telepathy-mission-control-5.16.4/0000755000175000017500000000000012762352250020021 5ustar00gkiagiagkiagia00000000000000telepathy-mission-control-5.16.4/tools/0000755000175000017500000000000012762352247021167 5ustar00gkiagiagkiagia00000000000000telepathy-mission-control-5.16.4/tools/doc-generator.xsl0000644000175000017500000012056712735242352024456 0ustar00gkiagiagkiagia00000000000000 . ERR: cannot find D-Bus interface, method, signal or property called ' ' ERR: Cannot use tp:member-ref when not in an <interface> ERR: interface has no signal/method/property called

Added in version .

Changed in version :

Changed in version

Deprecated since version .

Errors

Generic types

Simple types

Enumerated types:

Sets of flags:

Structure types

Mapping types

Types defined elsewhere

This interface is and is likely to cause havoc to your API/ABI if bindings are generated. Don't include it in libraries that care about compatibility.

Implementations of this interface must also implement:

Methods:

Interface has no methods.

Signals:

Interface has no signals.

Telepathy Properties:

Accessed using the Telepathy Properties interface.

Interface has no Telepathy properties.

D-Bus core Properties:

Accessed using the org.freedesktop.DBus.Properties interface.

Interface has no D-Bus core properties.

ERR: missing @name on a tp:flags type ERR: missing @type on tp:flags type

=
(Undocumented)
ERR: missing @name on a tp:enum type ERR: missing @type on tp:enum type

=
(Undocumented)
ERR: property does not have an interface as parent ERR: missing @name on a property of ERR: missing @type on property : ' '
, read-only write-only read/write ERR: unknown or missing value for @access on property : ' '

− a{ : }

In bindings that need a separate name, arrays of should be called .

Members

ERR: missing @name on a tp:simple-type ERR: missing @type on tp:simple-type

ERR: missing @name on a tp:external-type ERR: missing @type on tp:external-type
Defined by:
− ( , ) − a{ }

− ( : , )

In bindings that need a separate name, arrays of should be called .

Arrays of don't generally make sense.

Members

ERR: method does not have an interface as parent ERR: missing @name on a method of ERR: an arg of method has no type ERR: an 'in' arg of method has no name ERR: an arg of method has direction neither 'in' nor 'out'

( : , ) → , nothing

Parameters

Returns

Possible errors

( ) a{ } ERR: Unable to find type ' ' ERR: tp:type ' ' has D-Bus type ' ' but has been used with type=' ' ( )
(undocumented)
(generic description) (Undocumented.)
ERR: signal does not have an interface as parent ERR: missing @name on a signal of ERR: an arg of signal has no type ERR: an arg of signal has no name INFO: an arg of signal has unnecessary direction 'in' ERR: an arg of signal has direction other than 'in'

( : , )

Parameters

<xsl:value-of select="tp:title"/> <xsl:if test="tp:version"> <xsl:text> version </xsl:text> <xsl:value-of select="tp:version"/> </xsl:if>

Version

Interfaces

Index

Index of interfaces

Index of types

Stray text: {{{ }}} Unrecognised element: { }
telepathy-mission-control-5.16.4/tools/c-constants-generator.xsl0000644000175000017500000002552512735242352026143 0ustar00gkiagiagkiagia00000000000000 /** * : * * <![CDATA[ ]]> * * Bitfield/set of flags generated from the Telepathy specification. */ typedef enum { } ; * @ : <![CDATA[ ]]> * @ : <![CDATA[ ]]> s /** * : * * <![CDATA[ ]]> * * Bitfield/set of flags generated from the Telepathy specification. */ typedef enum { } ; /** * NUM_ : * * 1 higher than the highest valid value of # . */ #define NUM_ ( +1) Flag name != suffix = , Enumvalue name != suffix Enum values must be in ascending numeric order, but is less than the previous value = , tp:flag found outside tp:flags tp:enumvalue found outside tp:enum mixed-case-prefix param must be set /* Generated from , version */ #ifdef __cplusplus extern "C" { #endif #ifdef __cplusplus } #endif telepathy-mission-control-5.16.4/tools/spec-to-introspect.xsl0000644000175000017500000000145012735242352025454 0ustar00gkiagiagkiagia00000000000000 telepathy-mission-control-5.16.4/tools/glib-signals-marshal-gen.py0000644000175000017500000000254112735242352026305 0ustar00gkiagiagkiagia00000000000000#!/usr/bin/python import sys import xml.dom.minidom from string import ascii_letters, digits from libglibcodegen import signal_to_marshal_name, method_to_glue_marshal_name class Generator(object): def __init__(self, dom): self.dom = dom self.marshallers = {} def do_method(self, method): marshaller = method_to_glue_marshal_name(method, 'PREFIX') assert '__' in marshaller rhs = marshaller.split('__', 1)[1].split('_') self.marshallers[marshaller] = rhs def do_signal(self, signal): marshaller = signal_to_marshal_name(signal, 'PREFIX') assert '__' in marshaller rhs = marshaller.split('__', 1)[1].split('_') self.marshallers[marshaller] = rhs def __call__(self): methods = self.dom.getElementsByTagName('method') for method in methods: self.do_method(method) signals = self.dom.getElementsByTagName('signal') for signal in signals: self.do_signal(signal) all = self.marshallers.keys() all.sort() for marshaller in all: rhs = self.marshallers[marshaller] if not marshaller.startswith('g_cclosure'): print 'VOID:' + ','.join(rhs) if __name__ == '__main__': argv = sys.argv[1:] dom = xml.dom.minidom.parse(argv[0]) Generator(dom)() telepathy-mission-control-5.16.4/tools/glib-interfaces-body-generator.xsl0000644000175000017500000000360112735242352027667 0ustar00gkiagiagkiagia00000000000000 GQuark _iface_quark_ (void) { static GQuark quark = 0; if (G_UNLIKELY (quark == 0)) { quark = g_quark_from_static_string (" "); } return quark; } telepathy-mission-control-5.16.4/tools/libtpcodegen.py0000644000175000017500000001537012735242352024201 0ustar00gkiagiagkiagia00000000000000"""Library code for language-independent D-Bus-related code generation. The master copy of this library is in the telepathy-glib repository - please make any changes there. """ # Copyright (C) 2006-2008 Collabora Limited # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA import os from string import ascii_letters, digits NS_TP = "http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0" _ASCII_ALNUM = ascii_letters + digits def file_set_contents(filename, contents): try: os.remove(filename) except OSError: pass try: os.remove(filename + '.tmp') except OSError: pass open(filename + '.tmp', 'w').write(contents) os.rename(filename + '.tmp', filename) def cmp_by_name(node1, node2): return cmp(node1.getAttributeNode("name").nodeValue, node2.getAttributeNode("name").nodeValue) def escape_as_identifier(identifier): """Escape the given string to be a valid D-Bus object path or service name component, using a reversible encoding to ensure uniqueness. The reversible encoding is as follows: * The empty string becomes '_' * Otherwise, each non-alphanumeric character is replaced by '_' plus two lower-case hex digits; the same replacement is carried out on the first character, if it's a digit """ # '' -> '_' if not identifier: return '_' # A bit of a fast path for strings which are already OK. # We deliberately omit '_' because, for reversibility, that must also # be escaped. if (identifier.strip(_ASCII_ALNUM) == '' and identifier[0] in ascii_letters): return identifier # The first character may not be a digit if identifier[0] not in ascii_letters: ret = ['_%02x' % ord(identifier[0])] else: ret = [identifier[0]] # Subsequent characters may be digits or ASCII letters for c in identifier[1:]: if c in _ASCII_ALNUM: ret.append(c) else: ret.append('_%02x' % ord(c)) return ''.join(ret) def get_by_path(element, path): branches = path.split('/') branch = branches[0] # Is the current branch an attribute, if so, return the attribute value if branch[0] == '@': return element.getAttribute(branch[1:]) # Find matching children for the branch children = [] if branch == '..': children.append(element.parentNode) else: for x in element.childNodes: if x.localName == branch: children.append(x) ret = [] # If this is not the last path element, recursively gather results from # children if len(branches) > 1: for x in children: add = get_by_path(x, '/'.join(branches[1:])) if isinstance(add, list): ret += add else: return add else: ret = children return ret def get_docstring(element): docstring = None for x in element.childNodes: if x.namespaceURI == NS_TP and x.localName == 'docstring': docstring = x if docstring is not None: docstring = docstring.toxml().replace('\n', ' ').strip() if docstring.startswith(''): docstring = docstring[14:].lstrip() if docstring.endswith(''): docstring = docstring[:-15].rstrip() if docstring in ('', ''): docstring = '' return docstring def get_deprecated(element): text = [] for x in element.childNodes: if hasattr(x, 'data'): text.append(x.data.replace('\n', ' ').strip()) else: # This caters for tp:dbus-ref elements, but little else. if x.childNodes and hasattr(x.childNodes[0], 'data'): text.append(x.childNodes[0].data.replace('\n', ' ').strip()) return ' '.join(text) def get_descendant_text(element_or_elements): if not element_or_elements: return '' if isinstance(element_or_elements, list): return ''.join(map(get_descendant_text, element_or_elements)) parts = [] for x in element_or_elements.childNodes: if x.nodeType == x.TEXT_NODE: parts.append(x.nodeValue) elif x.nodeType == x.ELEMENT_NODE: parts.append(get_descendant_text(x)) else: pass return ''.join(parts) class _SignatureIter: """Iterator over a D-Bus signature. Copied from dbus-python 0.71 so we can run genginterface in a limited environment with only Python (like Scratchbox). """ def __init__(self, string): self.remaining = string def next(self): if self.remaining == '': raise StopIteration signature = self.remaining block_depth = 0 block_type = None end = len(signature) for marker in range(0, end): cur_sig = signature[marker] if cur_sig == 'a': pass elif cur_sig == '{' or cur_sig == '(': if block_type == None: block_type = cur_sig if block_type == cur_sig: block_depth = block_depth + 1 elif cur_sig == '}': if block_type == '{': block_depth = block_depth - 1 if block_depth == 0: end = marker break elif cur_sig == ')': if block_type == '(': block_depth = block_depth - 1 if block_depth == 0: end = marker break else: if block_depth == 0: end = marker break end = end + 1 self.remaining = signature[end:] return Signature(signature[0:end]) class Signature(str): """A string, iteration over which is by D-Bus single complete types rather than characters. """ def __iter__(self): return _SignatureIter(self) def xml_escape(s): s = s.replace('&', '&').replace("'", ''').replace('"', '"') return s.replace('<', '<').replace('>', '>') telepathy-mission-control-5.16.4/tools/gquark-gen.py0000644000175000017500000000757212735242352023610 0ustar00gkiagiagkiagia00000000000000#!/usr/bin/python # glib-client-gen.py: "I Can't Believe It's Not dbus-binding-tool" # # Generate GLib client wrappers from the Telepathy specification. # The master copy of this program is in the telepathy-glib repository - # please make any changes there. # # Copyright (C) 2006-2008 Collabora Ltd. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA import sys import os.path from getopt import gnu_getopt from libglibcodegen import Signature, type_to_gtype, cmp_by_name, get_docstring def camelcase_to_lower(s): out =""; out += s[0].lower() last_upper=False if s[0].isupper(): last_upper=True for i in range(1,len(s)): if s[i].isupper(): if last_upper: if (i+1) < len(s) and s[i+1].islower(): out += "_" + s[i].lower() else: out += s[i].lower() else: out += "_" + s[i].lower() last_upper=True else: out += s[i] last_upper=False return out NS_TP = "http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0" class Generator(object): def __init__(self, quark_list, prefix, basename, opts): self.__header = [] self.__body = [] self.prefix_lc = prefix.lower() self.prefix_uc = prefix.upper() self.basename = basename self.quark_prefix = opts.get('--quark-prefix', None) self.quark_list = [ l.split(None, 2) for l in quark_list ] def h(self, s): self.__header.append(s) def b(self, s): self.__body.append(s) def do_quark(self, quark): (qname, qstring) = quark self.b('GQuark') self.b('%s_%s (void)' % (self.prefix_lc, qname.lower())) self.b('{') self.b(' static GQuark quark = 0;') self.b('') self.b(' if (G_UNLIKELY (quark == 0))') self.b(' quark = g_quark_from_static_string ("%s");' % (qstring, )) self.b(' return quark;') self.b('}') self.b('') self.b('') self.h('#define %s_%s %s_%s()' % (self.prefix_uc, qname.upper(), self.prefix_lc, qname.lower())) self.h('GQuark %s_%s(void);' % (self.prefix_lc, qname.lower())) self.h('') def __call__(self): self.b('#include "%s.h"' % (self.basename)) self.b('') self.h('#include ') self.h('') self.h('G_BEGIN_DECLS') self.h('') for quark in self.quark_list: self.do_quark(quark) self.h('G_END_DECLS') self.h('') open(self.basename + '.h', 'w').write('\n'.join(self.__header)) open(self.basename + '.c', 'w').write('\n'.join(self.__body)) def types_to_gtypes(types): return [type_to_gtype(t)[1] for t in types] if __name__ == '__main__': options, argv = gnu_getopt(sys.argv[1:], '', ['quark-prefix=']) opts = {} for option, value in options: opts[option] = value quark_list_file = file(argv[0]) quark_list = quark_list_file.readlines() quark_list_file.close() Generator(quark_list, argv[1], argv[2], opts)() telepathy-mission-control-5.16.4/tools/identity.xsl0000644000175000017500000000033512735242352023544 0ustar00gkiagiagkiagia00000000000000 telepathy-mission-control-5.16.4/tools/glib-client-marshaller-gen.py0000644000175000017500000000277212735252346026640 0ustar00gkiagiagkiagia00000000000000#!/usr/bin/python import sys import xml.dom.minidom from string import ascii_letters, digits from libglibcodegen import signal_to_marshal_name NS_TP = "http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0" class Generator(object): def __init__(self, dom, prefix): self.dom = dom self.marshallers = {} self.prefix = prefix def do_signal(self, signal): marshaller = signal_to_marshal_name(signal, self.prefix) assert '__' in marshaller rhs = marshaller.split('__', 1)[1].split('_') self.marshallers[marshaller] = rhs def __call__(self): signals = self.dom.getElementsByTagName('signal') for signal in signals: self.do_signal(signal) print 'void' print '%s_register_dbus_glib_marshallers (void)' % self.prefix print '{' all = self.marshallers.keys() all.sort() for marshaller in all: rhs = self.marshallers[marshaller] print ' dbus_g_object_register_marshaller (' print ' g_cclosure_marshal_generic,' print ' G_TYPE_NONE, /* return */' for type in rhs: print ' G_TYPE_%s,' % type.replace('VOID', 'NONE') print ' G_TYPE_INVALID);' print '}' def types_to_gtypes(types): return [type_to_gtype(t)[1] for t in types] if __name__ == '__main__': argv = sys.argv[1:] dom = xml.dom.minidom.parse(argv[0]) Generator(dom, argv[1])() telepathy-mission-control-5.16.4/tools/glib-gtypes-generator.py0000644000175000017500000003071012735252346025753 0ustar00gkiagiagkiagia00000000000000#!/usr/bin/python # Generate GLib GInterfaces from the Telepathy specification. # The master copy of this program is in the telepathy-glib repository - # please make any changes there. # # Copyright (C) 2006, 2007 Collabora Limited # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA import sys import xml.dom.minidom from libtpcodegen import file_set_contents from libglibcodegen import escape_as_identifier, \ get_docstring, \ NS_TP, \ Signature, \ type_to_gtype, \ xml_escape def types_to_gtypes(types): return [type_to_gtype(t)[1] for t in types] class GTypesGenerator(object): def __init__(self, dom, output, mixed_case_prefix): self.dom = dom self.Prefix = mixed_case_prefix self.PREFIX_ = self.Prefix.upper() + '_' self.prefix_ = self.Prefix.lower() + '_' self.header = [] self.body = [] self.docs = [] self.output = output for f in (self.header, self.body, self.docs): f.append('/* Auto-generated, do not edit.\n *\n' ' * This file may be distributed under the same terms\n' ' * as the specification from which it was generated.\n' ' */\n\n') # keys are e.g. 'sv', values are the key escaped self.need_mappings = {} # keys are the contents of the struct (e.g. 'sssu'), values are the # key escaped self.need_structs = {} # keys are the contents of the struct (e.g. 'sssu'), values are the # key escaped self.need_struct_arrays = {} # keys are the contents of the array (unlike need_struct_arrays!), # values are the key escaped self.need_other_arrays = {} def h(self, code): self.header.append(code.encode("utf-8")) def c(self, code): self.body.append(code.encode("utf-8")) def d(self, code): self.docs.append(code.encode('utf-8')) def do_mapping_header(self, mapping): members = mapping.getElementsByTagNameNS(NS_TP, 'member') assert len(members) == 2 impl_sig = ''.join([elt.getAttribute('type') for elt in members]) esc_impl_sig = escape_as_identifier(impl_sig) name = (self.PREFIX_ + 'HASH_TYPE_' + mapping.getAttribute('name').upper()) impl = self.prefix_ + 'type_dbus_hash_' + esc_impl_sig docstring = get_docstring(mapping) or '(Undocumented)' self.d('/**\n * %s:\n *\n' % name.strip()) self.d(' * %s\n' % xml_escape(docstring)) self.d(' *\n') self.d(' * This macro expands to a call to a function\n') self.d(' * that returns the #GType of a #GHashTable\n') self.d(' * appropriate for representing a D-Bus\n') self.d(' * dictionary of signature\n') self.d(' * a{%s}.\n' % impl_sig) self.d(' *\n') key, value = members self.d(' * Keys (D-Bus type %s,\n' % key.getAttribute('type')) tp_type = key.getAttributeNS(NS_TP, 'type') if tp_type: self.d(' * type %s,\n' % tp_type) self.d(' * named %s):\n' % key.getAttribute('name')) docstring = get_docstring(key) or '(Undocumented)' self.d(' * %s\n' % xml_escape(docstring)) self.d(' *\n') self.d(' * Values (D-Bus type %s,\n' % value.getAttribute('type')) tp_type = value.getAttributeNS(NS_TP, 'type') if tp_type: self.d(' * type %s,\n' % tp_type) self.d(' * named %s):\n' % value.getAttribute('name')) docstring = get_docstring(value) or '(Undocumented)' self.d(' * %s\n' % xml_escape(docstring)) self.d(' *\n') self.d(' */\n') self.h('#define %s (%s ())\n\n' % (name, impl)) self.need_mappings[impl_sig] = esc_impl_sig array_name = mapping.getAttribute('array-name') if array_name: gtype_name = self.PREFIX_ + 'ARRAY_TYPE_' + array_name.upper() contents_sig = 'a{' + impl_sig + '}' esc_contents_sig = escape_as_identifier(contents_sig) impl = self.prefix_ + 'type_dbus_array_of_' + esc_contents_sig self.d('/**\n * %s:\n\n' % gtype_name) self.d(' * Expands to a call to a function\n') self.d(' * that returns the #GType of a #GPtrArray\n') self.d(' * of #%s.\n' % name) self.d(' */\n\n') self.h('#define %s (%s ())\n\n' % (gtype_name, impl)) self.need_other_arrays[contents_sig] = esc_contents_sig def do_struct_header(self, struct): members = struct.getElementsByTagNameNS(NS_TP, 'member') impl_sig = ''.join([elt.getAttribute('type') for elt in members]) esc_impl_sig = escape_as_identifier(impl_sig) name = (self.PREFIX_ + 'STRUCT_TYPE_' + struct.getAttribute('name').upper()) impl = self.prefix_ + 'type_dbus_struct_' + esc_impl_sig docstring = struct.getElementsByTagNameNS(NS_TP, 'docstring') if docstring: docstring = docstring[0].toprettyxml() if docstring.startswith(''): docstring = docstring[14:] if docstring.endswith('\n'): docstring = docstring[:-16] if docstring.strip() in ('', ''): docstring = '(Undocumented)' else: docstring = '(Undocumented)' self.d('/**\n * %s:\n\n' % name) self.d(' * %s\n' % xml_escape(docstring)) self.d(' *\n') self.d(' * This macro expands to a call to a function\n') self.d(' * that returns the #GType of a #GValueArray\n') self.d(' * appropriate for representing a D-Bus struct\n') self.d(' * with signature (%s).\n' % impl_sig) self.d(' *\n') for i, member in enumerate(members): self.d(' * Member %d (D-Bus type ' '%s,\n' % (i, member.getAttribute('type'))) tp_type = member.getAttributeNS(NS_TP, 'type') if tp_type: self.d(' * type %s,\n' % tp_type) self.d(' * named %s):\n' % member.getAttribute('name')) docstring = get_docstring(member) or '(Undocumented)' self.d(' * %s\n' % xml_escape(docstring)) self.d(' *\n') self.d(' */\n\n') self.h('#define %s (%s ())\n\n' % (name, impl)) array_name = struct.getAttribute('array-name') if array_name != '': array_name = (self.PREFIX_ + 'ARRAY_TYPE_' + array_name.upper()) impl = self.prefix_ + 'type_dbus_array_' + esc_impl_sig self.d('/**\n * %s:\n\n' % array_name) self.d(' * Expands to a call to a function\n') self.d(' * that returns the #GType of a #GPtrArray\n') self.d(' * of #%s.\n' % name) self.d(' */\n\n') self.h('#define %s (%s ())\n\n' % (array_name, impl)) self.need_struct_arrays[impl_sig] = esc_impl_sig self.need_structs[impl_sig] = esc_impl_sig def __call__(self): mappings = self.dom.getElementsByTagNameNS(NS_TP, 'mapping') structs = self.dom.getElementsByTagNameNS(NS_TP, 'struct') for mapping in mappings: self.do_mapping_header(mapping) for sig in self.need_mappings: self.h('GType %stype_dbus_hash_%s (void);\n\n' % (self.prefix_, self.need_mappings[sig])) self.c('GType\n%stype_dbus_hash_%s (void)\n{\n' % (self.prefix_, self.need_mappings[sig])) self.c(' static GType t = 0;\n\n') self.c(' if (G_UNLIKELY (t == 0))\n') # FIXME: translate sig into two GTypes items = tuple(Signature(sig)) gtypes = types_to_gtypes(items) self.c(' t = dbus_g_type_get_map ("GHashTable", ' '%s, %s);\n' % (gtypes[0], gtypes[1])) self.c(' return t;\n') self.c('}\n\n') for struct in structs: self.do_struct_header(struct) for sig in self.need_structs: self.h('GType %stype_dbus_struct_%s (void);\n\n' % (self.prefix_, self.need_structs[sig])) self.c('GType\n%stype_dbus_struct_%s (void)\n{\n' % (self.prefix_, self.need_structs[sig])) self.c(' static GType t = 0;\n\n') self.c(' if (G_UNLIKELY (t == 0))\n') self.c(' t = dbus_g_type_get_struct ("GValueArray",\n') items = tuple(Signature(sig)) gtypes = types_to_gtypes(items) for gtype in gtypes: self.c(' %s,\n' % gtype) self.c(' G_TYPE_INVALID);\n') self.c(' return t;\n') self.c('}\n\n') for sig in self.need_struct_arrays: self.h('GType %stype_dbus_array_%s (void);\n\n' % (self.prefix_, self.need_struct_arrays[sig])) self.c('GType\n%stype_dbus_array_%s (void)\n{\n' % (self.prefix_, self.need_struct_arrays[sig])) self.c(' static GType t = 0;\n\n') self.c(' if (G_UNLIKELY (t == 0))\n') self.c(' t = dbus_g_type_get_collection ("GPtrArray", ' '%stype_dbus_struct_%s ());\n' % (self.prefix_, self.need_struct_arrays[sig])) self.c(' return t;\n') self.c('}\n\n') for sig in self.need_other_arrays: self.h('GType %stype_dbus_array_of_%s (void);\n\n' % (self.prefix_, self.need_other_arrays[sig])) self.c('GType\n%stype_dbus_array_of_%s (void)\n{\n' % (self.prefix_, self.need_other_arrays[sig])) self.c(' static GType t = 0;\n\n') self.c(' if (G_UNLIKELY (t == 0))\n') if sig[:2] == 'a{' and sig[-1:] == '}': # array of mappings self.c(' t = dbus_g_type_get_collection (' '"GPtrArray", ' '%stype_dbus_hash_%s ());\n' % (self.prefix_, escape_as_identifier(sig[2:-1]))) elif sig[:2] == 'a(' and sig[-1:] == ')': # array of arrays of struct self.c(' t = dbus_g_type_get_collection (' '"GPtrArray", ' '%stype_dbus_array_%s ());\n' % (self.prefix_, escape_as_identifier(sig[2:-1]))) elif sig[:1] == 'a': # array of arrays of non-struct self.c(' t = dbus_g_type_get_collection (' '"GPtrArray", ' '%stype_dbus_array_of_%s ());\n' % (self.prefix_, escape_as_identifier(sig[1:]))) else: raise AssertionError("array of '%s' not supported" % sig) self.c(' return t;\n') self.c('}\n\n') file_set_contents(self.output + '.h', ''.join(self.header)) file_set_contents(self.output + '-body.h', ''.join(self.body)) file_set_contents(self.output + '-gtk-doc.h', ''.join(self.docs)) if __name__ == '__main__': argv = sys.argv[1:] dom = xml.dom.minidom.parse(argv[0]) GTypesGenerator(dom, argv[1], argv[2])() telepathy-mission-control-5.16.4/tools/glib-ginterface-gen.py0000644000175000017500000007411012735252346025334 0ustar00gkiagiagkiagia00000000000000#!/usr/bin/python # glib-ginterface-gen.py: service-side interface generator # # Generate dbus-glib 0.x service GInterfaces from the Telepathy specification. # The master copy of this program is in the telepathy-glib repository - # please make any changes there. # # Copyright (C) 2006, 2007 Collabora Limited # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA import sys import os.path import xml.dom.minidom from libtpcodegen import file_set_contents from libglibcodegen import Signature, type_to_gtype, cmp_by_name, \ NS_TP, dbus_gutils_wincaps_to_uscore NS_TP = "http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0" def get_emits_changed(node): try: return [ annotation.getAttribute('value') for annotation in node.getElementsByTagName('annotation') if annotation.getAttribute('name') == 'org.freedesktop.DBus.Property.EmitsChangedSignal' ][0] except IndexError: return None class Generator(object): def __init__(self, dom, prefix, basename, signal_marshal_prefix, headers, end_headers, not_implemented_func, allow_havoc): self.dom = dom self.__header = [] self.__body = [] self.__docs = [] assert prefix.endswith('_') assert not signal_marshal_prefix.endswith('_') # The main_prefix, sub_prefix thing is to get: # FOO_ -> (FOO_, _) # FOO_SVC_ -> (FOO_, _SVC_) # but # FOO_BAR/ -> (FOO_BAR_, _) # FOO_BAR/SVC_ -> (FOO_BAR_, _SVC_) if '/' in prefix: main_prefix, sub_prefix = prefix.upper().split('/', 1) prefix = prefix.replace('/', '_') else: main_prefix, sub_prefix = prefix.upper().split('_', 1) self.MAIN_PREFIX_ = main_prefix + '_' self._SUB_PREFIX_ = '_' + sub_prefix self.Prefix_ = prefix self.Prefix = prefix.replace('_', '') self.prefix_ = prefix.lower() self.PREFIX_ = prefix.upper() self.basename = basename self.signal_marshal_prefix = signal_marshal_prefix self.headers = headers self.end_headers = end_headers self.not_implemented_func = not_implemented_func self.allow_havoc = allow_havoc def h(self, s): if isinstance(s, unicode): s = s.encode('utf-8') self.__header.append(s) def b(self, s): if isinstance(s, unicode): s = s.encode('utf-8') self.__body.append(s) def d(self, s): if isinstance(s, unicode): s = s.encode('utf-8') self.__docs.append(s) def do_node(self, node): node_name = node.getAttribute('name').replace('/', '') node_name_mixed = self.node_name_mixed = node_name.replace('_', '') node_name_lc = self.node_name_lc = node_name.lower() node_name_uc = self.node_name_uc = node_name.upper() interfaces = node.getElementsByTagName('interface') assert len(interfaces) == 1, interfaces interface = interfaces[0] self.iface_name = interface.getAttribute('name') tmp = interface.getAttribute('tp:implement-service') if tmp == "no": return tmp = interface.getAttribute('tp:causes-havoc') if tmp and not self.allow_havoc: raise AssertionError('%s is %s' % (self.iface_name, tmp)) iface_emits_changed = get_emits_changed(interface) self.b('static const DBusGObjectInfo _%s%s_object_info;' % (self.prefix_, node_name_lc)) self.b('') methods = interface.getElementsByTagName('method') signals = interface.getElementsByTagName('signal') properties = interface.getElementsByTagName('property') # Don't put properties in dbus-glib glue glue_properties = [] self.b('struct _%s%sClass {' % (self.Prefix, node_name_mixed)) self.b(' GTypeInterface parent_class;') for method in methods: self.b(' %s %s;' % self.get_method_impl_names(method)) self.b('};') self.b('') if signals: self.b('enum {') for signal in signals: self.b(' %s,' % self.get_signal_const_entry(signal)) self.b(' N_%s_SIGNALS' % node_name_uc) self.b('};') self.b('static guint %s_signals[N_%s_SIGNALS] = {0};' % (node_name_lc, node_name_uc)) self.b('') self.b('static void %s%s_base_init (gpointer klass);' % (self.prefix_, node_name_lc)) self.b('') self.b('GType') self.b('%s%s_get_type (void)' % (self.prefix_, node_name_lc)) self.b('{') self.b(' static GType type = 0;') self.b('') self.b(' if (G_UNLIKELY (type == 0))') self.b(' {') self.b(' static const GTypeInfo info = {') self.b(' sizeof (%s%sClass),' % (self.Prefix, node_name_mixed)) self.b(' %s%s_base_init, /* base_init */' % (self.prefix_, node_name_lc)) self.b(' NULL, /* base_finalize */') self.b(' NULL, /* class_init */') self.b(' NULL, /* class_finalize */') self.b(' NULL, /* class_data */') self.b(' 0,') self.b(' 0, /* n_preallocs */') self.b(' NULL /* instance_init */') self.b(' };') self.b('') self.b(' type = g_type_register_static (G_TYPE_INTERFACE,') self.b(' "%s%s", &info, 0);' % (self.Prefix, node_name_mixed)) self.b(' }') self.b('') self.b(' return type;') self.b('}') self.b('') self.d('/**') self.d(' * %s%s:' % (self.Prefix, node_name_mixed)) self.d(' *') self.d(' * Dummy typedef representing any implementation of this ' 'interface.') self.d(' */') self.h('typedef struct _%s%s %s%s;' % (self.Prefix, node_name_mixed, self.Prefix, node_name_mixed)) self.h('') self.d('/**') self.d(' * %s%sClass:' % (self.Prefix, node_name_mixed)) self.d(' *') self.d(' * The class of %s%s.' % (self.Prefix, node_name_mixed)) if methods: self.d(' *') self.d(' * In a full implementation of this interface (i.e. all') self.d(' * methods implemented), the interface initialization') self.d(' * function used in G_IMPLEMENT_INTERFACE() would') self.d(' * typically look like this:') self.d(' *') self.d(' * ') self.d(' * static void') self.d(' * implement_%s (gpointer klass,' % self.node_name_lc) self.d(' * gpointer unused G_GNUC_UNUSED)') self.d(' * {') self.d(' * #define IMPLEMENT(x) %s%s_implement_##x (\\' % (self.prefix_, self.node_name_lc)) self.d(' * klass, my_object_##x)') for method in methods: class_member_name = method.getAttribute('tp:name-for-bindings') class_member_name = class_member_name.lower() self.d(' * IMPLEMENT (%s);' % class_member_name) self.d(' * #undef IMPLEMENT') self.d(' * }') self.d(' * ') else: self.d(' * This interface has no D-Bus methods, so an') self.d(' * implementation can typically pass %NULL to') self.d(' * G_IMPLEMENT_INTERFACE() as the interface') self.d(' * initialization function.') self.d(' */') self.d('') self.h('typedef struct _%s%sClass %s%sClass;' % (self.Prefix, node_name_mixed, self.Prefix, node_name_mixed)) self.h('') self.h('GType %s%s_get_type (void);' % (self.prefix_, node_name_lc)) gtype = self.current_gtype = \ self.MAIN_PREFIX_ + 'TYPE' + self._SUB_PREFIX_ + node_name_uc classname = self.Prefix + node_name_mixed self.h('#define %s \\\n (%s%s_get_type ())' % (gtype, self.prefix_, node_name_lc)) self.h('#define %s%s(obj) \\\n' ' (G_TYPE_CHECK_INSTANCE_CAST((obj), %s, %s))' % (self.PREFIX_, node_name_uc, gtype, classname)) self.h('#define %sIS%s%s(obj) \\\n' ' (G_TYPE_CHECK_INSTANCE_TYPE((obj), %s))' % (self.MAIN_PREFIX_, self._SUB_PREFIX_, node_name_uc, gtype)) self.h('#define %s%s_GET_CLASS(obj) \\\n' ' (G_TYPE_INSTANCE_GET_INTERFACE((obj), %s, %sClass))' % (self.PREFIX_, node_name_uc, gtype, classname)) self.h('') self.h('') base_init_code = [] for method in methods: self.do_method(method) for signal in signals: base_init_code.extend(self.do_signal(signal)) self.b('static inline void') self.b('%s%s_base_init_once (gpointer klass G_GNUC_UNUSED)' % (self.prefix_, node_name_lc)) self.b('{') if properties: self.b(' static TpDBusPropertiesMixinPropInfo properties[%d] = {' % (len(properties) + 1)) for m in properties: access = m.getAttribute('access') assert access in ('read', 'write', 'readwrite') if access == 'read': flags = 'TP_DBUS_PROPERTIES_MIXIN_FLAG_READ' elif access == 'write': flags = 'TP_DBUS_PROPERTIES_MIXIN_FLAG_WRITE' else: flags = ('TP_DBUS_PROPERTIES_MIXIN_FLAG_READ | ' 'TP_DBUS_PROPERTIES_MIXIN_FLAG_WRITE') prop_emits_changed = get_emits_changed(m) if prop_emits_changed is None: prop_emits_changed = iface_emits_changed if prop_emits_changed == 'true': flags += ' | TP_DBUS_PROPERTIES_MIXIN_FLAG_EMITS_CHANGED' elif prop_emits_changed == 'invalidates': flags += ' | TP_DBUS_PROPERTIES_MIXIN_FLAG_EMITS_INVALIDATED' self.b(' { 0, %s, "%s", 0, NULL, NULL }, /* %s */' % (flags, m.getAttribute('type'), m.getAttribute('name'))) self.b(' { 0, 0, NULL, 0, NULL, NULL }') self.b(' };') self.b(' static TpDBusPropertiesMixinIfaceInfo interface =') self.b(' { 0, properties, NULL, NULL };') self.b('') self.b(' dbus_g_object_type_install_info (%s%s_get_type (),' % (self.prefix_, node_name_lc)) self.b(' &_%s%s_object_info);' % (self.prefix_, node_name_lc)) self.b('') if properties: self.b(' interface.dbus_interface = g_quark_from_static_string ' '("%s");' % self.iface_name) for i, m in enumerate(properties): self.b(' properties[%d].name = g_quark_from_static_string ("%s");' % (i, m.getAttribute('name'))) self.b(' properties[%d].type = %s;' % (i, type_to_gtype(m.getAttribute('type'))[1])) self.b(' tp_svc_interface_set_dbus_properties_info (%s, &interface);' % self.current_gtype) self.b('') for s in base_init_code: self.b(s) self.b('}') self.b('static void') self.b('%s%s_base_init (gpointer klass)' % (self.prefix_, node_name_lc)) self.b('{') self.b(' static gboolean initialized = FALSE;') self.b('') self.b(' if (!initialized)') self.b(' {') self.b(' initialized = TRUE;') self.b(' %s%s_base_init_once (klass);' % (self.prefix_, node_name_lc)) self.b(' }') # insert anything we need to do per implementation here self.b('}') self.h('') self.b('static const DBusGMethodInfo _%s%s_methods[] = {' % (self.prefix_, node_name_lc)) method_blob, offsets = self.get_method_glue(methods) for method, offset in zip(methods, offsets): self.do_method_glue(method, offset) if len(methods) == 0: # empty arrays are a gcc extension, so put in a dummy member self.b(" { NULL, NULL, 0 }") self.b('};') self.b('') self.b('static const DBusGObjectInfo _%s%s_object_info = {' % (self.prefix_, node_name_lc)) self.b(' 0,') # version self.b(' _%s%s_methods,' % (self.prefix_, node_name_lc)) self.b(' %d,' % len(methods)) self.b('"' + method_blob.replace('\0', '\\0') + '",') self.b('"' + self.get_signal_glue(signals).replace('\0', '\\0') + '",') self.b('"' + self.get_property_glue(glue_properties).replace('\0', '\\0') + '",') self.b('};') self.b('') self.node_name_mixed = None self.node_name_lc = None self.node_name_uc = None def get_method_glue(self, methods): info = [] offsets = [] for method in methods: offsets.append(len(''.join(info))) info.append(self.iface_name + '\0') info.append(method.getAttribute('name') + '\0') info.append('A\0') # async counter = 0 for arg in method.getElementsByTagName('arg'): out = arg.getAttribute('direction') == 'out' name = arg.getAttribute('name') if not name: assert out name = 'arg%u' % counter counter += 1 info.append(name + '\0') if out: info.append('O\0') else: info.append('I\0') if out: info.append('F\0') # not const info.append('N\0') # not error or return info.append(arg.getAttribute('type') + '\0') info.append('\0') return ''.join(info) + '\0', offsets def do_method_glue(self, method, offset): lc_name = method.getAttribute('tp:name-for-bindings') if method.getAttribute('name') != lc_name.replace('_', ''): raise AssertionError('Method %s tp:name-for-bindings (%s) does ' 'not match' % (method.getAttribute('name'), lc_name)) lc_name = lc_name.lower() marshaller = 'g_cclosure_marshal_generic' wrapper = self.prefix_ + self.node_name_lc + '_' + lc_name self.b(" { (GCallback) %s, %s, %d }," % (wrapper, marshaller, offset)) def get_signal_glue(self, signals): info = [] for signal in signals: info.append(self.iface_name) info.append(signal.getAttribute('name')) return '\0'.join(info) + '\0\0' # the implementation can be the same get_property_glue = get_signal_glue def get_method_impl_names(self, method): dbus_method_name = method.getAttribute('name') class_member_name = method.getAttribute('tp:name-for-bindings') if dbus_method_name != class_member_name.replace('_', ''): raise AssertionError('Method %s tp:name-for-bindings (%s) does ' 'not match' % (dbus_method_name, class_member_name)) class_member_name = class_member_name.lower() stub_name = (self.prefix_ + self.node_name_lc + '_' + class_member_name) return (stub_name + '_impl', class_member_name + '_cb') def do_method(self, method): assert self.node_name_mixed is not None in_class = [] # Examples refer to Thing.DoStuff (su) -> ii # DoStuff dbus_method_name = method.getAttribute('name') # do_stuff class_member_name = method.getAttribute('tp:name-for-bindings') if dbus_method_name != class_member_name.replace('_', ''): raise AssertionError('Method %s tp:name-for-bindings (%s) does ' 'not match' % (dbus_method_name, class_member_name)) class_member_name = class_member_name.lower() # void tp_svc_thing_do_stuff (TpSvcThing *, const char *, guint, # DBusGMethodInvocation *); stub_name = (self.prefix_ + self.node_name_lc + '_' + class_member_name) # typedef void (*tp_svc_thing_do_stuff_impl) (TpSvcThing *, # const char *, guint, DBusGMethodInvocation); impl_name = stub_name + '_impl' # void tp_svc_thing_return_from_do_stuff (DBusGMethodInvocation *, # gint, gint); ret_name = (self.prefix_ + self.node_name_lc + '_return_from_' + class_member_name) # Gather arguments in_args = [] out_args = [] for i in method.getElementsByTagName('arg'): name = i.getAttribute('name') direction = i.getAttribute('direction') or 'in' dtype = i.getAttribute('type') assert direction in ('in', 'out') if name: name = direction + '_' + name elif direction == 'in': name = direction + str(len(in_args)) else: name = direction + str(len(out_args)) ctype, gtype, marshaller, pointer = type_to_gtype(dtype) if pointer: ctype = 'const ' + ctype struct = (ctype, name) if direction == 'in': in_args.append(struct) else: out_args.append(struct) # Implementation type declaration (in header, docs separated) self.d('/**') self.d(' * %s:' % impl_name) self.d(' * @self: The object implementing this interface') for (ctype, name) in in_args: self.d(' * @%s: %s (FIXME, generate documentation)' % (name, ctype)) self.d(' * @context: Used to return values or throw an error') self.d(' *') self.d(' * The signature of an implementation of the D-Bus method') self.d(' * %s on interface %s.' % (dbus_method_name, self.iface_name)) self.d(' */') self.h('typedef void (*%s) (%s%s *self,' % (impl_name, self.Prefix, self.node_name_mixed)) for (ctype, name) in in_args: self.h(' %s%s,' % (ctype, name)) self.h(' DBusGMethodInvocation *context);') # Class member (in class definition) in_class.append(' %s %s;' % (impl_name, class_member_name)) # Stub definition (in body only - it's static) self.b('static void') self.b('%s (%s%s *self,' % (stub_name, self.Prefix, self.node_name_mixed)) for (ctype, name) in in_args: self.b(' %s%s,' % (ctype, name)) self.b(' DBusGMethodInvocation *context)') self.b('{') self.b(' %s impl = (%s%s_GET_CLASS (self)->%s_cb);' % (impl_name, self.PREFIX_, self.node_name_uc, class_member_name)) self.b('') self.b(' if (impl != NULL)') tmp = ['self'] + [name for (ctype, name) in in_args] + ['context'] self.b(' {') self.b(' (impl) (%s);' % ',\n '.join(tmp)) self.b(' }') self.b(' else') self.b(' {') if self.not_implemented_func: self.b(' %s (context);' % self.not_implemented_func) else: self.b(' GError e = { DBUS_GERROR, ') self.b(' DBUS_GERROR_UNKNOWN_METHOD,') self.b(' "Method not implemented" };') self.b('') self.b(' dbus_g_method_return_error (context, &e);') self.b(' }') self.b('}') self.b('') # Implementation registration (in both header and body) self.h('void %s%s_implement_%s (%s%sClass *klass, %s impl);' % (self.prefix_, self.node_name_lc, class_member_name, self.Prefix, self.node_name_mixed, impl_name)) self.d('/**') self.d(' * %s%s_implement_%s:' % (self.prefix_, self.node_name_lc, class_member_name)) self.d(' * @klass: A class whose instances implement this interface') self.d(' * @impl: A callback used to implement the %s D-Bus method' % dbus_method_name) self.d(' *') self.d(' * Register an implementation for the %s method in the vtable' % dbus_method_name) self.d(' * of an implementation of this interface. To be called from') self.d(' * the interface init function.') self.d(' */') self.b('void') self.b('%s%s_implement_%s (%s%sClass *klass, %s impl)' % (self.prefix_, self.node_name_lc, class_member_name, self.Prefix, self.node_name_mixed, impl_name)) self.b('{') self.b(' klass->%s_cb = impl;' % class_member_name) self.b('}') self.b('') # Return convenience function (static inline, in header) self.d('/**') self.d(' * %s:' % ret_name) self.d(' * @context: The D-Bus method invocation context') for (ctype, name) in out_args: self.d(' * @%s: %s (FIXME, generate documentation)' % (name, ctype)) self.d(' *') self.d(' * Return successfully by calling dbus_g_method_return().') self.d(' * This inline function exists only to provide type-safety.') self.d(' */') self.d('') tmp = (['DBusGMethodInvocation *context'] + [ctype + name for (ctype, name) in out_args]) self.h('static inline') self.h('/* this comment is to stop gtkdoc realising this is static */') self.h(('void %s (' % ret_name) + (',\n '.join(tmp)) + ');') self.h('static inline void') self.h(('%s (' % ret_name) + (',\n '.join(tmp)) + ')') self.h('{') tmp = ['context'] + [name for (ctype, name) in out_args] self.h(' dbus_g_method_return (' + ',\n '.join(tmp) + ');') self.h('}') self.h('') return in_class def get_signal_const_entry(self, signal): assert self.node_name_uc is not None return ('SIGNAL_%s_%s' % (self.node_name_uc, signal.getAttribute('name'))) def do_signal(self, signal): assert self.node_name_mixed is not None in_base_init = [] # for signal: Thing::StuffHappened (s, u) # we want to emit: # void tp_svc_thing_emit_stuff_happened (gpointer instance, # const char *arg0, guint arg1); dbus_name = signal.getAttribute('name') ugly_name = signal.getAttribute('tp:name-for-bindings') if dbus_name != ugly_name.replace('_', ''): raise AssertionError('Signal %s tp:name-for-bindings (%s) does ' 'not match' % (dbus_name, ugly_name)) stub_name = (self.prefix_ + self.node_name_lc + '_emit_' + ugly_name.lower()) const_name = self.get_signal_const_entry(signal) # Gather arguments args = [] for i in signal.getElementsByTagName('arg'): name = i.getAttribute('name') dtype = i.getAttribute('type') tp_type = i.getAttribute('tp:type') if name: name = 'arg_' + name else: name = 'arg' + str(len(args)) ctype, gtype, marshaller, pointer = type_to_gtype(dtype) if pointer: ctype = 'const ' + ctype struct = (ctype, name, gtype) args.append(struct) tmp = (['gpointer instance'] + [ctype + name for (ctype, name, gtype) in args]) self.h(('void %s (' % stub_name) + (',\n '.join(tmp)) + ');') # FIXME: emit docs self.d('/**') self.d(' * %s:' % stub_name) self.d(' * @instance: The object implementing this interface') for (ctype, name, gtype) in args: self.d(' * @%s: %s (FIXME, generate documentation)' % (name, ctype)) self.d(' *') self.d(' * Type-safe wrapper around g_signal_emit to emit the') self.d(' * %s signal on interface %s.' % (dbus_name, self.iface_name)) self.d(' */') self.b('void') self.b(('%s (' % stub_name) + (',\n '.join(tmp)) + ')') self.b('{') self.b(' g_assert (instance != NULL);') self.b(' g_assert (G_TYPE_CHECK_INSTANCE_TYPE (instance, %s));' % (self.current_gtype)) tmp = (['instance', '%s_signals[%s]' % (self.node_name_lc, const_name), '0'] + [name for (ctype, name, gtype) in args]) self.b(' g_signal_emit (' + ',\n '.join(tmp) + ');') self.b('}') self.b('') signal_name = dbus_gutils_wincaps_to_uscore(dbus_name).replace('_', '-') self.d('/**') self.d(' * %s%s::%s:' % (self.Prefix, self.node_name_mixed, signal_name)) self.d(' * @self: an object') for (ctype, name, gtype) in args: self.d(' * @%s: %s (FIXME, generate documentation)' % (name, ctype)) self.d(' *') self.d(' * The %s D-Bus signal is emitted whenever ' 'this GObject signal is.' % dbus_name) self.d(' */') self.d('') in_base_init.append(' %s_signals[%s] =' % (self.node_name_lc, const_name)) in_base_init.append(' g_signal_new ("%s",' % signal_name) in_base_init.append(' G_OBJECT_CLASS_TYPE (klass),') in_base_init.append(' G_SIGNAL_RUN_LAST|G_SIGNAL_DETAILED,') in_base_init.append(' 0,') in_base_init.append(' NULL, NULL,') in_base_init.append(' g_cclosure_marshal_generic,') in_base_init.append(' G_TYPE_NONE,') tmp = ['%d' % len(args)] + [gtype for (ctype, name, gtype) in args] in_base_init.append(' %s);' % ',\n '.join(tmp)) in_base_init.append('') return in_base_init def have_properties(self, nodes): for node in nodes: interface = node.getElementsByTagName('interface')[0] if interface.getElementsByTagName('property'): return True return False def __call__(self): nodes = self.dom.getElementsByTagName('node') nodes.sort(cmp_by_name) self.h('#include ') self.h('#include ') for header in self.headers: self.h('#include %s' % header) self.h('') self.h('') self.h('G_BEGIN_DECLS') self.h('') self.b('#include "%s.h"' % self.basename) self.b('') for node in nodes: self.do_node(node) self.h('') self.h('G_END_DECLS') self.b('') for header in self.end_headers: self.b('#include %s' % header) self.h('') self.b('') file_set_contents(self.basename + '.h', '\n'.join(self.__header)) file_set_contents(self.basename + '.c', '\n'.join(self.__body)) file_set_contents(self.basename + '-gtk-doc.h', '\n'.join(self.__docs)) def cmdline_error(): print """\ usage: gen-ginterface [OPTIONS] xmlfile Prefix_ options: --include='' (may be repeated) --include='"header.h"' (ditto) --include-end='"header.h"' (ditto) Include extra headers in the generated .c file --signal-marshal-prefix='prefix' Use the given prefix on generated signal marshallers (default is prefix.lower()). --filename='BASENAME' Set the basename for the output files (default is prefix.lower() + 'ginterfaces') --not-implemented-func='symbol' Set action when methods not implemented in the interface vtable are called. symbol must have signature void symbol (DBusGMethodInvocation *context) and return some sort of "not implemented" error via dbus_g_method_return_error (context, ...) """ sys.exit(1) if __name__ == '__main__': from getopt import gnu_getopt options, argv = gnu_getopt(sys.argv[1:], '', ['filename=', 'signal-marshal-prefix=', 'include=', 'include-end=', 'allow-unstable', 'not-implemented-func=']) try: prefix = argv[1] except IndexError: cmdline_error() basename = prefix.lower() + 'ginterfaces' signal_marshal_prefix = prefix.lower().rstrip('_') headers = [] end_headers = [] not_implemented_func = '' allow_havoc = False for option, value in options: if option == '--filename': basename = value elif option == '--signal-marshal-prefix': signal_marshal_prefix = value elif option == '--include': if value[0] not in '<"': value = '"%s"' % value headers.append(value) elif option == '--include-end': if value[0] not in '<"': value = '"%s"' % value end_headers.append(value) elif option == '--not-implemented-func': not_implemented_func = value elif option == '--allow-unstable': allow_havoc = True try: dom = xml.dom.minidom.parse(argv[0]) except IndexError: cmdline_error() Generator(dom, prefix, basename, signal_marshal_prefix, headers, end_headers, not_implemented_func, allow_havoc)() telepathy-mission-control-5.16.4/tools/header-checks.am0000644000175000017500000000041112735241312024156 0ustar00gkiagiagkiagia00000000000000header-decl-macro-check: $(filter %.h,$(DIST_SOURCES)) @(for H in $^; \ do \ if [ x"$$(grep -l G_BEGIN_DECLS $$H)" != x"$$(grep -l G_END_DECLS $$H)" ]; \ then \ echo Unbalanced G_\*_DECL macros in $$H; \ exit 1; \ fi;\ done) telepathy-mission-control-5.16.4/tools/c-interfaces-generator.xsl0000644000175000017500000000605612735242352026250 0ustar00gkiagiagkiagia00000000000000 /** * _IFACE_ : * * The interface name " " */ #define _IFACE_ \ " " mixed-case-prefix param must be set /* Generated from: version */ telepathy-mission-control-5.16.4/tools/lcov.am0000644000175000017500000000145312735242352022447 0ustar00gkiagiagkiagia00000000000000lcov-reset: lcov --directory @top_srcdir@ --zerocounters lcov-report: lcov --directory @top_srcdir@ --capture \ --output-file @top_builddir@/lcov.info.tmp lcov --directory @top_srcdir@ --output-file @top_builddir@/lcov.info \ --remove @top_builddir@/lcov.info.tmp \ 'doc/reference/*/*-scan.c' rm @top_builddir@/lcov.info.tmp $(mkdir_p) @top_builddir@/lcov.html git_commit=`GIT_DIR=@top_srcdir@/.git git log -1 --pretty=format:%h 2>/dev/null`;\ genhtml --title "@PACKAGE_STRING@ $$git_commit" \ --output-directory @top_builddir@/lcov.html lcov.info @echo @echo 'lcov report can be found in:' @echo 'file://@abs_top_builddir@/lcov.html/index.html' @echo lcov-check: $(MAKE) lcov-reset $(MAKE) check sleep `expr $${MC_LINGER_TIME:-5}` sleep 1 $(MAKE) lcov-report ## vim:set ft=automake: telepathy-mission-control-5.16.4/tools/Makefile.am0000644000175000017500000000253612735242352023224 0ustar00gkiagiagkiagia00000000000000EXTRA_DIST = \ c-constants-generator.xsl \ c-interfaces-generator.xsl \ doc-generator.xsl \ glib-client-gen.py \ glib-blocking-client-gen.py \ glib-client-marshaller-gen.py \ glib-interfaces-generator.xsl \ glib-interfaces-body-generator.xsl \ glib-ginterface-gen.py \ glib-gtypes-generator.py \ glib-signals-marshal-gen.py \ gquark-gen.py \ identity.xsl \ lcov.am \ libtpcodegen.py \ libglibcodegen.py \ run_and_bt.gdb \ spec-to-introspect.xsl \ telepathy.am CLEANFILES = libglibcodegen.pyc libglibcodegen.pyo all: $(EXTRA_DIST) libglibcodegen.py: libtpcodegen.py $(AM_V_GEN)test -e ${srcdir}/$@ && touch ${srcdir}/$@ glib-client-marshaller-gen.py: libglibcodegen.py $(AM_V_GEN)test -e ${srcdir}/$@ && touch ${srcdir}/$@ glib-ginterface-gen.py: libglibcodegen.py $(AM_V_GEN)test -e ${srcdir}/$@ && touch ${srcdir}/$@ glib-gtypes-generator.py: libglibcodegen.py $(AM_V_GEN)test -e ${srcdir}/$@ && touch ${srcdir}/$@ glib-signals-marshal-gen.py: libglibcodegen.py $(AM_V_GEN)test -e ${srcdir}/$@ && touch ${srcdir}/$@ TELEPATHY_GLIB_SRCDIR = $(top_srcdir)/../telepathy-glib maintainer-update-from-telepathy-glib: set -e && cd $(srcdir) && \ for x in $(EXTRA_DIST); do \ if test -f $(TELEPATHY_GLIB_SRCDIR)/tools/$$x; then \ cp $(TELEPATHY_GLIB_SRCDIR)/tools/$$x $$x; \ fi; \ done telepathy-mission-control-5.16.4/tools/libglibcodegen.py0000644000175000017500000001456312735242352024476 0ustar00gkiagiagkiagia00000000000000"""Library code for GLib/D-Bus-related code generation. The master copy of this library is in the telepathy-glib repository - please make any changes there. """ # Copyright (C) 2006-2008 Collabora Limited # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA from libtpcodegen import NS_TP, \ Signature, \ cmp_by_name, \ escape_as_identifier, \ get_by_path, \ get_descendant_text, \ get_docstring, \ xml_escape, \ get_deprecated def dbus_gutils_wincaps_to_uscore(s): """Bug-for-bug compatible Python port of _dbus_gutils_wincaps_to_uscore which gets sequences of capital letters wrong in the same way. (e.g. in Telepathy, SendDTMF -> send_dt_mf) """ ret = '' for c in s: if c >= 'A' and c <= 'Z': length = len(ret) if length > 0 and (length < 2 or ret[length-2] != '_'): ret += '_' ret += c.lower() else: ret += c return ret def signal_to_marshal_type(signal): """ return a list of strings indicating the marshalling type for this signal. """ mtype=[] for i in signal.getElementsByTagName("arg"): name =i.getAttribute("name") type = i.getAttribute("type") mtype.append(type_to_gtype(type)[2]) return mtype _glib_marshallers = ['VOID', 'BOOLEAN', 'CHAR', 'UCHAR', 'INT', 'STRING', 'UINT', 'LONG', 'ULONG', 'ENUM', 'FLAGS', 'FLOAT', 'DOUBLE', 'STRING', 'PARAM', 'BOXED', 'POINTER', 'OBJECT', 'UINT_POINTER'] def signal_to_marshal_name(signal, prefix): mtype = signal_to_marshal_type(signal) if len(mtype): name = '_'.join(mtype) else: name = 'VOID' if name in _glib_marshallers: return 'g_cclosure_marshal_VOID__' + name else: return prefix + '_marshal_VOID__' + name def method_to_glue_marshal_name(method, prefix): mtype = [] for i in method.getElementsByTagName("arg"): if i.getAttribute("direction") != "out": type = i.getAttribute("type") mtype.append(type_to_gtype(type)[2]) mtype.append('POINTER') name = '_'.join(mtype) if name in _glib_marshallers: return 'g_cclosure_marshal_VOID__' + name else: return prefix + '_marshal_VOID__' + name def type_to_gtype(s): if s == 'y': #byte return ("guchar ", "G_TYPE_UCHAR","UCHAR", False) elif s == 'b': #boolean return ("gboolean ", "G_TYPE_BOOLEAN","BOOLEAN", False) elif s == 'n': #int16 return ("gint ", "G_TYPE_INT","INT", False) elif s == 'q': #uint16 return ("guint ", "G_TYPE_UINT","UINT", False) elif s == 'i': #int32 return ("gint ", "G_TYPE_INT","INT", False) elif s == 'u': #uint32 return ("guint ", "G_TYPE_UINT","UINT", False) elif s == 'x': #int64 return ("gint64 ", "G_TYPE_INT64","INT64", False) elif s == 't': #uint64 return ("guint64 ", "G_TYPE_UINT64","UINT64", False) elif s == 'd': #double return ("gdouble ", "G_TYPE_DOUBLE","DOUBLE", False) elif s == 's': #string return ("gchar *", "G_TYPE_STRING", "STRING", True) elif s == 'g': #signature - FIXME return ("gchar *", "DBUS_TYPE_G_SIGNATURE", "STRING", True) elif s == 'o': #object path return ("gchar *", "DBUS_TYPE_G_OBJECT_PATH", "BOXED", True) elif s == 'v': #variant return ("GValue *", "G_TYPE_VALUE", "BOXED", True) elif s == 'as': #array of strings return ("gchar **", "G_TYPE_STRV", "BOXED", True) elif s == 'ay': #byte array return ("GArray *", "dbus_g_type_get_collection (\"GArray\", G_TYPE_UCHAR)", "BOXED", True) elif s == 'au': #uint array return ("GArray *", "DBUS_TYPE_G_UINT_ARRAY", "BOXED", True) elif s == 'ai': #int array return ("GArray *", "DBUS_TYPE_G_INT_ARRAY", "BOXED", True) elif s == 'ax': #int64 array return ("GArray *", "DBUS_TYPE_G_INT64_ARRAY", "BOXED", True) elif s == 'at': #uint64 array return ("GArray *", "DBUS_TYPE_G_UINT64_ARRAY", "BOXED", True) elif s == 'ad': #double array return ("GArray *", "DBUS_TYPE_G_DOUBLE_ARRAY", "BOXED", True) elif s == 'ab': #boolean array return ("GArray *", "DBUS_TYPE_G_BOOLEAN_ARRAY", "BOXED", True) elif s == 'ao': #object path array return ("GPtrArray *", 'dbus_g_type_get_collection ("GPtrArray",' ' DBUS_TYPE_G_OBJECT_PATH)', "BOXED", True) elif s == 'a{ss}': #hash table of string to string return ("GHashTable *", "DBUS_TYPE_G_STRING_STRING_HASHTABLE", "BOXED", False) elif s[:2] == 'a{': #some arbitrary hash tables if s[2] not in ('y', 'b', 'n', 'q', 'i', 'u', 's', 'o', 'g'): raise Exception, "can't index a hashtable off non-basic type " + s first = type_to_gtype(s[2]) second = type_to_gtype(s[3:-1]) return ("GHashTable *", "(dbus_g_type_get_map (\"GHashTable\", " + first[1] + ", " + second[1] + "))", "BOXED", False) elif s[:2] in ('a(', 'aa'): # array of structs or arrays, recurse gtype = type_to_gtype(s[1:])[1] return ("GPtrArray *", "(dbus_g_type_get_collection (\"GPtrArray\", "+gtype+"))", "BOXED", True) elif s[:1] == '(': #struct gtype = "(dbus_g_type_get_struct (\"GValueArray\", " for subsig in Signature(s[1:-1]): gtype = gtype + type_to_gtype(subsig)[1] + ", " gtype = gtype + "G_TYPE_INVALID))" return ("GValueArray *", gtype, "BOXED", True) # we just don't know .. raise Exception, "don't know the GType for " + s telepathy-mission-control-5.16.4/tools/run_and_bt.gdb0000644000175000017500000000036012735241312023745 0ustar00gkiagiagkiagia00000000000000run echo ---- [bt full] -------------------------------------------\n bt full echo -----[thread apply all bt full] --------------------------\n thread apply all bt full echo ----------------------------------------------------------\n quit telepathy-mission-control-5.16.4/tools/glib-interfaces-generator.xsl0000644000175000017500000000437412735242352026744 0ustar00gkiagiagkiagia00000000000000 /** * _IFACE_QUARK_ : * * Expands to a call to a function that returns a quark for the interface name " " */ #define _IFACE_QUARK_ \ ( _iface_quark_ ()) GQuark _iface_quark_ (void); telepathy-mission-control-5.16.4/tools/telepathy.am0000644000175000017500000000472212735241312023500 0ustar00gkiagiagkiagia00000000000000## Useful top-level Makefile.am snippets for Telepathy projects. dist-hook: chmod u+w ${distdir}/ChangeLog if test -d ${top_srcdir}/.git; then \ ( cd ${top_srcdir} && git log --date=iso $(CHANGELOG_RANGE) ) > ${distdir}/ChangeLog; \ fi distcheck-hook: @test "z$(CHECK_FOR_UNRELEASED)" = z || \ case @VERSION@ in \ *.*.*.*|*+) ;; \ *) \ if grep -r UNRELEASED $(CHECK_FOR_UNRELEASED); \ then \ echo "^^^ This is meant to be a release, but some files say UNRELEASED" >&2; \ exit 2; \ fi \ ;; \ esac _is-release-check: @case @VERSION@ in \ (*.*.*.*|*+) \ echo "Hey! @VERSION@ is not a release!" >&2; \ exit 2; \ ;; \ esac @cd ${top_srcdir} && \ if ! git diff --no-ext-diff --quiet --exit-code; then \ echo "Hey! Your tree is dirty! No release for you." >&2; \ exit 2; \ fi @cd ${top_srcdir} && \ if ! git diff --cached --no-ext-diff --quiet --exit-code; then \ echo "Hey! You have changes staged! No release for you." >&2; \ exit 2; \ fi if ENABLE_GTK_DOC else @echo "Hey! You need to pass --enable-gtk-doc to configure!" @exit 2; endif %.tar.gz.asc: %.tar.gz $(AM_V_GEN)gpg --detach-sign --armor $@ @PACKAGE@-@VERSION@.tar.gz: $(MAKE) _is-release-check $(MAKE) check $(MAKE) distcheck maintainer-prepare-release: $(MAKE) _is-release-check $(MAKE) all $(MAKE) distcheck $(MAKE) release-mail git tag -s @PACKAGE@-@VERSION@ -m @PACKAGE@' '@VERSION@ gpg --detach-sign --armor @PACKAGE@-@VERSION@.tar.gz release-mail: NEWS $(AM_V_GEN)(python $(top_srcdir)/tools/make-release-mail.py \ @PACKAGE@ @VERSION@ $(top_srcdir)/NEWS > $@.tmp && \ mv $@.tmp $@) maintainer-upload-release: _maintainer-upload-release _maintainer-upload-release-check: _is-release-check test -f @PACKAGE@-@VERSION@.tar.gz test -f @PACKAGE@-@VERSION@.tar.gz.asc gpg --verify @PACKAGE@-@VERSION@.tar.gz.asc _maintainer-upload-release: _maintainer-upload-release-check rsync -vzP @PACKAGE@-@VERSION@.tar.gz telepathy.freedesktop.org:/srv/telepathy.freedesktop.org/www/releases/@PACKAGE@/@PACKAGE@-@VERSION@.tar.gz rsync -vzP @PACKAGE@-@VERSION@.tar.gz.asc telepathy.freedesktop.org:/srv/telepathy.freedesktop.org/www/releases/@PACKAGE@/@PACKAGE@-@VERSION@.tar.gz.asc maintainer-make-release: $(MAKE) maintainer-prepare-release $(MAKE) maintainer-upload-release @echo "Now:" @echo " • bump the nano-version;" @echo " • push the branch and tags upstream; and" @echo " • send release-mail to ." ## vim:set ft=automake: telepathy-mission-control-5.16.4/tools/glib-client-gen.py0000644000175000017500000013656112735242352024510 0ustar00gkiagiagkiagia00000000000000#!/usr/bin/python # glib-client-gen.py: "I Can't Believe It's Not dbus-binding-tool" # # Generate GLib client wrappers from the Telepathy specification. # The master copy of this program is in the telepathy-glib repository - # please make any changes there. # # Copyright (C) 2006-2008 Collabora Ltd. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA import sys import os.path import xml.dom.minidom from getopt import gnu_getopt from libtpcodegen import file_set_contents from libglibcodegen import Signature, type_to_gtype, cmp_by_name, \ get_docstring, xml_escape, get_deprecated NS_TP = "http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0" class Generator(object): def __init__(self, dom, prefix, basename, opts): self.dom = dom self.__header = [] self.__body = [] self.__docs = [] self.prefix_lc = prefix.lower() self.prefix_uc = prefix.upper() self.prefix_mc = prefix.replace('_', '') self.basename = basename self.group = opts.get('--group', None) self.iface_quark_prefix = opts.get('--iface-quark-prefix', None) self.tp_proxy_api = tuple(map(int, opts.get('--tp-proxy-api', '0').split('.'))) self.proxy_cls = opts.get('--subclass', 'TpProxy') + ' *' self.proxy_arg = opts.get('--subclass', 'void') + ' *' self.proxy_assert = opts.get('--subclass-assert', 'TP_IS_PROXY') self.proxy_doc = ('A #%s or subclass' % opts.get('--subclass', 'TpProxy')) if self.proxy_arg == 'void *': self.proxy_arg = 'gpointer ' self.reentrant_symbols = set() try: filename = opts['--generate-reentrant'] with open(filename, 'r') as f: for line in f.readlines(): self.reentrant_symbols.add(line.strip()) except KeyError: pass self.deprecate_reentrant = opts.get('--deprecate-reentrant', None) self.deprecation_attribute = opts.get('--deprecation-attribute', 'G_GNUC_DEPRECATED') self.guard = opts.get('--guard', None) def h(self, s): if isinstance(s, unicode): s = s.encode('utf-8') self.__header.append(s) def b(self, s): if isinstance(s, unicode): s = s.encode('utf-8') self.__body.append(s) def d(self, s): if isinstance(s, unicode): s = s.encode('utf-8') self.__docs.append(s) def get_iface_quark(self): assert self.iface_dbus is not None assert self.iface_uc is not None if self.iface_quark_prefix is None: return 'g_quark_from_static_string (\"%s\")' % self.iface_dbus else: return '%s_%s' % (self.iface_quark_prefix, self.iface_uc) def do_signal(self, iface, signal): iface_lc = iface.lower() member = signal.getAttribute('name') member_lc = signal.getAttribute('tp:name-for-bindings') if member != member_lc.replace('_', ''): raise AssertionError('Signal %s tp:name-for-bindings (%s) does ' 'not match' % (member, member_lc)) member_lc = member_lc.lower() member_uc = member_lc.upper() arg_count = 0 args = [] out_args = [] for arg in signal.getElementsByTagName('arg'): name = arg.getAttribute('name') type = arg.getAttribute('type') tp_type = arg.getAttribute('tp:type') if not name: name = 'arg%u' % arg_count arg_count += 1 else: name = 'arg_%s' % name info = type_to_gtype(type) args.append((name, info, tp_type, arg)) callback_name = ('%s_%s_signal_callback_%s' % (self.prefix_lc, iface_lc, member_lc)) collect_name = ('_%s_%s_collect_args_of_%s' % (self.prefix_lc, iface_lc, member_lc)) invoke_name = ('_%s_%s_invoke_callback_for_%s' % (self.prefix_lc, iface_lc, member_lc)) # Example: # # typedef void (*tp_cli_connection_signal_callback_new_channel) # (TpConnection *proxy, const gchar *arg_object_path, # const gchar *arg_channel_type, guint arg_handle_type, # guint arg_handle, gboolean arg_suppress_handler, # gpointer user_data, GObject *weak_object); self.d('/**') self.d(' * %s:' % callback_name) self.d(' * @proxy: The proxy on which %s_%s_connect_to_%s ()' % (self.prefix_lc, iface_lc, member_lc)) self.d(' * was called') for arg in args: name, info, tp_type, elt = arg ctype, gtype, marshaller, pointer = info docs = get_docstring(elt) or '(Undocumented)' if ctype == 'guint ' and tp_type != '': docs += ' (#%s)' % ('Tp' + tp_type.replace('_', '')) self.d(' * @%s: %s' % (name, xml_escape(docs))) self.d(' * @user_data: User-supplied data') self.d(' * @weak_object: User-supplied weakly referenced object') self.d(' *') self.d(' * Represents the signature of a callback for the signal %s.' % member) self.d(' */') self.d('') self.h('typedef void (*%s) (%sproxy,' % (callback_name, self.proxy_cls)) for arg in args: name, info, tp_type, elt = arg ctype, gtype, marshaller, pointer = info const = pointer and 'const ' or '' self.h(' %s%s%s,' % (const, ctype, name)) self.h(' gpointer user_data, GObject *weak_object);') if args: self.b('static void') self.b('%s (DBusGProxy *proxy G_GNUC_UNUSED,' % collect_name) for arg in args: name, info, tp_type, elt = arg ctype, gtype, marshaller, pointer = info const = pointer and 'const ' or '' self.b(' %s%s%s,' % (const, ctype, name)) self.b(' TpProxySignalConnection *sc)') self.b('{') self.b(' GValueArray *args = g_value_array_new (%d);' % len(args)) self.b(' GValue blank = { 0 };') self.b(' guint i;') self.b('') self.b(' g_value_init (&blank, G_TYPE_INT);') self.b('') self.b(' for (i = 0; i < %d; i++)' % len(args)) self.b(' g_value_array_append (args, &blank);') self.b('') for i, arg in enumerate(args): name, info, tp_type, elt = arg ctype, gtype, marshaller, pointer = info self.b(' g_value_unset (args->values + %d);' % i) self.b(' g_value_init (args->values + %d, %s);' % (i, gtype)) if gtype == 'G_TYPE_STRING': self.b(' g_value_set_string (args->values + %d, %s);' % (i, name)) elif marshaller == 'BOXED': self.b(' g_value_set_boxed (args->values + %d, %s);' % (i, name)) elif gtype == 'G_TYPE_UCHAR': self.b(' g_value_set_uchar (args->values + %d, %s);' % (i, name)) elif gtype == 'G_TYPE_BOOLEAN': self.b(' g_value_set_boolean (args->values + %d, %s);' % (i, name)) elif gtype == 'G_TYPE_INT': self.b(' g_value_set_int (args->values + %d, %s);' % (i, name)) elif gtype == 'G_TYPE_UINT': self.b(' g_value_set_uint (args->values + %d, %s);' % (i, name)) elif gtype == 'G_TYPE_INT64': self.b(' g_value_set_int (args->values + %d, %s);' % (i, name)) elif gtype == 'G_TYPE_UINT64': self.b(' g_value_set_uint64 (args->values + %d, %s);' % (i, name)) elif gtype == 'G_TYPE_DOUBLE': self.b(' g_value_set_double (args->values + %d, %s);' % (i, name)) else: assert False, ("Don't know how to put %s in a GValue" % gtype) self.b('') self.b(' tp_proxy_signal_connection_v0_take_results (sc, args);') self.b('}') self.b('static void') self.b('%s (TpProxy *tpproxy,' % invoke_name) self.b(' GError *error G_GNUC_UNUSED,') self.b(' GValueArray *args,') self.b(' GCallback generic_callback,') self.b(' gpointer user_data,') self.b(' GObject *weak_object)') self.b('{') self.b(' %s callback =' % callback_name) self.b(' (%s) generic_callback;' % callback_name) self.b('') self.b(' if (callback != NULL)') self.b(' callback (g_object_ref (tpproxy),') # FIXME: factor out into a function for i, arg in enumerate(args): name, info, tp_type, elt = arg ctype, gtype, marshaller, pointer = info if marshaller == 'BOXED': self.b(' g_value_get_boxed (args->values + %d),' % i) elif gtype == 'G_TYPE_STRING': self.b(' g_value_get_string (args->values + %d),' % i) elif gtype == 'G_TYPE_UCHAR': self.b(' g_value_get_uchar (args->values + %d),' % i) elif gtype == 'G_TYPE_BOOLEAN': self.b(' g_value_get_boolean (args->values + %d),' % i) elif gtype == 'G_TYPE_UINT': self.b(' g_value_get_uint (args->values + %d),' % i) elif gtype == 'G_TYPE_INT': self.b(' g_value_get_int (args->values + %d),' % i) elif gtype == 'G_TYPE_UINT64': self.b(' g_value_get_uint64 (args->values + %d),' % i) elif gtype == 'G_TYPE_INT64': self.b(' g_value_get_int64 (args->values + %d),' % i) elif gtype == 'G_TYPE_DOUBLE': self.b(' g_value_get_double (args->values + %d),' % i) else: assert False, "Don't know how to get %s from a GValue" % gtype self.b(' user_data,') self.b(' weak_object);') self.b('') if len(args) > 0: self.b(' g_value_array_free (args);') else: self.b(' if (args != NULL)') self.b(' g_value_array_free (args);') self.b('') self.b(' g_object_unref (tpproxy);') self.b('}') # Example: # # TpProxySignalConnection * # tp_cli_connection_connect_to_new_channel # (TpConnection *proxy, # tp_cli_connection_signal_callback_new_channel callback, # gpointer user_data, # GDestroyNotify destroy); # # destroy is invoked when the signal becomes disconnected. This # is either because the signal has been disconnected explicitly # by the user, because the TpProxy has become invalid and # emitted the 'invalidated' signal, or because the weakly referenced # object has gone away. self.d('/**') self.d(' * %s_%s_connect_to_%s:' % (self.prefix_lc, iface_lc, member_lc)) self.d(' * @proxy: %s' % self.proxy_doc) self.d(' * @callback: Callback to be called when the signal is') self.d(' * received') self.d(' * @user_data: User-supplied data for the callback') self.d(' * @destroy: Destructor for the user-supplied data, which') self.d(' * will be called when this signal is disconnected, or') self.d(' * before this function returns %NULL') self.d(' * @weak_object: A #GObject which will be weakly referenced; ') self.d(' * if it is destroyed, this callback will automatically be') self.d(' * disconnected') self.d(' * @error: If not %NULL, used to raise an error if %NULL is') self.d(' * returned') self.d(' *') self.d(' * Connect a handler to the signal %s.' % member) self.d(' *') self.d(' * %s' % xml_escape(get_docstring(signal) or '(Undocumented)')) self.d(' *') self.d(' * Returns: a #TpProxySignalConnection containing all of the') self.d(' * above, which can be used to disconnect the signal; or') self.d(' * %NULL if the proxy does not have the desired interface') self.d(' * or has become invalid.') self.d(' */') self.d('') self.h('TpProxySignalConnection *%s_%s_connect_to_%s (%sproxy,' % (self.prefix_lc, iface_lc, member_lc, self.proxy_arg)) self.h(' %s callback,' % callback_name) self.h(' gpointer user_data,') self.h(' GDestroyNotify destroy,') self.h(' GObject *weak_object,') self.h(' GError **error);') self.h('') self.b('TpProxySignalConnection *') self.b('%s_%s_connect_to_%s (%sproxy,' % (self.prefix_lc, iface_lc, member_lc, self.proxy_arg)) self.b(' %s callback,' % callback_name) self.b(' gpointer user_data,') self.b(' GDestroyNotify destroy,') self.b(' GObject *weak_object,') self.b(' GError **error)') self.b('{') self.b(' GType expected_types[%d] = {' % (len(args) + 1)) for arg in args: name, info, tp_type, elt = arg ctype, gtype, marshaller, pointer = info self.b(' %s,' % gtype) self.b(' G_TYPE_INVALID };') self.b('') self.b(' g_return_val_if_fail (%s (proxy), NULL);' % self.proxy_assert) self.b(' g_return_val_if_fail (callback != NULL, NULL);') self.b('') self.b(' return tp_proxy_signal_connection_v0_new ((TpProxy *) proxy,') self.b(' %s, \"%s\",' % (self.get_iface_quark(), member)) self.b(' expected_types,') if args: self.b(' G_CALLBACK (%s),' % collect_name) else: self.b(' NULL, /* no args => no collector function */') self.b(' %s,' % invoke_name) self.b(' G_CALLBACK (callback), user_data, destroy,') self.b(' weak_object, error);') self.b('}') self.b('') def do_method(self, iface, method): iface_lc = iface.lower() member = method.getAttribute('name') member_lc = method.getAttribute('tp:name-for-bindings') if member != member_lc.replace('_', ''): raise AssertionError('Method %s tp:name-for-bindings (%s) does ' 'not match' % (member, member_lc)) member_lc = member_lc.lower() member_uc = member_lc.upper() in_count = 0 ret_count = 0 in_args = [] out_args = [] for arg in method.getElementsByTagName('arg'): name = arg.getAttribute('name') direction = arg.getAttribute('direction') type = arg.getAttribute('type') tp_type = arg.getAttribute('tp:type') if direction != 'out': if not name: name = 'in%u' % in_count in_count += 1 else: name = 'in_%s' % name else: if not name: name = 'out%u' % ret_count ret_count += 1 else: name = 'out_%s' % name info = type_to_gtype(type) if direction != 'out': in_args.append((name, info, tp_type, arg)) else: out_args.append((name, info, tp_type, arg)) # Async reply callback type # Example: # void (*tp_cli_properties_interface_callback_for_get_properties) # (TpProxy *proxy, # const GPtrArray *out0, # const GError *error, # gpointer user_data, # GObject *weak_object); self.d('/**') self.d(' * %s_%s_callback_for_%s:' % (self.prefix_lc, iface_lc, member_lc)) self.d(' * @proxy: the proxy on which the call was made') for arg in out_args: name, info, tp_type, elt = arg ctype, gtype, marshaller, pointer = info docs = xml_escape(get_docstring(elt) or '(Undocumented)') if ctype == 'guint ' and tp_type != '': docs += ' (#%s)' % ('Tp' + tp_type.replace('_', '')) self.d(' * @%s: Used to return an \'out\' argument if @error is ' '%%NULL: %s' % (name, docs)) self.d(' * @error: %NULL on success, or an error on failure') self.d(' * @user_data: user-supplied data') self.d(' * @weak_object: user-supplied object') self.d(' *') self.d(' * Signature of the callback called when a %s method call' % member) self.d(' * succeeds or fails.') deprecated = method.getElementsByTagName('tp:deprecated') if deprecated: d = deprecated[0] self.d(' *') self.d(' * Deprecated: %s' % xml_escape(get_deprecated(d))) self.d(' */') self.d('') callback_name = '%s_%s_callback_for_%s' % (self.prefix_lc, iface_lc, member_lc) self.h('typedef void (*%s) (%sproxy,' % (callback_name, self.proxy_cls)) for arg in out_args: name, info, tp_type, elt = arg ctype, gtype, marshaller, pointer = info const = pointer and 'const ' or '' self.h(' %s%s%s,' % (const, ctype, name)) self.h(' const GError *error, gpointer user_data,') self.h(' GObject *weak_object);') self.h('') # Async callback implementation invoke_callback = '_%s_%s_invoke_callback_%s' % (self.prefix_lc, iface_lc, member_lc) collect_callback = '_%s_%s_collect_callback_%s' % (self.prefix_lc, iface_lc, member_lc) # The callback called by dbus-glib; this ends the call and collects # the results into a GValueArray. self.b('static void') self.b('%s (DBusGProxy *proxy,' % collect_callback) self.b(' DBusGProxyCall *call,') self.b(' gpointer user_data)') self.b('{') self.b(' GError *error = NULL;') if len(out_args) > 0: self.b(' GValueArray *args;') self.b(' GValue blank = { 0 };') self.b(' guint i;') for arg in out_args: name, info, tp_type, elt = arg ctype, gtype, marshaller, pointer = info # "We handle variants specially; the caller is expected to # have already allocated storage for them". Thanks, # dbus-glib... if gtype == 'G_TYPE_VALUE': self.b(' GValue *%s = g_new0 (GValue, 1);' % name) else: self.b(' %s%s;' % (ctype, name)) self.b('') self.b(' dbus_g_proxy_end_call (proxy, call, &error,') for arg in out_args: name, info, tp_type, elt = arg ctype, gtype, marshaller, pointer = info if gtype == 'G_TYPE_VALUE': self.b(' %s, %s,' % (gtype, name)) else: self.b(' %s, &%s,' % (gtype, name)) self.b(' G_TYPE_INVALID);') if len(out_args) == 0: self.b(' tp_proxy_pending_call_v0_take_results (user_data, error,' 'NULL);') else: self.b('') self.b(' if (error != NULL)') self.b(' {') self.b(' tp_proxy_pending_call_v0_take_results (user_data, error,') self.b(' NULL);') for arg in out_args: name, info, tp_type, elt = arg ctype, gtype, marshaller, pointer = info if gtype == 'G_TYPE_VALUE': self.b(' g_free (%s);' % name) self.b(' return;') self.b(' }') self.b('') self.b(' args = g_value_array_new (%d);' % len(out_args)) self.b(' g_value_init (&blank, G_TYPE_INT);') self.b('') self.b(' for (i = 0; i < %d; i++)' % len(out_args)) self.b(' g_value_array_append (args, &blank);') for i, arg in enumerate(out_args): name, info, tp_type, elt = arg ctype, gtype, marshaller, pointer = info self.b('') self.b(' g_value_unset (args->values + %d);' % i) self.b(' g_value_init (args->values + %d, %s);' % (i, gtype)) if gtype == 'G_TYPE_STRING': self.b(' g_value_take_string (args->values + %d, %s);' % (i, name)) elif marshaller == 'BOXED': self.b(' g_value_take_boxed (args->values + %d, %s);' % (i, name)) elif gtype == 'G_TYPE_UCHAR': self.b(' g_value_set_uchar (args->values + %d, %s);' % (i, name)) elif gtype == 'G_TYPE_BOOLEAN': self.b(' g_value_set_boolean (args->values + %d, %s);' % (i, name)) elif gtype == 'G_TYPE_INT': self.b(' g_value_set_int (args->values + %d, %s);' % (i, name)) elif gtype == 'G_TYPE_UINT': self.b(' g_value_set_uint (args->values + %d, %s);' % (i, name)) elif gtype == 'G_TYPE_INT64': self.b(' g_value_set_int (args->values + %d, %s);' % (i, name)) elif gtype == 'G_TYPE_UINT64': self.b(' g_value_set_uint (args->values + %d, %s);' % (i, name)) elif gtype == 'G_TYPE_DOUBLE': self.b(' g_value_set_double (args->values + %d, %s);' % (i, name)) else: assert False, ("Don't know how to put %s in a GValue" % gtype) self.b(' tp_proxy_pending_call_v0_take_results (user_data, ' 'NULL, args);') self.b('}') self.b('static void') self.b('%s (TpProxy *self,' % invoke_callback) self.b(' GError *error,') self.b(' GValueArray *args,') self.b(' GCallback generic_callback,') self.b(' gpointer user_data,') self.b(' GObject *weak_object)') self.b('{') self.b(' %s callback = (%s) generic_callback;' % (callback_name, callback_name)) self.b('') self.b(' if (error != NULL)') self.b(' {') self.b(' callback ((%s) self,' % self.proxy_cls) for arg in out_args: name, info, tp_type, elt = arg ctype, gtype, marshaller, pointer = info if marshaller == 'BOXED' or pointer: self.b(' NULL,') elif gtype == 'G_TYPE_DOUBLE': self.b(' 0.0,') else: self.b(' 0,') self.b(' error, user_data, weak_object);') self.b(' g_error_free (error);') self.b(' return;') self.b(' }') self.b(' callback ((%s) self,' % self.proxy_cls) # FIXME: factor out into a function for i, arg in enumerate(out_args): name, info, tp_type, elt = arg ctype, gtype, marshaller, pointer = info if marshaller == 'BOXED': self.b(' g_value_get_boxed (args->values + %d),' % i) elif gtype == 'G_TYPE_STRING': self.b(' g_value_get_string (args->values + %d),' % i) elif gtype == 'G_TYPE_UCHAR': self.b(' g_value_get_uchar (args->values + %d),' % i) elif gtype == 'G_TYPE_BOOLEAN': self.b(' g_value_get_boolean (args->values + %d),' % i) elif gtype == 'G_TYPE_UINT': self.b(' g_value_get_uint (args->values + %d),' % i) elif gtype == 'G_TYPE_INT': self.b(' g_value_get_int (args->values + %d),' % i) elif gtype == 'G_TYPE_UINT64': self.b(' g_value_get_uint64 (args->values + %d),' % i) elif gtype == 'G_TYPE_INT64': self.b(' g_value_get_int64 (args->values + %d),' % i) elif gtype == 'G_TYPE_DOUBLE': self.b(' g_value_get_double (args->values + %d),' % i) else: assert False, "Don't know how to get %s from a GValue" % gtype self.b(' error, user_data, weak_object);') self.b('') if len(out_args) > 0: self.b(' g_value_array_free (args);') else: self.b(' if (args != NULL)') self.b(' g_value_array_free (args);') self.b('}') self.b('') # Async stub # Example: # TpProxyPendingCall * # tp_cli_properties_interface_call_get_properties # (gpointer proxy, # gint timeout_ms, # const GArray *in_properties, # tp_cli_properties_interface_callback_for_get_properties callback, # gpointer user_data, # GDestroyNotify *destructor); self.h('TpProxyPendingCall *%s_%s_call_%s (%sproxy,' % (self.prefix_lc, iface_lc, member_lc, self.proxy_arg)) self.h(' gint timeout_ms,') self.d('/**') self.d(' * %s_%s_call_%s:' % (self.prefix_lc, iface_lc, member_lc)) self.d(' * @proxy: the #TpProxy') self.d(' * @timeout_ms: the timeout in milliseconds, or -1 to use the') self.d(' * default') for arg in in_args: name, info, tp_type, elt = arg ctype, gtype, marshaller, pointer = info docs = xml_escape(get_docstring(elt) or '(Undocumented)') if ctype == 'guint ' and tp_type != '': docs += ' (#%s)' % ('Tp' + tp_type.replace('_', '')) self.d(' * @%s: Used to pass an \'in\' argument: %s' % (name, docs)) self.d(' * @callback: called when the method call succeeds or fails;') self.d(' * may be %NULL to make a "fire and forget" call with no ') self.d(' * reply tracking') self.d(' * @user_data: user-supplied data passed to the callback;') self.d(' * must be %NULL if @callback is %NULL') self.d(' * @destroy: called with the user_data as argument, after the') self.d(' * call has succeeded, failed or been cancelled;') self.d(' * must be %NULL if @callback is %NULL') self.d(' * @weak_object: If not %NULL, a #GObject which will be ') self.d(' * weakly referenced; if it is destroyed, this call ') self.d(' * will automatically be cancelled. Must be %NULL if ') self.d(' * @callback is %NULL') self.d(' *') self.d(' * Start a %s method call.' % member) self.d(' *') self.d(' * %s' % xml_escape(get_docstring(method) or '(Undocumented)')) self.d(' *') self.d(' * Returns: a #TpProxyPendingCall representing the call in') self.d(' * progress. It is borrowed from the object, and will become') self.d(' * invalid when the callback is called, the call is') self.d(' * cancelled or the #TpProxy becomes invalid.') deprecated = method.getElementsByTagName('tp:deprecated') if deprecated: d = deprecated[0] self.d(' *') self.d(' * Deprecated: %s' % xml_escape(get_deprecated(d))) self.d(' */') self.d('') self.b('TpProxyPendingCall *\n%s_%s_call_%s (%sproxy,' % (self.prefix_lc, iface_lc, member_lc, self.proxy_arg)) self.b(' gint timeout_ms,') for arg in in_args: name, info, tp_type, elt = arg ctype, gtype, marshaller, pointer = info const = pointer and 'const ' or '' self.h(' %s%s%s,' % (const, ctype, name)) self.b(' %s%s%s,' % (const, ctype, name)) self.h(' %s callback,' % callback_name) self.h(' gpointer user_data,') self.h(' GDestroyNotify destroy,') self.h(' GObject *weak_object);') self.h('') self.b(' %s callback,' % callback_name) self.b(' gpointer user_data,') self.b(' GDestroyNotify destroy,') self.b(' GObject *weak_object)') self.b('{') self.b(' GError *error = NULL;') self.b(' GQuark interface = %s;' % self.get_iface_quark()) self.b(' DBusGProxy *iface;') self.b('') self.b(' g_return_val_if_fail (%s (proxy), NULL);' % self.proxy_assert) self.b(' g_return_val_if_fail (callback != NULL || ' 'user_data == NULL, NULL);') self.b(' g_return_val_if_fail (callback != NULL || ' 'destroy == NULL, NULL);') self.b(' g_return_val_if_fail (callback != NULL || ' 'weak_object == NULL, NULL);') self.b('') self.b(' G_GNUC_BEGIN_IGNORE_DEPRECATIONS') self.b(' iface = tp_proxy_borrow_interface_by_id (') self.b(' (TpProxy *) proxy,') self.b(' interface, &error);') self.b(' G_GNUC_END_IGNORE_DEPRECATIONS') self.b('') self.b(' if (iface == NULL)') self.b(' {') self.b(' if (callback != NULL)') self.b(' callback (proxy,') for arg in out_args: name, info, tp_type, elt = arg ctype, gtype, marshaller, pointer = info if pointer: self.b(' NULL,') else: self.b(' 0,') self.b(' error, user_data, weak_object);') self.b('') self.b(' if (destroy != NULL)') self.b(' destroy (user_data);') self.b('') self.b(' g_error_free (error);') self.b(' return NULL;') self.b(' }') self.b('') self.b(' if (callback == NULL)') self.b(' {') self.b(' dbus_g_proxy_call_no_reply (iface, "%s",' % member) for arg in in_args: name, info, tp_type, elt = arg ctype, gtype, marshaller, pointer = info const = pointer and 'const ' or '' self.b(' %s, %s,' % (gtype, name)) self.b(' G_TYPE_INVALID);') self.b(' return NULL;') self.b(' }') self.b(' else') self.b(' {') self.b(' TpProxyPendingCall *data;') self.b('') self.b(' data = tp_proxy_pending_call_v0_new ((TpProxy *) proxy,') self.b(' interface, "%s", iface,' % member) self.b(' %s,' % invoke_callback) self.b(' G_CALLBACK (callback), user_data, destroy,') self.b(' weak_object, FALSE);') self.b(' tp_proxy_pending_call_v0_take_pending_call (data,') self.b(' dbus_g_proxy_begin_call_with_timeout (iface,') self.b(' "%s",' % member) self.b(' %s,' % collect_callback) self.b(' data,') self.b(' tp_proxy_pending_call_v0_completed,') self.b(' timeout_ms,') for arg in in_args: name, info, tp_type, elt = arg ctype, gtype, marshaller, pointer = info const = pointer and 'const ' or '' self.b(' %s, %s,' % (gtype, name)) self.b(' G_TYPE_INVALID));') self.b('') self.b(' return data;') self.b(' }') self.b('}') self.b('') self.do_method_reentrant(method, iface_lc, member, member_lc, in_args, out_args, collect_callback) # leave a gap for the end of the method self.d('') self.b('') self.h('') def do_method_reentrant(self, method, iface_lc, member, member_lc, in_args, out_args, collect_callback): # Reentrant blocking calls # Example: # gboolean tp_cli_properties_interface_run_get_properties # (gpointer proxy, # gint timeout_ms, # const GArray *in_properties, # GPtrArray **out0, # GError **error, # GMainLoop **loop); run_method_name = '%s_%s_run_%s' % (self.prefix_lc, iface_lc, member_lc) if run_method_name not in self.reentrant_symbols: return self.b('typedef struct {') self.b(' GMainLoop *loop;') self.b(' GError **error;') for arg in out_args: name, info, tp_type, elt = arg ctype, gtype, marshaller, pointer = info self.b(' %s*%s;' % (ctype, name)) self.b(' unsigned success:1;') self.b(' unsigned completed:1;') self.b('} _%s_%s_run_state_%s;' % (self.prefix_lc, iface_lc, member_lc)) reentrant_invoke = '_%s_%s_finish_running_%s' % (self.prefix_lc, iface_lc, member_lc) self.b('static void') self.b('%s (TpProxy *self G_GNUC_UNUSED,' % reentrant_invoke) self.b(' GError *error,') self.b(' GValueArray *args,') self.b(' GCallback unused G_GNUC_UNUSED,') self.b(' gpointer user_data G_GNUC_UNUSED,') self.b(' GObject *unused2 G_GNUC_UNUSED)') self.b('{') self.b(' _%s_%s_run_state_%s *state = user_data;' % (self.prefix_lc, iface_lc, member_lc)) self.b('') self.b(' state->success = (error == NULL);') self.b(' state->completed = TRUE;') self.b(' g_main_loop_quit (state->loop);') self.b('') self.b(' if (error != NULL)') self.b(' {') self.b(' if (state->error != NULL)') self.b(' *state->error = error;') self.b(' else') self.b(' g_error_free (error);') self.b('') self.b(' return;') self.b(' }') self.b('') for i, arg in enumerate(out_args): name, info, tp_type, elt = arg ctype, gtype, marshaller, pointer = info self.b(' if (state->%s != NULL)' % name) if marshaller == 'BOXED': self.b(' *state->%s = g_value_dup_boxed (' 'args->values + %d);' % (name, i)) elif marshaller == 'STRING': self.b(' *state->%s = g_value_dup_string ' '(args->values + %d);' % (name, i)) elif marshaller in ('UCHAR', 'BOOLEAN', 'INT', 'UINT', 'INT64', 'UINT64', 'DOUBLE'): self.b(' *state->%s = g_value_get_%s (args->values + %d);' % (name, marshaller.lower(), i)) else: assert False, "Don't know how to copy %s" % gtype self.b('') if len(out_args) > 0: self.b(' g_value_array_free (args);') else: self.b(' if (args != NULL)') self.b(' g_value_array_free (args);') self.b('}') self.b('') if self.deprecate_reentrant: self.h('#ifndef %s' % self.deprecate_reentrant) self.h('gboolean %s (%sproxy,' % (run_method_name, self.proxy_arg)) self.h(' gint timeout_ms,') self.d('/**') self.d(' * %s:' % run_method_name) self.d(' * @proxy: %s' % self.proxy_doc) self.d(' * @timeout_ms: Timeout in milliseconds, or -1 for default') for arg in in_args: name, info, tp_type, elt = arg ctype, gtype, marshaller, pointer = info docs = xml_escape(get_docstring(elt) or '(Undocumented)') if ctype == 'guint ' and tp_type != '': docs += ' (#%s)' % ('Tp' + tp_type.replace('_', '')) self.d(' * @%s: Used to pass an \'in\' argument: %s' % (name, docs)) for arg in out_args: name, info, tp_type, elt = arg ctype, gtype, marshaller, pointer = info self.d(' * @%s: Used to return an \'out\' argument if %%TRUE is ' 'returned: %s' % (name, xml_escape(get_docstring(elt) or '(Undocumented)'))) self.d(' * @error: If not %NULL, used to return errors if %FALSE ') self.d(' * is returned') self.d(' * @loop: If not %NULL, set before re-entering ') self.d(' * the main loop, to point to a #GMainLoop ') self.d(' * which can be used to cancel this call with ') self.d(' * g_main_loop_quit(), causing a return of ') self.d(' * %FALSE with @error set to %TP_DBUS_ERROR_CANCELLED') self.d(' *') self.d(' * Call the method %s and run the main loop' % member) self.d(' * until it returns. Before calling this method, you must') self.d(' * add a reference to any borrowed objects you need to keep,') self.d(' * and generally ensure that everything is in a consistent') self.d(' * state.') self.d(' *') self.d(' * %s' % xml_escape(get_docstring(method) or '(Undocumented)')) self.d(' *') self.d(' * Returns: TRUE on success, FALSE and sets @error on error') deprecated = method.getElementsByTagName('tp:deprecated') if deprecated: d = deprecated[0] self.d(' *') self.d(' * Deprecated: %s' % xml_escape(get_deprecated(d))) self.d(' */') self.d('') self.b('gboolean\n%s (%sproxy,' % (run_method_name, self.proxy_arg)) self.b(' gint timeout_ms,') for arg in in_args: name, info, tp_type, elt = arg ctype, gtype, marshaller, pointer = info const = pointer and 'const ' or '' self.h(' %s%s%s,' % (const, ctype, name)) self.b(' %s%s%s,' % (const, ctype, name)) for arg in out_args: name, info, tp_type, elt = arg ctype, gtype, marshaller, pointer = info self.h(' %s*%s,' % (ctype, name)) self.b(' %s*%s,' % (ctype, name)) self.h(' GError **error,') if self.deprecate_reentrant: self.h(' GMainLoop **loop) %s;' % self.deprecation_attribute) self.h('#endif /* not %s */' % self.deprecate_reentrant) else: self.h(' GMainLoop **loop);') self.h('') self.b(' GError **error,') self.b(' GMainLoop **loop)') self.b('{') self.b(' DBusGProxy *iface;') self.b(' GQuark interface = %s;' % self.get_iface_quark()) self.b(' TpProxyPendingCall *pc;') self.b(' _%s_%s_run_state_%s state = {' % (self.prefix_lc, iface_lc, member_lc)) self.b(' NULL /* loop */, error,') for arg in out_args: name, info, tp_type, elt = arg self.b(' %s,' % name) self.b(' FALSE /* completed */, FALSE /* success */ };') self.b('') self.b(' g_return_val_if_fail (%s (proxy), FALSE);' % self.proxy_assert) self.b('') self.b(' G_GNUC_BEGIN_IGNORE_DEPRECATIONS') self.b(' iface = tp_proxy_borrow_interface_by_id') self.b(' ((TpProxy *) proxy, interface, error);') self.b(' G_GNUC_END_IGNORE_DEPRECATIONS') self.b('') self.b(' if (iface == NULL)') self.b(' return FALSE;') self.b('') self.b(' state.loop = g_main_loop_new (NULL, FALSE);') self.b('') self.b(' pc = tp_proxy_pending_call_v0_new ((TpProxy *) proxy,') self.b(' interface, "%s", iface,' % member) self.b(' %s,' % reentrant_invoke) self.b(' NULL, &state, NULL, NULL, TRUE);') self.b('') self.b(' if (loop != NULL)') self.b(' *loop = state.loop;') self.b('') self.b(' tp_proxy_pending_call_v0_take_pending_call (pc,') self.b(' dbus_g_proxy_begin_call_with_timeout (iface,') self.b(' "%s",' % member) self.b(' %s,' % collect_callback) self.b(' pc,') self.b(' tp_proxy_pending_call_v0_completed,') self.b(' timeout_ms,') for arg in in_args: name, info, tp_type, elt = arg ctype, gtype, marshaller, pointer = info const = pointer and 'const ' or '' self.b(' %s, %s,' % (gtype, name)) self.b(' G_TYPE_INVALID));') self.b('') self.b(' if (!state.completed)') self.b(' g_main_loop_run (state.loop);') self.b('') self.b(' if (!state.completed)') self.b(' tp_proxy_pending_call_cancel (pc);') self.b('') self.b(' if (loop != NULL)') self.b(' *loop = NULL;') self.b('') self.b(' g_main_loop_unref (state.loop);') self.b('') self.b(' return state.success;') self.b('}') self.b('') def do_signal_add(self, signal): marshaller_items = [] gtypes = [] for i in signal.getElementsByTagName('arg'): name = i.getAttribute('name') type = i.getAttribute('type') info = type_to_gtype(type) # type, GType, STRING, is a pointer gtypes.append(info[1]) self.b(' dbus_g_proxy_add_signal (proxy, "%s",' % signal.getAttribute('name')) for gtype in gtypes: self.b(' %s,' % gtype) self.b(' G_TYPE_INVALID);') def do_interface(self, node): ifaces = node.getElementsByTagName('interface') assert len(ifaces) == 1 iface = ifaces[0] name = node.getAttribute('name').replace('/', '') self.iface = name self.iface_lc = name.lower() self.iface_uc = name.upper() self.iface_mc = name.replace('_', '') self.iface_dbus = iface.getAttribute('name') signals = node.getElementsByTagName('signal') methods = node.getElementsByTagName('method') if signals: self.b('static inline void') self.b('%s_add_signals_for_%s (DBusGProxy *proxy)' % (self.prefix_lc, name.lower())) self.b('{') if self.tp_proxy_api >= (0, 7, 6): self.b(' if (!tp_proxy_dbus_g_proxy_claim_for_signal_adding ' '(proxy))') self.b(' return;') for signal in signals: self.do_signal_add(signal) self.b('}') self.b('') self.b('') for signal in signals: self.do_signal(name, signal) for method in methods: self.do_method(name, method) self.iface_dbus = None def __call__(self): if self.guard is not None: self.h('#ifndef %s' % self.guard) self.h('#define %s' % self.guard) self.h('') self.h('G_BEGIN_DECLS') self.h('') self.b('/* We don\'t want gtkdoc scanning this file, it\'ll get') self.b(' * confused by seeing function definitions, so mark it as: */') self.b('/**/') self.b('') nodes = self.dom.getElementsByTagName('node') nodes.sort(cmp_by_name) for node in nodes: self.do_interface(node) if self.group is not None: self.b('/*') self.b(' * %s_%s_add_signals:' % (self.prefix_lc, self.group)) self.b(' * @self: the #TpProxy') self.b(' * @quark: a quark whose string value is the interface') self.b(' * name whose signals should be added') self.b(' * @proxy: the D-Bus proxy to which to add the signals') self.b(' * @unused: not used for anything') self.b(' *') self.b(' * Tell dbus-glib that @proxy has the signatures of all') self.b(' * signals on the given interface, if it\'s one we') self.b(' * support.') self.b(' *') self.b(' * This function should be used as a signal handler for') self.b(' * #TpProxy::interface-added.') self.b(' */') self.b('static void') self.b('%s_%s_add_signals (TpProxy *self G_GNUC_UNUSED,' % (self.prefix_lc, self.group)) self.b(' guint quark,') self.b(' DBusGProxy *proxy,') self.b(' gpointer unused G_GNUC_UNUSED)') self.b('{') for node in nodes: iface = node.getElementsByTagName('interface')[0] self.iface_dbus = iface.getAttribute('name') signals = node.getElementsByTagName('signal') if not signals: continue name = node.getAttribute('name').replace('/', '').lower() self.iface_uc = name.upper() self.b(' if (quark == %s)' % self.get_iface_quark()) self.b(' %s_add_signals_for_%s (proxy);' % (self.prefix_lc, name)) self.b('}') self.b('') self.h('G_END_DECLS') self.h('') if self.guard is not None: self.h('#endif /* defined (%s) */' % self.guard) self.h('') file_set_contents(self.basename + '.h', '\n'.join(self.__header)) file_set_contents(self.basename + '-body.h', '\n'.join(self.__body)) file_set_contents(self.basename + '-gtk-doc.h', '\n'.join(self.__docs)) def types_to_gtypes(types): return [type_to_gtype(t)[1] for t in types] if __name__ == '__main__': options, argv = gnu_getopt(sys.argv[1:], '', ['group=', 'subclass=', 'subclass-assert=', 'iface-quark-prefix=', 'tp-proxy-api=', 'generate-reentrant=', 'deprecate-reentrant=', 'deprecation-attribute=', 'guard=']) opts = {} for option, value in options: opts[option] = value dom = xml.dom.minidom.parse(argv[0]) Generator(dom, argv[1], argv[2], opts)() telepathy-mission-control-5.16.4/tools/Makefile.in0000644000175000017500000003316412762351620023235 0ustar00gkiagiagkiagia00000000000000# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__make_dryrun = \ { \ am__dry=no; \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ *) \ for am__flg in $$MAKEFLAGS; do \ case $$am__flg in \ *=*|--*) ;; \ *n*) am__dry=yes; break;; \ esac; \ done;; \ esac; \ test $$am__dry = yes; \ } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = tools DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/gtk-doc.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/tp-compiler-flag.m4 \ $(top_srcdir)/m4/tp-compiler-warnings.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACCOUNTS_CACHE_DIR = @ACCOUNTS_CACHE_DIR@ ACCOUNTS_DIR = @ACCOUNTS_DIR@ ACLOCAL = @ACLOCAL@ AEGIS_LIBS = @AEGIS_LIBS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DBUS_CFLAGS = @DBUS_CFLAGS@ DBUS_LIBS = @DBUS_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ERROR_CFLAGS = @ERROR_CFLAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GIO_UNIX_CFLAGS = @GIO_UNIX_CFLAGS@ GIO_UNIX_LIBS = @GIO_UNIX_LIBS@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_COMPILE_SCHEMAS = @GLIB_COMPILE_SCHEMAS@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ GLIB_MKENUMS = @GLIB_MKENUMS@ GREP = @GREP@ GSETTINGS_DISABLE_SCHEMAS_COMPILE = @GSETTINGS_DISABLE_SCHEMAS_COMPILE@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ HTML_DIR = @HTML_DIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBACCOUNTS_SSO_CFLAGS = @LIBACCOUNTS_SSO_CFLAGS@ LIBACCOUNTS_SSO_LIBS = @LIBACCOUNTS_SSO_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MCE_CFLAGS = @MCE_CFLAGS@ MCE_LIBS = @MCE_LIBS@ MCP_ABI_VERSION = @MCP_ABI_VERSION@ MCP_API_VERSION = @MCP_API_VERSION@ MCP_LT_AGE = @MCP_LT_AGE@ MCP_LT_CURRENT = @MCP_LT_CURRENT@ MCP_LT_REVISION = @MCP_LT_REVISION@ MKDIR_P = @MKDIR_P@ NETWORK_MANAGER_CFLAGS = @NETWORK_MANAGER_CFLAGS@ NETWORK_MANAGER_LIBS = @NETWORK_MANAGER_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PYTHON = @PYTHON@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TELEPATHY_CFLAGS = @TELEPATHY_CFLAGS@ TELEPATHY_LIBS = @TELEPATHY_LIBS@ UPOWER_GLIB_CFLAGS = @UPOWER_GLIB_CFLAGS@ UPOWER_GLIB_LIBS = @UPOWER_GLIB_LIBS@ VERSION = @VERSION@ XSLTPROC = @XSLTPROC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gsettingsschemadir = @gsettingsschemadir@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mctestsdir = @mctestsdir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ pluginlibdir = @pluginlibdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = \ c-constants-generator.xsl \ c-interfaces-generator.xsl \ doc-generator.xsl \ glib-client-gen.py \ glib-blocking-client-gen.py \ glib-client-marshaller-gen.py \ glib-interfaces-generator.xsl \ glib-interfaces-body-generator.xsl \ glib-ginterface-gen.py \ glib-gtypes-generator.py \ glib-signals-marshal-gen.py \ gquark-gen.py \ identity.xsl \ lcov.am \ libtpcodegen.py \ libglibcodegen.py \ run_and_bt.gdb \ spec-to-introspect.xsl \ telepathy.am CLEANFILES = libglibcodegen.pyc libglibcodegen.pyo TELEPATHY_GLIB_SRCDIR = $(top_srcdir)/../telepathy-glib all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tools/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu tools/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am all: $(EXTRA_DIST) libglibcodegen.py: libtpcodegen.py $(AM_V_GEN)test -e ${srcdir}/$@ && touch ${srcdir}/$@ glib-client-marshaller-gen.py: libglibcodegen.py $(AM_V_GEN)test -e ${srcdir}/$@ && touch ${srcdir}/$@ glib-ginterface-gen.py: libglibcodegen.py $(AM_V_GEN)test -e ${srcdir}/$@ && touch ${srcdir}/$@ glib-gtypes-generator.py: libglibcodegen.py $(AM_V_GEN)test -e ${srcdir}/$@ && touch ${srcdir}/$@ glib-signals-marshal-gen.py: libglibcodegen.py $(AM_V_GEN)test -e ${srcdir}/$@ && touch ${srcdir}/$@ maintainer-update-from-telepathy-glib: set -e && cd $(srcdir) && \ for x in $(EXTRA_DIST); do \ if test -f $(TELEPATHY_GLIB_SRCDIR)/tools/$$x; then \ cp $(TELEPATHY_GLIB_SRCDIR)/tools/$$x $$x; \ fi; \ done # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: telepathy-mission-control-5.16.4/tools/glib-blocking-client-gen.py0000644000175000017500000011266112735242352026271 0ustar00gkiagiagkiagia00000000000000#!/usr/bin/python # glib-client-gen.py: "I Can't Believe It's Not dbus-binding-tool" # # Generate GLib client wrappers from the Telepathy specification. # The master copy of this program is in the telepathy-glib repository - # please make any changes there. # # Copyright (C) 2006-2008 Collabora Ltd. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA import sys import os.path import xml.dom.minidom from getopt import gnu_getopt from libglibcodegen import Signature, type_to_gtype, cmp_by_name, \ camelcase_to_lower, get_docstring NS_TP = "http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0" class Generator(object): def __init__(self, dom, prefix, basename, opts): self.dom = dom self.__header = [] self.__body = [] self.prefix_lc = prefix.lower() self.prefix_uc = prefix.upper() self.prefix_mc = prefix.replace('_', '') self.basename = basename self.group = opts.get('--group', None) self.iface_quark_prefix = opts.get('--iface-quark-prefix', None) self.proxy_cls = opts.get('--subclass', 'TpProxy') + ' *' self.proxy_arg = opts.get('--subclass', 'void') + ' *' self.proxy_assert = opts.get('--subclass-assert', 'TP_IS_PROXY') self.proxy_doc = ('A #%s or subclass' % opts.get('--subclass', 'TpProxy')) if self.proxy_arg == 'void *': self.proxy_arg = 'gpointer ' def h(self, s): self.__header.append(s) def b(self, s): self.__body.append(s) def get_iface_quark(self): assert self.iface_dbus is not None assert self.iface_uc is not None if self.iface_quark_prefix is None: return 'g_quark_from_static_string (\"%s\")' % self.iface_dbus else: return '%s_%s' % (self.iface_quark_prefix, self.iface_uc) def do_signal(self, iface, signal): iface_lc = iface.lower() member = signal.getAttribute('name') member_lc = camelcase_to_lower(member) member_uc = member_lc.upper() arg_count = 0 args = [] out_args = [] for arg in signal.getElementsByTagName('arg'): name = arg.getAttribute('name') type = arg.getAttribute('type') tp_type = arg.getAttribute('tp:type') if not name: name = 'arg%u' % arg_count arg_count += 1 else: name = 'arg_%s' % name info = type_to_gtype(type) args.append((name, info, tp_type, arg)) callback_name = ('%s_%s_signal_callback_%s' % (self.prefix_lc, iface_lc, member_lc)) collect_name = ('_%s_%s_collect_args_of_%s' % (self.prefix_lc, iface_lc, member_lc)) invoke_name = ('_%s_%s_invoke_callback_for_%s' % (self.prefix_lc, iface_lc, member_lc)) # Example: # # typedef void (*tp_cli_connection_signal_callback_new_channel) # (TpConnection *proxy, const gchar *arg_object_path, # const gchar *arg_channel_type, guint arg_handle_type, # guint arg_handle, gboolean arg_suppress_handler, # gpointer user_data, GObject *weak_object); self.b('/**') self.b(' * %s:' % callback_name) self.b(' * @proxy: The proxy on which %s_%s_connect_to_%s ()' % (self.prefix_lc, iface_lc, member_lc)) self.b(' * was called') for arg in args: name, info, tp_type, elt = arg ctype, gtype, marshaller, pointer = info self.b(' * @%s: ' % (name, get_docstring(elt) or '(Undocumented)')) self.b(' * @user_data: User-supplied data') self.b(' * @weak_object: User-supplied weakly referenced object') self.b(' *') self.b(' * Represents the signature of a callback for the signal %s.' % member) self.b(' */') self.h('typedef void (*%s) (%sproxy,' % (callback_name, self.proxy_cls)) for arg in args: name, info, tp_type, elt = arg ctype, gtype, marshaller, pointer = info const = pointer and 'const ' or '' self.h(' %s%s%s,' % (const, ctype, name)) self.h(' gpointer user_data, GObject *weak_object);') if args: self.b('static void') self.b('%s (DBusGProxy *proxy,' % collect_name) for arg in args: name, info, tp_type, elt = arg ctype, gtype, marshaller, pointer = info const = pointer and 'const ' or '' self.b(' %s%s%s,' % (const, ctype, name)) self.b(' TpProxySignalConnection *sc)') self.b('{') self.b(' GValueArray *args = g_value_array_new (%d);' % len(args)) self.b(' GValue blank = { 0 };') self.b(' guint i;') self.b('') self.b(' g_value_init (&blank, G_TYPE_INT);') self.b('') self.b(' for (i = 0; i < %d; i++)' % len(args)) self.b(' g_value_array_append (args, &blank);') self.b('') for i, arg in enumerate(args): name, info, tp_type, elt = arg ctype, gtype, marshaller, pointer = info self.b(' g_value_unset (args->values + %d);' % i) self.b(' g_value_init (args->values + %d, %s);' % (i, gtype)) if gtype == 'G_TYPE_STRING': self.b(' g_value_set_string (args->values + %d, %s);' % (i, name)) elif marshaller == 'BOXED': self.b(' g_value_set_boxed (args->values + %d, %s);' % (i, name)) elif gtype == 'G_TYPE_UCHAR': self.b(' g_value_set_uchar (args->values + %d, %s);' % (i, name)) elif gtype == 'G_TYPE_BOOLEAN': self.b(' g_value_set_boolean (args->values + %d, %s);' % (i, name)) elif gtype == 'G_TYPE_INT': self.b(' g_value_set_int (args->values + %d, %s);' % (i, name)) elif gtype == 'G_TYPE_UINT': self.b(' g_value_set_uint (args->values + %d, %s);' % (i, name)) elif gtype == 'G_TYPE_INT64': self.b(' g_value_set_int (args->values + %d, %s);' % (i, name)) elif gtype == 'G_TYPE_UINT64': self.b(' g_value_set_uint (args->values + %d, %s);' % (i, name)) elif gtype == 'G_TYPE_DOUBLE': self.b(' g_value_set_double (args->values + %d, %s);' % (i, name)) else: assert False, ("Don't know how to put %s in a GValue" % gtype) self.b('') self.b(' tp_proxy_signal_connection_v0_take_results (sc, args);') self.b('}') self.b('static void') self.b('%s (TpProxy *tpproxy,' % invoke_name) self.b(' GError *error,') self.b(' GValueArray *args,') self.b(' GCallback generic_callback,') self.b(' gpointer user_data,') self.b(' GObject *weak_object)') self.b('{') self.b(' %s callback =' % callback_name) self.b(' (%s) generic_callback;' % callback_name) self.b('') self.b(' if (callback != NULL)') self.b(' callback (g_object_ref (tpproxy),') # FIXME: factor out into a function for i, arg in enumerate(args): name, info, tp_type, elt = arg ctype, gtype, marshaller, pointer = info if marshaller == 'BOXED': self.b(' g_value_get_boxed (args->values + %d),' % i) elif gtype == 'G_TYPE_STRING': self.b(' g_value_get_string (args->values + %d),' % i) elif gtype == 'G_TYPE_UCHAR': self.b(' g_value_get_uchar (args->values + %d),' % i) elif gtype == 'G_TYPE_BOOLEAN': self.b(' g_value_get_boolean (args->values + %d),' % i) elif gtype == 'G_TYPE_UINT': self.b(' g_value_get_uint (args->values + %d),' % i) elif gtype == 'G_TYPE_INT': self.b(' g_value_get_int (args->values + %d),' % i) elif gtype == 'G_TYPE_UINT64': self.b(' g_value_get_uint64 (args->values + %d),' % i) elif gtype == 'G_TYPE_INT64': self.b(' g_value_get_int64 (args->values + %d),' % i) elif gtype == 'G_TYPE_DOUBLE': self.b(' g_value_get_double (args->values + %d),' % i) else: assert False, "Don't know how to get %s from a GValue" % gtype self.b(' user_data,') self.b(' weak_object);') self.b('') if len(args) > 0: self.b(' g_value_array_free (args);') else: self.b(' if (args != NULL)') self.b(' g_value_array_free (args);') self.b('') self.b(' g_object_unref (tpproxy);') self.b('}') # Example: # # TpProxySignalConnection * # tp_cli_connection_connect_to_new_channel # (TpConnection *proxy, # tp_cli_connection_signal_callback_new_channel callback, # gpointer user_data, # GDestroyNotify destroy); # # destroy is invoked when the signal becomes disconnected. This # is either because the signal has been disconnected explicitly # by the user, because the TpProxy has become invalid and # emitted the 'invalidated' signal, or because the weakly referenced # object has gone away. self.b('/**') self.b(' * %s_%s_connect_to_%s:' % (self.prefix_lc, iface_lc, member_lc)) self.b(' * @proxy: %s' % self.proxy_doc) self.b(' * @callback: Callback to be called when the signal is') self.b(' * received') self.b(' * @user_data: User-supplied data for the callback') self.b(' * @destroy: Destructor for the user-supplied data, which') self.b(' * will be called when this signal is disconnected, or') self.b(' * before this function returns %NULL') self.b(' * @weak_object: A #GObject which will be weakly referenced; ') self.b(' * if it is destroyed, this callback will automatically be') self.b(' * disconnected') self.b(' * @error: If not %NULL, used to raise an error if %NULL is') self.b(' * returned') self.b(' *') self.b(' * Connect a handler to the signal %s.' % member) self.b(' *') self.b(' * ' % (get_docstring(signal) or '(Undocumented)')) self.b(' *') self.b(' * Returns: a #TpProxySignalConnection containing all of the') self.b(' * above, which can be used to disconnect the signal; or') self.b(' * %NULL if the proxy does not have the desired interface') self.b(' * or has become invalid.') self.b(' */') self.h('TpProxySignalConnection *%s_%s_connect_to_%s (%sproxy,' % (self.prefix_lc, iface_lc, member_lc, self.proxy_arg)) self.h(' %s callback,' % callback_name) self.h(' gpointer user_data,') self.h(' GDestroyNotify destroy,') self.h(' GObject *weak_object,') self.h(' GError **error);') self.b('TpProxySignalConnection *') self.b('%s_%s_connect_to_%s (%sproxy,' % (self.prefix_lc, iface_lc, member_lc, self.proxy_arg)) self.b(' %s callback,' % callback_name) self.b(' gpointer user_data,') self.b(' GDestroyNotify destroy,') self.b(' GObject *weak_object,') self.b(' GError **error)') self.b('{') self.b(' GType expected_types[%d] = {' % (len(args) + 1)) for arg in args: name, info, tp_type, elt = arg ctype, gtype, marshaller, pointer = info self.b(' %s,' % gtype) self.b(' G_TYPE_INVALID };') self.b('') self.b(' g_return_val_if_fail (%s (proxy), NULL);' % self.proxy_assert) self.b(' g_return_val_if_fail (callback != NULL, NULL);') self.b('') self.b(' return tp_proxy_signal_connection_v0_new ((TpProxy *) proxy,') self.b(' %s, \"%s\",' % (self.get_iface_quark(), member)) self.b(' expected_types,') if args: self.b(' G_CALLBACK (%s),' % collect_name) else: self.b(' NULL, /* no args => no collector function */') self.b(' %s,' % invoke_name) self.b(' G_CALLBACK (callback), user_data, destroy,') self.b(' weak_object, error);') self.b('}') self.b('') self.h('') def do_method(self, iface, method): iface_lc = iface.lower() member = method.getAttribute('name') member_lc = camelcase_to_lower(member) member_uc = member_lc.upper() in_count = 0 ret_count = 0 in_args = [] out_args = [] for arg in method.getElementsByTagName('arg'): name = arg.getAttribute('name') direction = arg.getAttribute('direction') type = arg.getAttribute('type') tp_type = arg.getAttribute('tp:type') if direction != 'out': if not name: name = 'in%u' % in_count in_count += 1 else: name = 'in_%s' % name else: if not name: name = 'out%u' % ret_count ret_count += 1 else: name = 'out_%s' % name info = type_to_gtype(type) if direction != 'out': in_args.append((name, info, tp_type, arg)) else: out_args.append((name, info, tp_type, arg)) # Async reply callback type # Example: # void (*tp_cli_properties_interface_callback_for_get_properties) # (TpProxy *proxy, # const GPtrArray *out0, # const GError *error, # gpointer user_data, # GObject *weak_object); self.b('/**') self.b(' * %s_%s_callback_for_%s:' % (self.prefix_lc, iface_lc, member_lc)) self.b(' * @proxy: the proxy on which the call was made') for arg in out_args: name, info, tp_type, elt = arg ctype, gtype, marshaller, pointer = info self.b(' * @%s: Used to return an \'out\' argument if @error is ' '%%NULL: ' % (name, get_docstring(elt) or '(Undocumented)')) self.b(' * @error: %NULL on success, or an error on failure') self.b(' * @user_data: user-supplied data') self.b(' * @weak_object: user-supplied object') self.b(' *') self.b(' * Signature of the callback called when a %s method call' % member) self.b(' * succeeds or fails.') self.b(' */') callback_name = '%s_%s_callback_for_%s' % (self.prefix_lc, iface_lc, member_lc) self.h('typedef void (*%s) (%sproxy,' % (callback_name, self.proxy_cls)) for arg in out_args: name, info, tp_type, elt = arg ctype, gtype, marshaller, pointer = info const = pointer and 'const ' or '' self.h(' %s%s%s,' % (const, ctype, name)) self.h(' const GError *error, gpointer user_data,') self.h(' GObject *weak_object);') self.h('') # Async callback implementation invoke_callback = '_%s_%s_invoke_callback_%s' % (self.prefix_lc, iface_lc, member_lc) collect_callback = '_%s_%s_collect_callback_%s' % (self.prefix_lc, iface_lc, member_lc) # The callback called by dbus-glib; this ends the call and collects # the results into a GValueArray. self.b('static void') self.b('%s (DBusGProxy *proxy,' % collect_callback) self.b(' DBusGProxyCall *call,') self.b(' gpointer user_data)') self.b('{') self.b(' GError *error = NULL;') if len(out_args) > 0: self.b(' GValueArray *args;') self.b(' GValue blank = { 0 };') self.b(' guint i;') for arg in out_args: name, info, tp_type, elt = arg ctype, gtype, marshaller, pointer = info self.b(' %s%s;' % (ctype, name)) self.b('') self.b(' dbus_g_proxy_end_call (proxy, call, &error,') for arg in out_args: name, info, tp_type, elt = arg ctype, gtype, marshaller, pointer = info self.b(' %s, &%s,' % (gtype, name)) self.b(' G_TYPE_INVALID);') if len(out_args) == 0: self.b(' tp_proxy_pending_call_v0_take_results (user_data, error,' 'NULL);') else: self.b('') self.b(' if (error != NULL)') self.b(' {') self.b(' tp_proxy_pending_call_v0_take_results (user_data, error,') self.b(' NULL);') self.b(' return;') self.b(' }') self.b('') self.b(' args = g_value_array_new (%d);' % len(out_args)) self.b(' g_value_init (&blank, G_TYPE_INT);') self.b('') self.b(' for (i = 0; i < %d; i++)' % len(out_args)) self.b(' g_value_array_append (args, &blank);') for i, arg in enumerate(out_args): name, info, tp_type, elt = arg ctype, gtype, marshaller, pointer = info self.b('') self.b(' g_value_unset (args->values + %d);' % i) self.b(' g_value_init (args->values + %d, %s);' % (i, gtype)) if gtype == 'G_TYPE_STRING': self.b(' g_value_take_string (args->values + %d, %s);' % (i, name)) elif marshaller == 'BOXED': self.b(' g_value_take_boxed (args->values + %d, %s);' % (i, name)) elif gtype == 'G_TYPE_UCHAR': self.b(' g_value_set_uchar (args->values + %d, %s);' % (i, name)) elif gtype == 'G_TYPE_BOOLEAN': self.b(' g_value_set_boolean (args->values + %d, %s);' % (i, name)) elif gtype == 'G_TYPE_INT': self.b(' g_value_set_int (args->values + %d, %s);' % (i, name)) elif gtype == 'G_TYPE_UINT': self.b(' g_value_set_uint (args->values + %d, %s);' % (i, name)) elif gtype == 'G_TYPE_INT64': self.b(' g_value_set_int (args->values + %d, %s);' % (i, name)) elif gtype == 'G_TYPE_UINT64': self.b(' g_value_set_uint (args->values + %d, %s);' % (i, name)) elif gtype == 'G_TYPE_DOUBLE': self.b(' g_value_set_double (args->values + %d, %s);' % (i, name)) else: assert False, ("Don't know how to put %s in a GValue" % gtype) self.b(' tp_proxy_pending_call_v0_take_results (user_data, ' 'NULL, args);') self.b('}') self.b('static void') self.b('%s (TpProxy *self,' % invoke_callback) self.b(' GError *error,') self.b(' GValueArray *args,') self.b(' GCallback generic_callback,') self.b(' gpointer user_data,') self.b(' GObject *weak_object)') self.b('{') self.b(' %s callback = (%s) generic_callback;' % (callback_name, callback_name)) self.b('') self.b(' if (error != NULL)') self.b(' {') self.b(' callback ((%s) self,' % self.proxy_cls) for arg in out_args: name, info, tp_type, elt = arg ctype, gtype, marshaller, pointer = info if marshaller == 'BOXED' or pointer: self.b(' NULL,') elif gtype == 'G_TYPE_DOUBLE': self.b(' 0.0,') else: self.b(' 0,') self.b(' error, user_data, weak_object);') self.b(' g_error_free (error);') self.b(' return;') self.b(' }') self.b(' callback ((%s) self,' % self.proxy_cls) # FIXME: factor out into a function for i, arg in enumerate(out_args): name, info, tp_type, elt = arg ctype, gtype, marshaller, pointer = info if marshaller == 'BOXED': self.b(' g_value_get_boxed (args->values + %d),' % i) elif gtype == 'G_TYPE_STRING': self.b(' g_value_get_string (args->values + %d),' % i) elif gtype == 'G_TYPE_UCHAR': self.b(' g_value_get_uchar (args->values + %d),' % i) elif gtype == 'G_TYPE_BOOLEAN': self.b(' g_value_get_boolean (args->values + %d),' % i) elif gtype == 'G_TYPE_UINT': self.b(' g_value_get_uint (args->values + %d),' % i) elif gtype == 'G_TYPE_INT': self.b(' g_value_get_int (args->values + %d),' % i) elif gtype == 'G_TYPE_UINT64': self.b(' g_value_get_uint64 (args->values + %d),' % i) elif gtype == 'G_TYPE_INT64': self.b(' g_value_get_int64 (args->values + %d),' % i) elif gtype == 'G_TYPE_DOUBLE': self.b(' g_value_get_double (args->values + %d),' % i) else: assert False, "Don't know how to get %s from a GValue" % gtype self.b(' error, user_data, weak_object);') self.b('') if len(out_args) > 0: self.b(' g_value_array_free (args);') else: self.b(' if (args != NULL)') self.b(' g_value_array_free (args);') self.b('}') self.b('') # Async stub # Example: # TpProxyPendingCall * # tp_cli_properties_interface_call_get_properties # (gpointer proxy, # gint timeout_ms, # const GArray *in_properties, # tp_cli_properties_interface_callback_for_get_properties callback, # gpointer user_data, # GDestroyNotify *destructor); self.h('TpProxyPendingCall *%s_%s_call_%s (%sproxy,' % (self.prefix_lc, iface_lc, member_lc, self.proxy_arg)) self.h(' gint timeout_ms,') self.b('/**') self.b(' * %s_%s_call_%s:' % (self.prefix_lc, iface_lc, member_lc)) self.b(' * @proxy: the #TpProxy') self.b(' * @timeout_ms: the timeout in milliseconds, or -1 to use the') self.b(' * default') for arg in in_args: name, info, tp_type, elt = arg ctype, gtype, marshaller, pointer = info self.b(' * @%s: Used to pass an \'in\' argument: ' % (name, get_docstring(elt) or '(Undocumented)')) self.b(' * @callback: called when the method call succeeds or fails') self.b(' * @user_data: user-supplied data passed to the callback') self.b(' * @destroy: called with the user_data as argument, after the') self.b(' * call has succeeded, failed or been cancelled') self.b(' * @weak_object: A #GObject which will be weakly referenced; ') self.b(' * if it is destroyed, this callback will automatically be') self.b(' * disconnected') self.b(' *') self.b(' * Start a %s method call.' % member) self.b(' *') self.b(' * ' % (get_docstring(method) or '(Undocumented)')) self.b(' *') self.b(' * Returns: a #TpProxyPendingCall representing the call in') self.b(' * progress. It is borrowed from the object, and will become') self.b(' * invalid when the callback is called, the call is') self.b(' * cancelled or the #TpProxy becomes invalid.') self.b(' */') self.b('TpProxyPendingCall *\n%s_%s_call_%s (%sproxy,' % (self.prefix_lc, iface_lc, member_lc, self.proxy_arg)) self.b(' gint timeout_ms,') for arg in in_args: name, info, tp_type, elt = arg ctype, gtype, marshaller, pointer = info const = pointer and 'const ' or '' self.h(' %s%s%s,' % (const, ctype, name)) self.b(' %s%s%s,' % (const, ctype, name)) self.h(' %s callback,' % callback_name) self.h(' gpointer user_data,') self.h(' GDestroyNotify destroy,') self.h(' GObject *weak_object);') self.h('') self.b(' %s callback,' % callback_name) self.b(' gpointer user_data,') self.b(' GDestroyNotify destroy,') self.b(' GObject *weak_object)') self.b('{') self.b(' GError *error = NULL;') self.b(' GQuark interface = %s;' % self.get_iface_quark()) self.b(' DBusGProxy *iface;') self.b('') self.b(' g_return_val_if_fail (%s (proxy), NULL);' % self.proxy_assert) self.b('') self.b(' iface = tp_proxy_borrow_interface_by_id (') self.b(' (TpProxy *) proxy,') self.b(' interface, &error);') self.b('') self.b(' if (iface == NULL)') self.b(' {') self.b(' if (callback != NULL)') self.b(' callback (proxy,') for arg in out_args: name, info, tp_type, elt = arg ctype, gtype, marshaller, pointer = info if pointer: self.b(' NULL,') else: self.b(' 0,') self.b(' error, user_data, weak_object);') self.b(' g_error_free (error);') self.b(' return NULL;') self.b(' }') self.b('') self.b(' if (callback == NULL)') self.b(' {') self.b(' dbus_g_proxy_call_no_reply (iface, "%s",' % member) for arg in in_args: name, info, tp_type, elt = arg ctype, gtype, marshaller, pointer = info const = pointer and 'const ' or '' self.b(' %s, %s,' % (gtype, name)) self.b(' G_TYPE_INVALID);') self.b(' return NULL;') self.b(' }') self.b(' else') self.b(' {') self.b(' TpProxyPendingCall *data;') self.b('') self.b(' data = tp_proxy_pending_call_v0_new ((TpProxy *) proxy,') self.b(' interface, "%s", iface,' % member) self.b(' %s,' % invoke_callback) self.b(' G_CALLBACK (callback), user_data, destroy,') self.b(' weak_object, FALSE);') self.b(' tp_proxy_pending_call_v0_take_pending_call (data,') self.b(' dbus_g_proxy_begin_call_with_timeout (iface,') self.b(' "%s",' % member) self.b(' %s,' % collect_callback) self.b(' data,') self.b(' tp_proxy_pending_call_v0_completed,') self.b(' timeout_ms,') for arg in in_args: name, info, tp_type, elt = arg ctype, gtype, marshaller, pointer = info const = pointer and 'const ' or '' self.b(' %s, %s,' % (gtype, name)) self.b(' G_TYPE_INVALID));') self.b('') self.b(' return data;') self.b(' }') self.b('}') self.b('') # Non reentrant blocking calls # Example: # gboolean tp_cli_properties_interface_do_get_properties # (gpointer proxy, # gint timeout_ms, # const GArray *in_properties, # GPtrArray **out0, # GError **error); self.h('gboolean %s_%s_do_%s (%sproxy,' % (self.prefix_lc, iface_lc, member_lc, self.proxy_arg)) self.h(' gint timeout_ms,') self.b('/**') self.b(' * %s_%s_do_%s:' % (self.prefix_lc, iface_lc, member_lc)) self.b(' * @proxy: %s' % self.proxy_doc) self.b(' * @timeout_ms: Timeout in milliseconds, or -1 for default') for arg in in_args: name, info, tp_type, elt = arg ctype, gtype, marshaller, pointer = info self.b(' * @%s: Used to pass an \'in\' argument: ' % (name, get_docstring(elt) or '(Undocumented)')) for arg in out_args: name, info, tp_type, elt = arg ctype, gtype, marshaller, pointer = info self.b(' * @%s: Used to return an \'out\' argument if %%TRUE is ' 'returned: ' % (name, get_docstring(elt) or '(Undocumented)')) self.b(' * @error: If not %NULL, used to return errors if %FALSE ') self.b(' * is returned') self.b(' *') self.b(' * Call the method %s and block' % member) self.b(' * until it returns.') self.b(' *') self.b(' * ' % (get_docstring(method) or '(Undocumented)')) self.b(' *') self.b(' * Returns: TRUE on success, FALSE and sets @error on error') self.b(' */') self.b('gboolean\n%s_%s_do_%s (%sproxy,' % (self.prefix_lc, iface_lc, member_lc, self.proxy_arg)) self.b(' gint timeout_ms,') for arg in in_args: name, info, tp_type, elt = arg ctype, gtype, marshaller, pointer = info const = pointer and 'const ' or '' self.h(' %s%s%s,' % (const, ctype, name)) self.b(' %s%s%s,' % (const, ctype, name)) for arg in out_args: name, info, tp_type, elt = arg ctype, gtype, marshaller, pointer = info self.h(' %s*%s,' % (ctype, name)) self.b(' %s*%s,' % (ctype, name)) self.h(' GError **error);') self.h('') self.b(' GError **error)') self.b('{') self.b(' DBusGProxy *iface;') self.b(' GQuark interface = %s;' % self.get_iface_quark()) for arg in out_args: name, info, tp_type, elt = arg ctype, gtype, marshaller, pointer = info self.b(' %si_%s;' % (ctype, name)) self.b('') self.b(' g_return_val_if_fail (%s (proxy), FALSE);' % self.proxy_assert) self.b('') self.b(' iface = tp_proxy_borrow_interface_by_id') self.b(' ((TpProxy *) proxy, interface, error);') self.b('') self.b(' if (iface == NULL)') self.b(' return FALSE;') self.b('') self.b(' if (dbus_g_proxy_call_with_timeout (iface,') self.b(' "%s",' % member) self.b(' timeout_ms,') self.b(' error,') for arg in in_args: name, info, tp_type, elt = arg ctype, gtype, marshaller, pointer = info const = pointer and 'const ' or '' self.b(' %s, %s,' % (gtype, name)) self.b(' G_TYPE_INVALID,') for arg in out_args: name, info, tp_type, elt = arg ctype, gtype, marshaller, pointer = info self.b(' %s, &i_%s,' % (gtype, name)) self.b(' G_TYPE_INVALID))') self.b(' {') for arg in out_args: name, info, tp_type, elt = arg ctype, gtype, marshaller, pointer = info self.b(' *%s = i_%s;' % (name, name)) self.b(' return TRUE;') self.b(' }') self.b(' else') self.b(' return FALSE;') self.b('}') self.b('') # leave a gap for the end of the method self.b('') self.h('') def do_signal_add(self, signal): marshaller_items = [] gtypes = [] for i in signal.getElementsByTagName('arg'): name = i.getAttribute('name') type = i.getAttribute('type') info = type_to_gtype(type) # type, GType, STRING, is a pointer gtypes.append(info[1]) self.b(' dbus_g_proxy_add_signal (proxy, "%s",' % signal.getAttribute('name')) for gtype in gtypes: self.b(' %s,' % gtype) self.b(' G_TYPE_INVALID);') def do_interface(self, node): ifaces = node.getElementsByTagName('interface') assert len(ifaces) == 1 iface = ifaces[0] name = node.getAttribute('name').replace('/', '') self.iface = name self.iface_lc = name.lower() self.iface_uc = name.upper() self.iface_mc = name.replace('_', '') self.iface_dbus = iface.getAttribute('name') signals = node.getElementsByTagName('signal') methods = node.getElementsByTagName('method') self.b('static inline void') self.b('%s_add_signals_for_%s (DBusGProxy *proxy)' % (self.prefix_lc, name.lower())) self.b('{') for signal in signals: self.do_signal_add(signal) self.b('}') self.b('') self.b('') for signal in signals: self.do_signal(name, signal) for method in methods: self.do_method(name, method) self.iface_dbus = None def __call__(self): self.h('G_BEGIN_DECLS') self.h('') self.b('/* We don\'t want gtkdoc scanning this file, it\'ll get') self.b(' * confused by seeing function definitions, so mark it as: */') self.b('/**/') self.b('') nodes = self.dom.getElementsByTagName('node') nodes.sort(cmp_by_name) for node in nodes: self.do_interface(node) if self.group is not None: self.b('/*') self.b(' * %s_%s_add_signals:' % (self.prefix_lc, self.group)) self.b(' * @self: the #TpProxy') self.b(' * @quark: a quark whose string value is the interface') self.b(' * name whose signals should be added') self.b(' * @proxy: the D-Bus proxy to which to add the signals') self.b(' * @unused: not used for anything') self.b(' *') self.b(' * Tell dbus-glib that @proxy has the signatures of all') self.b(' * signals on the given interface, if it\'s one we') self.b(' * support.') self.b(' *') self.b(' * This function should be used as a signal handler for') self.b(' * #TpProxy::interface-added.') self.b(' */') self.b('static void') self.b('%s_%s_add_signals (TpProxy *self,' % (self.prefix_lc, self.group)) self.b(' guint quark,') self.b(' DBusGProxy *proxy,') self.b(' gpointer unused)') self.b('{') for node in nodes: iface = node.getElementsByTagName('interface')[0] self.iface_dbus = iface.getAttribute('name') name = node.getAttribute('name').replace('/', '').lower() self.iface_uc = name.upper() self.b(' if (quark == %s)' % self.get_iface_quark()) self.b(' %s_add_signals_for_%s (proxy);' % (self.prefix_lc, name)) self.b('}') self.b('') self.h('G_END_DECLS') self.h('') open(self.basename + '.h', 'w').write('\n'.join(self.__header)) open(self.basename + '-body.h', 'w').write('\n'.join(self.__body)) def types_to_gtypes(types): return [type_to_gtype(t)[1] for t in types] if __name__ == '__main__': options, argv = gnu_getopt(sys.argv[1:], '', ['group=', 'subclass=', 'subclass-assert=', 'iface-quark-prefix=']) opts = {} for option, value in options: opts[option] = value dom = xml.dom.minidom.parse(argv[0]) Generator(dom, argv[1], argv[2], opts)() telepathy-mission-control-5.16.4/ChangeLog0000644000175000017500000171350012762352250021602 0ustar00gkiagiagkiagia00000000000000commit 74d553d4125224f0a95c9d2843d38861b42eae9f Author: George Kiagiadakis Date: 2016-09-02 22:27:30 +0300 5.16.4 commit f576a9e8a125c16e3a562e3bb820707c1041af5c Author: Simon McVittie Date: 2014-03-20 12:53:39 +0000 dispatcher_delegate_channels: initialize am Otherwise, if we "goto error" too soon, we'll try to g_object_unref uninitialized memory. gcc doesn't spot that because we're using tp_clear_object, which uses an intermediate variable, and it doesn't propagate "uninitializedness" through assignments. commit 43afd2866bc38efe1b2cf27989df4e36ddd21201 Author: Simon McVittie Date: 2014-03-20 12:51:18 +0000 fix memory leaks: dbus_g_method_get_sender returns a copy We were semi-consistently using it wrong. commit e49b61b4e0f94f2e740ff5a0d231b43f37ab7d1b Author: George Kiagiadakis Date: 2016-09-01 21:50:50 +0300 Update NEWS commit 6a93bfeab23d64216cb5084f2d63c18f12ab6844 Author: George Kiagiadakis Date: 2016-09-01 21:19:34 +0300 tests: fix race condition in account-manager/avatar.py test It seems that the order of the dbus signals is unpredictable, so requiring it in the test sometimes makes it fail. It also seems that the other checks above in the same unit test have the same logic of not expecting a certain order in signal emission, so this is probably the right thing to do. commit 78d8c53b930323455bb7c4031903f46717b8a174 Author: George Kiagiadakis Date: 2016-08-15 11:37:24 +0300 tests: make tests work again when NM support is enabled Apparently the nm library also tries to access the /.../Settings object of NM, which was not available in our fake NM implementation. This commit implements the basic properties of the Settings object, which allows the tests to continue past this point. https://bugs.freedesktop.org/show_bug.cgi?id=96917 commit c5589bdc4ded0382adf6ba9ffc5c27f8a6e0568d Author: Ting-Wei Lan Date: 2016-01-11 15:07:56 +0800 mc-wait-for-name: Call setlocale in main function It is required to correctly show translated messages on some locales. https://bugs.freedesktop.org/show_bug.cgi?id=93661 commit cbe4ec1a4e1167ce8231849bcbbdec44d48422f2 Author: George Kiagiadakis Date: 2016-07-13 17:34:39 +0300 configure: do not enable upower support if upower is >=0.99 The code doesn't compile anymore, the features used have been removed. The replacement is logind, for which support exists in MC since 5.15.1. https://bugs.freedesktop.org/show_bug.cgi?id=70458 commit e732563380bda697c468b591ed126932b022d97f Author: George Kiagiadakis Date: 2016-07-01 18:43:28 +0300 configure: bump glib version requirement to 2.46 required for the fake-network-monitor in the unit tests https://bugs.freedesktop.org/show_bug.cgi?id=96763 Reviewed-by: Diane Trout commit d3e011a2dfaf6ecb41651de7ccc0d2bb520f3208 Author: George Kiagiadakis Date: 2016-07-01 18:31:21 +0300 tests/twisted/fake-network-monitor: implement the "network-metered" and "connectivity" properties of GNetworkMonitor "connectivity" is required since glib 2.44 "network-metered" is required since glib 2.46 https://bugs.freedesktop.org/show_bug.cgi?id=96763 Reviewed-by: Diane Trout commit 20dc94875afecacf086e57f67447e9384fb85d90 Author: Ting-Wei Lan Date: 2016-02-26 22:32:28 +0800 Don't initialize function pointers with G_TYPE_INVALID https://bugs.freedesktop.org/show_bug.cgi?id=94310 Reviewed-by: George Kiagiadakis commit 497e26593446d343105f594997ef0689aac4be4f Author: George Kiagiadakis Date: 2016-07-01 16:04:36 +0300 connectivity-monitor.c: fix unused variable warning when compiling without nm support This GError variable is not used anywhere else in this function. commit 91499340222a563bacce7994f32275c38ff55ff0 Author: Diane Trout Date: 2016-06-29 22:37:24 -0700 libnm-glib is deprecated and may not be available. This patch switches to use th enew libnm API, also snice nm_client_new now takes a GError, I thought I'd report the error message if mission control can't connect to the network manager. Additionally we can remove a definition of the NM_CHECK_VERSION macro for old versions of NM, as well as a guard for the NM_STATE_DISCONNECTING constant. commit 3d3a13c561e858853af5c601373be3ea0746f58c Author: Guillaume Desmottes Date: 2014-08-28 14:19:30 +0200 server: exit early if we failed to create McdService mcd_service_new() can return NULL if we didn't manage to connect to D-Bus. Best to handle this gracefully rather than crashing horribly. This is the top crasher on Ubuntu btw. https://errors.ubuntu.com/problem/7e2a5f9a379f34a347895782ae948177926a1932 commit 8f5a4fb823c1334e6d845aaa0c57f0fcffa42635 Author: Guillaume Desmottes Date: 2014-08-25 14:47:50 +0200 nano flag commit 84dc7d0fd952a9ef3d200ac5557cdf2daccca145 Author: Guillaume Desmottes Date: 2014-08-25 14:34:18 +0200 5.16.3 commit ab29ae42f751bf7e4ecc9a601e09cafab499fd14 Author: Steffen Kieß Date: 2014-08-25 14:11:35 +0200 mcd-connection: use tp_asv_new() properly The second argument has to be the type of the value. https://bugs.freedesktop.org/show_bug.cgi?id=81751 commit 810b32e92f2896a1ad8ee204bf6b8d5456a5db08 Author: Guillaume Desmottes Date: 2014-06-11 15:50:37 +0200 nano flag commit fb8000842e0b20f4aa4928edd62736b5cea2e8d5 Author: Guillaume Desmottes Date: 2014-06-11 15:44:01 +0200 5.16.2 commit 42c485ff56f5425cd592ae73c1c0e6c0f1de2b13 Author: Guillaume Desmottes Date: 2014-06-11 10:15:05 +0200 mcd_account_delete: make sure that the account stays alive Fix a regression introduced when backporting fix for https://bugs.freedesktop.org/show_bug.cgi?id=79827 commit 224443c1843ab0df7ef8ee1eda0409c35a4745a9 Author: Guillaume Desmottes Date: 2014-06-09 15:39:23 +0200 mcd-account: unregister the account once we're done deleting it The McdAccount object may still be alive for a short while because of pending async operations. We want to get rid of the D-Bus object as soon as possible and so, for example, a new Account object replacing the deleted one can be created. Fix https://bugs.freedesktop.org/show_bug.cgi?id=79827 commit 9c8e148e3ba00e53d0323aa75bdf6a5528968554 Author: Guillaume Desmottes Date: 2014-06-09 15:34:13 +0200 use G_STRFUNC in mission-control-plugins's DEBUG macro It's more useful when reading logs than G_STRLOC and that's what we already use in src/mcd-debug.h commit c86536f3b5fcc21eac60a836954d1aa002b67cc0 Author: Simon McVittie Date: 2014-01-30 13:04:56 +0000 codegen: avoid generating more than one thing in the same command As with telepathy-glib commit 36c2a545c9, a rule like this: _gen/x.c _gen/x.h: prerequisites $(AM_V_GEN)x-generator doesn't consider x.c and x.h together. Instead, it expands to two rules, one to generate x.c and one to generate x.h, which happen to run the same commands. This means that in the worst case, you can end up running x-generator twice in parallel, and they'll race with each other and overwrite or delete each other's output. Updated version of a patch from Ross Burton, taking into account that we now generate a separate header for the gtk-doc. I use the gtk-doc header as the one that "matters", because it's the last to be generated. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=69446 Reviewed-by: Guillaume Desmottes commit d4471ccad3163ee33fe5b5bd5947ca47ad01158a Author: Simon McVittie Date: 2014-01-29 19:24:54 +0000 NEWS commit a4bcc16f16f72d7a2b8fe74e715183b7b6985427 Author: Simon McVittie Date: 2014-01-28 16:28:16 +0000 mc-tool: fix setting automatic presence We were using the wrong finish-function. Reviewed-by: Guillaume Desmottes Bug: https://bugs.freedesktop.org/show_bug.cgi?id=74187 commit 84f1f56a114738c622bcd926868f5c232b3e6d8c Author: Simon McVittie Date: 2014-01-28 11:08:33 +0000 start 5.16.2 commit 53f6d1cf3fecd6667591a43bf511518f5a4b345f Author: Simon McVittie Date: 2014-01-27 14:51:36 +0000 forgot a NEWS entry commit 4eb0184ff5c7020cfcbada0ee66e4336158fc49e Author: Simon McVittie Date: 2014-01-27 12:25:18 +0000 5.16.1 commit 4d107b2c4b2a5161b6e113fb60e283017b700255 Author: Michael Kuhn Date: 2014-01-22 09:56:02 +0100 Release inhibitor on sleep and shutdown. Also fix a memory leak in login1_inhibit_cb. [The intention was to hold one "ref" to the inhibit fd for each connection that was waiting to disconnect, plus one "ref" for the idle state of "waiting to be notified by logind". We correctly took one "ref" per connection, but did not release the extra one. -smcv] Bug: https://bugs.freedesktop.org/show_bug.cgi?id=73599 Reviewed-by: Simon McVittie commit 07955827bba3ed6a6426ca4f2cb32efef2dc04c0 Author: John Brooks Date: 2013-12-12 15:46:27 -0700 Prevent assert for offline accounts with power saving Reviewed-by: Simon McVittie Bug: https://bugs.freedesktop.org/show_bug.cgi?id=72652 commit 0932dba29fa9de8e7268a924c4c93ccebb7dc65c Author: Sebastien Bacher Date: 2013-12-04 18:34:30 +0100 reset the error to NULL, so the next call is working [fixed argument type -smcv] Reviewed-by: Simon McVittie Bug: https://bugs.freedesktop.org/show_bug.cgi?id=72138 commit 51eb9027ec1b72591166ecde65793c9f5877ac16 Author: Guillaume Desmottes Date: 2013-11-26 10:19:54 +0100 connectivity-monitor: start watching 'use-conn' key in constructed We have to wait for the default GObject properties to be set before calling g_settings_bind(). If we don't, they override the value fetched from GSettings. commit f1de10a0f71638da502a77cae189b5fa6a047be6 Author: Simon McVittie Date: 2013-10-02 18:48:17 +0100 5.16.0+ commit 739b5414ec3fe1fc7896d34f09f510a9e8029473 Author: Simon McVittie Date: 2013-10-02 17:54:18 +0100 5.16.0 commit 52a6ac31f6d3b52332f6678c67c0c6013adf4c17 Author: Simon McVittie Date: 2013-10-02 17:40:58 +0100 Upload documentation to the 5.16.x location commit 9d74acccde6b41a9e06c115def43bbea77efacf9 Author: Simon McVittie Date: 2013-10-02 17:40:57 +0100 Don't warn on deprecated declarations, this is a stable branch. commit 41f675da7cd97b9a3771881c22788e73eb99f99a Author: Simon McVittie Date: 2013-10-02 17:41:55 +0100 Don't check documentation completeness in this stable branch commit 17a5d31769e9da52797df968c8881732f29d0f45 Author: Simon McVittie Date: 2013-10-02 16:33:42 +0100 NEWS: adjust note about ServerAuthentication handlers rishi pointed out on IRC that ServerAuthentication still makes passwords available to eavesdroppers on the session bus (if LOGIN, PLAIN or X-TELEPATHY-PASSWORD are used). ServerAuthentication doesn't allow arbitrary applications to ask MC "what is the password for account X?", which is what I was thinking of. The session bus is not generally modelled to be a security boundary; if yours is, you will need to write a security policy, then ensure that that policy is applied. Telepathy components are not designed to be used unmodified on an untrusted session bus. (Starting points include turning off eavesdropping, applying a "default-deny" policy, preventing processes other than Mission Control from calling HandleChannels on your ServerAuthentication client, and preventing processes from subverting each other with ptrace.) commit d0af8d654ae439a1a333c33f6e44084d3dad2afb Author: Simon McVittie Date: 2013-10-02 13:44:10 +0100 avatar-refresh test: subsume avatar-persist, and test more situations We have some sort of combinatorial explosion going on here, and it seems best to test it in a somewhat systematic way: * is the protocol one where avatars persist on the server (Gabble) or not (Salut)? * if it's like Gabble, does it download our own avatar token before signalling CONNECTED (as I suspect Haze does), or on-demand after GetKnownAvatarTokens (as Gabble appears to)? * if it's like Gabble, is the server storing an avatar for us? * in either case, do we have an avatar stored locally, and has it previously been uploaded or not? In addition, the avatar-refresh and avatar-persist tests exercised migration from ~/.missioncontrol and a low-priority XDG_DATA_DIRS entry (respectively) to ~/.local/share. I didn't do that in a loop, because it isn't applicable in all cases and would lead to even more combinations - testing each case once should be enough. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=69885 Reviewed-by: Guillaume Desmottes [cherry-picked from master commit d780671 plus the test part of 4f4ed24, adjusted for old constant naming and to replace unforbid_all() with unforbid_events() -smcv] Conflicts: tests/twisted/account-manager/avatar-persist.py tests/twisted/account-manager/avatar-refresh.py commit b89f6fe0bcacef9340f633ab09b275122c6db644 Author: Simon McVittie Date: 2013-10-02 13:08:45 +0100 Implement Contacts properly on SimulatedConnection, and fix tests Bug: https://bugs.freedesktop.org/show_bug.cgi?id=69885 Reviewed-by: Guillaume Desmottes [Cherry-picked from commit 15510bd on master. -smcv] Conflicts: tests/twisted/constants.py tests/twisted/mctest.py commit 54b9660d32a611100b87fedde559ebb1d4ec35a5 Author: Simon McVittie Date: 2013-10-02 12:58:31 +0100 McdAccount: go back to using GetKnownAvatarTokens Sadly, contact attributes aren't enough to distinguish between "this protocol doesn't store avatars and you haven't re-sent your avatar since you last connected", "this protocol stores avatars but the CM hasn't checked for your current avatar yet", and "this protocol stores avatars, but there is no avatar on the server for you". GetKnownAvatarTokens specifically excludes the middle option (blocking on a server round-trip if it needs to), and uses "avatar token missing" for the first and "avatar token empty" for the last. Tested to work with the telepathy-glib 0.20 branch, and with the 0.22 branch when fdo#70010 is fixed. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=69885 Reviewed-by: Guillaume Desmottes [This is a cherry-pick of commit 4f4ed24 from master, omitting the regression test change, to make sure the existing tests still pass -smcv] commit 9fa3c65e038f66dcf4c28bd10a26680229c2843c Author: Simon McVittie Date: 2013-09-20 12:59:50 +0100 Update extension interfaces to their telepathy-spec 0.27.1 versions No functional changes. The remaining interfaces (A.I.Conditions, CD.I.Messages) are still not in telepathy-spec at all. :-( commit 6a24c5e5d0a95dd11b82956c1186092bab617701 Author: Simon McVittie Date: 2013-09-20 12:54:38 +0100 Update CHECK_FOR_UNRELEASED to check the right files commit 972b515a0294d78c7a34dfe8ebd0f6a8e6f415e7 Author: Simon McVittie Date: 2013-09-20 12:53:28 +0100 Fix a wrong deprecation annotation commit 439309bfede3afe68469f39bbde332ff5f668ba6 Author: Simon McVittie Date: 2013-09-20 12:49:27 +0100 Document the new test logging arrangement Bug: https://bugs.freedesktop.org/show_bug.cgi?id=69585 commit 089c6a1562a74b86f7e60c87d43abc1c7a6cb446 Author: Simon McVittie Date: 2013-09-19 19:41:27 +0100 connectivity test: make sure we've caught up on GDBus messages Otherwise, the message from the FakeNetworkMonitor saying we've gone offline might not be received until after the message from the fake NM saying we've gone online - which would be a problem. There's no side-effect we can wait for here, so we just have to make sure the GDBus queue has been processed. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=69585 Reviewed-by: Guillaume Desmottes commit eb6a6bf52c1ed476f6dab871cad491d3fff5c8f5 Author: Simon McVittie Date: 2013-09-19 19:39:24 +0100 connectivity_monitor_nm_state_change_cb: if NM says DISCONNECTED, believe it Bug: https://bugs.freedesktop.org/show_bug.cgi?id=69585 Reviewed-by: Guillaume Desmottes commit 5336208b2848c810c0e9168cc629f9a63593f9ac Author: Simon McVittie Date: 2013-09-19 19:44:03 +0100 Log verbose test output and give it the same treatment as MC's log Bug: https://bugs.freedesktop.org/show_bug.cgi?id=69585 Reviewed-by: Guillaume Desmottes commit 38bbbf49bd1e357d1a4a9e6508c718c5edb9baf7 Author: Simon McVittie Date: 2013-09-19 18:48:38 +0100 run-test.sh.in: dump logfiles to stdout on failure This is a lot of very spammy output, but the failures are basically undebuggable without it, so... Bug: https://bugs.freedesktop.org/show_bug.cgi?id=69585 Reviewed-by: Guillaume Desmottes commit 83d08c87a251824f6f5f52037e1f79587bc9446c Author: Simon McVittie Date: 2013-09-19 19:43:29 +0100 run-test.sh.in: now that we run under 'set -e', catch failures If we just let with-session-bus.sh exit nonzero, the script aborts. We want to catch the nonzero exit status and do some more things before failing. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=69585 Reviewed-by: Guillaume Desmottes commit 79e1df1b5818e3bb323b040a708f3d91d616d2d6 Author: Simon McVittie Date: 2013-09-19 15:22:25 +0100 Nano version commit 2bd064c78030932544ceca652510c526f6f001dd Author: Simon McVittie Date: 2013-09-19 14:37:22 +0100 5.15.1 (5.16 rc1) commit c3cba937c429b7121270b19734a669211bebba19 Author: Simon McVittie Date: 2013-09-19 14:22:13 +0100 Put Autoconf, Automake, Libtool droppings in /build-aux Bug: https://bugs.freedesktop.org/show_bug.cgi?id=69542 Reviewed-by: Guillaume Desmottes commit 04a2f757879caf21d474c03a5728ec5e1ffe7c29 Author: Simon McVittie Date: 2013-09-18 19:42:56 +0100 document MC_TEST_KEEP_TEMP Bug: https://bugs.freedesktop.org/show_bug.cgi?id=69542 Reviewed-by: Guillaume Desmottes commit 3dcc0f4ebb90b80c8ee39794a65e906013d692a5 Author: Simon McVittie Date: 2013-09-18 19:23:52 +0100 mcd_account_self_contact_upgraded_cb: don't crash on bad timing If the account is disconnecting, we might get the callback for upgrading after we've already NULLed out self->priv->self_contact. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=69542 Reviewed-by: Guillaume Desmottes commit af998be5e6638671d05097176c7405258b30e315 Author: Simon McVittie Date: 2013-09-18 19:04:40 +0100 tests: cd into the directory from which we were run dbus-daemon does a chdir("/") for activated services. We want to undo that, and put our logs (and core dumps, if any) in a more obvious place. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=69542 Reviewed-by: Guillaume Desmottes commit cfb5810baf0b6f28223d2ebf7b9c20eddf2940cf Author: Simon McVittie Date: 2013-09-18 17:00:35 +0100 Tests: clean up all built sources Bug: https://bugs.freedesktop.org/show_bug.cgi?id=69542 Reviewed-by: Guillaume Desmottes commit 545ffc1f455a14bea9f77497a009ec6811bae6c7 Author: Simon McVittie Date: 2013-09-18 16:00:49 +0100 tests: write logs to MC_TEST_LOG_DIR, with latest log in `pwd` This makes the logs' location rather more obvious. Not altering MC's working directory also means the core dump (if any) comes out in tests/twisted, which makes sense, instead of tests/twisted/tools, which doesn't. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=69542 Reviewed-by: Guillaume Desmottes commit 30dc2928196aefd112db7047a98900c047f27bae Author: Simon McVittie Date: 2013-09-18 15:07:33 +0100 run-mc.sh.in: set DBUS_SYSTEM_BUS_ADDRESS This is used in the "installed" case, and this change is necessary to catch up with exec-with-log.sh.in in the "uninstalled" case. We want to use the fake NetworkManager, ConnMan etc., not the real ones. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=69542 Reviewed-by: Guillaume Desmottes commit 1978058f83f3bb30196985302fd917cb43473cfa Author: Simon McVittie Date: 2013-09-18 15:27:42 +0100 Always use run-test.sh to run tests There are three modes here: - make check: run tests in ${srcdir} against MC in ${builddir} - make installcheck: run tests in ${srcdir} against MC in ${DESTDIR}${prefix} - ${mctestsdir}/twisted/run-test.sh: run tests in ${mctestsdir} against MC in ${prefix} Also simplify the last of those cases, and avoid a potential symlink attack, by requiring that the current working directory for run-test.sh is a directory controlled by us. In practice we already required that, because with-session-bus.sh creates files in the current directory. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=69542 Reviewed-by: Guillaume Desmottes commit 2d769630290d17c20c0db1e32c61a725c6559fb7 Author: Simon McVittie Date: 2013-09-18 12:39:04 +0100 installcheck-twisted: test the just-installed MC if using a DESTDIR Bug: https://bugs.freedesktop.org/show_bug.cgi?id=69542 Reviewed-by: Guillaume Desmottes commit 12ecdbabc19628e19109666d8534ce6d99035a95 Author: Simon McVittie Date: 2013-09-18 12:45:29 +0100 Ignore /test-driver, installed by Automake 1.13 Bug: https://bugs.freedesktop.org/show_bug.cgi?id=69542 Reviewed-by: Guillaume Desmottes commit cc2af09f608511bf316e94e4462ff041406c455b Author: Simon McVittie Date: 2013-09-18 14:07:57 +0100 Flag printf-ish functions with G_GNUC_PRINTF and fix resulting warnings In particular, mcd-account-manager-default could crash when migrating an account, since it would dereference arbitrary stack contents as a pointer-to-string. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=69542 Reviewed-by: Guillaume Desmottes commit fe1e8ce4b830f665fbe098b1928969d26c553441 Author: Simon McVittie Date: 2013-09-10 12:00:14 +0100 _mcd_channel_depart: use tp_channel_leave_async or tp_channel_close_async This avoids some deprecated APIs, and is considerably simpler. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=55391 Bug: https://bugs.freedesktop.org/show_bug.cgi?id=55392 Signed-off-by: Simon McVittie Reviewed-by: Xavier Claessens commit 966ca2d58f87f9cfa7b1551885dd2f160971e19b Author: Simon McVittie Date: 2013-09-09 18:19:58 +0100 Switch from tp_g_key_file_get_[u]int64 to g_key_file_get_[u]int64 Bug: https://bugs.freedesktop.org/show_bug.cgi?id=69146 Reviewed-by: Xavier Claessens commit 9219b4282cc9c6465dc1f9efd9e549c97bc6e3a9 Author: Simon McVittie Date: 2013-09-09 17:21:47 +0100 Service points: use tp_connection_dup_contact_by_id_async tp_connection_request_handles is deprecated. Ideally, we should drop this whole chunk of code, but it seems best to save that for Telepathy 1.0. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=55391 Reviewed-by: Xavier Claessens commit 74744b3a1b792895089d5104109e3b56eeedea11 Author: Simon McVittie Date: 2013-09-09 17:19:58 +0100 McdConnection: use tp_simple_client_factory_ensure_connection This means we need to pass the client factory through the McdManager from the McdMaster, so, do. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=55391 Reviewed-by: Xavier Claessens commit a9afabf2a6219f27038b34e29d36cc20dd2965eb Author: Simon McVittie Date: 2013-02-13 15:01:54 +0000 Deprecate mcp_dispatch_operation_leave_channels It was designed for StreamedMedia, and is the wrong thing for Call. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=55391 Reviewed-by: Xavier Claessens commit 9becae7459f2762217f08eadc53ac0f9a85ab693 Author: Simon McVittie Date: 2013-09-03 19:44:08 +0100 List Service and Hidden in create-time account properties Also test them. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=33127 Reviewed-by: Guillaume Desmottes commit 82abc7249f071d86b3ac7b9e5a7f9815372c041b Author: Simon McVittie Date: 2013-09-05 15:31:29 +0100 Remove further remnants of gnome-keyring support Bug: https://bugs.freedesktop.org/show_bug.cgi?id=32578 Reviewed-by: Guillaume Desmottes commit a7d10e5e24129a608d3d3f00cfdeae67c9f745be Author: Simon McVittie Date: 2013-09-05 15:07:10 +0100 NEWS commit 05fcc81b1684975e9d20a4ecba55f46b11ccd7e8 Author: Simon McVittie Date: 2013-09-05 15:01:02 +0100 drop unused variables commit b0eedd06b5b9f51de060d91ca6eab0c3d2061d09 Author: Simon McVittie Date: 2013-08-28 14:44:58 +0100 Remove gnome-keyring support Bug: https://bugs.freedesktop.org/show_bug.cgi?id=32578 Reviewed-by: Marco Barisione commit 0c905a9ad4f3a90ed97e16a360097f17be777887 Author: Simon McVittie Date: 2012-10-08 19:34:22 +0100 Add a regression test for service-points (matched by identifier) The side-effect they have within MC is that plugins aren't allowed to delay or reject channel requests; we ought to test that, really. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=55773 Reviewed-by: Marco Barisione commit 8198d1ec4a318338d02800cf6d021734e7590daa Author: Simon McVittie Date: 2012-10-08 19:33:15 +0100 McdConnection: build up our sets of emergency numbers over time To facilitate this, use nicer data structures. Most importantly, this means we don't critical whenever we get more than one distinct service point, as Jonny noticed while porting to Telepathy 1.0. It might slightly defeat the intention of the ServicePointsChanged signal, but in practice the list is probably never going to shrink, and if it does, it's probably wise to keep considering its old members to be an emergency number (the effect that that has is that plugins aren't allowed to influence channel requests). Also, don't leak the sets of emergency numbers when finalized. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=55773 Reviewed-by: Marco Barisione commit edf39cf46747c269dcd1470b92185601fb898f99 Author: Simon McVittie Date: 2013-09-04 13:36:09 +0100 Drop fake-network-monitor.h from SOURCES It doesn't exist, and breaks distcheck. commit 2f3f113042ad117f35e2ebb2a26556b2c550e8af Author: Simon McVittie Date: 2013-08-28 15:36:14 +0100 Add a regression test for a "no SimplePresence" special case CurrentPresence should toggle between OFFLINE and UNSET if the account has no concept of presence. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=68905 Signed-off-by: Simon McVittie Reviewed-by: Guillaume Desmottes commit 6e88e909f5f1cb4b0f0d33f88b26f5cb6d3fc9c7 Author: Simon McVittie Date: 2013-08-28 15:35:38 +0100 Track presence via TpContact, not McdConnection Now that McdAccount has a TpContact for the self-contact, this is really easy. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=68905 Signed-off-by: Simon McVittie Reviewed-by: Guillaume Desmottes commit c5e96690fd558b4de8de794bce04fb3937b03799 Author: Simon McVittie Date: 2013-09-03 19:16:32 +0100 Add CONNECTIVITY_NONE, and make state transitions clearer Bug: https://bugs.freedesktop.org/show_bug.cgi?id=68758 Signed-off-by: Simon McVittie Reviewed-by: Guillaume Desmottes commit 425a6cb46cabf35bde272f99c5b8260b29a70201 Author: Simon McVittie Date: 2013-09-03 19:06:06 +0100 McdConnectivityMonitor: comment how McdInhibit works Bug: https://bugs.freedesktop.org/show_bug.cgi?id=68758 Signed-off-by: Simon McVittie Reviewed-by: Guillaume Desmottes commit 3a2a10d424c3033aabd5eb830321cfad852077ae Author: Simon McVittie Date: 2013-09-02 15:24:22 +0100 Listen to systemd sleep/shutdown signals, and inhibit until disconnected Bug: https://bugs.freedesktop.org/show_bug.cgi?id=68758 Signed-off-by: Simon McVittie Reviewed-by: Guillaume Desmottes commit d50b659542f829ccd411828a35a53c5f4678c581 Author: Simon McVittie Date: 2013-08-29 16:55:06 +0100 Remove unused signal McdAccount::connection-process Bug: https://bugs.freedesktop.org/show_bug.cgi?id=68712 Signed-off-by: Simon McVittie Reviewed-by: Guillaume Desmottes commit 7220e55986ca13ac14bb56bae51986e21be892af Author: Simon McVittie Date: 2013-08-29 16:53:47 +0100 Remove the remains of McdTransportPlugin Bug: https://bugs.freedesktop.org/show_bug.cgi?id=68712 Signed-off-by: Simon McVittie Reviewed-by: Guillaume Desmottes commit ea78c344fce0373188ac5549f664da0a6de1f500 Author: Simon McVittie Date: 2013-08-29 16:48:40 +0100 _mcd_master_account_replace_transport: inline into caller and simplify There's only one transport plugin, it only has one transport, and its state is basically boolean, so we can delete a lot of code. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=68712 Signed-off-by: Simon McVittie Reviewed-by: Guillaume Desmottes commit 3ec7b1947bf5c595edc1f2329aa6ce7b9feda816 Author: Simon McVittie Date: 2013-08-29 16:41:54 +0100 mcd_master_connect_automatic_accounts: move to McdAccountManager Iterating over all accounts? Looks like a job for the account manager. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=68712 Signed-off-by: Simon McVittie Reviewed-by: Guillaume Desmottes commit cb99598acaa71edd6efcedadaaff3103acf76571 Author: Simon McVittie Date: 2013-08-29 16:41:22 +0100 McdAccount: respond to connectivity status changes Instead of proxying through the transport plugin and the McdMaster, just watch the McdConnectivityMonitor. Much simpler! Bug: https://bugs.freedesktop.org/show_bug.cgi?id=68712 Signed-off-by: Simon McVittie Reviewed-by: Guillaume Desmottes commit 1ed0e969eadfa4a5c9d7e3156413588d6b083d09 Author: Simon McVittie Date: 2013-08-29 16:28:45 +0100 Move "waiting for connectivity" functionality into McdAccount Bug: https://bugs.freedesktop.org/show_bug.cgi?id=68712 Signed-off-by: Simon McVittie Reviewed-by: Guillaume Desmottes commit e076d7f16e23cd7246a20a45164a71d9e53058af Author: Simon McVittie Date: 2013-09-03 18:40:06 +0100 McdAccount: have a reference to the connectivity monitor Bug: https://bugs.freedesktop.org/show_bug.cgi?id=68712 Signed-off-by: Simon McVittie Reviewed-by: Guillaume Desmottes commit e2bcc5b94496d755c28490f28925da6f54a4cf4d Author: Simon McVittie Date: 2013-09-03 18:39:36 +0100 Put the connectivity monitor in the McdAccountManager Bug: https://bugs.freedesktop.org/show_bug.cgi?id=68712 Signed-off-by: Simon McVittie Reviewed-by: Guillaume Desmottes commit 957795838715b3b95f2bf8bc116b2328bf6a2881 Author: Simon McVittie Date: 2013-08-29 15:38:53 +0100 Remove the concept of binding accounts to transports We only have one transport now, so there are two options: either the account is a special one that "needs dispatch" and also bypasses the transport check (in practice this means cellular accounts), or it is connected via the Internet. Binding accounts to transports never made a vast amount of sense. If we have many parallel Internet connections (e.g. wired + wifi + cellular + VPN), Mission Control can't know which one a Connection is relying on - only the connection manager can know that - so we have to err on the side of disconnecting everything on a connectivity change anyway. A possible refinement in future Tp versions would be a way for a CM to tell MC "this connection does its own connectivity-monitoring, so don't kick it when we get disconnected". For now, we assume that everything needs the Internet, unless it's one of the accounts that wouldn't previously have been bound to a connection (i.e. _mcd_account_needs_dispatch() returns FALSE). Bug: https://bugs.freedesktop.org/show_bug.cgi?id=68712 Signed-off-by: Simon McVittie Reviewed-by: Guillaume Desmottes commit 7c598edf86939a630c9fb51c030bf4d1436e56a6 Author: Simon McVittie Date: 2013-08-28 16:52:04 +0100 mcd_operation_take_mission, _remove_mission: do not be virtual Nothing overrides them, they're no longer API, and one day I'd like to get rid of McdOperation entirely. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=68712 Signed-off-by: Simon McVittie Reviewed-by: Guillaume Desmottes commit 0327ccfcf5047aa785f6c127296817d6b7e73c05 Author: Simon McVittie Date: 2013-09-03 18:28:45 +0100 Update NEWS, and note the bug number of an older bug commit e6974e3dac274982dedcb5451106473dea3294fd Author: Simon McVittie Date: 2013-08-29 16:59:08 +0100 McdConnectivityMonitor: take responsibility for monitoring use-conn I want to get rid of the kludge-transport. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=68712 Signed-off-by: Simon McVittie Reviewed-by: Guillaume Desmottes commit e9c73ea3f027d2f156bcbcabab722e17221afbed Author: Simon McVittie Date: 2013-08-28 17:49:54 +0100 McdMaster: remove support for writing account-manager property Nothing constructs a McdMaster with a non-default McdAccountManager. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=68712 Signed-off-by: Simon McVittie Reviewed-by: Guillaume Desmottes commit 289c461e9c5020a4da70dc12d066a61af2276b41 Author: Simon McVittie Date: 2013-08-29 15:22:45 +0100 Remove support for checking conditions on accounts We no longer have API for external transport providers, and we've never defined any conditions on the transport provider we do have. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=68712 Signed-off-by: Simon McVittie Reviewed-by: Guillaume Desmottes commit 327f0bd220aacb909e9ecde066121f3ca0f65f35 Author: Simon McVittie Date: 2013-08-28 16:51:18 +0100 Remove various useless virtual method padding This part of Mission Control is no longer API. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=68712 Signed-off-by: Simon McVittie Reviewed-by: Guillaume Desmottes commit 3d77940b7b2b7394a695a46efc008dc31e85b45d Author: Simon McVittie Date: 2013-08-28 16:42:47 +0100 mcd_master_create_manager: unvirtualize There's no point in this being virtual: there are no subclasses, and it isn't API any more. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=68712 Signed-off-by: Simon McVittie Reviewed-by: Guillaume Desmottes commit 68f45847f9a3259be4fcb7a8d5647c46109b6c0e Author: Simon McVittie Date: 2013-08-28 16:40:38 +0100 McdMaster: use modern idiom for priv Bug: https://bugs.freedesktop.org/show_bug.cgi?id=68712 Signed-off-by: Simon McVittie Reviewed-by: Guillaume Desmottes commit 3ad533ac34481c4305a9093687f8042757a6cf96 Author: Simon McVittie Date: 2013-04-30 17:29:40 +0100 Replace ConnMan connectivity support with GNetworkMonitor The information we're getting from ConnMan is no more informative than GNetworkMonitor, and a ConnMan GNetworkMonitor implementation exists (e.g. ), so we might as well go via that. On NetworkManager systems, we now use NetworkManager to detect transient states like DISCONNECTING, but use the GNetworkMonitor to detect whether the interface is up. If NetworkManager is the only thing managing an interface, that makes no difference, but if there is an interface not managed by NetworkManager, the default netlink GNetworkMonitor will say we're online even while NM is DISCONNECTED, which is what we want. On non-NetworkManager, non-ConnMan systems where netlink works, netlink will tell us at least the basics of what's going on, and we can avoid trying to connect while there is no Internet route. On systems without a working GNetworkMonitor, GIO's default implementation will say "yes, you are online" at all times, which is no worse than we had previously. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=56635 Signed-off-by: Simon McVittie Reviewed-by: Guillaume Desmottes commit 2f94a6529c60cdd01e8418cabfe92fc4bccd6b34 Author: Simon McVittie Date: 2013-04-30 16:37:28 +0100 Add a fake GNetworkMonitor, using a subset of the ConnMan D-Bus API Bug: https://bugs.freedesktop.org/show_bug.cgi?id=56635 Signed-off-by: Simon McVittie Reviewed-by: Guillaume Desmottes commit eb0b99097edaa27a381c79733cd121d3ce68565d Author: Simon McVittie Date: 2013-04-30 16:54:14 +0100 Split connectivity state into the concepts of "up" and "stable" ConnMan and GNetworkMonitor only give us two states: either we have some level of Internet connectivity, or we don't. NetworkManager adds a third category of states (CONNECTING, DISCONNECTING, ASLEEP): "you might have connectivity, but things are changing, so you might want to disconnect now". I've represented this as "not stable". The flag is deliberately "stable", not "unstable", so that all the boolean flags have the same sense: if they are TRUE, we're "more connected". Bug: https://bugs.freedesktop.org/show_bug.cgi?id=56635 Signed-off-by: Simon McVittie Reviewed-by: Guillaume Desmottes commit 5dbd8df6bd212ede2075dce3cbf3a6b5ebf4e8d3 Author: Simon McVittie Date: 2013-04-30 17:08:08 +0100 Add a regression test for NetworkManager's "not quite offline" states We were only testing the intersection of ConnMan and NM functionality, but NM actually has a bit more. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=56635 Signed-off-by: Simon McVittie Reviewed-by: Guillaume Desmottes commit 01ee75652ec19b94681147ec0700d502bafb6e78 Author: Simon McVittie Date: 2013-05-03 15:39:51 +0100 resume development commit 76c328175300821b1a2554391f0143c4d54fb779 Author: Simon McVittie Date: 2013-05-03 15:02:59 +0100 Prepare 5.15.0 commit 7877d99ed2f9ff2cd0888e8f762ebad932852767 Author: Simon McVittie Date: 2013-05-03 13:01:44 +0100 McdSlacker: don't crash if SessionManager is absent or StatusChanged has no parameters Bug: https://bugs.freedesktop.org/show_bug.cgi?id=62530 Reviewed-by: Xavier Claessens commit 1d3403089ab01ff5b5056cd360d5469099d0ff08 Author: Xavier Claessens Date: 2013-05-02 18:05:50 +0200 McdSlacker: Use org.gnome.SessionManager DBus service MCE is a long dead Nokia closed source service for Maemo. This rewrites McdSlacker using GDBus and the much more useful GNOME SessionManager service. That interface is implemented in both gnome-shell and unity desktops. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=62530 commit d0419b28aa3ad45fa8f92b477ac65c32012b937b Merge: d7423ba 712ddaf Author: Simon McVittie Date: 2013-05-03 12:28:30 +0100 Merge branch 'telepathy-mission-control-5.14' Conflicts: NEWS configure.ac commit 712ddaf9b57fdc03e0c6b0b2c45ec04eaf135248 Author: Simon McVittie Date: 2013-05-03 12:25:45 +0100 resume development commit b613401b8f238ed633e72691d5a6716fdcaf9ee1 Author: Simon McVittie Date: 2013-05-03 11:54:47 +0100 Prepare 5.14.1 commit d7423ba7794f57380440ffbf485462653bc060c0 Merge: 7da30dc 57b73f8 Author: Simon McVittie Date: 2013-05-01 20:00:20 +0100 Merge branch 'telepathy-mission-control-5.14' Conflicts: NEWS commit 57b73f8f22f0e7fbc4b37c994ba0c96ec52b8c01 Author: Simon McVittie Date: 2013-05-01 19:55:15 +0100 NEWS for 5.14 commit 9e89a8ed3c54ad4c9ad9cc939c995a7196037889 Author: Simon McVittie Date: 2013-01-16 17:15:01 +0000 Only ignore passwords in gnome-keyring if Empathy has copied them When passwords are stored in the Parameters by MC and no SASLAuthentication handler is used, e.g. under Sugar, we currently save passwords into gnome-keyring, if enabled at compile time; so, we want to read them back out of gnome-keyring. This conflicts slightly with wanting to ignore passwords in gnome-keyring that are left over from an Empathy 3.0 schema migration that failed due to fd.o #42088. To avoid failure to authenticate/re-prompt if the password has been changed on the service side, ignore passwords that are going to be deleted; but to avoid breaking Sugar, don't ignore any other passwords we might find in gnome-keyring. Signed-off-by: Simon McVittie Bug: https://bugs.freedesktop.org/show_bug.cgi?id=59468 commit 7da30dceb86e3bc38679e18e6deb30e82c877692 Merge: c244460 07d5735 Author: Simon McVittie Date: 2013-04-30 13:11:37 +0100 Merge branch 'telepathy-mission-control-5.14' Conflicts: NEWS commit 07d5735d63a0dd1102fcec454159aad36cdbe30a Author: Simon McVittie Date: 2013-04-30 13:09:05 +0100 NEWS for 5.14 commit 1b45aa774e0869c10275adf5c02b778d48b7a2b7 Author: Nuno Araujo Date: 2013-01-18 22:47:00 +0100 Fix the build with automake 1.13 In Automake 1.13, the long-deprecated macro AM_CONFIG_HEADER (deprecated since 2002) has been removed in favour of AC_CONFIG_HEADERS. Reviewed-by: Simon McVittie Bug: https://bugs.freedesktop.org/show_bug.cgi?id=59605 commit c244460e5179ac4089fcb3a2c1c1949fdbf20a35 Author: Simon McVittie Date: 2013-04-30 12:49:23 +0100 tests: avoid an out-of-range int literal In this particular test case, the expected result according to the flags is "it fails", so the second column (expected converted value) is not relevant. This apparently causes build warnings (fatal by default) on ILP32 platforms, because 2147483648 is out-of-range for a signed int or signed long on such platforms. It's certainly also out-of-range for the struct member it's initializing, which is a gint32. Signed-off-by: Simon McVittie Reviewed-by: Guillaume Desmottes Bug: https://bugs.freedesktop.org/show_bug.cgi?id=64083 commit 305be4e9c3fe0eb04b46ecaee7789935e2445dbd Author: Simon McVittie Date: 2013-04-30 12:14:03 +0100 NEWS commit 393d6c8b6e64c487c8a426443d3b285c35093dce Author: Joshua Lock Date: 2013-04-24 16:09:46 -0700 connectivity-monitor: ConnMan Services with ready State are online A ConnMan Service is connected if it has a State of online or ready. [This can matter if your only connectivity to the outside world is through a proxy, in which case the State will remain 'ready' but Telepathy accounts might be usable anyway. -smcv] Signed-off-by: Joshua Lock Reviewed-by: Simon McVittie commit e7511f28cd233213457f9d712d1441add2500546 Merge: 72cdbb7 cdfea3c Author: Simon McVittie Date: 2013-04-04 16:45:46 +0100 Merge branch 'telepathy-mission-control-5.14' commit cdfea3c5a600a18f2621c6249a374951496685ba Author: Simon McVittie Date: 2013-04-04 16:43:23 +0100 Merge fd.o #63119 from telepathy-glib Bug: https://bugs.freedesktop.org/show_bug.cgi?id=63119 commit 72cdbb73d092de176fed47508f108fed8d4627c6 Author: Simon McVittie Date: 2013-02-13 14:44:51 +0000 More NEWS commit edd77d23975fabc9a33779cc4011dd84122c9b2e Merge: 75ce9cd 0fda3bd Author: Simon McVittie Date: 2013-02-13 14:36:42 +0000 Merge branch 'altered-one-54780' Bug: https://bugs.freedesktop.org/show_bug.cgi?id=54780 Reviewed-by: Will Thompson [deleted a stray line from a comment as per wjt's review -smcv] Conflicts: src/mcd-account.c commit 75ce9cdd98c102643ff3eddedf4cf328d034d283 Author: Simon McVittie Date: 2013-02-13 14:33:11 +0000 More NEWS for 5.15 commit 16f3e22820de84e7227dee7b85a690bdc1d561e0 Merge: 5aeddb8 06a09cf Author: Simon McVittie Date: 2013-02-13 14:20:16 +0000 Merge branch 'mock-account-store-54873' Bug: https://bugs.freedesktop.org/show_bug.cgi?id=54873 Reviewed-by: Will Thompson Conflicts: tests/twisted/account-manager/avatar.py commit 5aeddb8e0a314780585af7b8f19896a2be9815d4 Merge: 128ceb7 3975989 Author: Simon McVittie Date: 2013-02-13 14:13:42 +0000 Merge branch 'typed-settings-54872' Reviewed-by: Will Thompson Bug: https://bugs.freedesktop.org/show_bug.cgi?id=54872 [amended to add GLib 2.32 dependency -smcv] Conflicts: src/mcd-account.c commit 128ceb7d37ff5847a9e79f2bafa6127ae97f585b Author: Simon McVittie Date: 2013-01-09 14:14:01 +0000 NEWS for 5.15 commit 5047dc72737b9fcb2f1310f9b5cf8e5719a6fe52 Author: Simon McVittie Date: 2013-01-09 14:01:57 +0000 Clean all generated files, so we can distcheck successfully commit 4ab810e7f3d7458bdd02549f631ee402ec6862a3 Author: Simon McVittie Date: 2013-01-09 12:05:13 +0000 Communicate the detailed error from McdConnection to McdAccount In particular, this propagates the error from RequestConnection failing correctly, so add a regression test for that. Reviewed-by: Guillaume Desmottes Bug: https://bugs.freedesktop.org/show_bug.cgi?id=39334 commit d9d0d64c5046668a0e7dc261216672143a699559 Author: Simon McVittie Date: 2012-10-09 16:00:48 +0100 Remove McdAccount::connection-status-changed signal Nothing listens to it. Reviewed-by: Guillaume Desmottes Bug: https://bugs.freedesktop.org/show_bug.cgi?id=39334 commit 9c038fb370c25a2fb87fd80e71b4591cb81c5fa5 Author: Guillaume Desmottes Date: 2013-01-07 16:18:09 +0100 account-addressing: fire PropertiesChanged on URISchemes change commit 4b5ccf8a74f6c80d4a9787fcaec445327d589800 Author: Guillaume Desmottes Date: 2013-01-08 13:53:06 +0100 addressing.py: 'mailto' is the proper URI scheme commit e34842e2101a54dc90d7496999da10f62c392d30 Author: Will Thompson Date: 2013-01-09 09:51:07 +0000 Bump tp-glib dependency for tp_vardict_get_* a5a5d850 started using these functions, which were introduced in telepathy-glib 0.20.0. commit 060e148bd71f3989861ab374dba89cc20278fcec Author: Cosimo Cecchi Date: 2012-11-15 12:04:30 -0500 build: honor NOCONFIGURE in autogen.sh Like telepathy-glib does already. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=57165 Reviewed-By: Simon McVittie commit 52485ba01852a0fc7d46cb026adfbde16aa525d6 Author: Cosimo Cecchi Date: 2012-11-15 12:04:30 -0500 build: honor NOCONFIGURE in autogen.sh Like telepathy-glib does already. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=57165 Reviewed-By: Simon McVittie commit c3f9cd49aa0238922b5a0e972cf3cbe3a48be6eb Author: Mike Ruprecht Date: 2012-11-01 00:24:35 -0500 Update to current ConnMan API ConnMan 0.79 removed the GetState method and StateChanged signal. Use the GetProperties method and PropertyChanged signals as their replacements. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=56600 Reviewed-by: Guillaume Desmottes commit 077ac24ef7d324fded1ebba928ee6150ab583e9c Author: Guillaume Desmottes Date: 2012-10-30 15:17:33 +0100 Add missing config.h includes g_type_init() has been deprecated in GLib master. By including those files I can build without raising a deprecation error as we define GLIB_VERSION_MIN_REQUIRED to 2.30. commit 2fe37c082b5db56513598beb638b331ccfff9b0b Merge: 9b04e1b 61566c4 Author: Simon McVittie Date: 2012-10-09 16:53:19 +0100 Merge branch 'aliasing-avatars' Bug: https://bugs.freedesktop.org/show_bug.cgi?id=55668 Reviewed-by: Xavier Claessens commit 9b04e1ba0a4cfe74345cb6eaa0496b3348e9a24a Author: Emilio Pozuelo Monfort Date: 2011-06-15 12:26:26 +0100 Check for the specific error codes when reconnecting The NetworkError connection status maps to several TpErrors, so first check the error codes to decide whether we should automatically reconnect, and fallback to the connection status if we don't recognize the error. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=37844 Reviewed-by: Simon McVittie commit 61566c4ae43f312ed102eb1586e4aeb50dc03e6c Author: Simon McVittie Date: 2012-10-09 11:36:28 +0100 mcd_account_self_contact_changed_cb: ignore no-op changes commit d4eec9aa5baa63fdfc0cf354561044786dfa23b5 Author: Simon McVittie Date: 2012-10-09 11:29:39 +0100 mcd_account_process_initial_avatar_token: don't take self_contact argument It can be retrieved from the McdAccount. commit d2a26f3b1a3d6e0fead0b2885347bb9e0d6d15bd Author: Simon McVittie Date: 2012-10-09 11:27:57 +0100 Ignore changes to the avatar of former self-contacts This is highly theoretical, but in principle it could happen. commit 90dd8c46e8457629140397d6e6afacfe9f2eea6b Author: Simon McVittie Date: 2012-10-09 11:25:55 +0100 Implement Set("Nickname", "") by using the normalized name instead This is consistent with what we do when we first connect, and ensures that we always have some sort of nickname. commit a4355bb2eb2a682a4c1298c01683cffb4e42a666 Author: Simon McVittie Date: 2012-10-09 11:10:12 +0100 nickname test: test what happens when we set an empty nickname commit 97b7748520960cc4cda2f9c9c25eb5c5ad27e326 Author: Simon McVittie Date: 2012-10-09 10:55:45 +0100 Downgrade failure to prepare self-contact from WARNING to DEBUG commit 420ba08af8aa3d2b7300f683725dc8cc52858d51 Author: Simon McVittie Date: 2012-10-09 10:54:53 +0100 Downgrade failure to set alias/avatar from WARNING to DEBUG commit e49b1405fd0242c2e28b62905cb0dcfe1b8091d5 Author: Simon McVittie Date: 2012-10-05 17:54:04 +0100 Track Avatars using McdAccount, and use the self-contact for it commit 2a1d4dce7e7bfa08e646485d36f4223c46915a33 Author: Simon McVittie Date: 2012-10-05 17:53:34 +0100 Emulate the Aliasing interface a little more realistically commit 51641776d8cb3ac2db46ccf062bbe5aae2588230 Author: Simon McVittie Date: 2012-10-05 16:20:20 +0100 Knock out most of the IRC test until fd.o #55666 is fixed commit b543e87d5fcb65ef61516b4bf6c03cb4f27583b4 Author: Simon McVittie Date: 2012-10-05 13:45:58 +0100 Add a regression test for an IRC-like protocol IRC has plenty of oddities, but the one we're interested in here is that your nickname and your unique identifier are inextricably linked. commit eb7239987e2cddc1e2388428bf9f01bfc06fbb00 Author: Simon McVittie Date: 2012-10-05 16:17:44 +0100 McdAccount: cope with self-contact changes; follow the self-contact commit f5333aaa31373ffc30bad96fb877b7a5915dd6bf Author: Simon McVittie Date: 2012-10-05 12:42:39 +0100 nickname test: verify that a trivial nickname is not set on connect commit 121688c19cded284257b9e7a3690207d98899f82 Author: Simon McVittie Date: 2012-10-05 13:21:16 +0100 enable_fakecm_account: copy parameters and alter the copy Mutable defaults for arguments are dangerous. If we call enable_fakecm_account twice with default arguments, when we alter expect_before_connect/expect_after_connect, we are actually altering the default! Python doesn't construct a new empty list for us every time. The C equivalent would be a static GPtrArray * or something. commit b6d933c6927a8b0b4c60a414ccd7c271fb14e0dd Author: Simon McVittie Date: 2012-10-05 12:42:16 +0100 Don't set the nickname to the normalized name on connect We still allow the nickname to be set to the normalized name by user action later, because in that case, the intention is unambiguous: the user really does want their nickname to take that value. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=39381 commit 4ab487bfbd4d8a8ed8f4fb6e42afaf2a35e8e59e Author: Simon McVittie Date: 2012-10-05 12:04:02 +0100 McdAccount: take responsibility for setting the nickname As well as being implemented in a more streamlined way (using the self-contact instead of calling D-Bus methods directly), this reduces the circular dependencies between McdConnection and McdAccount. commit 8a27f3df35f58e48547a9d92711df16214edd5a4 Author: Simon McVittie Date: 2012-10-05 14:38:26 +0100 McdAccount: store the self-contact commit a5a5d85001669af4411d01daa98da0e6d3c3094c Author: Simon McVittie Date: 2012-10-08 15:46:44 +0100 _mcd_client_match_property: take channel properties as GVariant Signed-off-by: Simon McVittie Bug: https://bugs.freedesktop.org/show_bug.cgi?id=55391 Reviewed-by: Xavier Claessens commit eee9cebcfe2e583dbb5fd1421b879a7837bc7a2c Author: Simon McVittie Date: 2012-09-14 14:45:38 +0100 Generally use GVariant, not GHashTable, for channels' properties This means we can avoid the deprecated tp_channel_borrow_immutable_properties(). Signed-off-by: Simon McVittie Bug: https://bugs.freedesktop.org/show_bug.cgi?id=55391 Reviewed-by: Xavier Claessens commit 552dcac1ea50fbe0d64e4ec122b40d3d8fb5b391 Author: Simon McVittie Date: 2012-10-08 15:30:47 +0100 mc-tool: have a TpSimpleClientFactory to manufacture accounts Signed-off-by: Simon McVittie Bug: https://bugs.freedesktop.org/show_bug.cgi?id=55391 Reviewed-by: Xavier Claessens commit 7f8f814ffc232cbfe903b66a418c52d2ce964f5d Author: Simon McVittie Date: 2012-09-14 15:21:05 +0100 McpDispatchOperation: use a new factory for each connection This avoids the deprecated tp_channel_new_from_properties(). It has the same disadvantages as that function, but is a bit more obvious about it. Also comment how to change things at the next ABI break. Signed-off-by: Simon McVittie Bug: https://bugs.freedesktop.org/show_bug.cgi?id=55391 Reviewed-by: Xavier Claessens commit 4413b17df8a2e7e5df1167e4f3848a98a6395945 Author: Simon McVittie Date: 2012-09-14 15:51:04 +0100 McdConnection: use TpWeakRef instead of replicating it Signed-off-by: Simon McVittie Bug: https://bugs.freedesktop.org/show_bug.cgi?id=55391 Reviewed-by: Xavier Claessens commit a41ad6c876407eeb47fa6ae4dc930d9fdae47c9e Author: Simon McVittie Date: 2012-09-14 15:12:00 +0100 McdChannel: use the TpConnection's factory to make TpChannel objects Signed-off-by: Simon McVittie Bug: https://bugs.freedesktop.org/show_bug.cgi?id=55391 Reviewed-by: Xavier Claessens commit bd19b09f83087cfde65ff5f777b30a07cf07e22b Author: Simon McVittie Date: 2012-09-14 15:02:02 +0100 McdAccountManager: have a TpSimpleClientFactory Signed-off-by: Simon McVittie Bug: https://bugs.freedesktop.org/show_bug.cgi?id=55391 Reviewed-by: Xavier Claessens commit ac8b57c149c9c84dc86427337d0b39999f96da2c Author: Simon McVittie Date: 2012-09-14 15:00:20 +0100 McdAccountManager: use tp_dbus_daemon_register_object dbus_g_connection_register_g_object isn't deprecated, but it's more code. Signed-off-by: Simon McVittie Bug: https://bugs.freedesktop.org/show_bug.cgi?id=55391 Reviewed-by: Xavier Claessens commit e913203ccfe06fbf3435be69b0e6b07d1828ce73 Author: Simon McVittie Date: 2012-09-14 14:42:29 +0100 McdChannel: use tp_channel_get_requested instead of reinventing it MC's reinvention was potentially better if the channel might lack the Requested property... but that property has been mandatory for years, so CMs that haven't caught up can just deal with it. Signed-off-by: Simon McVittie Bug: https://bugs.freedesktop.org/show_bug.cgi?id=55391 Reviewed-by: Xavier Claessens commit 9f5aaffb018ce166c8181eb98cd13182112ead22 Author: Simon McVittie Date: 2012-09-14 14:38:17 +0100 Use tp_channel_get_connection instead of tp_channel_borrow_connection This requires telepathy-glib 0.19.9, so depend on it. Signed-off-by: Simon McVittie Bug: https://bugs.freedesktop.org/show_bug.cgi?id=55391 Reviewed-by: Xavier Claessens commit 8310376a77d8a591d438dd65f5050081430bd5ff Author: Simon McVittie Date: 2012-09-14 13:30:00 +0100 mc-tool: use tp_account_manager_dup_valid_accounts tp_account_manager_get_valid_accounts has the confusing (transfer container) transfer-mode, and is deprecated in telepathy-glib 0.19.9. Signed-off-by: Simon McVittie Bug: https://bugs.freedesktop.org/show_bug.cgi?id=55391 Reviewed-by: Xavier Claessens commit 534b0ed2fc2ddd4872bca3251025c30037fb3272 Author: Simon McVittie Date: 2012-09-14 12:03:11 +0100 Enable TP_DISABLE_SINGLE_INCLUDE Tested with telepathy-glib 0.20.0. Signed-off-by: Simon McVittie Bug: https://bugs.freedesktop.org/show_bug.cgi?id=55391 Reviewed-by: Xavier Claessens commit 5ba8d233c1776da8ab894e744e749b760c94275d Author: Simon McVittie Date: 2012-09-14 12:02:59 +0100 Update code generation tools from telepathy-glib 0.20.0 Signed-off-by: Simon McVittie Bug: https://bugs.freedesktop.org/show_bug.cgi?id=55391 Reviewed-by: Xavier Claessens commit 553120085c06d90a06f876a12344170b480c3846 Author: Simon McVittie Date: 2012-09-14 11:58:27 +0100 Enable TP_SEAL_ENABLE Tested with telepathy-glib 0.20.0. Signed-off-by: Simon McVittie Bug: https://bugs.freedesktop.org/show_bug.cgi?id=55391 Reviewed-by: Xavier Claessens commit 2637ab782d2ff562c40e18bae1f86f4d850537ed Author: Simon McVittie Date: 2012-09-13 17:57:35 +0100 replace sealed struct members with getters and use TpProtocol Originally two patches for 'next' by Jonny Lamb. Signed-off-by: Simon McVittie Bug: https://bugs.freedesktop.org/show_bug.cgi?id=55391 Reviewed-by: Xavier Claessens commit caacfe66c11a3c01fd29e935dd7b0ea7b9b474a6 Author: Simon McVittie Date: 2012-09-21 15:42:16 +0100 WARNING, etc. macros: add Signed-off-by: Simon McVittie Bug: https://bugs.freedesktop.org/show_bug.cgi?id=55391 Reviewed-by: Xavier Claessens commit f694362379baca962247f4b62630866332a969a7 Author: Simon McVittie Date: 2012-09-21 15:37:03 +0100 mc-debug-server: don't self-terminate when disconnected from GDBus It appears something in MC now connects to D-Bus for a second time, using GDBus this time. We don't want to exit-on-disconnect for this one either, again so we free all memory before exiting. Signed-off-by: Simon McVittie Bug: https://bugs.freedesktop.org/show_bug.cgi?id=55391 Reviewed-by: Xavier Claessens commit 33328b2b5cf1f8ea54dcadc639e90776544cad2c Author: Jonny Lamb Date: 2012-08-29 18:33:21 +0100 add more telepathy-glib-dbus.h includes where appropriate Signed-off-by: Jonny Lamb Bug: https://bugs.freedesktop.org/show_bug.cgi?id=55391 Reviewed-by: Simon McVittie commit b265e18157aec3d387b344331fb2aa117f1257bb Author: Jonny Lamb Date: 2012-08-29 18:29:54 +0100 make-valid test: make connection object paths distinct If these object paths are the same, the factory will use the same TpConnection (even though they are actually different connections) and dispatching will happen twice. Signed-off-by: Jonny Lamb Bug: https://bugs.freedesktop.org/show_bug.cgi?id=55391 Reviewed-by: Simon McVittie commit d98add74c5c5b142f4908dffdb6e0bac951d7564 Merge: dae5f16 76c62bc Author: Simon McVittie Date: 2012-10-04 16:03:30 +0100 Merge branch 'storage-refactor-54870' Bug: https://bugs.freedesktop.org/show_bug.cgi?id=54870 Reviewed-by: Jonny Lamb commit dae5f16617519406eaf9a41bc050d99944805dc2 Author: Simon McVittie Date: 2012-10-03 19:09:59 +0100 Start the 5.15 branch commit ff2df8e5eab56b0a5b013cb4333fbf41fd367414 Author: Simon McVittie Date: 2012-10-03 19:09:33 +0100 Revert "Don't check documentation completeness in this stable branch" This reverts commit 2a0b73c02353a155e473504546a8b7e598da4449. commit e4b9946e98001d081c0e6bc15c16e27432782a29 Author: Simon McVittie Date: 2012-10-03 19:08:52 +0100 Revert "Upload documentation to the 5.14.x location" This reverts commit 5f156149b05e7b5ab9e54eeee729136d9d59128c. commit 2a1ac0b29220b24a243124639e0bdd8b3c756022 Author: Simon McVittie Date: 2012-10-03 19:08:48 +0100 Revert "Don't warn on deprecated declarations, this is a stable branch." This reverts commit 4e5a187773cb34de567e3cf90d62710830bbd876. commit 847e2b950aa18d530dc0f32b58e8bb11a1658039 Author: Simon McVittie Date: 2012-10-03 19:08:22 +0100 development version commit c1fe16e325d1622bea056dbc8679c23e72000386 Author: Simon McVittie Date: 2012-10-03 18:11:25 +0100 fix Makefile syntax commit a433ba2a46c9fdcd73e365c88639a6e501762893 Author: Simon McVittie Date: 2012-09-21 15:35:54 +0100 exec-with-log.sh: add gdb wrapper Based on a patch from Jonny Lamb; changed to use ${abs_top_srcdir} to work out-of-tree, backtrace all threads, and put the gdb script in /tools. Signed-off-by: Simon McVittie commit 91006767d5ce8f95b43c7ff85fc6e5ec90d8895c Author: Guillaume Desmottes Date: 2012-10-03 14:37:26 +0200 prepare 5.14.0 commit 4e5a187773cb34de567e3cf90d62710830bbd876 Author: Simon McVittie Date: 2012-08-27 10:50:08 +0100 Don't warn on deprecated declarations, this is a stable branch. Signed-off-by: Simon McVittie commit 5f156149b05e7b5ab9e54eeee729136d9d59128c Author: Guillaume Desmottes Date: 2012-10-03 15:05:06 +0200 Upload documentation to the 5.14.x location To be reverted in the 5.15 branch. commit 2a0b73c02353a155e473504546a8b7e598da4449 Author: Guillaume Desmottes Date: 2012-10-03 14:57:48 +0200 Don't check documentation completeness in this stable branch To be reverted in the 5.15 branch. commit 90a3b33273dd4384ebf653c9ec4c7a5fbc752246 Author: Simon McVittie Date: 2012-09-20 16:15:48 +0100 Post-release version bump commit e80d7797aa038480701c6819bc178c9302d823e7 Author: Simon McVittie Date: 2012-09-20 15:41:12 +0100 Prepare version 5.13.2 commit d33c6c16abd488f6ec3fae2dbc88ffc6a3514c0b Author: Simon McVittie Date: 2012-09-20 15:35:49 +0100 NEWS commit b6f897048723dab0a1aefaacb969e8026a3d6e4d Merge: 5b5ee48 7095375 Author: Simon McVittie Date: 2012-09-20 15:09:20 +0100 Merge branch 'xdg-keyfile-35896' Reviewed-by: Jonny Lamb Bug: https://bugs.freedesktop.org/show_bug.cgi?id=35896 Conflicts: src/mcd-account-manager-default.c commit 5b5ee4862e11ab2b12d8f652d06b45600dc358af Merge: 0bb531d ef2ea07 Author: Simon McVittie Date: 2012-09-20 15:07:13 +0100 Merge branch 'telepathy-mission-control-5.12' into master Conflicts: NEWS configure.ac commit ef2ea07d1b27dabd87e0ae028396138f78d1970a Author: Simon McVittie Date: 2012-09-20 14:58:30 +0100 the obligatory version bump commit 010ab4ba86f557f89e1ec2045dc9fc5ae71513ad Author: Simon McVittie Date: 2012-09-20 13:21:47 +0100 Prepare version 5.12.3 commit 17965ae51796f93771a6444e90f6846639b68a9b Author: Simon McVittie Date: 2012-09-20 13:21:31 +0100 Do not distribute mcp-signals-marshal.h, which is generated at build-time Signed-off-by: Simon McVittie Reviewed-by: Guillaume Desmottes commit eaefb264316f206186b2ac7f1f36e6a4692deb3d Author: Simon McVittie Date: 2012-09-20 12:28:59 +0100 Default accounts backend: finish password migrations that Empathy 3.0 started Signed-off-by: Simon McVittie Bug: https://bugs.freedesktop.org/show_bug.cgi?id=42088 Bug-Debian: http://bugs.debian.org/687933 Reviewed-by: Guillaume Desmottes commit 5c89fe0b540eaeecd72379f1f2b9da07883425e9 Author: Simon McVittie Date: 2012-08-30 16:53:36 +0100 Make the gnome-keyring test work again, with modern gnome-keyring Signed-off-by: Simon McVittie Reviewed-by: Jonny Lamb Bug: https://bugs.freedesktop.org/show_bug.cgi?id=42088 Cherry-picked-from: c21e2b09bf4cdda6fb05d64f9198f6db7b776c76 commit 0fda3bd4b8217460a3c755e8eae8c48ad6478958 Author: Simon McVittie Date: 2012-09-12 12:26:16 +0100 Test that an account storage backend can alter AutomaticPresence AutomaticPresenceType etc. don't work, but AutomaticPresence does. commit 06cb1df43b9113eb0f202b4ae9d95adc032b5d67 Author: Simon McVittie Date: 2012-09-12 12:21:14 +0100 mc-tool: add getter for AutomaticPresence commit 287f7425b9069fae816f1e2872b5992dffb17074 Author: Simon McVittie Date: 2012-09-12 12:21:04 +0100 Use combined AutomaticPresence in tests where either would do commit 5b21fc3d06fba26dfef4ebd5e4287e57e1a416db Author: Simon McVittie Date: 2012-09-12 12:20:29 +0100 McdAccount: store automatic presence as a single attribute This will be necessary to make its change-notification work correctly. Use tests/twisted/account-manager/auto-connect.py to exercise the automatic migration. account-storage/default-keyring-storage.py is broken by this change, because it asserts that keyfiles from a lower-priority XDG location are not automatically migrated to a higher-priority location until something actually changes, and the migration of AutomaticPresenceType is a change. To avoid that, put the automatic presence in lower-priority keyfiles in that test in the new format already. commit a90652ddf3103de75c345f198f3c8ce4d797d443 Author: Simon McVittie Date: 2012-09-12 11:40:10 +0100 Add a regression test for (un)escaping things in keyfile format commit 938facb6517d2daecdf60a287f04d0cdf1f3fd66 Author: Simon McVittie Date: 2012-09-12 14:28:07 +0100 McdStorage: add support for storing structs (uss) in keyfiles commit f2cfc78ac1a37cb9a85055602cf7c001045492bf Author: Simon McVittie Date: 2012-09-11 18:42:22 +0100 McdAccount: consolidate AutomaticPresence setting commit 20661d5734d5d7c8f1e95b70be7b4f49f7cf4c04 Author: Simon McVittie Date: 2012-09-11 18:35:16 +0100 TestDBusAccountPlugin: push typed parameters into MC commit 05d1af08748932319ac5133f716deac4fae9b698 Author: Simon McVittie Date: 2012-09-11 18:35:01 +0100 Add a way for storage plugins to push typed parameters into MC commit 0a3f99bb6bb8703777e0060fa378360958a25032 Author: Simon McVittie Date: 2012-09-11 18:01:04 +0100 McdAccount: add a way to tell property setters that storage has already been updated This lets us get AccountPropertyChanged signals for more attributes changed via McpAccountStorage::altered-one, which would previously be suppressed because altered-one's API is that the storage plugin has already updated the McdStorage before emitting the signal. The property setter would then notice that the value was the same as in McdStorage, and assume that that meant it hadn't actually changed. commit 2c1a41059fec4657c59078525ca2527a06443b90 Author: Simon McVittie Date: 2012-09-11 17:22:29 +0100 mcd_account_altered_by_plugin: get the new value from the McdStorage This means we pick up the new value a little more reliably: in particular, this fixes processing of URISchemes, ConnectAutomatically and Supersedes. commit d62d0742c69c81cd0299f8dc30d6f717bba0493a Author: Simon McVittie Date: 2012-09-12 14:27:01 +0100 mcd_storage_init_value_for_attribute, mcd_storage_get_attribute_type: make extern commit 06a09cf70713999a11ba9227baa00264c95c25e8 Author: Simon McVittie Date: 2012-09-11 17:02:41 +0100 Add a regression test for an account storage plugin altering accounts commit a851f84c246259a3922b55cb1224ff5224809fd4 Author: Simon McVittie Date: 2012-09-11 17:12:06 +0100 WARNING macro: add commit 8c2c761e11c389bb243763b59cf3f1d63d94b283 Author: Simon McVittie Date: 2012-09-11 14:24:16 +0100 Mock accounts service plugin: respond to change signals from service commit 8ffb3f507c35af24fac0b4fb28438d4af7fb298c Author: Simon McVittie Date: 2012-09-10 19:12:10 +0100 Mock accounts service plugin: receive settings from MC as GVariant commit 8b602c52b9e2007740309ad1c84eaf2966143135 Author: Simon McVittie Date: 2012-09-10 19:01:14 +0100 Let storage plugins receive new values as GVariants commit 4efea11d2ed33a92f6ef05a954acfb180083531d Author: Simon McVittie Date: 2012-09-10 15:57:02 +0100 Preload accounts via fake accounts service when required The only tests left using real account storage are the three tests for specific plugins: default keyfile/keyring, diverted keyfile and libaccounts. commit d6c23d2fc528b3cff92ec78c706a78cd561a2a9b Author: Simon McVittie Date: 2012-09-10 15:38:24 +0100 account-manager/avatar test: assert about mock accounts service interactions commit 2ecab4c8c5109722bbf7c0f2df8d7d2c6aa64c6c Author: Simon McVittie Date: 2012-09-10 14:57:21 +0100 account-basics test: assert that the mock accounts service is used correctly commit 9d952ab91dfa2a87383492d0ad68a286c9236d49 Author: Simon McVittie Date: 2012-09-10 14:57:15 +0100 Use the mock accounts service for the majority of our tests For tests that rely on special behaviour such as "preloading" keyfiles with specific contents, don't provide the bus name of the mock accounts service, resulting in fallback to the diverted-keyfile plugin. commit 73306e67755de2b2b16d3a88d2ac9c8efe40bd99 Author: Simon McVittie Date: 2012-09-12 13:21:02 +0100 Add a fake account storage backend which uses a mock D-Bus service commit 3975989913b12fa1488d00085d8cdb84e5b3f46d Author: Simon McVittie Date: 2012-09-10 18:31:43 +0100 mcp_account_storage_owns: add At the moment we use get() to see whether a plugin thinks it "owns" a particular account, but it seems clearer and more self-documenting to have a dedicated virtual method for this. Signed-off-by: Simon McVittie commit fb470a3a8bde4e2bf07cf93722daa016a6344c2c Author: Simon McVittie Date: 2012-09-12 13:19:57 +0100 mcp_account_manager_escape_variant_for_keyfile: add to plugin API commit 7cf22355325f32bcf9898cfeb253390ed6624923 Author: Simon McVittie Date: 2012-09-10 18:30:11 +0100 Give account storage plugins a way to find out the GType for an attribute commit 7975d386c95469d2e5aa7626524dc906dfeb64ef Author: Simon McVittie Date: 2012-09-10 10:51:23 +0100 Require Python 2.6 so we can use "except A as b" etc. commit ee9b43cb446218b3fca3a0a753a4a3a94413c81c Author: Simon McVittie Date: 2012-09-10 18:27:28 +0100 McdStorage: store parameters in-memory as GVariants, with a fallback We don't necessarily know a parameter's type until we come to use it, so we can't necessarily decode it from a plugin straight away. However, if a new value comes in from UpdateParameters, we do know the type for that one. Signed-off-by: Simon McVittie commit 51b984b7cede7c2a2f2ec591846ac41573fd1887 Author: Simon McVittie Date: 2012-09-12 14:20:13 +0100 McdStorage: store attributes in-memory as GVariants, not keyfile syntax commit 6cce93320368fb34ab7e13b8eb1e4d6b33634006 Author: Simon McVittie Date: 2012-09-10 18:23:08 +0100 Consistently use the constants from mcd-account-config.h Signed-off-by: Simon McVittie commit 8a264749eabe572c0a41a135281890ae660b2222 Author: Simon McVittie Date: 2012-09-05 17:55:41 +0100 mcd-account-config.h: list every setting (i.e. all non-parameters) Signed-off-by: Simon McVittie commit 51357aacd99dd5f0057aeb9f743a2e696e10d7b3 Author: Simon McVittie Date: 2012-09-05 17:55:06 +0100 Rename MC_ACCOUNTS_KEY_ALIAS to MC_ACCOUNTS_KEY_NICKNAME Its value is actually "Nickname" so its name should follow. Signed-off-by: Simon McVittie commit 444c32b0de9e97b0046ef613c1c15eb9e8ef5ff8 Author: Simon McVittie Date: 2012-09-10 18:21:33 +0100 McdStorage: in update_storage, take the escaped value as a parameter This saves looking it up again. Signed-off-by: Simon McVittie commit c1152ed446503574f718a1cddaa5fcb80520dfd4 Author: Simon McVittie Date: 2012-09-10 19:22:57 +0100 McdStorage: change internal storage away from GKeyFiles Signed-off-by: Simon McVittie commit fd9f5784098d774076a12a5dd0da693f2b417cca Author: Simon McVittie Date: 2012-09-06 12:23:53 +0100 mcd_keyfile_escape_value, mcd_keyfile_unescape_value: add Also make them available to account storage plugins. Signed-off-by: Simon McVittie commit 2a647cbf905ad47a3d597499efc3eaae1397b719 Author: Simon McVittie Date: 2012-09-10 19:19:47 +0100 McdStorage: distinguish between parameters and attributes Parameters are part of the Parameters property, have CM-specified types and can be secret, whereas "attributes" (everything else) mostly stand alone, have known types hard-coded into MC, and are all non-secret. Signed-off-by: Simon McVittie commit 76c62bcf500acc21ef8db2064ed00d01e51b039d Author: Simon McVittie Date: 2012-09-10 10:31:43 +0100 McpAccountStorage: don't double-register signals if implemented twice The base_init function of a GInterface is called once per implementor. Signed-off-by: Simon McVittie commit d75df979a3cc8fe700197b3d96f5332187c52c2c Author: Simon McVittie Date: 2012-09-10 18:12:39 +0100 McpAccountStorage: improve documentation commit 9bf797ebf0bac51b3647bd063b47ca8d78c0c84d Author: Simon McVittie Date: 2012-09-10 18:10:52 +0100 Mark McpAccountStorage::altered as deprecated It would be nice to have, but apparently it doesn't actually work... so I'm not going to waste any time on it. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=28288 commit f976919e884fd85726b232eab3f76c558c904308 Author: Simon McVittie Date: 2012-09-10 18:07:34 +0100 Deprecate and undocument McpAccountStorage's vtable-filling functions commit 48ca9d546d08df14cd4f79bc00627206c7a7efb6 Author: Simon McVittie Date: 2012-09-10 18:07:06 +0100 All account storage plugins: fill the vtable directly commit 2ce2e402e3325517470480a1734f9b4cda6d19e0 Author: Simon McVittie Date: 2012-09-10 16:37:58 +0100 McpAccountStorage: stop recommending mcp_account_storage_iface_set_desc, etc. Now that the vtable is public, you can just fill it in. commit 95ded438d50149b02e2ee36f39e92a19d9770de9 Author: Simon McVittie Date: 2012-09-06 12:13:02 +0100 mcp_account_manager_set_value: document Signed-off-by: Simon McVittie commit 5ca771a0a76ef6fc41aba893bf3d100cda03a618 Author: Simon McVittie Date: 2012-09-06 12:16:36 +0100 Unify loading of new accounts Rather than having both the AM and McdStorage know how to load a new account, it's better to give the McdStorage a method to do it. This way, when it gets more complicated, we only need to change one place. Signed-off-by: Simon McVittie commit bf70a86c39902ccf4fdad8aec1be1bbcc661d148 Author: Simon McVittie Date: 2012-09-05 14:23:01 +0100 mcd_account_property_changed: rename to mcd_account_altered_by_plugin The parameter is either "param-" + a parameter, or a setting. It's not necessarily a property name! Signed-off-by: Simon McVittie commit 0ca9a72ee4285af5c12bd120c66487f09dc3600a Author: Simon McVittie Date: 2012-09-05 14:21:30 +0100 McdStorage: implement get_string, get_boolean, get_integer in terms of get_value commit ab6057bbb22d40fdf494aabdb9285a2556ff564c Author: Simon McVittie Date: 2012-09-07 17:44:41 +0100 mcd_storage_dup_value: alter signature, rename to mcd_storage_get_value Its callers become considerably simpler if it takes a pre-initialized GValue of the appropriate type and fills it, much like g_object_get_property(). Signed-off-by: Simon McVittie commit 76a7c315686a94b7b56c2c5e3cd83de72aed2735 Author: Simon McVittie Date: 2012-09-07 17:38:32 +0100 mcd_storage_has_value: remove, no longer needed Now that mcd_storage_dup_value() doesn't make up a value for parameters that are missing or can't be parsed, we can just rely on dup_value() raising an error for missing parameters. Signed-off-by: Simon McVittie commit 87b40cf09a3589daca09d9a54b466b0c0572f98b Author: Simon McVittie Date: 2012-09-07 17:37:29 +0100 mcd_storage_dup_value: don't return non-NULL with error set The practical effect of this is: * addressing_set_uri_scheme_association() needs modification to cope with a NULL return, which previously never happened (an empty string-list was returned on error) * addressing_get_uri_schemes() needs the same change * mcd_account_get_parameter() treats parameters whose value in the keyfile cannot be interpreted as the desired type as if they were unset; previously, it treated them as 0, False, "", [], etc. The old behaviour of mcd_account_get_parameter() seems undesirable: we shouldn't just make up parameter values. If the parameter is boolean "require-tls" and its value gets set to 2 for some reason, we should invalidate the account, rather than setting it to False and carrying on! commit 3e08626fafa696290162fb8baafa5bc4cece07fa Author: Simon McVittie Date: 2012-09-05 10:07:33 +0100 mcd_storage_set_string: implement in terms of mcd_storage_set_value commit ed5ec4105052e5e86f7471855a5c234822fc1c74 Author: Simon McVittie Date: 2012-09-05 10:03:37 +0100 mcd_storage_set_value: unset keys directly instead of via set_string commit a04220ab092e417f451d8ce55839d60469238ed1 Author: Simon McVittie Date: 2012-09-05 10:02:27 +0100 McdStorage: include flagging-as-secret in update_storage() This guarantees that we don't forget to flag things as secret, and also avoids unnecessary indirection through the McpAccountManager vtable. commit 7095375b51547bea365ed321f06ba6a7c7cd2101 Author: Simon McVittie Date: 2012-09-07 13:57:29 +0100 Update documentation of --with-accounts-dir It used to be where we kept accounts; now it's only the source for account migration into XDG_DATA_HOME. Keep its name the same, so that if a user or distribution is configuring with --with-accounts-dir="~/.mc-accounts" or something, the migration works as intended as long as they continue to do so. (We don't recommend doing so, though.) Bug: https://bugs.freedesktop.org/show_bug.cgi?id=35896 Signed-off-by: Simon McVittie commit c710e7bc5c302d657184077e0cc5530646efdb5f Author: Simon McVittie Date: 2012-09-07 13:54:19 +0100 Default account backend: write accounts to XDG_DATA_HOME, with fallback If the user has ~/.mission-control/accounts/accounts.cfg we migrate from there to XDG_DATA_HOME/telepathy/mission-control/accounts.cfg, and if successful, delete the old name. If the user has XDG_DATA_DIRS/telepathy/mission-control/accounts.cfg (in a lower-priority path element than XDG_DATA_HOME), we use it, with copy-on-write into XDG_DATA_HOME. (Limitation: the account-store executable used in some tests only reads from XDG_DATA_HOME, and doesn't understand the XDG_DATA_DIRS and MC_ACCOUNT_DIR fallback.) Bug: https://bugs.freedesktop.org/show_bug.cgi?id=35896 Signed-off-by: Simon McVittie commit 8de58594deeff1d26046f17487c5752b6fa0aeeb Author: Simon McVittie Date: 2012-09-07 13:06:41 +0100 Default account backend: include directory creation in _commit Also check for errors - we can at least give a useful warning. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=35896 Signed-off-by: Simon McVittie commit 9a932a687f75be5238c533d928f914292a5e9c43 Author: Simon McVittie Date: 2012-09-07 13:11:50 +0100 Default account backend: restructure to be able to look in multiple places This isolates all file-writing into _commit, and all file-reading into am_default_load_keyfile. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=35896 Signed-off-by: Simon McVittie commit bd9334449d2ff1db6158ecfbb41f65327a40a078 Author: Simon McVittie Date: 2012-09-04 15:43:33 +0100 McdAccount: migrate avatars to a XDG path This is the easy part of XDGification: there is no plugin involvement or anything for avatars (yet!), it's just hard-coded. Changing the avatar location from a single directory to a search path results in some new corner cases, so test them. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=35896 Signed-off-by: Simon McVittie commit 416486d706a4d717ad5670abca61e333471bfbdc Author: Simon McVittie Date: 2012-09-04 15:03:12 +0100 mcd_ensure_directory: add I keep calling g_mkdir_with_parents() and expecting it to return a boolean (it doesn't, it returns 0 or -1), so it seems worth wrapping it in something more sensible. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=35896 Signed-off-by: Simon McVittie commit 947aaa3c91f7f286d37f803286d77070f0cc6fb2 Author: Simon McVittie Date: 2012-09-03 19:12:29 +0100 Tests: distinguish between XDG cache/config/data home, and MC_ACCOUNT_DIR We want to be sure that MC is using the right one in each situation. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=35896 Signed-off-by: Simon McVittie commit 0bb531d7856f4b79edd7d328cef59e58f7f08ac8 Author: Simon McVittie Date: 2012-08-31 19:49:30 +0100 servicetest: don't eavesdrop on method replies or errors Eavesdropping on method replies breaks libdbus if you call methods using the same connection. You can get into a situation like this: * Test calls a method on MC; say the serial number is 42 * At around the same time, MC calls a method on gnome-keyring and also uses serial number 42 * gnome-keyring replies, labelled "in reply to 42" * Test is eavesdropping, so it sees the reply going from gnome-keyring to MC * Test interprets the reply from gnome-keyring to MC as the reply it was expecting from MC, sees completely the wrong types, and becomes confused This seems unlikely - but because serial numbers are sequential and start from 1 for each connection (as opposed to starting from a random offset), two connections can quite easily happen to sync up. I saw it happen most recently in the gnome-keyring test. With the benefit of hindsight, I think I've seen this before: whenever the tests made an Introspect() call which returned a type other than 's', that was probably this bug. We never actually generated events for messages other than signals and method calls, so match those ones specifically, and don't eavesdrop on replies. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=54495 Signed-off-by: Simon McVittie Reviewed-by: Jonny Lamb commit 0675c366c5b326d50a1ad7f368ee47c4219a47bd Author: Simon McVittie Date: 2012-09-07 11:29:53 +0100 Don't generate code for Account.I.Addressing, use telepathy-glib's Signed-off-by: Simon McVittie Reviewed-by: Xavier Claessens Bug: https://bugs.freedesktop.org/show_bug.cgi?id=54633 commit 375a55b0bc2f92a0ec6f409695b397aa7f6ec82e Author: Simon McVittie Date: 2012-09-07 11:15:52 +0100 Be single-include-compliant when generating service bindings Signed-off-by: Simon McVittie Reviewed-by: Xavier Claessens Bug: https://bugs.freedesktop.org/show_bug.cgi?id=54633 commit 37609dd9849871633f84192a0ce4fe65c40784e6 Author: Simon McVittie Date: 2012-09-07 11:11:23 +0100 Use G_VALUE_INIT instead of { 0 } We already depend on GLib 2.30, which is new enough. Signed-off-by: Simon McVittie Reviewed-by: Xavier Claessens Bug: https://bugs.freedesktop.org/show_bug.cgi?id=54633 commit a729a511399712c4b8fbfbef9d3517aaaa4ad9d7 Author: Simon McVittie Date: 2012-08-29 11:36:37 +0100 mcd_service_new: use tp_dbus_daemon_dup() Signed-off-by: Simon McVittie Reviewed-by: Xavier Claessens Bug: https://bugs.freedesktop.org/show_bug.cgi?id=54633 commit 362ef681dbaea571ccfccc3dbe06f2218780d217 Author: Simon McVittie Date: 2012-08-29 11:18:11 +0100 mcd-dbusprop: remove support for filtering property setting through an ACL This provided an asynchronous API for getting and setting properties, which nothing actually calls into, and nothing in MC supports setting properties asynchronously anyway. Into the bin it goes! Signed-off-by: Simon McVittie Reviewed-by: Xavier Claessens Bug: https://bugs.freedesktop.org/show_bug.cgi?id=54633 commit d14283c0220d24772372128d534e8e230a3b2088 Author: Simon McVittie Date: 2012-08-28 17:10:13 +0100 McdMaster: remove unused variable left over from old-style plugins Signed-off-by: Simon McVittie Reviewed-by: Xavier Claessens Bug: https://bugs.freedesktop.org/show_bug.cgi?id=54633 commit 450f485e4e9bb3be2ddb023e42de1fcf1fa2b282 Author: Simon McVittie Date: 2012-08-28 16:53:17 +0100 McdAccountManager: remove useless virtual method We no longer allow McdAccountManager or McdAccount to be subclassed. Signed-off-by: Simon McVittie Reviewed-by: Xavier Claessens Bug: https://bugs.freedesktop.org/show_bug.cgi?id=54633 commit f1a2718edbe6392e399e4498dc86249ef3f90fac Author: Simon McVittie Date: 2012-08-28 16:50:12 +0100 McdAccountManager: move initialization from init to constructed This lets us use the construct properties, and in particular the TpDBusDaemon, which means we can make it a construct-time property on McdStorage. Signed-off-by: Simon McVittie Reviewed-by: Xavier Claessens Bug: https://bugs.freedesktop.org/show_bug.cgi?id=54633 commit 9ead40da113ae477439c322d605d9dc35d38e062 Author: Simon McVittie Date: 2012-09-06 19:04:42 +0100 Post-release version bump commit 329a390d283e44c2955e87600428fb7cd86b97bf Author: Simon McVittie Date: 2012-09-06 18:23:15 +0100 prepare release commit 8453cbb099abd8f3ab3992559750297cea7c7ce0 Merge: 2667fa0 dd0eb39 Author: Simon McVittie Date: 2012-09-06 18:11:50 +0100 Merge branch 'telepathy-mission-control-5.12' Conflicts: NEWS configure.ac commit dd0eb39c5da72f5f0fae9bfc28072b001044b7bd Author: Simon McVittie Date: 2012-09-06 18:05:24 +0100 tools/Makefile.am: be careful not to create empty files in the builddir "make distcheck" in an already-out-of-tree build turns out not to work because of this. This corresponds to commit beb2d971 in telepathy-glib. commit 073c5898443755d64752d92b2ac0c1f94581f3e9 Author: Simon McVittie Date: 2012-09-06 18:00:05 +0100 post-release version bump commit e37277d17d9c7cbbb519e9e881d1582727b3acb2 Author: Simon McVittie Date: 2012-09-06 16:59:40 +0100 Prepare release commit 5e1bbe8f891af4d86cb9dfd2f0b36fdfbbb7b2ef Author: Simon McVittie Date: 2012-09-06 16:40:37 +0100 Butterfly account migration: migrate the password too, if stored Otherwise the upgrade from Debian 6 to 7 forgets MSN passwords, which is not the end of the world, but seems less nice than it could be. Signed-off-by: Simon McVittie Reviewed-by: Xavier Claessens commit 3ae49c706e93d06131cabf5b4a0421869948ec62 Author: Simon McVittie Date: 2012-09-06 16:43:19 +0100 Migrate from Butterfly to Haze even if Butterfly is no longer installed Mission Control has a bug/design flaw/whatever in which it doesn't know the types of parameters without looking at the corresponding connection manager, which doesn't work if that connection manager has been uninstalled. This turns out to be bad for the upgrade from Debian 6 to Debian 7, which upgrades MC to a version that will perform the migration from Butterfly to Haze, but also uninstalls Butterfly... Since we know what the type of 'account' is, with a bit of refactoring we can tell McdAccount that we know it's a string, get its value anyway, and get on with our lives. Bug-Debian: http://bugs.debian.org/686835 Signed-off-by: Simon McVittie Reviewed-by: Xavier Claessens commit 1ce1e32bc7f83b5dfc3b75407e896c7bd7e6cbdb Author: Simon McVittie Date: 2012-08-30 18:50:41 +0100 Default account backend: when deleting passwords, delete the same thing we will look for Deleting secrets with param="param-password" isn't a whole lot of use when we save, and look up, param="password". Signed-off-by: Simon McVittie Reviewed-by: Jonny Lamb Bug: https://bugs.freedesktop.org/show_bug.cgi?id=42088 Cherry-picked-from: 1d9e8f5cfb9e7b426a99ae6e16c35c1101d55a91 commit bd56ee0e36a681ee50d3e02d4f158bbc5df462f1 Author: Simon McVittie Date: 2012-08-30 18:12:06 +0100 Default account backend: when deleting from the keyring, remove from secrets Otherwise we'd just delete it, then (because it's still in secrets) re-commit it! Signed-off-by: Simon McVittie Reviewed-by: Jonny Lamb Bug: https://bugs.freedesktop.org/show_bug.cgi?id=42088 Cherry-picked-from: 16e4507c5001f6f45158ef3d0b46998fa8c1ca2a commit efc15381535a2d94eeec2b19651302768f65d0ad Author: Simon McVittie Date: 2012-08-30 16:03:08 +0100 _keyring_commit: perform deletions for keys in removed, not in secrets 'removed' is essentially a set of (account, key) tuples that should be deleted. What we were doing was: foreach account in removed foreach key in secrets[account] delete (account, key) which makes little sense - if we have param-password and param-proxy-password and we want to unset Parameters['password'], the current implementation would delete both. This commit changes it to: foreach account in removed foreach key in removed[account] delete (account, key) which has the advantage of actually making sense. Signed-off-by: Simon McVittie Reviewed-by: Jonny Lamb Bug: https://bugs.freedesktop.org/show_bug.cgi?id=42088 Cherry-picked-from: d4ca35cffea9d0093e127e0be633501d22ded35f commit dbba880903def15bc7bb5fdb9d05ee310f1a5bfe Author: Simon McVittie Date: 2012-08-30 18:09:21 +0100 Default account backend: when deleting, always delete from both places Our tracking of whether something is "secret" (in the gnome-keyring) is pretty shaky, and in particular, we can forget that things are meant to be "secret" sometimes (we lose that information when deleting parameters). Happily, when we're deleting things, it doesn't actually matter: the right thing to do is clearly to delete from both locations, regardless of where we think it ought to be. Similarly, when we're setting a property to a new value, it's appropriate to delete it from both locations, then put it in the right location (only). Signed-off-by: Simon McVittie Reviewed-by: Jonny Lamb Bug: https://bugs.freedesktop.org/show_bug.cgi?id=42088 Cherry-picked-from: 5b4954d2c959c4ba7f6c67b7d8e16eaa5ab272dd commit 2667fa042934116d06a828767860964f52363943 Merge: 80e392f a5fb89b Author: Guillaume Desmottes Date: 2012-09-06 11:19:21 +0200 Merge branch 'telepathy-mission-control-5.12' commit a5fb89bad8b6fc7498cb7056faea1fdaa44de986 Author: Guillaume Desmottes Date: 2012-09-04 13:51:20 +0200 mcd_connectivity_monitor_is_online: check if we are awake as well To be considered as online, we have to be connected to the network *and* not in the proccess of sleeping. Fix a race where an account we just disconnected because we are going to sleep is put back online because the monitor was considering us online again. commit 80e392f2253fd9624b7a3862c6faeaf698905118 Author: Xavier Claessens Date: 2012-09-05 12:07:56 +0200 McpAccountStorage: add signal to request an account reconnection commit 81c21ac1e2755dd63ecca892d0dbc65f9c4aa8c6 Author: Xavier Claessens Date: 2012-09-05 12:10:12 +0200 McdAccount: factor out code to reconnect commit 23b91753f3460a0e4b52a1b9c4cec98603ff9c5c Author: Xavier Claessens Date: 2012-09-05 12:02:20 +0200 McpAccountStorage: add functions to emit interface' signals commit 87001e5b9f5ce3124167766d61fa9993e1fad3f4 Author: Simon McVittie Date: 2012-08-31 15:27:44 +0100 NEWS commit 2e3360a39c4a9202d3ba473292f90ef5a821b10c Author: Simon McVittie Date: 2012-08-30 19:32:19 +0100 Default account backend: test that *all* passwords are deleted Signed-off-by: Simon McVittie Reviewed-by: Jonny Lamb Bug: https://bugs.freedesktop.org/show_bug.cgi?id=42088 commit 825f59e988c8435c5de0899abe45081440991f7b Author: Simon McVittie Date: 2012-08-30 17:16:55 +0100 Test deletion of passwords from accounts Signed-off-by: Simon McVittie Reviewed-by: Jonny Lamb Bug: https://bugs.freedesktop.org/show_bug.cgi?id=42088 commit 455d7be6901945117761e697c9e561b4c0165ee7 Author: Simon McVittie Date: 2012-08-30 18:51:19 +0100 account-store-default: load the same names that MC would This tool was previously not deleting "param-". Signed-off-by: Simon McVittie Reviewed-by: Jonny Lamb Bug: https://bugs.freedesktop.org/show_bug.cgi?id=42088 commit 1d9e8f5cfb9e7b426a99ae6e16c35c1101d55a91 Author: Simon McVittie Date: 2012-08-30 18:50:41 +0100 Default account backend: when deleting passwords, delete the same thing we will look for Deleting secrets with param="param-password" isn't a whole lot of use when we save, and look up, param="password". Signed-off-by: Simon McVittie Reviewed-by: Jonny Lamb Bug: https://bugs.freedesktop.org/show_bug.cgi?id=42088 commit 16e4507c5001f6f45158ef3d0b46998fa8c1ca2a Author: Simon McVittie Date: 2012-08-30 18:12:06 +0100 Default account backend: when deleting from the keyring, remove from secrets Otherwise we'd just delete it, then (because it's still in secrets) re-commit it! Signed-off-by: Simon McVittie Reviewed-by: Jonny Lamb Bug: https://bugs.freedesktop.org/show_bug.cgi?id=42088 commit d4ca35cffea9d0093e127e0be633501d22ded35f Author: Simon McVittie Date: 2012-08-30 16:03:08 +0100 _keyring_commit: perform deletions for keys in removed, not in secrets 'removed' is essentially a set of (account, key) tuples that should be deleted. What we were doing was: foreach account in removed foreach key in secrets[account] delete (account, key) which makes little sense - if we have param-password and param-proxy-password and we want to unset Parameters['password'], the current implementation would delete both. This commit changes it to: foreach account in removed foreach key in removed[account] delete (account, key) which has the advantage of actually making sense. Signed-off-by: Simon McVittie Reviewed-by: Jonny Lamb Bug: https://bugs.freedesktop.org/show_bug.cgi?id=42088 commit 5b4954d2c959c4ba7f6c67b7d8e16eaa5ab272dd Author: Simon McVittie Date: 2012-08-30 18:09:21 +0100 Default account backend: when deleting, always delete from both places Our tracking of whether something is "secret" (in the gnome-keyring) is pretty shaky, and in particular, we can forget that things are meant to be "secret" sometimes (we lose that information when deleting parameters). Happily, when we're deleting things, it doesn't actually matter: the right thing to do is clearly to delete from both locations, regardless of where we think it ought to be. Similarly, when we're setting a property to a new value, it's appropriate to delete it from both locations, then put it in the right location (only). Signed-off-by: Simon McVittie Reviewed-by: Jonny Lamb Bug: https://bugs.freedesktop.org/show_bug.cgi?id=42088 commit c21e2b09bf4cdda6fb05d64f9198f6db7b776c76 Author: Simon McVittie Date: 2012-08-30 16:53:36 +0100 Make the gnome-keyring test work again, with modern gnome-keyring Signed-off-by: Simon McVittie Reviewed-by: Jonny Lamb Bug: https://bugs.freedesktop.org/show_bug.cgi?id=42088 commit 548801efb1852a1b0be04992f248adc60123a973 Author: Jonny Lamb Date: 2012-06-15 18:15:46 +0100 gitignore: updated Signed-off-by: Jonny Lamb Reviewed-by: Simon McVittie commit 1e6577380a651ba28388a4a0d806e64065e48c56 Author: Simon McVittie Date: 2012-08-28 16:14:34 +0100 NEWS commit 676be2e38d43dc5dd5cc5507c4bccea159b4d735 Author: Simon McVittie Date: 2012-08-27 19:04:16 +0100 plugin-account.c: rename to mcd-storage.c Signed-off-by: Simon McVittie Reviewed-by: Xavier Claessens Bug: https://bugs.freedesktop.org/show_bug.cgi?id=54151 commit 019ebd806da9f0b83a1ab2ef60bc03e9e0da5af0 Author: Simon McVittie Date: 2012-08-27 19:01:35 +0100 McdStorage, McdPluginAccountManager: squash into one class The Storage name stays, to make the diff more readable. The header is mcd-storage.h but the implementation is still plugin-account.c, for the same reason. Signed-off-by: Simon McVittie Reviewed-by: Xavier Claessens Bug: https://bugs.freedesktop.org/show_bug.cgi?id=54151 commit 61066078763c94ef9ce7d674b7b2e19efe6d709e Author: Simon McVittie Date: 2012-08-27 18:02:51 +0100 McdStorage: remove _mcd_storage_store_connections I'm not sure why this was in McdStorage at all. It's a bit of a layering violation: AccountManager has a Storage, so Storage shouldn't call into AccountManager. We can fix the layering violation by adding a signal to McdAccount. Signed-off-by: Simon McVittie Reviewed-by: Xavier Claessens Bug: https://bugs.freedesktop.org/show_bug.cgi?id=54151 commit 6d6fe1b3903e1df4714a0fc217f75e9ea1120c19 Author: Simon McVittie Date: 2012-08-27 17:05:45 +0100 McdPluginAccountManager: fold interface methods into their implementations Nothing except McdPluginAccountManager implements McdStorage, and nothing ever will or should, so we can squash the two together. Signed-off-by: Simon McVittie Reviewed-by: Xavier Claessens Bug: https://bugs.freedesktop.org/show_bug.cgi?id=54151 commit 448148d83cb488c9909290a8f1ea04e8c490e968 Author: Simon McVittie Date: 2012-08-27 16:37:12 +0100 McdMaster: fail to build if umask() is missing We ought to be able to rely on umask() for files created since 5.2.2, at least on Unix. Signed-off-by: Simon McVittie Reviewed-by: Xavier Claessens Bug: https://bugs.freedesktop.org/show_bug.cgi?id=54151 commit 70062e7a10ff62b3e0852001ab93a4bd9375714d Author: Xavier Claessens Date: 2012-08-28 11:18:10 +0200 mc-tool: Display account's supersedes commit b5e82890de690905cabe24203ecd46ae41075998 Merge: a3cb554 47f3cb5 Author: Simon McVittie Date: 2012-08-27 11:50:59 +0100 Merge branch 'telepathy-mission-control-5.12', rejecting stable-only changes commit 47f3cb54fcda485e3fbfc9b297dd556a504273b7 Author: Simon McVittie Date: 2012-08-27 11:49:45 +0100 NEWS commit 249a3a81704d7af6426cc58732097056ca482c19 Author: Simon McVittie Date: 2012-08-27 11:48:04 +0100 Revert "stop using deprecated tp-glib functions" This wasn't really an appropriate change for a stable branch: it introduced code churn without actually fixing a bug. We should ignore deprecation warnings instead. This reverts commit 88642511bb9c6f66d2fe4aae1550893eb0d781b2. Signed-off-by: Simon McVittie Acked-by: Jonny Lamb commit df7276a652ac3f69e330f1fb8d126c229041ace0 Author: Simon McVittie Date: 2012-08-27 10:50:08 +0100 Don't warn on deprecated declarations, this is a stable branch. Signed-off-by: Simon McVittie commit 131248f8e1aec7b47e47e96d33122f4bfbcb66f2 Author: Simon McVittie Date: 2012-08-14 16:41:45 +0100 Disable the connectivity GSetting on Android There's no immediately obvious way to install GSettings schemas there. Signed-off-by: Simon McVittie Reviewed-by: Jonny Lamb Bug: https://bugs.freedesktop.org/show_bug.cgi?id=53497 commit a3cb554fd61cd91aec453052356570602e802475 Merge: af504f1 09c0b67 Author: Simon McVittie Date: 2012-08-08 10:36:49 +0100 Merge branch 'telepathy-mission-control-5.12' Conflicts: NEWS configure.ac commit 09c0b67148873c65d36afd322712a8a6db7eb7a5 Author: Simon McVittie Date: 2012-08-08 10:32:58 +0100 NEWS commit ad4b94ecd7768bd952cdcba51fd7039f564e6765 Author: Simon McVittie Date: 2012-08-07 19:48:09 +0100 Avoid race between Mission Control's two names by having one wait for the other If you do: dbus-send --dest=org.freedesktop.Telepathy.MissionControl5 \ --type=method_call --print-reply / org.freedesktop.DBus.Peer.Ping & \ dbus-send --dest=org.freedesktop.Telepathy.AccountManager \ --type=method_call --print-reply / org.freedesktop.DBus.Peer.Ping then one or both of the calls will fail because the executable claims one of its bus names, but can't get the other, and exits 1. By making one wait for the other, we get the desired behaviour. I've made activating MissionControl5 wait for AccountManager because in MC's current implementation AccountManager is taken last. Reviewed-by: Jonny Lamb Bug: https://bugs.freedesktop.org/show_bug.cgi?id=53220 commit af504f1f7db73c71e35f3c3701bfe9e428d02b72 Author: Guillaume Desmottes Date: 2012-08-07 10:36:28 +0200 mc-tool: don't display empty 'Addressing' section The general behaviour is to only display relevant fields. https://bugs.freedesktop.org/show_bug.cgi?id=53202 commit e845663d154a94d76131dd3ab3534037a3bb516e Author: Guillaume Desmottes Date: 2012-08-07 10:24:05 +0200 mc-tool: add 'dump' command Useful to quickly check all the accounts in one shot. https://bugs.freedesktop.org/show_bug.cgi?id=53202 commit 548451d9e4ef003dd64714d31850f04911eb7277 Author: Guillaume Desmottes Date: 2012-08-07 10:16:50 +0200 mc-tool: display Account.Storage settings Don't display StorageSpecificInformation as it requires an extra async call to be retrieved and it's not that useful anyway. https://bugs.freedesktop.org/show_bug.cgi?id=53202 commit af6c1ad94a7a677506f10778d426106d8538b428 Author: Simon McVittie Date: 2012-07-31 11:47:53 +0100 NEWS (also mention removal of obsolete features in 5.13.0) commit ddd21ba082fd5a90e93052463d00927853a8ecea Merge: ee34e40 694be3e Author: Simon McVittie Date: 2012-07-30 15:41:00 +0100 Merge branch 'one-channel-should-be-enough-for-anyone' Reviewed-by: Jonny Lamb Bug: https://bugs.freedesktop.org/show_bug.cgi?id=52305 commit ee34e40100294702f9bcde300056f659de4e3ed8 Author: Xavier Claessens Date: 2012-07-23 14:02:13 +0200 Post-release version bump commit 56a82e1c202ace036885b4a4b04feb64b14fde99 Author: Xavier Claessens Date: 2012-07-23 13:53:43 +0200 Prepare 5.13.0 release commit fd24dd6521bf9a9bebfcbf0241b3b8129bc90e61 Author: Xavier Claessens Date: 2012-07-19 10:38:20 +0200 McdAccountStorage: fix altered-one signal https://bugs.freedesktop.org/show_bug.cgi?id=52231 commit 149a95692b98dbeb84f1ce4a6a11447e015f0598 Author: Xavier Claessens Date: 2012-07-19 10:38:20 +0200 McdAccountStorage: fix altered-one signal https://bugs.freedesktop.org/show_bug.cgi?id=52231 commit 366068c784c7875516a817d480c3ecf244398680 Author: Xavier Claessens Date: 2012-07-17 16:51:41 +0200 CreateAccount: make possible to select a desired storage https://bugs.freedesktop.org/show_bug.cgi?id=52231 commit 694be3e53cb8523f86afb73f3ecc0f089610375a Author: Simon McVittie Date: 2012-07-20 14:03:51 +0100 McdDispatchOperation: only have one lost_channel, too https://bugs.freedesktop.org/show_bug.cgi?id=52305 commit 080860028665d9d76bede9c8f96e315af365fb5f Author: Simon McVittie Date: 2012-07-20 13:46:52 +0100 McdDispatchOperation: store one McdChannel, not a list https://bugs.freedesktop.org/show_bug.cgi?id=52305 commit d8da0aa2b9144d26da3926a6cf8f6f154cd5729c Author: Simon McVittie Date: 2012-05-15 20:06:36 -0400 McdDispatchOperation: collect_satisfied_requests: only take one channel https://bugs.freedesktop.org/show_bug.cgi?id=52305 commit 01e04709772936a6791330b49c02167b0ea7fafa Author: Simon McVittie Date: 2012-07-20 13:33:08 +0100 Replace iteration over channels with check for having a channel Now that there can only be one channel, we don't need to iterate. https://bugs.freedesktop.org/show_bug.cgi?id=52305 commit 60ee7341921191f2de4ec587eb098fe55488a869 Author: Simon McVittie Date: 2012-07-20 13:27:19 +0100 _mcd_dispatch_operation_new: only take one channel https://bugs.freedesktop.org/show_bug.cgi?id=52305 commit 80ea4690cef4b6e2e4509df7fc9040b66ff93faf Author: Simon McVittie Date: 2012-07-20 12:13:30 +0100 _mcd_dispatch_operation_dup_channels: turn into dup_channel, singular https://bugs.freedesktop.org/show_bug.cgi?id=52305 commit b8427349b001b799b9b0dfd63686cc80c2625722 Author: Simon McVittie Date: 2012-07-20 12:12:59 +0100 McdDispatchOperation: use internal list instead of dup_channels() Now that there can only be at most one channel in the list, it's pretty easy to do directly. https://bugs.freedesktop.org/show_bug.cgi?id=52305 commit 4877199bfb9ac256dc50893adc6462c288c1a36a Author: Simon McVittie Date: 2012-07-20 12:04:35 +0100 _mcd_dispatch_operation_peek_channel: adapt from old _peek_channels Now that the CDO can contain at most one channel, there's no need to return a list. https://bugs.freedesktop.org/show_bug.cgi?id=52305 commit 89aeb1f75cbdb787e2e4df6433fd41f62d6660d8 Author: Simon McVittie Date: 2012-07-20 13:15:26 +0100 McdDispatchOperation: change channels property to channel (singular) For now, the variable that implements this property is still a list of length 1. https://bugs.freedesktop.org/show_bug.cgi?id=52305 commit 95eabd3a26fac84405bd79f1dc109f50ed0fba06 Author: Simon McVittie Date: 2012-05-15 17:12:37 -0400 McdDispatchOperation: remove untrue comment I dimly remember that _mcd_dispatch_operation_new once had (transfer container) or possibly even (transfer full) semantics for the list of channels, but I also dimly remember removing it. The implementation certainly has (transfer none) semantics, and its one caller behaves as such too. https://bugs.freedesktop.org/show_bug.cgi?id=52305 commit 26817f3a31da1cc1eed75e296c6ec8f769ebb3bc Author: Simon McVittie Date: 2012-07-20 13:04:01 +0100 _mcd_dispatcher_enter_state_machine: only take one channel https://bugs.freedesktop.org/show_bug.cgi?id=52305 commit b015e6c79f59bbb8cc78405dc06aa0e9ee27ed80 Author: Simon McVittie Date: 2012-05-15 11:41:29 +0100 _mcd_client_registry_list_possible_handlers: only take one channel https://bugs.freedesktop.org/show_bug.cgi?id=52305 commit a30524b98da9403099dc303602b432d1b384237e Author: Simon McVittie Date: 2012-07-20 11:51:38 +0100 mcd_dispatcher_dup_possible_handlers: only take one TpChannel https://bugs.freedesktop.org/show_bug.cgi?id=52305 commit 7b0ebf426f26d9790217f5b14808e2ace1f15de9 Author: Simon McVittie Date: 2012-07-20 12:43:51 +0100 _mcd_dispatcher_take_channels: make singular, rename to ...add_channel It was previously (transfer container), now it's (transfer none). https://bugs.freedesktop.org/show_bug.cgi?id=52305 commit 97106c13aa76b29e46a965cf57cfbdf76ea3e767 Author: Simon McVittie Date: 2012-07-20 12:35:57 +0100 McdConnection: dispatch each channel from NewChannels separately This loses information - you can no longer tell the channels are related - but in practice nobody handles Text and Tube channels as a unit anyway, and signalling them together is now deprecated. https://bugs.freedesktop.org/show_bug.cgi?id=52305 commit b7e524b85b37f913431856514310a9e7749fddac Author: Simon McVittie Date: 2012-05-14 17:06:00 +0100 McdConnection: remove virtual methods Now that embedding and old-style plugins have been abolished, nothing can override them. https://bugs.freedesktop.org/show_bug.cgi?id=52305 commit c133c5b86a67a70594c6327578f4c7956b0112f0 Author: Xavier Claessens Date: 2012-07-19 11:17:09 +0200 Do not change RequestedPresence when disabling the account We can keep RequestedPresence to online, in which case the account will go back online when account gets enabled. https://bugs.freedesktop.org/show_bug.cgi?id=52259 commit cae1b270732bab16cb3324e912fc2956baa784bc Author: Xavier Claessens Date: 2012-07-12 11:12:30 +0200 Fix missing includes to build with recent libaccounts-glib commit c39128f213943b1f6f074a0b617ba7592fc8e846 Author: Xavier Claessens Date: 2012-07-12 11:11:54 +0200 Add missing config.h include to ignore tp-glib 0.20 deprecations commit dadff3e6147d914522afbde3c47023a5a9d10bf8 Author: Xavier Claessens Date: 2012-07-12 11:10:52 +0200 Do not ignore return valud of write() commit 329c70f9f63eb25dadeb145225a83d25cecb7eec Author: Xavier Claessens Date: 2012-07-11 13:03:05 +0200 start working on version 5.12.2 commit e824493e533f7c4ea9ae9066fb29b3298d9a8aa8 Author: Xavier Claessens Date: 2012-07-11 12:49:04 +0200 Prepare 5.12.1 release commit ac021dcd68cff4cc101c06b3f8abe246c21c6c15 Merge: eff02cf 57d7c63 Author: Xavier Claessens Date: 2012-07-11 12:15:52 +0200 Merge branch 'telepathy-mission-control-5.12' commit 57d7c6360f04d8bc65320c42a5d8929fa3e3bc25 Author: Xavier Claessens Date: 2012-07-11 12:14:11 +0200 Copy telepathy.am from telepathy-glib It make sure "make -j3 maintainer-foo" works commit 0daa22ca3858138aee10f8bf46a07fd15c1fcf49 Author: Xavier Claessens Date: 2012-07-09 12:35:01 +0200 McdAccountManagerDefault: Fix a possible double free If the account is already in the hashtable, g_hash_table_insert() will set @removed as value, but free it since the key already in the table is kept. https://bugs.freedesktop.org/show_bug.cgi?id=51842 commit eff02cf76254af6b9169badcfe76cd7890a0df6b Author: Xavier Claessens Date: 2012-07-09 12:35:01 +0200 McdAccountManagerDefault: Fix a possible double free If the account is already in the hashtable, g_hash_table_insert() will set @removed as value, but free it since the key already in the table is kept. https://bugs.freedesktop.org/show_bug.cgi?id=51842 commit 150c89d45c6b7d5a2d10bc36cff5689ea1ca72d8 Author: Will Thompson Date: 2012-04-05 17:10:18 +0100 dispatch test: make sure Ensure-ing channels after delegation/presenting works commit 54f4fd22c09a342bb58da978b5a055e45f968897 Author: Jonny Lamb Date: 2012-07-06 16:50:08 +0100 dispatcher: set channel state back to DISPATCHED after delegating & presenting _mcd_client_proxy_handle_channels sets the McdChannel state to HANDLER_INVOKED, but when we were calling this in both delegate and present operations, the state was not being set back to the DISPATCHED state afterwards. The state being wrong meant that dispatching a channel after if had been delegated or presented would not happen, as MC thought we were still waiting for a handler response. Signed-off-by: Jonny Lamb commit c8ae24ffd03297d097b553997eda3807f1505748 Author: Jonny Lamb Date: 2012-07-06 16:49:55 +0100 dispatcher: add more debug output when delegating channels Signed-off-by: Jonny Lamb commit 3d35096f9ccc69b8c3067ed85102694eda4a2855 Author: Will Thompson Date: 2012-04-05 16:56:35 +0100 Modernize dispatcher/redispatch-channels.py a little commit 6e8be05e1c1b5856575bb7d8404d4429824e4981 Merge: ebc338e d8c0bf7 Author: Jonny Lamb Date: 2012-07-09 18:10:39 +0100 Merge branch 'present-delegate-broken' commit d8c0bf71670b61a900e788413a9673d01f6ce06c Author: Will Thompson Date: 2012-04-05 17:10:18 +0100 dispatch test: make sure Ensure-ing channels after delegation/presenting works commit 6397152f8dbec113d46c5cbd2d6d9b936c31481b Author: Jonny Lamb Date: 2012-07-06 16:50:08 +0100 dispatcher: set channel state back to DISPATCHED after delegating & presenting _mcd_client_proxy_handle_channels sets the McdChannel state to HANDLER_INVOKED, but when we were calling this in both delegate and present operations, the state was not being set back to the DISPATCHED state afterwards. The state being wrong meant that dispatching a channel after if had been delegated or presented would not happen, as MC thought we were still waiting for a handler response. Signed-off-by: Jonny Lamb commit f037c639b5a14f94a1ca3fd9f3dcb92e455aabb5 Author: Jonny Lamb Date: 2012-07-06 16:49:55 +0100 dispatcher: add more debug output when delegating channels Signed-off-by: Jonny Lamb commit a01a0267e3f90a45b497664758bde0c0cd794ef4 Author: Will Thompson Date: 2012-04-05 16:56:35 +0100 Modernize dispatcher/redispatch-channels.py a little commit ebc338e2a5bc441879895be28c1c822f3a192157 Author: Guillaume Desmottes Date: 2012-06-22 09:19:21 +0200 use a DEBUG instead of warning if dbus_bus_add_match failed Also, make the message more explicit to one can check is D-Bus version if he's wondering why it failed. https://bugs.freedesktop.org/show_bug.cgi?id=51282 commit 08a7e21ad3d6664e7c2603906d76ca6222d1ac79 Author: Alvaro Soliverez Date: 2012-05-17 18:01:19 -0300 Android: adjust library name to fit latest changes commit 2c71a0c2c7a157e017b923cb2e0ed8e08a941b4f Author: Simon McVittie Date: 2012-05-10 16:37:31 +0100 Use telepathy-glib meta-headers Signed-off-by: Simon McVittie Reviewed-by: Jonny Lamb Bug: https://bugs.freedesktop.org/show_bug.cgi?id=49753 commit c5c011b0dc60508790b0410b37f2b6307d9d13d0 Author: Simon McVittie Date: 2012-05-10 16:30:59 +0100 Require telepathy-glib 0.19.0 Signed-off-by: Simon McVittie Reviewed-by: Jonny Lamb Bug: https://bugs.freedesktop.org/show_bug.cgi?id=49753 commit 48747e5c606d8b641ecff7eb77da163c9730e13e Author: Simon McVittie Date: 2012-05-10 16:06:27 +0100 McdConnection: don't bother refcounting handles, they're immortal Signed-off-by: Simon McVittie Reviewed-by: Jonny Lamb Bug: https://bugs.freedesktop.org/show_bug.cgi?id=49753 commit 7519795ea2a12f45ba8a03b6e9c70407563e97ec Author: Simon McVittie Date: 2012-05-10 15:57:54 +0100 mcd_account_connection_ready_cb: use self-contact for normalized name This saves us a pointless round-trip: the normalized name is part of CORE now. Signed-off-by: Simon McVittie Reviewed-by: Jonny Lamb Bug: https://bugs.freedesktop.org/show_bug.cgi?id=49753 commit 336ee3384c5e92003cbf58386db2c3aff3aabdc5 Author: Simon McVittie Date: 2012-05-10 15:34:17 +0100 McdClientProxy, McdClientRegistry: remove now-unused string pool Signed-off-by: Simon McVittie Reviewed-by: Jonny Lamb Bug: https://bugs.freedesktop.org/show_bug.cgi?id=49753 commit 3109731e32597d38a358263c7382ad09fcfff667 Author: Simon McVittie Date: 2012-05-10 15:32:43 +0100 McdClientProxy: store capability tokens as a strv, not a handle set There aren't *that* many of them, and handles are immortal now. If g_strdupv'ing the capability tokens ends up taking too much memory, we should write a generic refcounted string pool instead (but I doubt it will, in any case). Signed-off-by: Simon McVittie Reviewed-by: Jonny Lamb Bug: https://bugs.freedesktop.org/show_bug.cgi?id=49753 commit 42f20c1472f0073b320b860e1f868817cb6c3bb5 Author: Simon McVittie Date: 2012-05-10 15:20:02 +0100 _mcd_client_proxy_add_cap_tokens: switch from "add" to "set" semantics In both the cases where it's called (when we get a reply to GetAll, and when we've parsed a .client file), we actually want to take the new set, not union it with an existing set. Also, this will be easier to deal with when we stop (ab)using handles for this. Signed-off-by: Simon McVittie Reviewed-by: Jonny Lamb Bug: https://bugs.freedesktop.org/show_bug.cgi?id=49753 commit 96b49d683e449841ae4dc0a09aae6223db1a2a90 Merge: 91f8540 3382019 Author: Simon McVittie Date: 2012-05-10 15:07:37 +0100 Merge branch 'deprecations' Bug: https://bugs.freedesktop.org/show_bug.cgi?id=24762 Bug: https://bugs.freedesktop.org/show_bug.cgi?id=24899 Bug: https://bugs.freedesktop.org/show_bug.cgi?id=24914 Bug: https://bugs.freedesktop.org/show_bug.cgi?id=49648 Reviewed-by: Jonny Lamb commit 3382019e8ba7772848fa30448ca2addf5346aeef Author: Simon McVittie Date: 2012-05-08 15:30:41 +0100 McdDispatcher: don't be a McdMission The dispatcher subscribes to the master's abort signal rather than implementing any of the McdMission virtual methods, so nothing in McdMission is actually doing anything for it. This means we can get rid of McdProxy, so, do. commit 896e81dfee45830c8ab553c7324d8b2190b9775e Author: Simon McVittie Date: 2012-05-08 15:02:43 +0100 McdMission: remove placeholders for old signals, methods We're not supporting out-of-tree plugins any more. commit 17bef3f25da89629e9a8ca880a0833d6504986cf Author: Simon McVittie Date: 2012-05-08 15:00:05 +0100 McdMission: remove parent-set signal and parent property, unused commit 147b36b2a4c087b230e2fcb735aa5631da045c90 Author: Simon McVittie Date: 2012-05-08 14:48:07 +0100 mcd_transport_plugin_get_name: remove, unused You can just use g_type_name() anyway. commit 15d14bf15c3619a9d4ffa3adc5c80a2c6177d543 Author: Simon McVittie Date: 2012-05-08 14:35:17 +0100 Flatten McdPlugin into McdMaster This older plugin API exposes enough MC internals that there's no point trying to support it out-of-tree. commit e92a53b0529ecfdbcdcbc8d9db830919b547abbd Author: Simon McVittie Date: 2012-05-08 14:29:17 +0100 mcd_master_get_dispatcher, mcd_plugin_get_dispatcher: remove commit 46b86f8fd7584c5f8dbfc247fea25d32c27d4733 Author: Simon McVittie Date: 2012-05-08 14:26:36 +0100 mcd_manager_create_connection: don't be virtual, no subclass exists commit f4fe5fcdcfab0d00c63f4a2f3349ae8612bb9d5d Author: Simon McVittie Date: 2012-05-08 14:23:02 +0100 mcd_manager_get_dispatcher: remove, unused commit c420774c0fd30ea25220951145d5c23af25ebf57 Author: Simon McVittie Date: 2012-05-08 14:22:54 +0100 mcd_manager_get_connection: remove, unused commit ecfcf42a1ef35e45cd617301cd36deb0aeb7e77c Author: Simon McVittie Date: 2012-05-08 14:14:07 +0100 McdDispatcherContext: remove commit 52a0fc268cc12fe4aa2c3b5c9ae05bf31f11722d Author: Simon McVittie Date: 2012-05-08 14:12:00 +0100 inline McdDispatcherContext's methods commit 1f3fa4e2322daef9e965e2159c4ebd0b9ae2a9dd Author: Simon McVittie Date: 2012-05-08 14:08:25 +0100 Inline what's left of mcd_dispatcher_context_proceed into its only caller commit 76f016bdad63f0ea68bc11e64be54e01b61004b3 Author: Simon McVittie Date: 2012-05-08 14:05:04 +0100 Remove the concept of old-style filters altogether commit a22bf24e9189c98a87baef9b7288a37795424d66 Author: Simon McVittie Date: 2012-05-08 14:01:39 +0100 McdDispatcher: remove the ability to add old-style filters commit 1884b434805173e2d8b4eb6e6f6dc3f0f0b25129 Author: Simon McVittie Date: 2012-05-08 13:59:24 +0100 Remove remaining McdDispatcherContext getters, which are now unused commit 0a1e2de74466b78f2e99ee4c82e21dfbe4be3715 Author: Simon McVittie Date: 2012-05-08 13:58:31 +0100 Remove various unused getters from McdDispatcherContext commit c76a8013952a1fa0c85aa80777d765f51fe3f23b Author: Simon McVittie Date: 2012-05-08 13:56:47 +0100 mcd_dispatcher_context_get_channel_by_type: remove, unused This also means we can drop mcd_channel_get_channel_type_quark. commit a9f3580a8738260a2db4ebf7237adb389a5521f7 Author: Simon McVittie Date: 2012-05-08 13:54:58 +0100 mcd_dispatcher_context_forget_all and friends: remove, unused commit 5a3a0b3d417423a5fb588b36c65f0c7709556de9 Author: Simon McVittie Date: 2012-05-08 13:54:03 +0100 mcd_dispatcher_context_proceed: make private Ideally it should be inlined into its only caller, but this will do for now. commit 8fbc9bb3fc7f0714342dff2fd637824f88c653ac Author: Simon McVittie Date: 2012-05-08 13:52:25 +0100 mcd_dispatcher_context_process: remove commit 33987d0226e04381a1bda79bdfeadfc815943e53 Author: Simon McVittie Date: 2012-05-08 13:47:12 +0100 Remove McdController and inline its shutdown method into McdMaster commit d78e084fbfaaeafc4085284febbc0925cd4b25aa Author: Simon McVittie Date: 2012-05-08 13:34:38 +0100 McdChannel: remove more unused accessors commit 2f243467c66a466123cbfa1aa183fd3425bae2f9 Author: Simon McVittie Date: 2012-05-08 13:32:49 +0100 mcd_channel_get_name: remove, unused commit a70fc835f8bfaa3addab1106ff90e2b78b5dc737 Author: Simon McVittie Date: 2012-05-08 13:30:02 +0100 mcd_channel_get_inviter: remove commit 3b1f2acfbba23112148e367dd2216f6570b308d0 Author: Simon McVittie Date: 2012-05-08 13:29:15 +0100 McdChannel: stop tracking group members All it does now is to emit DEBUG() messages. commit 6c4526da85db2e963a602776f34de659362d90aa Author: Simon McVittie Date: 2012-05-08 13:28:07 +0100 mcd_channel_get_members_accepted and members-accepted signal: remove commit c91020a26d451d44096eea463e393a1b3101e3f1 Author: Simon McVittie Date: 2012-05-08 13:25:47 +0100 mcd_channel_is_missed: remove, unused commit e18c550af9c5c5b16017f458e1080a2736db7160 Author: Simon McVittie Date: 2012-05-08 13:23:36 +0100 mcd_connection_cancel_channel_request: remove, unused commit 25e12a0978aceccff2ce2a2bea6437404a627e44 Author: Simon McVittie Date: 2012-05-08 13:22:06 +0100 Account, AccountManager: remove various unused methods commit b647c66404e33db2a9dd473124bb7d566ffeb845 Author: Simon McVittie Date: 2009-12-18 14:34:05 +0000 mcd_manager_cancel_channel_request: remove Nothing calls it any more. commit cb8783c25ac8228ae5248bfa8bc8596fa6968879 Author: Simon McVittie Date: 2012-05-08 13:08:45 +0100 Remove unused support for a magical auto-away flag set by embedders Less code, fewer bugs. Also, people should have stopped embedding MC by now, and an earlier patch in this series made it impossible. commit 0deffb0262f2c33b582df25e06c931f0693ded3e Author: Simon McVittie Date: 2012-05-08 13:05:22 +0100 mcd_dispatcher_get_channel_type_usage: remove Nothing in-tree calls it, and the modern way to do this would be a MCP plugin that's a pseudo-observer. commit e7aea65314998512931f7988bea3babc0a548776 Author: Simon McVittie Date: 2012-05-08 13:03:59 +0100 mcd_debug_ref, mcd_debug_unref: remove They're officially deprecated and everything! commit a307cc9bbac1a7943b44a46813df0986731759a2 Author: Simon McVittie Date: 2012-05-08 14:40:52 +0100 McdProvisioning: remove, unused commit e9495b13221eeecfafe9813c69e14f8734ac604c Author: Simon McVittie Date: 2012-05-08 14:39:51 +0100 McdProvisioningFactory: remove, unused commit 182dae7a10bea7307a16a52d9d1216bf9e38457c Author: Simon McVittie Date: 2012-05-08 12:46:51 +0100 Remove deprecated support for old-style (mcd) plugins Only in-tree code can use mcd_* functions now. commit 524c5a6e0cf654e092e54870470656bdeba3c408 Author: Simon McVittie Date: 2012-05-08 16:59:39 +0100 Remove support for the non-standard Query interface commit cf819e45d2b0cb5d0f2868a28dea84223692d152 Author: Simon McVittie Date: 2012-05-08 13:12:54 +0100 Remove non-standard Compat interface commit 31b5eec29cf8e8a0d8ea503d4cc70055d003acfc Author: Simon McVittie Date: 2012-05-08 16:54:10 +0100 Remove support for archaic Capabilities interface No, not ContactCapabilities, Capabilities... commit ab92d3f1f2775854fbe801023a04df6839d639ac Author: Simon McVittie Date: 2012-05-08 14:16:29 +0100 _mcd_dispatcher_get_channel_enhanced_capabilities: remove, unused This was left over from ContactCapabilities.DRAFT1. commit 959d95db540a3a02ddb3e6fdb88f7b256301bd10 Author: Simon McVittie Date: 2012-05-08 14:36:20 +0100 _mcd_file_set_contents: remove, unused commit 8256dd642f79c8a35a1ae4f4aa5e9f5f17e1f54d Author: Simon McVittie Date: 2012-05-08 13:31:55 +0100 _mcd_connection_channel_is_urgent: remove, unused commit b58ba958bdeb7d872ed51eaf74288755b784b8cd Author: Simon McVittie Date: 2012-05-08 14:20:21 +0100 _mcd_dispatcher_get_client_registry: remove, unused commit b5ed6bd05b4482dadae245bb6c36ffbed00aee88 Author: Simon McVittie Date: 2012-05-08 13:03:41 +0100 Consistently include config.h in every .c file This is best-practice, and in particular it stops us from accidentally redefining GLIB_VERSION_MIN_REQUIRED, GLIB_VERSION_MAX_ALLOWED by including glib.h before (something that includes) config.h. commit 4850e3cd729f7a0c8c98e5c1452824abb7c776eb Author: Simon McVittie Date: 2012-05-08 12:54:21 +0100 Use the GObject 2.30 generic marshaller commit 4536ccdd1c187df466a9321ad234293f0563fe19 Author: Simon McVittie Date: 2012-05-08 12:52:59 +0100 Drop separate GIO check, we now include it in GLIB_LIBS Also use GLib 2.32 deprecation/availability checking. commit e0d36e4bb93119d5c23cc437a2fefd40675af034 Author: Simon McVittie Date: 2012-05-07 19:22:34 +0100 Use TpIntset instead of long-deprecated alias TpIntSet commit c3d77d670607907451811fe658198ccaffddd7d0 Author: Simon McVittie Date: 2012-05-07 19:21:45 +0100 Use TP_ERROR instead of long-deprecated TP_ERRORS commit 91f8540057fc4778ce0cc64ae8a86eaa02287168 Author: Simon McVittie Date: 2012-05-07 19:29:57 +0100 Set G_MESSAGES_DEBUG during testing The same as Gabble commit cbfa9d06. commit eb71e5aa43b11bb615cec0df0ff15558bcc9f3f8 Author: Guillaume Desmottes Date: 2012-05-07 09:36:39 +0200 _storage_dup_value: add the account to the error debug message I'm trying to track a bug and having this would have been useful. commit 45b935c3a47e0dee9965dca00a9acdfc4b5011fa Author: Vivek Dasmohapatra Date: 2012-05-02 18:45:38 +0100 Update news for fd.o#48646 fix commit ef2fb6a8e6decde7d225a17e8e894140f0dbefb2 Author: Vivek Dasmohapatra Date: 2012-04-13 14:12:53 +0100 GValue was unset in a code path that needed it to stay set commit 11ca259567fc7e01bfd88620c1003994af9f8ff1 Merge: 791b4b0 8864251 Author: Jonny Lamb Date: 2012-04-03 11:15:25 -0400 Merge branch 'telepathy-mission-control-5.12' commit 88642511bb9c6f66d2fe4aae1550893eb0d781b2 Author: Jonny Lamb Date: 2012-04-03 11:13:55 -0400 stop using deprecated tp-glib functions tp_*_call_when_ready were replaced by tp_proxy_prepare_async a while ago. Signed-off-by: Jonny Lamb commit 791b4b0dd45aec82447dc3c0ef4f31f90286015c Author: Jonny Lamb Date: 2012-04-02 18:59:27 -0400 start on version 5.13.0 Signed-off-by: Jonny Lamb commit edd10ce2948b29859006ca1e149e68097a3bd21b Author: Jonny Lamb Date: 2012-04-02 18:58:07 -0400 start working on version 5.12.1 Signed-off-by: Jonny Lamb commit aeba9f785227e07bf26b14822b1b288041297910 Author: Jonny Lamb Date: 2012-04-02 18:22:56 -0400 version 5.12.0 Signed-off-by: Jonny Lamb commit f185df41b7f514ce28bb121ec4abdc5dc422b7a0 Author: Jonny Lamb Date: 2012-04-02 18:07:14 -0400 update NEWS for 5.12.0 Signed-off-by: Jonny Lamb commit 154f2b42310090f947988df8fd44ee34a6cbb18a Author: Jonny Lamb Date: 2012-04-02 18:48:21 -0400 fakeconnectivity: implement GetAll and GetDevices for NM This is needed for newer libnm-glib. We should start using nm_client_new_async(). Signed-off-by: Jonny Lamb commit 853fefbb9663a5d6003cdefbc16c19c67d5bfcc7 Author: Alban Crequy Date: 2012-03-16 15:32:51 +0000 Add mcd_service_stop() and stop the McdService when SIGINT is sent https://bugs.freedesktop.org/show_bug.cgi?id=47054 commit 72498e161d71b6751d825888a684f62c304a9434 Author: Alban Crequy Date: 2012-03-26 13:33:22 +0100 Update dependency on GLib 2.30 GLib 2.30 is necessary for g_unix_open_pipe(). https://bugs.freedesktop.org/show_bug.cgi?id=47054 commit 370e642d6dc6983fee0ef1fcbedd96ef3a2b3b64 Author: Alvaro Soliverez Date: 2012-03-22 18:05:04 -0300 On Android, use pkg-config --static This makes it output the complete dependency chain for each library, e.g. libffi for GObject. This is necessary because Android toolchains don't follow shared library interdependencies like normal GNU toolchains. commit dcebc508f40abd0eaceb57039e5789638b5297b1 Author: Alvaro Soliverez Date: 2012-03-22 18:04:31 -0300 Use the correct LD_FLAGS variable for the Android target commit 90ac4892d9f15756e8fc1266a7b24b65da48a5ef Author: Simon McVittie Date: 2012-02-21 21:11:10 +0000 Development version commit 5027888083a46c97f75a99cdf165195afed929db Author: Simon McVittie Date: 2012-02-21 19:44:31 +0000 Update telepathy.am from telepathy-glib 0.17.5 to fix out-of-tree releases commit 8c8b9e690c94ba4b5a2f461799bc2e97b2104bce Author: Simon McVittie Date: 2012-02-21 19:41:39 +0000 Prepare 5.11.0 commit b4e4a0f52f75cabb8d6d60618e2decf72e7961e3 Merge: 16ac32e 349fa2e Author: Will Thompson Date: 2012-02-21 15:08:36 +0000 Merge branch 'telepathy-mission-control-5.10' commit 349fa2e017d7c7caa5a9a4987979fdae64f10d87 Author: Will Thompson Date: 2012-02-21 11:02:42 +0000 Account: don't crash on Get('Parameters') if _dup_parameters fails If the connection manager is not installed, or is installed but doesn't have the protocol for the account, then _mcd_account_dup_parameters() returns %NULL. (As the comment I've added says, I think this is ridiculous—it's fall-out from MC not storing the types of parameters.) As a result, Get('Parameters') or GetAll() would crash, because dbus-glib would try to serialize a NULL GHashTable and blow up. (See .) So with this patch, we handle NULL as "no parameters" for the sake of D-Bus properties. (Because this situation should only arise if the account is invalid, we also warn if _dup_parameters() returns NULL for valid accounts.) Reviewed-by: Simon McVittie commit 16ac32eb79765d65b46d71b35d5ddbbf9987ec7f Author: Simon McVittie Date: 2012-02-20 18:41:23 +0000 Depend on a new enough telepathy-glib for Supersedes commit 8618ecef8930ad39a8bfe8b37a9c854945b9dcb8 Merge: 572d39f c0dba4b Author: Simon McVittie Date: 2012-02-20 18:40:53 +0000 Merge branch 'butterfly-migration-42814' commit c0dba4b307cbc965bec3a325373e11a706dda7fe Author: Simon McVittie Date: 2012-02-14 13:23:11 +0000 Set the Supersedes property on migrated Butterfly accounts Bug: https://bugs.freedesktop.org/show_bug.cgi?id=42814 Signed-off-by: Simon McVittie commit d9a702e8c7dfd80c0f7064824e4bf9498c420cf3 Author: Simon McVittie Date: 2012-02-14 12:08:44 +0000 Test the Supersedes property Bug: https://bugs.freedesktop.org/show_bug.cgi?id=42814 Signed-off-by: Simon McVittie commit 4ee0376efd35ce0e06d14633e386c511938e26a3 Author: Simon McVittie Date: 2012-02-14 12:07:04 +0000 Account.Supersedes: add Bug: https://bugs.freedesktop.org/show_bug.cgi?id=42814 Signed-off-by: Simon McVittie commit 696ae3716947119ad8f6778f8fb6d3ad684d1bb1 Author: Simon McVittie Date: 2012-02-14 12:06:33 +0000 McdStorage: add support for 'ao' type Bug: https://bugs.freedesktop.org/show_bug.cgi?id=42814 Signed-off-by: Simon McVittie commit 572d39fb51e5d1aecdbaa2329686f5b818ce9897 Author: Guillaume Desmottes Date: 2012-02-02 11:27:20 +0100 Display a string representation of McdTransportStatus in debug message This will make my life much easier when trying to debug issues from users' logs. commit 9a32c79b81e4b5a847fcf34641e398f7c6089bfc Author: Alvaro Soliverez Date: 2012-02-01 15:36:25 +0000 Produce DLL files when compiled for windows When we cross-compile telepathy-mission-control for windows with the current flags we end up with a static library and it creates link issues in libraries and applications which uses teleapthy-glib on windows. to solve this -no-undefined LDFLAG is introduced in this commit. This ensures all the symbols are defined when we compile for windows. see: http://www.gnu.org/software/libtool/manual/libtool.html for more details about -no-undefined flag commit 3dcdbc3d14457d4096000f1426129062cb76e313 Author: Will Thompson Date: 2012-02-01 10:48:33 +0000 mc-tool: add a 'summary' command. commit c02db9192bf6233e09252b3d0d189744ea91acb1 Author: Will Thompson Date: 2012-02-01 11:00:09 +0000 mc-tool: sort lists of account identifiers. commit 35053f8fdeddd79c92d7f6ddb9e0ac96a6c0c3f6 Author: Will Thompson Date: 2012-02-01 10:16:37 +0000 mc-tool: use tp_account_get_path_suffix() commit 573700ecb680cc3753a362774214f93373df6936 Author: Guillaume Desmottes Date: 2012-01-27 15:39:46 +0100 mc-tool: display Addressing.URISchemes https://bugs.freedesktop.org/show_bug.cgi?id=45308 commit 39ff98afd91df7c91851a1cedbb9f735dae4e668 Merge: 1820917 1282e4c Author: Mikhail Zabaluev Date: 2012-01-19 13:24:13 +0100 Merge branch 'optionalize-gsettings' Reviewed-By: Simon McVittie (fd.o #43791) commit 1282e4c7b8d7e2c3bde3201dacd81dbeb4ca8b1d Author: Mikhail Zabaluev Date: 2012-01-13 14:13:15 +0100 Make the usage of "use-conn" GSetting a configure option commit 18209172f6ff643247c1fe1f09aa20b14ab2f932 Author: Siraj Razick Date: 2011-12-22 19:11:23 -0500 Changes need to cross compile MC for windows we need to include io.h to make unmask work when cross compiling commit 2b1944ad4085bc10a324dcea19ba19c901bbe578 Author: Vivek Dasmohapatra Date: 2011-12-19 15:13:11 +0000 In the [unlikely] event the id key has the wrong type, don't leak the GValue commit bcdbbe60367d67a602aed52a95e53e0725881e2d Author: Vivek Dasmohapatra Date: 2011-10-20 01:40:27 +0100 AgManager::enabled-event doesn't have the AgAccount::enabled multi-trigger bug commit 58ff362a133ec6625f23e89b175f3bc8374218f2 Author: Alvaro Soliverez Date: 2011-11-14 17:19:51 -0300 Support building for Android, modified from an original patch by Derek Foreman https://bugs.freedesktop.org/show_bug.cgi?id=42508 commit 652eb046e351d5939998efd97b0b053098ef6ac3 Author: Alvaro Soliverez Date: 2011-11-02 15:55:15 -0300 Build on systems without gettext Modified from an original patch by Derek Foreman https://bugs.freedesktop.org/show_bug.cgi?id=42508 commit ee2090321ca1530ada26c5431b9ba3dacfd4ea07 Author: Xavier Claessens Date: 2011-11-16 16:07:25 +0100 Use _unref instead of _free _destroy when possible.unref Replace g_(ptr_)array_free (foo, TRUE) and g_hash_table_destroy with respectively g_(ptr_)array_unref (foo) and g_hash_table_unref. I used this command to generate this patch: for f in `find -name "*.c"`; do sed -i $f -re 's/g_ptr_array_free \(([^ ,]+), TRUE\)/g_ptr_array_unref \(\1\)/'; done See Danielle's blog for explanation of possible bug _free can do: http://blogs.gnome.org/danni/2011/11/16/mistakes-with-g_value_set_boxed/ commit 778fa378b0923a43134508de5b36abaed028f2c1 Author: Guillaume Desmottes Date: 2011-11-14 14:15:47 +0100 lock accounts while migrating commit 83aa8ae7eb6a4b2aa8647f6e5581607e40f4ff4a Author: Guillaume Desmottes Date: 2011-11-11 16:12:28 +0100 migrate Butterfly accounts to Haze https://bugs.freedesktop.org/show_bug.cgi?id=42814 commit f052f2424a1a010f95739a59f19b71c4278c8231 Author: Guillaume Desmottes Date: 2011-11-11 16:00:15 +0100 add mcd_account_dup_icon() and mcd_account_dup_nickname() https://bugs.freedesktop.org/show_bug.cgi?id=42814 commit 1298e52994e0bba55437e7f876c2c6d84a49379d Author: Guillaume Desmottes Date: 2011-11-11 15:41:29 +0100 export mcd_account_get_parameter() https://bugs.freedesktop.org/show_bug.cgi?id=42814 commit 5353886fab93ed2efdcd2e2d0f83c64941e43a94 Author: Guillaume Desmottes Date: 2011-11-11 14:51:05 +0100 add mcd_account_dup_display_name() https://bugs.freedesktop.org/show_bug.cgi?id=42814 commit 3e39bb0e14bcbbefcb98839e730d86864165f28b Author: Guillaume Desmottes Date: 2011-11-11 13:45:23 +0100 value-is-same: stop testing G_TYPE_CHAR g_value_set_char() has been deprecated in GLib and, as said in the FIXME, we don't need to test this as it's not supported by D-Bus. commit 09206a0eee8ddecbd795155a7e9d8936f4b7e469 Author: Will Thompson Date: 2011-11-10 12:53:54 +0000 Put request paths under /org/fd/T/CD commit 4c3e8544f70c9b949934d741655e0874a1cc86c6 Merge: 8158b3d 18e4870 Author: Will Thompson Date: 2011-11-08 10:14:25 +0000 Merge branch 'telepathy-mission-control-5.10' Conflicts: configure.ac commit 18e48707de894057f30936ca86cddd304da4e48f Author: Will Thompson Date: 2011-11-08 10:14:03 +0000 Bump version to 5.10.1+ commit 0daca95dab021325bd20bd3a9da4f2e67cc005e5 Author: Will Thompson Date: 2011-11-08 10:00:46 +0000 Version 5.10.1 commit 627b82fe813d7852aaefa829cf6359f21fd3da62 Author: Will Thompson Date: 2011-11-08 10:00:29 +0000 NEWS for 5.10.1 commit 9822ad7c68969ad43c338f16216581256e321de8 Author: Will Thompson Date: 2011-11-08 09:49:52 +0000 Remove stray from GSettings schema I forgot to remove this when duplicating the one key I wanted to steal from Empathy, and ioni reported that it clashes with the same enum definition provided by Empathy. (I'm not 100% sure why—I'd've assumed they'd be namespaced by the GSettings schema, not the DConf path—but hey.) commit 8158b3db0272bd604fd17de6b870994877628b65 Author: Will Thompson Date: 2011-11-07 17:25:12 +0000 And again to 5.10.999+ for the unstable branch. commit 3eba6fcbc7e9418f7da101a7a58ff7154e905f48 Author: Will Thompson Date: 2011-11-07 17:24:56 +0000 Bump version to 5.10.0+ commit 2ddc68024e66584543aa5c08662b3fbb35109a61 Author: Will Thompson Date: 2011-11-07 17:20:36 +0000 Version 5.10.0 commit cf9cf54669685e7127de1e0e555281caa43ba819 Author: Will Thompson Date: 2011-11-07 17:16:13 +0000 NEWS for 5.10.0 commit b89a27403d632725504c21c6079b936f9c1c6c9c Merge: b1970f4 6ea034a Author: Will Thompson Date: 2011-11-04 18:44:40 +0000 Merge branch 'gsettings' Reviewed-by: Simon McVittie Fixes: commit 6ea034ad022068c581cdbf675a5be54e30d2e2f0 Author: Will Thompson Date: 2011-11-04 18:20:34 +0000 exec-with-log.sh.in: export POSIX_ME_HARDER=1 commit 52f223eb1740fe1dd3059a9c71c90de7785180c0 Author: Will Thompson Date: 2011-11-03 17:14:27 +0000 ConnectivityMonitor: fix debug message commit dbeb5860f634ed6ebaa2a76ca7e37be7623ea4a1 Author: Will Thompson Date: 2011-11-03 16:54:20 +0000 .gitignore: ignore connectivity monitor test tool commit a4bb333ef99e7c64a6b4b63a080c57c5beb1aac7 Author: Will Thompson Date: 2011-11-03 16:52:10 +0000 Bind use-conn GSettings key to ConnectivityMonitor This GSettings key does the same thing as the Empathy one it's an alias for does: if use-conn is False, the network state from NM/ConnMan is ignored, and MC will allow you to try to sign in even if there is supposedly no network connection! It's pretty great. (When I first committed this, it didn't work. Now it does. I don't know why.) commit db2ac21ee35f785cb21d7b1e782eb34c9753c4f4 Author: Will Thompson Date: 2011-11-03 15:33:02 +0000 Add a GSettings schema with use-conn key When the NM/ConnMan code lived in Empathy, there was a GSettings key which could be flipped to false to make Empathy always assume it had a network connection. This schema provides one GSettings key, im.telepathy.MissionControl.FromEmpathy use-conn, which happens to use the same dconf path as the Empathy key uses. This should make the two GSettings keys aliases for the same underlying value in dconf; we get a migration path for free. commit b1970f4371d3efdf4a385cd6b4eebb6731fadd1c Author: Alban Crequy Date: 2011-10-10 16:43:10 +0100 tests: add --enable-installed-tests This configure option makes it possible to install the twisted tests in /usr/share/telepathy-mission-control-tests and run them without the sources. https://bugs.freedesktop.org/show_bug.cgi?id=41927 commit 41c5b207f8482182834d7ea05d677316538f358b Author: Alban Crequy Date: 2011-11-01 17:25:31 +0000 update-parameters.py: fix the cache directory Use $XDG_CACHE_HOME instead of $MC_ACCOUNT_DIR to find the file mcp-test-diverted-account-plugin.conf because the test-only plugin mcp-account-diversion uses g_get_user_cache_dir(). This is a no-op because both variables have the same value, as defined in tests/twisted/Makefile.am: BASIC_TESTS_ENVIRONMENT = \ MC_ACCOUNT_DIR=@abs_top_builddir@/tests/twisted/tmp-$(TMPSUFFIX) \ XDG_CACHE_HOME=@abs_top_builddir@/tests/twisted/tmp-$(TMPSUFFIX) \ However, this was not semantically correct, and the two directories could be different in the future, with installed tests for example. commit 34b03f910bd8b889f0f71edfa9668b74d8ad8ba6 Author: Will Thompson Date: 2011-10-21 22:42:45 +0100 .gitignore: remove obsolete libmcclient references libmcclient is gone forever, so let's not ignore detritus from it. commit be2e5c2d899d9542b567983e809caf371ba9be6c Merge: cc746ed 82f1d4b Author: Will Thompson Date: 2011-11-03 11:53:28 +0000 Merge branch 'ChangingPresence' Reviewed-by: Simon McVittie Fixes: commit 82f1d4b02a32131b48ea9e461865415070ab7b72 Author: Will Thompson Date: 2011-11-03 10:29:09 +0000 Account: only set ChangingPresence if we actually are Previously, ChangingPresence could become True on accounts which were not Enabled, which makes no sense: we're not changing our presence in that case. It happened if you requested an offline presence on a disabled account whose current RequestedPresence is something online; or if you disabled an Enabled account whose RequestedPresence (and CurrentPresence) was offline. Here we change the implementation of setting RequestedPresence to only set ChangingPresence to True if it actually takes some action. There are situations where the presence has "changed" (maybe you changed the message associated with being offline) but no change actually needs to be applied. commit f2e91a1e1305ef78a49dbcc81f2b94a938afd5e1 Author: Will Thompson Date: 2011-11-03 10:28:55 +0000 account-manager/presence: modernize commit 33ec45d180708ec8c0be8309e91a29f313f4d2f3 Author: Will Thompson Date: 2011-11-03 09:46:28 +0000 mc-tool: show ChangingPresence commit cc746edd95fdc1802cd656eca664a7089de61745 Author: Jonny Lamb Date: 2011-10-07 11:34:52 +0100 connectivity-monitor: fix build with UPower but no NM or ConnMan http://bugs.debian.org/644589 Signed-off-by: Jonny Lamb commit 85a8950dff6ddf53bb78c780e003561c111a26f8 Author: Will Thompson Date: 2011-10-04 18:03:36 +0100 Bump version to 5.9.3+ commit 4110ebd94c33dcc53b867c6c85434903583b6e66 Author: Will Thompson Date: 2011-10-04 17:51:30 +0100 Version 5.9.3 commit 097abc38aa684f62002570885798c633a3992ef0 Author: Will Thompson Date: 2011-10-04 16:48:11 +0100 NEWS for 5.9.3 commit 99fab96fa358f69e688865a81c3afb79508394cc Merge: b78d26c c23ca1a Author: Will Thompson Date: 2011-10-04 16:19:21 +0100 Merge branch 'upower' Fixes: commit c23ca1a9ca5275e708326e5db5f762c52479845e Author: Will Thompson Date: 2011-10-04 16:16:01 +0100 Connectivity: move upower-specific code inside ifdef connectivity_monitor_set_awake() is only called by the code paths that listen to signals from upower, so passing --disable-upower to configure triggered a defined-but-not-used warning for it. commit b78d26c3319809e391a6bcda2d2cb7f454084b90 Merge: 25799ee 33f85c6 Author: Will Thompson Date: 2011-10-04 15:28:33 +0100 Merge branch 'telepathy-mission-control-5.8+' commit 33f85c6ed8818cef4db8e9b1caffe53ad4811456 Author: Will Thompson Date: 2011-10-04 14:43:05 +0100 NEWS for 5.8.2 commit 904027787d6ae857e70f29b49f4d131a92e6500e Author: Will Thompson Date: 2011-10-03 16:53:10 +0100 McdClient: don't allow unique_name to become NULL _mcd_client_registry_found_name() is called in three situations: • the initial call to ListNames() has returned; • the initial call to ListActivatableNames() has returned; and • NameOwnerChanged has been emitted for a client-shaped well-known name. In the first two cases, unique_name_if_known is NULL; in the first case, activatable is FALSE. I don't really understand what business the McdClientRegistry has telling the McdClient what its unique name is even when it's non-NULL, but passing NULL to _mcd_client_proxy_set_active() made McdClient violate an internal invariant. The first action McdClient takes is to discover the client's unique name, if any; if the client is not running, unique_name is set to "" (not NULL). Other parts of the McdClient internals assume (and assert) that unique_name is not NULL by the time they run. I *believe* that the client registry need not ever call _mcd_client_proxy_set_active(), but I am loathe to make that change without fully understanding the code and writing some tests. Fixes: Reviewed-by: Xavier Claessens commit c9907c9e7141acdda3cdf326db387f9c4c1b4abe Author: Will Thompson Date: 2011-09-28 17:57:20 +0100 Connectivity: refactor signalling state changes As Guillaume pointed out on , previously McdConnectivityMonitor would signal ::state-change even if the state hasn't changed in some cases. This patch reduces duplication and fixes that case. commit 7ffc20512ac6a81e9465622ec692a622bf7ebf8d Author: Will Thompson Date: 2011-09-27 18:08:57 +0100 Master: Always bind connection to a transport Previously, when a connection was brought online in response to an event other than a transport becoming connected, it would always be bound to a transport (if any transport plugins are loaded, obviously), regardless of whether the dictionary o' conditions was empty or not. However, when a transport coming online caused a connection to be brought up, that connection would not be bound to the transport that caused it to come online if the conditions were empty (which they generally are). For reasons I can't quite fathom, this actually doesn't seem to have affected anything: it could be because monitor_state_changed_cb in McdKludgeTransport also binds waiting connections to the transport that came online. But this seems like a sensible change for sanity and consistency reasons. commit 9da0c6c713c9cba1ddef33d599888fce16b79482 Author: Will Thompson Date: 2011-09-23 12:24:36 +0100 Connectivity: go offline when laptop suspends. Woop woop. commit 17246cccff176888eae16b8ce673e2c5f0da440f Author: Will Thompson Date: 2011-09-23 12:07:32 +0100 configure: optionally depend on upower-glib commit 25799ee8f5b02a8893d7bc5c8007e58b9d444bdd Merge: 66b2835 38d76aa Author: Will Thompson Date: 2011-09-28 11:33:09 +0100 Merge branch 'fd.o-38978-connectivity' Fixes: Reviewed-by: Guillaume Desmottes commit 38d76aa0c45d66828c1935b0b7573e7739af45b1 Author: Will Thompson Date: 2011-09-28 11:28:54 +0100 fakeconnectivity: use constant for NM interface commit bf06f43306c6717905e5ca9cf16e6f96e2bb95fe Author: Will Thompson Date: 2011-09-27 17:38:08 +0100 KludgeTransport: debug when connections get queued commit 928fbad1c14cde84758b45dd392eb1e20c150fa0 Author: Will Thompson Date: 2011-09-27 17:16:31 +0100 Account: reconnect if RequestedPresence is not offline Previously, when a network connection came back up, only accounts with ConnectAutomatically set would be re-connected. But if RequestedPresence is something online-flavoured, I think it makes sense to bring such accounts back online, too: if the user has asked to be online, a network blip shouldn't affect that. commit ca9833b3d208fa4f4f3af333ebca54178c5c62da Author: Will Thompson Date: 2011-09-27 17:15:46 +0100 am/connectivity: extract BillyIdle commit 855af5f3bb9f70aaa59768dbeaf50edf68198675 Author: Will Thompson Date: 2011-09-27 16:53:49 +0100 Account: when reconnecting, use RequestedPresence if possible Previously, if an account was taken offline due to the internet connection disappearing, when it was brought back up the AutomaticPresence would be used, trampling on whatever the user had put into RequestedPresence. I guess this was deliberate … but it doesn't seem like very useful behaviour. If I've explicitly set my presence to ('available', 'you can talk to me now'), despite my AutomaticPresence being ('busy', 'probably doing something else'), I don't see why a network connection blip should cause my lovingly-written presence to be discarded. commit 68d883e4d7488bd2c692c8bc85e5b8f77950ba01 Author: Will Thompson Date: 2011-09-27 16:37:44 +0100 am/connectivity: check for SetPresence call I'd like to be sure that setting RequestedPresence before the network connection comes up causes that presence to be applied when it does, as opposed to just that the account be brought online. commit fd8b6fe898130d6de44501e83629f188a3f3391a Author: Will Thompson Date: 2011-09-26 20:22:00 +0100 Account: add would_like_to_connect method. This consolidates logic previously duplicated between two code paths. commit 4ae0e4fc7cf2d4ffffec1efe8858b95202995333 Author: Will Thompson Date: 2011-09-26 19:56:28 +0100 Account: unduplicate get_requested_presence method _mcd_account_get_requested_presence() is literally identical to mcd_account_get_requested_presence() except the underscore (okay, and that the arguments are indented using spaces, not tabs). Whichever idiot was responsible for introducing the underscored version removed by this patch should be hunted down and shot on sight. commit 9d8bd36fa860a5599733c44763fb3aac5fc72b92 Author: Will Thompson Date: 2011-09-26 18:54:12 +0100 Account: refactor re-requesting RequestedPresence. commit d8ed34e08ef5ae4ce87d317663e3467ac76fdabb Author: Will Thompson Date: 2011-09-26 18:46:36 +0100 Account: remove _get_online_requests. This isn't called anywhere. And since this was the only way that McdOnlineRequestData structures could escape mcd-account.c, we can now hide that definition, too. commit 2d5b1ed417986250417af6a4eb3852e7837ed57b Author: Will Thompson Date: 2011-09-26 18:44:23 +0100 Account: static-ify _online_request_completed This is not called from outside mcd-account.c. commit df7537103a342b8bd42a69f21010f3fa448e8618 Author: Will Thompson Date: 2011-09-23 16:48:03 +0100 KludgeTransport: explain the one-element list o' transports 'one' was not a useful name for this variable, in retrospect. commit 0bde9e5973fe306e428ec604d85aaafb0c1a9bd5 Author: Will Thompson Date: 2011-09-20 11:29:08 +0100 Add a connectivity test This test does not run if neither NM nor ConnMan support is available. It also only runs against the test-specific MC daemon, since it depends on a backdoor method for synchronisation. commit dea44b07c708a391a2b6d0935aba1a7789c59f49 Author: Will Thompson Date: 2011-09-20 11:26:01 +0100 mctest: split up enable_fakecm_account() This patch splits out the second half of enable_fakecm_account(), starting at the point where it expects a RequestConnection call, into a new function, expect_fakecm_connection(). enable_fakecm_account() calls it, so its behaviour does not change. But the connectivity-monitoring tests will want to expect a call to RequestConnection() and let that part of the standard check run to completion, so will be able to use the freshly-split-out function. commit b4cd6e18b0d247ff69c3513e9492d885b954de89 Author: Will Thompson Date: 2011-09-14 19:10:10 +0100 Master: instantiate an McdKludgeTransport commit 101f02c4a73944512984d62c54f2ff18c3c2a2eb Author: Will Thompson Date: 2011-09-14 19:30:01 +0100 KludgeTransport: track McdConnectivityMonitor state commit 7e0434a6d0c9c87241432a9b2fcd5993389a29fa Author: Will Thompson Date: 2011-09-14 18:54:23 +0100 Add stub McdTransportPlugin implementation McdKludgeTransport will implement McdTransportPlugin using McdConnectivityMonitor. Currently it's a no-op though. commit 90fb7c9e5f8d81b669d4a01c1a9ec1886170b965 Author: Will Thompson Date: 2011-09-22 18:13:45 +0100 mctest: resuscitate MC asynchronously Shortly, MC will start making blocking calls on the test suite's fake NM implementation (via nm-glib). Calling bus.get_object service-activated MC as a side-effect of making a blocking call to Introspect() on it, so it deadlocked. I think it's clearer to explicitly, asynchronously activate it, and wait for it to claim its names; which also avoids the deadlock. commit 95a3fdd9a18b638d3e20df0df5976c2bf41c150d Author: Will Thompson Date: 2011-09-22 18:46:39 +0100 account-manager/create-with-properties: modernize and asyncify For some reason, the blocking call to Introspect here reliably deadlocked against the blocking call MC will, in a couple of patches' time, make to (the fake) Network Manager service implemented by the test suite. Removing it just made the GetAll() call deadlock instead. If I render that asynchronous, the deadlock goes away. I am not overly happy with having to do this kind of ad-hoc kludging of the test suite to make it run, but we're working around a library bug and I have no interest in delaying the NM integration while I fix nm-glib. commit 8af66a228e79470cde692d3aeaf43e70168f1b86 Author: Will Thompson Date: 2011-09-16 11:33:28 +0100 tests: add fake implementations of MC and NM commit dc460ae72ec2c29f42cf375e7e3366105998d132 Author: Will Thompson Date: 2011-09-19 18:21:39 +0100 test service: add a “process idle queue” method commit d29269cb97cc9d804ca55999487e530c38a12ec6 Author: Will Thompson Date: 2011-09-15 15:58:33 +0100 Add a test app for McdConnectivityMonitor commit 796c6e95ecab316f927092391affe35d6b01e99f Author: Will Thompson Date: 2011-09-14 16:24:55 +0100 Import EmpathyConnectivity as McdConnectivityMonitor I'll wrap this up in the hateful McdTransport[Plugin] API forthwith. commit 66b28358c295e994c5a3711b6d1e04edb53d423f Author: Will Thompson Date: 2011-09-26 12:19:23 +0100 mc-tool: add missing entry for reconnect to help commit 49c678c5169caea64728206a2f63496cd9e37c36 Merge: a669b92 c6939ce Author: Will Thompson Date: 2011-09-23 17:01:34 +0100 Merge branch 'mc-tool' Fixes: Reviewed-by: Simon McVittie commit c6939cec58fe158574f4206a780dffdf74264db4 Author: Will Thompson Date: 2011-09-23 15:19:41 +0100 mc-tool: add a 'reconnect' command commit af96bbe41f468f6301819b455713359d25efb5d7 Author: Will Thompson Date: 2011-09-23 15:00:03 +0100 mc-tool add: use tp_account_manager_create_account_async commit 871eb58541a95c2f9c015350b4f63aca64c4b785 Author: Will Thompson Date: 2011-09-23 14:40:24 +0100 mc-tool remove: use tp_account_remove_async commit eda38779c2c3107256a8ef5c5fc32d04e664363f Author: Will Thompson Date: 2011-09-23 14:38:27 +0100 mc-tool: improve 'update' output. Previously, mc-tool update didn't tell the user whether a reconnection would be required to apply parameter updates. This patch makes it do so, and also makes its implementation use tp_account_update_parameters_async(). commit ab3f0fcf0f700b3ad5c5d905188a3bb8c27994e0 Author: Will Thompson Date: 2011-09-23 14:28:54 +0100 mc-tool: set AutomaticPresence using tp-glib method commit 4bb6ce89cbc9a0dcb429a2bd42ee2c42d0a5c368 Author: Will Thompson Date: 2011-09-23 14:25:39 +0100 mc-tool: always show *some* value for ConnectAutomatically Previously, if an account had ConnectAutomatically: True, then mc-tool show would say: Connects: automatically But if the property was False, mc-tool show would not mention it. This patch makes the command produce: Connects: only when requested in the latter case. commit bce94d7b182c05bfde407a6f5cdbb2effdc119a7 Author: Will Thompson Date: 2011-09-23 14:24:41 +0100 mc-tool: use accessors from tp-glib 0.13.8 In some historic version of telepathy-glib, TpAccount did not have accessors for AutomaticPresence or NormalizedName. Since we depend on telepathy-glib 0.15.0, and these accessors were added in 0.13.8, we can now just use them. commit d854d0ecff853a63654229cf59bc2dc129fc45a2 Author: Will Thompson Date: 2011-09-14 14:48:05 +0100 configure: check for NM or ConnMan This is baically cargo-culted right out of Empathy. commit cc659f64994f71957345b6c9fab1bdb612c30f32 Author: Will Thompson Date: 2011-09-13 18:22:38 +0100 McdTransport: add guards to vfunc wrappers Most of these functions are mandatory-to-implement; check_conditions is, in practice, optional. commit 2981787353f9862c076cf1c72484c4d5ea234999 Author: Will Thompson Date: 2011-09-22 16:54:50 +0100 Master: poison singleton pointer when disposed Previously, when the 'default' instance of McdMaster (i.e., the singleton) was disposed, the 'default_master' variable was left pointing to it. This is basically fine in practice, since the McdMaster is meant to survive for the lifetime of the connection. But I hit a weird crash (caused by the test suite's version of MC waiting 5 seconds after the McdMaster is destroyed before closing, which interacts badly with the reconnection timeout being less than 5 seconds) and it would have been much clearer what was happening if 'default_master' had held a known-bad address rather than a possibly-valid pointer to a freed object. This doesn't change the behaviour of the code in any significant way: we'll still crash in this situation. But as far as I can tell the bug is harmless. commit 4695c8fe269d04eff269522dc6a0f67795a07dac Author: Will Thompson Date: 2011-09-16 11:13:22 +0100 tests: replace make_mc with class MC This will make it easier to glue things onto the side of the proxy for MC. commit a669b92559e7017b6381c44959fc077acc72b11f Merge: 42cef84 c8b1014 Author: Will Thompson Date: 2011-09-23 11:28:08 +0100 Merge branch 'uncontroversial' Reviewed-by: Simon McVittie commit 42cef84969d9f0ac32a90cccaaddc57e221d9950 Merge: d3f1153 746c698 Author: Will Thompson Date: 2011-09-23 11:27:52 +0100 Merge branch 'telepathy-mission-control-5.8+' commit 746c6982d06a124b05b439f11d92ae24fa252a40 Author: Simon McVittie Date: 2011-09-21 19:24:13 +0100 Make the regression tests work with D-Bus >= 1.5.6 The tests rely on being able to eavesdrop. Since D-Bus 1.5.6, normal match rules do not eavesdrop, even if allowed: you have to specifically ask for it. https://bugs.freedesktop.org/show_bug.cgi?id=41090 Reviewed-by: Will Thompson commit c8b1014ebc4ae7ad7fed8810e5ed0a05ebd7d5d9 Author: Will Thompson Date: 2011-09-19 18:24:50 +0100 tests: make sync_dbus more reliable This is taken from Gabble. commit 6417d165242ffeb1899108baee3d38709cc8a5e7 Author: Will Thompson Date: 2011-09-16 10:50:11 +0100 mctest: remove unused event_func arg from make_mc commit 6362eedfdc4907592d299bac2fe88cd936b62b94 Author: Will Thompson Date: 2011-09-16 10:44:38 +0100 mctest: remove references to parameters This is cargo-culted from CM tests which actually have connection parameters. commit 5461261e185cab9784923683720149490107e0a5 Author: Will Thompson Date: 2011-09-19 11:01:30 +0100 with-session-bus: print log file names commit 4aea67ec672ffbec19d7280bc6cd6b70cccd5607 Author: Will Thompson Date: 2011-09-15 16:22:10 +0100 tests: update with-session-bus.sh This gives us --also-for-system, which will be useful for testing NM integration. commit 1e0f118d843d16874969e8d4b8a380a7bdf2bec3 Author: Will Thompson Date: 2011-09-21 19:19:07 +0100 tests: run Python with unbuffered output commit 04008b50c4528bea1956c6bf3cd081f7fa9d6b9d Author: Will Thompson Date: 2011-09-21 19:18:17 +0100 plugin loader: add a missing space to DEBUG output commit ad37acd51910ddfd172f469ce131d1a8fce08ac1 Author: Will Thompson Date: 2011-09-14 14:35:20 +0100 configure: add summary commit d3f11533b226e0ecb0ba4e095732aae882089581 Author: Derek Foreman Date: 2011-08-30 08:09:43 -0500 add gio to the glib dependency check Signed-off-by: Jonny Lamb commit 560e18839b1d81da82091e18846a2c5206990da0 Author: Derek Foreman Date: 2011-05-16 13:58:37 -0400 add -uninstalled.pc.in file Signed-off-by: Jonny Lamb commit 9175ec5cc754e2f71482750e382407e44846a4cc Author: Derek Foreman Date: 2011-05-16 13:56:46 -0400 Make debug statement more useful Signed-off-by: Jonny Lamb commit 5bb11128eea9daa08491be2feed7f45718deef42 Author: Xavier Claessens Date: 2011-09-20 12:32:05 +0200 Add unit tests for the case an approver Claim() a CDO commit 8e06e3e0e110f5e29af3abf3bdc1febdf49c4980 Author: Xavier Claessens Date: 2011-09-20 13:15:13 +0200 Unit tests: SimulatedClient with wants_recovery=true fails to prepare commit 0bae7095a9e1a10e531d311e993fc1c67438cfd2 Author: Xavier Claessens Date: 2011-08-22 13:34:21 +0200 Avoid crash in client recovery if we don't know the handler well-known-name In the case an Observer/Approver Claims the channel, we don't get the handler well known name for that process. In that case we need to fallback to lookup all possible handlers on the same process and pick the first one that match. commit 34e8ab1f4b4e35647baab7d2b0ef2cd9fd1fdcc1 Merge: 2c9d469 1931d4f Author: Will Thompson Date: 2011-09-13 13:17:36 +0100 Merge branch 'fd.o-40129-set-a-proper-error-if-CM-crashes' Reviewed-by: Guillaume Desmottes commit 1931d4f2c71f0574a93cac848e2a1e0b40d6588c Author: Will Thompson Date: 2011-09-13 12:32:50 +0100 Test that MC sets reasonable errors when CM crashes This was intended to be a regression test for , but it turned out that MC is already pretty well-behaved. commit ca1f8bfff656a0de8f002eee9d0056bbb93301b1 Author: Will Thompson Date: 2011-09-13 12:30:26 +0100 OCD: sort tests in Makefile.am commit 57175d04e0b70a112de89e9d85e0e753915780e1 Author: Will Thompson Date: 2011-09-13 11:54:34 +0100 mctest: allow running FakeCM on a separate bus connection This was possible before, but not exactly straightforward: you had to clone the guts of create_fakecm_account(). By adding an optional parameter to create_fakecm_account(), and a method to SimulatedConnection to drop its bus name, it becomes pretty easy to run the fake CM on a separate bus, and hence simulate it crashing. commit cb19851532bb95ef18e162fc055dbed8c4d579d9 Author: Will Thompson Date: 2011-09-13 11:53:38 +0100 servicetest: Implement Event.__str__ This is stolen from Gabble. commit d9a6c491c2973b3e248de76615e83779ea820586 Author: Will Thompson Date: 2011-09-13 11:09:24 +0100 am/recover-from-disconnect: miscellaneous pruning • 'dbus' was imported twice; • 'dbus.service' and various symbols were imported but never used; • a BusName was claimed twice; • dbus.Interface objects were created unnecessarily; • dbus_interface='' was explicitly specified unnecessarily. commit 65fc610a6840258422809fc72f9b22dc34b56504 Author: Will Thompson Date: 2011-09-12 18:02:41 +0100 with-session-bus.sh: retain newline when forking dbus-monitor commit edfd9b291e81bb935054c5ab7102a1b2120d0333 Author: Will Thompson Date: 2011-08-16 17:25:17 +0100 Tests: remove stale FIXMEs about closing channels Since 5dfe2f0, Mission Control has not called Close() on channels when you disconnect. The test for this incorrect behaviour was commented out at some point, with a FIXME that the behaviour should be changed. Well, now the behaviour has been changed. So I replaced one with an assertion that Close() is not called, and the other I just removed (since that test doesn't actually have any channels). commit 2c9d469ec6646a39bd964866b434e0eaafab2b24 Author: Will Thompson Date: 2011-09-12 17:15:10 +0100 mcp: fix a bunch of doc warnings commit 9af88add93e4978056e5ad30741fec790386744c Author: Will Thompson Date: 2011-09-12 16:50:41 +0100 configure: remove unused ACCOUNTS_DIR and MANAGERS_DIR commit 1271aaa387c51c312ae2dd6bd0d7ba51ce6864cb Author: Will Thompson Date: 2011-09-12 16:48:36 +0100 Remove unused CHANDLERS_DIR I really hated Friends. commit 3c9f0062919c91887930a197e7240d1e113e7c40 Author: Will Thompson Date: 2011-09-07 17:39:18 +0100 Bump version to 5.9.2+ commit 36fec818dd30409637c38eec2b8774d48161408b Author: Will Thompson Date: 2011-08-31 11:21:06 +0100 Version 5.9.2 commit d6d0a8302d3974945daf7a020acf5ec4bccba441 Author: Will Thompson Date: 2011-08-31 11:20:36 +0100 NEWS for 5.9.2 commit a22988411e1f6601980a0cd9a9ecce93e29f7c6b Author: Guillaume Desmottes Date: 2011-09-01 14:25:44 +0200 mcd-account: use proper gboolean rather than 1 bit to store boolean properties It doesn't make sense to not use the boolean type provided by our framework and using 1 bit variable introduces weird corner case when being casted with gboolean. https://bugs.freedesktop.org/show_bug.cgi?id=40545 Reviewed-by: Will Thompson commit 4b52bb815739b5e73d028aebde9d22e81dac85dd Merge: ba3094e 2394a97 Author: Will Thompson Date: 2011-09-07 17:09:13 +0100 Merge branch 'doc-cleanup' Reviewed-by: Guillaume Desmottes commit 2394a9782e2739b0fce36349e8e1db957ff0f91e Author: Will Thompson Date: 2011-09-07 16:47:37 +0100 configure: remove obsolete OUT_OF_TREE_BUILD check The gtk-doc stuff doesn't use this any more. commit 047a42ee82fa0d664d510f0ccbd13a802a98ca90 Author: Will Thompson Date: 2011-09-07 16:38:37 +0100 Stop building docs for libmissioncontrol-server I'm hitting a weird issue in gtk-doc where the handwritten .types file is overwritten with a generated one during distcheck (but not during normal out-of-tree builds). Given that we have a newer plugin API we're keener on, let's just stop building documentation for the old one. (Most distros do not distribute libmissioncontrol-server as a library anyway.) The mission-control-plugins documentation doesn't hit this issue because it doesn't have a handwritten .types file. Instead, it relies on gtk-doc generating it, and uses IGNORE_HFILES to filter out internal headers. This seems more maintainable, so if anyone wants to resurrect this old documentation, I'd do it that way. commit 6de9a91e02906b1cb8536010a71175e0dafb43e6 Author: Will Thompson Date: 2011-09-07 14:34:55 +0100 docs: remove legacy templates These were all content-free anyway. Removing them, and using --flavour no-tmpl, makes the build neater and faster. commit ba3094edb045a74e6bdd7288db47d05aa9c11233 Merge: 9cdb15e 5bb6130 Author: Will Thompson Date: 2011-09-07 12:55:06 +0100 Merge branch 'telepathy-mission-control-5.8+' Conflicts: NEWS configure.ac commit 9cdb15ef0de942be523f3138c9447dc4ff71f4e9 Author: Vivek Dasmohapatra Date: 2011-09-06 19:23:01 +0100 Update NEWS with fixes merged from stable branch commit e8bacd5739c0a12084c0fc1df13155629bdd68d6 Merge: 1e87b2f c2aa017 Author: Vivek Dasmohapatra Date: 2011-09-06 19:21:41 +0100 Merge branch 'early-connecting-status-semi-hack' Conflicts: NEWS commit 1e87b2f7f5c34ef40b3af87fc29b6a89e7ea7b21 Merge: e116686 b29f2a8 Author: Vivek Dasmohapatra Date: 2011-09-06 19:20:28 +0100 Merge branch 'memory-leak' Conflicts: NEWS commit e116686b7e33474265795025374023e5ceeb4913 Merge: 6152792 f393396 Author: Vivek Dasmohapatra Date: 2011-09-06 19:18:06 +0100 Merge branch '58-recovery-position' commit 5bb613053dead289ac11f0330dd99bf5fcf5af39 Author: Vivek Dasmohapatra Date: 2011-09-06 19:05:28 +0100 Nano version commit 89585a13ec547b18ca70519b4e3a0e53238b2a2b Author: Vivek Dasmohapatra Date: 2011-09-06 19:03:40 +0100 Update doc-comment in configure.ac commit 5b161bf7b0747858e48fc7adf375cb61ee0df0ad Author: Vivek Dasmohapatra Date: 2011-09-06 16:31:58 +0100 Version 5.8.1 commit aa85d5b6de865651e8834e173a3873fbec6a0372 Author: Vivek Dasmohapatra Date: 2011-09-06 16:24:21 +0100 Update NEWS commit c2aa017899facac77648ddbf57cfd50c869a02c0 Author: Vivek Dasmohapatra Date: 2011-08-18 18:35:16 +0100 Set connection status to 'CONNECTING' as soon as we start trying to connect commit 5008b9578d0d815b87ae6145f122a8cf37671524 Author: Vivek Dasmohapatra Date: 2011-08-18 18:35:00 +0100 Don't throw a hissy-fit if the account is CONNECTING but the connection is not commit 91036eb72b06fe28a0a95b7b575cc0593ce76dd0 Author: Vivek Dasmohapatra Date: 2011-09-06 15:14:56 +0100 Update NEWS commit b29f2a8554a0a303fd7dca0ce6aae620423882ad Author: Vivek Dasmohapatra Date: 2011-09-01 18:12:15 +0100 API does not guarantee that the GValue remains unset on failed value retrieval commit fcaeb1ff9cade6b7451304076d383a01e3559f09 Author: Vivek Dasmohapatra Date: 2011-09-01 16:05:32 +0100 Approval contexts must be NULLed out or the free function will assert() commit 1e6d4cd9d48c5896f79dbea3bdf6ee64fcef1ad9 Author: Vivek Dasmohapatra Date: 2011-08-30 14:11:46 +0100 Approval struct free function did not free a string member commit 49a2f9434acc3f7649ae0129248cc0f16466ba4f Author: Vivek Dasmohapatra Date: 2011-08-30 13:53:44 +0100 Approval removed from GQueue should be freed commit fe5bc872a72a71900ea7116f793c37c9896c0ee6 Author: Vivek Dasmohapatra Date: 2011-08-30 13:48:22 +0100 Approval structs should be freed after removing them from the tracking GQueue commit 74a3b8ed4ed361602a555d8994f66626588e2873 Author: Vivek Dasmohapatra Date: 2011-09-06 15:08:21 +0100 Log fix introduced by 58-recovery-position in NEWS commit f3933967a7a1573ccaac8c6a52814e388cf7cb98 Author: Simon McVittie Date: 2011-05-19 18:16:26 +0100 undispatchable test: assert that observers are invoked, but approvers are not Also assert that MC doesn't close the channel as undispatchable until the Observer has had a look at it. commit 372ad259fdd87182f4d3bcadd053c4fafc443016 Author: Simon McVittie Date: 2011-05-19 18:14:24 +0100 fd.o #29022: if a channel can't be handled, dispatch it anyway, to run observers Arguably, we should have some way that approvers can opt-in to being told about undispatchable channels that they might want to Claim, but that requires spec, whereas we can fix this straight away. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=29022 commit 99d9669a46659ea42635aa5013e6a07e6c21e64b Author: Simon McVittie Date: 2011-05-19 17:30:25 +0100 McdHandlerMap: add brief documentation commit adf270a5a0382b0345fa7ee43904409c3157c96e Author: Simon McVittie Date: 2011-05-19 17:30:12 +0100 fd.o #34025 (ish): if we handle a channel internally, record that fact This means we'll include it in the set of handled channels when we invoke Observers with Recover=TRUE. We don't do this when calling _mcd_request_handle_internally (., ., FALSE) since we're not really behaving like a Handler in that case - more like an Observer or something. commit 6152792b0fc8ebd5daf3be1b743950f8b0698730 Merge: 1e95507 98785b8 Author: Will Thompson Date: 2011-09-01 13:17:17 +0100 Merge branch 'gtk-doc' Reviewed-by: Guillaume Desmottes commit 1e95507c3b45c8c3196850fc78db5a130ddcbc33 Merge: 1c24940 755fc0f Author: Will Thompson Date: 2011-09-01 13:16:58 +0100 Merge branch 'bin-mcclient' Fixes: Reviewed-by: Guillaume Desmottes commit 98785b8fa89cf2f03526de4af44e735af476976c Author: Will Thompson Date: 2011-08-31 17:15:05 +0100 Depend on gtk-doc ≥ 1.17 commit b39cdb342b78e0e40b9e92af4a6135bf5a05c18f Author: Will Thompson Date: 2011-08-31 17:14:21 +0100 docs: fix out-of-tree doc checks with gtk-doc 1.17 gtk-doc 1.17 runs in the builddir, not the sourcedir. So these files end up in the builddir, which is where we're running. Unfortunately this breaks doc checks with gtk-doc ≤ 1.16, which I can't find the strength to care about. (This is akin to 3ab0d76 in tp-glib.) commit e0bc7368527fa5d2509a251d33e4d5e3dcf6dc34 Author: Will Thompson Date: 2011-08-31 17:12:59 +0100 docs: sync Makefiles with tp-glib's This shouldn't change any behaviour. It just adds some defaults and comments from tp-glib's copy (which in turn are synced with the sample file shipped by gtk-doc) to make diffing the two easier. commit 8fbf0cfbee2ff547ad1a9cc331ad07243cfb2fdd Author: Will Thompson Date: 2011-08-31 17:06:23 +0100 docs: use GTKDOC_CFLAGS not INCLUDES Going by the examples provided by gtk-doc, this is preferred. It's been supported approximately forever. This is based on 019e84e6 in tp-glib. commit 99a3539a3c5bd1c0bc79062bc00e3520d91a392d Author: Will Thompson Date: 2011-08-31 17:00:28 +0100 docs: correctly scan source dirs This is taken from e3dcc31 in tp-glib. gtk-doc 1.17 now runs in the build dir, not in the source dir, so using relative paths here stopped working. commit a5ecb8ddb9cc1d7f2431425efe27cef6a2f239ec Author: Will Thompson Date: 2011-08-31 16:24:53 +0100 Silent-rules-ify some code generation commit 755fc0fed40b967c99ffb60c1bad06828c589325 Author: Will Thompson Date: 2011-08-31 14:59:14 +0100 Remove stale code-gen for stable interfaces. commit 773b790254aa89b914aeac8d144be2afa8916b4b Author: Will Thompson Date: 2011-08-31 14:53:03 +0100 Remove Account.Interface.ChannelRequests This is a predecessor to the current channel-requesting API, and is obsolete. commit 7cdacf5f4950af85714a838e2aba4256b2238918 Author: Will Thompson Date: 2011-08-31 14:57:44 +0100 Remove libmcclient This entails doing a little more code generation for the daemon: some bits depended on generated code from libmcclient, and there was an error enum used in exactly one place. But broadly speaking this just deletes a tonne of code and documentation. commit 7e0173a046b381856992faef292ade59cef31cad Author: Will Thompson Date: 2011-08-31 14:45:51 +0100 Remove local copies of ContactCaps and PowerSaving These have been in tp-glib for ages. commit 576fdc7e1657e42f4411123124d7b8dd651e883d Author: Will Thompson Date: 2011-08-31 14:37:41 +0100 Remove Compat.Profile support commit b614b7a40260f2c3baf9f4835b25bc6ca06993b6 Author: Will Thompson Date: 2011-08-31 14:26:47 +0100 Use D-Bus GType constants from tp-glib commit f6bb84c370ca350757f27ec486713376186f89a4 Author: Will Thompson Date: 2011-08-31 14:24:56 +0100 tests: don't test Compat.Profile property. This is slated for removal. commit 2c82847081b8c28ff18adc1ab3c6a49de2b6b151 Author: Will Thompson Date: 2011-08-31 14:18:15 +0100 tests: stop using non-standard channel request API I would like to remove this API. It was only used by libmcclient, which I would also like to remove. :) Most of these tests don't actually use the non-standard API: they just reference the interface for no good reason. commit 09c862d4fcf8b15a9fd92b5112d5dc7cdf6e8929 Author: Will Thompson Date: 2011-08-31 13:33:45 +0100 tests: move all of make_mc to mctest I have no idea why part of it was in servicetest. commit 1c24940a5f2e38ba4027b6b48a2166deeab91219 Author: Will Thompson Date: 2011-08-31 15:35:34 +0100 NEWS for 37861 (Before I forget.) commit ebe91108748249950d3aeb363e8bfc5e0428c222 Merge: fc84cd8 52e9df5 Author: Will Thompson Date: 2011-08-31 15:31:46 +0100 Merge branch 'telepathy-mission-control-5.8+' Now master is a superset of all known releases. ;) Conflicts: NEWS configure.ac commit fc84cd8e9eb88478d3da7b663fc649c560ac4f0e Merge: 547b3ba b8d92d6 Author: Will Thompson Date: 2011-08-31 11:06:46 +0100 Merge branch 'telepathy-mission-control-5.8' commit 547b3ba96d7f8f5fbdc09c3ecae5ce8badf21791 Merge: dd98690 8dbecc0 Author: Will Thompson Date: 2011-08-25 12:46:23 +0100 Merge branch '40337-invalid-account-error-reporting' Fixes: Reviewed-by: Jonny Lamb commit 8dbecc0ae4083ac8c83507084c36ad2ca536f499 Author: Will Thompson Date: 2011-08-25 12:30:02 +0100 bad-cm: break 'password's type. Jonny pointed out that, given that the method name contains "account", it's perhaps not the right parameter to check is in the error message returned when an incorrect type is passed. commit a01b090c4b289a50ba022852a3a93f1bfd8727b9 Author: Will Thompson Date: 2011-08-25 12:17:42 +0100 account-manager/bad-cm: clean up test. This reduces duplication and modernizes the test a bit. commit d771a4cff23130c34471fce3eb7236dc851e55ae Author: Will Thompson Date: 2011-08-25 12:09:54 +0100 Test invalid or ill-typed parameters for new accounts commit 4aad882bcec0a476adbbeab47dee4833c3e053a3 Author: Will Thompson Date: 2011-08-25 11:13:08 +0100 Include CM name when protocol doesn't exist This is not really ideal—the real error is that the CM doesn't exist but due to the current design of this part of MC, it's actually not easy to determine that. So at least including the name of the CM might make the error more obvious. commit 7ee4434e8049c170f9ee9766bd9b26913fc6e0cd Author: Will Thompson Date: 2011-08-24 18:42:47 +0100 AccountManager: use _mcd_account_set_parameters error verbatim commit 5a37fb49c80cb89c27925a410d4a1056e88bba3e Author: Will Thompson Date: 2011-08-24 18:41:13 +0100 Account: use NotImplemented for nonexistant cm/protocols The spec is actually pretty clear on this point. commit 289c02177b461bb1fb2f4487e5eed59d9c177db4 Author: Will Thompson Date: 2011-08-24 17:53:02 +0100 mcd_account_check_validity: report a GError for invalid accounts This corrects the specific case of poor error reporting mentioned on , where MC previously said “The supplied CM parameters were not valid” but now actually says which one. There are a couple of other account-creation cases (namely “CM doesn't exist” and “CM doesn't have that protocol”) which don't give the correct errors. And the test doesn't test the “Protocol doesn't have one of the specified parameters” case. commit fc543c3ee4ae0235876a7f22deaad0e19b2b1242 Author: Will Thompson Date: 2011-08-24 17:40:58 +0100 Account: internally track validity as a GError commit 976a3f1cebe4d2b8e4e22398a130ef4a181db8d9 Author: Will Thompson Date: 2011-08-24 17:21:11 +0100 mcd_account_check_parameters: give callback a GError commit c130b10a7c5d3453cbad163f68b968b538f356f9 Author: Will Thompson Date: 2011-08-23 18:51:31 +0100 McdAccount: use mcd_account_is_valid internally too This will make it simpler to change how validity is represented (from a boolean to a GError). commit dd9869068914125e80956531446eb297fa128784 Author: Frédéric Péters Date: 2011-08-21 11:08:36 +0200 mission-control-plugins: Link against gio Signed-off-by: Jonny Lamb commit bcc9373ff79d996767bca3efe1b4cafef0b9a525 Author: Will Thompson Date: 2011-07-25 16:01:43 +0100 Remove ContactCaps.DRAFT1 support Fixes: Reviewed-by: Xavier Claessens commit c64e52dc46a040b69b37100525bbf4698cca854f Author: Guillaume Desmottes Date: 2011-08-03 14:28:47 +0200 Avoid a warning when trying to store a NULL value e17b83fec8f01ca6977cb4fe259a83634aa90b26 only fixed the !ENABLE_GNOME_KEYRING case. https://bugs.freedesktop.org/show_bug.cgi?id=39796 commit 5999d678c2156e04b9c1db3cf1a406adb467810c Author: Guillaume Desmottes Date: 2011-08-03 12:52:08 +0200 account-manager-default: always delete secret keys from both locations This ensures that the key is actually removed even it has been tagged as secret after is removal. https://bugs.freedesktop.org/show_bug.cgi?id=39796 commit f2a78001ab99b7a8109121873bf14095b4c6fe19 Author: Will Thompson Date: 2011-08-01 16:10:13 +0100 mc-tool: allow localized strings for booleans commit 7a37f1c767ace97a1dafa258198ca6ca0c9c1830 Author: Will Thompson Date: 2011-08-01 16:02:09 +0100 mc-tool: make bool parsing sane. Previously, mc-tool update acct bool:foo=true would set foo to False! Particularly ridiculous given that mc-tool show produces 'true' and 'false', not '1' and '0'. I'm *sure* I've fixed this before. commit 52e9df56a40d027e0972158a600c1b7695820113 Author: Vivek Dasmohapatra Date: 2011-07-22 14:52:06 +0100 Nano version commit 597ed3fd7605bce7b06f6d127c1a90b7fc14f8de Merge: cb92278 149523e Author: Vivek Dasmohapatra Date: 2011-07-22 13:25:16 +0100 Merge branch 'unconditional-accounts-skip-too-many-transport-checks' into telepathy-mission-control-5.8+ commit cb92278fc5f001e5330e6d0e6deb410379ff809c Author: Vivek Dasmohapatra Date: 2011-06-24 16:37:52 +0100 Update NEWS for Aegis ACL plugin commit 1191b793e3c445cc836194c63c2d52b8dc42e56b Author: Vivek Dasmohapatra Date: 2011-06-24 16:36:12 +0100 The Aegis ACL plugin must activate handlers to check their credentials commit aae2f108921f4a8eedd861f76e8650c128e2d0cc Merge: 2607198 07e875a Author: Vivek Dasmohapatra Date: 2011-07-22 12:24:34 +0100 Merge branch 'cdo-satisfied-requests-hash-leak' into telepathy-mission-control-5.8+ Conflicts: NEWS commit 260719888571da3c2e0ebcdc9fc5f45f298c02cb Author: Vivek Dasmohapatra Date: 2011-07-22 12:18:04 +0100 Version 5.8.0 commit a6bb447eabb95bf91d5f0121ce0e8cdfa6eabead Author: Vivek Dasmohapatra Date: 2011-07-19 15:29:56 +0100 Fix unbalanced *_DECL macros commit a29cf172aca42414af59e634a78833e947886d25 Author: Vivek Dasmohapatra Date: 2011-07-19 15:24:48 +0100 Checks for unbalanced G_BEGIN/END_DECLS macros commit b8d92d6bef16a176fb2403957a645aa9510579c5 Author: Vivek Dasmohapatra Date: 2011-07-21 14:47:01 +0100 Nano version commit 3f847e56997ada402bba06344d8de81e13812eac Author: Vivek Dasmohapatra Date: 2011-07-21 14:31:32 +0100 Version 5.9.1 commit ffeee1fe4c6572d54f052608d30163f71ff05562 Merge: 0d2d371 b7e44e6 Author: Vivek Dasmohapatra Date: 2011-07-21 13:02:43 +0100 Merge branch 'unbalanced-header-macros' into telepathy-mission-control-5.8 commit 0d2d3718faf22255a575b44c6184435cd16b4027 Merge: da359cb 149523e Author: Vivek Dasmohapatra Date: 2011-07-21 13:02:21 +0100 Merge branch 'unconditional-accounts-skip-too-many-transport-checks' into telepathy-mission-control-5.8 commit 149523e89c42cea1cb61c1baa682c623a44e4893 Author: Vivek Dasmohapatra Date: 2011-07-20 18:36:55 +0100 If there are no transport plugins, the decision always has to be "Yes" commit da359cb5b2c3d640c58bd5d777186561244cddf8 Merge: cebbd25 894f722 Author: Vivek Dasmohapatra Date: 2011-07-20 17:07:14 +0100 Merge branch 'telepathy-mission-control-5.8' of git+ssh://git.freedesktop.org/git/telepathy/telepathy-mission-control into telepathy-mission-control-5.8 commit b7e44e64922a59795a2720939261b9e8bdc5057b Author: Vivek Dasmohapatra Date: 2011-07-19 15:29:56 +0100 Fix unbalanced *_DECL macros commit 3e753cbb5b442c1a1dfce84c816cef3df8e6afc0 Author: Vivek Dasmohapatra Date: 2011-07-19 15:24:48 +0100 Checks for unbalanced G_BEGIN/END_DECLS macros commit 894f722b50712ed9ac2f241691fcecdee560fa3f Author: Vincent Penquerc'h Date: 2011-07-18 09:46:37 +0000 Let cc find dbus, dbus-glib headers Bug: https://bugs.freedesktop.org/show_bug.cgi?id=39324 Reviewed-by: Simon McVittie commit cebbd25840976d134c373b901df27ad3e76db8c0 Author: Vivek Dasmohapatra Date: 2011-06-24 16:37:52 +0100 Update NEWS for Aegis ACL plugin commit 78f3189898d07bb7aa9702bc149066a455f0066a Author: Vivek Dasmohapatra Date: 2011-06-24 16:36:12 +0100 The Aegis ACL plugin must activate handlers to check their credentials commit 6153c0bf1fbe9132059597ec3b5ac9fe0446d7c1 Author: Vivek Dasmohapatra Date: 2011-06-24 16:33:28 +0100 Update NEWS commit 8876752c9274e1fd885e1a51f24c22369a6ec94b Merge: 98c15e8 575e87f Author: Vivek Dasmohapatra Date: 2011-06-24 16:27:58 +0100 Merge branch 'unconditional-accounts-skip-too-many-transport-checks' into telepathy-mission-control-5.8 commit 07e875ab4a41add247b4127470be6e45a3530e82 Author: Vivek Dasmohapatra Date: 2011-06-08 18:40:25 +0100 Unref wrapper not required if we set the free func commit 575e87ff463a2b654bd7c921a6c900b1f9da9006 Author: Vivek Dasmohapatra Date: 2011-06-08 18:16:32 +0100 Accounts flagged as always-dispatch don't need a transport. commit feed5e78989b49983bb9231e5340ec021fc09dc8 Author: Vivek Dasmohapatra Date: 2011-06-02 19:11:06 +0100 The 'set' GHashTable in collect_satisfied_requests was leaked commit 993f3648b2d11598901e92e81606dea6fcc50adc Merge: 80cca13 98c15e8 Author: Vivek Dasmohapatra Date: 2011-06-01 18:03:20 +0100 Merge branch 'telepathy-mission-control-5.8' commit 98c15e812a24112a8276fa4a62e208a5f008d135 Author: Vivek Dasmohapatra Date: 2011-06-01 18:01:42 +0100 Update NEWS commit 0cfe51094842b0b05d70e83b83f9cf677bc7e7ac Author: Vivek Dasmohapatra Date: 2011-06-01 17:37:10 +0100 Minor header include cleanup commit 792507ee78a5a2b44bcd98b407c4d2b34bf4a986 Author: Vivek Dasmohapatra Date: 2011-05-27 12:24:03 +0100 Hook up the built-in plugins to the new plugin debug infrastructure commit fd85965e16c3c31bd7370c730d120c0b37d2da21 Author: Vivek Dasmohapatra Date: 2011-05-27 11:46:32 +0100 plugin debug header should be included via the main plugin header commit 5a8b31db634408f9fc93fd551a2fe04e4cc1c661 Author: Vivek Dasmohapatra Date: 2011-05-26 16:59:30 +0100 Initialise new plugin debug at the same time as reguar daemon debugging commit 3fc48b4258f44812722772873c647a90759d31d1 Author: Vivek Dasmohapatra Date: 2011-05-26 16:58:29 +0100 Expose new header file to out-of-tree plugins commit c7929ee79943f8c0408207c37895d4bc03aed094 Author: Vivek Dasmohapatra Date: 2011-05-26 16:58:01 +0100 define MCP_DEBUG for plugins to use commit cb25b3900d439e8a998e948c588d16a7888027a1 Author: Vivek Dasmohapatra Date: 2011-05-19 21:26:58 +0100 Use the new environment-driven debug control mechanism in MCP commit eaae4ff6dab43a52584487eec5d8d39b74209db5 Author: Vivek Dasmohapatra Date: 2011-05-30 11:10:08 +0100 New debug control for mission-control-plugins commit b2b8407b4c41b1bc2074882c199984bf77ade554 Author: Vivek Dasmohapatra Date: 2011-05-31 19:35:04 +0100 _mcd_master_account_replace_transport would accept "no connection" as a successful replacement if no account conditions were specified, forcing unwanted reconnections commit e17b83fec8f01ca6977cb4fe259a83634aa90b26 Author: Vivek Dasmohapatra Date: 2011-05-19 15:26:13 +0100 Call g_key_file_remove... rather than ...set_value when new value is NULL commit 34a28b406627f4452807b27ee87760b7b93d4bad Author: Vivek Dasmohapatra Date: 2011-05-19 15:25:43 +0100 Don't call tp_intset_size on unset intset commit 80cca13c3f19829b646c68a3b2eebf25ab9ae732 Merge: 478a087 9a0990b Author: Vivek Dasmohapatra Date: 2011-05-24 19:09:25 +0100 Merge branch 'telepathy-mission-control-5.8' commit 9a0990b433fe9a90b1373c8aacaa5501d905f817 Author: Vivek Dasmohapatra Date: 2011-05-24 18:50:31 +0100 Update NEWS commit 0c3f44720632f76c5b4f90799314fb45fdd54c41 Merge: 964891e 232cc60 Author: Vivek Dasmohapatra Date: 2011-05-24 18:44:33 +0100 Merge branch 'cd-message-api-fixes' into telepathy-mission-control-5.8 commit 232cc604d7827c51456534976cf8c69446b3418b Author: Vivek Dasmohapatra Date: 2011-05-20 20:33:58 +0100 Catch the case where there's a hole in our logic and an internal request hasn't been cleaned up properly commit 0285a8ce6940868d91b86c9de23b141a85ff47a1 Author: Vivek Dasmohapatra Date: 2011-05-20 20:32:05 +0100 Log the actual call to internal request handling commit 761b4310d351396c14d27e08b78e4badf58c8387 Author: Vivek Dasmohapatra Date: 2011-05-20 20:30:26 +0100 If we're failing an internal request, clear the handler immediately commit 0c7cb7baad42bf7be3415403bb6610680e3c2c36 Author: Vivek Dasmohapatra Date: 2011-05-20 20:29:30 +0100 Internal requests should be handled in _both_ paths through _add_channel_request commit 478a087af9805219dad7c5288516f5f4c3891306 Merge: 272c1d1 964891e Author: Simon McVittie Date: 2011-05-20 13:52:10 +0100 Merge branch 'telepathy-mission-control-5.8' commit 964891e770dd1ca66c7c9a51ae03cc71dba8fe1a Merge: a0cd220 12230d1 Author: Simon McVittie Date: 2011-05-20 13:52:02 +0100 Merge branch '58-user-initiated' into telepathy-mission-control-5.8 commit 272c1d13fdb704b2c5e6da849355b5453eca035c Merge: e4ccbd3 a0cd220 Author: Simon McVittie Date: 2011-05-20 12:17:58 +0100 Merge branch 'telepathy-mission-control-5.8' Conflicts: NEWS commit a0cd22059631972a7d89aa0bc8644544e122cf35 Author: Simon McVittie Date: 2011-05-20 12:15:49 +0100 NEWS commit 615aae42cf533e02feb08eeabcad2f6ae16ea6ac Author: Vivek Dasmohapatra Date: 2011-05-06 17:22:25 +0100 We need to propagate nickname changes that occurred "behind our back" too Reviewed-by: Simon McVittie commit e6cd84b0d147f24fc7e2dbcec99e6b494af3c032 Author: Vivek Dasmohapatra Date: 2011-04-08 13:02:36 +0100 Storage has stabilised after the Big Rewrite: turn off debug by default Reviewed-by: Simon McVittie commit c4a70827351fc7e658c60d13e1b258aaa2fdfee0 Author: Vivek Dasmohapatra Date: 2011-04-08 12:59:30 +0100 The param hash is reffed by the ACL framework, we can drop our ref to it Reviewed-by: Simon McVittie commit f44ca2fc586c08d72e09a03f287567b85f7a05a8 Author: Vivek Dasmohapatra Date: 2011-04-08 12:58:51 +0100 Don't leak copies of the new stored setting values on update Reviewed-by: Simon McVittie commit da98340c7262c56ab9e38f9159783db746c1bd0b Author: Vivek Dasmohapatra Date: 2011-04-08 12:55:55 +0100 Don't leak the initial "offline" account status name Reviewed-by: Simon McVittie commit 2656c26edc53ac75a9e3fb1da19b5f4f6135bcf3 Author: Vivek Dasmohapatra Date: 2011-04-08 12:55:15 +0100 Don't leak the key list when accounts are updated by libaccounts/SSO Reviewed-by: Simon McVittie commit 12230d1e93a5c428618a0815146ba00138f2cbb2 Author: Simon McVittie Date: 2011-05-18 19:04:41 +0100 Add mcd_account_connection_is_user_initiated commit dc5ea0a5e8072cd6abcaa4b636f4395db54e26ac Author: Simon McVittie Date: 2011-05-18 19:01:45 +0100 _mcd_account_connection_begin: take a flag for user-initiatedness commit 03a86b79018b2c7ac0b8d1e7a2bf7ae54249da06 Author: Simon McVittie Date: 2011-05-18 19:01:22 +0100 mcd_account_request_presence_int: take a flag for user-initiatedness commit 82ff5c401a7e57ec62fea591c071a0644be1828f Author: Simon McVittie Date: 2011-05-18 19:21:58 +0100 mcd_account_request_presence_int: emit RequestedPresence directly commit 7517ff1489872b68e35f8536f552377726c5b190 Author: Simon McVittie Date: 2011-05-18 19:13:25 +0100 _mcd_account_connect_with_auto_presence: take a parameter for user-initiated or not commit e4ccbd3a80d4ea8cf2d527b54c662b4c41dad21a Merge: a43df07 2cdf0bd Author: Simon McVittie Date: 2011-05-19 16:39:47 +0100 Merge branch 'telepathy-mission-control-5.8' commit 2cdf0bd3efa2550c91f41f3fd2426365942e2878 Author: Simon McVittie Date: 2011-05-19 13:38:45 +0100 update autogenerated gtk-doc goo Reviewed-by: Guillaume Desmottes commit 7d4041666674515fd601faaa20e804aeab98cb92 Author: Simon McVittie Date: 2011-05-19 13:21:34 +0100 Regression test for passing unapproved channels to recovering observers Bug: https://bugs.freedesktop.org/show_bug.cgi?id=34025 Reviewed-by: Guillaume Desmottes commit dcc858d02c6c3671028d9e677b5d0a6bb36e0321 Author: Simon McVittie Date: 2011-05-19 13:38:20 +0100 fd.o #34025: call ObserveChannels for channels waiting in CDOs when recovering Bug: https://bugs.freedesktop.org/show_bug.cgi?id=34025 Reviewed-by: Guillaume Desmottes commit a43df074d4bd9355420a200707be626ad71266dd Merge: ad0753f 7209f39 Author: Simon McVittie Date: 2011-05-18 19:26:30 +0100 Merge branch 'telepathy-mission-control-5.8' commit 7209f3901a41ea0abacfb201aeef90a7abb0e76a Author: Jonny Lamb Date: 2011-05-18 11:10:27 +0100 tests: when creating multiple simulated connections use different object paths This was causing test failures when testing using a better tp-glib. Signed-off-by: Jonny Lamb commit 3f771dceff1cfd03f21f3cc44eb326f3299d2270 Author: Jonny Lamb Date: 2011-05-18 11:07:33 +0100 dispatcher/already-has-channel.py: don't test for calls done by tp-glib We previously checked makes sure GetInterfaces was called but this is actually a call that tp-glib does. Newer versions of tp-glib don't do this as they call GetAll on the connection beforehand so this test failed. We don't really need this q.expect. Signed-off-by: Jonny Lamb commit ad0753f240b4064c41fd7914449da4ae1638292a Author: Jonny Lamb Date: 2011-05-18 13:47:09 +0100 start on 5.9.1 Signed-off-by: Jonny Lamb commit cc9acec9c7e8fcbeb92271783f43e8311b7a3176 Author: Jonny Lamb Date: 2011-05-18 12:50:07 +0100 version 5.9.0 Signed-off-by: Jonny Lamb commit f64b04c3eb487e7df44836c2572260efcf9cc1dd Author: Jonny Lamb Date: 2011-05-18 11:10:27 +0100 tests: when creating multiple simulated connections use different object paths This was causing test failures when testing using a better tp-glib. Signed-off-by: Jonny Lamb commit 6c6ecf5152af67885f947bed5d9a00ad5da151f7 Author: Jonny Lamb Date: 2011-05-18 11:07:33 +0100 dispatcher/already-has-channel.py: don't test for calls done by tp-glib We previously checked makes sure GetInterfaces was called but this is actually a call that tp-glib does. Newer versions of tp-glib don't do this as they call GetAll on the connection beforehand so this test failed. We don't really need this q.expect. Signed-off-by: Jonny Lamb commit db2a49fc4270a43dead300b9c5faa8100a9a277a Author: Jonny Lamb Date: 2011-05-17 10:34:24 +0100 service-points: don't depend on there being any interfaces Signed-off-by: Jonny Lamb commit 7133b0e580815d6c25321bf213f5c61b75300e32 Author: Jonny Lamb Date: 2011-05-17 10:34:24 +0100 service-points: don't depend on there being any interfaces Signed-off-by: Jonny Lamb commit c167d23e3a9da532e98a99351c996b1fc2e99730 Author: Simon McVittie Date: 2011-05-17 10:44:08 +0100 Nano version "almost 5.9" commit 8176880328f8a7107117ccc4fe5279910796c2bd Merge: 9b03ad0 c12764d Author: Simon McVittie Date: 2011-05-17 10:41:42 +0100 Merge branch 'telepathy-mission-control-5.8' Commit c12764d3b "Don't warn about deprecated declarations" rejected, since this is the development branch. commit c12764d3b42f40736f315c320b929f756405bf80 Author: Simon McVittie Date: 2010-09-16 16:49:57 +0100 Don't warn about deprecated declarations The usual stable-branch change, to be rejected when merging to master. commit 9b03ad06401983c5126be107fac5c1c2f91df41b Author: Guillaume Desmottes Date: 2011-05-16 08:54:14 +0200 clean up indentation It's supposed to be 4 spaces identated. commit e8eb58e1890e05f242b059dcbcee633b96157df6 Author: Guillaume Desmottes Date: 2011-05-12 14:06:03 +0200 Implement new version of DelegateChannels() commit d86266ef7539e4ecaeb77fcb0a88e6dd289a1602 Author: Guillaume Desmottes Date: 2011-05-11 16:19:58 +0200 bump glib dep to 2.28 We need it for g_list_free_full(). commit 09f403c21aa2d598d8f1c1a6c375b91be57a950f Author: Guillaume Desmottes Date: 2011-05-11 13:27:57 +0200 Use non-fatal assertions for more subtile checks commit 9ef991c4d33b985ce61aca0a98304c637a0abba7 Author: Guillaume Desmottes Date: 2011-05-10 10:56:58 +0200 stop generating DelegateChannels and PresentChannel commit 6dcd8266c6d91be75ac76d49614d609f9e0e1ab0 Author: Guillaume Desmottes Date: 2011-05-10 11:13:03 +0200 DelegateChannels and PresentChannel are now stable commit b88dac1b0f0f95a05210a9a7f7dac442730b76a4 Author: Guillaume Desmottes Date: 2011-05-17 11:12:00 +0200 Bump tp-glib to 0.15.0 We need it for CD.RedispatchChannels() and PresentChannel() generated code. commit e5a15f51ef6473f5fa90eb5d7c86b8bba8b835a6 Author: Guillaume Desmottes Date: 2011-05-10 10:40:07 +0200 Implement CD.PresentChannel() commit 97df23d0640470efff1a4959999b7aae5bec7d49 Author: Guillaume Desmottes Date: 2011-05-10 10:10:56 +0200 Update to latest DelegateChannels WIP API Changes: - RedispatchChannels has been renamed to DelegateChannels() - It's now documented when we should raise NotCapable but our implementation was already doing it. - The Account argument has been removed - The Hints argument has been removed commit e90b58ca31a394bbdf94726288e66a643f709905 Author: Vivek Dasmohapatra Date: 2011-05-11 16:03:03 +0100 Start 5.7.12 development commit ab65263abdb9270d27177ed04ef919deb5b542a6 Author: Vivek Dasmohapatra Date: 2011-05-11 15:55:21 +0100 Prepare version 5.7.11 commit 88b5baf1db86614acff4ec8fca94667c7a55b49f Author: Simon McVittie Date: 2011-05-11 10:58:22 +0100 McpAccountManager: add brief documentation commit f43ca7dae697528d26941874236c9f9dc7f8c36b Author: Simon McVittie Date: 2011-05-11 10:57:56 +0100 McpDBusAclIface: note some API-breaking changes for later commit f0e6772fea09f90f180dec328828b8128b889db6 Author: Simon McVittie Date: 2011-05-11 10:57:23 +0100 McpDBusAclIface: make the vtable public and improve documentation commit 2d0564737c9efd42e05749aadbbc0c451109d115 Author: Simon McVittie Date: 2011-05-11 10:55:59 +0100 McpRequestPolicyIface: make the vtable public commit 44f3db606ec3f2d9e73fd53ad4a4609cee93eb3b Author: Simon McVittie Date: 2011-05-11 10:53:17 +0100 mcp: change all @include lines to the mission-control-plugins.h meta-header You're not meant to include the sub-headers directly. commit 344347320a75465ae35dc8ffdf715299ce5b14af Author: Will Thompson Date: 2011-01-11 10:43:17 +0000 Publicise McpAccountStorageIface All the existing fill-in-the-vtable functions still exist, of course. This struct is undocumented. But so were all the _implement_ functions, so that's okay then, or something. commit 58254dfccd39293e9c041a2276b260481053eda8 Author: Will Thompson Date: 2011-01-10 19:28:59 +0000 Storage: improve grouping in the header commit 4a7c8e9486b75dc23cbc1cd2812a65ee8b3fe7de Author: Will Thompson Date: 2011-01-10 19:27:25 +0000 Storage: Add typedefs for method signatures commit 68e48c0950397f15d0d7fb647a0175e5018efa2f Author: Simon McVittie Date: 2011-05-11 11:14:32 +0100 tests/account-store-default: if secret is not found, return NULL, not uninitialized Reviewed-by: Will Thompson commit a819a505f597097fd2aba2e83b456e6280847140 Author: Simon McVittie Date: 2011-05-11 10:25:16 +0100 NEWS for builtin-aegis-acls commit a4eb1c2b1403a84f593c3e5bad4622ff89f54496 Merge: e9d5be6 a079918 Author: Simon McVittie Date: 2011-05-11 10:12:57 +0100 Merge branch 'builtin-aegis-acls' Reviewed-by: Vivek Dasmohapatra Bug: https://bugs.freedesktop.org/show_bug.cgi?id=36845 commit a07991817ceb17c5a48e674ef14bf112b247638b Author: Simon McVittie Date: 2011-05-11 10:12:05 +0100 Fix caller_creds_are_enough() debug output so it will actually terminate commit 1d224057ae7c1be1c438070db3469b1047921603 Author: Simon McVittie Date: 2011-05-06 15:15:51 +0100 put Claim attempts through the handler suitability check, too These get a NULL TpClient, since it's non-obvious. commit 9ac3c5f4c5c4147734f0529bd43bdf1e13dd3f60 Author: Simon McVittie Date: 2011-05-06 15:02:46 +0100 include Handler's unique name in suitability checks if available commit e9d5be63b54acfd7515dbf527238e97b17fbf8b2 Author: Vivek Dasmohapatra Date: 2011-05-06 15:09:51 +0100 Nano version commit bb27105b6c79721ce266582abb920c9642744cdb Author: Simon McVittie Date: 2011-05-06 14:58:22 +0100 Add a test for handler-suitability checking commit 7a54c4538058c35f77e11c3999a03a35fb53fea8 Author: Simon McVittie Date: 2011-05-06 12:45:41 +0100 Add a no-op plugin to check that NULL pointers are OK commit b3ad0c11e2b3977c655116a8c2dc28221df17bee Author: Simon McVittie Date: 2011-05-06 12:45:06 +0100 McpDBusAcl: make it OK to not set a name or description commit 035973d3593c40db2535f1f6323d14e9863d92fa Author: Simon McVittie Date: 2011-05-06 12:35:29 +0100 mcp_dbus_acl_authorised_async_step: skip plugins not implementing authorised_async commit e041b7aa87f4a925a6fd8f9aab47e2cc5ae3356c Author: Simon McVittie Date: 2011-05-06 12:33:12 +0100 mcp_dbus_acl_authorised: if a plugin doesn't implement authorised(), assume TRUE commit 67eacd530568185c61499a67ba35f5c3562f4659 Author: Vivek Dasmohapatra Date: 2011-05-06 14:46:16 +0100 Prepare version 5.7.10 commit 29296083a036d84f6a39f0c543a56913ecd16d76 Author: Simon McVittie Date: 2011-05-06 12:16:35 +0100 make Handler suitability-checking asynchronous In the general case, when we do the check the Handler won't be running yet, so we can't check its group ID, Aegis credentials or any other process parameters; so plugins may need to be able to activate it and wait for it to start, and MC should be able to do other work in the meantime. commit a17f762c4fd03256a962636c4c2019b7fa26e7c2 Author: Vivek Dasmohapatra Date: 2011-05-06 12:14:38 +0100 Make an extra round trip to re-store the value, as this will trigger any important side effects like propagating values to the CM commit 4ee6a19dcc186400d0d4b7a49ccbf9b70918561f Author: Vivek Dasmohapatra Date: 2011-04-21 15:47:06 +0100 Deleted parameters aren't stored, so there's no meaningful test to be done here commit 69c388ba4df48f46a73296ffb54a17db93a8f1a0 Author: Simon McVittie Date: 2011-05-06 10:40:58 +0100 mcd_dispatch_operation_handle_channels: move the handler check here When we make it asynchronous, it'll have to be in a context where we can call callbacks for the result. Also, this removes some duplication. commit d6fcf20ef7a39504a819fa8f43b2c38905a40f1c Author: Simon McVittie Date: 2011-05-05 18:47:50 +0100 pid_is_permitted(): remove commit ea3fad6237fff58362cd6b2c0cb97bd44b48d1a6 Author: Simon McVittie Date: 2011-05-05 18:45:24 +0100 Use GetConnectionCredentials() when checking credentials asynchronously Again, this avoids a time of check / time of use vulnerability. commit d2f40c4995911d3583794297f6a76b4570453c44 Author: Simon McVittie Date: 2011-05-05 18:44:39 +0100 Use GetConnectionCredentials() when checking credentials synchronously This avoids a time of check / time of use vulnerability. Also, don't crash if the D-Bus call fails. commit ebef3a3d1fedf07edd75cf8cdf924df6e8958444 Author: Simon McVittie Date: 2011-05-05 18:02:50 +0100 Remove McpDBusChannelAcl commit 7b857fe79d268b0ff8cf919c8785a5a686f3c351 Author: Simon McVittie Date: 2011-05-05 18:00:45 +0100 AegisAcl: implement McpDispatchOperationPolicy, not McpDBusChannelAcl commit 698dbc6a8a55d3732c7b52ef00f38c9a24c79889 Author: Simon McVittie Date: 2011-05-05 17:56:47 +0100 McpDispatchOperationPolicyIface: add handler_is_suitable() commit 08a09215bfd734bb797661822000d4dce36e1b23 Author: Simon McVittie Date: 2011-05-05 17:44:49 +0100 McpDispatchOperationPolicyIface: make the GInterface into public API We can stay compatible as long as we don't change or reorder methods: adding methods to the end of a GInterface is considered to be a compatible change. commit 53bbd7de157f869d36edc40f73a317467e88df29 Author: Simon McVittie Date: 2011-05-05 17:13:20 +0100 Revert "Util to prepare a GPtrArray of TpChannel for the new DBus handler ACL framework" This reverts commit cbd280e9d768df7e4e1c69b0c0b49648a0219a10. Now that we're using McpDispatchOperation, this function isn't needed. commit c895b0414278dc79d749cd5a13974ff6d6d4b80a Author: Simon McVittie Date: 2011-05-05 17:13:00 +0100 mcp_dbus_channel_acl_authorised: redo API in terms of McpDispatchOperation This vastly simplifies both the caller (McdDispatchOperation) and the plugin. commit 8f2a8cbc424d6ac6bb0b55d3a973b568aaf9ccf4 Author: Simon McVittie Date: 2011-05-05 16:48:01 +0100 Move channel ACL traversal to McdDispatchOperation This is a helper for MC itself and isn't needed by plugins, so it shouldn't be in the mission-control-plugins library. commit bf612767b4a5500f8271d689353d4bb661eb45c0 Author: Simon McVittie Date: 2011-05-05 16:46:25 +0100 Flatten AegisChannelAcl into AegisAcl, which now implements both interfaces This means we don't need any extra glue to hook it into MC as a pseudo-plugin. commit c4bec580469f1a6b43cfbf6058a09849eb367c51 Author: Simon McVittie Date: 2011-05-05 16:38:34 +0100 aegis_acl_class_init: only initialize once commit f82a9d29645bddfe6e5d5bdebfa9527c1744192f Author: Simon McVittie Date: 2011-05-05 16:35:35 +0100 AegisAcl: remove unused struct members commit f3a03b48f1529a4f84eafec62bcb459fd597d626 Author: Simon McVittie Date: 2011-05-05 16:34:27 +0100 AegisAcl: hide the concrete type completely commit 190f905a44edac89bb0ce6a60fb19ac11a38c7f3 Author: Simon McVittie Date: 2011-05-05 16:33:49 +0100 AegisAcl: move struct contents and Aegis internals into the .c file commit a1004d8a10fe0caa153a595e5648dda8d916534a Author: Simon McVittie Date: 2011-05-05 16:27:53 +0100 Move mcp-dbus-aegis-acl plugin back to plugins and load it via plugin-loader commit ddc03c7002412e9c5e144b665fed249842cd338a Author: Simon McVittie Date: 2011-05-05 14:34:50 +0100 _mcd_manager_constructor: remove unused variable spotted by gcc-4.6 commit 77df7a3165cd881eedba2296f116b495c5a626c6 Author: Simon McVittie Date: 2011-05-05 14:34:12 +0100 plugin-account: sort_and_cache_plugins: only initialize once A potential bug spotted by gcc-4.6, which warns about this unused variable. commit b2500c50db739e21ebbde25b94e6384c1cc8e477 Author: Simon McVittie Date: 2011-05-05 14:33:08 +0100 _mcd_dispatch_operation_try_next_handler: don't leak error if Aegis rejects a handler commit 1915c72985971988737653698d86acc753057a10 Author: Simon McVittie Date: 2011-05-05 14:18:55 +0100 dbus-acl: if config.h is #include'd, it should be the very first thing commit d515f38253b6f3b96873773441ad47d8d45413ab Author: Simon McVittie Date: 2011-05-05 14:15:23 +0100 Revert "Filter reinvocation of handlers through the DBus Aegis ACL as well" This reverts commit a0b6d02c66dc8592455b151d38a3291db545f9a0. The handler is already handling the channels here, so this can only be a problem if you already got it wrong; there's no transfer of responsibility. commit 02fbeb602b7406d5746afbe6e5bbc94dfd10e066 Merge: b7ff6fe 631b061 Author: Vivek Dasmohapatra Date: 2011-05-04 19:53:40 +0100 Merge branch 'telepathy-mission-control-5.7' commit 631b061c3a431acef9ff16d5b9fa326f08741e6a Author: Vivek Dasmohapatra Date: 2011-05-04 19:29:22 +0100 Unused variables commit b7ff6fe1c3e29d5d74e707fd5fc0ac980d7f0650 Merge: fdc70e2 3441183 Author: Vivek Dasmohapatra Date: 2011-05-04 16:36:49 +0100 Merge branch 'telepathy-mission-control-5.7' Conflicts: NEWS commit 3441183e9e2b1d5c2d0919a922d87252c1278f77 Author: Vivek Dasmohapatra Date: 2011-05-04 16:33:36 +0100 Update NEWS commit c1b3639c61820d47e5f721983a20f37a3cd735b8 Author: Vivek Dasmohapatra Date: 2011-05-03 15:08:51 +0100 Make DEBUG macros in builtin-plugins dependent on ENABLE_DEBUG from config.h commit d1dd3023db239021b72bf18f9dd2867c6caf57c3 Author: Vivek Dasmohapatra Date: 2011-04-20 19:38:58 +0100 Misleadingly named argument in header file commit aa26a5f7c3446904434a4a2510fa81c024502779 Author: Vivek Dasmohapatra Date: 2011-04-20 19:38:38 +0100 Clean up the debugging in the DBus access ACL framework a bit commit a0b6d02c66dc8592455b151d38a3291db545f9a0 Author: Vivek Dasmohapatra Date: 2011-04-20 19:37:56 +0100 Filter reinvocation of handlers through the DBus Aegis ACL as well commit db0e652698ae50b14eda3b182e9c5998c6e455c4 Author: Vivek Dasmohapatra Date: 2011-04-20 19:37:28 +0100 Filter dispatch operations through the DBus Channel/Handler Aegis ACL commit 17b541a74a2d61062f3f89bd0cd60736ae414613 Author: Vivek Dasmohapatra Date: 2011-04-20 19:36:10 +0100 Implement the Aegis DBus Channel/Handler policy as an ACL plugin commit cbd280e9d768df7e4e1c69b0c0b49648a0219a10 Author: Vivek Dasmohapatra Date: 2011-04-20 19:34:45 +0100 Util to prepare a GPtrArray of TpChannel for the new DBus handler ACL framework commit be065542c28939643f106f9d5f74fd14e37bcd60 Author: Vivek Dasmohapatra Date: 2011-04-20 19:34:14 +0100 Implement the DBus Channel/Handler ACL framework commit 0125537aca079598f37afb7b18cc59c47aeb809c Author: Vivek Dasmohapatra Date: 2011-04-20 19:32:01 +0100 Resurrect the DBus access ACL plugin as a builtin pseudo-plugin commit 142ab4040e5569494a3835bdc29622fc469224f2 Author: Vivek Dasmohapatra Date: 2011-04-18 18:48:26 +0100 Remove the old external Aegis ACL plugin commit cfc09eb5b54fa10485d52db90924cc37a0a7d757 Author: Vivek Dasmohapatra Date: 2011-04-21 12:56:27 +0100 Simplify filter-add error checking commit 94de2830461dd828eff5df31e8bf4e60f78ccf2d Author: Vivek Dasmohapatra Date: 2011-04-21 12:45:36 +0100 People mght be interested in an invalid signal, so don't claim it commit d830cae86f8979bad772e8217b247a3a25c0dfbd Author: Vivek Dasmohapatra Date: 2011-04-21 12:43:26 +0100 Use utility function to check if it's the right signal commit 9aca7421037b878ce572e4ddc8f2f6200fb463df Author: Vivek Dasmohapatra Date: 2011-04-21 12:38:37 +0100 Don't ref the registry when adding it as the filter data commit b01dd79df9032460822c3c2eebf3b3cee6cc7103 Author: Vivek Dasmohapatra Date: 2011-04-14 19:26:27 +0100 Remove unused callback commit 90aff1c8afafd4defa2a4059bb36f61307b691fc Author: Vivek Dasmohapatra Date: 2011-04-14 18:43:19 +0100 Fall back to universal name-owner-changed matching if the new approach fails commit 6c4c4f775808717aedcac74f6784e60ce2ecfcb3 Author: Vivek Dasmohapatra Date: 2011-04-14 18:30:59 +0100 Remove FIXME now that we have done so commit fbf0571b85096aa5ee09c0e43c28d79cbeab1411 Author: Vivek Dasmohapatra Date: 2011-04-14 01:09:38 +0100 Copyright update commit 580cb1ad9d9cbdbf426796fb87e81e881bd0926a Author: Vivek Dasmohapatra Date: 2011-04-14 00:24:23 +0100 Use an arg0namespace match and a filter instead of all nameownerchanged signals commit fdc70e2e68b40a0d6616428f5b861ef247fadafa Author: Vivek Dasmohapatra Date: 2011-04-05 17:11:33 +0100 Nano version commit 6a03fa23d1ce0060e5486b882d2ef0e35af44691 Author: Vivek Dasmohapatra Date: 2011-04-05 16:37:12 +0100 Prepare version 5.7.9 commit 8334d2fe4ec2b867200906a362a3dad0bbdb260b Author: Vivek Dasmohapatra Date: 2011-04-05 16:33:40 +0100 Merge HEAD, branch 'master' into telepathy-mission-control-5.7 commit 691dcf70772574340b4532813da42c741fe8446a Author: Vivek Dasmohapatra Date: 2011-04-05 16:30:58 +0100 bogus const in declaration commit bd9ce873e74ecdfb347ededa94e1903fd1d7fc28 Author: Vivek Dasmohapatra Date: 2011-04-05 15:02:22 +0100 Nano version commit fa41a9cf0b4f336efeea3848bffbf26de5a66cc7 Author: Vivek Dasmohapatra Date: 2011-04-05 14:50:40 +0100 Prepare version 5.7.8 commit 63bd914321360851f30b30eea51d903563b927e4 Author: Vivek Dasmohapatra Date: 2011-04-01 19:20:05 +0100 Use tp_clear_object for GObjects rather than tp_clear_pointer commit 3fd08dd03d89e2e4d4923db84a598a09bc1ba571 Author: Vivek Dasmohapatra Date: 2011-04-01 19:18:25 +0100 Put the right value in the SEND_MESSAGE #define commit 1d22bf4561985c4f2e3a5f70757d537186aab59d Author: Vivek Dasmohapatra Date: 2011-04-01 14:35:53 +0100 Debugging & whitespace trivia commit 6060526c748a8829444e1d108dc6547b6c4622e7 Author: Vivek Dasmohapatra Date: 2011-04-01 14:35:26 +0100 Restart request if the channel owner closed it before we could send our message commit 46fd73820ee21652c815205d6e3d6f6538c538b6 Author: Vivek Dasmohapatra Date: 2011-04-01 14:34:28 +0100 Update the libcreds/cellular ACL to include the new message API call commit 409f6fa7427b51aed3ebbe9c349f5799de493928 Author: Vivek Dasmohapatra Date: 2011-04-01 14:33:24 +0100 Plug the send message API implementation into the ACL framework commit aabea2ce4023cbdd92c29e32235207c897b4031d Author: Vivek Dasmohapatra Date: 2011-04-01 14:30:31 +0100 Use the new message context allocators/dellocators commit c8e942ff87811a59e4e4ddafc1c2c61f23c903b1 Author: Vivek Dasmohapatra Date: 2011-04-01 14:23:43 +0100 Helper to steal message ontext back from the ACL framework commit cd9aeb1e53c4026adcba4361fb238ebbf63c548e Author: Vivek Dasmohapatra Date: 2011-03-30 18:16:24 +0100 Helpers for dbus error return and message dbus-context setting/unsetting commit 3f7e0ca90a52edf6141f9beabf5b62d082d898e4 Author: Vivek Dasmohapatra Date: 2011-03-30 18:11:01 +0100 Extend message context struct + allocator & free func so we can allow retries commit 02c76ce59f1bb8ef11630cd5f0c21d3cf79c9246 Author: Vivek Dasmohapatra Date: 2011-03-28 19:28:33 +0100 Force Account.Removed to be emitted when the account is, well, removed. commit 297c55b3e7d4c16cc2af8ee07f14879bd4f7c310 Author: Vivek Dasmohapatra Date: 2011-03-24 20:12:53 +0000 Squash some warnings commit 07a391599e392755170b23c15c6301178e6d3961 Author: Vivek Dasmohapatra Date: 2011-03-24 19:59:42 +0000 Dispatch internal operations after the observers have finished. commit 9cf8902965acc2d258e3c71448ce9ce05ed202b1 Author: Vivek Dasmohapatra Date: 2011-03-24 19:52:15 +0000 Internal requests ARE subject to policy, and shouldn't be dispatched here commit 5ac48ff9079881f4796a70787bb222a3f06603c1 Author: Vivek Dasmohapatra Date: 2011-03-24 19:51:17 +0000 Internal dispatch operations are NOT subject to approval commit 5dcb0986d3473033491fd06f944c9e3b64ec4f09 Author: Vivek Dasmohapatra Date: 2011-03-24 19:48:47 +0000 Tidy up the code used to set/check whether a dispatch operation is internal commit 1e23d9051b6f001e2ae77557783248ae1d7f5c33 Author: Vivek Dasmohapatra Date: 2011-03-22 20:28:26 +0000 The service properties shouldn't get deleted when the account is updated commit d1e2989bf0eae978f2eb20c1791d858d0720c059 Author: Vivek Dasmohapatra Date: 2011-03-22 17:28:06 +0000 Use clear-handler function in finalize instead of dupping the code commit ee4d8c3a42e918cbbf4d22b555dde6541c7116d6 Author: Vivek Dasmohapatra Date: 2011-03-22 17:27:31 +0000 Alter _mcd_request_handle_internally per review commit 757337b6c1db87aa1beedc287fb9e2fb17dc6c91 Author: Vivek Dasmohapatra Date: 2011-03-21 18:11:30 +0000 Copyright updates commit cb7e7dce7104f1503e854736f86f539d07507880 Author: Vivek Dasmohapatra Date: 2011-03-21 18:11:17 +0000 Implement the draft CD.Messages interface using the internal-request framework commit 66c6dcfbc51a541da10e07d306b6ba300fd9fc7e Author: Vivek Dasmohapatra Date: 2011-03-21 18:08:45 +0000 If a new channel results from an internal request, invoke its callback The usual approvers/observers logic is followed, to preserve as much normal channel behaviour as possible. commit f5dc7b9af212d5a4e495ebd5c433ea9d12e4e2d4 Author: Vivek Dasmohapatra Date: 2011-03-21 18:07:31 +0000 If a pre-existing channel results from an internal request, invoke its callback commit ae0c259b89424a6190ebd3e5df0b3de0d73257d3 Author: Vivek Dasmohapatra Date: 2011-03-21 18:04:44 +0000 use tp_clear_pointer commit e210d32c340fef61c0f2477d67f03360cbdbfece Author: Vivek Dasmohapatra Date: 2011-03-21 18:04:31 +0000 Allow requests to be blocked/unblocked on a per-account basis This allows internally generated requests which require external interaction to be atomic from the point of view of the caller, and prevents MC and "real" handlers from treadin on one-another's toes. commit a53807c9d8dc3b0d4e745a5e01be2ed64bd65adb Author: Vivek Dasmohapatra Date: 2011-03-21 18:02:32 +0000 Allow MC to set callbacks for internally generated requests These requests will typically be handled by MC itself rather than being dispatched to a "real" handler. commit f83fbe87848689edc028837de829b8f0748c9eaa Author: Vivek Dasmohapatra Date: 2011-03-21 17:59:45 +0000 Draft messages interface for the channel dispatcher commit 71940213008b3c46ffb66af68ff4ae17c6fa72cd Author: Vivek Dasmohapatra Date: 2011-03-16 15:26:08 +0000 Use the new always dispatchable info to bypass checks where necessary commit 43a84a875c4ef570af89b2eb7acbdd302539a07b Author: Vivek Dasmohapatra Date: 2011-03-16 15:25:37 +0000 Expose the new always-dispatchable info to internal callers commit 7db085c8b25aec2f8a34d1896765be62f217f36a Author: Vivek Dasmohapatra Date: 2011-03-16 15:25:02 +0000 New flag for accounts to indicate their channels must always be dispatched commit 88d047f975a13eca5bc29e69b9cdd10a0845e217 Author: Vivek Dasmohapatra Date: 2011-03-10 17:54:04 +0000 Free creds handle when we are done with it commit 9e6b4103c02806d40f78cd67344237713af49f4e Author: Vivek Dasmohapatra Date: 2011-04-05 14:15:50 +0100 Merge HEAD, branch 'master' into telepathy-mission-control-5.7 commit 29c120696de8118f56fef69284486c1ed6acf06e Author: Vivek Dasmohapatra Date: 2011-04-05 14:12:36 +0100 Merge HEAD, branch 'master' of git+ssh://git.freedesktop.org/git/telepathy/telepathy-mission-control commit d6f8af95d4645f212054f1500b6fc7d7feb2353a Author: Danielle Madeley Date: 2011-03-30 16:33:24 +1100 Remove reference to mc_cli_account_interface_stats_connect_to_stats_changed Makes MC master actually compilable! commit 054d9162eac73bc218277bb8d2723080ea629662 Author: Will Thompson Date: 2011-03-18 14:35:21 +0000 ChannelDispatcher: implement SupportsRequestHints commit 60cabc58f4a23a9494f875fc5bc8536f6da06f10 Author: Will Thompson Date: 2011-03-18 14:35:11 +0000 mctest: add a pretty ChannelDispatcher class commit 411f14de0bc018ae5f596257f20295413524f445 Merge: 7e9c06d 33e3c15 Author: Jonny Lamb Date: 2011-03-10 08:45:17 +0000 Merge remote branch 'stefw/path-in-pc' commit 7e9c06d5ad6d512ea46ad27115731cf457434dc2 Author: Sjoerd Simons Date: 2011-03-09 19:44:37 +0000 The account is passed as the object, not the user_data commit ef9a69832487e9d44843f4d2b9e3b84a571c9c40 Author: Vivek Dasmohapatra Date: 2011-03-09 17:47:14 +0000 Update news for cull-stats-interface branch merge commit 117136db5ded4aaf456b04fbae84ae8d77c568ea Merge: dc44d1b e91e385 Author: Vivek Dasmohapatra Date: 2011-03-09 17:44:12 +0000 Merge branch 'cull-stats-interface' Conflicts: src/mcd.xml commit dc44d1b037fd4659a663cfbc98c2e153fe8fd3fc Author: Vivek Dasmohapatra Date: 2011-03-09 17:08:32 +0000 Nano version bump commit c0d71ba28997b2747a41066cc587eadd6d63afae Author: Vivek Dasmohapatra Date: 2011-03-09 17:06:27 +0000 Prepare version 5.7.7 commit fd655e2cacf00ecb0db057c2f889a48a3e863850 Merge: ee5e558 18cb568 Author: Vivek Dasmohapatra Date: 2011-03-09 16:13:42 +0000 Merge branch 'master' into telepathy-mission-control-5.7 commit 18cb5680bb82bf03cbd41e6044d4f6cd2ece125a Merge: 3bf21d6 61e74f6 Author: Vivek Dasmohapatra Date: 2011-03-09 16:13:19 +0000 Merge branch 'sso-handle-non-atomic-updates' commit 61e74f631a08dc695072662e93ed43b478407026 Author: Vivek Dasmohapatra Date: 2011-03-09 13:52:00 +0000 Whitespace commit a0eb2e6eacae40f3ca87b735fde243409b22104a Author: Vivek Dasmohapatra Date: 2011-03-09 13:51:48 +0000 Fall back to the secondary setting for account naming if username is unset. commit 33e3c159c928f9881866d8be79eb5224865f8d49 Author: Stef Walter Date: 2011-03-09 12:58:07 +0100 Add missoncontrolpath variable to mission-control-plugins.pc This is for testing so plugins can lookup where the mission control executable is. https://bugs.freedesktop.org/show_bug.cgi?id=35140 commit ee5e5587eedf191b586a9ca780ef67916b16744c Merge: 08fa4d7 1a2e1b9 Author: Vivek Dasmohapatra Date: 2011-03-07 16:58:21 +0000 Merge branch 'master' into telepathy-mission-control-5.7 commit 3bf21d6d6151700970f8a191599da66536132759 Author: Guillaume Desmottes Date: 2011-03-07 16:32:34 +0100 start dev of next version commit 1a2e1b9a0718c34098951a50dad51e94f7462187 Author: Guillaume Desmottes Date: 2011-03-04 10:26:55 +0100 prepare 5.7.6 release commit d9e84e6a974968e85afb41b496712dcf5bf6b2f0 Author: Vivek Dasmohapatra Date: 2011-03-03 20:21:09 +0000 Typo in debug message commit ceba817848dc9d988dc8ecb14863968bafe666fb Author: Vivek Dasmohapatra Date: 2011-03-03 20:20:51 +0000 We actually need to watch the account twice, globally and for the service. commit 0783ceb306446d31e7222b44f7933408f7ae3f5b Author: Vivek Dasmohapatra Date: 2011-03-03 20:20:22 +0000 Explain how _sso_updated works; Rename 'key' to 'unused' to avoid confusion. commit 64b3054d3de4bcef9d0f5d6d81fe6fdfcf21c511 Author: Vivek Dasmohapatra Date: 2011-03-03 19:56:53 +0000 Rewrite the _sso_updated function: we no longer receive key-specific updates commit bf7751f352477c37047255ba4ae3ed4f90cde8d8 Author: Vivek Dasmohapatra Date: 2011-03-03 19:50:38 +0000 It is possible for the AG API to pass us duff account ids. Check for these. commit 03b1e1d3ebe2a9c48948eef41814e6db6eda45c6 Author: Vivek Dasmohapatra Date: 2011-03-03 19:48:48 +0000 Update the initial account loader to use the new watch-for-updates helper commit 21df44e6daff7d30e6aef2e3a440f1735d2b8340 Author: Vivek Dasmohapatra Date: 2011-03-03 19:48:01 +0000 Update _sso_created to use the new watch-for-updates helpers commit 69a89f369a79e6a838cc947a2cc6d36c13d052ea Author: Vivek Dasmohapatra Date: 2011-03-03 19:45:33 +0000 Update watch/unwatch functions and tracking hash to the new setup commit ae8e6e74bb7e94b03d5c21239f0b1a93612ab8e4 Author: Vivek Dasmohapatra Date: 2011-03-03 19:42:58 +0000 Alter the watch data struct and helpers to drop the key, which is going away commit 45b87d988829536ed03106e47b44b505c90e9cf0 Author: Vivek Dasmohapatra Date: 2011-03-03 19:40:48 +0000 Forward declarations for static functions so they can be referred to freely commit 024c428d90c999fd0bade3e8fe46d8bf36102770 Author: Vivek Dasmohapatra Date: 2011-03-03 19:34:04 +0000 Copyright update commit e09ac5ad2d3df2812d91ba8284aec7abe3031dc1 Author: Vivek Dasmohapatra Date: 2011-03-03 19:33:39 +0000 Accounts will be queued up for a delayed-create in _list, not here commit 12fd8163c225f4832bffee4f46a749f4fefdcfdd Author: Guillaume Desmottes Date: 2011-03-03 13:16:29 +0100 move delay approvers tests to tests/ commit 55f1a0545ede0d54ce65c2a32bb87bda62a9f5b5 Merge: ca1e743 4371e5e Author: Guillaume Desmottes Date: 2011-03-03 13:15:47 +0100 Merge remote branch 'jonny/delay-approvers' commit ca1e743e3f5ff6726981d0b61f763629d42866d1 Author: Vivek Dasmohapatra Date: 2011-03-01 17:39:15 +0000 Nano version 5.7.5+ commit 08fa4d72819bb13686c5e6caa3b9fd4f1cf3185a Merge: 07bc3de 69102be Author: Vivek Dasmohapatra Date: 2011-03-01 17:36:01 +0000 Merge branch 'master' into telepathy-mission-control-5.7 commit 69102beed05d7e2eec1d087b74c218f731f4bbd1 Author: Vivek Dasmohapatra Date: 2011-03-01 17:23:25 +0000 Version 5.7.5 commit ff0847e2dea8848c76d6f965014a1d1869d2d710 Merge: 28c11af 28581cc Author: Vivek Dasmohapatra Date: 2011-03-01 16:57:09 +0000 Merge branch 'master' of git+ssh://git.freedesktop.org/git/telepathy/telepathy-mission-control commit 28c11afb58a9809e648b6de8fadda6a9c2308773 Author: Vivek Dasmohapatra Date: 2011-03-01 16:31:21 +0000 update LIBS for gtk-doc scanner commit d5d40f83aa1e92cc374b3483259516187997f79f Author: Vivek Dasmohapatra Date: 2011-03-01 16:31:05 +0000 update LDADD for mission-control-5 commit bb9e6d06935400dbe599a158cf1d4a6122f5bcc2 Author: Vivek Dasmohapatra Date: 2011-03-01 16:30:44 +0000 update LDADD for mc-tool commit 28581cc816dd6082916db86d68200a439d64934a Merge: 6933fb3 4e69bef Author: Will Thompson Date: 2011-03-01 15:45:33 +0000 Merge branch 'misc' Reviewed-by: Marco Barisione commit 4e69beff3dd97487a6aff5b934a09c5123b82f22 Author: Will Thompson Date: 2011-03-01 15:13:04 +0000 mc-tool: remove support for þe olde profiles commit 41dec7ea5438f44068318fb4c69f28e5a13fa241 Author: Will Thompson Date: 2011-02-24 17:56:35 +0000 Be more robust against cataclysmic test failures Previously, if MC never claimed its bus names (because it was crashing on startup, for instance), the exception in the test initialization code wasn't caught. This means nothing would ever quit the Twisted mainloop, and the (failed) test would sit there forever. This patch ensures that the test exits uncleanly if this happens. commit 6933fb3526029c61c3078177f8bc3cd3bb9e0358 Author: Vivek Dasmohapatra Date: 2011-02-24 20:10:17 +0000 Checking the wrong struct member before clearing - spurious g_critical commit 07bc3de779b128a3d3071724542ef1b9b450dfbf Merge: a7a97dc 5339401 Author: Vivek Dasmohapatra Date: 2011-02-24 14:27:57 +0000 Merge tag 'telepathy-mission-control-5.7.4' of git+ssh://git.collabora.co.uk/git/telepathy-mission-control into telepathy-mission-control-5.7 commit 8fa0deffe7d07e2ffb1a19125f2a166c2d5830fc Author: Will Thompson Date: 2011-02-24 14:13:08 +0000 Bump to 5.7.4+ commit 5339401da8010e205f6688eb1bb74bdf4355fffc Author: Will Thompson Date: 2011-02-23 23:29:41 +0000 Version 5.7.4 commit b33885b5c94e0f6fc7c3773cc295747709ca61cf Author: Will Thompson Date: 2011-02-23 23:32:56 +0000 Update telepathy.am to moan about gtk-doc. commit aa0797f88ca2662d39e865bd85f72b73a891a077 Merge: bb001a6 c3be05c Author: Will Thompson Date: 2011-02-23 23:28:42 +0000 Merge branch 'external-password-storage-34416' Signed-off-by: Will Thompson Fixes: commit c3be05c7c44f0645ff919f6832dc1f744c4b6c8b Author: Will Thompson Date: 2011-02-23 23:04:38 +0000 Depend on telepathy-glib 0.13.14. We need this for emitting and connecting to PropertiesChanged commit 84aa24868fb5b2fac5d683116006950667dead51 Author: Will Thompson Date: 2011-02-23 22:46:55 +0000 Preserve deleted account while calling Identify When an account is deleted, we'd expect that the McdAccount object will die shortly afterwards. However, we need to ensure that RemoveAccount is called on connection managers that implement AccountStorage. Previously, the account object was used as the weak_object for the callback to IdentifyAccount; this could mean that the callback would never fire, and thus we'd never get around to calling RemoveAccount. So this patch holds a reference for that callback. commit 78221c62bf02313e76947d3f6872de7e4322a548 Author: Danielle Madeley Date: 2011-02-23 16:47:45 +1100 Emit PropertiesChanged for PasswordSaved signal commit 42c90a1d3e230919c10dda20d7d5fdf5e58074cd Author: Danielle Madeley Date: 2011-02-23 16:40:59 +1100 Implement PasswordSaved commit 6eb2ab4e6c23c828db78d0c8d1dd933aa0baea87 Author: Danielle Madeley Date: 2011-02-23 15:47:46 +1100 Call CM.I.AS.RemoveAccount() when the account is deleted commit 54fa2a2190c7f8f57d12e63f488e4f425380866b Author: Danielle Madeley Date: 2011-02-22 15:22:46 +1100 Implement ForgetPassword() commit acbf3a967441f1202fb4fa15858ad6a4e71baf04 Author: Danielle Madeley Date: 2011-02-22 15:22:24 +1100 Build client bindings for CM.I.AS commit 2e0e96d8a183cb0d18cf2754b94e91751f89d518 Author: Danielle Madeley Date: 2011-02-22 13:56:44 +1100 Hook up skeleton Acct.I.EPS in McdAccount Currently activates the interface when the CM.I.AS is present on the CM. Needs the methods and properties implemented. commit 696c6f6ae82cb478247b9921b28a5e3b17579cbf Author: Danielle Madeley Date: 2011-02-22 13:56:05 +1100 Add CM.I.AccountStorage.DRAFT from tp-spec commit 711ab5b25fe5d9108802cdc52ff02fcf8cf3f05f Author: Danielle Madeley Date: 2011-02-22 13:41:58 +1100 Add Acct.I.ExternalPasswordStorage.DRAFT from tp-spec commit 7365dde12d91eade4039fdb28cb79c3e3e14dfa4 Author: Danielle Madeley Date: 2011-02-22 13:36:29 +1100 Make it possible to optionally implement interfaces on a MC object Defining an interface as MCD_IMPLEMENT_OPTIONAL_IFACE() indicates it should not be included in an object's Interface property by default. Instead the interface is activated by calling mcd_dbus_activate_optional_interface() on an individual object instance. This makes it possible to implement interfaces such as Acct.I.ExternalPasswordStorage only on accounts whose Connection Manager supports it. commit bb001a6497ec414594ad5221eaad42a015a478b2 Author: Will Thompson Date: 2011-02-21 19:13:07 +0000 check_one_parameter_unset: fix conditional's indentation commit 9c8d9765ec0af9f82dbece22b4729a25bb8f320f Author: Will Thompson Date: 2011-02-21 17:25:43 +0000 UpdateParameters(): allow unsetting nonexistant parameters I missed the spec's decree that literally anything be permitted in the list of parameters to unset, and since there was no test for this nuance I made it regress. Here's a fix and a test. Reviewed-by: Nicolas Dufresne commit a11e1d23c3a292aba89ad8f7863bf3a5d2c14933 Author: Will Thompson Date: 2011-02-21 17:16:12 +0000 Here is some news. commit a4ca0e65fc908d499ff14582477fc9a99e65eda1 Merge: 5df9ab2 718d297 Author: Will Thompson Date: 2011-02-21 16:14:17 +0000 Merge branch 'fd.o-34316-UpdateParameters-fixes' Reviewed-by: Danielle Madeley commit 718d297eabac88364ffc35ad076987b564dd5ef1 Author: Will Thompson Date: 2011-02-21 15:52:12 +0000 UpdateParameters(): clarify releasing memory. On fd.o#34316, Danni sez: > It might be nice to have goto finally; and then error: then finally: > so that all the memory is released in one location -- since my first > question was whether or not the error path free'd @protocol. She's right, it's not clear. Nicolas suggested this even clearer implementation. (It would be even even clearer and shorter if this function returned a value rather than calling a callback (synchronously), but oh well.) Reviewed-by: Nicolas Dufresne commit 63c636e2f5f3149c792ce048e380a0ee9f376c22 Author: Will Thompson Date: 2011-02-18 17:30:59 +0000 Update copyright for files touched by this branch commit 0774476cae8f4f0336dc6913307b3d66871e58c9 Author: Will Thompson Date: 2011-02-18 17:23:28 +0000 UpdateParameters: break apart check_parameter_update() I had thought that the logic for setting and clearing parameters was similar enough that combining them would be a net win, but it seems that that was not the case. This patch rearranges check_one_parameter() check_parameter_update() into check_one_parameter_update() for parameter updates, and check_one_parameter_unset() for unset parameters. There is a little duplication, but these are much easier to follow. Dear reviewer, I'm sorry for the many false starts in this branch. I did try to rebase them out of existence, but… commit 5961487b0ec321b72e58ab9823ccd6f0a0097c95 Author: Will Thompson Date: 2011-02-18 16:42:52 +0000 UpdateParameters: check for setting parameters to their default A few patches ago, we made MC smarter about unsetting parameters which have default values. Here, we make the symmetrical case work: explicitly setting a previously-unset parameter to its default value should not need a reconnect to take effect. I really don't like how complicated check_parameter_update() has become, but this does actually seem to need to be this complicated to get every case right. Perhaps check_one_parameter() should be split into 'set' and 'unset' cases. commit 43523d6c224129aaeb64f55ceed3c6719c3e2919 Author: Will Thompson Date: 2011-02-18 14:33:40 +0000 UpdateParameters: consolidate post-validation code commit bb8a5fdfc607f4d01688884dcd3886fa004cb61b Author: Will Thompson Date: 2011-02-18 13:38:38 +0000 UpdateParameters: clean up freeing Not_Yet array commit 6173858addc6fa15072776e780298779972cfa2c Author: Will Thompson Date: 2011-02-18 12:58:49 +0000 UpdateParameters: apply Unset parameters immediately, if possible. If a parameter in the Unset list was previously set to its default value, there's no need to reconnect to apply the change. Also, if its default value is different, but it's got the DBus_Property flag, we can apply it to the running connection. Distressingly, fixing this does not actually make this code much simpler. Fixes: commit 0120affac05efd57f5eca2582a925df3ccec3f46 Author: Will Thompson Date: 2011-02-18 11:17:33 +0000 UpdateParameters: keep a{sv} of DBus_Property parameters This will make it easier to support unsetting DBus_Property parameters with the Has_Default flag. commit c4a4b83959e537a66ca0845e73136d7985e5f29e Author: Will Thompson Date: 2011-02-18 10:18:57 +0000 UpdateParameters: Extract checking params to a function commit 192c653f1df8a44a18d3c03895009592dc5ab904 Author: Will Thompson Date: 2011-02-17 19:02:42 +0000 UpdateParameters: expunge SetParametersData completely. I left some FIXMEs in for places which leak (not a regression!) or don't leak but look like they do. Clean-up comes next... commit af017acef7b4e4a296aa4b1ab3464d040626b75f Author: Will Thompson Date: 2011-02-17 18:47:14 +0000 UpdateParameters: move things out of SetParametersData This struct makes it much harder to see which functions actually use which data, and I think we leak some of it on some code paths. So I'm gonna get rid of it, piece by piece. commit 152022957ddf4b5bfdfbbd778e84f03b2522db88 Author: Will Thompson Date: 2011-02-17 18:27:01 +0000 UpdateParameters: Use a GQueue for DBus_Properties list I'm a GQueue addict, I know. commit 079546c39ca0d994320d415ca6f694afbf693e99 Author: Will Thompson Date: 2011-02-17 17:59:01 +0000 _mcd_account_set_parameters: remove stray 'return' commit 42c9023fd739142cd19500b7fa95e20f1bf85169 Author: Will Thompson Date: 2011-02-17 17:54:56 +0000 Test UpdateParameters with invalid parameters commit be6c320406c5574bfb58dc735d2885892539df6e Author: Will Thompson Date: 2011-02-17 17:39:50 +0000 UpdateParameters: linearize setting and unsetting params I love continuation passing style as much as the next guy, but this doesn't add anything. commit e91e385dfb4578ba93d19648536eecd2e7a3a0fe Author: Vivek Dasmohapatra Date: 2011-02-16 15:26:51 +0000 Delete the account stats interface, we don't need it any more commit 5df9ab23a8489a0ccd9e8563a4388c54cc677078 Author: Guillaume Desmottes Date: 2011-01-20 14:28:29 +0100 add redispatch-channels.py testing RedispatchChannels() commit bffe11ea92d8910c689f80a365f4343b5f52cab8 Author: Guillaume Desmottes Date: 2011-01-20 14:28:07 +0100 implement ChannelDispatcher.RedispatchChannels() (fdo #33271) commit 3124576fa649683e61718329d0c5ab3277405db3 Author: Guillaume Desmottes Date: 2011-01-20 14:27:36 +0100 expose mcd_connection_find_channel_by_path() commit 79b67507da3abec9a493f1f5780e2ab1535cfe30 Author: Guillaume Desmottes Date: 2011-01-20 12:18:48 +0100 factor out check_preferred_handler() commit 8c76ddb3661c73855a43f67da4eb023c2edbad23 Author: Guillaume Desmottes Date: 2011-01-19 14:49:40 +0100 generate ChannelDispatcher.Redispatch_Channels has a DRAFT commit c5e7ddbc3866fae72bf7a41ffe90fa0787862f13 Author: Guillaume Desmottes Date: 2011-01-20 10:01:53 +0100 mctest: silence the queue if we hit an error This a backport of the Gabble commit ee177cfb2a13a8374e2f1037e806b7bc58aa708b commit 1f7e0162173a0db91f7bda37eef45de84279cad9 Author: Vivek Dasmohapatra Date: 2011-02-15 16:02:53 +0000 version 5.7.3+ commit 0b7bd4c8bbddd39b72d27423add2ba3adbacab58 Author: Vivek Dasmohapatra Date: 2011-02-15 16:02:15 +0000 'UNRELEASED' checks activated commit a7a97dc694bb41922f0ce7e38291a7582f7ed373 Merge: 4cca7b6 181b72b Author: Vivek Dasmohapatra Date: 2011-02-15 15:24:06 +0000 Merge HEAD, branch 'master' into telepathy-mission-control-5.7 commit 181b72b62e7c908268d09ae7ed8388c820e28d04 Author: Vivek Dasmohapatra Date: 2011-02-15 15:00:34 +0000 Prepare version 5.7.3 commit 9b5e028ed37d3b7ed6d95ffb02d1a9661ef12564 Author: Vivek Dasmohapatra Date: 2011-02-15 14:51:14 +0000 Update copyright notices, prefer AUTHORS to per-file Contact: entries commit c0d77221030db1c2959a5f4427d5e1471c1c1a45 Author: Vivek Dasmohapatra Date: 2011-02-11 14:53:43 +0000 Clear the emergency data (and emit a critical warning) when setting They should always be empty when they are set, but cope if they aren't commit 3ce692fb7a14eab86021de9b3fa8cf06055dec1a Author: Vivek Dasmohapatra Date: 2011-02-08 14:52:04 +0000 Use predefined dbus property constants instead of rolling our own. commit a3bf09f24da81e0a2e894c91f23b8bd753cfb881 Author: Vivek Dasmohapatra Date: 2011-02-08 14:40:15 +0000 Missing call to clear the emergency data in parse_services_list commit 5a78285c5134bb37585a4775388fadabd1693ebe Author: Vivek Dasmohapatra Date: 2011-02-08 14:19:16 +0000 Rename _set_emergency_* to _take_emergency_* to indicate change of ownership commit 9d501e530d92ab5b39745fbe7c7eafd51c43b946 Author: Vivek Dasmohapatra Date: 2011-02-08 14:07:37 +0000 Change asserts in emergency data helpers to warnings commit 73d357732aa4088ff3c9a648d8c054b51a5208f3 Author: Vivek Dasmohapatra Date: 2011-02-08 14:04:10 +0000 Added emergency number helper functions should follow same style as file commit 28ee310ee78e09efea8c47d9085f8f4791729410 Author: Vivek Dasmohapatra Date: 2011-02-03 20:06:02 +0000 Bypass request policy delays for urgent channel requests commit 87c96d3ea28780955ab78f9feb74c527cc709e40 Author: Vivek Dasmohapatra Date: 2011-02-03 20:05:09 +0000 Cache the request policy plugins the first time we need them commit 12cb4e4be79067edb7013683856936de45424a8a Author: Vivek Dasmohapatra Date: 2011-01-28 04:43:12 +0000 Use service point data to check if a connection is urgent (eg an emergency call) commit 1906a3c4228bc7182a89058ef71468612998cfb2 Author: Vivek Dasmohapatra Date: 2011-01-28 04:37:32 +0000 Start watching a connection for service point data the first time it becomes connected commit 0f7484069b3cda5a362353067b0f46fd74a47ee9 Author: Vivek Dasmohapatra Date: 2011-01-28 04:35:49 +0000 Support watching for service point/emergency data and updating the connection commit bcd72e3363d246adc0b9c50e963813c4a0b7b9e0 Author: Vivek Dasmohapatra Date: 2011-01-28 04:30:53 +0000 Helper function to set emergency handles data commit c03b89519ab8522f6c457290e6512d0a88a87025 Author: Vivek Dasmohapatra Date: 2011-01-28 04:30:06 +0000 Helper function to set emergency number data commit 9e9e3b49987778d7ed3df9757ca302c75cac2d22 Author: Vivek Dasmohapatra Date: 2011-01-28 04:29:16 +0000 helper function to clear current emergency number/handle data commit e42743b23c38e309c0c2f0c53b610bd596643b2b Author: Vivek Dasmohapatra Date: 2011-01-28 04:28:02 +0000 Add struct entries to hold emergeny number (service point) data and state commit 485607b16534ed9ea9b9bd643cbbf9fff2672557 Author: Vivek Dasmohapatra Date: 2011-02-14 19:02:45 +0000 Update libtelepathy-glib0 dependency for debug_sender updates commit 3321165f24740d0d2b5947e3353fc78ddc4e85ab Author: Vivek Dasmohapatra Date: 2011-02-14 17:53:11 +0000 Be parsimonious with printf ops in the mcd_debug path. commit 52d53425d4dfb2c65ec4e640c42004318f19074f Author: Marco Barisione Date: 2011-01-28 14:56:39 +0000 McdAccountManager: don't leak if mcd_master_get_default() returns NULL Fixes: commit 0d69567e4d0d94e6018c10f528b177195c75b958 Author: Marco Barisione Date: 2011-01-27 19:02:27 +0000 Aegis plugin: fix a leak of DBus proxies Fixes: commit fa4de0d15ea4f2184e76f935ff79708fcee11eb4 Author: Vivek Dasmohapatra Date: 2011-01-19 17:55:24 +0000 version 5.7.2+ commit 4cca7b6ebb02353a0066a9180e9521724d0e0a8c Author: Vivek Dasmohapatra Date: 2011-01-19 15:27:55 +0000 Merge HEAD, branch 'master' into telepathy-mission-control-5.7 commit 833f5e87182e5053381bdd1502fe93b49c4cd347 Author: Vivek Dasmohapatra Date: 2011-01-19 15:10:38 +0000 Prepare version 5.7.2 commit c6114d74c265e77944968c46dd7afd0b09839ef7 Author: Vivek Dasmohapatra Date: 2011-01-19 15:10:21 +0000 Tests using the debug API must be in the special section to work in distcheck commit df58b39efd5db4c8cf2ad85a75377fde48191439 Merge: b7b9ffc 730dceb Author: Vivek Dasmohapatra Date: 2011-01-18 16:54:29 +0000 Merge branch 'hidden-for-accounts-glib' of git+ssh://git.collabora.co.uk/git/user/wjt/telepathy-mission-control-wjt commit b7b9ffc40cd0feadb37d735af97232355d4472dc Author: Vivek Dasmohapatra Date: 2011-01-11 18:54:31 +0000 Explanation of map had drifted away from same (in terms of location & accuracy) Updated text to reflect what's actualy going on now, relocated it so it is next to the structure it explains. commit 90f793ae18e049aa93d1cd0a1afc6154ec19ac5c Author: Vivek Dasmohapatra Date: 2011-01-11 18:01:05 +0000 Commit delay now #defined and logged explicitly commit f698e3371d4dd5fd3922f26c4217d71fd4315ad4 Author: Vivek Dasmohapatra Date: 2011-01-11 18:00:09 +0000 Add comment explaining _commit, remove obsolete FIXME comment commit d40546d1c6aa6cceae3330e614d95f67492681b2 Author: Eitan Isaacson Date: 2011-01-01 19:12:10 -0800 Delay actual commit() in sso backend. commit 730dcebb085d9fc3be97a8a9a240c5f23983de2e Author: Will Thompson Date: 2011-01-11 16:47:01 +0000 Set a plugin name and description for ag hidden backend commit a4115f4dc452905c4cfdfbbc5b1b989f79558080 Author: Will Thompson Date: 2011-01-11 16:22:38 +0000 Add a configure flag for hidden accounts-glib backend This is a pretty niche use case; it's not worth building it unless explicitly requested. commit 744fdc63357fe815c1894a9cd5cfafe75791bfb3 Author: Will Thompson Date: 2011-01-08 15:22:30 +0000 Set Hidden on accounts from hidden accounts-glib backend commit e929ec07702c77dc00e2e8962ea8e4865d33cc9d Author: Will Thompson Date: 2011-01-11 10:44:27 +0000 mc-tool: show Service (if present) Reviewed-by: Guillaume Desmottes commit 22f6152262224c5868e24c00200e6af9df4fc5d0 Author: Will Thompson Date: 2011-01-07 20:05:58 +0000 Add an accounts-glib backend for hidden accounts. Currently this doesn't hide accounts; it just looks for accounts of a different service type. But hey, this is a start. commit dc3b9deaf8a6f46e40297af555be40cfcee706ba Author: Will Thompson Date: 2011-01-10 18:56:34 +0000 account-glib: Remove spurious newlines in DEBUG messages commit 0363a3de3c94a78f5ed9e8df20ca28f05324d5f3 Author: Will Thompson Date: 2011-01-08 22:18:38 +0000 accounts-glib: remove unused list of services. This was used in an earlier incarnation of this backend, but now is just leaked. commit 60e1c9fe201e0ddca8bb0881f7cdd00bc8f753f6 Author: Will Thompson Date: 2011-01-08 14:58:19 +0000 accounts-glib: expose _get implemenation for subclasses This is only needed because McpAccountStorageIface is hidden. See . This is a workaround for now. commit 3373220c555262955684732e02716e688ccfd3b6 Author: Will Thompson Date: 2011-01-07 21:49:08 +0000 accounts-glib: split up gargantuan _get implementation commit 43555b2311992a2668441c87f98c20411c34a02f Author: Will Thompson Date: 2011-01-07 20:03:18 +0000 Clean up loading account storage plugins. The duplication of g_list_insert_sorted() was getting me down. commit 2858bbac87eeaa96814996ead4cc64db3b75c4b8 Author: Will Thompson Date: 2011-01-07 19:57:32 +0000 Correct MCD_ACCOUNT_MANAGER_SSO_CLASS() macro commit 508c59b67c7a19cb32108dc562ad9b16b52264a8 Author: Will Thompson Date: 2011-01-07 19:18:06 +0000 accounts-glib: make service type parametrizable Rather than hard-coding the "IM" string everywhere, we now call a private method which looks up the accounts-glib service type from a field in the class structure. The default implementation is of course "IM", but this will allow a subclass which looks for a different type of accounts. commit 88df5c5e996b6886d3854a2c643d1f288e2f4f4d Author: Will Thompson Date: 2011-01-07 18:55:45 +0000 accounts-glib: List services in constructed, not init I'm about to replace the hard-coded AG_SERVICE constant with a field in the class (so that a subclass can look for other services and set Hidden to True for those accounts). However, as we discovered way back in f7b7aa8e477abe03c1340c2b200ddcf9c9792c2c, when _init runs for class T, G_OBJECT_TYPE() always returns T even if we're constructing a subclass. So we're going to need to wait until constructed() to get at the desired service name. commit 972883acdc5f11e247b807477199fd5cf029d4b4 Author: Will Thompson Date: 2011-01-07 17:58:49 +0000 accounts-glib: declutter class_init commit 425a2bb4aa78a3184239e4b7e2d9f32c7ea7f9db Author: Will Thompson Date: 2011-01-07 16:12:15 +0000 accounts-glib: make null termination clearer commit 9799ff9a74700115f8eb3c7bd08f71e0b0440971 Author: Will Thompson Date: 2010-12-31 00:34:55 +0000 Add a smoke test for Account[Manager].I.Hidden This doesn't really test all that much, but it's better than nothing. commit 183be5735a3f15c2543a0059e234a8c386c49427 Author: Will Thompson Date: 2010-12-31 00:32:39 +0000 Implement AccountManager.Interface.Hidden commit c2ffc90b046a03942bc137db6b0f33d117763060 Author: Will Thompson Date: 2010-12-30 22:39:47 +0000 Implement Account.Interface.Hidden commit 02e3aed21485b375fda2d1c632074592b13263a8 Author: Will Thompson Date: 2010-12-01 19:47:01 +0000 Generate code for hidden account interfaces. commit 8e011b287da8f1b2319c8c947f636e87fda9f5c7 Author: Will Thompson Date: 2011-01-07 14:34:58 +0000 mctest: improve error messages from post-test cleanup commit 1eac316750a070612a24249063ba992602acd03a Author: Will Thompson Date: 2011-01-07 15:31:03 +0000 AM: Remove a stray paren from a debug message commit f5cef05a9d4b76c78045dcb6642964939e063698 Author: Will Thompson Date: 2011-01-06 19:07:05 +0000 tests: extract common mc-slaying and keyfile-reading code commit 4c99fea93bcc5a29f642fefad6b32329877117a5 Author: Will Thompson Date: 2011-01-06 17:23:47 +0000 mctest: tidy up create_fakecm_account() I think it needs a better docstring: I keep forgetting what it returns. Plus it's full of unnecessary comments and no-op code. So let's tidy it up a bit. commit e90cfdcf5f8991457f631cecef227e0b0ae0af21 Author: Will Thompson Date: 2011-01-06 16:32:57 +0000 mctest: support passing properties to create_fakecm_account() commit 081fdd53678d5579f90c1f5d753274284b439063 Author: Will Thompson Date: 2011-01-10 19:03:33 +0000 account_check_parameters: assert callback is non-NULL This function was already actually assuming this in two of the three places it calls the callback, so let's assume it properly. commit 4c79dba8a2fbdceb5460a6b124ca9a7790fa7731 Author: Will Thompson Date: 2011-01-10 18:56:45 +0000 Log why we're declaring accounts invalid. If the CM is flat-out missing, then we get debug output to that effect. But in the cases where the CM exists but lacks the relevant protocol, or the account is missing required parameters, no useful information was given. commit 12be4b8cfc2f4fc9a46a03a3c3a1149f089cbab6 Author: Will Thompson Date: 2011-01-06 11:11:26 +0000 Preliminary news for 5.7.2 commit 50454504ed1036f383deebeafd4b675da741f75f Merge: 4e08c42 b30dfb1 Author: Will Thompson Date: 2011-01-06 11:04:05 +0000 Merge branch 'misc' Reviewed-by: Jonny Lamb commit b30dfb18026448d25c699ba77a484c0ab11e6451 Author: Will Thompson Date: 2011-01-05 18:06:39 +0000 Simplify mcd_account_set_string_val() Hey, there's already a function that sets a string and returns TRUE or FALSE depending on whether or not it's actually changed. commit db50713152f6154b0a42c3f8ef23e25ff73987d7 Author: Will Thompson Date: 2011-01-05 17:40:47 +0000 Storage: allow backends to implement only one of commit/commit_one This mostly reverts 0d914e13cc4a6e84cebb840c0be4d32abaacaddc, except that it preserves the fix for the bug which could cause a NULL ->commit implementation to be called. I do not believe this interdependency is “irrational”: it reduces the boilerplate that backend implementations need. Plus, this makes the implementation match the documentation again. This also improves the debugging messages logged by mcp_account_storage_commit() and mcp_account_storage_commit_all(). Fixes: commit 53d38f675dd389f6d04fff5855094362c7e49aac Author: Will Thompson Date: 2011-01-05 17:27:20 +0000 Account: ensure updated string properties are committed. Properties whose setters were implemented using mcd_account_set_string_val() were actually not committed to disk unless/until some later property whose implementation is correct was updated. I noticed this in passing, not while checking out any particular bug. However, I think it may be responsible for the issue where people's aliases are re-set to their JID for no apparent reason. I don't really have any evidence to back this up. I did tweak one of the storage tests to expose this bug, though. I've checked a whole bunch of other properties, and I think the ones not implemented using mcd_account_set_string_val() were all already okay. commit d80eb01daa3fda0b3153a8ab1fa382c0dc6fd38b Author: Will Thompson Date: 2010-12-31 00:54:49 +0000 Accounts-GLib backend: fix shadowing warnings acct() is a function defined in unistd.h, which something winds up including in this file. Sometimes 'acct' was an AgAccount, and other times it was the "cm/protocol/foo" identifier. I changed the former to 'account' and the latter to 'account_suffix' where needed, as a first step towards coherency. commit e01643fdc290a668e5a532da7f8eccd9bf0856ca Author: Will Thompson Date: 2010-12-30 23:47:02 +0000 tests: improve assertion when forbidden events occur This makes the backtraces prettier; it doesn't have any functional effect. commit 2730cf23367fb0d2198b402c2bf4cb98a82cef42 Author: Will Thompson Date: 2010-12-30 23:36:37 +0000 Tests: handle more exceptions during cleanup Previously, if a non-DBusException was thrown while the test harness deletes any accounts left kicking around, the reactor would just hang; killing it would make Automake think the test passed! This does a better job. commit 4371e5e46ebd8d6537c9d6ba5106ee8bc703c1b8 Author: Jonny Lamb Date: 2011-01-04 11:22:48 +0000 mcd-dispatch-operation: explicitly cancel calling approvers instead of accidentally Previously, the "run approvers in an idle" function would be called when an observer returned even if he or she called HandleWith{,Time}. The idle function would set invoked_approvers_if_needed to TRUE and try and run the approvers if needed, followed by checking the client locks again. This made non-interactive approvers implemented as delaying observers work because it wouldn't actually call ADO on approvers due to mcd_dispatch_operation_is_approved returning TRUE, but this way makes the process a little more clear to understand. Signed-off-by: Jonny Lamb commit 36eeb9164dbb631c35efb1405bc6efb1c23c5e77 Author: Jonny Lamb Date: 2011-01-04 10:16:33 +0000 delay-then-call-handle-with.py: add test This test creates an observer and approver/handler. The observer has DelayApprovers=TRUE. The test makes sure that AddDispatchOperation is never called on the approver when the observer steals the CDO and calls HandleWith. Signed-off-by: Jonny Lamb commit bb5ea0cb107b80933d886e17059f9662058db2d0 Author: Jonny Lamb Date: 2011-01-03 15:27:35 +0000 delay-then-dont-call-approvers.py: test non-interactive approvers Signed-off-by: Jonny Lamb commit 8ef108d09cba245f71cdb6dc2a18cfc4ed2d7025 Author: Jonny Lamb Date: 2011-01-03 15:25:08 +0000 mcd-dispatch-operation: stop calling ADO if a delaying observer called Claim Previously, the Claim call would be handled as usual, but an idle was already added to call ADO so when it was reached it asserted as the dispatch operation had finished. Signed-off-by: Jonny Lamb commit ec6666d0b0edd70644498773f2cfa83ee21d57d9 Author: Will Thompson Date: 2010-12-24 17:37:15 +0000 tests: simplify holding the name for fakecm commit 48b13f6fc212b50118a7672b196b14b2bd96298f Author: Will Thompson Date: 2010-12-24 16:03:15 +0000 mctest: use ProxyWrapper for Account/AM proxies ProxyWrapper's a nice class that deals better with multiple interfaces on a remote object than bare python-dbus proxies do. So this reduces some of the boilerplate in mctest. I didn't go around changing all the tests to use this, because life is too short. commit 4e08c42659381c315feda5f3ba7250925c499869 Author: Jonny Lamb Date: 2010-12-22 16:10:40 +0000 tests: add a tests/README symlink I always get confused as to how to run the tests as I look for a tests/README and it's not there. Signed-off-by: Jonny Lamb commit 5b34520e25c014377a27f22d35b958ded994a2dd Author: Jonny Lamb Date: 2010-12-22 15:54:58 +0000 tests: move from test/ to tests/ So so annoying. Signed-off-by: Jonny Lamb commit 1d9f17613ac2ce1dc3928ab0848d7b9b987b6330 Author: Will Thompson Date: 2010-12-22 11:04:25 +0000 create-with-properties: remove unsound signal expectation When this test creates a new account, it expects four events to occur: • A.AccountPropertyChanged, to say the new account is valid; • AM.AccountValidityChanged, to say the new account is valid; • CreateAccount returning successfully; • RequestConnection on the fake CM, because ConnectAutomatically was set to True and RequestedPresence was set to non-offline in CreateAccount. However, if the account's not yet been announced by AccountValidityChanged, MC has no reason to emit AccountPropertyChanged on it. It happens that, in some cases, it does; but this depends on whether or not MC has already introspected the fake CM by the time the account is created. So the test is wrong to expect AccountPropertyChanged. Instead, we check that Account.Valid is in sync with what AccountValidityChanged said. This fixes an issue where this test would only pass if it was run after account-manager/create-twice, but not if it was run individually. commit 9ad89fea078ea23178a99608fc18b753bd6f2005 Author: Will Thompson Date: 2010-12-22 11:01:31 +0000 create-twice.py: use a different 'account' parameter This test runs right before a test which passed or failed depending on whether this test was run. The logs were made much harder to read by them both creating accounts with very similar names. commit 4afb8eb6314395eae3e3c4a905062183c2dcc090 Author: Guillaume Desmottes Date: 2010-12-22 10:14:40 +0100 stop generating Hints interfaces commit c2f15753fd5d3f874f4ef2d06c43bdcfeb0b492e Author: Guillaume Desmottes Date: 2010-12-22 09:59:16 +0100 SucceededWithChannel signal is now stable commit aa56027c9de02c8db28071548f2c96f059ac0fed Author: Guillaume Desmottes Date: 2010-12-22 09:48:28 +0100 ChannelRequest's Hints property is now stable commit 15c262255cbe130ad731358b1182a5e3457d05bd Author: Guillaume Desmottes Date: 2010-12-21 15:41:32 +0100 {Create,Ensure}ChannelWithHints is now stable commit cbffe9b899c1da6e7188685bc3bf5995a49eebce Author: Guillaume Desmottes Date: 2010-12-21 15:36:23 +0100 depends on tp-glib having request hints stable API commit 2401aebf11aaf5cc4478dc80c2b5c958308df5ed Merge: e33f894 7f16c51 Author: Will Thompson Date: 2010-12-21 18:56:39 +0000 Merge branch 'remove-MinimumPresence' Fixes: Reviewed-by: Simon McVittie commit e33f8946ac20e0a85a075e837b6318ac2974829e Merge: 359d1c5 cfe3684 Author: Will Thompson Date: 2010-12-21 18:56:03 +0000 Merge branch 'simplify-getting-parameters' Reviewed-by: Simon McVittie Fixes: commit e2432e19fdab9412209096844b90eb68fcdf0cde Author: Jonny Lamb Date: 2010-12-21 17:45:48 +0000 tests: test having >1 observers where only some of them have DelayApprovers=True Signed-off-by: Jonny Lamb commit 1b7156299d4124f9216d2584f8476244b90f208e Author: Jonny Lamb Date: 2010-12-21 17:45:12 +0000 dispatch-operation: only delay ADO if there exist DelayApprovers=True observers Signed-off-by: Jonny Lamb commit 8cd1e11c37f575e804acf7b3f9a2fe1fddb5805a Author: Jonny Lamb Date: 2010-12-21 17:09:43 +0000 delay-approvers.py: fix typo in comment Signed-off-by: Jonny Lamb commit d43e3a50ace82ad1b4603f6ee08709bd53b7a507 Author: Jonny Lamb Date: 2010-12-21 15:59:30 +0000 tests: add a test for DelayApprovers observers Signed-off-by: Jonny Lamb commit 6d6b34b49171602e9bf47039b991d0376dd2c457 Author: Jonny Lamb Date: 2010-12-21 15:58:22 +0000 mcd-dispatch-operation: don't call ADO if DelayApprover Observers haven't returned Signed-off-by: Jonny Lamb commit 6ef602298271ae2741e6e75245002684fb2ff9a6 Author: Jonny Lamb Date: 2010-12-21 15:56:57 +0000 mcd-client: pick up Observer.DelayApprovers Signed-off-by: Jonny Lamb commit 359d1c553b7135dcceebf5c80d49a81dd3521362 Merge: 4131664 9e4ddfb Author: Jonny Lamb Date: 2010-12-21 14:13:26 +0000 Merge branch 'test-fixes' commit 9e4ddfb989f05fb7a4c6c8f5c435e4319c7abd0d Author: Jonny Lamb Date: 2010-12-21 14:06:42 +0000 create-at-startup: don't expect ObserveChannels calls so close together Now that preparing the connection takes one more step, it can take longer before ObserveChannels is called with the channel that just appeared on connecting, so let's allow that to appear earlier. This only relaxes the test assumptions a little. Although it currently fails on 0.13.9 and this fixes it, it'll still work on tp-glib < 0.13.9. Signed-off-by: Jonny Lamb commit 95e56df4a2a0acc89c86fd85eb25ae0e7cdb603d Author: Jonny Lamb Date: 2010-12-21 13:20:41 +0000 mctest: implement GetContactAttributes and GetAll on Contacts Signed-off-by: Jonny Lamb commit e3e955d792db4328ff026a7c1c48c13dc8028826 Author: Jonny Lamb Date: 2010-12-21 13:20:30 +0000 mctest: implement HoldHandles Signed-off-by: Jonny Lamb commit 41baccd21db1ffc14d694b9d631b3385178894f6 Author: Jonny Lamb Date: 2010-12-21 13:19:56 +0000 mctest: implement GetAll on Connection Signed-off-by: Jonny Lamb commit 7f16c518a48a964f94d6b211bd224e7a29219910 Author: Will Thompson Date: 2010-12-01 18:48:15 +0000 Remove MinimumPresence implementation. I feel kind of bad doing this, but it turned out not to be needed. I think it's better to take dead code out, rather than leaving it kicking around to potentially complicate matters later. commit cfe36847c8afec4277ea042465917fc2d8e9631b Author: Will Thompson Date: 2010-12-03 00:44:44 +0000 McdDBusProp: remove get_async The only property that was implemented in an async fashion was Account.Parameters. Since that's now synchronous, we can bin this code for getting properties asynchronously. commit 94d62e8d68ec1d657b8af36f467b1520703632e5 Author: Will Thompson Date: 2010-12-02 18:21:58 +0000 Make _mcd_account_dup_parameters() synchronous This is a really massive patch, and I'm very sorry. Previously _mcd_account_dup_parameters() took a callback parameter. This was because mcd_account_get_parameter() took a callback parameter. The latter used to actually be asychronous in the gnome-keyring case, but it is not any more, thanks to the harmonious account backend API. So we can remove a *lot* of unnecessary complexity if we make the latter return the parameter's value synchronously, and hence make the former return a GHashTable synchronously. In particular, this means we can make retrieving the Parameters D-Bus property synchronous, which means we can port to TpDBusPropertiesMixin. I did try to split this patch up, but as you, dear reader, will be able to see from what I ended up with, this code was all really entangled with itself. This is the best I could do. commit 8cbdbdb68311f7df76e99b87257d256975fedb5c Author: Will Thompson Date: 2010-12-02 15:19:25 +0000 McdAccount: Remove un-overridden virtual methods No known subclass of McdAccount overrides get_parameter, set_parameter, delete or load these days. People should be, and are, using the new pluggable storage backends API. So it's safe to remove these methods from the vtable. This will simplify refactoring their (default) implementations. commit 08ba772275f1d5d87041e665afdad3216bf81df7 Author: Will Thompson Date: 2010-12-15 14:35:02 +0000 Account.Service: remove unnecessary explicit fallback. dbus-glib treats a GValue containing a NULL string as equivalent to a GValue containing "", at least in this context. Many other properties rely on this behaviour; so let's just rely on it here too. commit 8bd702c5c15afc24e4ab64847650a512fac37858 Author: Will Thompson Date: 2010-12-15 16:51:14 +0000 Tests: correct name of Conditions.Condition property The property's actually called Condition, not Conditions. But because McdDBusProp returns the same error for “unknown property” and “wrong type”, the test passed. commit f4b1a6175634948e376bf9047d88d81d5b2b2fa4 Author: Will Thompson Date: 2010-12-01 19:36:27 +0000 Remove redundant object path/bus name constants. These have been in tp-glib approximately forever. commit baeaade204481e7bd400d419ebc2ccb2084c5fed Author: Will Thompson Date: 2010-12-01 19:19:47 +0000 Remove long-obsolete mcd-presence-frame.h commit 413166490899fa583a8193197e2b62310a3e5d37 Author: Simon McVittie Date: 2010-12-10 17:39:47 +0000 Update telepathy.am from telepathy-glib commit cdb289c8d0f9cb96d90e287d526d408590b9e145 Author: Will Thompson Date: 2010-12-07 17:14:32 +0000 Start 5.7.2 development commit 52840f8f8aa13f1d91fe5eaad93cf888e52c1497 Author: Vivek Dasmohapatra Date: 2010-12-06 18:55:50 +0000 Prepare version 5.7.1 commit 3a320720d744f6a0d61bc0ae8bc95b5a52bb7a04 Merge: b4bafff 2472223 Author: Vivek Dasmohapatra Date: 2010-12-06 17:14:46 +0000 Merge branch 'master' of git+ssh://git.collabora.co.uk/git/telepathy-mission-control commit 24722235b4a0cf6ebca4a08980afa6514de03c05 Merge: 1164508 3a63c47 Author: Will Thompson Date: 2010-12-01 19:01:04 +0000 Merge branch 'telepathy-mission-control-5.6' commit 3a63c47fa84a7a3d20e2274cd8c8c94771c02736 Author: Will Thompson Date: 2010-12-01 19:00:50 +0000 NEWS for fd.o #24779. commit fc8258409337a777b5249d37df5bc6b88573165c Merge: 4a2f68a 438826e Author: Will Thompson Date: 2010-12-01 18:59:57 +0000 Merge branch 'fd.o-24779-CurrentPresence-incorrect' into telepathy-mission-control-5.6 Fixes: Reviewed-by: Simon McVittie commit 1164508b9633b352440c880ccccda20f904adf3c Author: Will Thompson Date: 2010-11-30 18:05:29 +0000 mc-tool: Improve error message for nonexistant accounts. Reviewed-by: Simon McVittie commit b4bafff4c224fc66c592be844ea9daeba2b4334c Author: Vivek Dasmohapatra Date: 2010-11-19 17:25:35 +0000 Undo the telepathy to mission control error mapping special case: It's Obsolete commit 7a7837cf62c9350e3a1b6cc714b15acee6d67363 Merge: 555cb06 4d21b5f Author: Vivek Dasmohapatra Date: 2010-11-19 17:17:08 +0000 Merge branch 'master' of git+ssh://git.collabora.co.uk/git/telepathy-mission-control commit 555cb06119523427c5814bc6e13bcbea2e7011f7 Author: Vivek Dasmohapatra Date: 2010-11-19 17:06:02 +0000 Nano version commit 4d21b5f58a8ce6f5ec4685ec298548c9b83ba37b Author: Simon McVittie Date: 2010-11-19 13:00:55 +0000 Update telepathy.am from tp-glib and add make-release-mail.py Also only ship the changelog since 5.4, which should be plenty. Reviewed-by: Will Thompson commit df17fb16b8c26b255ca6fad5a2f6010520b7a7bd Author: Simon McVittie Date: 2010-11-19 11:15:34 +0000 Start 5.7.1 development commit 77826308a3ca7c92d0e71aff77e99ebb45f88516 Author: Simon McVittie Date: 2010-11-19 11:15:07 +0000 Retroactively add more NEWS commit bf40bc1481782d96d85135c58823a8bf414ef89f Author: Vivek Dasmohapatra Date: 2010-11-18 18:45:35 +0000 Header file no longer exists commit 9fa087c98eb75ec31f71dda787c5661ea3f2110f Author: Vivek Dasmohapatra Date: 2010-11-18 17:40:58 +0000 Prepare for 5.7.0 commit c221ef54e7a3d52f379945304cc2d406dccf1212 Merge: e470073 7a9ee6b Author: Vivek Dasmohapatra Date: 2010-11-18 16:20:17 +0000 Merge branch 'account-interface-addressing' commit 7a9ee6b457755f93e2273b286cbe51f9ed1e0036 Author: Vivek Dasmohapatra Date: 2010-11-18 15:57:39 +0000 mcd-account-addressing.h contains no API, move from mc-headers to *_la_SOURCES commit e47007323c3983ef207a3f2f03b78d858e3395d1 Merge: fdd9048 c57e8e1 Author: Vivek Dasmohapatra Date: 2010-11-18 15:51:45 +0000 Merge branch 'missing-am-account-removed-signal' commit fdd9048df1f385c0ccc431422ab7585078a40ee4 Merge: 93d4f79 98d2148 Author: Vivek Dasmohapatra Date: 2010-11-18 15:51:32 +0000 Merge branch 'keep-calm-but-do-not-carry-on' commit 93d4f79d5d7aac0f80ca53a065c72e9df44e0683 Merge: 37c6ea2 39f8f20 Author: Simon McVittie Date: 2010-11-17 16:01:04 +0000 Merge branch 'hints' Reviewed-by: Guillaume Desmottes commit 39f8f20f74252fccbc4e09f3f66a16a9a8bcf3f6 Author: Simon McVittie Date: 2010-11-17 15:00:16 +0000 Switch from CD.Future, CR.Future to CD.I.Hints, CR.I.Hints from my branch commit 50a6bb2bbd0343d1c8e849e1efcbb964b4dc4545 Author: Simon McVittie Date: 2010-11-17 14:48:37 +0000 src: generate extensions per "class", not per interface, for dispatcher/request commit bc5c448d4c798146322ed5637eab7c31ad5d7025 Author: Simon McVittie Date: 2010-11-17 14:47:47 +0000 mcd-account-requests: remove obsolete inclusion commit 98d2148d313c928f88a5c588bf0fa60041998e97 Author: Vivek Dasmohapatra Date: 2010-11-17 14:07:10 +0000 abort()'s from inside g_error get trapped as core dumps by test suites We get a lot of noise in the form of bug reports as a result of these three because g_error ends in an abort() - we exit(1) anyway, so hopefully downgrading the error to a warning will calm things down. commit 37c6ea25e0dcbfa7ec50a04f3929011d698e8461 Merge: 0e41f32 4a2f68a Author: Simon McVittie Date: 2010-11-17 13:18:39 +0000 Merge branch 'telepathy-mission-control-5.6' Conflicts: NEWS configure.ac commit 4a2f68a1b2c84940b844652566710ca2706cfc63 Author: Simon McVittie Date: 2010-11-17 13:16:59 +0000 Nano version commit c57e8e157c255735c5b1434b278d04919be0b381 Author: Vivek Dasmohapatra Date: 2010-11-17 12:29:15 +0000 Missing AM.AccountRemoved signal when a storage plugin removes an account Only affects the disabled-in-5.6 SSO plugin which is why the tests didn't pick it up. commit 7df3310b088a0187b60c8ba1992ceac4a93026b1 Author: Simon McVittie Date: 2010-11-17 11:45:17 +0000 Version 5.6.1 commit 03937b7ef60e12468e3f661af943edb24ce8eecc Author: Simon McVittie Date: 2010-11-17 10:56:51 +0000 Update NEWS commit 0e41f320e6644951a0a22428cab22f0e4adcd90e Author: Simon McVittie Date: 2010-11-10 14:23:30 +0000 Update PowerSaving to the stable spec that will be in 0.21.5 Reviewed-by: Eitan Isaacson commit cd1886ad0ecfef4bdb3d5c3c7c76f2876a7562a7 Author: Vivek Dasmohapatra Date: 2010-11-10 15:09:41 +0000 Undraft Account.Interface.Addressing commit e89e4769683d51970e17854660592dce06c6de5d Merge: 3cf24b0 01c4a86 Author: Simon McVittie Date: 2010-11-10 14:15:40 +0000 Merge branch 'handler-request-props' Reviewed-by: Guillaume Desmottes Bug: https://bugs.freedesktop.org/show_bug.cgi?id=30000 commit 36112f9e9b9d5be41318ca2e61b37c7e9deb4a1e Author: Vivek Dasmohapatra Date: 2010-11-10 13:53:21 +0000 Unnecessary calls to set() in tests removed commit cac5fb9a3bb460ac4456d2f5322c51af769937ea Author: Vivek Dasmohapatra Date: 2010-11-10 13:50:12 +0000 Spec change: Acccount.I.Addressing method no longer has a return value commit 6919f27a0fcd052c9a2c9061a954f9b055a4fddd Author: Vivek Dasmohapatra Date: 2010-11-05 17:21:57 +0000 Test tidy proposed by wjt (cf gabble tests) commit 7027006f2ec8f559b7e9432d9faf0c7ab644a26e Author: Vivek Dasmohapatra Date: 2010-11-05 17:01:15 +0000 old_association and association are booleans, don't need to cast with !! commit 3cf24b0b4feb57ed42fc1894996e42de7cd87732 Merge: d3a2692 60403c9 Author: Eitan Isaacson Date: 2010-11-03 11:15:31 -0700 Merge branch 'power-save' commit 60403c991191511b1840882a64f629bf12aadbdf Author: Eitan Isaacson Date: 2010-11-03 11:14:29 -0700 Maked device idle test a seperate test. We need the MCE service available from the start. commit b1d9b8d2048d8bbe254c5ad7236c42a8950df169 Author: Eitan Isaacson Date: 2010-11-03 08:59:23 -0700 Report error if inactivity retrieval failed. commit d3a2692288e1494f48cbcb1085f69c4fa799a87d Merge: bdb2572 40834b2 Author: Eitan Isaacson Date: 2010-11-03 08:05:14 -0700 Merge branch 'build-fixes' commit 9ba931f1ded9aadffc6e69000d402424fc25b621 Author: Eitan Isaacson Date: 2010-11-02 22:37:20 -0700 Make device idle test conditional on no native MCE. commit fdc7058497096d15874a466fae35f5670942b029 Author: Eitan Isaacson Date: 2010-11-02 21:27:26 -0700 New device idle power saving test. commit 649a41e1d81ab1f481f33eca1615577e54db2d15 Author: Eitan Isaacson Date: 2010-11-01 11:22:32 -0700 Integrated McdSlacker into McdConnection. commit fc882c78ab5bbf35201048941d13fabc1dff1ae4 Author: Eitan Isaacson Date: 2010-11-01 11:22:32 -0700 Moved GabbleSlacker to MissionControl as McdSlacker. commit 73f5d61f2e9bfd7003c54dc3df28e89f7aa2c7dc Author: Eitan Isaacson Date: 2010-11-01 18:23:49 -0700 Added Conn.I.PowerSaving as extension. commit 40834b2e9281c0fe3273d6a0368ebd132bd6014f Author: Eitan Isaacson Date: 2010-11-01 11:46:35 -0700 Purge Account_Manager_Interface_SSO.* commit 0b9464ee78eb063e1ee8bf7b833a6bd378f1fa90 Author: Vivek Dasmohapatra Date: 2010-10-27 16:18:51 +0100 Use the new AG_SERVICE macro instead of hardiwring "IM" everywhere. commit 1798389710ce878298598c9ffc4b156abc708e00 Author: Vivek Dasmohapatra Date: 2010-10-27 16:18:13 +0100 Register for the IM service type specifically: no wakeups for non-IM changes commit 1b1908504a2127ee4e60ec6a0eda851cc817e48f Author: Will Thompson Date: 2010-10-25 18:34:50 +0100 Simplify SetURISchemeAssociation. commit 28382eae7df8725a69d437a9a6a5f9b64ae581a9 Author: Will Thompson Date: 2010-10-25 18:33:50 +0100 Add mcd_storage_set_strv This is more convenient than requiring callers to box up their strvs manually. commit 2078e4cf3fee9d9dafe60e3403e61d043d9daa86 Author: Vivek Dasmohapatra Date: 2010-10-25 16:34:11 +0100 Silence a warning commit cf6fa689d74aac0a177425e66d64f8a0864a9913 Author: Vivek Dasmohapatra Date: 2010-10-25 16:33:57 +0100 Tests need to use .DRAFT commit 2f059cc44bc6d05730d486a97f9a72c5d1922b49 Author: Vivek Dasmohapatra Date: 2010-10-25 16:33:34 +0100 Sync with spec branch commit 0d7d20201eab3f04d860bbfaaa00dfc36500974d Author: Vivek Dasmohapatra Date: 2010-10-22 17:54:50 +0100 Test the Accounts.I.Addressing interface commit 6edb77db1e8cb11cae196b24ea855580e641e208 Author: Vivek Dasmohapatra Date: 2010-10-22 17:54:50 +0100 Pull Account.I.Addressing into the mcd-account implementation commit c8b31e2ca7a8433293a0d604eb068a69326888a3 Author: Vivek Dasmohapatra Date: 2010-10-22 17:54:50 +0100 Implement Account.I.Addressing commit 23bcffad520e6c5356dc9df8f894006393cd3e71 Author: Vivek Dasmohapatra Date: 2010-10-22 17:54:49 +0100 Introduce new interface Account.Interface.Addressing commit bdb25723743291ca50b1b8cbdeb2dab051554066 Merge: 2e71d81 cfaa5ff Author: Will Thompson Date: 2010-10-12 17:35:14 +0100 Merge branch 'mcd-account-get-cm' Reviewed-by: Senko Rašić commit cfaa5ffdcee7069d92d882791882311e44d97e15 Author: Will Thompson Date: 2010-10-08 18:22:59 +0100 Add TpConnectionManager accessor to McdAccount commit 420325c1e1261c37c02f0790030a1f316c6bb128 Author: Will Thompson Date: 2010-10-12 11:14:57 +0100 Tweak .gitignore commit 782aa7c3bdd580c3e9ab4a0bde366815c2919f95 Author: Will Thompson Date: 2010-10-12 11:11:32 +0100 Remove obsolete AM.Interface.SSO This is superseded by Account.Interface.Storage. commit a710cd0f9abe2b756864928c65ba798e556198b0 Author: Will Thompson Date: 2010-10-11 14:55:06 +0100 Delete mcd_master_add_connection_parameter() This is not used anywhere, which is good, because it doesn't work. commit 41aeef1c314c60b12d394403d1552ed7bd964203 Author: Vivek Dasmohapatra Date: 2010-10-12 15:38:48 +0100 Implement the "list" operation in the libaccounts backend commit d8179b677aeeee0394840f330275bb956a459e84 Author: Vivek Dasmohapatra Date: 2010-10-12 15:38:12 +0100 Obsolete functions no longer used by the libaccounts get/set implementations commit 4f43ef635decd263783bcde5db7ac56e6e9a4297 Author: Vivek Dasmohapatra Date: 2010-10-12 15:37:03 +0100 Update the libaccounts "set" implementation to use the new helpers commit 3cd7559e500d1b5ac7b442ce61eef72337014feb Author: Vivek Dasmohapatra Date: 2010-10-12 15:36:34 +0100 Update libaccounts "get" implementation to use the new helper functions commit 3c1fefe21ebc9603bc0a0b4ff56cae9a369d59ef Author: Vivek Dasmohapatra Date: 2010-10-12 15:35:10 +0100 Helper function to save settings in the SSO commit 08e39a3aa4003b2a31c6a548610cf5fa32bf3b9d Author: Vivek Dasmohapatra Date: 2010-10-12 15:33:58 +0100 Helper functions to map the enabled flag to the enabled tri-state in SSO commit 8f2a2ccc5fd7e860581ffcbe2709f975cbc90856 Author: Vivek Dasmohapatra Date: 2010-10-12 15:27:10 +0100 Implement the same AG <-> MC setting mapping functions as the SSO storage plugin commit 6d6ab7387c99df31b071b7cce8d617ff46d87cf8 Author: Vivek Dasmohapatra Date: 2010-10-12 15:24:40 +0100 Fix up g_log related helpers so they build (bad comparison, bad func signature) commit 4c9c8f48f1b3b86ea46c46055d4c2e5ef926cb5a Author: Vivek Dasmohapatra Date: 2010-10-12 14:19:06 +0100 Implement the "list" operation in the default account store tool backend commit deb56f64ff9dc03f682e09561dfaad14bd3083d4 Author: Vivek Dasmohapatra Date: 2010-10-12 14:18:35 +0100 Implement the "list" operation in tha account store tool commit 2fc6e063fc591f2eba6dc51678ad5c527d9d2e4c Author: Vivek Dasmohapatra Date: 2010-10-12 13:31:56 +0100 Missing includes commit 2e71d81b3f9d04fc4f2a856d9de19cd1e6a92b12 Merge: 6b6156f 068185b Author: Senko Rasic Date: 2010-10-12 14:19:03 +0200 Merge branch 'bypass-observer' commit 068185bd5be0f113c1785a07e9da029ecd8e7cf0 Author: Senko Rasic Date: 2010-08-31 14:50:01 +0200 updated copyrights commit bddeef350dba5d90023f1f21d7d7664c46059ada Author: Senko Rasic Date: 2010-08-31 14:48:40 +0200 add dispatcher/bypass-observers.py test commit b6ea54b2cc93b3547d647e9ab4ceda58440c995b Author: Senko Rasic Date: 2010-08-31 14:43:56 +0200 mctest.SimulatedClient: optionally support BypassObservers commit 201d5af64004c1542c09b446c3046c6f1ad38425 Author: Senko Rasic Date: 2010-08-31 14:42:17 +0200 McdDispatcher: when respawning observers, skip notifying them about unobservable channels commit 8d8db2ffa52049d0ee39da7d7b75dfadac1bda34 Author: Senko Rasic Date: 2010-08-31 11:59:00 +0200 McdDispatchOperation: bypass observers if first channel handler requests it commit a892185dfbea0897b7b3ea1d541501fe8da9053a Author: Senko Rasic Date: 2010-08-31 11:58:10 +0200 McdClient: add BypassObservers boolean flag commit 01c4a86570f6772809c02b947c04822bf8ed57e8 Author: Simon McVittie Date: 2010-10-11 18:45:27 +0100 while we're using GObject-Introspection notation for docs, get it fully right commit 16d4d59d32b4acd6d35d28fafc1cf4899d2fa27c Author: Vivek Dasmohapatra Date: 2010-10-11 14:27:51 +0100 Let ag parameters/account shadow the ag 'username'/mc 'param-account' mapping New convention introduced to meet the requirements of a libaccounts platform: Normally the account parameter is mapped from the global 'username' setting. commit bd6ee840804ed95fea2511565932fdff84640e5e Author: Will Thompson Date: 2010-10-08 18:07:53 +0100 Remove unused mcd_manager_get_parameters() commit 6b6156f6ea921e50ef8b9bb15d7c2ba289ec2e66 Merge: a7b17cd fb5ea01 Author: Will Thompson Date: 2010-10-07 16:34:01 +0100 Merge branch 'telepathy-mission-control-5.6' commit fb5ea0159ec8a5d96a266530b401f788c0e293ca Merge: f03e38c 144d6e1 Author: Will Thompson Date: 2010-10-07 16:33:17 +0100 Merge branch 'mc-tool-types' into telepathy-mission-control-5.6 Reviewed-by: Simon McVittie Reviewed-by: Simon McVittie Reviewed-by: Vivek Dasmohapatra Reviewed-by: Vivek Dasmohapatra commit 144d6e15d9cd5bd8a8c17ffc50a0ba5078319d98 Author: Will Thompson Date: 2010-08-03 18:09:42 +0100 mc-tool: support object path parameters commit fcc72fea419a1eb5abb4fcb173a0a57dbaeee87e Author: Will Thompson Date: 2010-08-03 17:02:16 +0100 mc-tool: make help consistent about supported types Also, make it a bit more readable, and avoid the lines wrapping. commit a7b17cd87d76038a8448a515a4a9f2e439faff3b Merge: 750932c ea4d52a Author: Simon McVittie Date: 2010-10-06 15:20:56 +0100 Merge branch 'requests-30092' Conflicts: src/mcd-account-requests.c commit 750932c509c39e887b3be40d98593a0d9a5ebd9d Merge: 22e2a9f f03e38c Author: Simon McVittie Date: 2010-10-06 15:17:19 +0100 Merge branch 'telepathy-mission-control-5.6' commit f03e38c057a3d38537bc585dabc78ed0dc8cda24 Author: Simon McVittie Date: 2010-09-29 11:10:16 +0100 fd.o #30448: make type of mcp_account_storage_get_restrictions consistent with the header It seems we changed the implementation but not the header, and Solaris CC is stricter about this than gcc. Since the header defines our API, it seems better to fix this in the implementation for the moment. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=30448 Reviewed-by: Vivek Dasmohapatra commit 22e2a9f61969a96a54d3f7aba1b550219fa4efac Merge: 02eff78 793cc90 Author: Simon McVittie Date: 2010-09-29 10:57:14 +0100 Merge branch 'telepathy-mission-control-5.6' Conflicts: NEWS configure.ac commit 793cc900f08c0cc1efacc33d997c943fa1893086 Author: Simon McVittie Date: 2010-09-29 10:55:37 +0100 mcd-manager.c: don't define _POSIX_C_SOURCE for strtok_r, which we don't use commit 5e8d727e37c31f487bce840c755f66d66fa259d8 Author: Simon McVittie Date: 2010-09-29 10:55:18 +0100 fd.o #30447: don't use "return x()", where x returns void, in void functions Solaris CC doesn't allow this. [In fact, neither does ISO C99 --smcv] Reviewed-by: Simon McVittie Bug: https://bugs.freedesktop.org/show_bug.cgi?id=30447 commit 760fe45393bda94cebc9192595e34eed906a3d89 Author: Vivek Dasmohapatra Date: 2010-09-20 13:46:12 +0100 Must include config.h when using AC_DEFINE'd macros commit 02eff78a581f84ee9174a112df854c57026fda17 Author: Vivek Dasmohapatra Date: 2010-09-20 13:46:12 +0100 Must include config.h when using AC_DEFINE'd macros commit 438826eb7970d706a8bcb6c6ed79590a885ff761 Author: Will Thompson Date: 2010-09-16 18:48:55 +0100 Clean up SimplePresence-building code. commit 1e93089a8d05c2a60da177d0025dec1f031d3dbe Author: Will Thompson Date: 2010-09-16 18:23:05 +0100 Set CurrentPresence to Unset if online without SimplePresence The spec says: If the connection is online but does not support the SimplePresence interface, this should be (Connection_Presence_Type_Unset, "", ""). But previously we only updated CurrentPresence in response to PresencesChanged being emitted for our self handle, which it obviously never is by connections which don't implement SimplePresence. (Actually, this was right by accident until my previous commit, because CurrentPresence was initialized to (0, NULL, NULL).) Fixes: commit f02defd4f8053c62aafc867954474b4c97bae178 Author: Will Thompson Date: 2010-09-16 18:21:32 +0100 Correctly initialize Account.CurrentPresence The spec says that CurrentPresence being 'Unset' (which is value 0, hence the default if we don't change it) means that the connection is online, but doesn't support SimplePresence. commit 1cdaa58630098d66e0f76dcc06ce2cc0c3633597 Author: Simon McVittie Date: 2010-09-16 17:34:06 +0100 Nano version for master commit 62eba1c3202bcf165a3e975c9469c373dcad30cc Author: Simon McVittie Date: 2010-09-16 17:33:23 +0100 Revert "Don't warn about deprecated declarations" This reverts commit 50f936b83a8a5970f981bbe2a6b318b3d51adebe. commit 6cf2e11f2019cdbf0c2068362444e23663d55132 Author: Simon McVittie Date: 2010-09-16 17:33:13 +0100 Nano version 5.6.0+ commit 02023109462143bba05b169ecc1c690038c357c9 Author: Simon McVittie Date: 2010-09-16 16:51:22 +0100 Prepare MC 5.6.0 commit 50f936b83a8a5970f981bbe2a6b318b3d51adebe Author: Simon McVittie Date: 2010-09-16 16:49:57 +0100 Don't warn about deprecated declarations This is about to be a stable branch, so we're not going to fix any uses of newly-deprecated functions in future. (To be reverted in master after branching for 5.6.) commit 3433a7b4ae90f0f61d4fef130631e88f066fd26a Author: Simon McVittie Date: 2010-09-16 16:30:56 +0100 Update NEWS commit be83db16e4cba060da074a1c4e2db22596310d37 Author: Vivek Dasmohapatra Date: 2010-09-16 15:52:46 +0100 If keyring support is off, we define stubroutines, we dn't #if them out The unused definition warning -> error will bite us if we both define a noop stubroutine _and_ #if the use of that name out as well. commit 51b5efe07c8c14f5d54183561aed95c2cb7926ee Author: Vivek Dasmohapatra Date: 2010-09-16 15:28:13 +0100 Superfluous include commit 9c8eb6ae0a8ed6809d944f534e21a5740702c558 Author: Vivek Dasmohapatra Date: 2010-09-16 15:27:56 +0100 Install mcd-storage.h [needed by mcd-account-manager.h] commit d563ead8cff191753d95d19bb0655db254e77c6e Author: Simon McVittie Date: 2010-09-15 13:12:42 +0100 test/account-store: fix one more build warning Reviewed-by: Guillaume Desmottes commit 9c5a4e350ae324316297db4ca3af175cbc32a702 Author: Vincent Untz Date: 2010-09-15 13:08:19 +0100 Fix various build warnings Reviewed-by: Simon McVittie commit db4960f191d5b1d091dd76537d50194ae579e773 Author: Simon McVittie Date: 2010-09-14 19:11:05 +0100 Nano version commit 4c2b540e103cd87b296190ac4bdc72cfb40a3900 Author: Simon McVittie Date: 2010-09-14 18:25:10 +0100 Prepare version 5.5.4 commit 4f67eab634aa4d91d4841b3f3bdfa6d7ee52b2f0 Author: Simon McVittie Date: 2010-09-14 18:06:54 +0100 test/Makefile.am: simplify CFLAGS commit 3790a84acb18bf61d85a5a79b4ea4a30b1649986 Author: Simon McVittie Date: 2010-09-14 17:58:58 +0100 Knock out the account-storage/libaccounts-sso-storage test for 5.6 I'm unable to test it and it looks unfinished. commit c68547b12b3371eb1c67e2640e7d0f270f5890ef Author: Simon McVittie Date: 2010-09-14 17:28:59 +0100 Run account storage tests in their own session, and not in installcheck The gnome-keyring test assumes that it's talking to a MC instance configured to use the temporary keyring, which won't be true unless we run it in its own instance; the diverted-storage test makes assumptions about account naming that aren't necessarily true in a non-new MC instance. Similarly, these tests use Abort() which isn't in the real MC. commit 0bf6ed698102011576327856e16161cd19e1034d Author: Simon McVittie Date: 2010-09-14 17:37:40 +0100 Move keyfile_read() to mctest, fixing distcheck in a simple way There seems little point in separating out such a small utility function. commit a478b211eab9224f84a471bfbc1cf80d8ad2f094 Author: Simon McVittie Date: 2010-09-14 17:25:02 +0100 Add keyring-manipulation stuff to .gitignore commit 2b9f4f1aad25a77710d0a53c80e72c6ccca520bc Author: Simon McVittie Date: 2010-09-14 17:24:20 +0100 Compile test/. before test/twisted Otherwise, 'make check' in a clean tree won't work: account-store and keyring-command won't have been compiled yet when test/twisted is entered. commit 85e35b0b8e4501ac4eb35fb2fc210eedf0282e3d Merge: 3116079 9ac2c09 Author: Simon McVittie Date: 2010-09-14 16:00:12 +0100 Merge branch 'master' into storage-tests commit 9ac2c09945c69c32ca4a6e15a30048c58add2782 Author: Vivek Dasmohapatra Date: 2010-09-14 14:52:52 +0100 Generate a GError in the "unsupported type" case of the dup_value method commit 631e2cafc2e45e89ee3cfc9f47dd0582c14c40bf Author: Vivek Dasmohapatra Date: 2010-09-14 14:46:08 +0100 Tidy up the GError logic in dup_value, and document the value+error behaviour commit 84adc5d2a14b19f42c06cabbe4cb807ba7a0e274 Author: Vivek Dasmohapatra Date: 2010-09-14 14:31:57 +0100 Make sure the type of the passed in value matches the type from McdStorage commit d79c76c46d7c88b31ad865c2c25109a87f5591c5 Author: Vivek Dasmohapatra Date: 2010-09-14 14:24:01 +0100 Unused struct type declaration deleted commit 38bf72ea3dc67cbe9aadf72de61bbbb8ec0c06d1 Author: Vivek Dasmohapatra Date: 2010-09-14 14:23:19 +0100 Use typed key file set helpers in store_value McdStorage method implementation commit 50d0d448c136987956c73a86269faba22d0fa9b0 Author: Vivek Dasmohapatra Date: 2010-09-14 13:57:30 +0100 Reverse the decision about which layer does escaping/unescaping We now do the escaping/unescaping in the plugin-account layer (McdStorage interface), while the storage plugins just accept whatever they're given. commit 3116079d37cd389b10525a0f9d799e7fadb16e60 Author: Senko Rasic Date: 2010-06-21 11:29:12 +0200 add SSO storage backend test commit 320c153d13869fd3e5531948095fa18803e4ad1d Author: Senko Rasic Date: 2010-06-21 11:26:34 +0200 added default/keyring and diverted storage tests commit 58e7725455b8724d0eaab1c8da89b00d521a9e35 Author: Senko Rasic Date: 2010-06-21 11:24:44 +0200 test diversion storage plugin: have an exception for a special account So we can use that account to test default storage commit cf5af66a60fa318e4233d73a9f1c286dca4ec3b8 Author: Senko Rasic Date: 2010-06-21 11:23:26 +0200 set proper environment flags when testing with gnome-keyring commit 23320b621c85ed0984cfa0a628cfaf34c1ebf206 Author: Senko Rasic Date: 2010-06-21 11:21:38 +0200 mc-debug-server.c: use temporary keyring from env, don't create one commit 9cf19f452d0a068c9f4a96a86fa5bb3378b1709c Author: Senko Rasic Date: 2010-06-21 11:20:54 +0200 added tests/keyring-command helper for creating/destroying test keyring commit 2adf4f67d6503a44bca106baf5e8a0a32c90a70a Author: Senko Rasic Date: 2010-06-21 11:18:02 +0200 account-store.c: take temporary keyring name from environment commit 23d0a837431d1f7fc4e8f385a7777f8a8f6d3fbf Author: Senko Rasic Date: 2010-06-21 11:14:39 +0200 mctest.py: refactored code into new get_fakecm_account() and connect_to_mc() methods commit e67044de0f3a5468d56d8e491e37251737608bba Author: Senko Rasic Date: 2010-06-21 11:13:12 +0200 mc-debug-server.c: added org.freedesktop.Telepathy.MissionControl5.RegressionTests.Abort commit 4caef8e9a00ea506809934aaf21095f985381b9d Author: Vivek Dasmohapatra Date: 2010-06-03 16:45:08 +0100 return success on writing a param, only flush to store if we did so commit 94c683f4feb9010a8521e2f97f2fab90dd416368 Author: Vivek Dasmohapatra Date: 2010-06-03 16:44:29 +0100 Remove old debugging commit 61c753769cedc2bc0311f0d7417d61b0dcaf2e81 Author: Vivek Dasmohapatra Date: 2010-06-03 16:44:14 +0100 Don't call into libaccounts until we've muted its chatty debug output commit 9b04e4bf6149f5b51a1616e695b59689d1d4136f Author: Vivek Dasmohapatra Date: 2010-06-03 16:43:29 +0100 Suppress AG debug for ag_manager creation commit 39b95c9374b05af851d869ac0b1001ceb7a94aa4 Author: Vivek Dasmohapatra Date: 2010-06-03 16:42:44 +0100 g_type_init called, some backends need it commit f03cd76003142ca231d8cb2278a4ed61eda51d70 Author: Vivek Dasmohapatra Date: 2010-06-03 15:39:38 +0100 Fix delete method for dafault storage backend commit 162ed592fa8ff57c9a263b4bee02219baf919927 Author: Vivek Dasmohapatra Date: 2010-06-03 15:39:15 +0100 Whitespace trivia. commit 6249b7cc13d8f201f08a9ef8fa346486d00ca5ad Author: Vivek Dasmohapatra Date: 2010-06-03 15:38:56 +0100 Update usage/dcstrings. commit 68b240c151953179bebc0e02598e53bf255e0a4b Author: Vivek Dasmohapatra Date: 2010-06-03 15:38:10 +0100 Modify op name for account removal. commit ad7b90913ad23c37697dc8d0b60555a468212c49 Author: Vivek Dasmohapatra Date: 2010-06-03 15:37:31 +0100 Remove some old debugging commit 0c3f075b1a4b00c3467855ce51efbd6f61b26ffc Author: Vivek Dasmohapatra Date: 2010-06-02 19:57:39 +0100 account storage inspectors for default (keyfile + keyring) & libaccounts (SSO) commit 54404bcf80722c6a875cdeabc851ade29d59ef80 Author: Vivek Dasmohapatra Date: 2010-09-14 13:03:31 +0100 Documentation fix (misnamed funciton in docstring) commit f447f4004c915208b9f9e1434564e684d8d79ed2 Author: Vivek Dasmohapatra Date: 2010-09-13 21:31:06 +0100 Use McdStorage instead of direct private structure access in mcd-account-compat commit 84dea39154f663bac8d81fd30736d30f7cbca5c8 Author: Vivek Dasmohapatra Date: 2010-09-13 21:29:41 +0100 Use the McdStorage interface in the soon-to-be-deleted conditions code commit ff641a8dcb117f63fccff66bb2f8d5e83106bcf9 Author: Vivek Dasmohapatra Date: 2010-09-13 21:28:44 +0100 Use McdStorage instead of private structures in match_account_parameter commit 0f5556352746303cbe3ee7f923120526f9a68c29 Author: Vivek Dasmohapatra Date: 2010-09-13 21:27:43 +0100 DBus daemon is directly available via the account now, account manager is not commit 42f48a6d53390dd7ef798b637ff7ef5af9c13a65 Author: Vivek Dasmohapatra Date: 2010-09-13 21:26:44 +0100 The McdStorage layer uses get/set _value, the actual plugins need to use _string This way the layer closest to actual storage in a real actually-on-disc keyfile make sure escaping is handled, while all layers above them can simply treat the values as "data" without caring how or where they are stored. commit 18504cb01f8403ffcc904773d77a2731eb32b895 Author: Vivek Dasmohapatra Date: 2010-09-13 21:24:42 +0100 Make sure the sso-services property is cached when we load the account Doing this means we don't need to special-case sso-services in generic code later. commit e17c526c56ce5fe72ddd4ab3501d1779e564fbb6 Author: Vivek Dasmohapatra Date: 2010-09-13 21:23:29 +0100 Use the McdStorage interface to find the plugin claiming ownership of an account commit 3aae65a96489779109dcff2df48c3d261420d3c8 Author: Vivek Dasmohapatra Date: 2010-09-13 21:22:52 +0100 Stray debug message commit 49004b163bcd79225fb7fe6bb638526279622e4e Author: Vivek Dasmohapatra Date: 2010-09-13 21:22:40 +0100 No longer have direct access to account manager: use helper to store connections commit 6b53756ded5bbee92d0cafd6d0f50c78664cf252 Author: Vivek Dasmohapatra Date: 2010-09-13 21:21:45 +0100 mcd_account_get_alias update to use McdStorage commit 99424caa96dfe653098584dea550f12eeb0db961 Author: Vivek Dasmohapatra Date: 2010-09-13 21:20:53 +0100 get/set avatar methods update to use McdStorage interface commit b0d1c020c8115f8449082ebb308288f4ef07398d Author: Vivek Dasmohapatra Date: 2010-09-13 21:20:01 +0100 get/set avatar token updated to McdStorage interface commit 1f0cf66f58724f6c302bf1bb5f2cb2ea6cce6a47 Author: Vivek Dasmohapatra Date: 2010-09-13 21:19:24 +0100 get/set normalised name functions updated to McdStorage interface commit ce33ae1f42d6929ca92464ce5731ed7c9de55cc4 Author: Vivek Dasmohapatra Date: 2010-09-13 21:18:13 +0100 update_parameters_dup_params_cb updated to McdStorage interface commit 0ea08db42ff6d8171cc8e812dc4a1fe11784c672 Author: Vivek Dasmohapatra Date: 2010-09-13 21:17:13 +0100 clear_register_dup_params_cb updated to McdStorage interface commit ad1d2de0fd0e0c3efc599e325dee5bbc9c3f17f6 Author: Vivek Dasmohapatra Date: 2010-09-13 21:16:20 +0100 has_been_online updated to use McdStorage interface commit a2fbe50aba07795db0fd775d3b6119c5cd73a991 Author: Vivek Dasmohapatra Date: 2010-09-13 21:14:51 +0100 set_connect_automatically updated to use McdStorage interface commit f1f618d6fee47e7d46f4422b70c86f2d65b92ff6 Author: Vivek Dasmohapatra Date: 2010-09-13 21:14:22 +0100 set_automatic_presence updated to use McdStorage interface commit f9ae977dfb5b7479343fadb4f6a3b9dc59b11e0e Author: Vivek Dasmohapatra Date: 2010-09-13 21:09:53 +0100 _mcd_account_set_enabled upated to use McdStorage interface commit 8ab75eab9ffcffd9948391765d01c18b96115948 Author: Vivek Dasmohapatra Date: 2010-09-13 21:08:51 +0100 mcd_account_get_string_val updated to new McdStorage interface commit 7e862140fe946241a840cfab16f3c6ac050c9358 Author: Vivek Dasmohapatra Date: 2010-09-13 21:08:20 +0100 mcd_account_set_string_val updated to new McdStorage interface commit 3fd92771734ad5ad3820972e6dcb36c0d9c13c7b Author: Vivek Dasmohapatra Date: 2010-09-13 21:05:39 +0100 Delete account method updated to use new McdStorage interface commit efe36be000112b7d72b216e0946bec9fde6c5ff1 Author: Vivek Dasmohapatra Date: 2010-09-13 21:04:45 +0100 get/set parameter internal functions updated to use McdStorage interface commit 0f5a38efb6e1764da6123495519f7493b52fc8f9 Author: Vivek Dasmohapatra Date: 2010-09-13 21:03:46 +0100 keyfile_get_value and keyfile_set_value no longer exist (no more keyfile) commit d6fba82ec292e0c5a9cc94fdf05ed8a05479f3e7 Author: Vivek Dasmohapatra Date: 2010-09-13 20:51:03 +0100 McdAccount no longer holds an account manager It has a McdStorage object and a DBus daemon instead - updated constructors/destructors/accessors to reflect this change commit 0046407863d5f61ea1102e78d05d9aae5cc007d3 Author: Vivek Dasmohapatra Date: 2010-09-13 20:36:45 +0100 Implement method to find the McpAccountStorage plugin holding an account commit 01a0a82fce092b598370bac4d02c7db0f0cda076 Author: Vivek Dasmohapatra Date: 2010-09-13 20:35:57 +0100 Typo, missing return signature commit b594c4f37ea7e7be392683b27cc158c1148ebf77 Author: Vivek Dasmohapatra Date: 2010-09-13 20:35:36 +0100 Hook up the actual McdStorage method implmentations to the interface commit 76f68b35e71a35856ad2aec7206727fb0b8e7346 Author: Vivek Dasmohapatra Date: 2010-09-13 20:34:56 +0100 Implement setting store values from GValues commit 1d0ed399604c64ddf506eb5026b8b04da5c8681d Author: Vivek Dasmohapatra Date: 2010-09-13 20:33:46 +0100 Implement getting integers from the store commit 4a1ef90e2016b631dd606facb12096b7b8b9dec0 Author: Vivek Dasmohapatra Date: 2010-09-13 20:31:04 +0100 Implement getting booleans from the store commit 01fd9a07d6aaccaabeac572584858e489f1506bc Author: Vivek Dasmohapatra Date: 2010-09-13 20:30:42 +0100 Implement fetching GValues from the store commit 5667b21d7659b89bf2fb5e4e6787e90653230270 Author: Vivek Dasmohapatra Date: 2010-09-13 20:29:03 +0100 Implement the has_value method of the storage interface commit b29db1c3a2d7e9f0b72f178f2844a1938a430715 Author: Vivek Dasmohapatra Date: 2010-09-13 20:28:03 +0100 Make the McdStorage interface object available vie the account manager. commit 2e9de4ecf03a042ca75bbefac32be6674003c042 Author: Vivek Dasmohapatra Date: 2010-09-13 20:21:41 +0100 Unused 'update one account' operation removed Since _all_ operations now know the account involved, this operation sort of drops out of the logic. commit afc6b1cdaa1b8a133e6e49f3a46fd26029d83e62 Author: Vivek Dasmohapatra Date: 2010-09-13 20:17:42 +0100 Move commit operation (flushing to long term storage) into plugin-account commit d1ff9303f0501a65c9f18afb4d0418b506434c8f Author: Vivek Dasmohapatra Date: 2010-09-13 20:14:42 +0100 Move account creation and get/set value ops needed by same into plugin-account commit 33cc0a6a4d7df42b924e5b6bb66c0da7015768c0 Author: Vivek Dasmohapatra Date: 2010-09-13 20:07:31 +0100 Move account deletion (from storage) into plugin-account commit 5942a7827a3fe8719e8258aa14b34a17f7af78c3 Author: Vivek Dasmohapatra Date: 2010-09-13 20:04:54 +0100 Comments - we no longer have direct access to (or knowledge of) any keyfiles commit 3d5b5e7a248d29a7fce28604e03aba60c816a5ba Author: Vivek Dasmohapatra Date: 2010-09-13 20:01:36 +0100 Move account load + initialisation into plugin-account commit 991789066584f8be0afd1be4de1692b71d16f0ab Author: Vivek Dasmohapatra Date: 2010-09-13 19:42:57 +0100 Begin moving the storage plugin cache & management into plugin-account.c commit a925bdb89cd69a1f20374dde7887c01a2138473f Author: Vivek Dasmohapatra Date: 2010-09-13 17:33:16 +0100 New McdStorage interface for storing/retrieving account settings + params The McpAccountStorage interface used to communicate with the storage plugins The McdStorage interface is what MC in general should use to store/inspect/ update/whatever account details, and is responsible for managing the storage plugins. It replaces the old method of stealing the account manager's internal data structures via the McdAccount and changing them behind the account manager's back. commit 5906616c918a0206fb128590359c349895a27987 Author: Simon McVittie Date: 2010-09-09 14:38:51 +0100 Test request-properties in HandleChannels calls commit 6bae7bdbb2472dac2b280a675e9e06ac6af809f1 Author: Simon McVittie Date: 2010-09-09 14:28:11 +0100 mcd_dispatch_operation_handle_channels: include request-properties commit 2fca4d99a30fa4b4bac670806068cee2741ef40b Author: Simon McVittie Date: 2010-09-09 14:23:45 +0100 collect_satisfied_requests: go straight from channels to D-Bus info commit c36969dc58f99bbe35c2802b39729cc21c536d11 Author: Simon McVittie Date: 2010-09-09 14:06:43 +0100 _mcd_dispatcher_reinvoke_handler: include request-properties in Handler_Info commit ea4d52a990863cfe94662f92137406e7fe4f579c Author: Simon McVittie Date: 2010-09-08 18:27:45 +0100 _mcd_channel_new_request: take a pre-constructed McdRequest commit 58d1913c86b3b26017b2bb1efb68e43bd37fc567 Author: Simon McVittie Date: 2010-09-08 18:21:50 +0100 _mcd_request_predict_handler: take responsibility for guessing the handler commit e562ec8eda0b3116111998be60f7f51b7b0fe87a Author: Simon McVittie Date: 2010-09-09 13:45:29 +0100 Give each McdRequest a ref to the client registry commit a093c3c86b4978a6353dad70c8eaadc6f7c832a1 Author: Simon McVittie Date: 2010-09-08 18:11:29 +0100 _mcd_dispatcher_get_client_registry: add commit 015c2290185b610a9cf5fab205c6ba8094d9fe35 Author: Simon McVittie Date: 2010-09-08 18:09:58 +0100 _mcd_client_registry_get_dbus_daemon: add commit 8e9adf673d62abaf4e915ec00387c384fe956530 Author: Simon McVittie Date: 2010-09-08 18:06:08 +0100 McdClientRegistry: choose handlers in terms of properties, not McdRequest This means McdRequest can have a McdClientRegistry without circular dependencies. commit 3d9854432bacc5491f1e73b61dfa54d29a457827 Author: Simon McVittie Date: 2010-09-08 16:07:13 +0100 McdClientRegistry: re-indent recently moved code in Telepathy style commit 466bd0f2b380ca940f3bfeac3919c79311c1e85e Author: Simon McVittie Date: 2010-09-08 16:04:28 +0100 Move listing possible handlers from McdDispatcher to McdClientRegistry commit 60ca5963c9c13106ba52abc59844795fc3d6751b Author: Simon McVittie Date: 2010-09-08 16:03:59 +0100 McdChannel: remove disused implementations of the ChannelRequest API Space for a TpDBusPropertiesMixinClass is still reserved in the McdChannelClass, since subclasses might exist. commit 04f5815c5bd52ec5504b5cd81d6dfca700c84b1d Author: Simon McVittie Date: 2010-09-08 15:51:24 +0100 mcd-account-requests: call _mcd_request_proceed instead of a thin wrapper commit 0785e1d6235dd6c9ddc2803432f7f3df23ee3ca6 Author: Simon McVittie Date: 2010-09-08 15:49:56 +0100 Export McdRequest, not McdChannel, on D-Bus commit ec129a7446887e77bed82ad12b1e0d0aef105b5c Author: Simon McVittie Date: 2010-09-09 13:13:27 +0100 Inline _mcd_account_proceed_with_request() into its caller, and simplify commit 3808e0b8a9ce61b7fd80addfa44a1f71df9378d8 Author: Simon McVittie Date: 2010-09-09 13:10:46 +0100 McdRequest: take on responsibility for calling into Client.I.Requests commit 0a519167dd1f9c69a6a74951ff14040bb87171ec Author: Simon McVittie Date: 2010-09-08 15:03:50 +0100 McdRequest: implement the early stages of Proceed() For the moment it calls into mcd-account-requests for the next bit. commit 98a613e28a4b146b2df7b7a3b58365a013e5f327 Author: Simon McVittie Date: 2010-09-08 15:00:46 +0100 _mcd_channel_request_proceed: don't allow for absent accounts In earlier versions, this could possibly have happened if the code was tangled enough. However, McdRequest holds a reference to the account, so there's no way a McdRequest can not have an account. commit 40af99632c8c30e11468335bef6f12352bb2b25a Author: Simon McVittie Date: 2010-09-09 13:08:47 +0100 _mcd_account_proceed_with_request: remove dependence on McdChannel commit a2d0ea012a69cda374214cbe19a094045832e75b Author: Simon McVittie Date: 2010-09-08 14:48:56 +0100 mcd-account-requests: connect to ready-to-request earlier It can't actually be emitted until Proceed() is called, but if we connect to it ahead of time, _mcd_account_proceed_with_request doesn't actually need the McdChannel. commit 4204b3d2f8405e2b625abdbaf122980647d648a1 Author: Simon McVittie Date: 2010-09-08 13:53:05 +0100 mcd-account-requests: defer Proceed() until the dispatcher has been told This matches the order of events in the modern API, and means that the implementation of Proceed() can safely assume that the dispatcher knows about the channel request. This does break the expectations of the old-API tests: previously, we incorrectly asserted that AddRequest happened after calling CreateChannel on the connection manager, but either order would be valid, and in fact the new order makes more sense. commit f3a153356399ce2f8bcd3a231d13eba60bb262e4 Author: Simon McVittie Date: 2010-09-08 13:22:42 +0100 Move a stub version of Cancel() to McdRequest commit a6fbb7f242c49d722f6ee41e555e7e46d849f224 Author: Simon McVittie Date: 2010-09-08 12:38:42 +0100 Remove the concept of creating a channel request that is already proceeding Instead, in the Account.ChannelRequests code paths, just create one and then tell it to proceed. commit d2591a6eab3c08f01187b9835f3ddb5e2388cb89 Author: Simon McVittie Date: 2010-09-07 18:40:34 +0100 McdRequest: remove the "completed" signal commit 207eff860950fdeb263381952b11cc9aa66785a4 Author: Simon McVittie Date: 2010-09-07 18:39:40 +0100 Listen for McdRequest:succeeded[-with-channel] and McdRequest:failed commit d574ad8e275d2843de5441164b75763974ddedbb Author: Simon McVittie Date: 2010-09-07 18:12:41 +0100 McdRequest: emit succeeded, succeeded-with-channel and failed For now, these signals do nothing. They'll soon supersede completed, and when McdRequest is exported on D-Bus, they'll be mirrored onto D-Bus too. commit 669b0d56c8f7ed497ce27f75ed37cdb8fc035461 Author: Simon McVittie Date: 2010-09-07 16:39:49 +0100 _mcd_channel_get_request_user_action_time: remove, unused commit fce9d2674a549fa1a95c421ad5aa56e8b9367033 Author: Simon McVittie Date: 2010-09-07 16:37:13 +0100 McdDispatcher: work out possible handlers from McdRequest and/or TpChannels This avoids ambiguities caused by McdChannel being a (request or channel or both). As a bonus, assume_requested can go away, since it's inferred from the presence or absence of @request. This relies on some previously implicit assumptions, which are now assertions: - the McdChannel in _mcd_dispatcher_reinvoke_handler has both a McdRequest and a TpChannel - each McdChannel in _mcd_dispatcher_take_channels has a TpChannel commit 78fb02770ed53fbec5ef943a156d5f422aec61be Author: Simon McVittie Date: 2010-09-07 15:46:11 +0100 _mcd_channel_get_request_path: remove commit 2b76b5f06305696b80ee084e9ce44979344d577e Author: Simon McVittie Date: 2010-09-07 15:44:34 +0100 _mcd_account_create_request: return the McdRequest as well as the McdChannel commit 037c5dfccd2c37729be7193601d6a8856a496e92 Author: Simon McVittie Date: 2010-09-07 15:37:44 +0100 _mcd_channel_dup_request_properties: remove commit 19d30ad814181f99621eb8a72d53e11d9ccbe03e Author: Simon McVittie Date: 2010-09-07 15:37:15 +0100 mcd-account-requests: use McdRequest in easy cases commit 8ba71d6e31d5a1b867d0d1c042f6336d78413832 Author: Simon McVittie Date: 2010-09-07 15:27:14 +0100 McdChannel: track satisfied requests as a list of McdRequest, not McdChannel commit 263c83db750a71d8630853a55e7d0fb56bd6853e Author: Simon McVittie Date: 2010-09-07 15:17:28 +0100 _mcd_dispatcher_add_request: work in terms of the McdRequest commit 15792b20a88ae5a0ea35d178b8a4498a8ef54b24 Author: Simon McVittie Date: 2010-09-07 15:09:40 +0100 Make mcd_channel_new_request internal We already broke its API, and nobody outside MC should be calling it. commit 8e48fcec643c6a40f944902e133d8413780c0853 Author: Simon McVittie Date: 2010-09-07 15:05:11 +0100 _mcd_request_set_success: take a TpChannel, currently unused commit 04096146c5bf983430d519e116e89380f71bed5a Author: Simon McVittie Date: 2010-09-07 15:04:49 +0100 mcd_channel_status_changed: assert that we do/don't have a channel commit 4b905986fba354b0fff08c3bfdbd3b60bdeb3f16 Author: Simon McVittie Date: 2010-09-07 15:05:52 +0100 Check all references to user action time and update for current telepathy-spec This requires telepathy-glib 0.11.13 for the constants, but does not cause any functional changes. commit 584676015d63d14478388e2715730edfae69aa66 Author: Simon McVittie Date: 2010-09-07 14:35:54 +0100 McdRequest: implement the interfaces and properties of a ChannelRequest The methods are not yet implemented, the signals are not emitted, and the object isn't actually exported on D-Bus. commit 13aa404a2061f74d43d2c7f85067c9f18dea29eb Author: Simon McVittie Date: 2010-09-07 14:19:18 +0100 McdRequest: add Requests and Interfaces properties These will be exported from here when responsibility for exporting a ChannelRequest moves from McdChannel to McdRequest. commit 220fd673b7788fd3a986668a5e8ac3ddf034b7e3 Author: Simon McVittie Date: 2010-09-09 12:47:51 +0100 _mcd_dispatch_operation_run_observers: don't leak the request properties twice observer_info didn't have a value destructor, but the value inserted into it was copied with tp_asv_set_boxed; in addition, the original value wasn't freed either. Reviewed-by: Senko Rasic commit 39c99f03d6a99b52e884d46a009d8137f74a755b Author: Simon McVittie Date: 2010-09-09 12:18:23 +0100 Update NEWS commit 619d9d92ada8da156e00bc2a43ef34346050a060 Merge: 0995628 7f1635c Author: Simon McVittie Date: 2010-09-09 12:32:58 +0100 Merge branch 'clear-pointers' Reviewed-by: Vivek Dasmohapatra commit 7f1635c1f92752e68f68282d3092256705bac4d9 Author: Simon McVittie Date: 2010-09-09 11:59:04 +0100 various shared classes: use tp_clear_object, tp_clear_pointer commit a9a63aa9db1ab49fc9b1f204ca4c24a81bc92bed Author: Simon McVittie Date: 2010-09-09 11:58:02 +0100 various dispatch-related classes: use tp_clear_object, tp_clear_pointer commit 49011e5e13fd24d20037a7ae41d873caaa5854bf Author: Simon McVittie Date: 2010-09-09 11:56:09 +0100 various account-related classes: use tp_clear_object, tp_clear_pointer commit f121342b30aff60a601d25f3ce836ee88c4c5bf3 Author: Simon McVittie Date: 2010-09-09 11:54:22 +0100 server, test, util: use tp_clear_object commit 023fdb490cb9d323b416f3f88fbb346c7b9f8e79 Author: Simon McVittie Date: 2010-09-09 11:53:56 +0100 mcp: use tp_clear_object, tp_clear_pointer commit 09956287fa1cb9a9b179010ea8324bc896aa9df6 Merge: a926c6a 9a5ecad Author: Simon McVittie Date: 2010-09-09 11:48:30 +0100 Merge branch 'just-what-are-refs' Reviewed-by: Vivek Dasmohapatra commit 9a5ecadeea057bded61f52cc8abeb621d5807a46 Author: Simon McVittie Date: 2010-09-09 10:32:48 +0100 _mcd_account_proceed_with_request: don't leak the McpRequest This resulted in leaking the McdRequest, and hence compensated for the bug fixed in the previous commit. However, because the McpRequest is created lazily, it didn't prevent the crash when used without new-style request plugins. commit a635ef53eaa6ecd2925d413baf36a0de1c0af917 Author: Simon McVittie Date: 2010-09-09 10:31:46 +0100 McdRequest: take one extra ref when constructed, to match the Proceed() delay This caused crashes when MC master was run without a new-style plugin, but did not crash the regression tests due to a compensating error (a reference leak whenever there are new-style request plugins). commit a926c6a01b819c5b6cfb4dd138227fe2520a1f90 Merge: 65cc5ec 2a7602a Author: Simon McVittie Date: 2010-09-08 14:52:21 +0100 Merge branch 'easy' Reviewed-by: Vivek Dasmohapatra commit 2a7602a8c3aeb7fdead8635e6401ab972c261f9f Author: Simon McVittie Date: 2010-08-24 12:39:29 +0100 McdChannel: remove unused DEPRECATED_PROPERTY_WARNING macro commit 5d602d4aa7b1697a2a454ba639b2ae450776cd08 Author: Simon McVittie Date: 2010-09-08 12:19:13 +0100 channel_request_proceed: don't crash if already proceeding commit 65cc5ecf8dfa1dc922dfbf6720aefa5ccbf1f814 Author: Vivek Dasmohapatra Date: 2010-08-31 19:09:00 +0100 Skip new accounts created after startup that are completely invalid commit 758adac959bbeac537efd980e483e5dae86dd3e3 Author: Vivek Dasmohapatra Date: 2010-08-31 19:08:38 +0100 Skip pre-existing accounts which are completely invalid (no manager/protocol) commit b09749b7f8c5cb7c2f5e40cfcce915316d4aeb01 Author: Vivek Dasmohapatra Date: 2010-08-31 19:07:07 +0100 NULL out the pointers when finalising an McdAccount commit 2ae2cdfe81f31d42c2be42a45cfb5566ce90711a Author: Simon McVittie Date: 2010-09-07 12:57:05 +0100 Delete missioncontrol.log, as well as missioncontrol-*.log, in clean commit a477f91c212c8b9516ef2e4665a92fe3fb8503f9 Author: Simon McVittie Date: 2010-09-07 12:56:44 +0100 Re-auto-generate mcd-channel.sgml commit 2482316729a6a0a4b2074988e312721d7df6d8e1 Merge: adb9504 bf9d7f9 Author: Simon McVittie Date: 2010-09-07 12:52:07 +0100 Merge branch 'hints-30000' Reviewed-by: Guillaume Desmottes commit bf9d7f9db952d432ceda6bf3ca8bf2d5901ecf6e Author: Simon McVittie Date: 2010-09-06 17:20:58 +0100 exec-with-log.sh.in: keep a copy of the last log under a predictable name This is convenient if you keep it open in an editor between test runs :-) commit 3fa584f64014c92f93bcc0ac00bb5b184d686d59 Author: Simon McVittie Date: 2010-09-06 17:19:58 +0100 dispatcher/ensure-rapidly.py: test with all possible event orders Before tracking down the bug fixed by the previous commit, I thought it was caused by subtleties of event ordering; it wasn't, but the extra coverage is good to have anyway. commit af5207af0ab7578765f24fff9f1cbe40f3f22d08 Author: Simon McVittie Date: 2010-09-06 17:18:05 +0100 Copy the TpChannel to a proxy McdChannel when setting it up This fixes an assertion failure when emitting SucceededWithChannel for a proxy (secondary) representation of a channel (i.e. the second and subsequent EnsureChannel requests that returned a particular channel). To do this without putting a non-primary representation of a channel into the dispatching machinery (which breaks tracking which requests where satisfied) it's necessary to add _mcd_channel_is_primary_for_path; see that function's doc-comment for the definition of "primary" and "proxy" in this context. commit 6ba590895025f9fffda2511f43df2fdbaaacc616 Author: Simon McVittie Date: 2010-09-06 15:27:04 +0100 Move SucceededWithChannel and Hints into .FUTURE pseudo-interfaces Also rename RequestMetadata to Hints as per the spec draft that was merged. commit 21dac454cfb16ca927012ab980ab4978167e68c4 Author: Simon McVittie Date: 2010-09-06 15:24:07 +0100 Update xml/generic-types.xml for Object_Immutable_Properties_Map commit d7185b434e1bb44ce9bce11dd3a4087a550f7ef1 Author: Simon McVittie Date: 2010-09-06 15:22:50 +0100 Generate src/_gen/interfaces.h commit 7176e558e7b34c558432022ccb6372ee99f02a58 Author: Guillaume Desmottes Date: 2010-09-01 11:55:39 +0200 no need for free_req_properties commit e796d8b8546b58671132633ed9af0e863b73eb3c Author: Guillaume Desmottes Date: 2010-09-01 11:53:13 +0200 rename _mcd_channel_dup_properties to _mcd_channel_dup_request_properties commit cc8cd72bb2af3f82c39b449f5bd9ff333ee23c2a Author: Guillaume Desmottes Date: 2010-08-20 14:41:31 +0200 add 'request-properties' key to Observer_Info commit 8bb446b3efb3a8c7bde6310b3afdc39b5d1afbe2 Author: Guillaume Desmottes Date: 2010-08-20 14:23:25 +0200 collect_satisfied_requests: return an hash table commit a082fbd99ee0259296dae232cf4d8f6b7b9779d8 Author: Guillaume Desmottes Date: 2010-08-20 14:11:42 +0200 _mcd_channel_get_satisfied_requests: return an hash table mapping the path to the channel request commit 70a344b08828833c22d5d85428f745cfd0a499e7 Author: Guillaume Desmottes Date: 2010-08-20 11:54:33 +0200 mcd-channel: store the channel request object in satisfied_requests instead of just its path commit 6ad21f0931ff901c215528cef134771889dc9a0d Author: Guillaume Desmottes Date: 2010-08-20 11:47:33 +0200 _mcd_channel_dup_properties: add TP_PROP_CHANNEL_REQUEST_REQUEST_METADATA commit 47c33ecfd5343ff9697b9c5aa5a72a33934d8d38 Author: Guillaume Desmottes Date: 2010-08-19 16:14:04 +0200 factor out _mcd_channel_dup_properties commit b20bd391295e48faec2556b5c2fc27af338a12bf Author: Guillaume Desmottes Date: 2010-08-19 16:03:53 +0200 _mcd_dispatcher_add_request: use tp_asv_new() commit 246685f9b1ff6b484e3370a9e718cadbd5122273 Author: Guillaume Desmottes Date: 2010-08-19 15:10:38 +0200 test {Create,Ensure}ChannelWithMetadata commit 653f4236330d254195e2ca2a371f2f0c7eba8aac Author: Guillaume Desmottes Date: 2010-08-19 15:10:14 +0200 Implement {Create,Ensure}ChannelWithMetadata commit c706103d81437bf5ecb7e43aaaa6dd2b71d7c4e7 Author: Guillaume Desmottes Date: 2010-08-19 15:09:54 +0200 add API to set the metadata from the dispatcher commit dc32b6cd2d99f00a081736717f745fa1e47ff401 Author: Guillaume Desmottes Date: 2010-08-19 15:07:04 +0200 ChannelRequest: add RequestMetadata D-Bus property commit 96503c4f984141695b0cfb235f7b7a060c7f3a4d Author: Guillaume Desmottes Date: 2010-08-19 12:55:51 +0200 test SucceededWithChannel commit 6b7e006feff927815984996ea59f3975ae5d3e03 Author: Guillaume Desmottes Date: 2010-08-19 12:55:37 +0200 implement SucceededWithChannel commit adb9504b2944b60eba79e2a73a70186bfb5d4283 Merge: 85d7396 1aed923 Author: Simon McVittie Date: 2010-09-01 15:31:05 +0100 Merge branch 'requests' Reviewed-by: Vivek Dasmohapatra commit 85d739665ef17fcb9f5accd733792520593d90ae Author: Senko Rasic Date: 2010-08-26 21:18:12 +0200 add Account_Interface_Minimum_Presence.xml to SPECS commit a582ad14a29c20c007d01197d8dd08d3afdc8dab Merge: 341e252 70702c3 Author: Senko Rasic Date: 2010-08-26 15:29:23 +0200 Merge branch 'minimum-presence' Reviewed-by: Will Thompson Fixes: commit 70702c31f1d667a4a2f925f220b8e732bc779826 Author: Senko Rasic Date: 2010-08-26 15:26:13 +0200 use slice allocator for McdAccountPresencePriv commit b7ee51406a0d4645aa6f8b83c462af53c839ac24 Author: Senko Rasic Date: 2010-08-26 10:55:41 +0200 mcd-account-presence: stop watching for any remaining clients when we get disposed commit ab23622bde22556bc4cd691dc630914457278bc3 Author: Senko Rasic Date: 2010-08-26 10:47:02 +0200 mcd-account-presence.c: simplify presence setting commit ad4ebd4fb41462a1ae1632e40e496f46560648db Author: Senko Rasic Date: 2010-08-26 10:41:28 +0200 cancel MinimumPresence requests for clients that fall off the bus commit d82e70ce063ccad0f72ff5af7994dcc28538df25 Author: Senko Rasic Date: 2010-08-26 10:17:21 +0200 moved internal minimum presence data to McdAccountPresencePrivate commit 7c58468d80f344996c8d9bf02a83a282dbef6e66 Author: Senko Rasic Date: 2010-08-26 09:28:44 +0200 corrected copyrights commit eade94fdf9affc055efdc7be44b1bdf6ba7cac6c Author: Senko Rasic Date: 2010-08-25 12:57:49 +0200 add account/minimum-presence.py test commit 67b3060de8e98a1f07a6a8b4d742bdd68255c927 Author: Senko Rasic Date: 2010-08-25 12:57:14 +0200 SimulatedConnection: optionally support "hidden" presence commit 7a6b1d91104ec79f47d920d5241a3a6749d4da36 Author: Senko Rasic Date: 2010-08-25 12:56:50 +0200 updated copyrights commit 91448bb75a0e58a2622f52d364b438ae48a99aa0 Author: Senko Rasic Date: 2010-08-25 12:56:10 +0200 combine RequestedPresence and MinimumPresence commit 53d46b1a1dd6f14e1aeda03c9d249078694f8ec0 Author: Senko Rasic Date: 2010-08-25 12:53:49 +0200 implement Account.Interface.MinimumPresence in mcd-account-presence.[ch] commit 8d0698bb98b5b087fa80bbeb722d5e151c10093c Author: Senko Rasic Date: 2010-08-25 12:50:16 +0200 make (_mcd_account_)presence_type_is_settable into internally-visible method commit 0d421a714551f2a336f895a9b1073b0cf5206840 Author: Senko Rasic Date: 2010-08-25 11:49:18 +0200 add Account_Interface_Minimum_Presence.xml commit 1aed923e59e5a3c7d11c2a4529f9b13daadadb80 Author: Simon McVittie Date: 2010-08-24 12:16:36 +0100 Fix some typos that Vivek noticed commit a3f611843e1c27d6a838d1dbbb49e655c7839519 Author: Simon McVittie Date: 2010-08-24 12:14:28 +0100 Update copyright dates for files touched by the requests branch commit b80cc1470a1833049bbac99dc7c11838a17baff2 Merge: 989e204 341e252 Author: Simon McVittie Date: 2010-08-24 12:11:47 +0100 Merge branch 'master' into requests commit 341e252241769f8e55eba57661e9e12814526870 Author: Simon McVittie Date: 2010-08-24 12:02:19 +0100 mcd_account_manager_get_storage_plugin: don't shadow acct(2) from unistd.h Reviewed-by: Vivek Dasmohapatra commit fc1609946119e4c08c75b8a19c7c5222c4dd1ed5 Author: Simon McVittie Date: 2010-08-24 12:05:12 +0100 Bump version to 5.5.3+ to enable -Werror again commit 9b2aa99a6ff54538dcf6296e6df97254dd395b60 Merge: 0d914e1 ab8dbf1 Author: Vivek Dasmohapatra Date: 2010-08-19 14:55:13 +0100 Merge branch 'telepathy-mission-control-5.4' of git+ssh://git.collabora.co.uk/git/telepathy-mission-control commit ab8dbf1d6d5527a79bef37316cb7f895870d62e7 Author: Vivek Dasmohapatra Date: 2010-08-19 13:41:49 +0100 Drop the McdConnection probation timer when the TpConnection is released Also: Check that we haven't accidentally called the timer callback after releasing the TpConnection, as this avoids a SEGV (and g_warn if we find ourselves in this situation) commit 0d914e13cc4a6e84cebb840c0be4d32abaacaddc Author: Vivek Dasmohapatra Date: 2010-08-16 15:57:42 +0100 Irrational co-dependency of commit and commit_one eliminated. There's no point calling commit_one from commit if commit isn't implemented, as commit can only solve this by trying to call commit. Also fixes a logic-loophole which allowed a NULL commit implementation to be deref'd and called. commit 92c5bbdcd9cedbc876f8f6a06c6ff3fc179ec210 Merge: 92c4501 0fc5bed Author: Vivek Dasmohapatra Date: 2010-08-19 13:25:23 +0100 Merge branch 'telepathy-mission-control-5.4' of git+ssh://git.collabora.co.uk/git/telepathy-mission-control commit 0fc5bed249202727b7eb034ab37502e4a024afb1 Author: Vivek Dasmohapatra Date: 2010-07-19 13:10:12 +0100 More checks on built strings (from coverity report) commit b4463ae864beab551262778868c60104da572216 Author: Vivek Dasmohapatra Date: 2010-07-19 13:08:18 +0100 Unused variable commit 92c4501acdc358a63df43420c871152b01332d41 Author: Will Thompson Date: 2010-08-18 19:09:54 +0100 McdAccount: Correctly chain up to constructed Reviewed-by: Vivek Dasmohapatra commit 7a9bd3f12197c5d85ad3c2741d1481f0303cafee Merge: 4e75c43 f44d79e Author: Simon McVittie Date: 2010-08-11 16:27:52 +0100 Merge branch 'trivia' Reviewed-by: Vivek Dasmohapatra commit f44d79edc8be2a35f133f29a557cd0e652fc877b Author: Simon McVittie Date: 2010-08-11 16:19:38 +0100 Delete old examples These are no longer exemplary; people should use telepathy-glib or telepathy-qt4 instead of libmcclient. commit fb865d918fa135d03451ccc56cd7bc6ea127c639 Author: Simon McVittie Date: 2010-08-11 16:17:09 +0100 server, util: fix CPPFLAGS/LDADD for recent ld versions - use AM_CPPFLAGS instead of the deprecated equivalent INCLUDES - use GLIB_CFLAGS but not DBUS_CFLAGS (mc-server.c doesn't actually use any dbus-glib functionality directly; neither do the utils) - put our own include directories first, then everything else in stack order, lowest first - explicitly link against telepathy-glib and GLib, since we use their symbols (fixes linking with gold(1)) commit 4e75c43eca3737f2501e46bda0b74e9478637ac5 Author: Vivek Dasmohapatra Date: 2010-08-09 18:48:04 +0100 Only honour scheduled saves when we have actual differences to commit. commit dce04726ee40004fc0688d7ccc52ab4ef3833382 Author: Vivek Dasmohapatra Date: 2010-08-09 18:48:04 +0100 Don't flush unchanged settings to SSO commit 600c5c17cf040bcc3d17a8f9ef776b070d270b4a Author: Vivek Dasmohapatra Date: 2010-08-09 18:48:03 +0100 Don't flush the enabled state if the SSO state is functionally equivalent The state is a pair of booleans in SSO, but a single flag in MC, so we lose information if we unconditionally write to SSO - only flush the state to SSO if their configuration would result in a different status from the one we require. commit 8e70faef11543709c24db9d4bea4d1512072aeb8 Author: Eitan Isaacson Date: 2010-08-04 12:11:16 -0700 Make McpStoragePlugin retrieval in McdAccount safer. Don't do a g_return_if_fail, instead return empty results in external storage API calls. commit b23cd067fce751f820ae70a03c39613ca0180795 Merge: c48e35e 8c0b868 Author: Eitan Isaacson Date: 2010-08-04 10:02:52 -0700 Merge branch 'account-storage' commit 8c0b868f5ee65bd3e120186071f8e9aa250b94b6 Author: Eitan Isaacson Date: 2010-08-02 17:09:30 -0700 Retrieve the account storage plugin lazily. Apparently mcd_account_manager_get_storage_plugin can be called too early when the account is created, before it is written to the storage plugin. This patch makes it reference the account storage plugin lazily when needed, and to fail when it can't retrieve it. I tried to have it retrieve the storage plugin consistently at a later stage, but there is no way of knowing when the account is written to the storage plugin since there are multiple code paths. So this seemed like the safest choice. commit 49e5b5fd70eb7bcd110171b8562697ce99bb7cd3 Author: Eitan Isaacson Date: 2010-07-18 22:52:21 -0700 Remove references to McSvcAccountInterfaceStorage commit d7569ccc7fa071790afa2de54fb34605b857963e Author: Eitan Isaacson Date: 2010-07-05 12:05:26 -0700 Added maemo accounts support for Account.Storage API. commit a15d2973a136b81c4268e0f2463507d9b6bbb7d6 Author: Eitan Isaacson Date: 2010-06-15 14:55:02 -0700 Implented default Account.Storage API. commit 39faeb93baf6c3d5cd0c23ab086621a4169af928 Author: Eitan Isaacson Date: 2010-06-08 10:40:20 -0700 Remove warnings. commit c48e35ea2c9ae79f36884123f93344bd15ea0adb Merge: bfd0469 929dc97 Author: Vivek Dasmohapatra Date: 2010-07-30 13:17:15 +0100 Merge branch 'telepathy-mission-control-5.4' commit 929dc974509a172d9a0ad6c3bd9931171e75ba9d Author: Vivek Dasmohapatra Date: 2010-07-27 20:01:35 +0100 Can't use the AvatarRetrieved signal to find out if an avatar has been removed The signal only fired for those contacts that had an avatar, so if the connection signals that the avatar has been updated, and we then try to fetch the avatar via this signal, we simply never receive any data and the avatar we have never gets erased. commit ced3e32094b11970653227e78dbe7c3bd8515c8f Author: Vivek Dasmohapatra Date: 2010-07-29 17:11:07 +0100 Implement a test for a remote client unsetting our avatar commit bfd0469b8f260dd23070ebbd2420197380c13331 Author: Vivek Dasmohapatra Date: 2010-07-22 16:19:00 +0100 ABI has been added, update configure.ac variables commit 37c810c38c3d65f559c3b8a4654c913cfca4e5e9 Author: Vivek Dasmohapatra Date: 2010-07-22 16:01:10 +0100 Prepare NEWS and configure.ac for a release commit decbf7cd61cf44d8134c02aa55a7c74b0e9fcf91 Author: Vivek Dasmohapatra Date: 2010-07-22 14:10:49 +0100 freed GStrv may not be set, so should be initialised to NULL commit a1e401dc5e0fcb48022a53e0603ccdeb38927b61 Author: Vivek Dasmohapatra Date: 2010-07-21 16:56:31 +0100 SSO plugin should claim all setting for accounts it knows about commit 97bf09dd1dcfc6923288c4d54cad37b24bc795a0 Author: Vivek Dasmohapatra Date: 2010-07-21 16:56:31 +0100 Make the debugging of account storage plugins in the AM clearer commit 027a1ce8e7b2b2840941acc8e54c0b01020e5db7 Author: Simon McVittie Date: 2010-07-19 12:43:39 +0100 Update NEWS commit 27120189211ad52fba7d9870f6eed6d39cb28d7a Merge: d57126d 479174b Author: Simon McVittie Date: 2010-07-19 12:33:17 +0100 Merge branch 'rescue-mission' Reviewed-by: Vivek Dasmohapatra commit 479174b603f1ac2cd871a07125fd18dbc0eeabf8 Author: Simon McVittie Date: 2010-07-19 10:54:55 +0100 Fix over-zealous search/replace in ensure-and-redispatch.py commit 97a0efa95f0e80b6658a9a38021f7765f7d67d28 Author: Simon McVittie Date: 2010-07-19 10:53:13 +0100 plugin-account: unique_name: move g_free into the loop to avoid leaking We now allocate once per loop, so we need to free once per loop. Also narrow the scope of some local variables to make their usage clearer. commit 0360f89686f4f52fe2f2aea674e71f4897f88b34 Author: Simon McVittie Date: 2010-07-16 13:06:35 +0100 dispatcher/ensure-and-redispatch.py: test fd.o #24645 commit 70e1416243ed8bd88353e0e052aa9f8b241b9af0 Author: Simon McVittie Date: 2010-07-16 13:05:39 +0100 fd.o #24645: _mcd_dispatcher_reinvoke_handler: try to use the same Handler If a process has Handler well-known names A and B, and a channel that was already passed to A's HandleChannels implementation is returned by EnsureChannels, we want to call HandleChannels on A if it still exists, or failing that, B if its filter matches the channel. This is particularly useful if A was a PreferredHandler with an empty list of filters, as used by the proposed tp_account_create_channel_and_handle_async(). commit 88106ea7b1557c453fc9af3083505de5e98d4157 Author: Simon McVittie Date: 2010-07-16 13:01:51 +0100 McdHandlerMap: remember which Handler well-known name is responsible for each channel commit 0ebc29a5c62be843090f09f488876ec6ca8bd521 Author: Simon McVittie Date: 2010-07-16 12:09:42 +0100 dispatcher/ensure-and-redispatch.py: give the better handler a valid filter The channel's immutable properties contain Interfaces, an 'as', which isn't valid in a filter. commit 4631b0a4f1878a0d8b8f542319f6b99c96abcdc0 Author: Simon McVittie Date: 2010-07-16 12:04:16 +0100 mcp-dbus-caller-permission: don't shadow link(2) commit ad4312f564cfd5adbec9e73eee3c92c69b9750fb Author: Simon McVittie Date: 2010-07-16 12:00:51 +0100 mcd-account-manager-default: don't shadow acct(3) Also rename a GHashTableIter from account to iter, for least-astonishment. commit 286307447f8977a4fddf3dbee0b7374b88c3e57d Author: Simon McVittie Date: 2010-07-16 11:57:42 +0100 plugin-account: avoid sprintf, and remove limit of 1024 colliding accounts Re-using the same buffer saves one g_malloc per colliding account. Given that colliding accounts are a highly unusual case, it's just not worth it; let's have clearer and less error-prone code instead. commit fbf163fb378a10a439b48cbb25a628a364c2fbf1 Author: Simon McVittie Date: 2010-07-16 11:54:46 +0100 plugin-account.c: unique_name(): don't crash if 'account' is not a string commit 47541d798fc98ce4d2fd974a4e307bd61c56f9b8 Author: Simon McVittie Date: 2010-07-16 11:48:15 +0100 Don't shadow BSD acct(3) from unistd.h commit d57126d74cdf12f231575199cfea0ff8e9c7f3a9 Author: Vivek Dasmohapatra Date: 2010-07-15 13:47:04 +0100 Typo in comment. commit 1fcef50dd654ec93a021b430c0f32af496ae89bb Author: Vivek Dasmohapatra Date: 2010-07-15 13:43:15 +0100 Typo in header guard #define symbol name commit 650aaccdfa1f388909593f429b54cb3599ecb0c0 Merge: 7f1a3f0 99a0c91 Author: Vivek Dasmohapatra Date: 2010-07-15 12:57:07 +0100 Merge branch 'libcreds-demo' commit 7f1a3f00afefd38d9b86127ceeee2c009a5814ee Author: Will Thompson Date: 2010-07-07 17:55:42 +0100 Document mc-tool service in the manpage. commit 68424b9c018c4b61d260589bcc122e3c37f52711 Merge: a4f8545 f0c43a2 Author: Vivek Dasmohapatra Date: 2010-07-07 15:45:56 +0100 Merge branch 'sso-updates+service-property' commit f0c43a27d926ffbabc3594bd93f22018f7716ae9 Author: Vivek Dasmohapatra Date: 2010-07-05 18:48:19 +0100 Fix braino in comment commit cde89a1ea59cbb3e5eca5b2a46cafbf4f5a5d73c Author: Will Thompson Date: 2010-07-04 11:41:22 +0100 Add 'service' support to mc-tool mc-tool still can't create accounts with a particular service up-front, but it can (try to) set it on existing accounts. (We need to bump the tp-glib dependency to get tp_account_set_service_async().) commit a1f7cc8ab56c4f3158ff4ad914f27c33342c6d32 Author: Vivek Dasmohapatra Date: 2010-07-02 18:47:01 +0100 Implement Service property for SSO accounts commit 3eebea2b5e1141e6710158b25619f949fd7d1608 Author: Vivek Dasmohapatra Date: 2010-07-02 18:46:44 +0100 Implement new Service property on account interface commit 0a04ccfc2b93210f79d53288012e7f606956e217 Author: Vivek Dasmohapatra Date: 2010-07-02 18:45:26 +0100 Tests for new Service account property commit b0368acc4ba16a83cbc70183caf1a53952a50808 Author: Vivek Dasmohapatra Date: 2010-07-07 14:53:40 +0100 clear_setting_data() should always be called on a Setting * from setting_data() commit 12aebc76aa8ddacf08905bf02357a13b2e893735 Author: Vivek Dasmohapatra Date: 2010-07-07 14:38:50 +0100 Explain what's going on with the new internal-property-changed method+callbacks commit 73f16c5844184fa6a88dd3cc858a436bfbfdcace Author: Vivek Dasmohapatra Date: 2010-07-07 14:11:06 +0100 Can't remove the watch hash entry until the individual watches have been removed commit 143885cfa7d023800551820fb3253649469697bf Author: Vivek Dasmohapatra Date: 2010-07-02 12:59:12 +0100 Haul all the parameter name mapping/global/service/etc logic into one place. The handling of settings between MC and AG (which each have their own naming conventions and semantics) had grown organically and empirically and needed to be re-worked (now that we have a better idea of what needs to be done to get it right). commit a4f8545516b5e7dedc1d9b05d2ec34e584e651a5 Merge: d51a8ae 66680da Author: Will Thompson Date: 2010-07-02 11:16:04 +0100 Merge branch 'telepathy-mission-control-5.4' commit 66680dac767c5ae06abe306ce4e000041c105751 Author: Will Thompson Date: 2010-07-02 10:36:22 +0100 Treat calls ended locally with No_Answer as missed If the actor is the self handle, and the reason is No_Answer, then something on our side (either the CM or some client) decided we weren't going to answer and gave up. From the user's PoV, these calls are missed, so mark them as such. commit b9efeff6d131946b18f50584ad69341c01d7a5d9 Author: Vivek Dasmohapatra Date: 2010-07-01 20:57:40 +0100 property_changed_cb now only passed as a callback once, fix signature & warnings commit 8560edb3620021e4e69a9e03d26e6753bed13db0 Author: Vivek Dasmohapatra Date: 2010-06-30 12:36:06 +0100 Handle the single changed property signal from storage backends commit 746ad961203ee9d4ddeccf50d80b8a1f96739153 Author: Vivek Dasmohapatra Date: 2010-06-30 12:30:54 +0100 Method to let the AM notify the account that an account property has changed commit 8a5413806eaacbda841563180f21608ef15a4001 Author: Vivek Dasmohapatra Date: 2010-06-30 12:36:47 +0100 Emit the single changed property signal instead of the whole-account one commit 3e7daa0d6c52c1fde1b5f17486f02d25adbd4759 Author: Vivek Dasmohapatra Date: 2010-06-30 12:35:35 +0100 New signal - flags a single changed property from a backend to the AM commit 1bfdbd5b2310682852a6c264929a299da7e2ab96 Author: Vivek Dasmohapatra Date: 2010-06-25 16:31:14 +0100 Signal emitted on wrong object commit fdaead7365cc3b39606417970278da25df543650 Author: Vivek Dasmohapatra Date: 2010-06-25 16:30:54 +0100 Filter some keys from the watch list (immutable or monitored elsewhere) commit b3c4d999d3bfc3f0a744fbf3cf5a70f0da8f408a Author: Vivek Dasmohapatra Date: 2010-06-25 14:14:37 +0100 Watch SSO keys for updates originating from other processes commit d51a8aec93a05d8e8d66f96a50be993481494cd0 Author: Vivek Dasmohapatra Date: 2010-06-29 12:17:50 +0100 Disable deleted accounts so we don't leave connections holding refs to them This resulted in accounts that were online when deleted silently vanishing from the store without the account removal signals and so forth happening, leaving an online account in an orphaned CM. commit 2956b90df826ed716d99ea8589b33355b1fa7f14 Merge: 5dd81e2 386accf Author: Will Thompson Date: 2010-06-16 16:23:55 +0100 Merge branch 'telepathy-mission-control-5.4' commit 386accfd4645ede0743dc5500fe09a350d3dff68 Author: Will Thompson Date: 2010-06-16 15:59:50 +0100 Reduce INITIAL_RECONNECTION_TIME to 3 seconds This gives us pretty much the same progression, but with the first reconnection happening fast enough for the test suite. commit b84bb07cc573169028224c3d9958750f20acfa73 Author: Will Thompson Date: 2010-06-16 15:44:13 +0100 Add a #define for the reconnect interval cap commit 0884d14b2be3dc6b2c992bd63bdfd76c3d6fcca1 Author: Will Thompson Date: 2010-06-16 15:38:48 +0100 Attempt to reconnect less frequently. The previous constants made MC really keen. Trying again after 1 second is fine if the CM crashed, but the normal situation is that the server fell over, or the network is broken, in which case 10 seconds, 30 seconds, 1½ minutes, 4½ minutes, 13½ minutes, then every half hour seems a lot more reasonable. commit 0692f156df434142231f53f37dd03d87eab38ff1 Author: Will Thompson Date: 2010-06-16 15:36:34 +0100 Include reconnection time in debug message commit 1e7a95255453b727079e68f7077b311cb40fc570 Author: Will Thompson Date: 2010-06-16 15:35:59 +0100 Add a #define for reconnection timeout multiplier commit 5dd81e2d0cbd3523704e71d6ad679c5d18c07c73 Author: Simon McVittie Date: 2010-06-16 15:10:09 +0100 Nano version commit b02718b8d943a65b16e7fea1cbdafceb6574a5bb Author: Simon McVittie Date: 2010-06-16 14:32:00 +0100 Prepare version 5.5.2 commit 2776ff74b764ac348260aa8d42a4cfdafad6cc50 Merge: c786e7c a14a431 Author: Simon McVittie Date: 2010-06-16 13:59:02 +0100 Merge branch 'telepathy-mission-control-5.4' commit a14a43178eddc5e199abecc1d665a41e45bf772f Author: Simon McVittie Date: 2010-06-16 13:54:47 +0100 Nano version commit 3aa2164dc85d66bde3033bdc3e77bf399260214f Author: Simon McVittie Date: 2010-06-16 12:23:39 +0100 Prepare version 5.4.3 commit 92fc828a2f64900cb427869dc42210cae8d9b1b9 Author: Simon McVittie Date: 2010-05-26 18:44:23 +0100 Enable ERROR_CFLAGS in every Makefile.am that compiles C commit f30c6e3cb84fb67b097e3fc84761078ede4c090e Author: Simon McVittie Date: 2010-05-26 18:43:07 +0100 configure.ac: remove alleged AM_CFLAGS that were never actually used for anything commit 66e75a56da3ef41eae076104e149687f704d7a7c Author: Simon McVittie Date: 2010-05-26 13:08:11 +0100 Remove obsolete datadir_expanded check from configure.ac We use g_get_system_data_dirs() etc. now. commit 4719e9a639e53f96699ccbd475f08b1d9d7c5e38 Author: Simon McVittie Date: 2010-06-16 12:01:40 +0100 Add code to a couple of existing tests to verify that serialization in key files is as intended (Backported from master to not expect account storage to be diverted) commit d398ad3a7468d8e9950374735411ac9e7f49c532 Author: Simon McVittie Date: 2010-06-15 19:01:26 +0100 _mcd_account_dup_parameters: if unable, explain why commit bc1b5f1ceea27dbe713217d2dd3e159ad0445b4d Author: Simon McVittie Date: 2010-06-15 18:29:36 +0100 McdAccount: clear_register_dup_params_cb: survive if params is NULL It can be NULL in crash-recovery.py, apparently. Unfortunately, the async implementation doesn't tell us why it failed, only that it did. commit 42555e448cfdd8b191ccbe952ff1e91b6994341b Author: Simon McVittie Date: 2010-06-15 18:01:52 +0100 account-manager/recover-from-disconnect.py: comment why register=True commit 704f30899161c124e16ef084289794e51cc85d37 Author: Simon McVittie Date: 2010-06-15 17:52:54 +0100 Remove duplicate call to _mcd_account_set_parameter() commit 549147aadbabcd86464e9cf924c95d8433f6ef34 Author: Simon McVittie Date: 2010-06-07 19:37:39 +0100 fd.o #28118: clear the 'register' flag when an account goes to CONNECTED commit c786e7caf31fe178d9c8252857068deb3bb3c81c Merge: b5ba07f cac2333 Author: Simon McVittie Date: 2010-06-16 11:57:11 +0100 Merge branch 'unregister' Reviewed-by: Guillaume Desmottes commit b5ba07f2e899ca1263a3f9f20371a57eaaa65467 Merge: 54c1c8f 3a3389f Author: Simon McVittie Date: 2010-06-16 11:40:12 +0100 Merge branch 'only-flush-changed-accounts' Reviewed-by: Will Thompson commit 54c1c8f6d4f3daac868197b807fe64041486cbe1 Merge: 5d52cfe cdd0f4f Author: Simon McVittie Date: 2010-06-16 11:15:11 +0100 Merge branch 'backslash' Reviewed-by: Vivek Dasmohapatra commit 3a3389f92858c6b0870f5593202c1d14237d8a30 Author: Simon McVittie Date: 2010-06-16 11:13:15 +0100 mcd_account_manager_write_conf_async: pass the intended account to update_one_account commit bd37e72ef995e023522fcd94a2265bf61028a608 Author: Simon McVittie Date: 2010-06-16 11:12:56 +0100 McdAccountManager: update_one_account: document that @account may be NULL commit 110206d8fb4ad86f5b89811ae38080a21c06d505 Merge: 5d52cfe b1569da Author: Simon McVittie Date: 2010-06-16 11:03:57 +0100 Merge branch 'only-flush-changed-accounts' Reviewed-by: Will Thompson commit cdd0f4fe73d5e593e7d3806983ad47296777976f Author: Simon McVittie Date: 2010-06-15 19:54:18 +0100 Add code to a couple of existing tests to verify that serialization in key files is as intended commit dd4f741a4b1ddd9152173336fc9360ad25d26407 Author: Simon McVittie Date: 2010-06-15 19:53:50 +0100 default and diversion plugins: don't escape values from MC as strings again MC gives us a string that has been serialized into something .desktop compatible. If we escape it again, we'll double the number of backslashes compared with MC < 5.4. commit 84a3808905f2e87ffca975db8a055d8d3b33d405 Author: Simon McVittie Date: 2010-06-15 19:52:30 +0100 fd.o #28557: McdPluginAccountManager: use g_key_file_set_value when receiving a value from plugins When we give plugins something to store, it comes from g_key_file_get_value, so it's already been escaped according to .desktop syntax. When we get it back from the plugin, if we escape it again, we'll double the number of backslashes every time. commit cac2333a7956cc97a5acab8cfd3d30187e46a98c Author: Simon McVittie Date: 2010-06-15 19:01:26 +0100 _mcd_account_dup_parameters: if unable, explain why commit f4de0b512bef298c16079b08f3e83b112294d63c Author: Simon McVittie Date: 2010-06-15 18:29:36 +0100 McdAccount: clear_register_dup_params_cb: survive if params is NULL It can be NULL in crash-recovery.py, apparently. Unfortunately, the async implementation doesn't tell us why it failed, only that it did. commit 92b715d217e5a5bcf2718cb910958168b6f182b9 Merge: e261ac0 5d52cfe Author: Simon McVittie Date: 2010-06-15 18:05:02 +0100 Merge branch 'master' into unregister Conflicts: src/mcd-account.c test/twisted/account-manager/recover-from-disconnect.py commit e261ac07a489f68a45d82fc73a082dcde1c4efc1 Author: Simon McVittie Date: 2010-06-15 18:01:52 +0100 account-manager/recover-from-disconnect.py: comment why register=True commit d60519d0da47b422cfcd0e1fa3df05cb1179b96c Author: Simon McVittie Date: 2010-06-15 17:52:54 +0100 Remove duplicate call to _mcd_account_set_parameter() commit 5d52cfe22b8643959d0dd64d8ef5c715a437639b Merge: b4b6725 a2b55cb Author: Simon McVittie Date: 2010-06-15 17:40:25 +0100 Merge branch 'connection-error' Reviewed-by: Guillaume Desmottes commit b1569da8b42049f67bb00bc8377b9cfa05821865 Author: Simon McVittie Date: 2010-06-15 17:36:22 +0100 Revert AccountStorage commit() method to commit all accounts, and add optional-to-implement commit_one() We don't need to break API straight away to get this bug fixed. commit a2b55cb75d0bf5865effdfd62b7b12204a45a023 Author: Simon McVittie Date: 2010-06-14 16:48:44 +0100 Check that the ConnectionError[Details] properties work commit 3988709dcc9022c254f4cf3f276ff8b3a88eab3f Author: Simon McVittie Date: 2010-06-14 16:48:29 +0100 Implement ConnectionError, ConnectionErrorDetails properties fully This requires telepathy-glib 0.11.7, so require that in configure.ac. commit aaaa6e1277ff5f2407855cdca526af8681fdeb93 Merge: c47409a b4b6725 Author: Simon McVittie Date: 2010-06-14 16:43:11 +0100 Merge branch 'master' into connection-error commit b4b672525723f1555aab1a31f84ef19c52cf1bee Author: Vivek Dasmohapatra Date: 2010-06-11 16:24:09 +0100 Unused/shadowed variable declaration commit b83b65230d45f4c3caf38ce908fad45fec161f6e Author: Vivek Dasmohapatra Date: 2010-06-11 16:17:40 +0100 Global enabled flag must be turned on when the local one is If we don't do this, any account ettempting to make the transition from disabled → enabled will simply bounce back to disabled immediately. commit 3a0f11b7b93ead7e187ca6b820389302dd5a7d82 Author: Vivek Dasmohapatra Date: 2010-06-10 16:43:23 +0100 Don't call tp_svc_account_emit_removed, gets handled by McdAccount disposal commit 2d31eaeb1d96841a2d8d1fc6323fbb85366fa1e3 Author: Vivek Dasmohapatra Date: 2010-06-09 19:11:44 +0100 The label key (name, DisplayName) must be flagged as global so it gets fetched commit bc59fcb18c9c46e850de3b5b8243b114420374c4 Author: Vivek Dasmohapatra Date: 2010-06-09 18:27:41 +0100 The global service has no type: we are always interested in its enabled flag commit 70b2dff9c505381cd979320615d4ee5594c236e3 Author: Vivek Dasmohapatra Date: 2010-06-09 16:39:47 +0100 Warnings promoted to errors after rebase to master, misc tweaks to fix same commit 526277cb2e0aa9a01855170c903427872aae1d7f Author: Vivek Dasmohapatra Date: 2010-06-09 16:38:25 +0100 Remove temporarily disabled callback, unused definitions forbidden after rebase commit bc4d0f4adc65c0325e0231bea825c394d12fdd10 Author: Vivek Dasmohapatra Date: 2010-06-09 16:37:16 +0100 Missing header included commit 4f0bfe3e7397cbf37df7ee6dc15dd032d2ceab45 Author: Vivek Dasmohapatra Date: 2010-06-09 15:41:21 +0100 Implement account-updated signal handler (not connected up yet) Seems to do the right thing when connected, but the signal itself is not firing when I expect it to (this may be a bug in libaccounts or a misunderstanding on my part): Have disabled the code that connects the signal for now for this reason. commit 481e610ae31ff356210da10b70074443a5b0561a Author: Vivek Dasmohapatra Date: 2010-06-09 15:36:32 +0100 Hook up the account enabled/disabled signal when we cach an SSO account commit bdf7c5110df10a790df5f6ff9f8897ff6954bad4 Author: Vivek Dasmohapatra Date: 2010-06-09 15:33:49 +0100 The SSO "name" key maps to the MC "DisplayName" key commit 4a70382a58f7b3b7a7fa75600aba8216e5f1c226 Author: Vivek Dasmohapatra Date: 2010-06-09 15:32:38 +0100 Use the new helper functions to get/set the enabled state in SSO commit 0d86aeed97c00d9e3a8351f0a4552c2a8785849e Author: Vivek Dasmohapatra Date: 2010-06-09 15:28:37 +0100 Helper functions to get/set the enabled state of SSO accounts SSO accounts have a global enabled flag (the master enabled flag) as well as per service enabled flags: Both flags must be true to enable an SSO account, but either being off disables it. commit 7e556e7b4fac1b6dbaca933593edd4a2573ddf8e Author: Vivek Dasmohapatra Date: 2010-06-09 15:17:45 +0100 Fix data transmitted with deleted signal (name was prematurely freed before) commit 855d672de1469eacc96223b1f2feac7585871807 Author: Vivek Dasmohapatra Date: 2010-06-09 15:10:07 +0100 Callback chain to handle account-altered signals from backends commit cef2bb472058c36fd5a47cd6b9b3793bf6f01ba9 Author: Vivek Dasmohapatra Date: 2010-06-09 15:05:00 +0100 Tidy up debugging for backend account enabled/disabled signal handler commit e3de2cb8b3272d8d346749b59f824e6ef3d5342b Author: Vivek Dasmohapatra Date: 2010-06-09 15:04:04 +0100 Finish handling account deletion events from backends Cleanup refs to account, emit Tp signals. commit 3c277cf94f1466aeadb7e4445df30dd528040f21 Author: Vivek Dasmohapatra Date: 2010-06-09 14:55:52 +0100 Implement new list_keys method in shim object for account manager/plugins commit db2c574585ef2d2ec7e0dda982b57efa40005681 Author: Vivek Dasmohapatra Date: 2010-06-09 14:55:28 +0100 new account manager/plugin shim object method - list_keys commit 2b9b455c97949741edabacfa897f1adb245d6fbf Author: Will Thompson Date: 2010-06-09 12:53:13 +0100 Only flush changed account details to disk. Previously every time any property of any account changed, every account was flushed to storage. This is really, really bad if you use gnome-keyring, because it meant a pair of calls to Unlock()/CreateItem() for each secret on each account, every time anything changes. On my machine, signing in 6 accounts entailed 384 pairs of calls — 64 per account! Furthermore, it seems that the implementation of CreateItem() calls fsync(), so my hard disk would thrash for about thirty seconds. This patch adds an optional argument to mcd_account_manager_write_conf_async() and mcp_account_storage_commit(), indicating which account changed. If NULL, everything is flushed; if non-NULL, only that account is flushed. In my testing this reduced logging in to 9 Unlock()/CreateItem() pairs, which is still more than zero, but stops the disk thrashing quite so badly. Removing accounts doesn't cause the secrets to be removed from the keyring... but that's not a new bug. Everything else seems to work as expected. I didn't update the libaccounts-glib backend to benefit from this, but given that all it does is iterate across all accounts and call two methods on each, it should be easy enough. Mitigates: http://bugs.freedesktop.org/show_bug.cgi?id=28390 commit 23342ff5da50650e8336aace80b545f5cc001331 Merge: 82662db 92f8ba0 Author: Simon McVittie Date: 2010-06-07 19:47:46 +0100 Merge branch 'trivia' commit 92f8ba0c6472696d906340407854470e24fbce44 Author: Simon McVittie Date: 2010-06-07 19:43:27 +0100 Make AM_CFLAGS matter in src/ again Setting libmcd_convenience_la_CFLAGS to any value, ever, disables use of AM_CFLAGS for those source files. INCLUDES is what we want here. commit e12b12bb7b442f21ef5e5e76277dc2db3b6bf6b4 Author: Simon McVittie Date: 2010-06-07 19:43:23 +0100 Fix an assortment of compiler warnings commit 1a60034da6845195948d720dbb9481b2373fd35b Author: Simon McVittie Date: 2010-06-07 19:37:39 +0100 fd.o #28118: clear the 'register' flag when an account goes to CONNECTED commit c47409a249a59c980f87f4e320217f0045758589 Author: Simon McVittie Date: 2010-06-07 18:38:32 +0100 recover-from-disconnect.py: test detailed D-Bus errors commit a0f67dee25d9a97220c736467297393415ae6637 Author: Simon McVittie Date: 2010-06-07 18:33:43 +0100 mctest: add the ability to emit ConnectionError commit 96f555be20529cd91a1d0f4c50a52fd61570f3e4 Author: Simon McVittie Date: 2010-06-07 19:02:41 +0100 account-manager/auto-connect.py: test connection details being emitted together commit d05e9d029244e1e789b5e77d9f9f9e031dc7579f Author: Simon McVittie Date: 2010-06-07 18:07:34 +0100 McdAccount: keep track of ConnectionError[Details], and emit them in signals telepathy-glib support will be needed to have them as properties too. commit ac9d2eaffc1cc0ddf7dfa2d68181646abf50734a Author: Simon McVittie Date: 2010-06-07 17:52:07 +0100 _mcd_account_set_connection_status: emit change notifications for all related properties If the ConnectionStatus changes, we should put the Connection in the signal too, even if its value hasn't actually changed - it makes the signal easier to interpret. commit 4788d069be838ecc290114d098c394f3275b28e4 Author: Simon McVittie Date: 2010-06-07 18:33:33 +0100 account-manager tests: don't assume the next ConnectionStatus change will be to CONNECTED This is about to become untrue. commit 4a3304105563bbe8ff27f54fffa2232625738599 Author: Simon McVittie Date: 2010-06-07 17:48:10 +0100 _mcd_account_set_connection_status: only emit a change to Connection if something changed commit 50043605991025a0359233a61346e621b988388f Author: Simon McVittie Date: 2010-06-07 17:46:03 +0100 _mcd_account_set_connection_status: take a detailed error commit 7fe075cae4a60580e54091423561e413cfd1774e Author: Simon McVittie Date: 2010-06-07 17:45:25 +0100 McdConnection: emit TpConnection in CONNECTION_STATUS_CHANGED even when invalidated It's still referenced at this point, and emitting it here will let the McdAccount interrogate it to get the detailed connection error. commit 3f0403f0a871d1991098c0b8d50ca13d30dcdebe Author: Simon McVittie Date: 2010-06-07 17:44:24 +0100 _mcd_account_set_connection_status: only save the TpConnection if it's trying to connect commit d879726fea2fe55c33057ecf87901c48f8d180d2 Author: Will Thompson Date: 2010-06-06 16:57:13 +0100 Remove deprecated-and-unused mcd_account_manager_write_conf() commit 82662dbe3347109d2621c15a15a02dd4855f869b Author: Danielle Madeley Date: 2010-06-03 22:24:51 +1000 Nano version commit 9e2634a1cc47a9cc52c8bdf62cac2691a0d9ee43 Author: Danielle Madeley Date: 2010-06-03 22:15:32 +1000 Prepare release 5.5.1 commit 8674090dffeae2a9a6dc029afd133fdda2eed860 Merge: 5c3568a e509346 Author: Danielle Madeley Date: 2010-06-03 22:07:23 +1000 Merge remote branch 'smcv/plugin-doc' commit 5c3568a2a91420a27120612ef0730ec968dfc6a6 Author: Danielle Madeley Date: 2010-05-28 12:59:53 +1000 Implement ::toggled for McpAccountStorage plugins This allows an McpAccountStorage plugin to enable/disable an account. commit be025b57f399050908e228cc05828d82f66dbc34 Author: Danielle Madeley Date: 2010-05-27 20:54:04 +1000 Change startswith() to strip_prefix() to be clearer about what it does Make it return const, because it doesn't allocate a string. Change prefix() to ensure_prefix() Change strip() to skip_prefix() and make it return const commit e990954870d791e2623a927f85cc120d3a51a51d Author: Danielle Madeley Date: 2010-05-27 15:45:35 +1000 Update copyright for mc-tool commit 57cf63d319353fe860df91dfe9886d39ac1d9b3d Author: Danielle Madeley Date: 2010-05-27 14:40:05 +1000 Port from McAccount to TpAccount - Part 2 This reenables NormalizedName and AutomaticPresence by requesting those properties directly from the Account Manager, since they are not exposed via TpAccount. commit c54b2ee9384a902ff1488ce3f4027484439fc115 Author: Danielle Madeley Date: 2010-05-27 14:13:36 +1000 Port from McAccount to TpAccount - Part 1 This ports all features that use TpAccount and disables features that are not available through TpAccount (AutomaticPresence and NormalizedName). commit 062d2ea9dc1a1cd8dcd478d4243473f26354feaf Author: Danielle Madeley Date: 2010-05-27 12:32:33 +1000 Port from McAccountManager to TpAccountManager commit 58b12e4a39f8bd1c6c77e41b75d038c73db572d3 Author: Danielle Madeley Date: 2010-05-27 12:12:44 +1000 Replace account_prefix with TP_ACCOUNT_OBJECT_PATH_BASE commit fe2d061111a346f6c730286f8a8b7be620bd135d Author: Danielle Madeley Date: 2010-05-27 11:59:01 +1000 Change names of variables that shadow global functions Allows compilation with -Wshadow Changes: 'acct' -> 'account' 'daemon' -> 'dbus' commit 0398ea62880803d2ec68b088e6a4e0ec21f41c78 Author: Simon McVittie Date: 2010-05-26 19:25:03 +0100 Nano version commit 57ef8f9c6762ab0fc1d15991a15781e52ddff68d Author: Simon McVittie Date: 2010-05-26 19:04:43 +0100 Prepare release 5.5.0 commit 69d44b7e012282fe8a0d54c9828edd87c41a0304 Author: Simon McVittie Date: 2010-05-26 18:50:24 +0100 Update NEWS commit 65d3d66a1e739b1670997b1d91ad0c62e4d67916 Author: Simon McVittie Date: 2010-05-26 18:44:23 +0100 Enable ERROR_CFLAGS in every Makefile.am that compiles C commit eba54b4d4bfdb2132a224c3ce6b5c9aa594022f4 Author: Simon McVittie Date: 2010-05-26 18:44:08 +0100 Include "plugin-loader.h" where needed commit 9104ba032d388ef036aa3dc8eeb40bcbc1b5823b Author: Simon McVittie Date: 2010-05-26 18:43:57 +0100 McdAccountManager: delete unused variable commit 902be44973e3a03ebaf54ae193faa1c9cca7b597 Author: Simon McVittie Date: 2010-05-26 18:43:40 +0100 libmcclient/mc-dispatch-operation.c: add missing header for tp_g_hash_table_update commit a882183f60dea827efe6add35567379de5c6257d Author: Simon McVittie Date: 2010-05-26 18:43:07 +0100 configure.ac: remove alleged AM_CFLAGS that were never actually used for anything commit 00c1c83ccc1516eb08908657cba5d950f08cfdc1 Author: Simon McVittie Date: 2010-05-26 18:39:44 +0100 Now that GModule is mandatory, just include it in GLIB_LIBS commit 079136b04ad5dbb680272a681c73a435eca6da13 Author: Simon McVittie Date: 2010-05-26 18:19:41 +0100 Only install libmcclient.pc if we'll be installing libmcclient commit e53abee95629697235e2abd55583814b8936891c Merge: 72e3925 c7d292c Author: Simon McVittie Date: 2010-05-26 17:56:54 +0100 Merge branch 'plugin-doc-minimal' Reviewed-by: Vivek Dasmohapatra commit 72e392545e630ef8bd4b8cda0766162b053f1335 Merge: b4a1727 f120b06 Author: Simon McVittie Date: 2010-05-26 17:56:26 +0100 Merge branch 'will-this-release-ever-happen' Reviewed-by: Vivek Dasmohapatra commit f120b06cf7b81739b27984bbbad7a27650c8a81f Author: Simon McVittie Date: 2010-05-26 17:53:00 +0100 McProfile: don't dereference a NULL pointer and crash on malformed profiles commit 960369ba77533f8f1d0c351a94593b62735c4c0a Author: Simon McVittie Date: 2010-05-26 17:52:33 +0100 Make it more obvious that g_key_file_get_keys() returning NULL is handled commit 183bd3ba76ab9ba9e661ffa85b85e5db4c725556 Author: Simon McVittie Date: 2010-05-26 17:51:24 +0100 mcp-account-diversion demo plugin: also guard against an error return here See previous commit. commit 917cd7469b3cda60e1b0844267965e735c0f1c3f Author: Simon McVittie Date: 2010-05-26 17:50:13 +0100 Default account storage plugin: guard against g_key_file_get_keys returning NULL If the group in question doesn't exist in the keyfile (typically because an account didn't exist in the GNOME keyring, in the last patch band), the @length argument isn't initialized. We could initialize @length to 0, but that's not very obvious. commit 989e2048934cc5822488524d3813e0d230dc4c5a Author: Simon McVittie Date: 2009-12-18 11:00:15 +0000 McdChannel: when cancelling requests we no longer need to abort REQUEST-state channels Also explicitly close the TpChannel, if we have one. commit 393cb6e272d8178162d38f945069aa0dfe6fe687 Author: Simon McVittie Date: 2009-12-18 10:58:47 +0000 mcd_connection_request_channel: if the channel (request) has failed or been cancelled already, close and discard it commit c95ec5c7c16139fa264ea775ff39a81aa45b74fc Author: Simon McVittie Date: 2009-12-16 19:48:32 +0000 McdRequest: track whether we can safely be cancelled commit a21aa22763cb5e15cb88fb11fba46d00b68a9bed Author: Simon McVittie Date: 2009-12-16 19:35:05 +0000 McdDispatcher, mcd-account-requests: let the McdRequest tell us its status commit 3545baa31aeed9067cc7ad1de3ab65b3a1fc15b3 Author: Simon McVittie Date: 2009-12-16 19:24:14 +0000 McdRequest: signal completion commit dcbdea0f4555dac463f3fc39d217a3857aaafcb9 Author: Simon McVittie Date: 2009-12-16 19:20:42 +0000 McdChannel: propagate our own status to our request, if any commit a75673f34add70162e2fd41f5ddf6d17323e5017 Author: Simon McVittie Date: 2009-12-16 19:20:30 +0000 McdRequest: add a concept of having finished commit 3fff4f5496223e0e1042114f308a77022cbcdc61 Author: Simon McVittie Date: 2009-12-16 19:05:35 +0000 McdRequest: rename denial to failure We can use this as a more general indication of failure. commit 26cb82a134b9e182f162effc9ebb5a171e76cdf0 Author: Simon McVittie Date: 2009-12-16 18:47:21 +0000 mcd_channel_init: make it explicit that the initial status is UNDISPATCHED commit fe85f2dea2a78574e02ebde71fc4ff056df52d01 Author: Simon McVittie Date: 2009-12-16 17:44:00 +0000 Add a regression test for delaying channel creation in a plugin commit 7aaa5b54ca27ab51de3e2b8bd322a31cab7b2318 Author: Simon McVittie Date: 2009-12-16 17:43:08 +0000 McdRequest: support delaying requests while waiting for a plugin commit 6171032b1d982e07662d977a6d56c402d275d940 Author: Simon McVittie Date: 2010-05-26 15:08:05 +0100 McdPluginRequest: implement in terms of McdRequest, not McdChannel commit cf977ecc4a4bf83d199cb0e8864259865d85fb90 Author: Simon McVittie Date: 2009-12-16 16:22:58 +0000 McdChannel, McdPluginRequest: add stub support for delaying requests commit 6d8a535d13e96a68c8ed329dccdbf66c7cd9ba14 Author: Simon McVittie Date: 2010-05-26 15:06:50 +0100 mission-control-plugins: add support for delaying requests commit 7f1fbd6c841ffdcbc685fd19748ce284a09dad9a Author: Simon McVittie Date: 2009-12-16 14:19:15 +0000 McdRequest: store the request's properties commit 92a1b4297b71b136f55f1dd2a797cd2426ee3b04 Author: Simon McVittie Date: 2009-12-16 14:03:44 +0000 mcd_channel_get_channel_type: reimplement in terms of mcd_channel_get_channel_type_quark This prevents any string-lifetime concerns. commit bc7c22cc62c220f0a8aad334fea2bb9d8a0e2aa7 Author: Simon McVittie Date: 2009-12-16 13:58:56 +0000 McdRequest: store the proceeding flag commit 7392a143fdad5499d50c80bda6f4b22ee5b41bcd Author: Simon McVittie Date: 2009-12-16 13:52:52 +0000 McdRequest: store use_existing commit eda1c51c0552e540cfaf2f65e59962b1439abe0f Author: Simon McVittie Date: 2009-12-16 13:47:20 +0000 McdRequest: store the object path commit 91d8f19f7895cf3f738c62b4efea89cc8e300d10 Author: Simon McVittie Date: 2009-12-16 13:45:52 +0000 McdRequest: store the preferred handler commit 109ad4f0414b081d18189aa52f2670cc2cef0c30 Author: Simon McVittie Date: 2010-05-26 15:06:12 +0100 _mcd_channel_get_target_id: remove Nothing called this method, and misleadingly, it only worked on channels that were requests. commit 60e37da24c70f0961d0a2281ffa490dc0811243e Author: Simon McVittie Date: 2009-12-16 13:28:03 +0000 McdChannel: use the McdRequest for the account and user-time There's no longer any need to weak-ref the account, since the request strongly references it. commit adcf6df535ca3b31bd8fdcb3afcfc8730e525f05 Author: Simon McVittie Date: 2009-12-16 13:27:06 +0000 McdRequest: add properties for the account path and the user action time commit e2178d20dc34101acdf3bf53e3b537aaf44745b4 Author: Simon McVittie Date: 2009-11-18 14:13:45 +0000 McdChannel: have an McdRequest if this channel is, in fact, a request commit 1dd4d15647e2e5989bac5c2d11ff625aae49f7af Author: Simon McVittie Date: 2009-11-16 16:38:32 +0000 Add stub McdRequest class commit b36093176f5165f5df8d91401cce9787bfdf8e36 Author: Simon McVittie Date: 2009-12-15 17:47:25 +0000 McdAccount: make the default implementation of check_request just be "let it through" If a specialized version of MC (like OMC) wants to reject channel creation on low memory, it can do that by overriding this method, or by using the new, smaller plugin API. commit e5093465d4fd96973d4b1ee59716db1b8e75a076 Author: Simon McVittie Date: 2010-01-21 20:25:03 +0000 Document the API provided to plugins for dispatch operations commit 3c48d5ddb33e057fe0016b107aede03f5e19569e Author: Simon McVittie Date: 2010-01-21 20:24:44 +0000 Document how to be a dispatch operation policy plugin commit ad536935616e515e5ac181e83b88862cb01bd1a7 Author: Simon McVittie Date: 2010-01-21 20:24:29 +0000 Add stub documentation for McpRequest I'm not documenting this class until the smcv/requests branch lands, since its API gets more capable in that branch. commit a85d7dabe7c88df9bb50c591b241b145c586b367 Author: Simon McVittie Date: 2010-01-21 20:23:54 +0000 Document how to be a request policy Not all of this is strictly true until the smcv/requests branch, which makes request policy plugins able to delay dispatching, is merged. commit efac58c9a03aecb120db3cc25fb1137e383fe35a Author: Simon McVittie Date: 2010-01-21 20:22:48 +0000 Document global functions for plugins commit c7d292c87b26e5ec9cbf0f9559049ec2ebc75876 Author: Simon McVittie Date: 2010-05-26 17:02:13 +0100 Makefile.am: when doing `make maintainer-upload-release`, upload MCP docs commit cf57e89de87b1e8fcc14671a5d191c7a51d2d8e0 Author: Simon McVittie Date: 2010-01-21 20:22:26 +0000 Move MCP_PLUGIN_REF_NTH_OBJECT_SYMBOL, mcp_plugin_ref_nth_object to loader.h This will mean all the loader.h stuff gets documented together in gtk-doc. commit 1b5d0af55ede724f9e5bff7e2e8bf98b22eeb6da Author: Simon McVittie Date: 2010-05-26 17:27:20 +0100 Add infrastructure for documentation completeness checking, but leave it disabled commit 0285cf42d28d2af0aa727ed11cbfdb57eb50faed Author: Simon McVittie Date: 2010-05-26 17:26:54 +0100 Add gtk-doc infrastructure for mission-control-plugins commit 61b7a526279b205476bb649cd47be85feb83b661 Author: Simon McVittie Date: 2010-01-21 20:20:16 +0000 mission-control-plugins: use an internal macro that won't confuse gtk-doc commit b4a17274e0bf622deb710b87206a15e7322dded9 Merge: 447a225 f00511e Author: Simon McVittie Date: 2010-05-26 16:58:22 +0100 Merge branch 'telepathy-mission-control-5.4' Conflicts: NEWS configure.ac commit f00511ef405f7bccd18029576bf3f65e53504e70 Author: Simon McVittie Date: 2010-05-26 16:57:05 +0100 Nano version commit 00d01ea64a02ccbc2c13d58e4f7d7e85e5b73367 Author: Simon McVittie Date: 2010-05-26 16:36:03 +0100 Prepare version 5.4.2 commit d708686824f2ba70cf7c867752e9e52cb95f461b Author: Vivek Dasmohapatra Date: 2010-05-20 15:43:15 +0100 Coverity 7707 REVERSE_INULL two gchar ** deref'd w/o check in set_param Also gchar ** strv_type_key potentially leaked in the 'clear' and 'unset' cases (cherry picked from commit c4b90bf71b14da5a6c11bd7ef1898cd2734ffbab) commit cd48b089e962c9842c97545ad3cb91336a4be675 Author: Vivek Dasmohapatra Date: 2010-05-20 15:43:15 +0100 Coverity 21106 RESOURCE_LEAK in dispatch_operation_claim (cherry picked from commit 07599a7ab74d654d50bc4dd8493f6f4cef5459df) commit c773108d1729d00ed832d93c2246e14cb81ec12a Merge: 6cf8ed2 80b75c3 Author: Simon McVittie Date: 2010-05-26 16:22:04 +0100 Merge branch '54-unsafe-param-reuse' into telepathy-mission-control-5.4 Reviewed-by: Guillaume Desmottes commit 447a22525c59429d910cf68061649295e6f4ce1f Author: Simon McVittie Date: 2010-05-26 16:17:30 +0100 Remove protocol-copying code that was duplicated from telepathy-glib The stable branch needed this, but in this branch we can just depend on a good enough telepathy-glib. commit ec8e84c00493aa9e46b8e4513a005c8d079405a9 Merge: bf1963a 80b75c3 Author: Simon McVittie Date: 2010-05-26 16:15:33 +0100 Merge branch '54-unsafe-param-reuse' into unsafe-param-reuse Conflicts: src/mcd-account.c commit 80b75c38c6147eee494e8bf0d63309f4555d8d03 Author: Simon McVittie Date: 2010-05-26 16:09:06 +0100 _mcd_account_dup_parameters: don't assume that borrowed parameters remain valid commit 603f1fb47b08fc329868d6284022e9e397fd73d8 Author: Simon McVittie Date: 2010-05-26 16:08:32 +0100 _mcd_account_set_parameters: don't assume that borrowed parameters remain valid commit d408af59e2e5066ee87a6ef9c718500b335f704c Author: Simon McVittie Date: 2010-05-26 16:08:10 +0100 mcd_account_check_parameters: don't assume that borrowed parameters remain valid commit fd0180aeca1b266bf4212ce63ca01c36bd151762 Author: Simon McVittie Date: 2010-05-26 16:07:33 +0100 _mcd_account_migrate_secrets: don't assume that a borrowed string remains valid commit e183be2acb77ebd9117723ff3eb8da874aa8ab16 Author: Simon McVittie Date: 2010-05-26 16:06:45 +0100 _mcd_manager_dup_protocol, _mcd_manager_protocol_free: add Copied from telepathy-glib 0.11.6 to avoid a dependency on that version in this stable branch; in git master, they should be replaced by calls to the newer telepathy-glib API. commit bf1963ae9d03b9de9f20cfc41c5c42fe22d93682 Author: Vivek Dasmohapatra Date: 2010-04-19 19:38:30 +0100 Remove the independent keyring plugin commit 68f540a5e4f64bac4fe5eabeac1118eb05824b89 Author: Vivek Dasmohapatra Date: 2010-04-19 19:38:08 +0100 Remove references to/use of keyring plugin from account manager commit 76ae29581db982feea0069151c4f3baedbff8d1f Author: Vivek Dasmohapatra Date: 2010-04-19 15:31:14 +0100 Move keyring support from independent plugin to keyfile plugin. commit c4b90bf71b14da5a6c11bd7ef1898cd2734ffbab Author: Vivek Dasmohapatra Date: 2010-05-20 15:43:15 +0100 Coverity 7707 REVERSE_INULL two gchar ** deref'd w/o check in set_param Also gchar ** strv_type_key potentially leaked in the 'clear' and 'unset' cases commit 5e6f1c7c8722a660eced18fe88fcd1626ca1d5ef Author: Vivek Dasmohapatra Date: 2010-05-20 15:43:15 +0100 Coverity 11054 UNUSED_VALUE DBusConnection pointer in register_dbus_service commit e1ce16433e74c775d81589a6bd6fe28425343dde Author: Vivek Dasmohapatra Date: 2010-05-20 15:43:15 +0100 Coverity 11729 DEADCODE - message cannot be NULL after g_return_if_fail check commit b26ccfced1d7d6caf7e513f89d208784899bc795 Author: Vivek Dasmohapatra Date: 2010-05-20 15:43:15 +0100 Coverity 21104 REVERSE_INULL make mc_param_type consume NULL safely commit 07599a7ab74d654d50bc4dd8493f6f4cef5459df Author: Vivek Dasmohapatra Date: 2010-05-20 15:43:15 +0100 Coverity 21106 RESOURCE_LEAK in dispatch_operation_claim commit e7af1f7b919cad4443588ab7d1d710768aa923dc Merge: 5d4bc3c fc8c19b Author: Simon McVittie Date: 2010-05-26 14:05:54 +0100 Merge branch 'build' Reviewed-by: Guillaume Desmottes commit fc8c19bac53368a36170ae5a2501da566dab1c56 Author: Simon McVittie Date: 2010-05-26 13:25:11 +0100 Only install documentation for the old libraries if plugins are enabled commit 7958edf73362b03362e551c7a48ddbe0484ad32d Author: Simon McVittie Date: 2010-05-26 13:12:07 +0100 Always check for GModule, which we need for the new plugin API too commit 17bf9dce72ab82f08fd9e4b1ea493df5e4520a17 Author: Simon McVittie Date: 2010-05-26 13:10:39 +0100 Always build examples: they're not installed, and cheap to compile commit c7f56da57ed50073ed8604ec5f635a1b3830ed89 Author: Simon McVittie Date: 2010-05-26 13:10:02 +0100 Always build tests; remove --disable-tests option commit 0441d12aa7256747af7d510b288231dac31ddb15 Author: Simon McVittie Date: 2010-05-26 13:08:11 +0100 Remove obsolete datadir_expanded check from configure.ac We use g_get_system_data_dirs() etc. now. commit a8085fc622c922362f7c27ec6ecef59522688edf Author: Simon McVittie Date: 2010-05-26 13:05:15 +0100 fd.o #26634: remove obsolete utility for migration from Mission Control 4 commit 152fc26baec675dd72a685ce0c76616da7705081 Author: Simon McVittie Date: 2010-05-26 12:57:59 +0100 Explicitly disable MCD plugins when doing distcheck This helps to verify that the configuration we'll be using in distributions (static libmcclient and libmissioncontrol-server, and shared libmission-control-plugins) works correctly. commit d13fa422bdfdda5d6c040fd63f5b5fcb187b0857 Author: Simon McVittie Date: 2010-05-26 12:55:08 +0100 Update README commit 795ce3b4c1d3fecdad026edc4a8dc3999c7cdfa7 Author: Simon McVittie Date: 2010-05-26 12:27:12 +0100 libmcclient: only build as a shared library and install headers if MCD plugins are enabled Only Maemo, and MC tools like mc-tool, use this library; the latter can safely be statically linked to it, and the former already enables MCD plugins. commit 3efc0b2e69fda63390a03aebfa18a20b8379bcbc Author: Simon McVittie Date: 2010-05-26 12:04:09 +0100 src: re-namespace marshallers to avoid clashing with libmcclient if it's static commit 95a3e0e6d44e6c4178fa6b506be44f9d1180f5cd Author: Simon McVittie Date: 2010-05-25 19:56:59 +0100 Use a more obvious API version for the plugin headers commit a069613261c7c27fd4f4dbb844ab3081df07f1a5 Author: Simon McVittie Date: 2010-05-25 19:49:03 +0100 Distribute Account_Manager_Interface_SSO commit d5a34a06d764a72da1f7b5c845506f775d06802d Author: Simon McVittie Date: 2010-05-25 19:48:57 +0100 Remove stale reference to Creation interface, which no longer exists commit 5d4bc3cd9a3775f41a92850a8a1ba69e9d6a2e9d Merge: 02b3518 6cf8ed2 Author: Simon McVittie Date: 2010-05-25 19:44:19 +0100 Merge branch 'telepathy-mission-control-5.4' Conflicts: NEWS configure.ac src/mcd-connection.c commit 02b3518c046921abe98e0027b870a1fccc5be8e8 Merge: 8474ddf 6698e40 Author: Simon McVittie Date: 2010-05-25 19:40:46 +0100 Merge branch 'trivia' Reviewed-by: Will Thompson commit 6698e407c41f78ed7a40cd578d599849ec161500 Author: Simon McVittie Date: 2010-05-25 18:51:31 +0100 biggest NEWS ever? commit 6cf8ed2299d4e473550c1f828ac9af596c607721 Author: Simon McVittie Date: 2010-05-25 19:38:36 +0100 Nano version commit 91bb48a26e0dc7a9abab8d36b46e887c988a6279 Author: Simon McVittie Date: 2010-05-25 19:16:05 +0100 Prepare version 5.4.1 commit 7a24d56cd283cfeea0d29cab157f2498453a24a9 Author: Simon McVittie Date: 2010-05-25 18:55:08 +0100 update NEWS commit 5574043e9291e983e52848ab1b4c89d9a1bb44cd Author: Simon McVittie Date: 2010-05-25 18:29:09 +0100 Revert "fd.o #24875: reimplement g_error_new_valist to avoid a GLib 2.22 dependency" This reverts commit 29abb230abaf890d33751d5da232b9a69434f0e5. commit e4e4775f29576e5cf5b0e13b531c1ae2f73cb827 Author: Simon McVittie Date: 2010-05-25 18:28:53 +0100 Depend on sane versions of GLib, D-Bus and dbus-glib commit dc20989d8526005004a9825faa5fc9c2fa506b56 Author: Simon McVittie Date: 2010-05-25 17:06:13 +0100 Add a regression test for fd.o #25684 commit 73181507d5320d1f53bf79724f48e355d5e70c5a Author: Simon McVittie Date: 2010-05-25 17:05:09 +0100 fd.o #25684: fix detection of accounts that already exist Based on a patch from Jani Monoses . commit 39ce98e1be9739a4cd1b2139725a57e84a7eeb8f Author: Simon McVittie Date: 2010-05-25 16:39:37 +0100 fd.o #27129: update and simplify test/twisted/README Based on a patch from Tomeu Vizoso. commit 4e713cc04ca8a59ecef6fc0c055594456ff95220 Author: Simon McVittie Date: 2010-05-25 16:36:34 +0100 Add silent rules support commit 0edd9f9222bf7706a749fd3563dfab1a752108e4 Author: Simon McVittie Date: 2010-04-15 19:58:25 +0100 Update servicetest from Gabble to display better diagnostics commit 8474ddfa4435a53a13abe5103cd8828aa4431bfa Merge: 90a613b aedf811 Author: Simon McVittie Date: 2010-05-25 18:25:32 +0100 Merge remote branch 'cassidy/handle-time' commit 90a613bdb97f751dcf5d33dd3e156002ff817a7f Merge: cc5ddd9 7ecb1e6 Author: Simon McVittie Date: 2010-05-25 18:24:41 +0100 Merge remote branch 'andrunko/account-changing-presence' Reviewed-by: Simon McVittie commit cc5ddd9d50e7469d88d45a59360789013d4bde35 Author: Simon McVittie Date: 2010-05-25 18:23:16 +0100 Depend on telepathy-glib 0.11.6 for ChangingPresence, HandleWithTime commit 1dedb276b857276562ec4b007387e856ee8d5bfc Author: Simon McVittie Date: 2010-05-25 17:53:49 +0100 Don't cache whether we have the requests interface One use of the caching (in _mcd_connection_request_channel) was subtly incorrect: before using the cached variable we checked whether the TpConnection was ready, but that's not the same thing as checking whether our on_connection_ready() callback (which caches it) has actually been called yet. This fixes a regression in dispatcher/connect-for-request.py. commit fcfe135a45329d25cd8886b3861f68ee736e672e Author: Simon McVittie Date: 2010-05-25 17:06:13 +0100 Add a regression test for fd.o #25684 This turns out to be a regression in the 5.5 branch, but adding a test in the stable branch seems a good way to avoid introducing this bug. commit aedf81146c7a36c3f7f876b97aac845e9490913e Author: Guillaume Desmottes Date: 2010-05-25 13:53:15 +0200 implement Approver.HandleWithTime() commit 99a0c91b2e2d455eb3ac2001b132ff731843d12a Author: Vivek Dasmohapatra Date: 2010-05-24 17:54:36 +0100 Correct some comments. commit 0dd2f6fcb551e41a05b00d1aecbf94f6951d4c1e Author: Vivek Dasmohapatra Date: 2010-05-24 17:46:41 +0100 Aegis/libcreds based DBus caller ACL plugin commit f1696f20cd1442942283a0aba0a18136ec998da3 Author: Vivek Dasmohapatra Date: 2010-05-24 17:45:51 +0100 Wrap dispatcher ensure and create channel calls in DBus caller ACL checks commit be1d2579a4141d66324cdc5c1b9020dd6c4498cc Author: Vivek Dasmohapatra Date: 2010-05-24 17:44:46 +0100 Implement demo DBus caller permission ACL plugin (not used yet) commit 8a2752bf7a9af0dca7c8cfecd012d67438fa401b Author: Vivek Dasmohapatra Date: 2010-05-24 17:43:38 +0100 Provide ACL wrapped DBus property get/set/get_all helpers commit 5fbaaa0c09fe1fda85f2e48e5ee035e991ede62a Author: Vivek Dasmohapatra Date: 2010-05-24 17:42:10 +0100 DBus caller ACL plugin interface + docs added commit 194b14e3e614ccf8fff2c3087cc528285daf8b06 Author: Vivek Dasmohapatra Date: 2010-05-24 17:40:11 +0100 Improved debugging when g_module_open fails to load a plugin commit a6d16a6a0fdd7971406d935490a578f93bb7a70b Author: Vivek Dasmohapatra Date: 2010-05-24 17:39:48 +0100 Improved debug for malformed (missing manager) accounts commit f64a3c798ce77a5b67f54f6a03b22f28c58241d1 Author: Vivek Dasmohapatra Date: 2010-05-19 15:44:05 +0100 Signature of mcd_manager_call_when_ready callback wants a const before GError * commit 6131c21e87ea4ba1601012c58e9acedf8b725426 Author: Vivek Dasmohapatra Date: 2010-05-18 19:10:51 +0100 Drop support for unused create parameter from get_ag_account() commit ffeaeb5b6e7618d9926d19defe1e21279634370e Author: Vivek Dasmohapatra Date: 2010-05-18 18:43:18 +0100 Dead code removed. commit 33077472f156d3658354f13fea48b7c78d71b892 Author: Vivek Dasmohapatra Date: 2010-05-18 18:43:07 +0100 Dangerous call to g_free dropped commit 014994d7128e43e996a0533bcec58e0ae8eeb383 Author: Vivek Dasmohapatra Date: 2010-05-18 18:42:24 +0100 Minor comment. commit b308d60d6ddb3d0a94e69dd361e575bc7a4b76b0 Author: Vivek Dasmohapatra Date: 2010-05-18 18:42:00 +0100 Account verification calls shouldn't happen until after the manager is ready. This meant that the first account for any given manager might not have been announced over dbus depending on a race between the CM becoming ready and the account verification callback being invoked (for accounts created by storage backends like libaccounts-glib/SSO at any rate). commit faac87f2b3dff316b4cf65b6c7afacb495cbd2db Author: Vivek Dasmohapatra Date: 2010-05-18 18:39:24 +0100 Typo in debug message (valid/invalid switched). commit d66e10badab7b6e777b5722d446eff25982ad679 Merge: 575e003 b864a27 Author: Guillaume Desmottes Date: 2010-05-19 15:37:46 +0200 Merge branch 'telepathy-mission-control-5.4' commit b864a277d76c54a803e9259cd65abe1dfdc624d3 Author: Guillaume Desmottes Date: 2010-05-19 14:45:29 +0200 set '0' as UserActionTime when HandleWith() is called '0' means 'no user action' which is the safer choice to prevent focus stealing. User should use a futur variant of HandleWith() allowing him to pass a UserActionTime when needed. commit 575e003ecd88ed5ed07612b1f54cc4cb5698d7fe Merge: dfdc4d8 506f164 Author: Guillaume Desmottes Date: 2010-05-19 15:35:05 +0200 Merge branch 'telepathy-mission-control-5.4' commit 506f164532b3a2fc5b8b232b42414e7bc79c17b4 Author: Guillaume Desmottes Date: 2010-05-19 15:33:43 +0200 account-manager/presence.py: GetInterfaces can be called twice commit c758ce6dd21a56641b78b36137274a13d8270488 Author: Guillaume Desmottes Date: 2010-05-19 15:23:10 +0200 mctest.py: no need to import 'sha' commit dfdc4d82c654dad67c89b8a37951f5a079b37a8b Author: Vivek Dasmohapatra Date: 2010-05-10 14:15:48 +0100 Document likely error of an SSO ID account -> MC account dbus call. commit 56e186485d768b66190d6f1802e6178e7e50a8b0 Author: Vivek Dasmohapatra Date: 2010-04-26 14:50:14 +0100 xmlns typo commit 45a415ec7ae312a86d848d5cd2215e1300324032 Author: Vivek Dasmohapatra Date: 2010-04-26 14:04:12 +0100 Tweak the SSO ID comparison based on review commit 9d487bab8db34c2e117062178cd9342648a0120d Author: Vivek Dasmohapatra Date: 2010-04-26 14:03:41 +0100 Class, method and variable renaming from review. commit a676a8ef98b69eb3f62b1467dd776fad75bf9346 Author: Vivek Dasmohapatra Date: 2010-04-26 14:00:41 +0100 Remove account interface (dropped from requirements) commit 0357b99db643b1e7e30a9f7487468f880af1e3ba Author: Vivek Dasmohapatra Date: 2010-04-19 13:57:08 +0100 Implement the new SSO related utility methods. commit c78decfb9156e20fe423e0121ca3ae2400d82005 Author: Vivek Dasmohapatra Date: 2010-04-19 13:55:17 +0100 Generate headers and code for the new SSO properties interface. commit fde2102e92081645bcb71a88ae0d4aaee061e47b Author: Vivek Dasmohapatra Date: 2010-04-19 13:54:08 +0100 SSO accounts can have multiple services, but this is not exposed as a property. Instead, expose it as a special property which is not covered by the standard iterator but will be returned if you ask for it. Also, exclude the property from being saved, since the list of services can change and should not be cached in the SSO storage for the account itself. commit 3773279f3f783646aefa23978bff102358823399 Merge: c9ca4ea 156a6b7 Author: Vivek Dasmohapatra Date: 2010-05-10 13:27:11 +0100 Merge branch 'sso-tmc-uid-is-service-specific' commit c9ca4ea5f5fdb4cd735aeef816cc53694a518ddb Author: Vivek Dasmohapatra Date: 2010-05-10 12:59:02 +0100 mcd_account_check_validity after async account creation to prepare/announce it commit 156a6b76770aed18fc8c39af430f10dcf9e90219 Author: Vivek Dasmohapatra Date: 2010-05-07 16:03:25 +0100 MC_IDENTITY_KEY wasn't treated as a service local value everywhere, fixed commit 2d4a8c7ccfd56ceefe254db813b1b8348f6bc2c1 Author: Vivek Dasmohapatra Date: 2010-05-07 14:19:36 +0100 More explanatory comments. commit 8843d84ca628c928647bc10fbdaefe46dd5b9707 Author: Vivek Dasmohapatra Date: 2010-05-07 14:19:22 +0100 SSO values (as opposed to params) can now be local (they were all global before) commit e0ff2d813712bf5655f1899391e0b765516d674a Author: Vivek Dasmohapatra Date: 2010-05-07 13:47:44 +0100 Explanatory comment commit c83e332c1738e08dc28f818dfc9e006d81971d3a Author: Vivek Dasmohapatra Date: 2010-05-07 13:47:30 +0100 Change name of get_mc_key to indicate it deals with MC parameters, add comments commit 00f6eae530a14e2f99cb3896816af43f06f136cd Author: Vivek Dasmohapatra Date: 2010-05-07 13:41:00 +0100 Update implementors-note comment to be both true and more useful commit 7ecb1e63ca5e93449b5669a81fb80f0889514c09 Author: Andre Moreira Magalhaes (andrunko) Date: 2010-04-29 03:49:46 -0300 Added test case for Account.ChangingPresence. commit e5f0b40c879c92b2a59944decada5c2c4b1720fb Author: Andre Moreira Magalhaes (andrunko) Date: 2010-04-29 03:49:11 -0300 Proper emit AccountPropertyChanged(ChangingPresence) when the presence is changing. commit 282064d6b7758ad83815c8b63ff4cc6d9cf5b806 Author: Andre Moreira Magalhaes (andrunko) Date: 2010-04-29 03:48:41 -0300 Added Account.ChangingPresence property definition. commit 5dcd6cd2011e9b0477493cc7618388f4317cd341 Author: Vivek Dasmohapatra Date: 2010-05-07 13:40:24 +0100 Rename get_ag_key to indicate it applies to params specifically. commit d06aa5990e57b55ee03d5ea0d25f0f6895a094b5 Author: Vivek Dasmohapatra Date: 2010-05-05 18:18:52 +0100 Variable moved to a more localised scope commit 377f5cc874d5e784c6295d3220f4adfdc6092f8c Author: Vivek Dasmohapatra Date: 2010-05-05 18:18:32 +0100 Unused account name removed commit 36a87b5cd1377f820326d85320879e3dd6b7f2ea Author: Vivek Dasmohapatra Date: 2010-05-05 18:18:11 +0100 Unnecessary GList removed commit d96203693dbb764ccfe93e0f0f6dc307f62ce5fe Author: Vivek Dasmohapatra Date: 2010-05-05 16:22:18 +0100 Extra debugging to help diagnose a reported but as-yet unverified new-account bug commit b1105ba4a7c5fdd225a2b3b9d0938970db1599fc Author: Vivek Dasmohapatra Date: 2010-05-05 16:21:02 +0100 Revisit the SSO account storage plugin now we have some concrete examples The following points are addressed: * The hardwired SSO service selection is gone * We now very carefully pick an IM service where necessary * We un-set the service where necessary to get global settings * We are careful to leave the selected service in the same state on function exit as it was on entry. commit c8a3f6a72e84e876154b44b595ae2f6ce03b0f74 Author: Vivek Dasmohapatra Date: 2010-04-30 17:55:48 +0100 Don't try to register the account-manager's dbus name again. This was triggered by asynchronous back-end account creation, which is a new code path required by SSO. commit 3465fec353fe5af219039da520d56409ac150a60 Author: Simon McVittie Date: 2010-04-15 20:59:14 +0100 The next release from this branch will be 5.5 commit c8db874b6bf27dead411d6f83c504f2bb40fd1fd Merge: 0901a0a c4bb262 Author: Simon McVittie Date: 2010-04-15 20:57:50 +0100 Merge branch 'telepathy-mission-control-5.4' Conflicts: src/mcd-account-manager.c commit c4bb262c3209c172bf0ab2455a1cc4f8a14a1583 Author: Simon McVittie Date: 2010-04-15 20:54:43 +0100 Start 5.4.1 development commit 0901a0a6c90e24621e35ac35e5cd88fa20c2a205 Author: Simon McVittie Date: 2010-04-14 13:58:28 +0100 Set the right environment variable to run tests with a temporary version of ~/.cache commit 65f032693ee065ea6353fe8d18b77d84ccde61ab Author: Vivek Dasmohapatra Date: 2010-04-07 16:06:29 +0100 Gnome keyring code reintroduced at old location by a merge resolution, removed. commit 0a31a457851ca7c88d106e4379bcf5b96561e92f Merge: 4dc67bf 412a7a9 Author: Simon McVittie Date: 2010-04-06 19:47:21 +0100 Merge branch 'account-atomicity' Conflicts: src/mcd-account.c Reviewed-by: Vivek Dasmohapatra commit 4dc67bf5422609dc6c054e5373a083a4f311feb4 Author: Tomeu Vizoso Date: 2010-03-26 11:12:40 +0100 Fix error propagation in CreateAccount Fixes fdo#27021 commit 9ce5ed091566fac76159f22bd0bb09d8be297dfd Author: Vivek Dasmohapatra Date: 2010-03-24 18:02:01 +0000 Move the plugin loader init in the master to its _init function commit dfef1220b713bbbfdda4ae1d0e8c973afd1ed880 Author: Vivek Dasmohapatra Date: 2010-03-24 17:56:18 +0000 Make another belt-and-braces plugin loader initialisation call. commit acdadc00a8919115ceb63b2cd0c786b0fbabc00d Author: Vivek Dasmohapatra Date: 2010-03-24 17:10:55 +0000 Make sure the plugin loader has been initialised in libmissioncontrol-server. commit 4161863e9f376790c850ef67d27b4afcb9abe69b Author: Vivek Dasmohapatra Date: 2010-03-24 17:10:22 +0000 Make _mcd_plugin_loader_init idempotent. commit b1d43671069402ccca45e388a2d1d57c9c29b027 Author: Vivek Dasmohapatra Date: 2010-03-24 15:36:07 +0000 Incomplete accounts resulted in account manager load locks never being released. This meant that the account manager's dbus name was never claimed, as it sat around forever waiting for the account's manager to become ready, (or fail) but this could never happen as the incomplete account didn't have a manager at all. commit cebd5b7cce4011f8ea231162b6c10cdbee338905 Author: Vivek Dasmohapatra Date: 2010-03-15 16:11:22 +0000 Don't poke the keyring plugin into the list if it is disabled. (cherry picked from commit 3767b4a3df5a736857fec2b7852f71e695bafc75) commit aa441c4150ac472d264a6142d3265ebe55c46c20 Author: Vivek Dasmohapatra Date: 2010-03-18 20:35:56 +0000 Consider NULL self to _mcd_plugin_request_dup_denial to be an error. (cherry picked from commit f74dc67f0dd7547c8d60127ac4c823de1865592b) commit 23e1c6ceec44bd0002db04a7624d0ca0dc57d00d Author: Vivek Dasmohapatra Date: 2010-03-23 17:21:17 +0000 Explain why we don't invoke the plugin_api shim ahen there are no plugins. (cherry picked from commit e6caebf7c4332145f99a0f70f73596c0c61fa754) commit 679e396a9e30a32abea5d87ace227591d6021047 Author: Will Thompson Date: 2010-03-16 11:52:28 +0000 Avoid unsetting uninitialized GValues The 'cleanup' block calls g_value_unset(&protocol); if we 'goto cleanup;' before initializing it, we'll critical. (cherry picked from commit e2bf8cb962db707e146db611a09000e1fe5e349d) commit f87936da0484f2b2c20c70884cd44b2cfdcbab1b Author: Vivek Dasmohapatra Date: 2010-03-15 13:55:41 +0000 Don't save the manager and protocol keys, they're magic immutables. (cherry picked from commit 1cb84576b8d0ac20282d8062c6359858321186c6) commit c3665f28230481e8827dcb329e13840fa1766589 Author: Vivek Dasmohapatra Date: 2010-03-15 13:37:54 +0000 Correctly handle global settings vs service settings, in a uniform manner. (cherry picked from commit 1aca87caf2e83dcaccd0007046f66299fa10a7df) commit b9c9b0f3bc9795466f20f1fc63d7d1d873b4bec5 Author: Vivek Dasmohapatra Date: 2010-03-13 18:40:05 +0000 Some settings were found in the global rather than the service section. Cope. It's not clear that they should be in the global section, the tests seem to put them into the service section, but as we don't have a working a-ui at this end, look in both places when fetching, service section first, falling balc to global. (cherry picked from commit 3f0c6915c660171d9dd1b38988e5ce90adc8ee06) commit 449db2c78d4a79e8f30ca7e76300a651d2f5e3ae Author: Vivek Dasmohapatra Date: 2010-03-13 16:34:58 +0000 _provider_get_service isn't working reliably: hardwire the service for now We know we only need to support 1 service for now, google-talk - hard wire it as the account to select for now, as we need this for the demo, we can figure out what's wrong witrh it later when we're not hard up against a deadline. (cherry picked from commit edccb1b9846f504d0b621543512b8877acbe868f) commit 9f0dca248a3212dcb825bdbb013d5064449a88a5 Author: Vivek Dasmohapatra Date: 2010-03-13 14:45:21 +0000 MC param-account, param-password map to AG bare settings username, password. These were mapped to the parameters/ namespace in AG, but that's not where the maemo UI code seems to put them. (cherry picked from commit 805544ba366ab4067de645f415010fff7b6560e6) commit bd537555a2f1d41af7604c5fa3a7b5aec70f2273 Merge: 0829627 5e21813 Author: Eitan Isaacson Date: 2010-03-17 11:32:48 -0700 Merge branch 'dispatch-early' Reviewed-by: Simon McVittie commit 5e21813877d46912424a7abff5e21a023ce860ca Author: Eitan Isaacson Date: 2010-03-17 11:23:31 -0700 Expect Connect from mc instead of StatusChanged from SimulatedConnection. commit 082962702c1db6e08038920916b0c612b65c2d4c Merge: 148c720 d09690f Author: Simon McVittie Date: 2010-03-15 14:00:00 +0000 Merge remote branch 'tomeu/MC_LOGFILE' Reviewed-by: Simon McVittie commit 148c7209a55cd196f063e6d43f23fcbfc85ae4f6 Merge: 31e4e22 27a15d8 Author: Simon McVittie Date: 2010-03-15 13:59:49 +0000 Merge remote branch 'tomeu/bug-27038' Reviewed-by: Simon McVittie commit 31e4e22855aa5d0bddc8268b23ec426d9be1cd61 Merge: 5e8f91c f028fbe Author: Will Thompson Date: 2010-03-13 12:45:30 +0000 Merge branch 'account-storage-plugins' Conflicts: src/mcd-account-manager.c commit f028fbed67bb92088a10b2474839f3b9e426bf5b Author: Vivek Dasmohapatra Date: 2010-03-13 11:47:11 +0000 Removed stray debug message. commit e92541b13d1093b36377b3b03858aa0e5848607c Author: Will Thompson Date: 2010-03-13 11:24:40 +0000 Don't re-create objects for accounts we already have It seems that accounts from the accounts-glib loader pop up twice, once from the GKeyFile and once from the 'created' signal. Until we figure out why it's happening, let's add a cheesy hack that prevents the instance from the GKeyFile being created. Also add extra debugging to add_account() so we can see when accounts are added and where they've come from. commit 50ace3c347dfb1692d684f266a4248463208d534 Author: Vivek Dasmohapatra Date: 2010-03-13 03:13:09 +0000 Flush new async-created accounts to the SSO store to save new+derived settings. commit f77ddc8d02ca3a867a6127da8377edc1c20850d8 Author: Will Thompson Date: 2010-03-12 22:12:01 +0000 Uncork storage plugins after reading from GKeyFile commit ad08f3b4468a5d05f3e0451d10947affa7ee856b Author: Will Thompson Date: 2010-03-12 21:33:26 +0000 Add a FIXME for plugin_account_manager_set_dbus_daemon() commit a606766773c3945240628d3a508b3423022a8cf7 Author: Will Thompson Date: 2010-03-12 21:29:10 +0000 Uncork account stores when master calls _setup() This ensures that the McdMaster actually exists before we start creating accounts all over the place, and prevents a loop where instantiating an McdAccountManager instantiates an McdAccount which instantiates an McdMaster which instantiates an McdAccountManager... commit e260cc94562a992b20196efc3347f06ed2456ce6 Author: Will Thompson Date: 2010-03-12 21:23:06 +0000 Correctly retrieve CM and protocol from libaccounts You need to initialize GValues before you hand them to ag_account_get_value(). Also, 'c' was unused. commit f7b7aa8e477abe03c1340c2b200ddcf9c9792c2c Author: Will Thompson Date: 2010-03-12 21:03:22 +0000 AM: initialize D-Bus property interfaces in _init() It turns out that it is unsafe to do this at any later point, due to a series of surprising facts: • mcd_dbus_init_interfaces_instances (obj) is implemented in terms of g_type_get_qdata (G_OBJECT_TYPE (obj), ...). • osso-mission-control subclasses McdAccountManager. • This code: GType s, t; // s is a subtype of t; g_type_set_qdata (t, FOO, BAR); gpointer data = g_type_get_qdata (s, FOO); sets data to NULL because g_type_get_qdata() does not consider superclasses. • Remarkably, calling mcd_dbus_init_interfaces_instances() from the _init() function works because the code that runs each instance_init() function in the hierarchy in turn sets the object under construction's GTypeClass to be the particular type whose init() is running, rather than the final type of the object! This was a fun debugging session. commit 20bcefab890201dce263d21833dfbfeacc88c8b4 Author: Vivek Dasmohapatra Date: 2010-03-12 19:31:36 +0000 Put a fake create signal on the queue when new accounts are found during init. commit 632889e639e44f76745dc96eac5f70782e825f61 Author: Vivek Dasmohapatra Date: 2010-03-12 15:24:39 +0000 Log + hook up signals for _all_ plugins, pseudo and real. commit f1b4a26c5cc8b31c0b208b4629f1eed0b76ebea9 Author: Vivek Dasmohapatra Date: 2010-03-12 13:52:51 +0000 Move some setup to _constructed so that properties are available to the code. commit 6558c7a0f902ef0539e96f0eaf3eea4c3c66a0bb Author: Vivek Dasmohapatra Date: 2010-03-12 13:41:42 +0000 The dbus daemon isn't available at the point we need to construct the shim. Make the dbus-daemon a non-construct-only property, and provide a convenience method for setting it. Re-order the class_init so glib/gobject actually accepts the property. Implement property getter and setter for same reason. commit 27a15d80e090d4b84ff67d95c9bf283de7b97888 Author: Tomeu Vizoso Date: 2010-03-12 10:13:55 +0100 Don't try to propagate a denial if there are no plugins installed. Fixes fdo#27038 commit 236b156892b3b31f2331b62489150485045d8468 Author: Vivek Dasmohapatra Date: 2010-03-11 19:28:07 +0000 Forward declaration of prototype to keep the compiler happy. commit 15924b732c89cbb5bd5c5965b40e139e33349136 Author: Vivek Dasmohapatra Date: 2010-03-11 19:27:45 +0000 Only iterate over parameters, they're the only oones we want. commit a8dd436c66b42ab8c78c915da2a343887df10d10 Author: Vivek Dasmohapatra Date: 2010-03-11 19:27:12 +0000 More type errors. commit 3fe0325fe95272bb73b0b4508aac3f8d08df30cd Author: Vivek Dasmohapatra Date: 2010-03-11 19:26:44 +0000 Type error. commit 532291a3d299dd970b8774fbc045567c75af048c Author: Vivek Dasmohapatra Date: 2010-03-11 19:26:18 +0000 Type, 3 param function called w 2 params. commit 5be4467bcd28189cc4d8ef76269956f356fdc8fe Author: Vivek Dasmohapatra Date: 2010-03-11 19:25:50 +0000 Stash the McpAccountManager for use in signal handlers when _ready is called. Tweak the calling of signal handlers for delayed signals + handler data free operation to be correct (wrong type errors, param reordering typo) commit 4b8b72c968b8928386189a5709debb8d1b04d580 Author: Vivek Dasmohapatra Date: 2010-03-11 19:22:33 +0000 Typo. commit 8b6c50917d4c7b8294bec21402537a99a4b5ae7c Author: Vivek Dasmohapatra Date: 2010-03-11 17:53:36 +0000 Initialise the list of libaccounts services. commit 32edda37b998906ed33dbbccc829bb9cef591157 Author: Vivek Dasmohapatra Date: 2010-03-11 17:45:56 +0000 Accounts not created via libaccounts are not claimed by the sso plugin anymore. commit 359ca41ed4cc362d589f76aae4e5b1e404cbecb5 Author: Vivek Dasmohapatra Date: 2010-03-11 17:32:29 +0000 Doc typo fixes. commit 5b7e023a99002962eca9420b86ebbcd3adc29cbc Author: Vivek Dasmohapatra Date: 2010-03-11 17:32:17 +0000 Delay account creation signals until ready, use the new unique-name interface. commit 79054f1e316edc61394281af7401829214d6d8a9 Author: Vivek Dasmohapatra Date: 2010-03-11 17:30:22 +0000 Drop the old copy of the unique-name code and use it via the shim interface. commit 2cc024fafe82f61264d829c289d8d8326721335d Author: Vivek Dasmohapatra Date: 2010-03-11 17:29:08 +0000 Copy the unique-name logic into the plugin shim interface and expose it there. commit 660edddc2530e797b7d92cf512a162ac2e0610d6 Author: Vivek Dasmohapatra Date: 2010-03-11 17:27:04 +0000 Define interface to allow plugins to get the unique account name via the shim. commit b221338fbbd712e4105a38e5a7407d02898b525b Author: Vivek Dasmohapatra Date: 2010-03-11 17:24:40 +0000 Define interface to allow plugins to be told that aync account ops are now valid In other words, we're done with basic startup and listing of accounts that we had seen before, new accounts can now be created, and async notifications from the plugin backend may now be transmitted onwards by the standard signals defined in the interface. commit d09690f086ee4ba4edf4cbd6aa34fa088681d2e8 Author: Tomeu Vizoso Date: 2010-03-11 16:50:48 +0100 Add support for MC_LOGFILE commit 5e8f91cc75916c8768a05130b15f062dded11f4c Merge: 34eabb1 1abaae5 Author: Simon McVittie Date: 2010-03-11 15:41:42 +0000 Merge remote branch 'tomeu/bug-27015' Reviewed-by: Simon McVittie commit 1abaae519d56caf2478a7af24e5084d2c2476871 Author: Tomeu Vizoso Date: 2010-03-11 12:29:50 +0100 Remove misleading reference to GConf commit 2e6d574ef1faf1f88fa0e9e18a86ca1114ffefd9 Author: Vivek Dasmohapatra Date: 2010-03-09 19:19:41 +0000 Remove generated marshaller file(s) when a clean target is invoked. commit 901159ab234d78e24c00f98a76ea71363cfc3b42 Author: Vivek Dasmohapatra Date: 2010-03-09 18:26:56 +0000 Dropped noop dispose instance vtable entry. commit 9ce38fa3d5deead66d5185e95459feda033fe75e Author: Vivek Dasmohapatra Date: 2010-03-09 18:07:47 +0000 Replace strcmp et al with g_str_equal instead in boolean contexts. commit c5b2f19a62091752295a3fa36b00d0bc8d8bf06a Author: Vivek Dasmohapatra Date: 2010-03-09 18:01:36 +0000 g_int_equal was a braino - should have been g_direct_equal commit 34de0a64fba030a8a11905093137910faaa2ad1f Author: Vivek Dasmohapatra Date: 2010-03-09 17:46:33 +0000 Style trivia. commit 0a897ae7e9aedbf8d758b5acedeecacf7b7fa0f6 Author: Vivek Dasmohapatra Date: 2010-03-09 17:41:26 +0000 Move the ref/unref of the user data pointer completely out of write_conf. commit e71beba432935d3f06c9f2547f06a67bf7302fb0 Author: Vivek Dasmohapatra Date: 2010-03-09 17:12:09 +0000 Drop implementation of noop instance method for set_property. commit ed51ecb1ccf94ed89cf730358920fdfc77801a81 Author: Vivek Dasmohapatra Date: 2010-03-09 16:53:30 +0000 Free up the keyfiles in the finalisation stage, not the disposal. commit 8888f7f1f1955f5cdc765dc2990b1cbdcac21928 Author: Vivek Dasmohapatra Date: 2010-03-09 16:35:11 +0000 Makefile dependency/nodist fix. commit ca9a4fe535cf71a8e0ef3176c0c952c32d73c0b0 Author: Vivek Dasmohapatra Date: 2010-03-09 16:20:18 +0000 Use g_cclosure_marshal_VOID__STRING instead of _mcp_marshal_VOID__STRING. commit 88e1c55d37c7f3b993e7a1c335b3a718e65acd9b Author: Vivek Dasmohapatra Date: 2010-03-08 19:19:49 +0000 Implement and connect up handlers for SSO 3rd party account creation/deletion. commit 3e995b79683c92b74bbc0084da0e63e2e03e8060 Author: Vivek Dasmohapatra Date: 2010-03-08 19:19:10 +0000 Explanatory comment. commit 09f74c6a547574818a5029f5ac098819e7d9c0b7 Author: Vivek Dasmohapatra Date: 2010-03-08 19:18:52 +0000 Callback for mcd_account_delete in the account manager. commit d363fa0c54eb58aae790f1c3d969b2168c56a115 Author: Vivek Dasmohapatra Date: 2010-03-08 19:17:48 +0000 Type typo fix and explanatory comments for plugin account deleted callback. commit 7e443f93903574f8d0b37721fe60be8041c6c8cf Author: Vivek Dasmohapatra Date: 2010-03-08 19:15:18 +0000 "Enabled" setting is a special case in SSO, handle it as such. commit dee3cf66397c8d43ab8c0ae2658d7a6ce7653cf0 Author: Vivek Dasmohapatra Date: 2010-03-08 19:14:06 +0000 Forward declarations to keep compiler happy when we add the sso callbacks. commit 29ca669296c8f2afd6858e2452e098c6ea05dd67 Author: Vivek Dasmohapatra Date: 2010-03-08 16:02:24 +0000 Remember the ag id -> mc name mapping for use in deletion. Also forget the name and drop our ref to the ag account object when deleting. commit 7c6a00ac2ed87e354832f014e9c698ccf88c276b Author: Vivek Dasmohapatra Date: 2010-03-08 15:00:20 +0000 Remove old debug code. commit 283961d700fbc95ecc6cba314d2b62325feba356 Author: Vivek Dasmohapatra Date: 2010-03-05 19:18:16 +0000 Make the libaccounts-support conditional on the current config. commit 19e889489b6047cb743f79f660ea9057e6823aed Author: Vivek Dasmohapatra Date: 2010-03-05 19:17:38 +0000 Make libaccounts support optional via configure, update Makefile.am accordingly. commit 56bb654c974b42f936e79eaabb7730937a44f258 Author: Vivek Dasmohapatra Date: 2010-03-05 19:16:42 +0000 hash-include fixes commit 03dbe99b13454ab2c41200f2a49294e800c30bee Author: Vivek Dasmohapatra Date: 2010-03-05 19:15:15 +0000 libaccounts-glib pseudo-plugin for accounts storage. commit e75bd719fbb50cbaf955f01c5ba325fa2126479e Author: Vivek Dasmohapatra Date: 2010-03-05 14:48:02 +0000 Dependency to make sure the mcp marshaller(s) are generated in time. commit 9b84e17c141fbfe96c7ace4885307ae42ca07964 Author: Vivek Dasmohapatra Date: 2010-03-05 14:47:29 +0000 debug message emitted when signals we don't process (yet) are received. commit b5cdf7cf5e502bd9c57991a91a9185acadec2764 Author: Vivek Dasmohapatra Date: 2010-03-03 03:52:44 +0000 Handle setting deletion in McdPluginAccountManager. commit 25bc3a8fe7d2d6635a4f71d0ae6cc83a4bb6186a Author: Vivek Dasmohapatra Date: 2010-03-03 03:51:44 +0000 refs/unrefs of the McdPluginAccountManager instance were unbalanced. commit 1049d59b4c87928a0726424b718ea979c1b7e6c8 Author: Vivek Dasmohapatra Date: 2010-03-02 18:44:34 +0000 Set the loaded flag after a successful keyring read. commit 985c5076811073159e8a4f5d9beaa09d7b73b583 Author: Vivek Dasmohapatra Date: 2010-03-02 18:44:13 +0000 Style trivia. commit 494aa78683273a89761ff65584a6f9962415ddf4 Author: Vivek Dasmohapatra Date: 2010-03-02 18:38:48 +0000 Style trivia. commit 257b1761ff7e1275347695f4d2c9ed68a6f6d40d Author: Vivek Dasmohapatra Date: 2010-03-01 21:08:30 +0000 Style trivia. commit 785429022cacc75ba5750fd2631fff4dc32cd40b Author: Vivek Dasmohapatra Date: 2010-03-01 21:07:26 +0000 Use g_get_user_cache_dir to locate the target for the account dicersion plugin. commit b5b9d676b96294987a2c82a81201ed4d9080f6cd Author: Vivek Dasmohapatra Date: 2010-03-01 20:53:15 +0000 Rename plugin prio #defines and provide _NORMAL and _READONLY constants. commit 1c3500945ad2549a96743d51cc5e8d17eaf875ba Author: Vivek Dasmohapatra Date: 2010-03-01 20:52:23 +0000 Allow low priority (readonly) account storage plugins to be sorted correctly. commit ac9da0ef2e6508849d3d293c4540e355aa903ff3 Author: Vivek Dasmohapatra Date: 2010-03-01 20:29:08 +0000 Remove old debug instrumentation. commit df78e0e4f8a7305fbc950bddd194fbff87f390d0 Author: Vivek Dasmohapatra Date: 2010-03-01 20:27:48 +0000 Change transplanted code from existing style to preferred style. commit 543e9080b214c04b72b7d5e4733b19b711be1e4e Author: Vivek Dasmohapatra Date: 2010-03-01 20:25:04 +0000 Use same #defined noop code as elsewhere. commit 97b805d6e5d5cb909d165fb99d39a4c9dc7ac256 Author: Vivek Dasmohapatra Date: 2010-03-01 20:24:35 +0000 Style trivia. commit bf3c12f3d79774225582207fe66cbf8bc7502ca1 Author: Vivek Dasmohapatra Date: 2010-03-01 20:24:07 +0000 Style trivia. commit 3496d2bf29688b3e2d5d88abe33e7b0491fdef19 Author: Vivek Dasmohapatra Date: 2010-03-01 20:13:26 +0000 Plugin priority is signed. commit 4e2ce3fd358c29e201fe29b88454ff7180106712 Author: Vivek Dasmohapatra Date: 2010-03-01 19:45:18 +0000 Unnecessary include removed. commit 06a57ed5d2f149949dd8de470b09287041ef03b0 Author: Vivek Dasmohapatra Date: 2010-03-01 19:11:46 +0000 Minor style issues (variable renaming) and explanatory comments. commit 53cbba20640f28ae9275f8b29725d6916cc68a85 Author: Vivek Dasmohapatra Date: 2010-03-01 18:48:27 +0000 Rename account storage plugin comparison function. commit 91e6af087af9e57aa4d3424e2cb48a956ba137c4 Author: Vivek Dasmohapatra Date: 2010-03-01 18:43:46 +0000 Document the McpAccountManager interface. commit 54fb5116e33f5c3e6ba472e5348884eef50d8249 Author: Vivek Dasmohapatra Date: 2010-03-01 18:43:31 +0000 Document the McpAccountStorage interface. commit 70cbc38802864e4859ebc64f4d7f516c5a2bdc06 Author: Vivek Dasmohapatra Date: 2010-03-01 17:17:16 +0000 Don't include glib subheaders, only the main glib header. Note: This was existing code transplanted from elsewhere. There are lots of other subheader includes in the codebase but I have not addressed those cases here. commit c45a55d151decc332294adfd443c72ae4acb3170 Author: Vivek Dasmohapatra Date: 2010-03-01 17:12:22 +0000 Don't rely on mcd-debug in the plugin interface implementation. commit fbcd0cb4df51529f039d884fabcef4f4d1ac7163 Author: Vivek Dasmohapatra Date: 2010-02-26 19:26:27 +0000 Keep one long lived McdPluginAccountManager around and use its keyfile etc. commit 5558750baac59696fd9045a4b5280362d392b4f4 Author: Vivek Dasmohapatra Date: 2010-02-26 19:25:31 +0000 Make the McdPluginAccountManager the owner of the keyfile and secrets GKeyFiles. commit d095c537198a619ce26eeb0b0622cabce208aedd Author: Vivek Dasmohapatra Date: 2010-02-26 18:34:27 +0000 Class rename McdPluginAccount -> McdPluginAccountManager commit e02509b21e7757ba188dc652aea3c44b1f264441 Author: Vivek Dasmohapatra Date: 2010-02-26 18:26:57 +0000 Class/Interface rename - McpAccount[Iface] -> McpAccountManager[Iface] commit c67c292dbc22b90d64b9acee221cd8811cc79478 Author: Vivek Dasmohapatra Date: 2010-02-26 18:02:16 +0000 Typo: dead variable no longer used. commit 950c800befd43fcb2745d29908b3a5d16bf675db Author: Vivek Dasmohapatra Date: 2010-02-26 18:02:00 +0000 Use the plugin marshallers instead of sharing the core marshallers. commit 7103b41e9a578aa3ce14b3c9d25497706d594d02 Author: Vivek Dasmohapatra Date: 2010-02-26 18:01:32 +0000 Generate signal marshallers for plugins separately from the core marshallers. commit 2b009c68dc8d7b60b335d17369c9259c0ae7b38a Author: Vivek Dasmohapatra Date: 2010-02-25 19:13:33 +0000 Add a dependency and rule for the marshallers header from the src/ directory. commit 3fb1b91b97128411ca7a2df1849d16327398023a Author: Vivek Dasmohapatra Date: 2010-02-25 19:12:52 +0000 Load and use the account storage plugins, with two pseudo-plugins by default. The pseudo-plugins are the keyfile plugin (an oject that implements the relevant plugin interface, even though it isn't loaded as a plugin) and the gnome keyring plugin (ditto) which are loaded at advertised priorities. When no other plugins are loaded, the keyring plugin should transparently steal all secret parameters from accounts in the mcd-account-manager, provided that the keyring daemon is accessible. commit b855e67b2b250fb745f38b5e27dff9fb259aae11 Author: Vivek Dasmohapatra Date: 2010-02-25 19:07:37 +0000 Include the new account shim interface header in the main plugins header. commit 42a6831e4d47a343dca858c573e2013da0e1ddcb Author: Vivek Dasmohapatra Date: 2010-02-25 18:55:51 +0000 Implement the gnome keyring and gkeyfile storage plugins These two plugins will always be loaded at known (and exposed) priorities, this allows plugins that want to steal secrets (eg passwords) to slot themselves in at a higher priority than the keyring plugin, and those that should not receive passwords to slot themselves in between the keyring and keyfile plugins. commit e061231b0c83ca4537a6c174485cd1cb5bb96dc5 Author: Vivek Dasmohapatra Date: 2010-02-25 18:45:35 +0000 New marshallers for account storage plugins. commit d3e7cb461a22b24e64d58c725015fad997fd44cb Author: Vivek Dasmohapatra Date: 2010-02-25 18:44:35 +0000 Header defining the interface for the account storage shim interface. commit 52c82684e6e1a55e095d0886701bcd4054e87369 Author: Vivek Dasmohapatra Date: 2010-02-25 18:43:46 +0000 Define +implement interface by which account plugins can get/set parameters The shim interface, and the object implementing it, that get passed to account storage plugins to allow them to get/set parameters and to check to see whether they are secret (or flag them as secret). commit 6431ea7b698c43e9fa28864398000cea1e93e09c Author: Vivek Dasmohapatra Date: 2010-02-25 18:41:05 +0000 Update the account storage plugin interface to the new API The previous implementation was granular at the account level, new API allows plugins to grab individual account.key pairs, which means we can relocate the gnome-keyring support to the account storage layer instead of having it sit above in the mcd-account object. commit 95b79aff8de71b22502df6c9fec7910945302a49 Author: Vivek Dasmohapatra Date: 2010-02-25 18:37:45 +0000 Expose whether a parmater is secret (for use by account storage plugins). commit 6ead3d4396347ec3ae0682809a70ac9daf276ca7 Author: Vivek Dasmohapatra Date: 2010-02-25 18:37:04 +0000 Remove keyring support from mcd-account (will be moved to a plugin shortly) commit a43f6684c21099210debcdcc736ca2aac1efad74 Author: Vivek Dasmohapatra Date: 2010-02-14 23:53:06 +0000 Initialise the storage in the class initialiser, not the instance. commit aaaa63b99f64774a2f00a4c0ceb65220242bbb89 Author: Vivek Dasmohapatra Date: 2010-02-10 19:04:02 +0000 Sample implementation of account storage plugin, for use in tests later. commit 5b49274b33c6a46b06c8ad1422f8fce3e850bf9f Author: Vivek Dasmohapatra Date: 2010-02-10 19:03:29 +0000 New plugin class for account storage. commit 2fa79a09af19abc64d1d63ae12a76a097c43d93c Author: Vivek Dasmohapatra Date: 2010-02-10 19:02:30 +0000 Load plugins before any other components are initialised. commit 34eabb1752fbe705a73339eb0d959f140a63d9cf Author: Sjoerd Simons Date: 2010-03-01 13:58:58 +0000 Only time out channel requests after many hours Reviewed-by: Simon McVittie commit 24f58efd43b10ad51757be5b2168d49045d0faa2 Author: Eitan Isaacson Date: 2010-02-26 08:39:19 -0800 Changed indentation. commit f05e39e125ebecb04e868c87c237bff3f5e49644 Author: Eitan Isaacson Date: 2010-02-26 08:38:54 -0800 Remove redundant assertion in test script. commit ece1f5b90e9cf6ff33327f4911532b89bbcbdaea Author: Eitan Isaacson Date: 2010-02-25 14:30:17 -0800 Request unrequested channels when connection is ready. Fixes dispatcher/connect-for-request.py. commit 348a68e677c34cc8221e994f7b4a0e8f504229cb Author: Eitan Isaacson Date: 2010-02-25 14:05:34 -0800 Move _mcd_dispatcher_add_connection to mcd_connection_done_task_before_connect from mcd_connection_early_get_interfaces_cb. This guarantees the caps iface has been retrieved for UpdateCapabilities. commit a0ae71ebf164b59ba4761d4edf4bb9d738343448 Author: Eitan Isaacson Date: 2010-02-24 17:45:19 -0800 Regression test adjustments for new connection/dispatcher order. * mctest.py: Reorder expected GetAll method on requests iface in harness. * account-manager/reconnect.py: * account-manager/recover-from-disconnect.py: * account-manager/request-online.py: * account-manager/update-parameters.py: * dispatcher/recover-from-disconnect.py: Expect GetAll on request iface before connected. * capabilities/contact-caps.py: Remove UpdateCapabilities expectation after connection. commit 1ffce339da1e367104ef6c697c3eb7540dd3e14f Author: Eitan Isaacson Date: 2010-02-24 16:30:39 -0800 Added regression test for pre-connected channel dispatching. commit b47991610a4a9947f262b33e7cc94c923a44897c Author: Will Thompson Date: 2010-02-24 14:38:02 +0000 mc-tool: don't crash on invalid account names Reviewed-by: Simon McVittie commit bee3d1e1c7be2058bfa4eeab9b52477975d577d5 Author: Eitan Isaacson Date: 2010-02-17 11:59:34 -0800 Move _mcd_dispatcher_add_connection to an earlier stage. https://bugs.freedesktop.org/show_bug.cgi?id=26583 commit e4d54ce9b9e51291f8c281aa39b28bdf38fb7822 Author: Eitan Isaacson Date: 2010-02-16 17:34:46 -0800 Use telepathy debug interface Fixes: fd.o#26597 Signed-off-by: Jonny Lamb commit 0d7f1f23dd54fb0cd19e93cfe90aa8b82c9d5396 Author: Jonny Lamb Date: 2010-02-18 15:59:57 +0000 mc-wait-for-name: link to GLib properly See Debian bug #556488 for more info. Fixes: fd.o#25122 Signed-off-by: Jonny Lamb commit 3601f10e676b424c113b4f7ea061d405e93fc4c2 Author: Simon McVittie Date: 2009-12-15 17:31:20 +0000 mcd-debug: hook up plugins' debug level commit eef58e645111a18372e69af067cb113ce4e0bc42 Author: Simon McVittie Date: 2009-12-15 17:30:59 +0000 mission-control-plugins: add debug support commit a59e1b8e992ae77d45e77ba1221498220a8a7dc5 Author: Simon McVittie Date: 2009-12-15 17:08:53 +0000 Only load plugins that match mcp-*.so (or mcp-*.dll, etc. as appropriate) commit 782ffa5a6337ff48b81aaf779d510305b6e7f8bd Author: Simon McVittie Date: 2009-12-15 17:07:43 +0000 Add most of the plugin loader to the mission-control-plugins library commit 1671391d4984ae5387f1e042a07b01c001bd58e6 Author: Simon McVittie Date: 2009-11-03 22:56:10 +0000 dispatcher/create-rejected-by-mini-plugin.py: new test for McpRequestPolicy commit d87dd4d5913410edc9537e623f3ef223284950dc Author: Simon McVittie Date: 2009-11-03 22:55:07 +0000 McdAccount: lazily create a McdPluginRequest and pass it to all McpRequestPolicy objects commit 969199a78c867cefc5ed33fae740f67bab9531d7 Author: Simon McVittie Date: 2009-11-03 22:54:32 +0000 McdPluginRequest: add an implementation of McpRequest commit 684616798642c8c50db326e9c09bfa9bf2d5a94b Author: Simon McVittie Date: 2009-11-03 22:53:52 +0000 McdChannel: return from Proceed before possibly signalling Failed commit 2b11293d9d1e9a5e54a8b8124744c3de007b3d8f Author: Simon McVittie Date: 2009-11-03 16:30:12 +0000 mission-control-plugins: add API for noticing and/or denying requests commit be415f0f05fe4c7fdee8a78a50f760d2ac36bd79 Author: Simon McVittie Date: 2009-11-03 21:02:02 +0000 dispatcher/dispatch-rejected-by-mini-plugin.py: regression test for immediate and deferred rejection by plugins commit f86a0c4d613dd5ce587d88a27d569b5af35e378a Author: Simon McVittie Date: 2009-11-03 12:50:43 +0000 McdDispatchOperation: don't run Approvers early if a plugin has already decided to terminate the channels after observers finish commit 3fe828a9518f7ede54350052cf2ae53c431609c3 Author: Simon McVittie Date: 2009-11-03 12:26:40 +0000 dispatcher/dispatch-delayed-by-mini-plugin.py: regression test for mini plugin API commit 5290fb2e24d050d89a137fe8b39d3c14f3c80c71 Author: Simon McVittie Date: 2009-11-03 20:50:19 +0000 Port the "delayed acceptance" plugin from the old API to the new commit 6d98902e0e46e95330ed4a5a3630345ff300fccf Author: Simon McVittie Date: 2009-11-03 12:26:10 +0000 McdDispatchOperation: have a McdPluginDispatchOperation and use it to call mcp_dispatch_operation_policy_check() commit e81fab05393db2b89ee37f4bd3559c0fad6f53b0 Author: Simon McVittie Date: 2009-11-03 20:46:53 +0000 Link MC against libmission-control-plugins.la and implement McpDispatchOperation commit 4e6d97a4eaad3029d402afa8ea9271870d62f56d Author: Simon McVittie Date: 2009-11-03 20:44:34 +0000 Add a simple loader for plugins using mission-control-plugins commit 58c340fb4c6610690dc996e08c02b5e1943d56a0 Author: Simon McVittie Date: 2009-11-03 19:44:00 +0000 Rename --enable-plugins (etc.) to --enable-mcd-plugins (etc.) commit 4935d23ca73f36efa0940c7de2f22311b9fedad2 Author: Simon McVittie Date: 2009-11-03 19:42:28 +0000 Add an interface for plugins to implement in order to filter dispatch operations commit c2b9b191c9e456a4bc4585e4052f9aa3046593dc Author: Simon McVittie Date: 2009-11-03 19:40:25 +0000 Remove mission-control-plugins/dummy.c commit 0d89a4eac0929241e1a5641476c7447e0b323af7 Author: Simon McVittie Date: 2009-11-03 19:39:28 +0000 Add an object to represent dispatch operations for plugins commit e35c90c145db61e7975ea92c2a30dcdfd53cc8cf Author: Simon McVittie Date: 2009-11-03 16:35:18 +0000 Add a skeletal library to contain a minimal plugin API commit eb5665a6a0104188342b4faa7c566066f3185704 Author: Simon McVittie Date: 2009-11-02 17:11:28 +0000 _mcd_dispatch_operation_check_client_locks: run Approvers from here, not from _mcd_dispatch_operation_run_clients When plugins become able to delay dispatching, we want to delay running Approvers until all plugins have stopped delaying. commit cd76b68053aacb23e952e5ef48242589a8b7759d Author: Simon McVittie Date: 2009-10-29 18:05:39 +0000 McdDispatchOperation: add API for plugins to delay dispatching commit 55d72be29151eeb716f48ca28c770c0c18fc45e0 Author: Simon McVittie Date: 2009-10-29 18:04:35 +0000 McdDispatchOperation: add easy API for various dispatch operation attributes Plugins will need these. commit 914b45b46a14e298bb9db75034351570ba74749b Author: Simon McVittie Date: 2009-10-29 17:47:49 +0000 McdDispatchOperation: add API to close, destroy, leave, forget channels commit 5867ae9ba1a7e2a0292d9e84a96487f64d542b86 Author: Jonny Lamb Date: 2010-01-22 13:57:49 +0000 mc-server: give NULL to the new default log handler now that tp-glib has been fixed fd.o#23843 was fixed in telepathy-glib 0.7.37. MC already depends on 0.7.37, so this is just a matter of replacing the user_data workaround smcv added with the correct value of NULL. Signed-off-by: Jonny Lamb commit 412a7a9858bccff14ec8b7c068fea52f0e7152ac Author: Simon McVittie Date: 2009-11-20 19:42:42 +0000 McdAccount: update TpConnection in _mcd_account_set_connection_status When we receive a new TpConnection, that function is called when it's ready, which is more useful than having a connection that isn't ready. commit fdbeb7cf8d8aee7b45f2577f5e49b6fb6ee39924 Author: Simon McVittie Date: 2009-11-20 18:20:08 +0000 Correct a slightly misleading debug message commit 97abf3047e383872e1c7fdfab12937303a1dfe1a Author: Simon McVittie Date: 2009-11-20 18:19:18 +0000 McdAccount: keep a reference to the TpConnection ourselves commit 6b25231989685a616b3584bde513ce2e63d70794 Author: Simon McVittie Date: 2009-11-20 17:06:59 +0000 McdConnection: pass TpConnection to McdAccount in the same signal as the connection status change commit 0df9c9f7a7992ba75542800b161d295822585b88 Author: Simon McVittie Date: 2009-11-20 17:03:26 +0000 McdAccount: guarantee to emit ConnectionStatus and ConnectionStatusReason in the same signal Previously, we relied on the 10ms delay hack to get them to be in the same signal, but this way seems better. This requires a small expectation change in account-manager/auto-connect.py: previously we were relying on the 10ms delay hack delaying the emission of { ConnectionStatusChanged => CONNECTING } until after Connect() was called, which doesn't really seem right in any case (conceptually, we're trying to connect even before we call RequestConnection). Similarly, avatar-persist and avatar-refresh encode the same faulty assumption. Since that code is adequately tested in auto-connect.py, and isn't really the point of the avatar tests, I've just removed the faulty expectation from them. commit bed5596778b31ce7ec733943718c12a6d8de1e35 Author: Simon McVittie Date: 2009-11-20 15:33:10 +0000 McdAccount: emit_property_changed: don't emit empty signals commit 31f25cadb091b490630d60068c453a8ce336d77c Author: Simon McVittie Date: 2009-11-20 15:30:10 +0000 McdAccount: preallocate priv->changed_properties in init In practice, we'll basically always change a property, so there's no point in delaying this. commit a0bdfadc35c1f6571a8c01b02a50c72b17489274 Author: Simon McVittie Date: 2009-11-20 15:26:01 +0000 McdAccount: remove support for emitting property changes instantly There's no point in this being configurable. commit 880110051b779be8435ef99124ef6e97dca8da27 Author: Simon McVittie Date: 2009-11-20 16:37:34 +0000 mcd_account_changed_property: ref account while waiting for a deferred AccountPropertiesChanged Otherwise there's a possible use-after-free (someone changes a property then deletes the account within 10ms). telepathy-mission-control-5.16.4/src/0000755000175000017500000000000012762352247020616 5ustar00gkiagiagkiagia00000000000000telepathy-mission-control-5.16.4/src/client-registry.c0000644000175000017500000004712712735241312024107 0ustar00gkiagiagkiagia00000000000000/* Map containing registered Telepathy clients * * Copyright © 2007-2011 Nokia Corporation. * Copyright © 2009-2011 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * version 2.1 as published by the Free Software Foundation. * * This library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA * */ #include "config.h" #include "client-registry.h" #include #include "mcd-debug.h" #include #include #include G_DEFINE_TYPE (McdClientRegistry, _mcd_client_registry, G_TYPE_OBJECT) enum { PROP_0, PROP_DBUS_DAEMON }; enum { S_CLIENT_ADDED, S_READY, N_SIGNALS }; static guint signals[N_SIGNALS] = { 0 }; struct _McdClientRegistryPrivate { /* hash table containing clients * owned gchar * well_known_name -> owned McdClientProxy */ GHashTable *clients; TpDBusDaemon *dbus_daemon; /* We don't want to start dispatching until startup has finished. This * is defined as: * - activatable clients have been enumerated (ListActivatableNames) * (1 lock) * - running clients have been enumerated (ListNames) (1 lock) * - each client found that way is ready (1 lock per client) * When nothing more is stopping us from dispatching channels, we signal * ready. * */ gsize startup_lock; gboolean startup_completed; }; static void _mcd_client_registry_inc_startup_lock (McdClientRegistry *self) { if (!self->priv->startup_completed) { DEBUG ("%" G_GSIZE_FORMAT " -> %" G_GSIZE_FORMAT, self->priv->startup_lock, self->priv->startup_lock + 1); g_return_if_fail (self->priv->startup_lock > 0); self->priv->startup_lock++; } } static void _mcd_client_registry_dec_startup_lock (McdClientRegistry *self) { if (self->priv->startup_completed) return; DEBUG ("%" G_GSIZE_FORMAT " -> %" G_GSIZE_FORMAT, self->priv->startup_lock, self->priv->startup_lock - 1); g_return_if_fail (self->priv->startup_lock > 0); self->priv->startup_lock--; if (self->priv->startup_lock == 0) { self->priv->startup_completed = TRUE; g_signal_emit (self, signals[S_READY], 0); } } static void mcd_client_registry_ready_cb (McdClientProxy *client, McdClientRegistry *self); static void mcd_client_registry_gone_cb (McdClientProxy *client, McdClientRegistry *self); static void _mcd_client_registry_found_name (McdClientRegistry *self, const gchar *well_known_name, const gchar *unique_name_if_known, gboolean activatable) { McdClientProxy *client; if (!g_str_has_prefix (well_known_name, TP_CLIENT_BUS_NAME_BASE)) { /* This is not a Telepathy Client */ return; } if (!_mcd_client_check_valid_name ( well_known_name + MC_CLIENT_BUS_NAME_BASE_LEN, NULL)) { /* This is probably meant to be a Telepathy Client, but it's not */ DEBUG ("Ignoring invalid Client name: %s", well_known_name + MC_CLIENT_BUS_NAME_BASE_LEN); return; } client = g_hash_table_lookup (self->priv->clients, well_known_name); if (client != NULL) { if (activatable) { /* We already knew that it was active, but now we also know that * it is activatable */ _mcd_client_proxy_set_activatable (client); } else if (unique_name_if_known != NULL) { /* We already knew that it was activatable, but now we also know * that it is active */ _mcd_client_proxy_set_active (client, unique_name_if_known); } return; } DEBUG ("Registering client %s", well_known_name); client = _mcd_client_proxy_new (self->priv->dbus_daemon, well_known_name, unique_name_if_known, activatable); g_hash_table_insert (self->priv->clients, g_strdup (well_known_name), client); /* paired with one in mcd_client_registry_ready_cb, when the * McdClientProxy is ready */ _mcd_client_registry_inc_startup_lock (self); g_signal_connect (client, "ready", G_CALLBACK (mcd_client_registry_ready_cb), self); g_signal_connect (client, "gone", G_CALLBACK (mcd_client_registry_gone_cb), self); g_signal_emit (self, signals[S_CLIENT_ADDED], 0, client); } McdClientProxy * _mcd_client_registry_lookup (McdClientRegistry *self, const gchar *well_known_name) { g_return_val_if_fail (MCD_IS_CLIENT_REGISTRY (self), NULL); return g_hash_table_lookup (self->priv->clients, well_known_name); } static void mcd_client_registry_disconnect_client_signals (gpointer k G_GNUC_UNUSED, gpointer v, gpointer data) { g_signal_handlers_disconnect_by_func (v, mcd_client_registry_ready_cb, data); g_signal_handlers_disconnect_by_func (v, mcd_client_registry_gone_cb, data); if (!_mcd_client_proxy_is_ready (v)) { /* we'll never receive the ready signal now, so release the lock that * it would otherwise have released */ DEBUG ("client %s disappeared before it became ready - treating it " "as ready for our purposes", tp_proxy_get_bus_name (v)); mcd_client_registry_ready_cb (v, data); } } static void _mcd_client_registry_remove (McdClientRegistry *self, const gchar *well_known_name) { McdClientProxy *client; client = g_hash_table_lookup (self->priv->clients, well_known_name); if (client != NULL) { mcd_client_registry_disconnect_client_signals (NULL, client, self); } g_hash_table_remove (self->priv->clients, well_known_name); } void _mcd_client_registry_init_hash_iter (McdClientRegistry *self, GHashTableIter *iter) { g_return_if_fail (MCD_IS_CLIENT_REGISTRY (self)); g_hash_table_iter_init (iter, self->priv->clients); } static void _mcd_client_registry_init (McdClientRegistry *self) { self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, MCD_TYPE_CLIENT_REGISTRY, McdClientRegistryPrivate); self->priv->startup_completed = FALSE; /* the ListNames call we'll make in _constructed is the initial lock */ self->priv->startup_lock = 1; self->priv->clients = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_object_unref); } static void mcd_client_registry_list_activatable_names_cb (TpDBusDaemon *proxy, const gchar **names, const GError *error, gpointer user_data, GObject *weak_object) { McdClientRegistry *self = MCD_CLIENT_REGISTRY (weak_object); if (error != NULL) { DEBUG ("ListActivatableNames returned error, assuming none: %s %d: %s", g_quark_to_string (error->domain), error->code, error->message); } else if (names != NULL) { const gchar **iter = names; DEBUG ("ListActivatableNames returned"); while (*iter != NULL) { _mcd_client_registry_found_name (self, *iter, NULL, TRUE); iter++; } } /* paired with the lock taken when the McdClientRegistry was constructed */ _mcd_client_registry_dec_startup_lock (self); } static void mcd_client_registry_list_names_cb (TpDBusDaemon *proxy, const gchar **names, const GError *error, gpointer user_data, GObject *weak_object) { McdClientRegistry *self = MCD_CLIENT_REGISTRY (weak_object); if (error != NULL) { DEBUG ("ListNames returned error, assuming none: %s %d: %s", g_quark_to_string (error->domain), error->code, error->message); } else if (names != NULL) { const gchar **iter = names; DEBUG ("ListNames returned"); while (*iter != NULL) { _mcd_client_registry_found_name (self, *iter, NULL, FALSE); iter++; } } tp_cli_dbus_daemon_call_list_activatable_names (proxy, -1, mcd_client_registry_list_activatable_names_cb, NULL, NULL, weak_object); /* deliberately not calling _mcd_client_registry_dec_startup_lock here - * this function is "lock-neutral", similarly to list_names_cb (we would * take a lock for ListActivatableNames then release the one used for * ReloadConfig), so simplify by doing nothing */ } static DBusHandlerResult mcd_client_registry_name_owner_filter (DBusConnection *conn, DBusMessage *msg, gpointer data) { McdClientRegistry *self = MCD_CLIENT_REGISTRY (data); /* make sure this is the right kind of signal: */ if (dbus_message_is_signal (msg, DBUS_INTERFACE_DBUS, "NameOwnerChanged")) { const gchar *dbus_name = NULL; const gchar *old_owner = NULL; const gchar *new_owner = NULL; gboolean ok = dbus_message_get_args (msg, NULL, DBUS_TYPE_STRING, &dbus_name, DBUS_TYPE_STRING, &old_owner, DBUS_TYPE_STRING, &new_owner, DBUS_TYPE_INVALID); /* could not unpack args -> invalid -> stop processing right here */ if (!ok) return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; if (tp_str_empty (old_owner) && !tp_str_empty (new_owner)) _mcd_client_registry_found_name (self, dbus_name, new_owner, FALSE); } /* in case somebody else is also interested */ return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; } static void watch_clients (McdClientRegistry *self) { TpDBusDaemon *dbus_daemon = self->priv->dbus_daemon; DBusGConnection *gconn = tp_proxy_get_dbus_connection (dbus_daemon); DBusConnection *dconn = dbus_g_connection_get_connection (gconn); DBusError error = { 0 }; #define MATCH_ITEM(t,x) #t "='" x "'" #define NAME_OWNER_RULE \ MATCH_ITEM (type, "signal") "," \ MATCH_ITEM (sender, DBUS_SERVICE_DBUS) "," \ MATCH_ITEM (interface, DBUS_INTERFACE_DBUS) "," \ MATCH_ITEM (member, "NameOwnerChanged") #define CLIENT_MATCH_RULE \ NAME_OWNER_RULE "," \ MATCH_ITEM (arg0namespace, "org.freedesktop.Telepathy.Client") if (!dbus_connection_add_filter (dconn, mcd_client_registry_name_owner_filter, self, NULL)) g_critical ("Could not add filter for NameOwnerChanged (out of memory?)"); dbus_error_init (&error); dbus_bus_add_match (dconn, CLIENT_MATCH_RULE, &error); if (dbus_error_is_set (&error)) { DEBUG ("Could not add client names match rule (D-Bus 1.6 required): %s", error.message); dbus_error_free (&error); dbus_bus_add_match (dconn, NAME_OWNER_RULE, &error); if (dbus_error_is_set (&error)) { g_critical ("Could not add all dbus names match rule: %s", error.message); dbus_error_free (&error); } } } static void mcd_client_registry_constructed (GObject *object) { McdClientRegistry *self = MCD_CLIENT_REGISTRY (object); void (*chain_up) (GObject *) = G_OBJECT_CLASS (_mcd_client_registry_parent_class)->constructed; if (chain_up != NULL) chain_up (object); g_return_if_fail (self->priv->dbus_daemon != NULL); DEBUG ("Starting to look for clients"); watch_clients (self); tp_cli_dbus_daemon_call_list_names (self->priv->dbus_daemon, -1, mcd_client_registry_list_names_cb, NULL, NULL, object); } static void mcd_client_registry_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) { McdClientRegistry *self = MCD_CLIENT_REGISTRY (object); switch (prop_id) { case PROP_DBUS_DAEMON: g_assert (self->priv->dbus_daemon == NULL); /* it's construct-only */ self->priv->dbus_daemon = TP_DBUS_DAEMON (g_value_dup_object (value)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } } static void mcd_client_registry_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) { McdClientRegistry *self = MCD_CLIENT_REGISTRY (object); switch (prop_id) { case PROP_DBUS_DAEMON: g_value_set_object (value, self->priv->dbus_daemon); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } } static void mcd_client_registry_dispose (GObject *object) { McdClientRegistry *self = MCD_CLIENT_REGISTRY (object); void (*chain_up) (GObject *) = G_OBJECT_CLASS (_mcd_client_registry_parent_class)->dispose; if (self->priv->dbus_daemon != NULL) { DBusGConnection *gconn = tp_proxy_get_dbus_connection (self->priv->dbus_daemon); DBusConnection *dconn = dbus_g_connection_get_connection (gconn); dbus_connection_remove_filter (dconn, mcd_client_registry_name_owner_filter, self); } tp_clear_object (&self->priv->dbus_daemon); if (self->priv->clients != NULL) { g_hash_table_foreach (self->priv->clients, mcd_client_registry_disconnect_client_signals, self); } tp_clear_pointer (&self->priv->clients, g_hash_table_unref); if (chain_up != NULL) chain_up (object); } static void _mcd_client_registry_class_init (McdClientRegistryClass *cls) { GObjectClass *object_class = G_OBJECT_CLASS (cls); g_type_class_add_private (cls, sizeof (McdClientRegistryPrivate)); object_class->constructed = mcd_client_registry_constructed; object_class->get_property = mcd_client_registry_get_property; object_class->set_property = mcd_client_registry_set_property; object_class->dispose = mcd_client_registry_dispose; g_object_class_install_property (object_class, PROP_DBUS_DAEMON, g_param_spec_object ("dbus-daemon", "D-Bus daemon", "D-Bus daemon", TP_TYPE_DBUS_DAEMON, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS)); signals[S_CLIENT_ADDED] = g_signal_new ("client-added", G_OBJECT_CLASS_TYPE (cls), G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED, 0, NULL, NULL, g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1, MCD_TYPE_CLIENT_PROXY); signals[S_READY] = g_signal_new ("ready", G_OBJECT_CLASS_TYPE (cls), G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0); } McdClientRegistry * _mcd_client_registry_new (TpDBusDaemon *dbus_daemon) { return g_object_new (MCD_TYPE_CLIENT_REGISTRY, "dbus-daemon", dbus_daemon, NULL); } static void mcd_client_registry_ready_cb (McdClientProxy *client, McdClientRegistry *self) { DEBUG ("%s", tp_proxy_get_bus_name (client)); g_signal_handlers_disconnect_by_func (client, mcd_client_registry_ready_cb, self); /* paired with the one in _mcd_client_registry_found_name */ _mcd_client_registry_dec_startup_lock (self); } static void mcd_client_registry_gone_cb (McdClientProxy *client, McdClientRegistry *self) { _mcd_client_registry_remove (self, tp_proxy_get_bus_name (client)); } GPtrArray * _mcd_client_registry_dup_client_caps (McdClientRegistry *self) { GPtrArray *vas; GHashTableIter iter; gpointer p; g_return_val_if_fail (MCD_IS_CLIENT_REGISTRY (self), NULL); vas = g_ptr_array_sized_new (g_hash_table_size (self->priv->clients)); g_hash_table_iter_init (&iter, self->priv->clients); while (g_hash_table_iter_next (&iter, NULL, &p)) { g_ptr_array_add (vas, _mcd_client_proxy_dup_handler_capabilities (p)); } return vas; } gboolean _mcd_client_registry_is_ready (McdClientRegistry *self) { g_return_val_if_fail (MCD_IS_CLIENT_REGISTRY (self), FALSE); return self->priv->startup_completed; } typedef struct { McdClientProxy *client; gboolean bypass; gsize quality; } PossibleHandler; static gint possible_handler_cmp (gconstpointer a_, gconstpointer b_) { const PossibleHandler *a = a_; const PossibleHandler *b = b_; if (a->bypass) { if (!b->bypass) { /* BypassApproval wins, so a is better than b */ return 1; } } else if (b->bypass) { /* BypassApproval wins, so b is better than a */ return -1; } if (a->quality < b->quality) { return -1; } if (b->quality < a->quality) { return 1; } return 0; } GList * _mcd_client_registry_list_possible_handlers (McdClientRegistry *self, const gchar *preferred_handler, GVariant *request_props, TpChannel *channel, const gchar *must_have_unique_name) { GList *handlers = NULL; GList *handlers_iter; GHashTableIter client_iter; gpointer client_p; _mcd_client_registry_init_hash_iter (self, &client_iter); while (g_hash_table_iter_next (&client_iter, NULL, &client_p)) { McdClientProxy *client = MCD_CLIENT_PROXY (client_p); gsize quality; if (must_have_unique_name != NULL && tp_strdiff (must_have_unique_name, _mcd_client_proxy_get_unique_name (client))) { /* we're trying to redispatch to an existing handler, and this is * not it */ continue; } if (!tp_proxy_has_interface_by_id (client, TP_IFACE_QUARK_CLIENT_HANDLER)) { /* not a handler at all */ continue; } if (channel == NULL) { /* We don't know the channel's properties (the next part will not * execute), so we must work out the quality of match from the * channel request. We can assume that the request will return one * channel, with the requested properties, plus Requested == TRUE. */ g_assert (request_props != NULL); quality = _mcd_client_match_filters (request_props, _mcd_client_proxy_get_handler_filters (client), TRUE); } else { GVariant *properties; g_assert (TP_IS_CHANNEL (channel)); properties = tp_channel_dup_immutable_properties (channel); quality = _mcd_client_match_filters (properties, _mcd_client_proxy_get_handler_filters (client), FALSE); g_variant_unref (properties); } if (quality > 0) { PossibleHandler *ph = g_slice_new0 (PossibleHandler); ph->client = client; ph->bypass = _mcd_client_proxy_get_bypass_approval (client); ph->quality = quality; handlers = g_list_prepend (handlers, ph); } } /* if no handlers can take them all, fail - unless we're operating on * a request that specified a preferred handler, in which case assume * it's suitable */ if (handlers == NULL) { McdClientProxy *client; if (preferred_handler == NULL || preferred_handler[0] == '\0') { return NULL; } client = _mcd_client_registry_lookup (self, preferred_handler); if (client == NULL) { return NULL; } return g_list_append (NULL, client); } /* We have at least one handler that can take the whole batch. Sort * the possible handlers, most preferred first (i.e. sort by ascending * quality then reverse) */ handlers = g_list_sort (handlers, possible_handler_cmp); handlers = g_list_reverse (handlers); /* convert in-place from a list of PossibleHandler to a list of * McdClientProxy */ for (handlers_iter = handlers; handlers_iter != NULL; handlers_iter = handlers_iter->next) { PossibleHandler *ph = handlers_iter->data; handlers_iter->data = ph->client; g_slice_free (PossibleHandler, ph); } return handlers; } TpDBusDaemon * _mcd_client_registry_get_dbus_daemon (McdClientRegistry *self) { g_return_val_if_fail (MCD_IS_CLIENT_REGISTRY (self), NULL); return self->priv->dbus_daemon; } telepathy-mission-control-5.16.4/src/mcd-service.c0000644000175000017500000001160712735242352023163 0ustar00gkiagiagkiagia00000000000000/* vi: set et sw=4 ts=8 cino=t0,(0: */ /* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4; tab-width: 8 -*- */ /* * This file is part of mission-control * * Copyright (C) 2007-2009 Nokia Corporation. * Copyright (C) 2009 Collabora Ltd. * * Contact: Naba Kumar * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * version 2.1 as published by the Free Software Foundation. * * This library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA * */ /** * SECTION:mcd-service * @title: McdService * @short_description: Service interface implementation * @see_also: * @stability: Unstable * @include: mcd-service.h * * It is the frontline interface object that exposes mission-control to outside * world through a dbus interface. It basically subclasses McdMaster and * wraps up everything inside it and translate them into mission-control * dbus interface. */ #include "config.h" #include #include #include #include #include #include #include #include #include #include #include "mcd-connection.h" #include "mcd-misc.h" #include "mcd-service.h" /* DBus service specifics */ #define MISSION_CONTROL_DBUS_SERVICE "org.freedesktop.Telepathy.MissionControl5" static GObjectClass *parent_class = NULL; #define MCD_OBJECT_PRIV(mission) (G_TYPE_INSTANCE_GET_PRIVATE ((mission), \ MCD_TYPE_SERVICE, \ McdServicePrivate)) G_DEFINE_TYPE (McdService, mcd_service, MCD_TYPE_MASTER); /* Private */ typedef struct _McdServicePrivate { gboolean is_disposed; } McdServicePrivate; static void mcd_service_obtain_bus_name (McdService * obj) { McdMaster *master = MCD_MASTER (obj); GError *error = NULL; DEBUG ("Requesting MC dbus service"); if (!tp_dbus_daemon_request_name (mcd_master_get_dbus_daemon (master), MISSION_CONTROL_DBUS_SERVICE, TRUE /* idempotent */, &error)) { g_warning ("Failed registering '%s' service: %s", MISSION_CONTROL_DBUS_SERVICE, error->message); g_error_free (error); exit (1); } } static void mcd_service_disconnect (McdMission *mission) { MCD_MISSION_CLASS (mcd_service_parent_class)->disconnect (mission); mcd_master_shutdown (MCD_MASTER (mission), "Disconnected"); } static void mcd_dispose (GObject * obj) { McdServicePrivate *priv; McdService *self = MCD_OBJECT (obj); priv = MCD_OBJECT_PRIV (self); if (priv->is_disposed) { return; } priv->is_disposed = TRUE; if (self->main_loop) { g_main_loop_quit (self->main_loop); } tp_clear_pointer (&self->main_loop, g_main_loop_unref); if (G_OBJECT_CLASS (parent_class)->dispose) { G_OBJECT_CLASS (parent_class)->dispose (obj); } } static void mcd_service_constructed (GObject *obj) { DEBUG ("called"); mcd_service_obtain_bus_name (MCD_OBJECT (obj)); mcd_debug_print_tree (obj); if (G_OBJECT_CLASS (parent_class)->constructed) G_OBJECT_CLASS (parent_class)->constructed (obj); } static void mcd_service_init (McdService * obj) { obj->main_loop = g_main_loop_new (NULL, FALSE); DEBUG ("called"); } static void mcd_service_class_init (McdServiceClass * self) { GObjectClass *gobject_class = G_OBJECT_CLASS (self); McdMissionClass *mission_class = MCD_MISSION_CLASS (self); parent_class = g_type_class_peek_parent (self); gobject_class->constructed = mcd_service_constructed; gobject_class->dispose = mcd_dispose; mission_class->disconnect = mcd_service_disconnect; g_type_class_add_private (gobject_class, sizeof (McdServicePrivate)); } McdService * mcd_service_new (void) { McdService *obj; TpDBusDaemon *dbus_daemon; GError *error = NULL; /* Initialize DBus connection */ dbus_daemon = tp_dbus_daemon_dup (&error); if (dbus_daemon == NULL) { g_printerr ("Failed to open connection to bus: %s", error->message); g_error_free (error); return NULL; } obj = g_object_new (MCD_TYPE_SERVICE, "dbus-daemon", dbus_daemon, NULL); g_object_unref (dbus_daemon); return obj; } void mcd_service_run (McdService * self) { g_main_loop_run (self->main_loop); } void mcd_service_stop (McdService * self) { if (self->main_loop != NULL) g_main_loop_quit (self->main_loop); } telepathy-mission-control-5.16.4/src/mcd-dbusprop.c0000644000175000017500000002552612735241312023361 0ustar00gkiagiagkiagia00000000000000/* vi: set et sw=4 ts=8 cino=t0,(0: */ /* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4; tab-width: 8 -*- */ /* * This file is part of mission-control * * Copyright (C) 2008-2009 Nokia Corporation. * Copyright (C) 2009 Collabora Ltd. * * Contact: Alberto Mardegan * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * version 2.1 as published by the Free Software Foundation. * * This library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA * */ #include "config.h" #include #include #include "mcd-dbusprop.h" #include "mcd-debug.h" #define MCD_INTERFACES_QUARK get_interfaces_quark() static GQuark get_interfaces_quark (void) { static GQuark interfaces_quark = 0; if (G_UNLIKELY (!interfaces_quark)) interfaces_quark = g_quark_from_static_string ("interfaces"); return interfaces_quark; } #define MCD_ACTIVE_OPTIONAL_INTERFACES_QUARK \ get_active_optional_interfaces_quark() static GQuark get_active_optional_interfaces_quark (void) { static GQuark active_optional_interfaces_quark = 0; if (G_UNLIKELY (active_optional_interfaces_quark == 0)) active_optional_interfaces_quark = g_quark_from_static_string ("active-optional-interfaces"); return active_optional_interfaces_quark; } /** * get_active_optional_interfaces: * * DBus Interfaces marked as optional will only be included in the object's * Interfaces property if they appear in this set. * * Returns: a #TpIntset of the active optional interfaces. */ static TpIntset * get_active_optional_interfaces (TpSvcDBusProperties *object) { TpIntset *aoi = g_object_get_qdata (G_OBJECT (object), MCD_ACTIVE_OPTIONAL_INTERFACES_QUARK); if (G_UNLIKELY (aoi == NULL)) { aoi = tp_intset_new (); g_object_set_qdata_full (G_OBJECT (object), MCD_ACTIVE_OPTIONAL_INTERFACES_QUARK, aoi, (GDestroyNotify) tp_intset_destroy); } return aoi; } void mcd_dbus_activate_optional_interface (TpSvcDBusProperties *object, GType interface) { tp_intset_add (get_active_optional_interfaces (object), interface); } gboolean mcd_dbus_is_active_optional_interface (TpSvcDBusProperties *object, GType interface) { return tp_intset_is_member (get_active_optional_interfaces (object), interface); } static const McdDBusProp * get_interface_properties (TpSvcDBusProperties *object, const gchar *interface) { McdInterfaceData *iface_data; GType type; /* we must look up the ancestors, in case the object implementing the * interface has been subclassed. */ for (type = G_OBJECT_TYPE (object); type != 0; type = g_type_parent (type)) { iface_data = g_type_get_qdata (type, MCD_INTERFACES_QUARK); if (!iface_data) continue; while (iface_data->get_type) { if (iface_data->interface && strcmp (iface_data->interface, interface) == 0) return iface_data->properties; iface_data++; } } return NULL; } static const McdDBusProp * get_mcddbusprop (TpSvcDBusProperties *self, const gchar *interface_name, const gchar *property_name, GError **error) { const McdDBusProp *prop_array, *property; DEBUG ("%s, %s", interface_name, property_name); prop_array = get_interface_properties (self, interface_name); if (!prop_array) { g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "invalid interface: %s", interface_name); return NULL; } /* look for our property */ for (property = prop_array; property->name != NULL; property++) if (strcmp (property->name, property_name) == 0) break; if (!property->name) { g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "invalid property: %s", property_name); return NULL; } return property; } gboolean mcd_dbusprop_set_property (TpSvcDBusProperties *self, const gchar *interface_name, const gchar *property_name, const GValue *value, GError **error) { const McdDBusProp *property; property = get_mcddbusprop (self, interface_name, property_name, error); if (property == NULL) return FALSE; if (!property->setprop) { g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "property %s cannot be written", property_name); return FALSE; } /* we pass property->name, because we know it's a static value and there * will be no need to care about its lifetime */ return property->setprop (self, property->name, value, MCD_DBUS_PROP_SET_FLAG_NONE, error); } void dbusprop_set (TpSvcDBusProperties *self, const gchar *interface_name, const gchar *property_name, const GValue *value, DBusGMethodInvocation *context) { GError *error = NULL; mcd_dbusprop_set_property (self, interface_name, property_name, value, &error); if (error) { dbus_g_method_return_error (context, error); g_error_free (error); return; } tp_svc_dbus_properties_return_from_set (context); } gboolean mcd_dbusprop_get_property (TpSvcDBusProperties *self, const gchar *interface_name, const gchar *property_name, GValue *value, GError **error) { const McdDBusProp *property; property = get_mcddbusprop (self, interface_name, property_name, error); if (property == NULL) return FALSE; if (!property->getprop) { g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "property %s cannot be read", property_name); return FALSE; } property->getprop (self, property_name, value); return TRUE; } void dbusprop_get (TpSvcDBusProperties *self, const gchar *interface_name, const gchar *property_name, DBusGMethodInvocation *context) { GValue value = G_VALUE_INIT; GError *error = NULL; DEBUG ("%s, %s", interface_name, property_name); mcd_dbusprop_get_property (self, interface_name, property_name, &value, &error); if (error) { dbus_g_method_return_error (context, error); g_error_free (error); return; } tp_svc_dbus_properties_return_from_get (context, &value); g_value_unset (&value); } typedef struct { TpSvcDBusProperties *self; DBusGMethodInvocation *context; GHashTable *properties; const McdDBusProp *property; } GetAllData; static void get_all_iter (GetAllData *data) { if (data->property->name != NULL) { if (data->property->getprop) { GValue *out; out = g_malloc0 (sizeof (GValue)); data->property->getprop (data->self, data->property->name, out); g_hash_table_insert (data->properties, (gchar *) data->property->name, tp_g_value_slice_dup (out)); g_value_unset (out); g_free (out); data->property++; get_all_iter (data); } else { data->property++; get_all_iter (data); } } else { tp_svc_dbus_properties_return_from_get_all (data->context, data->properties); g_hash_table_unref (data->properties); g_slice_free (GetAllData, data); } } typedef struct { TpSvcDBusProperties *tp_svc_props; gchar *interface; gchar *property; } DBusPropAsyncData; void dbusprop_get_all (TpSvcDBusProperties *self, const gchar *interface_name, DBusGMethodInvocation *context) { const McdDBusProp *prop_array; GError *error = NULL; GetAllData *data; DEBUG ("%s", interface_name); prop_array = get_interface_properties (self, interface_name); if (!prop_array) { g_set_error (&error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "invalid interface: %s", interface_name); dbus_g_method_return_error (context, error); g_error_free (error); return; } data = g_slice_new0 (GetAllData); data->self = self; data->context = context; data->properties = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, (GDestroyNotify) tp_g_value_slice_free); data->property = prop_array; get_all_iter (data); } void mcd_dbus_init_interfaces (GType g_define_type_id, const McdInterfaceData *iface_data) { g_type_set_qdata (g_define_type_id, MCD_INTERFACES_QUARK, (gpointer)iface_data); while (iface_data->get_type) { GType type; type = iface_data->get_type(); G_IMPLEMENT_INTERFACE (type, iface_data->iface_init); iface_data++; } } void mcd_dbus_init_interfaces_instances (gpointer self) { McdInterfaceData *iface_data; iface_data = g_type_get_qdata (G_OBJECT_TYPE (self), MCD_INTERFACES_QUARK); while (iface_data->get_type) { if (iface_data->instance_init) iface_data->instance_init (self); iface_data++; } } void mcd_dbus_get_interfaces (TpSvcDBusProperties *self, const gchar *name, GValue *value) { McdInterfaceData *iface_data, *id; GPtrArray *a_ifaces; GType type; DEBUG ("called"); a_ifaces = g_ptr_array_new (); for (type = G_OBJECT_TYPE (self); type != 0; type = g_type_parent (type)) { iface_data = g_type_get_qdata (type, MCD_INTERFACES_QUARK); if (!iface_data) continue; for (id = iface_data; id->get_type; id++) { if (id->optional && !mcd_dbus_is_active_optional_interface (self, id->get_type ())) { DEBUG ("skipping inactive optional iface %s", id->interface); continue; } g_ptr_array_add (a_ifaces, g_strdup (id->interface)); } } g_ptr_array_add (a_ifaces, NULL); g_value_init (value, G_TYPE_STRV); g_value_take_boxed (value, g_ptr_array_free (a_ifaces, FALSE)); } telepathy-mission-control-5.16.4/src/mcd-debug.h0000644000175000017500000000412612735241312022607 0ustar00gkiagiagkiagia00000000000000/* vi: set et sw=4 ts=8 cino=t0,(0: */ /* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4; tab-width: 8 -*- */ /* * This file is part of mission-control * * Copyright (C) 2007-2009 Nokia Corporation. * Copyright (C) 2009 Collabora Ltd. * * Contact: Naba Kumar * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * version 2.1 as published by the Free Software Foundation. * * This library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA * */ #ifndef __MCD_DEBUG_H__ #define __MCD_DEBUG_H__ #include #include G_BEGIN_DECLS #undef DEBUG #ifdef ENABLE_DEBUG #define DEBUGGING (_mcd_debug_get_level () > 0) #define DEBUG(format, ...) \ mcd_debug ("%s: " format, G_STRFUNC, ##__VA_ARGS__) #define WARNING(format, ...) \ g_warning ("%s: " format, G_STRFUNC, ##__VA_ARGS__) #else /* !defined ENABLE_DEBUG */ #define DEBUGGING (0) #define DEBUG(format, ...) do {} while (0) #endif /* ENABLE_DEBUG */ #define MESSAGE(format, ...) \ g_message ("%s: " format, G_STRFUNC, ##__VA_ARGS__) #define WARNING(format, ...) \ g_warning ("%s: " format, G_STRFUNC, ##__VA_ARGS__) #define CRITICAL(format, ...) \ g_critical ("%s: " format, G_STRFUNC, ##__VA_ARGS__) #define ERROR(format, ...) \ g_error ("%s: " format, G_STRFUNC, ##__VA_ARGS__) extern gint mcd_debug_level; void mcd_debug_init (void); void mcd_debug_set_level (gint level); static inline gint _mcd_debug_get_level (void) { return mcd_debug_level; } void mcd_debug_print_tree (gpointer obj); void mcd_debug (const gchar *format, ...) G_GNUC_PRINTF (1, 2); G_END_DECLS #endif /* __MCD_DEBUG_H__ */ telepathy-mission-control-5.16.4/src/stamp-mcd-enum-types.h0000644000175000017500000000001212762351667024756 0ustar00gkiagiagkiagia00000000000000timestamp telepathy-mission-control-5.16.4/src/mcd-account-conditions.c0000644000175000017500000001126112735242352025322 0ustar00gkiagiagkiagia00000000000000/* vi: set et sw=4 ts=8 cino=t0,(0: */ /* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4; tab-width: 8 -*- */ /* * This file is part of mission-control * * Copyright (C) 2008-2009 Nokia Corporation. * Copyright (C) 2009 Collabora Ltd. * * Contact: Alberto Mardegan * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * version 2.1 as published by the Free Software Foundation. * * This library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA * */ #include "config.h" #include #include #include #include #include #include "mcd-account.h" #include "mcd-account-priv.h" #include "mcd-account-conditions.h" #include "mcd-account-manager.h" static void store_condition (gpointer key, gpointer value, gpointer userdata) { McdAccount *account = MCD_ACCOUNT (userdata); McdStorage *storage = _mcd_account_get_storage (account); const gchar *account_name = mcd_account_get_unique_name (account); const gchar *name = key, *condition = value; gchar condition_key[256]; g_snprintf (condition_key, sizeof (condition_key), "condition-%s", name); mcd_storage_set_string (storage, account_name, condition_key, condition); } static gboolean set_condition (TpSvcDBusProperties *self, const gchar *name, const GValue *value, McdDBusPropSetFlags flags, GError **error) { McdAccount *account = MCD_ACCOUNT (self); McdStorage *storage = _mcd_account_get_storage (account); const gchar *account_name = mcd_account_get_unique_name (account); gchar **keys, **key; GHashTable *conditions; /* FIXME: some sort of validation beyond just the type? */ if (!G_VALUE_HOLDS (value, TP_HASH_TYPE_STRING_STRING_MAP)) { g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Expected a{s:s} for Condition, but got %s", G_VALUE_TYPE_NAME (value)); return FALSE; } if (_mcd_account_get_always_on (account)) { g_set_error (error, TP_ERROR, TP_ERROR_PERMISSION_DENIED, "Account %s conditions cannot be changed", mcd_account_get_unique_name (account)); return FALSE; } conditions = g_value_get_boxed (value); /* first, delete existing conditions */ keys = mcd_storage_dup_attributes (storage, account_name, NULL); for (key = keys; *key != NULL; key++) { if (strncmp (*key, "condition-", 10) != 0) continue; mcd_storage_set_attribute (storage, account_name, *key, NULL); } g_strfreev (keys); if (!(flags & MCD_DBUS_PROP_SET_FLAG_ALREADY_IN_STORAGE)) { g_hash_table_foreach (conditions, store_condition, account); mcd_storage_commit (storage, account_name); } return TRUE; } static void get_condition (TpSvcDBusProperties *self, const gchar *name, GValue *value) { GHashTable *conditions; conditions = mcd_account_get_conditions (MCD_ACCOUNT (self)); g_value_init (value, DBUS_TYPE_G_STRING_STRING_HASHTABLE); g_value_take_boxed (value, conditions); } const McdDBusProp account_conditions_properties[] = { { "Condition", set_condition, get_condition }, { 0 }, }; void account_conditions_iface_init (McSvcAccountInterfaceConditionsClass *iface, gpointer iface_data) { } GHashTable *mcd_account_get_conditions (McdAccount *account) { gchar **keys, **key, *condition; GHashTable *conditions; McdStorage *storage = _mcd_account_get_storage (account); const gchar *account_name = mcd_account_get_unique_name (account); conditions = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free); keys = mcd_storage_dup_attributes (storage, account_name, NULL); for (key = keys; *key != NULL; key++) { if (strncmp (*key, "condition-", 10) != 0) continue; condition = mcd_storage_dup_string (storage, account_name, *key); DEBUG ("Condition: %s = %s", *key, condition); g_hash_table_insert (conditions, g_strdup (*key + 10), condition); } g_strfreev (keys); return conditions; } telepathy-mission-control-5.16.4/src/mcd-operation.c0000644000175000017500000001763212735241312023522 0ustar00gkiagiagkiagia00000000000000/* vi: set et sw=4 ts=8 cino=t0,(0: */ /* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4; tab-width: 8 -*- */ /* * This file is part of mission-control * * Copyright (C) 2007 Nokia Corporation. * * Contact: Naba Kumar * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * version 2.1 as published by the Free Software Foundation. * * This library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA * */ /** * SECTION:mcd-operation * @title: McdOperation * @short_description: Container class for holding missions * @see_also: * @stability: Unstable * @include: mcd-operation.h * * This is a simple container class that can hold a list of mission objects * as children. McdOperation makes sure that object states (see: McdMission) * of the container are all proxied to the children. Children life cycles * also managed by this class and parent-child relationship is correctly * established. */ #include "config.h" #include "mcd-operation.h" #include "mcd-mission-priv.h" #define MCD_OPERATION_PRIV(operation) (G_TYPE_INSTANCE_GET_PRIVATE ((operation), \ MCD_TYPE_OPERATION, \ McdOperationPrivate)) G_DEFINE_TYPE (McdOperation, mcd_operation, MCD_TYPE_MISSION); /* Private */ typedef struct _McdOperationPrivate { GList *missions; gboolean is_disposed; } McdOperationPrivate; enum _McdOperationSignalType { MISSION_TAKEN, MISSION_REMOVED, LAST_SIGNAL }; static guint mcd_operation_signals[LAST_SIGNAL] = { 0 }; static void on_mission_abort (McdMission *mission, McdOperation *operation) { g_return_if_fail (MCD_IS_MISSION (mission)); g_return_if_fail (MCD_IS_OPERATION (operation)); mcd_operation_remove_mission (operation, mission); } static void _mcd_operation_disconnect_mission (McdMission *mission, McdOperation *operation) { g_signal_handlers_disconnect_by_func (mission, G_CALLBACK (on_mission_abort), operation); } static void _mcd_operation_finalize (GObject * object) { G_OBJECT_CLASS (mcd_operation_parent_class)->finalize (object); } static void _mcd_operation_child_unref (McdMission *child) { g_object_unref (child); } static void _mcd_operation_abort (McdOperation * operation) { const GList *node; DEBUG ("Operation abort received, aborting all children"); node = MCD_OPERATION_PRIV (operation)->missions; while (node) { McdMission *mission = MCD_MISSION (node->data); /* We don't want to hear it ourself so that we still hold the * final reference to our children. */ g_signal_handlers_disconnect_by_func (mission, G_CALLBACK (on_mission_abort), operation); mcd_mission_abort (mission); /* Restore the handler so that we continue listing for destroy * notify for our children. */ g_signal_connect (mission, "abort", G_CALLBACK (on_mission_abort), operation); node = g_list_next (node); } } static void _mcd_operation_dispose (GObject * object) { McdOperationPrivate *priv = MCD_OPERATION_PRIV (object); if (priv->is_disposed) { return; } priv->is_disposed = TRUE; DEBUG ("operation disposed"); g_signal_handlers_disconnect_by_func (object, G_CALLBACK (_mcd_operation_abort), NULL); if (priv->missions) { g_list_foreach (priv->missions, (GFunc) _mcd_operation_disconnect_mission, object); g_list_foreach (priv->missions, (GFunc) _mcd_operation_child_unref, NULL); g_list_free (priv->missions); priv->missions = NULL; } G_OBJECT_CLASS (mcd_operation_parent_class)->dispose (object); } static void _mcd_operation_connect (McdMission * mission) { McdOperationPrivate *priv = MCD_OPERATION_PRIV (mission); g_list_foreach (priv->missions, (GFunc) mcd_mission_connect, NULL); MCD_MISSION_CLASS (mcd_operation_parent_class)->connect (mission); } static void _mcd_operation_disconnect (McdMission * mission) { McdOperationPrivate *priv = MCD_OPERATION_PRIV (mission); g_list_foreach (priv->missions, (GFunc) mcd_mission_disconnect, NULL); MCD_MISSION_CLASS (mcd_operation_parent_class)->disconnect (mission); } void mcd_operation_take_mission (McdOperation * operation, McdMission * mission) { McdOperationPrivate *priv; g_return_if_fail (MCD_IS_OPERATION (operation)); g_return_if_fail (MCD_IS_MISSION (mission)); priv = MCD_OPERATION_PRIV (operation); priv->missions = g_list_prepend (priv->missions, mission); _mcd_mission_set_parent (mission, MCD_MISSION (operation)); if (mcd_mission_is_connected (MCD_MISSION (operation))) mcd_mission_connect (mission); g_signal_connect (mission, "abort", G_CALLBACK (on_mission_abort), operation); g_signal_emit_by_name (G_OBJECT (operation), "mission-taken", mission); } void mcd_operation_remove_mission (McdOperation * operation, McdMission * mission) { McdOperationPrivate *priv; g_return_if_fail (MCD_IS_OPERATION (operation)); g_return_if_fail (MCD_IS_MISSION (mission)); priv = MCD_OPERATION_PRIV (operation); g_return_if_fail (g_list_find (priv->missions, mission) != NULL); _mcd_operation_disconnect_mission (mission, operation); priv->missions = g_list_remove (priv->missions, mission); _mcd_mission_set_parent (mission, NULL); g_signal_emit_by_name (G_OBJECT (operation), "mission-removed", mission); DEBUG ("removing mission: %p", mission); g_object_unref (mission); } static void mcd_operation_class_init (McdOperationClass * klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); McdMissionClass *mission_class = MCD_MISSION_CLASS (klass); g_type_class_add_private (object_class, sizeof (McdOperationPrivate)); object_class->finalize = _mcd_operation_finalize; object_class->dispose = _mcd_operation_dispose; mission_class->connect = _mcd_operation_connect; mission_class->disconnect = _mcd_operation_disconnect; mcd_operation_signals[MISSION_TAKEN] = g_signal_new ("mission-taken", G_OBJECT_CLASS_TYPE (klass), G_SIGNAL_RUN_FIRST, G_STRUCT_OFFSET (McdOperationClass, mission_taken_signal), NULL, NULL, g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1, G_TYPE_OBJECT); mcd_operation_signals[MISSION_REMOVED] = g_signal_new ("mission-removed", G_OBJECT_CLASS_TYPE (klass), G_SIGNAL_RUN_FIRST, G_STRUCT_OFFSET (McdOperationClass, mission_removed_signal), NULL, NULL, g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1, G_TYPE_OBJECT); } static void mcd_operation_init (McdOperation * obj) { McdOperationPrivate *priv = MCD_OPERATION_PRIV (obj); priv->missions = NULL; /* Listen to self abort so that we can propagate it to our * children */ g_signal_connect (obj, "abort", G_CALLBACK (_mcd_operation_abort), NULL); } /* Public */ McdOperation * mcd_operation_new (void) { McdOperation *obj; obj = MCD_OPERATION (g_object_new (MCD_TYPE_OPERATION, NULL)); return obj; } const GList * mcd_operation_get_missions (McdOperation * operation) { McdOperationPrivate *priv; g_return_val_if_fail (MCD_IS_OPERATION (operation), NULL); priv = MCD_OPERATION_PRIV (operation); return priv->missions; } void mcd_operation_foreach (McdOperation * operation, GFunc func, gpointer user_data) { McdOperationPrivate *priv; g_return_if_fail (MCD_IS_OPERATION (operation)); priv = MCD_OPERATION_PRIV (operation); g_list_foreach (priv->missions, (GFunc) func, user_data); } telepathy-mission-control-5.16.4/src/mcd-account-manager-priv.h0000644000175000017500000000400412735242352025543 0ustar00gkiagiagkiagia00000000000000/* vi: set et sw=4 ts=8 cino=t0,(0: */ /* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4; tab-width: 8 -*- */ /* * mcd-account-manager.h - the Telepathy Account D-Bus interface (service side) * * Copyright (C) 2008-2009 Collabora Ltd. * Copyright (C) 2008-2009 Nokia Corporation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef __MCD_ACCOUNT_MANAGER_PRIV_H__ #define __MCD_ACCOUNT_MANAGER_PRIV_H__ #include "mcd-account-manager.h" #include "mcd-dbusprop.h" /* auto-generated stubs */ #include "_gen/svc-Account_Manager_Interface_Hidden.h" G_BEGIN_DECLS G_GNUC_INTERNAL void _mcd_account_manager_setup (McdAccountManager *account_manager); G_GNUC_INTERNAL GHashTable *_mcd_account_manager_get_accounts (McdAccountManager *account_manager); typedef void (*McdGetAccountCb) (McdAccountManager *account_manager, McdAccount *account, const GError *error, gpointer user_data); G_GNUC_INTERNAL void _mcd_account_manager_create_account (McdAccountManager *account_manager, const gchar *manager, const gchar *protocol, const gchar *display_name, GHashTable *params, GHashTable *properties, McdGetAccountCb callback, gpointer user_data, GDestroyNotify destroy); G_END_DECLS #endif telepathy-mission-control-5.16.4/src/mcd-channel.c0000644000175000017500000011145512735242352023135 0ustar00gkiagiagkiagia00000000000000/* vi: set et sw=4 ts=8 cino=t0,(0: */ /* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4; tab-width: 8 -*- */ /* * This file is part of mission-control * * Copyright © 2007-2009 Nokia Corporation. * Copyright © 2009-2010 Collabora Ltd. * * Contact: Naba Kumar * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * version 2.1 as published by the Free Software Foundation. * * This library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA * */ /** * SECTION:mcd-channel * @title: McdChannel * @short_description: Channel class representing Telepathy channel class * @see_also: * @stability: Unstable * @include: mcd-channel.h * * FIXME */ #include "config.h" #include "mcd-channel.h" #include #include #include "channel-utils.h" #include "mcd-account-priv.h" #include "mcd-channel-priv.h" #include "mcd-enum-types.h" #include "request.h" #include "_gen/interfaces.h" #define MCD_CHANNEL_PRIV(channel) (MCD_CHANNEL (channel)->priv) G_DEFINE_TYPE (McdChannel, mcd_channel, MCD_TYPE_MISSION) typedef struct _McdChannelRequestData McdChannelRequestData; struct _McdChannelPrivate { TpChannel *tp_chan; GError *error; /* boolean properties */ guint outgoing : 1; guint is_disposed : 1; guint is_aborted : 1; guint constructing : 1; guint is_proxy : 1; McdChannelStatus status; McdRequest *request; /* List of reffed McdRequest */ GList *satisfied_requests; gint64 latest_request_time; }; enum _McdChannelSignalType { STATUS_CHANGED, LAST_SIGNAL }; enum _McdChannelPropertyType { PROP_TP_CHANNEL = 1, PROP_OUTGOING, PROP_ACCOUNT_PATH, PROP_REQUESTS, PROP_USER_ACTION_TIME, PROP_PREFERRED_HANDLER, PROP_INTERFACES, PROP_HINTS, }; static guint mcd_channel_signals[LAST_SIGNAL] = { 0 }; static void _mcd_channel_release_tp_channel (McdChannel *channel); static void on_proxied_channel_status_changed (McdChannel *source, McdChannelStatus status, McdChannel *dest); static void proxy_destroyed (TpProxy *self, guint domain, gint code, gchar *message, gpointer user_data) { McdChannel *channel = user_data; DEBUG ("Channel proxy invalidated: %s %d: %s", g_quark_to_string (domain), code, message); mcd_mission_abort (MCD_MISSION (channel)); } static void on_channel_ready (GObject *source_object, GAsyncResult *result, gpointer user_data) { TpChannel *tp_chan = TP_CHANNEL (source_object); McdChannel *channel, **channel_ptr = user_data; GError *error = NULL; if (!tp_proxy_prepare_finish (tp_chan, result, &error)) { DEBUG ("failed to prepare channel: %s", error->message); g_clear_error (&error); return; } channel = *channel_ptr; if (channel) g_object_remove_weak_pointer ((GObject *)channel, (gpointer)channel_ptr); g_slice_free (McdChannel *, channel_ptr); if (error) { DEBUG ("got error: %s", error->message); return; } if (!channel) return; DEBUG ("channel %p is ready", channel); channel->priv->outgoing = tp_channel_get_requested (tp_chan); } void _mcd_channel_close (McdChannel *channel) { McdChannelPrivate *priv = MCD_CHANNEL_PRIV (channel); if (!_mcd_tp_channel_should_close (priv->tp_chan, "closing")) { return; } DEBUG ("%p: calling Close() on %s", channel, mcd_channel_get_object_path (channel)); tp_cli_channel_call_close (priv->tp_chan, -1, NULL, NULL, NULL, NULL); } void _mcd_channel_undispatchable (McdChannel *channel) { McdChannelPrivate *priv = MCD_CHANNEL_PRIV (channel); if (!_mcd_tp_channel_should_close (priv->tp_chan, "destroying")) { return; } DEBUG ("%p: %s", channel, mcd_channel_get_object_path (channel)); /* Call Destroy() if possible, or Close() */ if (tp_proxy_has_interface_by_id (priv->tp_chan, TP_IFACE_QUARK_CHANNEL_INTERFACE_DESTROYABLE)) { DEBUG ("calling Destroy()"); tp_cli_channel_interface_destroyable_call_destroy (priv->tp_chan, -1, NULL, NULL, NULL, NULL); } else { DEBUG ("calling Close()"); tp_cli_channel_call_close (priv->tp_chan, -1, NULL, NULL, NULL, NULL); } } static void _mcd_channel_release_tp_channel (McdChannel *channel) { McdChannelPrivate *priv = MCD_CHANNEL_PRIV (channel); if (priv->tp_chan) { g_signal_handlers_disconnect_by_func (G_OBJECT (priv->tp_chan), G_CALLBACK (proxy_destroyed), channel); /* Destroy our proxy */ tp_clear_object (&priv->tp_chan); } } static void _mcd_channel_setup (McdChannel *channel, McdChannelPrivate *priv) { McdChannel **channel_ptr; channel_ptr = g_slice_alloc (sizeof (McdChannel *)); *channel_ptr = channel; g_object_add_weak_pointer ((GObject *)channel, (gpointer)channel_ptr); tp_proxy_prepare_async (priv->tp_chan, NULL, on_channel_ready, channel_ptr); g_signal_connect (priv->tp_chan, "invalidated", G_CALLBACK (proxy_destroyed), channel); priv->outgoing = tp_channel_get_requested (priv->tp_chan); } static void _mcd_channel_set_property (GObject * obj, guint prop_id, const GValue * val, GParamSpec * pspec) { TpChannel *tp_chan; McdChannel *channel = MCD_CHANNEL (obj); McdChannelPrivate *priv = MCD_CHANNEL_PRIV (obj); switch (prop_id) { case PROP_TP_CHANNEL: tp_chan = g_value_get_object (val); if (tp_chan) g_object_ref (tp_chan); _mcd_channel_release_tp_channel (channel); priv->tp_chan = tp_chan; if (priv->tp_chan && !priv->constructing) _mcd_channel_setup (channel, priv); break; case PROP_OUTGOING: priv->outgoing = g_value_get_boolean (val); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (obj, prop_id, pspec); break; } } static void _mcd_channel_get_property (GObject * obj, guint prop_id, GValue * val, GParamSpec * pspec) { McdChannelPrivate *priv = MCD_CHANNEL_PRIV (obj); switch (prop_id) { case PROP_TP_CHANNEL: g_value_set_object (val, priv->tp_chan); break; case PROP_OUTGOING: g_value_set_boolean (val, priv->outgoing); break; case PROP_ACCOUNT_PATH: if (priv->request != NULL) { g_object_get_property ((GObject *) priv->request, "account-path", val); break; } g_value_set_static_boxed (val, "/"); break; case PROP_USER_ACTION_TIME: if (priv->request != NULL) { g_object_get_property ((GObject *) priv->request, "user-action-time", val); break; } g_value_set_int64 (val, TP_USER_ACTION_TIME_NOT_USER_ACTION); break; case PROP_PREFERRED_HANDLER: if (priv->request != NULL) { g_object_get_property ((GObject *) priv->request, "preferred-handler", val); break; } g_value_set_static_string (val, ""); break; case PROP_REQUESTS: if (priv->request != NULL) { g_object_get_property ((GObject *) priv->request, "requests", val); break; } g_value_take_boxed (val, g_ptr_array_sized_new (0)); break; case PROP_INTERFACES: if (priv->request != NULL) { g_object_get_property ((GObject *) priv->request, "interfaces", val); break; } g_value_take_boxed (val, NULL); break; case PROP_HINTS: if (priv->request != NULL) { g_object_get_property ((GObject *) priv->request, "hints", val); break; } g_value_take_boxed (val, g_hash_table_new (NULL, NULL)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (obj, prop_id, pspec); break; } } static void _mcd_channel_constructed (GObject * object) { McdChannelPrivate *priv = MCD_CHANNEL_PRIV (object); if (G_OBJECT_CLASS (mcd_channel_parent_class)->constructed) G_OBJECT_CLASS (mcd_channel_parent_class)->constructed (object); priv->constructing = FALSE; if (priv->tp_chan) _mcd_channel_setup (MCD_CHANNEL (object), priv); } static void _mcd_channel_dispose (GObject * object) { McdChannelPrivate *priv = MCD_CHANNEL_PRIV (object); DEBUG ("%p (is disposed = %d)", object, priv->is_disposed); if (priv->is_disposed) return; priv->is_disposed = TRUE; tp_clear_object (&priv->request); _mcd_channel_release_tp_channel (MCD_CHANNEL (object)); G_OBJECT_CLASS (mcd_channel_parent_class)->dispose (object); } static void _mcd_channel_finalize (GObject * object) { McdChannelPrivate *priv = MCD_CHANNEL_PRIV (object); GList *list; list = priv->satisfied_requests; while (list) { g_object_unref (list->data); list = g_list_delete_link (list, list); } if (priv->error != NULL) { g_error_free (priv->error); priv->error = NULL; } G_OBJECT_CLASS (mcd_channel_parent_class)->finalize (object); } static void mcd_channel_abort (McdMission *mission) { McdChannel *channel = MCD_CHANNEL (mission); McdChannelPrivate *priv = channel->priv; DEBUG ("%p", mission); if (priv->is_aborted) { DEBUG ("Already aborted"); return; } priv->is_aborted = TRUE; /* If this is still a channel request, signal the failure */ if (priv->status == MCD_CHANNEL_STATUS_REQUEST || priv->status == MCD_CHANNEL_STATUS_REQUESTED || priv->status == MCD_CHANNEL_STATUS_DISPATCHING || priv->status == MCD_CHANNEL_STATUS_HANDLER_INVOKED) { /* this code-path can only happen if the connection is aborted, as in * the other cases we handle the error in McdChannel; for this reason, * we use the DISCONNECTED error code */ GError *error = g_error_new (TP_ERROR, TP_ERROR_DISCONNECTED, "Channel aborted"); mcd_channel_take_error (channel, error); } _mcd_channel_set_status (channel, MCD_CHANNEL_STATUS_ABORTED); /* chain up with the parent */ MCD_MISSION_CLASS (mcd_channel_parent_class)->abort (mission); } static void mcd_channel_status_changed (McdChannel *channel, McdChannelStatus status) { channel->priv->status = status; switch (status) { case MCD_CHANNEL_STATUS_UNDISPATCHED: case MCD_CHANNEL_STATUS_DISPATCHING: case MCD_CHANNEL_STATUS_HANDLER_INVOKED: case MCD_CHANNEL_STATUS_DISPATCHED: g_assert (channel->priv->tp_chan != NULL); break; case MCD_CHANNEL_STATUS_REQUEST: case MCD_CHANNEL_STATUS_REQUESTED: g_assert (channel->priv->tp_chan == NULL); break; case MCD_CHANNEL_STATUS_FAILED: case MCD_CHANNEL_STATUS_ABORTED: { /* no particular assertion */ } /* no default case, so the compiler will warn on unhandled states */ } if (channel->priv->request != NULL && !_mcd_request_is_complete (channel->priv->request)) { if (status == MCD_CHANNEL_STATUS_FAILED) { const GError *error = mcd_channel_get_error (channel); if (G_LIKELY (error != NULL)) { _mcd_request_set_failure (channel->priv->request, error->domain, error->code, error->message); } else { g_critical ("Requested channel's status changed to FAILED " "without a proper error"); _mcd_request_set_failure (channel->priv->request, TP_ERROR, TP_ERROR_NOT_AVAILABLE, "MC bug! FAILED but no error"); } } else if (status == MCD_CHANNEL_STATUS_DISPATCHED) { _mcd_request_set_success (channel->priv->request, channel->priv->tp_chan); } else if (status == MCD_CHANNEL_STATUS_HANDLER_INVOKED) { _mcd_request_set_uncancellable (channel->priv->request); } } } static void mcd_channel_class_init (McdChannelClass * klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); McdMissionClass *mission_class = MCD_MISSION_CLASS (klass); g_type_class_add_private (object_class, sizeof (McdChannelPrivate)); object_class->constructed = _mcd_channel_constructed; object_class->dispose = _mcd_channel_dispose; object_class->finalize = _mcd_channel_finalize; object_class->set_property = _mcd_channel_set_property; object_class->get_property = _mcd_channel_get_property; mission_class->abort = mcd_channel_abort; klass->status_changed_signal = mcd_channel_status_changed; /* signals */ mcd_channel_signals[STATUS_CHANGED] = g_signal_new ("status-changed", G_OBJECT_CLASS_TYPE (klass), G_SIGNAL_RUN_FIRST, G_STRUCT_OFFSET (McdChannelClass, status_changed_signal), NULL, NULL, g_cclosure_marshal_VOID__INT, G_TYPE_NONE, 1, G_TYPE_INT); /* properties */ g_object_class_install_property (object_class, PROP_TP_CHANNEL, g_param_spec_object ("tp-channel", "Telepathy Channel", "Telepathy Channel", TP_TYPE_CHANNEL, G_PARAM_READWRITE | G_PARAM_CONSTRUCT)); g_object_class_install_property (object_class, PROP_OUTGOING, g_param_spec_boolean ("outgoing", "Outgoing channel", "True if the channel was requested by us", FALSE, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); g_object_class_install_property (object_class, PROP_ACCOUNT_PATH, g_param_spec_boxed ("account-path", "Account", "Object path of the Account", DBUS_TYPE_G_OBJECT_PATH, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (object_class, PROP_PREFERRED_HANDLER, g_param_spec_string ("preferred-handler", "PreferredHandler", "Well-known bus name of the preferred Handler", NULL, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (object_class, PROP_USER_ACTION_TIME, g_param_spec_int64 ("user-action-time", "UserActionTime", "Time of user action", G_MININT64, G_MAXINT64, TP_USER_ACTION_TIME_NOT_USER_ACTION, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (object_class, PROP_REQUESTS, g_param_spec_boxed ("requests", "Requests", "A dbus-glib aa{sv}", TP_ARRAY_TYPE_QUALIFIED_PROPERTY_VALUE_MAP_LIST, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (object_class, PROP_INTERFACES, g_param_spec_boxed ("interfaces", "Interfaces", "A dbus-glib 'as'", G_TYPE_STRV, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (object_class, PROP_HINTS, g_param_spec_boxed ("hints", "Hints", "GHashTable", TP_HASH_TYPE_STRING_VARIANT_MAP, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); } static void mcd_channel_init (McdChannel * obj) { McdChannelPrivate *priv; priv = G_TYPE_INSTANCE_GET_PRIVATE (obj, MCD_TYPE_CHANNEL, McdChannelPrivate); obj->priv = priv; priv->status = MCD_CHANNEL_STATUS_UNDISPATCHED; priv->constructing = TRUE; } /** * mcd_channel_new_from_properties: * @connection: the #TpConnection on which the channel exists. * @object_path: the D-Bus object path of an existing channel. * @properties: #GHashTable of immutable channel properties. * * Creates a #McdChannel with an associated #TpChannel proxy for the channel * located at @object_path. * * Returns: a new #McdChannel if the #TpChannel was created successfully, %NULL * otherwise. */ McdChannel * mcd_channel_new_from_properties (TpConnection *connection, const gchar *object_path, const GHashTable *properties) { McdChannel *channel; TpChannel *tp_chan; GError *error = NULL; tp_chan = tp_simple_client_factory_ensure_channel ( tp_proxy_get_factory (connection), connection, object_path, properties, &error); if (G_UNLIKELY (error)) { g_warning ("%s: got error: %s", G_STRFUNC, error->message); g_error_free (error); return NULL; } channel = g_object_new (MCD_TYPE_CHANNEL, "tp-channel", tp_chan, NULL); g_object_unref (tp_chan); return channel; } /** * mcd_channel_new_from_path: * @connection: the #TpConnection on which the channel exists. * @object_path: the D-Bus object path of an existing channel. * @type: the channel type. * @handle: the channel handle. * @handle_type: the #TpHandleType. * * Creates a #McdChannel with an associated #TpChannel proxy for the channel * located at @object_path. * * Returns: a new #McdChannel if the #TpChannel was created successfully, %NULL * otherwise. */ McdChannel * mcd_channel_new_from_path (TpConnection *connection, const gchar *object_path, const gchar *type, guint handle, TpHandleType handle_type) { GHashTable *props; GValue v_type = G_VALUE_INIT; GValue v_handle = G_VALUE_INIT; GValue v_handle_type = G_VALUE_INIT; McdChannel *channel; props = g_hash_table_new (g_str_hash, g_str_equal); g_value_init (&v_type, G_TYPE_STRING); g_value_set_static_string (&v_type, type); g_hash_table_insert (props, TP_IFACE_CHANNEL ".ChannelType", &v_type); g_value_init (&v_handle, G_TYPE_UINT); g_value_set_uint (&v_handle, handle); g_hash_table_insert (props, TP_IFACE_CHANNEL ".TargetHandle", &v_handle); g_value_init (&v_handle_type, G_TYPE_UINT); g_value_set_uint (&v_handle_type, handle_type); g_hash_table_insert (props, TP_IFACE_CHANNEL ".TargetHandleType", &v_handle_type); channel = mcd_channel_new_from_properties (connection, object_path, props); g_hash_table_unref (props); return channel; } /** * mcd_channel_create_proxy: * @channel: the #McdChannel. * @connection: the #TpConnection on which the channel exists. * @object_path: the D-Bus object path of an existing channel. * @properties: #GHashTable of immutable channel properties, or %NULL. * * This method makes @channel create a #TpChannel object for @object_path. * It must not be called if @channel has already a #TpChannel associated with * it. * * Returns: %TRUE if the #TpChannel has been created, %FALSE otherwise. */ gboolean _mcd_channel_create_proxy (McdChannel *channel, TpConnection *connection, const gchar *object_path, const GHashTable *properties) { TpChannel *tp_chan; GError *error = NULL; g_return_val_if_fail (MCD_IS_CHANNEL (channel), FALSE); tp_chan = tp_simple_client_factory_ensure_channel ( tp_proxy_get_factory (connection), connection, object_path, properties, &error); if (G_UNLIKELY (error)) { g_warning ("%s: got error: %s", G_STRFUNC, error->message); g_error_free (error); return FALSE; } g_object_set (channel, "tp-channel", tp_chan, NULL); g_object_unref (tp_chan); return TRUE; } void _mcd_channel_set_status (McdChannel *channel, McdChannelStatus status) { DEBUG ("%p, %u", channel, status); g_return_if_fail(MCD_IS_CHANNEL(channel)); if (status != channel->priv->status) { if (status != MCD_CHANNEL_STATUS_ABORTED) g_return_if_fail (channel->priv->status != MCD_CHANNEL_STATUS_FAILED); g_object_ref (channel); g_signal_emit_by_name (channel, "status-changed", status); g_object_unref (channel); } } McdChannelStatus mcd_channel_get_status (McdChannel *channel) { return MCD_CHANNEL_PRIV (channel)->status; } const gchar * mcd_channel_get_object_path (McdChannel *channel) { McdChannelPrivate *priv = MCD_CHANNEL_PRIV (channel); return priv->tp_chan ? tp_proxy_get_object_path (priv->tp_chan) : NULL; } /* * mcd_channel_dup_immutable_properties: * @channel: the #McdChannel. * * Returns: the %G_VARIANT_TYPE_VARDICT of the immutable properties. */ GVariant * mcd_channel_dup_immutable_properties (McdChannel *channel) { GVariant *ret; g_return_val_if_fail (MCD_IS_CHANNEL (channel), NULL); if (channel->priv->tp_chan == NULL) { DEBUG ("Channel %p has no associated TpChannel", channel); return NULL; } ret = tp_channel_dup_immutable_properties (channel->priv->tp_chan); if (ret == NULL) { DEBUG ("Channel %p TpChannel %s (%p) has no immutable properties yet", channel, tp_proxy_get_object_path (channel->priv->tp_chan), channel->priv->tp_chan); return NULL; } return ret; } /** * mcd_channel_take_error: * @channel: the #McdChannel. * @error: a #GError. * * Sets @error on channel, and takes ownership of it (the error will eventually * be freed with g_error_free()). As a side effect, if @error is not %NULL this * method causes the channel status be set to %MCD_CHANNEL_STATUS_FAILED. */ void mcd_channel_take_error (McdChannel *channel, GError *error) { g_return_if_fail (MCD_IS_CHANNEL (channel)); if (channel->priv->error != NULL) g_error_free (channel->priv->error); channel->priv->error = error; if (error) _mcd_channel_set_status (channel, MCD_CHANNEL_STATUS_FAILED); } /** * mcd_channel_get_error: * @channel: the #McdChannel. * * Returns: the #GError, or %NULL if no error is set. */ const GError * mcd_channel_get_error (McdChannel *channel) { McdChannelPrivate *priv; g_return_val_if_fail (MCD_IS_CHANNEL (channel), NULL); priv = channel->priv; if (priv->error) return priv->error; if (priv->tp_chan) return tp_proxy_get_invalidated (priv->tp_chan); return NULL; } static void _mcd_channel_request_cancelling_cb (McdRequest *request, McdChannel *self) { McdChannelStatus status = mcd_channel_get_status (self); g_object_ref (self); DEBUG ("%p in status %u", self, status); mcd_channel_take_error (self, g_error_new (TP_ERROR, TP_ERROR_CANCELLED, "Cancelled")); /* If we're coming from state REQUEST, the call to the CM hasn't * happened yet; now that we're in state FAILED, it never will, * because mcd_connection_request_channel() now checks that. * * If we're coming from state REQUESTED, we need to close the channel * when the CM tells us where it is, so we can't now. * * If we're coming from state DISPATCHING, we need to shoot it down * now. * * Anything else is too late. */ if (status == MCD_CHANNEL_STATUS_DISPATCHING) { _mcd_channel_close (self); mcd_mission_abort ((McdMission *) self); } g_object_unref (self); } /* * _mcd_channel_new_request: * @clients: the client registry * @account: an account. * @properties: a #GHashTable of desired channel properties. * @user_time: user action time. * @preferred_handler: well-known name of preferred handler. * @hints: client hints from the request, or %NULL * @use_existing: use EnsureChannel if %TRUE or CreateChannel if %FALSE * * Create a #McdChannel object holding the given properties. The object can * then be used to intiate a channel request, by passing it to * mcd_connection_request_channel() on a connection in connected state. * * Returns: a newly created #McdChannel. */ McdChannel * _mcd_channel_new_request (McdRequest *request) { McdChannel *channel; channel = g_object_new (MCD_TYPE_CHANNEL, "outgoing", TRUE, NULL); /* TODO: this could be freed when the channel status becomes * MCD_CHANNEL_STATUS_DISPATCHED or MCD_CHANNEL_STATUS_FAILED? */ channel->priv->request = request; channel->priv->satisfied_requests = g_list_prepend (NULL, g_object_ref (channel->priv->request)); channel->priv->latest_request_time = _mcd_request_get_user_action_time (request); _mcd_channel_set_status (channel, MCD_CHANNEL_STATUS_REQUEST); /* for the moment McdChannel implements the later stages of cancelling */ tp_g_signal_connect_object (request, "cancelling", G_CALLBACK (_mcd_channel_request_cancelling_cb), channel, 0); return channel; } McdRequest * _mcd_channel_get_request (McdChannel *self) { g_return_val_if_fail (MCD_IS_CHANNEL (self), NULL); return self->priv->request; /* may be NULL */ } /* * _mcd_channel_get_requested_properties: * @channel: the #McdChannel. * * Returns: #GHashTable of requested properties. */ GHashTable * _mcd_channel_get_requested_properties (McdChannel *channel) { g_return_val_if_fail (MCD_IS_CHANNEL (channel), NULL); if (channel->priv->request == NULL) return NULL; return _mcd_request_get_properties (channel->priv->request); } /* * _mcd_channel_get_satisfied_requests: * @channel: the #McdChannel. * @get_latest_time: if not %NULL, the most recent request time will be copied * through this pointer * * Returns: a newly allocated hash table mapping channel object paths * to McdRequest objects satisfied by this channel */ GHashTable * _mcd_channel_get_satisfied_requests (McdChannel *channel, gint64 *get_latest_time) { GList *l; GHashTable *result; const gchar *path; g_return_val_if_fail (MCD_IS_CHANNEL (channel), NULL); if (get_latest_time != NULL) *get_latest_time = channel->priv->latest_request_time; result = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_object_unref); for (l = channel->priv->satisfied_requests; l != NULL; l = g_list_next (l)) { path = _mcd_request_get_object_path (l->data); g_assert (path != NULL); g_hash_table_insert (result, g_strdup (path), g_object_ref (l->data)); } return result; } /* * _mcd_channel_get_request_preferred_handler: * @channel: the #McdChannel. * * Returns: the preferred handler specified when requesting the channel, if the * channel is in MCD_CHANNEL_REQUEST status. */ const gchar * _mcd_channel_get_request_preferred_handler (McdChannel *channel) { g_return_val_if_fail (MCD_IS_CHANNEL (channel), NULL); if (G_UNLIKELY (channel->priv->request == NULL)) return NULL; return _mcd_request_get_preferred_handler (channel->priv->request); } /* * _mcd_channel_get_request_use_existing: * @channel: the #McdChannel. * * Returns: %TRUE if the channel musb be requested via EnsureChannel, %FALSE * otherwise. */ gboolean _mcd_channel_get_request_use_existing (McdChannel *channel) { g_return_val_if_fail (MCD_IS_CHANNEL (channel), FALSE); if (G_UNLIKELY (channel->priv->request == NULL)) return FALSE; return _mcd_request_get_use_existing (channel->priv->request); } /** * mcd_channel_is_requested: * @channel: the #McdChannel. * * Returns: %TRUE if @channel was requested, %FALSE otherwise. */ gboolean mcd_channel_is_requested (McdChannel *channel) { g_return_val_if_fail (MCD_IS_CHANNEL (channel), FALSE); return channel->priv->outgoing; } /** * mcd_channel_get_account: * @channel: the #McdChannel. * * Returns: the #McdAccount on which this channel was created. */ McdAccount * mcd_channel_get_account (McdChannel *channel) { McdMission *connection; g_return_val_if_fail (MCD_IS_CHANNEL (channel), NULL); connection = mcd_mission_get_parent (MCD_MISSION (channel)); if (G_LIKELY (connection)) return mcd_connection_get_account (MCD_CONNECTION (connection)); else return NULL; } static void copy_status (McdChannel *source, McdChannel *dest) { McdChannelPrivate *src_priv, *dst_priv; src_priv = source->priv; dst_priv = dest->priv; if (dst_priv->status != src_priv->status) { DEBUG ("source is %d, dest is %d", src_priv->status, dst_priv->status); if (src_priv->status == MCD_CHANNEL_STATUS_FAILED) { const GError *error; error = mcd_channel_get_error (source); /* this also takes care of setting the status */ mcd_channel_take_error (dest, g_error_copy (error)); } else _mcd_channel_set_status (dest, src_priv->status); } if (dst_priv->status == MCD_CHANNEL_STATUS_FAILED || dst_priv->status == MCD_CHANNEL_STATUS_DISPATCHED) { /* the request is completed, we are not interested in monitor the * channel anymore */ g_signal_handlers_disconnect_by_func (source, on_proxied_channel_status_changed, dest); mcd_mission_abort (MCD_MISSION (dest)); } } static void on_proxied_channel_status_changed (McdChannel *source, McdChannelStatus status, McdChannel *dest) { copy_status (source, dest); } /* * _mcd_channel_set_request_proxy: * @channel: a #McdChannel representing a channel request * @source: the primary #McdChannel that wraps a remote Channel, which * may or may not also be a channel request * * This function turns @channel into a proxy for @source: it listens to * "status-changed" signals from @source and replicates them on @channel. * See _mcd_channel_is_primary_for_path for terminology and rationale. */ void _mcd_channel_set_request_proxy (McdChannel *channel, McdChannel *source) { g_return_if_fail (MCD_IS_CHANNEL (channel)); g_return_if_fail (MCD_IS_CHANNEL (source)); g_return_if_fail (MCD_IS_REQUEST (channel->priv->request)); g_return_if_fail (!source->priv->is_proxy); g_return_if_fail (source->priv->tp_chan != NULL); _mcd_channel_copy_details (channel, source); /* Now @source is also satisfying the request of @channel */ source->priv->latest_request_time = MAX (source->priv->latest_request_time, channel->priv->latest_request_time); source->priv->satisfied_requests = g_list_prepend ( source->priv->satisfied_requests, g_object_ref (channel->priv->request)); copy_status (source, channel); g_signal_connect (source, "status-changed", G_CALLBACK (on_proxied_channel_status_changed), channel); } /* * _mcd_channel_copy_details: * @channel: the #McdChannel. * @source: the #McdChannel from which details are to be copied. * * Copy the #TpProxy and all associated properties from channel @source into * @channel. */ void _mcd_channel_copy_details (McdChannel *channel, McdChannel *source) { g_return_if_fail (MCD_IS_CHANNEL (channel)); g_return_if_fail (MCD_IS_CHANNEL (source)); channel->priv->is_proxy = TRUE; channel->priv->tp_chan = g_object_ref (source->priv->tp_chan); } TpChannel * mcd_channel_get_tp_channel (McdChannel *channel) { g_return_val_if_fail (MCD_IS_CHANNEL (channel), NULL); return channel->priv->tp_chan; } static void mcd_channel_depart_cb (GObject *source_object, GAsyncResult *result, gpointer data G_GNUC_UNUSED) { GError *error = NULL; /* By this point, TpChannel has already called Close() for us; * we only get an error if that failed. If Close() fails, there's * not a whole lot we can do about it. */ if (!tp_channel_leave_finish (TP_CHANNEL (source_object), result, &error)) { WARNING ("failed to depart, even via Close(): %s %d: %s", g_quark_to_string (error->domain), error->code, error->message); g_error_free (error); } } typedef struct { TpChannelGroupChangeReason reason; gchar *message; } DepartData; static void mcd_channel_ready_to_depart_cb (GObject *source_object, GAsyncResult *result, gpointer data) { TpChannel *channel = TP_CHANNEL (source_object); DepartData *d = data; GError *error = NULL; if (!tp_proxy_prepare_finish (channel, result, &error)) { DEBUG ("%s %d: %s", g_quark_to_string (error->domain), error->code, error->message); g_free (d->message); g_slice_free (DepartData, d); g_clear_error (&error); return; } /* If it's a Group, this will leave gracefully. * If not, it will just close it. Either's good. */ tp_channel_leave_async (channel, d->reason, d->message, mcd_channel_depart_cb, NULL); } void _mcd_channel_depart (McdChannel *channel, TpChannelGroupChangeReason reason, const gchar *message) { DepartData *d; const GError *invalidated; GQuark just_group_feature[] = { TP_CHANNEL_FEATURE_GROUP, 0 }; g_return_if_fail (MCD_IS_CHANNEL (channel)); g_return_if_fail (channel->priv->tp_chan != NULL); g_return_if_fail (message != NULL); invalidated = tp_proxy_get_invalidated (channel->priv->tp_chan); if (invalidated != NULL) { DEBUG ("%s %d: %s", g_quark_to_string (invalidated->domain), invalidated->code, invalidated->message); return; } if (message[0] == '\0' && reason == TP_CHANNEL_GROUP_CHANGE_REASON_NONE) { /* exactly equivalent to Close(), so skip the Group interface */ tp_channel_close_async (channel->priv->tp_chan, NULL, NULL); return; } d = g_slice_new (DepartData); d->reason = reason; d->message = g_strdup (message); /* tp_channel_leave_async documents calling it without first preparing * GROUP as deprecated. */ tp_proxy_prepare_async (channel->priv->tp_chan, just_group_feature, mcd_channel_ready_to_depart_cb, d); } /* * _mcd_channel_is_primary_for_path: * @self: an McdChannel * @channel_path: the object path of a TpChannel * * McdChannel leads a double life. A McdChannel can either be created to * represent a channel request (implementing ChannelRequest), or to wrap a * TpChannel (a remote Channel). * * When a new TpChannel satisfies a single channel request, the McdChannel * representing that channel request becomes the object that wraps that * TpChannel. * * When the same TpChannel satisfies more than one channel request, one of * the McdChannel instances representing the requests is chosen to wrap * that TpChannel in the same way. Let that instance be the "primary" * McdChannel. The remaining McdChannel instances become "proxies" for that * primary McdChannel. * * Only the primary McdChannel is suitable for passing to the McdDispatcher, * since it is the only one that tracks the complete list of requests being * satisfied by the TpChannel. * * Returns: %TRUE if @self is the primary McdChannel for @channel_path */ gboolean _mcd_channel_is_primary_for_path (McdChannel *self, const gchar *channel_path) { if (self->priv->tp_chan == NULL) return FALSE; if (self->priv->is_proxy) return FALSE; if (tp_strdiff (tp_proxy_get_object_path (self->priv->tp_chan), channel_path)) return FALSE; return TRUE; } telepathy-mission-control-5.16.4/src/mcd-master.h0000644000175000017500000000411712735241312023014 0ustar00gkiagiagkiagia00000000000000/* vi: set et sw=4 ts=8 cino=t0,(0: */ /* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4; tab-width: 8 -*- */ /* * This file is part of mission-control * * Copyright (C) 2007 Nokia Corporation. * * Contact: Naba Kumar * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * version 2.1 as published by the Free Software Foundation. * * This library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA * */ #ifndef MCD_MASTER_H #define MCD_MASTER_H #include #include G_BEGIN_DECLS #define MCD_TYPE_MASTER (mcd_master_get_type ()) #define MCD_MASTER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), MCD_TYPE_MASTER, McdMaster)) #define MCD_MASTER_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), MCD_TYPE_MASTER, McdMasterClass)) #define MCD_IS_MASTER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), MCD_TYPE_MASTER)) #define MCD_IS_MASTER_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), MCD_TYPE_MASTER)) #define MCD_MASTER_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), MCD_TYPE_MASTER, McdMasterClass)) typedef struct _McdMaster McdMaster; typedef struct _McdMasterClass McdMasterClass; typedef struct _McdMasterPrivate McdMasterPrivate; #include #include struct _McdMaster { McdOperation parent; McdMasterPrivate *priv; }; struct _McdMasterClass { McdOperationClass parent_class; }; GType mcd_master_get_type (void); McdMaster *mcd_master_get_default (void); TpDBusDaemon *mcd_master_get_dbus_daemon (McdMaster *master); void mcd_master_shutdown (McdMaster *self, const gchar *reason); G_END_DECLS #endif /* MCD_MASTER_H */ telepathy-mission-control-5.16.4/src/connectivity-monitor.h0000644000175000017500000000537512735241312025172 0ustar00gkiagiagkiagia00000000000000/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */ /* * Copyright © 2009–2011 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * * Authors: * Jonny Lamb * Will Thompson */ #ifndef MCD_CONNECTIVITY_MONITOR_H #define MCD_CONNECTIVITY_MONITOR_H #include G_BEGIN_DECLS #define MCD_TYPE_CONNECTIVITY_MONITOR (mcd_connectivity_monitor_get_type ()) #define MCD_CONNECTIVITY_MONITOR(o) \ (G_TYPE_CHECK_INSTANCE_CAST ((o), MCD_TYPE_CONNECTIVITY_MONITOR, \ McdConnectivityMonitor)) #define MCD_CONNECTIVITY_MONITOR_CLASS(k) \ (G_TYPE_CHECK_CLASS_CAST ((k), MCD_TYPE_CONNECTIVITY_MONITOR, \ McdConnectivityMonitorClass)) #define MCD_IS_CONNECTIVITY_MONITOR(o) \ (G_TYPE_CHECK_INSTANCE_TYPE ((o), MCD_TYPE_CONNECTIVITY_MONITOR)) #define MCD_IS_CONNECTIVITY_MONITOR_CLASS(k) \ (G_TYPE_CHECK_CLASS_TYPE ((k), MCD_TYPE_CONNECTIVITY_MONITOR)) #define MCD_CONNECTIVITY_MONITOR_GET_CLASS(o) \ (G_TYPE_INSTANCE_GET_CLASS ((o), MCD_TYPE_CONNECTIVITY_MONITOR, \ McdConnectivityMonitorClass)) typedef struct _McdConnectivityMonitor McdConnectivityMonitor; typedef struct _McdConnectivityMonitorClass McdConnectivityMonitorClass; typedef struct _McdConnectivityMonitorPrivate McdConnectivityMonitorPrivate; struct _McdConnectivityMonitor { GObject parent; McdConnectivityMonitorPrivate *priv; }; struct _McdConnectivityMonitorClass { GObjectClass parent_class; }; GType mcd_connectivity_monitor_get_type (void); /* public methods */ McdConnectivityMonitor *mcd_connectivity_monitor_new (void); gboolean mcd_connectivity_monitor_is_online (McdConnectivityMonitor *connectivity); gboolean mcd_connectivity_monitor_get_use_conn (McdConnectivityMonitor *connectivity); void mcd_connectivity_monitor_set_use_conn (McdConnectivityMonitor *connectivity, gboolean use_conn); typedef struct _McdInhibit McdInhibit; McdInhibit *mcd_inhibit_hold (McdInhibit *inhibit); void mcd_inhibit_release (McdInhibit *inhibit); G_END_DECLS #endif /* MCD_CONNECTIVITY_MONITOR_H */ telepathy-mission-control-5.16.4/src/mcd-storage.c0000644000175000017500000016474612735242352023204 0ustar00gkiagiagkiagia00000000000000/* Representation of the account manager as presented to plugins. This is * deliberately a "smaller" API than McdAccountManager. * * Copyright © 2010 Nokia Corporation * Copyright © 2010-2012 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA * */ #include "config.h" #include "mcd-storage.h" #include "mcd-account.h" #include "mcd-account-config.h" #include "mcd-debug.h" #include "mcd-misc.h" #include "plugin-loader.h" #include #include #include #include #include "mission-control-plugins/implementation.h" /* these pseudo-plugins take care of the actual account storage/retrieval */ #include "mcd-account-manager-default.h" #if ENABLE_LIBACCOUNTS_SSO #include "mcd-account-manager-sso.h" # ifdef ACCOUNTS_GLIB_HIDDEN_SERVICE_TYPE # include "mcd-storage-ag-hidden.h" # endif #endif #define MAX_KEY_LENGTH (DBUS_MAXIMUM_NAME_LENGTH + 6) static GList *stores = NULL; static void sort_and_cache_plugins (void); enum { PROP_DBUS_DAEMON = 1, }; struct _McdStorageClass { GObjectClass parent; }; static void plugin_iface_init (McpAccountManagerIface *iface, gpointer unused G_GNUC_UNUSED); G_DEFINE_TYPE_WITH_CODE (McdStorage, mcd_storage, G_TYPE_OBJECT, G_IMPLEMENT_INTERFACE (MCP_TYPE_ACCOUNT_MANAGER, plugin_iface_init)) typedef struct { /* owned string => GVariant * e.g. { 'DisplayName': <'Frederick Bloggs'> } */ GHashTable *attributes; /* owned string => owned GVariant * e.g. { 'account': <'fred@example.com'>, 'password': <'foo'> } */ GHashTable *parameters; /* owned string => owned string escaped as if for a keyfile * e.g. { 'account': 'fred@example.com', 'password': 'foo' } * keys of @parameters and @escaped_parameters are disjoint */ GHashTable *escaped_parameters; /* set of owned strings * e.g. { 'password': 'password' } */ GHashTable *secrets; } McdStorageAccount; static void mcd_storage_account_free (gpointer p) { McdStorageAccount *sa = p; g_hash_table_unref (sa->attributes); g_hash_table_unref (sa->parameters); g_hash_table_unref (sa->escaped_parameters); g_hash_table_unref (sa->secrets); g_slice_free (McdStorageAccount, sa); } static void mcd_storage_init (McdStorage *self) { self->accounts = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, mcd_storage_account_free); } static void storage_finalize (GObject *object) { McdStorage *self = MCD_STORAGE (object); GObjectFinalizeFunc finalize = G_OBJECT_CLASS (mcd_storage_parent_class)->finalize; g_hash_table_unref (self->accounts); self->accounts = NULL; if (finalize != NULL) finalize (object); } static void storage_dispose (GObject *object) { McdStorage *self = MCD_STORAGE (object); GObjectFinalizeFunc dispose = G_OBJECT_CLASS (mcd_storage_parent_class)->dispose; tp_clear_object (&self->dbusd); if (dispose != NULL) dispose (object); } static void storage_set_property (GObject *obj, guint prop_id, const GValue *val, GParamSpec *pspec) { McdStorage *self = MCD_STORAGE (obj); switch (prop_id) { case PROP_DBUS_DAEMON: tp_clear_object (&self->dbusd); self->dbusd = TP_DBUS_DAEMON (g_value_dup_object (val)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (obj, prop_id, pspec); break; } } static void storage_get_property (GObject *obj, guint prop_id, GValue *val, GParamSpec *pspec) { McdStorage *self = MCD_STORAGE (obj); switch (prop_id) { case PROP_DBUS_DAEMON: g_value_set_object (val, self->dbusd); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (obj, prop_id, pspec); break; } } static void mcd_storage_class_init (McdStorageClass *cls) { GObjectClass *object_class = (GObjectClass *) cls; GParamSpec *spec = g_param_spec_object ("dbus-daemon", "DBus daemon", "DBus daemon", TP_TYPE_DBUS_DAEMON, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); object_class->set_property = storage_set_property; object_class->get_property = storage_get_property; object_class->dispose = storage_dispose; object_class->finalize = storage_finalize; g_object_class_install_property (object_class, PROP_DBUS_DAEMON, spec); } McdStorage * mcd_storage_new (TpDBusDaemon *dbus_daemon) { return g_object_new (MCD_TYPE_STORAGE, "dbus-daemon", dbus_daemon, NULL); } static gchar * mcd_keyfile_escape_variant (GVariant *variant) { GValue value = G_VALUE_INIT; gchar *ret; dbus_g_value_parse_g_variant (variant, &value); if (G_IS_VALUE (&value)) { ret = mcd_keyfile_escape_value (&value); g_value_unset (&value); } else { gchar *printed = g_variant_print (variant, TRUE); ret = NULL; g_warning ("Unable to translate variant %s", printed); g_free (printed); } return ret; } static McdStorageAccount * lookup_account (McdStorage *self, const gchar *account) { return g_hash_table_lookup (self->accounts, account); } static McdStorageAccount * ensure_account (McdStorage *self, const gchar *account) { McdStorageAccount *sa = lookup_account (self, account); if (sa == NULL) { sa = g_slice_new (McdStorageAccount); sa->attributes = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, (GDestroyNotify) g_variant_unref); sa->parameters = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, (GDestroyNotify) g_variant_unref); sa->escaped_parameters = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free); sa->secrets = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL); g_hash_table_insert (self->accounts, g_strdup (account), sa); } return sa; } static gchar * get_value (const McpAccountManager *ma, const gchar *account, const gchar *key) { McdStorage *self = MCD_STORAGE (ma); McdStorageAccount *sa = lookup_account (self, account); GVariant *variant; gchar *ret; if (sa == NULL) return NULL; if (g_str_has_prefix (key, "param-")) { variant = g_hash_table_lookup (sa->parameters, key + 6); if (variant != NULL) { ret = mcd_keyfile_escape_variant (variant); g_variant_unref (variant); return ret; } else { /* OK, we don't have it as a variant. How about the keyfile-escaped * version? */ return g_strdup (g_hash_table_lookup (sa->escaped_parameters, key + 6)); } } else { variant = g_hash_table_lookup (sa->attributes, key); if (variant != NULL) { ret = mcd_keyfile_escape_variant (variant); g_variant_unref (variant); return ret; } else { return NULL; } } } static struct { const gchar *type; const gchar *name; } known_attributes[] = { /* Please keep this sorted by type, then by name. */ /* Structs */ { "(uss)", MC_ACCOUNTS_KEY_AUTOMATIC_PRESENCE }, /* Array of object path */ { "ao", MC_ACCOUNTS_KEY_SUPERSEDES }, /* Array of string */ { "as", MC_ACCOUNTS_KEY_URI_SCHEMES }, /* Booleans */ { "b", MC_ACCOUNTS_KEY_ALWAYS_DISPATCH }, { "b", MC_ACCOUNTS_KEY_CONNECT_AUTOMATICALLY }, { "b", MC_ACCOUNTS_KEY_ENABLED }, { "b", MC_ACCOUNTS_KEY_HAS_BEEN_ONLINE }, { "b", MC_ACCOUNTS_KEY_HIDDEN }, /* Strings */ { "s", MC_ACCOUNTS_KEY_AUTO_PRESENCE_MESSAGE }, { "s", MC_ACCOUNTS_KEY_AUTO_PRESENCE_STATUS }, { "s", MC_ACCOUNTS_KEY_AVATAR_MIME }, { "s", MC_ACCOUNTS_KEY_AVATAR_TOKEN }, { "s", MC_ACCOUNTS_KEY_DISPLAY_NAME }, { "s", MC_ACCOUNTS_KEY_ICON }, { "s", MC_ACCOUNTS_KEY_MANAGER }, { "s", MC_ACCOUNTS_KEY_NICKNAME }, { "s", MC_ACCOUNTS_KEY_NORMALIZED_NAME }, { "s", MC_ACCOUNTS_KEY_PROTOCOL }, { "s", MC_ACCOUNTS_KEY_SERVICE }, /* Integers */ { "u", MC_ACCOUNTS_KEY_AUTO_PRESENCE_TYPE }, { NULL, NULL } }; const gchar * mcd_storage_get_attribute_type (const gchar *attribute) { guint i; for (i = 0; known_attributes[i].type != NULL; i++) { if (!tp_strdiff (attribute, known_attributes[i].name)) return known_attributes[i].type; } /* special case for mcd-account-conditions.c */ if (g_str_has_prefix (attribute, "condition-")) return "s"; return NULL; } gboolean mcd_storage_init_value_for_attribute (GValue *value, const gchar *attribute) { const gchar *s = mcd_storage_get_attribute_type (attribute); if (s == NULL) return FALSE; switch (s[0]) { case 's': g_value_init (value, G_TYPE_STRING); return TRUE; case 'b': g_value_init (value, G_TYPE_BOOLEAN); return TRUE; case 'u': /* this seems wrong but it's how we've always done it */ g_value_init (value, G_TYPE_INT); return TRUE; case 'a': { switch (s[1]) { case 'o': g_value_init (value, TP_ARRAY_TYPE_OBJECT_PATH_LIST); return TRUE; case 's': g_value_init (value, G_TYPE_STRV); return TRUE; } } break; case '(': { if (!tp_strdiff (s, "(uss)")) { g_value_init (value, TP_STRUCT_TYPE_SIMPLE_PRESENCE); return TRUE; } } break; } return FALSE; } static gboolean mcpa_init_value_for_attribute (const McpAccountManager *mcpa, GValue *value, const gchar *attribute) { return mcd_storage_init_value_for_attribute (value, attribute); } static void mcpa_set_attribute (const McpAccountManager *ma, const gchar *account, const gchar *attribute, GVariant *value, McpAttributeFlags flags) { McdStorage *self = MCD_STORAGE (ma); McdStorageAccount *sa = ensure_account (self, account); if (value != NULL) { g_hash_table_insert (sa->attributes, g_strdup (attribute), g_variant_ref_sink (value)); } else { g_hash_table_remove (sa->attributes, attribute); } } static void mcpa_set_parameter (const McpAccountManager *ma, const gchar *account, const gchar *parameter, GVariant *value, McpParameterFlags flags) { McdStorage *self = MCD_STORAGE (ma); McdStorageAccount *sa = ensure_account (self, account); g_hash_table_remove (sa->parameters, parameter); g_hash_table_remove (sa->escaped_parameters, parameter); if (value != NULL) g_hash_table_insert (sa->parameters, g_strdup (parameter), g_variant_ref_sink (value)); if (flags & MCP_PARAMETER_FLAG_SECRET) { DEBUG ("flagging %s parameter %s as secret", account, parameter); g_hash_table_add (sa->secrets, g_strdup (parameter)); } } static void set_value (const McpAccountManager *ma, const gchar *account, const gchar *key, const gchar *value) { McdStorage *self = MCD_STORAGE (ma); McdStorageAccount *sa = ensure_account (self, account); if (g_str_has_prefix (key, "param-")) { g_hash_table_remove (sa->parameters, key + 6); g_hash_table_remove (sa->escaped_parameters, key + 6); if (value != NULL) g_hash_table_insert (sa->escaped_parameters, g_strdup (key + 6), g_strdup (value)); } else { if (value != NULL) { GValue tmp = G_VALUE_INIT; GError *error = NULL; if (!mcd_storage_init_value_for_attribute (&tmp, key)) { g_warning ("Not sure what the type of '%s' is, assuming string", key); g_value_init (&tmp, G_TYPE_STRING); } if (mcd_keyfile_unescape_value (value, &tmp, &error)) { g_hash_table_insert (sa->attributes, g_strdup (key), g_variant_ref_sink (dbus_g_value_build_g_variant (&tmp))); g_value_unset (&tmp); } else { g_warning ("Could not decode attribute '%s':'%s' from plugin: %s", key, value, error->message); g_error_free (error); g_hash_table_remove (sa->attributes, key); } } else { g_hash_table_remove (sa->attributes, key); } } } static GStrv list_keys (const McpAccountManager *ma, const gchar * account) { McdStorage *self = MCD_STORAGE (ma); GPtrArray *ret = g_ptr_array_new (); McdStorageAccount *sa = lookup_account (self, account); if (sa != NULL) { GHashTableIter iter; gpointer k; g_hash_table_iter_init (&iter, sa->attributes); while (g_hash_table_iter_next (&iter, &k, NULL)) g_ptr_array_add (ret, g_strdup (k)); g_hash_table_iter_init (&iter, sa->parameters); while (g_hash_table_iter_next (&iter, &k, NULL)) g_ptr_array_add (ret, g_strdup_printf ("param-%s", (gchar *) k)); } g_ptr_array_add (ret, NULL); return (GStrv) g_ptr_array_free (ret, FALSE); } static gboolean is_secret (const McpAccountManager *ma, const gchar *account, const gchar *key) { McdStorage *self = MCD_STORAGE (ma); McdStorageAccount *sa = lookup_account (self, account); if (sa == NULL || !g_str_has_prefix (key, "param-")) return FALSE; return g_hash_table_contains (sa->secrets, key + 6); } static void mcd_storage_make_secret (McdStorage *self, const gchar *account, const gchar *key) { McdStorageAccount *sa; g_return_if_fail (MCD_IS_STORAGE (self)); g_return_if_fail (account != NULL); g_return_if_fail (key != NULL); if (!g_str_has_prefix (key, "param-")) return; DEBUG ("flagging %s parameter %s as secret", account, key + 6); sa = ensure_account (self, account); g_hash_table_add (sa->secrets, g_strdup (key + 6)); } static void make_secret (const McpAccountManager *ma, const gchar *account, const gchar *key) { mcd_storage_make_secret (MCD_STORAGE (ma), account, key); } static gchar * unique_name (const McpAccountManager *ma, const gchar *manager, const gchar *protocol, const GHashTable *params) { McdStorage *self = MCD_STORAGE (ma); const gchar *base = NULL; gchar *esc_manager, *esc_protocol, *esc_base; guint i; gsize base_len = strlen (TP_ACCOUNT_OBJECT_PATH_BASE); DBusGConnection *connection = tp_proxy_get_dbus_connection (self->dbusd); base = tp_asv_get_string (params, "account"); if (base == NULL) base = "account"; esc_manager = tp_escape_as_identifier (manager); esc_protocol = g_strdelimit (g_strdup (protocol), "-", '_'); esc_base = tp_escape_as_identifier (base); for (i = 0; i < G_MAXUINT; i++) { gchar *path = g_strdup_printf ( TP_ACCOUNT_OBJECT_PATH_BASE "%s/%s/%s%u", esc_manager, esc_protocol, esc_base, i); if (!g_hash_table_contains (self->accounts, path + base_len) && dbus_g_connection_lookup_g_object (connection, path) == NULL) { gchar *ret = g_strdup (path + base_len); g_free (path); return ret; } g_free (path); } return NULL; } /* sort in descending order of priority (ie higher prio => earlier in list) */ static gint account_storage_cmp (gconstpointer a, gconstpointer b) { gint pa = mcp_account_storage_priority (a); gint pb = mcp_account_storage_priority (b); if (pa > pb) return -1; if (pa < pb) return 1; return 0; } static void add_storage_plugin (McpAccountStorage *plugin) { stores = g_list_insert_sorted (stores, plugin, account_storage_cmp); } static void add_libaccounts_plugins_if_enabled (void) { #if ENABLE_LIBACCOUNTS_SSO add_storage_plugin (MCP_ACCOUNT_STORAGE (mcd_account_manager_sso_new ())); # ifdef ACCOUNTS_GLIB_HIDDEN_SERVICE_TYPE add_storage_plugin (MCP_ACCOUNT_STORAGE (mcd_storage_ag_hidden_new ())); # endif #endif } static void sort_and_cache_plugins () { const GList *p; static gboolean plugins_cached = FALSE; if (plugins_cached) return; /* not guaranteed to have been called, but idempotent: */ _mcd_plugin_loader_init (); /* Add compiled-in plugins */ add_storage_plugin (MCP_ACCOUNT_STORAGE (mcd_account_manager_default_new ())); add_libaccounts_plugins_if_enabled (); for (p = mcp_list_objects(); p != NULL; p = g_list_next (p)) { if (MCP_IS_ACCOUNT_STORAGE (p->data)) { McpAccountStorage *plugin = g_object_ref (p->data); add_storage_plugin (plugin); } } for (p = stores; p != NULL; p = g_list_next (p)) { McpAccountStorage *plugin = p->data; DEBUG ("found plugin %s [%s; priority %d]\n%s", mcp_account_storage_name (plugin), g_type_name (G_TYPE_FROM_INSTANCE (plugin)), mcp_account_storage_priority (plugin), mcp_account_storage_description (plugin)); } plugins_cached = TRUE; } void mcd_storage_connect_signal (const gchar *signame, GCallback func, gpointer user_data) { GList *p; for (p = stores; p != NULL; p = g_list_next (p)) { McpAccountStorage *plugin = p->data; DEBUG ("connecting handler to %s plugin signal %s ", mcp_account_storage_name (plugin), signame); g_signal_connect (plugin, signame, func, user_data); } } /* * mcd_storage_load: * @storage: An object implementing the #McdStorage interface * * Load the long term account settings storage into our internal cache. * Should only really be called during startup, ie before our DBus names * have been claimed and other people might be relying on responses from us. */ void mcd_storage_load (McdStorage *self) { McpAccountManager *ma = MCP_ACCOUNT_MANAGER (self); GList *store = NULL; g_return_if_fail (MCD_IS_STORAGE (self)); sort_and_cache_plugins (); store = g_list_last (stores); /* fetch accounts stored in plugins, in reverse priority so higher prio * * plugins can overwrite lower prio ones' account data */ while (store != NULL) { GList *account; McpAccountStorage *plugin = store->data; GList *stored = mcp_account_storage_list (plugin, ma); const gchar *pname = mcp_account_storage_name (plugin); const gint prio = mcp_account_storage_priority (plugin); DEBUG ("listing from plugin %s [prio: %d]", pname, prio); for (account = stored; account != NULL; account = g_list_next (account)) { gchar *name = account->data; DEBUG ("fetching %s from plugin %s [prio: %d]", name, pname, prio); mcd_storage_add_account_from_plugin (self, plugin, name); g_free (name); } /* already freed the contents, just need to free the list itself */ g_list_free (stored); store = g_list_previous (store); } } /* * mcd_storage_dup_accounts: * @storage: An object implementing the #McdStorage interface * @n: place for the number of accounts to be written to (or %NULL) * * Returns: a newly allocated GStrv containing the unique account names, * which must be freed by the caller with g_strfreev(). */ GStrv mcd_storage_dup_accounts (McdStorage *self, gsize *n) { GPtrArray *ret = g_ptr_array_new (); GHashTableIter iter; gpointer k, v; g_hash_table_iter_init (&iter, self->accounts); while (g_hash_table_iter_next (&iter, &k, &v)) { McdStorageAccount *sa = v; if (g_hash_table_size (sa->attributes) > 0) g_ptr_array_add (ret, g_strdup (k)); } g_ptr_array_add (ret, NULL); return (GStrv) g_ptr_array_free (ret, FALSE); } /* * mcd_storage_dup_attributes: * @storage: An object implementing the #McdStorage interface * @account: unique name of the account * @n: place for the number of attributes to be written to (or %NULL) * * Returns: a newly allocated GStrv containing the names of all the * attributes or parameters currently stored for @account. Must be * freed by the caller with g_strfreev(). */ GStrv mcd_storage_dup_attributes (McdStorage *self, const gchar *account, gsize *n) { GPtrArray *ret = g_ptr_array_new (); McdStorageAccount *sa = lookup_account (self, account); if (sa != NULL) { GHashTableIter iter; gpointer k; g_hash_table_iter_init (&iter, sa->attributes); while (g_hash_table_iter_next (&iter, &k, NULL)) g_ptr_array_add (ret, g_strdup (k)); } g_ptr_array_add (ret, NULL); return (GStrv) g_ptr_array_free (ret, FALSE); } /* * mcd_storage_get_plugin: * @storage: An object implementing the #McdStorage interface * @account: unique name of the account * * Returns: the #McpAccountStorage object which is handling the account, * if any (if a new account has not yet been flushed to storage this can * be %NULL). * * Plugins are kept in permanent storage and can never be unloaded, so * the returned pointer need not be reffed or unreffed. (Indeed, it's * probably safer not to) */ McpAccountStorage * mcd_storage_get_plugin (McdStorage *self, const gchar *account) { GList *store = stores; McpAccountManager *ma = MCP_ACCOUNT_MANAGER (self); McpAccountStorage *owner = NULL; g_return_val_if_fail (MCD_IS_STORAGE (self), NULL); g_return_val_if_fail (account != NULL, NULL); for (; store != NULL && owner == NULL; store = g_list_next (store)) { McpAccountStorage *plugin = store->data; if (mcp_account_storage_owns (plugin, ma, account)) owner = plugin; } return owner; } /* * mcd_storage_dup_string: * @storage: An object implementing the #McdStorage interface * @account: unique name of the account * @attribute: name of the attribute to be retrieved (which must not be a * parameter) * * Returns: a newly allocated gchar * which must be freed with g_free(). */ gchar * mcd_storage_dup_string (McdStorage *self, const gchar *account, const gchar *attribute) { GValue tmp = G_VALUE_INIT; gchar *ret; g_return_val_if_fail (MCD_IS_STORAGE (self), NULL); g_return_val_if_fail (account != NULL, NULL); g_return_val_if_fail (attribute != NULL, NULL); g_return_val_if_fail (!g_str_has_prefix (attribute, "param-"), NULL); g_value_init (&tmp, G_TYPE_STRING); if (!mcd_storage_get_attribute (self, account, attribute, &tmp, NULL)) return NULL; ret = g_value_dup_string (&tmp); g_value_unset (&tmp); return ret; } static gboolean mcd_storage_coerce_variant_to_value (GVariant *variant, GValue *value, GError **error) { GValue tmp = G_VALUE_INIT; gboolean ret; gchar *escaped; dbus_g_value_parse_g_variant (variant, &tmp); if (G_VALUE_TYPE (&tmp) == G_VALUE_TYPE (value)) { memcpy (value, &tmp, sizeof (tmp)); return TRUE; } /* This is really pretty stupid but it'll do for now. * FIXME: implement a better similar-type-coercion mechanism than * round-tripping through a GKeyFile. */ escaped = mcd_keyfile_escape_value (&tmp); ret = mcd_keyfile_unescape_value (escaped, value, error); g_free (escaped); g_value_unset (&tmp); return ret; } /* * mcd_storage_get_attribute: * @storage: An object implementing the #McdStorage interface * @account: unique name of the account * @attribute: name of the attribute to be retrieved, e.g. 'DisplayName' * @value: location to return the value, initialized to the right #GType * @error: a place to store any #GErrors that occur */ gboolean mcd_storage_get_attribute (McdStorage *self, const gchar *account, const gchar *attribute, GValue *value, GError **error) { McdStorageAccount *sa; GVariant *variant; g_return_val_if_fail (MCD_IS_STORAGE (self), FALSE); g_return_val_if_fail (account != NULL, FALSE); g_return_val_if_fail (attribute != NULL, FALSE); g_return_val_if_fail (!g_str_has_prefix (attribute, "param-"), FALSE); sa = lookup_account (self, account); if (sa == NULL) { g_set_error (error, TP_ERROR, TP_ERROR_NOT_AVAILABLE, "Account %s does not exist", account); return FALSE; } variant = g_hash_table_lookup (sa->attributes, attribute); if (variant == NULL) { g_set_error (error, TP_ERROR, TP_ERROR_NOT_AVAILABLE, "Setting '%s' not stored by account %s", attribute, account); return FALSE; } return mcd_storage_coerce_variant_to_value (variant, value, error); } /* * mcd_storage_get_parameter: * @storage: An object implementing the #McdStorage interface * @account: unique name of the account * @parameter: name of the parameter to be retrieved, e.g. 'account' * @value: location to return the value, initialized to the right #GType * @error: a place to store any #GErrors that occur */ gboolean mcd_storage_get_parameter (McdStorage *self, const gchar *account, const gchar *parameter, GValue *value, GError **error) { McdStorageAccount *sa; const gchar *escaped; GVariant *variant; g_return_val_if_fail (MCD_IS_STORAGE (self), FALSE); g_return_val_if_fail (account != NULL, FALSE); g_return_val_if_fail (parameter != NULL, FALSE); sa = lookup_account (self, account); if (sa == NULL) { g_set_error (error, TP_ERROR, TP_ERROR_NOT_AVAILABLE, "Account %s does not exist", account); return FALSE; } variant = g_hash_table_lookup (sa->parameters, parameter); if (variant != NULL) return mcd_storage_coerce_variant_to_value (variant, value, error); /* OK, we don't have it as a variant. How about the keyfile-escaped * version? */ escaped = g_hash_table_lookup (sa->escaped_parameters, parameter); if (escaped == NULL) { g_set_error (error, TP_ERROR, TP_ERROR_NOT_AVAILABLE, "Parameter '%s' not stored by account %s", parameter, account); return FALSE; } return mcd_keyfile_unescape_value (escaped, value, error); } static gboolean mcpa_unescape_value_from_keyfile (const McpAccountManager *unused G_GNUC_UNUSED, const gchar *escaped, GValue *value, GError **error) { return mcd_keyfile_unescape_value (escaped, value, error); } /* * @escaped: a keyfile-escaped string * @value: a #GValue initialized with a supported #GType * @error: used to raise an error if %FALSE is returned * * Try to interpret @escaped as a value of the type of @value. If we can, * write the resulting value into @value and return %TRUE. * * Returns: %TRUE if @escaped could be interpreted as a value of that type */ gboolean mcd_keyfile_unescape_value (const gchar *escaped, GValue *value, GError **error) { GKeyFile *keyfile; gboolean ret; g_return_val_if_fail (escaped != NULL, FALSE); g_return_val_if_fail (G_IS_VALUE (value), FALSE); keyfile = g_key_file_new (); g_key_file_set_value (keyfile, "g", "k", escaped); ret = mcd_keyfile_get_value (keyfile, "g", "k", value, error); g_key_file_free (keyfile); return ret; } /* * mcd_keyfile_get_value: * @keyfile: A #GKeyFile * @group: name of a group * @key: name of a key * @value: location to return the value, initialized to the right #GType * @error: a place to store any #GErrors that occur */ gboolean mcd_keyfile_get_value (GKeyFile *keyfile, const gchar *group, const gchar *key, GValue *value, GError **error) { gboolean ret = FALSE; GType type; g_return_val_if_fail (keyfile != NULL, FALSE); g_return_val_if_fail (group != NULL, FALSE); g_return_val_if_fail (key != NULL, FALSE); g_return_val_if_fail (G_IS_VALUE (value), FALSE); type = G_VALUE_TYPE (value); switch (type) { case G_TYPE_STRING: { gchar *v_string = g_key_file_get_string (keyfile, group, key, error); if (v_string != NULL) { g_value_take_string (value, v_string); ret = TRUE; } /* else error is already set */ } break; case G_TYPE_INT: { GError *e = NULL; gint v_int = g_key_file_get_integer (keyfile, group, key, &e); if (e != NULL) { g_propagate_error (error, e); } else { g_value_set_int (value, v_int); ret = TRUE; } } break; case G_TYPE_INT64: { GError *e = NULL; gint64 v_int = g_key_file_get_int64 (keyfile, group, key, &e); if (e != NULL) { g_propagate_error (error, e); } else { g_value_set_int64 (value, v_int); ret = TRUE; } } break; case G_TYPE_UINT: { GError *e = NULL; guint64 v_uint = g_key_file_get_uint64 (keyfile, group, key, &e); if (e != NULL) { g_propagate_error (error, e); } else if (v_uint > G_MAXUINT32) { g_set_error (error, MCD_ACCOUNT_ERROR, MCD_ACCOUNT_ERROR_GET_PARAMETER, "Parameter '%s' out of range for an unsigned 32-bit " "integer: %" G_GUINT64_FORMAT, key, v_uint); } else { g_value_set_uint (value, v_uint); ret = TRUE; } } break; case G_TYPE_UCHAR: { GError *e = NULL; gint v_int = g_key_file_get_integer (keyfile, group, key, &e); if (e != NULL) { g_propagate_error (error, e); } else if (v_int < 0 || v_int > 0xFF) { g_set_error (error, MCD_ACCOUNT_ERROR, MCD_ACCOUNT_ERROR_GET_PARAMETER, "Parameter '%s' out of range for an unsigned byte: " "%d", key, v_int); } else { g_value_set_uchar (value, v_int); ret = TRUE; } } break; case G_TYPE_UINT64: { GError *e = NULL; guint64 v_uint = g_key_file_get_uint64 (keyfile, group, key, &e); if (e != NULL) { g_propagate_error (error, e); } else { g_value_set_uint64 (value, v_uint); ret = TRUE; } } break; case G_TYPE_BOOLEAN: { GError *e = NULL; gboolean v_bool = g_key_file_get_boolean (keyfile, group, key, &e); if (e != NULL) { g_propagate_error (error, e); } else { g_value_set_boolean (value, v_bool); ret = TRUE; } } break; case G_TYPE_DOUBLE: { GError *e = NULL; gdouble v_double = g_key_file_get_double (keyfile, group, key, &e); if (e != NULL) { g_propagate_error (error, e); } else { g_value_set_double (value, v_double); ret = TRUE; } } break; default: if (type == G_TYPE_STRV) { gchar **v = g_key_file_get_string_list (keyfile, group, key, NULL, error); if (v != NULL) { g_value_take_boxed (value, v); ret = TRUE; } } else if (type == DBUS_TYPE_G_OBJECT_PATH) { gchar *v_string = g_key_file_get_string (keyfile, group, key, error); if (v_string == NULL) { /* do nothing, error is already set */ } else if (!tp_dbus_check_valid_object_path (v_string, NULL)) { g_set_error (error, MCD_ACCOUNT_ERROR, MCD_ACCOUNT_ERROR_GET_PARAMETER, "Invalid object path %s", v_string); g_free (v_string); } else { g_value_take_boxed (value, v_string); ret = TRUE; } } else if (type == TP_ARRAY_TYPE_OBJECT_PATH_LIST) { gchar **v = g_key_file_get_string_list (keyfile, group, key, NULL, error); if (v != NULL) { gchar **iter; GPtrArray *arr = g_ptr_array_new (); for (iter = v; iter != NULL && *iter != NULL; iter++) { if (!g_variant_is_object_path (*iter)) { g_set_error (error, MCD_ACCOUNT_ERROR, MCD_ACCOUNT_ERROR_GET_PARAMETER, "Invalid object path %s stored in keyfile", *iter); g_strfreev (v); v = NULL; break; } } for (iter = v; iter != NULL && *iter != NULL; iter++) { /* transfer ownership from v to arr */ g_ptr_array_add (arr, *iter); } /* not g_strfreev - the strings' ownership has been * transferred */ g_free (v); g_value_take_boxed (value, arr); ret = TRUE; } } else if (type == TP_STRUCT_TYPE_SIMPLE_PRESENCE) { gchar **v = g_key_file_get_string_list (keyfile, group, key, NULL, error); if (v == NULL) { /* error is already set, do nothing */ } else if (g_strv_length (v) != 3) { g_set_error (error, TP_ERROR, TP_ERROR_NOT_AVAILABLE, "Invalid simple-presence structure stored in keyfile"); } else { guint64 u; gchar *endptr; errno = 0; u = g_ascii_strtoull (v[0], &endptr, 10); if (errno != 0 || *endptr != '\0' || u > G_MAXUINT32) { g_set_error (error, TP_ERROR, TP_ERROR_NOT_AVAILABLE, "Invalid presence type stored in keyfile: %s", v[0]); } else { /* a syntactically valid simple presence */ g_value_take_boxed (value, tp_value_array_build (3, G_TYPE_UINT, (guint) u, G_TYPE_STRING, v[1], G_TYPE_STRING, v[2], G_TYPE_INVALID)); ret = TRUE; } } g_strfreev (v); } else { gchar *message = g_strdup_printf ("cannot get key %s from group %s: " "unknown type %s", key, group, g_type_name (type)); g_warning ("%s: %s", G_STRFUNC, message); g_set_error (error, MCD_ACCOUNT_ERROR, MCD_ACCOUNT_ERROR_GET_PARAMETER, "%s", message); g_free (message); } } return ret; } /* * mcd_storage_get_boolean: * @storage: An object implementing the #McdStorage interface * @account: unique name of the account * @key: name of the attribute to be retrieved * * Returns: a #gboolean. Unset/unparseable values are returned as %FALSE */ gboolean mcd_storage_get_boolean (McdStorage *self, const gchar *account, const gchar *attribute) { GValue tmp = G_VALUE_INIT; g_return_val_if_fail (MCD_IS_STORAGE (self), FALSE); g_return_val_if_fail (account != NULL, FALSE); g_return_val_if_fail (attribute != NULL, FALSE); g_return_val_if_fail (!g_str_has_prefix (attribute, "param-"), FALSE); g_value_init (&tmp, G_TYPE_BOOLEAN); if (!mcd_storage_get_attribute (self, account, attribute, &tmp, NULL)) return FALSE; return g_value_get_boolean (&tmp); } /* * mcd_storage_get_integer: * @storage: An object implementing the #McdStorage interface * @account: unique name of the account * @attribute: name of the attribute to be retrieved * * Returns: a #gint. Unset or non-numeric values are returned as 0 */ gint mcd_storage_get_integer (McdStorage *self, const gchar *account, const gchar *attribute) { GValue tmp = G_VALUE_INIT; g_return_val_if_fail (MCD_IS_STORAGE (self), 0); g_return_val_if_fail (account != NULL, 0); g_return_val_if_fail (attribute != NULL, 0); g_return_val_if_fail (!g_str_has_prefix (attribute, "param-"), 0); g_value_init (&tmp, G_TYPE_INT); if (!mcd_storage_get_attribute (self, account, attribute, &tmp, NULL)) return FALSE; return g_value_get_int (&tmp); } static void update_storage (McdStorage *self, const gchar *account, const gchar *key, GVariant *variant, const gchar *escaped, gboolean secret) { GList *store; gboolean done = FALSE; gboolean parameter = g_str_has_prefix (key, "param-"); McpAccountManager *ma = MCP_ACCOUNT_MANAGER (self); if (secret) mcd_storage_make_secret (self, account, key); /* we're deleting, which is unconditional, no need to check if anyone * * claims this setting for themselves */ if (escaped == NULL) done = TRUE; for (store = stores; store != NULL; store = g_list_next (store)) { McpAccountStorage *plugin = store->data; const gchar *pn = mcp_account_storage_name (plugin); if (done) { DEBUG ("MCP:%s -> delete %s.%s", pn, account, key); mcp_account_storage_delete (plugin, ma, account, key); } else if (variant != NULL && !parameter && mcp_account_storage_set_attribute (plugin, ma, account, key, variant, MCP_ATTRIBUTE_FLAG_NONE)) { done = TRUE; DEBUG ("MCP:%s -> store attribute %s.%s", pn, account, key); } else if (variant != NULL && parameter && mcp_account_storage_set_parameter (plugin, ma, account, key + 6, variant, secret ? MCP_PARAMETER_FLAG_SECRET : MCP_PARAMETER_FLAG_NONE)) { done = TRUE; DEBUG ("MCP:%s -> store parameter %s.%s", pn, account, key); } else { done = mcp_account_storage_set (plugin, ma, account, key, escaped); DEBUG ("MCP:%s -> %s %s.%s", pn, done ? "store" : "ignore", account, key); } } } /* * mcd_storage_set_string: * @storage: An object implementing the #McdStorage interface * @account: the unique name of an account * @key: the name of the attribute * @value: the value to be stored (or %NULL to erase it) * * Copies and stores the supplied @value (or removes it if %NULL) to the * internal cache. * * Returns: a #gboolean indicating whether the cache actually required an * update (so that the caller can decide whether to request a commit to * long term storage or not). %TRUE indicates the cache was updated and * may not be in sync with the store any longer, %FALSE indicates we already * held the value supplied. */ gboolean mcd_storage_set_string (McdStorage *self, const gchar *account, const gchar *attribute, const gchar *val) { gboolean updated; g_return_val_if_fail (MCD_IS_STORAGE (self), FALSE); g_return_val_if_fail (account != NULL, FALSE); g_return_val_if_fail (attribute != NULL, FALSE); g_return_val_if_fail (!g_str_has_prefix (attribute, "param-"), FALSE); if (val == NULL) { updated = mcd_storage_set_attribute (self, account, attribute, NULL); } else { GValue tmp = G_VALUE_INIT; g_value_init (&tmp, G_TYPE_STRING); g_value_set_string (&tmp, val); updated = mcd_storage_set_attribute (self, account, attribute, &tmp); g_value_unset (&tmp); } return updated; } /* * mcd_storage_set_attribute: * @storage: An object implementing the #McdStorage interface * @account: the unique name of an account * @attribute: the name of the attribute, e.g. "DisplayName" * @value: the value to be stored (or %NULL to erase it) * * Copies and stores the supplied @value (or removes it if %NULL) in the * internal cache. * * Returns: a #gboolean indicating whether the cache actually required an * update (so that the caller can decide whether to request a commit to * long term storage or not). %TRUE indicates the cache was updated and * may not be in sync with the store any longer, %FALSE indicates we already * held the value supplied. */ gboolean mcd_storage_set_attribute (McdStorage *self, const gchar *account, const gchar *attribute, const GValue *value) { McdStorageAccount *sa; GVariant *old_v; GVariant *new_v; gboolean updated = FALSE; g_return_val_if_fail (MCD_IS_STORAGE (self), FALSE); g_return_val_if_fail (account != NULL, FALSE); g_return_val_if_fail (attribute != NULL, FALSE); g_return_val_if_fail (!g_str_has_prefix (attribute, "param-"), FALSE); sa = ensure_account (self, account); if (value != NULL) new_v = g_variant_ref_sink (dbus_g_value_build_g_variant (value)); else new_v = NULL; old_v = g_hash_table_lookup (sa->attributes, attribute); if (!mcd_nullable_variant_equal (old_v, new_v)) { gchar *escaped = NULL; /* First put it in the attributes hash table. (Watch out, this might * invalidate old_v.) */ if (new_v == NULL) g_hash_table_remove (sa->attributes, attribute); else g_hash_table_insert (sa->attributes, g_strdup (attribute), g_variant_ref (new_v)); /* OK now we have to escape it in a stupid way for plugins */ if (value != NULL) escaped = mcd_keyfile_escape_value (value); update_storage (self, account, attribute, new_v, escaped, FALSE); g_free (escaped); updated = TRUE; } tp_clear_pointer (&new_v, g_variant_unref); return updated; } /* * mcd_storage_set_parameter: * @storage: An object implementing the #McdStorage interface * @account: the unique name of an account * @parameter: the name of the parameter, e.g. "account" * @value: the value to be stored (or %NULL to erase it) * @secret: whether the value is confidential (might get stored in the * keyring, for example) * * Copies and stores the supplied @value (or removes it if %NULL) in the * internal cache. * * Returns: a #gboolean indicating whether the cache actually required an * update (so that the caller can decide whether to request a commit to * long term storage or not). %TRUE indicates the cache was updated and * may not be in sync with the store any longer, %FALSE indicates we already * held the value supplied. */ gboolean mcd_storage_set_parameter (McdStorage *self, const gchar *account, const gchar *parameter, const GValue *value, gboolean secret) { GVariant *old_v; GVariant *new_v = NULL; const gchar *old_escaped; gchar *new_escaped = NULL; McdStorageAccount *sa; gboolean updated = FALSE; g_return_val_if_fail (MCD_IS_STORAGE (self), FALSE); g_return_val_if_fail (account != NULL, FALSE); g_return_val_if_fail (parameter != NULL, FALSE); sa = ensure_account (self, account); if (value != NULL) { new_escaped = mcd_keyfile_escape_value (value); new_v = g_variant_ref_sink (dbus_g_value_build_g_variant (value)); } old_v = g_hash_table_lookup (sa->parameters, parameter); old_escaped = g_hash_table_lookup (sa->escaped_parameters, parameter); if (old_v != NULL) updated = !mcd_nullable_variant_equal (old_v, new_v); else if (old_escaped != NULL) updated = tp_strdiff (old_escaped, new_escaped); else updated = (value != NULL); if (updated) { gchar key[MAX_KEY_LENGTH]; g_hash_table_remove (sa->parameters, parameter); g_hash_table_remove (sa->escaped_parameters, parameter); if (new_v != NULL) g_hash_table_insert (sa->parameters, g_strdup (parameter), g_variant_ref (new_v)); g_snprintf (key, sizeof (key), "param-%s", parameter); update_storage (self, account, key, new_v, new_escaped, secret); return TRUE; } g_free (new_escaped); tp_clear_pointer (&new_v, g_variant_unref); return updated; } static gchar * mcpa_escape_value_for_keyfile (const McpAccountManager *unused G_GNUC_UNUSED, const GValue *value) { return mcd_keyfile_escape_value (value); } /* * @value: a populated #GValue of a supported #GType * * Escape the contents of @value to go in a #GKeyFile. Return the * value that would go in the keyfile. * * For instance, for a boolean value TRUE this would return "true", * and for a string containing one space, it would return "\s". */ gchar * mcd_keyfile_escape_value (const GValue *value) { GKeyFile *keyfile; gchar *ret; g_return_val_if_fail (G_IS_VALUE (value), NULL); keyfile = g_key_file_new (); mcd_keyfile_set_value (keyfile, "g", "k", value); ret = g_key_file_get_value (keyfile, "g", "k", NULL); g_key_file_free (keyfile); return ret; } static gchar * mcpa_escape_variant_for_keyfile (const McpAccountManager *unused G_GNUC_UNUSED, GVariant *variant) { return mcd_keyfile_escape_variant (variant); } /* * mcd_keyfile_set_value: * @keyfile: a keyfile * @name: the name of a group * @key: the key in the group * @value: the value to be stored (or %NULL to erase it) * * Copies and stores the supplied @value (or removes it if %NULL) to the * internal cache. * * Returns: a #gboolean indicating whether the cache actually required an * update (so that the caller can decide whether to request a commit to * long term storage or not). %TRUE indicates the cache was updated and * may not be in sync with the store any longer, %FALSE indicates we already * held the value supplied. */ gboolean mcd_keyfile_set_value (GKeyFile *keyfile, const gchar *name, const gchar *key, const GValue *value) { g_return_val_if_fail (name != NULL, FALSE); g_return_val_if_fail (key != NULL, FALSE); if (value == NULL) { gchar *old = g_key_file_get_value (keyfile, name, key, NULL); gboolean updated = (old != NULL); g_free (old); g_key_file_remove_key (keyfile, name, key, NULL); return updated; } else { gboolean updated = FALSE; gchar *old = g_key_file_get_value (keyfile, name, key, NULL); gchar *new = NULL; gchar *buf = NULL; switch (G_VALUE_TYPE (value)) { case G_TYPE_STRING: g_key_file_set_string (keyfile, name, key, g_value_get_string (value)); break; case G_TYPE_UINT: buf = g_strdup_printf ("%u", g_value_get_uint (value)); break; case G_TYPE_INT: g_key_file_set_integer (keyfile, name, key, g_value_get_int (value)); break; case G_TYPE_BOOLEAN: g_key_file_set_boolean (keyfile, name, key, g_value_get_boolean (value)); break; case G_TYPE_UCHAR: buf = g_strdup_printf ("%u", g_value_get_uchar (value)); break; case G_TYPE_UINT64: buf = g_strdup_printf ("%" G_GUINT64_FORMAT, g_value_get_uint64 (value)); break; case G_TYPE_INT64: buf = g_strdup_printf ("%" G_GINT64_FORMAT, g_value_get_int64 (value)); break; case G_TYPE_DOUBLE: g_key_file_set_double (keyfile, name, key, g_value_get_double (value)); break; default: if (G_VALUE_HOLDS (value, G_TYPE_STRV)) { gchar **strings = g_value_get_boxed (value); g_key_file_set_string_list (keyfile, name, key, (const gchar **)strings, g_strv_length (strings)); } else if (G_VALUE_HOLDS (value, DBUS_TYPE_G_OBJECT_PATH)) { g_key_file_set_string (keyfile, name, key, g_value_get_boxed (value)); } else if (G_VALUE_HOLDS (value, TP_ARRAY_TYPE_OBJECT_PATH_LIST)) { GPtrArray *arr = g_value_get_boxed (value); g_key_file_set_string_list (keyfile, name, key, (const gchar * const *) arr->pdata, arr->len); } else if (G_VALUE_HOLDS (value, TP_STRUCT_TYPE_SIMPLE_PRESENCE)) { guint type; /* enough for "4294967296" + \0 */ gchar printf_buf[11]; const gchar * strv[4] = { NULL, NULL, NULL, NULL }; tp_value_array_unpack (g_value_get_boxed (value), 3, &type, &(strv[1]), &(strv[2])); g_snprintf (printf_buf, sizeof (printf_buf), "%u", type); strv[0] = printf_buf; g_key_file_set_string_list (keyfile, name, key, strv, 3); } else { g_warning ("Unexpected param type %s", G_VALUE_TYPE_NAME (value)); return FALSE; } } if (buf != NULL) g_key_file_set_string (keyfile, name, key, buf); new = g_key_file_get_value (keyfile, name, key, NULL); if (tp_strdiff (old, new)) updated = TRUE; g_free (new); g_free (buf); g_free (old); return updated; } } /* * mcd_storage_create_account: * @storage: An object implementing the #McdStorage interface * @provider: the desired storage provider, or %NULL * @manager: the name of the manager * @protocol: the name of the protocol * @params: A gchar * / GValue * hash table of account parameters * @error: a #GError to fill when returning %NULL * * Create a new account in storage. This should not store any * information on the long term storage until mcd_storage_commit() is called. * * See mcp_account_storage_create(). * * Returns: the unique name to use for the new account, or %NULL on error. */ gchar * mcd_storage_create_account (McdStorage *self, const gchar *provider, const gchar *manager, const gchar *protocol, GHashTable *params, GError **error) { GList *store; McpAccountManager *ma = MCP_ACCOUNT_MANAGER (self); g_return_val_if_fail (MCD_IS_STORAGE (self), NULL); g_return_val_if_fail (!tp_str_empty (manager), NULL); g_return_val_if_fail (!tp_str_empty (protocol), NULL); /* If a storage provider is specified, use only it or fail */ if (provider != NULL) { for (store = stores; store != NULL; store = g_list_next (store)) { McpAccountStorage *plugin = store->data; if (!tp_strdiff (mcp_account_storage_provider (plugin), provider)) { return mcp_account_storage_create (plugin, ma, manager, protocol, params, error); } } g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Storage provider '%s' does not exist", provider); return NULL; } /* No provider specified, let's pick the first plugin able to create this * account in priority order. * * FIXME: This is rather subtle, and relies on the fact that accounts * aren't always strongly tied to a single plugin. * * For plugins that only store their accounts set up specifically * through them (like the libaccounts/SSO pseudo-plugin, * McdAccountManagerSSO), create() will fail as unimplemented, * and we'll fall through to the next plugin. Eventually we'll * reach the default keyfile+gnome-keyring plugin, or another * plugin that accepts arbitrary accounts. When set() is called, * the libaccounts/SSO plugin will reject that too, and again, * we'll fall through to a plugin that accepts arbitrary * accounts. * * Plugins that will accept arbitrary accounts being created * via D-Bus (like the default keyfile+gnome-keyring plugin, * and the account-diversion plugin in tests/twisted) * should, in principle, implement create() to be successful. * If they do, their create() will succeed, and later, so will * their set(). * * We can't necessarily rely on all such plugins implementing * create(), because it isn't a mandatory part of the plugin * API (it was added later). However, as it happens, the * default plugin returns successfully from create() without * really doing anything. When we iterate through the accounts again * to call set(), higher-priority plugins are given a second * chance to intercept that; so we end up with create() in * the default plugin being followed by set() from the * higher-priority plugin. In theory that's bad because it * splits the account across two plugins, but in practice * it isn't a problem because the default plugin's create() * doesn't really do anything anyway. */ for (store = stores; store != NULL; store = g_list_next (store)) { McpAccountStorage *plugin = store->data; gchar *ret; ret = mcp_account_storage_create (plugin, ma, manager, protocol, params, error); if (ret != NULL) return ret; g_clear_error (error); } /* This should never happen since the default storage is always able to create * an account */ g_warn_if_reached (); g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "None of the storage provider are able to create the account"); return NULL; } /* * mcd_storage_delete_account: * @storage: An object implementing the #McdStorage interface * @account: unique name of the account * * Removes an account's settings from long term storage. * This does not handle any of the other logic to do with removing * accounts, it merely ensures that no trace of the account remains * in long term storage once mcd_storage_commit() has been called. */ void mcd_storage_delete_account (McdStorage *self, const gchar *account) { GList *store; McpAccountManager *ma = MCP_ACCOUNT_MANAGER (self); g_return_if_fail (MCD_IS_STORAGE (self)); g_return_if_fail (account != NULL); g_hash_table_remove (self->accounts, account); for (store = stores; store != NULL; store = g_list_next (store)) { McpAccountStorage *plugin = store->data; mcp_account_storage_delete (plugin, ma, account, NULL); } } /* * mcd_storage_commit: * @storage: An object implementing the #McdStorage interface * @account: the unique name of an account * * Sync the long term storage (whatever it might be) with the current * state of our internal cache. */ void mcd_storage_commit (McdStorage *self, const gchar *account) { GList *store; McpAccountManager *ma = MCP_ACCOUNT_MANAGER (self); g_return_if_fail (MCD_IS_STORAGE (self)); for (store = stores; store != NULL; store = g_list_next (store)) { McpAccountStorage *plugin = store->data; const gchar *pname = mcp_account_storage_name (plugin); if (account != NULL) { DEBUG ("flushing plugin %s %s to long term storage", pname, account); mcp_account_storage_commit_one (plugin, ma, account); } else { DEBUG ("flushing plugin %s to long term storage", pname); mcp_account_storage_commit (plugin, ma); } } } /* * mcd_storage_set_strv: * @storage: An object implementing the #McdStorage interface * @account: the unique name of an account * @attribute: the name of the attribute * @strv: the string vector to be stored (where %NULL is treated as equivalent * to an empty vector) * * Copies and stores the supplied string vector to the internal cache. * * Returns: a #gboolean indicating whether the cache actually required an * update (so that the caller can decide whether to request a commit to * long term storage or not). %TRUE indicates the cache was updated and * may not be in sync with the store any longer, %FALSE indicates we already * held the value supplied. */ gboolean mcd_storage_set_strv (McdStorage *storage, const gchar *account, const gchar *attribute, const gchar * const *strv) { GValue v = G_VALUE_INIT; static const gchar * const *empty = { NULL }; gboolean ret; g_return_val_if_fail (MCD_IS_STORAGE (storage), FALSE); g_return_val_if_fail (account != NULL, FALSE); g_return_val_if_fail (attribute != NULL, FALSE); g_return_val_if_fail (!g_str_has_prefix (attribute, "param-"), FALSE); g_value_init (&v, G_TYPE_STRV); g_value_set_static_boxed (&v, strv == NULL ? empty : strv); ret = mcd_storage_set_attribute (storage, account, attribute, &v); g_value_unset (&v); return ret; } void mcd_storage_ready (McdStorage *self) { GList *store; McpAccountManager *ma = MCP_ACCOUNT_MANAGER (self); for (store = stores; store != NULL; store = g_list_next (store)) { McpAccountStorage *plugin = store->data; const gchar *plugin_name = mcp_account_storage_name (plugin); DEBUG ("Unblocking async account ops by %s", plugin_name); mcp_account_storage_ready (plugin, ma); } } static void plugin_iface_init (McpAccountManagerIface *iface, gpointer unused G_GNUC_UNUSED) { DEBUG (); iface->get_value = get_value; iface->set_value = set_value; iface->set_attribute = mcpa_set_attribute; iface->set_parameter = mcpa_set_parameter; iface->is_secret = is_secret; iface->make_secret = make_secret; iface->unique_name = unique_name; iface->list_keys = list_keys; iface->escape_value_for_keyfile = mcpa_escape_value_for_keyfile; iface->escape_variant_for_keyfile = mcpa_escape_variant_for_keyfile; iface->unescape_value_from_keyfile = mcpa_unescape_value_from_keyfile; iface->init_value_for_attribute = mcpa_init_value_for_attribute; } gboolean mcd_storage_add_account_from_plugin (McdStorage *self, McpAccountStorage *plugin, const gchar *account) { if (!mcp_account_storage_get (plugin, MCP_ACCOUNT_MANAGER (self), account, NULL)) { g_warning ("plugin %s disowned account %s", mcp_account_storage_name (plugin), account); return FALSE; } return TRUE; } telepathy-mission-control-5.16.4/src/sp_timestamp.h0000644000175000017500000000670612735241312023473 0ustar00gkiagiagkiagia00000000000000/* * Macro / inline function to add/mark "timestamps" to program in a * way that can be found from LTT traces. This helps in pinpointing * when something interesting starts or ends in the trace. Strace can * be used to get timings for these measurement points. * * Copyright (C) 2008 by Nokia Corporation * * Contact: Eero Tamminen * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * version 2.1 as published by the Free Software Foundation. * * This library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * usage: * #include "sp_timestamp.h" * ... * sp_timestamp("something-interesting-started"); * * To enable timestamping when building the code in Scratchbox, * do this before build: * export SBOX_EXTRA_COMPILER_ARGS="-DSP_TIMESTAMP_CREATE=1" * * You can see the timestamps when running the software with: * strace -f -tt -e trace=open,execve ./binary 2>&1 | grep /tmp/stamps * * If the programs are already running, give the program IDs which * strace should attach to with the "-p PID" argument instead of * a program name. * * * Implementation differences to Federico's Gnome app stracing tool: * http://www.gnome.org/~federico/news-2006-03.html#timeline-tools * - Lower level C-library functions are used instead of Glib * - Gets process name from /proc/PID/cmdline instead of Gtk * specific functions (macro version uses just __FILE__) * - Uses open() syscall instead of access() because LTT doesn't * record filename used by access() and because programs do * use open() less (ptrace has its own overhead) * - Files are in /tmp which on Maemo is tmpfs (in RAM) */ #ifndef SP_TIMESTAMP_H #define SP_TIMESTAMP_H #include #include #include #ifndef SP_TIMESTAMP_CREATE # define sp_timestamp(step) #else # ifdef SP_TIMESTAMP_MACRO /* low overhead macro adding code filename to measurement filename */ # define sp_timestamp(step) { int _tmp_fd; \ _tmp_fd = open("/tmp/stamps/" __FILE__ ":" step, O_CREAT|O_WRONLY, S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH); \ if (_tmp_fd >=0) close(_tmp_fd); } # else #include #include #include /* higher overhead Linux specific function that adds program name */ static inline void sp_timestamp(const char *step) { #define SP_TIMESTAMP_PATH "/tmp/stamps/" int fd, count, offset; char filename[256], *cmdname; /* get process command name */ snprintf(filename, sizeof(filename), "/proc/%d/cmdline", getpid()); fd = open(filename, O_RDONLY); assert(fd >= 0); strcpy(filename, SP_TIMESTAMP_PATH); offset = sizeof(SP_TIMESTAMP_PATH)-1; count = read(fd, filename+offset, sizeof(filename)-offset); assert(count > 0); close(fd); /* take basename of the command name */ cmdname = strrchr(filename+offset, '/'); memmove(filename+offset, cmdname+1, strlen(cmdname)); offset += strlen(filename+offset); /* add step name */ assert(sizeof(filename) > offset + 1 + strlen(step) + 1); filename[offset++] = ':'; filename[offset] = '\0'; strcat(filename+offset, step); fd = open(filename, O_CREAT|O_WRONLY, S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH); if (fd >= 0) { close(fd); } #undef SP_TIMESTAMP_PATH } # endif #endif #endif /* SP_TIMESTAMP_H */ telepathy-mission-control-5.16.4/src/mcd-storage.h0000644000175000017500000001120712735242352023170 0ustar00gkiagiagkiagia00000000000000/* Mission Control storage API - interface which provides access to account * parameter/attribute storage * * Copyright © 2010 Nokia Corporation * Copyright © 2010 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #ifndef MCD_STORAGE_H #define MCD_STORAGE_H G_BEGIN_DECLS typedef struct { GObject parent; TpDBusDaemon *dbusd; /* owned string => owned McdStorageAccount */ GHashTable *accounts; } McdStorage; typedef struct _McdStorageClass McdStorageClass; typedef struct _McdStoragePrivate McdStoragePrivate; #define MCD_TYPE_STORAGE (mcd_storage_get_type ()) #define MCD_STORAGE(o) \ (G_TYPE_CHECK_INSTANCE_CAST ((o), MCD_TYPE_STORAGE, McdStorage)) #define MCD_STORAGE_CLASS(cls) \ (G_TYPE_CHECK_CLASS_CAST ((cls), MCD_TYPE_STORAGE, McdStorageClass)) #define MCD_IS_STORAGE(o) \ (G_TYPE_CHECK_INSTANCE_TYPE ((o), MCD_TYPE_STORAGE)) #define MCD_IS_STORAGE_CLASS(cls) \ (G_TYPE_CHECK_CLASS_TYPE ((cls), MCD_TYPE_STORAGE)) #define MCD_STORAGE_GET_CLASS(o) \ (G_TYPE_INSTANCE_GET_CLASS ((o), MCD_TYPE_STORAGE, McdStorageClass)) GType mcd_storage_get_type (void); McdStorage *mcd_storage_new (TpDBusDaemon *dbus_daemon); void mcd_storage_ready (McdStorage *self); void mcd_storage_connect_signal (const gchar *signal, GCallback func, gpointer user_data); void mcd_storage_load (McdStorage *storage); GStrv mcd_storage_dup_accounts (McdStorage *storage, gsize *n); GStrv mcd_storage_dup_attributes (McdStorage *storage, const gchar *account, gsize *n); gboolean mcd_storage_set_string (McdStorage *storage, const gchar *account, const gchar *attribute, const gchar *value); gboolean mcd_storage_set_strv (McdStorage *storage, const gchar *account, const gchar *attribute, const gchar * const *strv); gboolean mcd_storage_set_attribute (McdStorage *storage, const gchar *account, const gchar *attribute, const GValue *value); gboolean mcd_storage_set_parameter (McdStorage *storage, const gchar *account, const gchar *parameter, const GValue *value, gboolean secret); gchar *mcd_storage_create_account (McdStorage *storage, const gchar *provider, const gchar *manager, const gchar *protocol, GHashTable *params, GError **error); void mcd_storage_delete_account (McdStorage *storage, const gchar *account); void mcd_storage_commit (McdStorage *storage, const gchar *account); gchar *mcd_storage_dup_string (McdStorage *storage, const gchar *account, const gchar *attribute); gboolean mcd_storage_get_attribute (McdStorage *storage, const gchar *account, const gchar *attribute, GValue *value, GError **error); gboolean mcd_storage_get_parameter (McdStorage *storage, const gchar *account, const gchar *parameter, GValue *value, GError **error); gboolean mcd_storage_get_boolean (McdStorage *storage, const gchar *account, const gchar *attribute); gint mcd_storage_get_integer (McdStorage *storage, const gchar *account, const gchar *attribute); McpAccountStorage * mcd_storage_get_plugin (McdStorage *storage, const gchar *account); G_GNUC_INTERNAL void _mcd_storage_store_connections (McdStorage *storage); gboolean mcd_storage_add_account_from_plugin (McdStorage *storage, McpAccountStorage *plugin, const gchar *account); gboolean mcd_keyfile_get_value (GKeyFile *keyfile, const gchar *group, const gchar *key, GValue *value, GError **error); gboolean mcd_keyfile_set_value (GKeyFile *keyfile, const gchar *name, const gchar *key, const GValue *value); gchar *mcd_keyfile_escape_value (const GValue *value); gboolean mcd_keyfile_unescape_value (const gchar *escaped, GValue *value, GError **error); const gchar *mcd_storage_get_attribute_type (const gchar *attribute); gboolean mcd_storage_init_value_for_attribute (GValue *value, const gchar *attribute); G_END_DECLS #endif /* MCD_STORAGE_H */ telepathy-mission-control-5.16.4/src/mcd-mission-priv.h0000644000175000017500000000224412735241312024157 0ustar00gkiagiagkiagia00000000000000/* vi: set et sw=4 ts=8 cino=t0,(0: */ /* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4; tab-width: 8 -*- */ /* * This file is part of mission-control * * Copyright (C) 2007 Nokia Corporation. * * Contact: Naba Kumar * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * version 2.1 as published by the Free Software Foundation. * * This library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA * */ #ifndef MCD_MISSION_PRIV_H #define MCD_MISSION_PRIV_H #include "mcd-mission.h" G_BEGIN_DECLS G_GNUC_INTERNAL void _mcd_mission_set_parent (McdMission *mission, McdMission *parent); G_END_DECLS #endif telepathy-mission-control-5.16.4/src/request.c0000644000175000017500000007025612735242352022457 0ustar00gkiagiagkiagia00000000000000/* A Telepathy ChannelRequest object * * Copyright © 2009-2011 Nokia Corporation. * Copyright © 2009-2011 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA * */ #include "config.h" #include "request.h" #include #include #include #include "mcd-account-priv.h" #include "mcd-connection-priv.h" #include "mcd-debug.h" #include "mcd-misc.h" #include "plugin-loader.h" #include "plugin-request.h" #include "_gen/interfaces.h" enum { PROP_0, PROP_CLIENT_REGISTRY, PROP_USE_EXISTING, PROP_ACCOUNT, PROP_ACCOUNT_PATH, PROP_PROPERTIES, PROP_USER_ACTION_TIME, PROP_PREFERRED_HANDLER, PROP_HINTS, PROP_REQUESTS, PROP_INTERFACES }; static guint sig_id_cancelling = 0; static guint sig_id_ready_to_request = 0; struct _McdRequest { GObject parent; gboolean use_existing; McdClientRegistry *clients; TpDBusDaemon *dbus_daemon; McdAccount *account; GHashTable *properties; gint64 user_action_time; gchar *preferred_handler; GHashTable *hints; gchar *object_path; /* if the request is an internally handled special case: */ McdRequestInternalHandler internal_handler; GFreeFunc internal_handler_clear; gpointer internal_handler_data; /* Number of reasons to not make the request yet. * * We hold one extra ref to ourselves per delay. The object starts with * one delay in _mcd_request_init, representing the Proceed() call * that hasn't happened; to get the refcounting right, we take the * corresponding ref in _mcd_request_constructed. */ gsize delay; TpClient *predicted_handler; /* TRUE if either succeeded[-with-channel] or failed was emitted */ gboolean is_complete; gboolean cancellable; GQuark failure_domain; gint failure_code; gchar *failure_message; gboolean proceeding; }; struct _McdRequestClass { GObjectClass parent; TpDBusPropertiesMixinClass dbus_properties_class; }; static void request_iface_init (TpSvcChannelRequestClass *); G_DEFINE_TYPE_WITH_CODE (McdRequest, _mcd_request, G_TYPE_OBJECT, G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CHANNEL_REQUEST, request_iface_init); G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_DBUS_PROPERTIES, tp_dbus_properties_mixin_iface_init)) #define REQUEST_OBJ_BASE "/org/freedesktop/Telepathy/ChannelDispatcher/Request" static guint last_req_id = 1; static void _mcd_request_init (McdRequest *self) { DEBUG ("%p", self); self->delay = 1; self->cancellable = TRUE; self->object_path = g_strdup_printf (REQUEST_OBJ_BASE "%u", last_req_id++); } static void _mcd_request_constructed (GObject *object) { McdRequest *self = (McdRequest *) object; void (*constructed) (GObject *) = G_OBJECT_CLASS (_mcd_request_parent_class)->constructed; /* this is paired with the delay in _mcd_request_init */ g_object_ref (self); if (constructed != NULL) constructed (object); g_return_if_fail (self->account != NULL); g_return_if_fail (self->clients != NULL); self->dbus_daemon = _mcd_client_registry_get_dbus_daemon (self->clients); tp_dbus_daemon_register_object (self->dbus_daemon, self->object_path, self); } static void _mcd_request_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) { McdRequest *self = (McdRequest *) object; switch (prop_id) { case PROP_USE_EXISTING: g_value_set_boolean (value, self->use_existing); break; case PROP_CLIENT_REGISTRY: g_value_set_object (value, self->clients); break; case PROP_ACCOUNT: g_value_set_object (value, self->account); break; case PROP_ACCOUNT_PATH: g_value_set_boxed (value, mcd_account_get_object_path (self->account)); break; case PROP_PROPERTIES: g_value_set_boxed (value, self->properties); break; case PROP_PREFERRED_HANDLER: if (self->preferred_handler == NULL) { g_value_set_static_string (value, ""); } else { g_value_set_string (value, self->preferred_handler); } break; case PROP_USER_ACTION_TIME: g_value_set_int64 (value, self->user_action_time); break; case PROP_HINTS: if (self->hints == NULL) { g_value_take_boxed (value, g_hash_table_new (NULL, NULL)); } else { g_value_set_boxed (value, self->hints); } break; case PROP_REQUESTS: { GPtrArray *arr = g_ptr_array_sized_new (1); g_ptr_array_add (arr, g_hash_table_ref (self->properties)); g_value_take_boxed (value, arr); } break; case PROP_INTERFACES: /* we have no interfaces */ g_value_set_static_boxed (value, NULL); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } } static void _mcd_request_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) { McdRequest *self = (McdRequest *) object; switch (prop_id) { case PROP_USE_EXISTING: self->use_existing = g_value_get_boolean (value); break; case PROP_CLIENT_REGISTRY: g_assert (self->clients == NULL); /* construct-only */ self->clients = g_value_dup_object (value); break; case PROP_ACCOUNT: g_assert (self->account == NULL); /* construct-only */ self->account = g_value_dup_object (value); break; case PROP_PROPERTIES: g_assert (self->properties == NULL); /* construct-only */ self->properties = g_hash_table_ref (g_value_get_boxed (value)); break; case PROP_USER_ACTION_TIME: g_assert (self->user_action_time == 0); /* construct-only */ self->user_action_time = g_value_get_int64 (value); break; case PROP_PREFERRED_HANDLER: if (self->preferred_handler != NULL) g_free (self->preferred_handler); self->preferred_handler = g_value_dup_string (value); break; case PROP_HINTS: g_assert (self->hints == NULL); /* construct-only */ self->hints = g_value_dup_boxed (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } } static void _mcd_request_dispose (GObject *object) { McdRequest *self = (McdRequest *) object; GObjectFinalizeFunc dispose = G_OBJECT_CLASS (_mcd_request_parent_class)->dispose; DEBUG ("%p", object); /* shouldn't ever actually get this far with a blocked account, * * but we have to clear the lock if we do or we'll deadlock */ if (_mcd_request_is_internal (self) && self->account != NULL) { const gchar *path = mcd_account_get_object_path (self->account); _mcd_request_unblock_account (path); g_warning ("internal request disposed without being handled or failed"); } tp_clear_object (&self->account); tp_clear_object (&self->clients); tp_clear_object (&self->predicted_handler); tp_clear_pointer (&self->hints, g_hash_table_unref); if (dispose != NULL) dispose (object); } static void _mcd_request_finalize (GObject *object) { McdRequest *self = (McdRequest *) object; GObjectFinalizeFunc finalize = G_OBJECT_CLASS (_mcd_request_parent_class)->finalize; DEBUG ("%p", object); _mcd_request_clear_internal_handler (self); g_free (self->preferred_handler); g_free (self->object_path); g_free (self->failure_message); tp_clear_pointer (&self->properties, g_hash_table_unref); if (finalize != NULL) finalize (object); } static void _mcd_request_class_init ( McdRequestClass *cls) { static TpDBusPropertiesMixinPropImpl request_props[] = { { "Account", "account-path", NULL }, { "UserActionTime", "user-action-time", NULL }, { "PreferredHandler", "preferred-handler", NULL }, { "Interfaces", "interfaces", NULL }, { "Requests", "requests", NULL }, { "Hints", "hints", NULL }, { NULL } }; static TpDBusPropertiesMixinIfaceImpl prop_interfaces[] = { { TP_IFACE_CHANNEL_REQUEST, tp_dbus_properties_mixin_getter_gobject_properties, NULL, request_props, }, { NULL } }; GObjectClass *object_class = (GObjectClass *) cls; object_class->constructed = _mcd_request_constructed; object_class->get_property = _mcd_request_get_property; object_class->set_property = _mcd_request_set_property; object_class->dispose = _mcd_request_dispose; object_class->finalize = _mcd_request_finalize; g_object_class_install_property (object_class, PROP_USE_EXISTING, g_param_spec_boolean ("use-existing", "Use EnsureChannel?", "TRUE if EnsureChannel should be used for this request", FALSE, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (object_class, PROP_CLIENT_REGISTRY, g_param_spec_object ("client-registry", "Client registry", "The client registry", MCD_TYPE_CLIENT_REGISTRY, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (object_class, PROP_ACCOUNT, g_param_spec_object ("account", "Account", "The underlying McdAccount", MCD_TYPE_ACCOUNT, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (object_class, PROP_ACCOUNT_PATH, g_param_spec_boxed ("account-path", "Account path", "The object path of McdRequest:account", DBUS_TYPE_G_OBJECT_PATH, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (object_class, PROP_PROPERTIES, g_param_spec_boxed ("properties", "Properties", "Properties requested for the channel", TP_HASH_TYPE_QUALIFIED_PROPERTY_VALUE_MAP, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (object_class, PROP_USER_ACTION_TIME, g_param_spec_int64 ("user-action-time", "UserActionTime", "Time of user action as for TpAccountChannelRequest:user-action-time", G_MININT64, G_MAXINT64, TP_USER_ACTION_TIME_NOT_USER_ACTION, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (object_class, PROP_PREFERRED_HANDLER, g_param_spec_string ("preferred-handler", "PreferredHandler", "Preferred handler for this request, or the empty string", "", G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (object_class, PROP_HINTS, g_param_spec_boxed ("hints", "Hints", "GHashTable", TP_HASH_TYPE_STRING_VARIANT_MAP, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (object_class, PROP_REQUESTS, g_param_spec_boxed ("requests", "Requests", "A dbus-glib aa{sv}", TP_ARRAY_TYPE_QUALIFIED_PROPERTY_VALUE_MAP_LIST, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (object_class, PROP_INTERFACES, g_param_spec_boxed ("interfaces", "Interfaces", "A dbus-glib 'as'", G_TYPE_STRV, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); sig_id_cancelling = g_signal_new ("cancelling", G_OBJECT_CLASS_TYPE (cls), G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0); sig_id_ready_to_request = g_signal_new ("ready-to-request", G_OBJECT_CLASS_TYPE (cls), G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0); cls->dbus_properties_class.interfaces = prop_interfaces, tp_dbus_properties_mixin_class_init (object_class, G_STRUCT_OFFSET (McdRequestClass, dbus_properties_class)); } McdRequest * _mcd_request_new (McdClientRegistry *clients, gboolean use_existing, McdAccount *account, GHashTable *properties, gint64 user_action_time, const gchar *preferred_handler, GHashTable *hints) { McdRequest *self; self = g_object_new (MCD_TYPE_REQUEST, "client-registry", clients, "use-existing", use_existing, "account", account, "properties", properties, "user-action-time", user_action_time, "preferred-handler", preferred_handler, "hints", hints, NULL); DEBUG ("%p (for %p)", self, account); return self; } void _mcd_request_set_internal_handler (McdRequest *self, McdRequestInternalHandler handler, GFreeFunc free_func, gpointer data) { g_assert (self->internal_handler == NULL); g_assert (self->internal_handler_data == NULL); g_assert (self->internal_handler_clear == NULL); self->internal_handler = handler; self->internal_handler_clear = free_func; self->internal_handler_data = data; } gboolean _mcd_request_handle_internally (McdRequest *self, McdChannel *channel, gboolean close_after) { if (self->internal_handler != NULL) { DEBUG ("Handling request %p, channel %p internally", self, channel); self->internal_handler (self, channel, self->internal_handler_data, close_after); return TRUE; } return FALSE; } void _mcd_request_clear_internal_handler (McdRequest *self) { if (self->internal_handler_clear != NULL) self->internal_handler_clear (self->internal_handler_data); self->internal_handler = NULL; self->internal_handler_data = NULL; self->internal_handler_clear = NULL; } gboolean _mcd_request_is_internal (McdRequest *self) { return self != NULL && self->internal_handler != NULL; } gboolean _mcd_request_get_use_existing (McdRequest *self) { return self->use_existing; } McdAccount * _mcd_request_get_account (McdRequest *self) { return self->account; } gint64 _mcd_request_get_user_action_time (McdRequest *self) { return self->user_action_time; } const gchar * _mcd_request_get_preferred_handler (McdRequest *self) { if (self->preferred_handler == NULL) return ""; return self->preferred_handler; } const gchar * _mcd_request_get_object_path (McdRequest *self) { return self->object_path; } GHashTable * _mcd_request_get_hints (McdRequest *self) { return self->hints; } static GList * _mcd_request_policy_plugins (void) { static gboolean cached = FALSE; static GList *policies = NULL; if (G_UNLIKELY (!cached)) { const GList *p = NULL; for (p = mcp_list_objects (); p != NULL; p = g_list_next (p)) { if (MCP_IS_REQUEST_POLICY (p->data)) policies = g_list_prepend (policies, g_object_ref (p->data)); } cached = TRUE; } return policies; } /* hash keys on account paths: value is the lock-count */ static GHashTable *account_locks = NULL; static GHashTable *blocked_reqs = NULL; static void _init_blocked_account_request_queue (void) { account_locks = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL); blocked_reqs = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL); } guint _mcd_request_block_account (const gchar *account) { guint count; gchar *key = g_strdup (account); if (G_UNLIKELY (account_locks == NULL)) _init_blocked_account_request_queue (); count = GPOINTER_TO_UINT (g_hash_table_lookup (account_locks, account)); g_hash_table_replace (account_locks, key, GUINT_TO_POINTER (++count)); DEBUG ("lock count for account %s is now: %u", account, count); return count; } static void _unblock_request (gpointer object, gpointer data) { DEBUG ("ending delay for internally locked request %p on account %s", object, (const gchar *) data); _mcd_request_end_delay (MCD_REQUEST (object)); } guint _mcd_request_unblock_account (const gchar *account) { guint count = 0; gchar *key = NULL; if (G_UNLIKELY (account_locks == NULL)) { g_warning ("Unbalanced account-request-unblock for %s", account); return 0; } count = GPOINTER_TO_UINT (g_hash_table_lookup (account_locks, account)); switch (count) { GQueue *queue; case 0: g_warning ("Unbalanced account-request-unblock for %s", account); return 0; case 1: DEBUG ("removing lock from account %s", account); g_hash_table_remove (account_locks, account); queue = g_hash_table_lookup (blocked_reqs, account); if (queue == NULL) return 0; g_queue_foreach (queue, _unblock_request, NULL); g_queue_clear (queue); return 0; default: DEBUG ("reducing lock count for %s", account); key = g_strdup (account); g_hash_table_replace (account_locks, key, GUINT_TO_POINTER (--count)); return count; } } static gboolean _queue_blocked_requests (McdRequest *self) { const gchar *path = NULL; guint locks = 0; /* this is an internal request and therefore not subject to blocking * BUT the fact that this internal request is in-flight means other * requests on the same account/handle type should be blocked */ if (self->internal_handler != NULL) { path = mcd_account_get_object_path (_mcd_request_get_account (self)); _mcd_request_block_account (path); return FALSE; } /* no internal requests in flight, nothing to queue, nothing to do */ if (account_locks == NULL) return FALSE; if (path == NULL) path = mcd_account_get_object_path (_mcd_request_get_account (self)); /* account_locks tracks the # of in-flight internal requests per account */ locks = GPOINTER_TO_UINT (g_hash_table_lookup (account_locks, path)); /* internal reqeusts in flight => other requests on that account must wait */ if (locks > 0) { GQueue *queue; queue = g_hash_table_lookup (blocked_reqs, path); if (queue == NULL) { queue = g_queue_new (); g_hash_table_insert (blocked_reqs, g_strdup (path), queue); } _mcd_request_start_delay (self); g_queue_push_tail (queue, self); return TRUE; } return FALSE; } void _mcd_request_proceed (McdRequest *self, DBusGMethodInvocation *context) { McdConnection *connection = NULL; McdPluginRequest *plugin_api = NULL; gboolean urgent = FALSE; gboolean blocked = FALSE; const GList *mini_plugins; if (self->proceeding) { GError na = { TP_ERROR, TP_ERROR_NOT_AVAILABLE, "Proceed has already been called; stop calling it" }; if (context != NULL) dbus_g_method_return_error (context, &na); return; } self->proceeding = TRUE; tp_clear_pointer (&context, tp_svc_channel_request_return_from_proceed); connection = mcd_account_get_connection (self->account); if (connection != NULL) { const gchar *name = tp_asv_get_string (self->properties, TP_PROP_CHANNEL_TARGET_ID); if (name != NULL) { urgent = _mcd_connection_target_id_is_urgent (connection, name); } else { guint handle = tp_asv_get_uint32 (self->properties, TP_PROP_CHANNEL_TARGET_HANDLE, NULL); urgent = _mcd_connection_target_handle_is_urgent (connection, handle); } } /* urgent calls (eg emergency numbers) are not subject to policy * * delays: they automatically pass go and collect 200 qwatloos */ if (urgent) goto proceed; /* requests can pick up an extra delay (and ref) here */ blocked = _queue_blocked_requests (self); if (blocked) DEBUG ("Request delayed in favour of internal request on %s", mcd_account_get_object_path (self->account)); /* now regular request policy plugins get their shot at denying/delaying */ for (mini_plugins = _mcd_request_policy_plugins (); mini_plugins != NULL; mini_plugins = mini_plugins->next) { DEBUG ("Checking request with policy"); /* Lazily create a plugin-API object if anything cares */ if (plugin_api == NULL) { plugin_api = _mcd_plugin_request_new (self->account, self); } mcp_request_policy_check (mini_plugins->data, MCP_REQUEST (plugin_api)); } /* this is paired with the delay set when the request was created */ proceed: _mcd_request_end_delay (self); tp_clear_object (&plugin_api); } GHashTable * _mcd_request_get_properties (McdRequest *self) { return self->properties; } GVariant * mcd_request_dup_properties (McdRequest *self) { GValue value = G_VALUE_INIT; GVariant *ret; g_value_init (&value, TP_HASH_TYPE_STRING_VARIANT_MAP); g_value_set_boxed (&value, self->properties); ret = dbus_g_value_build_g_variant (&value); g_value_unset (&value); return g_variant_ref_sink (ret); } void _mcd_request_start_delay (McdRequest *self) { g_object_ref (self); self->delay++; } void _mcd_request_end_delay (McdRequest *self) { g_return_if_fail (self->delay > 0); if (--self->delay == 0) { g_signal_emit (self, sig_id_ready_to_request, 0); } g_object_unref (self); } static void _mcd_request_clean_up (McdRequest *self) { tp_clear_object (&self->predicted_handler); tp_dbus_daemon_unregister_object (self->dbus_daemon, self); } void _mcd_request_set_success (McdRequest *self, TpChannel *channel) { g_return_if_fail (TP_IS_CHANNEL (channel)); if (!self->is_complete) { /* might be used for the connection's properties in future; empty * for now */ GHashTable *future_conn_props = g_hash_table_new (g_str_hash, g_str_equal); GVariant *variant; GValue value = G_VALUE_INIT; DEBUG ("Request succeeded"); self->is_complete = TRUE; self->cancellable = FALSE; variant = tp_channel_dup_immutable_properties (channel); dbus_g_value_parse_g_variant (variant, &value); g_assert (G_VALUE_HOLDS (&value, TP_HASH_TYPE_STRING_VARIANT_MAP)); tp_svc_channel_request_emit_succeeded_with_channel (self, tp_proxy_get_object_path (tp_channel_get_connection (channel)), future_conn_props, tp_proxy_get_object_path (channel), g_value_get_boxed (&value)); tp_svc_channel_request_emit_succeeded (self); g_hash_table_unref (future_conn_props); g_value_unset (&value); g_variant_unref (variant); _mcd_request_clean_up (self); } else { DEBUG ("Ignoring an attempt to succeed after already complete"); } } void _mcd_request_set_failure (McdRequest *self, GQuark domain, gint code, const gchar *message) { if (!self->is_complete) { GError e = { domain, code, (gchar *) message }; gchar *err_string; DEBUG ("Request failed: %s %d: %s", g_quark_to_string (domain), code, message); err_string = _mcd_build_error_string (&e); self->is_complete = TRUE; self->cancellable = FALSE; self->failure_domain = domain; self->failure_code = code; self->failure_message = g_strdup (message); if (self->predicted_handler != NULL) { /* no callback, as we don't really care: this method call acts as a * pseudo-signal */ DEBUG ("calling RemoveRequest on %s for %s", tp_proxy_get_object_path (self->predicted_handler), self->object_path); tp_cli_client_interface_requests_call_remove_request ( self->predicted_handler, -1, self->object_path, err_string, message, NULL, NULL, NULL, NULL); } tp_svc_channel_request_emit_failed (self, err_string, message); g_free (err_string); _mcd_request_clean_up (self); } else { DEBUG ("Ignoring an attempt to fail after already complete"); } } gboolean _mcd_request_is_complete (McdRequest *self) { return self->is_complete; } GError * _mcd_request_dup_failure (McdRequest *self) { if (self->failure_domain == 0) return NULL; return g_error_new_literal (self->failure_domain, self->failure_code, self->failure_message); } void _mcd_request_set_uncancellable (McdRequest *self) { self->cancellable = FALSE; } static void channel_request_cancel (TpSvcChannelRequest *iface, DBusGMethodInvocation *context) { McdRequest *self = MCD_REQUEST (iface); GError *error = NULL; if (_mcd_request_cancel (self, &error)) { tp_svc_channel_request_return_from_cancel (context); } else { dbus_g_method_return_error (context, error); g_error_free (error); } } static void channel_request_proceed (TpSvcChannelRequest *iface, DBusGMethodInvocation *context) { McdRequest *self = MCD_REQUEST (iface); _mcd_request_proceed (self, context); } static void request_iface_init (TpSvcChannelRequestClass *iface) { #define IMPLEMENT(x) tp_svc_channel_request_implement_##x (\ iface, channel_request_##x) IMPLEMENT (proceed); IMPLEMENT (cancel); #undef IMPLEMENT } GHashTable * _mcd_request_dup_immutable_properties (McdRequest *self) { return tp_dbus_properties_mixin_make_properties_hash ((GObject *) self, TP_IFACE_CHANNEL_REQUEST, "Account", TP_IFACE_CHANNEL_REQUEST, "UserActionTime", TP_IFACE_CHANNEL_REQUEST, "PreferredHandler", TP_IFACE_CHANNEL_REQUEST, "Interfaces", TP_IFACE_CHANNEL_REQUEST, "Requests", TP_IFACE_CHANNEL_REQUEST, "Hints", NULL); } gboolean _mcd_request_cancel (McdRequest *self, GError **error) { if (self->cancellable) { /* for the moment, McdChannel has to do the actual work, because its * status/error track the failure state */ g_signal_emit (self, sig_id_cancelling, 0); return TRUE; } else { g_set_error (error, TP_ERROR, TP_ERROR_NOT_AVAILABLE, "ChannelRequest is no longer cancellable"); return FALSE; } } static TpClient * guess_request_handler (McdRequest *self) { GList *sorted_handlers; GVariant *properties; if (!tp_str_empty (self->preferred_handler)) { McdClientProxy *client = _mcd_client_registry_lookup ( self->clients, self->preferred_handler); if (client != NULL) return (TpClient *) client; } properties = mcd_request_dup_properties (self); sorted_handlers = _mcd_client_registry_list_possible_handlers ( self->clients, self->preferred_handler, properties, NULL, NULL); g_variant_unref (properties); if (sorted_handlers != NULL) { McdClientProxy *first = sorted_handlers->data; g_list_free (sorted_handlers); return (TpClient *) first; } return NULL; } void _mcd_request_predict_handler (McdRequest *self) { GHashTable *properties; TpClient *predicted_handler; g_return_if_fail (!self->is_complete); g_return_if_fail (self->predicted_handler == NULL); predicted_handler = guess_request_handler (self); if (!predicted_handler) { /* No handler found. But it's possible that by the time that the * channel will be created some handler will have popped up, so we * must not destroy it. */ DEBUG ("No known handler for request %s", self->object_path); return; } if (!tp_proxy_has_interface_by_id (predicted_handler, TP_IFACE_QUARK_CLIENT_INTERFACE_REQUESTS)) { DEBUG ("Default handler %s for request %s doesn't want AddRequest", tp_proxy_get_bus_name (predicted_handler), self->object_path); return; } DEBUG ("Calling AddRequest on default handler %s for request %s", tp_proxy_get_bus_name (predicted_handler), self->object_path); properties = _mcd_request_dup_immutable_properties (self); tp_cli_client_interface_requests_call_add_request (predicted_handler, -1, self->object_path, properties, NULL, NULL, NULL, NULL); g_hash_table_unref (properties); /* Remember it so we can call RemoveRequest when appropriate */ self->predicted_handler = g_object_ref (predicted_handler); } telepathy-mission-control-5.16.4/src/mcd-debug.c0000644000175000017500000001136212735241312022602 0ustar00gkiagiagkiagia00000000000000/* vi: set et sw=4 ts=8 cino=t0,(0: */ /* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4; tab-width: 8 -*- */ /* * This file is part of mission-control * * Copyright (C) 2007-2009 Nokia Corporation. * Copyright (C) 2008 Collabora Ltd. * * Contact: Naba Kumar * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * version 2.1 as published by the Free Software Foundation. * * This library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA * */ /** * SECTION:mcd-debug * @title: Debugging * @short_description: Debugging utilities * @see_also: * @stability: Unstable * @include: mcd-debug.h * * FIXME */ #include #include #include #include #include #include "mcd-debug.h" #include "mcd-operation.h" gint mcd_debug_level = 0; static void mcd_debug_print_tree_real (gpointer object, gint level) { GString *indent_str; gchar *indent = " "; gint i; indent_str = g_string_new (""); for (i = 0; i < level; i++) { g_string_append (indent_str, indent); } g_debug ("%s%s (%p): %d", indent_str->str, G_OBJECT_TYPE_NAME(object), object, G_OBJECT (object)->ref_count); if (MCD_IS_OPERATION (object)) { const GList *missions = mcd_operation_get_missions (MCD_OPERATION (object)); const GList *node = missions; while (node) { mcd_debug_print_tree_real (node->data, level + 1); node = g_list_next (node); } } g_string_free (indent_str, TRUE); } /* We don't really have debug categories yet */ typedef enum { MCD_DEBUG_MISC = 1 << 0, MCD_DEBUG_TREES = 1 << 1 } McdDebugCategory; static GDebugKey const keys[] = { { "misc", MCD_DEBUG_MISC }, { "trees", MCD_DEBUG_TREES }, { NULL, 0 } }; static McdDebugCategory categories = 0; void mcd_debug_print_tree (gpointer object) { g_return_if_fail (MCD_IS_MISSION (object)); if (categories & MCD_DEBUG_TREES) { g_debug ("Object Hierarchy of object %p", object); g_debug ("["); mcd_debug_print_tree_real (object, 1); g_debug ("]"); } } void mcd_debug_init () { gchar *mc_debug_str; guint level; mc_debug_str = getenv ("MC_DEBUG"); if (mc_debug_str) { /* historically, MC_DEBUG was an integer; try that first */ level = atoi (mc_debug_str); /* if it wasn't an integer; try interpreting it as a * telepathy-glib-style flags-word */ if (level == 0) { categories = g_parse_debug_string (mc_debug_str, keys, G_N_ELEMENTS (keys) - 1); tp_debug_set_flags (mc_debug_str); /* mcd-debug.h uses the value of mcd_debug_level directly, so * we need to set it nonzero to get uncategorized messages */ if ((categories & MCD_DEBUG_MISC) != 0 && mcd_debug_level == 0) { mcd_debug_level = 1; } } else { /* this is API, and will also try to set up categories from the * level */ mcd_debug_set_level (level); } } mcp_set_debug ((mcd_debug_level >= 1)); mcp_debug_init (); tp_debug_divert_messages (g_getenv ("MC_LOGFILE")); if (mcd_debug_level >= 1) g_debug ("%s version %s", PACKAGE, VERSION); } void mcd_debug_set_level (gint level) { mcd_debug_level = level; mcp_set_debug ((mcd_debug_level >= 1)); if (level >= 1) { categories |= MCD_DEBUG_MISC; } else { categories = 0; } if (level >= 2) { categories |= MCD_DEBUG_TREES; } } void mcd_debug (const gchar *format, ...) { gchar *message = NULL; gchar **formatted = NULL; TpDebugSender *dbg = tp_debug_sender_dup (); va_list args; if (_mcd_debug_get_level () > 0) formatted = &message; va_start (args, format); tp_debug_sender_add_message_vprintf (dbg, NULL, formatted, G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, format, args); va_end (args); if (!tp_str_empty (message)) { g_debug ("%s", message); g_free (message); } /* NOTE: the sender must be cached elsewhere, or this gets EXPENSIVE: */ g_object_unref (dbg); } telepathy-mission-control-5.16.4/src/connectivity-monitor.c0000644000175000017500000005602312735667553025204 0ustar00gkiagiagkiagia00000000000000/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */ /* * Copyright © 2009–2011 Collabora Ltd. * Copyright © 2013 Intel Corporation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * * Authors: * Jonny Lamb * Will Thompson */ #include "config.h" #include "connectivity-monitor.h" #include #ifdef HAVE_GIO_UNIX #include #endif #ifdef HAVE_NM #include #endif #ifdef HAVE_UPOWER #include #endif #include #include "mcd-debug.h" #define LOGIN1_BUS_NAME "org.freedesktop.login1" #define LOGIN1_MANAGER_OBJECT_PATH "/org/freedesktop/login1" #define LOGIN1_MANAGER_IFACE "org.freedesktop.login1.Manager" #define LOGIN1_MANAGER_PREPARE_FOR_SLEEP "PrepareForSleep" #define LOGIN1_MANAGER_PREPARE_FOR_SHUTDOWN "PrepareForShutdown" #define LOGIN1_MANAGER_INHIBIT "Inhibit" struct _McdInhibit { /* The number of reasons why we should delay sleep/shutdown. This behaves * like a refcount: when it reaches 0, we close the fd and free the * McdInhibit structure. * * 1 when we are waiting for PrepareForSleep/PrepareForShutdown; * the number of extra "holds" (currently one per McdAccount) when we have * received that signal and are waiting for each McdAccount to disconnect; * temporarily 1 + number of extra "holds" while we are dealing with the * signal. */ gsize holds; /* fd encapsulating the delay, provided by logind. We close this * when we no longer have any reason to delay sleep/shutdown. */ int fd; }; typedef enum { CONNECTIVITY_NONE = 0, /* Set if the device is not suspended; clear if it is suspending * (or suspended, but we don't get scheduled then). */ CONNECTIVITY_AWAKE = (1 << 0), /* Set if GNetworkMonitor says we're up. */ CONNECTIVITY_UP = (1 << 1), /* Clear if NetworkManager says we're in a shaky state like * disconnecting (the GNetworkMonitor can't tell this). Set otherwise. */ CONNECTIVITY_STABLE = (1 << 2), /* Set if the device is not shutting down, clear if it is. */ CONNECTIVITY_RUNNING = (1 << 3) } Connectivity; struct _McdConnectivityMonitorPrivate { GNetworkMonitor *network_monitor; GDBusConnection *system_bus; guint login1_prepare_for_sleep_id; guint login1_prepare_for_shutdown_id; McdInhibit *login1_inhibit; #ifdef HAVE_NM NMClient *nm_client; gulong state_change_signal_id; #endif #ifdef HAVE_UPOWER UpClient *upower_client; #endif #ifdef ENABLE_CONN_SETTING /* Application settings we steal from under Empathy's nose. */ GSettings *settings; #endif Connectivity connectivity; gboolean use_conn; }; enum { STATE_CHANGE, LAST_SIGNAL }; enum { PROP_0, PROP_USE_CONN, }; static guint signals[LAST_SIGNAL]; static McdConnectivityMonitor *connectivity_monitor_singleton = NULL; G_DEFINE_TYPE (McdConnectivityMonitor, mcd_connectivity_monitor, G_TYPE_OBJECT); static gboolean is_connected (Connectivity connectivity) { return ((connectivity & CONNECTIVITY_AWAKE) && (connectivity & CONNECTIVITY_UP) && (connectivity & CONNECTIVITY_STABLE) && (connectivity & CONNECTIVITY_RUNNING)); } static void connectivity_monitor_change_states ( McdConnectivityMonitor *self, Connectivity set, Connectivity clear, McdInhibit *inhibit) { McdConnectivityMonitorPrivate *priv = self->priv; Connectivity connectivity = ((priv->connectivity | set) & (~clear)); gboolean old_total = is_connected (priv->connectivity); gboolean new_total = is_connected (connectivity); if (priv->connectivity == connectivity) return; DEBUG ("awake: %d -> %d; up: %d -> %d; stable: %d -> %d; running: %d -> %d", (priv->connectivity & CONNECTIVITY_AWAKE), (connectivity & CONNECTIVITY_AWAKE), (priv->connectivity & CONNECTIVITY_UP), (connectivity & CONNECTIVITY_UP), (priv->connectivity & CONNECTIVITY_STABLE), (connectivity & CONNECTIVITY_STABLE), (priv->connectivity & CONNECTIVITY_RUNNING), (connectivity & CONNECTIVITY_RUNNING)); priv->connectivity = connectivity; if (old_total != new_total) { DEBUG ("%s", new_total ? "connected" : "disconnected"); g_signal_emit (self, signals[STATE_CHANGE], 0, new_total, inhibit); } } /* Calling this function makes us "more online" or has no effect */ static inline void connectivity_monitor_add_states ( McdConnectivityMonitor *self, Connectivity set, McdInhibit *inhibit) { connectivity_monitor_change_states (self, set, CONNECTIVITY_NONE, inhibit); } /* Calling this function makes us "less online" or has no effect */ static inline void connectivity_monitor_remove_states ( McdConnectivityMonitor *self, Connectivity clear, McdInhibit *inhibit) { connectivity_monitor_change_states (self, CONNECTIVITY_NONE, clear, inhibit); } #ifdef HAVE_NM static void connectivity_monitor_nm_state_change_cb (NMClient *client, const GParamSpec *pspec, McdConnectivityMonitor *connectivity_monitor) { McdConnectivityMonitorPrivate *priv; NMState state; priv = connectivity_monitor->priv; if (!priv->use_conn) return; state = nm_client_get_state (priv->nm_client); if (state == NM_STATE_CONNECTING || state == NM_STATE_DISCONNECTING || state == NM_STATE_ASLEEP) { DEBUG ("New NetworkManager network state %d (unstable state)", state); connectivity_monitor_remove_states (connectivity_monitor, CONNECTIVITY_STABLE, NULL); } else if (state == NM_STATE_DISCONNECTED) { DEBUG ("New NetworkManager network state %d (disconnected)", state); connectivity_monitor_remove_states (connectivity_monitor, CONNECTIVITY_UP|CONNECTIVITY_STABLE, NULL); } else { DEBUG ("New NetworkManager network state %d (stable state)", state); connectivity_monitor_add_states (connectivity_monitor, CONNECTIVITY_STABLE, NULL); } } #endif static void connectivity_monitor_network_changed (GNetworkMonitor *monitor, gboolean available, McdConnectivityMonitor *connectivity_monitor) { McdConnectivityMonitorPrivate *priv; priv = connectivity_monitor->priv; if (!priv->use_conn) return; if (available) { DEBUG ("GNetworkMonitor (%s) says we are at least partially online", G_OBJECT_TYPE_NAME (monitor)); connectivity_monitor_add_states (connectivity_monitor, CONNECTIVITY_UP, NULL); } else { DEBUG ("GNetworkMonitor (%s) says we are offline", G_OBJECT_TYPE_NAME (monitor)); connectivity_monitor_remove_states (connectivity_monitor, CONNECTIVITY_UP, NULL); } } #ifdef HAVE_UPOWER static void connectivity_monitor_set_awake ( McdConnectivityMonitor *self, gboolean awake) { if (awake) connectivity_monitor_add_states (self, CONNECTIVITY_AWAKE, NULL); else connectivity_monitor_remove_states (self, CONNECTIVITY_AWAKE, NULL); } static void notify_sleep_cb ( UpClient *upower_client, UpSleepKind sleep_kind, gpointer user_data) { McdConnectivityMonitor *self = MCD_CONNECTIVITY_MONITOR (user_data); DEBUG ("about to sleep! sleep_kind=%s", up_sleep_kind_to_string (sleep_kind)); connectivity_monitor_set_awake (self, FALSE); } static void notify_resume_cb ( UpClient *upower_client, UpSleepKind sleep_kind, gpointer user_data) { McdConnectivityMonitor *self = MCD_CONNECTIVITY_MONITOR (user_data); DEBUG ("woke up! sleep_kind=%s", up_sleep_kind_to_string (sleep_kind)); connectivity_monitor_set_awake (self, TRUE); } #endif #ifdef HAVE_GIO_UNIX static void login1_inhibit_cb (GObject *source G_GNUC_UNUSED, GAsyncResult *result, gpointer user_data) { McdConnectivityMonitor *self = MCD_CONNECTIVITY_MONITOR (user_data); GUnixFDList *fds = NULL; GError *error = NULL; GVariant *tuple = g_dbus_connection_call_with_unix_fd_list_finish ( self->priv->system_bus, &fds, result, &error); if (tuple != NULL) { gint32 i; g_variant_get (tuple, "(h)", &i); if (g_unix_fd_list_get_length (fds) > i) { g_warn_if_fail (self->priv->login1_inhibit->fd == -1); self->priv->login1_inhibit->fd = g_unix_fd_list_get (fds, i, &error); if (self->priv->login1_inhibit->fd >= 0) { DEBUG ("fd %d inhibits login1 sleep/shutdown", self->priv->login1_inhibit->fd); } else { DEBUG ("unable to duplicate fd: %s #%d: %s", g_quark_to_string (error->domain), error->code, error->message); g_error_free (error); mcd_inhibit_release (self->priv->login1_inhibit); self->priv->login1_inhibit = NULL; } } else { DEBUG ("Inhibit() didn't return enough fds?"); } g_variant_unref (tuple); } else { DEBUG ("unable to delay sleep and shutdown: %s #%d: %s", g_quark_to_string (error->domain), error->code, error->message); g_error_free (error); } g_clear_object (&fds); g_object_unref (self); } #endif static void connectivity_monitor_renew_inhibit (McdConnectivityMonitor *self) { #ifdef HAVE_GIO_UNIX if (self->priv->login1_inhibit != NULL) return; self->priv->login1_inhibit = g_slice_new (McdInhibit); self->priv->login1_inhibit->holds = 1; self->priv->login1_inhibit->fd = -1; g_dbus_connection_call_with_unix_fd_list (self->priv->system_bus, LOGIN1_BUS_NAME, LOGIN1_MANAGER_OBJECT_PATH, LOGIN1_MANAGER_IFACE, LOGIN1_MANAGER_INHIBIT, g_variant_new ("(ssss)", "sleep:shutdown", "Telepathy", "Disconnecting IM accounts before suspend/shutdown...", "delay"), G_VARIANT_TYPE ("(h)"), G_DBUS_CALL_FLAGS_NONE, -1, NULL, NULL, login1_inhibit_cb, g_object_ref (self)); #endif } static void login1_prepare_for_sleep_cb (GDBusConnection *system_bus G_GNUC_UNUSED, const gchar *sender_name G_GNUC_UNUSED, const gchar *object_path G_GNUC_UNUSED, const gchar *interface_name G_GNUC_UNUSED, const gchar *signal_name G_GNUC_UNUSED, GVariant *parameters, gpointer user_data) { McdConnectivityMonitor *self = MCD_CONNECTIVITY_MONITOR (user_data); if (g_variant_is_of_type (parameters, G_VARIANT_TYPE ("(b)"))) { gboolean sleeping; g_variant_get (parameters, "(b)", &sleeping); if (sleeping) { DEBUG ("about to suspend"); connectivity_monitor_remove_states (self, CONNECTIVITY_AWAKE, self->priv->login1_inhibit); tp_clear_pointer (&self->priv->login1_inhibit, mcd_inhibit_release); } else { DEBUG ("woke up, or suspend was cancelled"); connectivity_monitor_renew_inhibit (self); connectivity_monitor_add_states (self, CONNECTIVITY_AWAKE, self->priv->login1_inhibit); } } else if (DEBUGGING) { gchar *pretty = g_variant_print (parameters, TRUE); DEBUG ("ignoring PrepareForSleep signal not of type (b): %s", pretty); g_free (pretty); } } static void login1_prepare_for_shutdown_cb (GDBusConnection *system_bus G_GNUC_UNUSED, const gchar *sender_name G_GNUC_UNUSED, const gchar *object_path G_GNUC_UNUSED, const gchar *interface_name G_GNUC_UNUSED, const gchar *signal_name G_GNUC_UNUSED, GVariant *parameters, gpointer user_data) { McdConnectivityMonitor *self = MCD_CONNECTIVITY_MONITOR (user_data); if (g_variant_is_of_type (parameters, G_VARIANT_TYPE ("(b)"))) { gboolean shutting_down; g_variant_get (parameters, "(b)", &shutting_down); if (shutting_down) { DEBUG ("about to shut down"); connectivity_monitor_remove_states (self, CONNECTIVITY_RUNNING, self->priv->login1_inhibit); tp_clear_pointer (&self->priv->login1_inhibit, mcd_inhibit_release); } else { DEBUG ("shutdown was cancelled"); connectivity_monitor_renew_inhibit (self); connectivity_monitor_add_states (self, CONNECTIVITY_RUNNING, self->priv->login1_inhibit); } } else if (DEBUGGING) { gchar *pretty = g_variant_print (parameters, TRUE); DEBUG ("ignoring PrepareForShutdown signal not of type (b): %s", pretty); g_free (pretty); } } static void got_system_bus_cb (GObject *source G_GNUC_UNUSED, GAsyncResult *result, gpointer user_data) { McdConnectivityMonitor *self = MCD_CONNECTIVITY_MONITOR (user_data); GError *error = NULL; self->priv->system_bus = g_bus_get_finish (result, &error); if (self->priv->system_bus != NULL) { self->priv->login1_prepare_for_sleep_id = g_dbus_connection_signal_subscribe (self->priv->system_bus, LOGIN1_BUS_NAME, LOGIN1_MANAGER_IFACE, LOGIN1_MANAGER_PREPARE_FOR_SLEEP, LOGIN1_MANAGER_OBJECT_PATH, NULL, G_DBUS_SIGNAL_FLAGS_NONE, login1_prepare_for_sleep_cb, self, NULL); self->priv->login1_prepare_for_shutdown_id = g_dbus_connection_signal_subscribe (self->priv->system_bus, LOGIN1_BUS_NAME, LOGIN1_MANAGER_IFACE, LOGIN1_MANAGER_PREPARE_FOR_SHUTDOWN, LOGIN1_MANAGER_OBJECT_PATH, NULL, G_DBUS_SIGNAL_FLAGS_NONE, login1_prepare_for_shutdown_cb, self, NULL); connectivity_monitor_renew_inhibit (self); } else { DEBUG ("unable to connect to system bus: %s #%d: %s", g_quark_to_string (error->domain), error->code, error->message); g_error_free (error); } g_object_unref (self); } static void mcd_connectivity_monitor_init (McdConnectivityMonitor *connectivity_monitor) { McdConnectivityMonitorPrivate *priv; priv = G_TYPE_INSTANCE_GET_PRIVATE (connectivity_monitor, MCD_TYPE_CONNECTIVITY_MONITOR, McdConnectivityMonitorPrivate); connectivity_monitor->priv = priv; priv->use_conn = TRUE; /* Initially, assume everything is good. */ priv->connectivity = CONNECTIVITY_AWAKE | CONNECTIVITY_STABLE | CONNECTIVITY_UP | CONNECTIVITY_RUNNING; priv->network_monitor = g_network_monitor_get_default (); tp_g_signal_connect_object (priv->network_monitor, "network-changed", G_CALLBACK (connectivity_monitor_network_changed), connectivity_monitor, 0); connectivity_monitor_network_changed (priv->network_monitor, g_network_monitor_get_network_available (priv->network_monitor), connectivity_monitor); #ifdef ENABLE_CONN_SETTING priv->settings = g_settings_new ("im.telepathy.MissionControl.FromEmpathy"); /* We'll call g_settings_bind() in constructed because default values of * properties haven't been set yet at this point and we don't want them to * override the value from GSettings. */ #endif #ifdef HAVE_NM { GError *error = NULL; priv->nm_client = nm_client_new (NULL, &error); if (priv->nm_client != NULL) { priv->state_change_signal_id = g_signal_connect (priv->nm_client, "notify::" NM_CLIENT_STATE, G_CALLBACK (connectivity_monitor_nm_state_change_cb), connectivity_monitor); connectivity_monitor_nm_state_change_cb (priv->nm_client, NULL, connectivity_monitor); } else { DEBUG ("Failed to get NetworkManager proxy: %s", error->message); } } #endif #ifdef HAVE_UPOWER priv->upower_client = up_client_new (); tp_g_signal_connect_object (priv->upower_client, "notify-sleep", G_CALLBACK (notify_sleep_cb), connectivity_monitor, G_CONNECT_AFTER); tp_g_signal_connect_object (priv->upower_client, "notify-resume", G_CALLBACK (notify_resume_cb), connectivity_monitor, G_CONNECT_AFTER); #endif g_bus_get (G_BUS_TYPE_SYSTEM, NULL, got_system_bus_cb, g_object_ref (connectivity_monitor)); } static void connectivity_monitor_constructed (GObject *object) { #ifdef ENABLE_CONN_SETTING McdConnectivityMonitor *self = MCD_CONNECTIVITY_MONITOR (object); g_settings_bind (self->priv->settings, "use-conn", self, "use-conn", G_SETTINGS_BIND_GET); #endif } static void connectivity_monitor_finalize (GObject *object) { #if defined(HAVE_NM) || defined(HAVE_UPOWER) McdConnectivityMonitor *connectivity_monitor = MCD_CONNECTIVITY_MONITOR (object); McdConnectivityMonitorPrivate *priv = connectivity_monitor->priv; #endif #ifdef HAVE_NM if (priv->nm_client != NULL) { g_signal_handler_disconnect (priv->nm_client, priv->state_change_signal_id); priv->state_change_signal_id = 0; g_object_unref (priv->nm_client); priv->nm_client = NULL; } #endif #ifdef HAVE_UPOWER tp_clear_object (&priv->upower_client); #endif G_OBJECT_CLASS (mcd_connectivity_monitor_parent_class)->finalize (object); } static inline void clear_subscription (GDBusConnection *conn, guint *subscription) { if (*subscription == 0) return; g_dbus_connection_signal_unsubscribe (conn, *subscription); *subscription = 0; } static void connectivity_monitor_dispose (GObject *object) { McdConnectivityMonitor *self = MCD_CONNECTIVITY_MONITOR (object); g_clear_object (&self->priv->network_monitor); #ifdef ENABLE_CONN_SETTING g_clear_object (&self->priv->settings); #endif clear_subscription (self->priv->system_bus, &self->priv->login1_prepare_for_sleep_id); clear_subscription (self->priv->system_bus, &self->priv->login1_prepare_for_shutdown_id); tp_clear_pointer (&self->priv->login1_inhibit, mcd_inhibit_release); g_clear_object (&self->priv->system_bus); G_OBJECT_CLASS (mcd_connectivity_monitor_parent_class)->dispose (object); } static GObject * connectivity_monitor_constructor (GType type, guint n_construct_params, GObjectConstructParam *construct_params) { GObject *retval; if (!connectivity_monitor_singleton) { retval = G_OBJECT_CLASS (mcd_connectivity_monitor_parent_class)->constructor (type, n_construct_params, construct_params); connectivity_monitor_singleton = MCD_CONNECTIVITY_MONITOR (retval); g_object_add_weak_pointer (retval, (gpointer) &connectivity_monitor_singleton); } else { retval = g_object_ref (connectivity_monitor_singleton); } return retval; } static void connectivity_monitor_get_property (GObject *object, guint param_id, GValue *value, GParamSpec *pspec) { McdConnectivityMonitor *connectivity_monitor = MCD_CONNECTIVITY_MONITOR (object); switch (param_id) { case PROP_USE_CONN: g_value_set_boolean (value, mcd_connectivity_monitor_get_use_conn ( connectivity_monitor)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec); break; }; } static void connectivity_monitor_set_property (GObject *object, guint param_id, const GValue *value, GParamSpec *pspec) { McdConnectivityMonitor *connectivity_monitor = MCD_CONNECTIVITY_MONITOR (object); switch (param_id) { case PROP_USE_CONN: mcd_connectivity_monitor_set_use_conn (connectivity_monitor, g_value_get_boolean (value)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec); break; }; } static void mcd_connectivity_monitor_class_init (McdConnectivityMonitorClass *klass) { GObjectClass *oclass = G_OBJECT_CLASS (klass); oclass->finalize = connectivity_monitor_finalize; oclass->dispose = connectivity_monitor_dispose; oclass->constructor = connectivity_monitor_constructor; oclass->constructed = connectivity_monitor_constructed; oclass->get_property = connectivity_monitor_get_property; oclass->set_property = connectivity_monitor_set_property; signals[STATE_CHANGE] = g_signal_new ("state-change", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST, 0, NULL, NULL, NULL, G_TYPE_NONE, 2, G_TYPE_BOOLEAN, G_TYPE_POINTER); g_object_class_install_property (oclass, PROP_USE_CONN, g_param_spec_boolean ("use-conn", "Use connectivity managers", "Set presence according to connectivity managers", TRUE, G_PARAM_CONSTRUCT | G_PARAM_READWRITE)); g_type_class_add_private (oclass, sizeof (McdConnectivityMonitorPrivate)); } /* public methods */ McdConnectivityMonitor * mcd_connectivity_monitor_new (void) { return g_object_new (MCD_TYPE_CONNECTIVITY_MONITOR, NULL); } gboolean mcd_connectivity_monitor_is_online (McdConnectivityMonitor *connectivity_monitor) { McdConnectivityMonitorPrivate *priv = connectivity_monitor->priv; return is_connected (priv->connectivity); } gboolean mcd_connectivity_monitor_get_use_conn (McdConnectivityMonitor *connectivity_monitor) { McdConnectivityMonitorPrivate *priv = connectivity_monitor->priv; return priv->use_conn; } void mcd_connectivity_monitor_set_use_conn (McdConnectivityMonitor *connectivity_monitor, gboolean use_conn) { McdConnectivityMonitorPrivate *priv = connectivity_monitor->priv; if (use_conn == priv->use_conn) return; DEBUG ("use-conn GSettings key changed; new value = %s", use_conn ? "true" : "false"); priv->use_conn = use_conn; if (use_conn) { #if defined(HAVE_NM) connectivity_monitor_nm_state_change_cb (priv->nm_client, NULL, connectivity_monitor); #endif connectivity_monitor_network_changed (priv->network_monitor, g_network_monitor_get_network_available (priv->network_monitor), connectivity_monitor); } else { /* !use_conn basically means "always assume it's stable and up". */ connectivity_monitor_add_states (connectivity_monitor, CONNECTIVITY_STABLE|CONNECTIVITY_UP, NULL); } g_object_notify (G_OBJECT (connectivity_monitor), "use-conn"); } McdInhibit * mcd_inhibit_hold (McdInhibit *inhibit) { DEBUG ("%p (fd %d): %" G_GSIZE_FORMAT " -> %" G_GSIZE_FORMAT, inhibit, inhibit->fd, inhibit->holds, inhibit->holds + 1); inhibit->holds++; return inhibit; } void mcd_inhibit_release (McdInhibit *inhibit) { DEBUG ("%p (fd %d): %" G_GSIZE_FORMAT " -> %" G_GSIZE_FORMAT, inhibit, inhibit->fd, inhibit->holds, inhibit->holds - 1); if (--inhibit->holds == 0) { /* Not using the retry-on-EINTR idiom: see g_close() in GLib 2.36. * After we depend on GLib 2.36, we could use g_close(). */ if (inhibit->fd != -1 && close (inhibit->fd) != 0) { WARNING ("unable to close fd, ignoring: %s", g_strerror (errno)); } g_slice_free (McdInhibit, inhibit); } } telepathy-mission-control-5.16.4/src/mcd-account-manager.c0000644000175000017500000015747612736244113024604 0ustar00gkiagiagkiagia00000000000000/* vi: set et sw=4 ts=8 cino=t0,(0: */ /* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4; tab-width: 8 -*- */ /* * This file is part of mission-control * * Copyright © 2007-2011 Nokia Corporation. * Copyright © 2009-2012 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * version 2.1 as published by the Free Software Foundation. * * This library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA * */ #include "config.h" #include "mcd-account-manager.h" #include #include #include #include #include #include #include #include "mcd-account-manager-priv.h" #include "mcd-storage.h" #include "mcd-account.h" #include "mcd-account-config.h" #include "mcd-account-priv.h" #include "mcd-connection-priv.h" #include "mcd-dbusprop.h" #include "mcd-master-priv.h" #include "mcd-misc.h" #include "mcd-storage.h" #include "mission-control-plugins/mission-control-plugins.h" #include "mission-control-plugins/implementation.h" #include "plugin-loader.h" #include "_gen/interfaces.h" #define PARAM_PREFIX "param-" #define WRITE_CONF_DELAY 500 #define MCD_ACCOUNT_MANAGER_PRIV(account_manager) \ (MCD_ACCOUNT_MANAGER (account_manager)->priv) static void account_manager_iface_init (TpSvcAccountManagerClass *iface, gpointer iface_data); static void account_manager_hidden_iface_init ( McSvcAccountManagerInterfaceHiddenClass *iface, gpointer iface_data); static void properties_iface_init (TpSvcDBusPropertiesClass *iface, gpointer iface_data); static void _mcd_account_manager_constructed (GObject *obj); static const McdDBusProp account_manager_properties[]; static const McdDBusProp account_manager_hidden_properties[]; static const McdInterfaceData account_manager_interfaces[] = { MCD_IMPLEMENT_IFACE (tp_svc_account_manager_get_type, account_manager, TP_IFACE_ACCOUNT_MANAGER), MCD_IMPLEMENT_IFACE (mc_svc_account_manager_interface_hidden_get_type, account_manager_hidden, MC_IFACE_ACCOUNT_MANAGER_INTERFACE_HIDDEN), { NULL, } }; G_DEFINE_TYPE_WITH_CODE (McdAccountManager, mcd_account_manager, G_TYPE_OBJECT, MCD_DBUS_INIT_INTERFACES (account_manager_interfaces); G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_DBUS_PROPERTIES, properties_iface_init); ) struct _McdAccountManagerPrivate { TpDBusDaemon *dbus_daemon; TpSimpleClientFactory *client_factory; McdConnectivityMonitor *minotaur; McdStorage *storage; GHashTable *accounts; gchar *account_connections_dir; /* directory for temporary file */ gchar *account_connections_file; /* in account_connections_dir */ gboolean dbus_registered; }; typedef struct { McdAccountManager *account_manager; McpAccountStorage *storage_plugin; McdAccount *account; gint account_lock; } McdLoadAccountsData; typedef struct { McdAccountManager *account_manager; GHashTable *parameters; GHashTable *properties; McdGetAccountCb callback; gpointer user_data; GDestroyNotify destroy; gboolean ok; GError *error; } McdCreateAccountData; typedef struct { McdAccount *account; gchar *key; } McdAlterAccountData; enum { PROP_0, PROP_DBUS_DAEMON, PROP_CLIENT_FACTORY }; static guint write_conf_id = 0; static void register_dbus_service (McdAccountManager *account_manager); static void release_load_accounts_lock (McdLoadAccountsData *lad); static void add_account (McdAccountManager *manager, McdAccount *account, const gchar *source); static void account_loaded (McdAccount *account, const GError *error, gpointer user_data); /* calback chain for asynchronously updates from backends: */ static void async_altered_validity_cb (McdAccount *account, const GError *invalid_reason, gpointer data) { DEBUG ("asynchronously altered account %s is %svalid", mcd_account_get_unique_name (account), (invalid_reason == NULL) ? "" : "in"); g_object_unref (account); } static void async_altered_manager_cb (McdManager *cm, const GError *error, gpointer data) { McdAccount *account = data; const gchar *name = NULL; if (cm != NULL) name = mcd_manager_get_name (cm); if (error != NULL) DEBUG ("manager %s not ready: %s", name, error->message); else DEBUG ("manager %s is ready", name); /* this triggers the final parameter check which results in dbus signals * * being fired and (potentially) the account going online automatically */ mcd_account_check_validity (account, async_altered_validity_cb, NULL); g_object_unref (cm); } /* account has been updated by a third party, and the McpAccountStorage * * plugin has just informed us of this fact */ static void altered_cb (GObject *storage, const gchar *name, gpointer data) { McdAccountManager *am = MCD_ACCOUNT_MANAGER (data); McdMaster *master = mcd_master_get_default (); McdAccount *account = NULL; McdManager *cm = NULL; const gchar *cm_name = NULL; account = mcd_account_manager_lookup_account (am, name); if (G_UNLIKELY (!account)) { g_warning ("%s: account %s does not exist", G_STRFUNC, name); return; } /* in theory, the CM is already ready by this point, but make sure: */ cm_name = mcd_account_get_manager_name (account); if (cm_name != NULL) cm = _mcd_master_lookup_manager (master, cm_name); if (cm != NULL) { g_object_ref (cm); g_object_ref (account); mcd_manager_call_when_ready (cm, async_altered_manager_cb, account); } } static void async_altered_one_manager_cb (McdManager *cm, const GError *error, gpointer data) { McdAlterAccountData *altered = data; const gchar *name = NULL; if (cm != NULL) name = mcd_manager_get_name (cm); if (error != NULL) DEBUG ("manager %s not ready: %s", name, error->message); else DEBUG ("manager %s is ready", name); /* this triggers the final parameter check which results in dbus signals * * being fired and (potentially) the account going online automatically */ mcd_account_altered_by_plugin (altered->account, altered->key); g_object_unref (cm); g_object_unref (altered->account); g_free (altered->key); g_slice_free (McdAlterAccountData, altered); } static void altered_one_cb (GObject *storage, const gchar *account_name, const gchar *key, gpointer data) { McdAccountManager *am = MCD_ACCOUNT_MANAGER (data); McdMaster *master = mcd_master_get_default (); McdAccount *account = NULL; McdManager *cm = NULL; const gchar *cm_name = NULL; account = mcd_account_manager_lookup_account (am, account_name); if (G_UNLIKELY (!account)) { g_warning ("%s: account %s does not exist", G_STRFUNC, account_name); return; } /* in theory, the CM is already ready by this point, but make sure: */ cm_name = mcd_account_get_manager_name (account); if (cm_name != NULL) cm = _mcd_master_lookup_manager (master, cm_name); if (cm != NULL) { McdAlterAccountData *altered = g_slice_new0 (McdAlterAccountData); g_object_ref (cm); altered->account = g_object_ref (account); altered->key = g_strdup (key); mcd_manager_call_when_ready (cm, async_altered_one_manager_cb, altered); } } /* callbacks for the various stages in an backend-driven account creation */ static void async_created_validity_cb (McdAccount *account, const GError *invalid_reason, gpointer data) { DEBUG ("asynchronously created account %s is %svalid", mcd_account_get_unique_name (account), (invalid_reason == NULL) ? "" : "in"); /* safely cached in the accounts hash by now */ g_object_unref (account); } static void async_created_manager_cb (McdManager *cm, const GError *error, gpointer data) { McdLoadAccountsData *lad = data; McdAccount *account = lad->account; McdAccountManager *am = lad->account_manager; McpAccountStorage *plugin = lad->storage_plugin; const gchar *name = NULL; if (cm != NULL) name = mcd_manager_get_name (cm); if (error != NULL) DEBUG ("manager %s not ready: %s", name, error->message); else DEBUG ("manager %s is ready", name); /* this takes a ref to the account and stores it in the accounts hash */ add_account (am, account, mcp_account_storage_name (plugin)); /* this will free the McdLoadAccountsData, don't use it after this */ _mcd_account_load (account, account_loaded, lad); /* this triggers the final parameter check which results in dbus signals * * being fired and (potentially) the account going online automatically */ mcd_account_check_validity (account, async_created_validity_cb, NULL); g_object_unref (cm); } /* account created by an McpAccountStorage plugin after the initial setup * * since the plugin does not have our cache, we need to poke the plugin * * to fetch the named account explicitly at this point (ie it's a read, not * * not a write, from the plugin's POV: */ static void created_cb (GObject *storage_plugin_obj, const gchar *name, gpointer data) { McpAccountStorage *plugin = MCP_ACCOUNT_STORAGE (storage_plugin_obj); McdAccountManager *am = MCD_ACCOUNT_MANAGER (data); McdAccountManagerPrivate *priv = MCD_ACCOUNT_MANAGER_PRIV (am); McdLoadAccountsData *lad = g_slice_new (McdLoadAccountsData); McdAccount *account = NULL; McdStorage *storage = priv->storage; McdMaster *master = mcd_master_get_default (); McdManager *cm = NULL; const gchar *cm_name = NULL; lad->account_manager = am; lad->storage_plugin = plugin; lad->account_lock = 1; /* will be released at the end of this function */ /* actually fetch the data into our cache from the plugin: */ if (mcd_storage_add_account_from_plugin (storage, plugin, name)) { account = mcd_account_new (am, name, priv->minotaur); lad->account = account; } else { /* that function already warned about it */ goto finish; } if (G_UNLIKELY (!account)) { g_warning ("%s: account %s failed to instantiate", G_STRFUNC, name); goto finish; } cm_name = mcd_account_get_manager_name (account); if (cm_name != NULL) cm = _mcd_master_lookup_manager (master, cm_name); if (cm != NULL) { lad->account_lock++; g_object_ref (cm); mcd_manager_call_when_ready (cm, async_created_manager_cb, lad); } else { /* account is well and truly broken. forget it even existed: */ g_warning ("%s: account %s has no manager, ignoring it", G_STRFUNC, name); g_object_unref (account); } finish: release_load_accounts_lock (lad); } static void toggled_cb (GObject *plugin, const gchar *name, gboolean on, gpointer data) { McpAccountStorage *storage_plugin = MCP_ACCOUNT_STORAGE (plugin); McdAccountManager *manager = MCD_ACCOUNT_MANAGER (data); McdAccount *account = NULL; GError *error = NULL; account = mcd_account_manager_lookup_account (manager, name); DEBUG ("%s plugin reports %s became %sabled", mcp_account_storage_name (storage_plugin), name, on ? "en" : "dis"); if (account == NULL) { g_warning ("%s: Unknown account %s from %s plugin", G_STRFUNC, name, mcp_account_storage_name (storage_plugin)); return; } _mcd_account_set_enabled (account, on, FALSE, MCD_DBUS_PROP_SET_FLAG_NONE, &error); if (error != NULL) { g_warning ("Error setting Enabled for %s: %s", name, error->message); g_clear_error (&error); } } static void reconnect_cb (GObject *plugin, const gchar *name, gpointer data) { McpAccountStorage *storage_plugin = MCP_ACCOUNT_STORAGE (plugin); McdAccountManager *manager = MCD_ACCOUNT_MANAGER (data); McdAccount *account = NULL; account = mcd_account_manager_lookup_account (manager, name); DEBUG ("%s plugin request %s reconnection", mcp_account_storage_name (storage_plugin), name); if (account == NULL) { g_warning ("%s: Unknown account %s from %s plugin", G_STRFUNC, name, mcp_account_storage_name (storage_plugin)); return; } /* Storage ask to reconnect when important parameters changed, which is an * user action. */ _mcd_account_reconnect (account, TRUE); } static void _mcd_account_delete_cb (McdAccount *account, const GError *error, gpointer data) { /* no need to do anything other than release the account ref, which * * should be the last ref we hold by the time this rolls arouns: */ g_object_unref (account); } /* a backend plugin notified us that an account was vaporised: remove it */ static void deleted_cb (GObject *plugin, const gchar *name, gpointer data) { McpAccountStorage *storage_plugin = MCP_ACCOUNT_STORAGE (plugin); McdAccountManager *manager = MCD_ACCOUNT_MANAGER (data); McdAccount *account = NULL; account = g_hash_table_lookup (manager->priv->accounts, name); DEBUG ("%s reported deletion of %s (%p)", mcp_account_storage_name (storage_plugin), name, account); if (account != NULL) { const gchar * object_path = mcd_account_get_object_path (account); g_object_ref (account); /* this unhooks the account's signal handlers */ g_hash_table_remove (manager->priv->accounts, name); tp_svc_account_manager_emit_account_removed (manager, object_path); mcd_account_delete (account, _mcd_account_delete_cb, NULL); } } static gboolean get_account_connection (const gchar *file_contents, const gchar *path, gchar **p_bus_name, gchar **p_account_name) { const gchar *line, *tab1, *tab2, *endline; const gchar *connection_path, *bus_name, *account_name; size_t len; g_return_val_if_fail (path != NULL, FALSE); if (!file_contents) return FALSE; len = strlen (path); line = file_contents; while ((tab1 = strchr (line, '\t')) != NULL) { connection_path = line; bus_name = tab1 + 1; tab2 = strchr (bus_name, '\t'); if (!tab2) break; account_name = tab2 + 1; endline = strchr (account_name, '\n'); if (!endline) break; if (line + len == tab1 && strncmp (path, connection_path, len) == 0) { *p_bus_name = g_strndup (bus_name, tab2 - bus_name); *p_account_name = g_strndup (account_name, endline - account_name); return TRUE; } line = endline + 1; } return FALSE; } static gboolean recover_connection (McdAccountManager *account_manager, gchar *file_contents, const gchar *name) { McdAccount *account; McdConnection *connection; McdManager *manager; McdMaster *master; const gchar *manager_name; gchar *object_path, *bus_name, *account_name; GError *error = NULL; gboolean ret = FALSE; master = mcd_master_get_default (); g_return_val_if_fail (MCD_IS_MASTER (master), FALSE); object_path = g_strdelimit (g_strdup_printf ("/%s", name), ".", '/'); if (!get_account_connection (file_contents, object_path, &bus_name, &account_name)) goto err_match; account = g_hash_table_lookup (account_manager->priv->accounts, account_name); if (!account || !mcd_account_is_enabled (account)) goto err_account; DEBUG ("account is %s", mcd_account_get_unique_name (account)); manager_name = mcd_account_get_manager_name (account); manager = _mcd_master_lookup_manager (master, manager_name); if (G_UNLIKELY (!manager)) { DEBUG ("Manager %s not found", manager_name); goto err_manager; } connection = mcd_manager_create_connection (manager, account); if (G_UNLIKELY (!connection)) goto err_connection; _mcd_connection_set_tp_connection (connection, bus_name, object_path, &error); if (G_UNLIKELY (error)) { DEBUG ("got error: %s", error->message); g_error_free (error); goto err_connection; } ret = TRUE; err_connection: err_manager: err_account: g_free (account_name); g_free (bus_name); err_match: g_free (object_path); return ret; } static void list_connection_names_cb (const gchar * const *names, gsize n, const gchar * const *cms, const gchar * const *protocols, const GError *error, gpointer user_data, GObject *weak_object) { McdAccountManager *account_manager = MCD_ACCOUNT_MANAGER (weak_object); McdAccountManagerPrivate *priv = account_manager->priv; gchar *contents = NULL; guint i; DEBUG ("%" G_GSIZE_FORMAT " connections", n); /* if the file has no contents, we don't really care why */ if (!g_file_get_contents (priv->account_connections_file, &contents, NULL, NULL)) { contents = NULL; } for (i = 0; i < n; i++) { g_return_if_fail (names[i] != NULL); DEBUG ("Connection %s", names[i]); if (!recover_connection (account_manager, contents, names[i])) { /* Close the connection */ TpConnection *proxy; gchar *path; path = g_strdup_printf ("/%s", names[i]); g_strdelimit (path, ".", '/'); DEBUG ("Killing connection"); proxy = tp_simple_client_factory_ensure_connection ( priv->client_factory, path, NULL, NULL); if (proxy) { tp_cli_connection_call_disconnect (proxy, -1, NULL, NULL, NULL, NULL); g_object_unref (proxy); } g_free (path); } } g_free (contents); } static void on_account_validity_changed (McdAccount *account, gboolean valid, McdAccountManager *account_manager) { const gchar *object_path; object_path = mcd_account_get_object_path (account); if (_mcd_account_is_hidden (account)) { mc_svc_account_manager_interface_hidden_emit_hidden_account_validity_changed ( account_manager, object_path, valid); } else { tp_svc_account_manager_emit_account_validity_changed (account_manager, object_path, valid); } } static void on_account_removed (McdAccount *account, McdAccountManager *account_manager) { McdAccountManagerPrivate *priv = account_manager->priv; McdStorage *storage = priv->storage; const gchar *name, *object_path; object_path = mcd_account_get_object_path (account); if (_mcd_account_is_hidden (account)) { mc_svc_account_manager_interface_hidden_emit_hidden_account_removed ( account_manager, object_path); } else { tp_svc_account_manager_emit_account_removed (account_manager, object_path); } name = mcd_account_get_unique_name (account); g_hash_table_remove (priv->accounts, name); mcd_storage_delete_account (storage, name); mcd_account_manager_write_conf_async (account_manager, account, NULL, NULL); } static inline void disconnect_signal (gpointer instance, gpointer func) { g_signal_handlers_disconnect_matched (instance, G_SIGNAL_MATCH_FUNC, 0, 0, NULL, func, NULL); } static void unref_account (gpointer data) { McdAccount *account = MCD_ACCOUNT (data); DEBUG ("called for %s", mcd_account_get_unique_name (account)); disconnect_signal (account, on_account_validity_changed); disconnect_signal (account, on_account_removed); g_object_unref (account); } static void _mcd_account_manager_store_account_connections ( McdAccountManager *); static void add_account (McdAccountManager *account_manager, McdAccount *account, const gchar *source) { McdAccountManagerPrivate *priv = account_manager->priv; McdAccount *existing; const gchar *name; name = mcd_account_get_unique_name (account); DEBUG ("adding account %s (%p) from %s", name, account, source); existing = mcd_account_manager_lookup_account (account_manager, name); if (existing != NULL) { g_warning ("...but we already have an account %p with that name!", existing); } g_hash_table_insert (priv->accounts, (gchar *)name, g_object_ref (account)); /* if we have to connect to any signals from the account object, this is * the place to do it */ g_signal_connect (account, "validity-changed", G_CALLBACK (on_account_validity_changed), account_manager); g_signal_connect (account, "removed", G_CALLBACK (on_account_removed), account_manager); tp_g_signal_connect_object (account, "connection-path-changed", G_CALLBACK (_mcd_account_manager_store_account_connections), account_manager, G_CONNECT_SWAPPED); /* some reports indicate this doesn't always fire for async backend * * accounts: testing here hasn't shown this, but at least we will be * * able to tell if this happens from MC debug logs now: */ DEBUG ("account %s validity: %d", name, mcd_account_is_valid (account)); /* if the account is already valid, synthesize a signal indicating that * it's been added */ if (mcd_account_is_valid (account)) on_account_validity_changed (account, TRUE, account_manager); } static void mcd_create_account_data_free (McdCreateAccountData *cad) { g_hash_table_unref (cad->parameters); tp_clear_pointer (&cad->properties, g_hash_table_unref); if (G_UNLIKELY (cad->error)) g_error_free (cad->error); g_slice_free (McdCreateAccountData, cad); } static gboolean set_new_account_properties (McdAccount *account, GHashTable *properties, GError **error) { GHashTableIter iter; gpointer key, value; gboolean ok = TRUE; g_hash_table_iter_init (&iter, properties); while (g_hash_table_iter_next (&iter, &key, &value) && ok) { gchar *name = key; gchar *dot, *iface, *pname; if ((dot = strrchr (name, '.')) != NULL) { iface = g_strndup (name, dot - name); pname = dot + 1; ok = mcd_dbusprop_set_property (TP_SVC_DBUS_PROPERTIES (account), iface, pname, value, error); g_free (iface); } else { g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Malformed property name: %s", name); ok = FALSE; } } return ok; } static void complete_account_creation_finish (McdAccount *account, McdCreateAccountData *cad) { McdAccountManager *account_manager = cad->account_manager; if (!cad->ok) { mcd_account_delete (account, NULL, NULL); tp_clear_object (&account); } mcd_account_manager_write_conf_async (account_manager, account, NULL, NULL); if (cad->callback != NULL) cad->callback (account_manager, account, cad->error, cad->user_data); mcd_create_account_data_free (cad); tp_clear_object (&account); } static void complete_account_creation_check_validity_cb (McdAccount *account, const GError *invalid_reason, gpointer user_data) { McdCreateAccountData *cad = user_data; if (invalid_reason != NULL) { cad->ok = FALSE; g_set_error_literal (&cad->error, invalid_reason->domain, invalid_reason->code, invalid_reason->message); } complete_account_creation_finish (account, cad); } static void complete_account_creation_set_cb (McdAccount *account, GPtrArray *not_yet, const GError *set_error, gpointer user_data) { McdCreateAccountData *cad = user_data; McdAccountManager *account_manager; cad->ok = TRUE; account_manager = cad->account_manager; if (set_error != NULL) { cad->ok = FALSE; g_set_error_literal (&cad->error, set_error->domain, set_error->code, set_error->message); } if (cad->ok && cad->properties != NULL) { cad->ok = set_new_account_properties (account, cad->properties, &cad->error); } if (cad->ok) { add_account (account_manager, account, G_STRFUNC); mcd_account_check_validity (account, complete_account_creation_check_validity_cb, cad); } else { complete_account_creation_finish (account, cad); } } static void complete_account_creation (McdAccount *account, const GError *cb_error, gpointer user_data) { McdCreateAccountData *cad = user_data; McdAccountManager *account_manager; account_manager = cad->account_manager; if (G_UNLIKELY (cb_error)) { cad->callback (account_manager, account, cb_error, cad->user_data); mcd_create_account_data_free (cad); return; } _mcd_account_set_parameters (account, cad->parameters, NULL, complete_account_creation_set_cb, cad); } void _mcd_account_manager_create_account (McdAccountManager *account_manager, const gchar *manager, const gchar *protocol, const gchar *display_name, GHashTable *params, GHashTable *properties, McdGetAccountCb callback, gpointer user_data, GDestroyNotify destroy) { McdAccountManagerPrivate *priv = account_manager->priv; McdStorage *storage = priv->storage; McdCreateAccountData *cad; McdAccount *account; gchar *unique_name = NULL; const gchar *provider; GError *e = NULL; DEBUG ("called"); if (G_UNLIKELY (manager == NULL || manager[0] == 0 || protocol == NULL || protocol[0] == 0)) { GError error = { TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Invalid parameters"}; callback (account_manager, NULL, &error, user_data); if (destroy) destroy (user_data); return; } provider = tp_asv_get_string (properties, TP_PROP_ACCOUNT_INTERFACE_STORAGE_STORAGE_PROVIDER); unique_name = mcd_storage_create_account (storage, provider, manager, protocol, params, &e); if (unique_name == NULL) { callback (account_manager, NULL, e, user_data); g_clear_error (&e); if (destroy) destroy (user_data); return; } /* create the basic account keys */ mcd_storage_set_string (storage, unique_name, MC_ACCOUNTS_KEY_MANAGER, manager); mcd_storage_set_string (storage, unique_name, MC_ACCOUNTS_KEY_PROTOCOL, protocol); if (display_name != NULL) mcd_storage_set_string (storage, unique_name, MC_ACCOUNTS_KEY_DISPLAY_NAME, display_name); account = mcd_account_new (account_manager, unique_name, priv->minotaur); g_free (unique_name); if (G_LIKELY (account)) { cad = g_slice_new (McdCreateAccountData); cad->account_manager = account_manager; cad->parameters = g_hash_table_ref (params); cad->properties = (properties ? g_hash_table_ref (properties) : NULL); cad->callback = callback; cad->user_data = user_data; cad->destroy = destroy; cad->error = NULL; _mcd_account_load (account, complete_account_creation, cad); } else { GError error = { TP_ERROR, TP_ERROR_NOT_AVAILABLE, "" }; callback (account_manager, NULL, &error, user_data); if (destroy) destroy (user_data); } } static void create_account_cb (McdAccountManager *account_manager, McdAccount *account, const GError *error, gpointer user_data) { DBusGMethodInvocation *context = user_data; const gchar *object_path; if (G_UNLIKELY (error)) { dbus_g_method_return_error (context, (GError *)error); return; } g_return_if_fail (MCD_IS_ACCOUNT (account)); object_path = mcd_account_get_object_path (account); tp_svc_account_manager_return_from_create_account (context, object_path); } static void account_manager_create_account (TpSvcAccountManager *self, const gchar *manager, const gchar *protocol, const gchar *display_name, GHashTable *parameters, GHashTable *properties, DBusGMethodInvocation *context) { _mcd_account_manager_create_account (MCD_ACCOUNT_MANAGER (self), manager, protocol, display_name, parameters, properties, create_account_cb, context, NULL); } static void account_manager_iface_init (TpSvcAccountManagerClass *iface, gpointer iface_data) { #define IMPLEMENT(x) tp_svc_account_manager_implement_##x (\ iface, account_manager_##x) IMPLEMENT(create_account); #undef IMPLEMENT } static void account_manager_hidden_iface_init ( McSvcAccountManagerInterfaceHiddenClass *iface, gpointer iface_data) { } static void accounts_to_gvalue (GHashTable *accounts, gboolean valid, gboolean hidden, GValue *value) { static GType ao_type = G_TYPE_INVALID; GPtrArray *account_array; GHashTableIter iter; McdAccount *account; gpointer k; if (G_UNLIKELY (ao_type == G_TYPE_INVALID)) ao_type = dbus_g_type_get_collection ("GPtrArray", DBUS_TYPE_G_OBJECT_PATH); account_array = g_ptr_array_sized_new (g_hash_table_size (accounts)); g_hash_table_iter_init (&iter, accounts); while (g_hash_table_iter_next (&iter, &k, (gpointer)&account)) { if (mcd_account_is_valid (account) == valid && _mcd_account_is_hidden (account) == hidden) { g_ptr_array_add (account_array, g_strdup (mcd_account_get_object_path (account))); } } g_value_init (value, ao_type); g_value_take_boxed (value, account_array); } static void get_valid_accounts (TpSvcDBusProperties *self, const gchar *name, GValue *value) { McdAccountManager *account_manager = MCD_ACCOUNT_MANAGER (self); McdAccountManagerPrivate *priv = account_manager->priv; DEBUG ("called"); accounts_to_gvalue (priv->accounts, TRUE, FALSE, value); } static void get_invalid_accounts (TpSvcDBusProperties *self, const gchar *name, GValue *value) { McdAccountManager *account_manager = MCD_ACCOUNT_MANAGER (self); McdAccountManagerPrivate *priv = account_manager->priv; DEBUG ("called"); accounts_to_gvalue (priv->accounts, FALSE, FALSE, value); } static void get_supported_account_properties (TpSvcDBusProperties *svc, const gchar *name, GValue *value) { static const gchar * const supported[] = { TP_IFACE_ACCOUNT ".AutomaticPresence", TP_IFACE_ACCOUNT ".Enabled", TP_IFACE_ACCOUNT ".Icon", TP_IFACE_ACCOUNT ".Nickname", TP_IFACE_ACCOUNT ".ConnectAutomatically", TP_IFACE_ACCOUNT ".RequestedPresence", TP_IFACE_ACCOUNT ".Supersedes", TP_PROP_ACCOUNT_SERVICE, TP_IFACE_ACCOUNT_INTERFACE_AVATAR ".Avatar", MC_IFACE_ACCOUNT_INTERFACE_CONDITIONS ".Condition", TP_PROP_ACCOUNT_INTERFACE_STORAGE_STORAGE_PROVIDER, MC_IFACE_ACCOUNT_INTERFACE_HIDDEN ".Hidden", NULL }; g_value_init (value, G_TYPE_STRV); g_value_set_static_boxed (value, supported); } static const McdDBusProp account_manager_properties[] = { { "ValidAccounts", NULL, get_valid_accounts }, { "InvalidAccounts", NULL, get_invalid_accounts }, { "Interfaces", NULL, mcd_dbus_get_interfaces }, { "SupportedAccountProperties", NULL, get_supported_account_properties }, { 0 }, }; static void get_valid_hidden_accounts (TpSvcDBusProperties *self, const gchar *name, GValue *value) { McdAccountManager *account_manager = MCD_ACCOUNT_MANAGER (self); McdAccountManagerPrivate *priv = account_manager->priv; accounts_to_gvalue (priv->accounts, TRUE, TRUE, value); } static void get_invalid_hidden_accounts (TpSvcDBusProperties *self, const gchar *name, GValue *value) { McdAccountManager *account_manager = MCD_ACCOUNT_MANAGER (self); McdAccountManagerPrivate *priv = account_manager->priv; accounts_to_gvalue (priv->accounts, FALSE, TRUE, value); } static const McdDBusProp account_manager_hidden_properties[] = { { "ValidHiddenAccounts", NULL, get_valid_hidden_accounts }, { "InvalidHiddenAccounts", NULL, get_invalid_hidden_accounts }, { 0 }, }; static void properties_iface_init (TpSvcDBusPropertiesClass *iface, gpointer iface_data) { #define IMPLEMENT(x) tp_svc_dbus_properties_implement_##x (\ iface, dbusprop_##x) IMPLEMENT(set); IMPLEMENT(get); IMPLEMENT(get_all); #undef IMPLEMENT } static gboolean write_conf (gpointer userdata) { McdStorage *storage = MCD_STORAGE (userdata); DEBUG ("called"); g_source_remove (write_conf_id); write_conf_id = 0; mcd_storage_commit (storage, NULL); return TRUE; } static void release_load_accounts_lock (McdLoadAccountsData *lad) { g_return_if_fail (lad->account_lock > 0); lad->account_lock--; DEBUG ("called, count is now %d", lad->account_lock); if (lad->account_lock == 0) { register_dbus_service (lad->account_manager); g_slice_free (McdLoadAccountsData, lad); } } static void account_loaded (McdAccount *account, const GError *error, gpointer user_data) { McdLoadAccountsData *lad = user_data; if (error) { g_warning ("%s: got error: %s", G_STRFUNC, error->message); g_hash_table_remove (lad->account_manager->priv->accounts, mcd_account_get_unique_name (account)); } release_load_accounts_lock (lad); } static void uncork_storage_plugins (McdAccountManager *account_manager) { McdAccountManagerPrivate *priv = MCD_ACCOUNT_MANAGER_PRIV (account_manager); mcd_account_manager_write_conf_async (account_manager, NULL, NULL, NULL); mcd_storage_ready (priv->storage); } typedef struct { McdAccountManager *self; McdAccount *account; McdLoadAccountsData *lad; } MigrateCtx; static MigrateCtx * migrate_ctx_new (McdAccountManager *self, McdAccount *account, McdLoadAccountsData *lad) { MigrateCtx *ctx = g_slice_new (MigrateCtx); ctx->self = g_object_ref (self); ctx->account = g_object_ref (account); ctx->lad = lad; /* Lock attempting to migrate the account */ lad->account_lock++; return ctx; } static void migrate_ctx_free (MigrateCtx *ctx) { g_object_unref (ctx->self); g_object_unref (ctx->account); release_load_accounts_lock (ctx->lad); g_slice_free (MigrateCtx, ctx); } static void migrate_delete_account_cb (McdAccount *account, const GError *error, gpointer user_data) { MigrateCtx *ctx = user_data; migrate_ctx_free (ctx); } static void migrate_create_account_cb (McdAccountManager *account_manager, McdAccount *account, const GError *error, gpointer user_data) { MigrateCtx *ctx = user_data; if (error != NULL) { DEBUG ("Failed to create account: %s", error->message); _mcd_account_set_enabled (ctx->account, FALSE, TRUE, MCD_DBUS_PROP_SET_FLAG_NONE, NULL); migrate_ctx_free (ctx); return; } DEBUG ("Account %s migrated, removing it", mcd_account_get_unique_name (ctx->account)); mcd_account_delete (ctx->account, migrate_delete_account_cb, ctx); } static void migrate_butterfly_haze_ready (McdManager *manager, const GError *error, gpointer user_data) { MigrateCtx *ctx = user_data; gchar *display_name; GValue v = G_VALUE_INIT; GValue password_v = G_VALUE_INIT; GHashTable *parameters, *properties; gchar *str; GPtrArray *supersedes; GPtrArray *old_supersedes; if (error != NULL) { DEBUG ("Can't find Haze: %s", error->message); _mcd_account_set_enabled (ctx->account, FALSE, TRUE, MCD_DBUS_PROP_SET_FLAG_NONE, NULL); goto error; } /* Parameters; the only mandatory one is 'account' */ if (!mcd_account_get_parameter_of_known_type (ctx->account, "account", G_TYPE_STRING, &v, NULL)) { _mcd_account_set_enabled (ctx->account, FALSE, TRUE, MCD_DBUS_PROP_SET_FLAG_NONE, NULL); goto error; } parameters = g_hash_table_new (g_str_hash, g_str_equal); g_hash_table_insert (parameters, "account", &v); /* If MC is storing the password, let's copy that too, so Empathy * can migrate it somewhere better. */ if (mcd_account_get_parameter_of_known_type (ctx->account, "password", G_TYPE_STRING, &password_v, NULL)) { g_hash_table_insert (parameters, "password", &password_v); } display_name = mcd_account_dup_display_name (ctx->account); /* Properties */ properties = tp_asv_new (NULL, NULL); str = mcd_account_dup_icon (ctx->account); if (str != NULL) tp_asv_take_string (properties, TP_PROP_ACCOUNT_ICON, str); tp_asv_set_boolean (properties, TP_PROP_ACCOUNT_ENABLED, mcd_account_is_enabled (ctx->account)); str = mcd_account_dup_nickname (ctx->account); if (str != NULL) tp_asv_take_string (properties, TP_PROP_ACCOUNT_NICKNAME, str); supersedes = g_ptr_array_new (); old_supersedes = _mcd_account_get_supersedes (ctx->account); if (old_supersedes != NULL) { guint i; for (i = 0; i < old_supersedes->len; i++) g_ptr_array_add (supersedes, g_strdup (g_ptr_array_index (old_supersedes, i))); } g_ptr_array_add (supersedes, g_strdup (mcd_account_get_object_path (ctx->account))); tp_asv_take_boxed (properties, TP_PROP_ACCOUNT_SUPERSEDES, TP_ARRAY_TYPE_OBJECT_PATH_LIST, supersedes); /* Set the service while we're on it */ tp_asv_set_string (properties, TP_PROP_ACCOUNT_SERVICE, "windows-live"); _mcd_account_manager_create_account (ctx->self, "haze", "msn", display_name, parameters, properties, migrate_create_account_cb, ctx, NULL); g_value_unset (&v); g_free (display_name); g_hash_table_unref (parameters); g_hash_table_unref (properties); return; error: migrate_ctx_free (ctx); } static void butterfly_account_loaded (McdAccount *account, const GError *error, gpointer user_data) { MigrateCtx *ctx = user_data; McdMaster *master = mcd_master_get_default (); McdManager *manager; if (error != NULL) goto error; DEBUG ("Try migrating butterfly account %s", mcd_account_get_unique_name (account)); /* Check if Haze is installed */ manager = _mcd_master_lookup_manager (master, "haze"); if (manager == NULL) { DEBUG ("Can't find Haze"); _mcd_account_set_enabled (account, FALSE, TRUE, MCD_DBUS_PROP_SET_FLAG_NONE, NULL); goto error; } mcd_manager_call_when_ready (manager, migrate_butterfly_haze_ready, ctx); return; error: migrate_ctx_free (ctx); } static void migrate_butterfly_account (McdAccountManager *self, McdAccount *account, McdLoadAccountsData *lad) { MigrateCtx *ctx; ctx = migrate_ctx_new (self, account, lad); _mcd_account_load (account, butterfly_account_loaded, ctx); } /* Migrate some specific type of account. If something went wrong during the * migration we disable it. */ static void migrate_accounts (McdAccountManager *self, McdLoadAccountsData *lad) { McdAccountManagerPrivate *priv = self->priv; GHashTableIter iter; gpointer v; g_hash_table_iter_init (&iter, priv->accounts); while (g_hash_table_iter_next (&iter, NULL, &v)) { McdAccount *account = v; TpConnectionManager *cm; cm = mcd_account_get_cm (account); if (cm == NULL) continue; if (!tp_strdiff (tp_connection_manager_get_name (cm), "butterfly")) migrate_butterfly_account (self, account, lad); } } /** * _mcd_account_manager_setup: * @account_manager: the #McdAccountManager. * * This function must be called by the McdMaster; it reads the accounts from * the config file, and it needs a McdMaster instance to be active. */ void _mcd_account_manager_setup (McdAccountManager *account_manager) { McdAccountManagerPrivate *priv = account_manager->priv; McdStorage *storage = priv->storage; McdLoadAccountsData *lad; gchar **accounts, **name; GHashTableIter iter; gpointer v; tp_list_connection_names (priv->dbus_daemon, list_connection_names_cb, NULL, NULL, (GObject *)account_manager); lad = g_slice_new (McdLoadAccountsData); lad->account_manager = account_manager; lad->account_lock = 1; /* will be released at the end of this function */ accounts = mcd_storage_dup_accounts (storage, NULL); for (name = accounts; *name != NULL; name++) { gboolean plausible = FALSE; const gchar *manager = NULL; const gchar *protocol = NULL; McdAccount *account = mcd_account_manager_lookup_account ( account_manager, *name); if (account != NULL) { /* FIXME: this shouldn't really happen */ DEBUG ("already have account %p called '%s'; skipping", account, *name); continue; } account = mcd_account_new (account_manager, *name, priv->minotaur); if (G_UNLIKELY (!account)) { g_warning ("%s: account %s failed to instantiate", G_STRFUNC, *name); continue; } manager = mcd_account_get_manager_name (account); protocol = mcd_account_get_protocol_name (account); plausible = !tp_str_empty (manager) && !tp_str_empty (protocol); if (G_UNLIKELY (!plausible)) { const gchar *dbg_manager = (manager == NULL) ? "(nil)" : manager; const gchar *dbg_protocol = (protocol == NULL) ? "(nil)" : protocol; g_warning ("%s: account %s has implausible manager/protocol: %s/%s", G_STRFUNC, *name, dbg_manager, dbg_protocol); g_object_unref (account); continue; } lad->account_lock++; add_account (lad->account_manager, account, "keyfile"); _mcd_account_load (account, account_loaded, lad); g_object_unref (account); } g_strfreev (accounts); uncork_storage_plugins (account_manager); migrate_accounts (account_manager, lad); release_load_accounts_lock (lad); g_hash_table_iter_init (&iter, account_manager->priv->accounts); while (g_hash_table_iter_next (&iter, NULL, &v)) _mcd_account_maybe_autoconnect (v); } static void register_dbus_service (McdAccountManager *account_manager) { McdAccountManagerPrivate *priv = account_manager->priv; GError *error = NULL; if (priv->dbus_registered) return; if (!tp_dbus_daemon_request_name (priv->dbus_daemon, TP_ACCOUNT_MANAGER_BUS_NAME, TRUE /* idempotent */, &error)) { /* FIXME: put in proper error handling when MC gains the ability to * be the AM or the CD but not both */ g_warning("Failed registering '%s' service: %s", TP_ACCOUNT_MANAGER_BUS_NAME, error->message); g_error_free (error); exit (1); } priv->dbus_registered = TRUE; tp_dbus_daemon_register_object (priv->dbus_daemon, TP_ACCOUNT_MANAGER_OBJECT_PATH, account_manager); } static void set_property (GObject *obj, guint prop_id, const GValue *val, GParamSpec *pspec) { McdAccountManager *account_manager = MCD_ACCOUNT_MANAGER (obj); McdAccountManagerPrivate *priv = account_manager->priv; switch (prop_id) { case PROP_CLIENT_FACTORY: g_assert (priv->client_factory == NULL); /* construct-only */ priv->client_factory = TP_SIMPLE_CLIENT_FACTORY (g_value_dup_object (val)); priv->dbus_daemon = tp_simple_client_factory_get_dbus_daemon (priv->client_factory); g_object_ref (priv->dbus_daemon); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (obj, prop_id, pspec); break; } } static void get_property (GObject *obj, guint prop_id, GValue *val, GParamSpec *pspec) { McdAccountManagerPrivate *priv = MCD_ACCOUNT_MANAGER_PRIV (obj); switch (prop_id) { case PROP_DBUS_DAEMON: g_value_set_object (val, priv->dbus_daemon); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (obj, prop_id, pspec); break; } } static void _mcd_account_manager_finalize (GObject *object) { McdAccountManagerPrivate *priv = MCD_ACCOUNT_MANAGER_PRIV (object); if (write_conf_id) { write_conf (priv->storage); g_assert (write_conf_id == 0); } tp_clear_object (&priv->storage); g_free (priv->account_connections_dir); remove (priv->account_connections_file); g_free (priv->account_connections_file); g_hash_table_unref (priv->accounts); G_OBJECT_CLASS (mcd_account_manager_parent_class)->finalize (object); } static void _mcd_account_manager_dispose (GObject *object) { McdAccountManagerPrivate *priv = MCD_ACCOUNT_MANAGER_PRIV (object); tp_clear_object (&priv->dbus_daemon); tp_clear_object (&priv->client_factory); tp_clear_object (&priv->minotaur); G_OBJECT_CLASS (mcd_account_manager_parent_class)->dispose (object); } static void mcd_account_manager_class_init (McdAccountManagerClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); g_type_class_add_private (object_class, sizeof (McdAccountManagerPrivate)); object_class->dispose = _mcd_account_manager_dispose; object_class->finalize = _mcd_account_manager_finalize; object_class->set_property = set_property; object_class->get_property = get_property; object_class->constructed = _mcd_account_manager_constructed; g_object_class_install_property (object_class, PROP_DBUS_DAEMON, g_param_spec_object ("dbus-daemon", "DBus daemon", "DBus daemon", TP_TYPE_DBUS_DAEMON, G_PARAM_READABLE)); g_object_class_install_property (object_class, PROP_CLIENT_FACTORY, g_param_spec_object ("client-factory", "Client factory", "Client factory", TP_TYPE_SIMPLE_CLIENT_FACTORY, G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); } static const gchar * get_connections_cache_dir (void) { const gchar *from_env = g_getenv ("MC_ACCOUNT_DIR"); if (from_env != NULL) { return from_env; } if ((ACCOUNTS_CACHE_DIR)[0] != '\0') { return ACCOUNTS_CACHE_DIR; } return g_get_user_cache_dir (); } static void mcd_account_manager_init (McdAccountManager *account_manager) { McdAccountManagerPrivate *priv; priv = G_TYPE_INSTANCE_GET_PRIVATE ((account_manager), MCD_TYPE_ACCOUNT_MANAGER, McdAccountManagerPrivate); account_manager->priv = priv; } static void _mcd_account_manager_constructed (GObject *obj) { McdAccountManager *account_manager = MCD_ACCOUNT_MANAGER (obj); McdAccountManagerPrivate *priv = account_manager->priv; guint i = 0; static struct { const gchar *name; GCallback handler; } sig[] = { { "created", G_CALLBACK (created_cb) }, { "altered", G_CALLBACK (altered_cb) }, { "toggled", G_CALLBACK (toggled_cb) }, { "deleted", G_CALLBACK (deleted_cb) }, { "altered-one", G_CALLBACK (altered_one_cb) }, { "reconnect", G_CALLBACK (reconnect_cb) }, { NULL, NULL } }; DEBUG (""); priv->minotaur = mcd_connectivity_monitor_new (); priv->storage = mcd_storage_new (priv->dbus_daemon); priv->accounts = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, unref_account); priv->account_connections_dir = g_strdup (get_connections_cache_dir ()); priv->account_connections_file = g_build_filename (priv->account_connections_dir, ".mc_connections", NULL); DEBUG ("loading plugins"); mcd_storage_load (priv->storage); /* hook up all the storage plugin signals to their handlers: */ for (i = 0; sig[i].name != NULL; i++) { mcd_storage_connect_signal (sig[i].name, sig[i].handler, account_manager); } /* initializes the interfaces */ mcd_dbus_init_interfaces_instances (account_manager); } McdAccountManager * mcd_account_manager_new (TpSimpleClientFactory *client_factory) { gpointer *obj; obj = g_object_new (MCD_TYPE_ACCOUNT_MANAGER, "client-factory", client_factory, NULL); return MCD_ACCOUNT_MANAGER (obj); } /** * mcd_account_manager_get_dbus_daemon: * @account_manager: the #McdAccountManager. * * Returns: the #TpDBusDaemon. */ TpDBusDaemon * mcd_account_manager_get_dbus_daemon (McdAccountManager *account_manager) { g_return_val_if_fail (MCD_IS_ACCOUNT_MANAGER (account_manager), NULL); return account_manager->priv->dbus_daemon; } McdConnectivityMonitor * mcd_account_manager_get_connectivity_monitor (McdAccountManager *self) { g_return_val_if_fail (MCD_IS_ACCOUNT_MANAGER (self), NULL); return self->priv->minotaur; } /** * McdAccountManagerWriteConfCb: * @account_manager: the #McdAccountManager * @error: a set #GError on failure or %NULL if there was no error * @user_data: user data * * The callback from mcd_account_manager_write_conf_async(). If the config * writing was successful, @error will be %NULL, otherwise it will be set * with the appropriate error. */ /** * mcd_account_manager_write_conf_async: * @account_manager: the #McdAccountManager * @account: the account to be written, or %NULL to flush all accounts * @callback: a callback to be called on write success or failure * @user_data: data to be passed to @callback * * Write the account manager configuration to disk. */ void mcd_account_manager_write_conf_async (McdAccountManager *account_manager, McdAccount *account, McdAccountManagerWriteConfCb callback, gpointer user_data) { McdStorage *storage = NULL; const gchar *account_name = NULL; g_return_if_fail (MCD_IS_ACCOUNT_MANAGER (account_manager)); storage = account_manager->priv->storage; if (account != NULL) { account_name = mcd_account_get_unique_name (account); DEBUG ("updating %s", account_name); mcd_storage_commit (storage, account_name); } else { GStrv groups; gsize n_accounts = 0; groups = mcd_storage_dup_accounts (storage, &n_accounts); DEBUG ("updating all %" G_GSIZE_FORMAT " accounts", n_accounts); mcd_storage_commit (storage, NULL); g_strfreev (groups); } if (callback != NULL) callback (account_manager, NULL, user_data); } GHashTable * _mcd_account_manager_get_accounts (McdAccountManager *account_manager) { return account_manager->priv->accounts; } McdAccount * mcd_account_manager_lookup_account (McdAccountManager *account_manager, const gchar *name) { McdAccountManagerPrivate *priv = account_manager->priv; return g_hash_table_lookup (priv->accounts, name); } McdAccount * mcd_account_manager_lookup_account_by_path (McdAccountManager *account_manager, const gchar *object_path) { McdAccountManagerPrivate *priv = account_manager->priv; if (!g_str_has_prefix (object_path, TP_ACCOUNT_OBJECT_PATH_BASE)) { /* can't possibly be right */ return NULL; } return g_hash_table_lookup (priv->accounts, object_path + strlen (TP_ACCOUNT_OBJECT_PATH_BASE)); } /* * _mcd_account_manager_store_account_connections: * @account_manager: the #McdAccountManager. * * This function is used to remember what connection an account was bound to. * The data is stored in a temporary file, and can be read when MC restarts * after a crash. */ static void _mcd_account_manager_store_account_connections (McdAccountManager *manager) { McdAccountManagerPrivate *priv; GHashTableIter iter; const gchar *account_name, *connection_path, *connection_name; McdAccount *account; FILE *file; g_return_if_fail (MCD_IS_ACCOUNT_MANAGER (manager)); priv = manager->priv; /* make $XDG_CACHE_DIR (or whatever) if it doesn't exist */ g_mkdir_with_parents (priv->account_connections_dir, 0700); _mcd_chmod_private (priv->account_connections_dir); file = fopen (priv->account_connections_file, "w"); if (G_UNLIKELY (!file)) return; g_hash_table_iter_init (&iter, priv->accounts); while (g_hash_table_iter_next (&iter, (gpointer)&account_name, (gpointer)&account)) { McdConnection *connection; connection = mcd_account_get_connection (account); if (connection) { connection_path = mcd_connection_get_object_path (connection); connection_name = mcd_connection_get_name (connection); if (connection_path && connection_name) fprintf (file, "%s\t%s\t%s\n", connection_path, connection_name, account_name); } } fclose (file); } McdStorage * mcd_account_manager_get_storage (McdAccountManager *account_manager) { return account_manager->priv->storage; } telepathy-mission-control-5.16.4/src/mcd-connection-service-points.h0000644000175000017500000000221312735241312026623 0ustar00gkiagiagkiagia00000000000000/* * This file is part of mission-control * * Copyright © 2011 Nokia Corporation. * Copyright © 2011 Collabora Ltd. * * Contact: Vivek Dasmohapatra * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * version 2.1 as published by the Free Software Foundation. * * This library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA * */ #ifndef MCD_CONNECTION_SERVICE_POINTS_H #define MCD_CONNECTION_SERVICE_POINTS_H #include #include #include "mcd-connection.h" G_BEGIN_DECLS G_GNUC_INTERNAL void mcd_connection_service_point_setup ( McdConnection *connection, gboolean watch); G_END_DECLS #endif telepathy-mission-control-5.16.4/src/mcd-storage-ag-hidden.c0000644000175000017500000000610412735242352025001 0ustar00gkiagiagkiagia00000000000000/* * storage-ag-hidden.c - account backend for "magic" hidden accounts using * accounts-glib * Copyright ©2011 Collabora Ltd. * Copyright ©2011 Nokia Corporation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "config.h" #include "mcd-storage-ag-hidden.h" #include #include "mcd-debug.h" /* FIXME: if we weren't in-tree, we wouldn't be able to include this header and * we'd have to re-hardcode magic strings like "Hidden". */ #include "mcd-account-config.h" static void account_storage_iface_init ( McpAccountStorageIface *iface, gpointer unused G_GNUC_UNUSED); G_DEFINE_TYPE_WITH_CODE (McdStorageAgHidden, mcd_storage_ag_hidden, MCD_TYPE_ACCOUNT_MANAGER_SSO, G_IMPLEMENT_INTERFACE (MCP_TYPE_ACCOUNT_STORAGE, account_storage_iface_init); ); static void mcd_storage_ag_hidden_init (McdStorageAgHidden *self) { } static void mcd_storage_ag_hidden_class_init (McdStorageAgHiddenClass *klass) { McdAccountManagerSsoClass *super = MCD_ACCOUNT_MANAGER_SSO_CLASS (klass); super->service_type = ACCOUNTS_GLIB_HIDDEN_SERVICE_TYPE; } static gboolean _mcd_storage_ag_hidden_get ( const McpAccountStorage *self, const McpAccountManager *am, const gchar *account_suffix, const gchar *key) { /* Chain up to the real implementation, checking whether this is an account * we care about in the process. */ if (!_mcd_account_manager_sso_get (self, am, account_suffix, key)) return FALSE; /* If the caller is looking for the "Hidden" key (or NULL, which means * everything), let's fill it in. (Every account this plugin cares about * should be hidden.) */ if (key == NULL || !tp_strdiff (key, MC_ACCOUNTS_KEY_HIDDEN)) mcp_account_manager_set_value (am, account_suffix, MC_ACCOUNTS_KEY_HIDDEN, "true"); return TRUE; } static void account_storage_iface_init ( McpAccountStorageIface *iface, gpointer unused G_GNUC_UNUSED) { mcp_account_storage_iface_set_name (iface, "maemo-libaccounts-hidden"); mcp_account_storage_iface_set_desc (iface, "Loads accounts with service type '" ACCOUNTS_GLIB_HIDDEN_SERVICE_TYPE "' from accounts-glib, and marks them as Hidden"); mcp_account_storage_iface_implement_get (iface, _mcd_storage_ag_hidden_get); } McdStorageAgHidden * mcd_storage_ag_hidden_new () { return g_object_new (MCD_TYPE_STORAGE_AG_HIDDEN, NULL); } telepathy-mission-control-5.16.4/src/mcd-dispatch-operation.c0000644000175000017500000025067312762341010025317 0ustar00gkiagiagkiagia00000000000000/* vi: set et sw=4 ts=4 cino=t0,(0: */ /* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * This file is part of mission-control * * Copyright © 2008-2011 Nokia Corporation. * Copyright © 2009-2011 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * version 2.1 as published by the Free Software Foundation. * * This library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA * */ #include "config.h" #include "mcd-dispatch-operation-priv.h" #include #include #include #include #include #include #include #include "channel-utils.h" #include "mcd-channel-priv.h" #include "mcd-dbusprop.h" #include "mcd-master-priv.h" #include "mcd-misc.h" #include "plugin-dispatch-operation.h" #include "plugin-loader.h" #define MCD_DISPATCH_OPERATION_PRIV(operation) (MCD_DISPATCH_OPERATION (operation)->priv) static void dispatch_operation_iface_init (TpSvcChannelDispatchOperationClass *iface, gpointer iface_data); static void properties_iface_init (TpSvcDBusPropertiesClass *iface, gpointer iface_data); static const McdDBusProp dispatch_operation_properties[]; static const McdInterfaceData dispatch_operation_interfaces[] = { MCD_IMPLEMENT_IFACE (tp_svc_channel_dispatch_operation_get_type, dispatch_operation, TP_IFACE_CHANNEL_DISPATCH_OPERATION), { NULL, } }; G_DEFINE_TYPE_WITH_CODE (McdDispatchOperation, _mcd_dispatch_operation, G_TYPE_OBJECT, MCD_DBUS_INIT_INTERFACES (dispatch_operation_interfaces); G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_DBUS_PROPERTIES, properties_iface_init); ) typedef enum { APPROVAL_TYPE_REQUESTED, APPROVAL_TYPE_HANDLE_WITH, APPROVAL_TYPE_CLAIM, APPROVAL_TYPE_CHANNELS_LOST, APPROVAL_TYPE_NO_APPROVERS } ApprovalType; typedef struct { ApprovalType type; /* NULL unless type is REQUESTED or HANDLE_WITH; may be NULL even in those * cases, to signify "any handler will do" */ gchar *client_bus_name; /* NULL unless type is CLAIM or HANDLE_WITH */ DBusGMethodInvocation *context; } Approval; static Approval * approval_new_handle_with (const gchar *client_bus_name, DBusGMethodInvocation *context) { Approval *approval = g_slice_new0 (Approval); g_assert (context != NULL); if (client_bus_name != NULL && client_bus_name[0] != '\0') approval->client_bus_name = g_strdup (client_bus_name); approval->type = APPROVAL_TYPE_HANDLE_WITH; approval->context = context; return approval; } static Approval * approval_new_claim (DBusGMethodInvocation *context) { Approval *approval = g_slice_new0 (Approval); g_assert (context != NULL); approval->type = APPROVAL_TYPE_CLAIM; approval->context = context; return approval; } static Approval * approval_new_requested (const gchar *preferred_bus_name) { Approval *approval = g_slice_new0 (Approval); if (preferred_bus_name != NULL && preferred_bus_name[0] != '\0') approval->client_bus_name = g_strdup (preferred_bus_name); approval->type = APPROVAL_TYPE_REQUESTED; return approval; } static Approval * approval_new (ApprovalType type) { Approval *approval = g_slice_new0 (Approval); switch (type) { case APPROVAL_TYPE_CLAIM: case APPROVAL_TYPE_HANDLE_WITH: case APPROVAL_TYPE_REQUESTED: g_assert_not_reached (); default: {} /* do nothing */ } approval->type = type; return approval; } static void approval_free (Approval *approval) { /* we should have replied to the method call by now */ g_assert (approval->context == NULL); g_free (approval->client_bus_name); g_slice_free (Approval, approval); } struct _McdDispatchOperationPrivate { const gchar *unique_name; /* borrowed from object_path */ gchar *object_path; GStrv possible_handlers; GHashTable *properties; /* If FALSE, we're not actually on D-Bus; an object path is reserved, * but we're inaccessible. */ guint needs_approval : 1; /* set of handlers we already tried * dup'd bus name (string) => dummy non-NULL pointer */ GHashTable *failed_handlers; /* if non-NULL, we will emit finished as soon as we can; on success, * this is NotYours, and on failure, it's something else */ GError *result; /* The time of the latest call to HandleWith(), for focus-stealing * prevention. * * This is shared between calls, so if the user makes contradictory * choices, like HandleWith("...Empathy") and HandleWith("...Kopete") in * quick succession, the channel will be handled with Empathy, but the * timestamp for focus-stealing purposes will be that of the call that * wanted Kopete; we consider this to be reasonable, since the user did * expect *something* to happen at the time of the second call. */ gint64 handle_with_time; /* queue of Approval */ GQueue *approvals; /* if not NULL, the handler that accepted it */ TpClient *successful_handler; /* Reference to a global handler map */ McdHandlerMap *handler_map; /* Reference to a global registry of clients */ McdClientRegistry *client_registry; McdAccount *account; McdConnection *connection; /* Owned McdChannel we're dispatching */ McdChannel *channel; /* If non-NULL, we have lost the McdChannel but can't emit * ChannelLost yet */ McdChannel *lost_channel; /* If TRUE, either the channel being dispatched was requested, or it * was pre-approved by being returned as a response to another request, * or a client approved processing with arbitrary handlers */ gboolean approved; /* If TRUE, at least one Approver accepted this dispatch operation, and * we're waiting for one of them to call HandleWith or Claim. */ gboolean accepted_by_an_approver; /* If FALSE, we're still working out what Observers and/or Approvers to * run. These are temporary client locks. */ gboolean invoked_observers_if_needed; gboolean invoked_approvers_if_needed; /* The number of observers that have not yet returned from ObserveChannels. * Until they have done so, we can't allow the dispatch operation to * finish. This is a client lock. * * A reference is held for each pending observer. */ gsize observers_pending; /* The number of observers that are pending which have * DelayApprovers=TRUE. This is used to know if * AddDispatchOperation can be called yet. */ gsize delay_approver_observers_pending; /* The number of approvers that have not yet returned from * AddDispatchOperation. Until they have done so, we can't allow the * dispatch operation to finish. This is a client lock. * * A reference is held for each pending approver. */ gsize ado_pending; /* The number of plugins whose decision we're waiting for, * regarding whether a handler is in fact suitable. */ gsize handler_suitable_pending; /* If non-NULL, a plugin has decided the selected handler is unsuitable. */ GError *handler_unsuitable; /* If TRUE, we're dispatching a channel request and it was cancelled */ gboolean cancelled; /* if TRUE, this channel was requested "behind our back", so stop * after observers */ gboolean observe_only; /* If non-NULL, we're in the middle of asking plugins whether we may call * HandleChannels, or doing so. This is a client lock. */ McdClientProxy *trying_handler; /* If TRUE, we've tried all the BypassApproval handlers, which happens * before we run approvers. */ gboolean tried_handlers_before_approval; McdPluginDispatchOperation *plugin_api; gsize plugins_pending; gboolean did_post_observer_actions; }; static void _mcd_dispatch_operation_check_finished ( McdDispatchOperation *self); static void _mcd_dispatch_operation_finish (McdDispatchOperation *, GQuark domain, gint code, const gchar *format, ...) G_GNUC_PRINTF (4, 5); static void _mcd_dispatch_operation_check_client_locks ( McdDispatchOperation *self); /* To give clients time to connect to our "destructive" signals (ChannelLost * and Finished), we guarantee not to emit them if we have called methods on * an observer or approver, but they have not returned. * * Returns: TRUE if we may emit Finished or ChannelLost */ static inline gboolean mcd_dispatch_operation_may_signal_finished (McdDispatchOperation *self) { return (self->priv->invoked_observers_if_needed && self->priv->observers_pending == 0 && self->priv->ado_pending == 0); } static void _mcd_dispatch_operation_inc_observers_pending (McdDispatchOperation *self, McdClientProxy *client) { g_return_if_fail (self->priv->result == NULL); g_object_ref (self); DEBUG ("%" G_GSIZE_FORMAT " -> %" G_GSIZE_FORMAT, self->priv->observers_pending, self->priv->observers_pending + 1); self->priv->observers_pending++; if (_mcd_client_proxy_get_delay_approvers (client)) self->priv->delay_approver_observers_pending++; } static void _mcd_dispatch_operation_dec_observers_pending (McdDispatchOperation *self, McdClientProxy *client) { DEBUG ("%" G_GSIZE_FORMAT " -> %" G_GSIZE_FORMAT, self->priv->observers_pending, self->priv->observers_pending - 1); g_return_if_fail (self->priv->observers_pending > 0); self->priv->observers_pending--; if (_mcd_client_proxy_get_delay_approvers (client)) self->priv->delay_approver_observers_pending--; _mcd_dispatch_operation_check_finished (self); _mcd_dispatch_operation_check_client_locks (self); g_object_unref (self); } static void _mcd_dispatch_operation_inc_ado_pending (McdDispatchOperation *self) { g_return_if_fail (self->priv->result == NULL); g_object_ref (self); DEBUG ("%" G_GSIZE_FORMAT " -> %" G_GSIZE_FORMAT, self->priv->ado_pending, self->priv->ado_pending + 1); self->priv->ado_pending++; } static void _mcd_dispatch_operation_dec_ado_pending (McdDispatchOperation *self) { DEBUG ("%" G_GSIZE_FORMAT " -> %" G_GSIZE_FORMAT, self->priv->ado_pending, self->priv->ado_pending - 1); g_return_if_fail (self->priv->ado_pending > 0); self->priv->ado_pending--; _mcd_dispatch_operation_check_finished (self); if (self->priv->ado_pending == 0 && !self->priv->accepted_by_an_approver) { DEBUG ("No approver accepted the channel; considering it to be " "approved"); g_queue_push_tail (self->priv->approvals, approval_new (APPROVAL_TYPE_NO_APPROVERS)); } _mcd_dispatch_operation_check_client_locks (self); g_object_unref (self); } gboolean _mcd_dispatch_operation_get_cancelled (McdDispatchOperation *self) { g_return_val_if_fail (MCD_IS_DISPATCH_OPERATION (self), FALSE); return self->priv->cancelled; } gboolean _mcd_dispatch_operation_is_internal (McdDispatchOperation *self) { GStrv handlers = self->priv->possible_handlers; return (handlers != NULL && !tp_strdiff (CDO_INTERNAL_HANDLER, *handlers)); } static inline gboolean _mcd_dispatch_operation_is_approved (McdDispatchOperation *self) { return (!self->priv->needs_approval || !g_queue_is_empty (self->priv->approvals)); } static gboolean _mcd_dispatch_operation_try_next_handler ( McdDispatchOperation *self); static void _mcd_dispatch_operation_close_as_undispatchable ( McdDispatchOperation *self, const GError *error); static gboolean mcd_dispatch_operation_idle_run_approvers (gpointer p); static void mcd_dispatch_operation_set_channel_handled_by ( McdDispatchOperation *self, McdChannel *channel, const gchar *unique_name, const gchar *well_known_name); static gboolean _mcd_dispatch_operation_handlers_can_bypass_approval ( McdDispatchOperation *self); static gboolean _mcd_dispatch_operation_handlers_can_bypass_observers ( McdDispatchOperation *self); static void _mcd_dispatch_operation_check_client_locks (McdDispatchOperation *self) { Approval *approval; guint approver_event_id = 0; if (!self->priv->invoked_observers_if_needed) { DEBUG ("waiting for Observers to be called"); return; } if (self->priv->plugins_pending > 0) { DEBUG ("waiting for plugins to stop delaying"); return; } /* Check whether plugins' requests to close channels later should be * honoured. We want to do this before running Approvers (if any). */ if (self->priv->observers_pending == 0 && !self->priv->did_post_observer_actions) { _mcd_plugin_dispatch_operation_observers_finished ( self->priv->plugin_api); self->priv->did_post_observer_actions = TRUE; } /* If nobody is bypassing approval, then we want to run approvers as soon * as possible, without waiting for observers, to improve responsiveness. * (The regression test dispatcher/exploding-bundles.py asserts that we * do this.) * * However, if a handler bypasses approval, we must wait til the observers * return, then run that handler, then proceed with the other handlers. */ if (!self->priv->tried_handlers_before_approval && !_mcd_dispatch_operation_handlers_can_bypass_approval (self) && self->priv->delay_approver_observers_pending == 0 && self->priv->channel != NULL && ! _mcd_plugin_dispatch_operation_will_terminate ( self->priv->plugin_api)) { self->priv->tried_handlers_before_approval = TRUE; approver_event_id = g_idle_add_full (G_PRIORITY_HIGH, mcd_dispatch_operation_idle_run_approvers, g_object_ref (self), g_object_unref); } /* we may not continue until we've called all the Observers, and they've * all replied "I'm ready" */ if (self->priv->observers_pending > 0) { return; } /* if we've called the first Approver, we may not continue until we've * called them all, and they all replied "I'm ready" */ if (self->priv->ado_pending > 0) { DEBUG ("waiting for AddDispatchOperation to return"); return; } /* if we've called one Handler, we may not continue until it responds * with an error */ if (self->priv->trying_handler != NULL) { DEBUG ("waiting for handler_is_suitable or HandleChannels to return"); return; } /* if a handler has claimed or accepted the channel, we have nothing to * do */ if (self->priv->result != NULL) { DEBUG ("already finished (or finishing): %s", self->priv->result->message); return; } /* If we're only meant to be observing, do nothing */ if (self->priv->observe_only) { DEBUG ("only observing"); return; } if (_mcd_dispatch_operation_is_internal (self)) { DEBUG ("Invoking internal handlers for requests"); if (self->priv->channel != NULL) { McdChannel *channel = self->priv->channel; McdRequest *request = _mcd_channel_get_request (channel); if (request != NULL) { DEBUG ("Internal handler for request channel"); _mcd_handler_map_set_channel_handled_internally ( self->priv->handler_map, mcd_channel_get_tp_channel (channel), _mcd_dispatch_operation_get_account_path (self)); _mcd_request_handle_internally (request, channel, TRUE); } } /* The rest of this function deals with externally handled requests: * * Since these requests were internal, we need not trouble ourselves * * further (and infact would probably trigger errors if we tried) */ return; } /* If there are no potential handlers, the story ends here: we don't * want to run approvers in this case */ if (self->priv->possible_handlers == NULL) { GError incapable = { TP_ERROR, TP_ERROR_NOT_CAPABLE, "No possible handlers, giving up" }; DEBUG ("%s", incapable.message); _mcd_dispatch_operation_close_as_undispatchable (self, &incapable); return; } approval = g_queue_peek_head (self->priv->approvals); /* if we've been claimed, respond, then do not call HandleChannels */ if (approval != NULL && approval->type == APPROVAL_TYPE_CLAIM) { gchar *caller = dbus_g_method_get_sender (approval->context); /* remove this approval from the list, so it won't be treated as a * failure */ g_queue_pop_head (self->priv->approvals); if (self->priv->channel != NULL) { McdChannel *channel = self->priv->channel; mcd_dispatch_operation_set_channel_handled_by (self, channel, caller, NULL); } DEBUG ("Replying to Claim call from %s", caller); tp_svc_channel_dispatch_operation_return_from_claim ( approval->context); approval->context = NULL; _mcd_dispatch_operation_finish (self, TP_ERROR, TP_ERROR_NOT_YOURS, "Channel successfully claimed by %s", caller); g_free (caller); if (approver_event_id > 0) { DEBUG ("Cancelling call to approvers as dispatch operation has been Claimed"); g_source_remove (approver_event_id); } approval_free (approval); return; } else if (approval != NULL && approval->type == APPROVAL_TYPE_HANDLE_WITH) { /* We set this to TRUE so that the handlers are called. */ self->priv->invoked_approvers_if_needed = TRUE; if (approver_event_id > 0) { DEBUG ("Cancelling call to approvers as dispatch operation has been HandledWith'd"); g_source_remove (approver_event_id); } } if (self->priv->invoked_approvers_if_needed) { if (_mcd_dispatch_operation_is_approved (self)) { DEBUG ("trying next handler"); if (!_mcd_dispatch_operation_try_next_handler (self)) { GError incapable = { TP_ERROR, TP_ERROR_NOT_CAPABLE, "No possible handler still exists, giving up" }; DEBUG ("ran out of handlers"); _mcd_dispatch_operation_close_as_undispatchable (self, &incapable); } } else { DEBUG ("waiting for approval"); } } else if (!self->priv->tried_handlers_before_approval) { DEBUG ("trying next pre-approval handler"); if (!_mcd_dispatch_operation_try_next_handler (self)) { DEBUG ("ran out of pre-approval handlers"); self->priv->tried_handlers_before_approval = TRUE; g_idle_add_full (G_PRIORITY_HIGH, mcd_dispatch_operation_idle_run_approvers, g_object_ref (self), g_object_unref); } } } enum { PROP_0, PROP_CHANNEL, PROP_CLIENT_REGISTRY, PROP_HANDLER_MAP, PROP_POSSIBLE_HANDLERS, PROP_NEEDS_APPROVAL, PROP_OBSERVE_ONLY, }; /* * _mcd_dispatch_operation_get_connection_path: * @self: the #McdDispatchOperation. * * Returns: the D-Bus object path of the Connection associated with @self, * or "/" if none. */ const gchar * _mcd_dispatch_operation_get_connection_path (McdDispatchOperation *self) { const gchar *path; g_return_val_if_fail (MCD_IS_DISPATCH_OPERATION (self), "/"); if (self->priv->connection == NULL) return "/"; path = mcd_connection_get_object_path (self->priv->connection); g_return_val_if_fail (path != NULL, "/"); return path; } static void get_connection (TpSvcDBusProperties *self, const gchar *name, GValue *value) { McdDispatchOperationPrivate *priv = MCD_DISPATCH_OPERATION_PRIV (self); DEBUG ("called for %s", priv->unique_name); g_value_init (value, DBUS_TYPE_G_OBJECT_PATH); g_value_set_boxed (value, _mcd_dispatch_operation_get_connection_path ( MCD_DISPATCH_OPERATION (self))); } const gchar * _mcd_dispatch_operation_get_cm_name (McdDispatchOperation *self) { const gchar *ret; g_return_val_if_fail (MCD_IS_DISPATCH_OPERATION (self), NULL); g_return_val_if_fail (self->priv->account != NULL, NULL); ret = mcd_account_get_manager_name (self->priv->account); g_return_val_if_fail (ret != NULL, NULL); return ret; } const gchar * _mcd_dispatch_operation_get_protocol (McdDispatchOperation *self) { const gchar *ret; g_return_val_if_fail (MCD_IS_DISPATCH_OPERATION (self), NULL); g_return_val_if_fail (self->priv->account != NULL, NULL); ret = mcd_account_get_protocol_name (self->priv->account); g_return_val_if_fail (ret != NULL, NULL); return ret; } /* * _mcd_dispatch_operation_get_account_path: * @operation: the #McdDispatchOperation. * * Returns: the D-Bus object path of the Account associated with @operation, * or "/" if none. */ const gchar * _mcd_dispatch_operation_get_account_path (McdDispatchOperation *self) { const gchar *path; g_return_val_if_fail (MCD_IS_DISPATCH_OPERATION (self), "/"); if (self->priv->account == NULL) return "/"; path = mcd_account_get_object_path (self->priv->account); g_return_val_if_fail (path != NULL, "/"); return path; } static void get_account (TpSvcDBusProperties *self, const gchar *name, GValue *value) { g_value_init (value, DBUS_TYPE_G_OBJECT_PATH); g_value_set_boxed (value, _mcd_dispatch_operation_get_account_path (MCD_DISPATCH_OPERATION (self))); } static void get_channels (TpSvcDBusProperties *iface, const gchar *name, GValue *value) { McdDispatchOperation *self = MCD_DISPATCH_OPERATION (iface); DEBUG ("called for %s", self->priv->unique_name); g_value_init (value, TP_ARRAY_TYPE_CHANNEL_DETAILS_LIST); if (self->priv->channel == NULL) { g_value_take_boxed (value, g_ptr_array_sized_new (0)); return; } g_value_take_boxed (value, _mcd_tp_channel_details_build_from_tp_chan ( mcd_channel_get_tp_channel (self->priv->channel))); } static void get_possible_handlers (TpSvcDBusProperties *self, const gchar *name, GValue *value) { McdDispatchOperationPrivate *priv = MCD_DISPATCH_OPERATION_PRIV (self); DEBUG ("called for %s", priv->unique_name); g_value_init (value, G_TYPE_STRV); g_value_set_boxed (value, priv->possible_handlers); } static const McdDBusProp dispatch_operation_properties[] = { { "Interfaces", NULL, mcd_dbus_get_interfaces }, { "Connection", NULL, get_connection }, { "Account", NULL, get_account }, { "Channels", NULL, get_channels }, { "PossibleHandlers", NULL, get_possible_handlers }, { 0 }, }; static void properties_iface_init (TpSvcDBusPropertiesClass *iface, gpointer iface_data) { #define IMPLEMENT(x) tp_svc_dbus_properties_implement_##x (\ iface, dbusprop_##x) IMPLEMENT(set); IMPLEMENT(get); IMPLEMENT(get_all); #undef IMPLEMENT } static void mcd_dispatch_operation_set_channel_handled_by (McdDispatchOperation *self, McdChannel *channel, const gchar *unique_name, const gchar *well_known_name) { TpChannel *tp_channel; g_assert (unique_name != NULL); tp_channel = mcd_channel_get_tp_channel (channel); g_return_if_fail (tp_channel != NULL); _mcd_channel_set_status (channel, MCD_CHANNEL_STATUS_DISPATCHED); _mcd_handler_map_set_channel_handled (self->priv->handler_map, tp_channel, unique_name, well_known_name, _mcd_dispatch_operation_get_account_path (self)); } static void mcd_dispatch_operation_actually_finish (McdDispatchOperation *self) { g_object_ref (self); DEBUG ("%s/%p: finished", self->priv->unique_name, self); tp_svc_channel_dispatch_operation_emit_finished (self); _mcd_dispatch_operation_check_client_locks (self); g_object_unref (self); } static void _mcd_dispatch_operation_finish (McdDispatchOperation *operation, GQuark domain, gint code, const gchar *format, ...) { McdDispatchOperationPrivate *priv = operation->priv; Approval *approval; const gchar *successful_handler = NULL; va_list ap; if (priv->successful_handler != NULL) { successful_handler = tp_proxy_get_bus_name (priv->successful_handler); } if (priv->result != NULL) { DEBUG ("already finished (or about to): %s", priv->result->message); return; } va_start (ap, format); priv->result = g_error_new_valist (domain, code, format, ap); va_end (ap); DEBUG ("Result: %s", priv->result->message); for (approval = g_queue_pop_head (priv->approvals); approval != NULL; approval = g_queue_pop_head (priv->approvals)) { gchar *caller; switch (approval->type) { case APPROVAL_TYPE_CLAIM: /* someone else got it - either another Claim() or a handler */ g_assert (approval->context != NULL); caller = dbus_g_method_get_sender (approval->context); DEBUG ("denying Claim call from %s", caller); g_free (caller); dbus_g_method_return_error (approval->context, priv->result); approval->context = NULL; break; case APPROVAL_TYPE_HANDLE_WITH: g_assert (approval->context != NULL); if (successful_handler != NULL) { /* Some Handler got it. If this Approver would have been * happy with that Handler, then it succeeds, otherwise, * it loses. */ if (approval->client_bus_name == NULL || !tp_strdiff (approval->client_bus_name, successful_handler)) { DEBUG ("successful HandleWith, channel went to %s", successful_handler); /* HandleWith and HandleWithTime both return void, so * it's OK to not distinguish */ tp_svc_channel_dispatch_operation_return_from_handle_with ( approval->context); approval->context = NULL; } else { DEBUG ("HandleWith -> NotYours: wanted %s but " "%s got it instead", approval->client_bus_name, successful_handler); dbus_g_method_return_error (approval->context, priv->result); approval->context = NULL; } } else { /* Handling finished for some other reason: perhaps the * channel was claimed, or perhaps it closed or we were * told to forget about it. */ DEBUG ("HandleWith -> error: %s %d: %s", g_quark_to_string (priv->result->domain), priv->result->code, priv->result->message); dbus_g_method_return_error (approval->context, priv->result); approval->context = NULL; } break; default: { /* there shouldn't be a dbus context for these: */ g_assert (approval->context == NULL); } } approval_free (approval); } if (mcd_dispatch_operation_may_signal_finished (operation)) { DEBUG ("%s/%p has finished", priv->unique_name, operation); mcd_dispatch_operation_actually_finish (operation); } else { DEBUG ("%s/%p not finishing just yet: " "waiting for %" G_GSIZE_FORMAT " observers, " "%" G_GSIZE_FORMAT " approvers", priv->unique_name, operation, priv->observers_pending, priv->ado_pending); } } static gboolean mcd_dispatch_operation_check_handle_with ( McdDispatchOperation *self, const gchar *handler_name, GError **error); static void dispatch_operation_handle_with_time (TpSvcChannelDispatchOperation *cdo, const gchar *handler_name, gint64 user_action_timestamp, DBusGMethodInvocation *context) { GError *error = NULL; McdDispatchOperation *self = MCD_DISPATCH_OPERATION (cdo); DEBUG ("%s/%p", self->priv->unique_name, self); if (!mcd_dispatch_operation_check_handle_with (self, handler_name, &error)) { dbus_g_method_return_error (context, error); g_error_free (error); return; } self->priv->handle_with_time = user_action_timestamp; g_queue_push_tail (self->priv->approvals, approval_new_handle_with (handler_name, context)); _mcd_dispatch_operation_check_client_locks (self); } static void dispatch_operation_handle_with (TpSvcChannelDispatchOperation *cdo, const gchar *handler_name, DBusGMethodInvocation *context) { dispatch_operation_handle_with_time (cdo, handler_name, TP_USER_ACTION_TIME_NOT_USER_ACTION, context); } typedef struct { McdDispatchOperation *self; DBusGMethodInvocation *context; gsize handler_suitable_pending; } ClaimAttempt; static void claim_attempt_resolve (ClaimAttempt *claim_attempt) { if (claim_attempt->context != NULL) { g_queue_push_tail (claim_attempt->self->priv->approvals, approval_new_claim (claim_attempt->context)); _mcd_dispatch_operation_check_client_locks (claim_attempt->self); } g_object_unref (claim_attempt->self); g_slice_free (ClaimAttempt, claim_attempt); } static void claim_attempt_suitability_cb (GObject *source, GAsyncResult *res, gpointer user_data) { ClaimAttempt *claim_attempt = user_data; GError *error = NULL; if (!mcp_dispatch_operation_policy_handler_is_suitable_finish ( MCP_DISPATCH_OPERATION_POLICY (source), res, &error)) { if (claim_attempt->context != NULL) dbus_g_method_return_error (claim_attempt->context, error); claim_attempt->context = NULL; g_error_free (error); } if (--claim_attempt->handler_suitable_pending == 0) { DEBUG ("all plugins have finished, resolving claim attempt"); claim_attempt_resolve (claim_attempt); } } static void dispatch_operation_claim (TpSvcChannelDispatchOperation *cdo, DBusGMethodInvocation *context) { McdDispatchOperation *self = MCD_DISPATCH_OPERATION (cdo); ClaimAttempt *claim_attempt; gchar *sender = dbus_g_method_get_sender (context); McpDispatchOperation *plugin_api = MCP_DISPATCH_OPERATION ( self->priv->plugin_api); const GList *p; if (self->priv->result != NULL) { DEBUG ("Giving error to %s: %s", sender, self->priv->result->message); dbus_g_method_return_error (context, self->priv->result); goto finally; } claim_attempt = g_slice_new0 (ClaimAttempt); claim_attempt->self = g_object_ref (self); claim_attempt->context = context; claim_attempt->handler_suitable_pending = 0; for (p = mcp_list_objects (); p != NULL; p = g_list_next (p)) { if (MCP_IS_DISPATCH_OPERATION_POLICY (p->data)) { McpDispatchOperationPolicy *plugin = p->data; DEBUG ("%s: checking policy for %s", G_OBJECT_TYPE_NAME (plugin), sender); claim_attempt->handler_suitable_pending++; mcp_dispatch_operation_policy_handler_is_suitable_async (plugin, NULL, sender, plugin_api, claim_attempt_suitability_cb, claim_attempt); } } if (claim_attempt->handler_suitable_pending == 0) claim_attempt_resolve (claim_attempt); finally: g_free (sender); } static void dispatch_operation_iface_init (TpSvcChannelDispatchOperationClass *iface, gpointer iface_data) { #define IMPLEMENT(x) tp_svc_channel_dispatch_operation_implement_##x (\ iface, dispatch_operation_##x) IMPLEMENT(handle_with); IMPLEMENT(claim); IMPLEMENT(handle_with_time); #undef IMPLEMENT } static void create_object_path (McdDispatchOperationPrivate *priv) { static guint cpt = 0; priv->object_path = g_strdup_printf (MC_DISPATCH_OPERATION_DBUS_OBJECT_BASE "do%u", cpt++); priv->unique_name = priv->object_path + (sizeof (MC_DISPATCH_OPERATION_DBUS_OBJECT_BASE) - 1); } static GObject * mcd_dispatch_operation_constructor (GType type, guint n_params, GObjectConstructParam *params) { GObjectClass *object_class = (GObjectClass *)_mcd_dispatch_operation_parent_class; GObject *object; McdDispatchOperation *operation; McdDispatchOperationPrivate *priv; object = object_class->constructor (type, n_params, params); operation = MCD_DISPATCH_OPERATION (object); g_return_val_if_fail (operation != NULL, NULL); priv = operation->priv; if (!priv->client_registry || !priv->handler_map || !priv->channel) goto error; if (priv->needs_approval && priv->observe_only) { g_critical ("observe_only => needs_approval must not be TRUE"); goto error; } create_object_path (priv); DEBUG ("%s/%p: needs_approval=%c", priv->unique_name, object, priv->needs_approval ? 'T' : 'F'); if (priv->channel != NULL) { DEBUG ("Channel: %s", mcd_channel_get_object_path (priv->channel)); g_assert (mcd_channel_get_account (priv->channel) == priv->account); } /* If approval is not needed, we don't appear on D-Bus (and approvers * don't run) */ if (priv->needs_approval) { TpDBusDaemon *dbus_daemon; DBusGConnection *dbus_connection; g_object_get (priv->client_registry, "dbus-daemon", &dbus_daemon, NULL); /* can be NULL if we have fallen off the bus (in the real MC libdbus * would exit in this situation, but in the debug build, we stay * active briefly) */ dbus_connection = tp_proxy_get_dbus_connection (dbus_daemon); if (G_LIKELY (dbus_connection != NULL)) dbus_g_connection_register_g_object (dbus_connection, priv->object_path, object); g_object_unref (dbus_daemon); } priv->plugin_api = _mcd_plugin_dispatch_operation_new (operation); return object; error: g_object_unref (object); g_return_val_if_reached (NULL); } static void _mcd_dispatch_operation_lose_channel (McdDispatchOperation *self, McdChannel *channel); static void mcd_dispatch_operation_channel_aborted_cb (McdChannel *channel, McdDispatchOperation *self) { const GError *error; g_object_ref (self); /* FIXME: use a GObject closure or something */ DEBUG ("Channel %p aborted while in a dispatch operation", channel); /* if it was a channel request, and it was cancelled, then the whole * dispatch operation should be aborted, closing any related channels */ error = mcd_channel_get_error (channel); if (error && error->code == TP_ERROR_CANCELLED) self->priv->cancelled = TRUE; _mcd_dispatch_operation_lose_channel (self, channel); if (self->priv->channel == NULL) { DEBUG ("Nothing left in this context"); } g_object_unref (self); } static void mcd_dispatch_operation_set_property (GObject *obj, guint prop_id, const GValue *val, GParamSpec *pspec) { McdDispatchOperation *operation = MCD_DISPATCH_OPERATION (obj); McdDispatchOperationPrivate *priv = operation->priv; switch (prop_id) { case PROP_CLIENT_REGISTRY: g_assert (priv->client_registry == NULL); /* construct-only */ priv->client_registry = MCD_CLIENT_REGISTRY (g_value_dup_object (val)); break; case PROP_HANDLER_MAP: g_assert (priv->handler_map == NULL); /* construct-only */ priv->handler_map = MCD_HANDLER_MAP (g_value_dup_object (val)); break; case PROP_CHANNEL: /* because this is construct-only, we can assert that: */ g_assert (priv->channel == NULL); g_assert (g_queue_is_empty (priv->approvals)); priv->channel = g_value_dup_object (val); if (G_LIKELY (priv->channel)) { const gchar *preferred_handler; priv->connection = (McdConnection *) mcd_mission_get_parent (MCD_MISSION (priv->channel)); if (G_LIKELY (priv->connection)) { g_object_ref (priv->connection); } else { /* shouldn't happen? */ g_warning ("Channel has no Connection?!"); } /* if the channel is actually a channel request, get the * preferred handler from it */ preferred_handler = _mcd_channel_get_request_preferred_handler (priv->channel); if (preferred_handler != NULL && g_str_has_prefix (preferred_handler, TP_CLIENT_BUS_NAME_BASE) && tp_dbus_check_valid_bus_name (preferred_handler, TP_DBUS_NAME_TYPE_WELL_KNOWN, NULL)) { DEBUG ("Extracted preferred handler: %s", preferred_handler); g_queue_push_tail (priv->approvals, approval_new_requested (preferred_handler)); } priv->account = mcd_channel_get_account (priv->channel); if (G_LIKELY (priv->account != NULL)) { g_object_ref (priv->account); } else { /* shouldn't happen? */ g_warning ("Channel given to McdDispatchOperation has no " "Account?!"); } /* connect to its signals */ g_signal_connect_after (priv->channel, "abort", G_CALLBACK (mcd_dispatch_operation_channel_aborted_cb), operation); } break; case PROP_POSSIBLE_HANDLERS: g_assert (priv->possible_handlers == NULL); priv->possible_handlers = g_value_dup_boxed (val); break; case PROP_NEEDS_APPROVAL: priv->needs_approval = g_value_get_boolean (val); break; case PROP_OBSERVE_ONLY: priv->observe_only = g_value_get_boolean (val); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (obj, prop_id, pspec); break; } } static void mcd_dispatch_operation_get_property (GObject *obj, guint prop_id, GValue *val, GParamSpec *pspec) { McdDispatchOperationPrivate *priv = MCD_DISPATCH_OPERATION_PRIV (obj); switch (prop_id) { case PROP_CLIENT_REGISTRY: g_value_set_object (val, priv->client_registry); break; case PROP_HANDLER_MAP: g_value_set_object (val, priv->handler_map); break; case PROP_POSSIBLE_HANDLERS: g_value_set_boxed (val, priv->possible_handlers); break; case PROP_NEEDS_APPROVAL: g_value_set_boolean (val, priv->needs_approval); break; case PROP_OBSERVE_ONLY: g_value_set_boolean (val, priv->observe_only); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (obj, prop_id, pspec); break; } } static void mcd_dispatch_operation_finalize (GObject *object) { McdDispatchOperationPrivate *priv = MCD_DISPATCH_OPERATION_PRIV (object); tp_clear_pointer (&priv->possible_handlers, g_strfreev); tp_clear_pointer (&priv->properties, g_hash_table_unref); tp_clear_pointer (&priv->failed_handlers, g_hash_table_unref); g_clear_error (&priv->result); g_free (priv->object_path); G_OBJECT_CLASS (_mcd_dispatch_operation_parent_class)->finalize (object); } static void mcd_dispatch_operation_dispose (GObject *object) { McdDispatchOperationPrivate *priv = MCD_DISPATCH_OPERATION_PRIV (object); tp_clear_object (&priv->plugin_api); tp_clear_object (&priv->successful_handler); if (priv->channel != NULL) { g_signal_handlers_disconnect_by_func (priv->channel, mcd_dispatch_operation_channel_aborted_cb, object); } tp_clear_object (&priv->channel); tp_clear_object (&priv->lost_channel); tp_clear_object (&priv->account); tp_clear_object (&priv->handler_map); tp_clear_object (&priv->client_registry); if (priv->approvals != NULL) { g_queue_foreach (priv->approvals, (GFunc) approval_free, NULL); tp_clear_pointer (&priv->approvals, g_queue_free); } G_OBJECT_CLASS (_mcd_dispatch_operation_parent_class)->dispose (object); } static void _mcd_dispatch_operation_class_init (McdDispatchOperationClass * klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); g_type_class_add_private (object_class, sizeof (McdDispatchOperationPrivate)); object_class->constructor = mcd_dispatch_operation_constructor; object_class->dispose = mcd_dispatch_operation_dispose; object_class->finalize = mcd_dispatch_operation_finalize; object_class->set_property = mcd_dispatch_operation_set_property; object_class->get_property = mcd_dispatch_operation_get_property; g_object_class_install_property (object_class, PROP_CLIENT_REGISTRY, g_param_spec_object ("client-registry", "Client registry", "Reference to a global registry of Telepathy clients", MCD_TYPE_CLIENT_REGISTRY, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (object_class, PROP_HANDLER_MAP, g_param_spec_object ("handler-map", "Handler map", "Reference to a global map from handled channels to handlers", MCD_TYPE_HANDLER_MAP, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (object_class, PROP_CHANNEL, g_param_spec_object ("channel", "Channel", "the channel to dispatch", MCD_TYPE_CHANNEL, G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (object_class, PROP_POSSIBLE_HANDLERS, g_param_spec_boxed ("possible-handlers", "Possible handlers", "Well-known bus names of possible handlers", G_TYPE_STRV, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (object_class, PROP_NEEDS_APPROVAL, g_param_spec_boolean ("needs-approval", "Needs approval?", "TRUE if this CDO should run Approvers and " "appear on D-Bus", FALSE, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (object_class, PROP_OBSERVE_ONLY, g_param_spec_boolean ("observe-only", "Observe only?", "TRUE if this CDO should stop dispatching " "as soon as Observers have been run", FALSE, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS)); } static void _mcd_dispatch_operation_init (McdDispatchOperation *operation) { McdDispatchOperationPrivate *priv; priv = G_TYPE_INSTANCE_GET_PRIVATE ((operation), MCD_TYPE_DISPATCH_OPERATION, McdDispatchOperationPrivate); operation->priv = priv; operation->priv->approvals = g_queue_new (); /* initializes the interfaces */ mcd_dbus_init_interfaces_instances (operation); } /* * _mcd_dispatch_operation_new: * @client_registry: the client registry. * @handler_map: the handler map * @channel: the channel to dispatch * @possible_handlers: the bus names of possible handlers for this channel * * Creates a #McdDispatchOperation. */ McdDispatchOperation * _mcd_dispatch_operation_new (McdClientRegistry *client_registry, McdHandlerMap *handler_map, gboolean needs_approval, gboolean observe_only, McdChannel *channel, const gchar * const *possible_handlers) { gpointer *obj; /* If we're only observing, then the channel was requested "behind MC's * back", so they can't need approval (i.e. observe_only implies * !needs_approval) */ g_return_val_if_fail (!observe_only || !needs_approval, NULL); g_return_val_if_fail (MCD_IS_CHANNEL (channel), NULL); obj = g_object_new (MCD_TYPE_DISPATCH_OPERATION, "client-registry", client_registry, "handler-map", handler_map, "channel", channel, "possible-handlers", possible_handlers, "needs-approval", needs_approval, "observe-only", observe_only, NULL); return MCD_DISPATCH_OPERATION (obj); } /* * _mcd_dispatch_operation_get_path: * @operation: the #McdDispatchOperation. * * Returns: the D-Bus object path of @operation. */ const gchar * _mcd_dispatch_operation_get_path (McdDispatchOperation *operation) { g_return_val_if_fail (MCD_IS_DISPATCH_OPERATION (operation), NULL); return operation->priv->object_path; } /* * _mcd_dispatch_operation_get_properties: * @operation: the #McdDispatchOperation. * * Gets the immutable properties of @operation. * * Returns: a #GHashTable with the operation properties. The reference count is * not incremented. */ GHashTable * _mcd_dispatch_operation_get_properties (McdDispatchOperation *operation) { McdDispatchOperationPrivate *priv; g_return_val_if_fail (MCD_IS_DISPATCH_OPERATION (operation), NULL); priv = operation->priv; if (!priv->properties) { const McdDBusProp *property; priv->properties = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, (GDestroyNotify)tp_g_value_slice_free); for (property = dispatch_operation_properties; property->name != NULL; property++) { GValue *value; gchar *name; if (!property->getprop) continue; /* The Channels property is mutable, so cannot be returned * here */ if (!tp_strdiff (property->name, "Channels")) continue; value = g_slice_new0 (GValue); property->getprop ((TpSvcDBusProperties *)operation, property->name, value); name = g_strconcat (TP_IFACE_CHANNEL_DISPATCH_OPERATION, ".", property->name, NULL); g_hash_table_insert (priv->properties, name, value); } } return priv->properties; } gboolean _mcd_dispatch_operation_needs_approval (McdDispatchOperation *self) { g_return_val_if_fail (MCD_IS_DISPATCH_OPERATION (self), FALSE); return self->priv->needs_approval; } /* * _mcd_dispatch_operation_is_finished: * @self: the #McdDispatchOperation. * * Returns: %TRUE if the operation has finished, %FALSE otherwise. */ gboolean _mcd_dispatch_operation_is_finished (McdDispatchOperation *self) { g_return_val_if_fail (MCD_IS_DISPATCH_OPERATION (self), FALSE); /* if we want to finish, and we can, then we have */ return (self->priv->result != NULL && mcd_dispatch_operation_may_signal_finished (self)); } static gboolean mcd_dispatch_operation_check_handle_with (McdDispatchOperation *self, const gchar *handler_name, GError **error) { g_return_val_if_fail (MCD_IS_DISPATCH_OPERATION (self), FALSE); if (self->priv->result != NULL) { DEBUG ("already finished, %s", self->priv->result->message); if (error != NULL) *error = g_error_copy (self->priv->result); return FALSE; } if (!g_queue_is_empty (self->priv->approvals)) { DEBUG ("NotYours: already finished or approved"); g_set_error (error, TP_ERROR, TP_ERROR_NOT_YOURS, "CDO already finished or approved"); return FALSE; } if (handler_name == NULL || handler_name[0] == '\0') { /* no handler name given */ return TRUE; } if (!g_str_has_prefix (handler_name, TP_CLIENT_BUS_NAME_BASE) || !tp_dbus_check_valid_bus_name (handler_name, TP_DBUS_NAME_TYPE_WELL_KNOWN, NULL)) { DEBUG ("InvalidArgument: handler name %s is bad", handler_name); g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Invalid handler name"); return FALSE; } return TRUE; } void _mcd_dispatch_operation_approve (McdDispatchOperation *self, const gchar *preferred_handler) { g_return_if_fail (MCD_IS_DISPATCH_OPERATION (self)); /* NULL-safety: treat both NULL and "" as "unspecified" */ if (preferred_handler == NULL) preferred_handler = ""; DEBUG ("%s/%p (preferred handler: '%s')", self->priv->unique_name, self, preferred_handler); if (!g_str_has_prefix (preferred_handler, TP_CLIENT_BUS_NAME_BASE) || !tp_dbus_check_valid_bus_name (preferred_handler, TP_DBUS_NAME_TYPE_WELL_KNOWN, NULL)) { DEBUG ("preferred handler name '%s' is bad, treating as unspecified", preferred_handler); preferred_handler = ""; } g_queue_push_tail (self->priv->approvals, approval_new_requested (preferred_handler)); _mcd_dispatch_operation_check_client_locks (self); } static void _mcd_dispatch_operation_lose_channel (McdDispatchOperation *self, McdChannel *channel) { const gchar *object_path; const GError *error = NULL; if (G_UNLIKELY (channel != self->priv->channel)) { g_warning ("%s: apparently lost %p but my channel is %p", G_STRFUNC, channel, self->priv->channel); return; } /* steal the reference */ self->priv->channel = NULL; object_path = mcd_channel_get_object_path (channel); error = mcd_channel_get_error (channel); if (object_path == NULL) { /* This shouldn't happen, but McdChannel is twisty enough that I * can't be sure */ g_critical ("McdChannel has already lost its TpChannel: %p", channel); } else if (!mcd_dispatch_operation_may_signal_finished (self)) { /* We're still invoking approvers, so we're not allowed to talk * about it right now. Instead, save the signal for later. */ DEBUG ("%s/%p not losing channel %s just yet: " "waiting for %" G_GSIZE_FORMAT " observers, " "%" G_GSIZE_FORMAT " approvers", self->priv->unique_name, self, object_path, self->priv->observers_pending, self->priv->ado_pending); g_assert (self->priv->lost_channel == NULL); self->priv->lost_channel = g_object_ref (channel); } else { gchar *error_name = _mcd_build_error_string (error); DEBUG ("%s/%p losing channel %s: %s: %s", self->priv->unique_name, self, object_path, error_name, error->message); tp_svc_channel_dispatch_operation_emit_channel_lost (self, object_path, error_name, error->message); g_free (error_name); } /* We previously stole this ref from self->priv->channel - drop it */ g_object_unref (channel); /* no channels left, so the CDO finishes (if it hasn't already) */ _mcd_dispatch_operation_finish (self, error->domain, error->code, "%s", error->message); } static void _mcd_dispatch_operation_check_finished (McdDispatchOperation *self) { if (mcd_dispatch_operation_may_signal_finished (self)) { McdChannel *lost_channel = self->priv->lost_channel; /* steal it */ self->priv->lost_channel = NULL; if (lost_channel != NULL) { const gchar *object_path = mcd_channel_get_object_path ( lost_channel); if (object_path == NULL) { /* This shouldn't happen, but McdChannel is twisty enough * that I can't be sure */ g_critical ("McdChannel has already lost its TpChannel: %p", lost_channel); } else { const GError *error = mcd_channel_get_error (lost_channel); gchar *error_name = _mcd_build_error_string (error); DEBUG ("%s/%p losing channel %s: %s: %s", self->priv->unique_name, self, object_path, error_name, error->message); tp_svc_channel_dispatch_operation_emit_channel_lost (self, object_path, error_name, error->message); g_free (error_name); } g_object_unref (lost_channel); } if (self->priv->result != NULL) { DEBUG ("%s/%p finished", self->priv->unique_name, self); mcd_dispatch_operation_actually_finish (self); } } else if (self->priv->result != NULL) { DEBUG ("%s/%p still unable to finish: " "waiting for %" G_GSIZE_FORMAT " observers, " "%" G_GSIZE_FORMAT " approvers", self->priv->unique_name, self, self->priv->observers_pending, self->priv->ado_pending); } } static void _mcd_dispatch_operation_set_handler_failed (McdDispatchOperation *self, const gchar *bus_name, const GError *error) { GList *iter, *next; gchar **handler; if (self->priv->failed_handlers == NULL) { self->priv->failed_handlers = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL); } /* the value is an arbitrary non-NULL pointer - the hash table itself * will do nicely */ g_hash_table_insert (self->priv->failed_handlers, g_strdup (bus_name), self->priv->failed_handlers); for (iter = g_queue_peek_head_link (self->priv->approvals); iter != NULL; iter = next) { Approval *approval = iter->data; /* do this before we potentially free the list element */ next = iter->next; /* If this approval wanted the same handler that just failed, then * we can assume that's not going to happen. */ if (approval->type == APPROVAL_TYPE_HANDLE_WITH && !tp_strdiff (approval->client_bus_name, bus_name)) { dbus_g_method_return_error (approval->context, (GError *) error); approval->context = NULL; approval_free (approval); g_queue_delete_link (self->priv->approvals, iter); } } for (handler = self->priv->possible_handlers; handler != NULL && *handler != NULL; handler++) { if (g_hash_table_lookup (self->priv->failed_handlers, *handler) == NULL) { /* we'll try this one soon */ return; } } DEBUG ("All possible handlers failed: failing with the last error"); _mcd_dispatch_operation_close_as_undispatchable (self, error); } static gboolean _mcd_dispatch_operation_get_handler_failed (McdDispatchOperation *self, const gchar *bus_name) { g_assert (MCD_IS_DISPATCH_OPERATION (self)); g_assert (bus_name != NULL); if (self->priv->failed_handlers == NULL) return FALSE; return (g_hash_table_lookup (self->priv->failed_handlers, bus_name) != NULL); } static gboolean _mcd_dispatch_operation_handlers_can_bypass_approval ( McdDispatchOperation *self) { gchar **iter; /* special case: internally handled request, not subject to approval */ if (_mcd_dispatch_operation_is_internal (self)) return TRUE; /* special case: we don't have any handlers at all, so we don't want * approval - we're just going to fail */ if (self->priv->possible_handlers == NULL) return TRUE; for (iter = self->priv->possible_handlers; *iter != NULL; iter++) { McdClientProxy *handler = _mcd_client_registry_lookup ( self->priv->client_registry, *iter); /* If the best handler that still exists bypasses approval, then * we're going to bypass approval. * * Also, because handlers are sorted with the best ones first, and * handlers with BypassApproval are "better", we can be sure that if * we've found a handler that still exists and does not bypass * approval, no handler bypasses approval. */ if (handler != NULL) { gboolean bypass = _mcd_client_proxy_get_bypass_approval ( handler); DEBUG ("%s has BypassApproval=%c", *iter, bypass ? 'T' : 'F'); return bypass; } } /* If no handler still exists, we don't bypass approval, although if that * happens we're basically doomed anyway. (unless this is an internal * request, in which case we should be ok) */ return FALSE; } /* this is analogous to *_can_bypass_handlers() method above */ static gboolean _mcd_dispatch_operation_handlers_can_bypass_observers ( McdDispatchOperation *self) { gchar **iter; for (iter = self->priv->possible_handlers; iter != NULL && *iter != NULL; iter++) { McdClientProxy *handler = _mcd_client_registry_lookup ( self->priv->client_registry, *iter); if (handler != NULL) { gboolean bypass = _mcd_client_proxy_get_bypass_observers ( handler); DEBUG ("%s has BypassObservers=%c", *iter, bypass ? 'T' : 'F'); return bypass; } } return FALSE; } gboolean _mcd_dispatch_operation_has_channel (McdDispatchOperation *self, McdChannel *channel) { g_return_val_if_fail (MCD_IS_DISPATCH_OPERATION (self), FALSE); return (self->priv->channel != NULL && self->priv->channel == channel); } McdChannel * _mcd_dispatch_operation_peek_channel (McdDispatchOperation *self) { g_return_val_if_fail (MCD_IS_DISPATCH_OPERATION (self), NULL); return self->priv->channel; } McdChannel * _mcd_dispatch_operation_dup_channel (McdDispatchOperation *self) { g_return_val_if_fail (MCD_IS_DISPATCH_OPERATION (self), NULL); if (self->priv->channel != NULL) return g_object_ref (self->priv->channel); return NULL; } static void _mcd_dispatch_operation_handle_channels_cb (TpClient *client, const GError *error, gpointer user_data, GObject *weak G_GNUC_UNUSED) { McdDispatchOperation *self = user_data; if (error) { DEBUG ("error: %s", error->message); _mcd_dispatch_operation_set_handler_failed (self, tp_proxy_get_bus_name (client), error); } else { /* FIXME: can channel ever be NULL here? */ if (self->priv->channel != NULL) { McdChannel *channel = MCD_CHANNEL (self->priv->channel); const gchar *unique_name; unique_name = _mcd_client_proxy_get_unique_name (MCD_CLIENT_PROXY (client)); /* This should always be false in practice - either we already know * the handler's unique name (because active handlers' unique names * are discovered before their handler filters), or the handler * is activatable and was not running, the handler filter came * from a .client file, and the bus daemon activated the handler * as a side-effect of HandleChannels (in which case * NameOwnerChanged should have already been emitted by the time * we got a reply to HandleChannels). * * We recover by whining to stderr and closing the channels, in the * interests of at least failing visibly. * * If dbus-glib exposed more of the details of the D-Bus message * passing system, then we could just look at the sender of the * reply and bypass this rubbish... */ if (G_UNLIKELY (unique_name == NULL || unique_name[0] == '\0')) { g_warning ("Client %s returned successfully but doesn't " "exist? dbus-daemon bug suspected", tp_proxy_get_bus_name (client)); g_warning ("Closing channel %s as a result", mcd_channel_get_object_path (channel)); _mcd_channel_undispatchable (channel); } else { mcd_dispatch_operation_set_channel_handled_by (self, channel, unique_name, tp_proxy_get_bus_name (client)); } } /* emit Finished, if we haven't already; but first make a note of the * handler we used, so we can reply to all the HandleWith calls with * success or failure */ self->priv->successful_handler = g_object_ref (client); _mcd_dispatch_operation_finish (self, TP_ERROR, TP_ERROR_NOT_YOURS, "Channel successfully handled by %s", tp_proxy_get_bus_name (client)); } tp_clear_object (&self->priv->trying_handler); _mcd_dispatch_operation_check_client_locks (self); } static void observe_channels_cb (TpClient *proxy, const GError *error, gpointer user_data, GObject *weak_object) { McdDispatchOperation *self = user_data; /* we display the error just for debugging, but we don't really care */ if (error) DEBUG ("Observer %s returned error: %s", tp_proxy_get_object_path (proxy), error->message); else DEBUG ("success from %s", tp_proxy_get_object_path (proxy)); _mcd_dispatch_operation_dec_observers_pending (self, MCD_CLIENT_PROXY (proxy)); } /* * @paths_out: (out) (transfer container) (element-type utf8): * Requests_Satisfied * @props_out: (out) (transfer container) (element-type utf8 GHashTable): * request-properties for Observer_Info or Handler_Info */ static void collect_satisfied_requests (McdChannel *channel, GPtrArray **paths_out, GHashTable **props_out) { GHashTableIter it; gpointer path, value; GPtrArray *satisfied_requests; GHashTable *request_properties; GHashTable *reqs; reqs = _mcd_channel_get_satisfied_requests (channel, NULL); satisfied_requests = g_ptr_array_sized_new (g_hash_table_size (reqs)); g_ptr_array_set_free_func (satisfied_requests, g_free); request_properties = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, (GDestroyNotify) g_hash_table_unref); g_hash_table_iter_init (&it, reqs); while (g_hash_table_iter_next (&it, &path, &value)) { GHashTable *props; g_ptr_array_add (satisfied_requests, g_strdup (path)); props = _mcd_request_dup_immutable_properties (value); g_assert (props != NULL); g_hash_table_insert (request_properties, g_strdup (path), props); } g_hash_table_unref (reqs); if (paths_out != NULL) *paths_out = satisfied_requests; else g_ptr_array_unref (satisfied_requests); if (props_out != NULL) *props_out = request_properties; else g_hash_table_unref (request_properties); } static void _mcd_dispatch_operation_run_observers (McdDispatchOperation *self) { const gchar *dispatch_operation_path = "/"; GHashTable *observer_info; GHashTableIter iter; gpointer client_p; observer_info = tp_asv_new (NULL, NULL); _mcd_client_registry_init_hash_iter (self->priv->client_registry, &iter); while (g_hash_table_iter_next (&iter, NULL, &client_p)) { McdClientProxy *client = MCD_CLIENT_PROXY (client_p); gboolean observed = FALSE; const gchar *account_path, *connection_path; GPtrArray *channels_array, *satisfied_requests; GHashTable *request_properties; if (!tp_proxy_has_interface_by_id (client, TP_IFACE_QUARK_CLIENT_OBSERVER)) continue; if (self->priv->channel != NULL) { McdChannel *channel = MCD_CHANNEL (self->priv->channel); GVariant *properties; properties = mcd_channel_dup_immutable_properties (channel); g_assert (properties != NULL); if (_mcd_client_match_filters (properties, _mcd_client_proxy_get_observer_filters (client), FALSE)) observed = TRUE; g_variant_unref (properties); } /* in particular this happens if there is no channel at all */ if (!observed) continue; /* build up the parameters and invoke the observer */ connection_path = _mcd_dispatch_operation_get_connection_path (self); account_path = _mcd_dispatch_operation_get_account_path (self); /* TODO: there's room for optimization here: reuse the channels_array, * if the observed list is the same */ channels_array = _mcd_tp_channel_details_build_from_tp_chan ( mcd_channel_get_tp_channel (self->priv->channel)); collect_satisfied_requests (self->priv->channel, &satisfied_requests, &request_properties); /* transfer ownership into observer_info */ tp_asv_take_boxed (observer_info, "request-properties", TP_HASH_TYPE_OBJECT_IMMUTABLE_PROPERTIES_MAP, request_properties); request_properties = NULL; if (_mcd_dispatch_operation_needs_approval (self)) { dispatch_operation_path = _mcd_dispatch_operation_get_path (self); } _mcd_dispatch_operation_inc_observers_pending (self, client); DEBUG ("calling ObserveChannels on %s for CDO %p", tp_proxy_get_bus_name (client), self); tp_cli_client_observer_call_observe_channels ( (TpClient *) client, -1, account_path, connection_path, channels_array, dispatch_operation_path, satisfied_requests, observer_info, observe_channels_cb, g_object_ref (self), g_object_unref, NULL); g_ptr_array_unref (satisfied_requests); _mcd_tp_channel_details_free (channels_array); } g_hash_table_unref (observer_info); } static void add_dispatch_operation_cb (TpClient *proxy, const GError *error, gpointer user_data, GObject *weak_object) { McdDispatchOperation *self = user_data; if (error) { DEBUG ("AddDispatchOperation %s (%p) on approver %s failed: " "%s", _mcd_dispatch_operation_get_path (self), self, tp_proxy_get_object_path (proxy), error->message); } else { DEBUG ("Approver %s accepted AddDispatchOperation %s (%p)", tp_proxy_get_object_path (proxy), _mcd_dispatch_operation_get_path (self), self); if (!self->priv->accepted_by_an_approver) { self->priv->accepted_by_an_approver = TRUE; } } /* If all approvers fail to add the DO, then we behave as if no * approver was registered: i.e., we continue dispatching. If at least * one approver accepted it, then we can still continue dispatching, * since it will be stalled until an approval is received. */ _mcd_dispatch_operation_dec_ado_pending (self); } static void _mcd_dispatch_operation_run_approvers (McdDispatchOperation *self) { GHashTableIter iter; gpointer client_p; /* we temporarily increment this count and decrement it at the end of the * function, to make sure it won't become 0 while we are still invoking * approvers */ _mcd_dispatch_operation_inc_ado_pending (self); _mcd_client_registry_init_hash_iter (self->priv->client_registry, &iter); while (g_hash_table_iter_next (&iter, NULL, &client_p)) { McdClientProxy *client = MCD_CLIENT_PROXY (client_p); GPtrArray *channel_details; const gchar *dispatch_operation; GHashTable *properties; gboolean matched = FALSE; if (!tp_proxy_has_interface_by_id (client, TP_IFACE_QUARK_CLIENT_APPROVER)) continue; if (self->priv->channel != NULL) { McdChannel *channel = MCD_CHANNEL (self->priv->channel); GVariant *channel_properties; channel_properties = mcd_channel_dup_immutable_properties (channel); g_assert (channel_properties != NULL); if (_mcd_client_match_filters (channel_properties, _mcd_client_proxy_get_approver_filters (client), FALSE)) { matched = TRUE; } g_variant_unref (channel_properties); } /* in particular, after this point, self->priv->channel can't * be NULL */ if (!matched) continue; dispatch_operation = _mcd_dispatch_operation_get_path (self); properties = _mcd_dispatch_operation_get_properties (self); channel_details = _mcd_tp_channel_details_build_from_tp_chan ( mcd_channel_get_tp_channel (self->priv->channel)); DEBUG ("Calling AddDispatchOperation on approver %s for CDO %s @ %p", tp_proxy_get_bus_name (client), dispatch_operation, self); _mcd_dispatch_operation_inc_ado_pending (self); tp_cli_client_approver_call_add_dispatch_operation ( (TpClient *) client, -1, channel_details, dispatch_operation, properties, add_dispatch_operation_cb, g_object_ref (self), g_object_unref, NULL); g_boxed_free (TP_ARRAY_TYPE_CHANNEL_DETAILS_LIST, channel_details); } /* This matches the approvers count set to 1 at the beginning of the * function */ _mcd_dispatch_operation_dec_ado_pending (self); } static gboolean mcd_dispatch_operation_idle_run_approvers (gpointer p) { McdDispatchOperation *self = p; if (_mcd_dispatch_operation_needs_approval (self)) { if (!_mcd_dispatch_operation_is_approved (self)) _mcd_dispatch_operation_run_approvers (self); } self->priv->invoked_approvers_if_needed = TRUE; _mcd_dispatch_operation_check_client_locks (self); return FALSE; } /* After this function is called, the McdDispatchOperation takes over its * own life-cycle, and the caller needn't hold an explicit reference to it. */ void _mcd_dispatch_operation_run_clients (McdDispatchOperation *self) { g_object_ref (self); DEBUG ("%s %p", self->priv->unique_name, self); if (self->priv->channel != NULL) { const GList *mini_plugins; if (_mcd_dispatch_operation_handlers_can_bypass_observers (self)) { DEBUG ("Bypassing observers"); } else { DEBUG ("Running observers"); _mcd_dispatch_operation_run_observers (self); } for (mini_plugins = mcp_list_objects (); mini_plugins != NULL; mini_plugins = mini_plugins->next) { if (MCP_IS_DISPATCH_OPERATION_POLICY (mini_plugins->data)) { mcp_dispatch_operation_policy_check (mini_plugins->data, MCP_DISPATCH_OPERATION (self->priv->plugin_api)); } } } DEBUG ("All necessary observers invoked"); self->priv->invoked_observers_if_needed = TRUE; DEBUG ("Checking finished/locks"); _mcd_dispatch_operation_check_finished (self); _mcd_dispatch_operation_check_client_locks (self); g_object_unref (self); } /* * mcd_dispatch_operation_handle_channels: * @self: the dispatch operation * @handler: the selected handler * * Invoke the handler for the given channels. */ static void mcd_dispatch_operation_handle_channels (McdDispatchOperation *self) { GList *channels = NULL; GHashTable *handler_info; GHashTable *request_properties; g_assert (self->priv->trying_handler != NULL); if (self->priv->handler_unsuitable != NULL) { GError *tmp = self->priv->handler_unsuitable; /* move the error out of the way first, in case the callback * tries a different handler which will also want to check * handler_unsuitable */ self->priv->handler_unsuitable = NULL; _mcd_dispatch_operation_handle_channels_cb ( (TpClient *) self->priv->trying_handler, tmp, self, NULL); g_error_free (tmp); return; } /* FIXME: it shouldn't be possible to get here without a channel */ if (self->priv->channel != NULL) { collect_satisfied_requests (self->priv->channel, NULL, &request_properties); channels = g_list_prepend (NULL, self->priv->channel); } else { request_properties = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, (GDestroyNotify) g_hash_table_unref); } handler_info = tp_asv_new (NULL, NULL); tp_asv_take_boxed (handler_info, "request-properties", TP_HASH_TYPE_OBJECT_IMMUTABLE_PROPERTIES_MAP, request_properties); request_properties = NULL; _mcd_client_proxy_handle_channels (self->priv->trying_handler, -1, channels, self->priv->handle_with_time, handler_info, _mcd_dispatch_operation_handle_channels_cb, g_object_ref (self), g_object_unref, NULL); g_hash_table_unref (handler_info); g_list_free (channels); } static void mcd_dispatch_operation_handler_decision_cb (GObject *source, GAsyncResult *res, gpointer user_data) { McdDispatchOperation *self = user_data; GError *error = NULL; if (!mcp_dispatch_operation_policy_handler_is_suitable_finish ( MCP_DISPATCH_OPERATION_POLICY (source), res, &error)) { /* ignore any errors after the first */ if (self->priv->handler_unsuitable == NULL) g_propagate_error (&self->priv->handler_unsuitable, error); else g_error_free (error); } if (--self->priv->handler_suitable_pending == 0) { mcd_dispatch_operation_handle_channels (self); } g_object_unref (self); } static void mcd_dispatch_operation_try_handler (McdDispatchOperation *self, McdClientProxy *handler) { TpClient *handler_client = (TpClient *) handler; const GList *p; McpDispatchOperation *plugin_api = MCP_DISPATCH_OPERATION ( self->priv->plugin_api); g_assert (self->priv->trying_handler == NULL); self->priv->trying_handler = g_object_ref (handler); self->priv->handler_suitable_pending = 0; DEBUG ("%s: channel ACL verification", self->priv->unique_name); for (p = mcp_list_objects (); p != NULL; p = g_list_next (p)) { if (MCP_IS_DISPATCH_OPERATION_POLICY (p->data)) { McpDispatchOperationPolicy *plugin = p->data; DEBUG ("%s: checking policy for %s", G_OBJECT_TYPE_NAME (plugin), tp_proxy_get_object_path (handler)); self->priv->handler_suitable_pending++; mcp_dispatch_operation_policy_handler_is_suitable_async (plugin, handler_client, _mcd_client_proxy_get_unique_name (handler), plugin_api, mcd_dispatch_operation_handler_decision_cb, g_object_ref (self)); } } if (self->priv->handler_suitable_pending == 0) { mcd_dispatch_operation_handle_channels (self); } } static gboolean _mcd_dispatch_operation_try_next_handler (McdDispatchOperation *self) { gchar **iter; gboolean is_approved = _mcd_dispatch_operation_is_approved (self); Approval *approval = g_queue_peek_head (self->priv->approvals); /* If there is a preferred Handler chosen by the first Approver or * request, it's the first one we'll consider. We'll even consider * it even if its filter doesn't match. * * In the case of an Approver calling HandleWith, we'll also try again * even if it already failed - perhaps the Approver is feeling lucky. */ if (approval != NULL && approval->client_bus_name != NULL) { McdClientProxy *handler = _mcd_client_registry_lookup ( self->priv->client_registry, approval->client_bus_name); gboolean failed = _mcd_dispatch_operation_get_handler_failed (self, approval->client_bus_name); DEBUG ("Approved handler is %s (still exists: %c, " "already failed: %c)", approval->client_bus_name, handler != NULL ? 'Y' : 'N', failed ? 'Y' : 'N'); /* Maybe the handler has exited since we chose it, or maybe we * already tried it? Otherwise, it's the right choice. */ if (handler != NULL && (approval->type == APPROVAL_TYPE_HANDLE_WITH || !failed)) { mcd_dispatch_operation_try_handler (self, handler); return TRUE; } /* If the Handler has disappeared, a HandleWith call should fail, * but a request (for which the client_bus_name is merely advisory) * can legitimately try more handlers. */ if (approval->type == APPROVAL_TYPE_HANDLE_WITH) { GError gone = { TP_ERROR, TP_ERROR_NOT_IMPLEMENTED, "The requested Handler does not exist" }; g_queue_pop_head (self->priv->approvals); dbus_g_method_return_error (approval->context, &gone); approval->context = NULL; approval_free (approval); return TRUE; } } for (iter = self->priv->possible_handlers; iter != NULL && *iter != NULL; iter++) { McdClientProxy *handler = _mcd_client_registry_lookup ( self->priv->client_registry, *iter); gboolean failed = _mcd_dispatch_operation_get_handler_failed (self, *iter); DEBUG ("Possible handler: %s (still exists: %c, already failed: %c)", *iter, handler != NULL ? 'Y' : 'N', failed ? 'Y' : 'N'); if (handler != NULL && !failed && (is_approved || _mcd_client_proxy_get_bypass_approval (handler))) { mcd_dispatch_operation_try_handler (self, handler); return TRUE; } } return FALSE; } static void _mcd_dispatch_operation_close_as_undispatchable (McdDispatchOperation *self, const GError *error) { /* All of the usable handlers vanished while we were thinking about it * (this can only happen if non-activatable handlers exit after we * include them in the list of possible handlers, but before we . * We should recover in some better way, perhaps by asking all the * approvers again (?), but for now we'll just close all the channels. */ DEBUG ("%s", error->message); _mcd_dispatch_operation_finish (self, error->domain, error->code, "%s", error->message); if (self->priv->channel != NULL) { McdChannel *channel = MCD_CHANNEL (self->priv->channel); GError e = { TP_ERROR, TP_ERROR_NOT_AVAILABLE, "Handler no longer available" }; g_object_ref (channel); mcd_channel_take_error (channel, g_error_copy (&e)); _mcd_channel_undispatchable (channel); g_object_unref (channel); } } void _mcd_dispatch_operation_start_plugin_delay (McdDispatchOperation *self) { g_object_ref (self); DEBUG ("%" G_GSIZE_FORMAT " -> %" G_GSIZE_FORMAT, self->priv->plugins_pending, self->priv->plugins_pending + 1); self->priv->plugins_pending++; } void _mcd_dispatch_operation_end_plugin_delay (McdDispatchOperation *self) { DEBUG ("%" G_GSIZE_FORMAT " -> %" G_GSIZE_FORMAT, self->priv->plugins_pending, self->priv->plugins_pending - 1); g_return_if_fail (self->priv->plugins_pending > 0); self->priv->plugins_pending--; _mcd_dispatch_operation_check_client_locks (self); g_object_unref (self); } void _mcd_dispatch_operation_forget_channels (McdDispatchOperation *self) { if (self->priv->channel != NULL) { /* Take a temporary copy, because self->priv->channels is going * to be modified as a result of mcd_mission_abort() */ McdChannel *channel = g_object_ref (self->priv->channel); mcd_mission_abort (MCD_MISSION (channel)); g_object_unref (channel); } /* There should now be no channel left (it was aborted) */ g_return_if_fail (self->priv->channel == NULL); } void _mcd_dispatch_operation_leave_channels (McdDispatchOperation *self, TpChannelGroupChangeReason reason, const gchar *message) { if (message == NULL) { message = ""; } if (self->priv->channel != NULL) { /* Take a temporary copy, because self->priv->channels could * be modified as a result */ McdChannel *channel = g_object_ref (self->priv->channel); _mcd_channel_depart (channel, reason, message); g_object_unref (channel); } _mcd_dispatch_operation_forget_channels (self); } void _mcd_dispatch_operation_close_channels (McdDispatchOperation *self) { if (self->priv->channel != NULL) { /* Take a temporary copy, because self->priv->channels could * be modified as a result */ McdChannel *channel = g_object_ref (self->priv->channel); _mcd_channel_close (channel); g_object_unref (channel); } _mcd_dispatch_operation_forget_channels (self); } void _mcd_dispatch_operation_destroy_channels (McdDispatchOperation *self) { if (self->priv->channel != NULL) { /* Take a temporary copy, because self->priv->channels could * be modified as a result */ McdChannel *channel = g_object_ref (self->priv->channel); _mcd_channel_undispatchable (channel); g_object_unref (channel); } _mcd_dispatch_operation_forget_channels (self); } /* This should really be called ..._has_invoked_observers_if_needed, * but that name would be ridiculous. */ gboolean _mcd_dispatch_operation_has_invoked_observers (McdDispatchOperation *self) { return self->priv->invoked_observers_if_needed; } telepathy-mission-control-5.16.4/src/client-registry.h0000644000175000017500000000562412735241312024110 0ustar00gkiagiagkiagia00000000000000/* Map containing registered Telepathy clients * * Copyright (C) 2007-2009 Nokia Corporation. * Copyright (C) 2009 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * version 2.1 as published by the Free Software Foundation. * * This library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA * */ #ifndef MCD_CLIENT_REGISTRY_H #define MCD_CLIENT_REGISTRY_H #include #include #include "mcd-client-priv.h" G_BEGIN_DECLS typedef struct _McdClientRegistry McdClientRegistry; typedef struct _McdClientRegistryClass McdClientRegistryClass; typedef struct _McdClientRegistryPrivate McdClientRegistryPrivate; struct _McdClientRegistry { GObject parent; McdClientRegistryPrivate *priv; }; struct _McdClientRegistryClass { GObjectClass parent; }; GType _mcd_client_registry_get_type (void); #define MCD_TYPE_CLIENT_REGISTRY \ (_mcd_client_registry_get_type ()) #define MCD_CLIENT_REGISTRY(obj) \ (G_TYPE_CHECK_INSTANCE_CAST ((obj), MCD_TYPE_CLIENT_REGISTRY, \ McdClientRegistry)) #define MCD_CLIENT_REGISTRY_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST ((klass), MCD_TYPE_CLIENT_REGISTRY, \ McdClientRegistryClass)) #define MCD_IS_CLIENT_REGISTRY(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MCD_TYPE_CLIENT_REGISTRY)) #define MCD_IS_CLIENT_REGISTRY_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE ((klass), MCD_TYPE_CLIENT_REGISTRY)) #define MCD_CLIENT_REGISTRY_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), MCD_TYPE_CLIENT_REGISTRY, \ McdClientRegistryClass)) G_GNUC_INTERNAL McdClientRegistry *_mcd_client_registry_new ( TpDBusDaemon *dbus_daemon); TpDBusDaemon *_mcd_client_registry_get_dbus_daemon (McdClientRegistry *self); G_GNUC_INTERNAL McdClientProxy *_mcd_client_registry_lookup ( McdClientRegistry *self, const gchar *well_known_name); G_GNUC_INTERNAL GPtrArray *_mcd_client_registry_dup_client_caps ( McdClientRegistry *self); G_GNUC_INTERNAL gboolean _mcd_client_registry_is_ready ( McdClientRegistry *self); G_GNUC_INTERNAL void _mcd_client_registry_init_hash_iter ( McdClientRegistry *self, GHashTableIter *iter); G_GNUC_INTERNAL GList *_mcd_client_registry_list_possible_handlers ( McdClientRegistry *self, const gchar *preferred_handler, GVariant *request_props, TpChannel *channel, const gchar *must_have_unique_name); G_END_DECLS #endif telepathy-mission-control-5.16.4/src/mcd-mission.h0000644000175000017500000000464512735241312023210 0ustar00gkiagiagkiagia00000000000000/* vi: set et sw=4 ts=8 cino=t0,(0: */ /* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4; tab-width: 8 -*- */ /* * This file is part of mission-control * * Copyright (C) 2007 Nokia Corporation. * * Contact: Naba Kumar * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * version 2.1 as published by the Free Software Foundation. * * This library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA * */ #ifndef MCD_MISSION_H #define MCD_MISSION_H #include #include #include "mcd-debug.h" G_BEGIN_DECLS #define MCD_TYPE_MISSION (mcd_mission_get_type ()) #define MCD_MISSION(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), MCD_TYPE_MISSION, McdMission)) #define MCD_MISSION_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), MCD_TYPE_MISSION, McdMissionClass)) #define MCD_IS_MISSION(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), MCD_TYPE_MISSION)) #define MCD_IS_MISSION_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), MCD_TYPE_MISSION)) #define MCD_MISSION_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), MCD_TYPE_MISSION, McdMissionClass)) typedef struct _McdMission McdMission; typedef struct _McdMissionClass McdMissionClass; struct _McdMission { GObject parent; }; struct _McdMissionClass { GObjectClass parent_class; /* Signals */ void (*connected_signal) (McdMission * mission); void (*disconnected_signal) (McdMission * mission); void (*abort_signal) (McdMission * mission); /* Virtual methods */ void (*connect) (McdMission * mission); void (*disconnect) (McdMission * mission); void (*abort) (McdMission * mission); }; GType mcd_mission_get_type (void); gboolean mcd_mission_is_connected (McdMission * mission); McdMission *mcd_mission_get_parent (McdMission * mission); void mcd_mission_abort (McdMission * mission); void mcd_mission_connect (McdMission * mission); void mcd_mission_disconnect (McdMission * mission); G_END_DECLS #endif /* MCD_MISSION_H */ telepathy-mission-control-5.16.4/src/mcd-account-addressing.h0000644000175000017500000000235612735241312025301 0ustar00gkiagiagkiagia00000000000000/* vi: set et sw=4 ts=8 cino=t0,(0: */ /* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4; tab-width: 8 -*- */ /* * This file is part of mission-control * * Copyright © 2010 Nokia Corporation. * Copyright © 2010 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * version 2.1 as published by the Free Software Foundation. * * This library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA * */ #ifndef __MCD_ACCOUNT_ADDRESSING_H__ #define __MCD_ACCOUNT_ADDRESSING_H__ #include "mcd-account-priv.h" G_BEGIN_DECLS G_GNUC_INTERNAL extern const McdDBusProp account_addressing_properties[]; G_GNUC_INTERNAL void account_addressing_iface_init ( TpSvcAccountInterfaceAddressingClass *iface, gpointer data); G_END_DECLS #endif telepathy-mission-control-5.16.4/src/mcd-connection-priv.h0000644000175000017500000000515312735241312024637 0ustar00gkiagiagkiagia00000000000000/* vi: set et sw=4 ts=8 cino=t0,(0: */ /* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4; tab-width: 8 -*- */ /* * This file is part of mission-control * * Copyright © 2007-2011 Nokia Corporation. * Copyright © 2009-2011 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * version 2.1 as published by the Free Software Foundation. * * This library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA * */ #ifndef __MCD_CONNECTION_PRIV_H__ #define __MCD_CONNECTION_PRIV_H__ #include "mcd-connection.h" G_BEGIN_DECLS G_GNUC_INTERNAL void _mcd_connection_request_presence (McdConnection *self, TpConnectionPresenceType type, const gchar *status, const gchar *message); G_GNUC_INTERNAL void _mcd_connection_connect (McdConnection *connection, GHashTable *params); G_GNUC_INTERNAL void _mcd_connection_update_property (McdConnection *connection, const gchar *name, const GValue *value); G_GNUC_INTERNAL void _mcd_connection_set_tp_connection (McdConnection *connection, const gchar *bus_name, const gchar *obj_path, GError **error); G_GNUC_INTERNAL void _mcd_connection_start_dispatching (McdConnection *self, GPtrArray *client_caps); G_GNUC_INTERNAL gboolean _mcd_connection_is_ready (McdConnection *self); G_GNUC_INTERNAL void _mcd_connection_set_avatar (McdConnection *self, const GArray *avatar, const gchar *mime_type); G_GNUC_INTERNAL void _mcd_connection_update_client_caps (McdConnection *self, GPtrArray *client_caps); G_GNUC_INTERNAL gboolean _mcd_connection_presence_info_is_ready (McdConnection *self); G_GNUC_INTERNAL void _mcd_connection_take_emergency_numbers (McdConnection *self, GSList *numbers); G_GNUC_INTERNAL gboolean _mcd_connection_target_id_is_urgent (McdConnection *connection, const gchar *name); G_GNUC_INTERNAL gboolean _mcd_connection_target_handle_is_urgent (McdConnection *self, guint handle); G_END_DECLS #endif telepathy-mission-control-5.16.4/src/mcd-connection-service-points.c0000644000175000017500000001214312735242352026626 0ustar00gkiagiagkiagia00000000000000/* * This file is part of mission-control * * Copyright © 2011 Nokia Corporation. * Copyright © 2011 Collabora Ltd. * * Contact: Vivek Dasmohapatra * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * version 2.1 as published by the Free Software Foundation. * * This library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA * */ #include "config.h" #include "mcd-connection-service-points.h" #include "mcd-connection-priv.h" #include #include static void service_point_contact_cb (GObject *source, GAsyncResult *result, gpointer user_data) { McdConnection *connection = MCD_CONNECTION (user_data); TpContact *contact = tp_connection_dup_contact_by_id_finish ( TP_CONNECTION (source), result, NULL); if (contact != NULL) { mcd_connection_add_emergency_handle (connection, tp_contact_get_handle (contact)); g_object_unref (contact); } g_object_unref (connection); } static void parse_services_list (McdConnection *connection, const GPtrArray *services) { guint i; GSList *e_numbers = NULL; for (i = 0; i < services->len; i++) { GValueArray *sp_info; GValueArray *sp; gchar **numbers; guint type; sp_info = g_ptr_array_index (services, i); sp = g_value_get_boxed (sp_info->values); type = g_value_get_uint (sp->values); if (type == TP_SERVICE_POINT_TYPE_EMERGENCY) { numbers = g_value_dup_boxed (sp_info->values + 1); e_numbers = g_slist_prepend (e_numbers, numbers); } } if (e_numbers != NULL) { GSList *service; TpConnection *tp_conn = mcd_connection_get_tp_connection (connection); /* FIXME: in 1.0, drop this and spec that when calling a service point, * you should use TargetID. See * https://bugs.freedesktop.org/show_bug.cgi?id=59162#c3 */ for (service = e_numbers; service != NULL; service =g_slist_next (service)) { const gchar * const *iter; for (iter = service->data; iter != NULL && *iter != NULL; iter++) tp_connection_dup_contact_by_id_async (tp_conn, *iter, 0, NULL, service_point_contact_cb, g_object_ref (connection)); } _mcd_connection_take_emergency_numbers (connection, e_numbers); } } static void service_points_changed_cb (TpConnection *proxy, const GPtrArray *service_points, gpointer user_data G_GNUC_UNUSED, GObject *object) { McdConnection *connection = MCD_CONNECTION (object); parse_services_list (connection, service_points); } static void service_points_fetched_cb (TpProxy *proxy, const GValue *value, const GError *error, gpointer user_data G_GNUC_UNUSED, GObject *object) { McdConnection *connection = MCD_CONNECTION (object); if (error) { g_warning ("%s: got error: %s", G_STRFUNC, error->message); return; } parse_services_list (connection, g_value_get_boxed (value)); } static void service_point_interface_check (TpConnection *tp_conn, const gchar **interfaces, const GError *error, gpointer data, GObject *connection) { const gchar *interface; gboolean found = FALSE; gboolean watch = GPOINTER_TO_UINT (data); guint i = 0; if (interfaces == NULL) return; for (interface = interfaces[0]; !found && !tp_str_empty (interface); interface = interfaces[++i]) { if (!tp_strdiff (interface, TP_IFACE_CONNECTION_INTERFACE_SERVICE_POINT)) found = TRUE; } if (!found) return; /* so we know if/when the service points change (eg the SIM might not be * accessible yet, in which case the call below won't return any entries) * check the flag though as we only want to do this once per connection: */ if (watch) tp_cli_connection_interface_service_point_connect_to_service_points_changed (tp_conn, service_points_changed_cb, NULL, NULL, connection, NULL); /* fetch the current list to initialise our state */ tp_cli_dbus_properties_call_get (tp_conn, -1, TP_IFACE_CONNECTION_INTERFACE_SERVICE_POINT, "KnownServicePoints", service_points_fetched_cb, NULL, NULL, connection); } void mcd_connection_service_point_setup (McdConnection *connection, gboolean watch) { TpConnection *tp_conn = mcd_connection_get_tp_connection (connection); if (G_UNLIKELY (!tp_conn)) return; /* see if the connection supports the service point interface */ tp_cli_connection_call_get_interfaces (tp_conn, -1, service_point_interface_check, GUINT_TO_POINTER (watch), NULL, G_OBJECT (connection)); } telepathy-mission-control-5.16.4/src/mcd-misc.c0000644000175000017500000001337012735242352022455 0ustar00gkiagiagkiagia00000000000000/* vi: set et sw=4 ts=4 cino=t0,(0: */ /* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * This file is part of mission-control * * Copyright (C) 2005-2009 Nokia Corporation. * Copyright (C) 2005-2009 Collabora Ltd. * * Contact: Alberto Mardegan * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * version 2.1 as published by the Free Software Foundation. * * This library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA * */ #include "config.h" #include "mcd-misc.h" #include #include #include #include #include #include #include #include "mcd-debug.h" #include "_gen/signals-marshal.h" #include "_gen/register-dbus-glib-marshallers-body.h" #include #include /* * Miscellaneus functions */ GHashTable * _mcd_deepcopy_asv (GHashTable *asv) { GHashTable *copy; copy = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, (GDestroyNotify)tp_g_value_slice_free); tp_g_hash_table_update (copy, asv, (GBoxedCopyFunc) g_strdup, (GBoxedCopyFunc) tp_g_value_slice_dup); return copy; } gchar * _mcd_build_error_string (const GError *error) { GEnumValue *value; GEnumClass *klass; const gchar *prefix; if (error->domain == TP_ERROR) { klass = g_type_class_ref (TP_TYPE_ERROR); prefix = TP_ERROR_PREFIX; } else return NULL; value = g_enum_get_value (klass, error->code); g_type_class_unref (klass); if (G_LIKELY (value && value->value_nick)) return g_strconcat (prefix, ".", value->value_nick, NULL); else return NULL; } typedef struct { McdReadyCb callback; gpointer user_data; } McdReadyCbData; typedef struct { gpointer strukt; GSList *callbacks; } McdReadyData; static void mcd_object_invoke_ready_callbacks (McdReadyData *rd, const GError *error) { GSList *list; for (list = rd->callbacks; list != NULL; list = list->next) { McdReadyCbData *cb = list->data; cb->callback (rd->strukt, error, cb->user_data); g_slice_free (McdReadyCbData, cb); } g_slist_free (rd->callbacks); } static void mcd_ready_data_free (McdReadyData *rd) { if (rd->strukt) { GError error = { TP_ERROR, TP_ERROR_CANCELLED, "Object disposed" }; mcd_object_invoke_ready_callbacks (rd, &error); } g_slice_free (McdReadyData, rd); } void _mcd_object_call_when_ready (gpointer object, GQuark quark, McdReadyCb callback, gpointer user_data) { _mcd_object_call_on_struct_when_ready (object, object, quark, callback, user_data); } void _mcd_object_call_on_struct_when_ready (gpointer object, gpointer strukt, GQuark quark, McdReadyCb callback, gpointer user_data) { McdReadyData *rd; McdReadyCbData *cb; g_return_if_fail (G_IS_OBJECT (object)); g_return_if_fail (quark != 0); g_return_if_fail (callback != NULL); cb = g_slice_new (McdReadyCbData); cb->callback = callback; cb->user_data = user_data; rd = g_object_get_qdata ((GObject *)object, quark); if (!rd) { rd = g_slice_new (McdReadyData); rd->strukt = strukt; rd->callbacks = NULL; g_object_set_qdata_full ((GObject *)object, quark, rd, (GDestroyNotify)mcd_ready_data_free); } rd->callbacks = g_slist_prepend (rd->callbacks, cb); } void _mcd_object_ready (gpointer object, GQuark quark, const GError *error) { McdReadyData *rd; /* steal the qdata so the callbacks won't be invoked again, even if the * object becomes ready or is finalized while still invoking them */ rd = g_object_steal_qdata ((GObject *)object, quark); if (!rd) return; g_object_ref (object); mcd_object_invoke_ready_callbacks (rd, error); rd->strukt = NULL; /* so the callbacks won't be invoked again */ mcd_ready_data_free (rd); g_object_unref (object); } gboolean mcd_ensure_directory (const gchar *dir, GError **error) { DEBUG ("%s", dir); if (g_mkdir_with_parents (dir, 0700) != 0) { g_set_error (error, TP_ERROR, TP_ERROR_NOT_AVAILABLE, "Unable to create directory '%s': %s", dir, g_strerror (errno)); return FALSE; } return TRUE; } int _mcd_chmod_private (const gchar *filename) { struct stat buf; int ret; ret = g_stat (filename, &buf); if (ret < 0) { DEBUG ("g_stat(%s): %s", filename, g_strerror (errno)); return ret; } if ((buf.st_mode & 0077) != 0) { DEBUG ("chmod go-rwx %s", filename); ret = g_chmod (filename, (buf.st_mode & ~0077)); if (ret < 0) { DEBUG ("g_chmod: %s", g_strerror (errno)); } } return ret; } gboolean mcd_nullable_variant_equal (GVariant *a, GVariant *b) { if (a == b) return TRUE; if (a == NULL || b == NULL) return FALSE; return g_variant_equal (a, b); } telepathy-mission-control-5.16.4/src/mcd-account-manager-sso.h0000644000175000017500000000656112735242352025401 0ustar00gkiagiagkiagia00000000000000/* * The SSO/libaccounts-glib manager keyfile storage pseudo-plugin * * Copyright © 2010 Nokia Corporation * Copyright © 2010 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #ifndef __MCD_ACCOUNT_MANAGER_SSO_H__ #define __MCD_ACCOUNT_MANAGER_SSO_H__ G_BEGIN_DECLS #define MCD_TYPE_ACCOUNT_MANAGER_SSO \ (mcd_account_manager_sso_get_type ()) #define MCD_ACCOUNT_MANAGER_SSO(o) \ (G_TYPE_CHECK_INSTANCE_CAST ((o), MCD_TYPE_ACCOUNT_MANAGER_SSO, \ McdAccountManagerSso)) #define MCD_ACCOUNT_MANAGER_SSO_CLASS(k) \ (G_TYPE_CHECK_CLASS_CAST((k), MCD_TYPE_ACCOUNT_MANAGER_SSO, \ McdAccountManagerSsoClass)) #define MCD_IS_ACCOUNT_MANAGER_SSO(o) \ (G_TYPE_CHECK_INSTANCE_TYPE ((o), MCD_TYPE_ACCOUNT_MANAGER_SSO)) #define MCD_IS_ACCOUNT_MANAGER_SSO_CLASS(k) \ (G_TYPE_CHECK_CLASS_TYPE ((k), MCD_TYPE_ACCOUNT_MANAGER_SSO)) #define MCD_ACCOUNT_MANAGER_SSO_GET_CLASS(o) \ (G_TYPE_INSTANCE_GET_CLASS ((o), MCD_TYPE_ACCOUNT_MANAGER_SSO, \ McdAccountManagerSsoClass)) typedef struct { GObject parent; GHashTable *accounts; GHashTable *id_name_map; GHashTable *watches; GQueue *pending_signals; AgManager *ag_manager; McpAccountManager *manager_interface; gboolean ready; gboolean save; gboolean loaded; guint commit_source; } _McdAccountManagerSso; typedef struct { GObjectClass parent_class; /* In the libaccounts model, each account has a number of associated * 'services'; for example, you might have a Google account with Google Talk, * Google Mail, Google Calendar, etc. services. Each service is of a * particular service type; for instance, the service named "google-talk" is * of type "IM". * * Typically we care about the "IM" service type for Telepathy purposes; but * we allow for the possibility of a subclass which cares about some other * service type. */ const gchar *service_type; } _McdAccountManagerSsoClass; typedef _McdAccountManagerSso McdAccountManagerSso; typedef _McdAccountManagerSsoClass McdAccountManagerSsoClass; GType mcd_account_manager_sso_get_type (void) G_GNUC_CONST; McdAccountManagerSso *mcd_account_manager_sso_new (void); /* FIXME: we shouldn't need to expose this. Subclasses should be able to chain * up to the parent class's implementation of the interface method, but they * can't because McpAccountStorageIface isn't exposed. See * . */ gboolean _mcd_account_manager_sso_get ( const McpAccountStorage *self, const McpAccountManager *am, const gchar *account_suffix, const gchar *key); G_END_DECLS #endif telepathy-mission-control-5.16.4/src/mcd-service.h0000644000175000017500000000424212735241312023160 0ustar00gkiagiagkiagia00000000000000/* vi: set et sw=4 ts=8 cino=t0,(0: */ /* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4; tab-width: 8 -*- */ /* * This file is part of mission-control * * Copyright (C) 2007 Nokia Corporation. * * Contact: Naba Kumar * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * version 2.1 as published by the Free Software Foundation. * * This library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA * */ #ifndef MCD_OBJECT_H #define MCD_OBJECT_H #include #include #include "mcd-master.h" #define MCD_TYPE_SERVICE (mcd_service_get_type ()) #define MCD_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_CAST \ ((obj), MCD_TYPE_SERVICE, \ McdService)) #define MCD_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST \ ((klass), MCD_TYPE_SERVICE, \ McdServiceClass)) #define MCD_IS_SERVICE(obj) (G_TYPE_CHECK_INSTANCE_TYPE \ ((obj), MCD_TYPE_SERVICE)) #define MCD_IS_SERVICE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE \ ((klass), MCD_TYPE_SERVICE)) #define MCD_OBJECT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS \ ((obj), MCD_TYPE_SERVICE, \ McdServiceClass)) typedef struct _McdService McdService; typedef struct _McdServiceClass McdServiceClass; struct _McdServiceClass { McdMasterClass parent_class; }; struct _McdService { McdMaster parent; GMainLoop *main_loop; }; GType mcd_service_get_type (void); McdService *mcd_service_new (void); void mcd_service_run (McdService * self); void mcd_service_stop (McdService * self); #endif telepathy-mission-control-5.16.4/src/mcd-client-priv.h0000644000175000017500000001114512735242352023761 0ustar00gkiagiagkiagia00000000000000/* vi: set et sw=4 ts=8 cino=t0,(0: */ /* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4; tab-width: 8 -*- */ /* * Mission Control client proxy. * * Copyright (C) 2009-2010 Nokia Corporation * Copyright (C) 2009-2010 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA * */ #ifndef MCD_CLIENT_PRIV_H #define MCD_CLIENT_PRIV_H #include #include #include #include G_BEGIN_DECLS typedef struct _McdClientProxy McdClientProxy; typedef struct _McdClientProxyClass McdClientProxyClass; typedef struct _McdClientProxyPrivate McdClientProxyPrivate; struct _McdClientProxy { TpClient parent; McdClientProxyPrivate *priv; }; struct _McdClientProxyClass { TpClientClass parent_class; }; G_GNUC_INTERNAL GType _mcd_client_proxy_get_type (void); #define MCD_TYPE_CLIENT_PROXY \ (_mcd_client_proxy_get_type ()) #define MCD_CLIENT_PROXY(obj) \ (G_TYPE_CHECK_INSTANCE_CAST ((obj), MCD_TYPE_CLIENT_PROXY, \ McdClientProxy)) #define MCD_CLIENT_PROXY_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST ((klass), MCD_TYPE_CLIENT_PROXY, \ McdClientProxyClass)) #define MCD_IS_CLIENT_PROXY(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MCD_TYPE_CLIENT_PROXY)) #define MCD_IS_CLIENT_PROXY_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE ((klass), MCD_TYPE_CLIENT_PROXY)) #define MCD_CLIENT_PROXY_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), MCD_TYPE_CLIENT_PROXY, \ McdClientProxyClass)) G_GNUC_INTERNAL McdClientProxy *_mcd_client_proxy_new ( TpDBusDaemon *dbus_daemon, const gchar *well_known_name, const gchar *unique_name_if_known, gboolean activatable); G_GNUC_INTERNAL gboolean _mcd_client_proxy_is_ready (McdClientProxy *self); G_GNUC_INTERNAL gboolean _mcd_client_check_valid_name ( const gchar *name_suffix, GError **error); G_GNUC_INTERNAL gboolean _mcd_client_proxy_is_active (McdClientProxy *self); G_GNUC_INTERNAL gboolean _mcd_client_proxy_is_activatable (McdClientProxy *self); G_GNUC_INTERNAL const gchar *_mcd_client_proxy_get_unique_name ( McdClientProxy *self); G_GNUC_INTERNAL void _mcd_client_proxy_set_inactive (McdClientProxy *self); G_GNUC_INTERNAL void _mcd_client_proxy_set_active (McdClientProxy *self, const gchar *unique_name); G_GNUC_INTERNAL void _mcd_client_proxy_set_activatable (McdClientProxy *self); G_GNUC_INTERNAL const GList *_mcd_client_proxy_get_approver_filters (McdClientProxy *self); G_GNUC_INTERNAL const GList *_mcd_client_proxy_get_observer_filters (McdClientProxy *self); G_GNUC_INTERNAL const GList *_mcd_client_proxy_get_handler_filters (McdClientProxy *self); G_GNUC_INTERNAL gboolean _mcd_client_proxy_get_bypass_approval (McdClientProxy *self); G_GNUC_INTERNAL gboolean _mcd_client_proxy_get_bypass_observers (McdClientProxy *self); G_GNUC_INTERNAL gboolean _mcd_client_proxy_get_delay_approvers (McdClientProxy *self); G_GNUC_INTERNAL GValueArray *_mcd_client_proxy_dup_handler_capabilities ( McdClientProxy *self); G_GNUC_INTERNAL void _mcd_client_proxy_inc_ready_lock (McdClientProxy *self); G_GNUC_INTERNAL void _mcd_client_proxy_dec_ready_lock (McdClientProxy *self); #define MC_CLIENT_BUS_NAME_BASE_LEN (sizeof (TP_CLIENT_BUS_NAME_BASE) - 1) G_GNUC_INTERNAL guint _mcd_client_match_filters ( GVariant *channel_properties, const GList *filters, gboolean assume_requested); G_GNUC_INTERNAL void _mcd_client_proxy_handle_channels (McdClientProxy *self, gint timeout_ms, const GList *channels, gint64 user_action_time, GHashTable *handler_info, tp_cli_client_handler_callback_for_handle_channels callback, gpointer user_data, GDestroyNotify destroy, GObject *weak_object); G_GNUC_INTERNAL void _mcd_client_recover_observer (McdClientProxy *self, TpChannel *channel, const gchar *account_path); G_END_DECLS #endif telepathy-mission-control-5.16.4/src/mcd-handler-map-priv.h0000644000175000017500000000667712735241312024704 0ustar00gkiagiagkiagia00000000000000/* vi: set et sw=4 ts=8 cino=t0,(0: */ /* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4; tab-width: 8 -*- */ /* * Keep track of which handlers own which channels. * * Copyright (C) 2009 Nokia Corporation * Copyright (C) 2009 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA * */ #ifndef MCD_HANDLER_MAP_H_ #define MCD_HANDLER_MAP_H_ #include G_BEGIN_DECLS typedef struct _McdHandlerMap McdHandlerMap; typedef struct _McdHandlerMapClass McdHandlerMapClass; typedef struct _McdHandlerMapPrivate McdHandlerMapPrivate; GType _mcd_handler_map_get_type (void); #define MCD_TYPE_HANDLER_MAP \ (_mcd_handler_map_get_type ()) #define MCD_HANDLER_MAP(obj) \ (G_TYPE_CHECK_INSTANCE_CAST ((obj), MCD_TYPE_HANDLER_MAP, \ McdHandlerMap)) #define MCD_HANDLER_MAP_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST ((klass), MCD_TYPE_HANDLER_MAP, \ McdHandlerMapClass)) #define MCD_IS_HANDLER_MAP(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MCD_TYPE_HANDLER_MAP)) #define MCD_IS_HANDLER_MAP_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE ((klass), MCD_TYPE_HANDLER_MAP)) #define MCD_HANDLER_MAP_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), MCD_TYPE_HANDLER_MAP, \ McdHandlerMapClass)) struct _McdHandlerMap { GObject parent; McdHandlerMapPrivate *priv; }; struct _McdHandlerMapClass { GObjectClass parent_class; }; McdHandlerMap *_mcd_handler_map_new (TpDBusDaemon *dbus_daemon); const gchar *_mcd_handler_map_get_handler (McdHandlerMap *self, const gchar *channel_path, const gchar **well_known_name); void _mcd_handler_map_set_path_handled (McdHandlerMap *self, const gchar *channel_path, const gchar *unique_name, const gchar *well_known_name); void _mcd_handler_map_set_channel_handled (McdHandlerMap *self, TpChannel *channel, const gchar *unique_name, const gchar *well_known_name, const gchar *account_path); GList *_mcd_handler_map_get_handled_channels (McdHandlerMap *self); const gchar *_mcd_handler_map_get_channel_account (McdHandlerMap *self, const gchar *channel_path); void _mcd_handler_map_set_channel_handled_internally (McdHandlerMap *self, TpChannel *channel, const gchar *account_path); G_END_DECLS #endif telepathy-mission-control-5.16.4/src/mcd-account.c0000644000175000017500000047431112736244113023162 0ustar00gkiagiagkiagia00000000000000/* vi: set et sw=4 ts=8 cino=t0,(0: */ /* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4; tab-width: 8 -*- */ /* * This file is part of mission-control * * Copyright © 2008–2010 Nokia Corporation. * Copyright © 2009–2013 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * version 2.1 as published by the Free Software Foundation. * * This library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA */ #include "config.h" #include "mcd-account.h" #include #include #include #include #include #include #include #include "mcd-account-priv.h" #include "mcd-account-conditions.h" #include "mcd-account-manager-priv.h" #include "mcd-account-addressing.h" #include "mcd-connection-priv.h" #include "mcd-misc.h" #include "mcd-manager.h" #include "mcd-manager-priv.h" #include "mcd-master.h" #include "mcd-master-priv.h" #include "mcd-dbusprop.h" #include "_gen/interfaces.h" #include "_gen/enums.h" #include "_gen/gtypes.h" #include "_gen/cli-Connection_Manager_Interface_Account_Storage-body.h" #define MC_OLD_AVATAR_FILENAME "avatar.bin" #define MCD_ACCOUNT_PRIV(account) (MCD_ACCOUNT (account)->priv) static void account_iface_init (TpSvcAccountClass *iface, gpointer iface_data); static void properties_iface_init (TpSvcDBusPropertiesClass *iface, gpointer iface_data); static void account_avatar_iface_init (TpSvcAccountInterfaceAvatarClass *iface, gpointer iface_data); static void account_storage_iface_init ( TpSvcAccountInterfaceStorageClass *iface, gpointer iface_data); static void account_hidden_iface_init ( McSvcAccountInterfaceHiddenClass *iface, gpointer iface_data); static void account_external_password_storage_iface_init ( McSvcAccountInterfaceExternalPasswordStorageClass *iface, gpointer iface_data); static const McdDBusProp account_properties[]; static const McdDBusProp account_avatar_properties[]; static const McdDBusProp account_storage_properties[]; static const McdDBusProp account_hidden_properties[]; static const McdDBusProp account_external_password_storage_properties[]; static const McdInterfaceData account_interfaces[] = { MCD_IMPLEMENT_IFACE (tp_svc_account_get_type, account, TP_IFACE_ACCOUNT), MCD_IMPLEMENT_IFACE (tp_svc_account_interface_avatar_get_type, account_avatar, TP_IFACE_ACCOUNT_INTERFACE_AVATAR), MCD_IMPLEMENT_IFACE (mc_svc_account_interface_conditions_get_type, account_conditions, MC_IFACE_ACCOUNT_INTERFACE_CONDITIONS), MCD_IMPLEMENT_IFACE (tp_svc_account_interface_storage_get_type, account_storage, TP_IFACE_ACCOUNT_INTERFACE_STORAGE), MCD_IMPLEMENT_IFACE (tp_svc_account_interface_addressing_get_type, account_addressing, TP_IFACE_ACCOUNT_INTERFACE_ADDRESSING), MCD_IMPLEMENT_IFACE (mc_svc_account_interface_hidden_get_type, account_hidden, MC_IFACE_ACCOUNT_INTERFACE_HIDDEN), MCD_IMPLEMENT_OPTIONAL_IFACE ( mc_svc_account_interface_external_password_storage_get_type, account_external_password_storage, MC_IFACE_ACCOUNT_INTERFACE_EXTERNAL_PASSWORD_STORAGE), { NULL, } }; G_DEFINE_TYPE_WITH_CODE (McdAccount, mcd_account, G_TYPE_OBJECT, MCD_DBUS_INIT_INTERFACES (account_interfaces); G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_DBUS_PROPERTIES, properties_iface_init); ) typedef struct { McdOnlineRequestCb callback; gpointer user_data; } McdOnlineRequestData; struct _McdAccountPrivate { gchar *unique_name; gchar *object_path; gchar *manager_name; gchar *protocol_name; TpConnection *tp_connection; TpContact *self_contact; McdConnection *connection; McdManager *manager; McdStorage *storage; TpDBusDaemon *dbus_daemon; gboolean registered; McdConnectivityMonitor *connectivity; McdAccountConnectionContext *connection_context; GKeyFile *keyfile; /* configuration file */ McpAccountStorage *storage_plugin; GPtrArray *supersedes; /* connection status */ TpConnectionStatus conn_status; TpConnectionStatusReason conn_reason; gchar *conn_dbus_error; GHashTable *conn_error_details; /* current presence fields */ TpConnectionPresenceType curr_presence_type; gchar *curr_presence_status; gchar *curr_presence_message; /* requested presence fields */ TpConnectionPresenceType req_presence_type; gchar *req_presence_status; gchar *req_presence_message; /* automatic presence fields */ TpConnectionPresenceType auto_presence_type; gchar *auto_presence_status; /* TODO: consider loading these from the configuration file as needed */ gchar *auto_presence_message; GList *online_requests; /* list of McdOnlineRequestData structures (callback with user data) to be called when the account will be online */ /* %NULL if the account is valid; a valid error for reporting over the * D-Bus if the account is invalid. */ GError *invalid_reason; gboolean connect_automatically; gboolean enabled; gboolean loaded; gboolean has_been_online; gboolean removed; gboolean always_on; gboolean changing_presence; gboolean setting_avatar; gboolean waiting_for_initial_avatar; gboolean waiting_for_connectivity; gboolean hidden; /* In addition to affecting dispatching, this flag also makes this * account bypass connectivity checks. */ gboolean always_dispatch; /* These fields are used to cache the changed properties */ gboolean properties_frozen; GHashTable *changed_properties; guint properties_source; gboolean password_saved; }; enum { PROP_0, PROP_DBUS_DAEMON, PROP_CONNECTIVITY_MONITOR, PROP_STORAGE, PROP_NAME, PROP_ALWAYS_ON, PROP_HIDDEN, }; enum { VALIDITY_CHANGED, CONNECTION_PATH_CHANGED, LAST_SIGNAL }; static guint _mcd_account_signals[LAST_SIGNAL] = { 0 }; static GQuark account_ready_quark = 0; GQuark mcd_account_error_quark (void) { static GQuark quark = 0; if (quark == 0) quark = g_quark_from_static_string ("mcd-account-error"); return quark; } /* * _mcd_account_maybe_autoconnect: * @account: the #McdAccount. * * Check whether automatic connection should happen (and attempt it if needed). */ void _mcd_account_maybe_autoconnect (McdAccount *account) { McdAccountPrivate *priv; g_return_if_fail (MCD_IS_ACCOUNT (account)); priv = account->priv; if (!mcd_account_would_like_to_connect (account)) { return; } if (_mcd_account_needs_dispatch (account)) { DEBUG ("Always-dispatchable account %s needs no transport", priv->unique_name); } else if (mcd_connectivity_monitor_is_online (priv->connectivity)) { DEBUG ("Account %s has connectivity, connecting", priv->unique_name); } else { DEBUG ("Account %s needs connectivity, not connecting", priv->unique_name); } DEBUG ("connecting account %s", priv->unique_name); _mcd_account_connect_with_auto_presence (account, FALSE); } static gboolean value_is_same (const GValue *val1, const GValue *val2) { g_return_val_if_fail (val1 != NULL && val2 != NULL, FALSE); switch (G_VALUE_TYPE (val1)) { case G_TYPE_STRING: return g_strcmp0 (g_value_get_string (val1), g_value_get_string (val2)) == 0; case G_TYPE_CHAR: case G_TYPE_UCHAR: case G_TYPE_INT: case G_TYPE_UINT: case G_TYPE_BOOLEAN: return val1->data[0].v_uint == val2->data[0].v_uint; case G_TYPE_INT64: return g_value_get_int64 (val1) == g_value_get_int64 (val2); case G_TYPE_UINT64: return g_value_get_uint64 (val1) == g_value_get_uint64 (val2); case G_TYPE_DOUBLE: return g_value_get_double (val1) == g_value_get_double (val2); default: if (G_VALUE_TYPE (val1) == DBUS_TYPE_G_OBJECT_PATH) { return !tp_strdiff (g_value_get_boxed (val1), g_value_get_boxed (val2)); } else if (G_VALUE_TYPE (val1) == G_TYPE_STRV) { gchar **left = g_value_get_boxed (val1); gchar **right = g_value_get_boxed (val2); if (left == NULL || right == NULL || *left == NULL || *right == NULL) { return ((left == NULL || *left == NULL) && (right == NULL || *right == NULL)); } while (*left != NULL || *right != NULL) { if (tp_strdiff (*left, *right)) { return FALSE; } left++; right++; } return TRUE; } else { g_warning ("%s: unexpected type %s", G_STRFUNC, G_VALUE_TYPE_NAME (val1)); return FALSE; } } } static void mcd_account_loaded (McdAccount *account) { g_return_if_fail (!account->priv->loaded); account->priv->loaded = TRUE; /* invoke all the callbacks */ g_object_ref (account); _mcd_object_ready (account, account_ready_quark, NULL); if (account->priv->online_requests != NULL) { /* if we have established that the account is not valid or is * disabled, cancel all requests */ if (!mcd_account_is_valid (account) || !account->priv->enabled) { /* FIXME: pick better errors and put them in telepathy-spec? */ GError e = { TP_ERROR, TP_ERROR_NOT_AVAILABLE, "account isn't Valid (not enough information to put it " "online)" }; GList *list; if (mcd_account_is_valid (account)) { e.message = "account isn't Enabled"; } list = account->priv->online_requests; account->priv->online_requests = NULL; for (/* already initialized */ ; list != NULL; list = g_list_delete_link (list, list)) { McdOnlineRequestData *data = list->data; data->callback (account, data->user_data, &e); g_slice_free (McdOnlineRequestData, data); } } /* otherwise, we want to go online now */ if (account->priv->conn_status == TP_CONNECTION_STATUS_DISCONNECTED) { _mcd_account_connect_with_auto_presence (account, TRUE); } } _mcd_account_maybe_autoconnect (account); g_object_unref (account); } /* * _mcd_account_set_parameter: * @account: the #McdAccount. * @name: the parameter name. * @value: a #GValue with the value to set, or %NULL. * * Sets the parameter @name to the value in @value. If @value, is %NULL, the * parameter is unset. */ static void _mcd_account_set_parameter (McdAccount *account, const gchar *name, const GValue *value) { McdAccountPrivate *priv = account->priv; McdStorage *storage = priv->storage; const gchar *account_name = mcd_account_get_unique_name (account); gboolean secret = mcd_account_parameter_is_secret (account, name); mcd_storage_set_parameter (storage, account_name, name, value, secret); } static GType mc_param_type (const TpConnectionManagerParam *param); /** * mcd_account_get_parameter: * @account: the #McdAccount. * @name: the parameter name. * @parameter: location at which to store the parameter's current value, or * %NULL if you don't actually care about the parameter's value. * @error: location at which to store an error if the parameter cannot be * retrieved. * * Get the @name parameter for @account. * * Returns: %TRUE if the parameter could be retrieved; %FALSE otherwise */ gboolean mcd_account_get_parameter (McdAccount *account, const gchar *name, GValue *parameter, GError **error) { McdAccountPrivate *priv = account->priv; const TpConnectionManagerParam *param; GType type; param = mcd_manager_get_protocol_param (priv->manager, priv->protocol_name, name); type = mc_param_type (param); return mcd_account_get_parameter_of_known_type (account, name, type, parameter, error); } gboolean mcd_account_get_parameter_of_known_type (McdAccount *account, const gchar *name, GType type, GValue *parameter, GError **error) { const gchar *account_name = mcd_account_get_unique_name (account); McdStorage *storage = account->priv->storage; GValue tmp = G_VALUE_INIT; g_value_init (&tmp, type); if (mcd_storage_get_parameter (storage, account_name, name, &tmp, error)) { if (parameter != NULL) { memcpy (parameter, &tmp, sizeof (tmp)); } return TRUE; } return FALSE; } typedef void (*CheckParametersCb) ( McdAccount *account, const GError *invalid_reason, gpointer user_data); static void mcd_account_check_parameters (McdAccount *account, CheckParametersCb callback, gpointer user_data); static void manager_ready_check_params_cb (McdAccount *account, const GError *invalid_reason, gpointer user_data) { McdAccountPrivate *priv = account->priv; g_clear_error (&priv->invalid_reason); if (invalid_reason != NULL) { priv->invalid_reason = g_error_copy (invalid_reason); } mcd_account_loaded (account); } static void account_external_password_storage_get_accounts_cb (TpProxy *cm, const GValue *value, const GError *in_error, gpointer user_data, GObject *self) { McdAccount *account = MCD_ACCOUNT (self); const char *account_id = user_data; GHashTable *map, *props; if (in_error != NULL) { DEBUG ("Failed to get Account property: %s", in_error->message); return; } g_return_if_fail (G_VALUE_HOLDS (value, MC_HASH_TYPE_ACCOUNT_FLAGS_MAP)); map = g_value_get_boxed (value); account->priv->password_saved = GPOINTER_TO_UINT (g_hash_table_lookup (map, account_id)) & MC_ACCOUNT_FLAG_CREDENTIALS_STORED; DEBUG ("PasswordSaved = %u", account->priv->password_saved); /* emit the changed signal */ props = tp_asv_new ( "PasswordSaved", G_TYPE_BOOLEAN, account->priv->password_saved, NULL); tp_svc_dbus_properties_emit_properties_changed (account, MC_IFACE_ACCOUNT_INTERFACE_EXTERNAL_PASSWORD_STORAGE, props, NULL); g_hash_table_unref (props); } static void account_setup_identify_account_cb (TpProxy *protocol, const char *account_id, const GError *in_error, gpointer user_data, GObject *self) { McdAccount *account = MCD_ACCOUNT (self); TpConnectionManager *cm = mcd_account_get_cm (account); if (in_error != NULL) { DEBUG ("Error identifying account: %s", in_error->message); return; } DEBUG ("Identified account as %s", account_id); /* look up the current value of the CM.I.AS.Accounts property * and monitor future changes */ tp_cli_dbus_properties_call_get (cm, -1, MC_IFACE_CONNECTION_MANAGER_INTERFACE_ACCOUNT_STORAGE, "Accounts", account_external_password_storage_get_accounts_cb, g_strdup (account_id), g_free, G_OBJECT (account)); } static void account_external_password_storage_properties_changed_cb (TpProxy *cm, const char *iface, GHashTable *changed_properties, const char **invalidated_properties, gpointer user_data, GObject *self) { McdAccount *account = MCD_ACCOUNT (self); TpProtocol *protocol = tp_connection_manager_get_protocol_object ( TP_CONNECTION_MANAGER (cm), account->priv->protocol_name); GHashTable *params; if (tp_strdiff (iface, MC_IFACE_CONNECTION_MANAGER_INTERFACE_ACCOUNT_STORAGE)) return; /* look up account identity so we can look up our value in * the Accounts map */ params = _mcd_account_dup_parameters (account); tp_cli_protocol_call_identify_account (protocol, -1, params, account_setup_identify_account_cb, NULL, NULL, G_OBJECT (account)); g_hash_table_unref (params); } static void on_manager_ready (McdManager *manager, const GError *error, gpointer user_data) { McdAccount *account = MCD_ACCOUNT (user_data); if (error) { DEBUG ("got error: %s", error->message); mcd_account_loaded (account); } else { TpConnectionManager *cm = mcd_manager_get_tp_proxy (manager); mcd_account_check_parameters (account, manager_ready_check_params_cb, NULL); /* determine if we support Acct.I.ExternalPasswordStorage */ if (tp_proxy_has_interface_by_id (cm, MC_IFACE_QUARK_CONNECTION_MANAGER_INTERFACE_ACCOUNT_STORAGE)) { TpProtocol *protocol = tp_connection_manager_get_protocol_object ( cm, account->priv->protocol_name); GHashTable *params; DEBUG ("CM %s has CM.I.AccountStorage iface", mcd_manager_get_name (manager)); mcd_dbus_activate_optional_interface ( TP_SVC_DBUS_PROPERTIES (account), MC_TYPE_SVC_ACCOUNT_INTERFACE_EXTERNAL_PASSWORD_STORAGE); /* look up account identity so we can look up our value in * the Accounts map */ params = _mcd_account_dup_parameters (account); tp_cli_protocol_call_identify_account (protocol, -1, params, account_setup_identify_account_cb, NULL, NULL, G_OBJECT (account)); tp_cli_dbus_properties_connect_to_properties_changed (cm, account_external_password_storage_properties_changed_cb, NULL, NULL, G_OBJECT (account), NULL); g_hash_table_unref (params); } } } static gboolean load_manager (McdAccount *account) { McdAccountPrivate *priv = account->priv; McdMaster *master; if (G_UNLIKELY (!priv->manager_name)) return FALSE; master = mcd_master_get_default (); priv->manager = _mcd_master_lookup_manager (master, priv->manager_name); if (priv->manager) { g_object_ref (priv->manager); mcd_manager_call_when_ready (priv->manager, on_manager_ready, account); return TRUE; } else return FALSE; } /* Returns the data dir for the given account name. * Returned string must be freed by caller. */ static gchar * get_old_account_data_path (McdAccountPrivate *priv) { const gchar *base; base = g_getenv ("MC_ACCOUNT_DIR"); if (!base) base = ACCOUNTS_DIR; if (!base) return NULL; if (base[0] == '~') return g_build_filename (g_get_home_dir(), base + 1, priv->unique_name, NULL); else return g_build_filename (base, priv->unique_name, NULL); } static void account_delete_identify_account_cb (TpProxy *protocol, const char *account_id, const GError *in_error, gpointer user_data, GObject *self) { McdAccount *account = MCD_ACCOUNT (self); TpConnectionManager *cm = mcd_account_get_cm (account); if (in_error != NULL) { DEBUG ("Error identifying account: %s", in_error->message); } else { DEBUG ("Identified account as %s", account_id); mc_cli_connection_manager_interface_account_storage_call_remove_account ( cm, -1, account_id, NULL, NULL, NULL, NULL); } g_object_unref (account); } static void unregister_dbus_service (McdAccount *self) { DBusGConnection *dbus_connection; g_return_if_fail (MCD_IS_ACCOUNT (self)); if (!self->priv->registered) return; dbus_connection = tp_proxy_get_dbus_connection (self->priv->dbus_daemon); dbus_g_connection_unregister_g_object (dbus_connection, (GObject *) self); self->priv->registered = FALSE; } void mcd_account_delete (McdAccount *account, McdAccountDeleteCb callback, gpointer user_data) { McdAccountPrivate *priv = account->priv; gchar *data_dir_str; GError *error = NULL; const gchar *name = mcd_account_get_unique_name (account); TpConnectionManager *cm = mcd_account_get_cm (account); /* if the CM implements CM.I.AccountStorage, we need to tell the CM * to forget any account credentials it knows */ if (tp_proxy_has_interface_by_id (cm, MC_IFACE_QUARK_CONNECTION_MANAGER_INTERFACE_ACCOUNT_STORAGE)) { TpProtocol *protocol; GHashTable *params; /* identify the account */ protocol = tp_connection_manager_get_protocol_object (cm, account->priv->protocol_name); params = _mcd_account_dup_parameters (account); tp_cli_protocol_call_identify_account (protocol, -1, params, account_delete_identify_account_cb, NULL, NULL, g_object_ref (account)); g_hash_table_unref (params); } /* got to turn the account off before removing it, otherwise we can * * end up with an orphaned CM holding the account online */ if (!_mcd_account_set_enabled (account, FALSE, FALSE, MCD_DBUS_PROP_SET_FLAG_NONE, &error)) { g_warning ("could not disable account %s (%s)", name, error->message); callback (account, error, user_data); g_error_free (error); return; } mcd_storage_delete_account (priv->storage, name); data_dir_str = get_old_account_data_path (priv); if (data_dir_str != NULL) { GDir *data_dir = g_dir_open (data_dir_str, 0, NULL); if (data_dir) { const gchar *filename; while ((filename = g_dir_read_name (data_dir)) != NULL) { gchar *path = g_build_filename (data_dir_str, filename, NULL); g_remove (path); g_free (path); } g_dir_close (data_dir); g_rmdir (data_dir_str); } g_free (data_dir_str); } mcd_storage_commit (priv->storage, name); /* The callback may drop the latest ref on @account so make sure it stays * alive while we still need it. */ g_object_ref (account); if (callback != NULL) callback (account, NULL, user_data); /* If the account was not removed via the DBus Account interface code * * path and something is holding a ref to it so it does not get disposed, * * then this signal may not get fired, so we make sure it _does_ here */ if (!priv->removed) { DEBUG ("Forcing Account.Removed for %s", name); priv->removed = TRUE; tp_svc_account_emit_removed (account); } unregister_dbus_service (account); g_object_unref (account); } void _mcd_account_load (McdAccount *account, McdAccountLoadCb callback, gpointer user_data) { if (account->priv->loaded) callback (account, NULL, user_data); else _mcd_object_call_when_ready (account, account_ready_quark, (McdReadyCb)callback, user_data); } static void on_connection_abort (McdConnection *connection, McdAccount *account) { McdAccountPrivate *priv = MCD_ACCOUNT_PRIV (account); DEBUG ("called (%p, account %s)", connection, priv->unique_name); _mcd_account_set_connection (account, NULL); } static void mcd_account_changed_property (McdAccount *account, const gchar *key, const GValue *value); static void mcd_account_request_presence_int (McdAccount *account, TpConnectionPresenceType type, const gchar *status, const gchar *message, gboolean user_initiated) { McdAccountPrivate *priv = account->priv; gboolean changed = FALSE; if (priv->req_presence_type != type) { priv->req_presence_type = type; changed = TRUE; } if (tp_strdiff (priv->req_presence_status, status)) { g_free (priv->req_presence_status); priv->req_presence_status = g_strdup (status); changed = TRUE; } if (tp_strdiff (priv->req_presence_message, message)) { g_free (priv->req_presence_message); priv->req_presence_message = g_strdup (message); changed = TRUE; } if (changed) { GValue value = G_VALUE_INIT; g_value_init (&value, TP_STRUCT_TYPE_SIMPLE_PRESENCE); g_value_take_boxed (&value, tp_value_array_build (3, G_TYPE_UINT, type, G_TYPE_STRING, status, G_TYPE_STRING, message, G_TYPE_INVALID)); mcd_account_changed_property (account, "RequestedPresence", &value); g_value_unset (&value); } DEBUG ("Requested presence: %u %s %s", priv->req_presence_type, priv->req_presence_status, priv->req_presence_message); if (type >= TP_CONNECTION_PRESENCE_TYPE_AVAILABLE) { if (!priv->enabled) { DEBUG ("%s not Enabled", priv->unique_name); return; } if (!mcd_account_is_valid (account)) { DEBUG ("%s not Valid", priv->unique_name); return; } } if (priv->connection == NULL) { if (type >= TP_CONNECTION_PRESENCE_TYPE_AVAILABLE) { if (changed) { _mcd_account_set_changing_presence (account, TRUE); } _mcd_account_connection_begin (account, user_initiated); } } else { if (changed) { _mcd_account_set_changing_presence (account, TRUE); } _mcd_connection_request_presence (priv->connection, priv->req_presence_type, priv->req_presence_status, priv->req_presence_message); } } /* * mcd_account_rerequest_presence: * * Re-requests the account's current RequestedPresence, possibly triggering a * new connection attempt. */ static void mcd_account_rerequest_presence (McdAccount *account, gboolean user_initiated) { McdAccountPrivate *priv = account->priv; mcd_account_request_presence_int (account, priv->req_presence_type, priv->req_presence_status, priv->req_presence_message, user_initiated); } void _mcd_account_connect (McdAccount *account, GHashTable *params) { McdAccountPrivate *priv = account->priv; g_assert (params != NULL); if (!priv->connection) { McdConnection *connection; if (!priv->manager && !load_manager (account)) { g_warning ("%s: Could not find manager `%s'", G_STRFUNC, priv->manager_name); return; } connection = mcd_manager_create_connection (priv->manager, account); _mcd_account_set_connection (account, connection); } _mcd_connection_connect (priv->connection, params); } static gboolean emit_property_changed (gpointer userdata) { McdAccount *account = MCD_ACCOUNT (userdata); McdAccountPrivate *priv = account->priv; DEBUG ("called"); if (g_hash_table_size (priv->changed_properties) > 0) { tp_svc_account_emit_account_property_changed (account, priv->changed_properties); g_hash_table_remove_all (priv->changed_properties); } if (priv->properties_source != 0) { g_source_remove (priv->properties_source); priv->properties_source = 0; } return FALSE; } static void mcd_account_freeze_properties (McdAccount *self) { g_return_if_fail (!self->priv->properties_frozen); DEBUG ("%s", self->priv->unique_name); self->priv->properties_frozen = TRUE; } static void mcd_account_thaw_properties (McdAccount *self) { g_return_if_fail (self->priv->properties_frozen); DEBUG ("%s", self->priv->unique_name); self->priv->properties_frozen = FALSE; if (g_hash_table_size (self->priv->changed_properties) != 0) { emit_property_changed (self); } } /* * This function is responsible of emitting the AccountPropertyChanged signal. * One possible improvement would be to save the HashTable and have the signal * emitted in an idle function (or a timeout function with a very small delay) * to group together several property changes that occur at the same time. */ static void mcd_account_changed_property (McdAccount *account, const gchar *key, const GValue *value) { McdAccountPrivate *priv = account->priv; DEBUG ("called: %s", key); if (priv->changed_properties && g_hash_table_lookup (priv->changed_properties, key)) { /* the changed property was also changed before; then let's force the * emission of the signal now, so that the property will appear in two * separate signals */ DEBUG ("Forcibly emit PropertiesChanged now"); emit_property_changed (account); } if (priv->properties_source == 0) { DEBUG ("First changed property"); priv->properties_source = g_timeout_add_full (G_PRIORITY_DEFAULT, 10, emit_property_changed, g_object_ref (account), g_object_unref); } g_hash_table_insert (priv->changed_properties, (gpointer) key, tp_g_value_slice_dup (value)); } typedef enum { SET_RESULT_ERROR, SET_RESULT_UNCHANGED, SET_RESULT_CHANGED } SetResult; /* * mcd_account_set_string_val: * @account: an account * @key: a D-Bus property name that is a string * @value: the new value for that property * @error: set to an error if %SET_RESULT_ERROR is returned * * Returns: %SET_RESULT_CHANGED or %SET_RESULT_UNCHANGED on success, * %SET_RESULT_ERROR on error */ static SetResult mcd_account_set_string_val (McdAccount *account, const gchar *key, const GValue *value, McdDBusPropSetFlags flags, GError **error) { McdAccountPrivate *priv = account->priv; McdStorage *storage = priv->storage; const gchar *name = mcd_account_get_unique_name (account); const gchar *new_string; if (!G_VALUE_HOLDS_STRING (value)) { g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Expected string for %s, but got %s", key, G_VALUE_TYPE_NAME (value)); return SET_RESULT_ERROR; } new_string = g_value_get_string (value); if (tp_str_empty (new_string)) { new_string = NULL; } if (flags & MCD_DBUS_PROP_SET_FLAG_ALREADY_IN_STORAGE) { mcd_account_changed_property (account, key, value); return SET_RESULT_CHANGED; } else if (mcd_storage_set_string (storage, name, key, new_string)) { mcd_storage_commit (storage, name); mcd_account_changed_property (account, key, value); return SET_RESULT_CHANGED; } else { return SET_RESULT_UNCHANGED; } } static void mcd_account_get_string_val (McdAccount *account, const gchar *key, GValue *value) { McdAccountPrivate *priv = account->priv; const gchar *name = mcd_account_get_unique_name (account); g_value_init (value, G_TYPE_STRING); if (!mcd_storage_get_attribute (priv->storage, name, key, value, NULL)) { g_value_set_static_string (value, NULL); } } static gboolean set_display_name (TpSvcDBusProperties *self, const gchar *name, const GValue *value, McdDBusPropSetFlags flags, GError **error) { McdAccount *account = MCD_ACCOUNT (self); McdAccountPrivate *priv = account->priv; DEBUG ("called for %s", priv->unique_name); return (mcd_account_set_string_val (account, MC_ACCOUNTS_KEY_DISPLAY_NAME, value, flags, error) != SET_RESULT_ERROR); } static void get_display_name (TpSvcDBusProperties *self, const gchar *name, GValue *value) { McdAccount *account = MCD_ACCOUNT (self); mcd_account_get_string_val (account, MC_ACCOUNTS_KEY_DISPLAY_NAME, value); } static gboolean set_icon (TpSvcDBusProperties *self, const gchar *name, const GValue *value, McdDBusPropSetFlags flags, GError **error) { McdAccount *account = MCD_ACCOUNT (self); McdAccountPrivate *priv = account->priv; DEBUG ("called for %s", priv->unique_name); return (mcd_account_set_string_val (account, MC_ACCOUNTS_KEY_ICON, value, flags, error) != SET_RESULT_ERROR); } static void get_icon (TpSvcDBusProperties *self, const gchar *name, GValue *value) { McdAccount *account = MCD_ACCOUNT (self); mcd_account_get_string_val (account, MC_ACCOUNTS_KEY_ICON, value); } static void get_valid (TpSvcDBusProperties *self, const gchar *name, GValue *value) { McdAccount *account = MCD_ACCOUNT (self); g_value_init (value, G_TYPE_BOOLEAN); g_value_set_boolean (value, mcd_account_is_valid (account)); } static void get_has_been_online (TpSvcDBusProperties *self, const gchar *name, GValue *value) { McdAccount *account = MCD_ACCOUNT (self); McdAccountPrivate *priv = account->priv; g_value_init (value, G_TYPE_BOOLEAN); g_value_set_boolean (value, priv->has_been_online); } /** * mcd_account_set_enabled: * @account: the #McdAccount * @enabled: %TRUE if the account is to be enabled * @write_out: %TRUE if this should be written to the keyfile * @error: return location for an error condition * * Returns: %TRUE on success */ gboolean _mcd_account_set_enabled (McdAccount *account, gboolean enabled, gboolean write_out, McdDBusPropSetFlags flags, GError **error) { McdAccountPrivate *priv = account->priv; if (priv->always_on && !enabled) { g_set_error (error, TP_ERROR, TP_ERROR_PERMISSION_DENIED, "Account %s cannot be disabled", priv->unique_name); return FALSE; } if (priv->enabled != enabled) { GValue value = G_VALUE_INIT; const gchar *name = mcd_account_get_unique_name (account); if (!enabled && priv->connection != NULL) _mcd_connection_request_presence (priv->connection, TP_CONNECTION_PRESENCE_TYPE_OFFLINE, "offline", NULL); priv->enabled = enabled; g_value_init (&value, G_TYPE_BOOLEAN); g_value_set_boolean (&value, enabled); if (!(flags & MCD_DBUS_PROP_SET_FLAG_ALREADY_IN_STORAGE)) { mcd_storage_set_attribute (priv->storage, name, MC_ACCOUNTS_KEY_ENABLED, &value); if (write_out) mcd_storage_commit (priv->storage, name); } mcd_account_changed_property (account, "Enabled", &value); g_value_unset (&value); if (enabled) { mcd_account_rerequest_presence (account, TRUE); _mcd_account_maybe_autoconnect (account); } } return TRUE; } static gboolean set_enabled (TpSvcDBusProperties *self, const gchar *name, const GValue *value, McdDBusPropSetFlags flags, GError **error) { McdAccount *account = MCD_ACCOUNT (self); McdAccountPrivate *priv = account->priv; gboolean enabled; DEBUG ("called for %s", priv->unique_name); if (!G_VALUE_HOLDS_BOOLEAN (value)) { g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Expected boolean for Enabled, but got %s", G_VALUE_TYPE_NAME (value)); return FALSE; } enabled = g_value_get_boolean (value); return _mcd_account_set_enabled (account, enabled, TRUE, flags, error); } static void get_enabled (TpSvcDBusProperties *self, const gchar *name, GValue *value) { McdAccount *account = MCD_ACCOUNT (self); McdAccountPrivate *priv = account->priv; g_value_init (value, G_TYPE_BOOLEAN); g_value_set_boolean (value, priv->enabled); } static gboolean set_service (TpSvcDBusProperties *self, const gchar *name, const GValue *value, McdDBusPropSetFlags flags, GError **error) { McdAccount *account = MCD_ACCOUNT (self); SetResult ret = SET_RESULT_ERROR; gboolean proceed = TRUE; static GRegex *rule = NULL; static gsize service_re_init = 0; if (g_once_init_enter (&service_re_init)) { GError *regex_error = NULL; rule = g_regex_new ("^(?:[a-z][a-z0-9_-]*)?$", G_REGEX_CASELESS|G_REGEX_DOLLAR_ENDONLY, 0, ®ex_error); g_assert_no_error (regex_error); g_once_init_leave (&service_re_init, 1); } if (G_VALUE_HOLDS_STRING (value)) proceed = g_regex_match (rule, g_value_get_string (value), 0, NULL); /* if value is not a string, mcd_account_set_string_val will set * * the appropriate error for us: don't duplicate that logic here */ if (proceed) { ret = mcd_account_set_string_val (account, MC_ACCOUNTS_KEY_SERVICE, value, flags, error); } else { g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Invalid service '%s': Must consist of ASCII alphanumeric " "characters, underscores (_) and hyphens (-) only, and " "start with a letter", g_value_get_string (value)); } return (ret != SET_RESULT_ERROR); } static void get_service (TpSvcDBusProperties *self, const gchar *name, GValue *value) { McdAccount *account = MCD_ACCOUNT (self); mcd_account_get_string_val (account, MC_ACCOUNTS_KEY_SERVICE, value); } static void mcd_account_set_self_alias_cb (TpConnection *tp_connection, const GError *error, gpointer user_data, GObject *weak_object) { if (error) DEBUG ("%s", error->message); } static void mcd_account_send_nickname_to_connection (McdAccount *self, const gchar *nickname) { if (self->priv->tp_connection == NULL) return; if (self->priv->self_contact == NULL) return; DEBUG ("%s: '%s'", self->priv->unique_name, nickname); if (tp_proxy_has_interface_by_id (self->priv->tp_connection, TP_IFACE_QUARK_CONNECTION_INTERFACE_ALIASING)) { GHashTable *aliases = g_hash_table_new (NULL, NULL); g_hash_table_insert (aliases, GUINT_TO_POINTER (tp_contact_get_handle (self->priv->self_contact)), (gchar *) nickname); tp_cli_connection_interface_aliasing_call_set_aliases ( self->priv->tp_connection, -1, aliases, mcd_account_set_self_alias_cb, NULL, NULL, NULL); g_hash_table_unref (aliases); } } static gboolean set_nickname (TpSvcDBusProperties *self, const gchar *name, const GValue *value, McdDBusPropSetFlags flags, GError **error) { McdAccount *account = MCD_ACCOUNT (self); McdAccountPrivate *priv = account->priv; SetResult ret; GValue replacement = G_VALUE_INIT; DEBUG ("called for %s", priv->unique_name); /* If we're asked to set Nickname = "", set it to our identifier * (NormalizedName) instead, so that we always have some sort of nickname. * This matches what we do when connecting an account. * * Exception: if we're not fully connected yet (and hence have no * self-contact), rely on the corresponding special-case * when we do become connected. */ if (G_VALUE_HOLDS_STRING (value) && tp_str_empty (g_value_get_string (value)) && priv->self_contact != NULL) { g_value_init (&replacement, G_TYPE_STRING); g_value_set_string (&replacement, tp_contact_get_identifier (priv->self_contact)); value = &replacement; } ret = mcd_account_set_string_val (account, MC_ACCOUNTS_KEY_NICKNAME, value, flags, error); if (ret != SET_RESULT_ERROR) { mcd_account_send_nickname_to_connection (account, g_value_get_string (value)); } if (value == &replacement) g_value_unset (&replacement); return (ret != SET_RESULT_ERROR); } static void get_nickname (TpSvcDBusProperties *self, const gchar *name, GValue *value) { McdAccount *account = MCD_ACCOUNT (self); mcd_account_get_string_val (account, MC_ACCOUNTS_KEY_NICKNAME, value); } static void mcd_account_self_contact_notify_avatar_file_cb (McdAccount *self, GParamSpec *unused_param_spec G_GNUC_UNUSED, TpContact *self_contact) { const gchar *token; gchar *prev_token; GFile *file; GError *error = NULL; gboolean changed; if (self_contact != self->priv->self_contact) return; file = tp_contact_get_avatar_file (self_contact); token = tp_contact_get_avatar_token (self_contact); if (self->priv->setting_avatar) { DEBUG ("Ignoring avatar change notification: we are setting ours"); return; } if (self->priv->waiting_for_initial_avatar) { DEBUG ("Ignoring avatar change notification: we are waiting for the " "initial value"); return; } prev_token = _mcd_account_get_avatar_token (self); changed = tp_strdiff (prev_token, token); g_free (prev_token); if (!changed) { DEBUG ("Avatar unchanged: '%s'", token); return; } if (file == NULL) { if (!_mcd_account_set_avatar (self, NULL, "", "", &error)) { DEBUG ("Attempt to clear avatar failed: %s", error->message); g_clear_error (&error); } } else { gchar *contents = NULL; gsize len = 0; GArray *arr; if (!g_file_load_contents (file, NULL, &contents, &len, NULL, &error)) { gchar *uri = g_file_get_uri (file); WARNING ("Unable to read avatar file %s: %s", uri, error->message); g_clear_error (&error); g_free (uri); return; } if (G_UNLIKELY (len > G_MAXUINT)) { gchar *uri = g_file_get_uri (file); WARNING ("Avatar file %s was ludicrously huge", uri); g_free (uri); g_free (contents); return; } arr = g_array_sized_new (TRUE, FALSE, 1, (guint) len); g_array_append_vals (arr, contents, (guint) len); g_free (contents); if (!_mcd_account_set_avatar (self, arr, tp_contact_get_avatar_mime_type (self_contact), tp_contact_get_avatar_token (self_contact), &error)) { DEBUG ("Attempt to save avatar failed: %s", error->message); g_clear_error (&error); } g_array_unref (arr); } } static void avatars_set_avatar_cb (TpConnection *tp_connection, const gchar *token, const GError *error, gpointer user_data, GObject *weak_object) { McdAccount *self = MCD_ACCOUNT (weak_object); self->priv->setting_avatar = FALSE; if (error != NULL) { DEBUG ("%s: %s", self->priv->unique_name, error->message); } else { DEBUG ("%s: new token %s", self->priv->unique_name, token); _mcd_account_set_avatar_token (self, token); } } static void avatars_clear_avatar_cb (TpConnection *tp_connection, const GError *error, gpointer user_data, GObject *weak_object) { McdAccount *self = MCD_ACCOUNT (weak_object); self->priv->setting_avatar = FALSE; if (error != NULL) { DEBUG ("%s: %s", self->priv->unique_name, error->message); } else { DEBUG ("%s: success", self->priv->unique_name); _mcd_account_set_avatar_token (self, ""); } } static void mcd_account_send_avatar_to_connection (McdAccount *self, const GArray *avatar, const gchar *mime_type) { if (self->priv->tp_connection == NULL) return; if (self->priv->self_contact == NULL) return; DEBUG ("%s: %u bytes", self->priv->unique_name, avatar->len); if (tp_proxy_has_interface_by_id (self->priv->tp_connection, TP_IFACE_QUARK_CONNECTION_INTERFACE_AVATARS)) { self->priv->setting_avatar = TRUE; if (avatar->len > 0 && avatar->len < G_MAXUINT) { tp_cli_connection_interface_avatars_call_set_avatar ( self->priv->tp_connection, -1, avatar, mime_type, avatars_set_avatar_cb, NULL, NULL, (GObject *) self); } else { tp_cli_connection_interface_avatars_call_clear_avatar ( self->priv->tp_connection, -1, avatars_clear_avatar_cb, NULL, NULL, (GObject *) self); } } else { DEBUG ("unsupported, ignoring"); } } static gboolean set_avatar (TpSvcDBusProperties *self, const gchar *name, const GValue *value, McdDBusPropSetFlags flags, GError **error) { McdAccount *account = MCD_ACCOUNT (self); McdAccountPrivate *priv = account->priv; const gchar *mime_type; const GArray *avatar; GValueArray *va; DEBUG ("called for %s", priv->unique_name); if (!G_VALUE_HOLDS (value, TP_STRUCT_TYPE_AVATAR)) { g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Unexpected type for Avatar: wanted (ay,s), got %s", G_VALUE_TYPE_NAME (value)); return FALSE; } va = g_value_get_boxed (value); avatar = g_value_get_boxed (va->values); mime_type = g_value_get_string (va->values + 1); if (!_mcd_account_set_avatar (account, avatar, mime_type, NULL, error)) { return FALSE; } tp_svc_account_interface_avatar_emit_avatar_changed (account); return TRUE; } static void get_avatar (TpSvcDBusProperties *self, const gchar *name, GValue *value) { McdAccount *account = MCD_ACCOUNT (self); gchar *mime_type; GArray *avatar = NULL; GType type = TP_STRUCT_TYPE_AVATAR; GValueArray *va; _mcd_account_get_avatar (account, &avatar, &mime_type); if (!avatar) avatar = g_array_new (FALSE, FALSE, 1); g_value_init (value, type); g_value_take_boxed (value, dbus_g_type_specialized_construct (type)); va = (GValueArray *) g_value_get_boxed (value); g_value_take_boxed (va->values, avatar); g_value_take_string (va->values + 1, mime_type); } static void get_parameters (TpSvcDBusProperties *self, const gchar *name, GValue *value) { McdAccount *account = MCD_ACCOUNT (self); GHashTable *params = _mcd_account_dup_parameters (account); if (params == NULL) { if (mcd_account_is_valid (account)) g_warning ("%s is supposedly valid, but _dup_parameters() failed!", mcd_account_get_unique_name (account)); params = tp_asv_new (NULL, NULL); } g_value_init (value, TP_HASH_TYPE_STRING_VARIANT_MAP); g_value_take_boxed (value, params); } gboolean _mcd_account_presence_type_is_settable (TpConnectionPresenceType type) { switch (type) { case TP_CONNECTION_PRESENCE_TYPE_UNSET: case TP_CONNECTION_PRESENCE_TYPE_UNKNOWN: case TP_CONNECTION_PRESENCE_TYPE_ERROR: return FALSE; default: return TRUE; } } static gboolean _presence_type_is_online (TpConnectionPresenceType type) { switch (type) { case TP_CONNECTION_PRESENCE_TYPE_UNSET: case TP_CONNECTION_PRESENCE_TYPE_OFFLINE: case TP_CONNECTION_PRESENCE_TYPE_UNKNOWN: case TP_CONNECTION_PRESENCE_TYPE_ERROR: return FALSE; default: return TRUE; } } static gboolean set_automatic_presence (TpSvcDBusProperties *self, const gchar *name, const GValue *value, McdDBusPropSetFlags flags, GError **error) { McdAccount *account = MCD_ACCOUNT (self); McdAccountPrivate *priv = account->priv; const gchar *status, *message; TpConnectionPresenceType type; gboolean changed = FALSE; GValueArray *va; const gchar *account_name = mcd_account_get_unique_name (account); DEBUG ("called for %s", account_name); if (!G_VALUE_HOLDS (value, TP_STRUCT_TYPE_SIMPLE_PRESENCE)) { g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Unexpected type for AutomaticPresence: wanted (u,s,s), " "got %s", G_VALUE_TYPE_NAME (value)); return FALSE; } va = g_value_get_boxed (value); type = g_value_get_uint (va->values); status = g_value_get_string (va->values + 1); message = g_value_get_string (va->values + 2); if (!_presence_type_is_online (type)) { g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "AutomaticPresence must be an online presence, not %d", type); return FALSE; } DEBUG ("setting automatic presence: %d, %s, %s", type, status, message); if (priv->auto_presence_type != type) { priv->auto_presence_type = type; changed = TRUE; } if (tp_strdiff (priv->auto_presence_status, status)) { g_free (priv->auto_presence_status); priv->auto_presence_status = g_strdup (status); changed = TRUE; } if (tp_strdiff (priv->auto_presence_message, message)) { g_free (priv->auto_presence_message); priv->auto_presence_message = g_strdup (message); changed = TRUE; } if (changed) { mcd_storage_set_attribute (priv->storage, account_name, MC_ACCOUNTS_KEY_AUTOMATIC_PRESENCE, value); mcd_storage_commit (priv->storage, account_name); mcd_account_changed_property (account, name, value); } return TRUE; } static void get_automatic_presence (TpSvcDBusProperties *self, const gchar *name, GValue *value) { McdAccount *account = MCD_ACCOUNT (self); McdAccountPrivate *priv = account->priv; gchar *presence, *message; gint presence_type; GType type; GValueArray *va; presence_type = priv->auto_presence_type; presence = priv->auto_presence_status; message = priv->auto_presence_message; type = TP_STRUCT_TYPE_SIMPLE_PRESENCE; g_value_init (value, type); g_value_take_boxed (value, dbus_g_type_specialized_construct (type)); va = (GValueArray *) g_value_get_boxed (value); g_value_set_uint (va->values, presence_type); g_value_set_static_string (va->values + 1, presence); g_value_set_static_string (va->values + 2, message); } static gboolean set_connect_automatically (TpSvcDBusProperties *self, const gchar *name, const GValue *value, McdDBusPropSetFlags flags, GError **error) { McdAccount *account = MCD_ACCOUNT (self); McdAccountPrivate *priv = account->priv; gboolean connect_automatically; DEBUG ("called for %s", priv->unique_name); if (!G_VALUE_HOLDS_BOOLEAN (value)) { g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Expected boolean for ConnectAutomatically, but got %s", G_VALUE_TYPE_NAME (value)); return FALSE; } connect_automatically = g_value_get_boolean (value); if (priv->always_on && !connect_automatically) { g_set_error (error, TP_ERROR, TP_ERROR_PERMISSION_DENIED, "Account %s always connects automatically", priv->unique_name); return FALSE; } if (priv->connect_automatically != connect_automatically) { const gchar *account_name = mcd_account_get_unique_name (account); if (!(flags & MCD_DBUS_PROP_SET_FLAG_ALREADY_IN_STORAGE)) { mcd_storage_set_attribute (priv->storage, account_name, MC_ACCOUNTS_KEY_CONNECT_AUTOMATICALLY, value); mcd_storage_commit (priv->storage, account_name); } priv->connect_automatically = connect_automatically; mcd_account_changed_property (account, name, value); if (connect_automatically) { _mcd_account_maybe_autoconnect (account); } } return TRUE; } static void get_connect_automatically (TpSvcDBusProperties *self, const gchar *name, GValue *value) { McdAccount *account = MCD_ACCOUNT (self); McdAccountPrivate *priv = account->priv; DEBUG ("called for %s", priv->unique_name); g_value_init (value, G_TYPE_BOOLEAN); g_value_set_boolean (value, priv->connect_automatically); } static void get_connection (TpSvcDBusProperties *self, const gchar *name, GValue *value) { McdAccount *account = MCD_ACCOUNT (self); McdAccountPrivate *priv = account->priv; const gchar *object_path; g_value_init (value, DBUS_TYPE_G_OBJECT_PATH); if (priv->connection && (object_path = mcd_connection_get_object_path (priv->connection))) g_value_set_boxed (value, object_path); else g_value_set_static_boxed (value, "/"); } static void get_connection_status (TpSvcDBusProperties *self, const gchar *name, GValue *value) { McdAccount *account = MCD_ACCOUNT (self); g_value_init (value, G_TYPE_UINT); g_value_set_uint (value, account->priv->conn_status); } static void get_connection_status_reason (TpSvcDBusProperties *self, const gchar *name, GValue *value) { McdAccount *account = MCD_ACCOUNT (self); g_value_init (value, G_TYPE_UINT); g_value_set_uint (value, account->priv->conn_reason); } static void get_connection_error (TpSvcDBusProperties *self, const gchar *name, GValue *value) { McdAccount *account = MCD_ACCOUNT (self); g_value_init (value, G_TYPE_STRING); g_value_set_string (value, account->priv->conn_dbus_error); } static void get_connection_error_details (TpSvcDBusProperties *self, const gchar *name, GValue *value) { McdAccount *account = MCD_ACCOUNT (self); g_value_init (value, TP_HASH_TYPE_STRING_VARIANT_MAP); g_value_set_boxed (value, account->priv->conn_error_details); } static void get_current_presence (TpSvcDBusProperties *self, const gchar *name, GValue *value) { McdAccount *account = MCD_ACCOUNT (self); McdAccountPrivate *priv = account->priv; gchar *status, *message; gint presence_type; GType type; GValueArray *va; presence_type = priv->curr_presence_type; status = priv->curr_presence_status; message = priv->curr_presence_message; type = TP_STRUCT_TYPE_SIMPLE_PRESENCE; g_value_init (value, type); g_value_take_boxed (value, dbus_g_type_specialized_construct (type)); va = (GValueArray *) g_value_get_boxed (value); g_value_set_uint (va->values, presence_type); g_value_set_static_string (va->values + 1, status); g_value_set_static_string (va->values + 2, message); } static gboolean set_requested_presence (TpSvcDBusProperties *self, const gchar *name, const GValue *value, McdDBusPropSetFlags flags, GError **error) { McdAccount *account = MCD_ACCOUNT (self); McdAccountPrivate *priv = account->priv; const gchar *status, *message; gint type; GValueArray *va; DEBUG ("called for %s", priv->unique_name); if (!G_VALUE_HOLDS (value, TP_STRUCT_TYPE_SIMPLE_PRESENCE)) { g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Unexpected type for RequestedPresence: wanted (u,s,s), " "got %s", G_VALUE_TYPE_NAME (value)); return FALSE; } va = g_value_get_boxed (value); type = (gint)g_value_get_uint (va->values); status = g_value_get_string (va->values + 1); message = g_value_get_string (va->values + 2); if (priv->always_on && !_presence_type_is_online (type)) { g_set_error (error, TP_ERROR, TP_ERROR_PERMISSION_DENIED, "Account %s cannot be taken offline", priv->unique_name); return FALSE; } if (!_mcd_account_presence_type_is_settable (type)) { g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "RequestedPresence %d cannot be set on yourself", type); return FALSE; } DEBUG ("setting requested presence: %d, %s, %s", type, status, message); mcd_account_request_presence_int (account, type, status, message, TRUE); return TRUE; } static void get_requested_presence (TpSvcDBusProperties *self, const gchar *name, GValue *value) { McdAccount *account = MCD_ACCOUNT (self); McdAccountPrivate *priv = account->priv; gchar *presence, *message; gint presence_type; GType type; GValueArray *va; presence_type = priv->req_presence_type; presence = priv->req_presence_status; message = priv->req_presence_message; type = TP_STRUCT_TYPE_SIMPLE_PRESENCE; g_value_init (value, type); g_value_take_boxed (value, dbus_g_type_specialized_construct (type)); va = (GValueArray *) g_value_get_boxed (value); g_value_set_uint (va->values, presence_type); g_value_set_static_string (va->values + 1, presence); g_value_set_static_string (va->values + 2, message); } static void get_changing_presence (TpSvcDBusProperties *self, const gchar *name, GValue *value) { McdAccount *account = MCD_ACCOUNT (self); McdAccountPrivate *priv = account->priv; g_value_init (value, G_TYPE_BOOLEAN); g_value_set_boolean (value, priv->changing_presence); } static void get_normalized_name (TpSvcDBusProperties *self, const gchar *name, GValue *value) { McdAccount *account = MCD_ACCOUNT (self); mcd_account_get_string_val (account, MC_ACCOUNTS_KEY_NORMALIZED_NAME, value); } static gboolean set_supersedes (TpSvcDBusProperties *svc, const gchar *name, const GValue *value, McdDBusPropSetFlags flags, GError **error) { McdAccount *self = MCD_ACCOUNT (svc); if (!G_VALUE_HOLDS (value, TP_ARRAY_TYPE_OBJECT_PATH_LIST)) { g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Unexpected type for Supersedes: wanted 'ao', got %s", G_VALUE_TYPE_NAME (value)); return FALSE; } if (self->priv->supersedes != NULL) g_ptr_array_unref (self->priv->supersedes); self->priv->supersedes = g_value_dup_boxed (value); mcd_account_changed_property (self, name, value); mcd_storage_set_attribute (self->priv->storage, self->priv->unique_name, MC_ACCOUNTS_KEY_SUPERSEDES, value); mcd_storage_commit (self->priv->storage, self->priv->unique_name); return TRUE; } static void get_supersedes (TpSvcDBusProperties *svc, const gchar *name, GValue *value) { McdAccount *self = MCD_ACCOUNT (svc); if (self->priv->supersedes == NULL) self->priv->supersedes = g_ptr_array_new (); g_value_init (value, TP_ARRAY_TYPE_OBJECT_PATH_LIST); g_value_set_boxed (value, self->priv->supersedes); } static McpAccountStorage * get_storage_plugin (McdAccount *account) { McdAccountPrivate *priv = account->priv; const gchar *account_name = mcd_account_get_unique_name (account); if (priv->storage_plugin != NULL) return priv->storage_plugin; priv->storage_plugin = mcd_storage_get_plugin (priv->storage, account_name); if (priv->storage_plugin != NULL) g_object_ref (priv->storage_plugin); return priv->storage_plugin; } static void get_storage_provider (TpSvcDBusProperties *self, const gchar *name, GValue *value) { McdAccount *account = MCD_ACCOUNT (self); McpAccountStorage *storage_plugin = get_storage_plugin (account); g_value_init (value, G_TYPE_STRING); if (storage_plugin != NULL) g_value_set_string (value, mcp_account_storage_provider (storage_plugin)); else g_value_set_static_string (value, ""); } static gboolean set_storage_provider (TpSvcDBusProperties *self, const gchar *name, const GValue *value, McdDBusPropSetFlags flags, GError **error) { McdAccount *account = MCD_ACCOUNT (self); McpAccountStorage *storage_plugin = get_storage_plugin (account); const gchar *current_provider = mcp_account_storage_provider (storage_plugin); if (!G_VALUE_HOLDS_STRING (value) || tp_strdiff (g_value_get_string (value), current_provider)) { g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Cannot change provider, it is defined at account creation only"); return FALSE; } return TRUE; } static void get_storage_identifier (TpSvcDBusProperties *self, const gchar *name, GValue *value) { McdAccount *account = MCD_ACCOUNT (self); McpAccountStorage *storage_plugin = get_storage_plugin (account); GValue identifier = G_VALUE_INIT; g_value_init (value, G_TYPE_VALUE); if (storage_plugin != NULL) { mcp_account_storage_get_identifier ( storage_plugin, account->priv->unique_name, &identifier); } else { g_value_init (&identifier, G_TYPE_UINT); g_value_set_uint (&identifier, 0); } g_value_set_boxed (value, &identifier); g_value_unset (&identifier); } static void get_storage_specific_info (TpSvcDBusProperties *self, const gchar *name, GValue *value) { GHashTable *storage_specific_info; McdAccount *account = MCD_ACCOUNT (self); McpAccountStorage *storage_plugin = get_storage_plugin (account); g_value_init (value, TP_HASH_TYPE_STRING_VARIANT_MAP); if (storage_plugin != NULL) storage_specific_info = mcp_account_storage_get_additional_info ( storage_plugin, account->priv->unique_name); else storage_specific_info = g_hash_table_new (g_str_hash, g_str_equal); g_value_take_boxed (value, storage_specific_info); } static void get_storage_restrictions (TpSvcDBusProperties *self, const gchar *name, GValue *value) { TpStorageRestrictionFlags flags; McdAccount *account = MCD_ACCOUNT (self); McpAccountStorage *storage_plugin = get_storage_plugin (account); g_value_init (value, G_TYPE_UINT); g_return_if_fail (storage_plugin != NULL); flags = mcp_account_storage_get_restrictions (storage_plugin, account->priv->unique_name); g_value_set_uint (value, flags); } static const McdDBusProp account_properties[] = { { "Interfaces", NULL, mcd_dbus_get_interfaces }, { "DisplayName", set_display_name, get_display_name }, { "Icon", set_icon, get_icon }, { "Valid", NULL, get_valid }, { "Enabled", set_enabled, get_enabled }, { "Nickname", set_nickname, get_nickname }, { "Service", set_service, get_service }, { "Parameters", NULL, get_parameters }, { "AutomaticPresence", set_automatic_presence, get_automatic_presence }, { "ConnectAutomatically", set_connect_automatically, get_connect_automatically }, { "Connection", NULL, get_connection }, { "ConnectionStatus", NULL, get_connection_status }, { "ConnectionStatusReason", NULL, get_connection_status_reason }, { "ConnectionError", NULL, get_connection_error }, { "ConnectionErrorDetails", NULL, get_connection_error_details }, { "CurrentPresence", NULL, get_current_presence }, { "RequestedPresence", set_requested_presence, get_requested_presence }, { "ChangingPresence", NULL, get_changing_presence }, { "NormalizedName", NULL, get_normalized_name }, { "HasBeenOnline", NULL, get_has_been_online }, { "Supersedes", set_supersedes, get_supersedes }, { 0 }, }; static const McdDBusProp account_avatar_properties[] = { { "Avatar", set_avatar, get_avatar }, { 0 }, }; static const McdDBusProp account_storage_properties[] = { { "StorageProvider", set_storage_provider, get_storage_provider }, { "StorageIdentifier", NULL, get_storage_identifier }, { "StorageSpecificInformation", NULL, get_storage_specific_info }, { "StorageRestrictions", NULL, get_storage_restrictions }, { 0 }, }; static void account_avatar_iface_init (TpSvcAccountInterfaceAvatarClass *iface, gpointer iface_data) { } static void account_storage_iface_init (TpSvcAccountInterfaceStorageClass *iface, gpointer iface_data) { } static void get_hidden (TpSvcDBusProperties *self, const gchar *name, GValue *value) { g_value_init (value, G_TYPE_BOOLEAN); g_object_get_property (G_OBJECT (self), "hidden", value); } static gboolean set_hidden (TpSvcDBusProperties *self, const gchar *name, const GValue *value, McdDBusPropSetFlags flags, GError **error) { McdAccount *account = MCD_ACCOUNT (self); McdAccountPrivate *priv = account->priv; const gchar *account_name = mcd_account_get_unique_name (account); if (!G_VALUE_HOLDS_BOOLEAN (value)) { g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Hidden must be set to a boolean, not a %s", G_VALUE_TYPE_NAME (value)); return FALSE; } /* Technically this property is immutable after the account's been created, * but currently it's not easy for this code to tell whether or not this is * a create-time property. It would probably be better if the create-time * properties were passed into us as a construct-time GObject property. But * that's a job for another month. * * So for now we check whether the value has changed, and violate the spec * by making this property mutable (at least with the keyfile backend). */ if (mcd_storage_set_attribute (priv->storage, account_name, MC_ACCOUNTS_KEY_HIDDEN, value)) { mcd_storage_commit (priv->storage, account_name); mcd_account_changed_property (account, MC_ACCOUNTS_KEY_HIDDEN, value); g_object_set_property (G_OBJECT (self), "hidden", value); } return TRUE; } static const McdDBusProp account_hidden_properties[] = { { "Hidden", set_hidden, get_hidden }, { 0 }, }; static void account_hidden_iface_init ( McSvcAccountInterfaceHiddenClass *iface, gpointer iface_data) { /* wow, it's pretty crap that I need this. */ } static void get_password_saved (TpSvcDBusProperties *self, const gchar *name, GValue *value) { McdAccount *account = MCD_ACCOUNT (self); g_assert_cmpstr (name, ==, "PasswordSaved"); g_value_init (value, G_TYPE_BOOLEAN); g_value_set_boolean (value, account->priv->password_saved); } static const McdDBusProp account_external_password_storage_properties[] = { { "PasswordSaved", NULL, get_password_saved }, { 0 }, }; static void account_external_password_storage_forget_credentials_cb (TpProxy *cm, const GError *in_error, gpointer user_data, GObject *self) { DBusGMethodInvocation *context = user_data; if (in_error != NULL) { dbus_g_method_return_error (context, in_error); return; } mc_svc_account_interface_external_password_storage_return_from_forget_password (context); } static void account_external_password_storage_identify_account_cb (TpProxy *protocol, const char *account_id, const GError *in_error, gpointer user_data, GObject *self) { McdAccount *account = MCD_ACCOUNT (self); DBusGMethodInvocation *context = user_data; TpConnectionManager *cm = mcd_account_get_cm (account); if (in_error != NULL) { dbus_g_method_return_error (context, in_error); return; } DEBUG ("Identified account as %s", account_id); mc_cli_connection_manager_interface_account_storage_call_forget_credentials ( cm, -1, account_id, account_external_password_storage_forget_credentials_cb, context, NULL, self); } static void account_external_password_storage_forget_password ( McSvcAccountInterfaceExternalPasswordStorage *self, DBusGMethodInvocation *context) { McdAccount *account = MCD_ACCOUNT (self); TpConnectionManager *cm = mcd_account_get_cm (account); TpProtocol *protocol; GHashTable *params; /* do we support the interface */ if (!tp_proxy_has_interface_by_id (cm, MC_IFACE_QUARK_CONNECTION_MANAGER_INTERFACE_ACCOUNT_STORAGE)) { GError *error = g_error_new (TP_ERROR, TP_ERROR_NOT_IMPLEMENTED, "CM for this Account does not implement AccountStorage iface"); dbus_g_method_return_error (context, error); g_error_free (error); return; } /* identify the account */ protocol = tp_connection_manager_get_protocol_object (cm, account->priv->protocol_name); params = _mcd_account_dup_parameters (account); tp_cli_protocol_call_identify_account (protocol, -1, params, account_external_password_storage_identify_account_cb, context, NULL, G_OBJECT (self)); g_hash_table_unref (params); } static void account_external_password_storage_iface_init ( McSvcAccountInterfaceExternalPasswordStorageClass *iface, gpointer iface_data) { #define IMPLEMENT(x) \ mc_svc_account_interface_external_password_storage_implement_##x (\ iface, account_external_password_storage_##x) IMPLEMENT (forget_password); #undef IMPLEMENT } static void properties_iface_init (TpSvcDBusPropertiesClass *iface, gpointer iface_data) { #define IMPLEMENT(x) tp_svc_dbus_properties_implement_##x (\ iface, dbusprop_##x) IMPLEMENT(set); IMPLEMENT(get); IMPLEMENT(get_all); #undef IMPLEMENT } static GType mc_param_type (const TpConnectionManagerParam *param) { const gchar *dbus_signature; if (G_UNLIKELY (param == NULL)) return G_TYPE_INVALID; dbus_signature = tp_connection_manager_param_get_dbus_signature (param); if (G_UNLIKELY (!dbus_signature)) return G_TYPE_INVALID; switch (dbus_signature[0]) { case DBUS_TYPE_STRING: return G_TYPE_STRING; case DBUS_TYPE_BYTE: return G_TYPE_UCHAR; case DBUS_TYPE_INT16: case DBUS_TYPE_INT32: return G_TYPE_INT; case DBUS_TYPE_UINT16: case DBUS_TYPE_UINT32: return G_TYPE_UINT; case DBUS_TYPE_BOOLEAN: return G_TYPE_BOOLEAN; case DBUS_TYPE_DOUBLE: return G_TYPE_DOUBLE; case DBUS_TYPE_OBJECT_PATH: return DBUS_TYPE_G_OBJECT_PATH; case DBUS_TYPE_INT64: return G_TYPE_INT64; case DBUS_TYPE_UINT64: return G_TYPE_UINT64; case DBUS_TYPE_ARRAY: if (dbus_signature[1] == DBUS_TYPE_STRING) return G_TYPE_STRV; /* other array types are not supported: * fall through the default case */ default: g_warning ("skipping parameter %s, unknown type %s", tp_connection_manager_param_get_name (param), dbus_signature); } return G_TYPE_INVALID; } typedef struct { McdAccount *self; DBusGMethodInvocation *context; } RemoveMethodData; static void account_remove_delete_cb (McdAccount *account, const GError *error, gpointer user_data) { RemoveMethodData *data = (RemoveMethodData *) user_data; if (error != NULL) { dbus_g_method_return_error (data->context, (GError *) error); return; } if (!data->self->priv->removed) { data->self->priv->removed = TRUE; tp_svc_account_emit_removed (data->self); } tp_svc_account_return_from_remove (data->context); g_slice_free (RemoveMethodData, data); } static void account_remove (TpSvcAccount *svc, DBusGMethodInvocation *context) { McdAccount *self = MCD_ACCOUNT (svc); RemoveMethodData *data; data = g_slice_new0 (RemoveMethodData); data->self = self; data->context = context; DEBUG ("called"); mcd_account_delete (self, account_remove_delete_cb, data); } /* * @account: the account * @name: an attribute name, or "param-" + a parameter name * * Tell the account that one of its attributes or parameters has changed * behind its back (as opposed to an external change triggered by DBus, * for example). This occurs when a storage plugin wishes to notify us * that something has changed. This will trigger an update when the * callback receives the new value. */ void mcd_account_altered_by_plugin (McdAccount *account, const gchar *name) { /* parameters are handled en bloc, reinvoke self with bloc key: */ if (g_str_has_prefix (name, "param-")) { mcd_account_altered_by_plugin (account, "Parameters"); } else { guint i = 0; const McdDBusProp *prop = NULL; GValue value = G_VALUE_INIT; GError *error = NULL; DEBUG ("%s", name); if (tp_strdiff (name, "Parameters") && !mcd_storage_init_value_for_attribute (&value, name)) { WARNING ("plugin wants to alter %s but I don't know what " "type that ought to be", name); return; } if (!tp_strdiff (name, "Parameters")) { get_parameters (TP_SVC_DBUS_PROPERTIES (account), name, &value); } else if (!mcd_storage_get_attribute (account->priv->storage, account->priv->unique_name, name, &value, &error)) { WARNING ("cannot get new value of %s: %s", name, error->message); g_error_free (error); return; } /* find the property update handler */ for (; prop == NULL && account_properties[i].name != NULL; i++) { if (g_str_equal (name, account_properties[i].name)) prop = &account_properties[i]; } /* is a known property: invoke the getter method for it (if any): * * then issue the change notification (DBus signals etc) for it */ if (prop != NULL) { /* poke the value back into itself with the setter: this * * extra round-trip may trigger extra actions like notifying * * the connection manager of the change, even though our own * * internal storage already has this value and needn't change */ if (prop->setprop != NULL) { DEBUG ("Calling property setter for %s", name); if (!prop->setprop (TP_SVC_DBUS_PROPERTIES (account), prop->name, &value, MCD_DBUS_PROP_SET_FLAG_ALREADY_IN_STORAGE, &error)) { WARNING ("Unable to set %s: %s", name, error->message); g_error_free (error); } } else { DEBUG ("Emitting signal directly for %s", name); mcd_account_changed_property (account, prop->name, &value); } } else { DEBUG ("%s does not appear to be an Account property", name); } g_value_unset (&value); } } static void mcd_account_check_parameters (McdAccount *account, CheckParametersCb callback, gpointer user_data) { McdAccountPrivate *priv = account->priv; TpProtocol *protocol; GList *params = NULL; GList *iter; GError *error = NULL; g_return_if_fail (callback != NULL); DEBUG ("called for %s", priv->unique_name); protocol = _mcd_manager_dup_protocol (priv->manager, priv->protocol_name); if (protocol == NULL) { g_set_error (&error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "CM '%s' doesn't implement protocol '%s'", priv->manager_name, priv->protocol_name); goto out; } params = tp_protocol_dup_params (protocol); for (iter = params; iter != NULL; iter = iter->next) { TpConnectionManagerParam *param = iter->data; const gchar *param_name = tp_connection_manager_param_get_name (param); if (!tp_connection_manager_param_is_required ((param))) continue; if (!mcd_account_get_parameter (account, param_name, NULL, NULL)) { g_set_error (&error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "missing required parameter '%s'", param_name); goto out; } } out: if (error != NULL) { DEBUG ("%s", error->message); } callback (account, error, user_data); g_clear_error (&error); g_list_free_full (params, (GDestroyNotify) tp_connection_manager_param_free); g_clear_object (&protocol); } static void set_parameters_maybe_autoconnect_cb (McdAccount *account, const GError *invalid_reason, gpointer user_data G_GNUC_UNUSED) { /* Strictly speaking this doesn't need to be called unless invalid_reason * is NULL, but calling it in all cases gives us clearer debug output */ _mcd_account_maybe_autoconnect (account); } static void apply_parameter_updates (McdAccount *account, GHashTable *params, const gchar **unset, GHashTable *dbus_properties) { McdAccountPrivate *priv = account->priv; GHashTableIter iter; gpointer name, value; const gchar **unset_iter; g_hash_table_iter_init (&iter, params); while (g_hash_table_iter_next (&iter, &name, &value)) { _mcd_account_set_parameter (account, name, value); } for (unset_iter = unset; unset_iter != NULL && *unset_iter != NULL; unset_iter++) { _mcd_account_set_parameter (account, *unset_iter, NULL); } if (mcd_account_get_connection_status (account) == TP_CONNECTION_STATUS_CONNECTED) { g_hash_table_iter_init (&iter, dbus_properties); while (g_hash_table_iter_next (&iter, &name, &value)) { DEBUG ("updating parameter %s", (const gchar *) name); _mcd_connection_update_property (priv->connection, name, value); } } mcd_account_check_validity (account, set_parameters_maybe_autoconnect_cb, NULL); } static void set_parameter_changed (GHashTable *dbus_properties, GPtrArray *not_yet, const TpConnectionManagerParam *param, const GValue *new_value) { const gchar *name = tp_connection_manager_param_get_name (param); DEBUG ("Parameter %s changed", name); /* can the param be updated on the fly? If yes, prepare to do so; and if * not, prepare to reset the connection */ if (tp_connection_manager_param_is_dbus_property (param)) { g_hash_table_insert (dbus_properties, g_strdup (name), tp_g_value_slice_dup (new_value)); } else { g_ptr_array_add (not_yet, g_strdup (name)); } } static gboolean check_one_parameter_update (McdAccount *account, TpProtocol *protocol, GHashTable *dbus_properties, GPtrArray *not_yet, const gchar *name, const GValue *new_value, GError **error) { const TpConnectionManagerParam *param = tp_protocol_get_param (protocol, name); GType type; if (param == NULL) { g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Protocol '%s' does not have parameter '%s'", tp_protocol_get_name (protocol), name); return FALSE; } type = mc_param_type (param); if (G_VALUE_TYPE (new_value) != type) { /* FIXME: use D-Bus type names, not GType names. */ g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "parameter '%s' must be of type %s, not %s", tp_connection_manager_param_get_name (param), g_type_name (type), G_VALUE_TYPE_NAME (new_value)); return FALSE; } if (mcd_account_get_connection_status (account) == TP_CONNECTION_STATUS_CONNECTED) { GValue current_value = G_VALUE_INIT; /* Check if the parameter's current value (or its default, if it has * one and it's not set to anything) matches the new value. */ if (mcd_account_get_parameter (account, tp_connection_manager_param_get_name (param), ¤t_value, NULL) || tp_connection_manager_param_get_default (param, ¤t_value)) { if (!value_is_same (¤t_value, new_value)) set_parameter_changed (dbus_properties, not_yet, param, new_value); g_value_unset (¤t_value); } else { /* The parameter wasn't previously set, and has no default value; * this update must be a change. */ set_parameter_changed (dbus_properties, not_yet, param, new_value); } } return TRUE; } static gboolean check_one_parameter_unset (McdAccount *account, TpProtocol *protocol, GHashTable *dbus_properties, GPtrArray *not_yet, const gchar *name, GError **error) { const TpConnectionManagerParam *param = tp_protocol_get_param (protocol, name); /* The spec decrees that “If the given parameters […] do not exist at all, * the account manager MUST accept this without error.”. Thus this function * is a no-op if @name doesn't actually exist. */ if (param != NULL && mcd_account_get_connection_status (account) == TP_CONNECTION_STATUS_CONNECTED) { GValue current_value = G_VALUE_INIT; if (mcd_account_get_parameter (account, tp_connection_manager_param_get_name (param), ¤t_value, NULL)) { /* There's an existing value; let's see if it's the same as the * default, if any. */ GValue default_value = G_VALUE_INIT; if (tp_connection_manager_param_get_default (param, &default_value)) { if (!value_is_same (¤t_value, &default_value)) set_parameter_changed (dbus_properties, not_yet, param, &default_value); g_value_unset (&default_value); } else { /* It has no default; we're gonna have to reconnect to make * this take effect. */ g_ptr_array_add (not_yet, g_strdup (tp_connection_manager_param_get_name (param))); } g_value_unset (¤t_value); } } return TRUE; } static gboolean check_parameters (McdAccount *account, TpProtocol *protocol, GHashTable *params, const gchar **unset, GHashTable *dbus_properties, GPtrArray *not_yet, GError **error) { GHashTableIter iter; gpointer key, value; const gchar **unset_iter; g_hash_table_iter_init (&iter, params); while (g_hash_table_iter_next (&iter, &key, &value)) { if (!check_one_parameter_update (account, protocol, dbus_properties, not_yet, key, value, error)) return FALSE; } for (unset_iter = unset; unset_iter != NULL && *unset_iter != NULL; unset_iter++) { if (!check_one_parameter_unset (account, protocol, dbus_properties, not_yet, *unset_iter, error)) return FALSE; } return TRUE; } /* * _mcd_account_set_parameters: * @account: the #McdAccount. * @name: the parameter name. * @params: names and values of parameters to set * @unset: names of parameters to unset * @callback: function to be called when finished * @user_data: data to be passed to @callback * * Alter the account parameters. * */ void _mcd_account_set_parameters (McdAccount *account, GHashTable *params, const gchar **unset, McdAccountSetParametersCb callback, gpointer user_data) { McdAccountPrivate *priv = account->priv; GHashTable *dbus_properties = NULL; GPtrArray *not_yet = NULL; GError *error = NULL; TpProtocol *protocol = NULL; DEBUG ("called"); if (G_UNLIKELY (!priv->manager && !load_manager (account))) { /* FIXME: this branch is never reached, even if the specified CM * doesn't actually exist: load_manager essentially always succeeds, * but of course the TpCM hasn't prepared (or failed, as it will if we * would like to hit this path) yet. So in practice we hit the next * block for nonexistant CMs too. */ g_set_error (&error, TP_ERROR, TP_ERROR_NOT_IMPLEMENTED, "Manager '%s' not found", priv->manager_name); goto out; } protocol = _mcd_manager_dup_protocol (priv->manager, priv->protocol_name); if (G_UNLIKELY (protocol == NULL)) { g_set_error (&error, TP_ERROR, TP_ERROR_NOT_IMPLEMENTED, "Protocol '%s' not found on CM '%s'", priv->protocol_name, priv->manager_name); goto out; } /* An a{sv} of DBus_Property parameters we should set on the connection. */ dbus_properties = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, (GDestroyNotify) tp_g_value_slice_free); not_yet = g_ptr_array_new_with_free_func (g_free); if (check_parameters (account, protocol, params, unset, dbus_properties, not_yet, &error)) apply_parameter_updates (account, params, unset, dbus_properties); out: if (callback != NULL) { if (error == NULL) callback (account, not_yet, NULL, user_data); else callback (account, NULL, error, user_data); } g_clear_error (&error); tp_clear_pointer (&dbus_properties, g_hash_table_unref); tp_clear_pointer (¬_yet, g_ptr_array_unref); g_clear_object (&protocol); } static void account_update_parameters_cb (McdAccount *account, GPtrArray *not_yet, const GError *error, gpointer user_data) { McdAccountPrivate *priv = account->priv; DBusGMethodInvocation *context = (DBusGMethodInvocation *) user_data; const gchar *account_name = mcd_account_get_unique_name (account); GHashTable *params; GValue value = G_VALUE_INIT; if (error != NULL) { dbus_g_method_return_error (context, (GError *) error); return; } /* Emit the PropertiesChanged signal */ params = _mcd_account_dup_parameters (account); g_return_if_fail (params != NULL); g_value_init (&value, TP_HASH_TYPE_STRING_VARIANT_MAP); g_value_take_boxed (&value, params); mcd_account_changed_property (account, "Parameters", &value); g_value_unset (&value); /* Commit the changes to disk */ mcd_storage_commit (priv->storage, account_name); /* And finally, return from UpdateParameters() */ g_ptr_array_add (not_yet, NULL); tp_svc_account_return_from_update_parameters (context, (const gchar **) not_yet->pdata); } static void account_update_parameters (TpSvcAccount *self, GHashTable *set, const gchar **unset, DBusGMethodInvocation *context) { McdAccount *account = MCD_ACCOUNT (self); McdAccountPrivate *priv = account->priv; DEBUG ("called for %s", priv->unique_name); _mcd_account_set_parameters (account, set, unset, account_update_parameters_cb, context); } void _mcd_account_reconnect (McdAccount *self, gboolean user_initiated) { /* FIXME: this isn't quite right. If we've just called RequestConnection * (possibly with out of date parameters) but we haven't got a Connection * back from the CM yet, the old parameters will still be used, I think * (I can't quite make out what actually happens). */ if (self->priv->connection) mcd_connection_close (self->priv->connection, NULL); _mcd_account_connection_begin (self, user_initiated); } static void account_reconnect (TpSvcAccount *service, DBusGMethodInvocation *context) { McdAccount *self = MCD_ACCOUNT (service); McdAccountPrivate *priv = self->priv; DEBUG ("%s", mcd_account_get_unique_name (self)); /* if we can't, or don't want to, connect this method is a no-op */ if (!priv->enabled || !mcd_account_is_valid (self) || priv->req_presence_type == TP_CONNECTION_PRESENCE_TYPE_OFFLINE) { DEBUG ("doing nothing (enabled=%c, valid=%c and " "combined presence=%i)", self->priv->enabled ? 'T' : 'F', mcd_account_is_valid (self) ? 'T' : 'F', self->priv->req_presence_type); tp_svc_account_return_from_reconnect (context); return; } /* Reconnect() counts as user-initiated */ _mcd_account_reconnect (self, TRUE); /* FIXME: we shouldn't really return from this method until the * reconnection has actually happened, but that would require less tangled * integration between Account and Connection */ tp_svc_account_return_from_reconnect (context); } static void account_iface_init (TpSvcAccountClass *iface, gpointer iface_data) { #define IMPLEMENT(x) tp_svc_account_implement_##x (\ iface, account_##x) IMPLEMENT(remove); IMPLEMENT(update_parameters); IMPLEMENT(reconnect); #undef IMPLEMENT } static void register_dbus_service (McdAccount *self, const GError *error, gpointer unused G_GNUC_UNUSED) { DBusGConnection *dbus_connection; TpDBusDaemon *dbus_daemon; if (error != NULL) { /* due to some tangled error handling, the McdAccount might already * have been freed by the time we get here, so it's no longer safe to * dereference self here! */ DEBUG ("%p failed to load: %s code %d: %s", self, g_quark_to_string (error->domain), error->code, error->message); return; } g_assert (MCD_IS_ACCOUNT (self)); /* these are invariants - the storage is set at construct-time * and the object path is set in mcd_account_setup, both of which are * run before this callback can possibly be invoked */ g_assert (self->priv->storage != NULL); g_assert (self->priv->object_path != NULL); dbus_daemon = self->priv->dbus_daemon; g_return_if_fail (dbus_daemon != NULL); dbus_connection = tp_proxy_get_dbus_connection (TP_PROXY (dbus_daemon)); if (G_LIKELY (dbus_connection)) { dbus_g_connection_register_g_object (dbus_connection, self->priv->object_path, (GObject *) self); self->priv->registered = TRUE; } } /* * @account: (allow-none): * @dir_out: (out): e.g. ~/.local/share/telepathy/mission-control * @basename_out: (out): e.g. gabble-jabber-fred_40example_2ecom.avatar * @file_out: (out): @dir_out + "/" + @basename_out */ static void get_avatar_paths (McdAccount *account, gchar **dir_out, gchar **basename_out, gchar **file_out) { gchar *dir = NULL; dir = g_build_filename (g_get_user_data_dir (), "telepathy", "mission-control", NULL); if (account == NULL) { if (file_out != NULL) *file_out = NULL; if (basename_out != NULL) *basename_out = NULL; } else if (basename_out != NULL || file_out != NULL) { gchar *basename = NULL; basename = g_strdup_printf ("%s.avatar", account->priv->unique_name); g_strdelimit (basename, "/", '-'); if (file_out != NULL) *file_out = g_build_filename (dir, basename, NULL); if (basename_out != NULL) *basename_out = basename; else g_free (basename); } if (dir_out != NULL) *dir_out = dir; else g_free (dir); } static gboolean save_avatar (McdAccount *self, gpointer data, gssize len, GError **error) { gchar *dir = NULL; gchar *file = NULL; gboolean ret = FALSE; get_avatar_paths (self, &dir, NULL, &file); if (mcd_ensure_directory (dir, error) && g_file_set_contents (file, data, len, error)) { DEBUG ("Saved avatar to %s", file); ret = TRUE; } else if (len == 0) { GArray *avatar = NULL; /* It failed, but maybe that's OK, since we didn't really want * an avatar anyway. */ _mcd_account_get_avatar (self, &avatar, NULL); if (avatar == NULL) { /* Creating the empty file failed, but it's fine, since what's * on disk correctly indicates that we have no avatar. */ DEBUG ("Ignoring failure to write empty avatar"); if (error != NULL) g_clear_error (error); } else { /* Continue to raise the error: we failed to write a 0-byte * file into the highest-priority avatar directory, and we do * need it, since there is a non-empty avatar in either that * directory or a lower-priority directory */ g_array_free (avatar, TRUE); } } g_free (dir); g_free (file); return ret; } static gchar *_mcd_account_get_old_avatar_filename (McdAccount *account, gchar **old_dir); static void mcd_account_migrate_avatar (McdAccount *account) { GError *error = NULL; gchar *old_file; gchar *old_dir = NULL; gchar *new_dir = NULL; gchar *basename = NULL; gchar *new_file = NULL; gchar *contents = NULL; guint i; /* Try to migrate the avatar to a better location */ old_file = _mcd_account_get_old_avatar_filename (account, &old_dir); if (!g_file_test (old_file, G_FILE_TEST_EXISTS)) { /* nothing to do */ goto finally; } DEBUG ("Migrating avatar from %s", old_file); get_avatar_paths (account, &new_dir, &basename, &new_file); if (g_file_test (new_file, G_FILE_TEST_IS_REGULAR)) { DEBUG ("... already migrated to %s", new_file); if (g_unlink (old_file) != 0) { DEBUG ("Failed to unlink %s: %s", old_file, g_strerror (errno)); } goto finally; } if (!mcd_ensure_directory (new_dir, &error)) { DEBUG ("%s", error->message); goto finally; } if (g_rename (old_file, new_file) == 0) { DEBUG ("Renamed %s to %s", old_file, new_file); } else { gsize len; DEBUG ("Unable to rename %s to %s, will try copy+delete: %s", old_file, new_file, g_strerror (errno)); if (!g_file_get_contents (old_file, &contents, &len, &error)) { DEBUG ("Unable to load old avatar %s: %s", old_file, error->message); goto finally; } if (g_file_set_contents (new_file, contents, len, &error)) { DEBUG ("Copied old avatar from %s to %s", old_file, new_file); } else { DEBUG ("Unable to save new avatar %s: %s", new_file, error->message); goto finally; } if (g_unlink (old_file) != 0) { DEBUG ("Failed to unlink %s: %s", old_file, g_strerror (errno)); goto finally; } } /* old_dir is typically ~/.mission-control/accounts/gabble/jabber/badger0. * We want to delete badger0, jabber, gabble, accounts if they are empty. * If they are not, we'll just get ENOTEMPTY and stop. */ for (i = 0; i < 4; i++) { gchar *tmp; if (g_rmdir (old_dir) != 0) { DEBUG ("Failed to rmdir %s: %s", old_dir, g_strerror (errno)); goto finally; } tmp = g_path_get_dirname (old_dir); g_free (old_dir); old_dir = tmp; } finally: g_clear_error (&error); g_free (basename); g_free (new_file); g_free (new_dir); g_free (contents); g_free (old_file); } static gboolean mcd_account_setup (McdAccount *account) { McdAccountPrivate *priv = account->priv; McdStorage *storage = priv->storage; const gchar *name = mcd_account_get_unique_name (account); GValue value = G_VALUE_INIT; priv->manager_name = mcd_storage_dup_string (storage, name, MC_ACCOUNTS_KEY_MANAGER); if (priv->manager_name == NULL) { g_warning ("Account '%s' has no manager", name); goto broken_account; } priv->protocol_name = mcd_storage_dup_string (storage, name, MC_ACCOUNTS_KEY_PROTOCOL); if (priv->protocol_name == NULL) { g_warning ("Account has no protocol"); goto broken_account; } priv->object_path = g_strconcat (TP_ACCOUNT_OBJECT_PATH_BASE, name, NULL); if (!priv->always_on) { priv->enabled = mcd_storage_get_boolean (storage, name, MC_ACCOUNTS_KEY_ENABLED); priv->connect_automatically = mcd_storage_get_boolean (storage, name, MC_ACCOUNTS_KEY_CONNECT_AUTOMATICALLY); } priv->has_been_online = mcd_storage_get_boolean (storage, name, MC_ACCOUNTS_KEY_HAS_BEEN_ONLINE); priv->hidden = mcd_storage_get_boolean (storage, name, MC_ACCOUNTS_KEY_HIDDEN); /* special case flag (for ring accounts, so far) */ priv->always_dispatch = mcd_storage_get_boolean (storage, name, MC_ACCOUNTS_KEY_ALWAYS_DISPATCH); g_value_init (&value, TP_STRUCT_TYPE_SIMPLE_PRESENCE); g_free (priv->auto_presence_status); g_free (priv->auto_presence_message); if (mcd_storage_get_attribute (storage, name, MC_ACCOUNTS_KEY_AUTOMATIC_PRESENCE, &value, NULL)) { GValueArray *va = g_value_get_boxed (&value); priv->auto_presence_type = g_value_get_uint (va->values + 0); priv->auto_presence_status = g_value_dup_string (va->values + 1); priv->auto_presence_message = g_value_dup_string (va->values + 2); if (priv->auto_presence_status == NULL) priv->auto_presence_status = g_strdup (""); if (priv->auto_presence_message == NULL) priv->auto_presence_message = g_strdup (""); } else { /* try the old versions */ priv->auto_presence_type = mcd_storage_get_integer (storage, name, MC_ACCOUNTS_KEY_AUTO_PRESENCE_TYPE); priv->auto_presence_status = mcd_storage_dup_string (storage, name, MC_ACCOUNTS_KEY_AUTO_PRESENCE_STATUS); priv->auto_presence_message = mcd_storage_dup_string (storage, name, MC_ACCOUNTS_KEY_AUTO_PRESENCE_MESSAGE); if (priv->auto_presence_status == NULL) priv->auto_presence_status = g_strdup (""); if (priv->auto_presence_message == NULL) priv->auto_presence_message = g_strdup (""); /* migrate to a more sensible storage format */ g_value_take_boxed (&value, tp_value_array_build (3, G_TYPE_UINT, (guint) priv->auto_presence_type, G_TYPE_STRING, priv->auto_presence_status, G_TYPE_STRING, priv->auto_presence_message, G_TYPE_INVALID)); if (mcd_storage_set_attribute (storage, name, MC_ACCOUNTS_KEY_AUTOMATIC_PRESENCE, &value)) { mcd_storage_set_attribute (storage, name, MC_ACCOUNTS_KEY_AUTO_PRESENCE_TYPE, NULL); mcd_storage_set_attribute (storage, name, MC_ACCOUNTS_KEY_AUTO_PRESENCE_STATUS, NULL); mcd_storage_set_attribute (storage, name, MC_ACCOUNTS_KEY_AUTO_PRESENCE_MESSAGE, NULL); mcd_storage_commit (storage, name); } } /* If invalid or something, force it to AVAILABLE - we want the auto * presence type to be an online status */ if (!_presence_type_is_online (priv->auto_presence_type)) { priv->auto_presence_type = TP_CONNECTION_PRESENCE_TYPE_AVAILABLE; g_free (priv->auto_presence_status); priv->auto_presence_status = g_strdup ("available"); } g_value_unset (&value); g_value_init (&value, TP_ARRAY_TYPE_OBJECT_PATH_LIST); if (priv->supersedes != NULL) g_ptr_array_unref (priv->supersedes); if (mcd_storage_get_attribute (storage, name, MC_ACCOUNTS_KEY_SUPERSEDES, &value, NULL)) { priv->supersedes = g_value_dup_boxed (&value); } else { priv->supersedes = g_ptr_array_new (); } g_value_unset (&value); /* check the manager */ if (!priv->manager && !load_manager (account)) { g_warning ("Could not find manager `%s'", priv->manager_name); mcd_account_loaded (account); } /* even though the manager is absent or unusable, we still register * * the accounts dbus name as it is otherwise acceptably configured */ _mcd_account_load (account, register_dbus_service, NULL); return TRUE; broken_account: /* normally, various callbacks would release locks when the manager * * became ready: however, this cannot happen for an incomplete account * * as it never gets a manager: We therefore invoke the account callbacks * * right now so the account manager doesn't hang around forever waiting * * for an event that cannot happen (at least until the account is fixed) */ mcd_account_loaded (account); return FALSE; } static void set_property (GObject *obj, guint prop_id, const GValue *val, GParamSpec *pspec) { McdAccount *account = MCD_ACCOUNT (obj); McdAccountPrivate *priv = account->priv; switch (prop_id) { case PROP_STORAGE: g_assert (priv->storage == NULL); priv->storage = g_value_dup_object (val); break; case PROP_DBUS_DAEMON: g_assert (priv->dbus_daemon == NULL); priv->dbus_daemon = g_value_dup_object (val); break; case PROP_CONNECTIVITY_MONITOR: g_assert (priv->connectivity == NULL); priv->connectivity = g_value_dup_object (val); break; case PROP_NAME: g_assert (priv->unique_name == NULL); priv->unique_name = g_value_dup_string (val); break; case PROP_ALWAYS_ON: priv->always_on = g_value_get_boolean (val); if (priv->always_on) { priv->enabled = TRUE; priv->connect_automatically = TRUE; priv->req_presence_type = priv->auto_presence_type; priv->req_presence_status = g_strdup (priv->auto_presence_status); priv->req_presence_message = g_strdup (priv->auto_presence_message); } break; case PROP_HIDDEN: priv->hidden = g_value_get_boolean (val); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (obj, prop_id, pspec); break; } } static void get_property (GObject *obj, guint prop_id, GValue *val, GParamSpec *pspec) { McdAccountPrivate *priv = MCD_ACCOUNT_PRIV (obj); switch (prop_id) { case PROP_DBUS_DAEMON: g_value_set_object (val, priv->dbus_daemon); break; case PROP_CONNECTIVITY_MONITOR: g_value_set_object (val, priv->connectivity); break; case PROP_NAME: g_value_set_string (val, priv->unique_name); break; case PROP_HIDDEN: g_value_set_boolean (val, priv->hidden); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (obj, prop_id, pspec); break; } } static void _mcd_account_finalize (GObject *object) { McdAccount *account = MCD_ACCOUNT (object); McdAccountPrivate *priv = MCD_ACCOUNT_PRIV (account); DEBUG ("%p (%s)", object, priv->unique_name); if (priv->changed_properties) g_hash_table_unref (priv->changed_properties); if (priv->properties_source != 0) g_source_remove (priv->properties_source); tp_clear_pointer (&priv->curr_presence_status, g_free); tp_clear_pointer (&priv->curr_presence_message, g_free); tp_clear_pointer (&priv->req_presence_status, g_free); tp_clear_pointer (&priv->req_presence_message, g_free); tp_clear_pointer (&priv->auto_presence_status, g_free); tp_clear_pointer (&priv->auto_presence_message, g_free); tp_clear_pointer (&priv->manager_name, g_free); tp_clear_pointer (&priv->protocol_name, g_free); tp_clear_pointer (&priv->unique_name, g_free); tp_clear_pointer (&priv->object_path, g_free); G_OBJECT_CLASS (mcd_account_parent_class)->finalize (object); } static void _mcd_account_dispose (GObject *object) { McdAccount *self = MCD_ACCOUNT (object); McdAccountPrivate *priv = self->priv; DEBUG ("%p (%s)", object, priv->unique_name); if (!self->priv->removed) { self->priv->removed = TRUE; tp_svc_account_emit_removed (self); } if (priv->online_requests) { GError *error; GList *list = priv->online_requests; error = g_error_new (TP_ERROR, TP_ERROR_DISCONNECTED, "Disposing account %s", priv->unique_name); while (list) { McdOnlineRequestData *data = list->data; data->callback (MCD_ACCOUNT (object), data->user_data, error); g_slice_free (McdOnlineRequestData, data); list = g_list_delete_link (list, list); } g_error_free (error); priv->online_requests = NULL; } tp_clear_object (&priv->manager); tp_clear_object (&priv->storage_plugin); tp_clear_object (&priv->storage); tp_clear_object (&priv->dbus_daemon); tp_clear_object (&priv->self_contact); tp_clear_object (&priv->connectivity); _mcd_account_set_connection_context (self, NULL); _mcd_account_set_connection (self, NULL); G_OBJECT_CLASS (mcd_account_parent_class)->dispose (object); } static GObject * _mcd_account_constructor (GType type, guint n_params, GObjectConstructParam *params) { GObjectClass *object_class = (GObjectClass *)mcd_account_parent_class; McdAccount *account; McdAccountPrivate *priv; account = MCD_ACCOUNT (object_class->constructor (type, n_params, params)); priv = account->priv; g_return_val_if_fail (account != NULL, NULL); if (G_UNLIKELY (!priv->storage || !priv->unique_name)) { g_object_unref (account); return NULL; } return (GObject *) account; } static void monitor_state_changed_cb ( McdConnectivityMonitor *monitor, gboolean connected, McdInhibit *inhibit, gpointer user_data) { McdAccount *self = MCD_ACCOUNT (user_data); if (connected) { if (mcd_account_would_like_to_connect (self)) { DEBUG ("account %s would like to connect", self->priv->unique_name); _mcd_account_connect_with_auto_presence (self, FALSE); } } else { if (_mcd_account_needs_dispatch (self)) { /* special treatment for cellular accounts */ DEBUG ("account %s is always dispatched and does not need a " "transport", self->priv->unique_name); } else { McdConnection *connection; DEBUG ("account %s must disconnect", self->priv->unique_name); connection = mcd_account_get_connection (self); if (connection != NULL) mcd_connection_close (connection, inhibit); } } if (!self->priv->waiting_for_connectivity) return; /* If we've gone online, allow the account to actually try to connect; * if we've fallen offline, say as much. (I don't actually think this * code will be reached if !connected, but.) */ DEBUG ("telling %s to %s", self->priv->unique_name, connected ? "proceed" : "give up"); mcd_account_connection_proceed_with_reason (self, connected, connected ? TP_CONNECTION_STATUS_REASON_NONE_SPECIFIED : TP_CONNECTION_STATUS_REASON_NETWORK_ERROR); self->priv->waiting_for_connectivity = FALSE; } static void _mcd_account_constructed (GObject *object) { GObjectClass *object_class = (GObjectClass *)mcd_account_parent_class; McdAccount *account = MCD_ACCOUNT (object); if (object_class->constructed) object_class->constructed (object); DEBUG ("%p (%s)", object, account->priv->unique_name); mcd_account_migrate_avatar (account); mcd_account_setup (account); tp_g_signal_connect_object (account->priv->connectivity, "state-change", (GCallback) monitor_state_changed_cb, account, 0); } static void mcd_account_add_signals (TpProxy *self, guint quark, DBusGProxy *proxy, gpointer data) { mc_cli_Connection_Manager_Interface_Account_Storage_add_signals (self, quark, proxy, data); } static void mcd_account_class_init (McdAccountClass * klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); g_type_class_add_private (object_class, sizeof (McdAccountPrivate)); object_class->constructor = _mcd_account_constructor; object_class->constructed = _mcd_account_constructed; object_class->dispose = _mcd_account_dispose; object_class->finalize = _mcd_account_finalize; object_class->set_property = set_property; object_class->get_property = get_property; klass->check_request = _mcd_account_check_request_real; g_object_class_install_property (object_class, PROP_DBUS_DAEMON, g_param_spec_object ("dbus-daemon", "DBus daemon", "DBus daemon", TP_TYPE_DBUS_DAEMON, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); g_object_class_install_property (object_class, PROP_CONNECTIVITY_MONITOR, g_param_spec_object ("connectivity monitor", "Connectivity monitor", "Connectivity monitor", MCD_TYPE_CONNECTIVITY_MONITOR, G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); g_object_class_install_property (object_class, PROP_STORAGE, g_param_spec_object ("storage", "storage", "storage", MCD_TYPE_STORAGE, G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); g_object_class_install_property (object_class, PROP_NAME, g_param_spec_string ("name", "Unique name", "Unique name", NULL, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); g_object_class_install_property (object_class, PROP_ALWAYS_ON, g_param_spec_boolean ("always-on", "Always on?", "Always on?", FALSE, G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (object_class, PROP_HIDDEN, g_param_spec_boolean ("hidden", "Hidden?", "Is this account hidden?", FALSE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); /* Signals */ _mcd_account_signals[VALIDITY_CHANGED] = g_signal_new ("validity-changed", G_OBJECT_CLASS_TYPE (klass), G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED, 0, NULL, NULL, g_cclosure_marshal_VOID__BOOLEAN, G_TYPE_NONE, 1, G_TYPE_BOOLEAN); _mcd_account_signals[CONNECTION_PATH_CHANGED] = g_signal_new ("connection-path-changed", G_OBJECT_CLASS_TYPE (klass), G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED, 0, NULL, NULL, g_cclosure_marshal_VOID__STRING, G_TYPE_NONE, 1, G_TYPE_STRING); account_ready_quark = g_quark_from_static_string ("mcd_account_load"); tp_proxy_or_subclass_hook_on_interface_add (TP_TYPE_CONNECTION_MANAGER, mcd_account_add_signals); } static void mcd_account_init (McdAccount *account) { McdAccountPrivate *priv; priv = G_TYPE_INSTANCE_GET_PRIVATE ((account), MCD_TYPE_ACCOUNT, McdAccountPrivate); account->priv = priv; priv->req_presence_type = TP_CONNECTION_PRESENCE_TYPE_OFFLINE; priv->req_presence_status = g_strdup ("offline"); priv->req_presence_message = g_strdup (""); priv->curr_presence_type = TP_CONNECTION_PRESENCE_TYPE_OFFLINE; priv->curr_presence_status = g_strdup ("offline"); priv->curr_presence_message = g_strdup (""); priv->always_on = FALSE; priv->always_dispatch = FALSE; priv->enabled = FALSE; priv->connect_automatically = FALSE; priv->changing_presence = FALSE; priv->auto_presence_type = TP_CONNECTION_PRESENCE_TYPE_AVAILABLE; priv->auto_presence_status = g_strdup ("available"); priv->auto_presence_message = g_strdup (""); /* initializes the interfaces */ mcd_dbus_init_interfaces_instances (account); priv->conn_status = TP_CONNECTION_STATUS_DISCONNECTED; priv->conn_reason = TP_CONNECTION_STATUS_REASON_REQUESTED; priv->conn_dbus_error = g_strdup (""); priv->conn_error_details = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, (GDestroyNotify) tp_g_value_slice_free); priv->changed_properties = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, (GDestroyNotify) tp_g_value_slice_free); g_set_error (&priv->invalid_reason, TP_ERROR, TP_ERROR_NOT_YET, "This account is not yet fully loaded"); } McdAccount * mcd_account_new (McdAccountManager *account_manager, const gchar *name, McdConnectivityMonitor *connectivity) { gpointer *obj; McdStorage *storage = mcd_account_manager_get_storage (account_manager); TpDBusDaemon *dbus = mcd_account_manager_get_dbus_daemon (account_manager); obj = g_object_new (MCD_TYPE_ACCOUNT, "storage", storage, "dbus-daemon", dbus, "connectivity-monitor", connectivity, "name", name, NULL); return MCD_ACCOUNT (obj); } McdStorage * _mcd_account_get_storage (McdAccount *account) { return account->priv->storage; } /* * mcd_account_is_valid: * @account: the #McdAccount. * * Checks that the account is usable: * - Manager, protocol and TODO presets (if specified) must exist * - All required parameters for the protocol must be set * * Returns: %TRUE if the account is valid, false otherwise. */ gboolean mcd_account_is_valid (McdAccount *account) { McdAccountPrivate *priv = MCD_ACCOUNT_PRIV (account); return priv->invalid_reason == NULL; } /** * mcd_account_is_enabled: * @account: the #McdAccount. * * Checks if the account is enabled: * * Returns: %TRUE if the account is enabled, false otherwise. */ gboolean mcd_account_is_enabled (McdAccount *account) { McdAccountPrivate *priv = MCD_ACCOUNT_PRIV (account); return priv->enabled; } gboolean _mcd_account_is_hidden (McdAccount *account) { g_return_val_if_fail (MCD_IS_ACCOUNT (account), FALSE); return account->priv->hidden; } const gchar * mcd_account_get_unique_name (McdAccount *account) { return account->priv->unique_name; } const gchar * mcd_account_get_object_path (McdAccount *account) { return account->priv->object_path; } /** * _mcd_account_dup_parameters: * @account: the #McdAccount. * * Get the parameters set for this account. The resulting #GHashTable will be * newly allocated and must be g_hash_table_unref()'d after use. * * Returns: @account's current parameters, or %NULL if they could not be * retrieved. */ GHashTable * _mcd_account_dup_parameters (McdAccount *account) { McdAccountPrivate *priv; TpProtocol *protocol; GList *protocol_params; GList *iter; GHashTable *params; g_return_val_if_fail (MCD_IS_ACCOUNT (account), NULL); priv = account->priv; DEBUG ("called"); /* FIXME: this is ridiculous. MC stores the parameters for the account, so * it should be able to expose them on D-Bus even if the CM is uninstalled. * It shouldn't need to iterate across the parameters supported by the CM. * But it does, because MC doesn't store the types of parameters. So it * needs the CM (or .manager file) to be around to tell it whether "true" * is a string or a boolean… */ if (!priv->manager && !load_manager (account)) { DEBUG ("unable to load manager for account %s", priv->unique_name); return NULL; } protocol = _mcd_manager_dup_protocol (priv->manager, priv->protocol_name); if (G_UNLIKELY (protocol == NULL)) { DEBUG ("unable to get protocol for %s account %s", priv->protocol_name, priv->unique_name); return NULL; } params = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, (GDestroyNotify) tp_g_value_slice_free); protocol_params = tp_protocol_dup_params (protocol); for (iter = protocol_params; iter != NULL; iter = iter->next) { TpConnectionManagerParam *param = iter->data; const gchar *name = tp_connection_manager_param_get_name (param); GValue v = G_VALUE_INIT; if (mcd_account_get_parameter (account, name, &v, NULL)) { g_hash_table_insert (params, g_strdup (name), tp_g_value_slice_dup (&v)); g_value_unset (&v); } } g_list_free_full (protocol_params, (GDestroyNotify) tp_connection_manager_param_free); g_object_unref (protocol); return params; } /** * mcd_account_request_presence: * @account: the #McdAccount. * @presence: a #TpConnectionPresenceType. * @status: presence status. * @message: presence status message. * * Request a presence status on the account, initiated by some other part of * MC (i.e. not by user request). */ void mcd_account_request_presence (McdAccount *account, TpConnectionPresenceType presence, const gchar *status, const gchar *message) { mcd_account_request_presence_int (account, presence, status, message, FALSE); } static void mcd_account_update_self_presence (McdAccount *account, guint presence, const gchar *status, const gchar *message, TpContact *self_contact) { McdAccountPrivate *priv = account->priv; gboolean changed = FALSE; GValue value = G_VALUE_INIT; if (self_contact != account->priv->self_contact) return; if (priv->curr_presence_type != presence) { priv->curr_presence_type = presence; changed = TRUE; } if (tp_strdiff (priv->curr_presence_status, status)) { g_free (priv->curr_presence_status); priv->curr_presence_status = g_strdup (status); changed = TRUE; } if (tp_strdiff (priv->curr_presence_message, message)) { g_free (priv->curr_presence_message); priv->curr_presence_message = g_strdup (message); changed = TRUE; } if (_mcd_connection_presence_info_is_ready (priv->connection)) { _mcd_account_set_changing_presence (account, FALSE); } if (!changed) return; g_value_init (&value, TP_STRUCT_TYPE_SIMPLE_PRESENCE); g_value_take_boxed (&value, tp_value_array_build (3, G_TYPE_UINT, presence, G_TYPE_STRING, status, G_TYPE_STRING, message, G_TYPE_INVALID)); mcd_account_changed_property (account, "CurrentPresence", &value); g_value_unset (&value); } /* TODO: remove when the relative members will become public */ void mcd_account_get_requested_presence (McdAccount *account, TpConnectionPresenceType *presence, const gchar **status, const gchar **message) { McdAccountPrivate *priv = account->priv; if (presence != NULL) *presence = priv->req_presence_type; if (status != NULL) *status = priv->req_presence_status; if (message != NULL) *message = priv->req_presence_message; } /* TODO: remove when the relative members will become public */ void mcd_account_get_current_presence (McdAccount *account, TpConnectionPresenceType *presence, const gchar **status, const gchar **message) { McdAccountPrivate *priv = account->priv; if (presence != NULL) *presence = priv->curr_presence_type; if (status != NULL) *status = priv->curr_presence_status; if (message != NULL) *message = priv->curr_presence_message; } /* * mcd_account_would_like_to_connect: * @account: an account * * Returns: %TRUE if @account is not currently in the process of trying to * connect, but would like to be, in a perfect world. */ gboolean mcd_account_would_like_to_connect (McdAccount *account) { McdAccountPrivate *priv; g_return_val_if_fail (MCD_IS_ACCOUNT (account), FALSE); priv = account->priv; if (!priv->enabled) { DEBUG ("%s not Enabled", priv->unique_name); return FALSE; } if (!mcd_account_is_valid (account)) { DEBUG ("%s not Valid", priv->unique_name); return FALSE; } if (priv->conn_status != TP_CONNECTION_STATUS_DISCONNECTED) { DEBUG ("%s already connecting/connected", priv->unique_name); return FALSE; } if (!priv->connect_automatically && !_presence_type_is_online (priv->req_presence_type)) { DEBUG ("%s does not ConnectAutomatically, and its RequestedPresence " "(%u, '%s', '%s') doesn't indicate the user wants to be online", priv->unique_name, priv->req_presence_type, priv->req_presence_status, priv->req_presence_message); return FALSE; } return TRUE; } /* TODO: remove when the relative members will become public */ const gchar * mcd_account_get_manager_name (McdAccount *account) { McdAccountPrivate *priv = account->priv; return priv->manager_name; } /* TODO: remove when the relative members will become public */ const gchar * mcd_account_get_protocol_name (McdAccount *account) { McdAccountPrivate *priv = account->priv; return priv->protocol_name; } /** * mcd_account_get_cm: * @account: an account * * Fetches the connection manager through which @account connects. If @account * is not ready, or is invalid (perhaps because the connection manager is * missing), this may be %NULL. * * Returns: the connection manager through which @account connects, or %NULL. */ TpConnectionManager * mcd_account_get_cm (McdAccount *account) { g_return_val_if_fail (account != NULL, NULL); g_return_val_if_fail (MCD_IS_ACCOUNT (account), NULL); return mcd_manager_get_tp_proxy (account->priv->manager); } void _mcd_account_set_normalized_name (McdAccount *account, const gchar *name) { McdAccountPrivate *priv = account->priv; GValue value = G_VALUE_INIT; const gchar *account_name = mcd_account_get_unique_name (account); DEBUG ("called (%s)", name); g_value_init (&value, G_TYPE_STRING); g_value_set_static_string (&value, name); mcd_storage_set_attribute (priv->storage, account_name, MC_ACCOUNTS_KEY_NORMALIZED_NAME, &value); mcd_storage_commit (priv->storage, account_name); mcd_account_changed_property (account, MC_ACCOUNTS_KEY_NORMALIZED_NAME, &value); g_value_unset (&value); } void _mcd_account_set_avatar_token (McdAccount *account, const gchar *token) { McdAccountPrivate *priv = account->priv; const gchar *account_name = mcd_account_get_unique_name (account); DEBUG ("called (%s)", token); mcd_storage_set_string (priv->storage, account_name, MC_ACCOUNTS_KEY_AVATAR_TOKEN, token); mcd_storage_commit (priv->storage, account_name); } gchar * _mcd_account_get_avatar_token (McdAccount *account) { McdAccountPrivate *priv = account->priv; const gchar *account_name = mcd_account_get_unique_name (account); return mcd_storage_dup_string (priv->storage, account_name, MC_ACCOUNTS_KEY_AVATAR_TOKEN); } gboolean _mcd_account_set_avatar (McdAccount *account, const GArray *avatar, const gchar *mime_type, const gchar *token, GError **error) { McdAccountPrivate *priv = MCD_ACCOUNT_PRIV (account); const gchar *account_name = mcd_account_get_unique_name (account); DEBUG ("called"); if (G_LIKELY(avatar) && avatar->len > 0) { if (!save_avatar (account, avatar->data, avatar->len, error)) { g_warning ("%s: writing avatar failed", G_STRLOC); return FALSE; } } else { /* We implement "deleting" an avatar by writing out a zero-length * file, so that it will override lower-priority directories. */ if (!save_avatar (account, "", 0, error)) { g_warning ("%s: writing empty avatar failed", G_STRLOC); return FALSE; } } if (mime_type != NULL) mcd_storage_set_string (priv->storage, account_name, MC_ACCOUNTS_KEY_AVATAR_MIME, mime_type); if (token) { gchar *prev_token; prev_token = _mcd_account_get_avatar_token (account); mcd_storage_set_string (priv->storage, account_name, MC_ACCOUNTS_KEY_AVATAR_TOKEN, token); if (!prev_token || strcmp (prev_token, token) != 0) tp_svc_account_interface_avatar_emit_avatar_changed (account); g_free (prev_token); } else { mcd_storage_set_attribute (priv->storage, account_name, MC_ACCOUNTS_KEY_AVATAR_TOKEN, NULL); mcd_account_send_avatar_to_connection (account, avatar, mime_type); } mcd_storage_commit (priv->storage, account_name); return TRUE; } static GArray * load_avatar_or_warn (const gchar *filename) { GError *error = NULL; gchar *data = NULL; gsize length; if (g_file_get_contents (filename, &data, &length, &error)) { if (length > 0 && length < G_MAXUINT) { GArray *ret; ret = g_array_new (FALSE, FALSE, 1); g_array_append_vals (ret, data, (guint) length); return ret; } else { DEBUG ("avatar %s was empty or ridiculously large (%" G_GSIZE_FORMAT " bytes)", filename, length); return NULL; } } else { DEBUG ("error reading %s: %s", filename, error->message); g_error_free (error); return NULL; } } void _mcd_account_get_avatar (McdAccount *account, GArray **avatar, gchar **mime_type) { McdAccountPrivate *priv = MCD_ACCOUNT_PRIV (account); const gchar *account_name = mcd_account_get_unique_name (account); gchar *basename; gchar *filename; if (mime_type != NULL) *mime_type = mcd_storage_dup_string (priv->storage, account_name, MC_ACCOUNTS_KEY_AVATAR_MIME); if (avatar == NULL) return; *avatar = NULL; get_avatar_paths (account, NULL, &basename, &filename); if (g_file_test (filename, G_FILE_TEST_EXISTS)) { *avatar = load_avatar_or_warn (filename); } else { const gchar * const *iter; for (iter = g_get_system_data_dirs (); iter != NULL && *iter != NULL; iter++) { gchar *candidate = g_build_filename (*iter, "telepathy", "mission-control", basename, NULL); if (g_file_test (candidate, G_FILE_TEST_EXISTS)) { *avatar = load_avatar_or_warn (candidate); g_free (candidate); break; } g_free (candidate); } } g_free (filename); g_free (basename); } GPtrArray * _mcd_account_get_supersedes (McdAccount *self) { return self->priv->supersedes; } static void mcd_account_self_contact_notify_alias_cb (McdAccount *self, GParamSpec *unused_param_spec G_GNUC_UNUSED, TpContact *self_contact) { GValue value = G_VALUE_INIT; if (self_contact != self->priv->self_contact) return; g_value_init (&value, G_TYPE_STRING); g_object_get_property (G_OBJECT (self_contact), "alias", &value); mcd_account_set_string_val (self, MC_ACCOUNTS_KEY_NICKNAME, &value, MCD_DBUS_PROP_SET_FLAG_NONE, NULL); g_value_unset (&value); } static gchar * mcd_account_get_alias (McdAccount *account) { McdAccountPrivate *priv = MCD_ACCOUNT_PRIV (account); const gchar *account_name = mcd_account_get_unique_name (account); return mcd_storage_dup_string (priv->storage, account_name, MC_ACCOUNTS_KEY_NICKNAME); } static void _mcd_account_online_request_completed (McdAccount *account, GError *error) { McdAccountPrivate *priv = MCD_ACCOUNT_PRIV (account); GList *list; list = priv->online_requests; while (list) { McdOnlineRequestData *data = list->data; data->callback (account, data->user_data, error); g_slice_free (McdOnlineRequestData, data); list = g_list_delete_link (list, list); } if (error) g_error_free (error); priv->online_requests = NULL; } static inline void process_online_requests (McdAccount *account, TpConnectionStatus status, TpConnectionStatusReason reason) { McdAccountPrivate *priv = MCD_ACCOUNT_PRIV (account); GError *error; switch (status) { case TP_CONNECTION_STATUS_CONNECTED: error = NULL; break; case TP_CONNECTION_STATUS_DISCONNECTED: error = g_error_new (TP_ERROR, TP_ERROR_DISCONNECTED, "Account %s disconnected with reason %d", priv->unique_name, reason); break; default: return; } _mcd_account_online_request_completed (account, error); } static void on_conn_status_changed (McdConnection *connection, TpConnectionStatus status, TpConnectionStatusReason reason, TpConnection *tp_conn, const gchar *dbus_error, GHashTable *details, McdAccount *account) { _mcd_account_set_connection_status (account, status, reason, tp_conn, dbus_error, details); } /* clear the "register" flag, if necessary */ static void clear_register (McdAccount *self) { GHashTable *params = _mcd_account_dup_parameters (self); if (params == NULL) { DEBUG ("no params returned"); return; } if (tp_asv_get_boolean (params, "register", NULL)) { GValue value = G_VALUE_INIT; const gchar *account_name = mcd_account_get_unique_name (self); _mcd_account_set_parameter (self, "register", NULL); g_hash_table_remove (params, "register"); g_value_init (&value, TP_HASH_TYPE_STRING_VARIANT_MAP); g_value_take_boxed (&value, params); mcd_account_changed_property (self, "Parameters", &value); g_value_unset (&value); mcd_storage_commit (self->priv->storage, account_name); } else { g_hash_table_unref (params); } } void _mcd_account_set_connection_status (McdAccount *account, TpConnectionStatus status, TpConnectionStatusReason reason, TpConnection *tp_conn, const gchar *dbus_error, const GHashTable *details) { McdAccountPrivate *priv = MCD_ACCOUNT_PRIV (account); gboolean changed = FALSE; DEBUG ("%s: %u because %u", priv->unique_name, status, reason); mcd_account_freeze_properties (account); if (status == TP_CONNECTION_STATUS_CONNECTED) { _mcd_account_set_has_been_online (account); clear_register (account); DEBUG ("clearing connection error details"); g_free (priv->conn_dbus_error); priv->conn_dbus_error = g_strdup (""); g_hash_table_remove_all (priv->conn_error_details); } else if (status == TP_CONNECTION_STATUS_DISCONNECTED) { /* we'll get this from the TpContact soon, but it makes sense * to bundle everything together into one signal */ mcd_account_update_self_presence (account, TP_CONNECTION_PRESENCE_TYPE_OFFLINE, "offline", "", priv->self_contact); if (dbus_error == NULL) dbus_error = ""; if (tp_strdiff (dbus_error, priv->conn_dbus_error)) { DEBUG ("changing detailed D-Bus error from '%s' to '%s'", priv->conn_dbus_error, dbus_error); g_free (priv->conn_dbus_error); priv->conn_dbus_error = g_strdup (dbus_error); changed = TRUE; } /* to avoid having to do deep comparisons, we assume that any change to * or from a non-empty hash table is interesting. */ if ((details != NULL && tp_asv_size (details) > 0) || tp_asv_size (priv->conn_error_details) > 0) { DEBUG ("changing error details"); g_hash_table_remove_all (priv->conn_error_details); if (details != NULL) tp_g_hash_table_update (priv->conn_error_details, (GHashTable *) details, (GBoxedCopyFunc) g_strdup, (GBoxedCopyFunc) tp_g_value_slice_dup); changed = TRUE; } } if (priv->tp_connection != tp_conn || (tp_conn != NULL && status == TP_CONNECTION_STATUS_DISCONNECTED)) { tp_clear_object (&priv->tp_connection); tp_clear_object (&priv->self_contact); if (tp_conn != NULL && status != TP_CONNECTION_STATUS_DISCONNECTED) priv->tp_connection = g_object_ref (tp_conn); else priv->tp_connection = NULL; changed = TRUE; } if (status != priv->conn_status) { DEBUG ("changing connection status from %u to %u", priv->conn_status, status); priv->conn_status = status; changed = TRUE; } if (reason != priv->conn_reason) { DEBUG ("changing connection status reason from %u to %u", priv->conn_reason, reason); priv->conn_reason = reason; changed = TRUE; } if (changed) { GValue value = G_VALUE_INIT; _mcd_account_tp_connection_changed (account, priv->tp_connection); g_value_init (&value, G_TYPE_UINT); g_value_set_uint (&value, priv->conn_status); mcd_account_changed_property (account, "ConnectionStatus", &value); g_value_set_uint (&value, priv->conn_reason); mcd_account_changed_property (account, "ConnectionStatusReason", &value); g_value_unset (&value); g_value_init (&value, G_TYPE_STRING); g_value_set_string (&value, priv->conn_dbus_error); mcd_account_changed_property (account, "ConnectionError", &value); g_value_unset (&value); g_value_init (&value, TP_HASH_TYPE_STRING_VARIANT_MAP); g_value_set_boxed (&value, priv->conn_error_details); mcd_account_changed_property (account, "ConnectionErrorDetails", &value); g_value_unset (&value); } mcd_account_thaw_properties (account); process_online_requests (account, status, reason); } TpConnectionStatus mcd_account_get_connection_status (McdAccount *account) { McdAccountPrivate *priv = MCD_ACCOUNT_PRIV (account); return priv->conn_status; } void _mcd_account_tp_connection_changed (McdAccount *account, TpConnection *tp_conn) { GValue value = G_VALUE_INIT; g_value_init (&value, DBUS_TYPE_G_OBJECT_PATH); if (tp_conn == NULL) { g_value_set_static_boxed (&value, "/"); } else { g_value_set_boxed (&value, tp_proxy_get_object_path (tp_conn)); } mcd_account_changed_property (account, "Connection", &value); g_signal_emit (account, _mcd_account_signals[CONNECTION_PATH_CHANGED], 0, g_value_get_boxed (&value)); g_value_unset (&value); } McdConnection * mcd_account_get_connection (McdAccount *account) { McdAccountPrivate *priv = MCD_ACCOUNT_PRIV (account); return priv->connection; } typedef struct { McdAccountCheckValidityCb callback; gpointer user_data; } CheckValidityData; static void check_validity_check_parameters_cb (McdAccount *account, const GError *invalid_reason, gpointer user_data) { CheckValidityData *data = (CheckValidityData *) user_data; McdAccountPrivate *priv = account->priv; gboolean now_valid = (invalid_reason == NULL); gboolean was_valid = (priv->invalid_reason == NULL); g_clear_error (&priv->invalid_reason); if (invalid_reason != NULL) { priv->invalid_reason = g_error_copy (invalid_reason); } if (was_valid != now_valid) { GValue value = G_VALUE_INIT; DEBUG ("Account validity changed (old: %d, new: %d)", was_valid, now_valid); g_signal_emit (account, _mcd_account_signals[VALIDITY_CHANGED], 0, now_valid); g_value_init (&value, G_TYPE_BOOLEAN); g_value_set_boolean (&value, now_valid); mcd_account_changed_property (account, "Valid", &value); if (now_valid) { /* Newly valid - try setting requested presence again. * This counts as user-initiated, because the user caused the * account to become valid somehow. */ mcd_account_rerequest_presence (account, TRUE); } } if (data->callback != NULL) data->callback (account, invalid_reason, data->user_data); g_slice_free (CheckValidityData, data); } void mcd_account_check_validity (McdAccount *account, McdAccountCheckValidityCb callback, gpointer user_data) { CheckValidityData *data; g_return_if_fail (MCD_IS_ACCOUNT (account)); data = g_slice_new0 (CheckValidityData); data->callback = callback; data->user_data = user_data; mcd_account_check_parameters (account, check_validity_check_parameters_cb, data); } /* * _mcd_account_connect_with_auto_presence: * @account: the #McdAccount. * @user_initiated: %TRUE if the connection attempt is in response to a user * request (like a request for a channel) * * Request the account to go back online with the current RequestedPresence, if * it is not Offline, or with the configured AutomaticPresence otherwise. * * This is appropriate in these situations: * - going online automatically because we've gained connectivity * - going online automatically in order to request a channel */ void _mcd_account_connect_with_auto_presence (McdAccount *account, gboolean user_initiated) { McdAccountPrivate *priv = account->priv; if (_presence_type_is_online (priv->req_presence_type)) mcd_account_rerequest_presence (account, user_initiated); else mcd_account_request_presence_int (account, priv->auto_presence_type, priv->auto_presence_status, priv->auto_presence_message, user_initiated); } /* * _mcd_account_online_request: * @account: the #McdAccount. * @callback: a #McdOnlineRequestCb. * @userdata: user data to be passed to @callback. * * If the account is online, call @callback immediately; else, try to put the * account online (set its presence to the automatic presence) and eventually * invoke @callback. * * @callback is always invoked exactly once. */ void _mcd_account_online_request (McdAccount *account, McdOnlineRequestCb callback, gpointer userdata) { McdAccountPrivate *priv = account->priv; McdOnlineRequestData *data; DEBUG ("connection status for %s is %d", priv->unique_name, priv->conn_status); if (priv->conn_status == TP_CONNECTION_STATUS_CONNECTED) { /* invoke the callback now */ DEBUG ("%s is already connected", priv->unique_name); callback (account, userdata, NULL); return; } if (priv->loaded && !mcd_account_is_valid (account)) { /* FIXME: pick a better error and put it in telepathy-spec? */ GError e = { TP_ERROR, TP_ERROR_NOT_AVAILABLE, "account isn't Valid (not enough information to put it online)" }; DEBUG ("%s: %s", priv->unique_name, e.message); callback (account, userdata, &e); return; } if (priv->loaded && !priv->enabled) { /* FIXME: pick a better error and put it in telepathy-spec? */ GError e = { TP_ERROR, TP_ERROR_NOT_AVAILABLE, "account isn't Enabled" }; DEBUG ("%s: %s", priv->unique_name, e.message); callback (account, userdata, &e); return; } /* listen to the StatusChanged signal */ if (priv->loaded && priv->conn_status == TP_CONNECTION_STATUS_DISCONNECTED) _mcd_account_connect_with_auto_presence (account, TRUE); /* now the connection should be in connecting state; insert the * callback in the online_requests hash table, which will be processed * in the connection-status-changed callback */ data = g_slice_new (McdOnlineRequestData); data->callback = callback; data->user_data = userdata; priv->online_requests = g_list_append (priv->online_requests, data); } GKeyFile * _mcd_account_get_keyfile (McdAccount *account) { McdAccountPrivate *priv = MCD_ACCOUNT_PRIV (account); return priv->keyfile; } static gchar * _mcd_account_get_old_avatar_filename (McdAccount *account, gchar **old_dir) { McdAccountPrivate *priv = account->priv; gchar *filename; *old_dir = get_old_account_data_path (priv); filename = g_build_filename (*old_dir, MC_OLD_AVATAR_FILENAME, NULL); return filename; } static void mcd_account_process_initial_avatar_token (McdAccount *self, const gchar *token) { GArray *avatar = NULL; gchar *mime_type = NULL; gchar *prev_token; g_assert (self->priv->self_contact != NULL); prev_token = _mcd_account_get_avatar_token (self); DEBUG ("%s", self->priv->unique_name); if (prev_token == NULL) DEBUG ("no previous local avatar token"); else DEBUG ("previous local avatar token: '%s'", prev_token); if (avatar == NULL) DEBUG ("no previous local avatar"); else DEBUG ("previous local avatar: %u bytes, MIME type '%s'", avatar->len, (mime_type != NULL ? mime_type : "(null)")); if (token == NULL) DEBUG ("no remote avatar token"); else DEBUG ("remote avatar token: '%s'", token); _mcd_account_get_avatar (self, &avatar, &mime_type); /* If we have a stored avatar but no avatar token, we must have * changed it locally; set it. * * Meanwhile, if the self-contact's avatar token is missing, this is * a protocol like link-local XMPP where avatars don't persist. * We can distinguish between this case (token is missing, so token = NULL) * and the case where there is no avatar on an XMPP server (token is * present and empty), although it's ridiculously subtle. * * Either way, upload our avatar, if any. */ if (tp_str_empty (prev_token) || token == NULL) { if (avatar != NULL) { if (tp_str_empty (prev_token)) DEBUG ("We have an avatar that has never been uploaded"); if (tp_str_empty (token)) DEBUG ("We have an avatar and the server doesn't"); mcd_account_send_avatar_to_connection (self, avatar, mime_type); goto out; } } /* Otherwise, if the self-contact's avatar token * differs from ours, one of our "other selves" must have changed * it remotely. Behave the same as if it changes remotely * mid-session - i.e. download it and use it as our new avatar. * * In particular, this includes the case where we had * a non-empty avatar last time we signed in, but another client * has deleted it from the server since then (prev_token nonempty, * token = ""). */ if (tp_strdiff (token, prev_token)) { GFile *file = tp_contact_get_avatar_file (self->priv->self_contact); DEBUG ("The server's avatar does not match ours"); if (file != NULL) { /* We have already downloaded it: copy it. */ mcd_account_self_contact_notify_avatar_file_cb (self, NULL, self->priv->self_contact); } /* ... else we haven't downloaded it yet, but when we do, * notify::avatar-file will go off. */ } out: g_free (prev_token); tp_clear_pointer (&avatar, g_array_unref); g_free (mime_type); } static void account_conn_get_known_avatar_tokens_cb (TpConnection *conn, GHashTable *tokens, const GError *error, gpointer user_data, GObject *weak_object) { McdAccount *self = g_object_ref (weak_object); self->priv->waiting_for_initial_avatar = FALSE; if (error != NULL) { DEBUG ("%s: GetKnownAvatarTokens raised %s #%d: %s", self->priv->unique_name, g_quark_to_string (error->domain), error->code, error->message); } else if (self->priv->self_contact == user_data) { TpHandle handle = tp_contact_get_handle (self->priv->self_contact); mcd_account_process_initial_avatar_token (self, g_hash_table_lookup (tokens, GUINT_TO_POINTER (handle))); } else { DEBUG ("%s: GetKnownAvatarTokens for outdated self-contact '%s', " "ignoring", self->priv->unique_name, tp_contact_get_identifier (user_data)); } g_object_unref (self); } static void mcd_account_self_contact_upgraded_cb (GObject *source_object, GAsyncResult *res, gpointer user_data) { TpConnection *conn = TP_CONNECTION (source_object); McdAccount *self = tp_weak_ref_dup_object (user_data); GPtrArray *contacts = NULL; GError *error = NULL; if (self == NULL) return; g_return_if_fail (MCD_IS_ACCOUNT (self)); if (tp_connection_upgrade_contacts_finish (conn, res, &contacts, &error)) { TpContact *self_contact; g_assert (contacts->len == 1); self_contact = g_ptr_array_index (contacts, 0); if (self_contact == self->priv->self_contact) { DEBUG ("%s", tp_contact_get_identifier (self_contact)); tp_g_signal_connect_object (self_contact, "notify::alias", G_CALLBACK (mcd_account_self_contact_notify_alias_cb), self, G_CONNECT_SWAPPED); mcd_account_self_contact_notify_alias_cb (self, NULL, self_contact); tp_g_signal_connect_object (self_contact, "notify::avatar-file", G_CALLBACK (mcd_account_self_contact_notify_avatar_file_cb), self, G_CONNECT_SWAPPED); tp_g_signal_connect_object (self_contact, "presence-changed", G_CALLBACK (mcd_account_update_self_presence), self, G_CONNECT_SWAPPED); /* If the connection doesn't support SimplePresence then the * presence will be (UNSET, '', '') which is what we want anyway. */ mcd_account_update_self_presence (self, tp_contact_get_presence_type (self_contact), tp_contact_get_presence_status (self_contact), tp_contact_get_presence_message (self_contact), self_contact); /* We have to use GetKnownAvatarTokens() because of its special * case for CMs that don't always download an up-to-date * avatar token before signalling CONNECTED. */ if (tp_proxy_has_interface_by_id (conn, TP_IFACE_QUARK_CONNECTION_INTERFACE_AVATARS)) { guint self_handle = tp_contact_get_handle (self_contact); GArray *arr = g_array_new (FALSE, FALSE, sizeof (guint)); g_array_append_val (arr, self_handle); tp_cli_connection_interface_avatars_call_get_known_avatar_tokens ( conn, -1, arr, account_conn_get_known_avatar_tokens_cb, g_object_ref (self_contact), g_object_unref, (GObject *) self); } } else if (self->priv->self_contact == NULL) { DEBUG ("self-contact '%s' has disappeared since we asked to " "upgrade it", tp_contact_get_identifier (self_contact)); } else { DEBUG ("self-contact '%s' has changed to '%s' since we asked to " "upgrade it", tp_contact_get_identifier (self_contact), tp_contact_get_identifier (self->priv->self_contact)); } g_ptr_array_unref (contacts); } else { DEBUG ("failed to prepare self-contact: %s", error->message); g_clear_error (&error); } g_object_unref (self); tp_weak_ref_destroy (user_data); } static void mcd_account_self_contact_changed_cb (McdAccount *self, GParamSpec *unused_param_spec G_GNUC_UNUSED, TpConnection *tp_connection) { static const TpContactFeature contact_features[] = { TP_CONTACT_FEATURE_AVATAR_TOKEN, TP_CONTACT_FEATURE_AVATAR_DATA, TP_CONTACT_FEATURE_ALIAS, TP_CONTACT_FEATURE_PRESENCE }; TpContact *self_contact; if (tp_connection != self->priv->tp_connection) return; self_contact = tp_connection_get_self_contact (tp_connection); g_assert (self_contact != NULL); DEBUG ("%s", tp_contact_get_identifier (self_contact)); if (self_contact == self->priv->self_contact) return; g_clear_object (&self->priv->self_contact); self->priv->self_contact = g_object_ref (self_contact); _mcd_account_set_normalized_name (self, tp_contact_get_identifier (self_contact)); tp_connection_upgrade_contacts_async (tp_connection, 1, &self_contact, G_N_ELEMENTS (contact_features), contact_features, mcd_account_self_contact_upgraded_cb, tp_weak_ref_new (self, NULL, NULL)); } static void mcd_account_connection_ready_cb (McdAccount *account, McdConnection *connection) { McdAccountPrivate *priv = account->priv; gchar *nickname; TpConnection *tp_connection; TpConnectionStatus status; TpConnectionStatusReason reason; const gchar *dbus_error = NULL; const GHashTable *details = NULL; g_return_if_fail (MCD_IS_ACCOUNT (account)); g_return_if_fail (connection == priv->connection); tp_connection = mcd_connection_get_tp_connection (connection); g_return_if_fail (tp_connection != NULL); g_return_if_fail (priv->tp_connection == NULL || tp_connection == priv->tp_connection); g_assert (tp_proxy_is_prepared (tp_connection, TP_CONNECTION_FEATURE_CONNECTED)); status = tp_connection_get_status (tp_connection, &reason); dbus_error = tp_connection_get_detailed_error (tp_connection, &details); _mcd_account_set_connection_status (account, status, reason, tp_connection, dbus_error, details); tp_g_signal_connect_object (tp_connection, "notify::self-contact", G_CALLBACK (mcd_account_self_contact_changed_cb), account, G_CONNECT_SWAPPED); mcd_account_self_contact_changed_cb (account, NULL, tp_connection); g_assert (priv->self_contact != NULL); /* FIXME: ideally, on protocols with server-stored nicknames, this should * only be done if the local Nickname has been changed since last time we * were online; Aliasing doesn't currently offer a way to tell whether * this is such a protocol, though. * * As a first step towards doing the right thing, we assume that if our * locally-stored nickname is just the protocol identifer, the * server-stored nickname (if any) takes precedence. */ nickname = mcd_account_get_alias (account); if (tp_str_empty (nickname)) { DEBUG ("no nickname yet"); } else if (!tp_strdiff (nickname, tp_contact_get_identifier (priv->self_contact))) { DEBUG ("not setting nickname to '%s' since it matches the " "NormalizedName", nickname); } else { mcd_account_send_nickname_to_connection (account, nickname); } g_free (nickname); } void _mcd_account_set_connection (McdAccount *account, McdConnection *connection) { McdAccountPrivate *priv; g_return_if_fail (MCD_IS_ACCOUNT (account)); priv = account->priv; if (connection == priv->connection) return; if (priv->connection) { g_signal_handlers_disconnect_by_func (priv->connection, on_connection_abort, account); g_signal_handlers_disconnect_by_func (priv->connection, on_conn_status_changed, account); g_signal_handlers_disconnect_by_func (priv->connection, mcd_account_connection_ready_cb, account); g_object_unref (priv->connection); } tp_clear_object (&priv->tp_connection); priv->connection = connection; priv->waiting_for_initial_avatar = TRUE; if (connection) { g_return_if_fail (MCD_IS_CONNECTION (connection)); g_object_ref (connection); if (_mcd_connection_is_ready (connection)) { mcd_account_connection_ready_cb (account, connection); } else { g_signal_connect_swapped (connection, "ready", G_CALLBACK (mcd_account_connection_ready_cb), account); } g_signal_connect (connection, "connection-status-changed", G_CALLBACK (on_conn_status_changed), account); g_signal_connect (connection, "abort", G_CALLBACK (on_connection_abort), account); } else { priv->conn_status = TP_CONNECTION_STATUS_DISCONNECTED; } } void _mcd_account_set_has_been_online (McdAccount *account) { if (!account->priv->has_been_online) { GValue value = G_VALUE_INIT; const gchar *account_name = mcd_account_get_unique_name (account); g_value_init (&value, G_TYPE_BOOLEAN); g_value_set_boolean (&value, TRUE); mcd_storage_set_attribute (account->priv->storage, account_name, MC_ACCOUNTS_KEY_HAS_BEEN_ONLINE, &value); account->priv->has_been_online = TRUE; mcd_storage_commit (account->priv->storage, account_name); mcd_account_changed_property (account, MC_ACCOUNTS_KEY_HAS_BEEN_ONLINE, &value); g_value_unset (&value); } } McdAccountConnectionContext * _mcd_account_get_connection_context (McdAccount *self) { g_return_val_if_fail (MCD_IS_ACCOUNT (self), NULL); return self->priv->connection_context; } void _mcd_account_set_connection_context (McdAccount *self, McdAccountConnectionContext *c) { g_return_if_fail (MCD_IS_ACCOUNT (self)); if (self->priv->connection_context != NULL) { _mcd_account_connection_context_free (self->priv->connection_context); } self->priv->connection_context = c; } gboolean _mcd_account_get_always_on (McdAccount *self) { g_return_val_if_fail (MCD_IS_ACCOUNT (self), FALSE); return self->priv->always_on; } gboolean _mcd_account_needs_dispatch (McdAccount *self) { g_return_val_if_fail (MCD_IS_ACCOUNT (self), FALSE); return self->priv->always_dispatch; } gboolean mcd_account_parameter_is_secret (McdAccount *self, const gchar *name) { McdAccountPrivate *priv = self->priv; const TpConnectionManagerParam *param; param = mcd_manager_get_protocol_param (priv->manager, priv->protocol_name, name); return (param != NULL && tp_connection_manager_param_is_secret (param)); } void _mcd_account_set_changing_presence (McdAccount *self, gboolean value) { McdAccountPrivate *priv = self->priv; GValue changing_presence = G_VALUE_INIT; priv->changing_presence = value; g_value_init (&changing_presence, G_TYPE_BOOLEAN); g_value_set_boolean (&changing_presence, value); mcd_account_changed_property (self, "ChangingPresence", &changing_presence); g_value_unset (&changing_presence); } gchar * mcd_account_dup_display_name (McdAccount *self) { const gchar *name = mcd_account_get_unique_name (self); return mcd_storage_dup_string (self->priv->storage, name, "DisplayName"); } gchar * mcd_account_dup_icon (McdAccount *self) { const gchar *name = mcd_account_get_unique_name (self); return mcd_storage_dup_string (self->priv->storage, name, "Icon"); } gchar * mcd_account_dup_nickname (McdAccount *self) { const gchar *name = mcd_account_get_unique_name (self); return mcd_storage_dup_string (self->priv->storage, name, "Nickname"); } McdConnectivityMonitor * mcd_account_get_connectivity_monitor (McdAccount *self) { return self->priv->connectivity; } gboolean mcd_account_get_waiting_for_connectivity (McdAccount *self) { return self->priv->waiting_for_connectivity; } void mcd_account_set_waiting_for_connectivity (McdAccount *self, gboolean waiting) { self->priv->waiting_for_connectivity = waiting; } telepathy-mission-control-5.16.4/src/mcd-account-connection.c0000644000175000017500000001142412735242352025311 0ustar00gkiagiagkiagia00000000000000/* vi: set et sw=4 ts=8 cino=t0,(0: */ /* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4; tab-width: 8 -*- */ /* * This file is part of mission-control * * Copyright (C) 2008-2009 Nokia Corporation. * Copyright (C) 2009 Collabora Ltd. * * Contact: Alberto Mardegan * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * version 2.1 as published by the Free Software Foundation. * * This library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA * */ #include "config.h" #include #include #include #include "mcd-master.h" #include "mcd-master-priv.h" #include "mcd-account.h" #include "mcd-account-priv.h" #include "mcd-account-manager.h" #include "mcd-connection-priv.h" struct _McdAccountConnectionContext { GHashTable *params; gboolean user_initiated; }; void _mcd_account_connection_context_free (McdAccountConnectionContext *c) { g_hash_table_unref (c->params); g_free (c); } void _mcd_account_connection_begin (McdAccount *account, gboolean user_initiated) { McdAccountConnectionContext *ctx; /* check whether a connection process is already ongoing */ if (_mcd_account_get_connection_context (account) != NULL) { DEBUG ("already trying to connect"); return; } /* get account params */ /* create dynamic params HT */ /* run the handlers */ ctx = g_malloc (sizeof (McdAccountConnectionContext)); ctx->user_initiated = user_initiated; /* If we get this far, the account should be valid, so getting the * parameters should succeed. */ ctx->params = _mcd_account_dup_parameters (account); g_assert (ctx->params != NULL); _mcd_account_set_connection_status (account, TP_CONNECTION_STATUS_CONNECTING, TP_CONNECTION_STATUS_REASON_REQUESTED, NULL, NULL, NULL); _mcd_account_set_connection_context (account, ctx); mcd_account_connection_proceed (account, TRUE); } void mcd_account_connection_proceed_with_reason (McdAccount *account, gboolean success, TpConnectionStatusReason reason) { McdAccountConnectionContext *ctx; gboolean delayed; /* call next handler, or terminate the chain (emitting proper signal). * if everything is fine, call mcd_manager_create_connection() and * _mcd_connection_connect () with the dynamic parameters. Remove that call * from mcd_manager_create_connection() */ ctx = _mcd_account_get_connection_context (account); g_return_if_fail (ctx != NULL); g_return_if_fail (ctx->params != NULL); if (success) { if (mcd_connectivity_monitor_is_online ( mcd_account_get_connectivity_monitor (account))) { DEBUG ("%s wants to connect and we're online - go for it", mcd_account_get_unique_name (account)); delayed = FALSE; } else if (!mcd_account_get_waiting_for_connectivity (account)) { DEBUG ("%s wants to connect, but we're offline; queuing it up", mcd_account_get_unique_name (account)); delayed = TRUE; mcd_account_set_waiting_for_connectivity (account, TRUE); } else { DEBUG ("%s wants to connect, but is already waiting for " "connectivity?", mcd_account_get_unique_name (account)); delayed = TRUE; } } else { DEBUG ("%s failed to connect: reason code %d", mcd_account_get_unique_name (account), reason); delayed = FALSE; } if (!delayed) { /* end of the chain */ if (success) { _mcd_account_connect (account, ctx->params); } else { _mcd_account_set_connection_status (account, TP_CONNECTION_STATUS_DISCONNECTED, reason, NULL, TP_ERROR_STR_DISCONNECTED, NULL); } _mcd_account_set_connection_context (account, NULL); } } void mcd_account_connection_proceed (McdAccount *account, gboolean success) { mcd_account_connection_proceed_with_reason (account, success, TP_CONNECTION_STATUS_REASON_NONE_SPECIFIED); } telepathy-mission-control-5.16.4/src/mcd-account-config.h0000644000175000017500000000622512735242352024427 0ustar00gkiagiagkiagia00000000000000/* vi: set et sw=4 ts=8 cino=t0,(0: */ /* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4; tab-width: 8 -*- */ /* * This file is part of mission-control * * Copyright (C) 2007-2009 Nokia Corporation. * Copyright (C) 2009 Collabora Ltd. * * Contact: Naba Kumar * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * version 2.1 as published by the Free Software Foundation. * * This library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA * */ #ifndef __MCD_ACCOUNT_CONFIG_H__ #define __MCD_ACCOUNT_CONFIG_H__ #include /* If you add new storable attributes you must also update * known_attributes in mcd-storage.c. */ /* string, 's' */ #define MC_ACCOUNTS_KEY_MANAGER "manager" #define MC_ACCOUNTS_KEY_PROTOCOL "protocol" #define MC_ACCOUNTS_KEY_DISPLAY_NAME "DisplayName" #define MC_ACCOUNTS_KEY_NORMALIZED_NAME "NormalizedName" #define MC_ACCOUNTS_KEY_AVATAR_TOKEN "avatar_token" #define MC_ACCOUNTS_KEY_AVATAR_MIME "AvatarMime" #define MC_ACCOUNTS_KEY_AUTOMATIC_PRESENCE "AutomaticPresence" /* next two are obsoleted by MC_ACCOUNTS_KEY_AUTOMATIC_PRESENCE */ #define MC_ACCOUNTS_KEY_AUTO_PRESENCE_STATUS "AutomaticPresenceStatus" #define MC_ACCOUNTS_KEY_AUTO_PRESENCE_MESSAGE "AutomaticPresenceMessage" #define MC_ACCOUNTS_KEY_ICON "Icon" #define MC_ACCOUNTS_KEY_NICKNAME "Nickname" #define MC_ACCOUNTS_KEY_SERVICE "Service" /* ... also "condition-*" reserved by mcd-account-conditions.c */ /* unsigned 32-bit integer, 'u' */ /* obsoleted by MC_ACCOUNTS_KEY_AUTOMATIC_PRESENCE */ #define MC_ACCOUNTS_KEY_AUTO_PRESENCE_TYPE "AutomaticPresenceType" /* boolean, 'b' */ #define MC_ACCOUNTS_KEY_ALWAYS_DISPATCH "always_dispatch" #define MC_ACCOUNTS_KEY_CONNECT_AUTOMATICALLY "ConnectAutomatically" #define MC_ACCOUNTS_KEY_ENABLED "Enabled" #define MC_ACCOUNTS_KEY_HAS_BEEN_ONLINE "HasBeenOnline" #define MC_ACCOUNTS_KEY_HIDDEN "Hidden" /* string array, 'as' */ #define MC_ACCOUNTS_KEY_URI_SCHEMES \ TP_IFACE_ACCOUNT_INTERFACE_ADDRESSING ".URISchemes" /* object path array, 'ao' */ #define MC_ACCOUNTS_KEY_SUPERSEDES "Supersedes" /* things that previously existed, so they should now be considered * to be reserved */ #define PRESETS_GROUP "Presets" #define PRESETS_GROUP_DEFAULTS "Defaults" #define MC_OLD_ACCOUNTS_KEY_AVATAR_ID "avatar_id" #define MC_OLD_ACCOUNTS_KEY_DATA_DIR "data_dir" #define MC_OLD_ACCOUNTS_KEY_DELETED "deleted" #define MC_OLD_ACCOUNTS_KEY_GROUPS "groups" #define MC_OLD_ACCOUNTS_KEY_ICON_NAME "icon_name" #define MC_OLD_ACCOUNTS_KEY_PRESETS "presets" #define MC_OLD_ACCOUNTS_KEY_PROFILE "profile" #define MC_OLD_ACCOUNTS_KEY_SECONDARY_VCARD_FIELDS "secondary_vcard_fields" #endif /* __MCD_ACCOUNT_CONFIG_H__ */ telepathy-mission-control-5.16.4/src/plugin-dispatch-operation.h0000644000175000017500000000530712735241312026053 0ustar00gkiagiagkiagia00000000000000/* Representation of a dispatch operation as presented to plugins. This is * deliberately a "smaller" API than McdDispatchOperation. * * Copyright (C) 2009 Nokia Corporation * Copyright (C) 2009 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA * */ #ifndef MCD_PLUGIN_DISPATCH_OPERATION_H #define MCD_PLUGIN_DISPATCH_OPERATION_H #include #include "mcd-dispatch-operation-priv.h" G_BEGIN_DECLS typedef struct _McdPluginDispatchOperation McdPluginDispatchOperation; typedef struct _McdPluginDispatchOperationClass McdPluginDispatchOperationClass; typedef struct _McdPluginDispatchOperationPrivate McdPluginDispatchOperationPrivate; G_GNUC_INTERNAL GType _mcd_plugin_dispatch_operation_get_type (void); #define MCD_TYPE_PLUGIN_DISPATCH_OPERATION \ (_mcd_plugin_dispatch_operation_get_type ()) #define MCD_PLUGIN_DISPATCH_OPERATION(obj) \ (G_TYPE_CHECK_INSTANCE_CAST ((obj), MCD_TYPE_PLUGIN_DISPATCH_OPERATION, \ McdPluginDispatchOperation)) #define MCD_PLUGIN_DISPATCH_OPERATION_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST ((klass), MCD_TYPE_PLUGIN_DISPATCH_OPERATION, \ McdPluginDispatchOperationClass)) #define MCD_IS_PLUGIN_DISPATCH_OPERATION(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MCD_TYPE_PLUGIN_DISPATCH_OPERATION)) #define MCD_IS_PLUGIN_DISPATCH_OPERATION_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE ((klass), MCD_TYPE_PLUGIN_DISPATCH_OPERATION)) #define MCD_PLUGIN_DISPATCH_OPERATION_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), MCD_TYPE_PLUGIN_DISPATCH_OPERATION, \ McdPluginDispatchOperationClass)) G_GNUC_INTERNAL McdPluginDispatchOperation *_mcd_plugin_dispatch_operation_new ( McdDispatchOperation *real_cdo); G_GNUC_INTERNAL void _mcd_plugin_dispatch_operation_observers_finished ( McdPluginDispatchOperation *self); G_GNUC_INTERNAL gboolean _mcd_plugin_dispatch_operation_will_terminate ( McdPluginDispatchOperation *self); G_END_DECLS #endif telepathy-mission-control-5.16.4/src/mcd-account-manager-sso.c0000644000175000017500000014504412735242352025374 0ustar00gkiagiagkiagia00000000000000/* * A pseudo-plugin that stores/fetches accounts in/from the SSO via libaccounts * * Copyright © 2010-2011 Nokia Corporation * Copyright © 2010-2011 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "config.h" #include "mcd-account-manager-sso.h" #include "mcd-debug.h" #include #include #include #include #include #define PLUGIN_PRIORITY (MCP_ACCOUNT_STORAGE_PLUGIN_PRIO_KEYRING + 10) #define PLUGIN_NAME "maemo-libaccounts" #define PLUGIN_DESCRIPTION \ "Account storage in the Maemo SSO store via libaccounts-glib API" #define PLUGIN_PROVIDER "org.maemo.Telepathy.Account.Storage.LibAccounts" #define MCPP "param-" #define AGPP "parameters/" #define LIBACCT_ID_KEY "libacct-uid" #define MC_ENABLED_KEY "Enabled" #define AG_ENABLED_KEY "enabled" #define AG_LABEL_KEY "name" #define MC_LABEL_KEY "DisplayName" #define AG_ACCOUNT_KEY "username" #define MC_ACCOUNT_KEY "account" #define PASSWORD_KEY "password" #define AG_ACCOUNT_ALT_KEY AGPP "account" #define MC_CMANAGER_KEY "manager" #define MC_PROTOCOL_KEY "protocol" #define MC_IDENTITY_KEY "tmc-uid" #define SERVICES_KEY "sso-services" #define MC_SERVICE_KEY "Service" #define AG_ACCOUNT_WRITE_INTERVAL 5 static const gchar *exported_settings[] = { "CredentialsId", NULL }; typedef enum { DELAYED_CREATE, DELAYED_DELETE, } DelayedSignal; typedef struct { gchar *mc_name; gchar *ag_name; gboolean global; /* global ag setting or service specific? */ gboolean readable; /* does the _standard_ read method copy this into MC? */ gboolean writable; /* does the _standard_ write method copy this into AG? */ gboolean freeable; /* should clear_setting_data deallocate the names? */ } Setting; #define GLOBAL TRUE #define SERVICE FALSE #define READABLE TRUE #define UNREADABLE FALSE #define WRITABLE TRUE #define UNWRITABLE FALSE typedef enum { SETTING_MC, SETTING_AG, } SettingType; /* IMPORTANT IMPLEMENTATION NOTE: * * The mapping between telepathy settings and parameter names * and ag account (libaccounts) settings, and whether those settings * are stored in the global or service specific ag section is a * finicky beast - the mapping below has been arrived at empirically * Take care when altering it. * * Settings not mentioned explicitly are: * • given the same name on both MC and AG sides * • assigned to the service specific section * • automatically prefixed (param- vs parameters/) for each side if necessary * * So if your setting fits these criteria, you do not need to add it at all. */ Setting setting_map[] = { { MC_ENABLED_KEY , AG_ENABLED_KEY , GLOBAL , UNREADABLE, UNWRITABLE }, { MCPP MC_ACCOUNT_KEY, AG_ACCOUNT_KEY , GLOBAL , READABLE , UNWRITABLE }, { MCPP PASSWORD_KEY , PASSWORD_KEY , GLOBAL , READABLE , WRITABLE }, { MC_LABEL_KEY , AG_LABEL_KEY , GLOBAL , READABLE , WRITABLE }, { LIBACCT_ID_KEY , LIBACCT_ID_KEY , GLOBAL , UNREADABLE, UNWRITABLE }, { MC_IDENTITY_KEY , MC_IDENTITY_KEY, SERVICE, READABLE , WRITABLE }, { MC_CMANAGER_KEY , MC_CMANAGER_KEY, SERVICE, READABLE , UNWRITABLE }, { MC_PROTOCOL_KEY , MC_PROTOCOL_KEY, SERVICE, READABLE , UNWRITABLE }, { MC_SERVICE_KEY , MC_SERVICE_KEY , SERVICE, UNREADABLE, UNWRITABLE }, { SERVICES_KEY , SERVICES_KEY , GLOBAL , UNREADABLE, UNWRITABLE }, { NULL } }; typedef struct { DelayedSignal signal; AgAccountId account_id; } DelayedSignalData; typedef struct { McdAccountManagerSso *sso; struct { AgAccountWatch service; AgAccountWatch global; } watch; } WatchData; static Setting * setting_data (const gchar *name, SettingType type) { guint i = 0; static Setting parameter = { NULL, NULL, SERVICE, READABLE, WRITABLE, TRUE }; const gchar *prefix; for (; setting_map[i].mc_name != NULL; i++) { const gchar *setting_name = NULL; if (type == SETTING_MC) setting_name = setting_map[i].mc_name; else setting_name = setting_map[i].ag_name; if (g_strcmp0 (name, setting_name) == 0) return &setting_map[i]; } prefix = (type == SETTING_MC) ? MCPP : AGPP; if (!g_str_has_prefix (name, prefix)) { /* a non-parameter setting */ parameter.mc_name = g_strdup (name); parameter.ag_name = g_strdup (name); } else { /* a setting that is a parameter on both sides (AG & MC) */ const guint plength = strlen (prefix); parameter.mc_name = g_strdup_printf ("%s%s", MCPP, name + plength); parameter.ag_name = g_strdup_printf ("%s%s", AGPP, name + plength); } return ¶meter; } static void clear_setting_data (Setting *setting) { if (setting == NULL) return; if (!setting->freeable) return; g_free (setting->mc_name); g_free (setting->ag_name); setting->mc_name = NULL; setting->ag_name = NULL; } static gboolean _sso_account_enabled ( McdAccountManagerSso *self, AgAccount *account, AgService *service); static void account_storage_iface_init (McpAccountStorageIface *, gpointer); static gchar * _ag_accountid_to_mc_key (McdAccountManagerSso *sso, AgAccountId id, gboolean create); static void _ag_account_stored_cb (AgAccount *acct, const GError *err, gpointer ignore); static void _sso_created (GObject *object, AgAccountId id, gpointer user_data); static void _sso_toggled (GObject *object, AgAccountId id, gpointer data); static gboolean save_setting ( McdAccountManagerSso *self, AgAccount *account, const Setting *setting, const gchar *val); G_DEFINE_TYPE_WITH_CODE (McdAccountManagerSso, mcd_account_manager_sso, G_TYPE_OBJECT, G_IMPLEMENT_INTERFACE (MCP_TYPE_ACCOUNT_STORAGE, account_storage_iface_init)); static gchar * _gvalue_to_string (const GValue *val) { switch (G_VALUE_TYPE (val)) { case G_TYPE_STRING: return g_value_dup_string (val); case G_TYPE_BOOLEAN: return g_strdup (g_value_get_boolean (val) ? "true" : "false"); case G_TYPE_CHAR: return g_strdup_printf ("%c", g_value_get_uchar (val)); case G_TYPE_UCHAR: return g_strdup_printf ("%c", g_value_get_char (val)); case G_TYPE_INT: return g_strdup_printf ("%i", g_value_get_int (val)); case G_TYPE_UINT: return g_strdup_printf ("%u", g_value_get_uint (val)); case G_TYPE_LONG: return g_strdup_printf ("%ld", g_value_get_long (val)); case G_TYPE_ULONG: return g_strdup_printf ("%lu", g_value_get_ulong (val)); case G_TYPE_INT64: return g_strdup_printf ("%" G_GINT64_FORMAT, g_value_get_int64 (val)); case G_TYPE_UINT64: return g_strdup_printf ("%" G_GUINT64_FORMAT, g_value_get_uint64 (val)); case G_TYPE_ENUM: return g_strdup_printf ("%d" , g_value_get_enum (val)); case G_TYPE_FLAGS: return g_strdup_printf ("%u", g_value_get_flags (val)); case G_TYPE_FLOAT: return g_strdup_printf ("%f", g_value_get_float (val)); case G_TYPE_DOUBLE: return g_strdup_printf ("%g", g_value_get_double (val)); default: DEBUG ("Unsupported type %s", G_VALUE_TYPE_NAME (val)); return NULL; } } static const gchar * account_manager_sso_get_service_type (McdAccountManagerSso *self) { McdAccountManagerSsoClass *klass = MCD_ACCOUNT_MANAGER_SSO_GET_CLASS (self); g_assert (klass->service_type != NULL); return klass->service_type; } static gboolean _ag_account_select_default_im_service ( McdAccountManagerSso *self, AgAccount *account) { const gchar *service_type = account_manager_sso_get_service_type (self); gboolean have_service = FALSE; GList *first = ag_account_list_services_by_type (account, service_type); if (first != NULL && first->data != NULL) { have_service = TRUE; DEBUG ("default %s service %s", service_type, ag_service_get_name (first->data)); ag_account_select_service (account, first->data); } ag_service_list_free (first); return have_service; } static AgSettingSource _ag_account_global_value (AgAccount *account, const gchar *key, GValue *value) { AgSettingSource src = AG_SETTING_SOURCE_NONE; AgService *service = ag_account_get_selected_service (account); if (service != NULL) { ag_account_select_service (account, NULL); src = ag_account_get_value (account, key, value); ag_account_select_service (account, service); } else { src = ag_account_get_value (account, key, value); } return src; } static AgSettingSource _ag_account_local_value ( McdAccountManagerSso *self, AgAccount *account, const gchar *key, GValue *value) { AgSettingSource src = AG_SETTING_SOURCE_NONE; AgService *service = ag_account_get_selected_service (account); if (service != NULL) { src = ag_account_get_value (account, key, value); } else { _ag_account_select_default_im_service (self, account); src = ag_account_get_value (account, key, value); ag_account_select_service (account, NULL); } return src; } /* AG_ACCOUNT_ALT_KEY from service overrides global AG_ACCOUNT_KEY if set */ static void _maybe_set_account_param_from_service ( McdAccountManagerSso *self, const McpAccountManager *am, AgAccount *ag_account, const gchar *mc_account) { Setting *setting = setting_data (AG_ACCOUNT_KEY, SETTING_AG); AgSettingSource source = AG_SETTING_SOURCE_NONE; GValue ag_value = G_VALUE_INIT; g_return_if_fail (setting != NULL); g_return_if_fail (ag_account != NULL); g_value_init (&ag_value, G_TYPE_STRING); source = _ag_account_local_value (self, ag_account, AG_ACCOUNT_ALT_KEY, &ag_value); if (source != AG_SETTING_SOURCE_NONE) { gchar *value = _gvalue_to_string (&ag_value); DEBUG ("overriding global %s param with %s: %s", AG_ACCOUNT_KEY, AG_ACCOUNT_ALT_KEY, value); mcp_account_manager_set_value (am, mc_account, setting->mc_name, value); g_free (value); } g_value_unset (&ag_value); clear_setting_data (setting); } static WatchData * make_watch_data (McdAccountManagerSso *sso) { WatchData *data = g_slice_new0 (WatchData); data->sso = g_object_ref (sso); return data; } static void free_watch_data (gpointer data) { WatchData *wd = data; if (wd == NULL) return; tp_clear_object (&wd->sso); g_slice_free (WatchData, wd); } static void unwatch_account_keys (McdAccountManagerSso *sso, AgAccountId id) { gpointer watch_key = GUINT_TO_POINTER (id); WatchData *wd = g_hash_table_lookup (sso->watches, watch_key); AgAccount *account = ag_manager_get_account (sso->ag_manager, id); if (wd != NULL && account != NULL) { ag_account_remove_watch (account, wd->watch.global); ag_account_remove_watch (account, wd->watch.service); } g_hash_table_remove (sso->watches, watch_key); } /* There are two types of ag watch: ag_account_watch_key and * * ag_account_watch_dir. _key passees us the watched key when invoking this * * callback, dir watches only a prefix, and passes the watched prefix * * (not the actual updated setting) - we now watch with _dir since _key * * doesn't allow us to watch for keys-that-are-not-set at creation time * * (since those cannot be known in advance): This means that in this * * callback we must compare what we have in MC with what's in AG and issue * * update notices accordingly (and remember to handle deleted keys). * * It also means the const gchar *what-was-updated parameter is not useful */ static void _sso_updated (AgAccount *account, const gchar *unused, gpointer data) { WatchData *wd = data; McdAccountManagerSso *sso = wd->sso; McpAccountManager *am = sso->manager_interface; McpAccountStorage *mcpa = MCP_ACCOUNT_STORAGE (sso); gpointer id = GUINT_TO_POINTER (account->id); const gchar *name = g_hash_table_lookup (sso->id_name_map, id); AgService *service = ag_account_get_selected_service (account); GStrv keys = NULL; GHashTable *unseen = NULL; GHashTableIter deleted_iter = { 0 }; const gchar *deleted_key; guint i; gboolean params_updated = FALSE; const gchar *immutables[] = { MC_SERVICE_KEY, SERVICES_KEY, NULL }; /* account has no name yet: might be time to create it */ if (name == NULL) return _sso_created (G_OBJECT (sso->ag_manager), account->id, sso); DEBUG ("update for account %s", name); /* list the keys we know about so we can tell if one has been deleted */ keys = mcp_account_manager_list_keys (am, name); unseen = g_hash_table_new (g_str_hash, g_str_equal); for (i = 0; keys != NULL && keys[i] != NULL; i++) g_hash_table_insert (unseen, keys[i], GUINT_TO_POINTER (TRUE)); /* now iterate over ag settings, global then service specific: */ ag_account_select_service (account, NULL); for (i = 0; i < 2; i++) { AgAccountSettingIter iter = { 0 }; const gchar *ag_key = NULL; const GValue *ag_val = NULL; if (i == 1) _ag_account_select_default_im_service (sso, account); ag_account_settings_iter_init (account, &iter, NULL); while (ag_account_settings_iter_next (&iter, &ag_key, &ag_val)) { Setting *setting = setting_data (ag_key, SETTING_AG); const gchar *mc_key; gchar *ag_str; gchar *mc_str; if (setting == NULL) continue; mc_key = setting->mc_name; mc_str = mcp_account_manager_get_value (am, name, mc_key); ag_str = _gvalue_to_string (ag_val); g_hash_table_remove (unseen, mc_key); if (tp_strdiff (ag_str, mc_str)) { mcp_account_manager_set_value (am, name, mc_key, ag_str); if (sso->ready) { if (g_str_has_prefix (mc_key, MCPP)) params_updated = TRUE; else mcp_account_storage_emit_altered_one (mcpa, name, mc_key); } } g_free (mc_str); g_free (ag_str); clear_setting_data (setting); } } /* special case values always exist and therefore cannot be deleted */ for (i = 0; immutables[i] != NULL; i++) { Setting *immutable = setting_data (immutables[i], SETTING_AG); g_hash_table_remove (unseen, immutable->ag_name); clear_setting_data (immutable); } /* signal (and update) deleted settings: */ g_hash_table_iter_init (&deleted_iter, unseen); while (g_hash_table_iter_next (&deleted_iter, (gpointer *)&deleted_key, NULL)) { mcp_account_manager_set_value (am, name, deleted_key, NULL); if (g_str_has_prefix (deleted_key, MCPP)) params_updated = TRUE; else mcp_account_storage_emit_altered_one (mcpa, name, deleted_key); } g_hash_table_unref (unseen); g_strfreev (keys); if (params_updated) mcp_account_storage_emit_altered_one (mcpa, name, "Parameters"); /* put the selected service back the way it was when we found it */ ag_account_select_service (account, service); } static void watch_for_updates (McdAccountManagerSso *sso, AgAccount *account) { WatchData *data; gpointer id = GUINT_TO_POINTER (account->id); AgService *service; /* already watching account? let's be idempotent */ if (g_hash_table_lookup (sso->watches, id) != NULL) return; DEBUG ("watching AG ID %u for updates", account->id); service = ag_account_get_selected_service (account); data = make_watch_data (sso); ag_account_select_service (account, NULL); data->watch.global = ag_account_watch_dir (account, "", _sso_updated, data); _ag_account_select_default_im_service (sso, account); data->watch.service = ag_account_watch_dir (account, "", _sso_updated, data); g_hash_table_insert (sso->watches, id, data); ag_account_select_service (account, service); } static void _sso_toggled (GObject *object, AgAccountId id, gpointer data) { AgManager *manager = AG_MANAGER (object); McdAccountManagerSso *sso = MCD_ACCOUNT_MANAGER_SSO (data); McpAccountStorage *mcpa = MCP_ACCOUNT_STORAGE (sso); AgAccount *account = NULL; gboolean on = FALSE; const gchar *name = NULL; /* If the account manager isn't ready, account state changes are of no * * interest to us: it will pick up the then-current state of the account * * when it does become ready, and anything that happens between now and * * then is not important: */ if (!sso->ready) return; account = ag_manager_get_account (manager, id); if (account != NULL) { on = _sso_account_enabled (sso, account, NULL); name = g_hash_table_lookup (sso->id_name_map, GUINT_TO_POINTER (id)); } if (name != NULL) { const gchar *value = on ? "true" : "false"; McpAccountManager *am = sso->manager_interface; mcp_account_manager_set_value (am, name, "Enabled", value); mcp_account_storage_emit_toggled (mcpa, name, on); } else { DEBUG ("received enabled=%u signal for unknown SSO account %u", on, id); } } static void _sso_deleted (GObject *object, AgAccountId id, gpointer user_data) { McdAccountManagerSso *sso = MCD_ACCOUNT_MANAGER_SSO (user_data); if (sso->ready) { const gchar *name = g_hash_table_lookup (sso->id_name_map, GUINT_TO_POINTER (id)); /* if the account was in our cache, then this was a 3rd party delete * * op that someone did behind our back: fire the signal and clean up */ if (name != NULL) { McpAccountStorage *mcpa = MCP_ACCOUNT_STORAGE (sso); gchar *signalled_name = g_strdup (name); /* forget id->name map first, so the signal can't start a loop */ g_hash_table_remove (sso->id_name_map, GUINT_TO_POINTER (id)); g_hash_table_remove (sso->accounts, signalled_name); /* stop watching for updates */ unwatch_account_keys (sso, id); mcp_account_storage_emit_deleted (mcpa, signalled_name); g_free (signalled_name); } } else { DelayedSignalData *sig_data = g_slice_new0 (DelayedSignalData); sig_data->signal = DELAYED_DELETE; sig_data->account_id = id; g_queue_push_tail (sso->pending_signals, sig_data); } } /* return TRUE if we actually changed any state, FALSE otherwise */ static gboolean _sso_account_enable ( McdAccountManagerSso *self, AgAccount *account, AgService *service, gboolean on) { AgService *original = ag_account_get_selected_service (account); /* the setting account is already in one of the global+service configurations that corresponds to our current state: don't touch it */ if (_sso_account_enabled (self, account, service) == on) return FALSE; /* turn the local enabled flag on/off as required */ if (service != NULL) ag_account_select_service (account, service); else _ag_account_select_default_im_service (self, account); ag_account_set_enabled (account, on); /* if we are turning the account on, the global flag must also be set * * NOTE: this isn't needed when turning the account off */ if (on) { ag_account_select_service (account, NULL); ag_account_set_enabled (account, on); } ag_account_select_service (account, original); return TRUE; } static gboolean _sso_account_enabled ( McdAccountManagerSso *self, AgAccount *account, AgService *service) { gboolean local = FALSE; gboolean global = FALSE; AgService *original = ag_account_get_selected_service (account); if (service == NULL) { _ag_account_select_default_im_service (self, account); local = ag_account_get_enabled (account); } else { if (original != service) ag_account_select_service (account, service); local = ag_account_get_enabled (account); } ag_account_select_service (account, NULL); global = ag_account_get_enabled (account); ag_account_select_service (account, original); DEBUG ("_sso_account_enabled: global:%d && local:%d", global, local); return local && global; } static void _sso_created (GObject *object, AgAccountId id, gpointer user_data) { AgManager *ag_manager = AG_MANAGER (object); McdAccountManagerSso *sso = MCD_ACCOUNT_MANAGER_SSO (user_data); gchar *name = g_hash_table_lookup (sso->id_name_map, GUINT_TO_POINTER (id)); if (sso->ready) { /* if we already know the account's name, we shouldn't fire the new * * account signal as it is one we (and our superiors) already have * * This could happen as a result of multiple updates being set off * * before we are ready, for example */ if (name == NULL) { McpAccountStorage *mcpa = MCP_ACCOUNT_STORAGE (sso); AgAccount *account = ag_manager_get_account (ag_manager, id); if (account != NULL) { /* this will be owned by the ag account hash, do not free it */ name = _ag_accountid_to_mc_key (sso, id, TRUE); if (name != NULL) { Setting *setting = setting_data (MC_IDENTITY_KEY, SETTING_MC); g_hash_table_insert (sso->accounts, name, account); g_hash_table_insert (sso->id_name_map, GUINT_TO_POINTER (id), g_strdup (name)); save_setting (sso, account, setting, name); ag_account_store (account, _ag_account_stored_cb, sso); mcp_account_storage_emit_created (mcpa, name); clear_setting_data (setting); } else { /* not enough data to name the account: wait for an update */ DEBUG ("SSO account #%u is currently unnameable", id); } /* in either case, add the account to the watched list */ watch_for_updates (sso, account); } } } else { DelayedSignalData *sig_data = g_slice_new0 (DelayedSignalData); sig_data->signal = DELAYED_CREATE; sig_data->account_id = id; g_queue_push_tail (sso->pending_signals, sig_data); } } static void mcd_account_manager_sso_init (McdAccountManagerSso *self) { self->accounts = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_object_unref); self->id_name_map = g_hash_table_new_full (g_direct_hash, g_direct_equal, NULL, g_free); self->watches = g_hash_table_new_full (g_direct_hash, g_direct_equal, NULL, (GDestroyNotify) free_watch_data); self->pending_signals = g_queue_new (); } static void mcd_account_manager_sso_constructed (GObject *object) { McdAccountManagerSso *self = MCD_ACCOUNT_MANAGER_SSO (object); GObjectClass *parent_class = G_OBJECT_CLASS (mcd_account_manager_sso_parent_class); const gchar *service_type = account_manager_sso_get_service_type (self); if (parent_class->constructed != NULL) parent_class->constructed (object); DEBUG ("Watching for services of type '%s'", service_type); self->ag_manager = ag_manager_new_for_service_type (service_type); g_signal_connect(self->ag_manager, "enabled-event", G_CALLBACK (_sso_toggled), self); g_signal_connect(self->ag_manager, "account-deleted", G_CALLBACK (_sso_deleted), self); g_signal_connect(self->ag_manager, "account-created", G_CALLBACK (_sso_created), self); } static void mcd_account_manager_sso_class_init (McdAccountManagerSsoClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); object_class->constructed = mcd_account_manager_sso_constructed; klass->service_type = "IM"; } static void _ag_account_stored_cb ( AgAccount *account, const GError *err, gpointer user_data) { McdAccountManagerSso *self = MCD_ACCOUNT_MANAGER_SSO (user_data); GValue uid = G_VALUE_INIT; const gchar *name = NULL; AgSettingSource src = AG_SETTING_SOURCE_NONE; g_value_init (&uid, G_TYPE_STRING); src = _ag_account_local_value (self, account, MC_IDENTITY_KEY, &uid); if (src != AG_SETTING_SOURCE_NONE && G_VALUE_HOLDS_STRING (&uid)) { name = g_value_get_string (&uid); DEBUG ("%p:%s stored: %s", account, name, err ? err->message : "-"); g_value_unset (&uid); } else { DEBUG ("%p:%s not stored? %s", acct, ag_account_get_display_name (account), err ? err->message : "-"); } } static gchar * _ag_accountid_to_mc_key (McdAccountManagerSso *sso, AgAccountId id, gboolean create) { AgAccount *account = ag_manager_get_account (sso->ag_manager, id); AgSettingSource src = AG_SETTING_SOURCE_NONE; AgService *service = NULL; GValue value = G_VALUE_INIT; if (account == NULL) { DEBUG ("AG Account ID %u invalid", id); return NULL; } service = ag_account_get_selected_service (account); DEBUG ("AG Account ID: %u", id); g_value_init (&value, G_TYPE_STRING); /* first look for the stored TMC uid */ src = _ag_account_local_value (sso, account, MC_IDENTITY_KEY, &value); /* if we found something, our work here is done: */ if (src != AG_SETTING_SOURCE_NONE) { gchar *uid = g_value_dup_string (&value); g_value_unset (&value); return uid; } if (!create) { g_value_unset (&value); return NULL; } DEBUG ("no " MC_IDENTITY_KEY " found, synthesising one:"); src = _ag_account_global_value (account, AG_ACCOUNT_KEY, &value); /* fall back to the alernative account-naming setting if necessary: */ if (src == AG_SETTING_SOURCE_NONE) { _ag_account_select_default_im_service (sso, account); src = _ag_account_local_value (sso, account, AG_ACCOUNT_ALT_KEY, &value); } if (src != AG_SETTING_SOURCE_NONE && G_VALUE_HOLDS_STRING (&value)) { AgAccountSettingIter iter; const gchar *k; const GValue *v; GValue cmanager = G_VALUE_INIT; GValue protocol = G_VALUE_INIT; const gchar *cman, *proto; McpAccountManager *am = sso->manager_interface; GHashTable *params = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL); gchar *name = NULL; g_value_init (&cmanager, G_TYPE_STRING); g_value_init (&protocol, G_TYPE_STRING); /* if we weren't on a service when got here, pick the most likely one: */ if (service == NULL) _ag_account_select_default_im_service (sso, account); ag_account_get_value (account, MC_CMANAGER_KEY, &cmanager); cman = g_value_get_string (&cmanager); if (cman == NULL) goto cleanup; ag_account_get_value (account, MC_PROTOCOL_KEY, &protocol); proto = g_value_get_string (&protocol); if (proto == NULL) goto cleanup; /* prepare the hash of MC param keys -> GValue */ /* NOTE: some AG bare settings map to MC parameters, * * so we must iterate over all AG settings, parameters * * and bare settings included */ /* first any matching global values: */ ag_account_select_service (account, NULL); ag_account_settings_iter_init (account, &iter, NULL); while (ag_account_settings_iter_next (&iter, &k, &v)) { Setting *setting = setting_data (k, SETTING_AG); if (setting != NULL && g_str_has_prefix (setting->mc_name, MCPP)) { gchar *param_key = g_strdup (setting->mc_name + strlen (MCPP)); g_hash_table_insert (params, param_key, (gpointer) v); } clear_setting_data (setting); } /* then any service specific settings */ if (service != NULL) ag_account_select_service (account, service); else _ag_account_select_default_im_service (sso, account); ag_account_settings_iter_init (account, &iter, NULL); while (ag_account_settings_iter_next (&iter, &k, &v)) { Setting *setting = setting_data (k, SETTING_AG); if (setting != NULL && g_str_has_prefix (setting->mc_name, MCPP)) { gchar *param_key = g_strdup (setting->mc_name + strlen (MCPP)); g_hash_table_insert (params, param_key, (gpointer) v); } clear_setting_data (setting); } /* we want this to override any other settings for uid generation */ g_hash_table_insert (params, g_strdup (MC_ACCOUNT_KEY), &value); name = mcp_account_manager_get_unique_name (am, cman, proto, params); cleanup: ag_account_select_service (account, service); g_hash_table_unref (params); g_value_unset (&value); g_value_unset (&cmanager); g_value_unset (&protocol); DEBUG (MC_IDENTITY_KEY " value %p:%s synthesised", name, name); return name; } else { g_value_unset (&value); } DEBUG (MC_IDENTITY_KEY " not synthesised, returning NULL"); return NULL; } static AgAccount * get_ag_account (const McdAccountManagerSso *sso, const McpAccountManager *am, const gchar *name, AgAccountId *id) { AgAccount *account; g_return_val_if_fail (id != NULL, NULL); /* we have a cached account, just return that */ account = g_hash_table_lookup (sso->accounts, name); if (account != NULL) { *id = account->id; return account; } *id = 0; return NULL; } /* returns true if it actually changed an account's state */ static gboolean save_setting ( McdAccountManagerSso *self, AgAccount *account, const Setting *setting, const gchar *val) { gboolean changed = FALSE; AgService *service = ag_account_get_selected_service (account); if (!setting->writable) return FALSE; if (setting->global) ag_account_select_service (account, NULL); else if (service == NULL) _ag_account_select_default_im_service (self, account); if (setting->readable) { GValue old = G_VALUE_INIT; AgSettingSource src = AG_SETTING_SOURCE_NONE; g_value_init (&old, G_TYPE_STRING); if (setting->global) src = _ag_account_global_value (account, setting->ag_name, &old); else src = _ag_account_local_value (self, account, setting->ag_name, &old); /* unsetting an already unset value, bail out */ if (val == NULL && src == AG_SETTING_SOURCE_NONE) goto done; /* assigning a value to one which _is_ set: check it actually changed */ if (val != NULL && src != AG_SETTING_SOURCE_NONE) { gchar *str = _gvalue_to_string (&old); gboolean noop = g_strcmp0 (str, val) == 0; g_value_unset (&old); g_free (str); if (noop) goto done; } } /* if we got this far, we're changing the stored state: */ changed = TRUE; if (val != NULL) { GValue value = G_VALUE_INIT; g_value_init (&value, G_TYPE_STRING); g_value_set_string (&value, val); ag_account_set_value (account, setting->ag_name, &value); g_value_unset (&value); } else { ag_account_set_value (account, setting->ag_name, NULL); } /* leave the selected service as we found it: */ done: ag_account_select_service (account, service); return changed; } static gboolean _set (const McpAccountStorage *self, const McpAccountManager *am, const gchar *account_suffix, const gchar *key, const gchar *val) { AgAccountId id; McdAccountManagerSso *sso = MCD_ACCOUNT_MANAGER_SSO (self); AgAccount *account = get_ag_account (sso, am, account_suffix, &id); Setting *setting = NULL; gboolean updated = FALSE; /* can't store a setting with no name */ g_return_val_if_fail (key != NULL, FALSE); /* we no longer create accounts in libaccount: either an account exists * * in libaccount as a result of some 3rd party intervention, or it is * * not an account that this plugin should ever concern itself with */ if (account != NULL) setting = setting_data (key, SETTING_MC); else return FALSE; if (setting != NULL) { /* Enabled is both a global and a local value, for extra fun: */ if (g_str_equal (setting->mc_name, MC_ENABLED_KEY)) { gboolean on = g_str_equal (val, "true"); DEBUG ("setting enabled flag: '%d'", on); updated = _sso_account_enable (sso, account, NULL, on); } else { updated = save_setting (sso, account, setting, val); } if (updated) sso->save = TRUE; clear_setting_data (setting); } /* whether or not we stored this value, if we got this far it's our * * setting and no-one else is allowed to claim it: so return TRUE */ return TRUE; } /* Implements the half of the _get method where key is not NULL. */ static void account_manager_sso_get_one ( McdAccountManagerSso *sso, const McpAccountManager *am, const gchar *account_suffix, const gchar *key, AgAccount *account, AgService *service) { if (g_str_equal (key, MC_ENABLED_KEY)) { const gchar *v = NULL; v = _sso_account_enabled (sso, account, service) ? "true" : "false"; mcp_account_manager_set_value (am, account_suffix, key, v); } else if (g_str_equal (key, SERVICES_KEY)) { GString *result = g_string_new (""); AgManager * agm = ag_account_get_manager (account); GList *services = ag_manager_list_services (agm); GList *item = NULL; for (item = services; item != NULL; item = g_list_next (item)) { const gchar *name = ag_service_get_name (item->data); g_string_append_printf (result, "%s;", name); } mcp_account_manager_set_value (am, account_suffix, key, result->str); ag_service_list_free (services); g_string_free (result, TRUE); } else if (g_str_equal (key, MC_SERVICE_KEY)) { const gchar *service_name = NULL; AgService *im_service = NULL; _ag_account_select_default_im_service (sso, account); im_service = ag_account_get_selected_service (account); service_name = ag_service_get_name (im_service); mcp_account_manager_set_value (am, account_suffix, key, service_name); } else { GValue v = G_VALUE_INIT; AgSettingSource src = AG_SETTING_SOURCE_NONE; Setting *setting = setting_data (key, SETTING_MC); if (setting == NULL) return; g_value_init (&v, G_TYPE_STRING); if (setting->global) src = _ag_account_global_value (account, setting->ag_name, &v); else src = _ag_account_local_value (sso, account, setting->ag_name, &v); if (src != AG_SETTING_SOURCE_NONE) { gchar *val = _gvalue_to_string (&v); mcp_account_manager_set_value (am, account_suffix, key, val); g_free (val); } if (g_str_equal (key, MCPP MC_ACCOUNT_KEY)) _maybe_set_account_param_from_service (sso, am, account, account_suffix); g_value_unset (&v); clear_setting_data (setting); } } /* Implements the half of the _get method where key == NULL, which is an * instruction from MC that we should look up all of this account's properties * and stash them with mcp_account_manager_set_value(). */ static void account_manager_sso_get_all ( McdAccountManagerSso *sso, const McpAccountManager *am, const gchar *account_suffix, AgAccount *account, AgService *service) { AgAccountSettingIter ag_setting; const gchar *k; const GValue *v; const gchar *on = NULL; AgService *im_service = NULL; /* pick the IM service if we haven't got one set */ if (service == NULL) _ag_account_select_default_im_service (sso, account); /* special case, not stored as a normal setting */ im_service = ag_account_get_selected_service (account); mcp_account_manager_set_value (am, account_suffix, MC_SERVICE_KEY, ag_service_get_name (im_service)); ag_account_settings_iter_init (account, &ag_setting, NULL); while (ag_account_settings_iter_next (&ag_setting, &k, &v)) { Setting *setting = setting_data (k, SETTING_AG); if (setting != NULL && setting->readable && !setting->global) { gchar *value = _gvalue_to_string (v); mcp_account_manager_set_value (am, account_suffix, setting->mc_name, value); g_free (value); } clear_setting_data (setting); } /* deselect any service we may have to get global settings */ ag_account_select_service (account, NULL); ag_account_settings_iter_init (account, &ag_setting, NULL); while (ag_account_settings_iter_next (&ag_setting, &k, &v)) { Setting *setting = setting_data (k, SETTING_AG); if (setting != NULL && setting->readable && setting->global) { gchar *value = _gvalue_to_string (v); mcp_account_manager_set_value (am, account_suffix, setting->mc_name, value); g_free (value); } clear_setting_data (setting); } /* special case, actually two separate but related flags in SSO */ on = _sso_account_enabled (sso, account, NULL) ? "true" : "false"; mcp_account_manager_set_value (am, account_suffix, MC_ENABLED_KEY, on); _maybe_set_account_param_from_service (sso, am, account, account_suffix); } gboolean _mcd_account_manager_sso_get ( const McpAccountStorage *self, const McpAccountManager *am, const gchar *account_suffix, const gchar *key) { AgAccountId id; McdAccountManagerSso *sso = MCD_ACCOUNT_MANAGER_SSO (self); AgAccount *account = get_ag_account (sso, am, account_suffix, &id); AgService *service = ag_account_get_selected_service (account); if (account == NULL) return FALSE; /* Delegate to one of the two relatively-orthogonal meanings of this * method... */ if (key != NULL) account_manager_sso_get_one (sso, am, account_suffix, key, account, service); else account_manager_sso_get_all (sso, am, account_suffix, account, service); /* leave the selected service as we found it */ ag_account_select_service (account, service); return TRUE; } static gboolean _delete (const McpAccountStorage *self, const McpAccountManager *am, const gchar *account_suffix, const gchar *key) { AgAccountId id; McdAccountManagerSso *sso = MCD_ACCOUNT_MANAGER_SSO (self); AgAccount *account = get_ag_account (sso, am, account_suffix, &id); gboolean updated = FALSE; /* have no values for this account, nothing to do here: */ if (account == NULL) return TRUE; if (key == NULL) { ag_account_delete (account); g_hash_table_remove (sso->accounts, account_suffix); g_hash_table_remove (sso->id_name_map, GUINT_TO_POINTER (id)); /* stop watching for updates */ unwatch_account_keys (sso, id); updated = TRUE; } else { Setting *setting = setting_data (key, SETTING_MC); if (setting != NULL) updated = save_setting (sso, account, setting, NULL); clear_setting_data (setting); } if (updated) sso->save = TRUE; return TRUE; } static gboolean _commit_real (gpointer user_data) { McpAccountStorage *self = MCP_ACCOUNT_STORAGE (user_data); McdAccountManagerSso *sso = MCD_ACCOUNT_MANAGER_SSO (self); GHashTableIter iter; gchar *key; AgAccount *account; g_hash_table_iter_init (&iter, sso->accounts); /* for each account, set its telepathy uid MC_IDENTITY_KEY in the * * AgAccount structure, and then flush any changes to said account * * to long term storage with ag_account_store() * * The actual changes are those pushed into the AgAccount in _set * * and _delete */ while (g_hash_table_iter_next (&iter, (gpointer) &key, (gpointer) &account)) { Setting *setting = setting_data (MC_IDENTITY_KEY, SETTING_MC); /* this value ties MC accounts to SSO accounts */ save_setting (sso, account, setting, key); ag_account_store (account, _ag_account_stored_cb, sso); } sso->commit_source = 0; /* any pending changes should now have been pushed, clear the save-me flag */ sso->save = FALSE; return FALSE; } static gboolean _commit (const McpAccountStorage *self, const McpAccountManager *am) { McdAccountManagerSso *sso = MCD_ACCOUNT_MANAGER_SSO (self); if (!sso->save) return TRUE; if (sso->commit_source == 0) { DEBUG ("Deferring commit for %d seconds", AG_ACCOUNT_WRITE_INTERVAL); sso->commit_source = g_timeout_add_seconds_full (G_PRIORITY_DEFAULT, AG_ACCOUNT_WRITE_INTERVAL, _commit_real, g_object_ref (sso), g_object_unref); } else { DEBUG ("Already deferred commit"); } return TRUE; } static void _load_from_libaccounts (McdAccountManagerSso *sso, const McpAccountManager *am) { GList *ag_ids = ag_manager_list_by_service_type (sso->ag_manager, account_manager_sso_get_service_type (sso)); GList *ag_id; for (ag_id = ag_ids; ag_id != NULL; ag_id = g_list_next (ag_id)) { const gchar *key; const GValue *val; AgAccountSettingIter iter; AgAccountId id = GPOINTER_TO_UINT (ag_id->data); AgAccount *account = ag_manager_get_account (sso->ag_manager, id); if (account != NULL) { AgService *service = ag_account_get_selected_service (account); gchar *name = _ag_accountid_to_mc_key (sso, id, FALSE); if (name != NULL) { AgService *im_service = NULL; gchar *ident = g_strdup_printf ("%u", id); GStrv mc_id = g_strsplit (name, "/", 3); gboolean enabled; /* cache the account object, and the ID->name maping: the * * latter is required because we might receive an async * * delete signal with the ID after libaccounts-glib has * * purged all its account data, so we couldn't rely on the * * MC_IDENTITY_KEY setting. */ g_hash_table_insert (sso->accounts, name, account); g_hash_table_insert (sso->id_name_map, GUINT_TO_POINTER (id), g_strdup (name)); if (service == NULL) _ag_account_select_default_im_service (sso, account); /* special case, not stored as a normal setting */ im_service = ag_account_get_selected_service (account); mcp_account_manager_set_value (am, name, MC_SERVICE_KEY, ag_service_get_name (im_service)); ag_account_settings_iter_init (account, &iter, NULL); while (ag_account_settings_iter_next (&iter, &key, &val)) { Setting *setting = setting_data (key, SETTING_AG); if (setting != NULL && !setting->global && setting->readable) { gchar *value = _gvalue_to_string (val); mcp_account_manager_set_value (am, name, setting->mc_name, value); g_free (value); } clear_setting_data (setting); } ag_account_select_service (account, NULL); ag_account_settings_iter_init (account, &iter, NULL); while (ag_account_settings_iter_next (&iter, &key, &val)) { Setting *setting = setting_data (key, SETTING_AG); if (setting != NULL && setting->global && setting->readable) { gchar *value = _gvalue_to_string (val); mcp_account_manager_set_value (am, name, setting->mc_name, value); g_free (value); } clear_setting_data (setting); } /* special case, actually two separate but related flags in SSO */ enabled = _sso_account_enabled (sso, account, NULL); mcp_account_manager_set_value (am, name, MC_ENABLED_KEY, enabled ? "true" : "false"); mcp_account_manager_set_value (am, name, LIBACCT_ID_KEY, ident); mcp_account_manager_set_value (am, name, MC_CMANAGER_KEY, mc_id[0]); mcp_account_manager_set_value (am, name, MC_PROTOCOL_KEY, mc_id[1]); mcp_account_manager_set_value (am, name, MC_IDENTITY_KEY, name); _maybe_set_account_param_from_service (sso, am, account, name); /* force the services value to be synthesised + cached */ _mcd_account_manager_sso_get (MCP_ACCOUNT_STORAGE (sso), am, name, SERVICES_KEY); ag_account_select_service (account, service); watch_for_updates (sso, account); g_strfreev (mc_id); g_free (ident); } } } sso->loaded = TRUE; ag_manager_list_free (ag_ids); } static GList * _list (const McpAccountStorage *self, const McpAccountManager *am) { GList *rval = NULL; McdAccountManagerSso *sso = MCD_ACCOUNT_MANAGER_SSO (self); GList *ag_ids = NULL; GList *ag_id; if (!sso->loaded) _load_from_libaccounts (sso, am); ag_ids = ag_manager_list_by_service_type (sso->ag_manager, account_manager_sso_get_service_type (sso)); for (ag_id = ag_ids; ag_id != NULL; ag_id = g_list_next (ag_id)) { AgAccountId id = GPOINTER_TO_UINT (ag_id->data); gchar *name = NULL; name = _ag_accountid_to_mc_key (sso, id, FALSE); if (name != NULL) { DEBUG ("account %s listed", name); rval = g_list_prepend (rval, name); } else { DelayedSignalData *data = g_slice_new0 (DelayedSignalData); DEBUG ("account %u delayed", id); data->signal = DELAYED_CREATE; data->account_id = id; g_queue_push_tail (sso->pending_signals, data); } } ag_manager_list_free (ag_ids); return rval; } static void _ready (const McpAccountStorage *self, const McpAccountManager *am) { McdAccountManagerSso *sso = MCD_ACCOUNT_MANAGER_SSO (self); if (sso->ready) return; g_assert (sso->manager_interface == NULL); sso->manager_interface = g_object_ref (G_OBJECT (am)); sso->ready = TRUE; while (g_queue_get_length (sso->pending_signals) > 0) { DelayedSignalData *data = g_queue_pop_head (sso->pending_signals); GObject *signal_source = G_OBJECT (sso->ag_manager); switch (data->signal) { case DELAYED_CREATE: _sso_created (signal_source, data->account_id, sso); break; case DELAYED_DELETE: _sso_deleted (signal_source, data->account_id, sso); break; default: g_assert_not_reached (); } g_slice_free (DelayedSignalData, data); } g_queue_free (sso->pending_signals); sso->pending_signals = NULL; } static gboolean _find_account (McdAccountManagerSso *sso, const gchar *account_name, AgAccountId *account_id) { GList *ag_ids = NULL; GList *ag_id; gboolean found = FALSE; g_return_val_if_fail (account_id != NULL, found); ag_ids = ag_manager_list_by_service_type (sso->ag_manager, account_manager_sso_get_service_type (sso)); for (ag_id = ag_ids; ag_id != NULL; ag_id = g_list_next (ag_id)) { AgAccountId id = GPOINTER_TO_UINT (ag_id->data); gchar *name = NULL; name = _ag_accountid_to_mc_key (sso, id, FALSE); if (g_strcmp0 (name, account_name) == 0) { found = TRUE; *account_id = id; } g_free (name); if (found) break; } ag_manager_list_free (ag_ids); return found; } static void _get_identifier (const McpAccountStorage *self, const gchar *account, GValue *identifier) { AgAccountId account_id = 0; if (!_find_account (MCD_ACCOUNT_MANAGER_SSO (self), account, &account_id)) g_warning ("Didn't find account %s in %s", account, PLUGIN_NAME); g_value_init (identifier, G_TYPE_UINT); g_value_set_uint (identifier, account_id); } static GHashTable * _get_additional_info (const McpAccountStorage *self, const gchar *account_suffix) { AgAccountId account_id = 0; McdAccountManagerSso *sso = MCD_ACCOUNT_MANAGER_SSO (self); GHashTable *additional_info = NULL; AgAccount *account; AgService *service; AgAccountSettingIter iter; const GValue *val; const gchar *key; if (!_find_account (sso, account_suffix, &account_id)) { g_warning ("Didn't find account %s in %s", account_suffix, PLUGIN_NAME); return NULL; } account = ag_manager_get_account (sso->ag_manager, account_id); g_return_val_if_fail (account != NULL, NULL); service = ag_account_get_selected_service (account); additional_info = g_hash_table_new_full (g_str_hash, g_str_equal, (GDestroyNotify) g_free, (GDestroyNotify) tp_g_value_slice_free); if (service == NULL) _ag_account_select_default_im_service (sso, account); ag_account_settings_iter_init (account, &iter, NULL); while (ag_account_settings_iter_next (&iter, &key, &val)) { if (tp_strv_contains (exported_settings, key)) g_hash_table_insert (additional_info, g_strdup (key), tp_g_value_slice_dup (val)); } ag_account_select_service (account, NULL); ag_account_settings_iter_init (account, &iter, NULL); while (ag_account_settings_iter_next (&iter, &key, &val)) { if (tp_strv_contains (exported_settings, key)) g_hash_table_insert (additional_info, g_strdup (key), tp_g_value_slice_dup (val)); } ag_account_select_service (account, service); g_object_unref (account); return additional_info; } static void account_storage_iface_init (McpAccountStorageIface *iface, gpointer unused G_GNUC_UNUSED) { iface->name = PLUGIN_NAME; iface->desc = PLUGIN_DESCRIPTION; iface->priority = PLUGIN_PRIORITY; iface->provider = PLUGIN_PROVIDER; iface->get = _mcd_account_manager_sso_get; iface->set = _set; iface->delete = _delete; iface->commit = _commit; iface->list = _list; iface->ready = _ready; iface->get_identifier = _get_identifier; iface->get_additional_info = _get_additional_info; } McdAccountManagerSso * mcd_account_manager_sso_new (void) { return g_object_new (MCD_TYPE_ACCOUNT_MANAGER_SSO, NULL); } telepathy-mission-control-5.16.4/src/mcd-dispatch-operation-priv.h0000644000175000017500000001176512735242352026310 0ustar00gkiagiagkiagia00000000000000/* vi: set et sw=4 ts=4 cino=t0,(0: */ /* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * mcd-operation.h - the Telepathy DispatchOperation D-Bus interface (service side) * * Copyright (C) 2008 Collabora Ltd. * Copyright (C) 2008 Nokia Corporation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef __MCD_DISPATCH_OPERATION_PRIV_H__ #define __MCD_DISPATCH_OPERATION_PRIV_H__ #include #include "client-registry.h" #include "mcd-handler-map-priv.h" G_BEGIN_DECLS typedef struct _McdDispatchOperation McdDispatchOperation; typedef struct _McdDispatchOperationPrivate McdDispatchOperationPrivate; typedef struct _McdDispatchOperationClass McdDispatchOperationClass; #include "mcd-account.h" struct _McdDispatchOperation { GObject parent; McdDispatchOperationPrivate *priv; }; struct _McdDispatchOperationClass { GObjectClass parent_class; }; #define CDO_INTERNAL_HANDLER "" #define MC_DISPATCH_OPERATION_DBUS_OBJECT_BASE "/org/freedesktop/Telepathy/DispatchOperation/" G_GNUC_INTERNAL GType _mcd_dispatch_operation_get_type (void); G_GNUC_INTERNAL const gchar *_mcd_dispatch_operation_get_path (McdDispatchOperation *operation); G_GNUC_INTERNAL GHashTable *_mcd_dispatch_operation_get_properties (McdDispatchOperation *operation); G_GNUC_INTERNAL void _mcd_dispatch_operation_approve (McdDispatchOperation *self, const gchar *preferred_handler); #define MCD_TYPE_DISPATCH_OPERATION (_mcd_dispatch_operation_get_type ()) #define MCD_DISPATCH_OPERATION(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), MCD_TYPE_DISPATCH_OPERATION, McdDispatchOperation)) #define MCD_DISPATCH_OPERATION_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), MCD_TYPE_DISPATCH_OPERATION, McdDispatchOperationClass)) #define MCD_IS_DISPATCH_OPERATION(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), MCD_TYPE_DISPATCH_OPERATION)) #define MCD_IS_DISPATCH_OPERATION_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), MCD_TYPE_DISPATCH_OPERATION)) #define MCD_DISPATCH_OPERATION_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), MCD_TYPE_DISPATCH_OPERATION, McdDispatchOperationClass)) G_GNUC_INTERNAL McdDispatchOperation *_mcd_dispatch_operation_new ( McdClientRegistry *client_registry, McdHandlerMap *handler_map, gboolean needs_approval, gboolean observe_only, McdChannel *channel, const gchar * const *possible_handlers); G_GNUC_INTERNAL gboolean _mcd_dispatch_operation_has_channel ( McdDispatchOperation *self, McdChannel *channel); G_GNUC_INTERNAL McdChannel *_mcd_dispatch_operation_peek_channel ( McdDispatchOperation *self); G_GNUC_INTERNAL McdChannel *_mcd_dispatch_operation_dup_channel ( McdDispatchOperation *self); G_GNUC_INTERNAL gboolean _mcd_dispatch_operation_is_finished ( McdDispatchOperation *self); G_GNUC_INTERNAL gboolean _mcd_dispatch_operation_needs_approval ( McdDispatchOperation *self); G_GNUC_INTERNAL gboolean _mcd_dispatch_operation_get_cancelled ( McdDispatchOperation *self); G_GNUC_INTERNAL void _mcd_dispatch_operation_run_clients ( McdDispatchOperation *self); G_GNUC_INTERNAL const gchar *_mcd_dispatch_operation_get_account_path ( McdDispatchOperation *self); G_GNUC_INTERNAL const gchar *_mcd_dispatch_operation_get_protocol ( McdDispatchOperation *self); G_GNUC_INTERNAL const gchar *_mcd_dispatch_operation_get_cm_name ( McdDispatchOperation *self); G_GNUC_INTERNAL const gchar *_mcd_dispatch_operation_get_connection_path ( McdDispatchOperation *self); G_GNUC_INTERNAL void _mcd_dispatch_operation_start_plugin_delay ( McdDispatchOperation *self); G_GNUC_INTERNAL void _mcd_dispatch_operation_end_plugin_delay ( McdDispatchOperation *self); G_GNUC_INTERNAL void _mcd_dispatch_operation_leave_channels ( McdDispatchOperation *self, TpChannelGroupChangeReason reason, const gchar *message); G_GNUC_INTERNAL void _mcd_dispatch_operation_close_channels ( McdDispatchOperation *self); G_GNUC_INTERNAL void _mcd_dispatch_operation_destroy_channels ( McdDispatchOperation *self); G_GNUC_INTERNAL void _mcd_dispatch_operation_forget_channels ( McdDispatchOperation *self); G_GNUC_INTERNAL gboolean _mcd_dispatch_operation_is_internal ( McdDispatchOperation *self); G_GNUC_INTERNAL gboolean _mcd_dispatch_operation_has_invoked_observers ( McdDispatchOperation *self); G_END_DECLS #endif telepathy-mission-control-5.16.4/src/plugin-request.c0000644000175000017500000001624412735241312023743 0ustar00gkiagiagkiagia00000000000000/* Representation of a channel request as presented to plugins. This is * deliberately a "smaller" API than McdChannel or McdRequest. * * Copyright © 2009 Nokia Corporation. * Copyright © 2009-2010 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA * */ #include "config.h" #include "plugin-request.h" #include #include "mission-control-plugins/implementation.h" #include "mcd-channel-priv.h" #include "mcd-debug.h" enum { PROP_0, PROP_ACCOUNT, PROP_REAL_REQUEST }; struct _McdPluginRequest { GObject parent; McdAccount *account; McdRequest *real_request; }; struct _McdPluginRequestClass { GObjectClass parent; }; static void plugin_iface_init (McpRequestIface *iface, gpointer unused G_GNUC_UNUSED); G_DEFINE_TYPE_WITH_CODE (McdPluginRequest, _mcd_plugin_request, G_TYPE_OBJECT, G_IMPLEMENT_INTERFACE (MCP_TYPE_REQUEST, plugin_iface_init)) static void _mcd_plugin_request_init (McdPluginRequest *self) { DEBUG ("%p", self); } static void plugin_req_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) { McdPluginRequest *self = (McdPluginRequest *) object; switch (prop_id) { case PROP_REAL_REQUEST: g_assert (self->real_request == NULL); /* construct-only */ self->real_request = g_value_dup_object (value); break; case PROP_ACCOUNT: g_assert (self->account == NULL); /* construct-only */ self->account = g_value_dup_object (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } } static void plugin_req_dispose (GObject *object) { McdPluginRequest *self = (McdPluginRequest *) object; GObjectFinalizeFunc dispose = G_OBJECT_CLASS (_mcd_plugin_request_parent_class)->dispose; DEBUG ("%p", object); tp_clear_object (&self->account); tp_clear_object (&self->real_request); if (dispose != NULL) dispose (object); } static void _mcd_plugin_request_class_init ( McdPluginRequestClass *cls) { GObjectClass *object_class = (GObjectClass *) cls; object_class->set_property = plugin_req_set_property; object_class->dispose = plugin_req_dispose; g_object_class_install_property (object_class, PROP_REAL_REQUEST, g_param_spec_object ("real-request", "Real channel request", "The underlying McdRequest", MCD_TYPE_REQUEST, G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (object_class, PROP_ACCOUNT, g_param_spec_object ("account", "Account", "The underlying McdAccount", MCD_TYPE_ACCOUNT, G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS)); } McdPluginRequest * _mcd_plugin_request_new (McdAccount *account, McdRequest *real_request) { McdPluginRequest *self; self = g_object_new (MCD_TYPE_PLUGIN_REQUEST, "account", account, "real-request", real_request, NULL); DEBUG ("%p (for %p, %p)", self, account, real_request); return self; } static const gchar * plugin_req_get_account_path (McpRequest *obj) { McdPluginRequest *self = MCD_PLUGIN_REQUEST (obj); g_return_val_if_fail (self != NULL, NULL); return mcd_account_get_object_path (self->account); } static const gchar * plugin_req_get_protocol (McpRequest *obj) { McdPluginRequest *self = MCD_PLUGIN_REQUEST (obj); g_return_val_if_fail (self != NULL, NULL); return mcd_account_get_protocol_name (self->account); } static const gchar * plugin_req_get_cm_name (McpRequest *obj) { McdPluginRequest *self = MCD_PLUGIN_REQUEST (obj); g_return_val_if_fail (self != NULL, NULL); return mcd_account_get_manager_name (self->account); } static gint64 plugin_req_get_user_action_time (McpRequest *obj) { McdPluginRequest *self = MCD_PLUGIN_REQUEST (obj); g_return_val_if_fail (self != NULL, 0); return _mcd_request_get_user_action_time (self->real_request); } static guint plugin_req_get_n_requests (McpRequest *obj) { McdPluginRequest *self = MCD_PLUGIN_REQUEST (obj); g_return_val_if_fail (self != NULL, 0); /* We only know how to request one channel at a time */ return 1; } static GHashTable * plugin_req_ref_nth_request (McpRequest *obj, guint n) { McdPluginRequest *self = MCD_PLUGIN_REQUEST (obj); GHashTable *requested_properties; g_return_val_if_fail (self != NULL, NULL); if (n > 0) { /* not an error, for easy iteration */ return NULL; } requested_properties = _mcd_request_get_properties ( self->real_request); g_return_val_if_fail (requested_properties != NULL, NULL); return g_hash_table_ref (requested_properties); } static void plugin_req_deny (McpRequest *obj, GQuark domain, gint code, const gchar *message) { McdPluginRequest *self = MCD_PLUGIN_REQUEST (obj); g_return_if_fail (self != NULL); _mcd_request_set_failure (self->real_request, domain, code, message); } /* an arbitrary constant, to detect use-after-free or wrong pointers */ #define DELAY_MAGIC 0xC953 typedef struct { gsize magic; McdPluginRequest *self; } RealDelay; static McpRequestDelay * plugin_req_start_delay (McpRequest *obj) { McdPluginRequest *self = MCD_PLUGIN_REQUEST (obj); RealDelay *delay; DEBUG ("%p", self); g_return_val_if_fail (self != NULL, NULL); delay = g_slice_new (RealDelay); delay->magic = DELAY_MAGIC; delay->self = g_object_ref (obj); _mcd_request_start_delay (self->real_request); return (McpRequestDelay *) delay; } static void plugin_req_end_delay (McpRequest *obj, McpRequestDelay *delay) { McdPluginRequest *self = MCD_PLUGIN_REQUEST (obj); RealDelay *real_delay = (RealDelay *) delay; DEBUG ("%p", self); g_return_if_fail (self != NULL); g_return_if_fail (real_delay->self == self); g_return_if_fail (real_delay->magic == DELAY_MAGIC); real_delay->magic = ~(DELAY_MAGIC); real_delay->self = NULL; _mcd_request_end_delay (self->real_request); g_object_unref (self); } static void plugin_iface_init (McpRequestIface *iface, gpointer unused G_GNUC_UNUSED) { DEBUG ("called"); iface->get_account_path = plugin_req_get_account_path; iface->get_protocol = plugin_req_get_protocol; iface->get_cm_name = plugin_req_get_cm_name; iface->get_user_action_time = plugin_req_get_user_action_time; iface->get_n_requests = plugin_req_get_n_requests; iface->ref_nth_request = plugin_req_ref_nth_request; iface->deny = plugin_req_deny; iface->start_delay = plugin_req_start_delay; iface->end_delay = plugin_req_end_delay; } telepathy-mission-control-5.16.4/src/mcd-manager-priv.h0000644000175000017500000000226312735241312024111 0ustar00gkiagiagkiagia00000000000000/* vi: set et sw=4 ts=8 cino=t0,(0: */ /* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4; tab-width: 8 -*- */ /* * This file is part of mission-control * * Copyright (C) 2007-2009 Nokia Corporation. * Copyright (C) 2010 Collabora Ltd. * * Contact: Naba Kumar * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * version 2.1 as published by the Free Software Foundation. * * This library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA * */ #ifndef MCD_MANAGER_PRIV_H #define MCD_MANAGER_PRIV_H #include "mcd-manager.h" G_BEGIN_DECLS TpProtocol *_mcd_manager_dup_protocol (McdManager *manager, const gchar *protocol); G_END_DECLS #endif /* MCD_MANAGER_H */ telepathy-mission-control-5.16.4/src/mcd-slacker.h0000644000175000017500000000363112735241312023145 0ustar00gkiagiagkiagia00000000000000/* * slacker.h - header for McdSlacker * Copyright ©2010 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef MCD_SLACKER_H #define MCD_SLACKER_H #include typedef struct _McdSlacker McdSlacker; typedef struct _McdSlackerClass McdSlackerClass; typedef struct _McdSlackerPrivate McdSlackerPrivate; struct _McdSlackerClass { GObjectClass parent_class; }; struct _McdSlacker { GObject parent; McdSlackerPrivate *priv; }; GType mcd_slacker_get_type (void); McdSlacker *mcd_slacker_new (void); gboolean mcd_slacker_is_inactive (McdSlacker *self); /* TYPE MACROS */ #define MCD_TYPE_SLACKER \ (mcd_slacker_get_type ()) #define MCD_SLACKER(obj) \ (G_TYPE_CHECK_INSTANCE_CAST((obj), MCD_TYPE_SLACKER, McdSlacker)) #define MCD_SLACKER_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST((klass), MCD_TYPE_SLACKER,\ McdSlackerClass)) #define MCD_IS_SLACKER(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj), MCD_TYPE_SLACKER)) #define MCD_IS_SLACKER_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE((klass), MCD_TYPE_SLACKER)) #define MCD_SLACKER_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), MCD_TYPE_SLACKER, \ McdSlackerClass)) #endif /* MCD_SLACKER_H */ telepathy-mission-control-5.16.4/src/mcd-manager.h0000644000175000017500000000552712735241312023141 0ustar00gkiagiagkiagia00000000000000/* vi: set et sw=4 ts=8 cino=t0,(0: */ /* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4; tab-width: 8 -*- */ /* * This file is part of mission-control * * Copyright (C) 2007-2009 Nokia Corporation. * * Contact: Naba Kumar * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * version 2.1 as published by the Free Software Foundation. * * This library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA * */ #ifndef MCD_MANAGER_H #define MCD_MANAGER_H #include #include G_BEGIN_DECLS #define MCD_TYPE_MANAGER (mcd_manager_get_type ()) #define MCD_MANAGER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), MCD_TYPE_MANAGER, McdManager)) #define MCD_MANAGER_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), MCD_TYPE_MANAGER, McdManagerClass)) #define MCD_IS_MANAGER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), MCD_TYPE_MANAGER)) #define MCD_IS_MANAGER_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), MCD_TYPE_MANAGER)) #define MCD_MANAGER_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), MCD_TYPE_MANAGER, McdManagerClass)) typedef struct _McdManager McdManager; typedef struct _McdManagerPrivate McdManagerPrivate; typedef struct _McdManagerClass McdManagerClass; #include "mcd-account.h" #include "mcd-connection.h" #include "mcd-operation.h" #include "mcd-dispatcher.h" struct _McdManager { McdOperation parent; McdManagerPrivate *priv; }; struct _McdManagerClass { McdOperationClass parent_class; }; GType mcd_manager_get_type (void); McdManager *mcd_manager_new (const gchar *unique_name, McdDispatcher *dispatcher, TpSimpleClientFactory *client_factory); const gchar *mcd_manager_get_name (McdManager *manager); const TpConnectionManagerParam * mcd_manager_get_protocol_param (McdManager *manager, const gchar *protocol, const gchar *param); McdConnection *mcd_manager_create_connection (McdManager *manager, McdAccount *account); TpConnectionManager *mcd_manager_get_tp_proxy (McdManager *manager); typedef void (*McdManagerReadyCb) (McdManager *manager, const GError *error, gpointer user_data); void mcd_manager_call_when_ready (McdManager *manager, McdManagerReadyCb callback, gpointer user_data); G_END_DECLS #endif /* MCD_MANAGER_H */ telepathy-mission-control-5.16.4/src/plugin-loader.c0000644000175000017500000000336312735242352023524 0ustar00gkiagiagkiagia00000000000000/* Loader for plugins that use mission-control-plugins * * Copyright (C) 2009 Nokia Corporation * Copyright (C) 2009 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA * */ #include "config.h" #include "plugin-loader.h" #include #include "mcd-debug.h" #if ENABLE_AEGIS #include "plugins/mcp-dbus-aegis-acl.h" #endif static gsize ready = 0; void _mcd_plugin_loader_init (void) { if (g_once_init_enter (&ready)) { #if ENABLE_AEGIS GObject *pseudo_plugin; #endif const gchar *dir = g_getenv ("MC_FILTER_PLUGIN_DIR"); if (dir == NULL) dir = MCD_PLUGIN_LOADER_DIR; mcp_read_dir (dir); #if ENABLE_AEGIS /* The last object added by mcp_add_object() will be treated as highest * priority, at least for the interfaces used here */ DEBUG ("Initialising built-in Aegis ACL plugin"); pseudo_plugin = G_OBJECT (aegis_acl_new ()); mcp_add_object (pseudo_plugin); g_object_unref (pseudo_plugin); #endif g_once_init_leave (&ready, 1); } } telepathy-mission-control-5.16.4/src/dispatcher.xml0000644000175000017500000000033612735242352023463 0ustar00gkiagiagkiagia00000000000000 telepathy-mission-control-5.16.4/src/mcd-account-manager.h0000644000175000017500000000667212735242352024602 0ustar00gkiagiagkiagia00000000000000/* vi: set et sw=4 ts=8 cino=t0,(0: */ /* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4; tab-width: 8 -*- */ /* * mcd-account-manager.h - the Telepathy Account D-Bus interface (service side) * * Copyright (C) 2008 Collabora Ltd. * Copyright (C) 2008 Nokia Corporation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef __MCD_ACCOUNT_MANAGER_H__ #define __MCD_ACCOUNT_MANAGER_H__ #include #include "mission-control-plugins/mission-control-plugins.h" #include "mcd-storage.h" #include "connectivity-monitor.h" G_BEGIN_DECLS #define MCD_TYPE_ACCOUNT_MANAGER (mcd_account_manager_get_type ()) #define MCD_ACCOUNT_MANAGER(o) \ (G_TYPE_CHECK_INSTANCE_CAST ((o), MCD_TYPE_ACCOUNT_MANAGER, McdAccountManager)) #define MCD_ACCOUNT_MANAGER_CLASS(k) \ (G_TYPE_CHECK_CLASS_CAST((k), MCD_TYPE_ACCOUNT_MANAGER, McdAccountManagerClass)) #define MCD_IS_ACCOUNT_MANAGER(o) \ (G_TYPE_CHECK_INSTANCE_TYPE ((o), MCD_TYPE_ACCOUNT_MANAGER)) #define MCD_IS_ACCOUNT_MANAGER_CLASS(k) \ (G_TYPE_CHECK_CLASS_TYPE ((k), MCD_TYPE_ACCOUNT_MANAGER)) #define MCD_ACCOUNT_MANAGER_GET_CLASS(o) \ (G_TYPE_INSTANCE_GET_CLASS ((o), MCD_TYPE_ACCOUNT_MANAGER, McdAccountManagerClass)) typedef struct _McdAccountManager McdAccountManager; typedef struct _McdAccountManagerPrivate McdAccountManagerPrivate; typedef struct _McdAccountManagerClass McdAccountManagerClass; #include "mcd-account.h" struct _McdAccountManager { GObject parent; McdAccountManagerPrivate *priv; }; struct _McdAccountManagerClass { GObjectClass parent_class; }; GType mcd_account_manager_get_type (void); McdAccountManager *mcd_account_manager_new ( TpSimpleClientFactory *client_factory); TpDBusDaemon *mcd_account_manager_get_dbus_daemon (McdAccountManager *account_manager); typedef void (McdAccountManagerWriteConfCb) (McdAccountManager *account_manager, const GError *error, gpointer user_data); void mcd_account_manager_write_conf_async (McdAccountManager *account_manager, McdAccount *account, McdAccountManagerWriteConfCb callback, gpointer user_data); McdAccount *mcd_account_manager_lookup_account (McdAccountManager *account_manager, const gchar *name); McdAccount *mcd_account_manager_lookup_account_by_path (McdAccountManager *account_manager, const gchar *object_path); McdStorage *mcd_account_manager_get_storage (McdAccountManager *manager); McdConnectivityMonitor *mcd_account_manager_get_connectivity_monitor ( McdAccountManager *self); G_END_DECLS #endif telepathy-mission-control-5.16.4/src/mcd-account-requests.c0000644000175000017500000002107212735241312025020 0ustar00gkiagiagkiagia00000000000000/* vi: set et sw=4 ts=4 cino=t0,(0: */ /* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4; tab-width: 4 -*- */ /* * This file is part of mission-control * * Copyright © 2008-2009 Nokia Corporation. * Copyright © 2009-2010 Collabora Ltd. * * Contact: Alberto Mardegan * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * version 2.1 as published by the Free Software Foundation. * * This library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA * */ #include "config.h" #include #include #include #include #include #include #include "mcd-account.h" #include "mcd-account-priv.h" #include "mcd-account-manager.h" #include "mcd-dispatcher-priv.h" #include "mcd-channel-priv.h" #include "mcd-misc.h" #include "request.h" static void online_request_cb (McdAccount *account, gpointer userdata, const GError *error) { McdChannel *channel = MCD_CHANNEL (userdata); McdConnection *connection; if (error) { g_warning ("got error: %s", error->message); mcd_channel_take_error (channel, g_error_copy (error)); g_object_unref (channel); return; } DEBUG ("called"); connection = mcd_account_get_connection (account); g_return_if_fail (connection != NULL); g_return_if_fail (mcd_account_get_connection_status (account) == TP_CONNECTION_STATUS_CONNECTED); if (mcd_channel_get_status (channel) == MCD_CHANNEL_STATUS_FAILED) { DEBUG ("channel %p is failed", channel); g_object_unref (channel); return; } /* the connection will take ownership of the channel if and only if it * has no parent; we expect it to have no parent, and the connection will * become its parent */ g_assert (mcd_mission_get_parent ((McdMission *) channel) == NULL); mcd_connection_request_channel (connection, channel); } static void mcd_account_channel_request_disconnect (McdRequest *request); static void on_request_succeeded_with_channel (McdRequest *request, const gchar *conn_path, GHashTable *conn_props, const gchar *chan_path, GHashTable *chan_props, McdChannel *channel) { mcd_account_channel_request_disconnect (request); } static void on_request_failed (McdRequest *request, const gchar *err_string, const gchar *message, McdChannel *channel) { g_warning ("Channel request %s failed, error: %s", _mcd_request_get_object_path (request), message); mcd_account_channel_request_disconnect (request); } static void ready_to_request_cb (McdRequest *request, McdChannel *channel); static void mcd_account_channel_request_disconnect (McdRequest *request) { g_signal_handlers_disconnect_matched (request, G_SIGNAL_MATCH_FUNC, 0, /* signal_id ignored */ 0, /* detail ignored */ NULL, /* closure ignored */ on_request_failed, NULL /* user data ignored */); g_signal_handlers_disconnect_matched (request, G_SIGNAL_MATCH_FUNC, 0, /* signal_id ignored */ 0, /* detail ignored */ NULL, /* closure ignored */ on_request_succeeded_with_channel, NULL /* user data ignored */); g_signal_handlers_disconnect_matched (request, G_SIGNAL_MATCH_FUNC, 0, /* signal_id ignored */ 0, /* detail ignored */ NULL, /* closure ignored */ ready_to_request_cb, NULL /* user data ignored */); } McdChannel * _mcd_account_create_request (McdClientRegistry *clients, McdAccount *account, GHashTable *properties, gint64 user_time, const gchar *preferred_handler, GHashTable *hints, gboolean use_existing, McdRequest **request_out, GError **error) { McdChannel *channel; GHashTable *props; McdRequest *request; if (!mcd_account_check_request (account, properties, error)) { return NULL; } /* We MUST deep-copy the hash-table, as we don't know how dbus-glib will * free it */ props = _mcd_deepcopy_asv (properties); request = _mcd_request_new (clients, use_existing, account, props, user_time, preferred_handler, hints); g_assert (request != NULL); g_hash_table_unref (props); channel = _mcd_channel_new_request (request); /* FIXME: this isn't ideal - if the account is deleted, Proceed will fail, * whereas what we want to happen is that Proceed will succeed but * immediately cause a failure to be signalled. It'll do for now though. */ /* This can't actually be emitted until Proceed() is called; it'll always * come before succeeded-with-channel or failed */ g_signal_connect_data (request, "ready-to-request", G_CALLBACK (ready_to_request_cb), g_object_ref (channel), (GClosureNotify) g_object_unref, 0); /* we use connect_after, to make sure that other signals (such as * RemoveRequest) are emitted before the Failed signal */ g_signal_connect_data (request, "succeeded-with-channel", G_CALLBACK (on_request_succeeded_with_channel), g_object_ref (channel), (GClosureNotify) g_object_unref, G_CONNECT_AFTER); g_signal_connect_data (request, "failed", G_CALLBACK (on_request_failed), g_object_ref (channel), (GClosureNotify) g_object_unref, G_CONNECT_AFTER); if (request_out != NULL) { *request_out = g_object_ref (request); } return channel; } static void ready_to_request_cb (McdRequest *request, McdChannel *channel) { GError *error = _mcd_request_dup_failure (request); /* if we didn't ref the channel, disconnecting the signal could * destroy it */ g_object_ref (channel); g_signal_handlers_disconnect_by_func (request, ready_to_request_cb, channel); if (error != NULL) { g_message ("request denied by plugin: %s", error->message); mcd_channel_take_error (channel, error); } else { DEBUG ("Starting online request"); /* Put the account online if necessary, and when that's finished, * make the actual request. (The callback releases this reference.) */ _mcd_account_online_request (_mcd_request_get_account (request), online_request_cb, g_object_ref (channel)); } g_object_unref (channel); } gboolean mcd_account_check_request (McdAccount *account, GHashTable *request, GError **error) { gboolean (*impl) (McdAccount *account, GHashTable *request, GError **error); g_return_val_if_fail (MCD_IS_ACCOUNT (account), FALSE); g_return_val_if_fail (request != NULL, FALSE); impl = MCD_ACCOUNT_GET_CLASS (account)->check_request; if (impl == NULL) return TRUE; return impl (account, request, error); } /* Default implementation of check_request */ gboolean _mcd_account_check_request_real (McdAccount *account, GHashTable *request, GError **error) { return TRUE; } telepathy-mission-control-5.16.4/src/plugin-request.h0000644000175000017500000000431712735241312023746 0ustar00gkiagiagkiagia00000000000000/* Representation of a channel request as presented to plugins. This is * deliberately a "smaller" API than McdChannel. * * Copyright © 2009 Nokia Corporation. * Copyright © 2009-2010 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA * */ #ifndef MCD_PLUGIN_REQUEST_H #define MCD_PLUGIN_REQUEST_H #include #include "mcd-account.h" #include "request.h" G_BEGIN_DECLS typedef struct _McdPluginRequest McdPluginRequest; typedef struct _McdPluginRequestClass McdPluginRequestClass; typedef struct _McdPluginRequestPrivate McdPluginRequestPrivate; G_GNUC_INTERNAL GType _mcd_plugin_request_get_type (void); #define MCD_TYPE_PLUGIN_REQUEST \ (_mcd_plugin_request_get_type ()) #define MCD_PLUGIN_REQUEST(obj) \ (G_TYPE_CHECK_INSTANCE_CAST ((obj), MCD_TYPE_PLUGIN_REQUEST, \ McdPluginRequest)) #define MCD_PLUGIN_REQUEST_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST ((klass), MCD_TYPE_PLUGIN_REQUEST, \ McdPluginRequestClass)) #define MCD_IS_PLUGIN_REQUEST(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MCD_TYPE_PLUGIN_REQUEST)) #define MCD_IS_PLUGIN_REQUEST_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE ((klass), MCD_TYPE_PLUGIN_REQUEST)) #define MCD_PLUGIN_REQUEST_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), MCD_TYPE_PLUGIN_REQUEST, \ McdPluginRequestClass)) G_GNUC_INTERNAL McdPluginRequest *_mcd_plugin_request_new (McdAccount *account, McdRequest *real_request); G_END_DECLS #endif telepathy-mission-control-5.16.4/src/mcd-account-addressing.c0000644000175000017500000000776412735242352025311 0ustar00gkiagiagkiagia00000000000000/* vi: set et sw=4 ts=8 cino=t0,(0: */ /* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4; tab-width: 8 -*- */ /* * This file is part of mission-control * * Copyright © 2010 Nokia Corporation. * Copyright © 2010 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * version 2.1 as published by the Free Software Foundation. * * This library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA * */ #include "config.h" #include "mcd-account-addressing.h" #include #include #include "mcd-account.h" #include "mcd-account-priv.h" #include "_gen/interfaces.h" static void addressing_set_uri_scheme_association (TpSvcAccountInterfaceAddressing *iface, const gchar *uri_scheme, gboolean association, DBusGMethodInvocation *context) { McdAccount *self = MCD_ACCOUNT (iface); const gchar *account = mcd_account_get_unique_name (self); McdStorage *storage = _mcd_account_get_storage (self); GValue value = G_VALUE_INIT; gchar **schemes = NULL; gboolean old_association = FALSE; g_value_init (&value, G_TYPE_STRV); if (mcd_storage_get_attribute (storage, account, MC_ACCOUNTS_KEY_URI_SCHEMES, &value, NULL)) { schemes = g_value_get_boxed (&value); old_association = tp_strv_contains ((const gchar * const *) schemes, uri_scheme); } if (old_association != association) { GPtrArray *new_schemes = g_ptr_array_new (); gchar **s; GHashTable *changed; if (association) { /* Prepend this new scheme to the existing list of schemes */ g_ptr_array_add (new_schemes, (gchar *) uri_scheme); for (s = schemes; s != NULL && *s != NULL; s++) g_ptr_array_add (new_schemes, *s); } else { /* Remove this scheme from the existing list of schemes */ for (s = schemes; s != NULL && *s != NULL; s++) if (tp_strdiff (*s, uri_scheme)) g_ptr_array_add (new_schemes, *s); } g_ptr_array_add (new_schemes, NULL); mcd_storage_set_strv (storage, account, MC_ACCOUNTS_KEY_URI_SCHEMES, (const gchar * const *) new_schemes->pdata); changed = tp_asv_new ( "URISchemes", G_TYPE_STRV, new_schemes->pdata, NULL); tp_svc_dbus_properties_emit_properties_changed (self, TP_IFACE_ACCOUNT_INTERFACE_ADDRESSING, changed, NULL); g_hash_table_unref (changed); g_ptr_array_unref (new_schemes); } g_value_unset (&value); tp_svc_account_interface_addressing_return_from_set_uri_scheme_association ( context); } static void addressing_get_uri_schemes (TpSvcDBusProperties *iface, const gchar *name, GValue *value) { McdAccount *self = MCD_ACCOUNT (iface); const gchar *account = mcd_account_get_unique_name (self); McdStorage *storage = _mcd_account_get_storage (self); g_value_init (value, G_TYPE_STRV); if (!mcd_storage_get_attribute (storage, account, MC_ACCOUNTS_KEY_URI_SCHEMES, value, NULL)) { g_value_set_boxed (value, NULL); } } const McdDBusProp account_addressing_properties[] = { { "URISchemes", NULL, addressing_get_uri_schemes }, { 0 } }; void account_addressing_iface_init (TpSvcAccountInterfaceAddressingClass *iface, gpointer data) { #define IMPLEMENT(x) tp_svc_account_interface_addressing_implement_##x (\ iface, addressing_##x) IMPLEMENT(set_uri_scheme_association); #undef IMPLEMENT } telepathy-mission-control-5.16.4/src/mcd-account-manager-default.h0000644000175000017500000000454212735242352026216 0ustar00gkiagiagkiagia00000000000000/* * The default account manager keyfile storage pseudo-plugin * * Copyright © 2010 Nokia Corporation * Copyright © 2010 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include #ifndef __MCD_ACCOUNT_MANAGER_DEFAULT_H__ #define __MCD_ACCOUNT_MANAGER_DEFAULT_H__ G_BEGIN_DECLS #define MCD_TYPE_ACCOUNT_MANAGER_DEFAULT \ (mcd_account_manager_default_get_type ()) #define MCD_ACCOUNT_MANAGER_DEFAULT(o) \ (G_TYPE_CHECK_INSTANCE_CAST ((o), MCD_TYPE_ACCOUNT_MANAGER_DEFAULT, \ McdAccountManagerDefault)) #define MCD_ACCOUNT_MANAGER_DEFAULT_CLASS(k) \ (G_TYPE_CHECK_CLASS_CAST((k), MCD_TYPE_ACCOUNT_MANAGER_DEFAULT, \ McdAccountManagerClass)) #define MCD_IS_ACCOUNT_MANAGER_DEFAULT(o) \ (G_TYPE_CHECK_INSTANCE_TYPE ((o), MCD_TYPE_ACCOUNT_MANAGER_DEFAULT)) #define MCD_IS_ACCOUNT_MANAGER_DEFAULT_CLASS(k) \ (G_TYPE_CHECK_CLASS_TYPE ((k), MCD_TYPE_ACCOUNT_MANAGER_DEFAULT)) #define MCD_ACCOUNT_MANAGER_DEFAULT_GET_CLASS(o) \ (G_TYPE_INSTANCE_GET_CLASS ((o), MCD_TYPE_ACCOUNT_MANAGER_DEFAULT, \ McdAccountManagerDefaultClass)) typedef struct { GObject parent; GKeyFile *keyfile; GKeyFile *removed; GHashTable *removed_accounts; gchar *filename; gboolean save; gboolean loaded; } _McdAccountManagerDefault; typedef struct { GObjectClass parent_class; } _McdAccountManagerDefaultClass; typedef _McdAccountManagerDefault McdAccountManagerDefault; typedef _McdAccountManagerDefaultClass McdAccountManagerDefaultClass; GType mcd_account_manager_default_get_type (void) G_GNUC_CONST; McdAccountManagerDefault *mcd_account_manager_default_new (void); G_END_DECLS #endif telepathy-mission-control-5.16.4/src/mcd-dispatcher.c0000644000175000017500000022336012762341015023646 0ustar00gkiagiagkiagia00000000000000/* vi: set et sw=4 ts=8 cino=t0,(0: */ /* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4; tab-width: 8 -*- */ /* * This file is part of mission-control * * Copyright © 2007-2011 Nokia Corporation. * Copyright © 2009-2011 Collabora Ltd. * * Contact: Naba Kumar * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * version 2.1 as published by the Free Software Foundation. * * This library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA * */ /** * SECTION:mcd-dispatcher * @title: McdDispatcher * @short_description: Dispatcher class to dispatch channels to handlers * @see_also: * @stability: Unstable * @include: mcd-dispatcher.h * * FIXME */ #include "config.h" #include #include #include #include #include "mission-control-plugins/mission-control-plugins.h" #include "client-registry.h" #include "mcd-account-priv.h" #include "mcd-client-priv.h" #include "mcd-connection.h" #include "mcd-connection-priv.h" #include "mcd-channel.h" #include "mcd-master.h" #include "mcd-channel-priv.h" #include "mcd-dispatcher-priv.h" #include "mcd-dispatch-operation-priv.h" #include "mcd-handler-map-priv.h" #include "mcd-misc.h" #include "plugin-loader.h" #include "_gen/svc-dispatcher.h" #include #include #include #include #include #include "sp_timestamp.h" #define CREATE_CHANNEL TP_IFACE_CONNECTION_INTERFACE_REQUESTS ".CreateChannel" #define ENSURE_CHANNEL TP_IFACE_CONNECTION_INTERFACE_REQUESTS ".EnsureChannel" #define SEND_MESSAGE \ TP_IFACE_CHANNEL_DISPATCHER ".Interface.Messages.DRAFT.SendMessage" #define MCD_DISPATCHER_PRIV(dispatcher) (MCD_DISPATCHER (dispatcher)->priv) static void dispatcher_iface_init (gpointer, gpointer); static void messages_iface_init (gpointer, gpointer); G_DEFINE_TYPE_WITH_CODE (McdDispatcher, mcd_dispatcher, G_TYPE_OBJECT, G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CHANNEL_DISPATCHER, dispatcher_iface_init); G_IMPLEMENT_INTERFACE (MC_TYPE_SVC_CHANNEL_DISPATCHER_INTERFACE_MESSAGES_DRAFT, messages_iface_init); G_IMPLEMENT_INTERFACE ( TP_TYPE_SVC_CHANNEL_DISPATCHER_INTERFACE_OPERATION_LIST, NULL); G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_DBUS_PROPERTIES, tp_dbus_properties_mixin_iface_init)) typedef struct { McdDispatcher *dispatcher; McdChannel *channel; gint handler_locks; gboolean handled; } McdChannelRecover; typedef struct { McdDispatcher *dispatcher; gchar *account_path; GHashTable *properties; gint64 user_action_time; gchar *preferred_handler; GHashTable *request_metadata; gboolean ensure; } McdChannelRequestACL; struct _McdDispatcherPrivate { /* Dispatching contexts */ GList *contexts; /* Channel dispatch operations */ GList *operations; TpDBusDaemon *dbus_daemon; /* hash table containing clients * char *bus_name -> McdClientProxy */ McdClientRegistry *clients; McdHandlerMap *handler_map; McdMaster *master; /* connection => itself, borrowed */ GHashTable *connections; /* Initially FALSE, meaning we suppress OperationList.DispatchOperations * change notification signals because nobody has retrieved that property * yet. Set to TRUE the first time someone reads the DispatchOperations * property. */ gboolean operation_list_active; gboolean is_disposed; }; struct cancel_call_data { DBusGProxy *handler_proxy; DBusGProxyCall *call; McdDispatcher *dispatcher; }; enum { PROP_0, PROP_DBUS_DAEMON, PROP_MCD_MASTER, PROP_INTERFACES, PROP_SUPPORTS_REQUEST_HINTS, PROP_DISPATCH_OPERATIONS, }; static void on_operation_finished (McdDispatchOperation *operation, McdDispatcher *self); static void on_master_abort (McdMaster *master, McdDispatcherPrivate *priv) { tp_clear_object (&priv->master); } static GStrv mcd_dispatcher_dup_internal_handlers (void) { const gchar * const internal_handlers[] = { CDO_INTERNAL_HANDLER, NULL }; return g_strdupv ((GStrv) internal_handlers); } static GStrv mcd_dispatcher_dup_possible_handlers (McdDispatcher *self, McdRequest *request, TpChannel *channel, const gchar *must_have_unique_name) { GList *handlers; guint n_handlers; guint i; GStrv ret; const GList *iter; GVariant *request_properties = NULL; if (request != NULL) request_properties = mcd_request_dup_properties (request); handlers = _mcd_client_registry_list_possible_handlers ( self->priv->clients, request != NULL ? _mcd_request_get_preferred_handler (request) : NULL, request_properties, channel, must_have_unique_name); n_handlers = g_list_length (handlers); tp_clear_pointer (&request_properties, g_variant_unref); if (handlers == NULL) return NULL; ret = g_new0 (gchar *, n_handlers + 1); for (iter = handlers, i = 0; iter != NULL; iter = iter->next, i++) { ret[i] = g_strdup (tp_proxy_get_bus_name (iter->data)); } ret[n_handlers] = NULL; g_list_free (handlers); return ret; } static void on_operation_finished (McdDispatchOperation *operation, McdDispatcher *self) { GList *its_link; g_signal_handlers_disconnect_by_func (operation, on_operation_finished, self); /* don't emit the signal if the CDO never appeared on D-Bus */ if (self->priv->operation_list_active && _mcd_dispatch_operation_needs_approval (operation)) { tp_svc_channel_dispatcher_interface_operation_list_emit_dispatch_operation_finished ( self, _mcd_dispatch_operation_get_path (operation)); } its_link = g_list_find (self->priv->operations, operation); if (its_link != NULL) { self->priv->operations = g_list_delete_link (self->priv->operations, its_link); g_object_unref (operation); } } static void _mcd_dispatcher_enter_state_machine (McdDispatcher *dispatcher, McdChannel *channel, const gchar * const *possible_handlers, gboolean requested, gboolean only_observe) { McdDispatchOperation *operation; McdDispatcherPrivate *priv; McdAccount *account; g_return_if_fail (MCD_IS_DISPATCHER (dispatcher)); g_return_if_fail (MCD_IS_CHANNEL (channel)); g_return_if_fail (requested || !only_observe); account = mcd_channel_get_account (channel); if (G_UNLIKELY (!account)) { g_warning ("%s called with no account", G_STRFUNC); return; } priv = dispatcher->priv; DEBUG ("new dispatch operation for %s channel %p: %s", requested ? "requested" : "unrequested", channel, mcd_channel_get_object_path (channel)); operation = _mcd_dispatch_operation_new (priv->clients, priv->handler_map, !requested, only_observe, channel, (const gchar * const *) possible_handlers); if (!requested) { if (priv->operation_list_active) { tp_svc_channel_dispatcher_interface_operation_list_emit_new_dispatch_operation ( dispatcher, _mcd_dispatch_operation_get_path (operation), _mcd_dispatch_operation_get_properties (operation)); } priv->operations = g_list_prepend (priv->operations, g_object_ref (operation)); g_signal_connect (operation, "finished", G_CALLBACK (on_operation_finished), dispatcher); } if (_mcd_dispatch_operation_get_cancelled (operation)) { GError error = { TP_ERROR, TP_ERROR_CANCELLED, "Channel request cancelled" }; McdChannel *cancelled; cancelled = _mcd_dispatch_operation_dup_channel (operation); if (cancelled != NULL) { if (mcd_channel_get_error (cancelled) == NULL) mcd_channel_take_error (cancelled, g_error_copy (&error)); _mcd_channel_undispatchable (cancelled); g_object_unref (cancelled); } } else if (_mcd_dispatch_operation_peek_channel (operation) == NULL) { DEBUG ("No channels left"); } else { _mcd_dispatch_operation_run_clients (operation); } g_object_unref (operation); } static void _mcd_dispatcher_set_property (GObject * obj, guint prop_id, const GValue * val, GParamSpec * pspec) { McdDispatcherPrivate *priv = MCD_DISPATCHER_PRIV (obj); McdMaster *master; switch (prop_id) { case PROP_DBUS_DAEMON: tp_clear_object (&priv->dbus_daemon); priv->dbus_daemon = TP_DBUS_DAEMON (g_value_dup_object (val)); break; case PROP_MCD_MASTER: master = g_value_get_object (val); g_object_ref (G_OBJECT (master)); if (priv->master) { g_signal_handlers_disconnect_by_func (G_OBJECT (master), G_CALLBACK (on_master_abort), NULL); g_object_unref (priv->master); } priv->master = master; g_signal_connect (G_OBJECT (master), "abort", G_CALLBACK (on_master_abort), priv); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (obj, prop_id, pspec); break; } } static const char * const interfaces[] = { TP_IFACE_CHANNEL_DISPATCHER_INTERFACE_OPERATION_LIST, NULL }; static void _mcd_dispatcher_get_property (GObject * obj, guint prop_id, GValue * val, GParamSpec * pspec) { McdDispatcherPrivate *priv = MCD_DISPATCHER_PRIV (obj); switch (prop_id) { case PROP_DBUS_DAEMON: g_value_set_object (val, priv->dbus_daemon); break; case PROP_MCD_MASTER: g_value_set_object (val, priv->master); break; case PROP_INTERFACES: g_value_set_static_boxed (val, interfaces); break; case PROP_SUPPORTS_REQUEST_HINTS: g_value_set_boolean (val, TRUE); break; case PROP_DISPATCH_OPERATIONS: { GList *iter; GPtrArray *operations = g_ptr_array_new (); /* Side-effect: from now on, emit change notification signals for * this property */ priv->operation_list_active = TRUE; for (iter = priv->operations; iter != NULL; iter = iter->next) { McdDispatchOperation *op = iter->data; if (_mcd_dispatch_operation_needs_approval (op) && !_mcd_dispatch_operation_is_finished (op)) { GValueArray *va = g_value_array_new (2); g_value_array_append (va, NULL); g_value_array_append (va, NULL); g_value_init (va->values + 0, DBUS_TYPE_G_OBJECT_PATH); g_value_init (va->values + 1, TP_HASH_TYPE_STRING_VARIANT_MAP); g_value_set_boxed (va->values + 0, _mcd_dispatch_operation_get_path (op)); g_value_set_boxed (va->values + 1, _mcd_dispatch_operation_get_properties (op)); g_ptr_array_add (operations, va); } } g_value_take_boxed (val, operations); } break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (obj, prop_id, pspec); break; } } static void mcd_dispatcher_client_handling_channel_cb (McdClientProxy *client, const gchar *object_path, McdDispatcher *self) { const gchar *bus_name = tp_proxy_get_bus_name (client); const gchar *unique_name = _mcd_client_proxy_get_unique_name (client); if (unique_name == NULL || unique_name[0] == '\0') { /* if it said it was handling channels but it doesn't seem to exist * (or worse, doesn't know whether it exists) then we don't believe * it */ DEBUG ("%s doesn't seem to exist, assuming it's not handling %s", bus_name, object_path); return; } DEBUG ("%s (%s) is handling %s", bus_name, unique_name, object_path); _mcd_handler_map_set_path_handled (self->priv->handler_map, object_path, unique_name, bus_name); } static void mcd_dispatcher_update_client_caps (McdDispatcher *self, McdClientProxy *client); static void mcd_dispatcher_client_capabilities_changed_cb (McdClientProxy *client, McdDispatcher *self) { mcd_dispatcher_update_client_caps (self, client); } static void mcd_dispatcher_client_gone_cb (McdClientProxy *client, McdDispatcher *self); static void mcd_dispatcher_client_needs_recovery_cb (McdClientProxy *client, McdDispatcher *self); static void mcd_dispatcher_discard_client (McdDispatcher *self, McdClientProxy *client) { g_signal_handlers_disconnect_by_func (client, mcd_dispatcher_client_capabilities_changed_cb, self); g_signal_handlers_disconnect_by_func (client, mcd_dispatcher_client_handling_channel_cb, self); g_signal_handlers_disconnect_by_func (client, mcd_dispatcher_client_gone_cb, self); g_signal_handlers_disconnect_by_func (client, mcd_dispatcher_client_needs_recovery_cb, self); } static void mcd_dispatcher_client_gone_cb (McdClientProxy *client, McdDispatcher *self) { mcd_dispatcher_discard_client (self, client); } /* * @channel: a non-null TpChannel which has already been dispatched * @request: (allow-none): if not NULL, a request that resulted in * @channel * * Return a Handler to which @channel could be re-dispatched, * for instance as a result of a re-request or a PresentChannel call. * * If @channel was dispatched to a Handler, return that Handler. * Otherwise, if it was Claimed by a process, and that process * has a Handler to which the channel could have been dispatched, * return that Handler. Otherwise return NULL. */ static McdClientProxy * _mcd_dispatcher_lookup_handler (McdDispatcher *self, TpChannel *channel, McdRequest *request) { McdClientProxy *handler = NULL; const gchar *object_path; const gchar *unique_name; const gchar *well_known_name; object_path = tp_proxy_get_object_path (channel); unique_name = _mcd_handler_map_get_handler (self->priv->handler_map, object_path, &well_known_name); if (unique_name == NULL) { DEBUG ("No process is handling channel %s", object_path); return NULL; } if (well_known_name != NULL) { /* We know which Handler well-known name was responsible: use it if it * still exists */ DEBUG ("Channel %s is handler by %s", object_path, well_known_name); handler = _mcd_client_registry_lookup (self->priv->clients, well_known_name); } if (handler == NULL) { GList *possible_handlers; GVariant *request_properties = NULL; /* Failing that, maybe the Handler it was dispatched to was temporary; * try to pick another Handler that can deal with it, on the same * unique name (i.e. in the same process). * It can also happen in the case an Observer/Approver Claimed the * channel; in that case we did not get its handler well known name. */ if (request != NULL) request_properties = mcd_request_dup_properties (request); possible_handlers = _mcd_client_registry_list_possible_handlers ( self->priv->clients, request != NULL ? _mcd_request_get_preferred_handler (request) : NULL, request_properties, channel, unique_name); tp_clear_pointer (&request_properties, g_variant_unref); if (possible_handlers != NULL) { DEBUG ("Pick first possible handler for channel %s", object_path); handler = possible_handlers->data; } else { /* The process is still running (otherwise it wouldn't be in the * handler map), but none of its well-known names is still * interested in channels of that sort. Oh well, not our problem. */ DEBUG ("process %s no longer interested in channel %s", unique_name, object_path); } g_list_free (possible_handlers); } return handler; } static void mcd_dispatcher_client_needs_recovery_cb (McdClientProxy *client, McdDispatcher *self) { const GList *channels = _mcd_handler_map_get_handled_channels (self->priv->handler_map); const GList *observer_filters; const GList *list; DEBUG ("called"); observer_filters = _mcd_client_proxy_get_observer_filters (client); for (list = channels; list; list = list->next) { TpChannel *channel = list->data; const gchar *object_path = tp_proxy_get_object_path (channel); GVariant *properties; McdClientProxy *handler; /* FIXME: This is not exactly the right behaviour, see fd.o#40305 */ handler = _mcd_dispatcher_lookup_handler (self, channel, NULL); if (handler && _mcd_client_proxy_get_bypass_observers (handler)) { DEBUG ("skipping unobservable channel %s", object_path); continue; } properties = tp_channel_dup_immutable_properties (channel); if (_mcd_client_match_filters (properties, observer_filters, FALSE)) { const gchar *account_path = _mcd_handler_map_get_channel_account (self->priv->handler_map, tp_proxy_get_object_path (channel)); _mcd_client_recover_observer (client, channel, account_path); } g_variant_unref (properties); } /* we also need to think about channels that are still being dispatched, * but have got far enough that this client wouldn't otherwise see them */ for (list = self->priv->operations; list != NULL; list = list->next) { McdDispatchOperation *op = list->data; if (_mcd_dispatch_operation_has_invoked_observers (op)) { McdChannel *mcd_channel = _mcd_dispatch_operation_peek_channel (op); if (mcd_channel != NULL) { GVariant *properties = mcd_channel_dup_immutable_properties (mcd_channel); if (_mcd_client_match_filters (properties, observer_filters, FALSE)) { _mcd_client_recover_observer (client, mcd_channel_get_tp_channel (mcd_channel), _mcd_dispatch_operation_get_account_path (op)); } g_variant_unref (properties); } } } } static void mcd_dispatcher_client_added_cb (McdClientRegistry *clients, McdClientProxy *client, McdDispatcher *self) { g_signal_connect (client, "gone", G_CALLBACK (mcd_dispatcher_client_gone_cb), self); g_signal_connect (client, "is-handling-channel", G_CALLBACK (mcd_dispatcher_client_handling_channel_cb), self); g_signal_connect (client, "handler-capabilities-changed", G_CALLBACK (mcd_dispatcher_client_capabilities_changed_cb), self); g_signal_connect (client, "need-recovery", G_CALLBACK (mcd_dispatcher_client_needs_recovery_cb), self); } static void mcd_dispatcher_client_registry_ready_cb (McdClientRegistry *clients, McdDispatcher *self) { GHashTableIter iter; gpointer p; GPtrArray *vas; DEBUG ("All initial clients have been inspected"); vas = _mcd_client_registry_dup_client_caps (clients); g_hash_table_iter_init (&iter, self->priv->connections); while (g_hash_table_iter_next (&iter, &p, NULL)) { _mcd_connection_start_dispatching (p, vas); } g_ptr_array_foreach (vas, (GFunc) g_value_array_free, NULL); g_ptr_array_unref (vas); } static void drop_each_operation (gpointer operation, gpointer dispatcher) { g_signal_handlers_disconnect_by_func (operation, on_operation_finished, dispatcher); g_object_unref (operation); } static void _mcd_dispatcher_dispose (GObject * object) { McdDispatcherPrivate *priv = MCD_DISPATCHER_PRIV (object); if (priv->is_disposed) { return; } priv->is_disposed = TRUE; if (priv->operations != NULL) { g_list_foreach (priv->operations, drop_each_operation, object); tp_clear_pointer (&priv->operations, g_list_free); } tp_clear_object (&priv->handler_map); if (priv->clients != NULL) { gpointer client_p; GHashTableIter iter; _mcd_client_registry_init_hash_iter (priv->clients, &iter); while (g_hash_table_iter_next (&iter, NULL, &client_p)) { mcd_dispatcher_discard_client ((McdDispatcher *) object, client_p); } g_signal_handlers_disconnect_by_func (priv->clients, mcd_dispatcher_client_added_cb, object); g_signal_handlers_disconnect_by_func (priv->clients, mcd_dispatcher_client_registry_ready_cb, object); tp_clear_object (&priv->clients); } tp_clear_pointer (&priv->connections, g_hash_table_unref); tp_clear_object (&priv->master); tp_clear_object (&priv->dbus_daemon); G_OBJECT_CLASS (mcd_dispatcher_parent_class)->dispose (object); } static void mcd_dispatcher_update_client_caps (McdDispatcher *self, McdClientProxy *client) { GPtrArray *vas; GHashTableIter iter; gpointer k; /* If we haven't finished inspecting initial clients yet, we'll push all * the client caps into all connections when we do, so do nothing. * * If we don't have any connections, on the other hand, then there's * nothing to do. */ if (!_mcd_client_registry_is_ready (self->priv->clients) || g_hash_table_size (self->priv->connections) == 0) { return; } vas = g_ptr_array_sized_new (1); g_ptr_array_add (vas, _mcd_client_proxy_dup_handler_capabilities (client)); g_hash_table_iter_init (&iter, self->priv->connections); while (g_hash_table_iter_next (&iter, &k, NULL)) { _mcd_connection_update_client_caps (k, vas); } g_ptr_array_foreach (vas, (GFunc) g_value_array_free, NULL); g_ptr_array_unref (vas); } static void mcd_dispatcher_constructed (GObject *object) { DBusGConnection *dgc; McdDispatcherPrivate *priv = MCD_DISPATCHER_PRIV (object); GError *error = NULL; priv->handler_map = _mcd_handler_map_new (priv->dbus_daemon); priv->clients = _mcd_client_registry_new (priv->dbus_daemon); g_signal_connect (priv->clients, "client-added", G_CALLBACK (mcd_dispatcher_client_added_cb), object); g_signal_connect (priv->clients, "ready", G_CALLBACK (mcd_dispatcher_client_registry_ready_cb), object); dgc = tp_proxy_get_dbus_connection (TP_PROXY (priv->dbus_daemon)); if (!tp_dbus_daemon_request_name (priv->dbus_daemon, TP_CHANNEL_DISPATCHER_BUS_NAME, TRUE /* idempotent */, &error)) { /* FIXME: put in proper error handling when MC gains the ability to * be the AM or the CD but not both */ g_warning ("Failed registering '%s' service: %s", TP_CHANNEL_DISPATCHER_BUS_NAME, error->message); g_error_free (error); exit (1); } dbus_g_connection_register_g_object (dgc, TP_CHANNEL_DISPATCHER_OBJECT_PATH, object); } static void mcd_dispatcher_class_init (McdDispatcherClass * klass) { static TpDBusPropertiesMixinPropImpl cd_props[] = { { "Interfaces", "interfaces", NULL }, { "SupportsRequestHints", "supports-request-hints", NULL }, { NULL } }; static TpDBusPropertiesMixinPropImpl op_list_props[] = { { "DispatchOperations", "dispatch-operations", NULL }, { NULL } }; static TpDBusPropertiesMixinIfaceImpl prop_interfaces[] = { { TP_IFACE_CHANNEL_DISPATCHER, tp_dbus_properties_mixin_getter_gobject_properties, NULL, cd_props, }, { TP_IFACE_CHANNEL_DISPATCHER_INTERFACE_OPERATION_LIST, tp_dbus_properties_mixin_getter_gobject_properties, NULL, op_list_props, }, { NULL } }; GObjectClass *object_class = G_OBJECT_CLASS (klass); g_type_class_add_private (object_class, sizeof (McdDispatcherPrivate)); object_class->constructed = mcd_dispatcher_constructed; object_class->set_property = _mcd_dispatcher_set_property; object_class->get_property = _mcd_dispatcher_get_property; object_class->dispose = _mcd_dispatcher_dispose; /* Properties */ g_object_class_install_property (object_class, PROP_DBUS_DAEMON, g_param_spec_object ("dbus-daemon", "DBus daemon", "DBus daemon", TP_TYPE_DBUS_DAEMON, G_PARAM_READWRITE | G_PARAM_CONSTRUCT)); g_object_class_install_property (object_class, PROP_MCD_MASTER, g_param_spec_object ("mcd-master", "McdMaster", "McdMaster", MCD_TYPE_MASTER, G_PARAM_READWRITE | G_PARAM_CONSTRUCT)); g_object_class_install_property (object_class, PROP_INTERFACES, g_param_spec_boxed ("interfaces", "Interfaces", "Interfaces", G_TYPE_STRV, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property ( object_class, PROP_SUPPORTS_REQUEST_HINTS, g_param_spec_boolean ("supports-request-hints", "SupportsRequestHints", "Yes, we support CreateChannelWithHints etc.", TRUE, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (object_class, PROP_DISPATCH_OPERATIONS, g_param_spec_boxed ("dispatch-operations", "ChannelDispatchOperation details", "A dbus-glib a(oa{sv})", TP_ARRAY_TYPE_DISPATCH_OPERATION_DETAILS_LIST, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); klass->dbus_properties_class.interfaces = prop_interfaces, tp_dbus_properties_mixin_class_init (object_class, G_STRUCT_OFFSET (McdDispatcherClass, dbus_properties_class)); } static void mcd_dispatcher_init (McdDispatcher * dispatcher) { McdDispatcherPrivate *priv; priv = G_TYPE_INSTANCE_GET_PRIVATE (dispatcher, MCD_TYPE_DISPATCHER, McdDispatcherPrivate); dispatcher->priv = priv; priv->operation_list_active = FALSE; priv->connections = g_hash_table_new (NULL, NULL); /* idempotent, not guaranteed to have been called yet */ _mcd_plugin_loader_init (); } McdDispatcher * mcd_dispatcher_new (TpDBusDaemon *dbus_daemon, McdMaster *master) { McdDispatcher *obj; obj = MCD_DISPATCHER (g_object_new (MCD_TYPE_DISPATCHER, "dbus-daemon", dbus_daemon, "mcd-master", master, NULL)); return obj; } /* * _mcd_dispatcher_add_channel: * @dispatcher: the #McdDispatcher. * @channel: (transfer none): a #McdChannel which must own a #TpChannel * @requested: whether the channels were requested by MC. * * Add @channel to the dispatching state machine. */ void _mcd_dispatcher_add_channel (McdDispatcher *dispatcher, McdChannel *channel, gboolean requested, gboolean only_observe) { TpChannel *tp_channel = NULL; GStrv possible_handlers; McdRequest *request = NULL; gboolean internal_request = FALSE; g_return_if_fail (MCD_IS_DISPATCHER (dispatcher)); g_return_if_fail (MCD_IS_CHANNEL (channel)); DEBUG ("%s channel %p: %s", requested ? "requested" : "unrequested", channel, mcd_channel_get_object_path (channel)); if (only_observe) { g_return_if_fail (requested); /* these channels were requested "behind our back", so only call * ObserveChannels on them */ _mcd_dispatcher_enter_state_machine (dispatcher, channel, NULL, TRUE, TRUE); return; } /* The channel must have the TpChannel part of McdChannel's double life. * It might also have the McdRequest part. */ tp_channel = mcd_channel_get_tp_channel (channel); g_assert (tp_channel != NULL); request = _mcd_channel_get_request (channel); internal_request = _mcd_request_is_internal (request); /* See if there are any handlers that can take all these channels */ if (internal_request) possible_handlers = mcd_dispatcher_dup_internal_handlers (); else possible_handlers = mcd_dispatcher_dup_possible_handlers (dispatcher, request, tp_channel, NULL); if (possible_handlers == NULL) { DEBUG ("Channel cannot be handled - making a CDO " "anyway, to get Observers run"); } else { DEBUG ("%s handler(s) found, dispatching channel", internal_request ? "internal" : "possible"); } _mcd_channel_set_status (channel, MCD_CHANNEL_STATUS_DISPATCHING); _mcd_dispatcher_enter_state_machine (dispatcher, channel, (const gchar * const *) possible_handlers, requested, FALSE); g_strfreev (possible_handlers); } static void mcd_dispatcher_finish_reinvocation (McdChannel *request) { _mcd_channel_set_status (request, MCD_CHANNEL_STATUS_DISPATCHED); /* no need to keep it around any more */ mcd_mission_abort (MCD_MISSION (request)); } static void reinvoke_handle_channels_cb (TpClient *client, const GError *error, gpointer user_data G_GNUC_UNUSED, GObject *weak_object) { McdChannel *request = MCD_CHANNEL (weak_object); if (error != NULL) { /* The handler is already dealing with this channel, but refuses to * re-handle it. Oh well, we tried. */ DEBUG ("handler %s refused re-notification about channel %p:%s: " "%s:%d: %s", tp_proxy_get_bus_name (client), request, mcd_channel_get_object_path (request), g_quark_to_string (error->domain), error->code, error->message); } else { DEBUG ("handler %s successfully notified about channel %p:%s", tp_proxy_get_bus_name (client), request, mcd_channel_get_object_path (request)); } /* either way, consider the request to have been dispatched */ mcd_dispatcher_finish_reinvocation (request); } /* * _mcd_dispatcher_reinvoke_handler: * @dispatcher: The #McdDispatcher. * @request: a #McdChannel that has both a #TpChannel and a #McdRequest * * Re-invoke the channel handler for @request. */ static void _mcd_dispatcher_reinvoke_handler (McdDispatcher *dispatcher, McdChannel *request) { GList *request_as_list; McdClientProxy *handler = NULL; McdRequest *real_request = _mcd_channel_get_request (request); TpChannel *tp_channel = mcd_channel_get_tp_channel (request); GHashTable *handler_info; GHashTable *request_properties; g_assert (real_request != NULL); g_assert (tp_channel != NULL); request_as_list = g_list_append (NULL, request); request_properties = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, (GDestroyNotify) g_hash_table_unref); g_hash_table_insert (request_properties, g_strdup (_mcd_request_get_object_path (real_request)), _mcd_request_dup_immutable_properties (real_request)); handler_info = tp_asv_new (NULL, NULL); /* hand over ownership of request_properties */ tp_asv_take_boxed (handler_info, "request-properties", TP_HASH_TYPE_OBJECT_IMMUTABLE_PROPERTIES_MAP, request_properties); request_properties = NULL; handler = _mcd_dispatcher_lookup_handler (dispatcher, tp_channel, real_request); if (handler == NULL) { mcd_dispatcher_finish_reinvocation (request); goto finally; } /* This is deliberately not the same call as for normal dispatching, * and it doesn't go through a dispatch operation - the error handling * is completely different, because the channel is already being * handled perfectly well. */ _mcd_client_proxy_handle_channels (handler, -1, request_as_list, 0, /* the request's user action time will be used automatically */ handler_info, reinvoke_handle_channels_cb, NULL, NULL, (GObject *) request); finally: g_hash_table_unref (handler_info); g_list_free (request_as_list); } static McdDispatchOperation * find_operation_from_channel (McdDispatcher *dispatcher, McdChannel *channel) { GList *list; g_return_val_if_fail (MCD_IS_CHANNEL (channel), NULL); for (list = dispatcher->priv->operations; list != NULL; list = list->next) { McdDispatchOperation *op = list->data; if (_mcd_dispatch_operation_has_channel (op, channel)) return op; } return NULL; } void _mcd_dispatcher_add_channel_request (McdDispatcher *dispatcher, McdChannel *channel, McdChannel *request) { McdChannelStatus status; McdRequest *origin = _mcd_channel_get_request (request); gboolean internal = _mcd_request_is_internal (origin); status = mcd_channel_get_status (channel); /* if the channel is already dispatched, just reinvoke the handler; if it * is not, @request must mirror the status of @channel */ if (status == MCD_CHANNEL_STATUS_DISPATCHED) { DEBUG ("reinvoking handler on channel %p", request); /* copy the object path and the immutable properties from the * existing channel */ _mcd_channel_copy_details (request, channel); if (internal) _mcd_request_handle_internally (origin, request, FALSE); else _mcd_dispatcher_reinvoke_handler (dispatcher, request); } else { DEBUG ("non-reinvoked handling of channel %p", request); _mcd_channel_set_request_proxy (request, channel); if (internal) { _mcd_request_handle_internally (origin, request, FALSE); } else if (status == MCD_CHANNEL_STATUS_DISPATCHING) { McdDispatchOperation *op = find_operation_from_channel (dispatcher, channel); const gchar *preferred_handler = _mcd_channel_get_request_preferred_handler (request); g_return_if_fail (op != NULL); DEBUG ("channel %p is in CDO %p", channel, op); _mcd_dispatch_operation_approve (op, preferred_handler); } DEBUG ("channel %p is proxying %p", request, channel); } } void _mcd_dispatcher_recover_channel (McdDispatcher *dispatcher, McdChannel *channel, const gchar *account_path) { McdDispatcherPrivate *priv; const gchar *path; const gchar *unique_name; const gchar *well_known_name = NULL; gboolean requested; TpChannel *tp_channel; /* we must check if the channel is already being handled by some client; to * do this, we can examine the active handlers' "HandledChannel" property. * By now, we should already have done this, because startup has completed. */ g_return_if_fail (MCD_IS_DISPATCHER (dispatcher)); priv = dispatcher->priv; g_return_if_fail (_mcd_client_registry_is_ready ( dispatcher->priv->clients)); path = mcd_channel_get_object_path (channel); tp_channel = mcd_channel_get_tp_channel (channel); g_return_if_fail (tp_channel != NULL); unique_name = _mcd_handler_map_get_handler (priv->handler_map, path, &well_known_name); if (unique_name != NULL) { DEBUG ("Channel %s is already handled by process %s", path, unique_name); _mcd_channel_set_status (channel, MCD_CHANNEL_STATUS_DISPATCHED); _mcd_handler_map_set_channel_handled (priv->handler_map, tp_channel, unique_name, well_known_name, account_path); } else { DEBUG ("%s is unhandled, redispatching", path); requested = mcd_channel_is_requested (channel); _mcd_dispatcher_add_channel (dispatcher, channel, requested, FALSE); } } static gboolean check_preferred_handler (const gchar *preferred_handler, GError **error) { g_assert (error != NULL); if (preferred_handler[0] == '\0') return TRUE; if (!tp_dbus_check_valid_bus_name (preferred_handler, TP_DBUS_NAME_TYPE_WELL_KNOWN, error)) { /* The error is TP_DBUS_ERROR_INVALID_BUS_NAME, which has no D-Bus * representation; re-map to InvalidArgument. */ (*error)->domain = TP_ERROR; (*error)->code = TP_ERROR_INVALID_ARGUMENT; return FALSE; } if (!g_str_has_prefix (preferred_handler, TP_CLIENT_BUS_NAME_BASE)) { g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Not a Telepathy Client: %s", preferred_handler); return FALSE; } return TRUE; } static void dispatcher_request_channel (McdDispatcher *self, const gchar *account_path, GHashTable *requested_properties, gint64 user_action_time, const gchar *preferred_handler, GHashTable *request_metadata, DBusGMethodInvocation *context, gboolean ensure) { McdAccountManager *am; McdAccount *account; McdChannel *channel = NULL; McdRequest *request = NULL; GError *error = NULL; const gchar *path; g_return_if_fail (account_path != NULL); g_return_if_fail (requested_properties != NULL); g_return_if_fail (preferred_handler != NULL); g_object_get (self->priv->master, "account-manager", &am, NULL); g_assert (am != NULL); account = mcd_account_manager_lookup_account_by_path (am, account_path); if (account == NULL) { g_set_error (&error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "No such account: %s", account_path); goto despair; } if (!check_preferred_handler (preferred_handler, &error)) goto despair; channel = _mcd_account_create_request (self->priv->clients, account, requested_properties, user_action_time, preferred_handler, request_metadata, ensure, &request, &error); if (channel == NULL) { /* FIXME: ideally this would be emitted as a Failed signal after * Proceed is called, but for the particular failure case here (low * memory) perhaps we don't want to */ goto despair; } g_assert (request != NULL); path = _mcd_request_get_object_path (request); g_assert (path != NULL); /* This is OK because the signatures of CreateChannel and EnsureChannel * are the same */ tp_svc_channel_dispatcher_return_from_create_channel (context, path); _mcd_request_predict_handler (request); /* We've done all we need to with this channel: the ChannelRequests code * keeps it alive as long as is necessary. The finally clause will * free it */ goto finally; despair: dbus_g_method_return_error (context, error); g_error_free (error); finally: tp_clear_object (&channel); tp_clear_object (&request); g_object_unref (am); } static void dispatcher_channel_request_acl_cleanup (gpointer data) { McdChannelRequestACL *crd = data; DEBUG ("cleanup acl (%p)", data); g_free (crd->account_path); g_free (crd->preferred_handler); g_hash_table_unref (crd->properties); g_object_unref (crd->dispatcher); tp_clear_pointer (&crd->request_metadata, g_hash_table_unref); g_slice_free (McdChannelRequestACL, crd); } static void dispatcher_channel_request_acl_success (DBusGMethodInvocation *context, gpointer data) { McdChannelRequestACL *crd = data; DEBUG ("complete acl (%p)", crd); dispatcher_request_channel (MCD_DISPATCHER (crd->dispatcher), crd->account_path, crd->properties, crd->user_action_time, crd->preferred_handler, crd->request_metadata, context, crd->ensure); } static void free_gvalue (gpointer gvalue) { GValue *gv = gvalue; g_value_unset (gv); g_slice_free (GValue, gv); } static void dispatcher_channel_request_acl_start (McdDispatcher *dispatcher, const gchar *method, const gchar *account_path, GHashTable *requested_properties, gint64 user_action_time, const gchar *preferred_handler, GHashTable *request_metadata, DBusGMethodInvocation *context, gboolean ensure) { McdChannelRequestACL *crd = g_slice_new0 (McdChannelRequestACL); GValue *account = g_slice_new0 (GValue); GHashTable *params = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, free_gvalue); g_value_init (account, G_TYPE_STRING); g_value_set_string (account, account_path); g_hash_table_insert (params, "account-path", account); crd->dispatcher = g_object_ref (dispatcher); crd->account_path = g_strdup (account_path); crd->preferred_handler = g_strdup (preferred_handler); crd->properties = g_hash_table_ref (requested_properties); crd->user_action_time = user_action_time; crd->ensure = ensure; crd->request_metadata = request_metadata != NULL ? g_hash_table_ref (request_metadata) : NULL; DEBUG ("start %s.%s acl (%p)", account_path, method, crd); mcp_dbus_acl_authorised_async (dispatcher->priv->dbus_daemon, context, DBUS_ACL_TYPE_METHOD, method, params, dispatcher_channel_request_acl_success, crd, dispatcher_channel_request_acl_cleanup); g_hash_table_unref (params); } static void dispatcher_create_channel (TpSvcChannelDispatcher *iface, const gchar *account_path, GHashTable *requested_properties, gint64 user_action_time, const gchar *preferred_handler, DBusGMethodInvocation *context) { dispatcher_channel_request_acl_start (MCD_DISPATCHER (iface), CREATE_CHANNEL, account_path, requested_properties, user_action_time, preferred_handler, NULL, context, FALSE); } static void dispatcher_ensure_channel (TpSvcChannelDispatcher *iface, const gchar *account_path, GHashTable *requested_properties, gint64 user_action_time, const gchar *preferred_handler, DBusGMethodInvocation *context) { dispatcher_channel_request_acl_start (MCD_DISPATCHER (iface), ENSURE_CHANNEL, account_path, requested_properties, user_action_time, preferred_handler, NULL, context, TRUE); } static void dispatcher_create_channel_with_hints (TpSvcChannelDispatcher *iface, const gchar *account_path, GHashTable *requested_properties, gint64 user_action_time, const gchar *preferred_handler, GHashTable *hints, DBusGMethodInvocation *context) { dispatcher_channel_request_acl_start (MCD_DISPATCHER (iface), CREATE_CHANNEL, account_path, requested_properties, user_action_time, preferred_handler, hints, context, FALSE); } static void dispatcher_ensure_channel_with_hints (TpSvcChannelDispatcher *iface, const gchar *account_path, GHashTable *requested_properties, gint64 user_action_time, const gchar *preferred_handler, GHashTable *hints, DBusGMethodInvocation *context) { dispatcher_channel_request_acl_start (MCD_DISPATCHER (iface), ENSURE_CHANNEL, account_path, requested_properties, user_action_time, preferred_handler, hints, context, TRUE); } static void mcd_dispatcher_lost_connection (gpointer data, GObject *corpse) { McdDispatcher *self = MCD_DISPATCHER (data); /* not safe to dereference corpse any more, so just print its address - * that's enough to pair up with add_connection calls */ DEBUG ("%p: %p", self, corpse); g_hash_table_remove (self->priv->connections, corpse); g_object_unref (self); } /* FIXME: this only needs to exist because McdConnection calls it in order * to preload caps before Connect */ GPtrArray * _mcd_dispatcher_dup_client_caps (McdDispatcher *self) { g_return_val_if_fail (MCD_IS_DISPATCHER (self), NULL); /* if we're not ready, return NULL to tell the connection not to preload */ if (!_mcd_client_registry_is_ready (self->priv->clients)) { return NULL; } return _mcd_client_registry_dup_client_caps (self->priv->clients); } void _mcd_dispatcher_add_connection (McdDispatcher *self, McdConnection *connection) { g_return_if_fail (MCD_IS_DISPATCHER (self)); DEBUG ("%p: %p (%s)", self, connection, mcd_connection_get_object_path (connection)); g_hash_table_insert (self->priv->connections, connection, connection); g_object_weak_ref ((GObject *) connection, mcd_dispatcher_lost_connection, g_object_ref (self)); if (_mcd_client_registry_is_ready (self->priv->clients)) { GPtrArray *vas = _mcd_client_registry_dup_client_caps (self->priv->clients); _mcd_connection_start_dispatching (connection, vas); g_ptr_array_foreach (vas, (GFunc) g_value_array_free, NULL); g_ptr_array_unref (vas); } /* else _mcd_connection_start_dispatching will be called when we're ready * for it */ } /* org.freedesktop.Telepathy.ChannelDispatcher.Messages */ typedef struct { McdDispatcher *dispatcher; gchar *account_path; gchar *target_id; GPtrArray *payload; guint flags; guint tries; gboolean close_after; DBusGMethodInvocation *dbus_context; } MessageContext; static MessageContext * message_context_steal (MessageContext *from) { MessageContext *stolen = g_slice_new0 (MessageContext); g_memmove (stolen, from, sizeof (MessageContext)); memset (from, 0, sizeof (MessageContext)); return stolen; } static MessageContext * message_context_new (McdDispatcher *dispatcher, const gchar *account_path, const gchar *target_id, const GPtrArray *payload, guint flags) { guint i; const guint size = payload->len; MessageContext *context = g_slice_new0 (MessageContext); GPtrArray *msg_copy = g_ptr_array_sized_new (size); g_ptr_array_set_free_func (msg_copy, (GDestroyNotify) g_hash_table_unref); for (i = 0; i < size; i++) { GHashTable *part = g_ptr_array_index (payload, i); g_ptr_array_add (msg_copy, _mcd_deepcopy_asv (part)); } context->dispatcher = g_object_ref (dispatcher); context->account_path = g_strdup (account_path); context->target_id = g_strdup (target_id); context->payload = msg_copy; context->flags = flags; context->dbus_context = NULL; return context; } static void message_context_return_error (MessageContext *context, const GError *error) { if (context->dbus_context == NULL) return; dbus_g_method_return_error (context->dbus_context, error); context->dbus_context = NULL; } static void message_context_set_return_context (MessageContext *context, DBusGMethodInvocation *dbus_context) { context->dbus_context = dbus_context; } static void message_context_free (gpointer ctx) { MessageContext *context = ctx; tp_clear_pointer (&context->payload, g_ptr_array_unref); tp_clear_pointer (&context->account_path, g_free); tp_clear_pointer (&context->target_id, g_free); if (context->dbus_context != NULL) { GError *error; error = g_error_new_literal (TP_ERROR, TP_ERROR_TERMINATED, "Channel request failed"); dbus_g_method_return_error (context->dbus_context, error); g_error_free (error); } tp_clear_object (&context->dispatcher); g_slice_free (MessageContext, context); } static void send_message_submitted (TpChannel *proxy, const gchar *token, const GError *error, gpointer data, GObject *weak) { MessageContext *message = data; DBusGMethodInvocation *context = message->dbus_context; McdChannel *channel = MCD_CHANNEL (weak); McdRequest *request = _mcd_channel_get_request (channel); gboolean close_after = message->close_after; /* this frees the dbus context, so clear it from our cache afterwards */ if (error == NULL) { mc_svc_channel_dispatcher_interface_messages_draft_return_from_send_message (context, token); message_context_set_return_context (message, NULL); } else { DEBUG ("error: %s", error->message); message_context_return_error (message, error); } _mcd_request_unblock_account (message->account_path); _mcd_request_clear_internal_handler (request); if (close_after) _mcd_channel_close (channel); } static void messages_send_message_start (DBusGMethodInvocation *context, MessageContext *message); static void send_message_got_channel (McdRequest *request, McdChannel *channel, gpointer data, gboolean close_after) { MessageContext *message = data; DEBUG ("received internal request/channel"); /* successful channel creation */ if (channel != NULL) { message->close_after = close_after; DEBUG ("calling send on channel interface"); tp_cli_channel_interface_messages_call_send_message (mcd_channel_get_tp_channel (channel), -1, message->payload, message->flags, send_message_submitted, message, NULL, G_OBJECT (channel)); } else /* doom and despair: no channel */ { if (message->tries++ == 0) { messages_send_message_start (message->dbus_context, message); /* we created a new lock above, we can now release the old one: */ _mcd_request_unblock_account (message->account_path); } else { GError *error = g_error_new_literal (TP_ERROR, TP_ERROR_CANCELLED, "Channel closed by owner"); _mcd_request_unblock_account (message->account_path); message_context_return_error (message, error); _mcd_request_clear_internal_handler (request); g_error_free (error); } } } static void messages_send_message_acl_success (DBusGMethodInvocation *dbus_context, gpointer data) { /* steal the contents of the message context from the ACL framework: * * this avoids a nasty double-free (and means we don't have to dup * * the message payload memory twice) */ messages_send_message_start (dbus_context, message_context_steal (data)); } static void messages_send_message_start (DBusGMethodInvocation *dbus_context, MessageContext *message) { McdAccountManager *am; McdAccount *account; McdChannel *channel = NULL; McdRequest *request = NULL; GError *error = NULL; GHashTable *props = NULL; GValue c_type = G_VALUE_INIT; GValue h_type = G_VALUE_INIT; GValue target = G_VALUE_INIT; McdDispatcher *self = message->dispatcher; DEBUG ("messages_send_message_acl_success [attempt #%u]", message->tries); /* the message request can now take posession of the dbus method context */ message_context_set_return_context (message, dbus_context); if (tp_str_empty (message->account_path)) { g_set_error_literal (&error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Account path not specified"); goto failure; } g_object_get (self->priv->master, "account-manager", &am, NULL); g_assert (am != NULL); account = mcd_account_manager_lookup_account_by_path (am, message->account_path); if (account == NULL) { g_set_error (&error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "No such account: %s", message->account_path); goto failure; } props = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, (GDestroyNotify) g_value_unset); g_value_init (&c_type, G_TYPE_STRING); g_value_init (&h_type, G_TYPE_UINT); g_value_init (&target, G_TYPE_STRING); g_value_set_static_string (&c_type, TP_IFACE_CHANNEL_TYPE_TEXT); g_value_set_uint (&h_type, TP_HANDLE_TYPE_CONTACT); g_value_set_string (&target, message->target_id); g_hash_table_insert (props, TP_PROP_CHANNEL_CHANNEL_TYPE, &c_type); g_hash_table_insert (props, TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, &h_type); g_hash_table_insert (props, TP_PROP_CHANNEL_TARGET_ID, &target); /* compare dispatcher_request_channel: we _are_ the handler for * * this channel so we don't need to check_preferred_handler here * * Also: this deep-copies the props hash, so we can throw ours away */ channel = _mcd_account_create_request (self->priv->clients, account, props, time (NULL), NULL, NULL, TRUE, &request, &error); g_hash_table_unref (props); if (channel == NULL || request == NULL) { g_set_error (&error, TP_ERROR, TP_ERROR_RESOURCE_UNAVAILABLE, "Could not create channel request"); goto failure; } _mcd_request_set_internal_handler (request, send_message_got_channel, message_context_free, message); /* we don't need to predict the handler either, same reason as above * * we do, however, want to call proceed on the request, as it is ours */ _mcd_request_proceed (request, NULL); goto finished; failure: message_context_return_error (message, error); message_context_free (message); g_error_free (error); finished: /* these are reffed and held open by the request infrastructure */ tp_clear_object (&channel); tp_clear_object (&request); } static void messages_send_message_acl_cleanup (gpointer data) { MessageContext *message = data; /* At this point either the messages framework or the ACL framework * * is expected to have handled the DBus return, so we must not try to */ message_context_set_return_context (message, NULL); message_context_free (message); } static void messages_send_message (McSvcChannelDispatcherInterfaceMessagesDraft *iface, const gchar *account_path, const gchar *target_id, const GPtrArray *payload, guint flags, DBusGMethodInvocation *context) { McdDispatcher *self= MCD_DISPATCHER (iface); MessageContext *message = message_context_new (self, account_path, target_id, payload, flags); /* these are for the ACL itself */ GValue *account = g_slice_new0 (GValue); GHashTable *params = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, free_gvalue); g_value_init (account, G_TYPE_STRING); g_value_set_string (account, account_path); g_hash_table_insert (params, "account-path", account); mcp_dbus_acl_authorised_async (self->priv->dbus_daemon, context, DBUS_ACL_TYPE_METHOD, SEND_MESSAGE, params, messages_send_message_acl_success, message, messages_send_message_acl_cleanup); } static void messages_iface_init (gpointer iface, gpointer data G_GNUC_UNUSED) { #define IMPLEMENT(x) \ mc_svc_channel_dispatcher_interface_messages_draft_implement_##x (iface, messages_##x) IMPLEMENT (send_message); #undef IMPLEMENT } typedef struct { McdDispatcher *self; gint64 user_action_time; DBusGMethodInvocation *context; /* List of owned ChannelToDelegate */ GList *channels; /* array of owned channel path */ GPtrArray *delegated; /* owned channel path -> owned GValueArray representing a * TP_STRUCT_TYPE_NOT_DELEGATED_ERROR */ GHashTable *not_delegated; } DelegateChannelsCtx; typedef struct { /* borrowed reference */ DelegateChannelsCtx *ctx; McdAccount *account; McdChannel *channel; /* Queue of reffed McdClientProxy */ GQueue *handlers; GError *error; } ChannelToDelegate; static ChannelToDelegate * channel_to_delegate_new (DelegateChannelsCtx *ctx, McdAccount *account, McdChannel *channel) { ChannelToDelegate *chan = g_slice_new0 (ChannelToDelegate); chan->ctx = ctx; chan->account = g_object_ref (account); chan->channel = g_object_ref (channel); chan->handlers = g_queue_new (); chan->error = NULL; return chan; } static void channel_to_delegate_free (ChannelToDelegate *chan) { g_object_unref (chan->account); g_object_unref (chan->channel); g_queue_foreach (chan->handlers, (GFunc) g_object_unref, NULL); g_queue_free (chan->handlers); tp_clear_pointer (&chan->error, g_error_free); g_slice_free (ChannelToDelegate, chan); } static void free_not_delegated_error (gpointer data) { g_boxed_free (TP_STRUCT_TYPE_NOT_DELEGATED_ERROR, data); } static DelegateChannelsCtx * delegate_channels_ctx_new (McdDispatcher *self, gint64 user_action_time, DBusGMethodInvocation *context) { DelegateChannelsCtx *ctx = g_slice_new0 (DelegateChannelsCtx); ctx->self = g_object_ref (self); ctx->user_action_time = user_action_time; ctx->context = context; ctx->channels = NULL; ctx->delegated = g_ptr_array_new_with_free_func (g_free); ctx->not_delegated = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, free_not_delegated_error); return ctx; } static void delegate_channels_ctx_free (DelegateChannelsCtx *ctx) { g_object_unref (ctx->self); g_ptr_array_unref (ctx->delegated); g_hash_table_unref (ctx->not_delegated); g_list_free_full (ctx->channels, (GDestroyNotify) channel_to_delegate_free); g_slice_free (DelegateChannelsCtx, ctx); } static void try_delegating (ChannelToDelegate *to_delegate); static void delegation_done (ChannelToDelegate *to_delegate) { DelegateChannelsCtx *ctx = to_delegate->ctx; ctx->channels = g_list_remove (ctx->channels, to_delegate); channel_to_delegate_free (to_delegate); if (ctx->channels == NULL) { /* We are done */ tp_svc_channel_dispatcher_return_from_delegate_channels ( ctx->context, ctx->delegated, ctx->not_delegated); delegate_channels_ctx_free (ctx); } } static void delegate_channels_cb (TpClient *client, const GError *error, gpointer user_data G_GNUC_UNUSED, GObject *weak_object) { ChannelToDelegate *to_delegate = user_data; DelegateChannelsCtx *ctx = to_delegate->ctx; McdClientProxy *clt_proxy = MCD_CLIENT_PROXY (client); /* If the delegation succeeded, the channel has a new handler. If * the delegation failed, the channel still has the old * handler. Either way, the channel still has a handler, so it has * been successfully dispatched (from 'handler invoked'). */ _mcd_channel_set_status (to_delegate->channel, MCD_CHANNEL_STATUS_DISPATCHED); if (error != NULL) { DEBUG ("Handler refused delegated channels"); if (to_delegate->error == NULL) to_delegate->error = g_error_copy (error); try_delegating (to_delegate); return; } DEBUG ("Channel %s has been delegated", mcd_channel_get_object_path ( to_delegate->channel)); _mcd_handler_map_set_path_handled (ctx->self->priv->handler_map, mcd_channel_get_object_path (to_delegate->channel), _mcd_client_proxy_get_unique_name (clt_proxy), tp_proxy_get_bus_name (client)); g_ptr_array_add (ctx->delegated, g_strdup ( mcd_channel_get_object_path (to_delegate->channel))); delegation_done (to_delegate); } static void try_delegating (ChannelToDelegate *to_delegate) { McdClientProxy *client; GList *channels = NULL; DEBUG ("%s", mcd_channel_get_object_path (to_delegate->channel)); if (g_queue_get_length (to_delegate->handlers) == 0) { GValueArray *v; const gchar *dbus_error; if (to_delegate->error == NULL) { g_set_error (&to_delegate->error, TP_ERROR, TP_ERROR_NOT_CAPABLE, "There is no other suitable handler"); } if (to_delegate->error->domain == TP_ERROR) dbus_error = tp_error_get_dbus_name (to_delegate->error->code); else dbus_error = TP_ERROR_STR_NOT_AVAILABLE; /* We failed to delegate this channel */ v = tp_value_array_build (2, G_TYPE_STRING, dbus_error, G_TYPE_STRING, to_delegate->error->message, G_TYPE_INVALID); g_hash_table_insert (to_delegate->ctx->not_delegated, g_strdup (mcd_channel_get_object_path (to_delegate->channel)), v); DEBUG ("...but failed to delegate %s: %s", mcd_channel_get_object_path (to_delegate->channel), to_delegate->error->message); delegation_done (to_delegate); return; } client = g_queue_pop_head (to_delegate->handlers); DEBUG ("...trying client %s", _mcd_client_proxy_get_unique_name ( client)); channels = g_list_prepend (channels, to_delegate->channel); _mcd_client_proxy_handle_channels (client, -1, channels, to_delegate->ctx->user_action_time, NULL, delegate_channels_cb, to_delegate, NULL, NULL); g_object_unref (client); g_list_free (channels); } static void add_possible_handlers (McdDispatcher *self, ChannelToDelegate *to_delegate, TpChannel *tp_channel, const gchar *sender, const gchar *preferred_handler) { GStrv possible_handlers; guint i; possible_handlers = mcd_dispatcher_dup_possible_handlers (self, NULL, tp_channel, NULL); for (i = 0; possible_handlers[i] != NULL; i++) { McdClientProxy *client; const gchar *unique_name; client = _mcd_client_registry_lookup (self->priv->clients, possible_handlers[i]); g_return_if_fail (client != NULL); unique_name = _mcd_client_proxy_get_unique_name (client); /* Skip the caller */ if (!tp_strdiff (unique_name, sender)) continue; /* Put the preferred handler at the head of the list so it will be tried * first */ if (!tp_strdiff (possible_handlers[i], preferred_handler)) g_queue_push_head (to_delegate->handlers, g_object_ref (client)); else g_queue_push_tail (to_delegate->handlers, g_object_ref (client)); } g_strfreev (possible_handlers); } static void dispatcher_delegate_channels ( TpSvcChannelDispatcher *iface, const GPtrArray *channels, gint64 user_action_time, const gchar *preferred_handler, DBusGMethodInvocation *context) { McdDispatcher *self = (McdDispatcher *) iface; GError *error = NULL; gchar *sender = NULL; McdConnection *conn = NULL; DelegateChannelsCtx *ctx = NULL; McdAccountManager *am = NULL; guint i; GList *l; DEBUG ("called"); if (!check_preferred_handler (preferred_handler, &error)) goto error; if (channels->len == 0) { g_set_error (&error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Need at least one channel to delegate"); goto error; } ctx = delegate_channels_ctx_new (self, user_action_time, context); sender = dbus_g_method_get_sender (context); g_object_get (self->priv->master, "account-manager", &am, NULL); g_assert (am != NULL); for (i = 0; i < channels->len; i++) { const gchar *chan_path = g_ptr_array_index (channels, i); const gchar *chan_account; const gchar *handler; McdChannel *mcd_channel; TpChannel *tp_channel; McdAccount *account; ChannelToDelegate *to_delegate; chan_account = _mcd_handler_map_get_channel_account ( self->priv->handler_map, chan_path); if (chan_account == NULL) { g_set_error (&error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Unknown channel: %s", chan_path); goto error; } account = mcd_account_manager_lookup_account_by_path (am, chan_account); g_return_if_fail (account != NULL); /* Check the caller is handling the channel */ handler = _mcd_handler_map_get_handler (self->priv->handler_map, chan_path, NULL); if (tp_strdiff (sender, handler)) { g_set_error (&error, TP_ERROR, TP_ERROR_NOT_YOURS, "Your are not handling channel %s", chan_path); goto error; } conn = mcd_account_get_connection (account); g_return_if_fail (conn != NULL); mcd_channel = mcd_connection_find_channel_by_path (conn, chan_path); g_return_if_fail (mcd_channel != NULL); tp_channel = mcd_channel_get_tp_channel (mcd_channel); g_return_if_fail (tp_channel != NULL); to_delegate = channel_to_delegate_new (ctx, account, mcd_channel); add_possible_handlers (self, to_delegate, tp_channel, sender, preferred_handler); ctx->channels = g_list_prepend (ctx->channels, to_delegate); } /* All the channels were ok, we can start delegating */ for (l = ctx->channels; l != NULL; l = g_list_next (l)) { ChannelToDelegate *to_delegate = l->data; try_delegating (to_delegate); } g_free (sender); g_object_unref (am); return; error: g_free (sender); dbus_g_method_return_error (context, error); g_error_free (error); tp_clear_pointer (&ctx, delegate_channels_ctx_free); tp_clear_object (&am); } static void present_handle_channels_cb (TpClient *client, const GError *error, gpointer user_data, GObject *weak_object) { DBusGMethodInvocation *context = user_data; McdChannel *mcd_channel = MCD_CHANNEL (weak_object); /* Whether presenting the channel succeeded or failed, the * channel's handler hasn't been altered, so it must be set back * to the dispatched state (from 'handler invoked'). */ _mcd_channel_set_status (mcd_channel, MCD_CHANNEL_STATUS_DISPATCHED); if (error != NULL) { dbus_g_method_return_error (context, error); return; } tp_svc_channel_dispatcher_return_from_present_channel (context); } static void dispatcher_present_channel ( TpSvcChannelDispatcher *iface, const gchar *channel_path, gint64 user_action_time, DBusGMethodInvocation *context) { McdDispatcher *self = (McdDispatcher *) iface; McdAccountManager *am; const gchar *chan_account; McdAccount *account; McdConnection *conn; McdChannel *mcd_channel; GError *error = NULL; McdClientProxy *client; GList *channels = NULL; chan_account = _mcd_handler_map_get_channel_account ( self->priv->handler_map, channel_path); if (chan_account == NULL) { g_set_error (&error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Unknown channel: %s", channel_path); goto error; } g_object_get (self->priv->master, "account-manager", &am, NULL); g_assert (am != NULL); account = mcd_account_manager_lookup_account_by_path (am, chan_account); g_return_if_fail (account != NULL); g_object_unref (am); conn = mcd_account_get_connection (account); g_return_if_fail (conn != NULL); mcd_channel = mcd_connection_find_channel_by_path (conn, channel_path); g_return_if_fail (mcd_channel != NULL); /* We take mcd_channel's request to base the search for a suitable Handler * on the handler that was preferred by the request that initially created * the Channel, if any. * Actually not, because of fd.o#41031 */ client = _mcd_dispatcher_lookup_handler (self, mcd_channel_get_tp_channel (mcd_channel), _mcd_channel_get_request (mcd_channel)); if (client == NULL) { g_set_error (&error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Channel %s is currently not handled", channel_path); goto error; } channels = g_list_append (channels, mcd_channel); _mcd_client_proxy_handle_channels (client, -1, channels, user_action_time, NULL, present_handle_channels_cb, context, NULL, G_OBJECT (mcd_channel)); g_list_free (channels); return; error: dbus_g_method_return_error (context, error); g_error_free (error); } static void dispatcher_iface_init (gpointer g_iface, gpointer iface_data G_GNUC_UNUSED) { #define IMPLEMENT(x) tp_svc_channel_dispatcher_implement_##x (\ g_iface, dispatcher_##x) IMPLEMENT (create_channel); IMPLEMENT (ensure_channel); IMPLEMENT (create_channel_with_hints); IMPLEMENT (ensure_channel_with_hints); IMPLEMENT (delegate_channels); IMPLEMENT (present_channel); #undef IMPLEMENT } telepathy-mission-control-5.16.4/src/channel-utils.c0000644000175000017500000001040512735241312023516 0ustar00gkiagiagkiagia00000000000000/* vi: set et sw=4 ts=8 cino=t0,(0: */ /* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4; tab-width: 8 -*- */ /* * This file is part of mission-control * * Copyright (C) 2007-2009 Nokia Corporation. * Copyright (C) 2009 Collabora Ltd. * * Contact: Naba Kumar * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * version 2.1 as published by the Free Software Foundation. * * This library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA * */ #include "config.h" #include "channel-utils.h" #include #include #include "mcd-channel.h" #include "mcd-debug.h" gboolean _mcd_tp_channel_should_close (TpChannel *channel, const gchar *verb) { const GError *invalidated; const gchar *object_path; GQuark channel_type; if (channel == NULL) { DEBUG ("Not %s NULL channel", verb); return FALSE; } invalidated = tp_proxy_get_invalidated (channel); object_path = tp_proxy_get_object_path (channel); if (invalidated != NULL) { DEBUG ("Not %s %p:%s, already invalidated: %s %d: %s", verb, channel, object_path, g_quark_to_string (invalidated->domain), invalidated->code, invalidated->message); return FALSE; } channel_type = tp_channel_get_channel_type_id (channel); if (channel_type == TP_IFACE_QUARK_CHANNEL_TYPE_CONTACT_LIST) { DEBUG ("Not %s %p:%s, it's a ContactList", verb, channel, object_path); return FALSE; } if (channel_type == TP_IFACE_QUARK_CHANNEL_TYPE_TUBES) { DEBUG ("Not %s %p:%s, it's an old Tubes channel", verb, channel, object_path); return FALSE; } return TRUE; } static void _channel_details_array_append (GPtrArray *channel_array, TpChannel *channel) { GType type = TP_STRUCT_TYPE_CHANNEL_DETAILS; GValue channel_val = G_VALUE_INIT; GVariant *pair[2]; GVariant *tuple; pair[0] = g_variant_new_object_path (tp_proxy_get_object_path (channel)); pair[1] = tp_channel_dup_immutable_properties (channel); /* takes ownership of floating pair[0] */ tuple = g_variant_new_tuple (pair, 2); dbus_g_value_parse_g_variant (tuple, &channel_val); g_variant_unref (pair[1]); g_variant_unref (tuple); g_assert (G_VALUE_HOLDS (&channel_val, type)); g_ptr_array_add (channel_array, g_value_get_boxed (&channel_val)); } /* * _mcd_tp_channel_details_build_from_list: * @channels: a #GList of #McdChannel elements. * * Returns: a #GPtrArray of Channel_Details, ready to be sent over D-Bus. Free * with _mcd_tp_channel_details_free(). */ GPtrArray * _mcd_tp_channel_details_build_from_list (const GList *channels) { GPtrArray *channel_array; const GList *list; channel_array = g_ptr_array_sized_new (g_list_length ((GList *) channels)); for (list = channels; list != NULL; list = list->next) { _channel_details_array_append (channel_array, mcd_channel_get_tp_channel (MCD_CHANNEL (list->data))); } return channel_array; } /* * _mcd_tp_channel_details_build_from_tp_chan: * @channel: a #TpChannel * * Returns: a #GPtrArray of Channel_Details, ready to be sent over D-Bus. Free * with _mcd_tp_channel_details_free(). */ GPtrArray * _mcd_tp_channel_details_build_from_tp_chan (TpChannel *channel) { GPtrArray *channel_array = g_ptr_array_sized_new (1); _channel_details_array_append (channel_array, channel); return channel_array; } /* * _mcd_tp_channel_details_free: * @channels: a #GPtrArray of Channel_Details. * * Frees the memory used by @channels. */ void _mcd_tp_channel_details_free (GPtrArray *channels) { g_boxed_free (TP_ARRAY_TYPE_CHANNEL_DETAILS_LIST, channels); } telepathy-mission-control-5.16.4/src/mcd-channel-priv.h0000644000175000017500000000542612735242352024120 0ustar00gkiagiagkiagia00000000000000/* vi: set et sw=4 ts=8 cino=t0,(0: */ /* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4; tab-width: 8 -*- */ /* * This file is part of mission-control * * Copyright © 2007-2009 Nokia Corporation. * Copyright © 2009-2010 Collabora Ltd. * * Contact: Naba Kumar * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * version 2.1 as published by the Free Software Foundation. * * This library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA * */ #ifndef MCD_CHANNEL_PRIV_H #define MCD_CHANNEL_PRIV_H #include "client-registry.h" #include "mcd-channel.h" #include "request.h" G_BEGIN_DECLS G_GNUC_INTERNAL gboolean _mcd_channel_create_proxy (McdChannel *channel, TpConnection *connection, const gchar *object_path, const GHashTable *properties); G_GNUC_INTERNAL void _mcd_channel_set_status (McdChannel *channel, McdChannelStatus status); /* not exported: */ G_GNUC_INTERNAL void _mcd_channel_undispatchable (McdChannel *self); G_GNUC_INTERNAL McdRequest *_mcd_channel_get_request (McdChannel *self); G_GNUC_INTERNAL GHashTable *_mcd_channel_get_requested_properties (McdChannel *channel); G_GNUC_INTERNAL GHashTable *_mcd_channel_get_satisfied_requests (McdChannel *channel, gint64 *get_latest_time); G_GNUC_INTERNAL const gchar *_mcd_channel_get_request_preferred_handler (McdChannel *channel); G_GNUC_INTERNAL gboolean _mcd_channel_get_request_use_existing (McdChannel *channel); G_GNUC_INTERNAL void _mcd_channel_request_proceed (McdChannel *self, DBusGMethodInvocation *context); G_GNUC_INTERNAL void _mcd_channel_copy_details (McdChannel *channel, McdChannel *source); G_GNUC_INTERNAL void _mcd_channel_set_request_proxy (McdChannel *channel, McdChannel *source); void _mcd_channel_close (McdChannel *channel); G_GNUC_INTERNAL void _mcd_channel_depart (McdChannel *channel, TpChannelGroupChangeReason reason, const gchar *message); G_GNUC_INTERNAL gboolean _mcd_channel_is_primary_for_path (McdChannel *self, const gchar *channel_path); G_GNUC_INTERNAL McdChannel *_mcd_channel_new_request (McdRequest *request); G_END_DECLS #endif telepathy-mission-control-5.16.4/src/mcd-connection.h0000644000175000017500000000562112735241312023661 0ustar00gkiagiagkiagia00000000000000/* vi: set et sw=4 ts=8 cino=t0,(0: */ /* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4; tab-width: 8 -*- */ /* * This file is part of mission-control * * Copyright (C) 2007-2009 Nokia Corporation. * * Contact: Naba Kumar * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * version 2.1 as published by the Free Software Foundation. * * This library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA * */ #ifndef __MCD_CONNECTION_H__ #define __MCD_CONNECTION_H__ #include #include #include #include "connectivity-monitor.h" /* for McdInhibit */ #include "mcd-operation.h" G_BEGIN_DECLS #define MCD_TYPE_CONNECTION (mcd_connection_get_type()) #define MCD_CONNECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MCD_TYPE_CONNECTION, McdConnection)) #define MCD_CONNECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MCD_TYPE_CONNECTION, McdConnectionClass)) #define MCD_IS_CONNECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MCD_TYPE_CONNECTION)) #define MCD_IS_CONNECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MCD_TYPE_CONNECTION)) #define MCD_CONNECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MCD_TYPE_CONNECTION, McdConnectionClass)) typedef struct _McdConnection McdConnection; typedef struct _McdConnectionPrivate McdConnectionPrivate; typedef struct _McdConnectionClass McdConnectionClass; #include "mcd-channel.h" struct _McdConnection { McdOperation parent; McdConnectionPrivate *priv; }; struct _McdConnectionClass { McdOperationClass parent_class; }; #include "mcd-dispatcher.h" GType mcd_connection_get_type (void); const gchar *mcd_connection_get_object_path (McdConnection *connection); const gchar *mcd_connection_get_name (McdConnection *connection); /* Return the connection's account */ McdAccount *mcd_connection_get_account (McdConnection * connection); TpConnection *mcd_connection_get_tp_connection (McdConnection *connection); gboolean mcd_connection_request_channel (McdConnection *connection, McdChannel *channel); void mcd_connection_close (McdConnection *connection, McdInhibit *inhibit); McdChannel * mcd_connection_find_channel_by_path (McdConnection *connection, const gchar *object_path); void mcd_connection_add_emergency_handle (McdConnection *self, TpHandle handle); G_END_DECLS #endif /* __MCD_CONNECTION_H__ */ telepathy-mission-control-5.16.4/src/plugin-loader.h0000644000175000017500000000203212735241312023514 0ustar00gkiagiagkiagia00000000000000/* Loader for plugins that use mission-control-plugins * * Copyright (C) 2009 Nokia Corporation * Copyright (C) 2009 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA * */ #ifndef MCD_PLUGIN_LOADER_H_ #define MCD_PLUGIN_LOADER_H_ #include G_BEGIN_DECLS G_GNUC_INTERNAL void _mcd_plugin_loader_init (void); G_END_DECLS #endif telepathy-mission-control-5.16.4/src/mcd-dispatcher-priv.h0000644000175000017500000000367112735241312024631 0ustar00gkiagiagkiagia00000000000000/* vi: set et sw=4 ts=8 cino=t0,(0: */ /* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4; tab-width: 8 -*- */ /* * This file is part of mission-control * * Copyright (C) 2007-2009 Nokia Corporation. * Copyright (C) 2009 Collabora Ltd. * * Contact: Naba Kumar * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * version 2.1 as published by the Free Software Foundation. * * This library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA * */ #ifndef MCD_DISPATCHER_PRIV_H #define MCD_DISPATCHER_PRIV_H #include "mcd-dispatcher.h" #include "mcd-connection.h" #include "client-registry.h" G_BEGIN_DECLS /* not exported */ G_GNUC_INTERNAL void _mcd_dispatcher_add_channel ( McdDispatcher *dispatcher, McdChannel *channel, gboolean requested, gboolean only_observe); G_GNUC_INTERNAL void _mcd_dispatcher_add_channel_request (McdDispatcher *dispatcher, McdChannel *channel, McdChannel *request); G_GNUC_INTERNAL void _mcd_dispatcher_recover_channel (McdDispatcher *dispatcher, McdChannel *channel, const gchar *account_path); G_GNUC_INTERNAL void _mcd_dispatcher_add_connection (McdDispatcher *self, McdConnection *connection); G_GNUC_INTERNAL GPtrArray *_mcd_dispatcher_dup_client_caps ( McdDispatcher *self); G_END_DECLS #endif /* MCD_DISPATCHER_H */ telepathy-mission-control-5.16.4/src/Makefile.am0000644000175000017500000002354512735242352022656 0ustar00gkiagiagkiagia00000000000000INCLUDES = \ $(TELEPATHY_CFLAGS) \ $(DBUS_CFLAGS) \ $(GLIB_CFLAGS) \ $(NETWORK_MANAGER_CFLAGS) \ $(CONNMAN_CFLAGS) \ $(UPOWER_GLIB_CFLAGS) \ -DG_LOG_DOMAIN=\"mcd\" \ -DMCD_PLUGIN_LOADER_DIR=\"@libdir@/mission-control-plugins.@MCP_ABI_VERSION@\" \ -DMC_DISABLE_DEPRECATED -I$(top_srcdir) AM_CFLAGS = $(ERROR_CFLAGS) mc_headers = \ mcd-account.h \ mcd-account-conditions.h \ mcd-account-manager.h \ mcd-account-manager-default.h \ mcd-debug.h \ mcd-mission.h \ mcd-operation.h \ mcd-master.h \ mcd-manager.h \ mcd-connection.h \ mcd-connection-service-points.h \ mcd-channel.h \ mcd-dispatcher.h \ mcd-service.h \ mcd-storage.h if ENABLE_LIBACCOUNTS_SSO mc_headers += \ mcd-account-manager-sso.h \ $(NULL) if ENABLE_LIBACCOUNTS_GLIB_HIDDEN mc_headers += \ mcd-storage-ag-hidden.h \ $(NULL) endif endif mc_gen_headers = \ _gen/cli-Connection_Manager_Interface_Account_Storage.h \ _gen/enums.h \ _gen/gtypes.h \ _gen/interfaces.h \ _gen/svc-Account_Interface_Conditions.h \ _gen/svc-Account_Interface_External_Password_Storage.h \ _gen/svc-Account_Interface_Hidden.h \ _gen/svc-Account_Manager_Interface_Hidden.h \ _gen/svc-dispatcher.h nodist_libmcd_convenience_la_SOURCES = \ _gen/cli-Connection_Manager_Interface_Account_Storage-body.h \ _gen/gtypes-body.h \ _gen/interfaces-body.h \ _gen/register-dbus-glib-marshallers-body.h \ _gen/signals-marshal.c \ _gen/signals-marshal.h \ _gen/signals-marshal.list \ _gen/svc-Account_Interface_Conditions.c \ _gen/svc-Account_Interface_External_Password_Storage.c \ _gen/svc-Account_Interface_Hidden.c \ _gen/svc-Account_Manager_Interface_Hidden.c \ _gen/svc-dispatcher.c \ mcd-enum-types.c \ mcd-enum-types.h \ $(mc_gen_headers) BUILT_SOURCES = \ _gen/mcd.xml \ stamp-mcd-enum-types.h \ $(nodist_libmcd_convenience_la_SOURCES) CLEANFILES = \ $(BUILT_SOURCES) \ _gen/cli-Connection_Manager_Interface_Account_Storage-gtk-doc.h \ _gen/svc-dispatcher-gtk-doc.h \ _gen/svc-Account_Interface_Hidden-gtk-doc.h \ _gen/svc-Account_Interface_External_Password_Storage-gtk-doc.h \ _gen/svc-Account_Interface_Conditions-gtk-doc.h \ _gen/svc-Account_Manager_Interface_Hidden-gtk-doc.h \ _gen/gtypes-gtk-doc.h \ $(NULL) libmcd_convenience_la_LIBADD = \ $(top_builddir)/mission-control-plugins/libmission-control-plugins.la \ $(TELEPATHY_LIBS) \ $(DBUS_LIBS) \ $(GLIB_LIBS) \ $(NETWORK_MANAGER_LIBS) \ $(CONNMAN_LIBS) \ $(UPOWER_GLIB_LIBS) \ $(NULL) if ENABLE_LIBACCOUNTS_SSO libmcd_convenience_la_LIBADD += $(LIBACCOUNTS_SSO_LIBS) INCLUDES += $(LIBACCOUNTS_SSO_CFLAGS) endif if ENABLE_AEGIS libmcd_convenience_la_LIBADD += $(top_builddir)/plugins/libmcp-aegis.la endif noinst_LTLIBRARIES = libmcd-convenience.la libmcd_convenience_la_SOURCES = \ mcd-account.c \ mcd-account-addressing.h \ mcd-account-conditions.c \ mcd-account-config.h \ mcd-account-connection.c \ mcd-account-requests.c \ mcd-account-addressing.c \ mcd-account-manager.c \ mcd-account-manager-priv.h \ mcd-account-manager-default.c \ mcd-account-priv.h \ mcd-client.c \ mcd-client-priv.h \ channel-utils.c \ channel-utils.h \ client-registry.c \ client-registry.h \ connectivity-monitor.c \ connectivity-monitor.h \ gtypes.c \ mcd-dbusprop.c \ mcd-dbusprop.h \ mcd-debug.c \ mcd-dispatch-operation.c \ mcd-dispatch-operation-priv.h \ mcd-handler-map.c \ mcd-handler-map-priv.h \ mcd-misc.c \ mcd-misc.h \ mcd-mission.c \ mcd-mission-priv.h \ mcd-operation.c \ mcd-master.c \ mcd-master-priv.h \ mcd-manager.c \ mcd-manager-priv.h \ mcd-connection.c \ mcd-connection-service-points.c \ mcd-connection-priv.h \ mcd-dispatcher.c \ mcd-dispatcher-priv.h \ mcd-channel.c \ mcd-channel-priv.h \ mcd-service.c \ mcd-slacker.c \ mcd-slacker.h \ mcd-storage.c \ mcd-storage.h \ plugin-dispatch-operation.c \ plugin-dispatch-operation.h \ plugin-loader.c \ plugin-loader.h \ plugin-request.c \ plugin-request.h \ request.c \ request.h \ sp_timestamp.h \ $(mc_headers) if ENABLE_LIBACCOUNTS_SSO libmcd_convenience_la_SOURCES += \ mcd-account-manager-sso.c \ $(NULL) if ENABLE_LIBACCOUNTS_GLIB_HIDDEN libmcd_convenience_la_SOURCES += \ mcd-storage-ag-hidden.c \ $(NULL) endif endif mcd-enum-types.h: stamp-mcd-enum-types.h $(AM_V_GEN)true stamp-mcd-enum-types.h: Makefile $(mc_headers) mcd-enum-types.c $(AM_V_GEN)( cd $(srcdir) && glib-mkenums \ --fhead "#ifndef __MCD_ENUM_TYPES_H__\n#define __MCD_ENUM_TYPES_H__\n\n#include \"mcd-mission.h\"\n#include \"mcd-channel.h\"\n\nG_BEGIN_DECLS\n" \ --fprod "/* enumerations from \"@filename@\" */\n" \ --vhead "GType @enum_name@_get_type (void) G_GNUC_CONST;\n#define MCD_TYPE_@ENUMSHORT@ (@enum_name@_get_type())\n" \ --ftail "G_END_DECLS\n\n#endif /* __MCD_ENUM_TYPES_H__ */" \ $(mc_headers) ) >> xgen-geth \ && (cmp -s xgen-geth mcd-enum-types.h || cp xgen-geth mcd-enum-types.h ) \ && rm -f xgen-geth \ && echo timestamp > $(@F) mcd-enum-types.c: Makefile $(mc_headers) $(AM_V_GEN)( cd $(srcdir) && glib-mkenums \ --fhead "#include \"mcd-enum-types.h\"\n#define g_intern_static_string(s) (s)\n" \ --fprod "\n/* enumerations from \"@filename@\" */" \ --ftail "\n#define __MCD_ENUM_TYPES_C__\n" \ --vhead "GType\n@enum_name@_get_type (void)\n{\n static GType etype = 0;\n if (etype == 0) {\n static const G@Type@Value values[] = {" \ --vprod " { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \ --vtail " { 0, NULL, NULL }\n };\n etype = g_@type@_register_static (g_intern_static_string (\"@EnumName@\"), values);\n }\n return etype;\n}\n" \ $(mc_headers) ) > xgen-getc \ && cp xgen-getc mcd-enum-types.c \ && rm -f xgen-getc EXTRA_DIST = \ mcd.xml \ dispatcher.xml \ stamp-mcd-enum-types.h Android.mk: Makefile.am $(nodist_libmcd_convenience_la_SOURCES) androgenizer -:PROJECT telepathy-mission-control \ -:STATIC libmcd-convenience \ -:TAGS eng debug \ -:REL_TOP $(top_srcdir) -:ABS_TOP $(abs_top_srcdir) \ -:SOURCES $(libmcd_convenience_la_SOURCES) $(nodist_libmcd_convenience_la_SOURCES) \ -:CFLAGS $(DEFAULT_INCLUDES) $(INCLUDES) $(DEFS) $(CFLAGS) $(AM_CFLAGS) \ -:CPPFLAGS $(CPPFLAGS) $(AM_CPPFLAGS) \ -:LDFLAGS $(libmcd_convenience_la_LIBADD) \ > $@ # ---- telepathy-glib-style code generation ---- tools_dir = $(top_srcdir)/tools _gen/mcd.xml: mcd.xml $(wildcard $(top_srcdir)/xml/*.xml) $(AM_V_at)$(mkdir_p) _gen $(AM_V_GEN)$(XSLTPROC) $(XSLTPROCFLAGS) --xinclude $(tools_dir)/identity.xsl \ $< > $@ _gen/%.xml: $(top_srcdir)/xml/%.xml $(wildcard $(top_srcdir)/xml/*.xml) $(AM_V_at)$(mkdir_p) _gen $(AM_V_GEN)$(XSLTPROC) $(XSLTPROCFLAGS) --xinclude $(tools_dir)/identity.xsl \ $< > $@ # Generated files which can be done for all "classes" at once _gen/signals-marshal.list: _gen/mcd.xml \ $(tools_dir)/glib-signals-marshal-gen.py $(AM_V_GEN)$(PYTHON) $(tools_dir)/glib-signals-marshal-gen.py $< > $@ _gen/signals-marshal.h: _gen/signals-marshal.list Makefile.am $(AM_V_GEN)$(GLIB_GENMARSHAL) --header --prefix=_mcd_ext_marshal $< > $@ _gen/signals-marshal.c: _gen/signals-marshal.list Makefile.am $(AM_V_GEN){ echo '#include "_gen/signals-marshal.h"' && \ $(GLIB_GENMARSHAL) --body --prefix=_mcd_ext_marshal $<; } \ > $@ _gen/register-dbus-glib-marshallers-body.h: _gen/mcd.xml \ $(tools_dir)/glib-client-marshaller-gen.py Makefile.am $(AM_V_GEN)$(PYTHON) $(tools_dir)/glib-client-marshaller-gen.py $< \ _mcd_ext > $@ _gen/enums.h: _gen/mcd.xml $(tools_dir)/c-constants-generator.xsl $(AM_V_GEN)$(XSLTPROC) $(XSLTPROCFLAGS) \ --stringparam mixed-case-prefix mc \ $(tools_dir)/c-constants-generator.xsl \ $< > $@ _gen/interfaces.h: _gen/mcd.xml \ $(tools_dir)/glib-interfaces-generator.xsl \ $(tools_dir)/c-interfaces-generator.xsl $(AM_V_GEN)$(XSLTPROC) $(XSLTPROCFLAGS) \ --stringparam mixed-case-prefix mc \ $(tools_dir)/glib-interfaces-generator.xsl \ $< > $@ _gen/interfaces-body.h: _gen/mcd.xml \ $(tools_dir)/glib-interfaces-body-generator.xsl \ $(tools_dir)/c-interfaces-generator.xsl $(AM_V_GEN)$(XSLTPROC) $(XSLTPROCFLAGS) \ --stringparam mixed-case-prefix mc \ $(tools_dir)/glib-interfaces-body-generator.xsl \ $< > $@ _gen/gtypes.h: _gen/gtypes-gtk-doc.h @: # generated as a side-effect _gen/gtypes-body.h: _gen/gtypes-gtk-doc.h @: # generated as a side-effect _gen/gtypes-gtk-doc.h: _gen/mcd.xml \ $(top_srcdir)/tools/glib-gtypes-generator.py $(AM_V_GEN)$(PYTHON) $(top_srcdir)/tools/glib-gtypes-generator.py \ $< _gen/gtypes mc # Generated files which must be generated per "class". # (Currently the only "class" is nmc4, but the new API will need "classes" # like account, account-manager, ...) _gen/%.xml: $(top_srcdir)/xml/%.xml $(wildcard $(top_srcdir)/xml/*.xml) Makefile.am $(AM_V_at)$(mkdir_p) _gen $(AM_V_GEN)$(XSLTPROC) $(XSLTPROCFLAGS) --xinclude $(tools_dir)/identity.xsl \ $< > $@ _gen/%.xml: %.xml $(wildcard $(top_srcdir)/xml/*.xml) Makefile.am $(AM_V_at)$(mkdir_p) _gen $(AM_V_GEN)$(XSLTPROC) $(XSLTPROCFLAGS) --xinclude $(tools_dir)/identity.xsl \ $< > $@ _gen/cli-%-body.h: _gen/cli-%-gtk-doc.h @: # generated as a side-effect _gen/cli-%.h: _gen/cli-%-gtk-doc.h @: # generated as a side-effect _gen/cli-%-gtk-doc.h: _gen/%.xml \ $(tools_dir)/glib-client-gen.py Makefile.am $(AM_V_GEN)$(PYTHON) $(tools_dir)/glib-client-gen.py \ --group=`echo $* | tr x- x_` \ --iface-quark-prefix=MC_IFACE_QUARK \ --tp-proxy-api=0.7.6 \ $< Mc_Cli _gen/cli-$* _gen/svc-%.c: _gen/svc-%-gtk-doc.h @: # generated as a side-effect _gen/svc-%.h: _gen/svc-%-gtk-doc.h @: # generated as a side-effect _gen/svc-%-gtk-doc.h: _gen/%.xml \ $(tools_dir)/glib-ginterface-gen.py Makefile.am $(AM_V_GEN)$(PYTHON) $(tools_dir)/glib-ginterface-gen.py \ --filename=_gen/svc-$* \ --signal-marshal-prefix=_mcd_ext \ --include='' \ --include='"_gen/signals-marshal.h"' \ --not-implemented-func='tp_dbus_g_method_return_not_implemented' \ --allow-unstable \ $< Mc_Svc_ include ../tools/header-checks.am check-local: header-decl-macro-check telepathy-mission-control-5.16.4/src/mcd-account-priv.h0000644000175000017500000001711612735242352024143 0ustar00gkiagiagkiagia00000000000000/* vi: set et sw=4 ts=8 cino=t0,(0: */ /* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4; tab-width: 8 -*- */ /* * This file is part of mission-control * * Copyright (C) 2007-2009 Nokia Corporation. * Copyright (C) 2009 Collabora Ltd. * * Contact: Naba Kumar * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * version 2.1 as published by the Free Software Foundation. * * This library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA * */ #ifndef __MCD_ACCOUNT_PRIV_H__ #define __MCD_ACCOUNT_PRIV_H__ #include "mcd-account.h" #include "mcd-account-config.h" #include "mcd-channel.h" #include "mcd-dbusprop.h" #include "request.h" #include /* auto-generated stubs */ #include "_gen/svc-Account_Interface_Conditions.h" #include "_gen/svc-Account_Interface_External_Password_Storage.h" #include "_gen/svc-Account_Interface_Hidden.h" #include "_gen/cli-Connection_Manager_Interface_Account_Storage.h" G_GNUC_INTERNAL void _mcd_account_maybe_autoconnect (McdAccount *account); G_GNUC_INTERNAL void _mcd_account_connect (McdAccount *account, GHashTable *params); typedef void (McdAccountSetParametersCb) (McdAccount *account, GPtrArray *not_yet, const GError *error, gpointer user_data); G_GNUC_INTERNAL void _mcd_account_set_parameters (McdAccount *account, GHashTable *params, const gchar **unset, McdAccountSetParametersCb callback, gpointer user_data); G_GNUC_INTERNAL void _mcd_account_request_temporary_presence (McdAccount *self, TpConnectionPresenceType type, const gchar *status); G_GNUC_INTERNAL GKeyFile *_mcd_account_get_keyfile (McdAccount *account); G_GNUC_INTERNAL void _mcd_account_set_has_been_online (McdAccount *account); G_GNUC_INTERNAL void _mcd_account_set_normalized_name (McdAccount *account, const gchar *name); G_GNUC_INTERNAL gboolean _mcd_account_set_avatar (McdAccount *account, const GArray *avatar, const gchar *mime_type, const gchar *token, GError **error); G_GNUC_INTERNAL void _mcd_account_get_avatar (McdAccount *account, GArray **avatar, gchar **mime_type); G_GNUC_INTERNAL void _mcd_account_set_avatar_token (McdAccount *account, const gchar *token); G_GNUC_INTERNAL gchar *_mcd_account_get_avatar_token (McdAccount *account); G_GNUC_INTERNAL void _mcd_account_set_alias (McdAccount *account, const gchar *alias); G_GNUC_INTERNAL GPtrArray *_mcd_account_get_supersedes (McdAccount *self); G_GNUC_INTERNAL void _mcd_account_tp_connection_changed (McdAccount *account, TpConnection *tp_conn); G_GNUC_INTERNAL void _mcd_account_load (McdAccount *account, McdAccountLoadCb callback, gpointer user_data); G_GNUC_INTERNAL void _mcd_account_set_connection (McdAccount *account, McdConnection *connection); G_GNUC_INTERNAL void _mcd_account_set_connection_status (McdAccount *account, TpConnectionStatus status, TpConnectionStatusReason reason, TpConnection *tp_conn, const gchar *dbus_error, const GHashTable *details); typedef void (*McdOnlineRequestCb) (McdAccount *account, gpointer userdata, const GError *error); void _mcd_account_online_request (McdAccount *account, McdOnlineRequestCb callback, gpointer userdata); void _mcd_account_connect_with_auto_presence (McdAccount *account, gboolean user_initiated); G_GNUC_INTERNAL McdStorage *_mcd_account_get_storage (McdAccount *account); static inline void _mcd_account_write_conf (McdAccount *account) { McdStorage *storage = _mcd_account_get_storage (account); g_return_if_fail (MCD_IS_STORAGE (storage)); mcd_storage_commit (storage, mcd_account_get_unique_name (account)); } G_GNUC_INTERNAL void _mcd_account_connection_begin (McdAccount *account, gboolean user_initiated); extern const McdDBusProp account_channelrequests_properties[]; G_GNUC_INTERNAL McdChannel *_mcd_account_create_request ( McdClientRegistry *clients, McdAccount *account, GHashTable *properties, gint64 user_action_time, const gchar *preferred_handler, GHashTable *request_metadata, gboolean use_existing, McdRequest **request_out, GError **error); typedef struct _McdAccountConnectionContext McdAccountConnectionContext; G_GNUC_INTERNAL McdAccountConnectionContext *_mcd_account_get_connection_context (McdAccount *self); G_GNUC_INTERNAL void _mcd_account_set_connection_context (McdAccount *self, McdAccountConnectionContext *c); G_GNUC_INTERNAL void _mcd_account_connection_context_free (McdAccountConnectionContext *c); typedef void (*McdAccountDupParametersCb) (McdAccount *account, GHashTable *params, gpointer user_data); G_GNUC_INTERNAL G_GNUC_WARN_UNUSED_RESULT GHashTable *_mcd_account_dup_parameters (McdAccount *account); extern const McdDBusProp account_conditions_properties[]; void account_conditions_iface_init (McSvcAccountInterfaceConditionsClass *iface, gpointer iface_data); G_GNUC_INTERNAL gboolean _mcd_account_check_request_real (McdAccount *account, GHashTable *request, GError **error); G_GNUC_INTERNAL gboolean _mcd_account_get_always_on (McdAccount *self); G_GNUC_INTERNAL void _mcd_account_set_changing_presence (McdAccount *self, gboolean value); G_GNUC_INTERNAL gboolean _mcd_account_set_enabled (McdAccount *account, gboolean enabled, gboolean write_out, McdDBusPropSetFlags flags, GError **error); G_GNUC_INTERNAL gboolean _mcd_account_presence_type_is_settable ( TpConnectionPresenceType type); gboolean _mcd_account_is_hidden (McdAccount *account); G_GNUC_INTERNAL gboolean _mcd_account_needs_dispatch (McdAccount *account); G_GNUC_INTERNAL void _mcd_account_reconnect (McdAccount *self, gboolean user_initiated); #endif /* __MCD_ACCOUNT_PRIV_H__ */ telepathy-mission-control-5.16.4/src/mcd-handler-map.c0000644000175000017500000003760712735241312023716 0ustar00gkiagiagkiagia00000000000000/* vi: set et sw=4 ts=8 cino=t0,(0: */ /* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4; tab-width: 8 -*- */ /* * Keep track of which handlers own which channels. * * Copyright (C) 2009 Nokia Corporation * Copyright (C) 2009 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA * */ #include "config.h" #include "mcd-handler-map-priv.h" #include #include "channel-utils.h" #include "mcd-channel-priv.h" G_DEFINE_TYPE (McdHandlerMap, _mcd_handler_map, G_TYPE_OBJECT); struct _McdHandlerMapPrivate { TpDBusDaemon *dbus_daemon; /* The handler for each channel currently being handled * owned gchar *object_path => owned gchar *unique_name */ GHashTable *channel_processes; /* The well-known bus name we invoked in channel_processes[path] * owned gchar *object_path => owned gchar *well_known_name */ GHashTable *channel_clients; /* owned gchar *unique_name => malloc'd gsize, number of channels */ GHashTable *handler_processes; /* owned gchar *object_path => ref'd TpChannel */ GHashTable *handled_channels; /* owned gchar *object_path => owned gchar *account_path */ GHashTable *channel_accounts; }; enum { PROP_0, PROP_DBUS_DAEMON }; static void slice_free_gsize (gpointer p) { g_slice_free (gsize, p); } static void _mcd_handler_map_init (McdHandlerMap *self) { self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, MCD_TYPE_HANDLER_MAP, McdHandlerMapPrivate); self->priv->channel_processes = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free); self->priv->channel_clients = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free); self->priv->handler_processes = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, slice_free_gsize); self->priv->handled_channels = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_object_unref); self->priv->channel_accounts = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free); } static void _mcd_handler_map_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) { McdHandlerMap *self = MCD_HANDLER_MAP (object); switch (prop_id) { case PROP_DBUS_DAEMON: g_value_set_object (value, self->priv->dbus_daemon); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); } } static void _mcd_handler_map_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) { McdHandlerMap *self = MCD_HANDLER_MAP (object); switch (prop_id) { case PROP_DBUS_DAEMON: g_assert (self->priv->dbus_daemon == NULL); /* construct-only */ self->priv->dbus_daemon = TP_DBUS_DAEMON (g_value_dup_object (value)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); } } static void mcd_handler_map_name_owner_cb (TpDBusDaemon *dbus_daemon, const gchar *name, const gchar *new_owner, gpointer user_data); static void _mcd_handler_map_dispose (GObject *object) { McdHandlerMap *self = MCD_HANDLER_MAP (object); tp_clear_pointer (&self->priv->handled_channels, g_hash_table_unref); if (self->priv->handler_processes != NULL) { GHashTableIter iter; gpointer k; g_assert (self->priv->dbus_daemon != NULL); g_hash_table_iter_init (&iter, self->priv->handler_processes); while (g_hash_table_iter_next (&iter, &k, NULL)) { tp_dbus_daemon_cancel_name_owner_watch (self->priv->dbus_daemon, k, mcd_handler_map_name_owner_cb, object); } } tp_clear_pointer (&self->priv->handler_processes, g_hash_table_unref); tp_clear_object (&self->priv->dbus_daemon); G_OBJECT_CLASS (_mcd_handler_map_parent_class)->dispose (object); } static void _mcd_handler_map_finalize (GObject *object) { McdHandlerMap *self = MCD_HANDLER_MAP (object); tp_clear_pointer (&self->priv->channel_processes, g_hash_table_unref); tp_clear_pointer (&self->priv->channel_clients, g_hash_table_unref); tp_clear_pointer (&self->priv->channel_accounts, g_hash_table_unref); G_OBJECT_CLASS (_mcd_handler_map_parent_class)->finalize (object); } static void _mcd_handler_map_class_init (McdHandlerMapClass *klass) { GObjectClass *object_class = (GObjectClass *) klass; g_type_class_add_private (object_class, sizeof (McdHandlerMapPrivate)); object_class->dispose = _mcd_handler_map_dispose; object_class->get_property = _mcd_handler_map_get_property; object_class->set_property = _mcd_handler_map_set_property; object_class->finalize = _mcd_handler_map_finalize; g_object_class_install_property (object_class, PROP_DBUS_DAEMON, g_param_spec_object ("dbus-daemon", "D-Bus daemon", "D-Bus daemon", TP_TYPE_DBUS_DAEMON, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS)); } McdHandlerMap * _mcd_handler_map_new (TpDBusDaemon *dbus_daemon) { return g_object_new (MCD_TYPE_HANDLER_MAP, "dbus-daemon", dbus_daemon, NULL); } /* * @well_known_name: (out): the well-known Client name of the handler, * or %NULL if not known (or if it's Mission Control itself) * * Returns: (transfer none): the unique name of the handler */ const gchar * _mcd_handler_map_get_handler (McdHandlerMap *self, const gchar *channel_path, const gchar **well_known_name) { if (well_known_name != NULL) *well_known_name = g_hash_table_lookup (self->priv->channel_clients, channel_path); return g_hash_table_lookup (self->priv->channel_processes, channel_path); } /* * @channel_path: a channel * @unique_name: the unique name of the handler * @well_known_name: the well-known name of the handler, or %NULL if not known * (or if it's Mission Control itself) * * Record that @channel_path is being handled by the Client * @well_known_name, whose unique name is @unique_name. * * Returns: (transfer none): the unique name of the handler */ void _mcd_handler_map_set_path_handled (McdHandlerMap *self, const gchar *channel_path, const gchar *unique_name, const gchar *well_known_name) { const gchar *old; gsize *counter; /* In case we want to re-invoke the same client later, remember its * well-known name, if we know it. (In edge cases where we're recovering * from an MC crash, we can only guess, so we get NULL.) */ if (well_known_name == NULL) g_hash_table_remove (self->priv->channel_clients, channel_path); else g_hash_table_insert (self->priv->channel_clients, g_strdup (channel_path), g_strdup (well_known_name)); old = g_hash_table_lookup (self->priv->channel_processes, channel_path); if (!tp_strdiff (old, unique_name)) { /* no-op - the new handler is the same as the old */ return; } if (old != NULL) { counter = g_hash_table_lookup (self->priv->handler_processes, old); if (--*counter == 0) { tp_dbus_daemon_cancel_name_owner_watch (self->priv->dbus_daemon, old, mcd_handler_map_name_owner_cb, self); g_hash_table_remove (self->priv->handler_processes, old); } } g_hash_table_insert (self->priv->channel_processes, g_strdup (channel_path), g_strdup (unique_name)); counter = g_hash_table_lookup (self->priv->handler_processes, unique_name); if (counter == NULL) { counter = g_slice_new (gsize); *counter = 1; g_hash_table_insert (self->priv->handler_processes, g_strdup (unique_name), counter); tp_dbus_daemon_watch_name_owner (self->priv->dbus_daemon, unique_name, mcd_handler_map_name_owner_cb, self, NULL); } else { ++*counter; } } static void handled_channel_invalidated_cb (TpChannel *channel, guint domain, gint code, const gchar *message, gpointer user_data) { McdHandlerMap *self = MCD_HANDLER_MAP (user_data); const gchar *path = tp_proxy_get_object_path (channel); gchar *handler; g_signal_handlers_disconnect_by_func (channel, handled_channel_invalidated_cb, user_data); handler = g_hash_table_lookup (self->priv->channel_processes, path); if (handler != NULL) { gsize *counter = g_hash_table_lookup (self->priv->handler_processes, handler); g_assert (counter != NULL); if (--*counter == 0) { g_hash_table_remove (self->priv->handler_processes, handler); } g_hash_table_remove (self->priv->channel_processes, path); } g_hash_table_remove (self->priv->handled_channels, path); g_hash_table_remove (self->priv->channel_accounts, path); g_object_unref (self); } /* * @channel: a channel * @unique_name: the unique name of the handler * @well_known_name: the well-known name of the handler, or %NULL if not known * (or if it's Mission Control itself) * @account_path: the account that @channel came from, or %NULL if not known * * Record that @channel_path is being handled by the Client * @well_known_name, whose unique name is @unique_name. * The record will be removed if the channel closes or is invalidated. * * Returns: (transfer none): the unique name of the handler */ void _mcd_handler_map_set_channel_handled (McdHandlerMap *self, TpChannel *channel, const gchar *unique_name, const gchar *well_known_name, const gchar *account_path) { const gchar *path = tp_proxy_get_object_path (channel); g_hash_table_insert (self->priv->handled_channels, g_strdup (path), g_object_ref (channel)); g_hash_table_insert (self->priv->channel_accounts, g_strdup (path), g_strdup (account_path)); g_signal_connect (channel, "invalidated", G_CALLBACK (handled_channel_invalidated_cb), g_object_ref (self)); _mcd_handler_map_set_path_handled (self, path, unique_name, well_known_name); } static void _mcd_handler_map_set_handler_crashed (McdHandlerMap *self, const gchar *unique_name) { gsize *counter = g_hash_table_lookup (self->priv->handler_processes, unique_name); if (counter != NULL) { GHashTableIter iter; gpointer path_p, name_p; GList *paths = NULL; tp_dbus_daemon_cancel_name_owner_watch (self->priv->dbus_daemon, unique_name, mcd_handler_map_name_owner_cb, self); g_hash_table_remove (self->priv->handler_processes, unique_name); /* This is O(number of channels being handled) but then again * it only happens if a handler crashes */ g_hash_table_iter_init (&iter, self->priv->channel_processes); while (g_hash_table_iter_next (&iter, &path_p, &name_p)) { if (!tp_strdiff (name_p, unique_name)) { DEBUG ("%s lost its handler %s", (const gchar *) path_p, (const gchar *) name_p); paths = g_list_prepend (paths, g_strdup (path_p)); g_hash_table_iter_remove (&iter); } } while (paths != NULL) { gchar *path = paths->data; TpChannel *channel = g_hash_table_lookup ( self->priv->handled_channels, path); /* this is NULL-safe */ if (_mcd_tp_channel_should_close (channel, "closing")) { DEBUG ("Closing channel %s", path); /* the corresponding McdChannel will get aborted when the * Channel actually closes */ tp_cli_channel_call_close (channel, -1, NULL, NULL, NULL, NULL); } paths = g_list_delete_link (paths, paths); g_free (path); } } } static void mcd_handler_map_name_owner_cb (TpDBusDaemon *dbus_daemon, const gchar *name, const gchar *new_owner, gpointer user_data) { if (new_owner == NULL || new_owner[0] == '\0') { _mcd_handler_map_set_handler_crashed (user_data, name); } } /* * Returns: (transfer container): all channels that are being handled */ GList * _mcd_handler_map_get_handled_channels (McdHandlerMap *self) { return g_hash_table_get_values (self->priv->handled_channels); } /* * Returns: (transfer none): the account that @channel_path belongs to, * or %NULL if not known */ const gchar * _mcd_handler_map_get_channel_account (McdHandlerMap *self, const gchar *channel_path) { return g_hash_table_lookup (self->priv->channel_accounts, channel_path); } /* * Record that MC itself is handling this channel, internally. */ void _mcd_handler_map_set_channel_handled_internally (McdHandlerMap *self, TpChannel *channel, const gchar *account_path) { _mcd_handler_map_set_channel_handled (self, channel, tp_dbus_daemon_get_unique_name (self->priv->dbus_daemon), NULL, account_path); } telepathy-mission-control-5.16.4/src/mcd-channel.h0000644000175000017500000001000112735241312023116 0ustar00gkiagiagkiagia00000000000000/* vi: set et sw=4 ts=8 cino=t0,(0: */ /* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4; tab-width: 8 -*- */ /* * This file is part of mission-control * * Copyright (C) 2007-2009 Nokia Corporation. * Copyright (C) 2009 Collabora Ltd. * * Contact: Naba Kumar * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * version 2.1 as published by the Free Software Foundation. * * This library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA * */ #ifndef MCD_CHANNEL_H #define MCD_CHANNEL_H #include #include #include #include "mcd-mission.h" G_BEGIN_DECLS #define MCD_TYPE_CHANNEL (mcd_channel_get_type ()) #define MCD_CHANNEL(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), MCD_TYPE_CHANNEL, McdChannel)) #define MCD_CHANNEL_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), MCD_TYPE_CHANNEL, McdChannelClass)) #define MCD_IS_CHANNEL(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), MCD_TYPE_CHANNEL)) #define MCD_IS_CHANNEL_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), MCD_TYPE_CHANNEL)) #define MCD_CHANNEL_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), MCD_TYPE_CHANNEL, McdChannelClass)) typedef struct _McdChannel McdChannel; typedef struct _McdChannelPrivate McdChannelPrivate; typedef struct _McdChannelClass McdChannelClass; #include "mcd-account.h" typedef enum { MCD_CHANNEL_STATUS_UNDISPATCHED, /* used for channels created in the NewChannel signal before the connection is ready */ MCD_CHANNEL_STATUS_REQUEST, /* Telepathy channel is not yet created */ MCD_CHANNEL_STATUS_REQUESTED, /* Channel has been requested from the CM */ MCD_CHANNEL_STATUS_DISPATCHING, /* Telepathy channel is created and waiting dispatch */ MCD_CHANNEL_STATUS_HANDLER_INVOKED, MCD_CHANNEL_STATUS_DISPATCHED, /* Channel has been dispatched to handler */ MCD_CHANNEL_STATUS_FAILED, /* Channel creation failed, or channel could not be dispached to a handler */ MCD_CHANNEL_STATUS_ABORTED, /* Channel has been aborted */ } McdChannelStatus; struct _McdChannel { McdMission parent; McdChannelPrivate *priv; }; struct _McdChannelClass { McdMissionClass parent_class; /* signals */ void (*status_changed_signal) (McdChannel * channel, McdChannelStatus status); }; GType mcd_channel_get_type (void); McdChannel * mcd_channel_new_from_properties (TpConnection *connection, const gchar *object_path, const GHashTable *properties); McdChannel *mcd_channel_new_from_path (TpConnection *connection, const gchar *object_path, const gchar *type, guint handle, TpHandleType handle_type); McdChannelStatus mcd_channel_get_status (McdChannel * channel); const gchar* mcd_channel_get_object_path (McdChannel *channel); gboolean mcd_channel_is_requested (McdChannel *channel); McdAccount *mcd_channel_get_account (McdChannel *channel); TpChannel *mcd_channel_get_tp_channel (McdChannel *channel); void mcd_channel_take_error (McdChannel *channel, GError *error); const GError *mcd_channel_get_error (McdChannel *channel); GVariant *mcd_channel_dup_immutable_properties (McdChannel *channel); G_END_DECLS #endif /* MCD_CHANNEL_H */ telepathy-mission-control-5.16.4/src/mcd-account.h0000644000175000017500000001420212735242352023156 0ustar00gkiagiagkiagia00000000000000/* vi: set et sw=4 ts=8 cino=t0,(0: */ /* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4; tab-width: 8 -*- */ /* * mcd-account.h - the Telepathy Account D-Bus interface (service side) * * Copyright © 2008–2011 Collabora Ltd. * Copyright © 2008 Nokia Corporation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef __MCD_ACCOUNT_H__ #define __MCD_ACCOUNT_H__ #include G_BEGIN_DECLS #define MCD_TYPE_ACCOUNT (mcd_account_get_type ()) #define MCD_ACCOUNT(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), MCD_TYPE_ACCOUNT, McdAccount)) #define MCD_ACCOUNT_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), MCD_TYPE_ACCOUNT, McdAccountClass)) #define MCD_IS_ACCOUNT(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), MCD_TYPE_ACCOUNT)) #define MCD_IS_ACCOUNT_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), MCD_TYPE_ACCOUNT)) #define MCD_ACCOUNT_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), MCD_TYPE_ACCOUNT, McdAccountClass)) typedef struct _McdAccount McdAccount; typedef struct _McdAccountPrivate McdAccountPrivate; typedef struct _McdAccountClass McdAccountClass; #include "mcd-connection.h" #include "mcd-account-manager.h" struct _McdAccount { GObject parent; McdAccountPrivate *priv; }; typedef enum { MCD_ACCOUNT_ERROR_SET_PARAMETER, MCD_ACCOUNT_ERROR_GET_PARAMETER, } McdAccountError; GQuark mcd_account_error_quark (void); #define MCD_ACCOUNT_ERROR (mcd_account_error_quark ()) typedef void (*McdAccountLoadCb) (McdAccount *account, const GError *error, gpointer user_data); typedef void (*McdAccountDeleteCb) (McdAccount *account, const GError *error, gpointer user_data); struct _McdAccountClass { GObjectClass parent_class; /* Used to be get_parameter; set_parameter; delete; load. These are not * implementeed in any known subclass of this class, so have been removed; * these padding fields are to preserve ABI compatibility. */ GCallback dummy[4]; gboolean (*check_request) (McdAccount *account, GHashTable *request, GError **error); void (*_mc_reserved6) (void); void (*_mc_reserved7) (void); }; GType mcd_account_get_type (void); McdAccount *mcd_account_new (McdAccountManager *account_manager, const gchar *name, McdConnectivityMonitor *minotaur); void mcd_account_delete (McdAccount *account, McdAccountDeleteCb callback, gpointer user_data); const gchar *mcd_account_get_unique_name (McdAccount *account); const gchar *mcd_account_get_object_path (McdAccount *account); gboolean mcd_account_is_valid (McdAccount *account); typedef void (*McdAccountCheckValidityCb) (McdAccount *account, const GError *invalid_reason, gpointer user_data); void mcd_account_check_validity (McdAccount *account, McdAccountCheckValidityCb callback, gpointer user_data); gboolean mcd_account_is_enabled (McdAccount *account); const gchar *mcd_account_get_manager_name (McdAccount *account); const gchar *mcd_account_get_protocol_name (McdAccount *account); TpConnectionManager *mcd_account_get_cm (McdAccount *account); void mcd_account_request_presence (McdAccount *account, TpConnectionPresenceType type, const gchar *status, const gchar *message); void mcd_account_get_current_presence (McdAccount *account, TpConnectionPresenceType *presence, const gchar **status, const gchar **message); void mcd_account_get_requested_presence (McdAccount *account, TpConnectionPresenceType *presence, const gchar **status, const gchar **message); gboolean mcd_account_would_like_to_connect (McdAccount *account); TpConnectionStatus mcd_account_get_connection_status (McdAccount *account); McdConnection *mcd_account_get_connection (McdAccount *account); gboolean mcd_account_check_request (McdAccount *account, GHashTable *request, GError **error); gboolean mcd_account_parameter_is_secret (McdAccount *self, const gchar *name); void mcd_account_altered_by_plugin (McdAccount *account, const gchar *name); gchar * mcd_account_dup_display_name (McdAccount *self); gboolean mcd_account_get_parameter (McdAccount *account, const gchar *name, GValue *parameter, GError **error); gboolean mcd_account_get_parameter_of_known_type (McdAccount *account, const gchar *name, GType type, GValue *parameter, GError **error); gchar * mcd_account_dup_icon (McdAccount *self); gchar * mcd_account_dup_nickname (McdAccount *self); McdConnectivityMonitor *mcd_account_get_connectivity_monitor ( McdAccount *self); gboolean mcd_account_get_waiting_for_connectivity (McdAccount *self); void mcd_account_set_waiting_for_connectivity (McdAccount *self, gboolean waiting); void mcd_account_connection_proceed (McdAccount *account, gboolean success); void mcd_account_connection_proceed_with_reason (McdAccount *account, gboolean success, TpConnectionStatusReason reason); G_END_DECLS #endif telepathy-mission-control-5.16.4/src/mcd-dbusprop.h0000644000175000017500000001155012735241312023356 0ustar00gkiagiagkiagia00000000000000/* vi: set et sw=4 ts=8 cino=t0,(0: */ /* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4; tab-width: 8 -*- */ /* * This file is part of mission-control * * Copyright (C) 2008-2009 Nokia Corporation. * Copyright (C) 2009 Collabora Ltd. * * Contact: Alberto Mardegan * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * version 2.1 as published by the Free Software Foundation. * * This library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA * */ #ifndef __MCD_DBUSPROP_H__ #define __MCD_DBUSPROP_H__ #include #include G_BEGIN_DECLS typedef enum { MCD_DBUS_PROP_SET_FLAG_NONE = 0, MCD_DBUS_PROP_SET_FLAG_ALREADY_IN_STORAGE = 1 } McdDBusPropSetFlags; typedef gboolean (*mcd_setprop) (TpSvcDBusProperties *self, const gchar *name, const GValue *value, McdDBusPropSetFlags flags, GError **error); typedef void (*mcd_getprop) (TpSvcDBusProperties *self, const gchar *name, GValue *value); typedef void (*mcddbus_get_cb) (TpSvcDBusProperties *self, const GValue *value, const GError *error, gpointer user_data); typedef void (*mcd_async_getprop) (TpSvcDBusProperties *self, const gchar *name, mcddbus_get_cb callback, gpointer user_data); typedef void (*McdInterfaceInit) (TpSvcDBusProperties *self); typedef struct _McdDBusProp { const gchar *name; mcd_setprop setprop; mcd_getprop getprop; } McdDBusProp; typedef struct _McdInterfaceData { GType (*get_type)(void); const gchar *interface; const McdDBusProp *properties; GInterfaceInitFunc iface_init; McdInterfaceInit instance_init; gboolean optional; } McdInterfaceData; #define MCD_IMPLEMENT_IFACE(type, type_name, dbus_name) \ { \ type, \ dbus_name, \ type_name##_properties, \ (GInterfaceInitFunc)type_name##_iface_init, \ NULL, \ FALSE, \ } #define MCD_IMPLEMENT_IFACE_WITH_INIT(type, type_name, dbus_name) \ { \ type, \ dbus_name, \ type_name##_properties, \ (GInterfaceInitFunc)type_name##_iface_init, \ type_name##_instance_init, \ FALSE, \ } #define MCD_IMPLEMENT_OPTIONAL_IFACE(type, type_name, dbus_name) \ { \ type, \ dbus_name, \ type_name##_properties, \ (GInterfaceInitFunc)type_name##_iface_init, \ NULL, \ TRUE, \ } #define MCD_IMPLEMENT_OPTIONAL_IFACE_WITH_INIT(type, type_name, dbus_name) \ { \ type, \ dbus_name, \ type_name##_properties, \ (GInterfaceInitFunc)type_name##_iface_init, \ type_name##_instance_init, \ TRUE, \ } void mcd_dbus_init_interfaces (GType g_define_type_id, const McdInterfaceData *iface_data); #define MCD_DBUS_INIT_INTERFACES(iface_data) \ mcd_dbus_init_interfaces (g_define_type_id, iface_data) void mcd_dbus_init_interfaces_instances (gpointer self); gboolean mcd_dbusprop_set_property (TpSvcDBusProperties *self, const gchar *interface_name, const gchar *property_name, const GValue *value, GError **error); gboolean mcd_dbusprop_get_property (TpSvcDBusProperties *self, const gchar *interface_name, const gchar *property_name, GValue *value, GError **error); void dbusprop_set (TpSvcDBusProperties *self, const gchar *interface_name, const gchar *property_name, const GValue *value, DBusGMethodInvocation *context); void dbusprop_get (TpSvcDBusProperties *self, const gchar *interface_name, const gchar *property_name, DBusGMethodInvocation *context); void dbusprop_get_all (TpSvcDBusProperties *self, const gchar *interface_name, DBusGMethodInvocation *context); void mcd_dbus_get_interfaces (TpSvcDBusProperties *self, const gchar *name, GValue *value); void mcd_dbus_activate_optional_interface (TpSvcDBusProperties *object, GType interface); gboolean mcd_dbus_is_active_optional_interface (TpSvcDBusProperties *object, GType interface); G_END_DECLS #endif /* __MCD_DBUSPROP_H__ */ telepathy-mission-control-5.16.4/src/mcd-master.c0000644000175000017500000002503312735242352023014 0ustar00gkiagiagkiagia00000000000000/* vi: set et sw=4 ts=8 cino=t0,(0: */ /* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4; tab-width: 8 -*- */ /* * This file is part of mission-control * * Copyright (C) 2007-2009 Nokia Corporation. * Copyright (C) 2009 Collabora Ltd. * * Contact: Naba Kumar * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * version 2.1 as published by the Free Software Foundation. * * This library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA * */ /** * SECTION:mcd-master * @title: McdMaster * @short_description: Server master class * @see_also: * @stability: Unstable * @include: mcd-master.h * * This class implements actual mission-control. It keeps track of * individual account presence and connection states in a McdPresenceFrame * member object, which is available as a property. * * The McdPresenceFrame object could be easily utilized for * any presence releated events and actions, either within this class or * any other class subclassing it or using it. * * It is basically a container for all McdManager objects and * takes care of their management. It also takes care of sleep and awake * cycles (e.g. translates to auto away somewhere down the hierarchy). */ #include #ifdef HAVE_SYS_STAT_H #include #endif #ifdef HAVE_SYS_TYPES_H #include #endif #include #include #include #include #include #include #ifdef G_OS_WIN32 #include #endif #include "mcd-master.h" #include "mcd-master-priv.h" #include "mcd-manager.h" #include "mcd-dispatcher.h" #include "mcd-account-manager.h" #include "mcd-account-manager-priv.h" #include "mcd-account-conditions.h" #include "mcd-account-priv.h" #include "plugin-loader.h" #ifdef G_OS_UNIX # ifndef HAVE_UMASK # error On Unix, MC relies on umask() for account privacy # endif #endif G_DEFINE_TYPE (McdMaster, mcd_master, MCD_TYPE_OPERATION); struct _McdMasterPrivate { McdAccountManager *account_manager; McdDispatcher *dispatcher; /* We create these for our member objects */ TpDBusDaemon *dbus_daemon; TpSimpleClientFactory *client_factory; /* Current pending sleep timer */ gint shutdown_timeout_id; gboolean is_disposed; gboolean low_memory; gboolean idle; }; enum { PROP_0, PROP_PRESENCE_FRAME, PROP_DBUS_CONNECTION, PROP_DBUS_DAEMON, PROP_DISPATCHER, PROP_ACCOUNT_MANAGER, }; /* Used to poison 'default_master' when the object it points to is disposed. * The default_master should basically be alive for the duration of the MC run. */ #define POISONED_MASTER ((McdMaster *) 0xdeadbeef) static McdMaster *default_master = NULL; static void _mcd_master_get_property (GObject * obj, guint prop_id, GValue * val, GParamSpec * pspec) { McdMasterPrivate *priv = MCD_MASTER (obj)->priv; switch (prop_id) { case PROP_DISPATCHER: g_value_set_object (val, priv->dispatcher); break; case PROP_DBUS_DAEMON: g_value_set_object (val, priv->dbus_daemon); break; case PROP_DBUS_CONNECTION: g_value_set_pointer (val, tp_proxy_get_dbus_connection ( TP_PROXY (priv->dbus_daemon))); break; case PROP_ACCOUNT_MANAGER: g_value_set_object (val, priv->account_manager); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (obj, prop_id, pspec); break; } } static void _mcd_master_set_property (GObject *obj, guint prop_id, const GValue *val, GParamSpec *pspec) { McdMasterPrivate *priv = MCD_MASTER (obj)->priv; switch (prop_id) { case PROP_DBUS_DAEMON: g_assert (priv->dbus_daemon == NULL); priv->dbus_daemon = g_value_dup_object (val); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (obj, prop_id, pspec); break; } } static void _mcd_master_dispose (GObject * object) { McdMasterPrivate *priv = MCD_MASTER (object)->priv; if (priv->is_disposed) { return; } priv->is_disposed = TRUE; tp_clear_object (&priv->account_manager); tp_clear_object (&priv->dbus_daemon); tp_clear_object (&priv->dispatcher); tp_clear_object (&priv->client_factory); if (default_master == (McdMaster *) object) { default_master = POISONED_MASTER; } G_OBJECT_CLASS (mcd_master_parent_class)->dispose (object); } static GObject * mcd_master_constructor (GType type, guint n_params, GObjectConstructParam *params) { GObjectClass *object_class = (GObjectClass *)mcd_master_parent_class; McdMaster *master; McdMasterPrivate *priv; master = MCD_MASTER (object_class->constructor (type, n_params, params)); priv = master->priv; g_return_val_if_fail (master != NULL, NULL); #ifdef HAVE_UMASK /* mask out group and other rwx bits when creating files */ umask (0077); #endif priv->client_factory = tp_simple_client_factory_new (priv->dbus_daemon); priv->account_manager = mcd_account_manager_new (priv->client_factory); priv->dispatcher = mcd_dispatcher_new (priv->dbus_daemon, master); g_assert (MCD_IS_DISPATCHER (priv->dispatcher)); _mcd_account_manager_setup (priv->account_manager); dbus_connection_set_exit_on_disconnect ( dbus_g_connection_get_connection ( tp_proxy_get_dbus_connection (TP_PROXY (priv->dbus_daemon))), TRUE); return (GObject *) master; } static void mcd_master_class_init (McdMasterClass * klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); g_type_class_add_private (object_class, sizeof (McdMasterPrivate)); object_class->constructor = mcd_master_constructor; object_class->get_property = _mcd_master_get_property; object_class->set_property = _mcd_master_set_property; object_class->dispose = _mcd_master_dispose; /* Properties */ g_object_class_install_property (object_class, PROP_DISPATCHER, g_param_spec_object ("dispatcher", "Dispatcher", "Dispatcher", MCD_TYPE_DISPATCHER, G_PARAM_READABLE)); g_object_class_install_property (object_class, PROP_DBUS_DAEMON, g_param_spec_object ("dbus-daemon", "DBus daemon", "DBus daemon", TP_TYPE_DBUS_DAEMON, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); g_object_class_install_property (object_class, PROP_DBUS_CONNECTION, g_param_spec_pointer ("dbus-connection", "D-Bus Connection", "D-Bus Connection", G_PARAM_READABLE)); g_object_class_install_property (object_class, PROP_ACCOUNT_MANAGER, g_param_spec_object ("account-manager", "AccountManager", "AccountManager", MCD_TYPE_ACCOUNT_MANAGER, G_PARAM_READABLE)); } static void mcd_master_init (McdMaster * master) { master->priv = G_TYPE_INSTANCE_GET_PRIVATE (master, MCD_TYPE_MASTER, McdMasterPrivate); if (!default_master) default_master = master; /* This newer plugin API is currently always enabled */ /* .... and is enabled before anything else as potentially * * any mcd component could have a new-API style plugin */ _mcd_plugin_loader_init (); } McdMaster * mcd_master_get_default (void) { if (!default_master) default_master = MCD_MASTER (g_object_new (MCD_TYPE_MASTER, NULL)); g_return_val_if_fail (default_master != POISONED_MASTER, NULL); return default_master; } /* * _mcd_master_lookup_manager: * @master: the #McdMaster. * @unique_name: the name of the manager. * * Gets the manager whose name is @unique_name. If the manager object doesn't * exists yet, it is created. * * Returns: a #McdManager. Caller must call g_object_ref() on it to ensure it * will stay alive as long as needed. */ McdManager * _mcd_master_lookup_manager (McdMaster *master, const gchar *unique_name) { const GList *managers, *list; McdManager *manager; managers = mcd_operation_get_missions (MCD_OPERATION (master)); for (list = managers; list; list = list->next) { manager = MCD_MANAGER (list->data); if (strcmp (unique_name, mcd_manager_get_name (manager)) == 0) return manager; } manager = mcd_manager_new (unique_name, master->priv->dispatcher, master->priv->client_factory); if (G_UNLIKELY (!manager)) g_warning ("Manager %s not created", unique_name); else mcd_operation_take_mission (MCD_OPERATION (master), MCD_MISSION (manager)); return manager; } /** * mcd_master_get_dbus_daemon: * @master: the #McdMaster. * * Returns: the #TpDBusDaemon. */ TpDBusDaemon * mcd_master_get_dbus_daemon (McdMaster *master) { g_return_val_if_fail (MCD_IS_MASTER (master), NULL); return master->priv->dbus_daemon; } /* Milliseconds to wait for Connectivity coming back up before exiting MC */ #define EXIT_COUNTDOWN_TIME 5000 static gboolean _mcd_master_exit_by_timeout (gpointer data) { McdMaster *self = MCD_MASTER (data); self->priv->shutdown_timeout_id = 0; /* Notify sucide */ mcd_mission_abort (MCD_MISSION (self)); return FALSE; } void mcd_master_shutdown (McdMaster *self, const gchar *reason) { McdMasterPrivate *priv; g_return_if_fail (MCD_IS_MASTER (self)); priv = self->priv; if(!priv->shutdown_timeout_id) { DEBUG ("MC will bail out because of \"%s\" out exit after %i", reason ? reason : "No reason specified", EXIT_COUNTDOWN_TIME); priv->shutdown_timeout_id = g_timeout_add (EXIT_COUNTDOWN_TIME, _mcd_master_exit_by_timeout, self); } else { DEBUG ("Already shutting down. This one has the reason %s", reason ? reason : "No reason specified"); } mcd_debug_print_tree (self); } telepathy-mission-control-5.16.4/src/mcd-storage-ag-hidden.h0000644000175000017500000000427512735242352025015 0ustar00gkiagiagkiagia00000000000000/* * storage-ag-hidden.h - account backend for "magic" hidden accounts using * accounts-glib * Copyright ©2011 Collabora Ltd. * Copyright ©2011 Nokia Corporation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef MCD_STORAGE_AG_HIDDEN_H #define MCD_STORAGE_AG_HIDDEN_H #include #include "mcd-account-manager-sso.h" typedef struct _McdStorageAgHidden McdStorageAgHidden; typedef struct _McdStorageAgHiddenClass McdStorageAgHiddenClass; struct _McdStorageAgHiddenClass { McdAccountManagerSsoClass parent_class; }; struct _McdStorageAgHidden { McdAccountManagerSso parent; }; GType mcd_storage_ag_hidden_get_type (void); McdStorageAgHidden *mcd_storage_ag_hidden_new (void); /* TYPE MACROS */ #define MCD_TYPE_STORAGE_AG_HIDDEN \ (mcd_storage_ag_hidden_get_type ()) #define MCD_STORAGE_AG_HIDDEN(obj) \ (G_TYPE_CHECK_INSTANCE_CAST((obj), MCD_TYPE_STORAGE_AG_HIDDEN, McdStorageAgHidden)) #define MCD_STORAGE_AG_HIDDEN_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST((klass), MCD_TYPE_STORAGE_AG_HIDDEN,\ McdStorageAgHiddenClass)) #define MCD_IS_STORAGE_AG_HIDDEN(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj), MCD_TYPE_STORAGE_AG_HIDDEN)) #define MCD_IS_STORAGE_AG_HIDDEN_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE((klass), MCD_TYPE_STORAGE_AG_HIDDEN)) #define MCD_STORAGE_AG_HIDDEN_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), MCD_TYPE_STORAGE_AG_HIDDEN, \ McdStorageAgHiddenClass)) #endif /* MCD_STORAGE_AG_HIDDEN_H */ telepathy-mission-control-5.16.4/src/mcd-mission.c0000644000175000017500000001771412735241312023204 0ustar00gkiagiagkiagia00000000000000/* vi: set et sw=4 ts=8 cino=t0,(0: */ /* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4; tab-width: 8 -*- */ /* * This file is part of mission-control * * Copyright (C) 2007 Nokia Corporation. * * Contact: Naba Kumar * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * version 2.1 as published by the Free Software Foundation. * * This library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA * */ /** * SECTION:mcd-mission * @title: McdMission * @short_description: Base class for server classes * @see_also: * @stability: Unstable * @include: mcd-mission.h * * It is the base class for every object in mission-control. It defines * a set of virtual functions and set of corresponding action signals. * all virtual functions results in emission of their corresponding action * signals. The virtual functions define states of the object, such * as memory conserved state, connected state, locked state, low power state, * lit state, sleeping state etc. Each of the object states can also be queried * independently as properties. * * There are also some action signals such as abort, which is used to notify * other objects holding hard references to it to release them (this object * should then automatically die since all held references are released). It * is mandatory for all other objects that hold a hard reference to it to * listen for this signal and release the reference in signal handler. * * Concrete derived classes should override the sate methods to implement * object specific state managements. */ #include "config.h" #include "mcd-mission-priv.h" #include #include "mcd-enum-types.h" #define MCD_MISSION_PRIV(mission) (G_TYPE_INSTANCE_GET_PRIVATE ((mission), \ MCD_TYPE_MISSION, \ McdMissionPrivate)) G_DEFINE_TYPE (McdMission, mcd_mission, G_TYPE_OBJECT); /* Private */ typedef struct _McdMissionPrivate { McdMission *parent; gboolean connected; gboolean is_disposed; } McdMissionPrivate; enum _McdMissionSignalType { CONNECTED, DISCONNECTED, PARENT_SET, ABORT, LAST_SIGNAL }; enum _McdMissionPropertyType { PROP_0, PROP_PARENT }; static guint mcd_mission_signals[LAST_SIGNAL] = { 0 }; static void _mcd_mission_connect (McdMission * mission) { McdMissionPrivate *priv; g_return_if_fail (MCD_IS_MISSION (mission)); priv = MCD_MISSION_PRIV (mission); if (!priv->connected) { priv->connected = TRUE; g_signal_emit_by_name (mission, "connected"); } } static void _mcd_mission_disconnect (McdMission * mission) { McdMissionPrivate *priv; g_return_if_fail (MCD_IS_MISSION (mission)); priv = MCD_MISSION_PRIV (mission); if (priv->connected) { priv->connected = FALSE; g_signal_emit_by_name (mission, "disconnected"); } } static void on_parent_abort (McdMission *parent, McdMission *mission) { DEBUG ("called"); _mcd_mission_set_parent (mission, NULL); } void _mcd_mission_set_parent (McdMission * mission, McdMission * parent) { McdMissionPrivate *priv; g_return_if_fail (MCD_IS_MISSION (mission)); g_return_if_fail ((parent == NULL) || MCD_IS_MISSION (parent)); priv = MCD_MISSION_PRIV (mission); DEBUG ("child = %p, parent = %p", mission, parent); if (priv->parent) { g_signal_handlers_disconnect_by_func (priv->parent, on_parent_abort, mission); } if (parent) { g_signal_connect (parent, "abort", G_CALLBACK (on_parent_abort), mission); g_object_ref (parent); } tp_clear_object (&priv->parent); priv->parent = parent; } static void _mcd_mission_abort (McdMission * mission) { g_signal_emit_by_name (G_OBJECT (mission), "abort"); } static void _mcd_mission_dispose (GObject * object) { McdMissionPrivate *priv; g_return_if_fail (MCD_IS_MISSION (object)); priv = MCD_MISSION_PRIV (object); if (priv->is_disposed) { return; } priv->is_disposed = TRUE; DEBUG ("mission disposed %p", object); if (priv->parent) { g_signal_handlers_disconnect_by_func (priv->parent, on_parent_abort, object); } tp_clear_object (&priv->parent); G_OBJECT_CLASS (mcd_mission_parent_class)->dispose (object); } static void _mcd_mission_finalize (GObject * object) { DEBUG ("mission finalized %p", object); G_OBJECT_CLASS (mcd_mission_parent_class)->finalize (object); } static void _mcd_set_property (GObject * object, guint prop_id, const GValue * val, GParamSpec * pspec) { McdMission *mission = MCD_MISSION (object); switch (prop_id) { case PROP_PARENT: _mcd_mission_set_parent (mission, g_value_get_object (val)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } } static void _mcd_get_property (GObject * object, guint prop_id, GValue * val, GParamSpec * pspec) { McdMission *mission = MCD_MISSION (object); switch (prop_id) { case PROP_PARENT: g_value_set_object (val, mcd_mission_get_parent (mission)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } } static void mcd_mission_class_init (McdMissionClass * klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); g_type_class_add_private (object_class, sizeof (McdMissionPrivate)); /* virtual medthods */ object_class->finalize = _mcd_mission_finalize; object_class->dispose = _mcd_mission_dispose; object_class->set_property = _mcd_set_property; object_class->get_property = _mcd_get_property; /* virtual medthods */ klass->abort = _mcd_mission_abort; klass->connect = _mcd_mission_connect; klass->disconnect = _mcd_mission_disconnect; /* signals */ mcd_mission_signals[ABORT] = g_signal_new ("abort", G_OBJECT_CLASS_TYPE (klass), G_SIGNAL_RUN_FIRST, G_STRUCT_OFFSET (McdMissionClass, abort_signal), NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0); mcd_mission_signals[CONNECTED] = g_signal_new ("connected", G_OBJECT_CLASS_TYPE (klass), G_SIGNAL_RUN_FIRST, G_STRUCT_OFFSET (McdMissionClass, connected_signal), NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0); mcd_mission_signals[DISCONNECTED] = g_signal_new ("disconnected", G_OBJECT_CLASS_TYPE (klass), G_SIGNAL_RUN_FIRST, G_STRUCT_OFFSET (McdMissionClass, disconnected_signal), NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0); } static void mcd_mission_init (McdMission * obj) { } /* Public methods */ void mcd_mission_connect (McdMission * mission) { g_return_if_fail (MCD_IS_MISSION (mission)); MCD_MISSION_GET_CLASS (mission)->connect (mission); } void mcd_mission_disconnect (McdMission * mission) { g_return_if_fail (MCD_IS_MISSION (mission)); MCD_MISSION_GET_CLASS (mission)->disconnect (mission); } void mcd_mission_abort (McdMission * mission) { g_return_if_fail (MCD_IS_MISSION (mission)); MCD_MISSION_GET_CLASS (mission)->abort (mission); } gboolean mcd_mission_is_connected (McdMission * mission) { McdMissionPrivate *priv; g_return_val_if_fail (MCD_IS_MISSION (mission), FALSE); priv = MCD_MISSION_PRIV (mission); return priv->connected; } McdMission * mcd_mission_get_parent (McdMission * mission) { McdMissionPrivate *priv; g_return_val_if_fail (MCD_IS_MISSION (mission), NULL); priv = MCD_MISSION_PRIV (mission); return priv->parent; } telepathy-mission-control-5.16.4/src/channel-utils.h0000644000175000017500000000306512735241312023527 0ustar00gkiagiagkiagia00000000000000/* vi: set et sw=4 ts=8 cino=t0,(0: */ /* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4; tab-width: 8 -*- */ /* * This file is part of mission-control * * Copyright (C) 2007-2010 Nokia Corporation. * Copyright (C) 2009-2010 Collabora Ltd. * * Contact: Naba Kumar * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * version 2.1 as published by the Free Software Foundation. * * This library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA * */ #ifndef CHANNEL_UTILS_H #define CHANNEL_UTILS_H #include #include G_BEGIN_DECLS G_GNUC_INTERNAL GPtrArray *_mcd_tp_channel_details_build_from_list (const GList *channels); G_GNUC_INTERNAL GPtrArray *_mcd_tp_channel_details_build_from_tp_chan (TpChannel *channel); G_GNUC_INTERNAL void _mcd_tp_channel_details_free (GPtrArray *channels); /* NULL-safe for @channel; @verb is for debug */ G_GNUC_INTERNAL gboolean _mcd_tp_channel_should_close (TpChannel *channel, const gchar *verb); G_END_DECLS #endif telepathy-mission-control-5.16.4/src/mcd-slacker.c0000644000175000017500000001424712735241312023145 0ustar00gkiagiagkiagia00000000000000/* * slacker.c - Idleness monitor * Copyright ©2010 Collabora Ltd. * Copyright ©2008-2010 Nokia Corporation * Copyright ©2013 Intel Corporation * * Derived from code in e-book-backend-tp.c in eds-backend-telepathy; thanks! * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "config.h" #include "mcd-slacker.h" #include #include "mcd-debug.h" struct _McdSlackerPrivate { GDBusProxy *proxy; gboolean is_inactive; }; G_DEFINE_TYPE (McdSlacker, mcd_slacker, G_TYPE_OBJECT) enum { SIG_INACTIVITY_CHANGED = 0, N_SIGNALS }; static guint signals[N_SIGNALS]; /* GNOME Session Manager interface description: * https://git.gnome.org/browse/gnome-session/tree/gnome-session/org.gnome.SessionManager.Presence.xml */ enum { STATUS_AVAILABLE = 0, STATUS_INVISIBLE, STATUS_BUSY, STATUS_IDLE }; #define SERVICE_NAME "org.gnome.SessionManager" #define SERVICE_OBJECT_PATH "/org/gnome/SessionManager/Presence" #define SERVICE_INTERFACE "org.gnome.SessionManager.Presence" #define SERVICE_PROP_NAME "status" #define SERVICE_SIG_NAME "StatusChanged" /** * mcd_slacker_is_inactive: * @self: do some work! * * * * Returns: %TRUE if the device is known to be inactive; false otherwise. */ gboolean mcd_slacker_is_inactive (McdSlacker *self) { g_return_val_if_fail (MCD_IS_SLACKER (self), FALSE); return self->priv->is_inactive; } static void status_changed (McdSlacker *self, GVariant *prop) { gboolean old = self->priv->is_inactive; if (g_variant_classify (prop) != G_VARIANT_CLASS_UINT32) { WARNING ("%s.%s property is of type %s and we expected u", SERVICE_INTERFACE, SERVICE_PROP_NAME, g_variant_get_type_string (prop)); return; } self->priv->is_inactive = (g_variant_get_uint32 (prop) == STATUS_IDLE); if (self->priv->is_inactive != old) { DEBUG ("device became %s", self->priv->is_inactive ? "inactive" : "active"); g_signal_emit (self, signals[SIG_INACTIVITY_CHANGED], 0, self->priv->is_inactive); } } static void signal_cb (GDBusProxy *proxy, gchar *sender_name, gchar *signal_name, GVariant *parameters, gpointer user_data) { McdSlacker *self = user_data; GVariant *prop; if (tp_strdiff (signal_name, SERVICE_SIG_NAME)) return; if (!g_variant_is_of_type (parameters, G_VARIANT_TYPE ("(u)"))) { WARNING ("%s.%s arguments are of type %s and we expected (u)", SERVICE_INTERFACE, SERVICE_PROP_NAME, g_variant_get_type_string (parameters)); return; } prop = g_variant_get_child_value (parameters, 0); status_changed (self, prop); g_variant_unref (prop); } static void proxy_new_cb (GObject *source, GAsyncResult *result, gpointer user_data) { McdSlacker *self = user_data; GVariant *prop; GError *error = NULL; self->priv->proxy = g_dbus_proxy_new_finish (result, &error); if (self->priv->proxy == NULL) { DEBUG ("Error while creating slacker proxy: %s", error->message); goto out; } g_signal_connect (self->priv->proxy, "g-signal", G_CALLBACK (signal_cb), self); prop = g_dbus_proxy_get_cached_property (self->priv->proxy, SERVICE_PROP_NAME); if (g_dbus_proxy_get_name_owner (self->priv->proxy) == NULL) { DEBUG ("%s service not found", SERVICE_NAME); } else if (prop == NULL) { DEBUG ("%s.%s property is missing", SERVICE_INTERFACE, SERVICE_PROP_NAME); } else { status_changed (self, prop); g_variant_unref (prop); } out: g_object_unref (self); } static void mcd_slacker_init (McdSlacker *self) { self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, MCD_TYPE_SLACKER, McdSlackerPrivate); } static gpointer slacker = NULL; static GObject * mcd_slacker_constructor ( GType type, guint n_construct_properties, GObjectConstructParam *construct_properties) { GObject *retval; if (slacker == NULL) { slacker = G_OBJECT_CLASS (mcd_slacker_parent_class)->constructor ( type, n_construct_properties, construct_properties); retval = slacker; g_object_add_weak_pointer (retval, &slacker); } else { retval = g_object_ref (slacker); } return retval; } static void mcd_slacker_constructed (GObject *object) { McdSlacker *self = MCD_SLACKER (object); g_dbus_proxy_new_for_bus (G_BUS_TYPE_SESSION, G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START, NULL, SERVICE_NAME, SERVICE_OBJECT_PATH, SERVICE_INTERFACE, NULL, proxy_new_cb, g_object_ref (self)); } static void mcd_slacker_dispose (GObject *object) { McdSlacker *self = MCD_SLACKER (object); g_clear_object (&self->priv->proxy); ((GObjectClass *) mcd_slacker_parent_class)->dispose (object); } static void mcd_slacker_class_init (McdSlackerClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); object_class->constructor = mcd_slacker_constructor; object_class->constructed = mcd_slacker_constructed; object_class->dispose = mcd_slacker_dispose; g_type_class_add_private (klass, sizeof (McdSlackerPrivate)); /** * McdSlacker::inactivity-changed: * @self: what a slacker * @inactive: %TRUE if the device is inactive. * * The ::inactivity-changed is emitted when session becomes idle. */ signals[SIG_INACTIVITY_CHANGED] = g_signal_new ("inactivity-changed", MCD_TYPE_SLACKER, G_SIGNAL_RUN_LAST, 0, NULL, NULL, NULL, G_TYPE_NONE, 1, G_TYPE_BOOLEAN); } McdSlacker * mcd_slacker_new () { return g_object_new (MCD_TYPE_SLACKER, NULL); } telepathy-mission-control-5.16.4/src/mcd-operation.h0000644000175000017500000000523712735241312023525 0ustar00gkiagiagkiagia00000000000000/* vi: set et sw=4 ts=8 cino=t0,(0: */ /* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4; tab-width: 8 -*- */ /* * This file is part of mission-control * * Copyright (C) 2007 Nokia Corporation. * * Contact: Naba Kumar * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * version 2.1 as published by the Free Software Foundation. * * This library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA * */ #ifndef MCD_OPERATION_H #define MCD_OPERATION_H #include #include #include "mcd-mission.h" G_BEGIN_DECLS #define MCD_TYPE_OPERATION (mcd_operation_get_type ()) #define MCD_OPERATION(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), MCD_TYPE_OPERATION, McdOperation)) #define MCD_OPERATION_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), MCD_TYPE_OPERATION, McdOperationClass)) #define MCD_IS_OPERATION(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), MCD_TYPE_OPERATION)) #define MCD_IS_OPERATION_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), MCD_TYPE_OPERATION)) #define MCD_OPERATION_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), MCD_TYPE_OPERATION, McdOperationClass)) typedef struct _McdOperation McdOperation; typedef struct _McdOperationClass McdOperationClass; struct _McdOperation { McdMission parent; }; struct _McdOperationClass { McdMissionClass parent_class; /* signals */ void (*mission_taken_signal) (McdOperation * operation, McdMission * mission); void (*mission_removed_signal) (McdOperation * operation, McdMission * mission); /* virtual methods */ void (*take_mission) (McdOperation * operation, McdMission * mission); void (*remove_mission) (McdOperation * operation, McdMission * mission); }; GType mcd_operation_get_type (void); McdOperation *mcd_operation_new (void); /* Takes the ownership of mission */ void mcd_operation_take_mission (McdOperation * operation, McdMission * mission); void mcd_operation_remove_mission (McdOperation * operation, McdMission * mission); void mcd_operation_foreach (McdOperation * operation, GFunc func, gpointer user_data); const GList * mcd_operation_get_missions (McdOperation * operation); G_END_DECLS #endif /* MCD_OPERATION_H */ telepathy-mission-control-5.16.4/src/gtypes.c0000644000175000017500000000034712735242352022274 0ustar00gkiagiagkiagia00000000000000#include "config.h" #include #include "_gen/gtypes.h" #include "_gen/gtypes-body.h" /* Because I'm too lazy to have a separate file for these. */ #include "_gen/interfaces.h" #include "_gen/interfaces-body.h" telepathy-mission-control-5.16.4/src/mcd.xml0000644000175000017500000000111412735242352022073 0ustar00gkiagiagkiagia00000000000000 Copyright (C) 2008 Nokia Corporation telepathy-mission-control-5.16.4/src/mcd-account-conditions.h0000644000175000017500000000233512735242352025331 0ustar00gkiagiagkiagia00000000000000/* vi: set et sw=4 ts=8 cino=t0,(0: */ /* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4; tab-width: 8 -*- */ /* * mcd-account.h - the Telepathy Account D-Bus interface (service side) * * Copyright (C) 2008 Collabora Ltd. * Copyright (C) 2008 Nokia Corporation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef __MCD_ACCOUNT_CONDITIONS_H__ #define __MCD_ACCOUNT_CONDITIONS_H__ #include "mcd-account.h" G_BEGIN_DECLS GHashTable *mcd_account_get_conditions (McdAccount *account); G_END_DECLS #endif telepathy-mission-control-5.16.4/src/mcd-manager.c0000644000175000017500000003002312735241312023121 0ustar00gkiagiagkiagia00000000000000/* vi: set et sw=4 ts=8 cino=t0,(0: */ /* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4; tab-width: 8 -*- */ /* * This file is part of mission-control * * Copyright (C) 2007-2009 Nokia Corporation. * Copyright (C) 2009 Collabora Ltd. * * Contact: Naba Kumar * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * version 2.1 as published by the Free Software Foundation. * * This library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA * */ /** * SECTION:mcd-manager * @title: McdManager * @short_description: Manager class representing Telepathy connection manager * @see_also: * @stability: Unstable * @include: mcd-manager.h * * FIXME */ #include "config.h" #include "mcd-manager.h" #include "mcd-manager-priv.h" #include "mcd-misc.h" #include "mcd-slacker.h" #include #include #include #include "mcd-connection.h" #define MANAGER_SUFFIX ".manager" #define MCD_MANAGER_PRIV(manager) (MCD_MANAGER (manager)->priv) G_DEFINE_TYPE (McdManager, mcd_manager, MCD_TYPE_OPERATION); struct _McdManagerPrivate { gchar *name; TpDBusDaemon *dbus_daemon; TpSimpleClientFactory *client_factory; McdDispatcher *dispatcher; TpConnectionManager *tp_conn_mgr; McdSlacker *slacker; guint is_disposed : 1; guint ready : 1; }; enum { PROP_0, PROP_NAME, PROP_DISPATCHER, PROP_CLIENT_FACTORY }; static GQuark readiness_quark = 0; static void on_manager_ready (GObject *source_object, GAsyncResult *result, gpointer user_data) { TpConnectionManager *tp_conn_mgr = TP_CONNECTION_MANAGER (source_object); McdManager *manager = MCD_MANAGER (user_data); McdManagerPrivate *priv; GError *error = NULL; tp_proxy_prepare_finish (tp_conn_mgr, result, &error); priv = manager->priv; DEBUG ("manager %s is ready", priv->name); priv->ready = TRUE; _mcd_object_ready (manager, readiness_quark, error); g_clear_error (&error); } static void _mcd_manager_finalize (GObject * object) { McdManagerPrivate *priv = MCD_MANAGER_PRIV (object); g_free (priv->name); G_OBJECT_CLASS (mcd_manager_parent_class)->finalize (object); } static void _mcd_manager_dispose (GObject * object) { McdManagerPrivate *priv; priv = MCD_MANAGER_PRIV (object); if (priv->is_disposed) { return; } priv->is_disposed = TRUE; tp_clear_object (&priv->dispatcher); tp_clear_object (&priv->tp_conn_mgr); tp_clear_object (&priv->client_factory); tp_clear_object (&priv->dbus_daemon); tp_clear_object (&priv->slacker); G_OBJECT_CLASS (mcd_manager_parent_class)->dispose (object); } static void _mcd_manager_connect (McdMission * mission) { MCD_MISSION_CLASS (mcd_manager_parent_class)->connect (mission); } static void _mcd_manager_disconnect (McdMission * mission) { GList *connections; DEBUG ("%p", mission); MCD_MISSION_CLASS (mcd_manager_parent_class)->disconnect (mission); /* We now call mcd_mission_abort() on all child connections; but since this * could modify the list of the children, we cannot just use * mcd_operation_foreach(). Instead, make a copy of the list and work on * that. */ DEBUG("manager tree before abort:"); mcd_debug_print_tree(mission); connections = g_list_copy ((GList *)mcd_operation_get_missions (MCD_OPERATION (mission))); g_list_foreach (connections, (GFunc) mcd_mission_abort, NULL); g_list_free (connections); DEBUG("manager tree after abort:"); mcd_debug_print_tree(mission); } static gboolean mcd_manager_setup (McdManager *manager) { McdManagerPrivate *priv = manager->priv; GError *error = NULL; priv->slacker = mcd_slacker_new (); priv->tp_conn_mgr = tp_connection_manager_new (priv->dbus_daemon, priv->name, NULL, &error); if (error) { g_warning ("%s, cannot create manager %s: %s", G_STRFUNC, priv->name, error->message); goto error; } tp_proxy_prepare_async (priv->tp_conn_mgr, NULL, on_manager_ready, manager); DEBUG ("Manager %s created", priv->name); return TRUE; error: tp_clear_object (&priv->tp_conn_mgr); g_clear_error (&error); return FALSE; } static GObject * _mcd_manager_constructor (GType type, guint n_params, GObjectConstructParam *params) { GObjectClass *object_class = (GObjectClass *)mcd_manager_parent_class; McdManager *manager; manager = MCD_MANAGER (object_class->constructor (type, n_params, params)); g_return_val_if_fail (manager != NULL, NULL); if (!mcd_manager_setup (manager)) { g_object_unref (manager); return NULL; } return (GObject *) manager; } static void _mcd_manager_set_property (GObject * obj, guint prop_id, const GValue * val, GParamSpec * pspec) { McdManagerPrivate *priv = MCD_MANAGER_PRIV (obj); McdDispatcher *dispatcher; switch (prop_id) { case PROP_NAME: g_assert (priv->name == NULL); priv->name = g_value_dup_string (val); break; case PROP_DISPATCHER: dispatcher = g_value_get_object (val); if (dispatcher) { g_return_if_fail (MCD_IS_DISPATCHER (dispatcher)); g_object_ref (dispatcher); } tp_clear_object (&priv->dispatcher); priv->dispatcher = dispatcher; break; case PROP_CLIENT_FACTORY: g_assert (priv->client_factory == NULL); /* construct-only */ priv->client_factory = g_value_dup_object (val); priv->dbus_daemon = g_object_ref ( tp_simple_client_factory_get_dbus_daemon (priv->client_factory)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (obj, prop_id, pspec); break; } } static void _mcd_manager_get_property (GObject * obj, guint prop_id, GValue * val, GParamSpec * pspec) { McdManagerPrivate *priv = MCD_MANAGER_PRIV (obj); switch (prop_id) { case PROP_DISPATCHER: g_value_set_object (val, priv->dispatcher); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (obj, prop_id, pspec); break; } } static void mcd_manager_class_init (McdManagerClass * klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); McdMissionClass *mission_class = MCD_MISSION_CLASS (klass); g_type_class_add_private (object_class, sizeof (McdManagerPrivate)); object_class->constructor = _mcd_manager_constructor; object_class->finalize = _mcd_manager_finalize; object_class->dispose = _mcd_manager_dispose; object_class->set_property = _mcd_manager_set_property; object_class->get_property = _mcd_manager_get_property; mission_class->connect = _mcd_manager_connect; mission_class->disconnect = _mcd_manager_disconnect; /* Properties */ g_object_class_install_property (object_class, PROP_NAME, g_param_spec_string ("name", "Name", "Name", NULL, G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); g_object_class_install_property (object_class, PROP_DISPATCHER, g_param_spec_object ("dispatcher", "Dispatcher", "Dispatcher", MCD_TYPE_DISPATCHER, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); g_object_class_install_property (object_class, PROP_CLIENT_FACTORY, g_param_spec_object ("client-factory", "Client factory", "Client factory", TP_TYPE_SIMPLE_CLIENT_FACTORY, G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); readiness_quark = g_quark_from_static_string ("mcd_manager_got_info"); } static void mcd_manager_init (McdManager *manager) { McdManagerPrivate *priv; priv = G_TYPE_INSTANCE_GET_PRIVATE (manager, MCD_TYPE_MANAGER, McdManagerPrivate); manager->priv = priv; } /* Public methods */ McdManager * mcd_manager_new (const gchar *unique_name, McdDispatcher *dispatcher, TpSimpleClientFactory *client_factory) { McdManager *obj; obj = MCD_MANAGER (g_object_new (MCD_TYPE_MANAGER, "name", unique_name, "dispatcher", dispatcher, "client-factory", client_factory, NULL)); return obj; } /** * mcd_manager_get_unique_name: * @manager: the #McdManager. * * Gets the unique name of the @manager. * * Returns: a const string with the unique name. */ const gchar * mcd_manager_get_name (McdManager *manager) { McdManagerPrivate *priv = MCD_MANAGER_PRIV (manager); return priv->name; } TpProtocol * _mcd_manager_dup_protocol (McdManager *manager, const gchar *protocol) { TpProtocol *p; g_return_val_if_fail (MCD_IS_MANAGER (manager), NULL); g_return_val_if_fail (protocol != NULL, NULL); p = tp_connection_manager_get_protocol_object (manager->priv->tp_conn_mgr, protocol); if (p == NULL) return NULL; else return g_object_ref (p); } const TpConnectionManagerParam * mcd_manager_get_protocol_param (McdManager *manager, const gchar *protocol, const gchar *param) { McdManagerPrivate *priv; TpProtocol *cm_protocol; g_return_val_if_fail (MCD_IS_MANAGER (manager), NULL); g_return_val_if_fail (protocol != NULL, NULL); g_return_val_if_fail (param != NULL, NULL); priv = manager->priv; cm_protocol = tp_connection_manager_get_protocol_object (priv->tp_conn_mgr, protocol); if (cm_protocol == NULL) return NULL; return tp_protocol_get_param (cm_protocol, param); } McdConnection * mcd_manager_create_connection (McdManager *manager, McdAccount *account) { McdConnection *connection; g_return_val_if_fail (MCD_IS_MANAGER (manager), NULL); g_return_val_if_fail (manager->priv->tp_conn_mgr != NULL, NULL); connection = g_object_new (MCD_TYPE_CONNECTION, "client-factory", manager->priv->client_factory, "tp-manager", manager->priv->tp_conn_mgr, "dispatcher", manager->priv->dispatcher, "account", account, "slacker", manager->priv->slacker, NULL); mcd_operation_take_mission (MCD_OPERATION (manager), MCD_MISSION (connection)); DEBUG ("Created a connection %p for account: %s", connection, mcd_account_get_unique_name (account)); return connection; } /** * mcd_manager_get_tp_proxy: * @manager: the #McdManager. * * Returns: the #TpConnectionManager proxy, or %NULL. */ TpConnectionManager * mcd_manager_get_tp_proxy (McdManager *manager) { g_return_val_if_fail (MCD_IS_MANAGER (manager), NULL); return manager->priv->tp_conn_mgr; } /** * mcd_manager_call_when_ready: * @manager: the #McdManager. * @callbacks: the #McdManagerReadyCb to invoke. * @user_data: user data to be passed to the callback. * * Invoke @callback when @manager is ready, i.e. when its introspection has * completed and all the manager protocols and parameter descriptions are * available. */ void mcd_manager_call_when_ready (McdManager *manager, McdManagerReadyCb callback, gpointer user_data) { g_return_if_fail (MCD_IS_MANAGER (manager)); g_return_if_fail (callback != NULL); if (manager->priv->ready) callback (manager, NULL, user_data); else _mcd_object_call_when_ready (manager, readiness_quark, (McdReadyCb)callback, user_data); } telepathy-mission-control-5.16.4/src/Makefile.in0000644000175000017500000012346412762351617022675 0ustar00gkiagiagkiagia00000000000000# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__make_dryrun = \ { \ am__dry=no; \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ *) \ for am__flg in $$MAKEFLAGS; do \ case $$am__flg in \ *=*|--*) ;; \ *n*) am__dry=yes; break;; \ esac; \ done;; \ esac; \ test $$am__dry = yes; \ } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ @ENABLE_LIBACCOUNTS_SSO_TRUE@am__append_1 = \ @ENABLE_LIBACCOUNTS_SSO_TRUE@ mcd-account-manager-sso.h \ @ENABLE_LIBACCOUNTS_SSO_TRUE@ $(NULL) @ENABLE_LIBACCOUNTS_GLIB_HIDDEN_TRUE@@ENABLE_LIBACCOUNTS_SSO_TRUE@am__append_2 = \ @ENABLE_LIBACCOUNTS_GLIB_HIDDEN_TRUE@@ENABLE_LIBACCOUNTS_SSO_TRUE@ mcd-storage-ag-hidden.h \ @ENABLE_LIBACCOUNTS_GLIB_HIDDEN_TRUE@@ENABLE_LIBACCOUNTS_SSO_TRUE@ $(NULL) @ENABLE_LIBACCOUNTS_SSO_TRUE@am__append_3 = $(LIBACCOUNTS_SSO_LIBS) @ENABLE_LIBACCOUNTS_SSO_TRUE@am__append_4 = $(LIBACCOUNTS_SSO_CFLAGS) @ENABLE_AEGIS_TRUE@am__append_5 = $(top_builddir)/plugins/libmcp-aegis.la @ENABLE_LIBACCOUNTS_SSO_TRUE@am__append_6 = \ @ENABLE_LIBACCOUNTS_SSO_TRUE@ mcd-account-manager-sso.c \ @ENABLE_LIBACCOUNTS_SSO_TRUE@ $(NULL) @ENABLE_LIBACCOUNTS_GLIB_HIDDEN_TRUE@@ENABLE_LIBACCOUNTS_SSO_TRUE@am__append_7 = \ @ENABLE_LIBACCOUNTS_GLIB_HIDDEN_TRUE@@ENABLE_LIBACCOUNTS_SSO_TRUE@ mcd-storage-ag-hidden.c \ @ENABLE_LIBACCOUNTS_GLIB_HIDDEN_TRUE@@ENABLE_LIBACCOUNTS_SSO_TRUE@ $(NULL) DIST_COMMON = $(srcdir)/../tools/header-checks.am \ $(srcdir)/Makefile.am $(srcdir)/Makefile.in subdir = src ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/gtk-doc.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/tp-compiler-flag.m4 \ $(top_srcdir)/m4/tp-compiler-warnings.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) am__DEPENDENCIES_1 = @ENABLE_LIBACCOUNTS_SSO_TRUE@am__DEPENDENCIES_2 = \ @ENABLE_LIBACCOUNTS_SSO_TRUE@ $(am__DEPENDENCIES_1) libmcd_convenience_la_DEPENDENCIES = $(top_builddir)/mission-control-plugins/libmission-control-plugins.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2) $(am__append_5) am__libmcd_convenience_la_SOURCES_DIST = mcd-account.c \ mcd-account-addressing.h mcd-account-conditions.c \ mcd-account-config.h mcd-account-connection.c \ mcd-account-requests.c mcd-account-addressing.c \ mcd-account-manager.c mcd-account-manager-priv.h \ mcd-account-manager-default.c mcd-account-priv.h mcd-client.c \ mcd-client-priv.h channel-utils.c channel-utils.h \ client-registry.c client-registry.h connectivity-monitor.c \ connectivity-monitor.h gtypes.c mcd-dbusprop.c mcd-dbusprop.h \ mcd-debug.c mcd-dispatch-operation.c \ mcd-dispatch-operation-priv.h mcd-handler-map.c \ mcd-handler-map-priv.h mcd-misc.c mcd-misc.h mcd-mission.c \ mcd-mission-priv.h mcd-operation.c mcd-master.c \ mcd-master-priv.h mcd-manager.c mcd-manager-priv.h \ mcd-connection.c mcd-connection-service-points.c \ mcd-connection-priv.h mcd-dispatcher.c mcd-dispatcher-priv.h \ mcd-channel.c mcd-channel-priv.h mcd-service.c mcd-slacker.c \ mcd-slacker.h mcd-storage.c mcd-storage.h \ plugin-dispatch-operation.c plugin-dispatch-operation.h \ plugin-loader.c plugin-loader.h plugin-request.c \ plugin-request.h request.c request.h sp_timestamp.h \ mcd-account.h mcd-account-conditions.h mcd-account-manager.h \ mcd-account-manager-default.h mcd-debug.h mcd-mission.h \ mcd-operation.h mcd-master.h mcd-manager.h mcd-connection.h \ mcd-connection-service-points.h mcd-channel.h mcd-dispatcher.h \ mcd-service.h mcd-account-manager-sso.h \ mcd-storage-ag-hidden.h mcd-account-manager-sso.c \ mcd-storage-ag-hidden.c am__objects_1 = am__objects_2 = $(am__objects_1) $(am__objects_1) @ENABLE_LIBACCOUNTS_SSO_TRUE@am__objects_3 = \ @ENABLE_LIBACCOUNTS_SSO_TRUE@ mcd-account-manager-sso.lo @ENABLE_LIBACCOUNTS_GLIB_HIDDEN_TRUE@@ENABLE_LIBACCOUNTS_SSO_TRUE@am__objects_4 = mcd-storage-ag-hidden.lo am_libmcd_convenience_la_OBJECTS = mcd-account.lo \ mcd-account-conditions.lo mcd-account-connection.lo \ mcd-account-requests.lo mcd-account-addressing.lo \ mcd-account-manager.lo mcd-account-manager-default.lo \ mcd-client.lo channel-utils.lo client-registry.lo \ connectivity-monitor.lo gtypes.lo mcd-dbusprop.lo mcd-debug.lo \ mcd-dispatch-operation.lo mcd-handler-map.lo mcd-misc.lo \ mcd-mission.lo mcd-operation.lo mcd-master.lo mcd-manager.lo \ mcd-connection.lo mcd-connection-service-points.lo \ mcd-dispatcher.lo mcd-channel.lo mcd-service.lo mcd-slacker.lo \ mcd-storage.lo plugin-dispatch-operation.lo plugin-loader.lo \ plugin-request.lo request.lo $(am__objects_2) $(am__objects_3) \ $(am__objects_4) nodist_libmcd_convenience_la_OBJECTS = signals-marshal.lo \ svc-Account_Interface_Conditions.lo \ svc-Account_Interface_External_Password_Storage.lo \ svc-Account_Interface_Hidden.lo \ svc-Account_Manager_Interface_Hidden.lo svc-dispatcher.lo \ mcd-enum-types.lo $(am__objects_1) libmcd_convenience_la_OBJECTS = $(am_libmcd_convenience_la_OBJECTS) \ $(nodist_libmcd_convenience_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; SOURCES = $(libmcd_convenience_la_SOURCES) \ $(nodist_libmcd_convenience_la_SOURCES) DIST_SOURCES = $(am__libmcd_convenience_la_SOURCES_DIST) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACCOUNTS_CACHE_DIR = @ACCOUNTS_CACHE_DIR@ ACCOUNTS_DIR = @ACCOUNTS_DIR@ ACLOCAL = @ACLOCAL@ AEGIS_LIBS = @AEGIS_LIBS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DBUS_CFLAGS = @DBUS_CFLAGS@ DBUS_LIBS = @DBUS_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ERROR_CFLAGS = @ERROR_CFLAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GIO_UNIX_CFLAGS = @GIO_UNIX_CFLAGS@ GIO_UNIX_LIBS = @GIO_UNIX_LIBS@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_COMPILE_SCHEMAS = @GLIB_COMPILE_SCHEMAS@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ GLIB_MKENUMS = @GLIB_MKENUMS@ GREP = @GREP@ GSETTINGS_DISABLE_SCHEMAS_COMPILE = @GSETTINGS_DISABLE_SCHEMAS_COMPILE@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ HTML_DIR = @HTML_DIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBACCOUNTS_SSO_CFLAGS = @LIBACCOUNTS_SSO_CFLAGS@ LIBACCOUNTS_SSO_LIBS = @LIBACCOUNTS_SSO_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MCE_CFLAGS = @MCE_CFLAGS@ MCE_LIBS = @MCE_LIBS@ MCP_ABI_VERSION = @MCP_ABI_VERSION@ MCP_API_VERSION = @MCP_API_VERSION@ MCP_LT_AGE = @MCP_LT_AGE@ MCP_LT_CURRENT = @MCP_LT_CURRENT@ MCP_LT_REVISION = @MCP_LT_REVISION@ MKDIR_P = @MKDIR_P@ NETWORK_MANAGER_CFLAGS = @NETWORK_MANAGER_CFLAGS@ NETWORK_MANAGER_LIBS = @NETWORK_MANAGER_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PYTHON = @PYTHON@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TELEPATHY_CFLAGS = @TELEPATHY_CFLAGS@ TELEPATHY_LIBS = @TELEPATHY_LIBS@ UPOWER_GLIB_CFLAGS = @UPOWER_GLIB_CFLAGS@ UPOWER_GLIB_LIBS = @UPOWER_GLIB_LIBS@ VERSION = @VERSION@ XSLTPROC = @XSLTPROC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gsettingsschemadir = @gsettingsschemadir@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mctestsdir = @mctestsdir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ pluginlibdir = @pluginlibdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ INCLUDES = $(TELEPATHY_CFLAGS) $(DBUS_CFLAGS) $(GLIB_CFLAGS) \ $(NETWORK_MANAGER_CFLAGS) $(CONNMAN_CFLAGS) \ $(UPOWER_GLIB_CFLAGS) -DG_LOG_DOMAIN=\"mcd\" \ -DMCD_PLUGIN_LOADER_DIR=\"@libdir@/mission-control-plugins.@MCP_ABI_VERSION@\" \ -DMC_DISABLE_DEPRECATED -I$(top_srcdir) $(am__append_4) AM_CFLAGS = $(ERROR_CFLAGS) mc_headers = mcd-account.h mcd-account-conditions.h \ mcd-account-manager.h mcd-account-manager-default.h \ mcd-debug.h mcd-mission.h mcd-operation.h mcd-master.h \ mcd-manager.h mcd-connection.h mcd-connection-service-points.h \ mcd-channel.h mcd-dispatcher.h mcd-service.h mcd-storage.h \ $(am__append_1) $(am__append_2) mc_gen_headers = \ _gen/cli-Connection_Manager_Interface_Account_Storage.h \ _gen/enums.h \ _gen/gtypes.h \ _gen/interfaces.h \ _gen/svc-Account_Interface_Conditions.h \ _gen/svc-Account_Interface_External_Password_Storage.h \ _gen/svc-Account_Interface_Hidden.h \ _gen/svc-Account_Manager_Interface_Hidden.h \ _gen/svc-dispatcher.h nodist_libmcd_convenience_la_SOURCES = \ _gen/cli-Connection_Manager_Interface_Account_Storage-body.h \ _gen/gtypes-body.h \ _gen/interfaces-body.h \ _gen/register-dbus-glib-marshallers-body.h \ _gen/signals-marshal.c \ _gen/signals-marshal.h \ _gen/signals-marshal.list \ _gen/svc-Account_Interface_Conditions.c \ _gen/svc-Account_Interface_External_Password_Storage.c \ _gen/svc-Account_Interface_Hidden.c \ _gen/svc-Account_Manager_Interface_Hidden.c \ _gen/svc-dispatcher.c \ mcd-enum-types.c \ mcd-enum-types.h \ $(mc_gen_headers) BUILT_SOURCES = \ _gen/mcd.xml \ stamp-mcd-enum-types.h \ $(nodist_libmcd_convenience_la_SOURCES) CLEANFILES = \ $(BUILT_SOURCES) \ _gen/cli-Connection_Manager_Interface_Account_Storage-gtk-doc.h \ _gen/svc-dispatcher-gtk-doc.h \ _gen/svc-Account_Interface_Hidden-gtk-doc.h \ _gen/svc-Account_Interface_External_Password_Storage-gtk-doc.h \ _gen/svc-Account_Interface_Conditions-gtk-doc.h \ _gen/svc-Account_Manager_Interface_Hidden-gtk-doc.h \ _gen/gtypes-gtk-doc.h \ $(NULL) libmcd_convenience_la_LIBADD = $(top_builddir)/mission-control-plugins/libmission-control-plugins.la \ $(TELEPATHY_LIBS) $(DBUS_LIBS) $(GLIB_LIBS) \ $(NETWORK_MANAGER_LIBS) $(CONNMAN_LIBS) $(UPOWER_GLIB_LIBS) \ $(NULL) $(am__append_3) $(am__append_5) noinst_LTLIBRARIES = libmcd-convenience.la libmcd_convenience_la_SOURCES = mcd-account.c mcd-account-addressing.h \ mcd-account-conditions.c mcd-account-config.h \ mcd-account-connection.c mcd-account-requests.c \ mcd-account-addressing.c mcd-account-manager.c \ mcd-account-manager-priv.h mcd-account-manager-default.c \ mcd-account-priv.h mcd-client.c mcd-client-priv.h \ channel-utils.c channel-utils.h client-registry.c \ client-registry.h connectivity-monitor.c \ connectivity-monitor.h gtypes.c mcd-dbusprop.c mcd-dbusprop.h \ mcd-debug.c mcd-dispatch-operation.c \ mcd-dispatch-operation-priv.h mcd-handler-map.c \ mcd-handler-map-priv.h mcd-misc.c mcd-misc.h mcd-mission.c \ mcd-mission-priv.h mcd-operation.c mcd-master.c \ mcd-master-priv.h mcd-manager.c mcd-manager-priv.h \ mcd-connection.c mcd-connection-service-points.c \ mcd-connection-priv.h mcd-dispatcher.c mcd-dispatcher-priv.h \ mcd-channel.c mcd-channel-priv.h mcd-service.c mcd-slacker.c \ mcd-slacker.h mcd-storage.c mcd-storage.h \ plugin-dispatch-operation.c plugin-dispatch-operation.h \ plugin-loader.c plugin-loader.h plugin-request.c \ plugin-request.h request.c request.h sp_timestamp.h \ $(mc_headers) $(am__append_6) $(am__append_7) EXTRA_DIST = \ mcd.xml \ dispatcher.xml \ stamp-mcd-enum-types.h # ---- telepathy-glib-style code generation ---- tools_dir = $(top_srcdir)/tools all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(srcdir)/../tools/header-checks.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(srcdir)/../tools/header-checks.am: $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libmcd-convenience.la: $(libmcd_convenience_la_OBJECTS) $(libmcd_convenience_la_DEPENDENCIES) $(EXTRA_libmcd_convenience_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(libmcd_convenience_la_OBJECTS) $(libmcd_convenience_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/channel-utils.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/client-registry.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/connectivity-monitor.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gtypes.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mcd-account-addressing.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mcd-account-conditions.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mcd-account-connection.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mcd-account-manager-default.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mcd-account-manager-sso.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mcd-account-manager.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mcd-account-requests.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mcd-account.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mcd-channel.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mcd-client.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mcd-connection-service-points.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mcd-connection.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mcd-dbusprop.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mcd-debug.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mcd-dispatch-operation.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mcd-dispatcher.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mcd-enum-types.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mcd-handler-map.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mcd-manager.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mcd-master.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mcd-misc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mcd-mission.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mcd-operation.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mcd-service.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mcd-slacker.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mcd-storage-ag-hidden.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mcd-storage.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/plugin-dispatch-operation.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/plugin-loader.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/plugin-request.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/request.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/signals-marshal.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/svc-Account_Interface_Conditions.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/svc-Account_Interface_External_Password_Storage.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/svc-Account_Interface_Hidden.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/svc-Account_Manager_Interface_Hidden.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/svc-dispatcher.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< signals-marshal.lo: _gen/signals-marshal.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT signals-marshal.lo -MD -MP -MF $(DEPDIR)/signals-marshal.Tpo -c -o signals-marshal.lo `test -f '_gen/signals-marshal.c' || echo '$(srcdir)/'`_gen/signals-marshal.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/signals-marshal.Tpo $(DEPDIR)/signals-marshal.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='_gen/signals-marshal.c' object='signals-marshal.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o signals-marshal.lo `test -f '_gen/signals-marshal.c' || echo '$(srcdir)/'`_gen/signals-marshal.c svc-Account_Interface_Conditions.lo: _gen/svc-Account_Interface_Conditions.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT svc-Account_Interface_Conditions.lo -MD -MP -MF $(DEPDIR)/svc-Account_Interface_Conditions.Tpo -c -o svc-Account_Interface_Conditions.lo `test -f '_gen/svc-Account_Interface_Conditions.c' || echo '$(srcdir)/'`_gen/svc-Account_Interface_Conditions.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/svc-Account_Interface_Conditions.Tpo $(DEPDIR)/svc-Account_Interface_Conditions.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='_gen/svc-Account_Interface_Conditions.c' object='svc-Account_Interface_Conditions.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o svc-Account_Interface_Conditions.lo `test -f '_gen/svc-Account_Interface_Conditions.c' || echo '$(srcdir)/'`_gen/svc-Account_Interface_Conditions.c svc-Account_Interface_External_Password_Storage.lo: _gen/svc-Account_Interface_External_Password_Storage.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT svc-Account_Interface_External_Password_Storage.lo -MD -MP -MF $(DEPDIR)/svc-Account_Interface_External_Password_Storage.Tpo -c -o svc-Account_Interface_External_Password_Storage.lo `test -f '_gen/svc-Account_Interface_External_Password_Storage.c' || echo '$(srcdir)/'`_gen/svc-Account_Interface_External_Password_Storage.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/svc-Account_Interface_External_Password_Storage.Tpo $(DEPDIR)/svc-Account_Interface_External_Password_Storage.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='_gen/svc-Account_Interface_External_Password_Storage.c' object='svc-Account_Interface_External_Password_Storage.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o svc-Account_Interface_External_Password_Storage.lo `test -f '_gen/svc-Account_Interface_External_Password_Storage.c' || echo '$(srcdir)/'`_gen/svc-Account_Interface_External_Password_Storage.c svc-Account_Interface_Hidden.lo: _gen/svc-Account_Interface_Hidden.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT svc-Account_Interface_Hidden.lo -MD -MP -MF $(DEPDIR)/svc-Account_Interface_Hidden.Tpo -c -o svc-Account_Interface_Hidden.lo `test -f '_gen/svc-Account_Interface_Hidden.c' || echo '$(srcdir)/'`_gen/svc-Account_Interface_Hidden.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/svc-Account_Interface_Hidden.Tpo $(DEPDIR)/svc-Account_Interface_Hidden.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='_gen/svc-Account_Interface_Hidden.c' object='svc-Account_Interface_Hidden.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o svc-Account_Interface_Hidden.lo `test -f '_gen/svc-Account_Interface_Hidden.c' || echo '$(srcdir)/'`_gen/svc-Account_Interface_Hidden.c svc-Account_Manager_Interface_Hidden.lo: _gen/svc-Account_Manager_Interface_Hidden.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT svc-Account_Manager_Interface_Hidden.lo -MD -MP -MF $(DEPDIR)/svc-Account_Manager_Interface_Hidden.Tpo -c -o svc-Account_Manager_Interface_Hidden.lo `test -f '_gen/svc-Account_Manager_Interface_Hidden.c' || echo '$(srcdir)/'`_gen/svc-Account_Manager_Interface_Hidden.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/svc-Account_Manager_Interface_Hidden.Tpo $(DEPDIR)/svc-Account_Manager_Interface_Hidden.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='_gen/svc-Account_Manager_Interface_Hidden.c' object='svc-Account_Manager_Interface_Hidden.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o svc-Account_Manager_Interface_Hidden.lo `test -f '_gen/svc-Account_Manager_Interface_Hidden.c' || echo '$(srcdir)/'`_gen/svc-Account_Manager_Interface_Hidden.c svc-dispatcher.lo: _gen/svc-dispatcher.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT svc-dispatcher.lo -MD -MP -MF $(DEPDIR)/svc-dispatcher.Tpo -c -o svc-dispatcher.lo `test -f '_gen/svc-dispatcher.c' || echo '$(srcdir)/'`_gen/svc-dispatcher.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/svc-dispatcher.Tpo $(DEPDIR)/svc-dispatcher.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='_gen/svc-dispatcher.c' object='svc-dispatcher.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o svc-dispatcher.lo `test -f '_gen/svc-dispatcher.c' || echo '$(srcdir)/'`_gen/svc-dispatcher.c mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am $(MAKE) $(AM_MAKEFLAGS) check-local check: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-am all-am: Makefile $(LTLIBRARIES) installdirs: install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: all check check-am install install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am check-local clean \ clean-generic clean-libtool clean-noinstLTLIBRARIES ctags \ distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am mcd-enum-types.h: stamp-mcd-enum-types.h $(AM_V_GEN)true stamp-mcd-enum-types.h: Makefile $(mc_headers) mcd-enum-types.c $(AM_V_GEN)( cd $(srcdir) && glib-mkenums \ --fhead "#ifndef __MCD_ENUM_TYPES_H__\n#define __MCD_ENUM_TYPES_H__\n\n#include \"mcd-mission.h\"\n#include \"mcd-channel.h\"\n\nG_BEGIN_DECLS\n" \ --fprod "/* enumerations from \"@filename@\" */\n" \ --vhead "GType @enum_name@_get_type (void) G_GNUC_CONST;\n#define MCD_TYPE_@ENUMSHORT@ (@enum_name@_get_type())\n" \ --ftail "G_END_DECLS\n\n#endif /* __MCD_ENUM_TYPES_H__ */" \ $(mc_headers) ) >> xgen-geth \ && (cmp -s xgen-geth mcd-enum-types.h || cp xgen-geth mcd-enum-types.h ) \ && rm -f xgen-geth \ && echo timestamp > $(@F) mcd-enum-types.c: Makefile $(mc_headers) $(AM_V_GEN)( cd $(srcdir) && glib-mkenums \ --fhead "#include \"mcd-enum-types.h\"\n#define g_intern_static_string(s) (s)\n" \ --fprod "\n/* enumerations from \"@filename@\" */" \ --ftail "\n#define __MCD_ENUM_TYPES_C__\n" \ --vhead "GType\n@enum_name@_get_type (void)\n{\n static GType etype = 0;\n if (etype == 0) {\n static const G@Type@Value values[] = {" \ --vprod " { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \ --vtail " { 0, NULL, NULL }\n };\n etype = g_@type@_register_static (g_intern_static_string (\"@EnumName@\"), values);\n }\n return etype;\n}\n" \ $(mc_headers) ) > xgen-getc \ && cp xgen-getc mcd-enum-types.c \ && rm -f xgen-getc Android.mk: Makefile.am $(nodist_libmcd_convenience_la_SOURCES) androgenizer -:PROJECT telepathy-mission-control \ -:STATIC libmcd-convenience \ -:TAGS eng debug \ -:REL_TOP $(top_srcdir) -:ABS_TOP $(abs_top_srcdir) \ -:SOURCES $(libmcd_convenience_la_SOURCES) $(nodist_libmcd_convenience_la_SOURCES) \ -:CFLAGS $(DEFAULT_INCLUDES) $(INCLUDES) $(DEFS) $(CFLAGS) $(AM_CFLAGS) \ -:CPPFLAGS $(CPPFLAGS) $(AM_CPPFLAGS) \ -:LDFLAGS $(libmcd_convenience_la_LIBADD) \ > $@ _gen/mcd.xml: mcd.xml $(wildcard $(top_srcdir)/xml/*.xml) $(AM_V_at)$(mkdir_p) _gen $(AM_V_GEN)$(XSLTPROC) $(XSLTPROCFLAGS) --xinclude $(tools_dir)/identity.xsl \ $< > $@ _gen/%.xml: $(top_srcdir)/xml/%.xml $(wildcard $(top_srcdir)/xml/*.xml) $(AM_V_at)$(mkdir_p) _gen $(AM_V_GEN)$(XSLTPROC) $(XSLTPROCFLAGS) --xinclude $(tools_dir)/identity.xsl \ $< > $@ # Generated files which can be done for all "classes" at once _gen/signals-marshal.list: _gen/mcd.xml \ $(tools_dir)/glib-signals-marshal-gen.py $(AM_V_GEN)$(PYTHON) $(tools_dir)/glib-signals-marshal-gen.py $< > $@ _gen/signals-marshal.h: _gen/signals-marshal.list Makefile.am $(AM_V_GEN)$(GLIB_GENMARSHAL) --header --prefix=_mcd_ext_marshal $< > $@ _gen/signals-marshal.c: _gen/signals-marshal.list Makefile.am $(AM_V_GEN){ echo '#include "_gen/signals-marshal.h"' && \ $(GLIB_GENMARSHAL) --body --prefix=_mcd_ext_marshal $<; } \ > $@ _gen/register-dbus-glib-marshallers-body.h: _gen/mcd.xml \ $(tools_dir)/glib-client-marshaller-gen.py Makefile.am $(AM_V_GEN)$(PYTHON) $(tools_dir)/glib-client-marshaller-gen.py $< \ _mcd_ext > $@ _gen/enums.h: _gen/mcd.xml $(tools_dir)/c-constants-generator.xsl $(AM_V_GEN)$(XSLTPROC) $(XSLTPROCFLAGS) \ --stringparam mixed-case-prefix mc \ $(tools_dir)/c-constants-generator.xsl \ $< > $@ _gen/interfaces.h: _gen/mcd.xml \ $(tools_dir)/glib-interfaces-generator.xsl \ $(tools_dir)/c-interfaces-generator.xsl $(AM_V_GEN)$(XSLTPROC) $(XSLTPROCFLAGS) \ --stringparam mixed-case-prefix mc \ $(tools_dir)/glib-interfaces-generator.xsl \ $< > $@ _gen/interfaces-body.h: _gen/mcd.xml \ $(tools_dir)/glib-interfaces-body-generator.xsl \ $(tools_dir)/c-interfaces-generator.xsl $(AM_V_GEN)$(XSLTPROC) $(XSLTPROCFLAGS) \ --stringparam mixed-case-prefix mc \ $(tools_dir)/glib-interfaces-body-generator.xsl \ $< > $@ _gen/gtypes.h: _gen/gtypes-gtk-doc.h @: # generated as a side-effect _gen/gtypes-body.h: _gen/gtypes-gtk-doc.h @: # generated as a side-effect _gen/gtypes-gtk-doc.h: _gen/mcd.xml \ $(top_srcdir)/tools/glib-gtypes-generator.py $(AM_V_GEN)$(PYTHON) $(top_srcdir)/tools/glib-gtypes-generator.py \ $< _gen/gtypes mc # Generated files which must be generated per "class". # (Currently the only "class" is nmc4, but the new API will need "classes" # like account, account-manager, ...) _gen/%.xml: $(top_srcdir)/xml/%.xml $(wildcard $(top_srcdir)/xml/*.xml) Makefile.am $(AM_V_at)$(mkdir_p) _gen $(AM_V_GEN)$(XSLTPROC) $(XSLTPROCFLAGS) --xinclude $(tools_dir)/identity.xsl \ $< > $@ _gen/%.xml: %.xml $(wildcard $(top_srcdir)/xml/*.xml) Makefile.am $(AM_V_at)$(mkdir_p) _gen $(AM_V_GEN)$(XSLTPROC) $(XSLTPROCFLAGS) --xinclude $(tools_dir)/identity.xsl \ $< > $@ _gen/cli-%-body.h: _gen/cli-%-gtk-doc.h @: # generated as a side-effect _gen/cli-%.h: _gen/cli-%-gtk-doc.h @: # generated as a side-effect _gen/cli-%-gtk-doc.h: _gen/%.xml \ $(tools_dir)/glib-client-gen.py Makefile.am $(AM_V_GEN)$(PYTHON) $(tools_dir)/glib-client-gen.py \ --group=`echo $* | tr x- x_` \ --iface-quark-prefix=MC_IFACE_QUARK \ --tp-proxy-api=0.7.6 \ $< Mc_Cli _gen/cli-$* _gen/svc-%.c: _gen/svc-%-gtk-doc.h @: # generated as a side-effect _gen/svc-%.h: _gen/svc-%-gtk-doc.h @: # generated as a side-effect _gen/svc-%-gtk-doc.h: _gen/%.xml \ $(tools_dir)/glib-ginterface-gen.py Makefile.am $(AM_V_GEN)$(PYTHON) $(tools_dir)/glib-ginterface-gen.py \ --filename=_gen/svc-$* \ --signal-marshal-prefix=_mcd_ext \ --include='' \ --include='"_gen/signals-marshal.h"' \ --not-implemented-func='tp_dbus_g_method_return_not_implemented' \ --allow-unstable \ $< Mc_Svc_ header-decl-macro-check: $(filter %.h,$(DIST_SOURCES)) @(for H in $^; \ do \ if [ x"$$(grep -l G_BEGIN_DECLS $$H)" != x"$$(grep -l G_END_DECLS $$H)" ]; \ then \ echo Unbalanced G_\*_DECL macros in $$H; \ exit 1; \ fi;\ done) check-local: header-decl-macro-check # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: telepathy-mission-control-5.16.4/src/mcd-master-priv.h0000644000175000017500000000232312735241312023767 0ustar00gkiagiagkiagia00000000000000/* vi: set et sw=4 ts=8 cino=t0,(0: */ /* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4; tab-width: 8 -*- */ /* * This file is part of mission-control * * Copyright (C) 2007-2009 Nokia Corporation. * Copyright (C) 2009 Collabora Ltd. * * Contact: Naba Kumar * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * version 2.1 as published by the Free Software Foundation. * * This library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA * */ #ifndef MCD_MASTER_PRIV_H #define MCD_MASTER_PRIV_H #include "mcd-master.h" G_BEGIN_DECLS G_GNUC_INTERNAL McdManager *_mcd_master_lookup_manager (McdMaster *master, const gchar *unique_name); G_END_DECLS #endif telepathy-mission-control-5.16.4/src/mcd-dispatcher.h0000644000175000017500000000441212735241312023645 0ustar00gkiagiagkiagia00000000000000/* vi: set et sw=4 ts=8 cino=t0,(0: */ /* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4; tab-width: 8 -*- */ /* * This file is part of mission-control * * Copyright (C) 2007-2009 Nokia Corporation. * Copyright (C) 2009 Collabora Ltd. * * Contact: Naba Kumar * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * version 2.1 as published by the Free Software Foundation. * * This library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA * */ #ifndef MCD_DISPATCHER_H #define MCD_DISPATCHER_H #include #include #include #include G_BEGIN_DECLS #define MCD_TYPE_DISPATCHER (mcd_dispatcher_get_type ()) #define MCD_DISPATCHER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), MCD_TYPE_DISPATCHER, McdDispatcher)) #define MCD_DISPATCHER_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), MCD_TYPE_DISPATCHER, McdDispatcherClass)) #define MCD_IS_DISPATCHER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), MCD_TYPE_DISPATCHER)) #define MCD_IS_DISPATCHER_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), MCD_TYPE_DISPATCHER)) #define MCD_DISPATCHER_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), MCD_TYPE_DISPATCHER, McdDispatcherClass)) typedef struct _McdDispatcher McdDispatcher; typedef struct _McdDispatcherClass McdDispatcherClass; typedef struct _McdDispatcherPrivate McdDispatcherPrivate; #include "mcd-channel.h" #include "mcd-master.h" struct _McdDispatcher { GObject parent; McdDispatcherPrivate *priv; }; struct _McdDispatcherClass { GObjectClass parent_class; TpDBusPropertiesMixinClass dbus_properties_class; }; GType mcd_dispatcher_get_type (void); McdDispatcher *mcd_dispatcher_new (TpDBusDaemon *dbus_daemon, McdMaster * master); G_END_DECLS #endif /* MCD_DISPATCHER_H */ telepathy-mission-control-5.16.4/src/mcd-connection.c0000644000175000017500000022632712735242352023671 0ustar00gkiagiagkiagia00000000000000/* vi: set et sw=4 ts=8 cino=t0,(0: */ /* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4; tab-width: 8 -*- */ /* * This file is part of mission-control * * Copyright © 2007-2011 Nokia Corporation. * Copyright © 2009-2011 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * version 2.1 as published by the Free Software Foundation. * * This library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA * */ /** * SECTION:mcd-connection * @title: McdConnection * @short_description: Connection class representing Telepathy connection class * @see_also: * @stability: Unstable * @include: mcd-connection.h * * FIXME */ #include "config.h" #include "mcd-connection.h" #include "mcd-connection-service-points.h" #include #include #include #include #include #include #include #include #include #include #include #include #include "mcd-account-priv.h" #include "mcd-channel-priv.h" #include "mcd-connection-priv.h" #include "mcd-dispatcher-priv.h" #include "mcd-channel.h" #include "mcd-misc.h" #include "mcd-slacker.h" #include "sp_timestamp.h" #define INITIAL_RECONNECTION_TIME 3 /* seconds */ #define RECONNECTION_MULTIPLIER 3 #define MAXIMUM_RECONNECTION_TIME 30 * 60 /* half an hour */ #define MCD_CONNECTION_PRIV(mcdconn) (MCD_CONNECTION (mcdconn)->priv) G_DEFINE_TYPE (McdConnection, mcd_connection, MCD_TYPE_OPERATION); /* Private */ struct _McdConnectionPrivate { /* Factory for TpConnection objects */ TpSimpleClientFactory *client_factory; /* Channel dispatcher */ McdDispatcher *dispatcher; /* Account */ McdAccount *account; /* Telepathy connection manager */ TpConnectionManager *tp_conn_mgr; /* Telepathy connection */ TpConnection *tp_conn; /* Things to do before calling Connect */ guint tasks_before_connect; guint reconnect_timer; /* timer for reconnection */ guint reconnect_interval; guint probation_timer; /* for mcd_connection_probation_ended_cb */ guint probation_drop_count; /* Supported presences (values are McdPresenceInfo structs) */ GHashTable *recognized_presences; TpConnectionStatusReason abort_reason; guint got_contact_capabilities : 1; guint has_presence_if : 1; guint has_capabilities_if : 1; guint has_contact_capabilities_if : 1; guint has_power_saving_if : 1; /* FALSE until the dispatcher has said it's ready for us */ guint dispatching_started : 1; /* FALSE until channels announced by NewChannel/NewChannels need to be * dispatched */ guint dispatched_initial_channels : 1; /* TRUE if the last status change was to CONNECTED */ guint connected : 1; /* FALSE until mcd_connection_close() is called */ guint closed : 1; /* FALSE until connected and the supported presence statuses retrieved */ guint presence_info_ready : 1; gboolean is_disposed; gboolean service_points_watched; McdSlacker *slacker; /* Emergency service points' handles. * Set of handles, lazily-allocated. */ TpIntset *service_point_handles; /* Emergency service points' identifiers. * Set of (transfer full) (type utf8), lazily-allocated. */ GHashTable *service_point_ids; }; typedef struct { TpConnectionPresenceType presence; guint may_set_on_self : 1; guint can_have_message : 1; } McdPresenceInfo; enum { PROP_0, PROP_CLIENT_FACTORY, PROP_TP_MANAGER, PROP_TP_CONNECTION, PROP_ACCOUNT, PROP_DISPATCHER, PROP_SLACKER, }; enum { READY, CONNECTION_STATUS_CHANGED, N_SIGNALS }; static guint signals[N_SIGNALS] = { 0 }; static const gchar * const _available_fb[] = { NULL }; static const gchar * const _away_fb[] = { "away", NULL }; static const gchar * const _ext_away_fb[] = { "xa", "away", NULL }; static const gchar * const _hidden_fb[] = { "hidden", "dnd", "busy", "away", NULL }; static const gchar * const _busy_fb[] = { "busy", "dnd", "away", NULL }; static const gchar * const *presence_fallbacks[] = { _available_fb, _away_fb, _ext_away_fb, _hidden_fb, _busy_fb }; static void _mcd_connection_release_tp_connection (McdConnection *connection, McdInhibit *inhibit); static gboolean request_channel_new_iface (McdConnection *connection, McdChannel *channel); static void mcd_presence_info_free (McdPresenceInfo *pi) { g_slice_free (McdPresenceInfo, pi); } static void presence_set_status_cb (TpConnection *proxy, const GError *error, gpointer user_data, GObject *weak_object) { McdConnectionPrivate *priv = user_data; if (error) { _mcd_account_set_changing_presence (priv->account, FALSE); g_warning ("%s: Setting presence of %s failed: %s", G_STRFUNC, mcd_account_get_unique_name (priv->account), error->message); } } static gboolean _check_presence (McdConnectionPrivate *priv, TpConnectionPresenceType presence, const gchar **status) { const gchar * const *fallbacks; if (priv->recognized_presences == NULL || g_hash_table_size (priv->recognized_presences) == 0) { DEBUG ("account %s: recognized presences unknown, not setting " "presence yet", mcd_account_get_unique_name (priv->account)); return FALSE; } if (presence == TP_CONNECTION_PRESENCE_TYPE_UNSET || *status == NULL) return FALSE; if (g_hash_table_lookup (priv->recognized_presences, *status)) return TRUE; if (presence < TP_CONNECTION_PRESENCE_TYPE_AVAILABLE || presence > TP_CONNECTION_PRESENCE_TYPE_BUSY) return FALSE; fallbacks = presence_fallbacks[presence - TP_CONNECTION_PRESENCE_TYPE_AVAILABLE]; for (; *fallbacks != NULL; fallbacks++) if (g_hash_table_lookup (priv->recognized_presences, *fallbacks)) break; /* assume that "available" is always supported -- otherwise, an error will * be returned by SetPresence, but it's not a big loss */ if (*fallbacks != NULL) { DEBUG ("account %s: presence %s not supported, setting %s", mcd_account_get_unique_name (priv->account), *status, *fallbacks); *status = *fallbacks; } else { DEBUG ("account %s: presence %s not supported and no fallback is " "supported either, trying \"available\" and hoping for the " "best...", mcd_account_get_unique_name (priv->account), *status); *status = "available"; } return TRUE; } static void _mcd_connection_attempt (McdConnection *connection) { g_return_if_fail (connection->priv->tp_conn_mgr != NULL); g_return_if_fail (connection->priv->account != NULL); DEBUG ("called for %p, account %s", connection, mcd_account_get_unique_name (connection->priv->account)); if (connection->priv->reconnect_timer != 0) { g_source_remove (connection->priv->reconnect_timer); connection->priv->reconnect_timer = 0; } if (mcd_account_get_connection_status (connection->priv->account) == TP_CONNECTION_STATUS_DISCONNECTED) { /* not user-initiated */ _mcd_account_connection_begin (connection->priv->account, FALSE); } else { /* Can this happen? We just don't know. */ DEBUG ("Not connecting because not disconnected (%i)", mcd_account_get_connection_status (connection->priv->account)); } } static void _mcd_connection_set_presence (McdConnection * connection, TpConnectionPresenceType presence, const gchar *status, const gchar *message) { McdConnectionPrivate *priv = connection->priv; const gchar *adj_status = status; if (!priv->tp_conn) { DEBUG ("tp_conn is NULL"); _mcd_connection_attempt (connection); return; } g_return_if_fail (TP_IS_CONNECTION (priv->tp_conn)); if (!priv->has_presence_if) { DEBUG ("Presence not supported on this connection"); return; } if (_check_presence (priv, presence, &adj_status)) { TpConnectionPresenceType curr_presence; const gchar *curr_status; const gchar *curr_message; DEBUG ("Setting status '%s' of type %u ('%s' was requested)", adj_status, presence, status); mcd_account_get_current_presence (priv->account, &curr_presence, &curr_status, &curr_message); if (curr_presence == presence && tp_strdiff (curr_status, adj_status) == 0 && tp_strdiff (curr_message, message) == 0) { // PresencesChanged won't be emitted and Account.ChangingPresence // will never go to FALSE, so forcibly set it to FALSE _mcd_account_set_changing_presence (priv->account, FALSE); } tp_cli_connection_interface_simple_presence_call_set_presence (priv->tp_conn, -1, adj_status, message, presence_set_status_cb, priv, NULL, (GObject *)connection); } else { DEBUG ("Unable to set status '%s', or anything suitable for type %u", status, presence); } } static void presence_get_statuses_cb (TpProxy *proxy, const GValue *v_statuses, const GError *error, gpointer user_data, GObject *weak_object) { McdConnectionPrivate *priv = user_data; McdConnection *connection = MCD_CONNECTION (weak_object); TpConnectionPresenceType presence; const gchar *status, *message; GHashTable *statuses; GHashTableIter iter; gpointer ht_key, ht_value; if (error) { g_warning ("%s: Get statuses failed for account %s: %s", G_STRFUNC, mcd_account_get_unique_name (priv->account), error->message); return; } else if (G_VALUE_TYPE (v_statuses) != TP_HASH_TYPE_SIMPLE_STATUS_SPEC_MAP) { g_warning ("%s: Get(Statuses) returned the wrong type: %s", mcd_account_get_unique_name (priv->account), G_VALUE_TYPE_NAME (v_statuses)); return; } if (!priv->recognized_presences) priv->recognized_presences = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, (GDestroyNotify)mcd_presence_info_free); DEBUG ("account %s:", mcd_account_get_unique_name (priv->account)); statuses = g_value_get_boxed (v_statuses); g_return_if_fail (statuses != NULL); /* This function can be called both before and after Connect() - before * CONNECTED the Connection tells us the presences it believes it will * probably support, and after CONNECTED it tells us the presences it * *actually* supports (which might be less numerous). */ g_hash_table_remove_all (priv->recognized_presences); g_hash_table_iter_init (&iter, statuses); while (g_hash_table_iter_next (&iter, &ht_key, &ht_value)) { GValueArray *va = ht_value; McdPresenceInfo *pi; status = ht_key; DEBUG (" %s", status); pi = g_slice_new (McdPresenceInfo); pi->presence = g_value_get_uint (va->values); pi->may_set_on_self = g_value_get_boolean (va->values + 1); pi->can_have_message = g_value_get_boolean (va->values + 2); g_hash_table_insert (priv->recognized_presences, g_strdup (status), pi); } /* Now the presence info is ready. We can set the presence */ mcd_account_get_requested_presence (priv->account, &presence, &status, &message); if (priv->connected) { priv->presence_info_ready = TRUE; } _mcd_connection_set_presence (connection, presence, status, message); } static void _mcd_connection_setup_presence (McdConnection *connection) { McdConnectionPrivate *priv = connection->priv; tp_cli_dbus_properties_call_get (priv->tp_conn, -1, TP_IFACE_CONNECTION_INTERFACE_SIMPLE_PRESENCE, "Statuses", presence_get_statuses_cb, priv, NULL, (GObject *)connection); } static void disconnect_cb (TpConnection *proxy, const GError *error, gpointer user_data, GObject *weak_object) { if (error != NULL) WARNING ("Disconnect failed: %s", error->message); else DEBUG ("Disconnected %s", tp_proxy_get_object_path (TP_PROXY (proxy))); } static void _mcd_connection_call_disconnect (McdConnection *connection, McdInhibit *inhibit) { TpConnection *tp_conn = connection->priv->tp_conn; if (!tp_conn || tp_proxy_get_invalidated (TP_PROXY (tp_conn)) != NULL) return; if (tp_connection_get_status (tp_conn, NULL) == TP_CONNECTION_STATUS_DISCONNECTED) return; tp_cli_connection_call_disconnect (tp_conn, -1, disconnect_cb, inhibit ? mcd_inhibit_hold (inhibit) : NULL, inhibit ? (GDestroyNotify) mcd_inhibit_release : NULL, NULL); } /* Update the presence of the tp_connection. * * Note, that the only presence transition not served by this function * is getting to non-offline state since when presence is offline this object * does not exist. * * So, here we just submit the request to the tp_connection object. The return off * the operation is handled by (yet to be written) handler */ void _mcd_connection_request_presence (McdConnection *self, TpConnectionPresenceType presence, const gchar *status, const gchar *message) { g_return_if_fail (MCD_IS_CONNECTION (self)); DEBUG ("Presence requested: %d", presence); if (presence == TP_CONNECTION_PRESENCE_TYPE_UNSET) return; if (presence == TP_CONNECTION_PRESENCE_TYPE_OFFLINE) { /* Connection Proxy */ self->priv->abort_reason = TP_CONNECTION_STATUS_REASON_REQUESTED; mcd_mission_disconnect (MCD_MISSION (self)); _mcd_connection_call_disconnect (self, NULL); /* if a reconnection attempt is scheduled, cancel it */ if (self->priv->reconnect_timer) { g_source_remove (self->priv->reconnect_timer); self->priv->reconnect_timer = 0; } } else { _mcd_connection_set_presence (self, presence, status, message); } } static void on_new_channel (TpConnection *proxy, const gchar *chan_obj_path, const gchar *chan_type, guint handle_type, guint handle, gboolean suppress_handler, gpointer user_data, GObject *weak_object) { McdConnection *connection = MCD_CONNECTION (weak_object); McdConnectionPrivate *priv = user_data; McdChannel *channel; DEBUG ("%s (t=%s, ht=%u, h=%u, suppress=%c)", chan_obj_path, chan_type, handle_type, handle, suppress_handler ? 'T' : 'F'); if (priv->dispatched_initial_channels) { channel = mcd_channel_new_from_path (proxy, chan_obj_path, chan_type, handle, handle_type); if (G_UNLIKELY (!channel)) return; mcd_operation_take_mission (MCD_OPERATION (connection), MCD_MISSION (channel)); /* MC no longer calls RequestChannel. As a result, if suppress_handler * is TRUE, we know that this channel was requested "behind our back", * therefore we should call ObserveChannels, but refrain from calling * AddDispatchOperation or HandleChannels. * * We assume that channels without suppress_handler are incoming. */ _mcd_dispatcher_add_channel (priv->dispatcher, channel, suppress_handler, suppress_handler); } } static void _foreach_channel_remove (McdMission * mission, McdOperation * operation) { g_assert (MCD_IS_MISSION (mission)); g_assert (MCD_IS_OPERATION (operation)); mcd_operation_remove_mission (operation, mission); } static void _mcd_connection_setup_power_saving (McdConnection *connection) { McdConnectionPrivate *priv = connection->priv; if (priv->slacker == NULL) return; DEBUG ("is %sactive", mcd_slacker_is_inactive (priv->slacker) ? "in" : ""); if (mcd_slacker_is_inactive (priv->slacker)) tp_cli_connection_interface_power_saving_call_set_power_saving (priv->tp_conn, -1, TRUE, NULL, NULL, NULL, NULL); } static gboolean mcd_connection_reconnect (McdConnection *connection) { DEBUG ("%p", connection); _mcd_connection_attempt (connection); return FALSE; } /* Number of seconds after which to assume the connection is basically stable. * If we have too many disconnections within this time, assume something * serious is wrong, and stop reconnecting. */ #define PROBATION_SEC 120 /* Maximum number of dropped connections within PROBATION_SEC. Connections * that never reached CONNECTED state don't count towards this limit, so we'll * keep retrying indefinitely for those (with exponential back-off). */ #define PROBATION_MAX_DROPPED 3 static gboolean mcd_connection_probation_ended_cb (gpointer user_data) { McdConnection *self = MCD_CONNECTION (user_data); McdConnectionPrivate *priv = MCD_CONNECTION_PRIV (self); /* We've been connected for PROBATION_SEC seconds. We can probably now * assume that the connection is stable */ if (priv->tp_conn != NULL) { DEBUG ("probation finished, assuming connection is stable: %s", tp_proxy_get_object_path (self->priv->tp_conn)); self->priv->probation_drop_count = 0; self->priv->reconnect_interval = INITIAL_RECONNECTION_TIME; } else /* probation timer survived beyond its useful life */ { g_warning ("probation error: timer should have been removed when the " "TpConnection was released"); } self->priv->probation_timer = 0; return FALSE; } static void on_connection_status_changed (TpConnection *tp_conn, GParamSpec *pspec, McdConnection *connection) { McdConnectionPrivate *priv = MCD_CONNECTION_PRIV (connection); TpConnectionStatus conn_status; TpConnectionStatusReason conn_reason; g_object_get (G_OBJECT (tp_conn), "status", &conn_status, "status-reason", &conn_reason, NULL); DEBUG ("status_changed called from tp (%d)", conn_status); switch (conn_status) { case TP_CONNECTION_STATUS_CONNECTING: g_signal_emit (connection, signals[CONNECTION_STATUS_CHANGED], 0, conn_status, conn_reason, tp_conn, NULL, NULL); priv->abort_reason = TP_CONNECTION_STATUS_REASON_NONE_SPECIFIED; priv->connected = FALSE; break; case TP_CONNECTION_STATUS_CONNECTED: { g_signal_emit (connection, signals[CONNECTION_STATUS_CHANGED], 0, conn_status, conn_reason, tp_conn, NULL, NULL); if (priv->probation_timer == 0) { DEBUG ("setting probation timer (%d) seconds, for %s", PROBATION_SEC, tp_proxy_get_object_path (tp_conn)); priv->probation_timer = g_timeout_add_seconds (PROBATION_SEC, mcd_connection_probation_ended_cb, connection); priv->probation_drop_count = 0; } mcd_connection_service_point_setup (connection, !priv->service_points_watched); priv->service_points_watched = TRUE; priv->connected = TRUE; } break; case TP_CONNECTION_STATUS_DISCONNECTED: /* Connection could die during account status updated if its * manager is the only one holding the reference to it (manager will * remove the connection from itself). To ensure we get a chance to * emit abort signal (there could be others holding a ref to it), we * will hold a temporary ref to it. */ priv->abort_reason = conn_reason; /* priv->connected will be reset to FALSE in the invalidated * callback */ break; default: g_warning ("Unknown telepathy connection status"); } } static gboolean connection_should_reconnect (TpConnection *tp_conn, guint domain, gint code) { TpConnectionStatusReason reason; if (domain == TP_ERROR) { switch (code) { case TP_ERROR_CONNECTION_FAILED: case TP_ERROR_CONNECTION_LOST: case TP_ERROR_DISCONNECTED: case TP_ERROR_NETWORK_ERROR: DEBUG ("error code %s, reconnecting", tp_error_get_dbus_name (code)); return TRUE; case TP_ERROR_SOFTWARE_UPGRADE_REQUIRED: case TP_ERROR_SERVICE_BUSY: case TP_ERROR_CONNECTION_REPLACED: case TP_ERROR_ALREADY_CONNECTED: case TP_ERROR_CONNECTION_REFUSED: case TP_ERROR_INVALID_ARGUMENT: case TP_ERROR_INVALID_HANDLE: case TP_ERROR_CANCELLED: case TP_ERROR_AUTHENTICATION_FAILED: case TP_ERROR_ENCRYPTION_NOT_AVAILABLE: case TP_ERROR_ENCRYPTION_ERROR: case TP_ERROR_CERT_NOT_PROVIDED: case TP_ERROR_CERT_UNTRUSTED: case TP_ERROR_CERT_EXPIRED: case TP_ERROR_CERT_NOT_ACTIVATED: case TP_ERROR_CERT_FINGERPRINT_MISMATCH: case TP_ERROR_CERT_HOSTNAME_MISMATCH: case TP_ERROR_CERT_SELF_SIGNED: case TP_ERROR_CERT_INVALID: case TP_ERROR_CERT_REVOKED: case TP_ERROR_CERT_INSECURE: case TP_ERROR_CERT_LIMIT_EXCEEDED: DEBUG ("error code %s, not reconnecting", tp_error_get_dbus_name (code)); return FALSE; default: DEBUG ("TpError code %s not handled", tp_error_get_dbus_name (code)); } } else if (domain == TP_DBUS_ERRORS) { switch (code) { case TP_DBUS_ERROR_NAME_OWNER_LOST: /* CM crashed */ DEBUG ("dbus error code: OWNER_LOST, reconnecting"); return TRUE; } } /* not sure what the GError meant, so check the generic status code */ tp_connection_get_status (tp_conn, &reason); switch (reason) { case TP_CONNECTION_STATUS_REASON_NETWORK_ERROR: DEBUG ("StatusReason %d, reconnecting", reason); return TRUE; default: break; } DEBUG ("not reconnecting"); return FALSE; } static void mcd_connection_invalidated_cb (TpConnection *tp_conn, guint domain, gint code, gchar *message, McdConnection *connection) { McdConnectionPrivate *priv = MCD_CONNECTION_PRIV (connection); DEBUG ("Proxy destroyed (%s)!", message); _mcd_connection_release_tp_connection (connection, NULL); if (priv->connected && priv->abort_reason != TP_CONNECTION_STATUS_REASON_REQUESTED && priv->probation_timer != 0) { DEBUG ("connection dropped while on probation: %s", tp_proxy_get_object_path (tp_conn)); if (++priv->probation_drop_count > PROBATION_MAX_DROPPED) { DEBUG ("connection dropped too many times, will stop " "reconnecting"); } } priv->connected = FALSE; if (connection_should_reconnect (tp_conn, domain, code) && priv->probation_drop_count <= PROBATION_MAX_DROPPED) { /* we were disconnected by a network error or by a connection manager * crash (in the latter case, we get NoneSpecified as a reason): don't * abort the connection but try to reconnect later */ if (priv->reconnect_timer == 0) { DEBUG ("Preparing for reconnection in %u seconds", priv->reconnect_interval); priv->reconnect_timer = g_timeout_add_seconds (priv->reconnect_interval, (GSourceFunc)mcd_connection_reconnect, connection); priv->reconnect_interval *= RECONNECTION_MULTIPLIER; if (priv->reconnect_interval >= MAXIMUM_RECONNECTION_TIME) priv->reconnect_interval = MAXIMUM_RECONNECTION_TIME; } } else { g_object_ref (connection); /* Notify connection abort */ mcd_mission_abort (MCD_MISSION (connection)); g_object_unref (connection); } } static void connect_cb (TpConnection *tp_conn, const GError *error, gpointer user_data, GObject *weak_object) { McdConnection *connection = MCD_CONNECTION (weak_object); DEBUG ("called for connection %p", connection); if (error) { g_warning ("%s: tp_conn_connect failed: %s", G_STRFUNC, error->message); } } static gboolean _mcd_connection_request_channel (McdConnection *connection, McdChannel *channel); static void request_unrequested_channels (McdConnection *connection) { const GList *channels; channels = mcd_operation_get_missions ((McdOperation *)connection); DEBUG ("called"); /* go through the channels that were requested while the connection was not * ready, and process them */ while (channels) { McdChannel *channel = MCD_CHANNEL (channels->data); if (mcd_channel_get_status (channel) == MCD_CHANNEL_STATUS_REQUEST) { DEBUG ("Requesting channel %p", channel); mcd_connection_request_channel (connection, channel); } channels = channels->next; } } McdChannel * mcd_connection_find_channel_by_path (McdConnection *connection, const gchar *object_path) { const GList *list = NULL; list = mcd_operation_get_missions (MCD_OPERATION (connection)); while (list) { McdChannel *channel = MCD_CHANNEL (list->data); if (_mcd_channel_is_primary_for_path (channel, object_path)) { return channel; } list = list->next; } return NULL; } static gboolean mcd_connection_need_dispatch (McdConnection *connection, const gchar *object_path, GHashTable *props); static void on_new_channels (TpConnection *proxy, const GPtrArray *channels, gpointer user_data, GObject *weak_object) { McdConnection *connection = MCD_CONNECTION (weak_object); McdConnectionPrivate *priv = user_data; guint i; if (DEBUGGING) { for (i = 0; i < channels->len; i++) { GValueArray *va = g_ptr_array_index (channels, i); const gchar *object_path = g_value_get_boxed (va->values); GHashTable *props = g_value_get_boxed (va->values + 1); GHashTableIter iter; gpointer k, v; DEBUG ("%s", object_path); g_hash_table_iter_init (&iter, props); while (g_hash_table_iter_next (&iter, &k, &v)) { gchar *repr = g_strdup_value_contents (v); DEBUG(" \"%s\" => %s", (const gchar *) k, repr); g_free (repr); } } } /* we can completely ignore the channels that arrive while this is * FALSE: they'll also be in Channels in the GetAll(Requests) result */ if (!priv->dispatched_initial_channels) return; sp_timestamp ("NewChannels received"); for (i = 0; i < channels->len; i++) { GValueArray *va; const gchar *object_path; GHashTable *props; GValue *value; gboolean requested = FALSE; gboolean only_observe = FALSE; McdChannel *channel; va = g_ptr_array_index (channels, i); object_path = g_value_get_boxed (va->values); props = g_value_get_boxed (va->values + 1); only_observe = !mcd_connection_need_dispatch (connection, object_path, props); /* Don't do anything for requested channels */ value = g_hash_table_lookup (props, TP_IFACE_CHANNEL ".Requested"); if (value && g_value_get_boolean (value)) requested = TRUE; /* if the channel was a request, we already have an object for it; * otherwise, create a new one */ channel = mcd_connection_find_channel_by_path (connection, object_path); if (!channel) { channel = mcd_channel_new_from_properties (proxy, object_path, props); if (G_UNLIKELY (!channel)) continue; mcd_operation_take_mission (MCD_OPERATION (connection), MCD_MISSION (channel)); } if (!requested) { /* we always dispatch unrequested (incoming) channels */ only_observe = FALSE; } _mcd_dispatcher_add_channel (priv->dispatcher, channel, requested, only_observe); } } static void mcd_connection_recover_channel (McdConnection *connection, const gchar *object_path, const GHashTable *properties) { McdConnectionPrivate *priv = connection->priv; McdChannel *channel; DEBUG ("called for %s", object_path); channel = mcd_channel_new_from_properties (priv->tp_conn, object_path, properties); if (G_UNLIKELY (!channel)) return; mcd_operation_take_mission (MCD_OPERATION (connection), MCD_MISSION (channel)); _mcd_dispatcher_recover_channel (priv->dispatcher, channel, mcd_account_get_object_path (priv->account)); } static void mcd_connection_found_channel (McdConnection *self, const gchar *object_path, GHashTable *channel_props) { const GList *list; gboolean found = FALSE; /* find the McdChannel */ /* NOTE: we cannot move the mcd_operation_get_missions() call out of * the loop, because mcd_dispatcher_send() can cause the channel to be * destroyed, at which point our list would contain a finalized channel * (and a crash will happen) */ list = mcd_operation_get_missions ((McdOperation *) self); for (; list != NULL; list = list->next) { McdChannel *channel = MCD_CHANNEL (list->data); if (g_strcmp0 (object_path, mcd_channel_get_object_path (channel)) == 0) { found = TRUE; break; } if (mcd_channel_get_status (channel) != MCD_CHANNEL_STATUS_UNDISPATCHED) continue; } if (!found) { /* We don't have a McdChannel for this channel, which most likely * means that it was already present on the connection before MC * started. Let's try to recover it */ mcd_connection_recover_channel (self, object_path, channel_props); } } static void get_all_requests_cb (TpProxy *proxy, GHashTable *properties, const GError *error, gpointer user_data, GObject *weak_object) { McdConnection *connection = MCD_CONNECTION (weak_object); McdConnectionPrivate *priv = user_data; GPtrArray *channels; GValue *value; guint i; if (error) { g_warning ("%s got error: %s", G_STRFUNC, error->message); return; } value = g_hash_table_lookup (properties, "Channels"); if (value == NULL) { g_warning ("%s: no Channels property on %s", G_STRFUNC, tp_proxy_get_object_path (proxy)); return; } if (!G_VALUE_HOLDS (value, TP_ARRAY_TYPE_CHANNEL_DETAILS_LIST)) { g_warning ("%s: property Channels has type %s, expecting %s", G_STRFUNC, G_VALUE_TYPE_NAME (value), g_type_name (TP_ARRAY_TYPE_CHANNEL_DETAILS_LIST)); return; } channels = g_value_get_boxed (value); for (i = 0; i < channels->len; i++) { GValueArray *va; const gchar *object_path; GHashTable *channel_props; va = g_ptr_array_index (channels, i); object_path = g_value_get_boxed (va->values); channel_props = g_value_get_boxed (va->values + 1); if (DEBUGGING) { GHashTableIter iter; gpointer k, v; DEBUG ("%s", object_path); g_hash_table_iter_init (&iter, channel_props); while (g_hash_table_iter_next (&iter, &k, &v)) { gchar *repr = g_strdup_value_contents (v); DEBUG(" \"%s\" => %s", (const gchar *) k, repr); g_free (repr); } } mcd_connection_found_channel (connection, object_path, channel_props); } priv->dispatched_initial_channels = TRUE; } static void mcd_connection_setup_requests (McdConnection *connection) { McdConnectionPrivate *priv = connection->priv; /* * 1. connect to the NewChannels * 2. get existing channels * 3. disconnect from NewChannel * 4. dispatch the UNDISPATCHED */ tp_cli_connection_interface_requests_connect_to_new_channels (priv->tp_conn, on_new_channels, priv, NULL, (GObject *)connection, NULL); tp_cli_dbus_properties_call_get_all (priv->tp_conn, -1, TP_IFACE_CONNECTION_INTERFACE_REQUESTS, get_all_requests_cb, priv, NULL, (GObject *)connection); } static void list_channels_cb (TpConnection *connection, const GPtrArray *structs, const GError *error, gpointer user_data, GObject *weak_object) { McdConnection *self = MCD_CONNECTION (weak_object); guint i; if (error) { g_warning ("ListChannels got error: %s", error->message); return; } for (i = 0; i < structs->len; i++) { GValueArray *va = g_ptr_array_index (structs, i); const gchar *object_path; GHashTable *channel_props; object_path = g_value_get_boxed (va->values + 0); DEBUG ("%s (t=%s, ht=%u, h=%u)", object_path, g_value_get_string (va->values + 1), g_value_get_uint (va->values + 2), g_value_get_uint (va->values + 3)); /* this is not the most efficient thing we could possibly do, but * we're on a fallback path so it's OK to be a bit slow */ channel_props = g_hash_table_new (g_str_hash, g_str_equal); g_hash_table_insert (channel_props, TP_IFACE_CHANNEL ".ChannelType", va->values + 1); g_hash_table_insert (channel_props, TP_IFACE_CHANNEL ".TargetHandleType", va->values + 2); g_hash_table_insert (channel_props, TP_IFACE_CHANNEL ".TargetHandle", va->values + 3); mcd_connection_found_channel (self, object_path, channel_props); g_hash_table_unref (channel_props); } self->priv->dispatched_initial_channels = TRUE; } static void mcd_connection_setup_pre_requests (McdConnection *connection) { McdConnectionPrivate *priv = connection->priv; tp_cli_connection_connect_to_new_channel (priv->tp_conn, on_new_channel, priv, NULL, (GObject *)connection, NULL); tp_cli_connection_call_list_channels (priv->tp_conn, -1, list_channels_cb, priv, NULL, (GObject *) connection); } static void on_connection_ready (GObject *source_object, GAsyncResult *result, gpointer user_data) { TpConnection *tp_conn = TP_CONNECTION (source_object); TpWeakRef *weak_ref = user_data; McdConnection *connection = tp_weak_ref_dup_object (weak_ref); McdConnectionPrivate *priv; GError *error = NULL; if (!tp_proxy_prepare_finish (tp_conn, result, &error)) { DEBUG ("got error: %s", error->message); g_clear_error (&error); goto finally; } if (!connection) goto finally; DEBUG ("connection is ready"); priv = MCD_CONNECTION_PRIV (connection); priv->has_presence_if = tp_proxy_has_interface_by_id (tp_conn, TP_IFACE_QUARK_CONNECTION_INTERFACE_SIMPLE_PRESENCE); priv->has_capabilities_if = tp_proxy_has_interface_by_id (tp_conn, TP_IFACE_QUARK_CONNECTION_INTERFACE_CAPABILITIES); priv->has_contact_capabilities_if = tp_proxy_has_interface_by_id (tp_conn, TP_IFACE_QUARK_CONNECTION_INTERFACE_CONTACT_CAPABILITIES); priv->has_power_saving_if = tp_proxy_has_interface_by_id (tp_conn, TP_IFACE_QUARK_CONNECTION_INTERFACE_POWER_SAVING); if (priv->has_presence_if) _mcd_connection_setup_presence (connection); if (priv->has_power_saving_if) _mcd_connection_setup_power_saving (connection); if (!priv->dispatching_started) _mcd_dispatcher_add_connection (priv->dispatcher, connection); request_unrequested_channels (connection); g_signal_emit (connection, signals[READY], 0); finally: g_clear_object (&connection); tp_weak_ref_destroy (weak_ref); } void _mcd_connection_start_dispatching (McdConnection *self, GPtrArray *client_caps) { g_return_if_fail (MCD_IS_CONNECTION (self)); g_return_if_fail (!self->priv->dispatching_started); DEBUG ("%p", self); self->priv->dispatching_started = TRUE; if (tp_proxy_has_interface_by_id (self->priv->tp_conn, TP_IFACE_QUARK_CONNECTION_INTERFACE_REQUESTS)) mcd_connection_setup_requests (self); else mcd_connection_setup_pre_requests (self); /* FIXME: why is this here? if we need to update caps before and after * * connected, it should be in the call_when_ready callback. */ _mcd_connection_update_client_caps (self, client_caps); } void _mcd_connection_update_client_caps (McdConnection *self, GPtrArray *client_caps) { g_return_if_fail (MCD_IS_CONNECTION (self)); if (!self->priv->has_contact_capabilities_if) { DEBUG ("ContactCapabilities unsupported"); return; } DEBUG ("Sending client caps to connection"); tp_cli_connection_interface_contact_capabilities_call_update_capabilities (self->priv->tp_conn, -1, client_caps, NULL, NULL, NULL, NULL); } static void mcd_connection_done_task_before_connect (McdConnection *self) { if (--self->priv->tasks_before_connect == 0) { if (self->priv->tp_conn == NULL) { DEBUG ("TpConnection went away, not doing anything"); } if (tp_proxy_has_interface_by_id (self->priv->tp_conn, TP_IFACE_QUARK_CONNECTION_INTERFACE_REQUESTS)) { _mcd_dispatcher_add_connection (self->priv->dispatcher, self); } DEBUG ("%s: Calling Connect()", tp_proxy_get_object_path (self->priv->tp_conn)); tp_cli_connection_call_connect (self->priv->tp_conn, -1, connect_cb, self->priv, NULL, (GObject *) self); } } static void mcd_connection_early_get_statuses_cb (TpProxy *proxy, const GValue *v_statuses, const GError *error, gpointer user_data, GObject *weak_object) { McdConnection *self = MCD_CONNECTION (weak_object); if (self->priv->tp_conn != (TpConnection *) proxy) { DEBUG ("Connection %p has been replaced with %p, stopping", proxy, self->priv->tp_conn); return; } /* This is before we called Connect(), and may or may not be before * connection-ready has been signalled. */ if (error == NULL) { DEBUG ("%s: Early Get(Statuses) succeeded", tp_proxy_get_object_path (proxy)); /* This will trigger a call to SetPresence, but don't wait for that to * finish before calling Connect (there's no need to). */ presence_get_statuses_cb (proxy, v_statuses, error, self->priv, weak_object); } else { DEBUG ("%s: Early Get(Statuses) failed (not a problem, will try " "again later): %s #%d: %s", tp_proxy_get_object_path (proxy), g_quark_to_string (error->domain), error->code, error->message); } mcd_connection_done_task_before_connect (self); } static void mcd_connection_early_get_interfaces_cb (TpConnection *tp_conn, const gchar **interfaces, const GError *error, gpointer user_data, GObject *weak_object) { McdConnection *self = MCD_CONNECTION (weak_object); const gchar **iter; if (self->priv->tp_conn != tp_conn) { DEBUG ("Connection %p has been replaced with %p, stopping", tp_conn, self->priv->tp_conn); return; } if (error != NULL) { DEBUG ("%s: Early GetInterfaces failed (not a problem, will try " "again later): %s #%d: %s", tp_proxy_get_object_path (tp_conn), g_quark_to_string (error->domain), error->code, error->message); } else { for (iter = interfaces; *iter != NULL; iter++) { GQuark q = g_quark_try_string (*iter); /* if the interface is not recognised, q will just be 0 */ if (q == TP_IFACE_QUARK_CONNECTION_INTERFACE_SIMPLE_PRESENCE) { /* nail on the interface (TpConnection will eventually know * how to do this for itself) */ tp_proxy_add_interface_by_id ((TpProxy *) tp_conn, q); self->priv->has_presence_if = TRUE; self->priv->tasks_before_connect++; tp_cli_dbus_properties_call_get (tp_conn, -1, TP_IFACE_CONNECTION_INTERFACE_SIMPLE_PRESENCE, "Statuses", mcd_connection_early_get_statuses_cb, NULL, NULL, (GObject *) self); } else if (q == TP_IFACE_QUARK_CONNECTION_INTERFACE_CONTACT_CAPABILITIES) { GPtrArray *client_caps; /* nail on the interface (TpConnection will eventually know * how to do this for itself) */ tp_proxy_add_interface_by_id ((TpProxy *) tp_conn, q); self->priv->has_contact_capabilities_if = TRUE; /* we don't need to delay Connect for this, it can be * fire-and-forget */ client_caps = _mcd_dispatcher_dup_client_caps ( self->priv->dispatcher); if (client_caps != NULL) { _mcd_connection_update_client_caps (self, client_caps); g_ptr_array_foreach (client_caps, (GFunc) g_value_array_free, NULL); g_ptr_array_unref (client_caps); } /* else the McdDispatcher hasn't sorted itself out yet, so * we can't usefully pre-load capabilities - we'll be told * the real capabilities as soon as it has worked them out */ } else if (q == TP_IFACE_QUARK_CONNECTION_INTERFACE_REQUESTS) { /* If we have the Requests iface, we could start dispatching * before the connection is in CONNECTED state */ tp_proxy_add_interface_by_id ((TpProxy *) tp_conn, q); } } } mcd_connection_done_task_before_connect (self); } static gchar * translate_g_error (GQuark domain, gint code, const gchar *message) { if (domain == TP_ERROR) { return g_strdup (tp_error_get_dbus_name (code)); } else if (domain == TP_DBUS_ERRORS) { switch (code) { case TP_DBUS_ERROR_UNKNOWN_REMOTE_ERROR: { const gchar *p = strchr (message, ':'); if (p != NULL) { gchar *tmp = g_strndup (message, message - p); /* The syntactic restrictions for error names are the same * as for interface names. */ if (g_dbus_is_interface_name (tmp)) return tmp; g_free (tmp); } } break; case TP_DBUS_ERROR_NO_INTERFACE: return g_strdup (DBUS_ERROR_UNKNOWN_INTERFACE); case TP_DBUS_ERROR_NAME_OWNER_LOST: return g_strdup (DBUS_ERROR_NAME_HAS_NO_OWNER); } } /* catch-all */ return g_strdup (DBUS_ERROR_FAILED); } static void request_connection_cb (TpConnectionManager *proxy, const gchar *bus_name, const gchar *obj_path, const GError *tperror, gpointer user_data, GObject *weak_object) { TpWeakRef *weak_ref = user_data; McdConnection *connection = tp_weak_ref_dup_object (weak_ref); McdConnectionPrivate *priv; GError *error = NULL; if (connection == NULL || connection->priv->closed) { DEBUG ("RequestConnection returned after we'd decided not to use this " "connection"); /* We no longer want this connection, in fact */ if (tperror != NULL) { DEBUG ("It failed anyway: %s", tperror->message); } else { /* no point in making a TpConnection for something we're just * going to throw away */ DBusGProxy *tmp_proxy = dbus_g_proxy_new_for_name (tp_proxy_get_dbus_connection (proxy), bus_name, obj_path, TP_IFACE_CONNECTION); DEBUG ("Disconnecting it: %s", obj_path); dbus_g_proxy_call_no_reply (tmp_proxy, "Disconnect", G_TYPE_INVALID); g_object_unref (tmp_proxy); } if (connection != NULL) { g_signal_emit (connection, signals[CONNECTION_STATUS_CHANGED], 0, TP_CONNECTION_STATUS_DISCONNECTED, TP_CONNECTION_STATUS_REASON_REQUESTED, NULL, "", NULL); } goto finally; } priv = connection->priv; if (tperror) { gchar *dbus_error = translate_g_error (tperror->domain, tperror->code, tperror->message); GHashTable *details = tp_asv_new ( "debug-message", G_TYPE_STRING, tperror->message, NULL); g_warning ("%s: RequestConnection failed: %s", G_STRFUNC, tperror->message); g_signal_emit (connection, signals[CONNECTION_STATUS_CHANGED], 0, TP_CONNECTION_STATUS_DISCONNECTED, TP_CONNECTION_STATUS_REASON_NONE_SPECIFIED, NULL, dbus_error, details); g_hash_table_unref (details); g_free (dbus_error); goto finally; } DEBUG ("created %s", obj_path); _mcd_connection_set_tp_connection (connection, bus_name, obj_path, &error); if (G_UNLIKELY (error)) { g_warning ("%s: got error: %s", G_STRFUNC, error->message); g_error_free (error); goto finally; } priv->tasks_before_connect = 1; /* TpConnection doesn't yet know how to get this information before * the Connection goes to CONNECTED, so we'll have to do it ourselves */ tp_cli_connection_call_get_interfaces (priv->tp_conn, -1, mcd_connection_early_get_interfaces_cb, NULL, NULL, (GObject *) connection); finally: g_clear_object (&connection); /* weak_ref is freed by the telepathy-glib call's destructor */ } static void _mcd_connection_connect_with_params (McdConnection *connection, GHashTable *params) { McdConnectionPrivate *priv = connection->priv; const gchar *protocol_name; protocol_name = mcd_account_get_protocol_name (priv->account); DEBUG ("Trying connect account: %s", mcd_account_get_unique_name (priv->account)); g_signal_emit (connection, signals[CONNECTION_STATUS_CHANGED], 0, TP_CONNECTION_STATUS_CONNECTING, TP_CONNECTION_STATUS_REASON_REQUESTED, NULL, NULL, NULL); /* If the McdConnection gets aborted (which results in it being freed!), * we need to kill off the Connection. So, we can't use connection as the * weak_object. * * A better design in MC 5.3.x would be for the McdConnection to have * a ref held for the duration of this call, not be freed, and signal * that it is no longer useful in some way other than getting aborted. */ tp_cli_connection_manager_call_request_connection (priv->tp_conn_mgr, -1, protocol_name, params, request_connection_cb, tp_weak_ref_new (connection, NULL, NULL), (GDestroyNotify) tp_weak_ref_destroy, NULL); } static void _mcd_connection_finalize (GObject * object) { McdConnection *connection = MCD_CONNECTION (object); McdConnectionPrivate *priv = MCD_CONNECTION_PRIV (connection); if (priv->recognized_presences) g_hash_table_unref (priv->recognized_presences); tp_clear_pointer (&priv->service_point_handles, tp_intset_destroy); tp_clear_pointer (&priv->service_point_ids, g_hash_table_unref); G_OBJECT_CLASS (mcd_connection_parent_class)->finalize (object); } static void _mcd_connection_release_tp_connection (McdConnection *connection, McdInhibit *inhibit) { McdConnectionPrivate *priv = MCD_CONNECTION_PRIV (connection); DEBUG ("%p", connection); if (priv->abort_reason == TP_CONNECTION_STATUS_REASON_REQUESTED) { g_signal_emit (connection, signals[CONNECTION_STATUS_CHANGED], 0, TP_CONNECTION_STATUS_DISCONNECTED, priv->abort_reason, priv->tp_conn, "", NULL); } else { const gchar *dbus_error = NULL; const GHashTable *details = NULL; if (priv->tp_conn != NULL) { dbus_error = tp_connection_get_detailed_error (priv->tp_conn, &details); } g_signal_emit (connection, signals[CONNECTION_STATUS_CHANGED], 0, TP_CONNECTION_STATUS_DISCONNECTED, priv->abort_reason, priv->tp_conn, dbus_error, details); } if (priv->tp_conn) { /* Disconnect signals */ g_signal_handlers_disconnect_by_func (priv->tp_conn, G_CALLBACK (on_connection_status_changed), connection); g_signal_handlers_disconnect_by_func (G_OBJECT (priv->tp_conn), G_CALLBACK (mcd_connection_invalidated_cb), connection); _mcd_connection_call_disconnect (connection, inhibit); /* the tp_connection has gone away, so we no longer need (or want) * the probation timer to go off: there's nothing for it to check */ if (priv->probation_timer > 0) { g_source_remove (priv->probation_timer); priv->probation_timer = 0; } tp_clear_object (&priv->tp_conn); } if (priv->recognized_presences) g_hash_table_remove_all (priv->recognized_presences); priv->dispatching_started = FALSE; } static void on_account_removed (McdAccount *account, McdConnection *connection) { DEBUG ("Account %s removed, aborting connection", mcd_account_get_unique_name (account)); mcd_mission_abort (MCD_MISSION (connection)); } static void on_inactivity_changed (McdSlacker *slacker, gboolean inactive, McdConnection *self) { McdConnectionPrivate *priv = self->priv; DEBUG ("%sactive, connection %s have power saving iface.", inactive ? "in" : "", priv->has_power_saving_if ? "does" : "doesn't"); if (priv->tp_conn != NULL && priv->has_power_saving_if) tp_cli_connection_interface_power_saving_call_set_power_saving (priv->tp_conn, -1, inactive, NULL, NULL, NULL, NULL); } static void _mcd_connection_constructed (GObject * object) { McdConnection *self = MCD_CONNECTION (object); McdConnectionPrivate *priv = self->priv; if (priv->slacker != NULL) g_signal_connect (priv->slacker, "inactivity-changed", G_CALLBACK (on_inactivity_changed), self); } static void _mcd_connection_dispose (GObject * object) { McdConnection *connection = MCD_CONNECTION (object); McdConnectionPrivate *priv = MCD_CONNECTION_PRIV (connection); DEBUG ("called for object %p", object); if (priv->is_disposed) { return; } priv->is_disposed = TRUE; if (priv->probation_timer) { g_source_remove (priv->probation_timer); priv->probation_timer = 0; } if (priv->reconnect_timer) { g_source_remove (priv->reconnect_timer); priv->reconnect_timer = 0; } mcd_operation_foreach (MCD_OPERATION (connection), (GFunc) _foreach_channel_remove, connection); _mcd_connection_release_tp_connection (connection, NULL); g_assert (priv->tp_conn == NULL); if (priv->account) { g_signal_handlers_disconnect_by_func (priv->account, G_CALLBACK (on_account_removed), object); tp_clear_object (&priv->account); } if (priv->slacker != NULL) { g_signal_handlers_disconnect_by_func (priv->slacker, G_CALLBACK (on_inactivity_changed), connection); tp_clear_object (&priv->slacker); } tp_clear_object (&priv->tp_conn_mgr); tp_clear_object (&priv->dispatcher); tp_clear_object (&priv->client_factory); G_OBJECT_CLASS (mcd_connection_parent_class)->dispose (object); } static void _mcd_connection_set_property (GObject * obj, guint prop_id, const GValue * val, GParamSpec * pspec) { McdDispatcher *dispatcher; McdAccount *account; TpConnectionManager *tp_conn_mgr; McdConnectionPrivate *priv = MCD_CONNECTION_PRIV (obj); switch (prop_id) { case PROP_DISPATCHER: dispatcher = g_value_get_object (val); if (dispatcher) { g_return_if_fail (MCD_IS_DISPATCHER (dispatcher)); g_object_ref (dispatcher); } tp_clear_object (&priv->dispatcher); priv->dispatcher = dispatcher; break; case PROP_CLIENT_FACTORY: g_assert (priv->client_factory == NULL); /* construct-only */ priv->client_factory = g_value_dup_object (val); break; case PROP_TP_MANAGER: tp_conn_mgr = g_value_get_object (val); g_object_ref (tp_conn_mgr); tp_clear_object (&priv->tp_conn_mgr); priv->tp_conn_mgr = tp_conn_mgr; break; case PROP_ACCOUNT: account = g_value_get_object (val); g_return_if_fail (MCD_IS_ACCOUNT (account)); g_object_ref (account); priv->account = account; g_signal_connect (priv->account, "removed", G_CALLBACK (on_account_removed), obj); _mcd_account_set_connection (account, MCD_CONNECTION (obj)); break; case PROP_SLACKER: g_assert (priv->slacker == NULL); priv->slacker = g_value_dup_object (val); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (obj, prop_id, pspec); break; } } static void _mcd_connection_get_property (GObject * obj, guint prop_id, GValue * val, GParamSpec * pspec) { McdConnectionPrivate *priv = MCD_CONNECTION_PRIV (obj); switch (prop_id) { case PROP_ACCOUNT: g_value_set_object (val, priv->account); break; case PROP_TP_MANAGER: g_value_set_object (val, priv->tp_conn_mgr); break; case PROP_TP_CONNECTION: g_value_set_object (val, priv->tp_conn); break; case PROP_DISPATCHER: g_value_set_object (val, priv->dispatcher); break; case PROP_SLACKER: g_value_set_object (val, priv->slacker); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (obj, prop_id, pspec); break; } } /* * mcd_connection_need_dispatch: * @connection: the #McdConnection. * @object_path: the object path of the new channel (only for debugging) * @props: the properties of the new channel * * This functions must be called in response to a NewChannels signals, and is * responsible for deciding whether MC must handle the channels or not. */ static gboolean mcd_connection_need_dispatch (McdConnection *connection, const gchar *object_path, GHashTable *props) { McdAccount *account = mcd_connection_get_account (connection); gboolean requested = FALSE, requested_by_us = FALSE; if (_mcd_account_needs_dispatch (account)) { DEBUG ("Account %s must always be dispatched, bypassing checks", mcd_account_get_object_path (account)); return TRUE; } /* We must _not_ handle channels that have the Requested flag set but that * have no McdChannel object associated: these are the channels directly * requested to the CM by some other application, and we must ignore them */ requested = tp_asv_get_boolean (props, TP_IFACE_CHANNEL ".Requested", NULL); if (requested) { if (mcd_connection_find_channel_by_path (connection, object_path)) requested_by_us = TRUE; } /* handle only bundles which were not requested or that were requested * through MC */ return !requested || requested_by_us; } gboolean _mcd_connection_target_id_is_urgent (McdConnection *self, const gchar *name) { return self->priv->service_point_ids != NULL && g_hash_table_contains (self->priv->service_point_ids, name); } gboolean _mcd_connection_target_handle_is_urgent (McdConnection *self, guint handle) { return self->priv->service_point_handles != NULL && tp_intset_is_member (self->priv->service_point_handles, handle); } static gboolean _mcd_connection_request_channel (McdConnection *connection, McdChannel *channel) { McdConnectionPrivate *priv = MCD_CONNECTION_PRIV (connection); gboolean ret; g_return_val_if_fail (priv->tp_conn != NULL, FALSE); g_return_val_if_fail (TP_IS_CONNECTION (priv->tp_conn), FALSE); if (!tp_proxy_is_prepared (priv->tp_conn, TP_CONNECTION_FEATURE_CONNECTED)) { /* don't request any channel until the connection is ready (because we * don't know if the CM implements the Requests interface). The channel * will be processed once the connection is ready */ return TRUE; } if (tp_proxy_has_interface_by_id (priv->tp_conn, TP_IFACE_QUARK_CONNECTION_INTERFACE_REQUESTS)) { ret = request_channel_new_iface (connection, channel); } else { mcd_channel_take_error (channel, g_error_new (TP_ERROR, TP_ERROR_NOT_IMPLEMENTED, "No Requests interface")); mcd_mission_abort ((McdMission *) channel); return TRUE; } if (ret) _mcd_channel_set_status (channel, MCD_CHANNEL_STATUS_REQUESTED); return ret; } static void mcd_connection_class_init (McdConnectionClass * klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); g_type_class_add_private (object_class, sizeof (McdConnectionPrivate)); object_class->finalize = _mcd_connection_finalize; object_class->dispose = _mcd_connection_dispose; object_class->constructed = _mcd_connection_constructed; object_class->set_property = _mcd_connection_set_property; object_class->get_property = _mcd_connection_get_property; _mcd_ext_register_dbus_glib_marshallers (); tp_connection_init_known_interfaces (); /* Properties */ g_object_class_install_property (object_class, PROP_DISPATCHER, g_param_spec_object ("dispatcher", "Dispatcher", "Dispatcher", MCD_TYPE_DISPATCHER, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); g_object_class_install_property (object_class, PROP_CLIENT_FACTORY, g_param_spec_object ("client-factory", "Client factory", "Client factory", TP_TYPE_SIMPLE_CLIENT_FACTORY, G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); g_object_class_install_property (object_class, PROP_TP_MANAGER, g_param_spec_object ("tp-manager", "Telepathy Manager", "Telepathy Manager", TP_TYPE_CONNECTION_MANAGER, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); g_object_class_install_property (object_class, PROP_TP_CONNECTION, g_param_spec_object ("tp-connection", "Telepathy Connection", "Telepathy Connection", TP_TYPE_CONNECTION, G_PARAM_READABLE)); g_object_class_install_property (object_class, PROP_ACCOUNT, g_param_spec_object ("account", "Account", "Account", MCD_TYPE_ACCOUNT, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); g_object_class_install_property (object_class, PROP_SLACKER, g_param_spec_object ("slacker", "MCE slacker", "Slacker object notifies us of user inactivity", MCD_TYPE_SLACKER, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); /** * @status: * @status_reason: * @connection: * @dbus_error: a D-Bus error name, or %NULL * @details: a #GHashTable from string to #GValue, or %NULL */ signals[CONNECTION_STATUS_CHANGED] = g_signal_new ( "connection-status-changed", G_OBJECT_CLASS_TYPE (klass), G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED, 0, NULL, NULL, NULL, G_TYPE_NONE, 5, G_TYPE_UINT, G_TYPE_UINT, TP_TYPE_CONNECTION, G_TYPE_STRING, G_TYPE_HASH_TABLE); signals[READY] = g_signal_new ("ready", G_OBJECT_CLASS_TYPE (klass), G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0); } static void mcd_connection_init (McdConnection * connection) { McdConnectionPrivate *priv; priv = G_TYPE_INSTANCE_GET_PRIVATE (connection, MCD_TYPE_CONNECTION, McdConnectionPrivate); connection->priv = priv; priv->abort_reason = TP_CONNECTION_STATUS_REASON_NONE_SPECIFIED; priv->reconnect_interval = INITIAL_RECONNECTION_TIME; } /* Public methods */ /* Constant getters. These should probably be removed */ McdAccount * mcd_connection_get_account (McdConnection * id) { McdConnectionPrivate *priv = MCD_CONNECTION_PRIV (id); return priv->account; } static void common_request_channel_cb (TpConnection *proxy, gboolean yours, const gchar *channel_path, GHashTable *properties, const GError *error, McdConnection *connection, McdChannel *channel) { McdConnectionPrivate *priv = connection->priv; if (error != NULL) { GError *mc_error; /* No special handling of "no capabilities" error: being confident that * https://bugs.freedesktop.org/show_bug.cgi?id=15769 will be fixed * soon :-) */ DEBUG ("got error: %s", error->message); mc_error = g_error_copy (error); mcd_channel_take_error (channel, mc_error); mcd_mission_abort ((McdMission *)channel); return; } DEBUG ("%p, object %s", channel, channel_path); /* if this was a call to EnsureChannel, it can happen that the returned * channel was already created before; in that case we keep the McdChannel * alive only as a proxy for the status-changed signals from the "real" * McdChannel */ if (_mcd_channel_get_request_use_existing (channel)) { McdChannel *existing; existing = mcd_connection_find_channel_by_path (connection, channel_path); if (existing) { _mcd_dispatcher_add_channel_request (priv->dispatcher, existing, channel); return; } } /* Everything here is well and fine. We can create the channel. */ if (!_mcd_channel_create_proxy (channel, priv->tp_conn, channel_path, properties)) { mcd_mission_abort ((McdMission *)channel); return; } /* if the channel request was cancelled, abort the channel now */ if (mcd_channel_get_status (channel) == MCD_CHANNEL_STATUS_FAILED) { DEBUG ("Channel %p was cancelled, aborting", channel); _mcd_channel_close (channel); mcd_mission_abort (MCD_MISSION (channel)); } /* No dispatching here: the channel will be dispatched upon receiving the * NewChannels signal */ } static void ensure_channel_cb (TpConnection *proxy, gboolean yours, const gchar *channel_path, GHashTable *properties, const GError *error, gpointer user_data, GObject *weak_object) { common_request_channel_cb (proxy, yours, channel_path, properties, error, MCD_CONNECTION (user_data), MCD_CHANNEL (weak_object)); } static void create_channel_cb (TpConnection *proxy, const gchar *channel_path, GHashTable *properties, const GError *error, gpointer user_data, GObject *weak_object) { common_request_channel_cb (proxy, TRUE, channel_path, properties, error, MCD_CONNECTION (user_data), MCD_CHANNEL (weak_object)); } static gboolean request_channel_new_iface (McdConnection *connection, McdChannel *channel) { McdConnectionPrivate *priv = MCD_CONNECTION_PRIV (connection); GHashTable *properties; properties = _mcd_channel_get_requested_properties (channel); if (_mcd_channel_get_request_use_existing (channel)) { /* Timeout of 5 hours: 5 * 3600 * 1000 */ tp_cli_connection_interface_requests_call_ensure_channel (priv->tp_conn, 18000000, properties, ensure_channel_cb, connection, NULL, (GObject *)channel); } else { /* Timeout of 5 hours: 5 * 3600 * 1000 */ tp_cli_connection_interface_requests_call_create_channel (priv->tp_conn, 18000000, properties, create_channel_cb, connection, NULL, (GObject *)channel); } return TRUE; } gboolean mcd_connection_request_channel (McdConnection *connection, McdChannel *channel) { g_return_val_if_fail (MCD_IS_CONNECTION (connection), FALSE); g_return_val_if_fail (MCD_IS_CHANNEL (channel), FALSE); if (mcd_channel_get_status (channel) == MCD_CHANNEL_STATUS_FAILED) { DEBUG ("Channel %p failed already, never mind", channel); _mcd_channel_close (channel); mcd_mission_abort (MCD_MISSION (channel)); /* FIXME: the boolean return is a decoy - everyone returns TRUE and * every caller ignores it - so it's not clear what FALSE would * mean. */ return TRUE; } if (!mcd_mission_get_parent ((McdMission *)channel)) mcd_operation_take_mission (MCD_OPERATION (connection), MCD_MISSION (channel)); return _mcd_connection_request_channel (connection, channel); } void mcd_connection_close (McdConnection *connection, McdInhibit *inhibit) { g_return_if_fail (MCD_IS_CONNECTION (connection)); connection->priv->closed = TRUE; connection->priv->abort_reason = TP_CONNECTION_STATUS_REASON_REQUESTED; _mcd_connection_release_tp_connection (connection, inhibit); mcd_mission_abort (MCD_MISSION (connection)); } /* * _mcd_connection_connect: * @connection: the #McdConnection. * @params: a #GHashTable of connection parameters * * Activate @connection. */ void _mcd_connection_connect (McdConnection *connection, GHashTable *params) { McdConnectionPrivate *priv; TpConnectionStatus status = TP_CONNECTION_STATUS_DISCONNECTED; g_return_if_fail (MCD_IS_CONNECTION (connection)); g_return_if_fail (params != NULL); priv = connection->priv; g_return_if_fail (priv->tp_conn_mgr); g_return_if_fail (priv->account); DEBUG ("called for %p, account %s", connection, mcd_account_get_unique_name (priv->account)); if (priv->reconnect_timer) { g_source_remove (priv->reconnect_timer); priv->reconnect_timer = 0; } /* the account's status can be CONNECTING _before_ we get here, because * for the account that includes things like trying to bring up an IAP * via an McdTransport plugin. So we have to use the actual status of * the connection (or DISCONNECTED if we havan't got one yet) */ if (priv->tp_conn != NULL) status = tp_connection_get_status (priv->tp_conn, NULL); if (status == TP_CONNECTION_STATUS_DISCONNECTED || status == TP_UNKNOWN_CONNECTION_STATUS) { _mcd_connection_connect_with_params (connection, params); } else { DEBUG ("Not connecting because not disconnected (%i)", mcd_account_get_connection_status (priv->account)); } } const gchar * mcd_connection_get_object_path (McdConnection *connection) { McdConnectionPrivate *priv = connection->priv; if (priv->tp_conn) return tp_proxy_get_object_path (TP_PROXY (priv->tp_conn)); else return NULL; } const gchar * mcd_connection_get_name (McdConnection *connection) { McdConnectionPrivate *priv = connection->priv; if (priv->tp_conn) return tp_proxy_get_bus_name (TP_PROXY (priv->tp_conn)); else return NULL; } /** * _mcd_connection_update_property: * @connection: the #McdConnection. * @name: the qualified name of the property to be updated. * @value: the new value of the property. * * Sets the property @name to @value. */ void _mcd_connection_update_property (McdConnection *connection, const gchar *name, const GValue *value) { McdConnectionPrivate *priv; const gchar *dot, *member; gchar *interface; g_return_if_fail (MCD_IS_CONNECTION (connection)); g_return_if_fail (name != NULL); priv = connection->priv; if (G_UNLIKELY (!priv->tp_conn)) return; dot = strrchr (name, '.'); if (G_UNLIKELY (!dot)) return; interface = g_strndup (name, dot - name); member = dot + 1; tp_cli_dbus_properties_call_set (priv->tp_conn, -1, interface, member, value, NULL, NULL, NULL, NULL); g_free (interface); } void _mcd_connection_set_tp_connection (McdConnection *connection, const gchar *bus_name, const gchar *obj_path, GError **error) { McdConnectionPrivate *priv; GQuark features[] = { TP_CONNECTION_FEATURE_CONNECTED, 0 }; GError *inner_error = NULL; g_return_if_fail (MCD_IS_CONNECTION (connection)); g_return_if_fail (error != NULL); priv = connection->priv; if (priv->tp_conn != NULL) { if (G_UNLIKELY (!tp_strdiff (tp_proxy_get_object_path (priv->tp_conn), obj_path))) { /* not really meant to happen */ g_warning ("%s: We already have %s", G_STRFUNC, tp_proxy_get_object_path (priv->tp_conn)); return; } DEBUG ("releasing old connection first"); _mcd_connection_release_tp_connection (connection, NULL); } g_assert (priv->tp_conn == NULL); priv->tp_conn = tp_simple_client_factory_ensure_connection ( priv->client_factory, obj_path, NULL, &inner_error); DEBUG ("new connection is %p", priv->tp_conn); if (!priv->tp_conn) { GHashTable *details = tp_asv_new ( "debug-message", G_TYPE_STRING, inner_error->message, NULL); /* Constructing a TpConnection can only fail from invalid arguments, * which would mean either MC or the connection manager is confused. */ g_signal_emit (connection, signals[CONNECTION_STATUS_CHANGED], 0, TP_CONNECTION_STATUS_DISCONNECTED, TP_CONNECTION_STATUS_REASON_NONE_SPECIFIED, NULL, TP_ERROR_STR_CONFUSED, details); g_hash_table_unref (details); g_propagate_error (error, inner_error); return; } /* FIXME: need some way to feed the status into the Account, but we don't * actually know it yet */ _mcd_account_tp_connection_changed (priv->account, priv->tp_conn); /* Setup signals */ g_signal_connect (priv->tp_conn, "invalidated", G_CALLBACK (mcd_connection_invalidated_cb), connection); g_signal_connect (priv->tp_conn, "notify::status", G_CALLBACK (on_connection_status_changed), connection); /* HACK for cancelling the _call_when_ready() callback when our object gets * destroyed */ tp_proxy_prepare_async (priv->tp_conn, features, on_connection_ready, tp_weak_ref_new (connection, NULL, NULL)); } /** * mcd_connection_get_tp_connection: * @connection: the #McdConnection. * * Returns: the #TpConnection being used, or %NULL if none. */ TpConnection * mcd_connection_get_tp_connection (McdConnection *connection) { g_return_val_if_fail (MCD_IS_CONNECTION (connection), NULL); return connection->priv->tp_conn; } gboolean _mcd_connection_is_ready (McdConnection *self) { g_return_val_if_fail (MCD_IS_CONNECTION (self), FALSE); return (self->priv->tp_conn != NULL) && tp_proxy_is_prepared (self->priv->tp_conn, TP_CONNECTION_FEATURE_CONNECTED); } gboolean _mcd_connection_presence_info_is_ready (McdConnection *self) { g_return_val_if_fail (MCD_IS_CONNECTION (self), FALSE); return self->priv->presence_info_ready; } void _mcd_connection_take_emergency_numbers (McdConnection *self, GSList *numbers) { GSList *iter; if (self->priv->service_point_ids == NULL) self->priv->service_point_ids = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL); for (iter = numbers; iter != NULL; iter = iter->next) { GStrv ids = iter->data; gchar **id_p; /* We treat emergency numbers as "sticky": if a given ID has ever * been considered an emergency number, it stays an emergency number. * This seems safer than ever removing one and losing their special * treatment. */ for (id_p = ids; id_p != NULL && *id_p != NULL; id_p++) g_hash_table_add (self->priv->service_point_ids, *id_p); } /* GStrv members' ownership has already been transferred */ g_slist_free_full (numbers, g_free); } void mcd_connection_add_emergency_handle (McdConnection *self, TpHandle handle) { if (self->priv->service_point_handles == NULL) self->priv->service_point_handles = tp_intset_new (); /* As above, we treat emergency numbers as "sticky". */ tp_intset_add (self->priv->service_point_handles, handle); } telepathy-mission-control-5.16.4/src/plugin-dispatch-operation.c0000644000175000017500000002570512735242352026057 0ustar00gkiagiagkiagia00000000000000/* Representation of a dispatch operation as presented to plugins. This is * deliberately a "smaller" API than McdDispatchOperation. * * Copyright (C) 2009 Nokia Corporation * Copyright (C) 2009 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA * */ #include "config.h" #include "plugin-dispatch-operation.h" #include "mission-control-plugins/implementation.h" #include "mcd-channel-priv.h" #include "mcd-debug.h" /* a larger numeric value will override a smaller one */ typedef enum { PLUGIN_ACTION_NONE, PLUGIN_ACTION_CLOSE, PLUGIN_ACTION_LEAVE, PLUGIN_ACTION_DESTROY } PluginAction; enum { PROP_0, PROP_REAL_CDO }; struct _McdPluginDispatchOperation { GObject parent; McdDispatchOperation *real_cdo; PluginAction after_observers; TpChannelGroupChangeReason reason; gchar *message; }; struct _McdPluginDispatchOperationClass { GObjectClass parent; }; static void plugin_iface_init (McpDispatchOperationIface *iface, gpointer unused G_GNUC_UNUSED); G_DEFINE_TYPE_WITH_CODE (McdPluginDispatchOperation, _mcd_plugin_dispatch_operation, G_TYPE_OBJECT, G_IMPLEMENT_INTERFACE (MCP_TYPE_DISPATCH_OPERATION, plugin_iface_init)) static void _mcd_plugin_dispatch_operation_init (McdPluginDispatchOperation *self) { DEBUG ("%p", self); } static void plugin_do_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) { McdPluginDispatchOperation *self = (McdPluginDispatchOperation *) object; switch (prop_id) { case PROP_REAL_CDO: g_assert (self->real_cdo == NULL); /* construct-only */ /* The real CDO is borrowed, because this plugin API is owned by it */ self->real_cdo = g_value_get_object (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } } static void plugin_do_finalize (GObject *object) { McdPluginDispatchOperation *self = (McdPluginDispatchOperation *) object; GObjectFinalizeFunc finalize = G_OBJECT_CLASS (_mcd_plugin_dispatch_operation_parent_class)->finalize; DEBUG ("%p", object); g_free (self->message); if (finalize != NULL) finalize (object); } static void _mcd_plugin_dispatch_operation_class_init ( McdPluginDispatchOperationClass *cls) { GObjectClass *object_class = (GObjectClass *) cls; object_class->set_property = plugin_do_set_property; object_class->finalize = plugin_do_finalize; g_object_class_install_property (object_class, PROP_REAL_CDO, g_param_spec_object ("real-cdo", "Real channel dispatch operation", "Borrowed pointer to the underlying McdDispatchOperation", MCD_TYPE_DISPATCH_OPERATION, G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS)); } McdPluginDispatchOperation * _mcd_plugin_dispatch_operation_new (McdDispatchOperation *real_cdo) { McdPluginDispatchOperation *self; self = g_object_new (MCD_TYPE_PLUGIN_DISPATCH_OPERATION, "real-cdo", real_cdo, NULL); DEBUG ("%p (for %p)", self, real_cdo); return self; } static const gchar * plugin_do_get_account_path (McpDispatchOperation *obj) { McdPluginDispatchOperation *self = MCD_PLUGIN_DISPATCH_OPERATION (obj); g_return_val_if_fail (self != NULL, NULL); return _mcd_dispatch_operation_get_account_path (self->real_cdo); } static const gchar * plugin_do_get_connection_path (McpDispatchOperation *obj) { McdPluginDispatchOperation *self = MCD_PLUGIN_DISPATCH_OPERATION (obj); g_return_val_if_fail (self != NULL, NULL); return _mcd_dispatch_operation_get_connection_path (self->real_cdo); } static const gchar * plugin_do_get_protocol (McpDispatchOperation *obj) { McdPluginDispatchOperation *self = MCD_PLUGIN_DISPATCH_OPERATION (obj); g_return_val_if_fail (self != NULL, NULL); return _mcd_dispatch_operation_get_protocol (self->real_cdo); } static const gchar * plugin_do_get_cm_name (McpDispatchOperation *obj) { McdPluginDispatchOperation *self = MCD_PLUGIN_DISPATCH_OPERATION (obj); g_return_val_if_fail (self != NULL, NULL); return _mcd_dispatch_operation_get_cm_name (self->real_cdo); } /* Channels */ static guint plugin_do_get_n_channels (McpDispatchOperation *obj) { McdPluginDispatchOperation *self = MCD_PLUGIN_DISPATCH_OPERATION (obj); g_return_val_if_fail (self != NULL, 0); if (_mcd_dispatch_operation_peek_channel (self->real_cdo) != NULL) return 1; return 0; } static const gchar * plugin_do_get_nth_channel_path (McpDispatchOperation *obj, guint n) { McdPluginDispatchOperation *self = MCD_PLUGIN_DISPATCH_OPERATION (obj); McdChannel *channel; g_return_val_if_fail (self != NULL, NULL); channel = _mcd_dispatch_operation_peek_channel (self->real_cdo); if (channel == NULL || n != 0) return NULL; return mcd_channel_get_object_path (channel); } static GHashTable * plugin_do_ref_nth_channel_properties (McpDispatchOperation *obj, guint n) { McdPluginDispatchOperation *self = MCD_PLUGIN_DISPATCH_OPERATION (obj); McdChannel *channel; GVariant *variant; GValue value = G_VALUE_INIT; GHashTable *ret; g_return_val_if_fail (self != NULL, NULL); channel = _mcd_dispatch_operation_peek_channel (self->real_cdo); if (channel == NULL || n != 0) return NULL; variant = mcd_channel_dup_immutable_properties (channel); if (variant == NULL) return NULL; /* For compatibility, we have to return the older type here. */ dbus_g_value_parse_g_variant (variant, &value); g_assert (G_VALUE_HOLDS (&value, TP_HASH_TYPE_STRING_VARIANT_MAP)); ret = g_value_dup_boxed (&value); g_value_unset (&value); return ret; } /* Delay the dispatch */ /* an arbitrary constant, to detect use-after-free or wrong pointers */ #define DELAY_MAGIC 0xCD053 typedef struct { gsize magic; McdPluginDispatchOperation *self; } RealDelay; static McpDispatchOperationDelay * plugin_do_start_delay (McpDispatchOperation *obj) { McdPluginDispatchOperation *self = MCD_PLUGIN_DISPATCH_OPERATION (obj); RealDelay *delay; DEBUG ("%p", self); g_return_val_if_fail (self != NULL, NULL); delay = g_slice_new (RealDelay); delay->magic = DELAY_MAGIC; delay->self = g_object_ref (obj); _mcd_dispatch_operation_start_plugin_delay (self->real_cdo); return (McpDispatchOperationDelay *) delay; } static void plugin_do_end_delay (McpDispatchOperation *obj, McpDispatchOperationDelay *delay) { McdPluginDispatchOperation *self = MCD_PLUGIN_DISPATCH_OPERATION (obj); RealDelay *real_delay = (RealDelay *) delay; DEBUG ("%p", self); g_return_if_fail (self != NULL); g_return_if_fail (real_delay->self == self); g_return_if_fail (real_delay->magic == DELAY_MAGIC); real_delay->magic = ~(DELAY_MAGIC); real_delay->self = NULL; _mcd_dispatch_operation_end_plugin_delay (self->real_cdo); g_object_unref (self); } /* Close */ static void plugin_do_leave_channels (McpDispatchOperation *obj, gboolean wait_for_observers, TpChannelGroupChangeReason reason, const gchar *message) { McdPluginDispatchOperation *self = MCD_PLUGIN_DISPATCH_OPERATION (obj); DEBUG ("%p (wait=%c reason=%d message=%s)", self, wait_for_observers ? 'T' : 'F', reason, message); g_return_if_fail (self != NULL); if (wait_for_observers) { if (self->after_observers < PLUGIN_ACTION_LEAVE) { DEBUG ("Remembering for later"); self->after_observers = PLUGIN_ACTION_LEAVE; self->reason = reason; g_free (self->message); self->message = g_strdup (message); } } else { DEBUG ("Leaving now"); _mcd_dispatch_operation_leave_channels (self->real_cdo, reason, message); } } static void plugin_do_close_channels (McpDispatchOperation *obj, gboolean wait_for_observers) { McdPluginDispatchOperation *self = MCD_PLUGIN_DISPATCH_OPERATION (obj); DEBUG ("%p (wait=%c)", self, wait_for_observers ? 'T' : 'F'); g_return_if_fail (self != NULL); if (wait_for_observers) { if (self->after_observers < PLUGIN_ACTION_CLOSE) { DEBUG ("Remembering for later"); self->after_observers = PLUGIN_ACTION_CLOSE; } } else { DEBUG ("Closing now"); _mcd_dispatch_operation_close_channels (self->real_cdo); } } static void plugin_do_destroy_channels (McpDispatchOperation *obj, gboolean wait_for_observers) { McdPluginDispatchOperation *self = MCD_PLUGIN_DISPATCH_OPERATION (obj); DEBUG ("%p (wait=%c)", self, wait_for_observers ? 'T' : 'F'); g_return_if_fail (self != NULL); if (wait_for_observers) { if (self->after_observers < PLUGIN_ACTION_DESTROY) self->after_observers = PLUGIN_ACTION_DESTROY; } else { _mcd_dispatch_operation_destroy_channels (self->real_cdo); } } void _mcd_plugin_dispatch_operation_observers_finished ( McdPluginDispatchOperation *self) { DEBUG ("%p", self); switch (self->after_observers) { case PLUGIN_ACTION_DESTROY: DEBUG ("destroying now"); _mcd_dispatch_operation_destroy_channels (self->real_cdo); break; case PLUGIN_ACTION_LEAVE: DEBUG ("leaving now: %d %s", self->reason, self->message); _mcd_dispatch_operation_leave_channels (self->real_cdo, self->reason, self->message); break; case PLUGIN_ACTION_CLOSE: DEBUG ("closing now"); _mcd_dispatch_operation_close_channels (self->real_cdo); break; case PLUGIN_ACTION_NONE: /* nothing to do */ break; } } gboolean _mcd_plugin_dispatch_operation_will_terminate ( McdPluginDispatchOperation *self) { return (self->after_observers != PLUGIN_ACTION_NONE); } static void plugin_iface_init (McpDispatchOperationIface *iface, gpointer unused G_GNUC_UNUSED) { DEBUG ("called"); iface->get_account_path = plugin_do_get_account_path; iface->get_connection_path = plugin_do_get_connection_path; iface->get_protocol = plugin_do_get_protocol; iface->get_cm_name = plugin_do_get_cm_name; iface->get_n_channels = plugin_do_get_n_channels; iface->get_nth_channel_path = plugin_do_get_nth_channel_path; iface->ref_nth_channel_properties = plugin_do_ref_nth_channel_properties; iface->start_delay = plugin_do_start_delay; iface->end_delay = plugin_do_end_delay; iface->leave_channels = plugin_do_leave_channels; iface->close_channels = plugin_do_close_channels; iface->destroy_channels = plugin_do_destroy_channels; } telepathy-mission-control-5.16.4/src/request.h0000644000175000017500000001033612735241312022450 0ustar00gkiagiagkiagia00000000000000/* A Telepathy ChannelRequest object * * Copyright © 2009 Nokia Corporation * Copyright © 2009-2010 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA * */ #ifndef MCD_REQUEST_H #define MCD_REQUEST_H #include #include "client-registry.h" #include "mcd-account.h" G_BEGIN_DECLS typedef struct _McdRequest McdRequest; typedef struct _McdRequestClass McdRequestClass; typedef struct _McdRequestPrivate McdRequestPrivate; typedef void (*McdRequestInternalHandler) (McdRequest *, McdChannel *, gpointer, gboolean); G_GNUC_INTERNAL GType _mcd_request_get_type (void); #define MCD_TYPE_REQUEST \ (_mcd_request_get_type ()) #define MCD_REQUEST(obj) \ (G_TYPE_CHECK_INSTANCE_CAST ((obj), MCD_TYPE_REQUEST, \ McdRequest)) #define MCD_REQUEST_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST ((klass), MCD_TYPE_REQUEST, \ McdRequestClass)) #define MCD_IS_REQUEST(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MCD_TYPE_REQUEST)) #define MCD_IS_REQUEST_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE ((klass), MCD_TYPE_REQUEST)) #define MCD_REQUEST_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), MCD_TYPE_REQUEST, \ McdRequestClass)) G_GNUC_INTERNAL McdRequest *_mcd_request_new (McdClientRegistry *clients, gboolean use_existing, McdAccount *account, GHashTable *properties, gint64 user_action_time, const gchar *preferred_handler, GHashTable *hints); G_GNUC_INTERNAL gboolean _mcd_request_get_use_existing (McdRequest *self); G_GNUC_INTERNAL McdAccount *_mcd_request_get_account (McdRequest *self); G_GNUC_INTERNAL GHashTable *_mcd_request_get_properties (McdRequest *self); G_GNUC_INTERNAL GVariant *mcd_request_dup_properties (McdRequest *self); G_GNUC_INTERNAL gint64 _mcd_request_get_user_action_time (McdRequest *self); G_GNUC_INTERNAL const gchar *_mcd_request_get_preferred_handler ( McdRequest *self); G_GNUC_INTERNAL const gchar *_mcd_request_get_object_path (McdRequest *self); G_GNUC_INTERNAL GHashTable *_mcd_request_get_hints ( McdRequest *self); G_GNUC_INTERNAL GHashTable *_mcd_request_dup_immutable_properties ( McdRequest *self); G_GNUC_INTERNAL void _mcd_request_proceed (McdRequest *self, DBusGMethodInvocation *context); G_GNUC_INTERNAL void _mcd_request_start_delay (McdRequest *self); G_GNUC_INTERNAL void _mcd_request_end_delay (McdRequest *self); G_GNUC_INTERNAL gboolean _mcd_request_is_complete (McdRequest *self); G_GNUC_INTERNAL void _mcd_request_set_success (McdRequest *self, TpChannel *channel); G_GNUC_INTERNAL void _mcd_request_set_failure (McdRequest *self, GQuark domain, gint code, const gchar *message); G_GNUC_INTERNAL GError *_mcd_request_dup_failure (McdRequest *self); G_GNUC_INTERNAL void _mcd_request_set_uncancellable (McdRequest *self); G_GNUC_INTERNAL gboolean _mcd_request_cancel (McdRequest *self, GError **error); G_GNUC_INTERNAL void _mcd_request_predict_handler (McdRequest *self); G_GNUC_INTERNAL void _mcd_request_set_internal_handler (McdRequest *self, McdRequestInternalHandler handler, GFreeFunc free_func, gpointer data); G_GNUC_INTERNAL gboolean _mcd_request_handle_internally (McdRequest *self, McdChannel *channel, gboolean close_after); G_GNUC_INTERNAL void _mcd_request_clear_internal_handler (McdRequest *self); G_GNUC_INTERNAL gboolean _mcd_request_is_internal (McdRequest *self); G_GNUC_INTERNAL guint _mcd_request_block_account (const gchar *account); G_GNUC_INTERNAL guint _mcd_request_unblock_account (const gchar *account); G_END_DECLS #endif telepathy-mission-control-5.16.4/src/mcd-misc.h0000644000175000017500000000412312735241312022451 0ustar00gkiagiagkiagia00000000000000/* vi: set et sw=4 ts=4 cino=t0,(0: */ /* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * This file is part of mission-control * * Copyright (C) 2007-2009 Nokia Corporation. * Copyright (C) 2009 Collabora Ltd. * * Contact: Alberto Mardegan * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * version 2.1 as published by the Free Software Foundation. * * This library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA * */ #ifndef MCD_MISC_H #define MCD_MISC_H #include #include #include #include G_BEGIN_DECLS GHashTable *_mcd_deepcopy_asv (GHashTable *asv); gchar *_mcd_build_error_string (const GError *error); typedef void (*McdReadyCb) (gpointer object, const GError *error, gpointer user_data); void _mcd_object_call_when_ready (gpointer object, GQuark quark, McdReadyCb callback, gpointer user_data); void _mcd_object_call_on_struct_when_ready (gpointer object, gpointer strukt, GQuark quark, McdReadyCb callback, gpointer user_data); void _mcd_object_ready (gpointer object, GQuark quark, const GError *error); G_GNUC_INTERNAL void _mcd_ext_register_dbus_glib_marshallers (void); gboolean mcd_ensure_directory (const gchar *dir, GError **error); G_GNUC_INTERNAL int _mcd_chmod_private (const gchar *filename); gboolean mcd_nullable_variant_equal (GVariant *a, GVariant *b); G_END_DECLS #endif /* MCD_MISC_H */ telepathy-mission-control-5.16.4/src/mcd-client.c0000644000175000017500000015204112735242352022777 0ustar00gkiagiagkiagia00000000000000/* vi: set et sw=4 ts=8 cino=t0,(0: */ /* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4; tab-width: 8 -*- */ /* * Mission Control client proxy. * * Copyright (C) 2009-2010 Nokia Corporation * Copyright (C) 2009-2010 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA * */ #include "config.h" #include "mcd-client-priv.h" #include #include #include #include #include "channel-utils.h" #include "mcd-channel-priv.h" #include "mcd-debug.h" G_DEFINE_TYPE (McdClientProxy, _mcd_client_proxy, TP_TYPE_CLIENT); enum { PROP_0, PROP_ACTIVATABLE, PROP_STRING_POOL, PROP_UNIQUE_NAME, }; enum { S_READY, S_IS_HANDLING_CHANNEL, S_HANDLER_CAPABILITIES_CHANGED, S_GONE, S_NEED_RECOVERY, N_SIGNALS }; static guint signals[N_SIGNALS] = { 0 }; struct _McdClientProxyPrivate { GStrv capability_tokens; gchar *unique_name; guint ready_lock; gboolean introspect_started; gboolean ready; gboolean bypass_approval; gboolean bypass_observers; gboolean delay_approvers; gboolean recover; /* If a client was in the ListActivatableNames list, it must not be * removed when it disappear from the bus. */ gboolean activatable; /* Channel filters * A channel filter is a GHashTable of * - key: gchar *property_name * - value: GValue of one of the allowed types on the ObserverChannelFilter * spec. The following matching is observed: * * G_TYPE_STRING: 's' * * G_TYPE_BOOLEAN: 'b' * * DBUS_TYPE_G_OBJECT_PATH: 'o' * * G_TYPE_UINT64: 'y' (8b), 'q' (16b), 'u' (32b), 't' (64b) * * G_TYPE_INT64: 'n' (16b), 'i' (32b), 'x' (64b) * * The list can be NULL if there is no filter, or the filters are not yet * retrieven from the D-Bus *ChannelFitler properties. In the last case, * the dispatcher just don't dispatch to this client. */ GList *approver_filters; GList *handler_filters; GList *observer_filters; gboolean disposed; }; typedef enum { MCD_CLIENT_APPROVER, MCD_CLIENT_HANDLER, MCD_CLIENT_OBSERVER } McdClientInterface; void _mcd_client_proxy_inc_ready_lock (McdClientProxy *self) { g_return_if_fail (MCD_IS_CLIENT_PROXY (self)); if (self->priv->ready) return; g_return_if_fail (self->priv->ready_lock > 0); self->priv->ready_lock++; } void _mcd_client_proxy_dec_ready_lock (McdClientProxy *self) { g_return_if_fail (MCD_IS_CLIENT_PROXY (self)); if (self->priv->ready) return; g_return_if_fail (self->priv->ready_lock > 0); if (--self->priv->ready_lock == 0) { self->priv->ready = TRUE; g_signal_emit (self, signals[S_READY], 0); /* Activatable Observers needing recovery have already * been called (in order to reactivate them). */ if (self->priv->recover && !self->priv->activatable) g_signal_emit (self, signals[S_NEED_RECOVERY], 0); } } static void _mcd_client_proxy_take_approver_filters (McdClientProxy *self, GList *filters); static void _mcd_client_proxy_take_observer_filters (McdClientProxy *self, GList *filters); static void _mcd_client_proxy_take_handler_filters (McdClientProxy *self, GList *filters); static gchar * _mcd_client_proxy_find_client_file (const gchar *client_name) { const gchar * const *dirs; const gchar *dirname; const gchar *env_dirname; gchar *filename, *absolute_filepath; /* * The full path is $XDG_DATA_DIRS/telepathy/clients/clientname.client * or $XDG_DATA_HOME/telepathy/clients/clientname.client * For testing purposes, we also look for $MC_CLIENTS_DIR/clientname.client * if $MC_CLIENTS_DIR is set. */ filename = g_strdup_printf ("%s.client", client_name); env_dirname = g_getenv ("MC_CLIENTS_DIR"); if (env_dirname) { absolute_filepath = g_build_filename (env_dirname, filename, NULL); if (g_file_test (absolute_filepath, G_FILE_TEST_IS_REGULAR)) goto finish; g_free (absolute_filepath); } dirname = g_get_user_data_dir (); if (G_LIKELY (dirname)) { absolute_filepath = g_build_filename (dirname, "telepathy/clients", filename, NULL); if (g_file_test (absolute_filepath, G_FILE_TEST_IS_REGULAR)) goto finish; g_free (absolute_filepath); } dirs = g_get_system_data_dirs (); for (dirname = *dirs; dirname != NULL; dirs++, dirname = *dirs) { absolute_filepath = g_build_filename (dirname, "telepathy/clients", filename, NULL); if (g_file_test (absolute_filepath, G_FILE_TEST_IS_REGULAR)) goto finish; g_free (absolute_filepath); } absolute_filepath = NULL; finish: g_free (filename); return absolute_filepath; } static GHashTable * parse_client_filter (GKeyFile *file, const gchar *group) { GHashTable *filter; gchar **keys; gsize len; guint i; filter = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, (GDestroyNotify) tp_g_value_slice_free); keys = g_key_file_get_keys (file, group, &len, NULL); if (keys == NULL) len = 0; for (i = 0; i < len; i++) { const gchar *key; const gchar *space; gchar *file_property; gchar file_property_type; key = keys[i]; space = g_strrstr (key, " "); if (space == NULL || space[1] == '\0' || space[2] != '\0') { g_warning ("Invalid key %s in client file", key); continue; } file_property_type = space[1]; file_property = g_strndup (key, space - key); switch (file_property_type) { case 'q': case 'u': case 't': /* unsigned integer */ { /* g_key_file_get_integer cannot be used because we need * to support 64 bits */ guint x; GValue *value = tp_g_value_slice_new (G_TYPE_UINT64); gchar *str = g_key_file_get_string (file, group, key, NULL); errno = 0; x = g_ascii_strtoull (str, NULL, 0); if (errno != 0) { g_warning ("Invalid unsigned integer '%s' in client" " file", str); } else { g_value_set_uint64 (value, x); g_hash_table_insert (filter, file_property, value); } g_free (str); break; } case 'y': case 'n': case 'i': case 'x': /* signed integer */ { gint x; GValue *value = tp_g_value_slice_new (G_TYPE_INT64); gchar *str = g_key_file_get_string (file, group, key, NULL); errno = 0; x = g_ascii_strtoll (str, NULL, 0); if (errno != 0) { g_warning ("Invalid signed integer '%s' in client" " file", str); } else { g_value_set_int64 (value, x); g_hash_table_insert (filter, file_property, value); } g_free (str); break; } case 'b': { GValue *value = tp_g_value_slice_new (G_TYPE_BOOLEAN); gboolean b = g_key_file_get_boolean (file, group, key, NULL); g_value_set_boolean (value, b); g_hash_table_insert (filter, file_property, value); break; } case 's': { GValue *value = tp_g_value_slice_new (G_TYPE_STRING); gchar *str = g_key_file_get_string (file, group, key, NULL); g_value_take_string (value, str); g_hash_table_insert (filter, file_property, value); break; } case 'o': { GValue *value = tp_g_value_slice_new (DBUS_TYPE_G_OBJECT_PATH); gchar *str = g_key_file_get_string (file, group, key, NULL); g_value_take_boxed (value, str); g_hash_table_insert (filter, file_property, value); break; } default: g_warning ("Invalid key %s in client file", key); continue; } } g_strfreev (keys); return filter; } static void _mcd_client_proxy_set_cap_tokens (McdClientProxy *self, GStrv cap_tokens); static void _mcd_client_proxy_add_interfaces (McdClientProxy *self, const gchar * const *interfaces); static void parse_client_file (McdClientProxy *client, GKeyFile *file) { gchar **iface_names, **groups, **cap_tokens; guint i; gsize len = 0; gboolean is_approver, is_handler, is_observer; GList *approver_filters = NULL; GList *observer_filters = NULL; GList *handler_filters = NULL; iface_names = g_key_file_get_string_list (file, TP_IFACE_CLIENT, "Interfaces", 0, NULL); if (!iface_names) return; _mcd_client_proxy_add_interfaces (client, (const gchar * const *) iface_names); g_strfreev (iface_names); is_approver = tp_proxy_has_interface_by_id (client, TP_IFACE_QUARK_CLIENT_APPROVER); is_observer = tp_proxy_has_interface_by_id (client, TP_IFACE_QUARK_CLIENT_OBSERVER); is_handler = tp_proxy_has_interface_by_id (client, TP_IFACE_QUARK_CLIENT_HANDLER); /* parse filtering rules */ groups = g_key_file_get_groups (file, &len); for (i = 0; i < len; i++) { if (is_approver && g_str_has_prefix (groups[i], TP_IFACE_CLIENT_APPROVER ".ApproverChannelFilter ")) { approver_filters = g_list_prepend (approver_filters, parse_client_filter (file, groups[i])); } else if (is_handler && g_str_has_prefix (groups[i], TP_IFACE_CLIENT_HANDLER ".HandlerChannelFilter ")) { handler_filters = g_list_prepend (handler_filters, parse_client_filter (file, groups[i])); } else if (is_observer && g_str_has_prefix (groups[i], TP_IFACE_CLIENT_OBSERVER ".ObserverChannelFilter ")) { observer_filters = g_list_prepend (observer_filters, parse_client_filter (file, groups[i])); } } g_strfreev (groups); _mcd_client_proxy_take_approver_filters (client, approver_filters); _mcd_client_proxy_take_observer_filters (client, observer_filters); _mcd_client_proxy_take_handler_filters (client, handler_filters); /* Other client options */ client->priv->bypass_approval = g_key_file_get_boolean (file, TP_IFACE_CLIENT_HANDLER, "BypassApproval", NULL); client->priv->bypass_observers = g_key_file_get_boolean (file, TP_IFACE_CLIENT_HANDLER, "BypassObservers", NULL); client->priv->delay_approvers = g_key_file_get_boolean (file, TP_IFACE_CLIENT_OBSERVER, "DelayApprovers", NULL); client->priv->recover = g_key_file_get_boolean (file, TP_IFACE_CLIENT_OBSERVER, "Recover", NULL); cap_tokens = g_key_file_get_keys (file, TP_IFACE_CLIENT_HANDLER ".Capabilities", NULL, NULL); _mcd_client_proxy_set_cap_tokens (client, cap_tokens); g_strfreev (cap_tokens); } static void _mcd_client_proxy_set_filters (McdClientProxy *client, McdClientInterface interface, GPtrArray *filters) { GList *client_filters = NULL; guint i; for (i = 0 ; i < filters->len ; i++) { GHashTable *channel_class = g_ptr_array_index (filters, i); GHashTable *new_channel_class; GHashTableIter iter; gchar *property_name; GValue *property_value; gboolean valid_filter = TRUE; new_channel_class = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, (GDestroyNotify) tp_g_value_slice_free); g_hash_table_iter_init (&iter, channel_class); while (g_hash_table_iter_next (&iter, (gpointer *) &property_name, (gpointer *) &property_value)) { GValue *filter_value; GType property_type = G_VALUE_TYPE (property_value); if (property_type == G_TYPE_BOOLEAN || property_type == G_TYPE_STRING || property_type == DBUS_TYPE_G_OBJECT_PATH) { filter_value = tp_g_value_slice_new (G_VALUE_TYPE (property_value)); g_value_copy (property_value, filter_value); } else if (property_type == G_TYPE_UCHAR || property_type == G_TYPE_UINT || property_type == G_TYPE_UINT64) { filter_value = tp_g_value_slice_new (G_TYPE_UINT64); g_value_transform (property_value, filter_value); } else if (property_type == G_TYPE_INT || property_type == G_TYPE_INT64) { filter_value = tp_g_value_slice_new (G_TYPE_INT64); g_value_transform (property_value, filter_value); } else { /* invalid type, do not add this filter */ g_warning ("%s: Property %s has an invalid type (%s)", G_STRFUNC, property_name, g_type_name (G_VALUE_TYPE (property_value))); valid_filter = FALSE; break; } g_hash_table_insert (new_channel_class, g_strdup (property_name), filter_value); } if (valid_filter) client_filters = g_list_prepend (client_filters, new_channel_class); else g_hash_table_unref (new_channel_class); } switch (interface) { case MCD_CLIENT_OBSERVER: _mcd_client_proxy_take_observer_filters (client, client_filters); break; case MCD_CLIENT_APPROVER: _mcd_client_proxy_take_approver_filters (client, client_filters); break; case MCD_CLIENT_HANDLER: _mcd_client_proxy_take_handler_filters (client, client_filters); break; default: g_assert_not_reached (); } } /* This is NULL-safe for the last argument, for ease of use with * tp_asv_get_boxed */ static void _mcd_client_proxy_set_cap_tokens (McdClientProxy *self, GStrv cap_tokens) { g_strfreev (self->priv->capability_tokens); self->priv->capability_tokens = g_strdupv (cap_tokens); } static void _mcd_client_proxy_add_interfaces (McdClientProxy *self, const gchar * const *interfaces) { guint i; if (interfaces == NULL) return; for (i = 0; interfaces[i] != NULL; i++) { if (tp_dbus_check_valid_interface_name (interfaces[i], NULL)) { GQuark q = g_quark_from_string (interfaces[i]); DEBUG ("%s: %s", tp_proxy_get_bus_name (self), interfaces[i]); tp_proxy_add_interface_by_id ((TpProxy *) self, q); } } } static void _mcd_client_proxy_init (McdClientProxy *self) { self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, MCD_TYPE_CLIENT_PROXY, McdClientProxyPrivate); /* paired with first call to mcd_client_proxy_introspect */ self->priv->ready_lock = 1; } gboolean _mcd_client_proxy_is_ready (McdClientProxy *self) { g_return_val_if_fail (MCD_IS_CLIENT_PROXY (self), FALSE); return self->priv->ready; } gboolean _mcd_client_proxy_is_active (McdClientProxy *self) { g_return_val_if_fail (MCD_IS_CLIENT_PROXY (self), FALSE); return self->priv->unique_name != NULL && self->priv->unique_name[0] != '\0'; } gboolean _mcd_client_proxy_is_activatable (McdClientProxy *self) { g_return_val_if_fail (MCD_IS_CLIENT_PROXY (self), FALSE); return self->priv->activatable; } const gchar * _mcd_client_proxy_get_unique_name (McdClientProxy *self) { g_return_val_if_fail (MCD_IS_CLIENT_PROXY (self), NULL); return self->priv->unique_name; } void _mcd_client_recover_observer (McdClientProxy *self, TpChannel *channel, const gchar *account_path) { GPtrArray *satisfied_requests; GHashTable *observer_info; TpConnection *conn; const gchar *connection_path; GPtrArray *channels_array; satisfied_requests = g_ptr_array_new (); observer_info = g_hash_table_new (g_str_hash, g_str_equal); tp_asv_set_boolean (observer_info, "recovering", TRUE); tp_asv_set_boxed (observer_info, "request-properties", TP_HASH_TYPE_OBJECT_IMMUTABLE_PROPERTIES_MAP, g_hash_table_new (NULL, NULL)); channels_array = _mcd_tp_channel_details_build_from_tp_chan (channel); conn = tp_channel_get_connection (channel); connection_path = tp_proxy_get_object_path (conn); DEBUG ("calling ObserveChannels on %s for channel %p", tp_proxy_get_bus_name (self), channel); tp_cli_client_observer_call_observe_channels ( (TpClient *) self, -1, account_path, connection_path, channels_array, "/", satisfied_requests, observer_info, NULL, NULL, NULL, NULL); _mcd_tp_channel_details_free (channels_array); g_ptr_array_unref (satisfied_requests); g_hash_table_unref (observer_info); } static void _mcd_client_proxy_handler_get_all_cb (TpProxy *proxy, GHashTable *properties, const GError *error, gpointer p G_GNUC_UNUSED, GObject *o G_GNUC_UNUSED) { McdClientProxy *self = MCD_CLIENT_PROXY (proxy); const gchar *bus_name = tp_proxy_get_bus_name (self); GPtrArray *filters; GPtrArray *handled_channels; gboolean bypass; if (error != NULL) { DEBUG ("GetAll(Handler) for client %s failed: %s #%d: %s", bus_name, g_quark_to_string (error->domain), error->code, error->message); goto finally; } /* by now, we at least know whether the client is running or not */ g_assert (self->priv->unique_name != NULL); filters = tp_asv_get_boxed (properties, "HandlerChannelFilter", TP_ARRAY_TYPE_STRING_VARIANT_MAP_LIST); if (filters != NULL) { DEBUG ("%s has %u HandlerChannelFilter entries", bus_name, filters->len); _mcd_client_proxy_set_filters (self, MCD_CLIENT_HANDLER, filters); } else { DEBUG ("%s HandlerChannelFilter absent or wrong type, assuming " "no channels can match", bus_name); } /* if wrong type or absent, assuming False is reasonable */ bypass = tp_asv_get_boolean (properties, "BypassApproval", NULL); self->priv->bypass_approval = bypass; DEBUG ("%s has BypassApproval=%c", bus_name, bypass ? 'T' : 'F'); bypass = tp_asv_get_boolean (properties, "BypassObservers", NULL); self->priv->bypass_observers = bypass; DEBUG ("%s has BypassObservers=%c", bus_name, bypass ? 'T' : 'F'); /* don't emit handler-capabilities-changed if we're not actually available * any more - if that's the case, then we already signalled our loss of * any capabilities */ if (self->priv->unique_name[0] != '\0' || self->priv->activatable) { _mcd_client_proxy_set_cap_tokens (self, tp_asv_get_boxed (properties, "Capabilities", G_TYPE_STRV)); g_signal_emit (self, signals[S_HANDLER_CAPABILITIES_CHANGED], 0); } /* If our unique name is "", then we're not *really* handling these * channels - they're the last known information from before the * client exited - so don't claim them. * * At the moment, McdDispatcher deals with the transition from active * to inactive in a centralized way, so we don't need to signal that. */ if (self->priv->unique_name[0] != '\0') { guint i; handled_channels = tp_asv_get_boxed (properties, "HandledChannels", TP_ARRAY_TYPE_OBJECT_PATH_LIST); if (handled_channels != NULL) { for (i = 0; i < handled_channels->len; i++) { const gchar *path = g_ptr_array_index (handled_channels, i); g_signal_emit (self, signals[S_IS_HANDLING_CHANNEL], 0, path); } } } finally: _mcd_client_proxy_dec_ready_lock (self); } static void _mcd_client_proxy_get_channel_filter_cb (TpProxy *proxy, const GValue *value, const GError *error, gpointer user_data, GObject *o G_GNUC_UNUSED) { McdClientProxy *self = MCD_CLIENT_PROXY (proxy); McdClientInterface iface = GPOINTER_TO_UINT (user_data); if (error != NULL) { DEBUG ("error getting a filter list for client %s: %s #%d: %s", tp_proxy_get_object_path (self), g_quark_to_string (error->domain), error->code, error->message); goto finally; } if (!G_VALUE_HOLDS (value, TP_ARRAY_TYPE_STRING_VARIANT_MAP_LIST)) { DEBUG ("wrong type for filter property on client %s: %s", tp_proxy_get_object_path (self), G_VALUE_TYPE_NAME (value)); goto finally; } _mcd_client_proxy_set_filters (self, iface, g_value_get_boxed (value)); finally: _mcd_client_proxy_dec_ready_lock (self); } static void _mcd_client_proxy_observer_get_all_cb (TpProxy *proxy, GHashTable *properties, const GError *error, gpointer p G_GNUC_UNUSED, GObject *o G_GNUC_UNUSED) { McdClientProxy *self = MCD_CLIENT_PROXY (proxy); const gchar *bus_name = tp_proxy_get_bus_name (self); gboolean recover; GPtrArray *filters; if (error != NULL) { DEBUG ("GetAll(Observer) for client %s failed: %s #%d: %s", bus_name, g_quark_to_string (error->domain), error->code, error->message); goto finally; } /* by now, we at least know whether the client is running or not */ g_assert (self->priv->unique_name != NULL); /* FALSE if DelayApprovers is invalid or missing is a good fallback */ self->priv->delay_approvers = tp_asv_get_boolean ( properties, "DelayApprovers", NULL); DEBUG ("%s has DelayApprovers=%c", bus_name, self->priv->delay_approvers ? 'T' : 'F'); filters = tp_asv_get_boxed (properties, "ObserverChannelFilter", TP_ARRAY_TYPE_STRING_VARIANT_MAP_LIST); if (filters != NULL) { DEBUG ("%s has %u ObserverChannelFilter entries", bus_name, filters->len); _mcd_client_proxy_set_filters (self, MCD_CLIENT_OBSERVER, filters); } else { DEBUG ("%s ObserverChannelFilter absent or wrong type, assuming " "no channels can match", bus_name); } /* if wrong type or absent, assuming False is reasonable */ recover = tp_asv_get_boolean (properties, "Recover", NULL); self->priv->recover = recover; DEBUG ("%s has Recover=%c", bus_name, recover ? 'T' : 'F'); finally: _mcd_client_proxy_dec_ready_lock (self); } static void _mcd_client_proxy_get_interfaces_cb (TpProxy *proxy, const GValue *out_Value, const GError *error, gpointer user_data G_GNUC_UNUSED, GObject *weak_object G_GNUC_UNUSED) { McdClientProxy *self = MCD_CLIENT_PROXY (proxy); const gchar *bus_name = tp_proxy_get_bus_name (proxy); if (error != NULL) { DEBUG ("Error getting Interfaces for Client %s, assuming none: " "%s %d %s", bus_name, g_quark_to_string (error->domain), error->code, error->message); goto finally; } if (!G_VALUE_HOLDS (out_Value, G_TYPE_STRV)) { DEBUG ("Wrong type getting Interfaces for Client %s, assuming none: " "%s", bus_name, G_VALUE_TYPE_NAME (out_Value)); goto finally; } _mcd_client_proxy_add_interfaces (self, g_value_get_boxed (out_Value)); DEBUG ("Client %s", bus_name); if (tp_proxy_has_interface_by_id (proxy, TP_IFACE_QUARK_CLIENT_APPROVER)) { _mcd_client_proxy_inc_ready_lock (self); DEBUG ("%s is an Approver", bus_name); tp_cli_dbus_properties_call_get (self, -1, TP_IFACE_CLIENT_APPROVER, "ApproverChannelFilter", _mcd_client_proxy_get_channel_filter_cb, GUINT_TO_POINTER (MCD_CLIENT_APPROVER), NULL, NULL); } if (tp_proxy_has_interface_by_id (proxy, TP_IFACE_QUARK_CLIENT_HANDLER)) { _mcd_client_proxy_inc_ready_lock (self); DEBUG ("%s is a Handler", bus_name); tp_cli_dbus_properties_call_get_all (self, -1, TP_IFACE_CLIENT_HANDLER, _mcd_client_proxy_handler_get_all_cb, NULL, NULL, NULL); } if (tp_proxy_has_interface_by_id (proxy, TP_IFACE_QUARK_CLIENT_OBSERVER)) { _mcd_client_proxy_inc_ready_lock (self); DEBUG ("%s is an Observer", bus_name); tp_cli_dbus_properties_call_get_all (self, -1, TP_IFACE_CLIENT_OBSERVER, _mcd_client_proxy_observer_get_all_cb, NULL, NULL, NULL); } finally: _mcd_client_proxy_dec_ready_lock (self); } static gboolean _mcd_client_proxy_parse_client_file (McdClientProxy *self) { gboolean file_found = FALSE; gchar *filename; const gchar *bus_name = tp_proxy_get_bus_name (self); filename = _mcd_client_proxy_find_client_file ( bus_name + MC_CLIENT_BUS_NAME_BASE_LEN); if (filename) { GKeyFile *file; GError *error = NULL; file = g_key_file_new (); g_key_file_load_from_file (file, filename, 0, &error); if (G_LIKELY (!error)) { DEBUG ("File found for %s: %s", bus_name, filename); parse_client_file (self, file); file_found = TRUE; } else { g_warning ("Loading file %s failed: %s", filename, error->message); g_error_free (error); } g_key_file_free (file); g_free (filename); } return file_found; } static gboolean mcd_client_proxy_introspect (gpointer data) { McdClientProxy *self = data; const gchar *bus_name = tp_proxy_get_bus_name (self); if (self->priv->introspect_started) { return FALSE; } self->priv->introspect_started = TRUE; /* The .client file is not mandatory as per the spec. However if it * exists, it is better to read it than activating the service to read the * D-Bus properties. */ if (!_mcd_client_proxy_parse_client_file (self)) { DEBUG ("No .client file for %s. Ask on D-Bus.", bus_name); _mcd_client_proxy_inc_ready_lock (self); tp_cli_dbus_properties_call_get (self, -1, TP_IFACE_CLIENT, "Interfaces", _mcd_client_proxy_get_interfaces_cb, NULL, NULL, NULL); } else { if (tp_proxy_has_interface_by_id (self, TP_IFACE_QUARK_CLIENT_HANDLER)) { if (_mcd_client_proxy_is_active (self)) { DEBUG ("%s is an active, activatable Handler", bus_name); /* We need to investigate whether it is handling any channels */ _mcd_client_proxy_inc_ready_lock (self); tp_cli_dbus_properties_call_get_all (self, -1, TP_IFACE_CLIENT_HANDLER, _mcd_client_proxy_handler_get_all_cb, NULL, NULL, NULL); } else { /* for us to have ever started introspecting, it must be * activatable */ DEBUG ("%s is a Handler but not active", bus_name); /* FIXME: we emit this even if the capabilities we got from the * .client file match those we already had, possibly causing * redundant UpdateCapabilities calls - however, those are * harmless */ g_signal_emit (self, signals[S_HANDLER_CAPABILITIES_CHANGED], 0); } } } _mcd_client_proxy_dec_ready_lock (self); return FALSE; } static void mcd_client_proxy_unique_name_cb (TpDBusDaemon *dbus_daemon, const gchar *well_known_name G_GNUC_UNUSED, const gchar *unique_name, gpointer user_data) { McdClientProxy *self = MCD_CLIENT_PROXY (user_data); gboolean should_recover = FALSE; g_object_ref (self); if (unique_name == NULL || unique_name[0] == '\0') { _mcd_client_proxy_set_inactive (self); /* To recover activatable Observers, we just need to call * ObserveChannels on them. */ should_recover = self->priv->recover && self->priv->activatable; } else { _mcd_client_proxy_set_active (self, unique_name); } mcd_client_proxy_introspect (self); if (should_recover) g_signal_emit (self, signals[S_NEED_RECOVERY], 0); g_object_unref (self); } static void mcd_client_proxy_dispose (GObject *object) { McdClientProxy *self = MCD_CLIENT_PROXY (object); void (*chain_up) (GObject *) = ((GObjectClass *) _mcd_client_proxy_parent_class)->dispose; if (self->priv->disposed) return; self->priv->disposed = TRUE; tp_dbus_daemon_cancel_name_owner_watch (tp_proxy_get_dbus_daemon (self), tp_proxy_get_bus_name (self), mcd_client_proxy_unique_name_cb, self); tp_clear_pointer (&self->priv->capability_tokens, g_strfreev); if (chain_up != NULL) { chain_up (object); } } static void mcd_client_proxy_finalize (GObject *object) { McdClientProxy *self = MCD_CLIENT_PROXY (object); void (*chain_up) (GObject *) = ((GObjectClass *) _mcd_client_proxy_parent_class)->finalize; g_free (self->priv->unique_name); _mcd_client_proxy_take_approver_filters (self, NULL); _mcd_client_proxy_take_observer_filters (self, NULL); _mcd_client_proxy_take_handler_filters (self, NULL); if (chain_up != NULL) { chain_up (object); } } static void mcd_client_proxy_constructed (GObject *object) { McdClientProxy *self = MCD_CLIENT_PROXY (object); void (*chain_up) (GObject *) = ((GObjectClass *) _mcd_client_proxy_parent_class)->constructed; const gchar *bus_name; if (chain_up != NULL) { chain_up (object); } bus_name = tp_proxy_get_bus_name (self); self->priv->capability_tokens = NULL; DEBUG ("%s", bus_name); tp_dbus_daemon_watch_name_owner (tp_proxy_get_dbus_daemon (self), bus_name, mcd_client_proxy_unique_name_cb, self, NULL); if (self->priv->unique_name != NULL) { /* we already know who we are, so we can skip straight to the * introspection. It's safe to call mcd_client_proxy_introspect * any number of times, so we don't need to guard against * duplication */ g_idle_add_full (G_PRIORITY_HIGH, mcd_client_proxy_introspect, g_object_ref (self), g_object_unref); } } static void mcd_client_proxy_set_property (GObject *object, guint property, const GValue *value, GParamSpec *param_spec) { McdClientProxy *self = MCD_CLIENT_PROXY (object); switch (property) { case PROP_ACTIVATABLE: self->priv->activatable = g_value_get_boolean (value); break; case PROP_UNIQUE_NAME: g_assert (self->priv->unique_name == NULL); self->priv->unique_name = g_value_dup_string (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property, param_spec); } } static void _mcd_client_proxy_class_init (McdClientProxyClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); g_type_class_add_private (object_class, sizeof (McdClientProxyPrivate)); object_class->constructed = mcd_client_proxy_constructed; object_class->dispose = mcd_client_proxy_dispose; object_class->finalize = mcd_client_proxy_finalize; object_class->set_property = mcd_client_proxy_set_property; signals[S_READY] = g_signal_new ("ready", G_OBJECT_CLASS_TYPE (klass), G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0); signals[S_GONE] = g_signal_new ("gone", G_OBJECT_CLASS_TYPE (klass), G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0); /* Never emitted until after the unique name is known */ signals[S_IS_HANDLING_CHANNEL] = g_signal_new ("is-handling-channel", G_OBJECT_CLASS_TYPE (klass), G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED, 0, NULL, NULL, g_cclosure_marshal_VOID__STRING, G_TYPE_NONE, 1, G_TYPE_STRING); /* Never emitted until after the unique name is known */ signals[S_HANDLER_CAPABILITIES_CHANGED] = g_signal_new ( "handler-capabilities-changed", G_OBJECT_CLASS_TYPE (klass), G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0); signals[S_NEED_RECOVERY] = g_signal_new ("need-recovery", G_OBJECT_CLASS_TYPE (klass), G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0); g_object_class_install_property (object_class, PROP_ACTIVATABLE, g_param_spec_boolean ("activatable", "Activatable?", "TRUE if this client can be service-activated", FALSE, G_PARAM_WRITABLE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (object_class, PROP_UNIQUE_NAME, g_param_spec_string ("unique-name", "Unique name", "The D-Bus unique name of this client, \"\" if not running or " "NULL if unknown", NULL, G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS)); } gboolean _mcd_client_check_valid_name (const gchar *name_suffix, GError **error) { guint i; if (!g_ascii_isalpha (*name_suffix)) { g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Client names must start with a letter"); return FALSE; } for (i = 1; name_suffix[i] != '\0'; i++) { if (i > (255 - MC_CLIENT_BUS_NAME_BASE_LEN)) { g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Client name too long"); } if (name_suffix[i] == '_' || g_ascii_isalpha (name_suffix[i])) { continue; } if (name_suffix[i] == '.' || g_ascii_isdigit (name_suffix[i])) { if (name_suffix[i-1] == '.') { g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Client names must not have a digit or dot " "following a dot"); return FALSE; } } else { g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Client names must not contain '%c'", name_suffix[i]); return FALSE; } } if (name_suffix[i-1] == '.') { g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Client names must not end with a dot"); return FALSE; } return TRUE; } McdClientProxy * _mcd_client_proxy_new (TpDBusDaemon *dbus_daemon, const gchar *well_known_name, const gchar *unique_name_if_known, gboolean activatable) { McdClientProxy *self; const gchar *name_suffix; gchar *object_path; g_return_val_if_fail (g_str_has_prefix (well_known_name, TP_CLIENT_BUS_NAME_BASE), NULL); name_suffix = well_known_name + MC_CLIENT_BUS_NAME_BASE_LEN; g_return_val_if_fail (_mcd_client_check_valid_name (name_suffix, NULL), NULL); object_path = g_strconcat ("/", well_known_name, NULL); g_strdelimit (object_path, ".", '/'); g_assert (tp_dbus_check_valid_bus_name (well_known_name, TP_DBUS_NAME_TYPE_WELL_KNOWN, NULL)); g_assert (tp_dbus_check_valid_object_path (object_path, NULL)); self = g_object_new (MCD_TYPE_CLIENT_PROXY, "dbus-daemon", dbus_daemon, "object-path", object_path, "bus-name", well_known_name, "unique-name", unique_name_if_known, "activatable", activatable, NULL); g_free (object_path); return self; } static void _mcd_client_proxy_become_incapable (McdClientProxy *self); void _mcd_client_proxy_set_inactive (McdClientProxy *self) { g_return_if_fail (MCD_IS_CLIENT_PROXY (self)); /* if unique name is already "" (i.e. known to be inactive), do nothing */ if (self->priv->unique_name != NULL && self->priv->unique_name[0] == '\0') { return; } g_free (self->priv->unique_name); self->priv->unique_name = g_strdup (""); if (!self->priv->activatable) { /* in ContactCapabilities we indicate the disappearance * of a client by giving it an empty set of capabilities and * filters */ _mcd_client_proxy_become_incapable (self); g_signal_emit (self, signals[S_GONE], 0); } } void _mcd_client_proxy_set_active (McdClientProxy *self, const gchar *unique_name) { g_return_if_fail (MCD_IS_CLIENT_PROXY (self)); g_return_if_fail (unique_name != NULL); g_free (self->priv->unique_name); self->priv->unique_name = g_strdup (unique_name); } void _mcd_client_proxy_set_activatable (McdClientProxy *self) { g_return_if_fail (MCD_IS_CLIENT_PROXY (self)); self->priv->activatable = TRUE; } const GList * _mcd_client_proxy_get_approver_filters (McdClientProxy *self) { g_return_val_if_fail (MCD_IS_CLIENT_PROXY (self), NULL); return self->priv->approver_filters; } const GList * _mcd_client_proxy_get_observer_filters (McdClientProxy *self) { g_return_val_if_fail (MCD_IS_CLIENT_PROXY (self), NULL); return self->priv->observer_filters; } const GList * _mcd_client_proxy_get_handler_filters (McdClientProxy *self) { g_return_val_if_fail (MCD_IS_CLIENT_PROXY (self), NULL); return self->priv->handler_filters; } static void mcd_client_proxy_free_client_filters (GList **client_filters) { g_assert (client_filters != NULL); if (*client_filters != NULL) { g_list_foreach (*client_filters, (GFunc) g_hash_table_unref, NULL); g_list_free (*client_filters); *client_filters = NULL; } } void _mcd_client_proxy_take_approver_filters (McdClientProxy *self, GList *filters) { g_return_if_fail (MCD_IS_CLIENT_PROXY (self)); mcd_client_proxy_free_client_filters (&(self->priv->approver_filters)); self->priv->approver_filters = filters; } void _mcd_client_proxy_take_observer_filters (McdClientProxy *self, GList *filters) { g_return_if_fail (MCD_IS_CLIENT_PROXY (self)); mcd_client_proxy_free_client_filters (&(self->priv->observer_filters)); self->priv->observer_filters = filters; } void _mcd_client_proxy_take_handler_filters (McdClientProxy *self, GList *filters) { g_return_if_fail (MCD_IS_CLIENT_PROXY (self)); mcd_client_proxy_free_client_filters (&(self->priv->handler_filters)); self->priv->handler_filters = filters; } gboolean _mcd_client_proxy_get_bypass_approval (McdClientProxy *self) { g_return_val_if_fail (MCD_IS_CLIENT_PROXY (self), FALSE); return self->priv->bypass_approval; } gboolean _mcd_client_proxy_get_bypass_observers (McdClientProxy *self) { g_return_val_if_fail (MCD_IS_CLIENT_PROXY (self), FALSE); return self->priv->bypass_observers; } gboolean _mcd_client_proxy_get_delay_approvers (McdClientProxy *self) { g_return_val_if_fail (MCD_IS_CLIENT_PROXY (self), FALSE); return self->priv->delay_approvers; } static void _mcd_client_proxy_become_incapable (McdClientProxy *self) { gboolean handler_was_capable = (self->priv->handler_filters != NULL); if (self->priv->capability_tokens != NULL && self->priv->capability_tokens[0] != NULL) { handler_was_capable = TRUE; } _mcd_client_proxy_take_approver_filters (self, NULL); _mcd_client_proxy_take_observer_filters (self, NULL); _mcd_client_proxy_take_handler_filters (self, NULL); tp_clear_pointer (&self->priv->capability_tokens, g_strfreev); if (handler_was_capable) { g_signal_emit (self, signals[S_HANDLER_CAPABILITIES_CHANGED], 0); } } GValueArray * _mcd_client_proxy_dup_handler_capabilities (McdClientProxy *self) { GPtrArray *filters; GStrv cap_tokens; GValueArray *va; const GList *list; gchar *empty_strv[] = { NULL }; g_return_val_if_fail (MCD_IS_CLIENT_PROXY (self), NULL); filters = g_ptr_array_sized_new ( g_list_length (self->priv->handler_filters)); for (list = self->priv->handler_filters; list != NULL; list = list->next) { GHashTable *copy = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, (GDestroyNotify) tp_g_value_slice_free); tp_g_hash_table_update (copy, list->data, (GBoxedCopyFunc) g_strdup, (GBoxedCopyFunc) tp_g_value_slice_dup); g_ptr_array_add (filters, copy); } cap_tokens = self->priv->capability_tokens; if (cap_tokens == NULL) cap_tokens = empty_strv; if (DEBUGGING) { guint i; DEBUG ("%s:", tp_proxy_get_bus_name (self)); DEBUG ("- %u channel filters", filters->len); DEBUG ("- %u capability tokens:", g_strv_length (cap_tokens)); for (i = 0; cap_tokens[i] != NULL; i++) { DEBUG (" %s", cap_tokens[i]); } DEBUG ("-end-"); } va = g_value_array_new (3); g_value_array_append (va, NULL); g_value_array_append (va, NULL); g_value_array_append (va, NULL); g_value_init (va->values + 0, G_TYPE_STRING); g_value_init (va->values + 1, TP_ARRAY_TYPE_CHANNEL_CLASS_LIST); g_value_init (va->values + 2, G_TYPE_STRV); g_value_set_string (va->values + 0, tp_proxy_get_bus_name (self)); g_value_take_boxed (va->values + 1, filters); g_value_set_boxed (va->values + 2, cap_tokens); return va; } /* returns TRUE if the channel matches one property criteria */ static gboolean _mcd_client_match_property (GVariant *channel_properties, gchar *property_name, GValue *filter_value) { GType filter_type = G_VALUE_TYPE (filter_value); g_return_val_if_fail (g_variant_is_of_type (channel_properties, G_VARIANT_TYPE_VARDICT), FALSE); g_assert (G_IS_VALUE (filter_value)); if (filter_type == G_TYPE_STRING) { const gchar *string; string = tp_vardict_get_string (channel_properties, property_name); if (!string) return FALSE; return !tp_strdiff (string, g_value_get_string (filter_value)); } if (filter_type == DBUS_TYPE_G_OBJECT_PATH) { const gchar *path; path = tp_vardict_get_object_path (channel_properties, property_name); if (!path) return FALSE; return !tp_strdiff (path, g_value_get_boxed (filter_value)); } if (filter_type == G_TYPE_BOOLEAN) { gboolean valid; gboolean b; b = tp_vardict_get_boolean (channel_properties, property_name, &valid); if (!valid) return FALSE; return !!b == !!g_value_get_boolean (filter_value); } if (filter_type == G_TYPE_UCHAR || filter_type == G_TYPE_UINT || filter_type == G_TYPE_UINT64) { gboolean valid; guint64 i; i = tp_vardict_get_uint64 (channel_properties, property_name, &valid); if (!valid) return FALSE; if (filter_type == G_TYPE_UCHAR) return i == g_value_get_uchar (filter_value); else if (filter_type == G_TYPE_UINT) return i == g_value_get_uint (filter_value); else return i == g_value_get_uint64 (filter_value); } if (filter_type == G_TYPE_INT || filter_type == G_TYPE_INT64) { gboolean valid; gint64 i; i = tp_vardict_get_int64 (channel_properties, property_name, &valid); if (!valid) return FALSE; if (filter_type == G_TYPE_INT) return i == g_value_get_int (filter_value); else return i == g_value_get_int64 (filter_value); } g_warning ("%s: Invalid type: %s", G_STRFUNC, g_type_name (filter_type)); return FALSE; } /* if the channel matches one of the channel filters, returns a positive * number that increases with more specific matches; otherwise, returns 0 * * (implementation detail: the positive number is 1 + the number of keys in the * largest filter that matched) */ guint _mcd_client_match_filters (GVariant *channel_properties, const GList *filters, gboolean assume_requested) { const GList *list; guint best_quality = 0; g_return_val_if_fail (g_variant_is_of_type (channel_properties, G_VARIANT_TYPE_VARDICT), 0); for (list = filters; list != NULL; list = list->next) { GHashTable *filter = list->data; GHashTableIter filter_iter; gboolean filter_matched = TRUE; gchar *property_name; GValue *filter_value; guint quality; /* +1 because the empty hash table matches everything :-) */ quality = g_hash_table_size (filter) + 1; if (quality <= best_quality) { /* even if this filter matches, there's no way it can be a * better-quality match than the best one we saw so far */ continue; } g_hash_table_iter_init (&filter_iter, filter); while (g_hash_table_iter_next (&filter_iter, (gpointer *) &property_name, (gpointer *) &filter_value)) { if (assume_requested && ! tp_strdiff (property_name, TP_IFACE_CHANNEL ".Requested")) { if (! G_VALUE_HOLDS_BOOLEAN (filter_value) || ! g_value_get_boolean (filter_value)) { filter_matched = FALSE; break; } } else if (! _mcd_client_match_property (channel_properties, property_name, filter_value)) { filter_matched = FALSE; break; } } if (filter_matched) { best_quality = quality; } } return best_quality; } static const gchar * borrow_channel_account_path (McdChannel *channel) { McdAccount *account; const gchar *account_path; account = mcd_channel_get_account (channel); account_path = account == NULL ? "/" : mcd_account_get_object_path (account); if (G_UNLIKELY (account_path == NULL)) /* can't happen? */ account_path = "/"; return account_path; } static const gchar * borrow_channel_connection_path (McdChannel *channel) { TpChannel *tp_channel; TpConnection *tp_connection; const gchar *connection_path; tp_channel = mcd_channel_get_tp_channel (channel); g_return_val_if_fail (tp_channel != NULL, "/"); tp_connection = tp_channel_get_connection (tp_channel); g_return_val_if_fail (tp_connection != NULL, "/"); connection_path = tp_proxy_get_object_path (tp_connection); g_return_val_if_fail (connection_path != NULL, "/"); return connection_path; } void _mcd_client_proxy_handle_channels (McdClientProxy *self, gint timeout_ms, const GList *channels, gint64 user_action_time, GHashTable *handler_info, tp_cli_client_handler_callback_for_handle_channels callback, gpointer user_data, GDestroyNotify destroy, GObject *weak_object) { GPtrArray *channel_details; GPtrArray *requests_satisfied; const GList *iter; g_return_if_fail (MCD_IS_CLIENT_PROXY (self)); g_return_if_fail (channels != NULL); DEBUG ("calling HandleChannels on %s", tp_proxy_get_bus_name (self)); channel_details = _mcd_tp_channel_details_build_from_list (channels); requests_satisfied = g_ptr_array_new_with_free_func (g_free); if (handler_info == NULL) { handler_info = g_hash_table_new (g_str_hash, g_str_equal); } else { g_hash_table_ref (handler_info); } for (iter = channels; iter != NULL; iter = iter->next) { gint64 req_time = 0; GHashTable *requests; GHashTableIter it; gpointer path; requests = _mcd_channel_get_satisfied_requests (iter->data, &req_time); g_hash_table_iter_init (&it, requests); while (g_hash_table_iter_next (&it, &path, NULL)) { g_ptr_array_add (requests_satisfied, g_strdup (path)); } g_hash_table_unref (requests); /* Numerical order is correct for all currently supported values: * * (TP_USER_ACTION_TIME_NOT_USER_ACTION == 0) is less than * (normal X11 timestamps, which are 1 to G_MAXUINT32) are less than * (TP_USER_ACTION_TIME_CURRENT_TIME == G_MAXINT64) */ if (req_time > user_action_time) user_action_time = req_time; _mcd_channel_set_status (iter->data, MCD_CHANNEL_STATUS_HANDLER_INVOKED); } tp_cli_client_handler_call_handle_channels ((TpClient *) self, timeout_ms, borrow_channel_account_path (channels->data), borrow_channel_connection_path (channels->data), channel_details, requests_satisfied, user_action_time, handler_info, callback, user_data, destroy, weak_object); _mcd_tp_channel_details_free (channel_details); g_ptr_array_unref (requests_satisfied); g_hash_table_unref (handler_info); } telepathy-mission-control-5.16.4/src/mcd-account-manager-default.c0000644000175000017500000002363012735242352026210 0ustar00gkiagiagkiagia00000000000000/* * The default account manager keyfile storage pseudo-plugin * * Copyright © 2010 Nokia Corporation * Copyright © 2010 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "config.h" #include #include #include #include #include "mcd-account-manager-default.h" #include "mcd-debug.h" #include "mcd-misc.h" #define PLUGIN_NAME "default-gkeyfile" #define PLUGIN_PRIORITY MCP_ACCOUNT_STORAGE_PLUGIN_PRIO_DEFAULT #define PLUGIN_DESCRIPTION "GKeyFile (default) account storage backend" #define INITIAL_CONFIG "# Telepathy accounts\n" static void account_storage_iface_init (McpAccountStorageIface *, gpointer); G_DEFINE_TYPE_WITH_CODE (McdAccountManagerDefault, mcd_account_manager_default, G_TYPE_OBJECT, G_IMPLEMENT_INTERFACE (MCP_TYPE_ACCOUNT_STORAGE, account_storage_iface_init)); static gchar * get_old_filename (void) { const gchar *base; base = g_getenv ("MC_ACCOUNT_DIR"); if (!base) base = ACCOUNTS_DIR; if (!base) return NULL; if (base[0] == '~') return g_build_filename (g_get_home_dir(), base + 1, "accounts.cfg", NULL); else return g_build_filename (base, "accounts.cfg", NULL); } static gchar * account_filename_in (const gchar *dir) { return g_build_filename (dir, "telepathy", "mission-control", "accounts.cfg", NULL); } static void mcd_account_manager_default_init (McdAccountManagerDefault *self) { DEBUG ("mcd_account_manager_default_init"); self->filename = account_filename_in (g_get_user_data_dir ()); self->keyfile = g_key_file_new (); self->removed = g_key_file_new (); self->removed_accounts = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL); self->save = FALSE; self->loaded = FALSE; } static void mcd_account_manager_default_class_init (McdAccountManagerDefaultClass *cls) { DEBUG ("mcd_account_manager_default_class_init"); } /* We happen to know that the string MC gave us is "sufficiently escaped" to * put it in the keyfile as-is. */ static gboolean _set (const McpAccountStorage *self, const McpAccountManager *am, const gchar *account, const gchar *key, const gchar *val) { McdAccountManagerDefault *amd = MCD_ACCOUNT_MANAGER_DEFAULT (self); amd->save = TRUE; if (val != NULL) g_key_file_set_value (amd->keyfile, account, key, val); else g_key_file_remove_key (amd->keyfile, account, key, NULL); return TRUE; } static gboolean _get (const McpAccountStorage *self, const McpAccountManager *am, const gchar *account, const gchar *key) { McdAccountManagerDefault *amd = MCD_ACCOUNT_MANAGER_DEFAULT (self); if (key != NULL) { gchar *v = NULL; v = g_key_file_get_value (amd->keyfile, account, key, NULL); if (v == NULL) return FALSE; mcp_account_manager_set_value (am, account, key, v); g_free (v); } else { gsize i; gsize n; GStrv keys = g_key_file_get_keys (amd->keyfile, account, &n, NULL); if (keys == NULL) n = 0; for (i = 0; i < n; i++) { gchar *v = g_key_file_get_value (amd->keyfile, account, keys[i], NULL); if (v != NULL) mcp_account_manager_set_value (am, account, keys[i], v); g_free (v); } g_strfreev (keys); } return TRUE; } static gchar * _create (const McpAccountStorage *self, const McpAccountManager *am, const gchar *manager, const gchar *protocol, GHashTable *params, GError **error) { gchar *unique_name; /* See comment in plugin-account.c::_storage_create_account() before changing * this implementation, it's more subtle than it looks */ unique_name = mcp_account_manager_get_unique_name (MCP_ACCOUNT_MANAGER (am), manager, protocol, params); g_return_val_if_fail (unique_name != NULL, NULL); return unique_name; } static gboolean _delete (const McpAccountStorage *self, const McpAccountManager *am, const gchar *account, const gchar *key) { McdAccountManagerDefault *amd = MCD_ACCOUNT_MANAGER_DEFAULT (self); if (key == NULL) { if (g_key_file_remove_group (amd->keyfile, account, NULL)) amd->save = TRUE; } else { gsize n; GStrv keys; gboolean save = FALSE; save = g_key_file_remove_key (amd->keyfile, account, key, NULL); if (save) amd->save = TRUE; keys = g_key_file_get_keys (amd->keyfile, account, &n, NULL); /* if that was the last parameter, the account is gone too */ if (keys == NULL || n == 0) { g_key_file_remove_group (amd->keyfile, account, NULL); } g_strfreev (keys); } return TRUE; } static gboolean _commit (const McpAccountStorage *self, const McpAccountManager *am, const gchar *account) { gsize n; gchar *data; McdAccountManagerDefault *amd = MCD_ACCOUNT_MANAGER_DEFAULT (self); gboolean rval = FALSE; gchar *dir; GError *error = NULL; if (!amd->save) return TRUE; dir = g_path_get_dirname (amd->filename); DEBUG ("Saving accounts to %s", amd->filename); if (!mcd_ensure_directory (dir, &error)) { g_warning ("%s", error->message); g_clear_error (&error); /* fall through anyway: writing to the file will fail, but it does * give us a chance to commit to the keyring too */ } g_free (dir); data = g_key_file_to_data (amd->keyfile, &n, NULL); rval = g_file_set_contents (amd->filename, data, n, &error); if (rval) { amd->save = FALSE; } else { g_warning ("%s", error->message); g_error_free (error); } g_free (data); return rval; } static void am_default_load_keyfile (McdAccountManagerDefault *self, const gchar *filename) { GError *error = NULL; if (g_key_file_load_from_file (self->keyfile, filename, G_KEY_FILE_KEEP_COMMENTS, &error)) { DEBUG ("Loaded accounts from %s", filename); } else { DEBUG ("Failed to load accounts from %s: %s", filename, error->message); g_error_free (error); /* Start with a blank configuration, but do not save straight away; * we don't want to overwrite a corrupt-but-maybe-recoverable * configuration file with an empty one until given a reason to * do so. */ g_key_file_load_from_data (self->keyfile, INITIAL_CONFIG, -1, G_KEY_FILE_KEEP_COMMENTS, NULL); } } static GList * _list (const McpAccountStorage *self, const McpAccountManager *am) { gsize i; gsize n; GStrv accounts; GList *rval = NULL; McdAccountManagerDefault *amd = MCD_ACCOUNT_MANAGER_DEFAULT (self); if (!amd->loaded && g_file_test (amd->filename, G_FILE_TEST_EXISTS)) { /* If the file exists, but loading it fails, we deliberately * do not fall through to the "initial configuration" case, * because we don't want to overwrite a corrupted file * with an empty one until an actual write takes place. */ am_default_load_keyfile (amd, amd->filename); amd->loaded = TRUE; } if (!amd->loaded) { const gchar * const *iter; for (iter = g_get_system_data_dirs (); iter != NULL && *iter != NULL; iter++) { gchar *filename = account_filename_in (*iter); if (g_file_test (filename, G_FILE_TEST_EXISTS)) { am_default_load_keyfile (amd, filename); amd->loaded = TRUE; /* Do not set amd->save: we don't need to write it to a * higher-priority directory until it actually changes. */ } g_free (filename); if (amd->loaded) break; } } if (!amd->loaded) { gchar *old_filename = get_old_filename (); if (g_file_test (old_filename, G_FILE_TEST_EXISTS)) { am_default_load_keyfile (amd, old_filename); amd->loaded = TRUE; amd->save = TRUE; if (_commit (self, am, NULL)) { DEBUG ("Migrated %s to new location: deleting old copy", old_filename); if (g_unlink (old_filename) != 0) g_warning ("Unable to delete %s: %s", old_filename, g_strerror (errno)); } } g_free (old_filename); } if (!amd->loaded) { DEBUG ("Creating initial account data"); g_key_file_load_from_data (amd->keyfile, INITIAL_CONFIG, -1, G_KEY_FILE_KEEP_COMMENTS, NULL); amd->loaded = TRUE; amd->save = TRUE; _commit (self, am, NULL); } accounts = g_key_file_get_groups (amd->keyfile, &n); for (i = 0; i < n; i++) { rval = g_list_prepend (rval, g_strdup (accounts[i])); } g_strfreev (accounts); return rval; } static void account_storage_iface_init (McpAccountStorageIface *iface, gpointer unused G_GNUC_UNUSED) { iface->name = PLUGIN_NAME; iface->desc = PLUGIN_DESCRIPTION; iface->priority = PLUGIN_PRIORITY; iface->get = _get; iface->set = _set; iface->create = _create; iface->delete = _delete; iface->commit_one = _commit; iface->list = _list; } McdAccountManagerDefault * mcd_account_manager_default_new (void) { return g_object_new (MCD_TYPE_ACCOUNT_MANAGER_DEFAULT, NULL); } telepathy-mission-control-5.16.4/data/0000755000175000017500000000000012762352247020740 5ustar00gkiagiagkiagia00000000000000telepathy-mission-control-5.16.4/data/Makefile.am0000644000175000017500000000072512735241312022766 0ustar00gkiagiagkiagia00000000000000mc_schemas = \ im.telepathy.MissionControl.FromEmpathy.gschema.xml \ $(NULL) gsettings_SCHEMAS = if ENABLE_CONN_SETTING gsettings_SCHEMAS += $(mc_schemas) # We build our own schema cache here for the benefit of the test suite noinst_DATA = gschemas.compiled gschemas.compiled: $(gsettings_SCHEMAS) $(AM_V_GEN)$(GLIB_COMPILE_SCHEMAS) --targetdir=$(builddir) $(srcdir) endif @GSETTINGS_RULES@ EXTRA_DIST = \ $(mc_schemas) \ $(NULL) CLEANFILES = $(noinst_DATA) telepathy-mission-control-5.16.4/data/im.telepathy.MissionControl.FromEmpathy.gschema.xml0000644000175000017500000000067712735241312032706 0ustar00gkiagiagkiagia00000000000000 true Connectivity managers should be used Whether connectivity managers should be used to automatically disconnect/reconnect. telepathy-mission-control-5.16.4/data/Makefile.in0000644000175000017500000003153312762351617023012 0ustar00gkiagiagkiagia00000000000000# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__make_dryrun = \ { \ am__dry=no; \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ *) \ for am__flg in $$MAKEFLAGS; do \ case $$am__flg in \ *=*|--*) ;; \ *n*) am__dry=yes; break;; \ esac; \ done;; \ esac; \ test $$am__dry = yes; \ } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ @ENABLE_CONN_SETTING_TRUE@am__append_1 = $(mc_schemas) subdir = data DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/gtk-doc.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/tp-compiler-flag.m4 \ $(top_srcdir)/m4/tp-compiler-warnings.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac DATA = $(noinst_DATA) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACCOUNTS_CACHE_DIR = @ACCOUNTS_CACHE_DIR@ ACCOUNTS_DIR = @ACCOUNTS_DIR@ ACLOCAL = @ACLOCAL@ AEGIS_LIBS = @AEGIS_LIBS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DBUS_CFLAGS = @DBUS_CFLAGS@ DBUS_LIBS = @DBUS_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ERROR_CFLAGS = @ERROR_CFLAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GIO_UNIX_CFLAGS = @GIO_UNIX_CFLAGS@ GIO_UNIX_LIBS = @GIO_UNIX_LIBS@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_COMPILE_SCHEMAS = @GLIB_COMPILE_SCHEMAS@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ GLIB_MKENUMS = @GLIB_MKENUMS@ GREP = @GREP@ GSETTINGS_DISABLE_SCHEMAS_COMPILE = @GSETTINGS_DISABLE_SCHEMAS_COMPILE@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ HTML_DIR = @HTML_DIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBACCOUNTS_SSO_CFLAGS = @LIBACCOUNTS_SSO_CFLAGS@ LIBACCOUNTS_SSO_LIBS = @LIBACCOUNTS_SSO_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MCE_CFLAGS = @MCE_CFLAGS@ MCE_LIBS = @MCE_LIBS@ MCP_ABI_VERSION = @MCP_ABI_VERSION@ MCP_API_VERSION = @MCP_API_VERSION@ MCP_LT_AGE = @MCP_LT_AGE@ MCP_LT_CURRENT = @MCP_LT_CURRENT@ MCP_LT_REVISION = @MCP_LT_REVISION@ MKDIR_P = @MKDIR_P@ NETWORK_MANAGER_CFLAGS = @NETWORK_MANAGER_CFLAGS@ NETWORK_MANAGER_LIBS = @NETWORK_MANAGER_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PYTHON = @PYTHON@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TELEPATHY_CFLAGS = @TELEPATHY_CFLAGS@ TELEPATHY_LIBS = @TELEPATHY_LIBS@ UPOWER_GLIB_CFLAGS = @UPOWER_GLIB_CFLAGS@ UPOWER_GLIB_LIBS = @UPOWER_GLIB_LIBS@ VERSION = @VERSION@ XSLTPROC = @XSLTPROC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gsettingsschemadir = @gsettingsschemadir@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mctestsdir = @mctestsdir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ pluginlibdir = @pluginlibdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ mc_schemas = \ im.telepathy.MissionControl.FromEmpathy.gschema.xml \ $(NULL) gsettings_SCHEMAS = $(am__append_1) # We build our own schema cache here for the benefit of the test suite @ENABLE_CONN_SETTING_TRUE@noinst_DATA = gschemas.compiled EXTRA_DIST = \ $(mc_schemas) \ $(NULL) CLEANFILES = $(noinst_DATA) all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu data/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu data/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(DATA) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am @ENABLE_CONN_SETTING_TRUE@gschemas.compiled: $(gsettings_SCHEMAS) @ENABLE_CONN_SETTING_TRUE@ $(AM_V_GEN)$(GLIB_COMPILE_SCHEMAS) --targetdir=$(builddir) $(srcdir) @GSETTINGS_RULES@ # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: telepathy-mission-control-5.16.4/build-aux/0000755000175000017500000000000012762352247021721 5ustar00gkiagiagkiagia00000000000000telepathy-mission-control-5.16.4/build-aux/config.sub0000755000175000017500000010705512762351617023714 0ustar00gkiagiagkiagia00000000000000#! /bin/sh # Configuration validation subroutine script. # Copyright 1992-2016 Free Software Foundation, Inc. timestamp='2016-03-30' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # Please send patches to . # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS Canonicalize a configuration name. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright 1992-2016 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo $1 exit ;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \ kopensolaris*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; android-linux) os=-linux-android basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis | -knuth | -cray | -microblaze*) os= basic_machine=$1 ;; -bluegene*) os=-cnk ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco6) os=-sco5v6 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5v6*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*178) os=-lynxos178 ;; -lynx*5) os=-lynxos5 ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | aarch64 | aarch64_be \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arceb \ | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ | avr | avr32 \ | ba \ | be32 | be64 \ | bfin \ | c4x | c8051 | clipper \ | d10v | d30v | dlx | dsp16xx | dvp \ | e2k | epiphany \ | fido | fr30 | frv | ft32 \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | hexagon \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | k1om \ | le32 | le64 \ | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | microblazeel | mcore | mep | metag \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64octeon | mips64octeonel \ | mips64orion | mips64orionel \ | mips64r5900 | mips64r5900el \ | mips64vr | mips64vrel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa32r6 | mipsisa32r6el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64r6 | mipsisa64r6el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipsr5900 | mipsr5900el \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | moxie \ | mt \ | msp430 \ | nds32 | nds32le | nds32be \ | nios | nios2 | nios2eb | nios2el \ | ns16k | ns32k \ | open8 | or1k | or1knd | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle \ | pyramid \ | riscv32 | riscv64 \ | rl78 | rx \ | score \ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ | spu \ | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ | ubicom32 \ | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ | visium \ | we32k \ | x86 | xc16x | xstormy16 | xtensa \ | z8k | z80) basic_machine=$basic_machine-unknown ;; c54x) basic_machine=tic54x-unknown ;; c55x) basic_machine=tic55x-unknown ;; c6x) basic_machine=tic6x-unknown ;; leon|leon[3-9]) basic_machine=sparc-$basic_machine ;; m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; ms1) basic_machine=mt-unknown ;; strongarm | thumb | xscale) basic_machine=arm-unknown ;; xgate) basic_machine=$basic_machine-unknown os=-none ;; xscaleeb) basic_machine=armeb-unknown ;; xscaleel) basic_machine=armel-unknown ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | aarch64-* | aarch64_be-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | ba-* \ | be32-* | be64-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* \ | c8051-* | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | e2k-* | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | hexagon-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ | k1om-* \ | le32-* | le64-* \ | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ | microblaze-* | microblazeel-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64octeon-* | mips64octeonel-* \ | mips64orion-* | mips64orionel-* \ | mips64r5900-* | mips64r5900el-* \ | mips64vr-* | mips64vrel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa32r6-* | mipsisa32r6el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64r6-* | mipsisa64r6el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipsr5900-* | mipsr5900el-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nds32-* | nds32le-* | nds32be-* \ | nios-* | nios2-* | nios2eb-* | nios2el-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | open8-* \ | or1k*-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ | pyramid-* \ | riscv32-* | riscv64-* \ | rl78-* | romp-* | rs6000-* | rx-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx*-* \ | tahoe-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tile*-* \ | tron-* \ | ubicom32-* \ | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ | vax-* \ | visium-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* \ | xstormy16-* | xtensa*-* \ | ymp-* \ | z8k-* | z80-*) ;; # Recognize the basic CPU types without company name, with glob match. xtensa*) basic_machine=$basic_machine-unknown ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-unknown os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; abacus) basic_machine=abacus-unknown ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amd64) basic_machine=x86_64-pc ;; amd64-*) basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aros) basic_machine=i386-pc os=-aros ;; asmjs) basic_machine=asmjs-unknown ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; blackfin) basic_machine=bfin-unknown os=-linux ;; blackfin-*) basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; bluegene*) basic_machine=powerpc-ibm os=-cnk ;; c54x-*) basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c55x-*) basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c6x-*) basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c90) basic_machine=c90-cray os=-unicos ;; cegcc) basic_machine=arm-unknown os=-cegcc ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; craynv) basic_machine=craynv-cray os=-unicosmp ;; cr16 | cr16-*) basic_machine=cr16-unknown os=-elf ;; crds | unos) basic_machine=m68k-crds ;; crisv32 | crisv32-* | etraxfs*) basic_machine=crisv32-axis ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; crx) basic_machine=crx-unknown os=-elf ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; dicos) basic_machine=i686-pc os=-dicos ;; djgpp) basic_machine=i586-pc os=-msdosdjgpp ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; i386-vsta | vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; leon-*|leon[3-9]-*) basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'` ;; m68knommu) basic_machine=m68k-unknown os=-linux ;; m68knommu-*) basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; microblaze*) basic_machine=microblaze-xilinx ;; mingw64) basic_machine=x86_64-pc os=-mingw64 ;; mingw32) basic_machine=i686-pc os=-mingw32 ;; mingw32ce) basic_machine=arm-unknown os=-mingw32ce ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mipsEE* | ee | ps2) basic_machine=mips64r5900el-scei case $os in -linux*) ;; *) os=-elf ;; esac ;; iop) basic_machine=mipsel-scei os=-irx ;; dvp) basic_machine=dvp-scei os=-elf ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; moxiebox) basic_machine=moxie-unknown os=-moxiebox ;; msdos) basic_machine=i386-pc os=-msdos ;; ms1-*) basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; msys) basic_machine=i686-pc os=-msys ;; mvs) basic_machine=i370-ibm os=-mvs ;; nacl) basic_machine=le32-unknown os=-nacl ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; neo-tandem) basic_machine=neo-tandem ;; nse-tandem) basic_machine=nse-tandem ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; openrisc | openrisc-*) basic_machine=or32-unknown ;; os400) basic_machine=powerpc-ibm os=-os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; parisc) basic_machine=hppa-unknown os=-linux ;; parisc-*) basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pc98) basic_machine=i386-pc ;; pc98-*) basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc | ppcbe) basic_machine=powerpc-unknown ;; ppc-* | ppcbe-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rdos | rdos64) basic_machine=x86_64-pc os=-rdos ;; rdos32) basic_machine=i386-pc os=-rdos ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sde) basic_machine=mipsisa32-sde os=-elf ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sh5el) basic_machine=sh5le-unknown ;; sh64) basic_machine=sh64-unknown ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; strongarm-* | thumb-*) basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; tile*) basic_machine=$basic_machine-unknown os=-linux-gnu ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; tpf) basic_machine=s390x-ibm os=-tpf ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; xbox) basic_machine=i686-pc os=-mingw32 ;; xps | xps100) basic_machine=xps100-honeywell ;; xscale-* | xscalee[bl]-*) basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; z80-*-coff) basic_machine=z80-unknown os=-sim ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; mmix) basic_machine=mmix-knuth ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp10) # there are many clones, so DEC is not a safe bet basic_machine=pdp10-unknown ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -auroraux) os=-auroraux ;; -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ | -sym* | -kopensolaris* | -plan9* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* | -aros* | -cloudabi* | -sortix* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ | -bitrig* | -openbsd* | -solidbsd* | -libertybsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* | -cegcc* \ | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ | -linux-newlib* | -linux-musl* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* | -irx* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \ | -onefs* | -tirtos*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto-qnx*) ;; -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; -linux-dietlibc) os=-linux-dietlibc ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -os400*) os=-os400 ;; -wince*) os=-wince ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -syllable*) os=-syllable ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2 ) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -tpf*) os=-tpf ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -es1800*) os=-ose ;; -xenix) os=-xenix ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -aros*) os=-aros ;; -zvmoe) os=-zvmoe ;; -dicos*) os=-dicos ;; -nacl*) ;; -ios) ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in score-*) os=-elf ;; spu-*) os=-elf ;; *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; c8051-*) os=-elf ;; hexagon-*) os=-elf ;; tic54x-*) os=-coff ;; tic55x-*) os=-coff ;; tic6x-*) os=-coff ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 ;; m68*-cisco) os=-aout ;; mep-*) os=-elf ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; *-be) os=-beos ;; *-haiku) os=-haiku ;; *-ibm) os=-aix ;; *-knuth) os=-mmixware ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -cnk*|-aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -os400*) vendor=ibm ;; -ptx*) vendor=sequent ;; -tpf*) vendor=ibm ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os exit # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: telepathy-mission-control-5.16.4/build-aux/config.guess0000755000175000017500000012612312762351617024246 0ustar00gkiagiagkiagia00000000000000#! /bin/sh # Attempt to guess a canonical system name. # Copyright 1992-2016 Free Software Foundation, Inc. timestamp='2016-04-02' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # # Originally written by Per Bothner; maintained since 2000 by Ben Elliston. # # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess # # Please send patches to . me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright 1992-2016 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > $dummy.c ; for c in cc gcc c89 c99 ; do if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac ; set_cc_for_build= ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown case "${UNAME_SYSTEM}" in Linux|GNU|GNU/*) # If the system lacks a compiler, then just pick glibc. # We could probably try harder. LIBC=gnu eval $set_cc_for_build cat <<-EOF > $dummy.c #include #if defined(__UCLIBC__) LIBC=uclibc #elif defined(__dietlibc__) LIBC=dietlibc #else LIBC=gnu #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` ;; esac # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \ /sbin/$sysctl 2>/dev/null || \ /usr/sbin/$sysctl 2>/dev/null || \ echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; earmv*) arch=`echo ${UNAME_MACHINE_ARCH} | sed -e 's,^e\(armv[0-9]\).*$,\1,'` endian=`echo ${UNAME_MACHINE_ARCH} | sed -ne 's,^.*\(eb\)$,\1,p'` machine=${arch}${endian}-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE_ARCH}" in arm*|earm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # Determine ABI tags. case "${UNAME_MACHINE_ARCH}" in earm*) expr='s/^earmv[0-9]/-eabi/;s/eb$//' abi=`echo ${UNAME_MACHINE_ARCH} | sed -e "$expr"` ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case "${UNAME_VERSION}" in Debian*) release='-gnu' ;; *) release=`echo ${UNAME_RELEASE} | sed -e 's/[-_].*//' | cut -d. -f1,2` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}${abi}" exit ;; *:Bitrig:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE} exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} exit ;; *:LibertyBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'` echo ${UNAME_MACHINE_ARCH}-unknown-libertybsd${UNAME_RELEASE} exit ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit ;; *:SolidBSD:*:*) echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} exit ;; macppc:MirBSD:*:*) echo powerpc-unknown-mirbsd${UNAME_RELEASE} exit ;; *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} exit ;; *:Sortix:*:*) echo ${UNAME_MACHINE}-unknown-sortix exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") UNAME_MACHINE=alpha ;; "EV4.5 (21064)") UNAME_MACHINE=alpha ;; "LCA4 (21066/21068)") UNAME_MACHINE=alpha ;; "EV5 (21164)") UNAME_MACHINE=alphaev5 ;; "EV5.6 (21164A)") UNAME_MACHINE=alphaev56 ;; "EV5.6 (21164PC)") UNAME_MACHINE=alphapca56 ;; "EV5.7 (21164PC)") UNAME_MACHINE=alphapca57 ;; "EV6 (21264)") UNAME_MACHINE=alphaev6 ;; "EV6.7 (21264A)") UNAME_MACHINE=alphaev67 ;; "EV6.8CB (21264C)") UNAME_MACHINE=alphaev68 ;; "EV6.8AL (21264B)") UNAME_MACHINE=alphaev68 ;; "EV6.8CX (21264D)") UNAME_MACHINE=alphaev68 ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE=alphaev69 ;; "EV7 (21364)") UNAME_MACHINE=alphaev7 ;; "EV7.9 (21364A)") UNAME_MACHINE=alphaev79 ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` # Reset EXIT trap before exiting to avoid spurious non-zero exit code. exitcode=$? trap '' 0 exit $exitcode ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix exit ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit ;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition exit ;; *:z/VM:*:*) echo s390-ibm-zvmoe exit ;; *:OS400:*:*) echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit ;; arm*:riscos:*:*|arm*:RISCOS:*:*) echo arm-unknown-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7; exit ;; esac ;; s390x:SunOS:*:*) echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) echo i386-pc-auroraux${UNAME_RELEASE} exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) eval $set_cc_for_build SUN_ARCH=i386 # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # This test works for both compilers. if [ "$CC_FOR_BUILD" != no_compiler_found ]; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then SUN_ARCH=x86_64 fi fi echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` exit ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = x && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} ;; sun4) echo sparc-sun-sunos${UNAME_RELEASE} ;; esac exit ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && SYSTEM_NAME=`$dummy $dummyarg` && { echo "$SYSTEM_NAME"; exit; } echo mips-mips-riscos${UNAME_RELEASE} exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ [ ${TARGET_BINARY_INTERFACE}x = x ] then echo m88k-dg-dgux${UNAME_RELEASE} else echo m88k-dg-dguxbcs${UNAME_RELEASE} fi else echo i586-dg-dgux${UNAME_RELEASE} fi exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` then echo "$SYSTEM_NAME" else echo rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit ;; *:AIX:*:[4567]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/lslpp ] ; then IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit ;; *:AIX:*:*) echo rs6000-ibm-aix exit ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in 32) HP_ARCH=hppa2.0n ;; 64) HP_ARCH=hppa2.0w ;; '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20 esac ;; esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS="" $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if [ ${HP_ARCH} = hppa2.0w ] then eval $set_cc_for_build # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler # generating 64-bit code. GNU and HP use different nomenclature: # # $ CC_FOR_BUILD=cc ./config.guess # => hppa2.0w-hp-hpux11.23 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | grep -q __LP64__ then HP_ARCH=hppa2.0w else HP_ARCH=hppa64 fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit ;; *:FreeBSD:*:*) UNAME_PROCESSOR=`/usr/bin/uname -p` case ${UNAME_PROCESSOR} in amd64) echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; *) echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; esac exit ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; *:MINGW64*:*) echo ${UNAME_MACHINE}-pc-mingw64 exit ;; *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; *:MSYS*:*) echo ${UNAME_MACHINE}-pc-msys exit ;; i*:windows32*:*) # uname -m includes "-pc" on this system. echo ${UNAME_MACHINE}-mingw32 exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; *:Interix*:*) case ${UNAME_MACHINE} in x86) echo i586-pc-interix${UNAME_RELEASE} exit ;; authenticamd | genuineintel | EM64T) echo x86_64-unknown-interix${UNAME_RELEASE} exit ;; IA64) echo ia64-unknown-interix${UNAME_RELEASE} exit ;; esac ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit ;; 8664:Windows_NT:*) echo x86_64-pc-mks exit ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i586-pc-interix exit ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) echo x86_64-unknown-cygwin exit ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; *:GNU:*:*) # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC} exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; aarch64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep -q ld.so.1 if test "$?" = 0 ; then LIBC=gnulibc1 ; fi echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; arc:Linux:*:* | arceb:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; arm*:Linux:*:*) eval $set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then echo ${UNAME_MACHINE}-unknown-linux-${LIBC} else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi else echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf fi fi exit ;; avr32*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; cris:Linux:*:*) echo ${UNAME_MACHINE}-axis-linux-${LIBC} exit ;; crisv32:Linux:*:*) echo ${UNAME_MACHINE}-axis-linux-${LIBC} exit ;; e2k:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; frv:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; hexagon:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; i*86:Linux:*:*) echo ${UNAME_MACHINE}-pc-linux-${LIBC} exit ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; k1om:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; mips:Linux:*:* | mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef ${UNAME_MACHINE} #undef ${UNAME_MACHINE}el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=${UNAME_MACHINE}el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=${UNAME_MACHINE} #else CPU= #endif #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } ;; openrisc*:Linux:*:*) echo or1k-unknown-linux-${LIBC} exit ;; or32:Linux:*:* | or1k*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; padre:Linux:*:*) echo sparc-unknown-linux-${LIBC} exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-${LIBC} exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-${LIBC} ;; PA8*) echo hppa2.0-unknown-linux-${LIBC} ;; *) echo hppa-unknown-linux-${LIBC} ;; esac exit ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-${LIBC} exit ;; ppc:Linux:*:*) echo powerpc-unknown-linux-${LIBC} exit ;; ppc64le:Linux:*:*) echo powerpc64le-unknown-linux-${LIBC} exit ;; ppcle:Linux:*:*) echo powerpcle-unknown-linux-${LIBC} exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux-${LIBC} exit ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; tile*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-${LIBC} exit ;; x86_64:Linux:*:*) eval $set_cc_for_build X86_64_ABI= # If there is a compiler, see if it is configured for 32-bit objects. if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __ILP32__'; echo IS_X32; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_X32 >/dev/null then X86_64_ABI=x32 fi fi echo ${UNAME_MACHINE}-pc-linux-${LIBC}${X86_64_ABI} exit ;; xtensa*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx exit ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit ;; i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i586. # Note: whatever this is, it MUST be the same as what config.sub # prints for the "djgpp" host, or else GDB configure will decide that # this is a cross-build. echo i586-pc-msdosdjgpp exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; paragon:*:*:*) echo i860-intel-osf1 exit ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; NCR*:*:4.2:* | MPRAS*:*:4.2:*) OS_REL='.3' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo ${UNAME_MACHINE}-sni-sysv4 else echo ns32k-sni-sysv fi exit ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. echo ${UNAME_MACHINE}-stratus-vos exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit ;; BePC:Haiku:*:*) # Haiku running on Intel PC compatible. echo i586-pc-haiku exit ;; x86_64:Haiku:*:*) echo x86_64-unknown-haiku exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit ;; SX-7:SUPER-UX:*:*) echo sx7-nec-superux${UNAME_RELEASE} exit ;; SX-8:SUPER-UX:*:*) echo sx8-nec-superux${UNAME_RELEASE} exit ;; SX-8R:SUPER-UX:*:*) echo sx8r-nec-superux${UNAME_RELEASE} exit ;; SX-ACE:SUPER-UX:*:*) echo sxace-nec-superux${UNAME_RELEASE} exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown eval $set_cc_for_build if test "$UNAME_PROCESSOR" = unknown ; then UNAME_PROCESSOR=powerpc fi if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then if [ "$CC_FOR_BUILD" != no_compiler_found ]; then if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then case $UNAME_PROCESSOR in i386) UNAME_PROCESSOR=x86_64 ;; powerpc) UNAME_PROCESSOR=powerpc64 ;; esac fi fi elif test "$UNAME_PROCESSOR" = i386 ; then # Avoid executing cc on OS X 10.9, as it ships with a stub # that puts up a graphical alert prompting to install # developer tools. Any system running Mac OS X 10.7 or # later (Darwin 11 and later) is required to have a 64-bit # processor. This is not true of the ARM version of Darwin # that Apple uses in portable devices. UNAME_PROCESSOR=x86_64 fi echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = x86; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} exit ;; *:QNX:*:4*) echo i386-pc-qnx exit ;; NEO-?:NONSTOP_KERNEL:*:*) echo neo-tandem-nsk${UNAME_RELEASE} exit ;; NSE-*:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit ;; NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = 386; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit ;; *:ITS:*:*) echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} exit ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; esac ;; *:XENIX:*:SysV) echo i386-pc-xenix exit ;; i*86:skyos:*:*) echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE} | sed -e 's/ .*$//'` exit ;; i*86:rdos:*:*) echo ${UNAME_MACHINE}-pc-rdos exit ;; i*86:AROS:*:*) echo ${UNAME_MACHINE}-pc-aros exit ;; x86_64:VMkernel:*:*) echo ${UNAME_MACHINE}-unknown-esx exit ;; amd64:Isilon\ OneFS:*:*) echo x86_64-unknown-onefs exit ;; esac cat >&2 < in order to provide the needed information to handle your system. config.guess timestamp = $timestamp uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = ${UNAME_MACHINE} UNAME_RELEASE = ${UNAME_RELEASE} UNAME_SYSTEM = ${UNAME_SYSTEM} UNAME_VERSION = ${UNAME_VERSION} EOF exit 1 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: telepathy-mission-control-5.16.4/build-aux/install-sh0000755000175000017500000003325612762351617023736 0ustar00gkiagiagkiagia00000000000000#!/bin/sh # install - install a program, script, or datafile scriptversion=2011-01-19.21; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. nl=' ' IFS=" "" $nl" # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit=${DOITPROG-} if test -z "$doit"; then doit_exec=exec else doit_exec=$doit fi # Put in absolute file names if you don't have them in your path; # or use environment vars. chgrpprog=${CHGRPPROG-chgrp} chmodprog=${CHMODPROG-chmod} chownprog=${CHOWNPROG-chown} cmpprog=${CMPPROG-cmp} cpprog=${CPPROG-cp} mkdirprog=${MKDIRPROG-mkdir} mvprog=${MVPROG-mv} rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} posix_glob='?' initialize_posix_glob=' test "$posix_glob" != "?" || { if (set -f) 2>/dev/null; then posix_glob= else posix_glob=: fi } ' posix_mkdir= # Desired mode of installed file. mode=0755 chgrpcmd= chmodcmd=$chmodprog chowncmd= mvcmd=$mvprog rmcmd="$rmprog -f" stripcmd= src= dst= dir_arg= dst_arg= copy_on_change=false no_target_directory= usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: --help display this help and exit. --version display version info and exit. -c (ignored) -C install only if different (preserve the last data modification time) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -s $stripprog installed files. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test $# -ne 0; do case $1 in -c) ;; -C) copy_on_change=true;; -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 case $mode in *' '* | *' '* | *' '* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac shift;; -o) chowncmd="$chownprog $2" shift;; -s) stripcmd=$stripprog;; -t) dst_arg=$2 # Protect names problematic for `test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac shift;; -T) no_target_directory=true;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac shift done if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dst_arg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dst_arg" shift # fnord fi shift # arg dst_arg=$arg # Protect names problematic for `test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac done fi if test $# -eq 0; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call `install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then do_exit='(exit $ret); exit $ret' trap "ret=129; $do_exit" 1 trap "ret=130; $do_exit" 2 trap "ret=141; $do_exit" 13 trap "ret=143; $do_exit" 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. case $mode in # Optimize common cases. *644) cp_umask=133;; *755) cp_umask=22;; *[0-7]) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac fi for src do # Protect names problematic for `test' and other utilities. case $src in -* | [=\(\)!]) src=./$src;; esac if test -n "$dir_arg"; then dst=$src dstdir=$dst test -d "$dstdir" dstdir_status=$? else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dst_arg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dst_arg # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then if test -n "$no_target_directory"; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst dst=$dstdir/`basename "$src"` dstdir_status=0 else # Prefer dirname, but fall back on a substitute if dirname fails. dstdir=` (dirname "$dst") 2>/dev/null || expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$dst" : 'X\(//\)[^/]' \| \ X"$dst" : 'X\(//\)$' \| \ X"$dst" : 'X\(/\)' \| . 2>/dev/null || echo X"$dst" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q' ` test -d "$dstdir" dstdir_status=$? fi fi obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') # Create intermediate dirs using mode 755 as modified by the umask. # This is like FreeBSD 'install' as of 1997-10-28. umask=`umask` case $stripcmd.$umask in # Optimize common cases. *[2367][2367]) mkdir_umask=$umask;; .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; *[0-7]) mkdir_umask=`expr $umask + 22 \ - $umask % 100 % 40 + $umask % 20 \ - $umask % 10 % 4 + $umask % 2 `;; *) mkdir_umask=$umask,go-w;; esac # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then mkdir_mode=-m$mode else mkdir_mode= fi posix_mkdir=false case $umask in *[123567][0-7][0-7]) # POSIX mkdir -p sets u+wx bits regardless of umask, which # is incompatible with FreeBSD 'install' when (umask & 300) != 0. ;; *) tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 if (umask $mkdir_umask && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writeable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. ls_ld_tmpdir=`ls -ld "$tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/d" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null fi trap '' 0;; esac;; esac if $posix_mkdir && ( umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else # The umask is ridiculous, or mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. case $dstdir in /*) prefix='/';; [-=\(\)!]*) prefix='./';; *) prefix='';; esac eval "$initialize_posix_glob" oIFS=$IFS IFS=/ $posix_glob set -f set fnord $dstdir shift $posix_glob set +f IFS=$oIFS prefixes= for d do test X"$d" = X && continue prefix=$prefix$d if test -d "$prefix"; then prefixes= else if $posix_mkdir; then (umask=$mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 else case $prefix in *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; *) qprefix=$prefix;; esac prefixes="$prefixes '$qprefix'" fi fi prefix=$prefix/ done if test -n "$prefixes"; then # Don't fail if two instances are running concurrently. (umask $mkdir_umask && eval "\$doit_exec \$mkdirprog $prefixes") || test -d "$dstdir" || exit 1 obsolete_mkdir_used=true fi fi fi if test -n "$dir_arg"; then { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 else # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && eval "$initialize_posix_glob" && $posix_glob set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && $posix_glob set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then rm -f "$dsttmp" else # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. { # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { test ! -f "$dst" || $doit $rmcmd -f "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } } || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 } } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 trap '' 0 fi done # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: telepathy-mission-control-5.16.4/build-aux/depcomp0000755000175000017500000005064312762351620023300 0ustar00gkiagiagkiagia00000000000000#! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2012-03-27.16; # UTC # Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009, 2010, # 2011, 2012 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Alexandre Oliva . case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] Run PROGRAMS ARGS to compile a file, generating dependencies as side-effects. Environment variables: depmode Dependency tracking mode. source Source file read by 'PROGRAMS ARGS'. object Object file output by 'PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. tmpdepfile Temporary file to use when outputting dependencies. libtool Whether libtool is used (yes/no). Report bugs to . EOF exit $? ;; -v | --v*) echo "depcomp $scriptversion" exit $? ;; esac # A tabulation character. tab=' ' # A newline character. nl=' ' if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. depfile=${depfile-`echo "$object" | sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case # here, because this file can only contain one case statement. if test "$depmode" = hp; then # HP compiler uses -M and no extra arg. gccflag=-M depmode=gcc fi if test "$depmode" = dashXmstdout; then # This is just like dashmstdout with a different argument. dashmflag=-xM depmode=dashmstdout fi cygpath_u="cygpath -u -f -" if test "$depmode" = msvcmsys; then # This is just like msvisualcpp but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvisualcpp fi if test "$depmode" = msvc7msys; then # This is just like msvc7 but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvc7 fi if test "$depmode" = xlc; then # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency informations. gccflag=-qmakedep=gcc,-MF depmode=gcc fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. ## Unfortunately, FreeBSD c89 acceptance of flags depends upon ## the command line argument order; so add the flags where they ## appear in depend2.am. Note that the slowdown incurred here ## affects only configure: in makefiles, %FASTDEP% shortcuts this. for arg do case $arg in -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; *) set fnord "$@" "$arg" ;; esac shift # fnord shift # $arg done "$@" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like ## -MM, not -M (despite what the docs say). ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then gccflag=-MD, fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ## The second -e expression handles DOS-style file names with drive letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the "deleted header file" problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. tr ' ' "$nl" < "$tmpdepfile" | ## Some versions of gcc put a space before the ':'. On the theory ## that the space means something, we add a space to the output as ## well. hp depmode also adds that space, but also prefixes the VPATH ## to the object. Take care to not repeat it in the output. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; sgi) if test "$libtool" = yes; then "$@" "-Wp,-MDupdate,$tmpdepfile" else "$@" -MDupdate "$tmpdepfile" fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; # the IRIX cc adds comments like '#:fec' to the end of the # dependency line. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ tr "$nl" ' ' >> "$depfile" echo >> "$depfile" # The second pass generates a dummy entry for each header file. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> "$depfile" else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; xlc) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the # current directory. Also, the AIX compiler puts '$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then tmpdepfile1=$dir$base.u tmpdepfile2=$base.u tmpdepfile3=$dir.libs/$base.u "$@" -Wc,-M else tmpdepfile1=$dir$base.u tmpdepfile2=$dir$base.u tmpdepfile3=$dir$base.u "$@" -M fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then # Each line is of the form 'foo.o: dependent.h'. # Do two passes, one to just change these to # '$object: dependent.h' and one to simply 'dependent.h:'. sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" sed -e 's,^.*\.[a-z]*:['"$tab"' ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; icc) # Intel's C compiler anf tcc (Tiny C Compiler) understand '-MD -MF file'. # However on # $CC -MD -MF foo.d -c -o sub/foo.o sub/foo.c # ICC 7.0 will fill foo.d with something like # foo.o: sub/foo.c # foo.o: sub/foo.h # which is wrong. We want # sub/foo.o: sub/foo.c # sub/foo.o: sub/foo.h # sub/foo.c: # sub/foo.h: # ICC 7.1 will output # foo.o: sub/foo.c sub/foo.h # and will wrap long lines using '\': # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... # tcc 0.9.26 (FIXME still under development at the moment of writing) # will emit a similar output, but also prepend the continuation lines # with horizontal tabulation characters. "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each line is of the form 'foo.o: dependent.h', # or 'foo.o: dep1.h dep2.h \', or ' dep3.h dep4.h \'. # Do two passes, one to just change these to # '$object: dependent.h' and one to simply 'dependent.h:'. sed -e "s/^[ $tab][ $tab]*/ /" -e "s,^[^:]*:,$object :," \ < "$tmpdepfile" > "$depfile" sed ' s/[ '"$tab"'][ '"$tab"']*/ /g s/^ *// s/ *\\*$// s/^[^:]*: *// /^$/d /:$/d s/$/ :/ ' < "$tmpdepfile" >> "$depfile" rm -f "$tmpdepfile" ;; hp2) # The "hp" stanza above does not work with aCC (C++) and HP's ia64 # compilers, which have integrated preprocessors. The correct option # to use with these is +Maked; it writes dependencies to a file named # 'foo.d', which lands next to the object file, wherever that # happens to be. # Much of this is similar to the tru64 case; see comments there. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then tmpdepfile1=$dir$base.d tmpdepfile2=$dir.libs/$base.d "$@" -Wc,+Maked else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d "$@" +Maked fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile" # Add 'dependent.h:' lines. sed -ne '2,${ s/^ *// s/ \\*$// s/$/:/ p }' "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" "$tmpdepfile2" ;; tru64) # The Tru64 compiler uses -MD to generate dependencies as a side # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put # dependencies in 'foo.d' instead, so we check for that too. # Subdirectories are respected. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then # With Tru64 cc, shared objects can also be used to make a # static library. This mechanism is used in libtool 1.4 series to # handle both shared and static libraries in a single compilation. # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. # # With libtool 1.5 this exception was removed, and libtool now # generates 2 separate objects for the 2 libraries. These two # compilations output dependencies in $dir.libs/$base.o.d and # in $dir$base.o.d. We have to check for both files, because # one of the two compilations can be disabled. We should prefer # $dir$base.o.d over $dir.libs/$base.o.d because the latter is # automatically cleaned when .libs/ is deleted, while ignoring # the former would cause a distcleancheck panic. tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4 tmpdepfile2=$dir$base.o.d # libtool 1.5 tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5 tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504 "$@" -Wc,-MD else tmpdepfile1=$dir$base.o.d tmpdepfile2=$dir$base.d tmpdepfile3=$dir$base.d tmpdepfile4=$dir$base.d "$@" -MD fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" sed -e 's,^.*\.[a-z]*:['"$tab"' ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; msvc7) if test "$libtool" = yes; then showIncludes=-Wc,-showIncludes else showIncludes=-showIncludes fi "$@" $showIncludes > "$tmpdepfile" stat=$? grep -v '^Note: including file: ' "$tmpdepfile" if test "$stat" = 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # The first sed program below extracts the file names and escapes # backslashes for cygpath. The second sed program outputs the file # name when reading, but also accumulates all include files in the # hold buffer in order to output them again at the end. This only # works with sed implementations that can handle large buffers. sed < "$tmpdepfile" -n ' /^Note: including file: *\(.*\)/ { s//\1/ s/\\/\\\\/g p }' | $cygpath_u | sort -u | sed -n ' s/ /\\ /g s/\(.*\)/'"$tab"'\1 \\/p s/.\(.*\) \\/\1:/ H $ { s/.*/'"$tab"'/ G p }' >> "$depfile" rm -f "$tmpdepfile" ;; msvc7msys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. dashmstdout) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done test -z "$dashmflag" && dashmflag=-M # Require at least two characters before searching for ':' # in the target name. This is to cope with DOS-style filenames: # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise. "$@" $dashmflag | sed 's:^['"$tab"' ]*[^:'"$tab"' ][^:][^:]*\:['"$tab"' ]*:'"$object"'\: :' > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" tr ' ' "$nl" < "$tmpdepfile" | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; dashXmstdout) # This case only exists to satisfy depend.m4. It is never actually # run, as this mode is specially recognized in the preamble. exit 1 ;; makedepend) "$@" || exit $? # Remove any Libtool call if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # X makedepend shift cleared=no eat=no for arg do case $cleared in no) set ""; shift cleared=yes ;; esac if test $eat = yes; then eat=no continue fi case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; # Strip any option that makedepend may not understand. Remove # the object too, otherwise makedepend will parse it as a source file. -arch) eat=yes ;; -*|$object) ;; *) set fnord "$@" "$arg"; shift ;; esac done obj_suffix=`echo "$object" | sed 's/^.*\././'` touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" # makedepend may prepend the VPATH from the source file name to the object. # No need to regex-escape $object, excess matching of '.' is harmless. sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" sed '1,2d' "$tmpdepfile" | tr ' ' "$nl" | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; cpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done "$@" -E | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; msvisualcpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi IFS=" " for arg do case "$arg" in -o) shift ;; $object) shift ;; "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E 2>/dev/null | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile" echo "$tab" >> "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; msvcmsys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: telepathy-mission-control-5.16.4/build-aux/missing0000755000175000017500000002415212762351617023324 0ustar00gkiagiagkiagia00000000000000#! /bin/sh # Common stub for a few missing GNU programs while installing. scriptversion=2012-01-06.13; # UTC # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006, # 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc. # Originally by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try \`$0 --help' for more information" exit 1 fi run=: sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p' sed_minuso='s/.* -o \([^ ]*\).*/\1/p' # In the cases where this matters, `missing' is being run in the # srcdir already. if test -f configure.ac; then configure_ac=configure.ac else configure_ac=configure.in fi msg="missing on your system" case $1 in --run) # Try to run requested program, and just exit if it succeeds. run= shift "$@" && exit 0 # Exit code 63 means version mismatch. This often happens # when the user try to use an ancient version of a tool on # a file that requires a minimum version. In this case we # we should proceed has if the program had been absent, or # if --run hadn't been passed. if test $? = 63; then run=: msg="probably too old" fi ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an error status if there is no known handling for PROGRAM. Options: -h, --help display this help and exit -v, --version output version information and exit --run try to run the given command, and emulate it if it fails Supported PROGRAM values: aclocal touch file \`aclocal.m4' autoconf touch file \`configure' autoheader touch file \`config.h.in' autom4te touch the output file, or create a stub one automake touch all \`Makefile.in' files bison create \`y.tab.[ch]', if possible, from existing .[ch] flex create \`lex.yy.c', if possible, from existing .c help2man touch the output file lex create \`lex.yy.c', if possible, from existing .c makeinfo touch the output file yacc create \`y.tab.[ch]', if possible, from existing .[ch] Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and \`g' are ignored when checking the name. Send bug reports to ." exit $? ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" exit $? ;; -*) echo 1>&2 "$0: Unknown \`$1' option" echo 1>&2 "Try \`$0 --help' for more information" exit 1 ;; esac # normalize program name to check for. program=`echo "$1" | sed ' s/^gnu-//; t s/^gnu//; t s/^g//; t'` # Now exit if we have it, but it failed. Also exit now if we # don't have it and --version was passed (most likely to detect # the program). This is about non-GNU programs, so use $1 not # $program. case $1 in lex*|yacc*) # Not GNU programs, they don't have --version. ;; *) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then # Could not run --version or --help. This is probably someone # running `$TOOL --version' or `$TOOL --help' to check whether # $TOOL exists and not knowing $TOOL uses missing. exit 1 fi ;; esac # If it does not exist, or fails to run (possibly an outdated version), # try to emulate it. case $program in aclocal*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." touch aclocal.m4 ;; autoconf*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." touch configure ;; autoheader*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acconfig.h' or \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` test -z "$files" && files="config.h" touch_files= for f in $files; do case $f in *:*) touch_files="$touch_files "`echo "$f" | sed -e 's/^[^:]*://' -e 's/:.*//'`;; *) touch_files="$touch_files $f.in";; esac done touch $touch_files ;; automake*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." find . -type f -name Makefile.am -print | sed 's/\.am$/.in/' | while read f; do touch "$f"; done ;; autom4te*) echo 1>&2 "\ WARNING: \`$1' is needed, but is $msg. You might have modified some files without having the proper tools for further handling them. You can get \`$1' as part of \`Autoconf' from any GNU archive site." file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo "#! /bin/sh" echo "# Created by GNU Automake missing as a replacement of" echo "# $ $@" echo "exit 0" chmod +x $file exit 1 fi ;; bison*|yacc*) echo 1>&2 "\ WARNING: \`$1' $msg. You should only need it if you modified a \`.y' file. You may need the \`Bison' package in order for those modifications to take effect. You can get \`Bison' from any GNU archive site." rm -f y.tab.c y.tab.h if test $# -ne 1; then eval LASTARG=\${$#} case $LASTARG in *.y) SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` if test -f "$SRCFILE"; then cp "$SRCFILE" y.tab.c fi SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` if test -f "$SRCFILE"; then cp "$SRCFILE" y.tab.h fi ;; esac fi if test ! -f y.tab.h; then echo >y.tab.h fi if test ! -f y.tab.c; then echo 'main() { return 0; }' >y.tab.c fi ;; lex*|flex*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.l' file. You may need the \`Flex' package in order for those modifications to take effect. You can get \`Flex' from any GNU archive site." rm -f lex.yy.c if test $# -ne 1; then eval LASTARG=\${$#} case $LASTARG in *.l) SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` if test -f "$SRCFILE"; then cp "$SRCFILE" lex.yy.c fi ;; esac fi if test ! -f lex.yy.c; then echo 'main() { return 0; }' >lex.yy.c fi ;; help2man*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a dependency of a manual page. You may need the \`Help2man' package in order for those modifications to take effect. You can get \`Help2man' from any GNU archive site." file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo ".ab help2man is required to generate this page" exit $? fi ;; makeinfo*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.texi' or \`.texinfo' file, or any other file indirectly affecting the aspect of the manual. The spurious call might also be the consequence of using a buggy \`make' (AIX, DU, IRIX). You might want to install the \`Texinfo' package or the \`GNU make' package. Grab either from any GNU archive site." # The file to touch is that specified with -o ... file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -z "$file"; then # ... or it is the one specified with @setfilename ... infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` file=`sed -n ' /^@setfilename/{ s/.* \([^ ]*\) *$/\1/ p q }' $infile` # ... or it is derived from the source name (dir/f.texi becomes f.info) test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info fi # If the file does not exist, the user really needs makeinfo; # let's fail without touching anything. test -f $file || exit 1 touch $file ;; *) echo 1>&2 "\ WARNING: \`$1' is needed, and is $msg. You might have modified some files without having the proper tools for further handling them. Check the \`README' file, it often tells you about the needed prerequisites for installing this package. You may also peek at any GNU archive site, in case some other package would contain this missing \`$1' program." exit 1 ;; esac exit 0 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: telepathy-mission-control-5.16.4/build-aux/ltmain.sh0000644000175000017500000117350012762351615023546 0ustar00gkiagiagkiagia00000000000000#! /bin/sh ## DO NOT EDIT - This file generated from ./build-aux/ltmain.in ## by inline-source v2014-01-03.01 # libtool (GNU libtool) 2.4.6 # Provide generalized library-building support services. # Written by Gordon Matzigkeit , 1996 # Copyright (C) 1996-2015 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # GNU Libtool is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . PROGRAM=libtool PACKAGE=libtool VERSION=2.4.6 package_revision=2.4.6 ## ------ ## ## Usage. ## ## ------ ## # Run './libtool --help' for help with using this script from the # command line. ## ------------------------------- ## ## User overridable command paths. ## ## ------------------------------- ## # After configure completes, it has a better idea of some of the # shell tools we need than the defaults used by the functions shared # with bootstrap, so set those here where they can still be over- # ridden by the user, but otherwise take precedence. : ${AUTOCONF="autoconf"} : ${AUTOMAKE="automake"} ## -------------------------- ## ## Source external libraries. ## ## -------------------------- ## # Much of our low-level functionality needs to be sourced from external # libraries, which are installed to $pkgauxdir. # Set a version string for this script. scriptversion=2015-10-04.22; # UTC # General shell script boiler plate, and helper functions. # Written by Gary V. Vaughan, 2004 # Copyright (C) 2004-2015 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # As a special exception to the GNU General Public License, if you distribute # this file as part of a program or library that is built using GNU Libtool, # you may include this file under the same distribution terms that you use # for the rest of that program. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNES FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # Please report bugs or propose patches to gary@gnu.org. ## ------ ## ## Usage. ## ## ------ ## # Evaluate this file near the top of your script to gain access to # the functions and variables defined here: # # . `echo "$0" | ${SED-sed} 's|[^/]*$||'`/build-aux/funclib.sh # # If you need to override any of the default environment variable # settings, do that before evaluating this file. ## -------------------- ## ## Shell normalisation. ## ## -------------------- ## # Some shells need a little help to be as Bourne compatible as possible. # Before doing anything else, make sure all that help has been provided! DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi # NLS nuisances: We save the old values in case they are required later. _G_user_locale= _G_safe_locale= for _G_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test set = \"\${$_G_var+set}\"; then save_$_G_var=\$$_G_var $_G_var=C export $_G_var _G_user_locale=\"$_G_var=\\\$save_\$_G_var; \$_G_user_locale\" _G_safe_locale=\"$_G_var=C; \$_G_safe_locale\" fi" done # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Make sure IFS has a sensible default sp=' ' nl=' ' IFS="$sp $nl" # There are apparently some retarded systems that use ';' as a PATH separator! if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi ## ------------------------- ## ## Locate command utilities. ## ## ------------------------- ## # func_executable_p FILE # ---------------------- # Check that FILE is an executable regular file. func_executable_p () { test -f "$1" && test -x "$1" } # func_path_progs PROGS_LIST CHECK_FUNC [PATH] # -------------------------------------------- # Search for either a program that responds to --version with output # containing "GNU", or else returned by CHECK_FUNC otherwise, by # trying all the directories in PATH with each of the elements of # PROGS_LIST. # # CHECK_FUNC should accept the path to a candidate program, and # set $func_check_prog_result if it truncates its output less than # $_G_path_prog_max characters. func_path_progs () { _G_progs_list=$1 _G_check_func=$2 _G_PATH=${3-"$PATH"} _G_path_prog_max=0 _G_path_prog_found=false _G_save_IFS=$IFS; IFS=${PATH_SEPARATOR-:} for _G_dir in $_G_PATH; do IFS=$_G_save_IFS test -z "$_G_dir" && _G_dir=. for _G_prog_name in $_G_progs_list; do for _exeext in '' .EXE; do _G_path_prog=$_G_dir/$_G_prog_name$_exeext func_executable_p "$_G_path_prog" || continue case `"$_G_path_prog" --version 2>&1` in *GNU*) func_path_progs_result=$_G_path_prog _G_path_prog_found=: ;; *) $_G_check_func $_G_path_prog func_path_progs_result=$func_check_prog_result ;; esac $_G_path_prog_found && break 3 done done done IFS=$_G_save_IFS test -z "$func_path_progs_result" && { echo "no acceptable sed could be found in \$PATH" >&2 exit 1 } } # We want to be able to use the functions in this file before configure # has figured out where the best binaries are kept, which means we have # to search for them ourselves - except when the results are already set # where we skip the searches. # Unless the user overrides by setting SED, search the path for either GNU # sed, or the sed that truncates its output the least. test -z "$SED" && { _G_sed_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for _G_i in 1 2 3 4 5 6 7; do _G_sed_script=$_G_sed_script$nl$_G_sed_script done echo "$_G_sed_script" 2>/dev/null | sed 99q >conftest.sed _G_sed_script= func_check_prog_sed () { _G_path_prog=$1 _G_count=0 printf 0123456789 >conftest.in while : do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo '' >> conftest.nl "$_G_path_prog" -f conftest.sed conftest.out 2>/dev/null || break diff conftest.out conftest.nl >/dev/null 2>&1 || break _G_count=`expr $_G_count + 1` if test "$_G_count" -gt "$_G_path_prog_max"; then # Best one so far, save it but keep looking for a better one func_check_prog_result=$_G_path_prog _G_path_prog_max=$_G_count fi # 10*(2^10) chars as input seems more than enough test 10 -lt "$_G_count" && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out } func_path_progs "sed gsed" func_check_prog_sed $PATH:/usr/xpg4/bin rm -f conftest.sed SED=$func_path_progs_result } # Unless the user overrides by setting GREP, search the path for either GNU # grep, or the grep that truncates its output the least. test -z "$GREP" && { func_check_prog_grep () { _G_path_prog=$1 _G_count=0 _G_path_prog_max=0 printf 0123456789 >conftest.in while : do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo 'GREP' >> conftest.nl "$_G_path_prog" -e 'GREP$' -e '-(cannot match)-' conftest.out 2>/dev/null || break diff conftest.out conftest.nl >/dev/null 2>&1 || break _G_count=`expr $_G_count + 1` if test "$_G_count" -gt "$_G_path_prog_max"; then # Best one so far, save it but keep looking for a better one func_check_prog_result=$_G_path_prog _G_path_prog_max=$_G_count fi # 10*(2^10) chars as input seems more than enough test 10 -lt "$_G_count" && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out } func_path_progs "grep ggrep" func_check_prog_grep $PATH:/usr/xpg4/bin GREP=$func_path_progs_result } ## ------------------------------- ## ## User overridable command paths. ## ## ------------------------------- ## # All uppercase variable names are used for environment variables. These # variables can be overridden by the user before calling a script that # uses them if a suitable command of that name is not already available # in the command search PATH. : ${CP="cp -f"} : ${ECHO="printf %s\n"} : ${EGREP="$GREP -E"} : ${FGREP="$GREP -F"} : ${LN_S="ln -s"} : ${MAKE="make"} : ${MKDIR="mkdir"} : ${MV="mv -f"} : ${RM="rm -f"} : ${SHELL="${CONFIG_SHELL-/bin/sh}"} ## -------------------- ## ## Useful sed snippets. ## ## -------------------- ## sed_dirname='s|/[^/]*$||' sed_basename='s|^.*/||' # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. sed_quote_subst='s|\([`"$\\]\)|\\\1|g' # Same as above, but do not quote variable references. sed_double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution that turns a string into a regex matching for the # string literally. sed_make_literal_regex='s|[].[^$\\*\/]|\\&|g' # Sed substitution that converts a w32 file name or path # that contains forward slashes, into one that contains # (escaped) backslashes. A very naive implementation. sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' # Re-'\' parameter expansions in output of sed_double_quote_subst that # were '\'-ed in input to the same. If an odd number of '\' preceded a # '$' in input to sed_double_quote_subst, that '$' was protected from # expansion. Since each input '\' is now two '\'s, look for any number # of runs of four '\'s followed by two '\'s and then a '$'. '\' that '$'. _G_bs='\\' _G_bs2='\\\\' _G_bs4='\\\\\\\\' _G_dollar='\$' sed_double_backslash="\ s/$_G_bs4/&\\ /g s/^$_G_bs2$_G_dollar/$_G_bs&/ s/\\([^$_G_bs]\\)$_G_bs2$_G_dollar/\\1$_G_bs2$_G_bs$_G_dollar/g s/\n//g" ## ----------------- ## ## Global variables. ## ## ----------------- ## # Except for the global variables explicitly listed below, the following # functions in the '^func_' namespace, and the '^require_' namespace # variables initialised in the 'Resource management' section, sourcing # this file will not pollute your global namespace with anything # else. There's no portable way to scope variables in Bourne shell # though, so actually running these functions will sometimes place # results into a variable named after the function, and often use # temporary variables in the '^_G_' namespace. If you are careful to # avoid using those namespaces casually in your sourcing script, things # should continue to work as you expect. And, of course, you can freely # overwrite any of the functions or variables defined here before # calling anything to customize them. EXIT_SUCCESS=0 EXIT_FAILURE=1 EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing. EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake. # Allow overriding, eg assuming that you follow the convention of # putting '$debug_cmd' at the start of all your functions, you can get # bash to show function call trace with: # # debug_cmd='eval echo "${FUNCNAME[0]} $*" >&2' bash your-script-name debug_cmd=${debug_cmd-":"} exit_cmd=: # By convention, finish your script with: # # exit $exit_status # # so that you can set exit_status to non-zero if you want to indicate # something went wrong during execution without actually bailing out at # the point of failure. exit_status=$EXIT_SUCCESS # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh # is ksh but when the shell is invoked as "sh" and the current value of # the _XPG environment variable is not equal to 1 (one), the special # positional parameter $0, within a function call, is the name of the # function. progpath=$0 # The name of this program. progname=`$ECHO "$progpath" |$SED "$sed_basename"` # Make sure we have an absolute progpath for reexecution: case $progpath in [\\/]*|[A-Za-z]:\\*) ;; *[\\/]*) progdir=`$ECHO "$progpath" |$SED "$sed_dirname"` progdir=`cd "$progdir" && pwd` progpath=$progdir/$progname ;; *) _G_IFS=$IFS IFS=${PATH_SEPARATOR-:} for progdir in $PATH; do IFS=$_G_IFS test -x "$progdir/$progname" && break done IFS=$_G_IFS test -n "$progdir" || progdir=`pwd` progpath=$progdir/$progname ;; esac ## ----------------- ## ## Standard options. ## ## ----------------- ## # The following options affect the operation of the functions defined # below, and should be set appropriately depending on run-time para- # meters passed on the command line. opt_dry_run=false opt_quiet=false opt_verbose=false # Categories 'all' and 'none' are always available. Append any others # you will pass as the first argument to func_warning from your own # code. warning_categories= # By default, display warnings according to 'opt_warning_types'. Set # 'warning_func' to ':' to elide all warnings, or func_fatal_error to # treat the next displayed warning as a fatal error. warning_func=func_warn_and_continue # Set to 'all' to display all warnings, 'none' to suppress all # warnings, or a space delimited list of some subset of # 'warning_categories' to display only the listed warnings. opt_warning_types=all ## -------------------- ## ## Resource management. ## ## -------------------- ## # This section contains definitions for functions that each ensure a # particular resource (a file, or a non-empty configuration variable for # example) is available, and if appropriate to extract default values # from pertinent package files. Call them using their associated # 'require_*' variable to ensure that they are executed, at most, once. # # It's entirely deliberate that calling these functions can set # variables that don't obey the namespace limitations obeyed by the rest # of this file, in order that that they be as useful as possible to # callers. # require_term_colors # ------------------- # Allow display of bold text on terminals that support it. require_term_colors=func_require_term_colors func_require_term_colors () { $debug_cmd test -t 1 && { # COLORTERM and USE_ANSI_COLORS environment variables take # precedence, because most terminfo databases neglect to describe # whether color sequences are supported. test -n "${COLORTERM+set}" && : ${USE_ANSI_COLORS="1"} if test 1 = "$USE_ANSI_COLORS"; then # Standard ANSI escape sequences tc_reset='' tc_bold=''; tc_standout='' tc_red=''; tc_green='' tc_blue=''; tc_cyan='' else # Otherwise trust the terminfo database after all. test -n "`tput sgr0 2>/dev/null`" && { tc_reset=`tput sgr0` test -n "`tput bold 2>/dev/null`" && tc_bold=`tput bold` tc_standout=$tc_bold test -n "`tput smso 2>/dev/null`" && tc_standout=`tput smso` test -n "`tput setaf 1 2>/dev/null`" && tc_red=`tput setaf 1` test -n "`tput setaf 2 2>/dev/null`" && tc_green=`tput setaf 2` test -n "`tput setaf 4 2>/dev/null`" && tc_blue=`tput setaf 4` test -n "`tput setaf 5 2>/dev/null`" && tc_cyan=`tput setaf 5` } fi } require_term_colors=: } ## ----------------- ## ## Function library. ## ## ----------------- ## # This section contains a variety of useful functions to call in your # scripts. Take note of the portable wrappers for features provided by # some modern shells, which will fall back to slower equivalents on # less featureful shells. # func_append VAR VALUE # --------------------- # Append VALUE onto the existing contents of VAR. # We should try to minimise forks, especially on Windows where they are # unreasonably slow, so skip the feature probes when bash or zsh are # being used: if test set = "${BASH_VERSION+set}${ZSH_VERSION+set}"; then : ${_G_HAVE_ARITH_OP="yes"} : ${_G_HAVE_XSI_OPS="yes"} # The += operator was introduced in bash 3.1 case $BASH_VERSION in [12].* | 3.0 | 3.0*) ;; *) : ${_G_HAVE_PLUSEQ_OP="yes"} ;; esac fi # _G_HAVE_PLUSEQ_OP # Can be empty, in which case the shell is probed, "yes" if += is # useable or anything else if it does not work. test -z "$_G_HAVE_PLUSEQ_OP" \ && (eval 'x=a; x+=" b"; test "a b" = "$x"') 2>/dev/null \ && _G_HAVE_PLUSEQ_OP=yes if test yes = "$_G_HAVE_PLUSEQ_OP" then # This is an XSI compatible shell, allowing a faster implementation... eval 'func_append () { $debug_cmd eval "$1+=\$2" }' else # ...otherwise fall back to using expr, which is often a shell builtin. func_append () { $debug_cmd eval "$1=\$$1\$2" } fi # func_append_quoted VAR VALUE # ---------------------------- # Quote VALUE and append to the end of shell variable VAR, separated # by a space. if test yes = "$_G_HAVE_PLUSEQ_OP"; then eval 'func_append_quoted () { $debug_cmd func_quote_for_eval "$2" eval "$1+=\\ \$func_quote_for_eval_result" }' else func_append_quoted () { $debug_cmd func_quote_for_eval "$2" eval "$1=\$$1\\ \$func_quote_for_eval_result" } fi # func_append_uniq VAR VALUE # -------------------------- # Append unique VALUE onto the existing contents of VAR, assuming # entries are delimited by the first character of VALUE. For example: # # func_append_uniq options " --another-option option-argument" # # will only append to $options if " --another-option option-argument " # is not already present somewhere in $options already (note spaces at # each end implied by leading space in second argument). func_append_uniq () { $debug_cmd eval _G_current_value='`$ECHO $'$1'`' _G_delim=`expr "$2" : '\(.\)'` case $_G_delim$_G_current_value$_G_delim in *"$2$_G_delim"*) ;; *) func_append "$@" ;; esac } # func_arith TERM... # ------------------ # Set func_arith_result to the result of evaluating TERMs. test -z "$_G_HAVE_ARITH_OP" \ && (eval 'test 2 = $(( 1 + 1 ))') 2>/dev/null \ && _G_HAVE_ARITH_OP=yes if test yes = "$_G_HAVE_ARITH_OP"; then eval 'func_arith () { $debug_cmd func_arith_result=$(( $* )) }' else func_arith () { $debug_cmd func_arith_result=`expr "$@"` } fi # func_basename FILE # ------------------ # Set func_basename_result to FILE with everything up to and including # the last / stripped. if test yes = "$_G_HAVE_XSI_OPS"; then # If this shell supports suffix pattern removal, then use it to avoid # forking. Hide the definitions single quotes in case the shell chokes # on unsupported syntax... _b='func_basename_result=${1##*/}' _d='case $1 in */*) func_dirname_result=${1%/*}$2 ;; * ) func_dirname_result=$3 ;; esac' else # ...otherwise fall back to using sed. _b='func_basename_result=`$ECHO "$1" |$SED "$sed_basename"`' _d='func_dirname_result=`$ECHO "$1" |$SED "$sed_dirname"` if test "X$func_dirname_result" = "X$1"; then func_dirname_result=$3 else func_append func_dirname_result "$2" fi' fi eval 'func_basename () { $debug_cmd '"$_b"' }' # func_dirname FILE APPEND NONDIR_REPLACEMENT # ------------------------------------------- # Compute the dirname of FILE. If nonempty, add APPEND to the result, # otherwise set result to NONDIR_REPLACEMENT. eval 'func_dirname () { $debug_cmd '"$_d"' }' # func_dirname_and_basename FILE APPEND NONDIR_REPLACEMENT # -------------------------------------------------------- # Perform func_basename and func_dirname in a single function # call: # dirname: Compute the dirname of FILE. If nonempty, # add APPEND to the result, otherwise set result # to NONDIR_REPLACEMENT. # value returned in "$func_dirname_result" # basename: Compute filename of FILE. # value retuned in "$func_basename_result" # For efficiency, we do not delegate to the functions above but instead # duplicate the functionality here. eval 'func_dirname_and_basename () { $debug_cmd '"$_b"' '"$_d"' }' # func_echo ARG... # ---------------- # Echo program name prefixed message. func_echo () { $debug_cmd _G_message=$* func_echo_IFS=$IFS IFS=$nl for _G_line in $_G_message; do IFS=$func_echo_IFS $ECHO "$progname: $_G_line" done IFS=$func_echo_IFS } # func_echo_all ARG... # -------------------- # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "$*" } # func_echo_infix_1 INFIX ARG... # ------------------------------ # Echo program name, followed by INFIX on the first line, with any # additional lines not showing INFIX. func_echo_infix_1 () { $debug_cmd $require_term_colors _G_infix=$1; shift _G_indent=$_G_infix _G_prefix="$progname: $_G_infix: " _G_message=$* # Strip color escape sequences before counting printable length for _G_tc in "$tc_reset" "$tc_bold" "$tc_standout" "$tc_red" "$tc_green" "$tc_blue" "$tc_cyan" do test -n "$_G_tc" && { _G_esc_tc=`$ECHO "$_G_tc" | $SED "$sed_make_literal_regex"` _G_indent=`$ECHO "$_G_indent" | $SED "s|$_G_esc_tc||g"` } done _G_indent="$progname: "`echo "$_G_indent" | $SED 's|.| |g'`" " ## exclude from sc_prohibit_nested_quotes func_echo_infix_1_IFS=$IFS IFS=$nl for _G_line in $_G_message; do IFS=$func_echo_infix_1_IFS $ECHO "$_G_prefix$tc_bold$_G_line$tc_reset" >&2 _G_prefix=$_G_indent done IFS=$func_echo_infix_1_IFS } # func_error ARG... # ----------------- # Echo program name prefixed message to standard error. func_error () { $debug_cmd $require_term_colors func_echo_infix_1 " $tc_standout${tc_red}error$tc_reset" "$*" >&2 } # func_fatal_error ARG... # ----------------------- # Echo program name prefixed message to standard error, and exit. func_fatal_error () { $debug_cmd func_error "$*" exit $EXIT_FAILURE } # func_grep EXPRESSION FILENAME # ----------------------------- # Check whether EXPRESSION matches any line of FILENAME, without output. func_grep () { $debug_cmd $GREP "$1" "$2" >/dev/null 2>&1 } # func_len STRING # --------------- # Set func_len_result to the length of STRING. STRING may not # start with a hyphen. test -z "$_G_HAVE_XSI_OPS" \ && (eval 'x=a/b/c; test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \ && _G_HAVE_XSI_OPS=yes if test yes = "$_G_HAVE_XSI_OPS"; then eval 'func_len () { $debug_cmd func_len_result=${#1} }' else func_len () { $debug_cmd func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len` } fi # func_mkdir_p DIRECTORY-PATH # --------------------------- # Make sure the entire path to DIRECTORY-PATH is available. func_mkdir_p () { $debug_cmd _G_directory_path=$1 _G_dir_list= if test -n "$_G_directory_path" && test : != "$opt_dry_run"; then # Protect directory names starting with '-' case $_G_directory_path in -*) _G_directory_path=./$_G_directory_path ;; esac # While some portion of DIR does not yet exist... while test ! -d "$_G_directory_path"; do # ...make a list in topmost first order. Use a colon delimited # list incase some portion of path contains whitespace. _G_dir_list=$_G_directory_path:$_G_dir_list # If the last portion added has no slash in it, the list is done case $_G_directory_path in */*) ;; *) break ;; esac # ...otherwise throw away the child directory and loop _G_directory_path=`$ECHO "$_G_directory_path" | $SED -e "$sed_dirname"` done _G_dir_list=`$ECHO "$_G_dir_list" | $SED 's|:*$||'` func_mkdir_p_IFS=$IFS; IFS=: for _G_dir in $_G_dir_list; do IFS=$func_mkdir_p_IFS # mkdir can fail with a 'File exist' error if two processes # try to create one of the directories concurrently. Don't # stop in that case! $MKDIR "$_G_dir" 2>/dev/null || : done IFS=$func_mkdir_p_IFS # Bail out if we (or some other process) failed to create a directory. test -d "$_G_directory_path" || \ func_fatal_error "Failed to create '$1'" fi } # func_mktempdir [BASENAME] # ------------------------- # Make a temporary directory that won't clash with other running # libtool processes, and avoids race conditions if possible. If # given, BASENAME is the basename for that directory. func_mktempdir () { $debug_cmd _G_template=${TMPDIR-/tmp}/${1-$progname} if test : = "$opt_dry_run"; then # Return a directory name, but don't create it in dry-run mode _G_tmpdir=$_G_template-$$ else # If mktemp works, use that first and foremost _G_tmpdir=`mktemp -d "$_G_template-XXXXXXXX" 2>/dev/null` if test ! -d "$_G_tmpdir"; then # Failing that, at least try and use $RANDOM to avoid a race _G_tmpdir=$_G_template-${RANDOM-0}$$ func_mktempdir_umask=`umask` umask 0077 $MKDIR "$_G_tmpdir" umask $func_mktempdir_umask fi # If we're not in dry-run mode, bomb out on failure test -d "$_G_tmpdir" || \ func_fatal_error "cannot create temporary directory '$_G_tmpdir'" fi $ECHO "$_G_tmpdir" } # func_normal_abspath PATH # ------------------------ # Remove doubled-up and trailing slashes, "." path components, # and cancel out any ".." path components in PATH after making # it an absolute path. func_normal_abspath () { $debug_cmd # These SED scripts presuppose an absolute path with a trailing slash. _G_pathcar='s|^/\([^/]*\).*$|\1|' _G_pathcdr='s|^/[^/]*||' _G_removedotparts=':dotsl s|/\./|/|g t dotsl s|/\.$|/|' _G_collapseslashes='s|/\{1,\}|/|g' _G_finalslash='s|/*$|/|' # Start from root dir and reassemble the path. func_normal_abspath_result= func_normal_abspath_tpath=$1 func_normal_abspath_altnamespace= case $func_normal_abspath_tpath in "") # Empty path, that just means $cwd. func_stripname '' '/' "`pwd`" func_normal_abspath_result=$func_stripname_result return ;; # The next three entries are used to spot a run of precisely # two leading slashes without using negated character classes; # we take advantage of case's first-match behaviour. ///*) # Unusual form of absolute path, do nothing. ;; //*) # Not necessarily an ordinary path; POSIX reserves leading '//' # and for example Cygwin uses it to access remote file shares # over CIFS/SMB, so we conserve a leading double slash if found. func_normal_abspath_altnamespace=/ ;; /*) # Absolute path, do nothing. ;; *) # Relative path, prepend $cwd. func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath ;; esac # Cancel out all the simple stuff to save iterations. We also want # the path to end with a slash for ease of parsing, so make sure # there is one (and only one) here. func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$_G_removedotparts" -e "$_G_collapseslashes" -e "$_G_finalslash"` while :; do # Processed it all yet? if test / = "$func_normal_abspath_tpath"; then # If we ascended to the root using ".." the result may be empty now. if test -z "$func_normal_abspath_result"; then func_normal_abspath_result=/ fi break fi func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$_G_pathcar"` func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$_G_pathcdr"` # Figure out what to do with it case $func_normal_abspath_tcomponent in "") # Trailing empty path component, ignore it. ;; ..) # Parent dir; strip last assembled component from result. func_dirname "$func_normal_abspath_result" func_normal_abspath_result=$func_dirname_result ;; *) # Actual path component, append it. func_append func_normal_abspath_result "/$func_normal_abspath_tcomponent" ;; esac done # Restore leading double-slash if one was found on entry. func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result } # func_notquiet ARG... # -------------------- # Echo program name prefixed message only when not in quiet mode. func_notquiet () { $debug_cmd $opt_quiet || func_echo ${1+"$@"} # A bug in bash halts the script if the last line of a function # fails when set -e is in force, so we need another command to # work around that: : } # func_relative_path SRCDIR DSTDIR # -------------------------------- # Set func_relative_path_result to the relative path from SRCDIR to DSTDIR. func_relative_path () { $debug_cmd func_relative_path_result= func_normal_abspath "$1" func_relative_path_tlibdir=$func_normal_abspath_result func_normal_abspath "$2" func_relative_path_tbindir=$func_normal_abspath_result # Ascend the tree starting from libdir while :; do # check if we have found a prefix of bindir case $func_relative_path_tbindir in $func_relative_path_tlibdir) # found an exact match func_relative_path_tcancelled= break ;; $func_relative_path_tlibdir*) # found a matching prefix func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir" func_relative_path_tcancelled=$func_stripname_result if test -z "$func_relative_path_result"; then func_relative_path_result=. fi break ;; *) func_dirname $func_relative_path_tlibdir func_relative_path_tlibdir=$func_dirname_result if test -z "$func_relative_path_tlibdir"; then # Have to descend all the way to the root! func_relative_path_result=../$func_relative_path_result func_relative_path_tcancelled=$func_relative_path_tbindir break fi func_relative_path_result=../$func_relative_path_result ;; esac done # Now calculate path; take care to avoid doubling-up slashes. func_stripname '' '/' "$func_relative_path_result" func_relative_path_result=$func_stripname_result func_stripname '/' '/' "$func_relative_path_tcancelled" if test -n "$func_stripname_result"; then func_append func_relative_path_result "/$func_stripname_result" fi # Normalisation. If bindir is libdir, return '.' else relative path. if test -n "$func_relative_path_result"; then func_stripname './' '' "$func_relative_path_result" func_relative_path_result=$func_stripname_result fi test -n "$func_relative_path_result" || func_relative_path_result=. : } # func_quote ARG # -------------- # Aesthetically quote one ARG, store the result into $func_quote_result. Note # that we keep attention to performance here (so far O(N) complexity as long as # func_append is O(1)). func_quote () { $debug_cmd func_quote_result=$1 case $func_quote_result in *[\\\`\"\$]*) case $func_quote_result in *[\[\*\?]*) func_quote_result=`$ECHO "$func_quote_result" | $SED "$sed_quote_subst"` return 0 ;; esac func_quote_old_IFS=$IFS for _G_char in '\' '`' '"' '$' do # STATE($1) PREV($2) SEPARATOR($3) set start "" "" func_quote_result=dummy"$_G_char$func_quote_result$_G_char"dummy IFS=$_G_char for _G_part in $func_quote_result do case $1 in quote) func_append func_quote_result "$3$2" set quote "$_G_part" "\\$_G_char" ;; start) set first "" "" func_quote_result= ;; first) set quote "$_G_part" "" ;; esac done IFS=$func_quote_old_IFS done ;; *) ;; esac } # func_quote_for_eval ARG... # -------------------------- # Aesthetically quote ARGs to be evaled later. # This function returns two values: # i) func_quote_for_eval_result # double-quoted, suitable for a subsequent eval # ii) func_quote_for_eval_unquoted_result # has all characters that are still active within double # quotes backslashified. func_quote_for_eval () { $debug_cmd func_quote_for_eval_unquoted_result= func_quote_for_eval_result= while test 0 -lt $#; do func_quote "$1" _G_unquoted_arg=$func_quote_result if test -n "$func_quote_for_eval_unquoted_result"; then func_append func_quote_for_eval_unquoted_result " $_G_unquoted_arg" else func_append func_quote_for_eval_unquoted_result "$_G_unquoted_arg" fi case $_G_unquoted_arg in # Double-quote args containing shell metacharacters to delay # word splitting, command substitution and variable expansion # for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") _G_quoted_arg=\"$_G_unquoted_arg\" ;; *) _G_quoted_arg=$_G_unquoted_arg ;; esac if test -n "$func_quote_for_eval_result"; then func_append func_quote_for_eval_result " $_G_quoted_arg" else func_append func_quote_for_eval_result "$_G_quoted_arg" fi shift done } # func_quote_for_expand ARG # ------------------------- # Aesthetically quote ARG to be evaled later; same as above, # but do not quote variable references. func_quote_for_expand () { $debug_cmd case $1 in *[\\\`\"]*) _G_arg=`$ECHO "$1" | $SED \ -e "$sed_double_quote_subst" -e "$sed_double_backslash"` ;; *) _G_arg=$1 ;; esac case $_G_arg in # Double-quote args containing shell metacharacters to delay # word splitting and command substitution for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") _G_arg=\"$_G_arg\" ;; esac func_quote_for_expand_result=$_G_arg } # func_stripname PREFIX SUFFIX NAME # --------------------------------- # strip PREFIX and SUFFIX from NAME, and store in func_stripname_result. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). if test yes = "$_G_HAVE_XSI_OPS"; then eval 'func_stripname () { $debug_cmd # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are # positional parameters, so assign one to ordinary variable first. func_stripname_result=$3 func_stripname_result=${func_stripname_result#"$1"} func_stripname_result=${func_stripname_result%"$2"} }' else func_stripname () { $debug_cmd case $2 in .*) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%\\\\$2\$%%"`;; *) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%$2\$%%"`;; esac } fi # func_show_eval CMD [FAIL_EXP] # ----------------------------- # Unless opt_quiet is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. func_show_eval () { $debug_cmd _G_cmd=$1 _G_fail_exp=${2-':'} func_quote_for_expand "$_G_cmd" eval "func_notquiet $func_quote_for_expand_result" $opt_dry_run || { eval "$_G_cmd" _G_status=$? if test 0 -ne "$_G_status"; then eval "(exit $_G_status); $_G_fail_exp" fi } } # func_show_eval_locale CMD [FAIL_EXP] # ------------------------------------ # Unless opt_quiet is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. Use the saved locale for evaluation. func_show_eval_locale () { $debug_cmd _G_cmd=$1 _G_fail_exp=${2-':'} $opt_quiet || { func_quote_for_expand "$_G_cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || { eval "$_G_user_locale $_G_cmd" _G_status=$? eval "$_G_safe_locale" if test 0 -ne "$_G_status"; then eval "(exit $_G_status); $_G_fail_exp" fi } } # func_tr_sh # ---------- # Turn $1 into a string suitable for a shell variable name. # Result is stored in $func_tr_sh_result. All characters # not in the set a-zA-Z0-9_ are replaced with '_'. Further, # if $1 begins with a digit, a '_' is prepended as well. func_tr_sh () { $debug_cmd case $1 in [0-9]* | *[!a-zA-Z0-9_]*) func_tr_sh_result=`$ECHO "$1" | $SED -e 's/^\([0-9]\)/_\1/' -e 's/[^a-zA-Z0-9_]/_/g'` ;; * ) func_tr_sh_result=$1 ;; esac } # func_verbose ARG... # ------------------- # Echo program name prefixed message in verbose mode only. func_verbose () { $debug_cmd $opt_verbose && func_echo "$*" : } # func_warn_and_continue ARG... # ----------------------------- # Echo program name prefixed warning message to standard error. func_warn_and_continue () { $debug_cmd $require_term_colors func_echo_infix_1 "${tc_red}warning$tc_reset" "$*" >&2 } # func_warning CATEGORY ARG... # ---------------------------- # Echo program name prefixed warning message to standard error. Warning # messages can be filtered according to CATEGORY, where this function # elides messages where CATEGORY is not listed in the global variable # 'opt_warning_types'. func_warning () { $debug_cmd # CATEGORY must be in the warning_categories list! case " $warning_categories " in *" $1 "*) ;; *) func_internal_error "invalid warning category '$1'" ;; esac _G_category=$1 shift case " $opt_warning_types " in *" $_G_category "*) $warning_func ${1+"$@"} ;; esac } # func_sort_ver VER1 VER2 # ----------------------- # 'sort -V' is not generally available. # Note this deviates from the version comparison in automake # in that it treats 1.5 < 1.5.0, and treats 1.4.4a < 1.4-p3a # but this should suffice as we won't be specifying old # version formats or redundant trailing .0 in bootstrap.conf. # If we did want full compatibility then we should probably # use m4_version_compare from autoconf. func_sort_ver () { $debug_cmd printf '%s\n%s\n' "$1" "$2" \ | sort -t. -k 1,1n -k 2,2n -k 3,3n -k 4,4n -k 5,5n -k 6,6n -k 7,7n -k 8,8n -k 9,9n } # func_lt_ver PREV CURR # --------------------- # Return true if PREV and CURR are in the correct order according to # func_sort_ver, otherwise false. Use it like this: # # func_lt_ver "$prev_ver" "$proposed_ver" || func_fatal_error "..." func_lt_ver () { $debug_cmd test "x$1" = x`func_sort_ver "$1" "$2" | $SED 1q` } # Local variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC" # time-stamp-time-zone: "UTC" # End: #! /bin/sh # Set a version string for this script. scriptversion=2014-01-07.03; # UTC # A portable, pluggable option parser for Bourne shell. # Written by Gary V. Vaughan, 2010 # Copyright (C) 2010-2015 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # Please report bugs or propose patches to gary@gnu.org. ## ------ ## ## Usage. ## ## ------ ## # This file is a library for parsing options in your shell scripts along # with assorted other useful supporting features that you can make use # of too. # # For the simplest scripts you might need only: # # #!/bin/sh # . relative/path/to/funclib.sh # . relative/path/to/options-parser # scriptversion=1.0 # func_options ${1+"$@"} # eval set dummy "$func_options_result"; shift # ...rest of your script... # # In order for the '--version' option to work, you will need to have a # suitably formatted comment like the one at the top of this file # starting with '# Written by ' and ending with '# warranty; '. # # For '-h' and '--help' to work, you will also need a one line # description of your script's purpose in a comment directly above the # '# Written by ' line, like the one at the top of this file. # # The default options also support '--debug', which will turn on shell # execution tracing (see the comment above debug_cmd below for another # use), and '--verbose' and the func_verbose function to allow your script # to display verbose messages only when your user has specified # '--verbose'. # # After sourcing this file, you can plug processing for additional # options by amending the variables from the 'Configuration' section # below, and following the instructions in the 'Option parsing' # section further down. ## -------------- ## ## Configuration. ## ## -------------- ## # You should override these variables in your script after sourcing this # file so that they reflect the customisations you have added to the # option parser. # The usage line for option parsing errors and the start of '-h' and # '--help' output messages. You can embed shell variables for delayed # expansion at the time the message is displayed, but you will need to # quote other shell meta-characters carefully to prevent them being # expanded when the contents are evaled. usage='$progpath [OPTION]...' # Short help message in response to '-h' and '--help'. Add to this or # override it after sourcing this library to reflect the full set of # options your script accepts. usage_message="\ --debug enable verbose shell tracing -W, --warnings=CATEGORY report the warnings falling in CATEGORY [all] -v, --verbose verbosely report processing --version print version information and exit -h, --help print short or long help message and exit " # Additional text appended to 'usage_message' in response to '--help'. long_help_message=" Warning categories include: 'all' show all warnings 'none' turn off all the warnings 'error' warnings are treated as fatal errors" # Help message printed before fatal option parsing errors. fatal_help="Try '\$progname --help' for more information." ## ------------------------- ## ## Hook function management. ## ## ------------------------- ## # This section contains functions for adding, removing, and running hooks # to the main code. A hook is just a named list of of function, that can # be run in order later on. # func_hookable FUNC_NAME # ----------------------- # Declare that FUNC_NAME will run hooks added with # 'func_add_hook FUNC_NAME ...'. func_hookable () { $debug_cmd func_append hookable_fns " $1" } # func_add_hook FUNC_NAME HOOK_FUNC # --------------------------------- # Request that FUNC_NAME call HOOK_FUNC before it returns. FUNC_NAME must # first have been declared "hookable" by a call to 'func_hookable'. func_add_hook () { $debug_cmd case " $hookable_fns " in *" $1 "*) ;; *) func_fatal_error "'$1' does not accept hook functions." ;; esac eval func_append ${1}_hooks '" $2"' } # func_remove_hook FUNC_NAME HOOK_FUNC # ------------------------------------ # Remove HOOK_FUNC from the list of functions called by FUNC_NAME. func_remove_hook () { $debug_cmd eval ${1}_hooks='`$ECHO "\$'$1'_hooks" |$SED "s| '$2'||"`' } # func_run_hooks FUNC_NAME [ARG]... # --------------------------------- # Run all hook functions registered to FUNC_NAME. # It is assumed that the list of hook functions contains nothing more # than a whitespace-delimited list of legal shell function names, and # no effort is wasted trying to catch shell meta-characters or preserve # whitespace. func_run_hooks () { $debug_cmd case " $hookable_fns " in *" $1 "*) ;; *) func_fatal_error "'$1' does not support hook funcions.n" ;; esac eval _G_hook_fns=\$$1_hooks; shift for _G_hook in $_G_hook_fns; do eval $_G_hook '"$@"' # store returned options list back into positional # parameters for next 'cmd' execution. eval _G_hook_result=\$${_G_hook}_result eval set dummy "$_G_hook_result"; shift done func_quote_for_eval ${1+"$@"} func_run_hooks_result=$func_quote_for_eval_result } ## --------------- ## ## Option parsing. ## ## --------------- ## # In order to add your own option parsing hooks, you must accept the # full positional parameter list in your hook function, remove any # options that you action, and then pass back the remaining unprocessed # options in '_result', escaped suitably for # 'eval'. Like this: # # my_options_prep () # { # $debug_cmd # # # Extend the existing usage message. # usage_message=$usage_message' # -s, --silent don'\''t print informational messages # ' # # func_quote_for_eval ${1+"$@"} # my_options_prep_result=$func_quote_for_eval_result # } # func_add_hook func_options_prep my_options_prep # # # my_silent_option () # { # $debug_cmd # # # Note that for efficiency, we parse as many options as we can # # recognise in a loop before passing the remainder back to the # # caller on the first unrecognised argument we encounter. # while test $# -gt 0; do # opt=$1; shift # case $opt in # --silent|-s) opt_silent=: ;; # # Separate non-argument short options: # -s*) func_split_short_opt "$_G_opt" # set dummy "$func_split_short_opt_name" \ # "-$func_split_short_opt_arg" ${1+"$@"} # shift # ;; # *) set dummy "$_G_opt" "$*"; shift; break ;; # esac # done # # func_quote_for_eval ${1+"$@"} # my_silent_option_result=$func_quote_for_eval_result # } # func_add_hook func_parse_options my_silent_option # # # my_option_validation () # { # $debug_cmd # # $opt_silent && $opt_verbose && func_fatal_help "\ # '--silent' and '--verbose' options are mutually exclusive." # # func_quote_for_eval ${1+"$@"} # my_option_validation_result=$func_quote_for_eval_result # } # func_add_hook func_validate_options my_option_validation # # You'll alse need to manually amend $usage_message to reflect the extra # options you parse. It's preferable to append if you can, so that # multiple option parsing hooks can be added safely. # func_options [ARG]... # --------------------- # All the functions called inside func_options are hookable. See the # individual implementations for details. func_hookable func_options func_options () { $debug_cmd func_options_prep ${1+"$@"} eval func_parse_options \ ${func_options_prep_result+"$func_options_prep_result"} eval func_validate_options \ ${func_parse_options_result+"$func_parse_options_result"} eval func_run_hooks func_options \ ${func_validate_options_result+"$func_validate_options_result"} # save modified positional parameters for caller func_options_result=$func_run_hooks_result } # func_options_prep [ARG]... # -------------------------- # All initialisations required before starting the option parse loop. # Note that when calling hook functions, we pass through the list of # positional parameters. If a hook function modifies that list, and # needs to propogate that back to rest of this script, then the complete # modified list must be put in 'func_run_hooks_result' before # returning. func_hookable func_options_prep func_options_prep () { $debug_cmd # Option defaults: opt_verbose=false opt_warning_types= func_run_hooks func_options_prep ${1+"$@"} # save modified positional parameters for caller func_options_prep_result=$func_run_hooks_result } # func_parse_options [ARG]... # --------------------------- # The main option parsing loop. func_hookable func_parse_options func_parse_options () { $debug_cmd func_parse_options_result= # this just eases exit handling while test $# -gt 0; do # Defer to hook functions for initial option parsing, so they # get priority in the event of reusing an option name. func_run_hooks func_parse_options ${1+"$@"} # Adjust func_parse_options positional parameters to match eval set dummy "$func_run_hooks_result"; shift # Break out of the loop if we already parsed every option. test $# -gt 0 || break _G_opt=$1 shift case $_G_opt in --debug|-x) debug_cmd='set -x' func_echo "enabling shell trace mode" $debug_cmd ;; --no-warnings|--no-warning|--no-warn) set dummy --warnings none ${1+"$@"} shift ;; --warnings|--warning|-W) test $# = 0 && func_missing_arg $_G_opt && break case " $warning_categories $1" in *" $1 "*) # trailing space prevents matching last $1 above func_append_uniq opt_warning_types " $1" ;; *all) opt_warning_types=$warning_categories ;; *none) opt_warning_types=none warning_func=: ;; *error) opt_warning_types=$warning_categories warning_func=func_fatal_error ;; *) func_fatal_error \ "unsupported warning category: '$1'" ;; esac shift ;; --verbose|-v) opt_verbose=: ;; --version) func_version ;; -\?|-h) func_usage ;; --help) func_help ;; # Separate optargs to long options (plugins may need this): --*=*) func_split_equals "$_G_opt" set dummy "$func_split_equals_lhs" \ "$func_split_equals_rhs" ${1+"$@"} shift ;; # Separate optargs to short options: -W*) func_split_short_opt "$_G_opt" set dummy "$func_split_short_opt_name" \ "$func_split_short_opt_arg" ${1+"$@"} shift ;; # Separate non-argument short options: -\?*|-h*|-v*|-x*) func_split_short_opt "$_G_opt" set dummy "$func_split_short_opt_name" \ "-$func_split_short_opt_arg" ${1+"$@"} shift ;; --) break ;; -*) func_fatal_help "unrecognised option: '$_G_opt'" ;; *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;; esac done # save modified positional parameters for caller func_quote_for_eval ${1+"$@"} func_parse_options_result=$func_quote_for_eval_result } # func_validate_options [ARG]... # ------------------------------ # Perform any sanity checks on option settings and/or unconsumed # arguments. func_hookable func_validate_options func_validate_options () { $debug_cmd # Display all warnings if -W was not given. test -n "$opt_warning_types" || opt_warning_types=" $warning_categories" func_run_hooks func_validate_options ${1+"$@"} # Bail if the options were screwed! $exit_cmd $EXIT_FAILURE # save modified positional parameters for caller func_validate_options_result=$func_run_hooks_result } ## ----------------- ## ## Helper functions. ## ## ----------------- ## # This section contains the helper functions used by the rest of the # hookable option parser framework in ascii-betical order. # func_fatal_help ARG... # ---------------------- # Echo program name prefixed message to standard error, followed by # a help hint, and exit. func_fatal_help () { $debug_cmd eval \$ECHO \""Usage: $usage"\" eval \$ECHO \""$fatal_help"\" func_error ${1+"$@"} exit $EXIT_FAILURE } # func_help # --------- # Echo long help message to standard output and exit. func_help () { $debug_cmd func_usage_message $ECHO "$long_help_message" exit 0 } # func_missing_arg ARGNAME # ------------------------ # Echo program name prefixed message to standard error and set global # exit_cmd. func_missing_arg () { $debug_cmd func_error "Missing argument for '$1'." exit_cmd=exit } # func_split_equals STRING # ------------------------ # Set func_split_equals_lhs and func_split_equals_rhs shell variables after # splitting STRING at the '=' sign. test -z "$_G_HAVE_XSI_OPS" \ && (eval 'x=a/b/c; test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \ && _G_HAVE_XSI_OPS=yes if test yes = "$_G_HAVE_XSI_OPS" then # This is an XSI compatible shell, allowing a faster implementation... eval 'func_split_equals () { $debug_cmd func_split_equals_lhs=${1%%=*} func_split_equals_rhs=${1#*=} test "x$func_split_equals_lhs" = "x$1" \ && func_split_equals_rhs= }' else # ...otherwise fall back to using expr, which is often a shell builtin. func_split_equals () { $debug_cmd func_split_equals_lhs=`expr "x$1" : 'x\([^=]*\)'` func_split_equals_rhs= test "x$func_split_equals_lhs" = "x$1" \ || func_split_equals_rhs=`expr "x$1" : 'x[^=]*=\(.*\)$'` } fi #func_split_equals # func_split_short_opt SHORTOPT # ----------------------------- # Set func_split_short_opt_name and func_split_short_opt_arg shell # variables after splitting SHORTOPT after the 2nd character. if test yes = "$_G_HAVE_XSI_OPS" then # This is an XSI compatible shell, allowing a faster implementation... eval 'func_split_short_opt () { $debug_cmd func_split_short_opt_arg=${1#??} func_split_short_opt_name=${1%"$func_split_short_opt_arg"} }' else # ...otherwise fall back to using expr, which is often a shell builtin. func_split_short_opt () { $debug_cmd func_split_short_opt_name=`expr "x$1" : 'x-\(.\)'` func_split_short_opt_arg=`expr "x$1" : 'x-.\(.*\)$'` } fi #func_split_short_opt # func_usage # ---------- # Echo short help message to standard output and exit. func_usage () { $debug_cmd func_usage_message $ECHO "Run '$progname --help |${PAGER-more}' for full usage" exit 0 } # func_usage_message # ------------------ # Echo short help message to standard output. func_usage_message () { $debug_cmd eval \$ECHO \""Usage: $usage"\" echo $SED -n 's|^# || /^Written by/{ x;p;x } h /^Written by/q' < "$progpath" echo eval \$ECHO \""$usage_message"\" } # func_version # ------------ # Echo version message to standard output and exit. func_version () { $debug_cmd printf '%s\n' "$progname $scriptversion" $SED -n ' /(C)/!b go :more /\./!{ N s|\n# | | b more } :go /^# Written by /,/# warranty; / { s|^# || s|^# *$|| s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2| p } /^# Written by / { s|^# || p } /^warranty; /q' < "$progpath" exit $? } # Local variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC" # time-stamp-time-zone: "UTC" # End: # Set a version string. scriptversion='(GNU libtool) 2.4.6' # func_echo ARG... # ---------------- # Libtool also displays the current mode in messages, so override # funclib.sh func_echo with this custom definition. func_echo () { $debug_cmd _G_message=$* func_echo_IFS=$IFS IFS=$nl for _G_line in $_G_message; do IFS=$func_echo_IFS $ECHO "$progname${opt_mode+: $opt_mode}: $_G_line" done IFS=$func_echo_IFS } # func_warning ARG... # ------------------- # Libtool warnings are not categorized, so override funclib.sh # func_warning with this simpler definition. func_warning () { $debug_cmd $warning_func ${1+"$@"} } ## ---------------- ## ## Options parsing. ## ## ---------------- ## # Hook in the functions to make sure our own options are parsed during # the option parsing loop. usage='$progpath [OPTION]... [MODE-ARG]...' # Short help message in response to '-h'. usage_message="Options: --config show all configuration variables --debug enable verbose shell tracing -n, --dry-run display commands without modifying any files --features display basic configuration information and exit --mode=MODE use operation mode MODE --no-warnings equivalent to '-Wnone' --preserve-dup-deps don't remove duplicate dependency libraries --quiet, --silent don't print informational messages --tag=TAG use configuration variables from tag TAG -v, --verbose print more informational messages than default --version print version information -W, --warnings=CATEGORY report the warnings falling in CATEGORY [all] -h, --help, --help-all print short, long, or detailed help message " # Additional text appended to 'usage_message' in response to '--help'. func_help () { $debug_cmd func_usage_message $ECHO "$long_help_message MODE must be one of the following: clean remove files from the build directory compile compile a source file into a libtool object execute automatically set library path, then run a program finish complete the installation of libtool libraries install install libraries or executables link create a library or an executable uninstall remove libraries from an installed directory MODE-ARGS vary depending on the MODE. When passed as first option, '--mode=MODE' may be abbreviated as 'MODE' or a unique abbreviation of that. Try '$progname --help --mode=MODE' for a more detailed description of MODE. When reporting a bug, please describe a test case to reproduce it and include the following information: host-triplet: $host shell: $SHELL compiler: $LTCC compiler flags: $LTCFLAGS linker: $LD (gnu? $with_gnu_ld) version: $progname (GNU libtool) 2.4.6 automake: `($AUTOMAKE --version) 2>/dev/null |$SED 1q` autoconf: `($AUTOCONF --version) 2>/dev/null |$SED 1q` Report bugs to . GNU libtool home page: . General help using GNU software: ." exit 0 } # func_lo2o OBJECT-NAME # --------------------- # Transform OBJECT-NAME from a '.lo' suffix to the platform specific # object suffix. lo2o=s/\\.lo\$/.$objext/ o2lo=s/\\.$objext\$/.lo/ if test yes = "$_G_HAVE_XSI_OPS"; then eval 'func_lo2o () { case $1 in *.lo) func_lo2o_result=${1%.lo}.$objext ;; * ) func_lo2o_result=$1 ;; esac }' # func_xform LIBOBJ-OR-SOURCE # --------------------------- # Transform LIBOBJ-OR-SOURCE from a '.o' or '.c' (or otherwise) # suffix to a '.lo' libtool-object suffix. eval 'func_xform () { func_xform_result=${1%.*}.lo }' else # ...otherwise fall back to using sed. func_lo2o () { func_lo2o_result=`$ECHO "$1" | $SED "$lo2o"` } func_xform () { func_xform_result=`$ECHO "$1" | $SED 's|\.[^.]*$|.lo|'` } fi # func_fatal_configuration ARG... # ------------------------------- # Echo program name prefixed message to standard error, followed by # a configuration failure hint, and exit. func_fatal_configuration () { func__fatal_error ${1+"$@"} \ "See the $PACKAGE documentation for more information." \ "Fatal configuration error." } # func_config # ----------- # Display the configuration for all the tags in this script. func_config () { re_begincf='^# ### BEGIN LIBTOOL' re_endcf='^# ### END LIBTOOL' # Default configuration. $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath" # Now print the configurations for the tags. for tagname in $taglist; do $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath" done exit $? } # func_features # ------------- # Display the features supported by this script. func_features () { echo "host: $host" if test yes = "$build_libtool_libs"; then echo "enable shared libraries" else echo "disable shared libraries" fi if test yes = "$build_old_libs"; then echo "enable static libraries" else echo "disable static libraries" fi exit $? } # func_enable_tag TAGNAME # ----------------------- # Verify that TAGNAME is valid, and either flag an error and exit, or # enable the TAGNAME tag. We also add TAGNAME to the global $taglist # variable here. func_enable_tag () { # Global variable: tagname=$1 re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$" re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$" sed_extractcf=/$re_begincf/,/$re_endcf/p # Validate tagname. case $tagname in *[!-_A-Za-z0-9,/]*) func_fatal_error "invalid tag name: $tagname" ;; esac # Don't test for the "default" C tag, as we know it's # there but not specially marked. case $tagname in CC) ;; *) if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then taglist="$taglist $tagname" # Evaluate the configuration. Be careful to quote the path # and the sed script, to avoid splitting on whitespace, but # also don't use non-portable quotes within backquotes within # quotes we have to do it in 2 steps: extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"` eval "$extractedcf" else func_error "ignoring unknown tag $tagname" fi ;; esac } # func_check_version_match # ------------------------ # Ensure that we are using m4 macros, and libtool script from the same # release of libtool. func_check_version_match () { if test "$package_revision" != "$macro_revision"; then if test "$VERSION" != "$macro_version"; then if test -z "$macro_version"; then cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from an older release. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from $PACKAGE $macro_version. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF fi else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, $progname: but the definition of this LT_INIT comes from revision $macro_revision. $progname: You should recreate aclocal.m4 with macros from revision $package_revision $progname: of $PACKAGE $VERSION and run autoconf again. _LT_EOF fi exit $EXIT_MISMATCH fi } # libtool_options_prep [ARG]... # ----------------------------- # Preparation for options parsed by libtool. libtool_options_prep () { $debug_mode # Option defaults: opt_config=false opt_dlopen= opt_dry_run=false opt_help=false opt_mode= opt_preserve_dup_deps=false opt_quiet=false nonopt= preserve_args= # Shorthand for --mode=foo, only valid as the first argument case $1 in clean|clea|cle|cl) shift; set dummy --mode clean ${1+"$@"}; shift ;; compile|compil|compi|comp|com|co|c) shift; set dummy --mode compile ${1+"$@"}; shift ;; execute|execut|execu|exec|exe|ex|e) shift; set dummy --mode execute ${1+"$@"}; shift ;; finish|finis|fini|fin|fi|f) shift; set dummy --mode finish ${1+"$@"}; shift ;; install|instal|insta|inst|ins|in|i) shift; set dummy --mode install ${1+"$@"}; shift ;; link|lin|li|l) shift; set dummy --mode link ${1+"$@"}; shift ;; uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) shift; set dummy --mode uninstall ${1+"$@"}; shift ;; esac # Pass back the list of options. func_quote_for_eval ${1+"$@"} libtool_options_prep_result=$func_quote_for_eval_result } func_add_hook func_options_prep libtool_options_prep # libtool_parse_options [ARG]... # --------------------------------- # Provide handling for libtool specific options. libtool_parse_options () { $debug_cmd # Perform our own loop to consume as many options as possible in # each iteration. while test $# -gt 0; do _G_opt=$1 shift case $_G_opt in --dry-run|--dryrun|-n) opt_dry_run=: ;; --config) func_config ;; --dlopen|-dlopen) opt_dlopen="${opt_dlopen+$opt_dlopen }$1" shift ;; --preserve-dup-deps) opt_preserve_dup_deps=: ;; --features) func_features ;; --finish) set dummy --mode finish ${1+"$@"}; shift ;; --help) opt_help=: ;; --help-all) opt_help=': help-all' ;; --mode) test $# = 0 && func_missing_arg $_G_opt && break opt_mode=$1 case $1 in # Valid mode arguments: clean|compile|execute|finish|install|link|relink|uninstall) ;; # Catch anything else as an error *) func_error "invalid argument for $_G_opt" exit_cmd=exit break ;; esac shift ;; --no-silent|--no-quiet) opt_quiet=false func_append preserve_args " $_G_opt" ;; --no-warnings|--no-warning|--no-warn) opt_warning=false func_append preserve_args " $_G_opt" ;; --no-verbose) opt_verbose=false func_append preserve_args " $_G_opt" ;; --silent|--quiet) opt_quiet=: opt_verbose=false func_append preserve_args " $_G_opt" ;; --tag) test $# = 0 && func_missing_arg $_G_opt && break opt_tag=$1 func_append preserve_args " $_G_opt $1" func_enable_tag "$1" shift ;; --verbose|-v) opt_quiet=false opt_verbose=: func_append preserve_args " $_G_opt" ;; # An option not handled by this hook function: *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;; esac done # save modified positional parameters for caller func_quote_for_eval ${1+"$@"} libtool_parse_options_result=$func_quote_for_eval_result } func_add_hook func_parse_options libtool_parse_options # libtool_validate_options [ARG]... # --------------------------------- # Perform any sanity checks on option settings and/or unconsumed # arguments. libtool_validate_options () { # save first non-option argument if test 0 -lt $#; then nonopt=$1 shift fi # preserve --debug test : = "$debug_cmd" || func_append preserve_args " --debug" case $host in # Solaris2 added to fix http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16452 # see also: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59788 *cygwin* | *mingw* | *pw32* | *cegcc* | *solaris2* | *os2*) # don't eliminate duplications in $postdeps and $predeps opt_duplicate_compiler_generated_deps=: ;; *) opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps ;; esac $opt_help || { # Sanity checks first: func_check_version_match test yes != "$build_libtool_libs" \ && test yes != "$build_old_libs" \ && func_fatal_configuration "not configured to build any kind of library" # Darwin sucks eval std_shrext=\"$shrext_cmds\" # Only execute mode is allowed to have -dlopen flags. if test -n "$opt_dlopen" && test execute != "$opt_mode"; then func_error "unrecognized option '-dlopen'" $ECHO "$help" 1>&2 exit $EXIT_FAILURE fi # Change the help message to a mode-specific one. generic_help=$help help="Try '$progname --help --mode=$opt_mode' for more information." } # Pass back the unparsed argument list func_quote_for_eval ${1+"$@"} libtool_validate_options_result=$func_quote_for_eval_result } func_add_hook func_validate_options libtool_validate_options # Process options as early as possible so that --help and --version # can return quickly. func_options ${1+"$@"} eval set dummy "$func_options_result"; shift ## ----------- ## ## Main. ## ## ----------- ## magic='%%%MAGIC variable%%%' magic_exe='%%%MAGIC EXE variable%%%' # Global variables. extracted_archives= extracted_serial=0 # If this variable is set in any of the actions, the command in it # will be execed at the end. This prevents here-documents from being # left over by shells. exec_cmd= # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } # func_generated_by_libtool # True iff stdin has been generated by Libtool. This function is only # a basic sanity check; it will hardly flush out determined imposters. func_generated_by_libtool_p () { $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 } # func_lalib_p file # True iff FILE is a libtool '.la' library or '.lo' object file. # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_lalib_p () { test -f "$1" && $SED -e 4q "$1" 2>/dev/null | func_generated_by_libtool_p } # func_lalib_unsafe_p file # True iff FILE is a libtool '.la' library or '.lo' object file. # This function implements the same check as func_lalib_p without # resorting to external programs. To this end, it redirects stdin and # closes it afterwards, without saving the original file descriptor. # As a safety measure, use it only where a negative result would be # fatal anyway. Works if 'file' does not exist. func_lalib_unsafe_p () { lalib_p=no if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then for lalib_p_l in 1 2 3 4 do read lalib_p_line case $lalib_p_line in \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;; esac done exec 0<&5 5<&- fi test yes = "$lalib_p" } # func_ltwrapper_script_p file # True iff FILE is a libtool wrapper script # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_script_p () { test -f "$1" && $lt_truncate_bin < "$1" 2>/dev/null | func_generated_by_libtool_p } # func_ltwrapper_executable_p file # True iff FILE is a libtool wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_executable_p () { func_ltwrapper_exec_suffix= case $1 in *.exe) ;; *) func_ltwrapper_exec_suffix=.exe ;; esac $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1 } # func_ltwrapper_scriptname file # Assumes file is an ltwrapper_executable # uses $file to determine the appropriate filename for a # temporary ltwrapper_script. func_ltwrapper_scriptname () { func_dirname_and_basename "$1" "" "." func_stripname '' '.exe' "$func_basename_result" func_ltwrapper_scriptname_result=$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper } # func_ltwrapper_p file # True iff FILE is a libtool wrapper script or wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_p () { func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1" } # func_execute_cmds commands fail_cmd # Execute tilde-delimited COMMANDS. # If FAIL_CMD is given, eval that upon failure. # FAIL_CMD may read-access the current command in variable CMD! func_execute_cmds () { $debug_cmd save_ifs=$IFS; IFS='~' for cmd in $1; do IFS=$sp$nl eval cmd=\"$cmd\" IFS=$save_ifs func_show_eval "$cmd" "${2-:}" done IFS=$save_ifs } # func_source file # Source FILE, adding directory component if necessary. # Note that it is not necessary on cygwin/mingw to append a dot to # FILE even if both FILE and FILE.exe exist: automatic-append-.exe # behavior happens only for exec(3), not for open(2)! Also, sourcing # 'FILE.' does not work on cygwin managed mounts. func_source () { $debug_cmd case $1 in */* | *\\*) . "$1" ;; *) . "./$1" ;; esac } # func_resolve_sysroot PATH # Replace a leading = in PATH with a sysroot. Store the result into # func_resolve_sysroot_result func_resolve_sysroot () { func_resolve_sysroot_result=$1 case $func_resolve_sysroot_result in =*) func_stripname '=' '' "$func_resolve_sysroot_result" func_resolve_sysroot_result=$lt_sysroot$func_stripname_result ;; esac } # func_replace_sysroot PATH # If PATH begins with the sysroot, replace it with = and # store the result into func_replace_sysroot_result. func_replace_sysroot () { case $lt_sysroot:$1 in ?*:"$lt_sysroot"*) func_stripname "$lt_sysroot" '' "$1" func_replace_sysroot_result='='$func_stripname_result ;; *) # Including no sysroot. func_replace_sysroot_result=$1 ;; esac } # func_infer_tag arg # Infer tagged configuration to use if any are available and # if one wasn't chosen via the "--tag" command line option. # Only attempt this if the compiler in the base compile # command doesn't match the default compiler. # arg is usually of the form 'gcc ...' func_infer_tag () { $debug_cmd if test -n "$available_tags" && test -z "$tagname"; then CC_quoted= for arg in $CC; do func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` case $@ in # Blanks in the command may have been stripped by the calling shell, # but not from the CC environment variable when configure was run. " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;; # Blanks at the start of $base_compile will cause this to fail # if we don't check for them as well. *) for z in $available_tags; do if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then # Evaluate the configuration. eval "`$SED -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" CC_quoted= for arg in $CC; do # Double-quote args containing other shell metacharacters. func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` case "$@ " in " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) # The compiler in the base compile command matches # the one in the tagged configuration. # Assume this is the tagged configuration we want. tagname=$z break ;; esac fi done # If $tagname still isn't set, then no tagged configuration # was found and let the user know that the "--tag" command # line option must be used. if test -z "$tagname"; then func_echo "unable to infer tagged configuration" func_fatal_error "specify a tag with '--tag'" # else # func_verbose "using $tagname tagged configuration" fi ;; esac fi } # func_write_libtool_object output_name pic_name nonpic_name # Create a libtool object file (analogous to a ".la" file), # but don't create it if we're doing a dry run. func_write_libtool_object () { write_libobj=$1 if test yes = "$build_libtool_libs"; then write_lobj=\'$2\' else write_lobj=none fi if test yes = "$build_old_libs"; then write_oldobj=\'$3\' else write_oldobj=none fi $opt_dry_run || { cat >${write_libobj}T </dev/null` if test "$?" -eq 0 && test -n "$func_convert_core_file_wine_to_w32_tmp"; then func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" | $SED -e "$sed_naive_backslashify"` else func_convert_core_file_wine_to_w32_result= fi fi } # end: func_convert_core_file_wine_to_w32 # func_convert_core_path_wine_to_w32 ARG # Helper function used by path conversion functions when $build is *nix, and # $host is mingw, cygwin, or some other w32 environment. Relies on a correctly # configured wine environment available, with the winepath program in $build's # $PATH. Assumes ARG has no leading or trailing path separator characters. # # ARG is path to be converted from $build format to win32. # Result is available in $func_convert_core_path_wine_to_w32_result. # Unconvertible file (directory) names in ARG are skipped; if no directory names # are convertible, then the result may be empty. func_convert_core_path_wine_to_w32 () { $debug_cmd # unfortunately, winepath doesn't convert paths, only file names func_convert_core_path_wine_to_w32_result= if test -n "$1"; then oldIFS=$IFS IFS=: for func_convert_core_path_wine_to_w32_f in $1; do IFS=$oldIFS func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f" if test -n "$func_convert_core_file_wine_to_w32_result"; then if test -z "$func_convert_core_path_wine_to_w32_result"; then func_convert_core_path_wine_to_w32_result=$func_convert_core_file_wine_to_w32_result else func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result" fi fi done IFS=$oldIFS fi } # end: func_convert_core_path_wine_to_w32 # func_cygpath ARGS... # Wrapper around calling the cygpath program via LT_CYGPATH. This is used when # when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2) # $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or # (2), returns the Cygwin file name or path in func_cygpath_result (input # file name or path is assumed to be in w32 format, as previously converted # from $build's *nix or MSYS format). In case (3), returns the w32 file name # or path in func_cygpath_result (input file name or path is assumed to be in # Cygwin format). Returns an empty string on error. # # ARGS are passed to cygpath, with the last one being the file name or path to # be converted. # # Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH # environment variable; do not put it in $PATH. func_cygpath () { $debug_cmd if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null` if test "$?" -ne 0; then # on failure, ensure result is empty func_cygpath_result= fi else func_cygpath_result= func_error "LT_CYGPATH is empty or specifies non-existent file: '$LT_CYGPATH'" fi } #end: func_cygpath # func_convert_core_msys_to_w32 ARG # Convert file name or path ARG from MSYS format to w32 format. Return # result in func_convert_core_msys_to_w32_result. func_convert_core_msys_to_w32 () { $debug_cmd # awkward: cmd appends spaces to result func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null | $SED -e 's/[ ]*$//' -e "$sed_naive_backslashify"` } #end: func_convert_core_msys_to_w32 # func_convert_file_check ARG1 ARG2 # Verify that ARG1 (a file name in $build format) was converted to $host # format in ARG2. Otherwise, emit an error message, but continue (resetting # func_to_host_file_result to ARG1). func_convert_file_check () { $debug_cmd if test -z "$2" && test -n "$1"; then func_error "Could not determine host file name corresponding to" func_error " '$1'" func_error "Continuing, but uninstalled executables may not work." # Fallback: func_to_host_file_result=$1 fi } # end func_convert_file_check # func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH # Verify that FROM_PATH (a path in $build format) was converted to $host # format in TO_PATH. Otherwise, emit an error message, but continue, resetting # func_to_host_file_result to a simplistic fallback value (see below). func_convert_path_check () { $debug_cmd if test -z "$4" && test -n "$3"; then func_error "Could not determine the host path corresponding to" func_error " '$3'" func_error "Continuing, but uninstalled executables may not work." # Fallback. This is a deliberately simplistic "conversion" and # should not be "improved". See libtool.info. if test "x$1" != "x$2"; then lt_replace_pathsep_chars="s|$1|$2|g" func_to_host_path_result=`echo "$3" | $SED -e "$lt_replace_pathsep_chars"` else func_to_host_path_result=$3 fi fi } # end func_convert_path_check # func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG # Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT # and appending REPL if ORIG matches BACKPAT. func_convert_path_front_back_pathsep () { $debug_cmd case $4 in $1 ) func_to_host_path_result=$3$func_to_host_path_result ;; esac case $4 in $2 ) func_append func_to_host_path_result "$3" ;; esac } # end func_convert_path_front_back_pathsep ################################################## # $build to $host FILE NAME CONVERSION FUNCTIONS # ################################################## # invoked via '$to_host_file_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # Result will be available in $func_to_host_file_result. # func_to_host_file ARG # Converts the file name ARG from $build format to $host format. Return result # in func_to_host_file_result. func_to_host_file () { $debug_cmd $to_host_file_cmd "$1" } # end func_to_host_file # func_to_tool_file ARG LAZY # converts the file name ARG from $build format to toolchain format. Return # result in func_to_tool_file_result. If the conversion in use is listed # in (the comma separated) LAZY, no conversion takes place. func_to_tool_file () { $debug_cmd case ,$2, in *,"$to_tool_file_cmd",*) func_to_tool_file_result=$1 ;; *) $to_tool_file_cmd "$1" func_to_tool_file_result=$func_to_host_file_result ;; esac } # end func_to_tool_file # func_convert_file_noop ARG # Copy ARG to func_to_host_file_result. func_convert_file_noop () { func_to_host_file_result=$1 } # end func_convert_file_noop # func_convert_file_msys_to_w32 ARG # Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic # conversion to w32 is not available inside the cwrapper. Returns result in # func_to_host_file_result. func_convert_file_msys_to_w32 () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_to_host_file_result=$func_convert_core_msys_to_w32_result fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_msys_to_w32 # func_convert_file_cygwin_to_w32 ARG # Convert file name ARG from Cygwin to w32 format. Returns result in # func_to_host_file_result. func_convert_file_cygwin_to_w32 () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then # because $build is cygwin, we call "the" cygpath in $PATH; no need to use # LT_CYGPATH in this case. func_to_host_file_result=`cygpath -m "$1"` fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_cygwin_to_w32 # func_convert_file_nix_to_w32 ARG # Convert file name ARG from *nix to w32 format. Requires a wine environment # and a working winepath. Returns result in func_to_host_file_result. func_convert_file_nix_to_w32 () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then func_convert_core_file_wine_to_w32 "$1" func_to_host_file_result=$func_convert_core_file_wine_to_w32_result fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_nix_to_w32 # func_convert_file_msys_to_cygwin ARG # Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. # Returns result in func_to_host_file_result. func_convert_file_msys_to_cygwin () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_cygpath -u "$func_convert_core_msys_to_w32_result" func_to_host_file_result=$func_cygpath_result fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_msys_to_cygwin # func_convert_file_nix_to_cygwin ARG # Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed # in a wine environment, working winepath, and LT_CYGPATH set. Returns result # in func_to_host_file_result. func_convert_file_nix_to_cygwin () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then # convert from *nix to w32, then use cygpath to convert from w32 to cygwin. func_convert_core_file_wine_to_w32 "$1" func_cygpath -u "$func_convert_core_file_wine_to_w32_result" func_to_host_file_result=$func_cygpath_result fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_nix_to_cygwin ############################################# # $build to $host PATH CONVERSION FUNCTIONS # ############################################# # invoked via '$to_host_path_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # The result will be available in $func_to_host_path_result. # # Path separators are also converted from $build format to $host format. If # ARG begins or ends with a path separator character, it is preserved (but # converted to $host format) on output. # # All path conversion functions are named using the following convention: # file name conversion function : func_convert_file_X_to_Y () # path conversion function : func_convert_path_X_to_Y () # where, for any given $build/$host combination the 'X_to_Y' value is the # same. If conversion functions are added for new $build/$host combinations, # the two new functions must follow this pattern, or func_init_to_host_path_cmd # will break. # func_init_to_host_path_cmd # Ensures that function "pointer" variable $to_host_path_cmd is set to the # appropriate value, based on the value of $to_host_file_cmd. to_host_path_cmd= func_init_to_host_path_cmd () { $debug_cmd if test -z "$to_host_path_cmd"; then func_stripname 'func_convert_file_' '' "$to_host_file_cmd" to_host_path_cmd=func_convert_path_$func_stripname_result fi } # func_to_host_path ARG # Converts the path ARG from $build format to $host format. Return result # in func_to_host_path_result. func_to_host_path () { $debug_cmd func_init_to_host_path_cmd $to_host_path_cmd "$1" } # end func_to_host_path # func_convert_path_noop ARG # Copy ARG to func_to_host_path_result. func_convert_path_noop () { func_to_host_path_result=$1 } # end func_convert_path_noop # func_convert_path_msys_to_w32 ARG # Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic # conversion to w32 is not available inside the cwrapper. Returns result in # func_to_host_path_result. func_convert_path_msys_to_w32 () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # Remove leading and trailing path separator characters from ARG. MSYS # behavior is inconsistent here; cygpath turns them into '.;' and ';.'; # and winepath ignores them completely. func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result=$func_convert_core_msys_to_w32_result func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_msys_to_w32 # func_convert_path_cygwin_to_w32 ARG # Convert path ARG from Cygwin to w32 format. Returns result in # func_to_host_file_result. func_convert_path_cygwin_to_w32 () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"` func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_cygwin_to_w32 # func_convert_path_nix_to_w32 ARG # Convert path ARG from *nix to w32 format. Requires a wine environment and # a working winepath. Returns result in func_to_host_file_result. func_convert_path_nix_to_w32 () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result=$func_convert_core_path_wine_to_w32_result func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_nix_to_w32 # func_convert_path_msys_to_cygwin ARG # Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. # Returns result in func_to_host_file_result. func_convert_path_msys_to_cygwin () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_msys_to_w32_result" func_to_host_path_result=$func_cygpath_result func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" fi } # end func_convert_path_msys_to_cygwin # func_convert_path_nix_to_cygwin ARG # Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a # a wine environment, working winepath, and LT_CYGPATH set. Returns result in # func_to_host_file_result. func_convert_path_nix_to_cygwin () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # Remove leading and trailing path separator characters from # ARG. msys behavior is inconsistent here, cygpath turns them # into '.;' and ';.', and winepath ignores them completely. func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result" func_to_host_path_result=$func_cygpath_result func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" fi } # end func_convert_path_nix_to_cygwin # func_dll_def_p FILE # True iff FILE is a Windows DLL '.def' file. # Keep in sync with _LT_DLL_DEF_P in libtool.m4 func_dll_def_p () { $debug_cmd func_dll_def_p_tmp=`$SED -n \ -e 's/^[ ]*//' \ -e '/^\(;.*\)*$/d' \ -e 's/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p' \ -e q \ "$1"` test DEF = "$func_dll_def_p_tmp" } # func_mode_compile arg... func_mode_compile () { $debug_cmd # Get the compilation command and the source file. base_compile= srcfile=$nonopt # always keep a non-empty value in "srcfile" suppress_opt=yes suppress_output= arg_mode=normal libobj= later= pie_flag= for arg do case $arg_mode in arg ) # do not "continue". Instead, add this to base_compile lastarg=$arg arg_mode=normal ;; target ) libobj=$arg arg_mode=normal continue ;; normal ) # Accept any command-line options. case $arg in -o) test -n "$libobj" && \ func_fatal_error "you cannot specify '-o' more than once" arg_mode=target continue ;; -pie | -fpie | -fPIE) func_append pie_flag " $arg" continue ;; -shared | -static | -prefer-pic | -prefer-non-pic) func_append later " $arg" continue ;; -no-suppress) suppress_opt=no continue ;; -Xcompiler) arg_mode=arg # the next one goes into the "base_compile" arg list continue # The current "srcfile" will either be retained or ;; # replaced later. I would guess that would be a bug. -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result lastarg= save_ifs=$IFS; IFS=, for arg in $args; do IFS=$save_ifs func_append_quoted lastarg "$arg" done IFS=$save_ifs func_stripname ' ' '' "$lastarg" lastarg=$func_stripname_result # Add the arguments to base_compile. func_append base_compile " $lastarg" continue ;; *) # Accept the current argument as the source file. # The previous "srcfile" becomes the current argument. # lastarg=$srcfile srcfile=$arg ;; esac # case $arg ;; esac # case $arg_mode # Aesthetically quote the previous argument. func_append_quoted base_compile "$lastarg" done # for arg case $arg_mode in arg) func_fatal_error "you must specify an argument for -Xcompile" ;; target) func_fatal_error "you must specify a target with '-o'" ;; *) # Get the name of the library object. test -z "$libobj" && { func_basename "$srcfile" libobj=$func_basename_result } ;; esac # Recognize several different file suffixes. # If the user specifies -o file.o, it is replaced with file.lo case $libobj in *.[cCFSifmso] | \ *.ada | *.adb | *.ads | *.asm | \ *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \ *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup) func_xform "$libobj" libobj=$func_xform_result ;; esac case $libobj in *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;; *) func_fatal_error "cannot determine name of library object from '$libobj'" ;; esac func_infer_tag $base_compile for arg in $later; do case $arg in -shared) test yes = "$build_libtool_libs" \ || func_fatal_configuration "cannot build a shared library" build_old_libs=no continue ;; -static) build_libtool_libs=no build_old_libs=yes continue ;; -prefer-pic) pic_mode=yes continue ;; -prefer-non-pic) pic_mode=no continue ;; esac done func_quote_for_eval "$libobj" test "X$libobj" != "X$func_quote_for_eval_result" \ && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \ && func_warning "libobj name '$libobj' may not contain shell special characters." func_dirname_and_basename "$obj" "/" "" objname=$func_basename_result xdir=$func_dirname_result lobj=$xdir$objdir/$objname test -z "$base_compile" && \ func_fatal_help "you must specify a compilation command" # Delete any leftover library objects. if test yes = "$build_old_libs"; then removelist="$obj $lobj $libobj ${libobj}T" else removelist="$lobj $libobj ${libobj}T" fi # On Cygwin there's no "real" PIC flag so we must build both object types case $host_os in cygwin* | mingw* | pw32* | os2* | cegcc*) pic_mode=default ;; esac if test no = "$pic_mode" && test pass_all != "$deplibs_check_method"; then # non-PIC code in shared libraries is not supported pic_mode=default fi # Calculate the filename of the output object if compiler does # not support -o with -c if test no = "$compiler_c_o"; then output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.$objext lockfile=$output_obj.lock else output_obj= need_locks=no lockfile= fi # Lock this critical section if it is needed # We use this script file to make the link, it avoids creating a new file if test yes = "$need_locks"; then until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done elif test warn = "$need_locks"; then if test -f "$lockfile"; then $ECHO "\ *** ERROR, $lockfile exists and contains: `cat $lockfile 2>/dev/null` This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support '-c' and '-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi func_append removelist " $output_obj" $ECHO "$srcfile" > "$lockfile" fi $opt_dry_run || $RM $removelist func_append removelist " $lockfile" trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 func_to_tool_file "$srcfile" func_convert_file_msys_to_w32 srcfile=$func_to_tool_file_result func_quote_for_eval "$srcfile" qsrcfile=$func_quote_for_eval_result # Only build a PIC object if we are building libtool libraries. if test yes = "$build_libtool_libs"; then # Without this assignment, base_compile gets emptied. fbsd_hideous_sh_bug=$base_compile if test no != "$pic_mode"; then command="$base_compile $qsrcfile $pic_flag" else # Don't build PIC code command="$base_compile $qsrcfile" fi func_mkdir_p "$xdir$objdir" if test -z "$output_obj"; then # Place PIC objects in $objdir func_append command " -o $lobj" fi func_show_eval_locale "$command" \ 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE' if test warn = "$need_locks" && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support '-c' and '-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed, then go on to compile the next one if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then func_show_eval '$MV "$output_obj" "$lobj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi # Allow error messages only from the first compilation. if test yes = "$suppress_opt"; then suppress_output=' >/dev/null 2>&1' fi fi # Only build a position-dependent object if we build old libraries. if test yes = "$build_old_libs"; then if test yes != "$pic_mode"; then # Don't build PIC code command="$base_compile $qsrcfile$pie_flag" else command="$base_compile $qsrcfile $pic_flag" fi if test yes = "$compiler_c_o"; then func_append command " -o $obj" fi # Suppress compiler output if we already did a PIC compilation. func_append command "$suppress_output" func_show_eval_locale "$command" \ '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' if test warn = "$need_locks" && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support '-c' and '-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then func_show_eval '$MV "$output_obj" "$obj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi fi $opt_dry_run || { func_write_libtool_object "$libobj" "$objdir/$objname" "$objname" # Unlock the critical section if it was locked if test no != "$need_locks"; then removelist=$lockfile $RM "$lockfile" fi } exit $EXIT_SUCCESS } $opt_help || { test compile = "$opt_mode" && func_mode_compile ${1+"$@"} } func_mode_help () { # We need to display help for each of the modes. case $opt_mode in "") # Generic help is extracted from the usage comments # at the start of this file. func_help ;; clean) $ECHO \ "Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE... Remove files from the build directory. RM is the name of the program to use to delete files associated with each FILE (typically '/bin/rm'). RM-OPTIONS are options (such as '-f') to be passed to RM. If FILE is a libtool library, object or program, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; compile) $ECHO \ "Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE Compile a source file into a libtool library object. This mode accepts the following additional options: -o OUTPUT-FILE set the output file name to OUTPUT-FILE -no-suppress do not suppress compiler output for multiple passes -prefer-pic try to build PIC objects only -prefer-non-pic try to build non-PIC objects only -shared do not build a '.o' file suitable for static linking -static only build a '.o' file suitable for static linking -Wc,FLAG pass FLAG directly to the compiler COMPILE-COMMAND is a command to be used in creating a 'standard' object file from the given SOURCEFILE. The output file name is determined by removing the directory component from SOURCEFILE, then substituting the C source code suffix '.c' with the library object suffix, '.lo'." ;; execute) $ECHO \ "Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]... Automatically set library path, then run a program. This mode accepts the following additional options: -dlopen FILE add the directory containing FILE to the library path This mode sets the library path environment variable according to '-dlopen' flags. If any of the ARGS are libtool executable wrappers, then they are translated into their corresponding uninstalled binary, and any of their required library directories are added to the library path. Then, COMMAND is executed, with ARGS as arguments." ;; finish) $ECHO \ "Usage: $progname [OPTION]... --mode=finish [LIBDIR]... Complete the installation of libtool libraries. Each LIBDIR is a directory that contains libtool libraries. The commands that this mode executes may require superuser privileges. Use the '--dry-run' option if you just want to see what would be executed." ;; install) $ECHO \ "Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND... Install executables or libraries. INSTALL-COMMAND is the installation command. The first component should be either the 'install' or 'cp' program. The following components of INSTALL-COMMAND are treated specially: -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation The rest of the components are interpreted as arguments to that command (only BSD-compatible install options are recognized)." ;; link) $ECHO \ "Usage: $progname [OPTION]... --mode=link LINK-COMMAND... Link object files or libraries together to form another library, or to create an executable program. LINK-COMMAND is a command using the C compiler that you would use to create a program from several object files. The following components of LINK-COMMAND are treated specially: -all-static do not do any dynamic linking at all -avoid-version do not add a version suffix if possible -bindir BINDIR specify path to binaries directory (for systems where libraries must be found in the PATH setting at runtime) -dlopen FILE '-dlpreopen' FILE if it cannot be dlopened at runtime -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) -export-symbols SYMFILE try to export only the symbols listed in SYMFILE -export-symbols-regex REGEX try to export only the symbols matching REGEX -LLIBDIR search LIBDIR for required installed libraries -lNAME OUTPUT-FILE requires the installed library libNAME -module build a library that can dlopened -no-fast-install disable the fast-install mode -no-install link a not-installable executable -no-undefined declare that a library does not refer to external symbols -o OUTPUT-FILE create OUTPUT-FILE from the specified objects -objectlist FILE use a list of object files found in FILE to specify objects -os2dllname NAME force a short DLL name on OS/2 (no effect on other OSes) -precious-files-regex REGEX don't remove output files matching REGEX -release RELEASE specify package release information -rpath LIBDIR the created library will eventually be installed in LIBDIR -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries -shared only do dynamic linking of libtool libraries -shrext SUFFIX override the standard shared library file extension -static do not do any dynamic linking of uninstalled libtool libraries -static-libtool-libs do not do any dynamic linking of libtool libraries -version-info CURRENT[:REVISION[:AGE]] specify library version info [each variable defaults to 0] -weak LIBNAME declare that the target provides the LIBNAME interface -Wc,FLAG -Xcompiler FLAG pass linker-specific FLAG directly to the compiler -Wl,FLAG -Xlinker FLAG pass linker-specific FLAG directly to the linker -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC) All other options (arguments beginning with '-') are ignored. Every other argument is treated as a filename. Files ending in '.la' are treated as uninstalled libtool libraries, other files are standard or library object files. If the OUTPUT-FILE ends in '.la', then a libtool library is created, only library objects ('.lo' files) may be specified, and '-rpath' is required, except when creating a convenience library. If OUTPUT-FILE ends in '.a' or '.lib', then a standard library is created using 'ar' and 'ranlib', or on Windows using 'lib'. If OUTPUT-FILE ends in '.lo' or '.$objext', then a reloadable object file is created, otherwise an executable program is created." ;; uninstall) $ECHO \ "Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... Remove libraries from an installation directory. RM is the name of the program to use to delete files associated with each FILE (typically '/bin/rm'). RM-OPTIONS are options (such as '-f') to be passed to RM. If FILE is a libtool library, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; *) func_fatal_help "invalid operation mode '$opt_mode'" ;; esac echo $ECHO "Try '$progname --help' for more information about other modes." } # Now that we've collected a possible --mode arg, show help if necessary if $opt_help; then if test : = "$opt_help"; then func_mode_help else { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do func_mode_help done } | $SED -n '1p; 2,$s/^Usage:/ or: /p' { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do echo func_mode_help done } | $SED '1d /^When reporting/,/^Report/{ H d } $x /information about other modes/d /more detailed .*MODE/d s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/' fi exit $? fi # func_mode_execute arg... func_mode_execute () { $debug_cmd # The first argument is the command name. cmd=$nonopt test -z "$cmd" && \ func_fatal_help "you must specify a COMMAND" # Handle -dlopen flags immediately. for file in $opt_dlopen; do test -f "$file" \ || func_fatal_help "'$file' is not a file" dir= case $file in *.la) func_resolve_sysroot "$file" file=$func_resolve_sysroot_result # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "'$lib' is not a valid libtool archive" # Read the libtool library. dlname= library_names= func_source "$file" # Skip this library if it cannot be dlopened. if test -z "$dlname"; then # Warn if it was a shared library. test -n "$library_names" && \ func_warning "'$file' was not linked with '-export-dynamic'" continue fi func_dirname "$file" "" "." dir=$func_dirname_result if test -f "$dir/$objdir/$dlname"; then func_append dir "/$objdir" else if test ! -f "$dir/$dlname"; then func_fatal_error "cannot find '$dlname' in '$dir' or '$dir/$objdir'" fi fi ;; *.lo) # Just add the directory containing the .lo file. func_dirname "$file" "" "." dir=$func_dirname_result ;; *) func_warning "'-dlopen' is ignored for non-libtool libraries and objects" continue ;; esac # Get the absolute pathname. absdir=`cd "$dir" && pwd` test -n "$absdir" && dir=$absdir # Now add the directory to shlibpath_var. if eval "test -z \"\$$shlibpath_var\""; then eval "$shlibpath_var=\"\$dir\"" else eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" fi done # This variable tells wrapper scripts just to set shlibpath_var # rather than running their programs. libtool_execute_magic=$magic # Check if any of the arguments is a wrapper script. args= for file do case $file in -* | *.la | *.lo ) ;; *) # Do a test to see if this is really a libtool program. if func_ltwrapper_script_p "$file"; then func_source "$file" # Transform arg to wrapped name. file=$progdir/$program elif func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" func_source "$func_ltwrapper_scriptname_result" # Transform arg to wrapped name. file=$progdir/$program fi ;; esac # Quote arguments (to preserve shell metacharacters). func_append_quoted args "$file" done if $opt_dry_run; then # Display what would be done. if test -n "$shlibpath_var"; then eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\"" echo "export $shlibpath_var" fi $ECHO "$cmd$args" exit $EXIT_SUCCESS else if test -n "$shlibpath_var"; then # Export the shlibpath_var. eval "export $shlibpath_var" fi # Restore saved environment variables for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test \"\${save_$lt_var+set}\" = set; then $lt_var=\$save_$lt_var; export $lt_var else $lt_unset $lt_var fi" done # Now prepare to actually exec the command. exec_cmd=\$cmd$args fi } test execute = "$opt_mode" && func_mode_execute ${1+"$@"} # func_mode_finish arg... func_mode_finish () { $debug_cmd libs= libdirs= admincmds= for opt in "$nonopt" ${1+"$@"} do if test -d "$opt"; then func_append libdirs " $opt" elif test -f "$opt"; then if func_lalib_unsafe_p "$opt"; then func_append libs " $opt" else func_warning "'$opt' is not a valid libtool archive" fi else func_fatal_error "invalid argument '$opt'" fi done if test -n "$libs"; then if test -n "$lt_sysroot"; then sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"` sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;" else sysroot_cmd= fi # Remove sysroot references if $opt_dry_run; then for lib in $libs; do echo "removing references to $lt_sysroot and '=' prefixes from $lib" done else tmpdir=`func_mktempdir` for lib in $libs; do $SED -e "$sysroot_cmd s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \ > $tmpdir/tmp-la mv -f $tmpdir/tmp-la $lib done ${RM}r "$tmpdir" fi fi if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then for libdir in $libdirs; do if test -n "$finish_cmds"; then # Do each command in the finish commands. func_execute_cmds "$finish_cmds" 'admincmds="$admincmds '"$cmd"'"' fi if test -n "$finish_eval"; then # Do the single finish_eval. eval cmds=\"$finish_eval\" $opt_dry_run || eval "$cmds" || func_append admincmds " $cmds" fi done fi # Exit here if they wanted silent mode. $opt_quiet && exit $EXIT_SUCCESS if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then echo "----------------------------------------------------------------------" echo "Libraries have been installed in:" for libdir in $libdirs; do $ECHO " $libdir" done echo echo "If you ever happen to want to link against installed libraries" echo "in a given directory, LIBDIR, you must either use libtool, and" echo "specify the full pathname of the library, or use the '-LLIBDIR'" echo "flag during linking and do at least one of the following:" if test -n "$shlibpath_var"; then echo " - add LIBDIR to the '$shlibpath_var' environment variable" echo " during execution" fi if test -n "$runpath_var"; then echo " - add LIBDIR to the '$runpath_var' environment variable" echo " during linking" fi if test -n "$hardcode_libdir_flag_spec"; then libdir=LIBDIR eval flag=\"$hardcode_libdir_flag_spec\" $ECHO " - use the '$flag' linker flag" fi if test -n "$admincmds"; then $ECHO " - have your system administrator run these commands:$admincmds" fi if test -f /etc/ld.so.conf; then echo " - have your system administrator add LIBDIR to '/etc/ld.so.conf'" fi echo echo "See any operating system documentation about shared libraries for" case $host in solaris2.[6789]|solaris2.1[0-9]) echo "more information, such as the ld(1), crle(1) and ld.so(8) manual" echo "pages." ;; *) echo "more information, such as the ld(1) and ld.so(8) manual pages." ;; esac echo "----------------------------------------------------------------------" fi exit $EXIT_SUCCESS } test finish = "$opt_mode" && func_mode_finish ${1+"$@"} # func_mode_install arg... func_mode_install () { $debug_cmd # There may be an optional sh(1) argument at the beginning of # install_prog (especially on Windows NT). if test "$SHELL" = "$nonopt" || test /bin/sh = "$nonopt" || # Allow the use of GNU shtool's install command. case $nonopt in *shtool*) :;; *) false;; esac then # Aesthetically quote it. func_quote_for_eval "$nonopt" install_prog="$func_quote_for_eval_result " arg=$1 shift else install_prog= arg=$nonopt fi # The real first argument should be the name of the installation program. # Aesthetically quote it. func_quote_for_eval "$arg" func_append install_prog "$func_quote_for_eval_result" install_shared_prog=$install_prog case " $install_prog " in *[\\\ /]cp\ *) install_cp=: ;; *) install_cp=false ;; esac # We need to accept at least all the BSD install flags. dest= files= opts= prev= install_type= isdir=false stripme= no_mode=: for arg do arg2= if test -n "$dest"; then func_append files " $dest" dest=$arg continue fi case $arg in -d) isdir=: ;; -f) if $install_cp; then :; else prev=$arg fi ;; -g | -m | -o) prev=$arg ;; -s) stripme=" -s" continue ;; -*) ;; *) # If the previous option needed an argument, then skip it. if test -n "$prev"; then if test X-m = "X$prev" && test -n "$install_override_mode"; then arg2=$install_override_mode no_mode=false fi prev= else dest=$arg continue fi ;; esac # Aesthetically quote the argument. func_quote_for_eval "$arg" func_append install_prog " $func_quote_for_eval_result" if test -n "$arg2"; then func_quote_for_eval "$arg2" fi func_append install_shared_prog " $func_quote_for_eval_result" done test -z "$install_prog" && \ func_fatal_help "you must specify an install program" test -n "$prev" && \ func_fatal_help "the '$prev' option requires an argument" if test -n "$install_override_mode" && $no_mode; then if $install_cp; then :; else func_quote_for_eval "$install_override_mode" func_append install_shared_prog " -m $func_quote_for_eval_result" fi fi if test -z "$files"; then if test -z "$dest"; then func_fatal_help "no file or destination specified" else func_fatal_help "you must specify a destination" fi fi # Strip any trailing slash from the destination. func_stripname '' '/' "$dest" dest=$func_stripname_result # Check to see that the destination is a directory. test -d "$dest" && isdir=: if $isdir; then destdir=$dest destname= else func_dirname_and_basename "$dest" "" "." destdir=$func_dirname_result destname=$func_basename_result # Not a directory, so check to see that there is only one file specified. set dummy $files; shift test "$#" -gt 1 && \ func_fatal_help "'$dest' is not a directory" fi case $destdir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) for file in $files; do case $file in *.lo) ;; *) func_fatal_help "'$destdir' must be an absolute directory name" ;; esac done ;; esac # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic=$magic staticlibs= future_libdirs= current_libdirs= for file in $files; do # Do each installation. case $file in *.$libext) # Do the static libraries later. func_append staticlibs " $file" ;; *.la) func_resolve_sysroot "$file" file=$func_resolve_sysroot_result # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "'$file' is not a valid libtool archive" library_names= old_library= relink_command= func_source "$file" # Add the libdir to current_libdirs if it is the destination. if test "X$destdir" = "X$libdir"; then case "$current_libdirs " in *" $libdir "*) ;; *) func_append current_libdirs " $libdir" ;; esac else # Note the libdir as a future libdir. case "$future_libdirs " in *" $libdir "*) ;; *) func_append future_libdirs " $libdir" ;; esac fi func_dirname "$file" "/" "" dir=$func_dirname_result func_append dir "$objdir" if test -n "$relink_command"; then # Determine the prefix the user has applied to our future dir. inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"` # Don't allow the user to place us outside of our expected # location b/c this prevents finding dependent libraries that # are installed to the same prefix. # At present, this check doesn't affect windows .dll's that # are installed into $libdir/../bin (currently, that works fine) # but it's something to keep an eye on. test "$inst_prefix_dir" = "$destdir" && \ func_fatal_error "error: cannot install '$file' to a directory not ending in $libdir" if test -n "$inst_prefix_dir"; then # Stick the inst_prefix_dir data into the link command. relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` else relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"` fi func_warning "relinking '$file'" func_show_eval "$relink_command" \ 'func_fatal_error "error: relink '\''$file'\'' with the above command before installing it"' fi # See the names of the shared library. set dummy $library_names; shift if test -n "$1"; then realname=$1 shift srcname=$realname test -n "$relink_command" && srcname=${realname}T # Install the shared library and build the symlinks. func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \ 'exit $?' tstripme=$stripme case $host_os in cygwin* | mingw* | pw32* | cegcc*) case $realname in *.dll.a) tstripme= ;; esac ;; os2*) case $realname in *_dll.a) tstripme= ;; esac ;; esac if test -n "$tstripme" && test -n "$striplib"; then func_show_eval "$striplib $destdir/$realname" 'exit $?' fi if test "$#" -gt 0; then # Delete the old symlinks, and create new ones. # Try 'ln -sf' first, because the 'ln' binary might depend on # the symlink we replace! Solaris /bin/ln does not understand -f, # so we also need to try rm && ln -s. for linkname do test "$linkname" != "$realname" \ && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })" done fi # Do each command in the postinstall commands. lib=$destdir/$realname func_execute_cmds "$postinstall_cmds" 'exit $?' fi # Install the pseudo-library for information purposes. func_basename "$file" name=$func_basename_result instname=$dir/${name}i func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' # Maybe install the static library, too. test -n "$old_library" && func_append staticlibs " $dir/$old_library" ;; *.lo) # Install (i.e. copy) a libtool object. # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile=$destdir/$destname else func_basename "$file" destfile=$func_basename_result destfile=$destdir/$destfile fi # Deduce the name of the destination old-style object file. case $destfile in *.lo) func_lo2o "$destfile" staticdest=$func_lo2o_result ;; *.$objext) staticdest=$destfile destfile= ;; *) func_fatal_help "cannot copy a libtool object to '$destfile'" ;; esac # Install the libtool object if requested. test -n "$destfile" && \ func_show_eval "$install_prog $file $destfile" 'exit $?' # Install the old object if enabled. if test yes = "$build_old_libs"; then # Deduce the name of the old-style object file. func_lo2o "$file" staticobj=$func_lo2o_result func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?' fi exit $EXIT_SUCCESS ;; *) # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile=$destdir/$destname else func_basename "$file" destfile=$func_basename_result destfile=$destdir/$destfile fi # If the file is missing, and there is a .exe on the end, strip it # because it is most likely a libtool script we actually want to # install stripped_ext= case $file in *.exe) if test ! -f "$file"; then func_stripname '' '.exe' "$file" file=$func_stripname_result stripped_ext=.exe fi ;; esac # Do a test to see if this is really a libtool program. case $host in *cygwin* | *mingw*) if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" wrapper=$func_ltwrapper_scriptname_result else func_stripname '' '.exe' "$file" wrapper=$func_stripname_result fi ;; *) wrapper=$file ;; esac if func_ltwrapper_script_p "$wrapper"; then notinst_deplibs= relink_command= func_source "$wrapper" # Check the variables that should have been set. test -z "$generated_by_libtool_version" && \ func_fatal_error "invalid libtool wrapper script '$wrapper'" finalize=: for lib in $notinst_deplibs; do # Check to see that each library is installed. libdir= if test -f "$lib"; then func_source "$lib" fi libfile=$libdir/`$ECHO "$lib" | $SED 's%^.*/%%g'` if test -n "$libdir" && test ! -f "$libfile"; then func_warning "'$lib' has not been installed in '$libdir'" finalize=false fi done relink_command= func_source "$wrapper" outputname= if test no = "$fast_install" && test -n "$relink_command"; then $opt_dry_run || { if $finalize; then tmpdir=`func_mktempdir` func_basename "$file$stripped_ext" file=$func_basename_result outputname=$tmpdir/$file # Replace the output file specification. relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` $opt_quiet || { func_quote_for_expand "$relink_command" eval "func_echo $func_quote_for_expand_result" } if eval "$relink_command"; then : else func_error "error: relink '$file' with the above command before installing it" $opt_dry_run || ${RM}r "$tmpdir" continue fi file=$outputname else func_warning "cannot relink '$file'" fi } else # Install the binary that we compiled earlier. file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"` fi fi # remove .exe since cygwin /usr/bin/install will append another # one anyway case $install_prog,$host in */usr/bin/install*,*cygwin*) case $file:$destfile in *.exe:*.exe) # this is ok ;; *.exe:*) destfile=$destfile.exe ;; *:*.exe) func_stripname '' '.exe' "$destfile" destfile=$func_stripname_result ;; esac ;; esac func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?' $opt_dry_run || if test -n "$outputname"; then ${RM}r "$tmpdir" fi ;; esac done for file in $staticlibs; do func_basename "$file" name=$func_basename_result # Set up the ranlib parameters. oldlib=$destdir/$name func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 tool_oldlib=$func_to_tool_file_result func_show_eval "$install_prog \$file \$oldlib" 'exit $?' if test -n "$stripme" && test -n "$old_striplib"; then func_show_eval "$old_striplib $tool_oldlib" 'exit $?' fi # Do each command in the postinstall commands. func_execute_cmds "$old_postinstall_cmds" 'exit $?' done test -n "$future_libdirs" && \ func_warning "remember to run '$progname --finish$future_libdirs'" if test -n "$current_libdirs"; then # Maybe just do a dry run. $opt_dry_run && current_libdirs=" -n$current_libdirs" exec_cmd='$SHELL "$progpath" $preserve_args --finish$current_libdirs' else exit $EXIT_SUCCESS fi } test install = "$opt_mode" && func_mode_install ${1+"$@"} # func_generate_dlsyms outputname originator pic_p # Extract symbols from dlprefiles and create ${outputname}S.o with # a dlpreopen symbol table. func_generate_dlsyms () { $debug_cmd my_outputname=$1 my_originator=$2 my_pic_p=${3-false} my_prefix=`$ECHO "$my_originator" | $SED 's%[^a-zA-Z0-9]%_%g'` my_dlsyms= if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then if test -n "$NM" && test -n "$global_symbol_pipe"; then my_dlsyms=${my_outputname}S.c else func_error "not configured to extract global symbols from dlpreopened files" fi fi if test -n "$my_dlsyms"; then case $my_dlsyms in "") ;; *.c) # Discover the nlist of each of the dlfiles. nlist=$output_objdir/$my_outputname.nm func_show_eval "$RM $nlist ${nlist}S ${nlist}T" # Parse the name list into a source file. func_verbose "creating $output_objdir/$my_dlsyms" $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\ /* $my_dlsyms - symbol resolution table for '$my_outputname' dlsym emulation. */ /* Generated by $PROGRAM (GNU $PACKAGE) $VERSION */ #ifdef __cplusplus extern \"C\" { #endif #if defined __GNUC__ && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4)) #pragma GCC diagnostic ignored \"-Wstrict-prototypes\" #endif /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE /* DATA imports from DLLs on WIN32 can't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #elif defined __osf__ /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif #define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0) /* External symbol declarations for the compiler. */\ " if test yes = "$dlself"; then func_verbose "generating symbol list for '$output'" $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" # Add our own program objects to the symbol list. progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP` for progfile in $progfiles; do func_to_tool_file "$progfile" func_convert_file_msys_to_w32 func_verbose "extracting global C symbols from '$func_to_tool_file_result'" $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'" done if test -n "$exclude_expsyms"; then $opt_dry_run || { eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi if test -n "$export_symbols_regex"; then $opt_dry_run || { eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi # Prepare the list of exported symbols if test -z "$export_symbols"; then export_symbols=$output_objdir/$outputname.exp $opt_dry_run || { $RM $export_symbols eval "$SED -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' ;; esac } else $opt_dry_run || { eval "$SED -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' ;; esac } fi fi for dlprefile in $dlprefiles; do func_verbose "extracting global C symbols from '$dlprefile'" func_basename "$dlprefile" name=$func_basename_result case $host in *cygwin* | *mingw* | *cegcc* ) # if an import library, we need to obtain dlname if func_win32_import_lib_p "$dlprefile"; then func_tr_sh "$dlprefile" eval "curr_lafile=\$libfile_$func_tr_sh_result" dlprefile_dlbasename= if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then # Use subshell, to avoid clobbering current variable values dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"` if test -n "$dlprefile_dlname"; then func_basename "$dlprefile_dlname" dlprefile_dlbasename=$func_basename_result else # no lafile. user explicitly requested -dlpreopen . $sharedlib_from_linklib_cmd "$dlprefile" dlprefile_dlbasename=$sharedlib_from_linklib_result fi fi $opt_dry_run || { if test -n "$dlprefile_dlbasename"; then eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"' else func_warning "Could not compute DLL name from $name" eval '$ECHO ": $name " >> "$nlist"' fi func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe | $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'" } else # not an import lib $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } fi ;; *) $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } ;; esac done $opt_dry_run || { # Make sure we have at least an empty file. test -f "$nlist" || : > "$nlist" if test -n "$exclude_expsyms"; then $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T $MV "$nlist"T "$nlist" fi # Try sorting and uniquifying the output. if $GREP -v "^: " < "$nlist" | if sort -k 3 /dev/null 2>&1; then sort -k 3 else sort +2 fi | uniq > "$nlist"S; then : else $GREP -v "^: " < "$nlist" > "$nlist"S fi if test -f "$nlist"S; then eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"' else echo '/* NONE */' >> "$output_objdir/$my_dlsyms" fi func_show_eval '$RM "${nlist}I"' if test -n "$global_symbol_to_import"; then eval "$global_symbol_to_import"' < "$nlist"S > "$nlist"I' fi echo >> "$output_objdir/$my_dlsyms" "\ /* The mapping between symbol names and symbols. */ typedef struct { const char *name; void *address; } lt_dlsymlist; extern LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[];\ " if test -s "$nlist"I; then echo >> "$output_objdir/$my_dlsyms" "\ static void lt_syminit(void) { LT_DLSYM_CONST lt_dlsymlist *symbol = lt_${my_prefix}_LTX_preloaded_symbols; for (; symbol->name; ++symbol) {" $SED 's/.*/ if (STREQ (symbol->name, \"&\")) symbol->address = (void *) \&&;/' < "$nlist"I >> "$output_objdir/$my_dlsyms" echo >> "$output_objdir/$my_dlsyms" "\ } }" fi echo >> "$output_objdir/$my_dlsyms" "\ LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[] = { {\"$my_originator\", (void *) 0}," if test -s "$nlist"I; then echo >> "$output_objdir/$my_dlsyms" "\ {\"@INIT@\", (void *) <_syminit}," fi case $need_lib_prefix in no) eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; *) eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; esac echo >> "$output_objdir/$my_dlsyms" "\ {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt_${my_prefix}_LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif\ " } # !$opt_dry_run pic_flag_for_symtable= case "$compile_command " in *" -static "*) ;; *) case $host in # compiling the symbol table file with pic_flag works around # a FreeBSD bug that causes programs to crash when -lm is # linked before any other PIC object. But we must not use # pic_flag when linking with -static. The problem exists in # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;; *-*-hpux*) pic_flag_for_symtable=" $pic_flag" ;; *) $my_pic_p && pic_flag_for_symtable=" $pic_flag" ;; esac ;; esac symtab_cflags= for arg in $LTCFLAGS; do case $arg in -pie | -fpie | -fPIE) ;; *) func_append symtab_cflags " $arg" ;; esac done # Now compile the dynamic symbol file. func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?' # Clean up the generated files. func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T" "${nlist}I"' # Transform the symbol file into the correct name. symfileobj=$output_objdir/${my_outputname}S.$objext case $host in *cygwin* | *mingw* | *cegcc* ) if test -f "$output_objdir/$my_outputname.def"; then compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` else compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` fi ;; *) compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` ;; esac ;; *) func_fatal_error "unknown suffix for '$my_dlsyms'" ;; esac else # We keep going just in case the user didn't refer to # lt_preloaded_symbols. The linker will fail if global_symbol_pipe # really was required. # Nullify the symbol file. compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"` finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"` fi } # func_cygming_gnu_implib_p ARG # This predicate returns with zero status (TRUE) if # ARG is a GNU/binutils-style import library. Returns # with nonzero status (FALSE) otherwise. func_cygming_gnu_implib_p () { $debug_cmd func_to_tool_file "$1" func_convert_file_msys_to_w32 func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'` test -n "$func_cygming_gnu_implib_tmp" } # func_cygming_ms_implib_p ARG # This predicate returns with zero status (TRUE) if # ARG is an MS-style import library. Returns # with nonzero status (FALSE) otherwise. func_cygming_ms_implib_p () { $debug_cmd func_to_tool_file "$1" func_convert_file_msys_to_w32 func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'` test -n "$func_cygming_ms_implib_tmp" } # func_win32_libid arg # return the library type of file 'arg' # # Need a lot of goo to handle *both* DLLs and import libs # Has to be a shell function in order to 'eat' the argument # that is supplied when $file_magic_command is called. # Despite the name, also deal with 64 bit binaries. func_win32_libid () { $debug_cmd win32_libid_type=unknown win32_fileres=`file -L $1 2>/dev/null` case $win32_fileres in *ar\ archive\ import\ library*) # definitely import win32_libid_type="x86 archive import" ;; *ar\ archive*) # could be an import, or static # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD. if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then case $nm_interface in "MS dumpbin") if func_cygming_ms_implib_p "$1" || func_cygming_gnu_implib_p "$1" then win32_nmres=import else win32_nmres= fi ;; *) func_to_tool_file "$1" func_convert_file_msys_to_w32 win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" | $SED -n -e ' 1,100{ / I /{ s|.*|import| p q } }'` ;; esac case $win32_nmres in import*) win32_libid_type="x86 archive import";; *) win32_libid_type="x86 archive static";; esac fi ;; *DLL*) win32_libid_type="x86 DLL" ;; *executable*) # but shell scripts are "executable" too... case $win32_fileres in *MS\ Windows\ PE\ Intel*) win32_libid_type="x86 DLL" ;; esac ;; esac $ECHO "$win32_libid_type" } # func_cygming_dll_for_implib ARG # # Platform-specific function to extract the # name of the DLL associated with the specified # import library ARG. # Invoked by eval'ing the libtool variable # $sharedlib_from_linklib_cmd # Result is available in the variable # $sharedlib_from_linklib_result func_cygming_dll_for_implib () { $debug_cmd sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"` } # func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs # # The is the core of a fallback implementation of a # platform-specific function to extract the name of the # DLL associated with the specified import library LIBNAME. # # SECTION_NAME is either .idata$6 or .idata$7, depending # on the platform and compiler that created the implib. # # Echos the name of the DLL associated with the # specified import library. func_cygming_dll_for_implib_fallback_core () { $debug_cmd match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"` $OBJDUMP -s --section "$1" "$2" 2>/dev/null | $SED '/^Contents of section '"$match_literal"':/{ # Place marker at beginning of archive member dllname section s/.*/====MARK====/ p d } # These lines can sometimes be longer than 43 characters, but # are always uninteresting /:[ ]*file format pe[i]\{,1\}-/d /^In archive [^:]*:/d # Ensure marker is printed /^====MARK====/p # Remove all lines with less than 43 characters /^.\{43\}/!d # From remaining lines, remove first 43 characters s/^.\{43\}//' | $SED -n ' # Join marker and all lines until next marker into a single line /^====MARK====/ b para H $ b para b :para x s/\n//g # Remove the marker s/^====MARK====// # Remove trailing dots and whitespace s/[\. \t]*$// # Print /./p' | # we now have a list, one entry per line, of the stringified # contents of the appropriate section of all members of the # archive that possess that section. Heuristic: eliminate # all those that have a first or second character that is # a '.' (that is, objdump's representation of an unprintable # character.) This should work for all archives with less than # 0x302f exports -- but will fail for DLLs whose name actually # begins with a literal '.' or a single character followed by # a '.'. # # Of those that remain, print the first one. $SED -e '/^\./d;/^.\./d;q' } # func_cygming_dll_for_implib_fallback ARG # Platform-specific function to extract the # name of the DLL associated with the specified # import library ARG. # # This fallback implementation is for use when $DLLTOOL # does not support the --identify-strict option. # Invoked by eval'ing the libtool variable # $sharedlib_from_linklib_cmd # Result is available in the variable # $sharedlib_from_linklib_result func_cygming_dll_for_implib_fallback () { $debug_cmd if func_cygming_gnu_implib_p "$1"; then # binutils import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"` elif func_cygming_ms_implib_p "$1"; then # ms-generated import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"` else # unknown sharedlib_from_linklib_result= fi } # func_extract_an_archive dir oldlib func_extract_an_archive () { $debug_cmd f_ex_an_ar_dir=$1; shift f_ex_an_ar_oldlib=$1 if test yes = "$lock_old_archive_extraction"; then lockfile=$f_ex_an_ar_oldlib.lock until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done fi func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \ 'stat=$?; rm -f "$lockfile"; exit $stat' if test yes = "$lock_old_archive_extraction"; then $opt_dry_run || rm -f "$lockfile" fi if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then : else func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" fi } # func_extract_archives gentop oldlib ... func_extract_archives () { $debug_cmd my_gentop=$1; shift my_oldlibs=${1+"$@"} my_oldobjs= my_xlib= my_xabs= my_xdir= for my_xlib in $my_oldlibs; do # Extract the objects. case $my_xlib in [\\/]* | [A-Za-z]:[\\/]*) my_xabs=$my_xlib ;; *) my_xabs=`pwd`"/$my_xlib" ;; esac func_basename "$my_xlib" my_xlib=$func_basename_result my_xlib_u=$my_xlib while :; do case " $extracted_archives " in *" $my_xlib_u "*) func_arith $extracted_serial + 1 extracted_serial=$func_arith_result my_xlib_u=lt$extracted_serial-$my_xlib ;; *) break ;; esac done extracted_archives="$extracted_archives $my_xlib_u" my_xdir=$my_gentop/$my_xlib_u func_mkdir_p "$my_xdir" case $host in *-darwin*) func_verbose "Extracting $my_xabs" # Do not bother doing anything if just a dry run $opt_dry_run || { darwin_orig_dir=`pwd` cd $my_xdir || exit $? darwin_archive=$my_xabs darwin_curdir=`pwd` func_basename "$darwin_archive" darwin_base_archive=$func_basename_result darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true` if test -n "$darwin_arches"; then darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'` darwin_arch= func_verbose "$darwin_base_archive has multiple architectures $darwin_arches" for darwin_arch in $darwin_arches; do func_mkdir_p "unfat-$$/$darwin_base_archive-$darwin_arch" $LIPO -thin $darwin_arch -output "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive" "$darwin_archive" cd "unfat-$$/$darwin_base_archive-$darwin_arch" func_extract_an_archive "`pwd`" "$darwin_base_archive" cd "$darwin_curdir" $RM "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive" done # $darwin_arches ## Okay now we've a bunch of thin objects, gotta fatten them up :) darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$sed_basename" | sort -u` darwin_file= darwin_files= for darwin_file in $darwin_filelist; do darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP` $LIPO -create -output "$darwin_file" $darwin_files done # $darwin_filelist $RM -rf unfat-$$ cd "$darwin_orig_dir" else cd $darwin_orig_dir func_extract_an_archive "$my_xdir" "$my_xabs" fi # $darwin_arches } # !$opt_dry_run ;; *) func_extract_an_archive "$my_xdir" "$my_xabs" ;; esac my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP` done func_extract_archives_result=$my_oldobjs } # func_emit_wrapper [arg=no] # # Emit a libtool wrapper script on stdout. # Don't directly open a file because we may want to # incorporate the script contents within a cygwin/mingw # wrapper executable. Must ONLY be called from within # func_mode_link because it depends on a number of variables # set therein. # # ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR # variable will take. If 'yes', then the emitted script # will assume that the directory where it is stored is # the $objdir directory. This is a cygwin/mingw-specific # behavior. func_emit_wrapper () { func_emit_wrapper_arg1=${1-no} $ECHO "\ #! $SHELL # $output - temporary wrapper script for $objdir/$outputname # Generated by $PROGRAM (GNU $PACKAGE) $VERSION # # The $output program cannot be directly executed until all the libtool # libraries that it depends on are installed. # # This wrapper script should never be moved out of the build directory. # If it is, it will not operate correctly. # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. sed_quote_subst='$sed_quote_subst' # Be Bourne compatible if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac fi BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH relink_command=\"$relink_command\" # This environment variable determines our operation mode. if test \"\$libtool_install_magic\" = \"$magic\"; then # install mode needs the following variables: generated_by_libtool_version='$macro_version' notinst_deplibs='$notinst_deplibs' else # When we are sourced in execute mode, \$file and \$ECHO are already set. if test \"\$libtool_execute_magic\" != \"$magic\"; then file=\"\$0\"" func_quote "$ECHO" qECHO=$func_quote_result $ECHO "\ # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } ECHO=\"$qECHO\" fi # Very basic option parsing. These options are (a) specific to # the libtool wrapper, (b) are identical between the wrapper # /script/ and the wrapper /executable/ that is used only on # windows platforms, and (c) all begin with the string "--lt-" # (application programs are unlikely to have options that match # this pattern). # # There are only two supported options: --lt-debug and # --lt-dump-script. There is, deliberately, no --lt-help. # # The first argument to this parsing function should be the # script's $0 value, followed by "$@". lt_option_debug= func_parse_lt_options () { lt_script_arg0=\$0 shift for lt_opt do case \"\$lt_opt\" in --lt-debug) lt_option_debug=1 ;; --lt-dump-script) lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\` test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=. lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\` cat \"\$lt_dump_D/\$lt_dump_F\" exit 0 ;; --lt-*) \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2 exit 1 ;; esac done # Print the debug banner immediately: if test -n \"\$lt_option_debug\"; then echo \"$outputname:$output:\$LINENO: libtool wrapper (GNU $PACKAGE) $VERSION\" 1>&2 fi } # Used when --lt-debug. Prints its arguments to stdout # (redirection is the responsibility of the caller) func_lt_dump_args () { lt_dump_args_N=1; for lt_arg do \$ECHO \"$outputname:$output:\$LINENO: newargv[\$lt_dump_args_N]: \$lt_arg\" lt_dump_args_N=\`expr \$lt_dump_args_N + 1\` done } # Core function for launching the target application func_exec_program_core () { " case $host in # Backslashes separate directories on plain windows *-*-mingw | *-*-os2* | *-cegcc*) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir\\\\\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} " ;; *) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir/\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir/\$program\" \${1+\"\$@\"} " ;; esac $ECHO "\ \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 exit 1 } # A function to encapsulate launching the target application # Strips options in the --lt-* namespace from \$@ and # launches target application with the remaining arguments. func_exec_program () { case \" \$* \" in *\\ --lt-*) for lt_wr_arg do case \$lt_wr_arg in --lt-*) ;; *) set x \"\$@\" \"\$lt_wr_arg\"; shift;; esac shift done ;; esac func_exec_program_core \${1+\"\$@\"} } # Parse options func_parse_lt_options \"\$0\" \${1+\"\$@\"} # Find the directory that this script lives in. thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\` test \"x\$thisdir\" = \"x\$file\" && thisdir=. # Follow symbolic links until we get to the real thisdir. file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\` while test -n \"\$file\"; do destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\` # If there was a directory component, then change thisdir. if test \"x\$destdir\" != \"x\$file\"; then case \"\$destdir\" in [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; *) thisdir=\"\$thisdir/\$destdir\" ;; esac fi file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\` file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\` done # Usually 'no', except on cygwin/mingw when embedded into # the cwrapper. WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1 if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then # special case for '.' if test \"\$thisdir\" = \".\"; then thisdir=\`pwd\` fi # remove .libs from thisdir case \"\$thisdir\" in *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;; $objdir ) thisdir=. ;; esac fi # Try to get the absolute directory name. absdir=\`cd \"\$thisdir\" && pwd\` test -n \"\$absdir\" && thisdir=\"\$absdir\" " if test yes = "$fast_install"; then $ECHO "\ program=lt-'$outputname'$exeext progdir=\"\$thisdir/$objdir\" if test ! -f \"\$progdir/\$program\" || { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | $SED 1q\`; \\ test \"X\$file\" != \"X\$progdir/\$program\"; }; then file=\"\$\$-\$program\" if test ! -d \"\$progdir\"; then $MKDIR \"\$progdir\" else $RM \"\$progdir/\$file\" fi" $ECHO "\ # relink executable if necessary if test -n \"\$relink_command\"; then if relink_command_output=\`eval \$relink_command 2>&1\`; then : else \$ECHO \"\$relink_command_output\" >&2 $RM \"\$progdir/\$file\" exit 1 fi fi $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || { $RM \"\$progdir/\$program\"; $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; } $RM \"\$progdir/\$file\" fi" else $ECHO "\ program='$outputname' progdir=\"\$thisdir/$objdir\" " fi $ECHO "\ if test -f \"\$progdir/\$program\"; then" # fixup the dll searchpath if we need to. # # Fix the DLL searchpath if we need to. Do this before prepending # to shlibpath, because on Windows, both are PATH and uninstalled # libraries must come first. if test -n "$dllsearchpath"; then $ECHO "\ # Add the dll search path components to the executable PATH PATH=$dllsearchpath:\$PATH " fi # Export our shlibpath_var if we have one. if test yes = "$shlibpath_overrides_runpath" && test -n "$shlibpath_var" && test -n "$temp_rpath"; then $ECHO "\ # Add our own library path to $shlibpath_var $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" # Some systems cannot cope with colon-terminated $shlibpath_var # The second colon is a workaround for a bug in BeOS R4 sed $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\` export $shlibpath_var " fi $ECHO "\ if test \"\$libtool_execute_magic\" != \"$magic\"; then # Run the actual program with our arguments. func_exec_program \${1+\"\$@\"} fi else # The program doesn't exist. \$ECHO \"\$0: error: '\$progdir/\$program' does not exist\" 1>&2 \$ECHO \"This script is just a wrapper for \$program.\" 1>&2 \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 exit 1 fi fi\ " } # func_emit_cwrapperexe_src # emit the source code for a wrapper executable on stdout # Must ONLY be called from within func_mode_link because # it depends on a number of variable set therein. func_emit_cwrapperexe_src () { cat < #include #ifdef _MSC_VER # include # include # include #else # include # include # ifdef __CYGWIN__ # include # endif #endif #include #include #include #include #include #include #include #include #define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0) /* declarations of non-ANSI functions */ #if defined __MINGW32__ # ifdef __STRICT_ANSI__ int _putenv (const char *); # endif #elif defined __CYGWIN__ # ifdef __STRICT_ANSI__ char *realpath (const char *, char *); int putenv (char *); int setenv (const char *, const char *, int); # endif /* #elif defined other_platform || defined ... */ #endif /* portability defines, excluding path handling macros */ #if defined _MSC_VER # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv # define S_IXUSR _S_IEXEC #elif defined __MINGW32__ # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv #elif defined __CYGWIN__ # define HAVE_SETENV # define FOPEN_WB "wb" /* #elif defined other platforms ... */ #endif #if defined PATH_MAX # define LT_PATHMAX PATH_MAX #elif defined MAXPATHLEN # define LT_PATHMAX MAXPATHLEN #else # define LT_PATHMAX 1024 #endif #ifndef S_IXOTH # define S_IXOTH 0 #endif #ifndef S_IXGRP # define S_IXGRP 0 #endif /* path handling portability macros */ #ifndef DIR_SEPARATOR # define DIR_SEPARATOR '/' # define PATH_SEPARATOR ':' #endif #if defined _WIN32 || defined __MSDOS__ || defined __DJGPP__ || \ defined __OS2__ # define HAVE_DOS_BASED_FILE_SYSTEM # define FOPEN_WB "wb" # ifndef DIR_SEPARATOR_2 # define DIR_SEPARATOR_2 '\\' # endif # ifndef PATH_SEPARATOR_2 # define PATH_SEPARATOR_2 ';' # endif #endif #ifndef DIR_SEPARATOR_2 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) #else /* DIR_SEPARATOR_2 */ # define IS_DIR_SEPARATOR(ch) \ (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) #endif /* DIR_SEPARATOR_2 */ #ifndef PATH_SEPARATOR_2 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) #else /* PATH_SEPARATOR_2 */ # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) #endif /* PATH_SEPARATOR_2 */ #ifndef FOPEN_WB # define FOPEN_WB "w" #endif #ifndef _O_BINARY # define _O_BINARY 0 #endif #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) #define XFREE(stale) do { \ if (stale) { free (stale); stale = 0; } \ } while (0) #if defined LT_DEBUGWRAPPER static int lt_debug = 1; #else static int lt_debug = 0; #endif const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */ void *xmalloc (size_t num); char *xstrdup (const char *string); const char *base_name (const char *name); char *find_executable (const char *wrapper); char *chase_symlinks (const char *pathspec); int make_executable (const char *path); int check_executable (const char *path); char *strendzap (char *str, const char *pat); void lt_debugprintf (const char *file, int line, const char *fmt, ...); void lt_fatal (const char *file, int line, const char *message, ...); static const char *nonnull (const char *s); static const char *nonempty (const char *s); void lt_setenv (const char *name, const char *value); char *lt_extend_str (const char *orig_value, const char *add, int to_end); void lt_update_exe_path (const char *name, const char *value); void lt_update_lib_path (const char *name, const char *value); char **prepare_spawn (char **argv); void lt_dump_script (FILE *f); EOF cat <= 0) && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) return 1; else return 0; } int make_executable (const char *path) { int rval = 0; struct stat st; lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n", nonempty (path)); if ((!path) || (!*path)) return 0; if (stat (path, &st) >= 0) { rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR); } return rval; } /* Searches for the full path of the wrapper. Returns newly allocated full path name if found, NULL otherwise Does not chase symlinks, even on platforms that support them. */ char * find_executable (const char *wrapper) { int has_slash = 0; const char *p; const char *p_next; /* static buffer for getcwd */ char tmp[LT_PATHMAX + 1]; size_t tmp_len; char *concat_name; lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n", nonempty (wrapper)); if ((wrapper == NULL) || (*wrapper == '\0')) return NULL; /* Absolute path? */ #if defined HAVE_DOS_BASED_FILE_SYSTEM if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':') { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } else { #endif if (IS_DIR_SEPARATOR (wrapper[0])) { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } #if defined HAVE_DOS_BASED_FILE_SYSTEM } #endif for (p = wrapper; *p; p++) if (*p == '/') { has_slash = 1; break; } if (!has_slash) { /* no slashes; search PATH */ const char *path = getenv ("PATH"); if (path != NULL) { for (p = path; *p; p = p_next) { const char *q; size_t p_len; for (q = p; *q; q++) if (IS_PATH_SEPARATOR (*q)) break; p_len = (size_t) (q - p); p_next = (*q == '\0' ? q : q + 1); if (p_len == 0) { /* empty path: current directory */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); } else { concat_name = XMALLOC (char, p_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, p, p_len); concat_name[p_len] = '/'; strcpy (concat_name + p_len + 1, wrapper); } if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } } /* not found in PATH; assume curdir */ } /* Relative path | not found in path: prepend cwd */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); return NULL; } char * chase_symlinks (const char *pathspec) { #ifndef S_ISLNK return xstrdup (pathspec); #else char buf[LT_PATHMAX]; struct stat s; char *tmp_pathspec = xstrdup (pathspec); char *p; int has_symlinks = 0; while (strlen (tmp_pathspec) && !has_symlinks) { lt_debugprintf (__FILE__, __LINE__, "checking path component for symlinks: %s\n", tmp_pathspec); if (lstat (tmp_pathspec, &s) == 0) { if (S_ISLNK (s.st_mode) != 0) { has_symlinks = 1; break; } /* search backwards for last DIR_SEPARATOR */ p = tmp_pathspec + strlen (tmp_pathspec) - 1; while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) p--; if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) { /* no more DIR_SEPARATORS left */ break; } *p = '\0'; } else { lt_fatal (__FILE__, __LINE__, "error accessing file \"%s\": %s", tmp_pathspec, nonnull (strerror (errno))); } } XFREE (tmp_pathspec); if (!has_symlinks) { return xstrdup (pathspec); } tmp_pathspec = realpath (pathspec, buf); if (tmp_pathspec == 0) { lt_fatal (__FILE__, __LINE__, "could not follow symlinks for %s", pathspec); } return xstrdup (tmp_pathspec); #endif } char * strendzap (char *str, const char *pat) { size_t len, patlen; assert (str != NULL); assert (pat != NULL); len = strlen (str); patlen = strlen (pat); if (patlen <= len) { str += len - patlen; if (STREQ (str, pat)) *str = '\0'; } return str; } void lt_debugprintf (const char *file, int line, const char *fmt, ...) { va_list args; if (lt_debug) { (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line); va_start (args, fmt); (void) vfprintf (stderr, fmt, args); va_end (args); } } static void lt_error_core (int exit_status, const char *file, int line, const char *mode, const char *message, va_list ap) { fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode); vfprintf (stderr, message, ap); fprintf (stderr, ".\n"); if (exit_status >= 0) exit (exit_status); } void lt_fatal (const char *file, int line, const char *message, ...) { va_list ap; va_start (ap, message); lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap); va_end (ap); } static const char * nonnull (const char *s) { return s ? s : "(null)"; } static const char * nonempty (const char *s) { return (s && !*s) ? "(empty)" : nonnull (s); } void lt_setenv (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_setenv) setting '%s' to '%s'\n", nonnull (name), nonnull (value)); { #ifdef HAVE_SETENV /* always make a copy, for consistency with !HAVE_SETENV */ char *str = xstrdup (value); setenv (name, str, 1); #else size_t len = strlen (name) + 1 + strlen (value) + 1; char *str = XMALLOC (char, len); sprintf (str, "%s=%s", name, value); if (putenv (str) != EXIT_SUCCESS) { XFREE (str); } #endif } } char * lt_extend_str (const char *orig_value, const char *add, int to_end) { char *new_value; if (orig_value && *orig_value) { size_t orig_value_len = strlen (orig_value); size_t add_len = strlen (add); new_value = XMALLOC (char, add_len + orig_value_len + 1); if (to_end) { strcpy (new_value, orig_value); strcpy (new_value + orig_value_len, add); } else { strcpy (new_value, add); strcpy (new_value + add_len, orig_value); } } else { new_value = xstrdup (add); } return new_value; } void lt_update_exe_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_exe_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); /* some systems can't cope with a ':'-terminated path #' */ size_t len = strlen (new_value); while ((len > 0) && IS_PATH_SEPARATOR (new_value[len-1])) { new_value[--len] = '\0'; } lt_setenv (name, new_value); XFREE (new_value); } } void lt_update_lib_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_lib_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); lt_setenv (name, new_value); XFREE (new_value); } } EOF case $host_os in mingw*) cat <<"EOF" /* Prepares an argument vector before calling spawn(). Note that spawn() does not by itself call the command interpreter (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") : ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); GetVersionEx(&v); v.dwPlatformId == VER_PLATFORM_WIN32_NT; }) ? "cmd.exe" : "command.com"). Instead it simply concatenates the arguments, separated by ' ', and calls CreateProcess(). We must quote the arguments since Win32 CreateProcess() interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a special way: - Space and tab are interpreted as delimiters. They are not treated as delimiters if they are surrounded by double quotes: "...". - Unescaped double quotes are removed from the input. Their only effect is that within double quotes, space and tab are treated like normal characters. - Backslashes not followed by double quotes are not special. - But 2*n+1 backslashes followed by a double quote become n backslashes followed by a double quote (n >= 0): \" -> " \\\" -> \" \\\\\" -> \\" */ #define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" #define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" char ** prepare_spawn (char **argv) { size_t argc; char **new_argv; size_t i; /* Count number of arguments. */ for (argc = 0; argv[argc] != NULL; argc++) ; /* Allocate new argument vector. */ new_argv = XMALLOC (char *, argc + 1); /* Put quoted arguments into the new argument vector. */ for (i = 0; i < argc; i++) { const char *string = argv[i]; if (string[0] == '\0') new_argv[i] = xstrdup ("\"\""); else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL) { int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL); size_t length; unsigned int backslashes; const char *s; char *quoted_string; char *p; length = 0; backslashes = 0; if (quote_around) length++; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') length += backslashes + 1; length++; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) length += backslashes + 1; quoted_string = XMALLOC (char, length + 1); p = quoted_string; backslashes = 0; if (quote_around) *p++ = '"'; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') { unsigned int j; for (j = backslashes + 1; j > 0; j--) *p++ = '\\'; } *p++ = c; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) { unsigned int j; for (j = backslashes; j > 0; j--) *p++ = '\\'; *p++ = '"'; } *p = '\0'; new_argv[i] = quoted_string; } else new_argv[i] = (char *) string; } new_argv[argc] = NULL; return new_argv; } EOF ;; esac cat <<"EOF" void lt_dump_script (FILE* f) { EOF func_emit_wrapper yes | $SED -n -e ' s/^\(.\{79\}\)\(..*\)/\1\ \2/ h s/\([\\"]\)/\\\1/g s/$/\\n/ s/\([^\n]*\).*/ fputs ("\1", f);/p g D' cat <<"EOF" } EOF } # end: func_emit_cwrapperexe_src # func_win32_import_lib_p ARG # True if ARG is an import lib, as indicated by $file_magic_cmd func_win32_import_lib_p () { $debug_cmd case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in *import*) : ;; *) false ;; esac } # func_suncc_cstd_abi # !!ONLY CALL THIS FOR SUN CC AFTER $compile_command IS FULLY EXPANDED!! # Several compiler flags select an ABI that is incompatible with the # Cstd library. Avoid specifying it if any are in CXXFLAGS. func_suncc_cstd_abi () { $debug_cmd case " $compile_command " in *" -compat=g "*|*\ -std=c++[0-9][0-9]\ *|*" -library=stdcxx4 "*|*" -library=stlport4 "*) suncc_use_cstd_abi=no ;; *) suncc_use_cstd_abi=yes ;; esac } # func_mode_link arg... func_mode_link () { $debug_cmd case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) # It is impossible to link a dll without this setting, and # we shouldn't force the makefile maintainer to figure out # what system we are compiling for in order to pass an extra # flag for every libtool invocation. # allow_undefined=no # FIXME: Unfortunately, there are problems with the above when trying # to make a dll that has undefined symbols, in which case not # even a static library is built. For now, we need to specify # -no-undefined on the libtool link line when we can be certain # that all symbols are satisfied, otherwise we get a static library. allow_undefined=yes ;; *) allow_undefined=yes ;; esac libtool_args=$nonopt base_compile="$nonopt $@" compile_command=$nonopt finalize_command=$nonopt compile_rpath= finalize_rpath= compile_shlibpath= finalize_shlibpath= convenience= old_convenience= deplibs= old_deplibs= compiler_flags= linker_flags= dllsearchpath= lib_search_path=`pwd` inst_prefix_dir= new_inherited_linker_flags= avoid_version=no bindir= dlfiles= dlprefiles= dlself=no export_dynamic=no export_symbols= export_symbols_regex= generated= libobjs= ltlibs= module=no no_install=no objs= os2dllname= non_pic_objects= precious_files_regex= prefer_static_libs=no preload=false prev= prevarg= release= rpath= xrpath= perm_rpath= temp_rpath= thread_safe=no vinfo= vinfo_number=no weak_libs= single_module=$wl-single_module func_infer_tag $base_compile # We need to know -static, to get the right output filenames. for arg do case $arg in -shared) test yes != "$build_libtool_libs" \ && func_fatal_configuration "cannot build a shared library" build_old_libs=no break ;; -all-static | -static | -static-libtool-libs) case $arg in -all-static) if test yes = "$build_libtool_libs" && test -z "$link_static_flag"; then func_warning "complete static linking is impossible in this configuration" fi if test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; -static) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=built ;; -static-libtool-libs) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; esac build_libtool_libs=no build_old_libs=yes break ;; esac done # See if our shared archives depend on static archives. test -n "$old_archive_from_new_cmds" && build_old_libs=yes # Go through the arguments, transforming them on the way. while test "$#" -gt 0; do arg=$1 shift func_quote_for_eval "$arg" qarg=$func_quote_for_eval_unquoted_result func_append libtool_args " $func_quote_for_eval_result" # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in output) func_append compile_command " @OUTPUT@" func_append finalize_command " @OUTPUT@" ;; esac case $prev in bindir) bindir=$arg prev= continue ;; dlfiles|dlprefiles) $preload || { # Add the symbol object into the linking commands. func_append compile_command " @SYMFILE@" func_append finalize_command " @SYMFILE@" preload=: } case $arg in *.la | *.lo) ;; # We handle these cases below. force) if test no = "$dlself"; then dlself=needless export_dynamic=yes fi prev= continue ;; self) if test dlprefiles = "$prev"; then dlself=yes elif test dlfiles = "$prev" && test yes != "$dlopen_self"; then dlself=yes else dlself=needless export_dynamic=yes fi prev= continue ;; *) if test dlfiles = "$prev"; then func_append dlfiles " $arg" else func_append dlprefiles " $arg" fi prev= continue ;; esac ;; expsyms) export_symbols=$arg test -f "$arg" \ || func_fatal_error "symbol file '$arg' does not exist" prev= continue ;; expsyms_regex) export_symbols_regex=$arg prev= continue ;; framework) case $host in *-*-darwin*) case "$deplibs " in *" $qarg.ltframework "*) ;; *) func_append deplibs " $qarg.ltframework" # this is fixed later ;; esac ;; esac prev= continue ;; inst_prefix) inst_prefix_dir=$arg prev= continue ;; mllvm) # Clang does not use LLVM to link, so we can simply discard any # '-mllvm $arg' options when doing the link step. prev= continue ;; objectlist) if test -f "$arg"; then save_arg=$arg moreargs= for fil in `cat "$save_arg"` do # func_append moreargs " $fil" arg=$fil # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test none = "$pic_object" && test none = "$non_pic_object"; then func_fatal_error "cannot find name of object for '$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir=$func_dirname_result if test none != "$pic_object"; then # Prepend the subdirectory the object is found in. pic_object=$xdir$pic_object if test dlfiles = "$prev"; then if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then func_append dlfiles " $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test dlprefiles = "$prev"; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg=$pic_object fi # Non-PIC object. if test none != "$non_pic_object"; then # Prepend the subdirectory the object is found in. non_pic_object=$xdir$non_pic_object # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test none = "$pic_object"; then arg=$non_pic_object fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object=$pic_object func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir=$func_dirname_result func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "'$arg' is not a valid libtool object" fi fi done else func_fatal_error "link input file '$arg' does not exist" fi arg=$save_arg prev= continue ;; os2dllname) os2dllname=$arg prev= continue ;; precious_regex) precious_files_regex=$arg prev= continue ;; release) release=-$arg prev= continue ;; rpath | xrpath) # We need an absolute path. case $arg in [\\/]* | [A-Za-z]:[\\/]*) ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac if test rpath = "$prev"; then case "$rpath " in *" $arg "*) ;; *) func_append rpath " $arg" ;; esac else case "$xrpath " in *" $arg "*) ;; *) func_append xrpath " $arg" ;; esac fi prev= continue ;; shrext) shrext_cmds=$arg prev= continue ;; weak) func_append weak_libs " $arg" prev= continue ;; xcclinker) func_append linker_flags " $qarg" func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xcompiler) func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xlinker) func_append linker_flags " $qarg" func_append compiler_flags " $wl$qarg" prev= func_append compile_command " $wl$qarg" func_append finalize_command " $wl$qarg" continue ;; *) eval "$prev=\"\$arg\"" prev= continue ;; esac fi # test -n "$prev" prevarg=$arg case $arg in -all-static) if test -n "$link_static_flag"; then # See comment for -static flag below, for more details. func_append compile_command " $link_static_flag" func_append finalize_command " $link_static_flag" fi continue ;; -allow-undefined) # FIXME: remove this flag sometime in the future. func_fatal_error "'-allow-undefined' must not be used because it is the default" ;; -avoid-version) avoid_version=yes continue ;; -bindir) prev=bindir continue ;; -dlopen) prev=dlfiles continue ;; -dlpreopen) prev=dlprefiles continue ;; -export-dynamic) export_dynamic=yes continue ;; -export-symbols | -export-symbols-regex) if test -n "$export_symbols" || test -n "$export_symbols_regex"; then func_fatal_error "more than one -exported-symbols argument is not allowed" fi if test X-export-symbols = "X$arg"; then prev=expsyms else prev=expsyms_regex fi continue ;; -framework) prev=framework continue ;; -inst-prefix-dir) prev=inst_prefix continue ;; # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* # so, if we see these flags be careful not to treat them like -L -L[A-Z][A-Z]*:*) case $with_gcc/$host in no/*-*-irix* | /*-*-irix*) func_append compile_command " $arg" func_append finalize_command " $arg" ;; esac continue ;; -L*) func_stripname "-L" '' "$arg" if test -z "$func_stripname_result"; then if test "$#" -gt 0; then func_fatal_error "require no space between '-L' and '$1'" else func_fatal_error "need path for '-L' option" fi fi func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) absdir=`cd "$dir" && pwd` test -z "$absdir" && \ func_fatal_error "cannot determine absolute directory name of '$dir'" dir=$absdir ;; esac case "$deplibs " in *" -L$dir "* | *" $arg "*) # Will only happen for absolute or sysroot arguments ;; *) # Preserve sysroot, but never include relative directories case $dir in [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;; *) func_append deplibs " -L$dir" ;; esac func_append lib_search_path " $dir" ;; esac case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'` case :$dllsearchpath: in *":$dir:"*) ;; ::) dllsearchpath=$dir;; *) func_append dllsearchpath ":$dir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append dllsearchpath ":$testbindir";; esac ;; esac continue ;; -l*) if test X-lc = "X$arg" || test X-lm = "X$arg"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*) # These systems don't actually have a C or math library (as such) continue ;; *-*-os2*) # These systems don't actually have a C library (as such) test X-lc = "X$arg" && continue ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*) # Do not include libc due to us having libc/libc_r. test X-lc = "X$arg" && continue ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C and math libraries are in the System framework func_append deplibs " System.ltframework" continue ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype test X-lc = "X$arg" && continue ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work test X-lc = "X$arg" && continue ;; esac elif test X-lc_r = "X$arg"; then case $host in *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*) # Do not include libc_r directly, use -pthread flag. continue ;; esac fi func_append deplibs " $arg" continue ;; -mllvm) prev=mllvm continue ;; -module) module=yes continue ;; # Tru64 UNIX uses -model [arg] to determine the layout of C++ # classes, name mangling, and exception handling. # Darwin uses the -arch flag to determine output architecture. -model|-arch|-isysroot|--sysroot) func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" prev=xcompiler continue ;; -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" case "$new_inherited_linker_flags " in *" $arg "*) ;; * ) func_append new_inherited_linker_flags " $arg" ;; esac continue ;; -multi_module) single_module=$wl-multi_module continue ;; -no-fast-install) fast_install=no continue ;; -no-install) case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*) # The PATH hackery in wrapper scripts is required on Windows # and Darwin in order for the loader to find any dlls it needs. func_warning "'-no-install' is ignored for $host" func_warning "assuming '-no-fast-install' instead" fast_install=no ;; *) no_install=yes ;; esac continue ;; -no-undefined) allow_undefined=no continue ;; -objectlist) prev=objectlist continue ;; -os2dllname) prev=os2dllname continue ;; -o) prev=output ;; -precious-files-regex) prev=precious_regex continue ;; -release) prev=release continue ;; -rpath) prev=rpath continue ;; -R) prev=xrpath continue ;; -R*) func_stripname '-R' '' "$arg" dir=$func_stripname_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; =*) func_stripname '=' '' "$dir" dir=$lt_sysroot$func_stripname_result ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac case "$xrpath " in *" $dir "*) ;; *) func_append xrpath " $dir" ;; esac continue ;; -shared) # The effects of -shared are defined in a previous loop. continue ;; -shrext) prev=shrext continue ;; -static | -static-libtool-libs) # The effects of -static are defined in a previous loop. # We used to do the same as -all-static on platforms that # didn't have a PIC flag, but the assumption that the effects # would be equivalent was wrong. It would break on at least # Digital Unix and AIX. continue ;; -thread-safe) thread_safe=yes continue ;; -version-info) prev=vinfo continue ;; -version-number) prev=vinfo vinfo_number=yes continue ;; -weak) prev=weak continue ;; -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result arg= save_ifs=$IFS; IFS=, for flag in $args; do IFS=$save_ifs func_quote_for_eval "$flag" func_append arg " $func_quote_for_eval_result" func_append compiler_flags " $func_quote_for_eval_result" done IFS=$save_ifs func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Wl,*) func_stripname '-Wl,' '' "$arg" args=$func_stripname_result arg= save_ifs=$IFS; IFS=, for flag in $args; do IFS=$save_ifs func_quote_for_eval "$flag" func_append arg " $wl$func_quote_for_eval_result" func_append compiler_flags " $wl$func_quote_for_eval_result" func_append linker_flags " $func_quote_for_eval_result" done IFS=$save_ifs func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Xcompiler) prev=xcompiler continue ;; -Xlinker) prev=xlinker continue ;; -XCClinker) prev=xcclinker continue ;; # -msg_* for osf cc -msg_*) func_quote_for_eval "$arg" arg=$func_quote_for_eval_result ;; # Flags to be passed through unchanged, with rationale: # -64, -mips[0-9] enable 64-bit mode for the SGI compiler # -r[0-9][0-9]* specify processor for the SGI compiler # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler # +DA*, +DD* enable 64-bit mode for the HP compiler # -q* compiler args for the IBM compiler # -m*, -t[45]*, -txscale* architecture-specific flags for GCC # -F/path path to uninstalled frameworks, gcc on darwin # -p, -pg, --coverage, -fprofile-* profiling flags for GCC # -fstack-protector* stack protector flags for GCC # @file GCC response files # -tp=* Portland pgcc target processor selection # --sysroot=* for sysroot support # -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization # -specs=* GCC specs files # -stdlib=* select c++ std lib with clang # -fsanitize=* Clang/GCC memory and address sanitizer # -fuse-ld=* Linker select flags for GCC -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*| \ -specs=*|-fsanitize=*|-fuse-ld=*) func_quote_for_eval "$arg" arg=$func_quote_for_eval_result func_append compile_command " $arg" func_append finalize_command " $arg" func_append compiler_flags " $arg" continue ;; -Z*) if test os2 = "`expr $host : '.*\(os2\)'`"; then # OS/2 uses -Zxxx to specify OS/2-specific options compiler_flags="$compiler_flags $arg" func_append compile_command " $arg" func_append finalize_command " $arg" case $arg in -Zlinker | -Zstack) prev=xcompiler ;; esac continue else # Otherwise treat like 'Some other compiler flag' below func_quote_for_eval "$arg" arg=$func_quote_for_eval_result fi ;; # Some other compiler flag. -* | +*) func_quote_for_eval "$arg" arg=$func_quote_for_eval_result ;; *.$objext) # A standard object. func_append objs " $arg" ;; *.lo) # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test none = "$pic_object" && test none = "$non_pic_object"; then func_fatal_error "cannot find name of object for '$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir=$func_dirname_result test none = "$pic_object" || { # Prepend the subdirectory the object is found in. pic_object=$xdir$pic_object if test dlfiles = "$prev"; then if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then func_append dlfiles " $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test dlprefiles = "$prev"; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg=$pic_object } # Non-PIC object. if test none != "$non_pic_object"; then # Prepend the subdirectory the object is found in. non_pic_object=$xdir$non_pic_object # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test none = "$pic_object"; then arg=$non_pic_object fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object=$pic_object func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir=$func_dirname_result func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "'$arg' is not a valid libtool object" fi fi ;; *.$libext) # An archive. func_append deplibs " $arg" func_append old_deplibs " $arg" continue ;; *.la) # A libtool-controlled library. func_resolve_sysroot "$arg" if test dlfiles = "$prev"; then # This library was specified with -dlopen. func_append dlfiles " $func_resolve_sysroot_result" prev= elif test dlprefiles = "$prev"; then # The library was specified with -dlpreopen. func_append dlprefiles " $func_resolve_sysroot_result" prev= else func_append deplibs " $func_resolve_sysroot_result" fi continue ;; # Some other compiler argument. *) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. func_quote_for_eval "$arg" arg=$func_quote_for_eval_result ;; esac # arg # Now actually substitute the argument into the commands. if test -n "$arg"; then func_append compile_command " $arg" func_append finalize_command " $arg" fi done # argument parsing loop test -n "$prev" && \ func_fatal_help "the '$prevarg' option requires an argument" if test yes = "$export_dynamic" && test -n "$export_dynamic_flag_spec"; then eval arg=\"$export_dynamic_flag_spec\" func_append compile_command " $arg" func_append finalize_command " $arg" fi oldlibs= # calculate the name of the file, without its directory func_basename "$output" outputname=$func_basename_result libobjs_save=$libobjs if test -n "$shlibpath_var"; then # get the directories listed in $shlibpath_var eval shlib_search_path=\`\$ECHO \"\$$shlibpath_var\" \| \$SED \'s/:/ /g\'\` else shlib_search_path= fi eval sys_lib_search_path=\"$sys_lib_search_path_spec\" eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" # Definition is injected by LT_CONFIG during libtool generation. func_munge_path_list sys_lib_dlsearch_path "$LT_SYS_LIBRARY_PATH" func_dirname "$output" "/" "" output_objdir=$func_dirname_result$objdir func_to_tool_file "$output_objdir/" tool_output_objdir=$func_to_tool_file_result # Create the object directory. func_mkdir_p "$output_objdir" # Determine the type of output case $output in "") func_fatal_help "you must specify an output file" ;; *.$libext) linkmode=oldlib ;; *.lo | *.$objext) linkmode=obj ;; *.la) linkmode=lib ;; *) linkmode=prog ;; # Anything else should be a program. esac specialdeplibs= libs= # Find all interdependent deplibs by searching for libraries # that are linked more than once (e.g. -la -lb -la) for deplib in $deplibs; do if $opt_preserve_dup_deps; then case "$libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append libs " $deplib" done if test lib = "$linkmode"; then libs="$predeps $libs $compiler_lib_search_path $postdeps" # Compute libraries that are listed more than once in $predeps # $postdeps and mark them as special (i.e., whose duplicates are # not to be eliminated). pre_post_deps= if $opt_duplicate_compiler_generated_deps; then for pre_post_dep in $predeps $postdeps; do case "$pre_post_deps " in *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;; esac func_append pre_post_deps " $pre_post_dep" done fi pre_post_deps= fi deplibs= newdependency_libs= newlib_search_path= need_relink=no # whether we're linking any uninstalled libtool libraries notinst_deplibs= # not-installed libtool libraries notinst_path= # paths that contain not-installed libtool libraries case $linkmode in lib) passes="conv dlpreopen link" for file in $dlfiles $dlprefiles; do case $file in *.la) ;; *) func_fatal_help "libraries can '-dlopen' only libtool libraries: $file" ;; esac done ;; prog) compile_deplibs= finalize_deplibs= alldeplibs=false newdlfiles= newdlprefiles= passes="conv scan dlopen dlpreopen link" ;; *) passes="conv" ;; esac for pass in $passes; do # The preopen pass in lib mode reverses $deplibs; put it back here # so that -L comes before libs that need it for instance... if test lib,link = "$linkmode,$pass"; then ## FIXME: Find the place where the list is rebuilt in the wrong ## order, and fix it there properly tmp_deplibs= for deplib in $deplibs; do tmp_deplibs="$deplib $tmp_deplibs" done deplibs=$tmp_deplibs fi if test lib,link = "$linkmode,$pass" || test prog,scan = "$linkmode,$pass"; then libs=$deplibs deplibs= fi if test prog = "$linkmode"; then case $pass in dlopen) libs=$dlfiles ;; dlpreopen) libs=$dlprefiles ;; link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; esac fi if test lib,dlpreopen = "$linkmode,$pass"; then # Collect and forward deplibs of preopened libtool libs for lib in $dlprefiles; do # Ignore non-libtool-libs dependency_libs= func_resolve_sysroot "$lib" case $lib in *.la) func_source "$func_resolve_sysroot_result" ;; esac # Collect preopened libtool deplibs, except any this library # has declared as weak libs for deplib in $dependency_libs; do func_basename "$deplib" deplib_base=$func_basename_result case " $weak_libs " in *" $deplib_base "*) ;; *) func_append deplibs " $deplib" ;; esac done done libs=$dlprefiles fi if test dlopen = "$pass"; then # Collect dlpreopened libraries save_deplibs=$deplibs deplibs= fi for deplib in $libs; do lib= found=false case $deplib in -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) if test prog,link = "$linkmode,$pass"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append compiler_flags " $deplib" if test lib = "$linkmode"; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi continue ;; -l*) if test lib != "$linkmode" && test prog != "$linkmode"; then func_warning "'-l' is ignored for archives/objects" continue fi func_stripname '-l' '' "$deplib" name=$func_stripname_result if test lib = "$linkmode"; then searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path" else searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path" fi for searchdir in $searchdirs; do for search_ext in .la $std_shrext .so .a; do # Search the libtool library lib=$searchdir/lib$name$search_ext if test -f "$lib"; then if test .la = "$search_ext"; then found=: else found=false fi break 2 fi done done if $found; then # deplib is a libtool library # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, # We need to do some special things here, and not later. if test yes = "$allow_libtool_libs_with_static_runtimes"; then case " $predeps $postdeps " in *" $deplib "*) if func_lalib_p "$lib"; then library_names= old_library= func_source "$lib" for l in $old_library $library_names; do ll=$l done if test "X$ll" = "X$old_library"; then # only static version available found=false func_dirname "$lib" "" "." ladir=$func_dirname_result lib=$ladir/$old_library if test prog,link = "$linkmode,$pass"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs" fi continue fi fi ;; *) ;; esac fi else # deplib doesn't seem to be a libtool library if test prog,link = "$linkmode,$pass"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs" fi continue fi ;; # -l *.ltframework) if test prog,link = "$linkmode,$pass"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" if test lib = "$linkmode"; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi continue ;; -L*) case $linkmode in lib) deplibs="$deplib $deplibs" test conv = "$pass" && continue newdependency_libs="$deplib $newdependency_libs" func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; prog) if test conv = "$pass"; then deplibs="$deplib $deplibs" continue fi if test scan = "$pass"; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; *) func_warning "'-L' is ignored for archives/objects" ;; esac # linkmode continue ;; # -L -R*) if test link = "$pass"; then func_stripname '-R' '' "$deplib" func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result # Make sure the xrpath contains only unique directories. case "$xrpath " in *" $dir "*) ;; *) func_append xrpath " $dir" ;; esac fi deplibs="$deplib $deplibs" continue ;; *.la) func_resolve_sysroot "$deplib" lib=$func_resolve_sysroot_result ;; *.$libext) if test conv = "$pass"; then deplibs="$deplib $deplibs" continue fi case $linkmode in lib) # Linking convenience modules into shared libraries is allowed, # but linking other static libraries is non-portable. case " $dlpreconveniencelibs " in *" $deplib "*) ;; *) valid_a_lib=false case $deplibs_check_method in match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \ | $EGREP "$match_pattern_regex" > /dev/null; then valid_a_lib=: fi ;; pass_all) valid_a_lib=: ;; esac if $valid_a_lib; then echo $ECHO "*** Warning: Linking the shared library $output against the" $ECHO "*** static library $deplib is not portable!" deplibs="$deplib $deplibs" else echo $ECHO "*** Warning: Trying to link with static lib archive $deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because the file extensions .$libext of this argument makes me believe" echo "*** that it is just a static archive that I should not use here." fi ;; esac continue ;; prog) if test link != "$pass"; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi continue ;; esac # linkmode ;; # *.$libext *.lo | *.$objext) if test conv = "$pass"; then deplibs="$deplib $deplibs" elif test prog = "$linkmode"; then if test dlpreopen = "$pass" || test yes != "$dlopen_support" || test no = "$build_libtool_libs"; then # If there is no dlopen support or we're linking statically, # we need to preload. func_append newdlprefiles " $deplib" compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append newdlfiles " $deplib" fi fi continue ;; %DEPLIBS%) alldeplibs=: continue ;; esac # case $deplib $found || test -f "$lib" \ || func_fatal_error "cannot find the library '$lib' or unhandled argument '$deplib'" # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$lib" \ || func_fatal_error "'$lib' is not a valid libtool archive" func_dirname "$lib" "" "." ladir=$func_dirname_result dlname= dlopen= dlpreopen= libdir= library_names= old_library= inherited_linker_flags= # If the library was installed with an old release of libtool, # it will not redefine variables installed, or shouldnotlink installed=yes shouldnotlink=no avoidtemprpath= # Read the .la file func_source "$lib" # Convert "-framework foo" to "foo.ltframework" if test -n "$inherited_linker_flags"; then tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'` for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do case " $new_inherited_linker_flags " in *" $tmp_inherited_linker_flag "*) ;; *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";; esac done fi dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` if test lib,link = "$linkmode,$pass" || test prog,scan = "$linkmode,$pass" || { test prog != "$linkmode" && test lib != "$linkmode"; }; then test -n "$dlopen" && func_append dlfiles " $dlopen" test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen" fi if test conv = "$pass"; then # Only check for convenience libraries deplibs="$lib $deplibs" if test -z "$libdir"; then if test -z "$old_library"; then func_fatal_error "cannot find name of link library for '$lib'" fi # It is a libtool convenience library, so add in its objects. func_append convenience " $ladir/$objdir/$old_library" func_append old_convenience " $ladir/$objdir/$old_library" elif test prog != "$linkmode" && test lib != "$linkmode"; then func_fatal_error "'$lib' is not a convenience library" fi tmp_libs= for deplib in $dependency_libs; do deplibs="$deplib $deplibs" if $opt_preserve_dup_deps; then case "$tmp_libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append tmp_libs " $deplib" done continue fi # $pass = conv # Get the name of the library we link against. linklib= if test -n "$old_library" && { test yes = "$prefer_static_libs" || test built,no = "$prefer_static_libs,$installed"; }; then linklib=$old_library else for l in $old_library $library_names; do linklib=$l done fi if test -z "$linklib"; then func_fatal_error "cannot find name of link library for '$lib'" fi # This library was specified with -dlopen. if test dlopen = "$pass"; then test -z "$libdir" \ && func_fatal_error "cannot -dlopen a convenience library: '$lib'" if test -z "$dlname" || test yes != "$dlopen_support" || test no = "$build_libtool_libs" then # If there is no dlname, no dlopen support or we're linking # statically, we need to preload. We also need to preload any # dependent libraries so libltdl's deplib preloader doesn't # bomb out in the load deplibs phase. func_append dlprefiles " $lib $dependency_libs" else func_append newdlfiles " $lib" fi continue fi # $pass = dlopen # We need an absolute path. case $ladir in [\\/]* | [A-Za-z]:[\\/]*) abs_ladir=$ladir ;; *) abs_ladir=`cd "$ladir" && pwd` if test -z "$abs_ladir"; then func_warning "cannot determine absolute directory name of '$ladir'" func_warning "passing it literally to the linker, although it might fail" abs_ladir=$ladir fi ;; esac func_basename "$lib" laname=$func_basename_result # Find the relevant object directory and library name. if test yes = "$installed"; then if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then func_warning "library '$lib' was moved." dir=$ladir absdir=$abs_ladir libdir=$abs_ladir else dir=$lt_sysroot$libdir absdir=$lt_sysroot$libdir fi test yes = "$hardcode_automatic" && avoidtemprpath=yes else if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then dir=$ladir absdir=$abs_ladir # Remove this search path later func_append notinst_path " $abs_ladir" else dir=$ladir/$objdir absdir=$abs_ladir/$objdir # Remove this search path later func_append notinst_path " $abs_ladir" fi fi # $installed = yes func_stripname 'lib' '.la' "$laname" name=$func_stripname_result # This library was specified with -dlpreopen. if test dlpreopen = "$pass"; then if test -z "$libdir" && test prog = "$linkmode"; then func_fatal_error "only libraries may -dlpreopen a convenience library: '$lib'" fi case $host in # special handling for platforms with PE-DLLs. *cygwin* | *mingw* | *cegcc* ) # Linker will automatically link against shared library if both # static and shared are present. Therefore, ensure we extract # symbols from the import library if a shared library is present # (otherwise, the dlopen module name will be incorrect). We do # this by putting the import library name into $newdlprefiles. # We recover the dlopen module name by 'saving' the la file # name in a special purpose variable, and (later) extracting the # dlname from the la file. if test -n "$dlname"; then func_tr_sh "$dir/$linklib" eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname" func_append newdlprefiles " $dir/$linklib" else func_append newdlprefiles " $dir/$old_library" # Keep a list of preopened convenience libraries to check # that they are being used correctly in the link pass. test -z "$libdir" && \ func_append dlpreconveniencelibs " $dir/$old_library" fi ;; * ) # Prefer using a static library (so that no silly _DYNAMIC symbols # are required to link). if test -n "$old_library"; then func_append newdlprefiles " $dir/$old_library" # Keep a list of preopened convenience libraries to check # that they are being used correctly in the link pass. test -z "$libdir" && \ func_append dlpreconveniencelibs " $dir/$old_library" # Otherwise, use the dlname, so that lt_dlopen finds it. elif test -n "$dlname"; then func_append newdlprefiles " $dir/$dlname" else func_append newdlprefiles " $dir/$linklib" fi ;; esac fi # $pass = dlpreopen if test -z "$libdir"; then # Link the convenience library if test lib = "$linkmode"; then deplibs="$dir/$old_library $deplibs" elif test prog,link = "$linkmode,$pass"; then compile_deplibs="$dir/$old_library $compile_deplibs" finalize_deplibs="$dir/$old_library $finalize_deplibs" else deplibs="$lib $deplibs" # used for prog,scan pass fi continue fi if test prog = "$linkmode" && test link != "$pass"; then func_append newlib_search_path " $ladir" deplibs="$lib $deplibs" linkalldeplibs=false if test no != "$link_all_deplibs" || test -z "$library_names" || test no = "$build_libtool_libs"; then linkalldeplibs=: fi tmp_libs= for deplib in $dependency_libs; do case $deplib in -L*) func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; esac # Need to link against all dependency_libs? if $linkalldeplibs; then deplibs="$deplib $deplibs" else # Need to hardcode shared library paths # or/and link against static libraries newdependency_libs="$deplib $newdependency_libs" fi if $opt_preserve_dup_deps; then case "$tmp_libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append tmp_libs " $deplib" done # for deplib continue fi # $linkmode = prog... if test prog,link = "$linkmode,$pass"; then if test -n "$library_names" && { { test no = "$prefer_static_libs" || test built,yes = "$prefer_static_libs,$installed"; } || test -z "$old_library"; }; then # We need to hardcode the library path if test -n "$shlibpath_var" && test -z "$avoidtemprpath"; then # Make sure the rpath contains only unique directories. case $temp_rpath: in *"$absdir:"*) ;; *) func_append temp_rpath "$absdir:" ;; esac fi # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) func_append compile_rpath " $absdir" ;; esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac ;; esac fi # $linkmode,$pass = prog,link... if $alldeplibs && { test pass_all = "$deplibs_check_method" || { test yes = "$build_libtool_libs" && test -n "$library_names"; }; }; then # We only need to search for static libraries continue fi fi link_static=no # Whether the deplib will be linked statically use_static_libs=$prefer_static_libs if test built = "$use_static_libs" && test yes = "$installed"; then use_static_libs=no fi if test -n "$library_names" && { test no = "$use_static_libs" || test -z "$old_library"; }; then case $host in *cygwin* | *mingw* | *cegcc* | *os2*) # No point in relinking DLLs because paths are not encoded func_append notinst_deplibs " $lib" need_relink=no ;; *) if test no = "$installed"; then func_append notinst_deplibs " $lib" need_relink=yes fi ;; esac # This is a shared library # Warn about portability, can't link against -module's on some # systems (darwin). Don't bleat about dlopened modules though! dlopenmodule= for dlpremoduletest in $dlprefiles; do if test "X$dlpremoduletest" = "X$lib"; then dlopenmodule=$dlpremoduletest break fi done if test -z "$dlopenmodule" && test yes = "$shouldnotlink" && test link = "$pass"; then echo if test prog = "$linkmode"; then $ECHO "*** Warning: Linking the executable $output against the loadable module" else $ECHO "*** Warning: Linking the shared library $output against the loadable module" fi $ECHO "*** $linklib is not portable!" fi if test lib = "$linkmode" && test yes = "$hardcode_into_libs"; then # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) func_append compile_rpath " $absdir" ;; esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac ;; esac fi if test -n "$old_archive_from_expsyms_cmds"; then # figure out the soname set dummy $library_names shift realname=$1 shift libname=`eval "\\$ECHO \"$libname_spec\""` # use dlname if we got it. it's perfectly good, no? if test -n "$dlname"; then soname=$dlname elif test -n "$soname_spec"; then # bleh windows case $host in *cygwin* | mingw* | *cegcc* | *os2*) func_arith $current - $age major=$func_arith_result versuffix=-$major ;; esac eval soname=\"$soname_spec\" else soname=$realname fi # Make a new name for the extract_expsyms_cmds to use soroot=$soname func_basename "$soroot" soname=$func_basename_result func_stripname 'lib' '.dll' "$soname" newlib=libimp-$func_stripname_result.a # If the library has no export list, then create one now if test -f "$output_objdir/$soname-def"; then : else func_verbose "extracting exported symbol list from '$soname'" func_execute_cmds "$extract_expsyms_cmds" 'exit $?' fi # Create $newlib if test -f "$output_objdir/$newlib"; then :; else func_verbose "generating import library for '$soname'" func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?' fi # make sure the library variables are pointing to the new library dir=$output_objdir linklib=$newlib fi # test -n "$old_archive_from_expsyms_cmds" if test prog = "$linkmode" || test relink != "$opt_mode"; then add_shlibpath= add_dir= add= lib_linked=yes case $hardcode_action in immediate | unsupported) if test no = "$hardcode_direct"; then add=$dir/$linklib case $host in *-*-sco3.2v5.0.[024]*) add_dir=-L$dir ;; *-*-sysv4*uw2*) add_dir=-L$dir ;; *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ *-*-unixware7*) add_dir=-L$dir ;; *-*-darwin* ) # if the lib is a (non-dlopened) module then we cannot # link against it, someone is ignoring the earlier warnings if /usr/bin/file -L $add 2> /dev/null | $GREP ": [^:]* bundle" >/dev/null; then if test "X$dlopenmodule" != "X$lib"; then $ECHO "*** Warning: lib $linklib is a module, not a shared library" if test -z "$old_library"; then echo echo "*** And there doesn't seem to be a static archive available" echo "*** The link will probably fail, sorry" else add=$dir/$old_library fi elif test -n "$old_library"; then add=$dir/$old_library fi fi esac elif test no = "$hardcode_minus_L"; then case $host in *-*-sunos*) add_shlibpath=$dir ;; esac add_dir=-L$dir add=-l$name elif test no = "$hardcode_shlibpath_var"; then add_shlibpath=$dir add=-l$name else lib_linked=no fi ;; relink) if test yes = "$hardcode_direct" && test no = "$hardcode_direct_absolute"; then add=$dir/$linklib elif test yes = "$hardcode_minus_L"; then add_dir=-L$absdir # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) func_append add_dir " -L$inst_prefix_dir$libdir" ;; esac fi add=-l$name elif test yes = "$hardcode_shlibpath_var"; then add_shlibpath=$dir add=-l$name else lib_linked=no fi ;; *) lib_linked=no ;; esac if test yes != "$lib_linked"; then func_fatal_configuration "unsupported hardcode properties" fi if test -n "$add_shlibpath"; then case :$compile_shlibpath: in *":$add_shlibpath:"*) ;; *) func_append compile_shlibpath "$add_shlibpath:" ;; esac fi if test prog = "$linkmode"; then test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" test -n "$add" && compile_deplibs="$add $compile_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" if test yes != "$hardcode_direct" && test yes != "$hardcode_minus_L" && test yes = "$hardcode_shlibpath_var"; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac fi fi fi if test prog = "$linkmode" || test relink = "$opt_mode"; then add_shlibpath= add_dir= add= # Finalize command for both is simple: just hardcode it. if test yes = "$hardcode_direct" && test no = "$hardcode_direct_absolute"; then add=$libdir/$linklib elif test yes = "$hardcode_minus_L"; then add_dir=-L$libdir add=-l$name elif test yes = "$hardcode_shlibpath_var"; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac add=-l$name elif test yes = "$hardcode_automatic"; then if test -n "$inst_prefix_dir" && test -f "$inst_prefix_dir$libdir/$linklib"; then add=$inst_prefix_dir$libdir/$linklib else add=$libdir/$linklib fi else # We cannot seem to hardcode it, guess we'll fake it. add_dir=-L$libdir # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) func_append add_dir " -L$inst_prefix_dir$libdir" ;; esac fi add=-l$name fi if test prog = "$linkmode"; then test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" test -n "$add" && finalize_deplibs="$add $finalize_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" fi fi elif test prog = "$linkmode"; then # Here we assume that one of hardcode_direct or hardcode_minus_L # is not unsupported. This is valid on all known static and # shared platforms. if test unsupported != "$hardcode_direct"; then test -n "$old_library" && linklib=$old_library compile_deplibs="$dir/$linklib $compile_deplibs" finalize_deplibs="$dir/$linklib $finalize_deplibs" else compile_deplibs="-l$name -L$dir $compile_deplibs" finalize_deplibs="-l$name -L$dir $finalize_deplibs" fi elif test yes = "$build_libtool_libs"; then # Not a shared library if test pass_all != "$deplibs_check_method"; then # We're trying link a shared library against a static one # but the system doesn't support it. # Just print a warning and add the library to dependency_libs so # that the program can be linked against the static library. echo $ECHO "*** Warning: This system cannot link to static lib archive $lib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have." if test yes = "$module"; then echo "*** But as you try to build a module library, libtool will still create " echo "*** a static module, that should work as long as the dlopening application" echo "*** is linked with the -dlopen flag to resolve symbols at runtime." if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" echo "*** lists from a program, using 'nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." echo "*** 'nm' from GNU binutils and a full rebuild may help." fi if test no = "$build_old_libs"; then build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi else deplibs="$dir/$old_library $deplibs" link_static=yes fi fi # link shared/static library? if test lib = "$linkmode"; then if test -n "$dependency_libs" && { test yes != "$hardcode_into_libs" || test yes = "$build_old_libs" || test yes = "$link_static"; }; then # Extract -R from dependency_libs temp_deplibs= for libdir in $dependency_libs; do case $libdir in -R*) func_stripname '-R' '' "$libdir" temp_xrpath=$func_stripname_result case " $xrpath " in *" $temp_xrpath "*) ;; *) func_append xrpath " $temp_xrpath";; esac;; *) func_append temp_deplibs " $libdir";; esac done dependency_libs=$temp_deplibs fi func_append newlib_search_path " $absdir" # Link against this library test no = "$link_static" && newdependency_libs="$abs_ladir/$laname $newdependency_libs" # ... and its dependency_libs tmp_libs= for deplib in $dependency_libs; do newdependency_libs="$deplib $newdependency_libs" case $deplib in -L*) func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result";; *) func_resolve_sysroot "$deplib" ;; esac if $opt_preserve_dup_deps; then case "$tmp_libs " in *" $func_resolve_sysroot_result "*) func_append specialdeplibs " $func_resolve_sysroot_result" ;; esac fi func_append tmp_libs " $func_resolve_sysroot_result" done if test no != "$link_all_deplibs"; then # Add the search paths of all dependency libraries for deplib in $dependency_libs; do path= case $deplib in -L*) path=$deplib ;; *.la) func_resolve_sysroot "$deplib" deplib=$func_resolve_sysroot_result func_dirname "$deplib" "" "." dir=$func_dirname_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) absdir=$dir ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then func_warning "cannot determine absolute directory name of '$dir'" absdir=$dir fi ;; esac if $GREP "^installed=no" $deplib > /dev/null; then case $host in *-*-darwin*) depdepl= eval deplibrary_names=`$SED -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` if test -n "$deplibrary_names"; then for tmp in $deplibrary_names; do depdepl=$tmp done if test -f "$absdir/$objdir/$depdepl"; then depdepl=$absdir/$objdir/$depdepl darwin_install_name=`$OTOOL -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` if test -z "$darwin_install_name"; then darwin_install_name=`$OTOOL64 -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` fi func_append compiler_flags " $wl-dylib_file $wl$darwin_install_name:$depdepl" func_append linker_flags " -dylib_file $darwin_install_name:$depdepl" path= fi fi ;; *) path=-L$absdir/$objdir ;; esac else eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` test -z "$libdir" && \ func_fatal_error "'$deplib' is not a valid libtool archive" test "$absdir" != "$libdir" && \ func_warning "'$deplib' seems to be moved" path=-L$absdir fi ;; esac case " $deplibs " in *" $path "*) ;; *) deplibs="$path $deplibs" ;; esac done fi # link_all_deplibs != no fi # linkmode = lib done # for deplib in $libs if test link = "$pass"; then if test prog = "$linkmode"; then compile_deplibs="$new_inherited_linker_flags $compile_deplibs" finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs" else compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` fi fi dependency_libs=$newdependency_libs if test dlpreopen = "$pass"; then # Link the dlpreopened libraries before other libraries for deplib in $save_deplibs; do deplibs="$deplib $deplibs" done fi if test dlopen != "$pass"; then test conv = "$pass" || { # Make sure lib_search_path contains only unique directories. lib_search_path= for dir in $newlib_search_path; do case "$lib_search_path " in *" $dir "*) ;; *) func_append lib_search_path " $dir" ;; esac done newlib_search_path= } if test prog,link = "$linkmode,$pass"; then vars="compile_deplibs finalize_deplibs" else vars=deplibs fi for var in $vars dependency_libs; do # Add libraries to $var in reverse order eval tmp_libs=\"\$$var\" new_libs= for deplib in $tmp_libs; do # FIXME: Pedantically, this is the right thing to do, so # that some nasty dependency loop isn't accidentally # broken: #new_libs="$deplib $new_libs" # Pragmatically, this seems to cause very few problems in # practice: case $deplib in -L*) new_libs="$deplib $new_libs" ;; -R*) ;; *) # And here is the reason: when a library appears more # than once as an explicit dependence of a library, or # is implicitly linked in more than once by the # compiler, it is considered special, and multiple # occurrences thereof are not removed. Compare this # with having the same library being listed as a # dependency of multiple other libraries: in this case, # we know (pedantically, we assume) the library does not # need to be listed more than once, so we keep only the # last copy. This is not always right, but it is rare # enough that we require users that really mean to play # such unportable linking tricks to link the library # using -Wl,-lname, so that libtool does not consider it # for duplicate removal. case " $specialdeplibs " in *" $deplib "*) new_libs="$deplib $new_libs" ;; *) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$deplib $new_libs" ;; esac ;; esac ;; esac done tmp_libs= for deplib in $new_libs; do case $deplib in -L*) case " $tmp_libs " in *" $deplib "*) ;; *) func_append tmp_libs " $deplib" ;; esac ;; *) func_append tmp_libs " $deplib" ;; esac done eval $var=\"$tmp_libs\" done # for var fi # Add Sun CC postdeps if required: test CXX = "$tagname" && { case $host_os in linux*) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 func_suncc_cstd_abi if test no != "$suncc_use_cstd_abi"; then func_append postdeps ' -library=Cstd -library=Crun' fi ;; esac ;; solaris*) func_cc_basename "$CC" case $func_cc_basename_result in CC* | sunCC*) func_suncc_cstd_abi if test no != "$suncc_use_cstd_abi"; then func_append postdeps ' -library=Cstd -library=Crun' fi ;; esac ;; esac } # Last step: remove runtime libs from dependency_libs # (they stay in deplibs) tmp_libs= for i in $dependency_libs; do case " $predeps $postdeps $compiler_lib_search_path " in *" $i "*) i= ;; esac if test -n "$i"; then func_append tmp_libs " $i" fi done dependency_libs=$tmp_libs done # for pass if test prog = "$linkmode"; then dlfiles=$newdlfiles fi if test prog = "$linkmode" || test lib = "$linkmode"; then dlprefiles=$newdlprefiles fi case $linkmode in oldlib) if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then func_warning "'-dlopen' is ignored for archives" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "'-l' and '-L' are ignored for archives" ;; esac test -n "$rpath" && \ func_warning "'-rpath' is ignored for archives" test -n "$xrpath" && \ func_warning "'-R' is ignored for archives" test -n "$vinfo" && \ func_warning "'-version-info/-version-number' is ignored for archives" test -n "$release" && \ func_warning "'-release' is ignored for archives" test -n "$export_symbols$export_symbols_regex" && \ func_warning "'-export-symbols' is ignored for archives" # Now set the variables for building old libraries. build_libtool_libs=no oldlibs=$output func_append objs "$old_deplibs" ;; lib) # Make sure we only generate libraries of the form 'libNAME.la'. case $outputname in lib*) func_stripname 'lib' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" ;; *) test no = "$module" \ && func_fatal_help "libtool library '$output' must begin with 'lib'" if test no != "$need_lib_prefix"; then # Add the "lib" prefix for modules if required func_stripname '' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" else func_stripname '' '.la' "$outputname" libname=$func_stripname_result fi ;; esac if test -n "$objs"; then if test pass_all != "$deplibs_check_method"; then func_fatal_error "cannot build libtool library '$output' from non-libtool objects on this host:$objs" else echo $ECHO "*** Warning: Linking the shared library $output against the non-libtool" $ECHO "*** objects $objs is not portable!" func_append libobjs " $objs" fi fi test no = "$dlself" \ || func_warning "'-dlopen self' is ignored for libtool libraries" set dummy $rpath shift test 1 -lt "$#" \ && func_warning "ignoring multiple '-rpath's for a libtool library" install_libdir=$1 oldlibs= if test -z "$rpath"; then if test yes = "$build_libtool_libs"; then # Building a libtool convenience library. # Some compilers have problems with a '.al' extension so # convenience libraries should have the same extension an # archive normally would. oldlibs="$output_objdir/$libname.$libext $oldlibs" build_libtool_libs=convenience build_old_libs=yes fi test -n "$vinfo" && \ func_warning "'-version-info/-version-number' is ignored for convenience libraries" test -n "$release" && \ func_warning "'-release' is ignored for convenience libraries" else # Parse the version information argument. save_ifs=$IFS; IFS=: set dummy $vinfo 0 0 0 shift IFS=$save_ifs test -n "$7" && \ func_fatal_help "too many parameters to '-version-info'" # convert absolute version numbers to libtool ages # this retains compatibility with .la files and attempts # to make the code below a bit more comprehensible case $vinfo_number in yes) number_major=$1 number_minor=$2 number_revision=$3 # # There are really only two kinds -- those that # use the current revision as the major version # and those that subtract age and use age as # a minor version. But, then there is irix # that has an extra 1 added just for fun # case $version_type in # correct linux to gnu/linux during the next big refactor darwin|freebsd-elf|linux|osf|windows|none) func_arith $number_major + $number_minor current=$func_arith_result age=$number_minor revision=$number_revision ;; freebsd-aout|qnx|sunos) current=$number_major revision=$number_minor age=0 ;; irix|nonstopux) func_arith $number_major + $number_minor current=$func_arith_result age=$number_minor revision=$number_minor lt_irix_increment=no ;; esac ;; no) current=$1 revision=$2 age=$3 ;; esac # Check that each of the things are valid numbers. case $current in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "CURRENT '$current' must be a nonnegative integer" func_fatal_error "'$vinfo' is not valid version information" ;; esac case $revision in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "REVISION '$revision' must be a nonnegative integer" func_fatal_error "'$vinfo' is not valid version information" ;; esac case $age in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "AGE '$age' must be a nonnegative integer" func_fatal_error "'$vinfo' is not valid version information" ;; esac if test "$age" -gt "$current"; then func_error "AGE '$age' is greater than the current interface number '$current'" func_fatal_error "'$vinfo' is not valid version information" fi # Calculate the version variables. major= versuffix= verstring= case $version_type in none) ;; darwin) # Like Linux, but with the current version available in # verstring for coding it into the library header func_arith $current - $age major=.$func_arith_result versuffix=$major.$age.$revision # Darwin ld doesn't like 0 for these options... func_arith $current + 1 minor_current=$func_arith_result xlcverstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision" verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" # On Darwin other compilers case $CC in nagfor*) verstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision" ;; *) verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" ;; esac ;; freebsd-aout) major=.$current versuffix=.$current.$revision ;; freebsd-elf) func_arith $current - $age major=.$func_arith_result versuffix=$major.$age.$revision ;; irix | nonstopux) if test no = "$lt_irix_increment"; then func_arith $current - $age else func_arith $current - $age + 1 fi major=$func_arith_result case $version_type in nonstopux) verstring_prefix=nonstopux ;; *) verstring_prefix=sgi ;; esac verstring=$verstring_prefix$major.$revision # Add in all the interfaces that we are compatible with. loop=$revision while test 0 -ne "$loop"; do func_arith $revision - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring=$verstring_prefix$major.$iface:$verstring done # Before this point, $major must not contain '.'. major=.$major versuffix=$major.$revision ;; linux) # correct to gnu/linux during the next big refactor func_arith $current - $age major=.$func_arith_result versuffix=$major.$age.$revision ;; osf) func_arith $current - $age major=.$func_arith_result versuffix=.$current.$age.$revision verstring=$current.$age.$revision # Add in all the interfaces that we are compatible with. loop=$age while test 0 -ne "$loop"; do func_arith $current - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring=$verstring:$iface.0 done # Make executables depend on our current version. func_append verstring ":$current.0" ;; qnx) major=.$current versuffix=.$current ;; sco) major=.$current versuffix=.$current ;; sunos) major=.$current versuffix=.$current.$revision ;; windows) # Use '-' rather than '.', since we only want one # extension on DOS 8.3 file systems. func_arith $current - $age major=$func_arith_result versuffix=-$major ;; *) func_fatal_configuration "unknown library version type '$version_type'" ;; esac # Clear the version info if we defaulted, and they specified a release. if test -z "$vinfo" && test -n "$release"; then major= case $version_type in darwin) # we can't check for "0.0" in archive_cmds due to quoting # problems, so we reset it completely verstring= ;; *) verstring=0.0 ;; esac if test no = "$need_version"; then versuffix= else versuffix=.0.0 fi fi # Remove version info from name if versioning should be avoided if test yes,no = "$avoid_version,$need_version"; then major= versuffix= verstring= fi # Check to see if the archive will have undefined symbols. if test yes = "$allow_undefined"; then if test unsupported = "$allow_undefined_flag"; then if test yes = "$build_old_libs"; then func_warning "undefined symbols not allowed in $host shared libraries; building static only" build_libtool_libs=no else func_fatal_error "can't build $host shared library unless -no-undefined is specified" fi fi else # Don't allow undefined symbols. allow_undefined_flag=$no_undefined_flag fi fi func_generate_dlsyms "$libname" "$libname" : func_append libobjs " $symfileobj" test " " = "$libobjs" && libobjs= if test relink != "$opt_mode"; then # Remove our outputs, but don't remove object files since they # may have been created when compiling PIC objects. removelist= tempremovelist=`$ECHO "$output_objdir/*"` for p in $tempremovelist; do case $p in *.$objext | *.gcno) ;; $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/$libname$release.*) if test -n "$precious_files_regex"; then if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 then continue fi fi func_append removelist " $p" ;; *) ;; esac done test -n "$removelist" && \ func_show_eval "${RM}r \$removelist" fi # Now set the variables for building old libraries. if test yes = "$build_old_libs" && test convenience != "$build_libtool_libs"; then func_append oldlibs " $output_objdir/$libname.$libext" # Transform .lo files to .o files. oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; $lo2o" | $NL2SP` fi # Eliminate all temporary directories. #for path in $notinst_path; do # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"` # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"` # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"` #done if test -n "$xrpath"; then # If the user specified any rpath flags, then add them. temp_xrpath= for libdir in $xrpath; do func_replace_sysroot "$libdir" func_append temp_xrpath " -R$func_replace_sysroot_result" case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac done if test yes != "$hardcode_into_libs" || test yes = "$build_old_libs"; then dependency_libs="$temp_xrpath $dependency_libs" fi fi # Make sure dlfiles contains only unique files that won't be dlpreopened old_dlfiles=$dlfiles dlfiles= for lib in $old_dlfiles; do case " $dlprefiles $dlfiles " in *" $lib "*) ;; *) func_append dlfiles " $lib" ;; esac done # Make sure dlprefiles contains only unique files old_dlprefiles=$dlprefiles dlprefiles= for lib in $old_dlprefiles; do case "$dlprefiles " in *" $lib "*) ;; *) func_append dlprefiles " $lib" ;; esac done if test yes = "$build_libtool_libs"; then if test -n "$rpath"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*) # these systems don't actually have a c library (as such)! ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C library is in the System framework func_append deplibs " System.ltframework" ;; *-*-netbsd*) # Don't link with libc until the a.out ld.so is fixed. ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work ;; *) # Add libc to deplibs on all other systems if necessary. if test yes = "$build_libtool_need_lc"; then func_append deplibs " -lc" fi ;; esac fi # Transform deplibs into only deplibs that can be linked in shared. name_save=$name libname_save=$libname release_save=$release versuffix_save=$versuffix major_save=$major # I'm not sure if I'm treating the release correctly. I think # release should show up in the -l (ie -lgmp5) so we don't want to # add it in twice. Is that correct? release= versuffix= major= newdeplibs= droppeddeps=no case $deplibs_check_method in pass_all) # Don't check for shared/static. Everything works. # This might be a little naive. We might want to check # whether the library exists or not. But this is on # osf3 & osf4 and I'm not really sure... Just # implementing what was already the behavior. newdeplibs=$deplibs ;; test_compile) # This code stresses the "libraries are programs" paradigm to its # limits. Maybe even breaks it. We compile a program, linking it # against the deplibs as a proxy for the library. Then we can check # whether they linked in statically or dynamically with ldd. $opt_dry_run || $RM conftest.c cat > conftest.c </dev/null` $nocaseglob else potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` fi for potent_lib in $potential_libs; do # Follow soft links. if ls -lLd "$potent_lib" 2>/dev/null | $GREP " -> " >/dev/null; then continue fi # The statement above tries to avoid entering an # endless loop below, in case of cyclic links. # We might still enter an endless loop, since a link # loop can be closed while we follow links, # but so what? potlib=$potent_lib while test -h "$potlib" 2>/dev/null; do potliblink=`ls -ld $potlib | $SED 's/.* -> //'` case $potliblink in [\\/]* | [A-Za-z]:[\\/]*) potlib=$potliblink;; *) potlib=`$ECHO "$potlib" | $SED 's|[^/]*$||'`"$potliblink";; esac done if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | $SED -e 10q | $EGREP "$file_magic_regex" > /dev/null; then func_append newdeplibs " $a_deplib" a_deplib= break 2 fi done done fi if test -n "$a_deplib"; then droppeddeps=yes echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib"; then $ECHO "*** with $libname but no candidates were found. (...for file magic test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a file magic. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. ;; match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` for a_deplib in $deplibs; do case $a_deplib in -l*) func_stripname -l '' "$a_deplib" name=$func_stripname_result if test yes = "$allow_libtool_libs_with_static_runtimes"; then case " $predeps $postdeps " in *" $a_deplib "*) func_append newdeplibs " $a_deplib" a_deplib= ;; esac fi if test -n "$a_deplib"; then libname=`eval "\\$ECHO \"$libname_spec\""` for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do potential_libs=`ls $i/$libname[.-]* 2>/dev/null` for potent_lib in $potential_libs; do potlib=$potent_lib # see symlink-check above in file_magic test if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \ $EGREP "$match_pattern_regex" > /dev/null; then func_append newdeplibs " $a_deplib" a_deplib= break 2 fi done done fi if test -n "$a_deplib"; then droppeddeps=yes echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib"; then $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a regex pattern. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. ;; none | unknown | *) newdeplibs= tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'` if test yes = "$allow_libtool_libs_with_static_runtimes"; then for i in $predeps $postdeps; do # can't use Xsed below, because $i might contain '/' tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s|$i||"` done fi case $tmp_deplibs in *[!\ \ ]*) echo if test none = "$deplibs_check_method"; then echo "*** Warning: inter-library dependencies are not supported in this platform." else echo "*** Warning: inter-library dependencies are not known to be supported." fi echo "*** All declared inter-library dependencies are being dropped." droppeddeps=yes ;; esac ;; esac versuffix=$versuffix_save major=$major_save release=$release_save libname=$libname_save name=$name_save case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library with the System framework newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'` ;; esac if test yes = "$droppeddeps"; then if test yes = "$module"; then echo echo "*** Warning: libtool could not satisfy all declared inter-library" $ECHO "*** dependencies of module $libname. Therefore, libtool will create" echo "*** a static module, that should work as long as the dlopening" echo "*** application is linked with the -dlopen flag." if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" echo "*** lists from a program, using 'nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." echo "*** 'nm' from GNU binutils and a full rebuild may help." fi if test no = "$build_old_libs"; then oldlibs=$output_objdir/$libname.$libext build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi else echo "*** The inter-library dependencies that have been dropped here will be" echo "*** automatically added whenever a program is linked with this library" echo "*** or is declared to -dlopen it." if test no = "$allow_undefined"; then echo echo "*** Since this library must not contain undefined symbols," echo "*** because either the platform does not support them or" echo "*** it was explicitly requested with -no-undefined," echo "*** libtool will only create a static version of it." if test no = "$build_old_libs"; then oldlibs=$output_objdir/$libname.$libext build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi fi fi # Done checking deplibs! deplibs=$newdeplibs fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" case $host in *-*-darwin*) newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $deplibs " in *" -L$path/$objdir "*) func_append new_libs " -L$path/$objdir" ;; esac ;; esac done for deplib in $deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) func_append new_libs " $deplib" ;; esac ;; *) func_append new_libs " $deplib" ;; esac done deplibs=$new_libs # All the library-specific variables (install_libdir is set above). library_names= old_library= dlname= # Test again, we may have decided not to build it any more if test yes = "$build_libtool_libs"; then # Remove $wl instances when linking with ld. # FIXME: should test the right _cmds variable. case $archive_cmds in *\$LD\ *) wl= ;; esac if test yes = "$hardcode_into_libs"; then # Hardcode the library paths hardcode_libdirs= dep_rpath= rpath=$finalize_rpath test relink = "$opt_mode" || rpath=$compile_rpath$rpath for libdir in $rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then func_replace_sysroot "$libdir" libdir=$func_replace_sysroot_result if test -z "$hardcode_libdirs"; then hardcode_libdirs=$libdir else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append dep_rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) func_append perm_rpath " $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir=$hardcode_libdirs eval "dep_rpath=\"$hardcode_libdir_flag_spec\"" fi if test -n "$runpath_var" && test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do func_append rpath "$dir:" done eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" fi test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" fi shlibpath=$finalize_shlibpath test relink = "$opt_mode" || shlibpath=$compile_shlibpath$shlibpath if test -n "$shlibpath"; then eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" fi # Get the real and link names of the library. eval shared_ext=\"$shrext_cmds\" eval library_names=\"$library_names_spec\" set dummy $library_names shift realname=$1 shift if test -n "$soname_spec"; then eval soname=\"$soname_spec\" else soname=$realname fi if test -z "$dlname"; then dlname=$soname fi lib=$output_objdir/$realname linknames= for link do func_append linknames " $link" done # Use standard objects if they are pic test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP` test "X$libobjs" = "X " && libobjs= delfiles= if test -n "$export_symbols" && test -n "$include_expsyms"; then $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp" export_symbols=$output_objdir/$libname.uexp func_append delfiles " $export_symbols" fi orig_export_symbols= case $host_os in cygwin* | mingw* | cegcc*) if test -n "$export_symbols" && test -z "$export_symbols_regex"; then # exporting using user supplied symfile func_dll_def_p "$export_symbols" || { # and it's NOT already a .def file. Must figure out # which of the given symbols are data symbols and tag # them as such. So, trigger use of export_symbols_cmds. # export_symbols gets reassigned inside the "prepare # the list of exported symbols" if statement, so the # include_expsyms logic still works. orig_export_symbols=$export_symbols export_symbols= always_export_symbols=yes } fi ;; esac # Prepare the list of exported symbols if test -z "$export_symbols"; then if test yes = "$always_export_symbols" || test -n "$export_symbols_regex"; then func_verbose "generating symbol list for '$libname.la'" export_symbols=$output_objdir/$libname.exp $opt_dry_run || $RM $export_symbols cmds=$export_symbols_cmds save_ifs=$IFS; IFS='~' for cmd1 in $cmds; do IFS=$save_ifs # Take the normal branch if the nm_file_list_spec branch # doesn't work or if tool conversion is not needed. case $nm_file_list_spec~$to_tool_file_cmd in *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*) try_normal_branch=yes eval cmd=\"$cmd1\" func_len " $cmd" len=$func_len_result ;; *) try_normal_branch=no ;; esac if test yes = "$try_normal_branch" \ && { test "$len" -lt "$max_cmd_len" \ || test "$max_cmd_len" -le -1; } then func_show_eval "$cmd" 'exit $?' skipped_export=false elif test -n "$nm_file_list_spec"; then func_basename "$output" output_la=$func_basename_result save_libobjs=$libobjs save_output=$output output=$output_objdir/$output_la.nm func_to_tool_file "$output" libobjs=$nm_file_list_spec$func_to_tool_file_result func_append delfiles " $output" func_verbose "creating $NM input file list: $output" for obj in $save_libobjs; do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" done > "$output" eval cmd=\"$cmd1\" func_show_eval "$cmd" 'exit $?' output=$save_output libobjs=$save_libobjs skipped_export=false else # The command line is too long to execute in one step. func_verbose "using reloadable object file for export list..." skipped_export=: # Break out early, otherwise skipped_export may be # set to false by a later but shorter cmd. break fi done IFS=$save_ifs if test -n "$export_symbols_regex" && test : != "$skipped_export"; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi fi if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols=$export_symbols test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test : != "$skipped_export" && test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for '$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands, which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter func_append delfiles " $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi tmp_deplibs= for test_deplib in $deplibs; do case " $convenience " in *" $test_deplib "*) ;; *) func_append tmp_deplibs " $test_deplib" ;; esac done deplibs=$tmp_deplibs if test -n "$convenience"; then if test -n "$whole_archive_flag_spec" && test yes = "$compiler_needs_object" && test -z "$libobjs"; then # extract the archives, so we have objects to list. # TODO: could optimize this to just extract one archive. whole_archive_flag_spec= fi if test -n "$whole_archive_flag_spec"; then save_libobjs=$libobjs eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= else gentop=$output_objdir/${outputname}x func_append generated " $gentop" func_extract_archives $gentop $convenience func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi fi if test yes = "$thread_safe" && test -n "$thread_safe_flag_spec"; then eval flag=\"$thread_safe_flag_spec\" func_append linker_flags " $flag" fi # Make a backup of the uninstalled library when relinking if test relink = "$opt_mode"; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $? fi # Do each of the archive commands. if test yes = "$module" && test -n "$module_cmds"; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then eval test_cmds=\"$module_expsym_cmds\" cmds=$module_expsym_cmds else eval test_cmds=\"$module_cmds\" cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then eval test_cmds=\"$archive_expsym_cmds\" cmds=$archive_expsym_cmds else eval test_cmds=\"$archive_cmds\" cmds=$archive_cmds fi fi if test : != "$skipped_export" && func_len " $test_cmds" && len=$func_len_result && test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then : else # The command line is too long to link in one step, link piecewise # or, if using GNU ld and skipped_export is not :, use a linker # script. # Save the value of $output and $libobjs because we want to # use them later. If we have whole_archive_flag_spec, we # want to use save_libobjs as it was before # whole_archive_flag_spec was expanded, because we can't # assume the linker understands whole_archive_flag_spec. # This may have to be revisited, in case too many # convenience libraries get linked in and end up exceeding # the spec. if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then save_libobjs=$libobjs fi save_output=$output func_basename "$output" output_la=$func_basename_result # Clear the reloadable object creation command queue and # initialize k to one. test_cmds= concat_cmds= objlist= last_robj= k=1 if test -n "$save_libobjs" && test : != "$skipped_export" && test yes = "$with_gnu_ld"; then output=$output_objdir/$output_la.lnkscript func_verbose "creating GNU ld script: $output" echo 'INPUT (' > $output for obj in $save_libobjs do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" >> $output done echo ')' >> $output func_append delfiles " $output" func_to_tool_file "$output" output=$func_to_tool_file_result elif test -n "$save_libobjs" && test : != "$skipped_export" && test -n "$file_list_spec"; then output=$output_objdir/$output_la.lnk func_verbose "creating linker input file list: $output" : > $output set x $save_libobjs shift firstobj= if test yes = "$compiler_needs_object"; then firstobj="$1 " shift fi for obj do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" >> $output done func_append delfiles " $output" func_to_tool_file "$output" output=$firstobj\"$file_list_spec$func_to_tool_file_result\" else if test -n "$save_libobjs"; then func_verbose "creating reloadable object files..." output=$output_objdir/$output_la-$k.$objext eval test_cmds=\"$reload_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 # Loop over the list of objects to be linked. for obj in $save_libobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result if test -z "$objlist" || test "$len" -lt "$max_cmd_len"; then func_append objlist " $obj" else # The command $test_cmds is almost too long, add a # command to the queue. if test 1 -eq "$k"; then # The first file doesn't have a previous command to add. reload_objs=$objlist eval concat_cmds=\"$reload_cmds\" else # All subsequent reloadable object files will link in # the last one created. reload_objs="$objlist $last_robj" eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\" fi last_robj=$output_objdir/$output_la-$k.$objext func_arith $k + 1 k=$func_arith_result output=$output_objdir/$output_la-$k.$objext objlist=" $obj" func_len " $last_robj" func_arith $len0 + $func_len_result len=$func_arith_result fi done # Handle the remaining objects by creating one last # reloadable object file. All subsequent reloadable object # files will link in the last one created. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ reload_objs="$objlist $last_robj" eval concat_cmds=\"\$concat_cmds$reload_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" fi func_append delfiles " $output" else output= fi ${skipped_export-false} && { func_verbose "generating symbol list for '$libname.la'" export_symbols=$output_objdir/$libname.exp $opt_dry_run || $RM $export_symbols libobjs=$output # Append the command to create the export file. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" fi } test -n "$save_libobjs" && func_verbose "creating a temporary reloadable object file: $output" # Loop through the commands generated above and execute them. save_ifs=$IFS; IFS='~' for cmd in $concat_cmds; do IFS=$save_ifs $opt_quiet || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test relink = "$opt_mode"; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS=$save_ifs if test -n "$export_symbols_regex" && ${skipped_export-false}; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi ${skipped_export-false} && { if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols=$export_symbols test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for '$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands, which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter func_append delfiles " $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi } libobjs=$output # Restore the value of output. output=$save_output if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= fi # Expand the library linking commands again to reset the # value of $libobjs for piecewise linking. # Do each of the archive commands. if test yes = "$module" && test -n "$module_cmds"; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then cmds=$module_expsym_cmds else cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then cmds=$archive_expsym_cmds else cmds=$archive_cmds fi fi fi if test -n "$delfiles"; then # Append the command to remove temporary files to $cmds. eval cmds=\"\$cmds~\$RM $delfiles\" fi # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop=$output_objdir/${outputname}x func_append generated " $gentop" func_extract_archives $gentop $dlprefiles func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi save_ifs=$IFS; IFS='~' for cmd in $cmds; do IFS=$sp$nl eval cmd=\"$cmd\" IFS=$save_ifs $opt_quiet || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test relink = "$opt_mode"; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS=$save_ifs # Restore the uninstalled library and exit if test relink = "$opt_mode"; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $? if test -n "$convenience"; then if test -z "$whole_archive_flag_spec"; then func_show_eval '${RM}r "$gentop"' fi fi exit $EXIT_SUCCESS fi # Create links to the real library. for linkname in $linknames; do if test "$realname" != "$linkname"; then func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?' fi done # If -module or -export-dynamic was specified, set the dlname. if test yes = "$module" || test yes = "$export_dynamic"; then # On all known operating systems, these are identical. dlname=$soname fi fi ;; obj) if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then func_warning "'-dlopen' is ignored for objects" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "'-l' and '-L' are ignored for objects" ;; esac test -n "$rpath" && \ func_warning "'-rpath' is ignored for objects" test -n "$xrpath" && \ func_warning "'-R' is ignored for objects" test -n "$vinfo" && \ func_warning "'-version-info' is ignored for objects" test -n "$release" && \ func_warning "'-release' is ignored for objects" case $output in *.lo) test -n "$objs$old_deplibs" && \ func_fatal_error "cannot build library object '$output' from non-libtool objects" libobj=$output func_lo2o "$libobj" obj=$func_lo2o_result ;; *) libobj= obj=$output ;; esac # Delete the old objects. $opt_dry_run || $RM $obj $libobj # Objects from convenience libraries. This assumes # single-version convenience libraries. Whenever we create # different ones for PIC/non-PIC, this we'll have to duplicate # the extraction. reload_conv_objs= gentop= # if reload_cmds runs $LD directly, get rid of -Wl from # whole_archive_flag_spec and hope we can get by with turning comma # into space. case $reload_cmds in *\$LD[\ \$]*) wl= ;; esac if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" test -n "$wl" || tmp_whole_archive_flags=`$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'` reload_conv_objs=$reload_objs\ $tmp_whole_archive_flags else gentop=$output_objdir/${obj}x func_append generated " $gentop" func_extract_archives $gentop $convenience reload_conv_objs="$reload_objs $func_extract_archives_result" fi fi # If we're not building shared, we need to use non_pic_objs test yes = "$build_libtool_libs" || libobjs=$non_pic_objects # Create the old-style object. reload_objs=$objs$old_deplibs' '`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; /\.lib$/d; $lo2o" | $NL2SP`' '$reload_conv_objs output=$obj func_execute_cmds "$reload_cmds" 'exit $?' # Exit if we aren't doing a library object file. if test -z "$libobj"; then if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS fi test yes = "$build_libtool_libs" || { if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi # Create an invalid libtool object if no PIC, so that we don't # accidentally link it into a program. # $show "echo timestamp > $libobj" # $opt_dry_run || eval "echo timestamp > $libobj" || exit $? exit $EXIT_SUCCESS } if test -n "$pic_flag" || test default != "$pic_mode"; then # Only do commands if we really have different PIC objects. reload_objs="$libobjs $reload_conv_objs" output=$libobj func_execute_cmds "$reload_cmds" 'exit $?' fi if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS ;; prog) case $host in *cygwin*) func_stripname '' '.exe' "$output" output=$func_stripname_result.exe;; esac test -n "$vinfo" && \ func_warning "'-version-info' is ignored for programs" test -n "$release" && \ func_warning "'-release' is ignored for programs" $preload \ && test unknown,unknown,unknown = "$dlopen_support,$dlopen_self,$dlopen_self_static" \ && func_warning "'LT_INIT([dlopen])' not used. Assuming no dlopen support." case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'` finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'` ;; esac case $host in *-*-darwin*) # Don't allow lazy linking, it breaks C++ global constructors # But is supposedly fixed on 10.4 or later (yay!). if test CXX = "$tagname"; then case ${MACOSX_DEPLOYMENT_TARGET-10.0} in 10.[0123]) func_append compile_command " $wl-bind_at_load" func_append finalize_command " $wl-bind_at_load" ;; esac fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $compile_deplibs " in *" -L$path/$objdir "*) func_append new_libs " -L$path/$objdir" ;; esac ;; esac done for deplib in $compile_deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) func_append new_libs " $deplib" ;; esac ;; *) func_append new_libs " $deplib" ;; esac done compile_deplibs=$new_libs func_append compile_command " $compile_deplibs" func_append finalize_command " $finalize_deplibs" if test -n "$rpath$xrpath"; then # If the user specified any rpath flags, then add them. for libdir in $rpath $xrpath; do # This is the magic to use -rpath. case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac done fi # Now hardcode the library paths rpath= hardcode_libdirs= for libdir in $compile_rpath $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs=$libdir else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) func_append perm_rpath " $libdir" ;; esac fi case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`$ECHO "$libdir" | $SED -e 's*/lib$*/bin*'` case :$dllsearchpath: in *":$libdir:"*) ;; ::) dllsearchpath=$libdir;; *) func_append dllsearchpath ":$libdir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append dllsearchpath ":$testbindir";; esac ;; esac done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir=$hardcode_libdirs eval rpath=\" $hardcode_libdir_flag_spec\" fi compile_rpath=$rpath rpath= hardcode_libdirs= for libdir in $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs=$libdir else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$finalize_perm_rpath " in *" $libdir "*) ;; *) func_append finalize_perm_rpath " $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir=$hardcode_libdirs eval rpath=\" $hardcode_libdir_flag_spec\" fi finalize_rpath=$rpath if test -n "$libobjs" && test yes = "$build_old_libs"; then # Transform all the library objects into standard objects. compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP` finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP` fi func_generate_dlsyms "$outputname" "@PROGRAM@" false # template prelinking step if test -n "$prelink_cmds"; then func_execute_cmds "$prelink_cmds" 'exit $?' fi wrappers_required=: case $host in *cegcc* | *mingw32ce*) # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway. wrappers_required=false ;; *cygwin* | *mingw* ) test yes = "$build_libtool_libs" || wrappers_required=false ;; *) if test no = "$need_relink" || test yes != "$build_libtool_libs"; then wrappers_required=false fi ;; esac $wrappers_required || { # Replace the output file specification. compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'` link_command=$compile_command$compile_rpath # We have no uninstalled library dependencies, so finalize right now. exit_status=0 func_show_eval "$link_command" 'exit_status=$?' if test -n "$postlink_cmds"; then func_to_tool_file "$output" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi # Delete the generated files. if test -f "$output_objdir/${outputname}S.$objext"; then func_show_eval '$RM "$output_objdir/${outputname}S.$objext"' fi exit $exit_status } if test -n "$compile_shlibpath$finalize_shlibpath"; then compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" fi if test -n "$finalize_shlibpath"; then finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" fi compile_var= finalize_var= if test -n "$runpath_var"; then if test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do func_append rpath "$dir:" done compile_var="$runpath_var=\"$rpath\$$runpath_var\" " fi if test -n "$finalize_perm_rpath"; then # We should set the runpath_var. rpath= for dir in $finalize_perm_rpath; do func_append rpath "$dir:" done finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " fi fi if test yes = "$no_install"; then # We don't need to create a wrapper script. link_command=$compile_var$compile_command$compile_rpath # Replace the output file specification. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'` # Delete the old output file. $opt_dry_run || $RM $output # Link the executable and exit func_show_eval "$link_command" 'exit $?' if test -n "$postlink_cmds"; then func_to_tool_file "$output" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi exit $EXIT_SUCCESS fi case $hardcode_action,$fast_install in relink,*) # Fast installation is not supported link_command=$compile_var$compile_command$compile_rpath relink_command=$finalize_var$finalize_command$finalize_rpath func_warning "this platform does not like uninstalled shared libraries" func_warning "'$output' will be relinked during installation" ;; *,yes) link_command=$finalize_var$compile_command$finalize_rpath relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'` ;; *,no) link_command=$compile_var$compile_command$compile_rpath relink_command=$finalize_var$finalize_command$finalize_rpath ;; *,needless) link_command=$finalize_var$compile_command$finalize_rpath relink_command= ;; esac # Replace the output file specification. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` # Delete the old output files. $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname func_show_eval "$link_command" 'exit $?' if test -n "$postlink_cmds"; then func_to_tool_file "$output_objdir/$outputname" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi # Now create the wrapper script. func_verbose "creating $output" # Quote the relink command for shipping. if test -n "$relink_command"; then # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" fi done func_quote "(cd `pwd`; $relink_command)" relink_command=$func_quote_result fi # Only actually do things if not in dry run mode. $opt_dry_run || { # win32 will think the script is a binary if it has # a .exe suffix, so we strip it off here. case $output in *.exe) func_stripname '' '.exe' "$output" output=$func_stripname_result ;; esac # test for cygwin because mv fails w/o .exe extensions case $host in *cygwin*) exeext=.exe func_stripname '' '.exe' "$outputname" outputname=$func_stripname_result ;; *) exeext= ;; esac case $host in *cygwin* | *mingw* ) func_dirname_and_basename "$output" "" "." output_name=$func_basename_result output_path=$func_dirname_result cwrappersource=$output_path/$objdir/lt-$output_name.c cwrapper=$output_path/$output_name.exe $RM $cwrappersource $cwrapper trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 func_emit_cwrapperexe_src > $cwrappersource # The wrapper executable is built using the $host compiler, # because it contains $host paths and files. If cross- # compiling, it, like the target executable, must be # executed on the $host or under an emulation environment. $opt_dry_run || { $LTCC $LTCFLAGS -o $cwrapper $cwrappersource $STRIP $cwrapper } # Now, create the wrapper script for func_source use: func_ltwrapper_scriptname $cwrapper $RM $func_ltwrapper_scriptname_result trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15 $opt_dry_run || { # note: this script will not be executed, so do not chmod. if test "x$build" = "x$host"; then $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result else func_emit_wrapper no > $func_ltwrapper_scriptname_result fi } ;; * ) $RM $output trap "$RM $output; exit $EXIT_FAILURE" 1 2 15 func_emit_wrapper no > $output chmod +x $output ;; esac } exit $EXIT_SUCCESS ;; esac # See if we need to build an old-fashioned archive. for oldlib in $oldlibs; do case $build_libtool_libs in convenience) oldobjs="$libobjs_save $symfileobj" addlibs=$convenience build_libtool_libs=no ;; module) oldobjs=$libobjs_save addlibs=$old_convenience build_libtool_libs=no ;; *) oldobjs="$old_deplibs $non_pic_objects" $preload && test -f "$symfileobj" \ && func_append oldobjs " $symfileobj" addlibs=$old_convenience ;; esac if test -n "$addlibs"; then gentop=$output_objdir/${outputname}x func_append generated " $gentop" func_extract_archives $gentop $addlibs func_append oldobjs " $func_extract_archives_result" fi # Do each command in the archive commands. if test -n "$old_archive_from_new_cmds" && test yes = "$build_libtool_libs"; then cmds=$old_archive_from_new_cmds else # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop=$output_objdir/${outputname}x func_append generated " $gentop" func_extract_archives $gentop $dlprefiles func_append oldobjs " $func_extract_archives_result" fi # POSIX demands no paths to be encoded in archives. We have # to avoid creating archives with duplicate basenames if we # might have to extract them afterwards, e.g., when creating a # static archive out of a convenience library, or when linking # the entirety of a libtool archive into another (currently # not supported by libtool). if (for obj in $oldobjs do func_basename "$obj" $ECHO "$func_basename_result" done | sort | sort -uc >/dev/null 2>&1); then : else echo "copying selected object files to avoid basename conflicts..." gentop=$output_objdir/${outputname}x func_append generated " $gentop" func_mkdir_p "$gentop" save_oldobjs=$oldobjs oldobjs= counter=1 for obj in $save_oldobjs do func_basename "$obj" objbase=$func_basename_result case " $oldobjs " in " ") oldobjs=$obj ;; *[\ /]"$objbase "*) while :; do # Make sure we don't pick an alternate name that also # overlaps. newobj=lt$counter-$objbase func_arith $counter + 1 counter=$func_arith_result case " $oldobjs " in *[\ /]"$newobj "*) ;; *) if test ! -f "$gentop/$newobj"; then break; fi ;; esac done func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" func_append oldobjs " $gentop/$newobj" ;; *) func_append oldobjs " $obj" ;; esac done fi func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 tool_oldlib=$func_to_tool_file_result eval cmds=\"$old_archive_cmds\" func_len " $cmds" len=$func_len_result if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then cmds=$old_archive_cmds elif test -n "$archiver_list_spec"; then func_verbose "using command file archive linking..." for obj in $oldobjs do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" done > $output_objdir/$libname.libcmd func_to_tool_file "$output_objdir/$libname.libcmd" oldobjs=" $archiver_list_spec$func_to_tool_file_result" cmds=$old_archive_cmds else # the command line is too long to link in one step, link in parts func_verbose "using piecewise archive linking..." save_RANLIB=$RANLIB RANLIB=: objlist= concat_cmds= save_oldobjs=$oldobjs oldobjs= # Is there a better way of finding the last object in the list? for obj in $save_oldobjs do last_oldobj=$obj done eval test_cmds=\"$old_archive_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 for obj in $save_oldobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result func_append objlist " $obj" if test "$len" -lt "$max_cmd_len"; then : else # the above command should be used before it gets too long oldobjs=$objlist if test "$obj" = "$last_oldobj"; then RANLIB=$save_RANLIB fi test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\$concat_cmds$old_archive_cmds\" objlist= len=$len0 fi done RANLIB=$save_RANLIB oldobjs=$objlist if test -z "$oldobjs"; then eval cmds=\"\$concat_cmds\" else eval cmds=\"\$concat_cmds~\$old_archive_cmds\" fi fi fi func_execute_cmds "$cmds" 'exit $?' done test -n "$generated" && \ func_show_eval "${RM}r$generated" # Now create the libtool archive. case $output in *.la) old_library= test yes = "$build_old_libs" && old_library=$libname.$libext func_verbose "creating $output" # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" fi done # Quote the link command for shipping. relink_command="(cd `pwd`; $SHELL \"$progpath\" $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" func_quote "$relink_command" relink_command=$func_quote_result if test yes = "$hardcode_automatic"; then relink_command= fi # Only create the output if not a dry run. $opt_dry_run || { for installed in no yes; do if test yes = "$installed"; then if test -z "$install_libdir"; then break fi output=$output_objdir/${outputname}i # Replace all uninstalled libtool libraries with the installed ones newdependency_libs= for deplib in $dependency_libs; do case $deplib in *.la) func_basename "$deplib" name=$func_basename_result func_resolve_sysroot "$deplib" eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result` test -z "$libdir" && \ func_fatal_error "'$deplib' is not a valid libtool archive" func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name" ;; -L*) func_stripname -L '' "$deplib" func_replace_sysroot "$func_stripname_result" func_append newdependency_libs " -L$func_replace_sysroot_result" ;; -R*) func_stripname -R '' "$deplib" func_replace_sysroot "$func_stripname_result" func_append newdependency_libs " -R$func_replace_sysroot_result" ;; *) func_append newdependency_libs " $deplib" ;; esac done dependency_libs=$newdependency_libs newdlfiles= for lib in $dlfiles; do case $lib in *.la) func_basename "$lib" name=$func_basename_result eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "'$lib' is not a valid libtool archive" func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name" ;; *) func_append newdlfiles " $lib" ;; esac done dlfiles=$newdlfiles newdlprefiles= for lib in $dlprefiles; do case $lib in *.la) # Only pass preopened files to the pseudo-archive (for # eventual linking with the app. that links it) if we # didn't already link the preopened objects directly into # the library: func_basename "$lib" name=$func_basename_result eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "'$lib' is not a valid libtool archive" func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name" ;; esac done dlprefiles=$newdlprefiles else newdlfiles= for lib in $dlfiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlfiles " $abs" done dlfiles=$newdlfiles newdlprefiles= for lib in $dlprefiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlprefiles " $abs" done dlprefiles=$newdlprefiles fi $RM $output # place dlname in correct position for cygwin # In fact, it would be nice if we could use this code for all target # systems that can't hard-code library paths into their executables # and that have no shared library path variable independent of PATH, # but it turns out we can't easily determine that from inspecting # libtool variables, so we have to hard-code the OSs to which it # applies here; at the moment, that means platforms that use the PE # object format with DLL files. See the long comment at the top of # tests/bindir.at for full details. tdlname=$dlname case $host,$output,$installed,$module,$dlname in *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) # If a -bindir argument was supplied, place the dll there. if test -n "$bindir"; then func_relative_path "$install_libdir" "$bindir" tdlname=$func_relative_path_result/$dlname else # Otherwise fall back on heuristic. tdlname=../bin/$dlname fi ;; esac $ECHO > $output "\ # $outputname - a libtool library file # Generated by $PROGRAM (GNU $PACKAGE) $VERSION # # Please DO NOT delete this file! # It is necessary for linking the library. # The name that we can dlopen(3). dlname='$tdlname' # Names of this library. library_names='$library_names' # The name of the static archive. old_library='$old_library' # Linker flags that cannot go in dependency_libs. inherited_linker_flags='$new_inherited_linker_flags' # Libraries that this one depends upon. dependency_libs='$dependency_libs' # Names of additional weak libraries provided by this library weak_library_names='$weak_libs' # Version information for $libname. current=$current age=$age revision=$revision # Is this an already installed library? installed=$installed # Should we warn about portability when linking against -modules? shouldnotlink=$module # Files to dlopen/dlpreopen dlopen='$dlfiles' dlpreopen='$dlprefiles' # Directory that this library needs to be installed in: libdir='$install_libdir'" if test no,yes = "$installed,$need_relink"; then $ECHO >> $output "\ relink_command=\"$relink_command\"" fi done } # Do a symbolic link so that the libtool archive can be found in # LD_LIBRARY_PATH before the program is installed. func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?' ;; esac exit $EXIT_SUCCESS } if test link = "$opt_mode" || test relink = "$opt_mode"; then func_mode_link ${1+"$@"} fi # func_mode_uninstall arg... func_mode_uninstall () { $debug_cmd RM=$nonopt files= rmforce=false exit_status=0 # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic=$magic for arg do case $arg in -f) func_append RM " $arg"; rmforce=: ;; -*) func_append RM " $arg" ;; *) func_append files " $arg" ;; esac done test -z "$RM" && \ func_fatal_help "you must specify an RM program" rmdirs= for file in $files; do func_dirname "$file" "" "." dir=$func_dirname_result if test . = "$dir"; then odir=$objdir else odir=$dir/$objdir fi func_basename "$file" name=$func_basename_result test uninstall = "$opt_mode" && odir=$dir # Remember odir for removal later, being careful to avoid duplicates if test clean = "$opt_mode"; then case " $rmdirs " in *" $odir "*) ;; *) func_append rmdirs " $odir" ;; esac fi # Don't error if the file doesn't exist and rm -f was used. if { test -L "$file"; } >/dev/null 2>&1 || { test -h "$file"; } >/dev/null 2>&1 || test -f "$file"; then : elif test -d "$file"; then exit_status=1 continue elif $rmforce; then continue fi rmfiles=$file case $name in *.la) # Possibly a libtool archive, so verify it. if func_lalib_p "$file"; then func_source $dir/$name # Delete the libtool libraries and symlinks. for n in $library_names; do func_append rmfiles " $odir/$n" done test -n "$old_library" && func_append rmfiles " $odir/$old_library" case $opt_mode in clean) case " $library_names " in *" $dlname "*) ;; *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;; esac test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i" ;; uninstall) if test -n "$library_names"; then # Do each command in the postuninstall commands. func_execute_cmds "$postuninstall_cmds" '$rmforce || exit_status=1' fi if test -n "$old_library"; then # Do each command in the old_postuninstall commands. func_execute_cmds "$old_postuninstall_cmds" '$rmforce || exit_status=1' fi # FIXME: should reinstall the best remaining shared library. ;; esac fi ;; *.lo) # Possibly a libtool object, so verify it. if func_lalib_p "$file"; then # Read the .lo file func_source $dir/$name # Add PIC object to the list of files to remove. if test -n "$pic_object" && test none != "$pic_object"; then func_append rmfiles " $dir/$pic_object" fi # Add non-PIC object to the list of files to remove. if test -n "$non_pic_object" && test none != "$non_pic_object"; then func_append rmfiles " $dir/$non_pic_object" fi fi ;; *) if test clean = "$opt_mode"; then noexename=$name case $file in *.exe) func_stripname '' '.exe' "$file" file=$func_stripname_result func_stripname '' '.exe' "$name" noexename=$func_stripname_result # $file with .exe has already been added to rmfiles, # add $file without .exe func_append rmfiles " $file" ;; esac # Do a test to see if this is a libtool program. if func_ltwrapper_p "$file"; then if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" relink_command= func_source $func_ltwrapper_scriptname_result func_append rmfiles " $func_ltwrapper_scriptname_result" else relink_command= func_source $dir/$noexename fi # note $name still contains .exe if it was in $file originally # as does the version of $file that was added into $rmfiles func_append rmfiles " $odir/$name $odir/${name}S.$objext" if test yes = "$fast_install" && test -n "$relink_command"; then func_append rmfiles " $odir/lt-$name" fi if test "X$noexename" != "X$name"; then func_append rmfiles " $odir/lt-$noexename.c" fi fi fi ;; esac func_show_eval "$RM $rmfiles" 'exit_status=1' done # Try to remove the $objdir's in the directories where we deleted files for dir in $rmdirs; do if test -d "$dir"; then func_show_eval "rmdir $dir >/dev/null 2>&1" fi done exit $exit_status } if test uninstall = "$opt_mode" || test clean = "$opt_mode"; then func_mode_uninstall ${1+"$@"} fi test -z "$opt_mode" && { help=$generic_help func_fatal_help "you must specify a MODE" } test -z "$exec_cmd" && \ func_fatal_help "invalid operation mode '$opt_mode'" if test -n "$exec_cmd"; then eval exec "$exec_cmd" exit $EXIT_FAILURE fi exit $exit_status # The TAGs below are defined such that we never get into a situation # where we disable both kinds of libraries. Given conflicting # choices, we go for a static library, that is the most portable, # since we can't tell whether shared libraries were disabled because # the user asked for that or because the platform doesn't support # them. This is particularly important on AIX, because we don't # support having both static and shared libraries enabled at the same # time on that platform, so we default to a shared-only configuration. # If a disable-shared tag is given, we'll fallback to a static-only # configuration. But we'll never go from static-only to shared-only. # ### BEGIN LIBTOOL TAG CONFIG: disable-shared build_libtool_libs=no build_old_libs=yes # ### END LIBTOOL TAG CONFIG: disable-shared # ### BEGIN LIBTOOL TAG CONFIG: disable-static build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` # ### END LIBTOOL TAG CONFIG: disable-static # Local Variables: # mode:shell-script # sh-indentation:2 # End: telepathy-mission-control-5.16.4/mission-control-plugins/0000755000175000017500000000000012762352247024645 5ustar00gkiagiagkiagia00000000000000telepathy-mission-control-5.16.4/mission-control-plugins/mission-control-plugins.h0000644000175000017500000000343712735242352031636 0ustar00gkiagiagkiagia00000000000000/* Mission Control plugin API (merged header). * #include . * * Copyright (C) 2009 Nokia Corporation * Copyright (C) 2009 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef MCP_MISSION_CONTROL_PLUGINS_H #define MCP_MISSION_CONTROL_PLUGINS_H #include #include typedef enum { MCP_PARAMETER_FLAG_NONE = 0, MCP_PARAMETER_FLAG_SECRET = TP_CONN_MGR_PARAM_FLAG_SECRET } McpParameterFlags; typedef enum { MCP_ATTRIBUTE_FLAG_NONE = 0 } McpAttributeFlags; #define _MCP_IN_MISSION_CONTROL_PLUGINS_H #include #include #include #include #include #include #include #include #include #undef _MCP_IN_MISSION_CONTROL_PLUGINS_H #endif telepathy-mission-control-5.16.4/mission-control-plugins/account.h0000644000175000017500000000647012735242352026454 0ustar00gkiagiagkiagia00000000000000/* Mission Control plugin API - internals, for MC to use for account storage * * Copyright © 2010 Nokia Corporation * Copyright © 2010 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef MCP_ACCOUNT_MANAGER_H #define MCP_ACCOUNT_MANAGER_H #ifndef _MCP_IN_MISSION_CONTROL_PLUGINS_H #error Use instead #endif G_BEGIN_DECLS typedef struct _McpAccountManager McpAccountManager; typedef struct _McpAccountManagerIface McpAccountManagerIface; #define MCP_TYPE_ACCOUNT_MANAGER (mcp_account_manager_get_type ()) #define MCP_ACCOUNT_MANAGER(o) \ (G_TYPE_CHECK_INSTANCE_CAST ((o), MCP_TYPE_ACCOUNT_MANAGER, \ McpAccountManager)) #define MCP_IS_ACCOUNT_MANAGER(o) \ (G_TYPE_CHECK_INSTANCE_TYPE ((o), MCP_TYPE_ACCOUNT_MANAGER)) #define MCP_ACCOUNT_MANAGER_GET_IFACE(o) \ (G_TYPE_INSTANCE_GET_INTERFACE ((o), MCP_TYPE_ACCOUNT_MANAGER, \ McpAccountManagerIface)) GType mcp_account_manager_get_type (void) G_GNUC_CONST; void mcp_account_manager_set_value (const McpAccountManager *mcpa, const gchar *account, const gchar *key, const gchar *value); void mcp_account_manager_set_attribute (const McpAccountManager *mcpa, const gchar *account, const gchar *attribute, GVariant *value, McpAttributeFlags flags); void mcp_account_manager_set_parameter (const McpAccountManager *mcpa, const gchar *account, const gchar *parameter, GVariant *value, McpParameterFlags flags); gchar * mcp_account_manager_get_value (const McpAccountManager *mcpa, const gchar *account, const gchar *key); gboolean mcp_account_manager_parameter_is_secret (const McpAccountManager *mcpa, const gchar *account, const gchar *key); void mcp_account_manager_parameter_make_secret (const McpAccountManager *mcpa, const gchar *account, const gchar *key); gchar * mcp_account_manager_get_unique_name (McpAccountManager *mcpa, const gchar *manager, const gchar *protocol, const GHashTable *params); GStrv mcp_account_manager_list_keys (const McpAccountManager *mcpa, const gchar *account); gchar *mcp_account_manager_escape_value_for_keyfile ( const McpAccountManager *mcpa, const GValue *value); gchar *mcp_account_manager_escape_variant_for_keyfile ( const McpAccountManager *mcpa, GVariant *variant); gboolean mcp_account_manager_unescape_value_from_keyfile ( const McpAccountManager *mcpa, const gchar *escaped, GValue *value, GError **error); gboolean mcp_account_manager_init_value_for_attribute ( const McpAccountManager *mcpa, GValue *value, const gchar *attribute); G_END_DECLS #endif telepathy-mission-control-5.16.4/mission-control-plugins/dbus-acl.h0000644000175000017500000000733512735242352026513 0ustar00gkiagiagkiagia00000000000000/* Mission Control plugin API - DBus Caller ID. * * Copyright © 2010 Nokia Corporation * Copyright © 2010 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef MCP_DBUS_ACL_H #define MCP_DBUS_ACL_H #ifndef _MCP_IN_MISSION_CONTROL_PLUGINS_H #error Use instead #endif #include #include G_BEGIN_DECLS /* API for plugins to implement */ typedef struct _McpDBusAcl McpDBusAcl; typedef struct _McpDBusAclIface McpDBusAclIface; #define MCP_TYPE_DBUS_ACL (mcp_dbus_acl_get_type ()) #define MCP_DBUS_ACL(o) \ (G_TYPE_CHECK_INSTANCE_CAST ((o), MCP_TYPE_DBUS_ACL, McpDBusAcl)) #define MCP_IS_DBUS_ACL(o) \ (G_TYPE_CHECK_INSTANCE_TYPE ((o), MCP_TYPE_DBUS_ACL)) #define MCP_DBUS_ACL_GET_IFACE(o) \ (G_TYPE_INSTANCE_GET_INTERFACE ((o), MCP_TYPE_DBUS_ACL, \ McpDBusAclIface)) GType mcp_dbus_acl_get_type (void) G_GNUC_CONST; /* FIXME: when we break API, rename all types to start with Mcp */ typedef void (*DBusAclAuthorised) (DBusGMethodInvocation *call, gpointer data); typedef enum { DBUS_ACL_TYPE_UNKNOWN = 0, DBUS_ACL_TYPE_METHOD, DBUS_ACL_TYPE_GET_PROPERTY, DBUS_ACL_TYPE_SET_PROPERTY, } DBusAclType; typedef struct { McpDBusAcl *acl; const GList *next_acl; DBusGMethodInvocation *context; DBusAclType type; gchar *name; GHashTable *params; TpDBusDaemon *dbus; DBusAclAuthorised handler; gpointer data; GDestroyNotify cleanup; } DBusAclAuthData; typedef gboolean (*DBusAclAuthoriser) (const McpDBusAcl *, const TpDBusDaemon *, const DBusGMethodInvocation *, DBusAclType type, const gchar *name, const GHashTable *); typedef void (*DBusAclAsyncAuthoriser) (const McpDBusAcl *, DBusAclAuthData *); /* real functions that handle multi-plugin acl logic */ void mcp_dbus_acl_authorised_async_step (DBusAclAuthData *ad, gboolean permitted); void mcp_dbus_acl_authorised_async (TpDBusDaemon *dbus, DBusGMethodInvocation *context, DBusAclType type, const gchar *name, GHashTable *params, DBusAclAuthorised handler, gpointer data, GDestroyNotify cleanup); gboolean mcp_dbus_acl_authorised (const TpDBusDaemon *dbus, DBusGMethodInvocation *context, DBusAclType type, const gchar *name, const GHashTable *params); /* virtual methods */ void mcp_dbus_acl_iface_set_name (McpDBusAclIface *iface, const gchar *name); void mcp_dbus_acl_iface_set_desc (McpDBusAclIface *iface, const gchar *desc); void mcp_dbus_acl_iface_implement_authorised (McpDBusAclIface *iface, DBusAclAuthoriser method); void mcp_dbus_acl_iface_implement_authorised_async (McpDBusAclIface *iface, DBusAclAsyncAuthoriser method); const gchar *mcp_dbus_acl_name (const McpDBusAcl *acl); const gchar *mcp_dbus_acl_description (const McpDBusAcl *acl); struct _McpDBusAclIface { GTypeInterface parent; const gchar *name; const gchar *desc; DBusAclAuthoriser authorised; DBusAclAsyncAuthoriser authorised_async; }; G_END_DECLS #endif telepathy-mission-control-5.16.4/mission-control-plugins/request.c0000644000175000017500000001241312735241312026470 0ustar00gkiagiagkiagia00000000000000/* Mission Control plugin API - representation of a ChannelRequest * * Copyright (C) 2009 Nokia Corporation * Copyright (C) 2009 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /** * SECTION:request * @title: McpRequest * @short_description: Request object, implemented by Mission Control * @see_also: #McpRequestPolicy * @include: mission-control-plugins/mission-control-plugins.h */ #include "config.h" #include #include #include #include GType mcp_request_get_type (void) { static gsize once = 0; static GType type = 0; if (g_once_init_enter (&once)) { static const GTypeInfo info = { sizeof (McpRequestIface), NULL, /* base_init */ NULL, /* base_finalize */ NULL, /* class_init */ NULL, /* class_finalize */ NULL, /* class_data */ 0, /* instance_size */ 0, /* n_preallocs */ NULL, /* instance_init */ NULL /* value_table */ }; type = g_type_register_static (G_TYPE_INTERFACE, "McpRequest", &info, 0); g_type_interface_add_prerequisite (type, G_TYPE_OBJECT); g_once_init_leave (&once, 1); } return type; } const gchar * mcp_request_get_account_path (McpRequest *self) { McpRequestIface *iface = MCP_REQUEST_GET_IFACE (self); g_return_val_if_fail (iface != NULL, NULL); g_return_val_if_fail (iface->get_account_path != NULL, NULL); return iface->get_account_path (self); } const gchar * mcp_request_get_protocol (McpRequest *self) { McpRequestIface *iface = MCP_REQUEST_GET_IFACE (self); g_return_val_if_fail (iface != NULL, NULL); g_return_val_if_fail (iface->get_protocol != NULL, NULL); return iface->get_protocol (self); } const gchar * mcp_request_get_cm_name (McpRequest *self) { McpRequestIface *iface = MCP_REQUEST_GET_IFACE (self); g_return_val_if_fail (iface != NULL, NULL); g_return_val_if_fail (iface->get_cm_name != NULL, NULL); return iface->get_cm_name (self); } gint64 mcp_request_get_user_action_time (McpRequest *self) { McpRequestIface *iface = MCP_REQUEST_GET_IFACE (self); g_return_val_if_fail (iface != NULL, 0); g_return_val_if_fail (iface->get_user_action_time != NULL, 0); return iface->get_user_action_time (self); } guint mcp_request_get_n_requests (McpRequest *self) { McpRequestIface *iface = MCP_REQUEST_GET_IFACE (self); g_return_val_if_fail (iface != NULL, 0); g_return_val_if_fail (iface->get_n_requests != NULL, 0); return iface->get_n_requests (self); } GHashTable * mcp_request_ref_nth_request (McpRequest *self, guint n) { McpRequestIface *iface = MCP_REQUEST_GET_IFACE (self); g_return_val_if_fail (iface != NULL, NULL); g_return_val_if_fail (iface->ref_nth_request != NULL, NULL); return iface->ref_nth_request (self, n); } void mcp_request_deny (McpRequest *self, GQuark domain, gint code, const gchar *message) { McpRequestIface *iface = MCP_REQUEST_GET_IFACE (self); g_return_if_fail (iface != NULL); g_return_if_fail (domain != 0); g_return_if_fail (message != NULL); g_return_if_fail (iface->deny != NULL); iface->deny (self, domain, code, message); } gboolean mcp_request_find_request_by_type (McpRequest *self, guint start_from, GQuark channel_type, guint *ret_index, GHashTable **ret_ref_requested_properties) { guint i = start_from; while (1) { GHashTable *req = mcp_request_ref_nth_request (self, i); if (req == NULL) return FALSE; if (channel_type == 0 || channel_type == g_quark_try_string ( tp_asv_get_string (req, TP_IFACE_CHANNEL ".ChannelType"))) { if (ret_index != NULL) *ret_index = i; if (ret_ref_requested_properties != NULL) *ret_ref_requested_properties = req; else g_hash_table_unref (req); return TRUE; } g_hash_table_unref (req); i++; } } McpRequestDelay * mcp_request_start_delay (McpRequest *self) { McpRequestIface *iface = MCP_REQUEST_GET_IFACE (self); g_return_val_if_fail (iface != NULL, NULL); g_return_val_if_fail (iface->start_delay != NULL, NULL); return iface->start_delay (self); } void mcp_request_end_delay (McpRequest *self, McpRequestDelay *delay) { McpRequestIface *iface = MCP_REQUEST_GET_IFACE (self); g_return_if_fail (iface != NULL); g_return_if_fail (delay != NULL); g_return_if_fail (iface->end_delay != NULL); iface->end_delay (self, delay); } telepathy-mission-control-5.16.4/mission-control-plugins/loader.h0000644000175000017500000000256612735241312026263 0ustar00gkiagiagkiagia00000000000000/* Mission Control plugin API - loader * * Copyright (C) 2009 Nokia Corporation * Copyright (C) 2009 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef MCP_LOADER_H #define MCP_LOADER_H #ifndef _MCP_IN_MISSION_CONTROL_PLUGINS_H #error Use instead #endif G_BEGIN_DECLS /* not actually implemented in this library, see loader.c */ GObject *mcp_plugin_ref_nth_object (guint n); #define MCP_PLUGIN_REF_NTH_OBJECT_SYMBOL "mcp_plugin_ref_nth_object" void mcp_set_debug (gboolean debug); void mcp_add_object (gpointer object); void mcp_read_dir (const gchar *path); const GList *mcp_list_objects (void); G_END_DECLS #endif telepathy-mission-control-5.16.4/mission-control-plugins/debug-internal.h0000644000175000017500000000227012735241312027705 0ustar00gkiagiagkiagia00000000000000/* Mission Control plugin API - debug * * Copyright (C) 2009 Nokia Corporation * Copyright (C) 2009 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef MCP_DEBUG_INTERNAL_H #define MCP_DEBUG_INTERNAL_H #include "config.h" #include #include #ifdef DEBUG #undef DEBUG #endif #ifdef ENABLE_DEBUG #define DEBUG(format, ...) \ MCP_DEBUG (MCP_DEBUG_TYPE, format, ##__VA_ARGS__) #else #define DEBUG(format, ...) do {} while (0) #endif #endif telepathy-mission-control-5.16.4/mission-control-plugins/loader.c0000644000175000017500000001556012735242352026261 0ustar00gkiagiagkiagia00000000000000/* Loader for plugins that use mission-control-plugins * * Copyright (C) 2009 Nokia Corporation * Copyright (C) 2009 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA * */ /** * SECTION:loader * @title: Plugin loader and global functions * @short_description: Writing a plugin, or loading plugins * @see_also: * @include: mission-control-plugins/mission-control-plugins.h * * To write plugins for Mission Control, build a GModule whose name starts * with "mcp-" and ends with %G_MODULE_SUFFIX, for instance mcp-testplugin.so * on Linux or mcp-testplugin.dll on Windows. It must be installed in the * directory given by the ${plugindir} variable in the mission-control-plugins * pkg-config file. * * Each plugin must contain an extern (public) function called * mcp_plugin_ref_nth_object() which behaves as documented here. Mission * Control will call that function to load the plugin. * * Mission Control also uses functions from this part of the library, to load * the plugins. */ #include "config.h" #include #include #include static gboolean debugging = FALSE; #undef DEBUG #define DEBUG(format, ...) \ G_STMT_START { if (debugging || mcp_is_debugging (MCP_DEBUG_LOADER)) \ g_debug ("%s " format, G_STRLOC, ##__VA_ARGS__); } G_STMT_END /* Android's build system prefixes the plugins with lib */ #ifndef __BIONIC__ #define PLUGIN_PREFIX "mcp-" #else #define PLUGIN_PREFIX "libmcp-" #endif /** * mcp_set_debug: * @debug: whether to log debug output * * Set whether debug output will be produced via g_debug() for the plugin * loader. Plugins shouldn't normally need to call this function. */ void mcp_set_debug (gboolean debug) { debugging = debug; } static GList *plugins = NULL; /** * mcp_add_object: * @object: an object implementing one or more plugin interfaces * * Add an object to the list of "plugin objects". Mission Control does this * automatically for the objects returned by mcp_plugin_ref_nth_object(), * so you should only need to use this if you're embedding part of Mission * Control in a larger process. * * As currently implemented, these objects are never unreferenced. * * Mission Control uses this function to load its plugins; plugins shouldn't * call it. */ void mcp_add_object (gpointer object) { g_return_if_fail (G_IS_OBJECT (object)); plugins = g_list_prepend (plugins, g_object_ref (object)); } /** * MCP_PLUGIN_REF_NTH_OBJECT_SYMBOL: * * A string constant whose value is the name mcp_plugin_ref_nth_object(). */ /** * mcp_plugin_ref_nth_object: * @n: object number, starting from 0 * * Implemented by each plugin (not implemented in this library!) as a hook * point; it will be called repeatedly with an increasing argument, and must * return a #GObject reference each time, until it returns %NULL. * * Mission Control will query each object for the #GInterfaces it * implements, and behave accordingly; for instance, the objects might * implement #McpRequestPolicy and/or #McpDispatchOperationPolicy. * * As currently implemented, these objects are never unreferenced. * * Returns: a new reference to a #GObject, or %NULL if @n is at least the * number of objects supported by this plugin */ /** * mcp_read_dir: * @path: full path to a plugins directory * * Read plugins from the given path. Any file with prefix "mcp-" and suffix * %G_MODULE_SUFFIX is considered as a potential plugin, and loaded; if it * contains the symbol mcp_plugin_ref_nth_object(), the plugin is made * resident, then that symbol is called as a function until it returns %NULL. * * Mission Control uses this function to load its plugins; plugins shouldn't * call it. */ void mcp_read_dir (const gchar *path) { GError *error = NULL; GDir *dir = g_dir_open (path, 0, &error); const gchar *entry; if (dir == NULL) { DEBUG ("could not load plugins from %s: %s", path, error->message); g_error_free (error); return; } for (entry = g_dir_read_name (dir); entry != NULL; entry = g_dir_read_name (dir)) { gchar *full_path; GModule *module; if (!g_str_has_prefix (entry, PLUGIN_PREFIX)) { DEBUG ("%s isn't a plugin (doesn't start with " PLUGIN_PREFIX ")", entry); continue; } if (!g_str_has_suffix (entry, "." G_MODULE_SUFFIX)) { DEBUG ("%s is not a loadable module", entry); continue; } full_path = g_build_filename (path, entry, NULL); module = g_module_open (full_path, G_MODULE_BIND_LOCAL); if (module) DEBUG ("g_module_open (%s, ...) = %p", full_path, module); else DEBUG ("g_module_open (%s, ...) = %s", full_path, g_module_error ()); if (module != NULL) { gpointer symbol; if (g_module_symbol (module, MCP_PLUGIN_REF_NTH_OBJECT_SYMBOL, &symbol)) { GObject *(* ref_nth) (guint) = symbol; guint n = 0; GObject *object; /* In practice, approximately no GModules can safely be unloaded. * For those that can, if there's ever a need for it, we can add * an API for "please don't make me resident". */ g_module_make_resident (module); for (object = ref_nth (n); object != NULL; object = ref_nth (++n)) { mcp_add_object (object); g_object_unref (object); } DEBUG ("%u plugin object(s) found in %s", n, entry); } else { DEBUG ("%s does not have symbol %s", entry, MCP_PLUGIN_REF_NTH_OBJECT_SYMBOL); g_module_close (module); } } g_free (full_path); } g_dir_close (dir); } /** * mcp_list_objects: * * Return a list of objects that might implement plugin interfaces. * * Mission Control uses this function to iterate through the loaded plugin * objects; plugins shouldn't need to call it. * * Returns: a constant list of plugin objects */ const GList * mcp_list_objects (void) { return plugins; } telepathy-mission-control-5.16.4/mission-control-plugins/account-storage.h0000644000175000017500000002500712735242352030113 0ustar00gkiagiagkiagia00000000000000/* Mission Control plugin API - Account storage hook. * * Copyright © 2010 Nokia Corporation * Copyright © 2010 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef MCP_ACCOUNT_STORAGE_H #define MCP_ACCOUNT_STORAGE_H #ifndef _MCP_IN_MISSION_CONTROL_PLUGINS_H #error Use instead #endif G_BEGIN_DECLS #define MCP_ACCOUNT_STORAGE_PLUGIN_PRIO_READONLY -1 #define MCP_ACCOUNT_STORAGE_PLUGIN_PRIO_DEFAULT 0 #define MCP_ACCOUNT_STORAGE_PLUGIN_PRIO_NORMAL 100 #define MCP_ACCOUNT_STORAGE_PLUGIN_PRIO_KEYRING 10000 /* API for plugins to implement */ typedef struct _McpAccountStorage McpAccountStorage; typedef struct _McpAccountStorageIface McpAccountStorageIface; #ifdef _i_used_gtk_doc_but_all_i_got_was_this_heap_of_workarounds /* Without this, gtk-doc doesn't generate documentation for * #McpAccountStorage. There is actually no such struct: do not attempt * to use it. */ struct _McpAccountStorage { }; #endif #define MCP_TYPE_ACCOUNT_STORAGE (mcp_account_storage_get_type ()) #define MCP_ACCOUNT_STORAGE(o) \ (G_TYPE_CHECK_INSTANCE_CAST ((o), MCP_TYPE_ACCOUNT_STORAGE, \ McpAccountStorage)) #define MCP_IS_ACCOUNT_STORAGE(o) \ (G_TYPE_CHECK_INSTANCE_TYPE ((o), MCP_TYPE_ACCOUNT_STORAGE)) #define MCP_ACCOUNT_STORAGE_GET_IFACE(o) \ (G_TYPE_INSTANCE_GET_INTERFACE ((o), MCP_TYPE_ACCOUNT_STORAGE, \ McpAccountStorageIface)) GType mcp_account_storage_get_type (void); /* Virtual method implementation signatures */ typedef gboolean (*McpAccountStorageGetFunc) ( const McpAccountStorage *storage, const McpAccountManager *am, const gchar *account, const gchar *key); typedef gboolean (*McpAccountStorageSetFunc) ( const McpAccountStorage *storage, const McpAccountManager *am, const gchar *account, const gchar *key, const gchar *val); typedef gchar * (*McpAccountStorageCreate) ( const McpAccountStorage *storage, const McpAccountManager *am, const gchar *manager, const gchar *protocol, GHashTable *params, GError **error); typedef gboolean (*McpAccountStorageDeleteFunc) ( const McpAccountStorage *storage, const McpAccountManager *am, const gchar *account, const gchar *key); typedef GList * (*McpAccountStorageListFunc) ( const McpAccountStorage *storage, const McpAccountManager *am); typedef gboolean (*McpAccountStorageCommitFunc) ( const McpAccountStorage *storage, const McpAccountManager *am); typedef gboolean (*McpAccountStorageCommitOneFunc) ( const McpAccountStorage *storage, const McpAccountManager *am, const gchar *account); typedef void (*McpAccountStorageReadyFunc) ( const McpAccountStorage *storage, const McpAccountManager *am); typedef void (*McpAccountStorageGetIdentifierFunc) ( const McpAccountStorage *storage, const gchar *account, GValue *identifier); typedef GHashTable * (*McpAccountStorageGetAdditionalInfoFunc) ( const McpAccountStorage *storage, const gchar *account); /* FIXME: when breaking API, make this return TpStorageRestrictionFlags */ typedef guint (*McpAccountStorageGetRestrictionsFunc) ( const McpAccountStorage *storage, const gchar *account); struct _McpAccountStorageIface { GTypeInterface parent; gint priority; const gchar *name; const gchar *desc; const gchar *provider; McpAccountStorageSetFunc set; McpAccountStorageGetFunc get; McpAccountStorageDeleteFunc delete; McpAccountStorageCommitFunc commit; McpAccountStorageListFunc list; McpAccountStorageReadyFunc ready; McpAccountStorageCommitOneFunc commit_one; McpAccountStorageGetIdentifierFunc get_identifier; McpAccountStorageGetAdditionalInfoFunc get_additional_info; McpAccountStorageGetRestrictionsFunc get_restrictions; McpAccountStorageCreate create; /* Since 5.15.0 */ gboolean (*owns) (McpAccountStorage *storage, McpAccountManager *am, const gchar *account); gboolean (*set_attribute) (McpAccountStorage *storage, McpAccountManager *am, const gchar *account, const gchar *attribute, GVariant *val, McpAttributeFlags flags); gboolean (*set_parameter) (McpAccountStorage *storage, McpAccountManager *am, const gchar *account, const gchar *parameter, GVariant *val, McpParameterFlags flags); }; #ifndef __GTK_DOC_IGNORE__ #ifndef MC_DISABLE_DEPRECATED /* functions with which to fill in the vtable */ G_DEPRECATED_FOR (iface->priority = prio) void mcp_account_storage_iface_set_priority (McpAccountStorageIface *iface, guint prio); G_DEPRECATED_FOR (iface->name = name) void mcp_account_storage_iface_set_name (McpAccountStorageIface *iface, const gchar *name); G_DEPRECATED_FOR (iface->desc = desc) void mcp_account_storage_iface_set_desc (McpAccountStorageIface *iface, const gchar *desc); G_DEPRECATED_FOR (iface->provider = provider) void mcp_account_storage_iface_set_provider (McpAccountStorageIface *iface, const gchar *provider); G_DEPRECATED_FOR (iface->get = method) void mcp_account_storage_iface_implement_get (McpAccountStorageIface *iface, McpAccountStorageGetFunc method); G_DEPRECATED_FOR (iface->set = method) void mcp_account_storage_iface_implement_set (McpAccountStorageIface *iface, McpAccountStorageSetFunc method); G_DEPRECATED_FOR (iface->create = method) void mcp_account_storage_iface_implement_create ( McpAccountStorageIface *iface, McpAccountStorageCreate method); G_DEPRECATED_FOR (iface->delete = method) void mcp_account_storage_iface_implement_delete (McpAccountStorageIface *iface, McpAccountStorageDeleteFunc method); G_DEPRECATED_FOR (iface->list = method) void mcp_account_storage_iface_implement_list (McpAccountStorageIface *iface, McpAccountStorageListFunc method); G_DEPRECATED_FOR (iface->commit = method) void mcp_account_storage_iface_implement_commit (McpAccountStorageIface *iface, McpAccountStorageCommitFunc method); G_DEPRECATED_FOR (iface->commit_one = method) void mcp_account_storage_iface_implement_commit_one ( McpAccountStorageIface *iface, McpAccountStorageCommitOneFunc method); G_DEPRECATED_FOR (iface->ready = method) void mcp_account_storage_iface_implement_ready (McpAccountStorageIface *iface, McpAccountStorageReadyFunc method); G_DEPRECATED_FOR (iface->get_identifier = method) void mcp_account_storage_iface_implement_get_identifier ( McpAccountStorageIface *iface, McpAccountStorageGetIdentifierFunc method); G_DEPRECATED_FOR (iface->get_additional_info = method) void mcp_account_storage_iface_implement_get_additional_info ( McpAccountStorageIface *iface, McpAccountStorageGetAdditionalInfoFunc method); G_DEPRECATED_FOR (iface->get_restrictions = method) void mcp_account_storage_iface_implement_get_restrictions ( McpAccountStorageIface *iface, McpAccountStorageGetRestrictionsFunc method); #endif /* !defined(MC_DISABLE_DEPRECATED) */ #endif /* !defined(__GTK_DOC_IGNORE__) */ /* virtual methods */ gint mcp_account_storage_priority (const McpAccountStorage *storage); gboolean mcp_account_storage_get (const McpAccountStorage *storage, McpAccountManager *am, const gchar *account, const gchar *key); gboolean mcp_account_storage_set (const McpAccountStorage *storage, const McpAccountManager *am, const gchar *account, const gchar *key, const gchar *value); gchar * mcp_account_storage_create (const McpAccountStorage *storage, const McpAccountManager *am, const gchar *manager, const gchar *protocol, GHashTable *params, GError **error); gboolean mcp_account_storage_delete (const McpAccountStorage *storage, const McpAccountManager *am, const gchar *account, const gchar *key); void mcp_account_storage_ready (const McpAccountStorage *storage, const McpAccountManager *am); gboolean mcp_account_storage_commit (const McpAccountStorage *storage, const McpAccountManager *am); gboolean mcp_account_storage_commit_one (const McpAccountStorage *storage, const McpAccountManager *am, const gchar *account); GList *mcp_account_storage_list (const McpAccountStorage *storage, const McpAccountManager *am); void mcp_account_storage_get_identifier (const McpAccountStorage *storage, const gchar *account, GValue *identifier); GHashTable *mcp_account_storage_get_additional_info ( const McpAccountStorage *storage, const gchar *account); guint mcp_account_storage_get_restrictions (const McpAccountStorage *storage, const gchar *account); const gchar *mcp_account_storage_name (const McpAccountStorage *storage); const gchar *mcp_account_storage_description (const McpAccountStorage *storage); const gchar *mcp_account_storage_provider (const McpAccountStorage *storage); gboolean mcp_account_storage_owns (McpAccountStorage *storage, McpAccountManager *am, const gchar *account); gboolean mcp_account_storage_set_attribute (McpAccountStorage *storage, McpAccountManager *am, const gchar *account, const gchar *attribute, GVariant *value, McpAttributeFlags flags); gboolean mcp_account_storage_set_parameter (McpAccountStorage *storage, McpAccountManager *am, const gchar *account, const gchar *parameter, GVariant *value, McpParameterFlags flags); void mcp_account_storage_emit_created (McpAccountStorage *storage, const gchar *account); G_DEPRECATED_FOR (something that is actually implemented) void mcp_account_storage_emit_altered (McpAccountStorage *storage, const gchar *account); void mcp_account_storage_emit_altered_one (McpAccountStorage *storage, const gchar *account, const gchar *key); void mcp_account_storage_emit_deleted (McpAccountStorage *storage, const gchar *account); void mcp_account_storage_emit_toggled (McpAccountStorage *storage, const gchar *account, gboolean enabled); void mcp_account_storage_emit_reconnect (McpAccountStorage *storage, const gchar *account); G_END_DECLS #endif telepathy-mission-control-5.16.4/mission-control-plugins/debug.c0000644000175000017500000000416412735242352026077 0ustar00gkiagiagkiagia00000000000000/* Mission Control plugin API - plugin debug infrastructure * * Copyright © 2011 Nokia Corporation * Copyright © 2011 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include static McpDebugFlags debug_flags; static GDebugKey const keys[] = { { "account", MCP_DEBUG_ACCOUNT }, { "account-storage", MCP_DEBUG_ACCOUNT_STORAGE }, { "dbus-acl", MCP_DEBUG_DBUS_ACL }, { "dispatch-operation", MCP_DEBUG_DISPATCH_OPERATION }, { "dispatch-operation-policy", MCP_DEBUG_DISPATCH_OPERATION_POLICY }, { "loader", MCP_DEBUG_LOADER }, { "request", MCP_DEBUG_REQUEST }, { "request-policy", MCP_DEBUG_REQUEST_POLICY }, { NULL, 0 } }; void mcp_debug_init (void) { const gchar *p_debug = g_getenv ("MCP_DEBUG"); const gchar *d_debug = g_getenv ("MC_DEBUG"); const gchar *debug = NULL; debug_flags = MCP_DEBUG_NONE; if (p_debug != NULL) debug = p_debug; else if (g_strcmp0 ("all", d_debug) == 0) debug = d_debug; else return; debug_flags = g_parse_debug_string (debug, keys, G_N_ELEMENTS (keys) - 1); } gboolean mcp_is_debugging (McpDebugFlags flags) { #ifdef ENABLE_DEBUG return (flags & debug_flags) != 0; #else return FALSE; #endif } telepathy-mission-control-5.16.4/mission-control-plugins/account-storage.c0000644000175000017500000011537112735242352030112 0ustar00gkiagiagkiagia00000000000000/* Mission Control plugin API - Account Storage plugins. * * Copyright © 2010 Nokia Corporation * Copyright © 2010 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /** * SECTION:account-storage * @title: McpAccountStorage * @short_description: Account Storage object, implemented by plugins * @see_also: * @include: mission-control-plugins/mission-control-plugins.h * * Plugins may implement #McpAccountStorage in order to provide account * parameter storage backends to the AccountManager object. * * To do so, the plugin must implement a #GObject subclass that implements * #McpAccountStorage, then return an instance of that subclass from * mcp_plugin_ref_nth_object(). * * Many methods take "the unique name of an account" as an argument. * In this plugin, that means the unique "tail" of the account's * object path, for instance "gabble/jabber/chris_40example_2ecom". * The account's full object path is obtained by prepending * %TP_ACCOUNT_OBJECT_PATH_BASE. * * A complete implementation of this interface with all methods would * look something like this: * * * G_DEFINE_TYPE_WITH_CODE (FooPlugin, foo_plugin, * G_TYPE_OBJECT, * G_IMPLEMENT_INTERFACE (...); * G_IMPLEMENT_INTERFACE (MCP_TYPE_ACCOUNT_STORAGE, * account_storage_iface_init)); * /* ... */ * static void * account_storage_iface_init (McpAccountStorageIface *iface) * { * iface->priority = 0; * iface->name = "foo"; * iface->desc = "The FOO storage backend"; * iface->provider = "org.freedesktop.Telepathy.MissionControl5.FooStorage"; * * iface->get = foo_plugin_get; * iface->set = foo_plugin_get; * iface->delete = foo_plugin_delete; * iface->commit = foo_plugin_commit; * iface->commit_one = foo_plugin_commit_one; * iface->list = foo_plugin_list; * iface->ready = foo_plugin_ready; * iface->get_identifier = foo_plugin_get_identifier; * iface->get_additional_info = foo_plugin_get_additional_info; * iface->get_restrictions = foo_plugin_get_restrictions; * iface->create = foo_plugin_create; * iface->owns = foo_plugin_owns; * iface->set_attribute = foo_plugin_set_attribute; * iface->set_parameter = foo_plugin_set_parameter; * } * * * A single object can implement more than one interface; It is currently * unlikely that you would find it useful to implement anything other than * an account storage plugin in an account storage object, though. */ #include "config.h" #include #include #include #include #include #define MCP_DEBUG_TYPE MCP_DEBUG_ACCOUNT_STORAGE #ifdef ENABLE_DEBUG #define SDEBUG(_p, _format, ...) \ DEBUG("%s: " _format, \ (_p != NULL) ? mcp_account_storage_name (_p) : "NULL", ##__VA_ARGS__) #else /* ENABLE_DEBUG */ #define SDEBUG(_p, _format, ...) do {} while (0); #endif /* ENABLE_DEBUG */ enum { CREATED, ALTERED, TOGGLED, DELETED, ALTERED_ONE, RECONNECT, NO_SIGNAL }; static guint signals[NO_SIGNAL] = { 0 }; static gboolean default_set (const McpAccountStorage *storage, const McpAccountManager *am, const gchar *account, const gchar *key, const gchar *val) { return FALSE; } static gboolean default_set_attribute (McpAccountStorage *storage, McpAccountManager *am, const gchar *account, const gchar *attribute, GVariant *value, McpAttributeFlags flags) { return FALSE; } static gboolean default_set_parameter (McpAccountStorage *storage, McpAccountManager *am, const gchar *account, const gchar *parameter, GVariant *value, McpParameterFlags flags) { return FALSE; } static gboolean default_owns (McpAccountStorage *storage, McpAccountManager *am, const gchar *account) { /* This has the side-effect of pushing the "manager" key back into @am, * but that should be a no-op in practice: we always call this * method in priority order and stop at the first one that says "yes", * and @am's idea of what "manager" is should have come from that same * plugin anyway. */ return mcp_account_storage_get (storage, am, account, "manager"); } static void class_init (gpointer klass, gpointer data) { GType type = G_TYPE_FROM_CLASS (klass); McpAccountStorageIface *iface = klass; iface->owns = default_owns; iface->set = default_set; iface->set_attribute = default_set_attribute; iface->set_parameter = default_set_parameter; if (signals[CREATED] != 0) { DEBUG ("already registered signals"); return; } /** * McpAccountStorage::created * @account: the unique name of the created account * * Emitted if an external entity creates an account * in the backend the emitting plugin handles. * * Should not be fired until mcp_account_storage_ready() has been called * */ signals[CREATED] = g_signal_new ("created", type, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__STRING, G_TYPE_NONE, 1, G_TYPE_STRING); /** * McpAccountStorage::altered * @account: the unique name of the altered account * * This signal does not appear to be fully implemented * (see freedesktop.org bug 28288). * Emit #McpAccountStorage::altered-one instead. * * Should not be fired until mcp_account_storage_ready() has been called * */ signals[ALTERED] = g_signal_new ("altered", type, G_SIGNAL_RUN_LAST | G_SIGNAL_DEPRECATED, 0, NULL, NULL, g_cclosure_marshal_VOID__STRING, G_TYPE_NONE, 1, G_TYPE_STRING); /** * McpAccountStorage::altered-one * @account: the unique name of the altered account * @name: the name of the altered property (its key) * * Emitted if an external entity alters an account * in the backend that the emitting plugin handles. * * Before emitting this signal, the plugin must call * either mcp_account_manager_set_attribute(), * either mcp_account_manager_set_parameter() or * mcp_account_manager_set_value() to push the new value * into the account manager. * * Note that mcp_account_manager_set_parameter() does not use the * "param-" prefix, but this signal and mcp_account_manager_set_value() * both do. * * Should not be fired until mcp_account_storage_ready() has been called */ signals[ALTERED_ONE] = g_signal_new ("altered-one", type, G_SIGNAL_RUN_LAST, 0, NULL, NULL, _mcp_marshal_VOID__STRING_STRING, G_TYPE_NONE, 2, G_TYPE_STRING, G_TYPE_STRING); /** * McpAccountStorage::deleted * @account: the unique name of the deleted account * * Emitted if an external entity deletes an account * in the backend the emitting plugin handles. * * Should not be fired until mcp_account_storage_ready() has been called * */ signals[DELETED] = g_signal_new ("deleted", type, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__STRING, G_TYPE_NONE, 1, G_TYPE_STRING); /** * McpAccountStorage::toggled * @account: the unique name of the toggled account * @enabled: #gboolean indicating whether the account is enabled * * Emitted if an external entity enables/disables an account * in the backend the emitting plugin handles. This is similar to * emitting #McpAccountStorage::altered-one for the attribute * "Enabled", except that the plugin is not required to call * a function like mcp_account_manager_set_value() first. * * Should not be fired until mcp_account_storage_ready() has been called * */ signals[TOGGLED] = g_signal_new ("toggled", type, G_SIGNAL_RUN_LAST, 0, NULL, NULL, _mcp_marshal_VOID__STRING_BOOLEAN, G_TYPE_NONE, 2, G_TYPE_STRING, G_TYPE_BOOLEAN); /** * McpAccountStorage::reconnect * @account: the unique name of the account to reconnect * * emitted if an external entity modified important parameters of the * account and a reconnection is required in order to apply them. * * Should not be fired until mcp_account_storage_ready() has been called **/ signals[RECONNECT] = g_signal_new ("reconnect", type, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__STRING, G_TYPE_NONE, 1, G_TYPE_STRING); } GType mcp_account_storage_get_type (void) { static gsize once = 0; static GType type = 0; if (g_once_init_enter (&once)) { static const GTypeInfo info = { sizeof (McpAccountStorageIface), NULL, /* base_init */ NULL, /* base_finalize */ class_init, /* class_init */ NULL, /* class_finalize */ NULL, /* class_data */ 0, /* instance_size */ 0, /* n_preallocs */ NULL, /* instance_init */ NULL /* value_table */ }; type = g_type_register_static (G_TYPE_INTERFACE, "McpAccountStorage", &info, 0); g_type_interface_add_prerequisite (type, G_TYPE_OBJECT); g_once_init_leave (&once, 1); } return type; } /** * McpAccountStorage: * * An object implementing the account storage plugin interface. */ /** * McpAccountStorageIface: * @parent: the standard fields for an interface * @priority: returned by mcp_account_storage_priority() * @name: returned by mcp_account_storage_name() * @desc: returned by mcp_account_storage_description() * @provider: returned by mcp_account_storage_provider() * @set: implementation of mcp_account_storage_set() * @get: implementation of mcp_account_storage_get() * @delete: implementation of mcp_account_storage_delete() * @commit: implementation of mcp_account_storage_commit() * @list: implementation of mcp_account_storage_list() * @ready: implementation of mcp_account_storage_ready() * @commit_one: implementation of mcp_account_storage_commit_one() * @get_identifier: implementation of mcp_account_storage_get_identifier() * @get_additional_info: implementation of * mcp_account_storage_get_additional_info() * @get_restrictions: implementation of mcp_account_storage_get_restrictions() * @create: implementation of mcp_account_storage_create() * * The interface vtable for an account storage plugin. */ void mcp_account_storage_iface_set_priority (McpAccountStorageIface *iface, guint prio) { iface->priority = prio; } void mcp_account_storage_iface_set_name (McpAccountStorageIface *iface, const gchar *name) { iface->name = name; } void mcp_account_storage_iface_set_desc (McpAccountStorageIface *iface, const gchar *desc) { iface->desc = desc; } void mcp_account_storage_iface_set_provider (McpAccountStorageIface *iface, const gchar *provider) { iface->provider = provider; } void mcp_account_storage_iface_implement_get (McpAccountStorageIface *iface, McpAccountStorageGetFunc method) { iface->get = method; } void mcp_account_storage_iface_implement_set (McpAccountStorageIface *iface, McpAccountStorageSetFunc method) { iface->set = method; } void mcp_account_storage_iface_implement_delete (McpAccountStorageIface *iface, McpAccountStorageDeleteFunc method) { iface->delete = method; } void mcp_account_storage_iface_implement_commit (McpAccountStorageIface *iface, McpAccountStorageCommitFunc method) { iface->commit = method; } void mcp_account_storage_iface_implement_commit_one (McpAccountStorageIface *iface, McpAccountStorageCommitOneFunc method) { iface->commit_one = method; } void mcp_account_storage_iface_implement_list (McpAccountStorageIface *iface, McpAccountStorageListFunc method) { iface->list = method; } void mcp_account_storage_iface_implement_ready (McpAccountStorageIface *iface, McpAccountStorageReadyFunc method) { iface->ready = method; } void mcp_account_storage_iface_implement_get_identifier ( McpAccountStorageIface *iface, McpAccountStorageGetIdentifierFunc method) { iface->get_identifier = method; } void mcp_account_storage_iface_implement_get_additional_info ( McpAccountStorageIface *iface, McpAccountStorageGetAdditionalInfoFunc method) { iface->get_additional_info = method; } void mcp_account_storage_iface_implement_get_restrictions ( McpAccountStorageIface *iface, McpAccountStorageGetRestrictionsFunc method) { iface->get_restrictions = method; } void mcp_account_storage_iface_implement_create ( McpAccountStorageIface *iface, McpAccountStorageCreate method) { iface->create = method; } /** * mcp_account_storage_priority: * @storage: an #McpAccountStorage instance * * Gets the priority for this plugin. * * Priorities currently run from MCP_ACCOUNT_STORAGE_PLUGIN_PRIO_DEFAULT * (the default storage plugin priority) upwards. More-positive numbers * are higher priority. * * Plugins at a higher priority then MCP_ACCOUNT_STORAGE_PLUGIN_PRIO_KEYRING * used to have the opportunity to "steal" passwords from the gnome keyring. * It is no longer significant. * * Plugins at a lower priority than the default plugin will never be asked to * store any details, although they may still be asked to list them at startup * time, and may asynchronously notify MC of accounts via the signals above. * * When loading accounts at startup, plugins are consulted in order from * lowest to highest, so that higher priority plugins may overrule settings * from lower priority plugins. * * Loading all the accounts is only done at startup, before the dbus name * is claimed, and is therefore the only time plugins are allowed to indulge * in blocking calls (indeed, they are expected to carry out this operation, * and ONLY this operation, synchronously). * * When values are being set, the plugins are invoked from highest priority * to lowest, with the first plugin that claims a setting being assigned * ownership, and all lower priority plugins being asked to delete the * setting in question. * * Returns: the priority of this plugin **/ gint mcp_account_storage_priority (const McpAccountStorage *storage) { McpAccountStorageIface *iface = MCP_ACCOUNT_STORAGE_GET_IFACE (storage); g_return_val_if_fail (iface != NULL, -1); return iface->priority; } /** * McpAccountStorageGetFunc: * @storage: the account storage plugin * @am: object used to call back into the account manager * @account: the unique name of the account * @key: the setting whose value we wish to fetch: either an attribute * like "DisplayName", or "param-" plus a parameter like "account" * * An implementation of mcp_account_storage_get(). * * Returns: %TRUE if @storage is responsible for @account */ /** * mcp_account_storage_get: * @storage: an #McpAccountStorage instance * @am: an #McpAccountManager instance * @account: the unique name of the account * @key: the setting whose value we wish to fetch: either an attribute * like "DisplayName", or "param-" plus a parameter like "account" * * Get a value from the plugin's in-memory cache. * Before emitting this signal, the plugin must call * either mcp_account_manager_set_attribute(), * mcp_account_manager_set_parameter(), * or mcp_account_manager_set_value() and (if appropriate) * mcp_account_manager_parameter_make_secret() * before returning from this method call. * * Note that mcp_account_manager_set_parameter() does not use the * "param-" prefix, even if called from this function. * * If @key is %NULL the plugin should iterate through all attributes and * parameters, and push each of them into @am, as if this method had * been called once for each attribute or parameter. It must then return * %TRUE if any attributes or parameters were found, or %FALSE if it * was not responsible for @account. * * Returns: %TRUE if @storage is responsible for @account */ gboolean mcp_account_storage_get (const McpAccountStorage *storage, McpAccountManager *am, const gchar *account, const gchar *key) { McpAccountStorageIface *iface = MCP_ACCOUNT_STORAGE_GET_IFACE (storage); SDEBUG (storage, ""); g_return_val_if_fail (iface != NULL, FALSE); g_return_val_if_fail (iface->get != NULL, FALSE); return iface->get (storage, am, account, key); } /** * McpAccountStorageSetFunc: * @storage: an #McpAccountStorage instance * @am: an #McpAccountManager instance * @account: the unique name of the account * @key: the setting whose value we wish to store: either an attribute * like "DisplayName", or "param-" plus a parameter like "account" * @val: a non-%NULL value for @key * * An implementation of mcp_account_storage_set(). * * Returns: %TRUE if @storage is responsible for @account */ /** * mcp_account_storage_set: * @storage: an #McpAccountStorage instance * @am: an #McpAccountManager instance * @account: the unique name of the account * @key: the non-%NULL setting whose value we wish to store: either an * attribute like "DisplayName", or "param-" plus a parameter like "account" * @value: a value to associate with @key, escaped as if for a #GKeyFile * * The plugin is expected to either quickly and synchronously * update its internal cache of values with @value, or to * decline to store the setting. * * The plugin is not expected to write to its long term storage * at this point. It can expect Mission Control to call either * mcp_account_storage_commit() or mcp_account_storage_commit_one() * after a short delay. * * Plugins that implement mcp_storage_set_attribute() and * mcp_account_storage_set_parameter() can just return %FALSE here. * There is a default implementation, which just returns %FALSE. * * Returns: %TRUE if the attribute was claimed, %FALSE otherwise */ gboolean mcp_account_storage_set (const McpAccountStorage *storage, const McpAccountManager *am, const gchar *account, const gchar *key, const gchar *value) { McpAccountStorageIface *iface = MCP_ACCOUNT_STORAGE_GET_IFACE (storage); SDEBUG (storage, ""); g_return_val_if_fail (iface != NULL, FALSE); return iface->set (storage, am, account, key, value); } /** * mcp_account_storage_set_attribute: * @storage: an #McpAccountStorage instance * @am: an #McpAccountManager instance * @account: the unique name of the account * @attribute: the name of an attribute, e.g. "DisplayName" * @value: a value to associate with @attribute * @flags: flags influencing how the attribute is to be stored * * Store an attribute. * * The plugin is expected to either quickly and synchronously * update its internal cache of values with @value, or to * decline to store the attribute. * * The plugin is not expected to write to its long term storage * at this point. * * There is a default implementation, which just returns %FALSE. * Mission Control will call mcp_account_storage_set() instead, * using a keyfile-escaped version of @value. * * Returns: %TRUE if the attribute was claimed, %FALSE otherwise * * Since: 5.15.0 */ gboolean mcp_account_storage_set_attribute (McpAccountStorage *storage, McpAccountManager *am, const gchar *account, const gchar *attribute, GVariant *value, McpAttributeFlags flags) { McpAccountStorageIface *iface = MCP_ACCOUNT_STORAGE_GET_IFACE (storage); SDEBUG (storage, ""); g_return_val_if_fail (iface != NULL, FALSE); g_return_val_if_fail (iface->set_attribute != NULL, FALSE); return iface->set_attribute (storage, am, account, attribute, value, flags); } /** * mcp_account_storage_set_parameter: * @storage: an #McpAccountStorage instance * @am: an #McpAccountManager instance * @account: the unique name of the account * @parameter: the name of a parameter, e.g. "account" (note that there * is no "param-" prefix here) * @value: a value to associate with @parameter * @flags: flags influencing how the parameter is to be stored * * Store a parameter. * * The plugin is expected to either quickly and synchronously * update its internal cache of values with @value, or to * decline to store the parameter. * * The plugin is not expected to write to its long term storage * at this point. * * There is a default implementation, which just returns %FALSE. * Mission Control will call mcp_account_storage_set() instead, * using "param-" + @parameter as key and a keyfile-escaped version * of @value as value. * * Returns: %TRUE if the parameter was claimed, %FALSE otherwise * * Since: 5.15.0 */ gboolean mcp_account_storage_set_parameter (McpAccountStorage *storage, McpAccountManager *am, const gchar *account, const gchar *parameter, GVariant *value, McpParameterFlags flags) { McpAccountStorageIface *iface = MCP_ACCOUNT_STORAGE_GET_IFACE (storage); SDEBUG (storage, ""); g_return_val_if_fail (iface != NULL, FALSE); g_return_val_if_fail (iface->set_parameter != NULL, FALSE); return iface->set_parameter (storage, am, account, parameter, value, flags); } /** * McpAccountStorageCreate: * @storage: an #McpAccountStorage instance * @am: an object which can be used to call back into the account manager * @manager: the name of the manager * @protocol: the name of the protocol * @params: A gchar * / GValue * hash table of account parameters * @error: a GError to fill * * An implementation of mcp_account_storage_create() * * Returns: (transfer full): the account name or %NULL */ /** * mcp_account_storage_create: * @storage: an #McpAccountStorage instance * @am: an object which can be used to call back into the account manager * @manager: the name of the manager * @protocol: the name of the protocol * @params: A gchar * / GValue * hash table of account parameters * @error: a GError to fill * * Inform the plugin that a new account is being created. @manager, @protocol * and @params are given to help determining the account's unique name, but does * not need to be stored on the account yet, mcp_account_storage_set() and * mcp_account_storage_commit() will be called later. * * It is recommended to use mcp_account_manager_get_unique_name() to create the * unique name, but it's not mandatory. One could base the unique name on an * internal storage identifier, prefixed with the provider's name * (e.g. goa__1234). * * #McpAccountStorage::created signal should not be emitted for this account, * not even when mcp_account_storage_commit() will be called. * * Returns: (transfer full): the newly allocated account name, which should * be freed once the caller is done with it, or %NULL if that couldn't * be done. */ gchar * mcp_account_storage_create (const McpAccountStorage *storage, const McpAccountManager *am, const gchar *manager, const gchar *protocol, GHashTable *params, GError **error) { McpAccountStorageIface *iface = MCP_ACCOUNT_STORAGE_GET_IFACE (storage); g_return_val_if_fail (iface != NULL, NULL); if (iface->create == NULL) { g_set_error (error, TP_ERROR, TP_ERROR_NOT_IMPLEMENTED, "This storage does not implement create function"); return NULL; } return iface->create (storage, am, manager, protocol, params, error); } /** * McpAccountStorageDeleteFunc: * @storage: an #McpAccountStorage instance * @am: an #McpAccountManager instance * @account: the unique name of the account * @key: (allow-none): the setting whose value we wish to store - either an * attribute like "DisplayName", or "param-" plus a parameter like * "account" - or %NULL to delete the entire account * * An implementation of mcp_account_storage_delete(). * * Returns: %TRUE if the setting or settings are not * the plugin's cache after this operation, %FALSE otherwise. */ /** * mcp_account_storage_delete: * @storage: an #McpAccountStorage instance * @am: an #McpAccountManager instance * @account: the unique name of the account * @key: (allow-none): the setting whose value we wish to store - either an * attribute like "DisplayName", or "param-" plus a parameter like * "account" - or %NULL to delete the entire account * * The plugin is expected to remove the setting for @key from its * internal cache and to remember that its state has changed, so * that it can delete said setting from its long term storage if * its long term storage method makes this necessary. * * If @key is %NULL, the plugin should forget all its settings for * @account,and remember to delete the entire account from its storage later. * * The plugin is not expected to update its long term storage at * this point. * * Returns: %TRUE if the setting or settings are not * the plugin's cache after this operation, %FALSE otherwise. * This is very unlikely to ever be %FALSE, as a plugin is always * expected to be able to manipulate its own cache. */ gboolean mcp_account_storage_delete (const McpAccountStorage *storage, const McpAccountManager *am, const gchar *account, const gchar *key) { McpAccountStorageIface *iface = MCP_ACCOUNT_STORAGE_GET_IFACE (storage); SDEBUG (storage, ""); g_return_val_if_fail (iface != NULL, FALSE); return iface->delete (storage, am, account, key); } /** * McpAccountStorageCommitFunc: * @storage: an #McpAccountStorage instance * @am: an #McpAccountManager instance * * An implementation of mcp_account_storage_commit(). * * Returns: %TRUE if the commit process was started successfully */ /** * mcp_account_storage_commit: * @storage: an #McpAccountStorage instance * @am: an #McpAccountManager instance * * The plugin is expected to write its cache to long term storage, * deleting, adding or updating entries in said storage as needed. * * This call is expected to return promptly, but the plugin is * not required to have finished its commit operation when it returns, * merely to have started the operation. * * If the @commit_one method is implemented, it will be called preferentially * if only one account is to be committed. If the @commit_one method is * implemented but @commit is not, @commit_one will be called with * @account_name = %NULL to commit all accounts. * * Returns: %TRUE if the commit process was started (but not necessarily * completed) successfully; %FALSE if there was a problem that was immediately * obvious. */ gboolean mcp_account_storage_commit (const McpAccountStorage *storage, const McpAccountManager *am) { McpAccountStorageIface *iface = MCP_ACCOUNT_STORAGE_GET_IFACE (storage); SDEBUG (storage, "committing all accounts"); g_return_val_if_fail (iface != NULL, FALSE); if (iface->commit != NULL) { return iface->commit (storage, am); } else if (iface->commit_one != NULL) { return iface->commit_one (storage, am, NULL); } else { SDEBUG (storage, "neither commit nor commit_one is implemented; cannot save accounts"); return FALSE; } } /** * McpAccountStorageCommitOneFunc: * @storage: an #McpAccountStorage instance * @am: an #McpAccountManager instance * @account: (allow-none): the unique suffix of an account's object path, * or %NULL * * An implementation of mcp_account_storage_commit_one(). * * Returns: %TRUE if the commit process was started successfully */ /** * mcp_account_storage_commit_one: * @storage: an #McpAccountStorage instance * @am: an #McpAccountManager instance * @account: (allow-none): the unique suffix of an account's object path, * or %NULL if all accounts are to be committed and * mcp_account_storage_commit() is unimplemented * * The same as mcp_account_storage_commit(), but only commit the given * account. This is optional to implement; the default implementation * is to call @commit. * * If both mcp_account_storage_commit_one() and mcp_account_storage_commit() * are implemented, Mission Control will never pass @account = %NULL to * this method. * * Returns: %TRUE if the commit process was started (but not necessarily * completed) successfully; %FALSE if there was a problem that was immediately * obvious. */ gboolean mcp_account_storage_commit_one (const McpAccountStorage *storage, const McpAccountManager *am, const gchar *account) { McpAccountStorageIface *iface = MCP_ACCOUNT_STORAGE_GET_IFACE (storage); SDEBUG (storage, "called for %s", account ? account : ""); g_return_val_if_fail (iface != NULL, FALSE); if (iface->commit_one != NULL) return iface->commit_one (storage, am, account); else /* Fall back to plain ->commit() */ return mcp_account_storage_commit (storage, am); } /** * McpAccountStorageListFunc: * @storage: an #McpAccountStorage instance * @am: an #McpAccountManager instance * * An implementation of mcp_account_storage_list(). * * Returns: (transfer full): a list of account names */ /** * mcp_account_storage_list: * @storage: an #McpAccountStorage instance * @am: an #McpAccountManager instance * * Load details of every account stored by this plugin into an in-memory cache * so that it can respond to requests promptly. * * This method is called only at initialisation time, before the dbus name * has been claimed, and is the only one permitted to block. * * Returns: (element-type utf8) (transfer full): a list of account names that * the plugin has settings for. The account names should be freed with * g_free(), and the list with g_list_free(), when the caller is done with * them. */ GList * mcp_account_storage_list (const McpAccountStorage *storage, const McpAccountManager *am) { McpAccountStorageIface *iface = MCP_ACCOUNT_STORAGE_GET_IFACE (storage); SDEBUG (storage, ""); g_return_val_if_fail (iface != NULL, NULL); return iface->list (storage, am); } /** * McpAccountStorageReadyFunc: * @storage: an #McpAccountStorage instance * @am: an #McpAccountManager instance * * An implementation of mcp_account_storage_ready(). */ /** * mcp_account_storage_ready: * @storage: an #McpAccountStorage instance * @am: an #McpAccountManager instance * * Informs the plugin that it is now permitted to create new accounts, * ie it can now fire its "created", "altered", "toggled" and "deleted" * signals. */ void mcp_account_storage_ready (const McpAccountStorage *storage, const McpAccountManager *am) { McpAccountStorageIface *iface = MCP_ACCOUNT_STORAGE_GET_IFACE (storage); g_return_if_fail (iface != NULL); /* plugins that can't create accounts from external sources don't * * need to implement this method, as they can never fire the async * * account change signals: */ if (iface->ready != NULL) iface->ready (storage, am); } /** * McpAccountStorageGetIdentifierFunc: * @storage: an #McpAccountStorage instance * @account: the unique name of the account * @identifier: (out caller-allocates): a zero-filled #GValue whose type * can be sent over D-Bus by dbus-glib, to hold the identifier. * * An implementation of mcp_account_storage_get_identifier(). */ /** * mcp_account_storage_get_identifier: * @storage: an #McpAccountStorage instance * @account: the unique name of the account * @identifier: (out caller-allocates): a zero-filled #GValue whose type * can be sent over D-Bus by dbus-glib, to hold the identifier. * * Get the storage-specific identifier for this account. The type is variant, * hence the GValue. * * This method will only be called for the storage plugin that "owns" * the account. */ void mcp_account_storage_get_identifier (const McpAccountStorage *storage, const gchar *account, GValue *identifier) { McpAccountStorageIface *iface = MCP_ACCOUNT_STORAGE_GET_IFACE (storage); SDEBUG (storage, ""); g_return_if_fail (iface != NULL); g_return_if_fail (identifier != NULL); g_return_if_fail (!G_IS_VALUE (identifier)); if (iface->get_identifier == NULL) { g_value_init (identifier, G_TYPE_STRING); g_value_set_string (identifier, account); } else { iface->get_identifier (storage, account, identifier); } } /** * McpAccountStorageGetAdditionalInfoFunc * @storage: an #McpAccountStorage instance * @account: the unique name of the account * * An implementation of mcp_account_storage_get_identifier(). * * Returns: (transfer container) (element-type utf8 GObject.Value): additional * storage-specific information */ /** * mcp_account_storage_get_additional_info: * @storage: an #McpAccountStorage instance * @account: the unique name of the account * * Return additional storage-specific information about this account, which is * made available on D-Bus but not otherwise interpreted by Mission Control. * * This method will only be called for the storage plugin that "owns" * the account. * * Returns: (transfer container) (element-type utf8 GObject.Value): additional * storage-specific information */ GHashTable * mcp_account_storage_get_additional_info (const McpAccountStorage *storage, const gchar *account) { McpAccountStorageIface *iface = MCP_ACCOUNT_STORAGE_GET_IFACE (storage); GHashTable *ret = NULL; SDEBUG (storage, ""); g_return_val_if_fail (iface != NULL, FALSE); if (iface->get_additional_info != NULL) ret = iface->get_additional_info (storage, account); if (ret == NULL) ret = g_hash_table_new (g_str_hash, g_str_equal); return ret; } /** * McpAccountStorageGetRestrictionsFunc * @storage: an #McpAccountStorage instance * @account: the unique name of the account * * An implementation of mcp_account_storage_get_restrictions(). * * Returns: any restrictions that apply to this account. */ /** * mcp_account_storage_get_restrictions: * @storage: an #McpAccountStorage instance * @account: the unique name of the account * * This method will only be called for the storage plugin that "owns" * the account. * * Returns: a bitmask of %TpStorageRestrictionFlags with the restrictions to * account storage. */ /* FIXME: when breaking API, make this return TpStorageRestrictionFlags */ guint mcp_account_storage_get_restrictions (const McpAccountStorage *storage, const gchar *account) { McpAccountStorageIface *iface = MCP_ACCOUNT_STORAGE_GET_IFACE (storage); g_return_val_if_fail (iface != NULL, 0); if (iface->get_restrictions == NULL) return 0; else return iface->get_restrictions (storage, account); } /** * mcp_account_storage_name: * @storage: an #McpAccountStorage instance * * * * Returns: the plugin's name (for logging etc) */ const gchar * mcp_account_storage_name (const McpAccountStorage *storage) { McpAccountStorageIface *iface = MCP_ACCOUNT_STORAGE_GET_IFACE (storage); g_return_val_if_fail (iface != NULL, NULL); return iface->name; } /** * mcp_account_storage_description: * @storage: an #McpAccountStorage instance * * * * Returns: the plugin's description (for logging etc) */ const gchar * mcp_account_storage_description (const McpAccountStorage *storage) { McpAccountStorageIface *iface = MCP_ACCOUNT_STORAGE_GET_IFACE (storage); g_return_val_if_fail (iface != NULL, NULL); return iface->desc; } /** * mcp_account_storage_provider: * @storage: an #McpAccountStorage instance * * * * Returns: a D-Bus namespaced name for this plugin, or "" if none * was provided in #McpAccountStorageIface.provider. */ const gchar * mcp_account_storage_provider (const McpAccountStorage *storage) { McpAccountStorageIface *iface = MCP_ACCOUNT_STORAGE_GET_IFACE (storage); g_return_val_if_fail (iface != NULL, NULL); return iface->provider != NULL ? iface->provider : ""; } /** * mcp_account_storage_emit_create: * @storage: an #McpAccountStorage instance * @account: the unique name of the created account * * Emits the #McpAccountStorage::created signal. */ void mcp_account_storage_emit_created (McpAccountStorage *storage, const gchar *account) { g_signal_emit (storage, signals[CREATED], 0, account); } /** * mcp_account_storage_emit_altered: * @storage: an #McpAccountStorage instance * @account: the unique name of the altered account * * Emits the #McpAccountStorage::altered signal */ void mcp_account_storage_emit_altered (McpAccountStorage *storage, const gchar *account) { g_signal_emit (storage, signals[ALTERED], 0, account); } /** * mcp_account_storage_emit_altered_one: * @storage: an #McpAccountStorage instance * @account: the unique name of the altered account * @key: the key of the altered property: either an attribute name * like "DisplayName", or "param-" plus a parameter name like "account" * * Emits the #McpAccountStorage::altered-one signal */ void mcp_account_storage_emit_altered_one (McpAccountStorage *storage, const gchar *account, const gchar *key) { g_signal_emit (storage, signals[ALTERED_ONE], 0, account, key); } /** * mcp_account_storage_emit_deleted: * @storage: an #McpAccountStorage instance * @account: the unique name of the deleted account * * Emits the #McpAccountStorage::deleted signal */ void mcp_account_storage_emit_deleted (McpAccountStorage *storage, const gchar *account) { g_signal_emit (storage, signals[DELETED], 0, account); } /** * mcp_account_storage_emit_toggled: * @storage: an #McpAccountStorage instance * @account: the unique name of the account * @enabled: %TRUE if the account is now enabled * * Emits ::toggled signal */ void mcp_account_storage_emit_toggled (McpAccountStorage *storage, const gchar *account, gboolean enabled) { g_signal_emit (storage, signals[TOGGLED], 0, account, enabled); } /** * mcp_account_storage_emit_reconnect: * @storage: an #McpAccountStorage instance * @account: the unique name of the account to reconnect * * Emits ::reconnect signal */ void mcp_account_storage_emit_reconnect (McpAccountStorage *storage, const gchar *account) { g_signal_emit (storage, signals[RECONNECT], 0, account); } /** * mcp_account_storage_owns: * @storage: an #McpAccountStorage instance * @am: an #McpAccountManager instance * @account: the unique name (object-path tail) of an account * * Check whether @account is stored in @storage. The highest-priority * plugin for which this function returns %TRUE is considered to be * responsible for @account. * * There is a default implementation, which calls mcp_account_storage_get() * for the well-known key "manager". * * Returns: %TRUE if @account is stored in @storage * * Since: 5.15.0 */ gboolean mcp_account_storage_owns (McpAccountStorage *storage, McpAccountManager *am, const gchar *account) { McpAccountStorageIface *iface = MCP_ACCOUNT_STORAGE_GET_IFACE (storage); g_return_val_if_fail (iface != NULL, FALSE); g_return_val_if_fail (iface->owns != NULL, FALSE); return iface->owns (storage, am, account); } telepathy-mission-control-5.16.4/mission-control-plugins/dispatch-operation-policy.c0000644000175000017500000002377212735241312032104 0ustar00gkiagiagkiagia00000000000000/* Mission Control plugin API - ChannelDispatchOperation policy hook. * * Copyright (C) 2009 Nokia Corporation * Copyright (C) 2009 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /** * SECTION:dispatch-operation-policy * @title: McpDispatchOperationPolicy * @short_description: Dispatch Operation policy object, implemented by plugins * @see_also: #McpDispatchOperation * @include: mission-control-plugins/mission-control-plugins.h * * Plugins may implement #McpDispatchOperationPolicy in order to apply policy * to Telepathy channel dispatch operations passing through the Channel * Dispatcher part of Mission Control. This interface behaves rather like the * Observer clients in the Telepathy specification, and has access to the same * information, but runs within the Mission Control process rather than being * invoked over D-Bus. * * To do so, the plugin must implement a #GObject subclass that implements * #McpDispatchOperationPolicy, then return an instance of that subclass from * mcp_plugin_ref_nth_object(). * * A typical plugin might look like this: * * * G_DEFINE_TYPE_WITH_CODE (MyPlugin, my_plugin, * G_TYPE_OBJECT, * G_IMPLEMENT_INTERFACE (...); * G_IMPLEMENT_INTERFACE (MCP_TYPE_DISPATCH_OPERATION_POLICY, * cdo_policy_iface_init); * G_IMPLEMENT_INTERFACE (...)) * /* ... */ * static void * cdo_policy_iface_init (McpDispatchOperationPolicyIface *iface, * gpointer unused G_GNUC_UNUSED) * { * iface->check = my_plugin_check_cdo; * iface->handler_is_suitable_async = my_plugin_handler_is_suitable_async; * iface->handler_is_suitable_finish = my_plugin_handler_is_suitable_finish; * } * * * A single object can implement more than one interface; for instance, it * may be useful to combine this interface with #McpRequestPolicy. */ #include "config.h" #include GType mcp_dispatch_operation_policy_get_type (void) { static gsize once = 0; static GType type = 0; if (g_once_init_enter (&once)) { static const GTypeInfo info = { sizeof (McpDispatchOperationPolicyIface), NULL, /* base_init */ NULL, /* base_finalize */ NULL, /* class_init */ NULL, /* class_finalize */ NULL, /* class_data */ 0, /* instance_size */ 0, /* n_preallocs */ NULL, /* instance_init */ NULL /* value_table */ }; type = g_type_register_static (G_TYPE_INTERFACE, "McpDispatchOperationPolicy", &info, 0); g_type_interface_add_prerequisite (type, G_TYPE_OBJECT); g_once_init_leave (&once, 1); } return type; } /** * McpDispatchOperationPolicyIface: * @parent: the parent type * @check: an implementation of mcp_dispatch_operation_policy_check(); * %NULL is equivalent to an implementation that does nothing * @handler_is_suitable_async: an implementation of * mcp_dispatch_operation_policy_handler_is_suitable_async(); * %NULL is treated as equivalent to an implementation that accepts * every handler, i.e. always asynchronously returns %TRUE * @handler_is_suitable_finish: an implementation of * mcp_dispatch_operation_policy_handler_is_suitable_finish(); * %NULL is treated as equivalent to an implementation that accepts any * #GSimpleAsyncResult */ /** * McpDispatchOperationPolicyCb: * @policy: an implementation of this interface, provided by a plugin * @dispatch_operation: an object representing a dispatch operation, i.e. * a bundle of channels being dispatched * * Signature of an implementation of mcp_dispatch_operation_policy_check(). */ /** * McpDispatchOperationPolicyHandlerIsSuitableAsync: * @policy: an implementation of this interface, provided by a plugin * @handler: a proxy for the Handler's D-Bus API, or %NULL if the Handler * is calling Claim (so its well-known name is not immediately obvious) * @unique_name: The Handler's unique name, or empty or %NULL if it has not yet * been started * @dispatch_operation: an object representing a dispatch operation, i.e. * a bundle of channels being dispatched * @callback: callback to be called on success or failure * @user_data: user data for the callback * * Signature of mcp_dispatch_operation_policy_handler_is_suitable_async() */ /** * McpDispatchOperationPolicyFinisher: * @policy: an implementation of this interface, provided by a plugin * @result: the asynchronous result passed to a #GAsyncReadyCallback * @error: (allow-none): used to return an error * * Signature of a virtual method used to finish an asynchronous operation * that succeeds or fails, but does not return any additional value. * * Returns: %TRUE if the operation succeeded, %FALSE on error */ /** * mcp_dispatch_operation_policy_check: * @policy: an implementation of this interface, provided by a plugin * @dispatch_operation: an object representing a dispatch operation, i.e. * a bundle of channels being dispatched * * Check what to do with a bundle of channels. Implementations of this method * can use methods on @dispatch_operation to examine the channels, delay * dispatching, close the channels, etc. in order to impose whatever policy * the plugin requires. * * Mission Control calls this function in each plugin after invoking * Observers, but before Approvers, and without waiting for Observers to * reply. */ void mcp_dispatch_operation_policy_check (McpDispatchOperationPolicy *policy, McpDispatchOperation *dispatch_operation) { McpDispatchOperationPolicyIface *iface = MCP_DISPATCH_OPERATION_POLICY_GET_IFACE (policy); g_return_if_fail (iface != NULL); if (iface->check != NULL) iface->check (policy, dispatch_operation); } /** * mcp_dispatch_operation_policy_iface_implement_check: * @iface: the interface * @impl: an implementation of the virtual method * mcp_dispatch_operation_policy_check() * * This method is no longer necessary: just set iface->check = impl instead. */ void mcp_dispatch_operation_policy_iface_implement_check ( McpDispatchOperationPolicyIface *iface, McpDispatchOperationPolicyCb impl) { iface->check = impl; } /** * mcp_dispatch_operation_policy_handler_is_suitable_async: * @policy: an implementation of this interface, provided by a plugin * @handler: a proxy for the Handler's D-Bus API, or %NULL if the Handler * is calling Claim (so its well-known name is not immediately obvious) * @unique_name: The Handler's unique name, or empty or %NULL if it has not yet * been started * @dispatch_operation: an object representing a dispatch operation, i.e. * a bundle of channels being dispatched * @callback: callback to be called on success or failure * @user_data: user data for the callback * * Check whether a handler is "suitable" for these channels. For instance, * this could be used to ensure that only the platform's default UI can be * used for particular channels, even if MC would normally consider * a third-party UI to be a better match. * * Mission Control calls all implementations of this method in parallel * and waits for them all to return. If any of them raises an error, * the handler is considered to be unsuitable. */ void mcp_dispatch_operation_policy_handler_is_suitable_async ( McpDispatchOperationPolicy *policy, TpClient *handler, const gchar *unique_name, McpDispatchOperation *dispatch_operation, GAsyncReadyCallback callback, gpointer user_data) { McpDispatchOperationPolicyIface *iface = MCP_DISPATCH_OPERATION_POLICY_GET_IFACE (policy); g_return_if_fail (iface != NULL); if (iface->handler_is_suitable_async != NULL) { iface->handler_is_suitable_async (policy, handler, unique_name, dispatch_operation, callback, user_data); } else { /* unimplemented: the default is to succeed */ GSimpleAsyncResult *simple = g_simple_async_result_new ( (GObject *) policy, callback, user_data, mcp_dispatch_operation_policy_handler_is_suitable_async); g_simple_async_result_complete_in_idle (simple); g_object_unref (simple); } } /** * mcp_dispatch_operation_policy_handler_is_suitable_finish: * @policy: an implementation of this interface, provided by a plugin * @result: the asynchronous result passed to the #GAsyncReadyCallback * @error: (allow-none): used to return an error * * Finish a call to mcp_dispatch_operation_policy_handler_is_suitable_async(). * * Returns: %TRUE if the handler is suitable; %FALSE if the handler is * unsuitable or there was an error */ gboolean mcp_dispatch_operation_policy_handler_is_suitable_finish ( McpDispatchOperationPolicy *policy, GAsyncResult *result, GError **error) { McpDispatchOperationPolicyIface *iface = MCP_DISPATCH_OPERATION_POLICY_GET_IFACE (policy); g_return_val_if_fail (iface != NULL, FALSE); if (iface->handler_is_suitable_finish != NULL) { return iface->handler_is_suitable_finish (policy, result, error); } else { /* accept any GSimpleAsyncResult regardless of source tag, so we can * use it with the default implementation of _async or with most * user-supplied implementations */ g_return_val_if_fail (G_IS_SIMPLE_ASYNC_RESULT (result), FALSE); return !g_simple_async_result_propagate_error ( (GSimpleAsyncResult *) result, error); } } telepathy-mission-control-5.16.4/mission-control-plugins/debug.h0000644000175000017500000000335312735242352026103 0ustar00gkiagiagkiagia00000000000000/* Mission Control plugin API - for plugin debug messages * * Copyright © 2011 Nokia Corporation * Copyright © 2011 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef MCP_DEBUG_H #define MCP_DEBUG_H #ifndef _MCP_IN_MISSION_CONTROL_PLUGINS_H #error Use instead #endif #define MCP_DEBUG(_type, _fmt, ...) \ G_STMT_START { if (mcp_is_debugging (_type)) \ g_debug ("%s: " _fmt, G_STRFUNC, ##__VA_ARGS__); } G_STMT_END G_BEGIN_DECLS typedef enum { MCP_DEBUG_NONE = 0, MCP_DEBUG_ACCOUNT = 1 << 0, MCP_DEBUG_ACCOUNT_STORAGE = 1 << 1, MCP_DEBUG_DBUS_ACL = 1 << 2, MCP_DEBUG_DISPATCH_OPERATION = 1 << 3, MCP_DEBUG_DISPATCH_OPERATION_POLICY = 1 << 4, MCP_DEBUG_LOADER = 1 << 5, MCP_DEBUG_REQUEST = 1 << 6, MCP_DEBUG_REQUEST_POLICY = 1 << 7, } McpDebugFlags; gboolean mcp_is_debugging (McpDebugFlags type); void mcp_debug_init (void); G_END_DECLS #endif telepathy-mission-control-5.16.4/mission-control-plugins/request-policy.h0000644000175000017500000000424612735241312027777 0ustar00gkiagiagkiagia00000000000000/* Mission Control plugin API - ChannelRequest policy hook. * * Copyright (C) 2009 Nokia Corporation * Copyright (C) 2009 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef MCP_REQUEST_POLICY_H #define MCP_REQUEST_POLICY_H #ifndef _MCP_IN_MISSION_CONTROL_PLUGINS_H #error Use instead #endif #include G_BEGIN_DECLS /* API for plugins to implement */ typedef struct _McpRequestPolicy McpRequestPolicy; typedef struct _McpRequestPolicyIface McpRequestPolicyIface; #define MCP_TYPE_REQUEST_POLICY \ (mcp_request_policy_get_type ()) #define MCP_REQUEST_POLICY(o) \ (G_TYPE_CHECK_INSTANCE_CAST ((o), MCP_TYPE_REQUEST_POLICY, McpRequestPolicy)) #define MCP_IS_REQUEST_POLICY(o) \ (G_TYPE_CHECK_INSTANCE_TYPE ((o), MCP_TYPE_REQUEST_POLICY)) #define MCP_REQUEST_POLICY_GET_IFACE(o) \ (G_TYPE_INSTANCE_GET_INTERFACE ((o), MCP_TYPE_REQUEST_POLICY, \ McpRequestPolicyIface)) GType mcp_request_policy_get_type (void) G_GNUC_CONST; /* virtual methods */ typedef void (*McpRequestPolicyCb) (McpRequestPolicy *policy, McpRequest *request); void mcp_request_policy_check (McpRequestPolicy *policy, McpRequest *request); void mcp_request_policy_iface_implement_check (McpRequestPolicyIface *iface, void (*impl) (McpRequestPolicy *, McpRequest *)); struct _McpRequestPolicyIface { GTypeInterface parent; McpRequestPolicyCb check; }; G_END_DECLS #endif telepathy-mission-control-5.16.4/mission-control-plugins/account.c0000644000175000017500000003375712735242352026457 0ustar00gkiagiagkiagia00000000000000/* Mission Control plugin API - interface to an McdAccountManager for plugins * * Copyright © 2010 Nokia Corporation * Copyright © 2010 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "config.h" #include #include #include #define MCP_DEBUG_TYPE MCP_DEBUG_ACCOUNT /** * SECTION:account * @title: McpAccountManager * @short_description: Object representing the account manager, implemented * by Mission Control * @see_also: #McpAccountStorage * @include: mission-control-plugins/mission-control-plugins.h * * This object represents the Telepathy AccountManager. * * Most virtual methods on the McpAccountStorageIface interface receive an * object provided by Mission Control that implements this interface. * It can be used to manipulate Mission Control's in-memory cache of accounts. * * Only Mission Control should implement this interface. */ GType mcp_account_manager_get_type (void) { static gsize once = 0; static GType type = 0; if (g_once_init_enter (&once)) { static const GTypeInfo info = { sizeof (McpAccountManagerIface), NULL, /* base_init */ NULL, /* base_finalize */ NULL, /* class_init */ NULL, /* class_finalize */ NULL, /* class_data */ 0, /* instance_size */ 0, /* n_preallocs */ NULL, /* instance_init */ NULL /* value_table */ }; type = g_type_register_static (G_TYPE_INTERFACE, "McpAccountManager", &info, 0); g_type_interface_add_prerequisite (type, G_TYPE_OBJECT); g_once_init_leave (&once, 1); } return type; } /** * mcp_account_manager_set_value: * @mcpa: an #McpAccountManager instance * @account: the unique name of an account * @key: the setting whose value we wish to change: either an attribute * like "DisplayName", or "param-" plus a parameter like "account" * @value: the new value, escaped as if for a #GKeyFile, or %NULL to delete * the setting/parameter * * Inform Mission Control that @key has changed its value to @value. * * This function may either be called from mcp_account_storage_get(), * or just before emitting #McpAccountStorage::altered-one. * * New plugins should call mcp_account_manager_set_attribute() or * mcp_account_manager_set_parameter() instead. */ void mcp_account_manager_set_value (const McpAccountManager *mcpa, const gchar *account, const gchar *key, const gchar *value) { McpAccountManagerIface *iface = MCP_ACCOUNT_MANAGER_GET_IFACE (mcpa); g_return_if_fail (iface != NULL); g_return_if_fail (iface->set_value != NULL); iface->set_value (mcpa, account, key, value); } /** * mcp_account_manager_set_attribute: * @mcpa: an #McpAccountManager instance * @account: the unique name of an account * @attribute: the name of an attribute, such as "DisplayName" * @value: (allow-none): the new value, or %NULL to delete the attribute * @flags: flags for the new value (only used if @value is non-%NULL) * * Inform Mission Control that @attribute has changed its value to @value. * * If @value is a floating reference, Mission Control will take ownership * of it, much like g_variant_builder_add_value(). * * This function may either be called from mcp_account_storage_get(), * or just before emitting #McpAccountStorage::altered-one. */ void mcp_account_manager_set_attribute (const McpAccountManager *mcpa, const gchar *account, const gchar *attribute, GVariant *value, McpAttributeFlags flags) { McpAccountManagerIface *iface = MCP_ACCOUNT_MANAGER_GET_IFACE (mcpa); g_return_if_fail (iface != NULL); g_return_if_fail (iface->set_attribute != NULL); iface->set_attribute (mcpa, account, attribute, value, flags); } /** * mcp_account_manager_set_parameter: * @mcpa: an #McpAccountManager instance * @account: the unique name of an account * @parameter: the name of a parameter, such as "account", without * the "param-" prefix * @value: (allow-none): the new value, or %NULL to delete the parameter * @flags: flags for the new value (only used if @value is non-%NULL) * * Inform Mission Control that @parameter has changed its value to @value. * * If @value is a floating reference, Mission Control will take ownership * of it, much like g_variant_builder_add_value(). * * This function may either be called from mcp_account_storage_get(), * or just before emitting #McpAccountStorage::altered-one. */ void mcp_account_manager_set_parameter (const McpAccountManager *mcpa, const gchar *account, const gchar *parameter, GVariant *value, McpParameterFlags flags) { McpAccountManagerIface *iface = MCP_ACCOUNT_MANAGER_GET_IFACE (mcpa); g_return_if_fail (iface != NULL); g_return_if_fail (iface->set_parameter != NULL); iface->set_parameter (mcpa, account, parameter, value, flags); } /** * mcp_account_manage_list_keys: * @mcpa: a #McpAccountManager instance * @account: the unique name of an account * * * * Returns: (transfer full): a list of all keys (attributes and * "param-"-prefixed parameters) stored for @account by any plugin */ GStrv mcp_account_manager_list_keys (const McpAccountManager *mcpa, const gchar *account) { McpAccountManagerIface *iface = MCP_ACCOUNT_MANAGER_GET_IFACE (mcpa); g_return_val_if_fail (iface != NULL, NULL); g_return_val_if_fail (iface->list_keys != NULL, NULL); g_return_val_if_fail (account != NULL, NULL); return iface->list_keys (mcpa, account); } /** * mcp_account_manager_get_value: * @mcpa: an #McpAccountManager instance * @account: the unique name of an account * @key: the setting whose value we wish to fetch: either an attribute * like "DisplayName", or "param-" plus a parameter like "account" * * Fetch a copy of the current value of an account setting held by * the account manager. * * Returns: (transfer full): the value of @key */ gchar * mcp_account_manager_get_value (const McpAccountManager *mcpa, const gchar *account, const gchar *key) { McpAccountManagerIface *iface = MCP_ACCOUNT_MANAGER_GET_IFACE (mcpa); g_return_val_if_fail (iface != NULL, NULL); g_return_val_if_fail (iface->set_value != NULL, NULL); return iface->get_value (mcpa, account, key); } /** * mcp_account_manager_parameter_is_secret: * @mcpa: an #McpAccountManager instance * @account: the unique name of an account * @key: the constant string "param-", plus a parameter name like * "account" or "password" * * Determine whether a given account parameter is secret. * Generally this is determined by MC and passed down to plugins, * but any #McpAccountStorage plugin may decide a parameter is * secret, in which case the return value for this call will * indicate that fact too. * * For historical reasons, this function only operates on parameters, * but requires its argument to be prefixed with "param-". * * Returns: %TRUE for secret settings, %FALSE otherwise */ gboolean mcp_account_manager_parameter_is_secret (const McpAccountManager *mcpa, const gchar *account, const gchar *key) { McpAccountManagerIface *iface = MCP_ACCOUNT_MANAGER_GET_IFACE (mcpa); g_return_val_if_fail (iface != NULL, FALSE); g_return_val_if_fail (iface->is_secret != NULL, FALSE); return iface->is_secret (mcpa, account, key); } /** * mcp_account_manager_parameter_make_secret: * @mcpa: an #McpAccountManager instance * @account: the unique name of an account * @key: the constant string "param-", plus a parameter name like * "account" or "password" * * Flag an account setting as secret for the lifetime of this * #McpAccountManager. For instance, this should be called if * @key has been retrieved from gnome-keyring. * * For historical reasons, this function only operates on parameters, * but requires its argument to be prefixed with "param-". */ void mcp_account_manager_parameter_make_secret (const McpAccountManager *mcpa, const gchar *account, const gchar *key) { McpAccountManagerIface *iface = MCP_ACCOUNT_MANAGER_GET_IFACE (mcpa); g_return_if_fail (iface != NULL); g_return_if_fail (iface->make_secret != NULL); g_debug ("%s.%s should be secret", account, key); iface->make_secret (mcpa, account, key); } /** * mcp_account_manager_get_unique_name: * @mcpa: an #McpAccountManager instance * @manager: the name of the manager * @protocol: the name of the protocol * @params: A gchar * / GValue * hash table of account parameters. * * Generate and return the canonical unique name of this [new] account. * Should not be called for accounts which have already had a name * assigned: Intended for use when a plugin encounters an account which * MC has not previously seen before (ie one created by a 3rd party * in the back-end that the plugin in question provides an interface to). * * Returns: the newly allocated account name, which should be freed * once the caller is done with it. */ gchar * mcp_account_manager_get_unique_name (McpAccountManager *mcpa, const gchar *manager, const gchar *protocol, const GHashTable *params) { McpAccountManagerIface *iface = MCP_ACCOUNT_MANAGER_GET_IFACE (mcpa); g_return_val_if_fail (iface != NULL, NULL); g_return_val_if_fail (iface->unique_name != NULL, NULL); return iface->unique_name (mcpa, manager, protocol, params); } /** * mcp_account_manager_escape_value_from_keyfile: * @mcpa: a #McpAccountManager * @value: a value with a supported #GType * * Escape @value so it could be passed to g_key_file_set_value(). * For instance, escaping the boolean value TRUE returns "true", * and escaping the string value containing one space returns "\s". * * It is a programming error to use an unsupported type. * The supported types are currently %G_TYPE_STRING, %G_TYPE_BOOLEAN, * %G_TYPE_INT, %G_TYPE_UINT, %G_TYPE_INT64, %G_TYPE_UINT64, %G_TYPE_UCHAR, * %G_TYPE_STRV, %DBUS_TYPE_G_OBJECT_PATH and %TP_ARRAY_TYPE_OBJECT_PATH_LIST. * * Returns: the escaped form of @value */ gchar * mcp_account_manager_escape_value_for_keyfile (const McpAccountManager *mcpa, const GValue *value) { McpAccountManagerIface *iface = MCP_ACCOUNT_MANAGER_GET_IFACE (mcpa); g_return_val_if_fail (iface != NULL, NULL); g_return_val_if_fail (iface->escape_value_for_keyfile != NULL, NULL); return iface->escape_value_for_keyfile (mcpa, value); } /** * mcp_account_manager_escape_variant_for_keyfile: * @mcpa: a #McpAccountManager * @variant: a #GVariant with a supported #GVariantType * * Escape @variant so it could be passed to g_key_file_set_value(). * For instance, escaping the boolean value TRUE returns "true", * and escaping the string value containing one space returns "\s". * * It is a programming error to use an unsupported type. * The supported types are currently %G_VARIANT_TYPE_STRING, * %G_VARIANT_TYPE_BOOLEAN, %G_VARIANT_TYPE_INT32, %G_VARIANT_TYPE_UINT32, * %G_VARIANT_TYPE_INT64, %G_VARIANT_TYPE_UINT64, %G_VARIANT_TYPE_BYTE, * %G_VARIANT_TYPE_STRING_ARRAY, %G_VARIANT_TYPE_OBJECT_PATH and * %G_VARIANT_TYPE_OBJECT_PATH_ARRAY. * * Returns: (transfer full): the escaped form of @variant */ gchar * mcp_account_manager_escape_variant_for_keyfile (const McpAccountManager *mcpa, GVariant *variant) { McpAccountManagerIface *iface = MCP_ACCOUNT_MANAGER_GET_IFACE (mcpa); g_return_val_if_fail (iface != NULL, NULL); g_return_val_if_fail (iface->escape_variant_for_keyfile != NULL, NULL); return iface->escape_variant_for_keyfile (mcpa, variant); } /** * mcp_account_manager_unescape_value_from_keyfile: * @mcpa: a #McpAccountManager * @escaped: an escaped string as returned by g_key_file_get_value() * @value: a value to populate, with a supported #GType * @error: used to raise an error if %FALSE is returned * * Attempt to interpret @escaped as a value of @value's type. * If successful, put it in @value and return %TRUE. * * It is a programming error to try to escape an unsupported type. * The supported types are currently %G_TYPE_STRING, %G_TYPE_BOOLEAN, * %G_TYPE_INT, %G_TYPE_UINT, %G_TYPE_INT64, %G_TYPE_UINT64, %G_TYPE_UCHAR, * %G_TYPE_STRV, %DBUS_TYPE_G_OBJECT_PATH and %TP_ARRAY_TYPE_OBJECT_PATH_LIST. * * Returns: %TRUE if @value was filled in */ gboolean mcp_account_manager_unescape_value_from_keyfile (const McpAccountManager *mcpa, const gchar *escaped, GValue *value, GError **error) { McpAccountManagerIface *iface = MCP_ACCOUNT_MANAGER_GET_IFACE (mcpa); g_return_val_if_fail (iface != NULL, FALSE); g_return_val_if_fail (iface->unescape_value_from_keyfile != NULL, FALSE); return iface->unescape_value_from_keyfile (mcpa, escaped, value, error); } /** * mcp_account_manager_init_value_for_attribute: * @mcpa: a #McpAccountManager * @value: a zero-filled value to initialize * @attribute: a supported Mission Control attribute * * If @attribute is a known Mission Control attribute, initialize @value * with an appropriate type for @attribute and return %TRUE. Otherwise, * return %FALSE. * * Returns: %TRUE if @value was initialized */ gboolean mcp_account_manager_init_value_for_attribute (const McpAccountManager *mcpa, GValue *value, const gchar *attribute) { McpAccountManagerIface *iface = MCP_ACCOUNT_MANAGER_GET_IFACE (mcpa); g_return_val_if_fail (iface != NULL, FALSE); g_return_val_if_fail (iface->init_value_for_attribute != NULL, FALSE); return iface->init_value_for_attribute (mcpa, value, attribute); } telepathy-mission-control-5.16.4/mission-control-plugins/dispatch-operation.c0000644000175000017500000004332312735242352030606 0ustar00gkiagiagkiagia00000000000000/* Mission Control plugin API - representation of a ChannelDispatchOperation * * Copyright (C) 2009 Nokia Corporation * Copyright (C) 2009 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /** * SECTION:dispatch-operation * @title: McpDispatchOperation * @short_description: Dispatch operation object, implemented by Mission Control * @see_also: #McpDispatchOperationPolicy * @include: mission-control-plugins/mission-control-plugins.h * * This object represents a Telepathy ChannelDispatchOperation object, as used * by Approvers. A ChannelDispatchOperation represents a bundle of one or more * Telepathy Channels being dispatched to user interfaces or other clients. * * The virtual method mcd_dispatch_operation_policy_check() receives an object * provided by Mission Control that implements this interface. It can be * used to inspect the channels, delay dispatching of the bundle until the * plugin is ready to continue, or close the channels in various ways. * * Only Mission Control should implement this interface. */ #include "config.h" #include #include #include #include GType mcp_dispatch_operation_get_type (void) { static gsize once = 0; static GType type = 0; if (g_once_init_enter (&once)) { static const GTypeInfo info = { sizeof (McpDispatchOperationIface), NULL, /* base_init */ NULL, /* base_finalize */ NULL, /* class_init */ NULL, /* class_finalize */ NULL, /* class_data */ 0, /* instance_size */ 0, /* n_preallocs */ NULL, /* instance_init */ NULL /* value_table */ }; type = g_type_register_static (G_TYPE_INTERFACE, "McpDispatchOperation", &info, 0); g_type_interface_add_prerequisite (type, G_TYPE_OBJECT); g_once_init_leave (&once, 1); } return type; } /** * mcp_dispatch_operation_get_account_path: * @self: a dispatch operation * * * * Returns: the D-Bus object path of the Account with which the channels are * associated. The string is owned by @self and must not be freed; it is * only valid as long as a reference to @self is held. */ const gchar * mcp_dispatch_operation_get_account_path (McpDispatchOperation *self) { McpDispatchOperationIface *iface = MCP_DISPATCH_OPERATION_GET_IFACE (self); g_return_val_if_fail (iface != NULL, NULL); g_return_val_if_fail (iface->get_account_path != NULL, NULL); return iface->get_account_path (self); } /** * mcp_dispatch_operation_get_connection_path: * @self: a dispatch operation * * * * Returns: the D-Bus object path of the Connection with which the channels are * associated. The string is owned by @self and must not be freed; it is * only valid as long as a reference to @self is held. */ const gchar * mcp_dispatch_operation_get_connection_path (McpDispatchOperation *self) { McpDispatchOperationIface *iface = MCP_DISPATCH_OPERATION_GET_IFACE (self); g_return_val_if_fail (iface != NULL, NULL); g_return_val_if_fail (iface->get_connection_path != NULL, NULL); return iface->get_connection_path (self); } /** * mcp_dispatch_operation_get_protocol: * @self: a dispatch operation * * * * Returns: the Telepathy identifier for the protocol, such as 'jabber' or * 'icq' (the Protocol type in telepathy-spec). The string is owned by @self * and must not be freed; it is only valid as long as a reference to @self * is held. */ const gchar * mcp_dispatch_operation_get_protocol (McpDispatchOperation *self) { McpDispatchOperationIface *iface = MCP_DISPATCH_OPERATION_GET_IFACE (self); g_return_val_if_fail (iface != NULL, NULL); g_return_val_if_fail (iface->get_protocol != NULL, NULL); return iface->get_protocol (self); } /** * mcp_dispatch_operation_get_cm_name: * @self: a dispatch operation * * * * Returns: the short name of the Telepathy connection manager, such as * 'gabble' or 'haze' (the Connection_Manager_Name type in telepathy-spec). * The string is owned by @self and must not be freed; it is only valid as * long as a reference to @self is held. */ const gchar * mcp_dispatch_operation_get_cm_name (McpDispatchOperation *self) { McpDispatchOperationIface *iface = MCP_DISPATCH_OPERATION_GET_IFACE (self); g_return_val_if_fail (iface != NULL, NULL); g_return_val_if_fail (iface->get_cm_name != NULL, NULL); return iface->get_cm_name (self); } /** * mcp_dispatch_operation_get_n_channels: * @self: a dispatch operation * * * * Returns: the number of channels in this dispatch operation. */ guint mcp_dispatch_operation_get_n_channels (McpDispatchOperation *self) { McpDispatchOperationIface *iface = MCP_DISPATCH_OPERATION_GET_IFACE (self); g_return_val_if_fail (iface != NULL, 0); g_return_val_if_fail (iface->get_n_channels != NULL, 0); return iface->get_n_channels (self); } /** * mcp_dispatch_operation_get_nth_channel_path: * @self: a dispatch operation * @n: index of the channel to inspect * * * * Returns: the D-Bus object path of the @n'th channel (starting from 0), or * %NULL if @n is greater than or equal to * mcp_dispatch_operation_get_n_channels(). * The string is owned by @self and must not be freed; it is only valid as * long as a reference to @self is held. */ const gchar * mcp_dispatch_operation_get_nth_channel_path (McpDispatchOperation *self, guint n) { McpDispatchOperationIface *iface = MCP_DISPATCH_OPERATION_GET_IFACE (self); g_return_val_if_fail (iface != NULL, NULL); g_return_val_if_fail (iface->get_nth_channel_path != NULL, NULL); if (n >= mcp_dispatch_operation_get_n_channels (self)) { return NULL; /* not considered to be an error, to make iterating easy */ } return iface->get_nth_channel_path (self, n); } /** * mcp_dispatch_operation_ref_nth_channel_properties: * @self: a dispatch operation * @n: index of the channel to inspect * * Return the immutable properties of the @n'th channel (starting from 0), or * %NULL if @n is greater than or equal to * mcp_dispatch_operation_get_n_channels(). * * The keys of the hash table are strings and the values are in #GValue * structures, using the same representation as dbus-glib, tp_asv_get_string() * etc. Do not add or remove entries in this hash table. * * Returns: a reference to a hash table, which must be released with * g_hash_table_unref() by the caller */ GHashTable * mcp_dispatch_operation_ref_nth_channel_properties (McpDispatchOperation *self, guint n) { McpDispatchOperationIface *iface = MCP_DISPATCH_OPERATION_GET_IFACE (self); g_return_val_if_fail (iface != NULL, NULL); g_return_val_if_fail (iface->ref_nth_channel_properties != NULL, NULL); if (n >= mcp_dispatch_operation_get_n_channels (self)) { return NULL; /* not considered to be an error, to make iterating easy */ } return iface->ref_nth_channel_properties (self, n); } /** * mcp_dispatch_operation_start_delay: * @self: a dispatch operation * * Start to delay the dispatch operation, for instance while waiting for * an asynchronous operation to finish. The returned token must be passed to * mcp_dispatch_operation_end_delay() exactly once, at which point dispatching * will continue and the token becomes invalid. * * This is similar to an Observer delaying the return from ObserveChannels, * except that there is no time limit - a dispatch operation policy plugin * can delay the dispatch operation indefinitely. * * Returns: a token which can be used to end the delay */ McpDispatchOperationDelay * mcp_dispatch_operation_start_delay (McpDispatchOperation *self) { McpDispatchOperationIface *iface = MCP_DISPATCH_OPERATION_GET_IFACE (self); g_return_val_if_fail (iface != NULL, NULL); g_return_val_if_fail (iface->start_delay != NULL, NULL); return iface->start_delay (self); } /** * mcp_dispatch_operation_end_delay: * @self: a dispatch operation * @delay: a token obtained by calling mcp_dispatch_operation_start_delay() * on @self previously * * Stop delaying the dispatch operation, allowing dispatching to proceed. */ void mcp_dispatch_operation_end_delay (McpDispatchOperation *self, McpDispatchOperationDelay *delay) { McpDispatchOperationIface *iface = MCP_DISPATCH_OPERATION_GET_IFACE (self); g_return_if_fail (iface != NULL); g_return_if_fail (delay != NULL); g_return_if_fail (iface->end_delay != NULL); iface->end_delay (self, delay); } /** * mcp_dispatch_operation_leave_channels: * @self: a dispatch operation * @wait_for_observers: if %FALSE, leave the channels immediately; if %TRUE * (usually recommended), wait for Observers to reply first * @reason: the reason code to give * @message: a human-readable message provided by the user, or either the * empty string or %NULL if no message has been provided * * Leave all channels in this bundle by using RemoveMembersWithReason if the * channel has the Group interface, or Close if not. * * This method was intended for StreamedMedia channels, which (ab)used the * Group interface for call control. StreamedMedia channels have been * superseded by Call channels, which have a proper "hang up" method which * should be used instead. * * Deprecated: 5.15.1: Use tp_call_channel_hangup_async() to * hang up Call channels, mcp_dispatch_operation_close_channels() to close * generic channels, or mcp_dispatch_operation_destroy_channels() to * terminate the channel destructively. */ void mcp_dispatch_operation_leave_channels (McpDispatchOperation *self, gboolean wait_for_observers, TpChannelGroupChangeReason reason, const gchar *message) { McpDispatchOperationIface *iface = MCP_DISPATCH_OPERATION_GET_IFACE (self); g_return_if_fail (iface != NULL); g_return_if_fail (iface->leave_channels != NULL); if (message == NULL) message = ""; iface->leave_channels (self, wait_for_observers, reason, message); } /** * mcp_dispatch_operation_close_channels: * @self: a dispatch operation * @wait_for_observers: if %FALSE, close the channels immediately; if %TRUE * (usually recommended), wait for Observers to reply first * * Close all channels in this bundle by using the Close D-Bus method. * * Plugins that terminate an audio or audio/video call should * use tp_call_channel_hangup_async() instead. */ void mcp_dispatch_operation_close_channels (McpDispatchOperation *self, gboolean wait_for_observers) { McpDispatchOperationIface *iface = MCP_DISPATCH_OPERATION_GET_IFACE (self); g_return_if_fail (iface != NULL); g_return_if_fail (iface->close_channels != NULL); iface->close_channels (self, wait_for_observers); } /** * mcp_dispatch_operation_destroy_channels: * @self: a dispatch operation * @wait_for_observers: if %FALSE, close the channels immediately; if %TRUE * (usually recommended), wait for Observers to reply first * * Close all channels in this bundle destructively, by using the Destroy D-Bus * method if implemented, or the Close D-Bus method if not. * * Plugins that terminate an audio or audio/video call should * use tp_call_channel_hangup_async() instead. */ void mcp_dispatch_operation_destroy_channels (McpDispatchOperation *self, gboolean wait_for_observers) { McpDispatchOperationIface *iface = MCP_DISPATCH_OPERATION_GET_IFACE (self); g_return_if_fail (iface != NULL); g_return_if_fail (iface->destroy_channels != NULL); iface->destroy_channels (self, wait_for_observers); } /** * mcp_dispatch_operation_find_channel_by_type: * @self: a dispatch operation * @start_from: index at which to start searching, usually 0 * @handle_type: the handle type to match * @channel_type: the channel type to match * @ret_index: if not %NULL, used to return the index of the first matching * channel, suitable for use with * mcp_dispatch_operation_get_nth_channel_path() etc. * @ret_dup_path: if not %NULL, used to return the object path of the first * matching channel, which must be freed with g_free() * @ret_ref_immutable_properties: if not %NULL, used to return a reference to * immutable properties, as if via * mcp_dispatch_operation_ref_nth_channel_properties(), which must be * released with g_hash_table_unref() * @ret_ref_channel: if not %NULL, used to return a #TpChannel, which is not * guaranteed to be ready immediately, and must be released with * g_object_unref() * * Attempt to find a channel matching the given handle type and channel type * in the bundle. This is an easy way to test whether the bundle contains any * channels of interest to a particular plugin. * * Returns: %TRUE if a matching channel was found, or %FALSE (without touching * @ret_index, @ret_dup_path, @ret_ref_immutable_properties or * @ret_ref_channel) if not */ gboolean mcp_dispatch_operation_find_channel_by_type (McpDispatchOperation *self, guint start_from, TpHandleType handle_type, GQuark channel_type, guint *ret_index, gchar **ret_dup_path, GHashTable **ret_ref_immutable_properties, TpChannel **ret_ref_channel) { const gchar *channel_type_str = g_quark_to_string (channel_type); gboolean valid; guint i; g_return_val_if_fail (MCP_IS_DISPATCH_OPERATION (self), FALSE); g_return_val_if_fail (channel_type != 0, FALSE); for (i = start_from; i < mcp_dispatch_operation_get_n_channels (self); i++) { GHashTable *properties = mcp_dispatch_operation_ref_nth_channel_properties (self, i); const gchar *channel_path = mcp_dispatch_operation_get_nth_channel_path (self, i); if (properties != NULL && channel_path != NULL && !tp_strdiff (tp_asv_get_string (properties, TP_IFACE_CHANNEL ".ChannelType"), channel_type_str) && tp_asv_get_uint32 (properties, TP_IFACE_CHANNEL ".TargetHandleType", &valid) == handle_type && valid) { if (ret_index != NULL) *ret_index = i; if (ret_ref_immutable_properties != NULL) *ret_ref_immutable_properties = properties; else g_hash_table_unref (properties); if (ret_dup_path != NULL) *ret_dup_path = g_strdup (channel_path); if (ret_ref_channel != NULL) { /* FIXME: in next, this method should take a TpClientFactory * argument, and pass it on here */ TpConnection *connection = mcp_dispatch_operation_ref_connection (self); *ret_ref_channel = tp_simple_client_factory_ensure_channel ( tp_proxy_get_factory (connection), connection, channel_path, properties, NULL); g_object_unref (connection); } return TRUE; } g_hash_table_unref (properties); } return FALSE; } /** * mcp_dispatch_operation_ref_connection: * @self: a dispatch operation * * Return a #TpConnection object. It is not guaranteed to be ready immediately; * use tp_connection_call_when_ready(). * * Returns: a reference to a #TpConnection, which must be released with * g_object_unref() by the caller */ TpConnection * mcp_dispatch_operation_ref_connection (McpDispatchOperation *self) { TpDBusDaemon *dbus = tp_dbus_daemon_dup (NULL); TpConnection *connection = NULL; const gchar *conn_path; conn_path = mcp_dispatch_operation_get_connection_path (self); if (conn_path != NULL && dbus != NULL) { /* FIXME: in next, this method should take a TpClientFactory argument * instead of making a new one here */ TpSimpleClientFactory *factory = tp_simple_client_factory_new (dbus); connection = tp_simple_client_factory_ensure_connection (factory, conn_path, NULL, NULL); g_object_unref (factory); } g_object_unref (dbus); return connection; } /** * mcp_dispatch_operation_ref_nth_channel: * @self: a dispatch operation * @n: index of the channel to inspect * * Return a #TpChannel object. It is not guaranteed to be ready immediately; * use tp_channel_call_when_ready(). * * Returns: a reference to a #TpChannel, which must be released with * g_object_unref() by the caller, or %NULL if @n is too large */ TpChannel * mcp_dispatch_operation_ref_nth_channel (McpDispatchOperation *self, guint n) { /* FIXME: in next, this method should take a TpClientFactory argument, * and pass it on here */ TpConnection *connection = mcp_dispatch_operation_ref_connection (self); GHashTable *channel_properties = NULL; const gchar *channel_path = NULL; TpChannel *channel = NULL; if (connection == NULL) goto finally; channel_path = mcp_dispatch_operation_get_nth_channel_path (self, n); if (channel_path == NULL) goto finally; channel_properties = mcp_dispatch_operation_ref_nth_channel_properties (self, n); if (channel_properties == NULL) goto finally; channel = tp_simple_client_factory_ensure_channel ( tp_proxy_get_factory (connection), connection, channel_path, channel_properties, NULL); finally: tp_clear_object (&connection); tp_clear_pointer (&channel_properties, g_hash_table_unref); return channel; } telepathy-mission-control-5.16.4/mission-control-plugins/implementation.h0000644000175000017500000001054012735242352030036 0ustar00gkiagiagkiagia00000000000000/* Mission Control plugin API - internals, for MC to use * * Copyright © 2009-2010 Nokia Corporation * Copyright © 2009-2010 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef MCP_IMPLEMENTATION_H #define MCP_IMPLEMENTATION_H #include G_BEGIN_DECLS struct _McpRequestIface { GTypeInterface parent; /* Account */ const gchar * (*get_account_path) (McpRequest *self); const gchar * (*get_protocol) (McpRequest *self); const gchar * (*get_cm_name) (McpRequest *self); gint64 (*get_user_action_time) (McpRequest *self); guint (*get_n_requests) (McpRequest *self); GHashTable * (*ref_nth_request) (McpRequest *self, guint n); void (*deny) (McpRequest *self, GQuark domain, gint code, const gchar *message); /* Delay the request */ McpRequestDelay * (*start_delay) (McpRequest *self); void (*end_delay) (McpRequest *self, McpRequestDelay *delay); }; struct _McpDispatchOperationIface { GTypeInterface parent; /* Account and Connection */ const gchar * (*get_account_path) (McpDispatchOperation *self); const gchar * (*get_connection_path) (McpDispatchOperation *self); const gchar * (*get_protocol) (McpDispatchOperation *self); const gchar * (*get_cm_name) (McpDispatchOperation *self); /* Channels */ guint (*get_n_channels) (McpDispatchOperation *self); const gchar * (*get_nth_channel_path) (McpDispatchOperation *self, guint n); GHashTable * (*ref_nth_channel_properties) (McpDispatchOperation *self, guint n); /* Delay the dispatch */ McpDispatchOperationDelay * (*start_delay) (McpDispatchOperation *self); void (*end_delay) (McpDispatchOperation *self, McpDispatchOperationDelay *delay); /* Close */ void (*leave_channels) (McpDispatchOperation *self, gboolean wait_for_observers, TpChannelGroupChangeReason reason, const gchar *message); void (*close_channels) (McpDispatchOperation *self, gboolean wait_for_observers); void (*destroy_channels) (McpDispatchOperation *self, gboolean wait_for_observers); }; struct _McpAccountManagerIface { GTypeInterface parent; void (*set_value) (const McpAccountManager *ma, const gchar *acct, const gchar *key, const gchar *value); gchar * (*get_value) (const McpAccountManager *ma, const gchar *acct, const gchar *key); gboolean (*is_secret) (const McpAccountManager *ma, const gchar *acct, const gchar *key); void (* make_secret) (const McpAccountManager *ma, const gchar *acct, const gchar *key); gchar * (* unique_name) (const McpAccountManager *ma, const gchar *manager, const gchar *protocol, const GHashTable *params); GStrv (* list_keys) (const McpAccountManager *ma, const gchar *acct); gchar * (* escape_value_for_keyfile) (const McpAccountManager *mcpa, const GValue *value); gboolean (* unescape_value_from_keyfile) (const McpAccountManager *mcpa, const gchar *escaped, GValue *value, GError **error); gboolean (* init_value_for_attribute) (const McpAccountManager *mcpa, GValue *value, const gchar *attribute); gchar * (* escape_variant_for_keyfile) (const McpAccountManager *mcpa, GVariant *variant); void (* set_attribute) (const McpAccountManager *mcpa, const gchar *account, const gchar *attribute, GVariant *value, McpAttributeFlags flags); void (* set_parameter) (const McpAccountManager *mcpa, const gchar *account, const gchar *parameter, GVariant *value, McpParameterFlags flags); }; G_END_DECLS #endif telepathy-mission-control-5.16.4/mission-control-plugins/mcp-signals-marshal.list0000644000175000017500000000004712735241312031373 0ustar00gkiagiagkiagia00000000000000VOID:STRING,BOOLEAN VOID:STRING,STRING telepathy-mission-control-5.16.4/mission-control-plugins/dispatch-operation.h0000644000175000017500000000753612735242352030621 0ustar00gkiagiagkiagia00000000000000/* Mission Control plugin API - representation of a ChannelDispatchOperation * * Copyright (C) 2009 Nokia Corporation * Copyright (C) 2009 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef MCP_DISPATCH_OPERATION_H #define MCP_DISPATCH_OPERATION_H #ifndef _MCP_IN_MISSION_CONTROL_PLUGINS_H #error Use instead #endif #include G_BEGIN_DECLS typedef struct _McpDispatchOperation McpDispatchOperation; typedef struct _McpDispatchOperationIface McpDispatchOperationIface; /* Opaque token representing a DO being stalled until an asynchronous * policy action */ typedef struct _McpDispatchOperationDelay McpDispatchOperationDelay; #define MCP_TYPE_DISPATCH_OPERATION \ (mcp_dispatch_operation_get_type ()) #define MCP_DISPATCH_OPERATION(o) \ (G_TYPE_CHECK_INSTANCE_CAST ((o), MCP_TYPE_DISPATCH_OPERATION, \ McpDispatchOperation)) #define MCP_IS_DISPATCH_OPERATION(o) \ (G_TYPE_CHECK_INSTANCE_TYPE ((o), MCP_TYPE_DISPATCH_OPERATION)) #define MCP_DISPATCH_OPERATION_GET_IFACE(o) \ (G_TYPE_INSTANCE_GET_INTERFACE ((o), MCP_TYPE_DISPATCH_OPERATION, \ McpDispatchOperationIface)) GType mcp_dispatch_operation_get_type (void) G_GNUC_CONST; /* utility functions which will work on any implementation of this interface */ gboolean mcp_dispatch_operation_find_channel_by_type ( McpDispatchOperation *self, guint start_from, TpHandleType handle_type, GQuark channel_type, guint *ret_index, gchar **ret_dup_path, GHashTable **ret_ref_immutable_properties, TpChannel **ret_ref_channel); TpConnection *mcp_dispatch_operation_ref_connection ( McpDispatchOperation *self); TpChannel *mcp_dispatch_operation_ref_nth_channel (McpDispatchOperation *self, guint n); /* virtual methods */ const gchar *mcp_dispatch_operation_get_account_path ( McpDispatchOperation *self); const gchar *mcp_dispatch_operation_get_connection_path ( McpDispatchOperation *self); const gchar *mcp_dispatch_operation_get_protocol (McpDispatchOperation *self); const gchar *mcp_dispatch_operation_get_cm_name (McpDispatchOperation *self); guint mcp_dispatch_operation_get_n_channels (McpDispatchOperation *self); const gchar *mcp_dispatch_operation_get_nth_channel_path ( McpDispatchOperation *self, guint n); GHashTable *mcp_dispatch_operation_ref_nth_channel_properties ( McpDispatchOperation *self, guint n); McpDispatchOperationDelay *mcp_dispatch_operation_start_delay ( McpDispatchOperation *self); void mcp_dispatch_operation_end_delay (McpDispatchOperation *self, McpDispatchOperationDelay *delay); #ifndef MC_DISABLE_DEPRECATED G_DEPRECATED_FOR (mcp_dispatch_operation_close_channels or tp_call_channel_hangup_async) void mcp_dispatch_operation_leave_channels (McpDispatchOperation *self, gboolean wait_for_observers, TpChannelGroupChangeReason reason, const gchar *message); #endif void mcp_dispatch_operation_close_channels (McpDispatchOperation *self, gboolean wait_for_observers); void mcp_dispatch_operation_destroy_channels (McpDispatchOperation *self, gboolean wait_for_observers); G_END_DECLS #endif telepathy-mission-control-5.16.4/mission-control-plugins/Makefile.am0000644000175000017500000000437012735242352026700 0ustar00gkiagiagkiagia00000000000000INCLUDES = \ $(TELEPATHY_CFLAGS) \ $(DBUS_CFLAGS) \ $(GLIB_CFLAGS) \ -I$(top_srcdir) \ -I$(top_builddir) \ -DG_LOG_DOMAIN=\"mc-plugins\" \ -DMCP_API_VERSION=@MCP_API_VERSION@ \ -DMCP_ABI_VERSION=@MCP_ABI_VERSION@ AM_CFLAGS = $(ERROR_CFLAGS) EXTRA_DIST = mcp-signals-marshal.list lib_LTLIBRARIES = libmission-control-plugins.la plugins_includedir = \ $(includedir)/mission-control-@MCP_API_VERSION@/mission-control-plugins plugins_include_HEADERS = \ mission-control-plugins.h \ account.h \ account-storage.h \ dbus-acl.h \ debug.h \ dispatch-operation.h \ dispatch-operation-policy.h \ loader.h \ request.h \ request-policy.h \ $(NULL) nodist_plugins_include_HEADERS = \ mcp-signals-marshal.h \ $(NULL) libmission_control_plugins_la_LDFLAGS = \ -export-symbols-regex "^(mcp_)" \ -no-undefined -version-info "@MCP_LT_CURRENT@":"@MCP_LT_REVISION@":"@MCP_LT_AGE@" libmission_control_plugins_la_LIBADD = \ $(TELEPATHY_LIBS) \ $(DBUS_LIBS) \ $(GLIB_LIBS) \ $(NULL) nodist_libmission_control_plugins_la_SOURCES = \ mcp-signals-marshal.c \ mcp-signals-marshal.h libmission_control_plugins_la_SOURCES = \ debug-internal.h \ debug.h \ debug.c \ account.c \ account-storage.c \ dbus-acl.c \ dispatch-operation.c \ dispatch-operation-policy.c \ implementation.h \ loader.c \ request.c \ request-policy.c BUILT_SOURCES = $(nodist_libmission_control_plugins_la_SOURCES) Android.mk: Makefile.am $(BUILT_SOURCES) androgenizer -:PROJECT telepathy-mission-control \ -:SHARED libmission-control-plugins \ -:TAGS eng debug \ -:REL_TOP $(top_srcdir) -:ABS_TOP $(abs_top_srcdir) \ -:SOURCES $(BUILT_SOURCES) $(libmission_control_plugins_la_SOURCES) \ -:CFLAGS $(DEFAULT_INCLUDES) $(DEFS) $(CFLAGS) $(AM_CFLAGS) \ -:CPPFLAGS $(CPPFLAGS) $(AM_CPPFLAGS) $(INCLUDES) \ -:LDFLAGS $(libmission_control_plugins_la_LIBADD) \ > $@ CLEANFILES = $(BUILT_SOURCES) %-signals-marshal.h: %-signals-marshal.list Makefile $(AM_V_GEN)glib-genmarshal --header --prefix=_$(subst -,_,$(notdir $*))_marshal $< \ > $*-signals-marshal.h %-signals-marshal.c: %-signals-marshal.list Makefile $(AM_V_GEN){ echo '#include "$(notdir $*)-signals-marshal.h"' && \ glib-genmarshal --body --prefix=_$(subst -,_,$(notdir $*))_marshal $<; } \ > $*-signals-marshal.c telepathy-mission-control-5.16.4/mission-control-plugins/dispatch-operation-policy.h0000644000175000017500000000700612735241312032101 0ustar00gkiagiagkiagia00000000000000/* Mission Control plugin API - ChannelDispatchOperation policy hook. * * Copyright (C) 2009 Nokia Corporation * Copyright (C) 2009 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef MCP_DISPATCH_OPERATION_POLICY_H #define MCP_DISPATCH_OPERATION_POLICY_H #ifndef _MCP_IN_MISSION_CONTROL_PLUGINS_H #error Use instead #endif #include #include G_BEGIN_DECLS /* API for plugins to implement */ typedef struct _McpDispatchOperationPolicy McpDispatchOperationPolicy; typedef struct _McpDispatchOperationPolicyIface McpDispatchOperationPolicyIface; #define MCP_TYPE_DISPATCH_OPERATION_POLICY \ (mcp_dispatch_operation_policy_get_type ()) #define MCP_DISPATCH_OPERATION_POLICY(o) \ (G_TYPE_CHECK_INSTANCE_CAST ((o), MCP_TYPE_DISPATCH_OPERATION_POLICY, \ McpDispatchOperationPolicy)) #define MCP_IS_DISPATCH_OPERATION_POLICY(o) \ (G_TYPE_CHECK_INSTANCE_TYPE ((o), MCP_TYPE_DISPATCH_OPERATION_POLICY)) #define MCP_DISPATCH_OPERATION_POLICY_GET_IFACE(o) \ (G_TYPE_INSTANCE_GET_INTERFACE ((o), MCP_TYPE_DISPATCH_OPERATION_POLICY, \ McpDispatchOperationPolicyIface)) GType mcp_dispatch_operation_policy_get_type (void) G_GNUC_CONST; /* virtual methods */ typedef void (*McpDispatchOperationPolicyCb) ( McpDispatchOperationPolicy *policy, McpDispatchOperation *dispatch_operation); void mcp_dispatch_operation_policy_check (McpDispatchOperationPolicy *policy, McpDispatchOperation *dispatch_operation); typedef void (*McpDispatchOperationPolicyHandlerIsSuitableAsync) ( McpDispatchOperationPolicy *policy, TpClient *handler, const gchar *unique_name, McpDispatchOperation *dispatch_operation, GAsyncReadyCallback callback, gpointer user_data); typedef gboolean (*McpDispatchOperationPolicyFinisher) ( McpDispatchOperationPolicy *policy, GAsyncResult *result, GError **error); void mcp_dispatch_operation_policy_handler_is_suitable_async ( McpDispatchOperationPolicy *policy, TpClient *handler, const gchar *unique_name, McpDispatchOperation *dispatch_operation, GAsyncReadyCallback callback, gpointer user_data); gboolean mcp_dispatch_operation_policy_handler_is_suitable_finish ( McpDispatchOperationPolicy *policy, GAsyncResult *result, GError **error); void mcp_dispatch_operation_policy_iface_implement_check ( McpDispatchOperationPolicyIface *iface, McpDispatchOperationPolicyCb impl); struct _McpDispatchOperationPolicyIface { GTypeInterface parent; McpDispatchOperationPolicyCb check; McpDispatchOperationPolicyHandlerIsSuitableAsync handler_is_suitable_async; McpDispatchOperationPolicyFinisher handler_is_suitable_finish; }; G_END_DECLS #endif telepathy-mission-control-5.16.4/mission-control-plugins/dbus-acl.c0000644000175000017500000003122512735242352026501 0ustar00gkiagiagkiagia00000000000000/* Mission Control plugin API - DBus Caller ID. * * Copyright © 2010 Nokia Corporation * Copyright © 2010 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /** * SECTION:dbus-acl * @title: McpDBusAcl * @short_description: DBus ACLs, implemented by plugins * @see_also: * @include: mission-control-plugins/mission-control-plugins.h * * Plugins may implement #McpDBusAcl in order to provide checks on whether * a DBus method call or property get/set operation should be allowed. * * To do so, the plugin must implement a #GObject subclass that implements * #McpDBusAcl, then return an instance of that subclass from * mcp_plugin_ref_nth_object(). * * An implementation of this interface might look like this: * * * G_DEFINE_TYPE_WITH_CODE (APlugin, a_plugin, * G_TYPE_OBJECT, * G_IMPLEMENT_INTERFACE (...); * G_IMPLEMENT_INTERFACE (MCP_TYPE_DBUS_ACL, dbus_acl_iface_init); * G_IMPLEMENT_INTERFACE (...)) * /* ... */ * static void * dbus_acl_iface_init (McpDBusAclIface *iface, * gpointer unused G_GNUC_UNUSED) * { * iface->name = "APlugin"; * iface->desc = "A plugin that checks some conditions"; * iface->authorised = _authorised; * iface->authorised_async = _authorised_async; * } * * * A single object can implement more than one interface. */ #include "config.h" #include #include #include #include #include #define MCP_DEBUG_TYPE MCP_DEBUG_DBUS_ACL #define ACL_DEBUG(_p, _format, ...) \ DEBUG("%s: " _format, \ (_p != NULL) ? mcp_dbus_acl_name (_p) : "-", ##__VA_ARGS__) /** * McpDBusAclIface: * @parent: the parent type * @name: the name of the plugin, or %NULL to use the GObject class name * @desc: the description of the plugin, or %NULL * @authorised: an implementation of part of mcp_dbus_acl_authorised() * @authorised_async: an implementation of part of * mcp_dbus_acl_authorised_async() */ GType mcp_dbus_acl_get_type (void) { static gsize once = 0; static GType type = 0; if (g_once_init_enter (&once)) { static const GTypeInfo info = { sizeof (McpDBusAclIface), NULL, /* base_init */ NULL, /* base_finalize */ NULL, /* class_init */ NULL, /* class_finalize */ NULL, /* class_data */ 0, /* instance_size */ 0, /* n_preallocs */ NULL, /* instance_init */ NULL /* value_table */ }; type = g_type_register_static (G_TYPE_INTERFACE, "McpDBusAcl", &info, 0); g_type_interface_add_prerequisite (type, G_TYPE_OBJECT); g_once_init_leave (&once, 1); } return type; } static GList * cached_acls (void) { static gboolean acl_plugins_cached = FALSE; static GList *dbus_acls = NULL; const GList *p; if (acl_plugins_cached) return dbus_acls; /* insert the default storage plugin into the sorted plugin list */ for (p = mcp_list_objects(); p != NULL; p = g_list_next (p)) { if (MCP_IS_DBUS_ACL (p->data)) { dbus_acls = g_list_prepend (dbus_acls, g_object_ref (p->data)); } } acl_plugins_cached = TRUE; return dbus_acls; } static DBusAclAuthData * auth_data_new (TpDBusDaemon *dbus, const gchar *name, GHashTable *params) { DBusAclAuthData *data = g_slice_new0 (DBusAclAuthData); data->dbus = g_object_ref (dbus); data->params = (params != NULL) ? g_hash_table_ref (params) : NULL; data->name = g_strdup (name); return data; } static void auth_data_free (DBusAclAuthData *data) { data->cleanup (data->data); /* free the callback data */ tp_clear_pointer (&data->params, g_hash_table_unref); tp_clear_object (&data->dbus); g_free (data->name); g_slice_free (DBusAclAuthData, data); } /** * mcp_dbus_acl_iface_set_name: * @iface: an instance implementing McpDBusAclIface * @name: the plugin's name (used in debugging and some return values) * * Sets the name of the plugin. Intended for use by the plugin implementor. * * This is no longer necessary: just use "iface->name = name". **/ void mcp_dbus_acl_iface_set_name (McpDBusAclIface *iface, const gchar *name) { iface->name = name; } /** * mcp_dbus_acl_iface_set_desc: * @iface: an instance implementing McpDBusAclIface * @desc: the plugin's description * * Sets the plugin's description. Intended for use by the plugin implementor. * * This is no longer necessary: just use "iface->desc = desc". **/ void mcp_dbus_acl_iface_set_desc (McpDBusAclIface *iface, const gchar *desc) { iface->desc = desc; } /** * mcp_dbus_acl_iface_implement_authorised: * @iface: an instance implementing McpDBusAclIface * @method: the plugin's description * * Implements this plugin's part of the mcp_dbus_acl_authorised() method. * * This is no longer necessary: just use "iface->authorised = method". **/ void mcp_dbus_acl_iface_implement_authorised (McpDBusAclIface *iface, DBusAclAuthoriser method) { iface->authorised = method; } /** * mcp_dbus_acl_iface_implement_authorised_async: * @iface: an instance implementing McpDBusAclIface * @method: the plugin's description * * Implements this plugin's part of the mcp_dbus_acl_authorised_async() method. * * This is no longer necessary: just use "iface->authorised_async = method". **/ void mcp_dbus_acl_iface_implement_authorised_async (McpDBusAclIface *iface, DBusAclAsyncAuthoriser method) { iface->authorised_async = method; } /* FIXME: when we break ABI, this should move to src/ under a different name, * and mcp_dbus_acl_authorised() should be a trivial wrapper around * iface->authorised() */ /** * mcp_dbus_acl_authorised: * @dbus: a #TpDBusDaemon instance * @context: a #DBusGMethodInvocation corresponding to the DBus call * @type: a #DBusAclType value (method call, get or set property) * @name: the name of the method or property in question * @params: A #GHashTable of #gchar * / #GValue parameters relating to the * call which are deemed to be "of interest" for ACL plugins, or %NULL * * This method calls each #DBusAcl plugin's authorised method, set by * mcp_dbus_acl_iface_implement_authorised() * * How a plugin deals with @params is entirely plugin dependent. * * If any plugin returns %FALSE, the call is considered to be forbidden. * * Returns: a #gboolean - %TRUE for permitted, %FALSE for forbidden. **/ gboolean mcp_dbus_acl_authorised (const TpDBusDaemon *dbus, DBusGMethodInvocation *context, DBusAclType type, const gchar *name, const GHashTable *params) { GList *p; GList *acls = cached_acls (); gboolean permitted = TRUE; for (p = acls; permitted && p != NULL; p = g_list_next (p)) { McpDBusAcl *plugin = MCP_DBUS_ACL (p->data); McpDBusAclIface *iface = MCP_DBUS_ACL_GET_IFACE (p->data); ACL_DEBUG (plugin, "checking ACL for %s", name); if (iface->authorised != NULL) permitted = iface->authorised (plugin, dbus, context, type, name, params); if (!permitted) break; } if (!permitted) { GError *denied = NULL; const gchar *denier = mcp_dbus_acl_name (p->data); denied = g_error_new (DBUS_GERROR, DBUS_GERROR_ACCESS_DENIED, "permission denied by DBus ACL plugin '%s'", denier); dbus_g_method_return_error (context, denied); g_error_free (denied); } return permitted; } /** * mcp_dbus_acl_authorised_async_step: * @ad: a #DBusAclAuthData pointer * @permitted: whether the last plugin permitted the call being inspected * * This call is intended for use in the authorised_async mehod of a * #DBusAcl plugin - it allows the plugin to hand control back to the * overall ACL infrastructure, informing it of its decision as it does. **/ void mcp_dbus_acl_authorised_async_step (DBusAclAuthData *ad, gboolean permitted) { if (permitted) { while (ad->next_acl != NULL && ad->next_acl->data != NULL) { McpDBusAcl *plugin = MCP_DBUS_ACL (ad->next_acl->data); McpDBusAclIface *iface = MCP_DBUS_ACL_GET_IFACE (plugin); if (ad->acl != NULL) ACL_DEBUG (ad->acl, "passed ACL for %s", ad->name); /* take the next plugin off the next_acl list */ ad->next_acl = g_list_next (ad->next_acl); ad->acl = plugin; if (iface->authorised_async != NULL) { /* kick off the next async authoriser in the chain */ iface->authorised_async (plugin, ad); /* don't clean up, the next async acl will call us when it's * done: */ return; } } if (ad->acl != NULL) ACL_DEBUG (ad->acl, "passed final ACL for %s", ad->name); ad->handler (ad->context, ad->data); } else { const gchar *who = (ad->acl != NULL) ? mcp_dbus_acl_name (ad->acl) : NULL; GError *denied = g_error_new (DBUS_GERROR, DBUS_GERROR_ACCESS_DENIED, "%s permission denied by DBus ACL plugin '%s'", ad->name, (who != NULL) ? who : "*unknown*"); dbus_g_method_return_error (ad->context, denied); g_error_free (denied); } auth_data_free (ad); /* done with internal bookkeeping */ } /* FIXME: when we break ABI, this should move to src/ under a different name, * and mcp_dbus_acl_authorised_async() should be a trivial wrapper around * iface->authorised_async(); it should also use GIO-style asynchronicity */ /** * mcp_dbus_acl_authorised_async: * @dbus: a #TpDBusDaemon instance * @context: a #DBusGMethodInvocation corresponding to the DBus call * @type: a #DBusAclType value (method call, get or set property) * @name: the name of the method or property in question * @params: A #GHashTable of #gchar * / #GValue parameters relating to the * call which are deemed to be "of interest" for ACL plugins, or %NULL * @handler: callback to call if the ACL decides the call is permitted * @data: a #gpointer to pass to the @handler * @cleanup: a #GDestroyNotify to use to deallocate @data * * This method calls each #DBusAcl plugin's authorised_async method, set by * mcp_dbus_acl_iface_implement_authorised_async() * * How a plugin deals with @parameters is entirely plugin dependent. * * The plugin should implement an async (or at least non-blocking) * check, which should signal that it has finished by calling * mcp_dbus_acl_authorised_async_step() * * If all the plugins permit this call, then @handler will be invoked * with @context and @data as its arguments. * * @cleanup wll be called if the call is forbidden, or after @handler is * invoked. If the call is forbidden, a DBus error will be returned to the * caller automatically. * **/ void mcp_dbus_acl_authorised_async (TpDBusDaemon *dbus, DBusGMethodInvocation *context, DBusAclType type, const gchar *name, GHashTable *params, DBusAclAuthorised handler, gpointer data, GDestroyNotify cleanup) { GList *acls = cached_acls (); DBusAclAuthData *ad = auth_data_new (dbus, name, params); ad->acl = NULL; /* first step, there's no current ACL yet */ ad->type = type; ad->data = data; ad->cleanup = cleanup; ad->context = context; ad->handler = handler; ad->next_acl = acls; ACL_DEBUG (NULL, "DBus access ACL verification: %u rules for %s", g_list_length (acls), name); mcp_dbus_acl_authorised_async_step (ad, TRUE); } /* plugin meta-data */ const gchar * mcp_dbus_acl_name (const McpDBusAcl *self) { McpDBusAclIface *iface = MCP_DBUS_ACL_GET_IFACE (self); g_return_val_if_fail (iface != NULL, FALSE); if (iface->name == NULL) return G_OBJECT_TYPE_NAME (self); return iface->name; } const gchar * mcp_dbus_acl_description (const McpDBusAcl *self) { McpDBusAclIface *iface = MCP_DBUS_ACL_GET_IFACE (self); g_return_val_if_fail (iface != NULL, FALSE); if (iface->desc == NULL) return "(no description)"; return iface->desc; } telepathy-mission-control-5.16.4/mission-control-plugins/request-policy.c0000644000175000017500000001144612735241312027772 0ustar00gkiagiagkiagia00000000000000/* Mission Control plugin API - ChannelRequest policy hook. * * Copyright (C) 2009 Nokia Corporation * Copyright (C) 2009 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /** * SECTION:request-policy * @title: McpRequestPolicy * @short_description: Request-policy object, implemented by plugins * @see_also: #McpRequest * @include: mission-control-plugins/mission-control-plugins.h * * Plugins may implement #McpRequestPolicy in order to apply policy to * Telepathy channel requests passing through the Channel Dispatcher part of * Mission Control. The plugins are run just after the requesting client calls * the ChannelRequest.Proceed method, and can inspect the request, delay its * processing, and/or make it fail. * * To do so, the plugin must implement a #GObject subclass that implements * #McpRequestPolicy, then return an instance of that subclass from * mcp_plugin_ref_nth_object(). * * An implementation of this plugin might look like this: * * * G_DEFINE_TYPE_WITH_CODE (MyPlugin, my_plugin, * G_TYPE_OBJECT, * G_IMPLEMENT_INTERFACE (...); * G_IMPLEMENT_INTERFACE (MCP_TYPE_REQUEST_POLICY, * request_policy_iface_init); * G_IMPLEMENT_INTERFACE (...)) * /* ... */ * static void * request_policy_iface_init (McpRequestPolicyIface *iface, * gpointer unused G_GNUC_UNUSED) * { * iface->check = my_plugin_check_request; * } * * * A single object can implement more than one interface; for instance, it * may be useful to combine this interface with #McpDispatchOperationPolicy. */ #include "config.h" #include /** * McpRequestPolicyIface: * @parent: the parent type * @check: an implementation of mcp_request_policy_check(), or %NULL * to do nothing */ GType mcp_request_policy_get_type (void) { static gsize once = 0; static GType type = 0; if (g_once_init_enter (&once)) { static const GTypeInfo info = { sizeof (McpRequestPolicyIface), NULL, /* base_init */ NULL, /* base_finalize */ NULL, /* class_init */ NULL, /* class_finalize */ NULL, /* class_data */ 0, /* instance_size */ 0, /* n_preallocs */ NULL, /* instance_init */ NULL /* value_table */ }; type = g_type_register_static (G_TYPE_INTERFACE, "McpRequestPolicy", &info, 0); g_type_interface_add_prerequisite (type, G_TYPE_OBJECT); g_once_init_leave (&once, 1); } return type; } /** * McpRequestPolicyCb: * @policy: an implementation of this interface, provided by a plugin * @request: an object representing a channel request * * Signature of an implementation of mcp_request_policy_check(). */ /** * mcp_request_policy_check: * @policy: an implementation of this interface, provided by a plugin * @request: an object representing a channel request * * Check what to do with a channel request. Implementations of this method * can use methods on @request to examine the request, delay * processing, make the request fail, etc. in order to impose whatever policy * the plugin requires. * * Mission Control calls this function in each plugin just after the requesting * client calls the Proceed method on the Telepathy ChannelRequest. If the * plugin makes the request fail, this does not take effect until all plugins * have been notified. */ void mcp_request_policy_check (McpRequestPolicy *policy, McpRequest *request) { McpRequestPolicyIface *iface = MCP_REQUEST_POLICY_GET_IFACE (policy); g_return_if_fail (iface != NULL); if (iface->check != NULL) iface->check (policy, request); } /** * mcp_request_policy_iface_implement_check: * @iface: the interface * @impl: an implementation of the virtual method mcp_request_policy_check() * * This function is no longer needed, since #McpRequestPolicyIface is now * public API. Use "iface->check = impl" instead. */ void mcp_request_policy_iface_implement_check (McpRequestPolicyIface *iface, void (*impl) (McpRequestPolicy *, McpRequest *)) { iface->check = impl; } telepathy-mission-control-5.16.4/mission-control-plugins/Makefile.in0000644000175000017500000006370612762351617026726 0ustar00gkiagiagkiagia00000000000000# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__make_dryrun = \ { \ am__dry=no; \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ *) \ for am__flg in $$MAKEFLAGS; do \ case $$am__flg in \ *=*|--*) ;; \ *n*) am__dry=yes; break;; \ esac; \ done;; \ esac; \ test $$am__dry = yes; \ } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = mission-control-plugins DIST_COMMON = $(plugins_include_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/gtk-doc.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/tp-compiler-flag.m4 \ $(top_srcdir)/m4/tp-compiler-warnings.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(libdir)" \ "$(DESTDIR)$(plugins_includedir)" \ "$(DESTDIR)$(plugins_includedir)" LTLIBRARIES = $(lib_LTLIBRARIES) am__DEPENDENCIES_1 = libmission_control_plugins_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am_libmission_control_plugins_la_OBJECTS = debug.lo account.lo \ account-storage.lo dbus-acl.lo dispatch-operation.lo \ dispatch-operation-policy.lo loader.lo request.lo \ request-policy.lo nodist_libmission_control_plugins_la_OBJECTS = mcp-signals-marshal.lo libmission_control_plugins_la_OBJECTS = \ $(am_libmission_control_plugins_la_OBJECTS) \ $(nodist_libmission_control_plugins_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent libmission_control_plugins_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(AM_CFLAGS) $(CFLAGS) \ $(libmission_control_plugins_la_LDFLAGS) $(LDFLAGS) -o $@ DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; SOURCES = $(libmission_control_plugins_la_SOURCES) \ $(nodist_libmission_control_plugins_la_SOURCES) DIST_SOURCES = $(libmission_control_plugins_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac HEADERS = $(nodist_plugins_include_HEADERS) $(plugins_include_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACCOUNTS_CACHE_DIR = @ACCOUNTS_CACHE_DIR@ ACCOUNTS_DIR = @ACCOUNTS_DIR@ ACLOCAL = @ACLOCAL@ AEGIS_LIBS = @AEGIS_LIBS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DBUS_CFLAGS = @DBUS_CFLAGS@ DBUS_LIBS = @DBUS_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ERROR_CFLAGS = @ERROR_CFLAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GIO_UNIX_CFLAGS = @GIO_UNIX_CFLAGS@ GIO_UNIX_LIBS = @GIO_UNIX_LIBS@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_COMPILE_SCHEMAS = @GLIB_COMPILE_SCHEMAS@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ GLIB_MKENUMS = @GLIB_MKENUMS@ GREP = @GREP@ GSETTINGS_DISABLE_SCHEMAS_COMPILE = @GSETTINGS_DISABLE_SCHEMAS_COMPILE@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ HTML_DIR = @HTML_DIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBACCOUNTS_SSO_CFLAGS = @LIBACCOUNTS_SSO_CFLAGS@ LIBACCOUNTS_SSO_LIBS = @LIBACCOUNTS_SSO_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MCE_CFLAGS = @MCE_CFLAGS@ MCE_LIBS = @MCE_LIBS@ MCP_ABI_VERSION = @MCP_ABI_VERSION@ MCP_API_VERSION = @MCP_API_VERSION@ MCP_LT_AGE = @MCP_LT_AGE@ MCP_LT_CURRENT = @MCP_LT_CURRENT@ MCP_LT_REVISION = @MCP_LT_REVISION@ MKDIR_P = @MKDIR_P@ NETWORK_MANAGER_CFLAGS = @NETWORK_MANAGER_CFLAGS@ NETWORK_MANAGER_LIBS = @NETWORK_MANAGER_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PYTHON = @PYTHON@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TELEPATHY_CFLAGS = @TELEPATHY_CFLAGS@ TELEPATHY_LIBS = @TELEPATHY_LIBS@ UPOWER_GLIB_CFLAGS = @UPOWER_GLIB_CFLAGS@ UPOWER_GLIB_LIBS = @UPOWER_GLIB_LIBS@ VERSION = @VERSION@ XSLTPROC = @XSLTPROC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gsettingsschemadir = @gsettingsschemadir@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mctestsdir = @mctestsdir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ pluginlibdir = @pluginlibdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ INCLUDES = \ $(TELEPATHY_CFLAGS) \ $(DBUS_CFLAGS) \ $(GLIB_CFLAGS) \ -I$(top_srcdir) \ -I$(top_builddir) \ -DG_LOG_DOMAIN=\"mc-plugins\" \ -DMCP_API_VERSION=@MCP_API_VERSION@ \ -DMCP_ABI_VERSION=@MCP_ABI_VERSION@ AM_CFLAGS = $(ERROR_CFLAGS) EXTRA_DIST = mcp-signals-marshal.list lib_LTLIBRARIES = libmission-control-plugins.la plugins_includedir = \ $(includedir)/mission-control-@MCP_API_VERSION@/mission-control-plugins plugins_include_HEADERS = \ mission-control-plugins.h \ account.h \ account-storage.h \ dbus-acl.h \ debug.h \ dispatch-operation.h \ dispatch-operation-policy.h \ loader.h \ request.h \ request-policy.h \ $(NULL) nodist_plugins_include_HEADERS = \ mcp-signals-marshal.h \ $(NULL) libmission_control_plugins_la_LDFLAGS = \ -export-symbols-regex "^(mcp_)" \ -no-undefined -version-info "@MCP_LT_CURRENT@":"@MCP_LT_REVISION@":"@MCP_LT_AGE@" libmission_control_plugins_la_LIBADD = \ $(TELEPATHY_LIBS) \ $(DBUS_LIBS) \ $(GLIB_LIBS) \ $(NULL) nodist_libmission_control_plugins_la_SOURCES = \ mcp-signals-marshal.c \ mcp-signals-marshal.h libmission_control_plugins_la_SOURCES = \ debug-internal.h \ debug.h \ debug.c \ account.c \ account-storage.c \ dbus-acl.c \ dispatch-operation.c \ dispatch-operation-policy.c \ implementation.h \ loader.c \ request.c \ request-policy.c BUILT_SOURCES = $(nodist_libmission_control_plugins_la_SOURCES) CLEANFILES = $(BUILT_SOURCES) all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu mission-control-plugins/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu mission-control-plugins/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ } uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libmission-control-plugins.la: $(libmission_control_plugins_la_OBJECTS) $(libmission_control_plugins_la_DEPENDENCIES) $(EXTRA_libmission_control_plugins_la_DEPENDENCIES) $(AM_V_CCLD)$(libmission_control_plugins_la_LINK) -rpath $(libdir) $(libmission_control_plugins_la_OBJECTS) $(libmission_control_plugins_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/account-storage.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/account.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbus-acl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/debug.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dispatch-operation-policy.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dispatch-operation.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/loader.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mcp-signals-marshal.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/request-policy.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/request.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-nodist_plugins_includeHEADERS: $(nodist_plugins_include_HEADERS) @$(NORMAL_INSTALL) @list='$(nodist_plugins_include_HEADERS)'; test -n "$(plugins_includedir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(plugins_includedir)'"; \ $(MKDIR_P) "$(DESTDIR)$(plugins_includedir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(plugins_includedir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(plugins_includedir)" || exit $$?; \ done uninstall-nodist_plugins_includeHEADERS: @$(NORMAL_UNINSTALL) @list='$(nodist_plugins_include_HEADERS)'; test -n "$(plugins_includedir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(plugins_includedir)'; $(am__uninstall_files_from_dir) install-plugins_includeHEADERS: $(plugins_include_HEADERS) @$(NORMAL_INSTALL) @list='$(plugins_include_HEADERS)'; test -n "$(plugins_includedir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(plugins_includedir)'"; \ $(MKDIR_P) "$(DESTDIR)$(plugins_includedir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(plugins_includedir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(plugins_includedir)" || exit $$?; \ done uninstall-plugins_includeHEADERS: @$(NORMAL_UNINSTALL) @list='$(plugins_include_HEADERS)'; test -n "$(plugins_includedir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(plugins_includedir)'; $(am__uninstall_files_from_dir) ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(plugins_includedir)" "$(DESTDIR)$(plugins_includedir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) clean: clean-am clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-nodist_plugins_includeHEADERS \ install-plugins_includeHEADERS install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-libLTLIBRARIES install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-libLTLIBRARIES \ uninstall-nodist_plugins_includeHEADERS \ uninstall-plugins_includeHEADERS .MAKE: all check install install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libLTLIBRARIES clean-libtool ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am \ install-libLTLIBRARIES install-man \ install-nodist_plugins_includeHEADERS install-pdf \ install-pdf-am install-plugins_includeHEADERS install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \ uninstall-am uninstall-libLTLIBRARIES \ uninstall-nodist_plugins_includeHEADERS \ uninstall-plugins_includeHEADERS Android.mk: Makefile.am $(BUILT_SOURCES) androgenizer -:PROJECT telepathy-mission-control \ -:SHARED libmission-control-plugins \ -:TAGS eng debug \ -:REL_TOP $(top_srcdir) -:ABS_TOP $(abs_top_srcdir) \ -:SOURCES $(BUILT_SOURCES) $(libmission_control_plugins_la_SOURCES) \ -:CFLAGS $(DEFAULT_INCLUDES) $(DEFS) $(CFLAGS) $(AM_CFLAGS) \ -:CPPFLAGS $(CPPFLAGS) $(AM_CPPFLAGS) $(INCLUDES) \ -:LDFLAGS $(libmission_control_plugins_la_LIBADD) \ > $@ %-signals-marshal.h: %-signals-marshal.list Makefile $(AM_V_GEN)glib-genmarshal --header --prefix=_$(subst -,_,$(notdir $*))_marshal $< \ > $*-signals-marshal.h %-signals-marshal.c: %-signals-marshal.list Makefile $(AM_V_GEN){ echo '#include "$(notdir $*)-signals-marshal.h"' && \ glib-genmarshal --body --prefix=_$(subst -,_,$(notdir $*))_marshal $<; } \ > $*-signals-marshal.c # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: telepathy-mission-control-5.16.4/mission-control-plugins/request.h0000644000175000017500000000515212735241312026477 0ustar00gkiagiagkiagia00000000000000/* Mission Control plugin API - representation of a ChannelRequest * * Copyright © 2009 Nokia Corporation * Copyright © 2009-2010 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef MCP_REQUEST_H #define MCP_REQUEST_H #ifndef _MCP_IN_MISSION_CONTROL_PLUGINS_H #error Use instead #endif #include G_BEGIN_DECLS typedef struct _McpRequest McpRequest; typedef struct _McpRequestIface McpRequestIface; /* Opaque token representing a request being stalled until an asynchronous * policy action */ typedef struct _McpRequestDelay McpRequestDelay; #define MCP_TYPE_REQUEST \ (mcp_request_get_type ()) #define MCP_REQUEST(o) \ (G_TYPE_CHECK_INSTANCE_CAST ((o), MCP_TYPE_REQUEST, McpRequest)) #define MCP_IS_REQUEST(o) \ (G_TYPE_CHECK_INSTANCE_TYPE ((o), MCP_TYPE_REQUEST)) #define MCP_REQUEST_GET_IFACE(o) \ (G_TYPE_INSTANCE_GET_INTERFACE ((o), MCP_TYPE_REQUEST, \ McpRequestIface)) GType mcp_request_get_type (void) G_GNUC_CONST; /* utility functions which will work on any implementation of this interface */ gboolean mcp_request_find_request_by_type (McpRequest *self, guint start_from, GQuark channel_type, guint *ret_index, GHashTable **ret_ref_requested_properties); /* virtual methods */ const gchar *mcp_request_get_account_path (McpRequest *self); const gchar *mcp_request_get_protocol (McpRequest *self); const gchar *mcp_request_get_cm_name (McpRequest *self); gint64 mcp_request_get_user_action_time (McpRequest *self); guint mcp_request_get_n_requests (McpRequest *self); GHashTable *mcp_request_ref_nth_request (McpRequest *self, guint n); void mcp_request_deny (McpRequest *self, GQuark domain, gint code, const gchar *message); McpRequestDelay *mcp_request_start_delay (McpRequest *self); void mcp_request_end_delay (McpRequest *self, McpRequestDelay *delay); G_END_DECLS #endif telepathy-mission-control-5.16.4/COPYING0000644000175000017500000006364412735241312021065 0ustar00gkiagiagkiagia00000000000000 GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things. To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. ^L Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. ^L GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. ^L Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. ^L 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. ^L 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. ^L 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. ^L 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS ^L How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! telepathy-mission-control-5.16.4/AUTHORS0000644000175000017500000000041312735241312021063 0ustar00gkiagiagkiagia00000000000000Alberto Mardegan Marco Barisione Naba Kumar Simon McVittie Vivek Dasmohapatra Will Thompson telepathy-mission-control-5.16.4/mission-control-plugins.pc.in0000644000175000017500000000077112735241312025571 0ustar00gkiagiagkiagia00000000000000prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ libexecdir=@libexecdir@ includedir=@includedir@ MCP_API_VERSION=@MCP_API_VERSION@ MCP_ABI_VERSION=@MCP_ABI_VERSION@ plugindir=${libdir}/mission-control-plugins.@MCP_ABI_VERSION@ missioncontrolpath=${libexecdir}/mission-control-5 Name: mission-control-plugins Description: Mission Control plugin API Requires: telepathy-glib Version: @VERSION@ Libs: -L${libdir} -lmission-control-plugins Cflags: -I${includedir}/mission-control-${MCP_API_VERSION} telepathy-mission-control-5.16.4/plugins/0000755000175000017500000000000012762352247021510 5ustar00gkiagiagkiagia00000000000000telepathy-mission-control-5.16.4/plugins/mcp-dbus-aegis-acl.c0000644000175000017500000002661312735242352025214 0ustar00gkiagiagkiagia00000000000000/* * A pseudo-plugin that checks the caller's Aegis permission tokens * * Copyright © 2010-2011 Nokia Corporation * Copyright © 2010-2011 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "config.h" #ifdef G_LOG_DOMAIN #undef G_LOG_DOMAIN #endif #define G_LOG_DOMAIN "mission-control-DBus-Access-ACL" #define DEBUG(_f, ...) MCP_DEBUG (MCP_DEBUG_DBUS_ACL, _f, ##__VA_ARGS__) #include #include #include #include #include #include typedef struct _AegisAcl AegisAcl; typedef struct _AegisAclClass AegisAclClass; struct _AegisAcl { GObject parent; }; struct _AegisAclClass { GObjectClass parent_class; }; #define CREATE_CHANNEL TP_IFACE_CONNECTION_INTERFACE_REQUESTS ".CreateChannel" #define ENSURE_CHANNEL TP_IFACE_CONNECTION_INTERFACE_REQUESTS ".EnsureChannel" #define SEND_MESSAGE \ TP_IFACE_CHANNEL_DISPATCHER ".Interface.Messages.DRAFT.SendMessage" #define AEGIS_CALL_TOKEN "Cellular" /* implemented by the Aegis-patched dbus-daemon */ #define AEGIS_INTERFACE "com.meego.DBus.Creds" #define PLUGIN_NAME "dbus-aegis-acl" #define PLUGIN_DESCRIPTION \ "This plugin uses libcreds to check the aegis security tokens " \ "associated with the calling process ID and determine whether " \ "the DBus call or property access should be allowed" static creds_value_t aegis_token = CREDS_BAD; static creds_type_t aegis_type = CREDS_BAD; static void aegis_acl_iface_init (McpDBusAclIface *, gpointer); static void aegis_cdo_policy_iface_init (McpDispatchOperationPolicyIface *, gpointer); static GType aegis_acl_get_type (void); G_DEFINE_TYPE_WITH_CODE (AegisAcl, aegis_acl, G_TYPE_OBJECT, G_IMPLEMENT_INTERFACE (MCP_TYPE_DBUS_ACL, aegis_acl_iface_init); G_IMPLEMENT_INTERFACE (MCP_TYPE_DISPATCH_OPERATION_POLICY, aegis_cdo_policy_iface_init)) static void aegis_acl_init (AegisAcl *self) { } static void aegis_acl_class_init (AegisAclClass *cls) { if (aegis_type != CREDS_BAD) return; aegis_type = creds_str2creds (AEGIS_CALL_TOKEN, &aegis_token); } static gchar *restricted_methods[] = { CREATE_CHANNEL, ENSURE_CHANNEL, SEND_MESSAGE, NULL }; static gboolean method_is_filtered (const gchar *method) { guint i; for (i = 0; restricted_methods[i] != NULL; i++) { if (!tp_strdiff (method, restricted_methods[i])) return TRUE; } return FALSE; } static gboolean is_filtered (DBusAclType type, const gchar *name, const GHashTable *params) { const GValue *account = NULL; const gchar *path = NULL; /* only bothered with method calls */ if (type != DBUS_ACL_TYPE_METHOD) return FALSE; /* only create/ensure channel concern us (and send message, now): */ if (!method_is_filtered (name)) return FALSE; /* must have at least the account-path to check */ if (params == NULL) return FALSE; account = g_hash_table_lookup ((GHashTable *) params, "account-path"); if (account == NULL) return FALSE; path = g_value_get_string (account); DEBUG ("should we check account %s?", path); /* account must belong to the ring or MMS connection manager: */ if (g_str_has_prefix (path, TP_ACCOUNT_OBJECT_PATH_BASE "ring/") || g_str_has_prefix (path, TP_ACCOUNT_OBJECT_PATH_BASE "mmscm/")) return TRUE; return FALSE; } /* For simplicity we don't implement non-trivial conversion between * dbus-glib's arrays of guint, and libcreds' arrays of uint32_t. * If this assertion fails on your platform, you'll need to implement it. */ G_STATIC_ASSERT (sizeof (guint) == sizeof (uint32_t)); static gboolean caller_creds_are_enough (const gchar *name, const GArray *au) { creds_t caller_creds = creds_import ((const uint32_t *) au->data, au->len); gboolean ok = creds_have_p (caller_creds, aegis_type, aegis_token); #ifdef ENABLE_DEBUG if (ok) { DEBUG ("Caller %s is appropriately privileged", name); } else { char buf[1024]; creds_type_t debug_type; creds_value_t debug_value; int i = 0; DEBUG ("Caller %s has these credentials:", name); while ((debug_type = creds_list (caller_creds, i++, &debug_value)) != CREDS_BAD) { creds_creds2str (debug_type, debug_value, buf, sizeof (buf)); DEBUG ("- %s", buf); } DEBUG ("but they are insufficient"); } #endif creds_free (caller_creds); return ok; } static gboolean check_peer_creds_sync (DBusGConnection *dgc, const gchar *bus_name, gboolean activate) { DBusGProxy *proxy = dbus_g_proxy_new_for_name (dgc, DBUS_SERVICE_DBUS, DBUS_PATH_DBUS, AEGIS_INTERFACE); GArray *au = NULL; GError *error = NULL; gboolean ok = FALSE; if (dbus_g_proxy_call (proxy, "GetConnectionCredentials", &error, G_TYPE_STRING, bus_name, G_TYPE_INVALID, DBUS_TYPE_G_UINT_ARRAY, &au, G_TYPE_INVALID)) { ok = caller_creds_are_enough (bus_name, au); g_array_unref (au); } else if (activate && error->code == DBUS_GERROR_NAME_HAS_NO_OWNER) { guint status; GError *start_error = NULL; DBusGProxy *dbus = dbus_g_proxy_new_for_name (dgc, DBUS_SERVICE_DBUS, DBUS_PATH_DBUS, DBUS_INTERFACE_DBUS); DEBUG ("Trying to activate %s for aegis credentials check", bus_name); if (dbus_g_proxy_call (dbus, "StartServiceByName", &start_error, G_TYPE_STRING, bus_name, G_TYPE_UINT, 0, G_TYPE_INVALID, G_TYPE_UINT, &status, G_TYPE_INVALID)) { ok = check_peer_creds_sync (dgc, bus_name, FALSE); } else { DEBUG ("GetConnectionCredentials failed: %s", start_error->message); g_clear_error (&start_error); } g_object_unref (dbus); g_clear_error (&error); } else { DEBUG ("GetConnectionCredentials failed: %s", error->message); g_clear_error (&error); ok = FALSE; } g_object_unref (proxy); return ok; } static gboolean caller_authorised (const McpDBusAcl *self, const TpDBusDaemon *dbus, const DBusGMethodInvocation *call, DBusAclType type, const gchar *name, const GHashTable *params) { DBusGConnection *dgc = tp_proxy_get_dbus_connection ((TpDBusDaemon *)dbus); gboolean ok = TRUE; if (is_filtered (type, name, params)) { gchar *caller = dbus_g_method_get_sender ((DBusGMethodInvocation *) call); ok = check_peer_creds_sync (dgc, caller, FALSE); g_free (caller); } DEBUG ("sync Aegis ACL check [%s]", ok ? "Allowed" : "Forbidden"); return ok; } static void async_authorised_cb (DBusGProxy *proxy, DBusGProxyCall *call, gpointer data) { GError *error = NULL; DBusAclAuthData *ad = data; GArray *au = NULL; const McpDBusAcl *self = ad->acl; gboolean permitted = FALSE; /* if this returns FALSE, there are no credentials, which means something * untrustworthy is going on, which in turn means we must deny: can't * authorise without first authenticating */ permitted = dbus_g_proxy_end_call (proxy, call, &error, DBUS_TYPE_G_UINT_ARRAY, &au, G_TYPE_INVALID); if (permitted) { permitted = caller_creds_are_enough (ad->name, au); g_array_unref (au); } else { DEBUG ("GetConnectionCredentials failed: %s", error->message); g_clear_error (&error); } DEBUG ("finished async Aegis ACL check [%s]", permitted ? "Allowed" : "Forbidden"); mcp_dbus_acl_authorised_async_step (ad, permitted); g_object_unref (proxy); } static void caller_async_authorised (const McpDBusAcl *self, DBusAclAuthData *data) { DEBUG ("starting async caller-permission ACL check"); if (is_filtered (data->type, data->name, data->params)) { DBusGConnection *dgc; DBusGProxy *proxy; gchar *caller = dbus_g_method_get_sender (data->context); dgc = tp_proxy_get_dbus_connection (data->dbus); proxy = dbus_g_proxy_new_for_name (dgc, DBUS_SERVICE_DBUS, DBUS_PATH_DBUS, AEGIS_INTERFACE); dbus_g_proxy_begin_call (proxy, "GetConnectionCredentials", async_authorised_cb, data, NULL, G_TYPE_STRING, caller, G_TYPE_INVALID); g_free (caller); } else { mcp_dbus_acl_authorised_async_step (data, TRUE); } } static void aegis_acl_iface_init (McpDBusAclIface *iface, gpointer unused G_GNUC_UNUSED) { mcp_dbus_acl_iface_set_name (iface, PLUGIN_NAME); mcp_dbus_acl_iface_set_desc (iface, PLUGIN_DESCRIPTION); mcp_dbus_acl_iface_implement_authorised (iface, caller_authorised); mcp_dbus_acl_iface_implement_authorised_async (iface, caller_async_authorised); } static gchar *restricted_cms[] = { "ring", "mmscm", NULL }; static inline gboolean cm_is_restricted (const gchar *cm_name) { guint i; for (i = 0; restricted_cms[i] != NULL; i++) { if (!tp_strdiff (restricted_cms[i], cm_name)) return TRUE; } return FALSE; } static void handler_is_suitable_async (McpDispatchOperationPolicy *self, TpClient *recipient, const gchar *unique_name, McpDispatchOperation *dispatch_op, GAsyncReadyCallback callback, gpointer user_data) { const gchar *manager = mcp_dispatch_operation_get_cm_name (dispatch_op); GSimpleAsyncResult *simple = g_simple_async_result_new ((GObject *) self, callback, user_data, handler_is_suitable_async); gboolean ok = TRUE; if (cm_is_restricted (manager)) { TpDBusDaemon *dbus = tp_dbus_daemon_dup (NULL); /* if MC started successfully, we ought to have one */ g_assert (dbus != NULL); if (!tp_str_empty (unique_name)) { ok = check_peer_creds_sync (tp_proxy_get_dbus_connection (dbus), unique_name, TRUE); } else { g_assert (recipient != NULL); ok = check_peer_creds_sync (tp_proxy_get_dbus_connection (dbus), tp_proxy_get_bus_name (recipient), TRUE); } if (!ok) { g_simple_async_result_set_error (simple, TP_ERROR, TP_ERROR_PERMISSION_DENIED, "insufficient Aegis credentials"); } g_object_unref (dbus); } DEBUG ("sync Aegis CDO policy check [%s]", ok ? "Allowed" : "Forbidden"); g_simple_async_result_complete_in_idle (simple); g_object_unref (simple); } static void aegis_cdo_policy_iface_init (McpDispatchOperationPolicyIface *iface, gpointer unused G_GNUC_UNUSED) { iface->handler_is_suitable_async = handler_is_suitable_async; /* the default finish function accepts our GSimpleAsyncResult */ } GObject * aegis_acl_new (void) { return g_object_new (aegis_acl_get_type (), NULL); } telepathy-mission-control-5.16.4/plugins/Makefile.am0000644000175000017500000000070512735242352023541 0ustar00gkiagiagkiagia00000000000000INCLUDES = \ $(TELEPATHY_CFLAGS) \ $(DBUS_CFLAGS) \ $(GLIB_CFLAGS) \ -I$(top_srcdir) \ -I$(top_builddir) \ -DLIBDIR="@libdir@" \ -DLIBVERSION="@MCP_ABI_VERSION@" noinst_LTLIBRARIES = if ENABLE_AEGIS noinst_LTLIBRARIES += libmcp-aegis.la libmcp_aegis_la_SOURCES = mcp-dbus-aegis-acl.c libmcp_aegis_la_LIBADD = \ $(top_builddir)/mission-control-plugins/libmission-control-plugins.la \ $(TELEPATHY_LIBS) \ $(DBUS_LIBS) \ $(AEGIS_LIBS) endif telepathy-mission-control-5.16.4/plugins/Makefile.in0000644000175000017500000004426012762351617023563 0ustar00gkiagiagkiagia00000000000000# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__make_dryrun = \ { \ am__dry=no; \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ *) \ for am__flg in $$MAKEFLAGS; do \ case $$am__flg in \ *=*|--*) ;; \ *n*) am__dry=yes; break;; \ esac; \ done;; \ esac; \ test $$am__dry = yes; \ } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ @ENABLE_AEGIS_TRUE@am__append_1 = libmcp-aegis.la subdir = plugins DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/gtk-doc.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/tp-compiler-flag.m4 \ $(top_srcdir)/m4/tp-compiler-warnings.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) am__DEPENDENCIES_1 = @ENABLE_AEGIS_TRUE@libmcp_aegis_la_DEPENDENCIES = $(top_builddir)/mission-control-plugins/libmission-control-plugins.la \ @ENABLE_AEGIS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ @ENABLE_AEGIS_TRUE@ $(am__DEPENDENCIES_1) am__libmcp_aegis_la_SOURCES_DIST = mcp-dbus-aegis-acl.c @ENABLE_AEGIS_TRUE@am_libmcp_aegis_la_OBJECTS = mcp-dbus-aegis-acl.lo libmcp_aegis_la_OBJECTS = $(am_libmcp_aegis_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent @ENABLE_AEGIS_TRUE@am_libmcp_aegis_la_rpath = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; SOURCES = $(libmcp_aegis_la_SOURCES) DIST_SOURCES = $(am__libmcp_aegis_la_SOURCES_DIST) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACCOUNTS_CACHE_DIR = @ACCOUNTS_CACHE_DIR@ ACCOUNTS_DIR = @ACCOUNTS_DIR@ ACLOCAL = @ACLOCAL@ AEGIS_LIBS = @AEGIS_LIBS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DBUS_CFLAGS = @DBUS_CFLAGS@ DBUS_LIBS = @DBUS_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ERROR_CFLAGS = @ERROR_CFLAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GIO_UNIX_CFLAGS = @GIO_UNIX_CFLAGS@ GIO_UNIX_LIBS = @GIO_UNIX_LIBS@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_COMPILE_SCHEMAS = @GLIB_COMPILE_SCHEMAS@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ GLIB_MKENUMS = @GLIB_MKENUMS@ GREP = @GREP@ GSETTINGS_DISABLE_SCHEMAS_COMPILE = @GSETTINGS_DISABLE_SCHEMAS_COMPILE@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ HTML_DIR = @HTML_DIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBACCOUNTS_SSO_CFLAGS = @LIBACCOUNTS_SSO_CFLAGS@ LIBACCOUNTS_SSO_LIBS = @LIBACCOUNTS_SSO_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MCE_CFLAGS = @MCE_CFLAGS@ MCE_LIBS = @MCE_LIBS@ MCP_ABI_VERSION = @MCP_ABI_VERSION@ MCP_API_VERSION = @MCP_API_VERSION@ MCP_LT_AGE = @MCP_LT_AGE@ MCP_LT_CURRENT = @MCP_LT_CURRENT@ MCP_LT_REVISION = @MCP_LT_REVISION@ MKDIR_P = @MKDIR_P@ NETWORK_MANAGER_CFLAGS = @NETWORK_MANAGER_CFLAGS@ NETWORK_MANAGER_LIBS = @NETWORK_MANAGER_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PYTHON = @PYTHON@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TELEPATHY_CFLAGS = @TELEPATHY_CFLAGS@ TELEPATHY_LIBS = @TELEPATHY_LIBS@ UPOWER_GLIB_CFLAGS = @UPOWER_GLIB_CFLAGS@ UPOWER_GLIB_LIBS = @UPOWER_GLIB_LIBS@ VERSION = @VERSION@ XSLTPROC = @XSLTPROC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gsettingsschemadir = @gsettingsschemadir@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mctestsdir = @mctestsdir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ pluginlibdir = @pluginlibdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ INCLUDES = \ $(TELEPATHY_CFLAGS) \ $(DBUS_CFLAGS) \ $(GLIB_CFLAGS) \ -I$(top_srcdir) \ -I$(top_builddir) \ -DLIBDIR="@libdir@" \ -DLIBVERSION="@MCP_ABI_VERSION@" noinst_LTLIBRARIES = $(am__append_1) @ENABLE_AEGIS_TRUE@libmcp_aegis_la_SOURCES = mcp-dbus-aegis-acl.c @ENABLE_AEGIS_TRUE@libmcp_aegis_la_LIBADD = \ @ENABLE_AEGIS_TRUE@ $(top_builddir)/mission-control-plugins/libmission-control-plugins.la \ @ENABLE_AEGIS_TRUE@ $(TELEPATHY_LIBS) \ @ENABLE_AEGIS_TRUE@ $(DBUS_LIBS) \ @ENABLE_AEGIS_TRUE@ $(AEGIS_LIBS) all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu plugins/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu plugins/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libmcp-aegis.la: $(libmcp_aegis_la_OBJECTS) $(libmcp_aegis_la_DEPENDENCIES) $(EXTRA_libmcp_aegis_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(am_libmcp_aegis_la_rpath) $(libmcp_aegis_la_OBJECTS) $(libmcp_aegis_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mcp-dbus-aegis-acl.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: telepathy-mission-control-5.16.4/doc/0000755000175000017500000000000012762352250020566 5ustar00gkiagiagkiagia00000000000000telepathy-mission-control-5.16.4/doc/reference/0000755000175000017500000000000012762352250022524 5ustar00gkiagiagkiagia00000000000000telepathy-mission-control-5.16.4/doc/reference/mission-control-plugins/0000755000175000017500000000000012762352250027342 5ustar00gkiagiagkiagia00000000000000telepathy-mission-control-5.16.4/doc/reference/mission-control-plugins/mission-control-plugins.types0000644000175000017500000000025312762352250035246 0ustar00gkiagiagkiagia00000000000000mcp_account_manager_get_type mcp_dbus_acl_get_type mcp_dispatch_operation_get_type mcp_dispatch_operation_policy_get_type mcp_request_get_type mcp_request_policy_get_type mission-control-plugins-sections.txt0000644000175000017500000001155112762352250036472 0ustar00gkiagiagkiagia00000000000000telepathy-mission-control-5.16.4/doc/reference/mission-control-plugins
account mcp_account_manager_set_value mcp_account_manager_set_attribute mcp_account_manager_set_parameter mcp_account_manager_get_value mcp_account_manager_parameter_is_secret mcp_account_manager_parameter_make_secret mcp_account_manager_get_unique_name mcp_account_manager_list_keys mcp_account_manager_escape_value_for_keyfile mcp_account_manager_escape_variant_for_keyfile mcp_account_manager_unescape_value_from_keyfile mcp_account_manager_init_value_for_attribute MCP_ACCOUNT_MANAGER MCP_ACCOUNT_MANAGER_GET_IFACE MCP_IS_ACCOUNT_MANAGER MCP_TYPE_ACCOUNT_MANAGER McpAccountManager McpAccountManagerIface mcp_account_manager_get_type
account-storage MCP_ACCOUNT_STORAGE_PLUGIN_PRIO_READONLY MCP_ACCOUNT_STORAGE_PLUGIN_PRIO_DEFAULT MCP_ACCOUNT_STORAGE_PLUGIN_PRIO_NORMAL MCP_ACCOUNT_STORAGE_PLUGIN_PRIO_KEYRING McpAccountStorage mcp_account_storage_priority mcp_account_storage_get mcp_account_storage_set mcp_account_storage_create mcp_account_storage_delete mcp_account_storage_ready mcp_account_storage_commit mcp_account_storage_commit_one mcp_account_storage_list mcp_account_storage_get_identifier mcp_account_storage_get_additional_info mcp_account_storage_get_restrictions mcp_account_storage_name mcp_account_storage_description mcp_account_storage_provider mcp_account_storage_owns mcp_account_storage_set_attribute mcp_account_storage_set_parameter mcp_account_storage_emit_created mcp_account_storage_emit_altered mcp_account_storage_emit_altered_one mcp_account_storage_emit_deleted mcp_account_storage_emit_toggled mcp_account_storage_emit_reconnect McpAccountStorageIface
dbus-acl McpDBusAcl DBusAclAuthorised DBusAclType DBusAclAuthData DBusAclAuthoriser DBusAclAsyncAuthoriser mcp_dbus_acl_authorised_async_step mcp_dbus_acl_authorised_async mcp_dbus_acl_authorised mcp_dbus_acl_iface_set_name mcp_dbus_acl_iface_set_desc mcp_dbus_acl_iface_implement_authorised mcp_dbus_acl_iface_implement_authorised_async mcp_dbus_acl_name mcp_dbus_acl_description MCP_DBUS_ACL MCP_DBUS_ACL_GET_IFACE MCP_IS_DBUS_ACL MCP_TYPE_DBUS_ACL McpDBusAcl McpDBusAclIface mcp_dbus_acl_get_type
debug MCP_DEBUG McpDebugFlags mcp_is_debugging mcp_debug_init
dispatch-operation mcp_dispatch_operation_find_channel_by_type mcp_dispatch_operation_ref_connection mcp_dispatch_operation_ref_nth_channel mcp_dispatch_operation_get_account_path mcp_dispatch_operation_get_connection_path mcp_dispatch_operation_get_protocol mcp_dispatch_operation_get_cm_name mcp_dispatch_operation_get_n_channels mcp_dispatch_operation_get_nth_channel_path mcp_dispatch_operation_ref_nth_channel_properties mcp_dispatch_operation_start_delay mcp_dispatch_operation_end_delay mcp_dispatch_operation_leave_channels mcp_dispatch_operation_close_channels mcp_dispatch_operation_destroy_channels McpDispatchOperationDelay MCP_DISPATCH_OPERATION MCP_DISPATCH_OPERATION_GET_IFACE MCP_IS_DISPATCH_OPERATION MCP_TYPE_DISPATCH_OPERATION McpDispatchOperation McpDispatchOperationIface mcp_dispatch_operation_get_type
dispatch-operation-policy McpDispatchOperationPolicy McpDispatchOperationPolicyCb mcp_dispatch_operation_policy_check McpDispatchOperationPolicyHandlerIsSuitableAsync McpDispatchOperationPolicyFinisher mcp_dispatch_operation_policy_handler_is_suitable_async mcp_dispatch_operation_policy_handler_is_suitable_finish mcp_dispatch_operation_policy_iface_implement_check MCP_DISPATCH_OPERATION_POLICY MCP_DISPATCH_OPERATION_POLICY_GET_IFACE MCP_IS_DISPATCH_OPERATION_POLICY MCP_TYPE_DISPATCH_OPERATION_POLICY McpDispatchOperationPolicy McpDispatchOperationPolicyIface mcp_dispatch_operation_policy_get_type
loader mcp_plugin_ref_nth_object MCP_PLUGIN_REF_NTH_OBJECT_SYMBOL mcp_set_debug mcp_add_object mcp_read_dir mcp_list_objects
mission-control-plugins McpParameterFlags McpAttributeFlags
request mcp_request_find_request_by_type mcp_request_get_account_path mcp_request_get_protocol mcp_request_get_cm_name mcp_request_get_user_action_time mcp_request_get_n_requests mcp_request_ref_nth_request mcp_request_deny mcp_request_start_delay mcp_request_end_delay McpRequestDelay MCP_IS_REQUEST MCP_REQUEST MCP_REQUEST_GET_IFACE MCP_TYPE_REQUEST McpRequest McpRequestIface mcp_request_get_type
request-policy McpRequestPolicy McpRequestPolicyCb mcp_request_policy_check mcp_request_policy_iface_implement_check MCP_IS_REQUEST_POLICY MCP_REQUEST_POLICY MCP_REQUEST_POLICY_GET_IFACE MCP_TYPE_REQUEST_POLICY McpRequestPolicy McpRequestPolicyIface mcp_request_policy_get_type
telepathy-mission-control-5.16.4/doc/reference/mission-control-plugins/Makefile.am0000644000175000017500000001132512735242352031401 0ustar00gkiagiagkiagia00000000000000## Process this file with automake to produce Makefile.in # We require automake 1.9 at least. AUTOMAKE_OPTIONS = 1.9 # This is a blank Makefile.am for using gtk-doc. # Copy this to your project's API docs directory and modify the variables to # suit your project. See the GTK+ Makefiles in gtk+/docs/reference for examples # of using the various options. # The name of the module, e.g. 'glib'. DOC_MODULE=mission-control-plugins # Uncomment for versioned docs and specify the version of the module, e.g. '2'. #DOC_MODULE_VERSION=2 # The top-level SGML file. You can change this if you want to. DOC_MAIN_SGML_FILE=$(DOC_MODULE)-docs.sgml # Directories containing the source code, relative to $(srcdir). # gtk-doc will search all .c and .h files beneath these paths # for inline comments documenting functions and macros. # e.g. DOC_SOURCE_DIR=../../../gtk ../../../gdk DOC_SOURCE_DIR=$(abs_top_srcdir)/mission-control-plugins $(abs_top_builddir)/mission-control-plugins # Extra options to pass to gtkdoc-scangobj. Not normally needed. SCANGOBJ_OPTIONS= # Extra options to supply to gtkdoc-scan. # e.g. SCAN_OPTIONS=--deprecated-guards="GTK_DISABLE_DEPRECATED" SCAN_OPTIONS=--rebuild-types --rebuild-sections # Extra options to supply to gtkdoc-mkdb. # e.g. MKDB_OPTIONS=--xml-mode --output-format=xml MKDB_OPTIONS=--sgml-mode --output-format=xml # Extra options to supply to gtkdoc-mktmpl # e.g. MKTMPL_OPTIONS=--only-section-tmpl MKTMPL_OPTIONS= # Extra options to supply to gtkdoc-mkhtml MKHTML_OPTIONS= # Extra options to supply to gtkdoc-fixref. Not normally needed. # e.g. FIXXREF_OPTIONS=--extra-dir=../gdk-pixbuf/html --extra-dir=../gdk/html FIXXREF_OPTIONS= # Used for dependencies. The docs will be rebuilt if any of these change. # e.g. HFILE_GLOB=$(top_srcdir)/gtk/*.h # e.g. CFILE_GLOB=$(top_srcdir)/gtk/*.c HFILE_GLOB=$(top_srcdir)/mission-control-plugins/*.h CFILE_GLOB=$(top_srcdir)/mission-control-plugins/*.c # Extra header to include when scanning, which are not under DOC_SOURCE_DIR # e.g. EXTRA_HFILES=$(top_srcdir}/contrib/extra.h EXTRA_HFILES= # Header files or dirs to ignore when scanning. Use base file/dir names # e.g. IGNORE_HFILES=gtkdebug.h gtkintl.h private_code IGNORE_HFILES=implementation.h debug-internal.h # Images to copy into HTML directory. # e.g. HTML_IMAGES=$(top_srcdir)/gtk/stock-icons/stock_about_24.png HTML_IMAGES= # Extra SGML files that are included by $(DOC_MAIN_SGML_FILE). # e.g. content_files=running.sgml building.sgml changes-2.0.sgml content_files= # SGML files where gtk-doc abbrevations (#GtkWidget) are expanded # These files must be listed here *and* in content_files # e.g. expand_content_files=running.sgml expand_content_files= # CFLAGS and LDFLAGS for compiling gtkdoc-scangobj with your library. # Only needed if you are using gtkdoc-scangobj to dynamically query widget # signals and properties. # e.g. GTKDOC_CFLAGS=-I$(top_srcdir) -I$(top_builddir) $(GTK_DEBUG_FLAGS) # e.g. GTKDOC_LIBS=$(top_builddir)/gtk/$(gtktargetlib) GTKDOC_CFLAGS = \ -I$(top_srcdir) \ $(TELEPATHY_CFLAGS) \ $(DBUS_CFLAGS) \ $(GLIB_CFLAGS) GTKDOC_LIBS = \ $(top_builddir)/mission-control-plugins/libmission-control-plugins.la \ $(TELEPATHY_LIBS) \ $(DBUS_LIBS) \ $(GLIB_LIBS) # This includes the standard gtk-doc make rules, copied by gtkdocize. include $(top_srcdir)/gtk-doc.make # Other files to distribute # e.g. EXTRA_DIST += version.xml.in #EXTRA_DIST += # Files not to distribute # for --rebuild-types in $(SCAN_OPTIONS), e.g. $(DOC_MODULE).types # for --rebuild-sections in $(SCAN_OPTIONS) e.g. $(DOC_MODULE)-sections.txt #DISTCLEANFILES += clean-local: clean-mcp # we actually treat all of these as disposable, in this "book" clean-mcp: rm -fr *.txt *.types # this will be enabled in a future release ENABLE_DOC_CHECKS = no if ENABLE_GTK_DOC check-local: @err=0; \ echo "Checking for undocumented symbols..."; \ if grep '^0 symbols incomplete' \ $(DOC_MODULE)-undocumented.txt && \ grep '^0 not documented' \ $(DOC_MODULE)-undocumented.txt; then\ :; \ else \ cat $(DOC_MODULE)-undocumented.txt; \ err=1; \ fi; \ echo "Checking for unused symbols..."; \ if grep . $(DOC_MODULE)-unused.txt; then\ echo "^^^ Unused symbols" >&2; \ err=1; \ fi; \ echo "Checking for undeclared symbols..."; \ if test -e $(DOC_MODULE)-undeclared.txt &&\ grep . $(DOC_MODULE)-undeclared.txt; then\ echo "^^^ Undeclared symbols" >&2; \ err=1; \ fi; \ sed -n -e 's,\(.*\),\1,p' $(DOC_MODULE)-sections.txt |\ while read file; do \ if grep -F "xml/$$file.xml" $(DOC_MODULE)-docs.sgml \ >/dev/null;\ then \ :; \ else \ echo "$$file missing from $(DOC_MODULE)-docs.sgml"; \ err=1; \ fi; \ done endif # ... but don't fail on incomplete documentation, this is a stable branch telepathy-mission-control-5.16.4/doc/reference/mission-control-plugins/Makefile.in0000644000175000017500000007046212762351617031426 0ustar00gkiagiagkiagia00000000000000# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # -*- mode: makefile -*- #################################### # Everything below here is generic # #################################### VPATH = @srcdir@ am__make_dryrun = \ { \ am__dry=no; \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ *) \ for am__flg in $$MAKEFLAGS; do \ case $$am__flg in \ *=*|--*) ;; \ *n*) am__dry=yes; break;; \ esac; \ done;; \ esac; \ test $$am__dry = yes; \ } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/gtk-doc.make subdir = doc/reference/mission-control-plugins ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/gtk-doc.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/tp-compiler-flag.m4 \ $(top_srcdir)/m4/tp-compiler-warnings.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACCOUNTS_CACHE_DIR = @ACCOUNTS_CACHE_DIR@ ACCOUNTS_DIR = @ACCOUNTS_DIR@ ACLOCAL = @ACLOCAL@ AEGIS_LIBS = @AEGIS_LIBS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DBUS_CFLAGS = @DBUS_CFLAGS@ DBUS_LIBS = @DBUS_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ERROR_CFLAGS = @ERROR_CFLAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GIO_UNIX_CFLAGS = @GIO_UNIX_CFLAGS@ GIO_UNIX_LIBS = @GIO_UNIX_LIBS@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_COMPILE_SCHEMAS = @GLIB_COMPILE_SCHEMAS@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ GLIB_MKENUMS = @GLIB_MKENUMS@ GREP = @GREP@ GSETTINGS_DISABLE_SCHEMAS_COMPILE = @GSETTINGS_DISABLE_SCHEMAS_COMPILE@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ HTML_DIR = @HTML_DIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBACCOUNTS_SSO_CFLAGS = @LIBACCOUNTS_SSO_CFLAGS@ LIBACCOUNTS_SSO_LIBS = @LIBACCOUNTS_SSO_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MCE_CFLAGS = @MCE_CFLAGS@ MCE_LIBS = @MCE_LIBS@ MCP_ABI_VERSION = @MCP_ABI_VERSION@ MCP_API_VERSION = @MCP_API_VERSION@ MCP_LT_AGE = @MCP_LT_AGE@ MCP_LT_CURRENT = @MCP_LT_CURRENT@ MCP_LT_REVISION = @MCP_LT_REVISION@ MKDIR_P = @MKDIR_P@ NETWORK_MANAGER_CFLAGS = @NETWORK_MANAGER_CFLAGS@ NETWORK_MANAGER_LIBS = @NETWORK_MANAGER_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PYTHON = @PYTHON@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TELEPATHY_CFLAGS = @TELEPATHY_CFLAGS@ TELEPATHY_LIBS = @TELEPATHY_LIBS@ UPOWER_GLIB_CFLAGS = @UPOWER_GLIB_CFLAGS@ UPOWER_GLIB_LIBS = @UPOWER_GLIB_LIBS@ VERSION = @VERSION@ XSLTPROC = @XSLTPROC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gsettingsschemadir = @gsettingsschemadir@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mctestsdir = @mctestsdir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ pluginlibdir = @pluginlibdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ # We require automake 1.9 at least. AUTOMAKE_OPTIONS = 1.9 # This is a blank Makefile.am for using gtk-doc. # Copy this to your project's API docs directory and modify the variables to # suit your project. See the GTK+ Makefiles in gtk+/docs/reference for examples # of using the various options. # The name of the module, e.g. 'glib'. DOC_MODULE = mission-control-plugins # Uncomment for versioned docs and specify the version of the module, e.g. '2'. #DOC_MODULE_VERSION=2 # The top-level SGML file. You can change this if you want to. DOC_MAIN_SGML_FILE = $(DOC_MODULE)-docs.sgml # Directories containing the source code, relative to $(srcdir). # gtk-doc will search all .c and .h files beneath these paths # for inline comments documenting functions and macros. # e.g. DOC_SOURCE_DIR=../../../gtk ../../../gdk DOC_SOURCE_DIR = $(abs_top_srcdir)/mission-control-plugins $(abs_top_builddir)/mission-control-plugins # Extra options to pass to gtkdoc-scangobj. Not normally needed. SCANGOBJ_OPTIONS = # Extra options to supply to gtkdoc-scan. # e.g. SCAN_OPTIONS=--deprecated-guards="GTK_DISABLE_DEPRECATED" SCAN_OPTIONS = --rebuild-types --rebuild-sections # Extra options to supply to gtkdoc-mkdb. # e.g. MKDB_OPTIONS=--xml-mode --output-format=xml MKDB_OPTIONS = --sgml-mode --output-format=xml # Extra options to supply to gtkdoc-mktmpl # e.g. MKTMPL_OPTIONS=--only-section-tmpl MKTMPL_OPTIONS = # Extra options to supply to gtkdoc-mkhtml MKHTML_OPTIONS = # Extra options to supply to gtkdoc-fixref. Not normally needed. # e.g. FIXXREF_OPTIONS=--extra-dir=../gdk-pixbuf/html --extra-dir=../gdk/html FIXXREF_OPTIONS = # Used for dependencies. The docs will be rebuilt if any of these change. # e.g. HFILE_GLOB=$(top_srcdir)/gtk/*.h # e.g. CFILE_GLOB=$(top_srcdir)/gtk/*.c HFILE_GLOB = $(top_srcdir)/mission-control-plugins/*.h CFILE_GLOB = $(top_srcdir)/mission-control-plugins/*.c # Extra header to include when scanning, which are not under DOC_SOURCE_DIR # e.g. EXTRA_HFILES=$(top_srcdir}/contrib/extra.h EXTRA_HFILES = # Header files or dirs to ignore when scanning. Use base file/dir names # e.g. IGNORE_HFILES=gtkdebug.h gtkintl.h private_code IGNORE_HFILES = implementation.h debug-internal.h # Images to copy into HTML directory. # e.g. HTML_IMAGES=$(top_srcdir)/gtk/stock-icons/stock_about_24.png HTML_IMAGES = # Extra SGML files that are included by $(DOC_MAIN_SGML_FILE). # e.g. content_files=running.sgml building.sgml changes-2.0.sgml content_files = # SGML files where gtk-doc abbrevations (#GtkWidget) are expanded # These files must be listed here *and* in content_files # e.g. expand_content_files=running.sgml expand_content_files = # CFLAGS and LDFLAGS for compiling gtkdoc-scangobj with your library. # Only needed if you are using gtkdoc-scangobj to dynamically query widget # signals and properties. # e.g. GTKDOC_CFLAGS=-I$(top_srcdir) -I$(top_builddir) $(GTK_DEBUG_FLAGS) # e.g. GTKDOC_LIBS=$(top_builddir)/gtk/$(gtktargetlib) GTKDOC_CFLAGS = \ -I$(top_srcdir) \ $(TELEPATHY_CFLAGS) \ $(DBUS_CFLAGS) \ $(GLIB_CFLAGS) GTKDOC_LIBS = \ $(top_builddir)/mission-control-plugins/libmission-control-plugins.la \ $(TELEPATHY_LIBS) \ $(DBUS_LIBS) \ $(GLIB_LIBS) @GTK_DOC_USE_LIBTOOL_FALSE@GTKDOC_CC = $(CC) $(INCLUDES) $(GTKDOC_DEPS_CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @GTK_DOC_USE_LIBTOOL_TRUE@GTKDOC_CC = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(INCLUDES) $(GTKDOC_DEPS_CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @GTK_DOC_USE_LIBTOOL_FALSE@GTKDOC_LD = $(CC) $(GTKDOC_DEPS_LIBS) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) @GTK_DOC_USE_LIBTOOL_TRUE@GTKDOC_LD = $(LIBTOOL) --tag=CC --mode=link $(CC) $(GTKDOC_DEPS_LIBS) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) @GTK_DOC_USE_LIBTOOL_FALSE@GTKDOC_RUN = @GTK_DOC_USE_LIBTOOL_TRUE@GTKDOC_RUN = $(LIBTOOL) --mode=execute # We set GPATH here; this gives us semantics for GNU make # which are more like other make's VPATH, when it comes to # whether a source that is a target of one rule is then # searched for in VPATH/GPATH. # GPATH = $(srcdir) TARGET_DIR = $(HTML_DIR)/$(DOC_MODULE) SETUP_FILES = \ $(content_files) \ $(expand_content_files) \ $(DOC_MAIN_SGML_FILE) \ $(DOC_MODULE)-sections.txt \ $(DOC_MODULE)-overrides.txt EXTRA_DIST = \ $(HTML_IMAGES) \ $(SETUP_FILES) DOC_STAMPS = setup-build.stamp scan-build.stamp sgml-build.stamp \ html-build.stamp pdf-build.stamp \ sgml.stamp html.stamp pdf.stamp SCANOBJ_FILES = \ $(DOC_MODULE).args \ $(DOC_MODULE).hierarchy \ $(DOC_MODULE).interfaces \ $(DOC_MODULE).prerequisites \ $(DOC_MODULE).signals REPORT_FILES = \ $(DOC_MODULE)-undocumented.txt \ $(DOC_MODULE)-undeclared.txt \ $(DOC_MODULE)-unused.txt CLEANFILES = $(SCANOBJ_FILES) $(REPORT_FILES) $(DOC_STAMPS) gtkdoc-check.test @GTK_DOC_BUILD_HTML_FALSE@HTML_BUILD_STAMP = @GTK_DOC_BUILD_HTML_TRUE@HTML_BUILD_STAMP = html-build.stamp @GTK_DOC_BUILD_PDF_FALSE@PDF_BUILD_STAMP = @GTK_DOC_BUILD_PDF_TRUE@PDF_BUILD_STAMP = pdf-build.stamp #### setup #### GTK_DOC_V_SETUP = $(GTK_DOC_V_SETUP_$(V)) GTK_DOC_V_SETUP_ = $(GTK_DOC_V_SETUP_$(AM_DEFAULT_VERBOSITY)) GTK_DOC_V_SETUP_0 = @echo " DOC Preparing build"; #### scan #### GTK_DOC_V_SCAN = $(GTK_DOC_V_SCAN_$(V)) GTK_DOC_V_SCAN_ = $(GTK_DOC_V_SCAN_$(AM_DEFAULT_VERBOSITY)) GTK_DOC_V_SCAN_0 = @echo " DOC Scanning header files"; GTK_DOC_V_INTROSPECT = $(GTK_DOC_V_INTROSPECT_$(V)) GTK_DOC_V_INTROSPECT_ = $(GTK_DOC_V_INTROSPECT_$(AM_DEFAULT_VERBOSITY)) GTK_DOC_V_INTROSPECT_0 = @echo " DOC Introspecting gobjects"; #### xml #### GTK_DOC_V_XML = $(GTK_DOC_V_XML_$(V)) GTK_DOC_V_XML_ = $(GTK_DOC_V_XML_$(AM_DEFAULT_VERBOSITY)) GTK_DOC_V_XML_0 = @echo " DOC Building XML"; #### html #### GTK_DOC_V_HTML = $(GTK_DOC_V_HTML_$(V)) GTK_DOC_V_HTML_ = $(GTK_DOC_V_HTML_$(AM_DEFAULT_VERBOSITY)) GTK_DOC_V_HTML_0 = @echo " DOC Building HTML"; GTK_DOC_V_XREF = $(GTK_DOC_V_XREF_$(V)) GTK_DOC_V_XREF_ = $(GTK_DOC_V_XREF_$(AM_DEFAULT_VERBOSITY)) GTK_DOC_V_XREF_0 = @echo " DOC Fixing cross-references"; #### pdf #### GTK_DOC_V_PDF = $(GTK_DOC_V_PDF_$(V)) GTK_DOC_V_PDF_ = $(GTK_DOC_V_PDF_$(AM_DEFAULT_VERBOSITY)) GTK_DOC_V_PDF_0 = @echo " DOC Building PDF"; # this will be enabled in a future release ENABLE_DOC_CHECKS = no all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/gtk-doc.make $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/reference/mission-control-plugins/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu doc/reference/mission-control-plugins/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_srcdir)/gtk-doc.make: $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$(top_distdir)" distdir="$(distdir)" \ dist-hook @ENABLE_GTK_DOC_FALSE@check-local: check-am: all-am $(MAKE) $(AM_MAKEFLAGS) check-local check: check-am @ENABLE_GTK_DOC_FALSE@all-local: all-am: Makefile all-local installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-local mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic distclean-local dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-data-local install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic \ maintainer-clean-local mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-local .MAKE: check-am install-am install-strip .PHONY: all all-am all-local check check-am check-local clean \ clean-generic clean-libtool clean-local dist-hook distclean \ distclean-generic distclean-libtool distclean-local distdir \ dvi dvi-am html html-am info info-am install install-am \ install-data install-data-am install-data-local install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic \ maintainer-clean-local mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am \ uninstall-local gtkdoc-check.test: Makefile $(AM_V_GEN)echo "#!/bin/sh -e" > $@; \ echo "$(GTKDOC_CHECK_PATH) || exit 1" >> $@; \ chmod +x $@ all-gtk-doc: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP) .PHONY: all-gtk-doc @ENABLE_GTK_DOC_TRUE@all-local: all-gtk-doc docs: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP) $(REPORT_FILES): sgml-build.stamp setup-build.stamp: -$(GTK_DOC_V_SETUP)if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \ files=`echo $(SETUP_FILES) $(DOC_MODULE).types`; \ if test "x$$files" != "x" ; then \ for file in $$files ; do \ destdir=`dirname $(abs_builddir)/$$file`; \ test -d "$$destdir" || mkdir -p "$$destdir"; \ test -f $(abs_srcdir)/$$file && \ cp -pf $(abs_srcdir)/$$file $(abs_builddir)/$$file || true; \ done; \ fi; \ fi $(AM_V_at)touch setup-build.stamp scan-build.stamp: setup-build.stamp $(HFILE_GLOB) $(CFILE_GLOB) $(GTK_DOC_V_SCAN)_source_dir='' ; \ for i in $(DOC_SOURCE_DIR) ; do \ _source_dir="$${_source_dir} --source-dir=$$i" ; \ done ; \ gtkdoc-scan --module=$(DOC_MODULE) --ignore-headers="$(IGNORE_HFILES)" $${_source_dir} $(SCAN_OPTIONS) $(EXTRA_HFILES) $(GTK_DOC_V_INTROSPECT)if grep -l '^..*$$' $(DOC_MODULE).types > /dev/null 2>&1 ; then \ scanobj_options=""; \ gtkdoc-scangobj 2>&1 --help | grep >/dev/null "\-\-verbose"; \ if test "$$?" = "0"; then \ if test "x$(V)" = "x1"; then \ scanobj_options="--verbose"; \ fi; \ fi; \ CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" RUN="$(GTKDOC_RUN)" CFLAGS="$(GTKDOC_CFLAGS) $(CFLAGS)" LDFLAGS="$(GTKDOC_LIBS) $(LDFLAGS)" \ gtkdoc-scangobj $(SCANGOBJ_OPTIONS) $$scanobj_options --module=$(DOC_MODULE); \ else \ for i in $(SCANOBJ_FILES) ; do \ test -f $$i || touch $$i ; \ done \ fi $(AM_V_at)touch scan-build.stamp $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt: scan-build.stamp @true sgml-build.stamp: setup-build.stamp $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(HFILE_GLOB) $(CFILE_GLOB) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt $(expand_content_files) xml/gtkdocentities.ent $(GTK_DOC_V_XML)_source_dir='' ; \ for i in $(DOC_SOURCE_DIR) ; do \ _source_dir="$${_source_dir} --source-dir=$$i" ; \ done ; \ gtkdoc-mkdb --module=$(DOC_MODULE) --output-format=xml --expand-content-files="$(expand_content_files)" --main-sgml-file=$(DOC_MAIN_SGML_FILE) $${_source_dir} $(MKDB_OPTIONS) $(AM_V_at)touch sgml-build.stamp sgml.stamp: sgml-build.stamp @true xml/gtkdocentities.ent: Makefile $(GTK_DOC_V_XML)$(MKDIR_P) $(@D) && ( \ echo ""; \ echo ""; \ echo ""; \ echo ""; \ echo ""; \ echo ""; \ echo ""; \ ) > $@ html-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files) $(expand_content_files) $(GTK_DOC_V_HTML)rm -rf html && mkdir html && \ mkhtml_options=""; \ gtkdoc-mkhtml 2>&1 --help | grep >/dev/null "\-\-verbose"; \ if test "$$?" = "0"; then \ if test "x$(V)" = "x1"; then \ mkhtml_options="$$mkhtml_options --verbose"; \ fi; \ fi; \ gtkdoc-mkhtml 2>&1 --help | grep >/dev/null "\-\-path"; \ if test "$$?" = "0"; then \ mkhtml_options="$$mkhtml_options --path=\"$(abs_srcdir)\""; \ fi; \ cd html && gtkdoc-mkhtml $$mkhtml_options $(MKHTML_OPTIONS) $(DOC_MODULE) ../$(DOC_MAIN_SGML_FILE) -@test "x$(HTML_IMAGES)" = "x" || \ for file in $(HTML_IMAGES) ; do \ if test -f $(abs_srcdir)/$$file ; then \ cp $(abs_srcdir)/$$file $(abs_builddir)/html; \ fi; \ if test -f $(abs_builddir)/$$file ; then \ cp $(abs_builddir)/$$file $(abs_builddir)/html; \ fi; \ done; $(GTK_DOC_V_XREF)gtkdoc-fixxref --module=$(DOC_MODULE) --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS) $(AM_V_at)touch html-build.stamp pdf-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files) $(expand_content_files) $(GTK_DOC_V_PDF)rm -f $(DOC_MODULE).pdf && \ mkpdf_options=""; \ gtkdoc-mkpdf 2>&1 --help | grep >/dev/null "\-\-verbose"; \ if test "$$?" = "0"; then \ if test "x$(V)" = "x1"; then \ mkpdf_options="$$mkpdf_options --verbose"; \ fi; \ fi; \ if test "x$(HTML_IMAGES)" != "x"; then \ for img in $(HTML_IMAGES); do \ part=`dirname $$img`; \ echo $$mkpdf_options | grep >/dev/null "\-\-imgdir=$$part "; \ if test $$? != 0; then \ mkpdf_options="$$mkpdf_options --imgdir=$$part"; \ fi; \ done; \ fi; \ gtkdoc-mkpdf --path="$(abs_srcdir)" $$mkpdf_options $(DOC_MODULE) $(DOC_MAIN_SGML_FILE) $(MKPDF_OPTIONS) $(AM_V_at)touch pdf-build.stamp ############## clean-local: @rm -f *~ *.bak @rm -rf .libs @if echo $(SCAN_OPTIONS) | grep -q "\-\-rebuild-types" ; then \ rm -f $(DOC_MODULE).types; \ fi @if echo $(SCAN_OPTIONS) | grep -q "\-\-rebuild-sections" ; then \ rm -f $(DOC_MODULE)-sections.txt; \ fi distclean-local: @rm -rf xml html $(REPORT_FILES) $(DOC_MODULE).pdf \ $(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt @if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \ rm -f $(SETUP_FILES) $(DOC_MODULE).types; \ fi maintainer-clean-local: @rm -rf xml html install-data-local: @installfiles=`echo $(builddir)/html/*`; \ if test "$$installfiles" = '$(builddir)/html/*'; \ then echo 1>&2 'Nothing to install' ; \ else \ if test -n "$(DOC_MODULE_VERSION)"; then \ installdir="$(DESTDIR)$(TARGET_DIR)-$(DOC_MODULE_VERSION)"; \ else \ installdir="$(DESTDIR)$(TARGET_DIR)"; \ fi; \ $(mkinstalldirs) $${installdir} ; \ for i in $$installfiles; do \ echo ' $(INSTALL_DATA) '$$i ; \ $(INSTALL_DATA) $$i $${installdir}; \ done; \ if test -n "$(DOC_MODULE_VERSION)"; then \ mv -f $${installdir}/$(DOC_MODULE).devhelp2 \ $${installdir}/$(DOC_MODULE)-$(DOC_MODULE_VERSION).devhelp2; \ fi; \ $(GTKDOC_REBASE) --relative --dest-dir=$(DESTDIR) --html-dir=$${installdir}; \ fi uninstall-local: @if test -n "$(DOC_MODULE_VERSION)"; then \ installdir="$(DESTDIR)$(TARGET_DIR)-$(DOC_MODULE_VERSION)"; \ else \ installdir="$(DESTDIR)$(TARGET_DIR)"; \ fi; \ rm -rf $${installdir} # # Require gtk-doc when making dist # @HAVE_GTK_DOC_TRUE@dist-check-gtkdoc: docs @HAVE_GTK_DOC_FALSE@dist-check-gtkdoc: @HAVE_GTK_DOC_FALSE@ @echo "*** gtk-doc is needed to run 'make dist'. ***" @HAVE_GTK_DOC_FALSE@ @echo "*** gtk-doc was not found when 'configure' ran. ***" @HAVE_GTK_DOC_FALSE@ @echo "*** please install gtk-doc and rerun 'configure'. ***" @HAVE_GTK_DOC_FALSE@ @false dist-hook: dist-check-gtkdoc all-gtk-doc dist-hook-local @mkdir $(distdir)/html @cp ./html/* $(distdir)/html @-cp ./$(DOC_MODULE).pdf $(distdir)/ @-cp ./$(DOC_MODULE).types $(distdir)/ @-cp ./$(DOC_MODULE)-sections.txt $(distdir)/ @cd $(distdir) && rm -f $(DISTCLEANFILES) @$(GTKDOC_REBASE) --online --relative --html-dir=$(distdir)/html .PHONY : dist-hook-local docs # This includes the standard gtk-doc make rules, copied by gtkdocize. # Other files to distribute # e.g. EXTRA_DIST += version.xml.in #EXTRA_DIST += # Files not to distribute # for --rebuild-types in $(SCAN_OPTIONS), e.g. $(DOC_MODULE).types # for --rebuild-sections in $(SCAN_OPTIONS) e.g. $(DOC_MODULE)-sections.txt #DISTCLEANFILES += clean-local: clean-mcp # we actually treat all of these as disposable, in this "book" clean-mcp: rm -fr *.txt *.types @ENABLE_GTK_DOC_TRUE@check-local: @ENABLE_GTK_DOC_TRUE@ @err=0; \ @ENABLE_GTK_DOC_TRUE@ echo "Checking for undocumented symbols..."; \ @ENABLE_GTK_DOC_TRUE@ if grep '^0 symbols incomplete' \ @ENABLE_GTK_DOC_TRUE@ $(DOC_MODULE)-undocumented.txt && \ @ENABLE_GTK_DOC_TRUE@ grep '^0 not documented' \ @ENABLE_GTK_DOC_TRUE@ $(DOC_MODULE)-undocumented.txt; then\ @ENABLE_GTK_DOC_TRUE@ :; \ @ENABLE_GTK_DOC_TRUE@ else \ @ENABLE_GTK_DOC_TRUE@ cat $(DOC_MODULE)-undocumented.txt; \ @ENABLE_GTK_DOC_TRUE@ err=1; \ @ENABLE_GTK_DOC_TRUE@ fi; \ @ENABLE_GTK_DOC_TRUE@ echo "Checking for unused symbols..."; \ @ENABLE_GTK_DOC_TRUE@ if grep . $(DOC_MODULE)-unused.txt; then\ @ENABLE_GTK_DOC_TRUE@ echo "^^^ Unused symbols" >&2; \ @ENABLE_GTK_DOC_TRUE@ err=1; \ @ENABLE_GTK_DOC_TRUE@ fi; \ @ENABLE_GTK_DOC_TRUE@ echo "Checking for undeclared symbols..."; \ @ENABLE_GTK_DOC_TRUE@ if test -e $(DOC_MODULE)-undeclared.txt &&\ @ENABLE_GTK_DOC_TRUE@ grep . $(DOC_MODULE)-undeclared.txt; then\ @ENABLE_GTK_DOC_TRUE@ echo "^^^ Undeclared symbols" >&2; \ @ENABLE_GTK_DOC_TRUE@ err=1; \ @ENABLE_GTK_DOC_TRUE@ fi; \ @ENABLE_GTK_DOC_TRUE@ sed -n -e 's,\(.*\),\1,p' $(DOC_MODULE)-sections.txt |\ @ENABLE_GTK_DOC_TRUE@ while read file; do \ @ENABLE_GTK_DOC_TRUE@ if grep -F "xml/$$file.xml" $(DOC_MODULE)-docs.sgml \ @ENABLE_GTK_DOC_TRUE@ >/dev/null;\ @ENABLE_GTK_DOC_TRUE@ then \ @ENABLE_GTK_DOC_TRUE@ :; \ @ENABLE_GTK_DOC_TRUE@ else \ @ENABLE_GTK_DOC_TRUE@ echo "$$file missing from $(DOC_MODULE)-docs.sgml"; \ @ENABLE_GTK_DOC_TRUE@ err=1; \ @ENABLE_GTK_DOC_TRUE@ fi; \ @ENABLE_GTK_DOC_TRUE@ done # ... but don't fail on incomplete documentation, this is a stable branch # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: telepathy-mission-control-5.16.4/doc/reference/mission-control-plugins/html/0000755000175000017500000000000012762352250030306 5ustar00gkiagiagkiagia00000000000000telepathy-mission-control-5.16.4/doc/reference/mission-control-plugins/html/api-index-full.html0000644000175000017500000007422612762352250034025 0ustar00gkiagiagkiagia00000000000000 API Index: Mission Control Plugins Reference Manual

API Index

A

McpAccountStorage, struct in McpAccountStorage
McpAccountStorageIface, struct in McpAccountStorage
mcp_account_manager_escape_value_for_keyfile, function in McpAccountManager
mcp_account_manager_escape_variant_for_keyfile, function in McpAccountManager
mcp_account_manager_get_unique_name, function in McpAccountManager
mcp_account_manager_get_value, function in McpAccountManager
mcp_account_manager_init_value_for_attribute, function in McpAccountManager
mcp_account_manager_list_keys, function in McpAccountManager
mcp_account_manager_parameter_is_secret, function in McpAccountManager
mcp_account_manager_parameter_make_secret, function in McpAccountManager
mcp_account_manager_set_attribute, function in McpAccountManager
mcp_account_manager_set_parameter, function in McpAccountManager
mcp_account_manager_set_value, function in McpAccountManager
mcp_account_manager_unescape_value_from_keyfile, function in McpAccountManager
mcp_account_storage_commit, function in McpAccountStorage
mcp_account_storage_commit_one, function in McpAccountStorage
mcp_account_storage_create, function in McpAccountStorage
mcp_account_storage_delete, function in McpAccountStorage
mcp_account_storage_description, function in McpAccountStorage
mcp_account_storage_emit_altered, function in McpAccountStorage
mcp_account_storage_emit_altered_one, function in McpAccountStorage
mcp_account_storage_emit_created, function in McpAccountStorage
mcp_account_storage_emit_deleted, function in McpAccountStorage
mcp_account_storage_emit_reconnect, function in McpAccountStorage
mcp_account_storage_emit_toggled, function in McpAccountStorage
mcp_account_storage_get, function in McpAccountStorage
mcp_account_storage_get_additional_info, function in McpAccountStorage
mcp_account_storage_get_identifier, function in McpAccountStorage
mcp_account_storage_get_restrictions, function in McpAccountStorage
mcp_account_storage_list, function in McpAccountStorage
mcp_account_storage_name, function in McpAccountStorage
mcp_account_storage_owns, function in McpAccountStorage
MCP_ACCOUNT_STORAGE_PLUGIN_PRIO_DEFAULT, macro in McpAccountStorage
MCP_ACCOUNT_STORAGE_PLUGIN_PRIO_KEYRING, macro in McpAccountStorage
MCP_ACCOUNT_STORAGE_PLUGIN_PRIO_NORMAL, macro in McpAccountStorage
MCP_ACCOUNT_STORAGE_PLUGIN_PRIO_READONLY, macro in McpAccountStorage
mcp_account_storage_priority, function in McpAccountStorage
mcp_account_storage_provider, function in McpAccountStorage
mcp_account_storage_ready, function in McpAccountStorage
mcp_account_storage_set, function in McpAccountStorage
mcp_account_storage_set_attribute, function in McpAccountStorage
mcp_account_storage_set_parameter, function in McpAccountStorage
mcp_add_object, function in Plugin loader and global functions
McpAttributeFlags, enum in mission-control-plugins

D

DBusAclAsyncAuthoriser, user_function in McpDBusAcl
DBusAclAuthData, struct in McpDBusAcl
DBusAclAuthorised, user_function in McpDBusAcl
DBusAclAuthoriser, user_function in McpDBusAcl
DBusAclType, enum in McpDBusAcl
mcp_dbus_acl_authorised, function in McpDBusAcl
mcp_dbus_acl_authorised_async, function in McpDBusAcl
mcp_dbus_acl_authorised_async_step, function in McpDBusAcl
mcp_dbus_acl_description, function in McpDBusAcl
mcp_dbus_acl_iface_implement_authorised, function in McpDBusAcl
mcp_dbus_acl_iface_implement_authorised_async, function in McpDBusAcl
mcp_dbus_acl_iface_set_desc, function in McpDBusAcl
mcp_dbus_acl_iface_set_name, function in McpDBusAcl
mcp_dbus_acl_name, function in McpDBusAcl
MCP_DEBUG, macro in debug
McpDebugFlags, enum in debug
mcp_debug_init, function in debug
McpDispatchOperationDelay, struct in McpDispatchOperation
McpDispatchOperationPolicyCb, user_function in McpDispatchOperationPolicy
McpDispatchOperationPolicyFinisher, user_function in McpDispatchOperationPolicy
McpDispatchOperationPolicyHandlerIsSuitableAsync, user_function in McpDispatchOperationPolicy
mcp_dispatch_operation_close_channels, function in McpDispatchOperation
mcp_dispatch_operation_destroy_channels, function in McpDispatchOperation
mcp_dispatch_operation_end_delay, function in McpDispatchOperation
mcp_dispatch_operation_find_channel_by_type, function in McpDispatchOperation
mcp_dispatch_operation_get_account_path, function in McpDispatchOperation
mcp_dispatch_operation_get_cm_name, function in McpDispatchOperation
mcp_dispatch_operation_get_connection_path, function in McpDispatchOperation
mcp_dispatch_operation_get_nth_channel_path, function in McpDispatchOperation
mcp_dispatch_operation_get_n_channels, function in McpDispatchOperation
mcp_dispatch_operation_get_protocol, function in McpDispatchOperation
mcp_dispatch_operation_leave_channels, function in McpDispatchOperation
mcp_dispatch_operation_policy_check, function in McpDispatchOperationPolicy
mcp_dispatch_operation_policy_handler_is_suitable_async, function in McpDispatchOperationPolicy
mcp_dispatch_operation_policy_handler_is_suitable_finish, function in McpDispatchOperationPolicy
mcp_dispatch_operation_policy_iface_implement_check, function in McpDispatchOperationPolicy
mcp_dispatch_operation_ref_connection, function in McpDispatchOperation
mcp_dispatch_operation_ref_nth_channel, function in McpDispatchOperation
mcp_dispatch_operation_ref_nth_channel_properties, function in McpDispatchOperation
mcp_dispatch_operation_start_delay, function in McpDispatchOperation

I

mcp_is_debugging, function in debug

L

mcp_list_objects, function in Plugin loader and global functions

P

McpParameterFlags, enum in mission-control-plugins
mcp_plugin_ref_nth_object, function in Plugin loader and global functions
MCP_PLUGIN_REF_NTH_OBJECT_SYMBOL, macro in Plugin loader and global functions

R

mcp_read_dir, function in Plugin loader and global functions
McpRequestDelay, struct in McpRequest
McpRequestPolicyCb, user_function in McpRequestPolicy
mcp_request_deny, function in McpRequest
mcp_request_end_delay, function in McpRequest
mcp_request_find_request_by_type, function in McpRequest
mcp_request_get_account_path, function in McpRequest
mcp_request_get_cm_name, function in McpRequest
mcp_request_get_n_requests, function in McpRequest
mcp_request_get_protocol, function in McpRequest
mcp_request_get_user_action_time, function in McpRequest
mcp_request_policy_check, function in McpRequestPolicy
mcp_request_policy_iface_implement_check, function in McpRequestPolicy
mcp_request_ref_nth_request, function in McpRequest
mcp_request_start_delay, function in McpRequest

S

mcp_set_debug, function in Plugin loader and global functions
telepathy-mission-control-5.16.4/doc/reference/mission-control-plugins/html/ch02.html0000644000175000017500000000434112762352250031732 0ustar00gkiagiagkiagia00000000000000 Account storage: Mission Control Plugins Reference Manual

Account storage

McpAccountStorage — Account Storage object, implemented by plugins
McpAccountManager — Object representing the account manager, implemented by Mission Control
telepathy-mission-control-5.16.4/doc/reference/mission-control-plugins/html/McpAccountManager.html0000644000175000017500000012365212762352250034534 0ustar00gkiagiagkiagia00000000000000 McpAccountManager: Mission Control Plugins Reference Manual

McpAccountManager

McpAccountManager — Object representing the account manager, implemented by Mission Control

Object Hierarchy

    GInterface
    ╰── McpAccountManager

Includes

#include <mission-control-plugins/mission-control-plugins.h>

Description

This object represents the Telepathy AccountManager.

Most virtual methods on the McpAccountStorageIface interface receive an object provided by Mission Control that implements this interface. It can be used to manipulate Mission Control's in-memory cache of accounts.

Only Mission Control should implement this interface.

Functions

mcp_account_manager_set_value ()

void
mcp_account_manager_set_value (const McpAccountManager *mcpa,
                               const gchar *account,
                               const gchar *key,
                               const gchar *value);

Inform Mission Control that key has changed its value to value .

This function may either be called from mcp_account_storage_get(), or just before emitting “altered-one”.

New plugins should call mcp_account_manager_set_attribute() or mcp_account_manager_set_parameter() instead.

Parameters

mcpa

an McpAccountManager instance

 

account

the unique name of an account

 

key

the setting whose value we wish to change: either an attribute like "DisplayName", or "param-" plus a parameter like "account"

 

value

the new value, escaped as if for a GKeyFile, or NULL to delete the setting/parameter

 

mcp_account_manager_set_attribute ()

void
mcp_account_manager_set_attribute (const McpAccountManager *mcpa,
                                   const gchar *account,
                                   const gchar *attribute,
                                   GVariant *value,
                                   McpAttributeFlags flags);

Inform Mission Control that attribute has changed its value to value .

If value is a floating reference, Mission Control will take ownership of it, much like g_variant_builder_add_value().

This function may either be called from mcp_account_storage_get(), or just before emitting “altered-one”.

Parameters

mcpa

an McpAccountManager instance

 

account

the unique name of an account

 

attribute

the name of an attribute, such as "DisplayName"

 

value

the new value, or NULL to delete the attribute.

[allow-none]

flags

flags for the new value (only used if value is non-NULL)

 

mcp_account_manager_set_parameter ()

void
mcp_account_manager_set_parameter (const McpAccountManager *mcpa,
                                   const gchar *account,
                                   const gchar *parameter,
                                   GVariant *value,
                                   McpParameterFlags flags);

Inform Mission Control that parameter has changed its value to value .

If value is a floating reference, Mission Control will take ownership of it, much like g_variant_builder_add_value().

This function may either be called from mcp_account_storage_get(), or just before emitting “altered-one”.

Parameters

mcpa

an McpAccountManager instance

 

account

the unique name of an account

 

parameter

the name of a parameter, such as "account", without the "param-" prefix

 

value

the new value, or NULL to delete the parameter.

[allow-none]

flags

flags for the new value (only used if value is non-NULL)

 

mcp_account_manager_get_value ()

gchar *
mcp_account_manager_get_value (const McpAccountManager *mcpa,
                               const gchar *account,
                               const gchar *key);

Fetch a copy of the current value of an account setting held by the account manager.

Parameters

mcpa

an McpAccountManager instance

 

account

the unique name of an account

 

key

the setting whose value we wish to fetch: either an attribute like "DisplayName", or "param-" plus a parameter like "account"

 

Returns

the value of key .

[transfer full]


mcp_account_manager_parameter_is_secret ()

gboolean
mcp_account_manager_parameter_is_secret
                               (const McpAccountManager *mcpa,
                                const gchar *account,
                                const gchar *key);

Determine whether a given account parameter is secret. Generally this is determined by MC and passed down to plugins, but any McpAccountStorage plugin may decide a parameter is secret, in which case the return value for this call will indicate that fact too.

For historical reasons, this function only operates on parameters, but requires its argument to be prefixed with "param-".

Parameters

mcpa

an McpAccountManager instance

 

account

the unique name of an account

 

key

the constant string "param-", plus a parameter name like "account" or "password"

 

Returns

TRUE for secret settings, FALSE otherwise


mcp_account_manager_parameter_make_secret ()

void
mcp_account_manager_parameter_make_secret
                               (const McpAccountManager *mcpa,
                                const gchar *account,
                                const gchar *key);

Flag an account setting as secret for the lifetime of this McpAccountManager. For instance, this should be called if key has been retrieved from gnome-keyring.

For historical reasons, this function only operates on parameters, but requires its argument to be prefixed with "param-".

Parameters

mcpa

an McpAccountManager instance

 

account

the unique name of an account

 

key

the constant string "param-", plus a parameter name like "account" or "password"

 

mcp_account_manager_get_unique_name ()

gchar *
mcp_account_manager_get_unique_name (McpAccountManager *mcpa,
                                     const gchar *manager,
                                     const gchar *protocol,
                                     const GHashTable *params);

Generate and return the canonical unique name of this [new] account. Should not be called for accounts which have already had a name assigned: Intended for use when a plugin encounters an account which MC has not previously seen before (ie one created by a 3rd party in the back-end that the plugin in question provides an interface to).

Parameters

mcpa

an McpAccountManager instance

 

manager

the name of the manager

 

protocol

the name of the protocol

 

params

A gchar * / GValue * hash table of account parameters.

 

Returns

the newly allocated account name, which should be freed once the caller is done with it.


mcp_account_manager_list_keys ()

GStrv
mcp_account_manager_list_keys (const McpAccountManager *mcpa,
                               const gchar *account);

mcp_account_manager_escape_value_for_keyfile ()

gchar *
mcp_account_manager_escape_value_for_keyfile
                               (const McpAccountManager *mcpa,
                                const GValue *value);

mcp_account_manager_escape_variant_for_keyfile ()

gchar *
mcp_account_manager_escape_variant_for_keyfile
                               (const McpAccountManager *mcpa,
                                GVariant *variant);

Escape variant so it could be passed to g_key_file_set_value(). For instance, escaping the boolean value TRUE returns "true", and escaping the string value containing one space returns "\s".

It is a programming error to use an unsupported type. The supported types are currently G_VARIANT_TYPE_STRING, G_VARIANT_TYPE_BOOLEAN, G_VARIANT_TYPE_INT32, G_VARIANT_TYPE_UINT32, G_VARIANT_TYPE_INT64, G_VARIANT_TYPE_UINT64, G_VARIANT_TYPE_BYTE, G_VARIANT_TYPE_STRING_ARRAY, G_VARIANT_TYPE_OBJECT_PATH and G_VARIANT_TYPE_OBJECT_PATH_ARRAY.

Parameters

mcpa

a McpAccountManager

 

variant

a GVariant with a supported GVariantType

 

Returns

the escaped form of variant .

[transfer full]


mcp_account_manager_unescape_value_from_keyfile ()

gboolean
mcp_account_manager_unescape_value_from_keyfile
                               (const McpAccountManager *mcpa,
                                const gchar *escaped,
                                GValue *value,
                                GError **error);

Attempt to interpret escaped as a value of value 's type. If successful, put it in value and return TRUE.

It is a programming error to try to escape an unsupported type. The supported types are currently G_TYPE_STRING, G_TYPE_BOOLEAN, G_TYPE_INT, G_TYPE_UINT, G_TYPE_INT64, G_TYPE_UINT64, G_TYPE_UCHAR, G_TYPE_STRV, DBUS_TYPE_G_OBJECT_PATH and TP_ARRAY_TYPE_OBJECT_PATH_LIST.

Parameters

mcpa

a McpAccountManager

 

escaped

an escaped string as returned by g_key_file_get_value()

 

value

a value to populate, with a supported GType

 

error

used to raise an error if FALSE is returned

 

Returns

TRUE if value was filled in


mcp_account_manager_init_value_for_attribute ()

gboolean
mcp_account_manager_init_value_for_attribute
                               (const McpAccountManager *mcpa,
                                GValue *value,
                                const gchar *attribute);

If attribute is a known Mission Control attribute, initialize value with an appropriate type for attribute and return TRUE. Otherwise, return FALSE.

Parameters

mcpa

a McpAccountManager

 

value

a zero-filled value to initialize

 

attribute

a supported Mission Control attribute

 

Returns

TRUE if value was initialized

Types and Values

telepathy-mission-control-5.16.4/doc/reference/mission-control-plugins/html/right-insensitive.png0000644000175000017500000000056512762352250034475 0ustar00gkiagiagkiagia00000000000000PNG  IHDRabKGD pHYs B(xtIME ^IDAT8͒J` /S_$AqrW(>m"]\(49.Nd39{eM#MSIιEiHz|3{̲l3,KkV'@EEQlwyiq]Kh4:mĦ,;ts\aR5/7'Wps׭I,K1=0j0Wg> PU𻤝0 ]?qCҫιg~kA_IENDB`mission-control-plugins-McpAccountStorage.html0000644000175000017500000025445412762352250041330 0ustar00gkiagiagkiagia00000000000000telepathy-mission-control-5.16.4/doc/reference/mission-control-plugins/html McpAccountStorage: Mission Control Plugins Reference Manual

McpAccountStorage

McpAccountStorage — Account Storage object, implemented by plugins

Includes

#include <mission-control-plugins/mission-control-plugins.h>

Description

Plugins may implement McpAccountStorage in order to provide account parameter storage backends to the AccountManager object.

To do so, the plugin must implement a GObject subclass that implements McpAccountStorage, then return an instance of that subclass from mcp_plugin_ref_nth_object().

Many methods take "the unique name of an account" as an argument. In this plugin, that means the unique "tail" of the account's object path, for instance "gabble/jabber/chris_40example_2ecom". The account's full object path is obtained by prepending TP_ACCOUNT_OBJECT_PATH_BASE.

A complete implementation of this interface with all methods would look something like this:

Example 1. 

G_DEFINE_TYPE_WITH_CODE (FooPlugin, foo_plugin,
   G_TYPE_OBJECT,
   G_IMPLEMENT_INTERFACE (...);
   G_IMPLEMENT_INTERFACE (MCP_TYPE_ACCOUNT_STORAGE,
     account_storage_iface_init));
/* ... */
static void
account_storage_iface_init (McpAccountStorageIface *iface)
{
  iface->priority = 0;
  iface->name = "foo";
  iface->desc = "The FOO storage backend";
  iface->provider = "org.freedesktop.Telepathy.MissionControl5.FooStorage";

  iface->get = foo_plugin_get;
  iface->set = foo_plugin_get;
  iface->delete = foo_plugin_delete;
  iface->commit = foo_plugin_commit;
  iface->commit_one = foo_plugin_commit_one;
  iface->list = foo_plugin_list;
  iface->ready = foo_plugin_ready;
  iface->get_identifier = foo_plugin_get_identifier;
  iface->get_additional_info = foo_plugin_get_additional_info;
  iface->get_restrictions = foo_plugin_get_restrictions;
  iface->create = foo_plugin_create;
  iface->owns = foo_plugin_owns;
  iface->set_attribute = foo_plugin_set_attribute;
  iface->set_parameter = foo_plugin_set_parameter;
}

A single object can implement more than one interface; It is currently unlikely that you would find it useful to implement anything other than an account storage plugin in an account storage object, though.

Functions

mcp_account_storage_priority ()

gint
mcp_account_storage_priority (const McpAccountStorage *storage);

mcp_account_storage_priority is deprecated and should not be used in newly-written code.

Gets the priority for this plugin.

Priorities currently run from MCP_ACCOUNT_STORAGE_PLUGIN_PRIO_DEFAULT (the default storage plugin priority) upwards. More-positive numbers are higher priority.

Plugins at a higher priority then MCP_ACCOUNT_STORAGE_PLUGIN_PRIO_KEYRING used to have the opportunity to "steal" passwords from the gnome keyring. It is no longer significant.

Plugins at a lower priority than the default plugin will never be asked to store any details, although they may still be asked to list them at startup time, and may asynchronously notify MC of accounts via the signals above.

When loading accounts at startup, plugins are consulted in order from lowest to highest, so that higher priority plugins may overrule settings from lower priority plugins.

Loading all the accounts is only done at startup, before the dbus name is claimed, and is therefore the only time plugins are allowed to indulge in blocking calls (indeed, they are expected to carry out this operation, and ONLY this operation, synchronously).

When values are being set, the plugins are invoked from highest priority to lowest, with the first plugin that claims a setting being assigned ownership, and all lower priority plugins being asked to delete the setting in question.

Parameters

storage

an McpAccountStorage instance

 

Returns

the priority of this plugin


mcp_account_storage_get ()

gboolean
mcp_account_storage_get (const McpAccountStorage *storage,
                         McpAccountManager *am,
                         const gchar *account,
                         const gchar *key);

Get a value from the plugin's in-memory cache. Before emitting this signal, the plugin must call either mcp_account_manager_set_attribute(), mcp_account_manager_set_parameter(), or mcp_account_manager_set_value() and (if appropriate) mcp_account_manager_parameter_make_secret() before returning from this method call.

Note that mcp_account_manager_set_parameter() does not use the "param-" prefix, even if called from this function.

If key is NULL the plugin should iterate through all attributes and parameters, and push each of them into am , as if this method had been called once for each attribute or parameter. It must then return TRUE if any attributes or parameters were found, or FALSE if it was not responsible for account .

Parameters

storage

an McpAccountStorage instance

 

am

an McpAccountManager instance

 

account

the unique name of the account

 

key

the setting whose value we wish to fetch: either an attribute like "DisplayName", or "param-" plus a parameter like "account"

 

Returns

TRUE if storage is responsible for account


mcp_account_storage_set ()

gboolean
mcp_account_storage_set (const McpAccountStorage *storage,
                         const McpAccountManager *am,
                         const gchar *account,
                         const gchar *key,
                         const gchar *value);

The plugin is expected to either quickly and synchronously update its internal cache of values with value , or to decline to store the setting.

The plugin is not expected to write to its long term storage at this point. It can expect Mission Control to call either mcp_account_storage_commit() or mcp_account_storage_commit_one() after a short delay.

Plugins that implement mcp_storage_set_attribute() and mcp_account_storage_set_parameter() can just return FALSE here. There is a default implementation, which just returns FALSE.

Parameters

storage

an McpAccountStorage instance

 

am

an McpAccountManager instance

 

account

the unique name of the account

 

key

the non-NULL setting whose value we wish to store: either an attribute like "DisplayName", or "param-" plus a parameter like "account"

 

value

a value to associate with key , escaped as if for a GKeyFile

 

Returns

TRUE if the attribute was claimed, FALSE otherwise


mcp_account_storage_create ()

gchar *
mcp_account_storage_create (const McpAccountStorage *storage,
                            const McpAccountManager *am,
                            const gchar *manager,
                            const gchar *protocol,
                            GHashTable *params,
                            GError **error);

Inform the plugin that a new account is being created. manager , protocol and params are given to help determining the account's unique name, but does not need to be stored on the account yet, mcp_account_storage_set() and mcp_account_storage_commit() will be called later.

It is recommended to use mcp_account_manager_get_unique_name() to create the unique name, but it's not mandatory. One could base the unique name on an internal storage identifier, prefixed with the provider's name (e.g. goa__1234).

“created” signal should not be emitted for this account, not even when mcp_account_storage_commit() will be called.

Parameters

storage

an McpAccountStorage instance

 

am

an object which can be used to call back into the account manager

 

manager

the name of the manager

 

protocol

the name of the protocol

 

params

A gchar * / GValue * hash table of account parameters

 

error

a GError to fill

 

Returns

the newly allocated account name, which should be freed once the caller is done with it, or NULL if that couldn't be done.

[transfer full]


mcp_account_storage_delete ()

gboolean
mcp_account_storage_delete (const McpAccountStorage *storage,
                            const McpAccountManager *am,
                            const gchar *account,
                            const gchar *key);

The plugin is expected to remove the setting for key from its internal cache and to remember that its state has changed, so that it can delete said setting from its long term storage if its long term storage method makes this necessary.

If key is NULL, the plugin should forget all its settings for account ,and remember to delete the entire account from its storage later.

The plugin is not expected to update its long term storage at this point.

Parameters

storage

an McpAccountStorage instance

 

am

an McpAccountManager instance

 

account

the unique name of the account

 

key

the setting whose value we wish to store - either an attribute like "DisplayName", or "param-" plus a parameter like "account" - or NULL to delete the entire account.

[allow-none]

Returns

TRUE if the setting or settings are not the plugin's cache after this operation, FALSE otherwise. This is very unlikely to ever be FALSE, as a plugin is always expected to be able to manipulate its own cache.


mcp_account_storage_ready ()

void
mcp_account_storage_ready (const McpAccountStorage *storage,
                           const McpAccountManager *am);

Informs the plugin that it is now permitted to create new accounts, ie it can now fire its "created", "altered", "toggled" and "deleted" signals.

Parameters

storage

an McpAccountStorage instance

 

am

an McpAccountManager instance

 

mcp_account_storage_commit ()

gboolean
mcp_account_storage_commit (const McpAccountStorage *storage,
                            const McpAccountManager *am);

The plugin is expected to write its cache to long term storage, deleting, adding or updating entries in said storage as needed.

This call is expected to return promptly, but the plugin is not required to have finished its commit operation when it returns, merely to have started the operation.

If the commit_one method is implemented, it will be called preferentially if only one account is to be committed. If the commit_one method is implemented but commit is not, commit_one will be called with account_name = NULL to commit all accounts.

Parameters

storage

an McpAccountStorage instance

 

am

an McpAccountManager instance

 

Returns

TRUE if the commit process was started (but not necessarily completed) successfully; FALSE if there was a problem that was immediately obvious.


mcp_account_storage_commit_one ()

gboolean
mcp_account_storage_commit_one (const McpAccountStorage *storage,
                                const McpAccountManager *am,
                                const gchar *account);

The same as mcp_account_storage_commit(), but only commit the given account. This is optional to implement; the default implementation is to call commit .

If both mcp_account_storage_commit_one() and mcp_account_storage_commit() are implemented, Mission Control will never pass account = NULL to this method.

Parameters

storage

an McpAccountStorage instance

 

am

an McpAccountManager instance

 

account

the unique suffix of an account's object path, or NULL if all accounts are to be committed and mcp_account_storage_commit() is unimplemented.

[allow-none]

Returns

TRUE if the commit process was started (but not necessarily completed) successfully; FALSE if there was a problem that was immediately obvious.


mcp_account_storage_list ()

GList *
mcp_account_storage_list (const McpAccountStorage *storage,
                          const McpAccountManager *am);

Load details of every account stored by this plugin into an in-memory cache so that it can respond to requests promptly.

This method is called only at initialisation time, before the dbus name has been claimed, and is the only one permitted to block.

Parameters

storage

an McpAccountStorage instance

 

am

an McpAccountManager instance

 

Returns

a list of account names that the plugin has settings for. The account names should be freed with g_free(), and the list with g_list_free(), when the caller is done with them.

[element-type utf8][transfer full]


mcp_account_storage_get_identifier ()

void
mcp_account_storage_get_identifier (const McpAccountStorage *storage,
                                    const gchar *account,
                                    GValue *identifier);

Get the storage-specific identifier for this account. The type is variant, hence the GValue.

This method will only be called for the storage plugin that "owns" the account.

Parameters

storage

an McpAccountStorage instance

 

account

the unique name of the account

 

identifier

a zero-filled GValue whose type can be sent over D-Bus by dbus-glib, to hold the identifier.

[out caller-allocates]

mcp_account_storage_get_additional_info ()

GHashTable *
mcp_account_storage_get_additional_info
                               (const McpAccountStorage *storage,
                                const gchar *account);

Return additional storage-specific information about this account, which is made available on D-Bus but not otherwise interpreted by Mission Control.

This method will only be called for the storage plugin that "owns" the account.

Parameters

storage

an McpAccountStorage instance

 

account

the unique name of the account

 

Returns

additional storage-specific information.

[transfer container][element-type utf8 GObject.Value]


mcp_account_storage_get_restrictions ()

guint
mcp_account_storage_get_restrictions (const McpAccountStorage *storage,
                                      const gchar *account);

This method will only be called for the storage plugin that "owns" the account.

Parameters

storage

an McpAccountStorage instance

 

account

the unique name of the account

 

Returns

a bitmask of TpStorageRestrictionFlags with the restrictions to account storage.


mcp_account_storage_name ()

const gchar *
mcp_account_storage_name (const McpAccountStorage *storage);

Parameters

storage

an McpAccountStorage instance

 

Returns

the plugin's name (for logging etc)


mcp_account_storage_description ()

const gchar *
mcp_account_storage_description (const McpAccountStorage *storage);

Parameters

storage

an McpAccountStorage instance

 

Returns

the plugin's description (for logging etc)


mcp_account_storage_provider ()

const gchar *
mcp_account_storage_provider (const McpAccountStorage *storage);

Parameters

storage

an McpAccountStorage instance

 

Returns

a D-Bus namespaced name for this plugin, or "" if none was provided in McpAccountStorageIface.provider.


mcp_account_storage_owns ()

gboolean
mcp_account_storage_owns (McpAccountStorage *storage,
                          McpAccountManager *am,
                          const gchar *account);

Check whether account is stored in storage . The highest-priority plugin for which this function returns TRUE is considered to be responsible for account .

There is a default implementation, which calls mcp_account_storage_get() for the well-known key "manager".

Parameters

storage

an McpAccountStorage instance

 

am

an McpAccountManager instance

 

account

the unique name (object-path tail) of an account

 

Returns

TRUE if account is stored in storage

Since: 5.15.0


mcp_account_storage_set_attribute ()

gboolean
mcp_account_storage_set_attribute (McpAccountStorage *storage,
                                   McpAccountManager *am,
                                   const gchar *account,
                                   const gchar *attribute,
                                   GVariant *value,
                                   McpAttributeFlags flags);

Store an attribute.

The plugin is expected to either quickly and synchronously update its internal cache of values with value , or to decline to store the attribute.

The plugin is not expected to write to its long term storage at this point.

There is a default implementation, which just returns FALSE. Mission Control will call mcp_account_storage_set() instead, using a keyfile-escaped version of value .

Parameters

storage

an McpAccountStorage instance

 

am

an McpAccountManager instance

 

account

the unique name of the account

 

attribute

the name of an attribute, e.g. "DisplayName"

 

value

a value to associate with attribute

 

flags

flags influencing how the attribute is to be stored

 

Returns

TRUE if the attribute was claimed, FALSE otherwise

Since: 5.15.0


mcp_account_storage_set_parameter ()

gboolean
mcp_account_storage_set_parameter (McpAccountStorage *storage,
                                   McpAccountManager *am,
                                   const gchar *account,
                                   const gchar *parameter,
                                   GVariant *value,
                                   McpParameterFlags flags);

Store a parameter.

The plugin is expected to either quickly and synchronously update its internal cache of values with value , or to decline to store the parameter.

The plugin is not expected to write to its long term storage at this point.

There is a default implementation, which just returns FALSE. Mission Control will call mcp_account_storage_set() instead, using "param-" + parameter as key and a keyfile-escaped version of value as value.

Parameters

storage

an McpAccountStorage instance

 

am

an McpAccountManager instance

 

account

the unique name of the account

 

parameter

the name of a parameter, e.g. "account" (note that there is no "param-" prefix here)

 

value

a value to associate with parameter

 

flags

flags influencing how the parameter is to be stored

 

Returns

TRUE if the parameter was claimed, FALSE otherwise

Since: 5.15.0


mcp_account_storage_emit_created ()

void
mcp_account_storage_emit_created (McpAccountStorage *storage,
                                  const gchar *account);

mcp_account_storage_emit_altered ()

void
mcp_account_storage_emit_altered (McpAccountStorage *storage,
                                  const gchar *account);

mcp_account_storage_emit_altered is deprecated and should not be used in newly-written code.

Emits the “altered” signal

Parameters

storage

an McpAccountStorage instance

 

account

the unique name of the altered account

 

mcp_account_storage_emit_altered_one ()

void
mcp_account_storage_emit_altered_one (McpAccountStorage *storage,
                                      const gchar *account,
                                      const gchar *key);

Emits the “altered-one” signal

Parameters

storage

an McpAccountStorage instance

 

account

the unique name of the altered account

 

key

the key of the altered property: either an attribute name like "DisplayName", or "param-" plus a parameter name like "account"

 

mcp_account_storage_emit_deleted ()

void
mcp_account_storage_emit_deleted (McpAccountStorage *storage,
                                  const gchar *account);

Emits the “deleted” signal

Parameters

storage

an McpAccountStorage instance

 

account

the unique name of the deleted account

 

mcp_account_storage_emit_toggled ()

void
mcp_account_storage_emit_toggled (McpAccountStorage *storage,
                                  const gchar *account,
                                  gboolean enabled);

Emits ::toggled signal

Parameters

storage

an McpAccountStorage instance

 

account

the unique name of the account

 

enabled

TRUE if the account is now enabled

 

mcp_account_storage_emit_reconnect ()

void
mcp_account_storage_emit_reconnect (McpAccountStorage *storage,
                                    const gchar *account);

Emits ::reconnect signal

Parameters

storage

an McpAccountStorage instance

 

account

the unique name of the account to reconnect

 

Types and Values

MCP_ACCOUNT_STORAGE_PLUGIN_PRIO_READONLY

#define MCP_ACCOUNT_STORAGE_PLUGIN_PRIO_READONLY -1

MCP_ACCOUNT_STORAGE_PLUGIN_PRIO_DEFAULT

#define MCP_ACCOUNT_STORAGE_PLUGIN_PRIO_DEFAULT   0

MCP_ACCOUNT_STORAGE_PLUGIN_PRIO_NORMAL

#define MCP_ACCOUNT_STORAGE_PLUGIN_PRIO_NORMAL    100

MCP_ACCOUNT_STORAGE_PLUGIN_PRIO_KEYRING

#define MCP_ACCOUNT_STORAGE_PLUGIN_PRIO_KEYRING   10000

struct McpAccountStorage

struct McpAccountStorage {
 };
#endif

#define MCP_TYPE_ACCOUNT_STORAGE (mcp_account_storage_get_type ())

#define MCP_ACCOUNT_STORAGE(o) \
  (G_TYPE_CHECK_INSTANCE_CAST ((o), MCP_TYPE_ACCOUNT_STORAGE, \
      McpAccountStorage))

#define MCP_IS_ACCOUNT_STORAGE(o) \
  (G_TYPE_CHECK_INSTANCE_TYPE ((o), MCP_TYPE_ACCOUNT_STORAGE))

#define MCP_ACCOUNT_STORAGE_GET_IFACE(o) \
  (G_TYPE_INSTANCE_GET_INTERFACE ((o), MCP_TYPE_ACCOUNT_STORAGE, \
                                  McpAccountStorageIface))

GType mcp_account_storage_get_type (void);

/* Virtual method implementation signatures */
typedef gboolean (*McpAccountStorageGetFunc) (
    const McpAccountStorage *storage,
    const McpAccountManager *am,
    const gchar *account,
    const gchar *key);
typedef gboolean (*McpAccountStorageSetFunc) (
    const McpAccountStorage *storage,
    const McpAccountManager *am,
    const gchar *account,
    const gchar *key,
    const gchar *val);
typedef gchar * (*McpAccountStorageCreate) (
    const McpAccountStorage *storage,
    const McpAccountManager *am,
    const gchar *manager,
    const gchar *protocol,
    GHashTable *params,
    GError **error);
typedef gboolean (*McpAccountStorageDeleteFunc) (
    const McpAccountStorage *storage,
    const McpAccountManager *am,
    const gchar *account,
    const gchar *key);
typedef GList * (*McpAccountStorageListFunc) (
    const McpAccountStorage *storage,
    const McpAccountManager *am);
typedef gboolean (*McpAccountStorageCommitFunc) (
    const McpAccountStorage *storage,
    const McpAccountManager *am);
typedef gboolean (*McpAccountStorageCommitOneFunc) (
    const McpAccountStorage *storage,
    const McpAccountManager *am,
    const gchar *account);
typedef void (*McpAccountStorageReadyFunc) (
    const McpAccountStorage *storage,
    const McpAccountManager *am);
typedef void (*McpAccountStorageGetIdentifierFunc) (
    const McpAccountStorage *storage,
    const gchar *account,
    GValue *identifier);
typedef GHashTable * (*McpAccountStorageGetAdditionalInfoFunc) (
    const McpAccountStorage *storage,
    const gchar *account);
/* FIXME: when breaking API, make this return TpStorageRestrictionFlags */
typedef guint (*McpAccountStorageGetRestrictionsFunc) (
    const McpAccountStorage *storage,
    const gchar *account);

struct _McpAccountStorageIface
{
  GTypeInterface parent;

  gint priority;
  const gchar *name;
  const gchar *desc;
  const gchar *provider;

  McpAccountStorageSetFunc set;
  McpAccountStorageGetFunc get;
  McpAccountStorageDeleteFunc delete;
  McpAccountStorageCommitFunc commit;
  McpAccountStorageListFunc list;
  McpAccountStorageReadyFunc ready;
  McpAccountStorageCommitOneFunc commit_one;
  McpAccountStorageGetIdentifierFunc get_identifier;
  McpAccountStorageGetAdditionalInfoFunc get_additional_info;
  McpAccountStorageGetRestrictionsFunc get_restrictions;
  McpAccountStorageCreate create;

  /* Since 5.15.0 */
  gboolean (*owns) (McpAccountStorage *storage,
      McpAccountManager *am,
      const gchar *account);
  gboolean (*set_attribute) (McpAccountStorage *storage,
      McpAccountManager *am,
      const gchar *account,
      const gchar *attribute,
      GVariant *val,
      McpAttributeFlags flags);
  gboolean (*set_parameter) (McpAccountStorage *storage,
      McpAccountManager *am,
      const gchar *account,
      const gchar *parameter,
      GVariant *val,
      McpParameterFlags flags);
};

An object implementing the account storage plugin interface.


McpAccountStorageIface

typedef struct _McpAccountStorageIface McpAccountStorageIface;

The interface vtable for an account storage plugin.

Members

telepathy-mission-control-5.16.4/doc/reference/mission-control-plugins/html/object-tree.html0000644000175000017500000000474412762352250033410 0ustar00gkiagiagkiagia00000000000000 Object Hierarchy: Mission Control Plugins Reference Manual

Object Hierarchy

    GInterface
    ├── McpAccountManager
    ├── McpDBusAcl
    ├── McpDispatchOperation
    ├── McpDispatchOperationPolicy
    ├── McpRequest
    ╰── McpRequestPolicy
telepathy-mission-control-5.16.4/doc/reference/mission-control-plugins/html/ch03.html0000644000175000017500000000401012762352250031724 0ustar00gkiagiagkiagia00000000000000 Channel requests: Mission Control Plugins Reference Manual

Channel requests

McpRequestPolicy — Request-policy object, implemented by plugins
McpRequest — Request object, implemented by Mission Control
telepathy-mission-control-5.16.4/doc/reference/mission-control-plugins/html/up.png0000644000175000017500000000040412762352250031436 0ustar00gkiagiagkiagia00000000000000PNG  IHDRabKGD pHYs B(xtIME IDAT81 @D{xa;$]r =JR1, Sd-}0̟oL:m-QO[ k TzMޠL,:ךu!tK; Pp Ot@l/̵*l}IENDB`telepathy-mission-control-5.16.4/doc/reference/mission-control-plugins/html/annotation-glossary.html0000644000175000017500000000575112762352250035217 0ustar00gkiagiagkiagia00000000000000 Annotation Glossary: Mission Control Plugins Reference Manual

Annotation Glossary

A

allow-none

NULL is OK, both for passing and for returning.

E

element-type

Generics and defining elements of containers and arrays.

O

out caller-allocates

Out parameter, where caller must allocate storage.

T

transfer container

Free data container after the code is done.

transfer full

Free data after the code is done.

mission-control-plugins-Plugin-loader-and-global-functions.html0000644000175000017500000003412612762352250044445 0ustar00gkiagiagkiagia00000000000000telepathy-mission-control-5.16.4/doc/reference/mission-control-plugins/html Plugin loader and global functions: Mission Control Plugins Reference Manual

Plugin loader and global functions

Plugin loader and global functions — Writing a plugin, or loading plugins

Functions

Types and Values

Includes

#include <mission-control-plugins/mission-control-plugins.h>

Description

To write plugins for Mission Control, build a GModule whose name starts with "mcp-" and ends with G_MODULE_SUFFIX, for instance mcp-testplugin.so on Linux or mcp-testplugin.dll on Windows. It must be installed in the directory given by the ${plugindir} variable in the mission-control-plugins pkg-config file.

Each plugin must contain an extern (public) function called mcp_plugin_ref_nth_object() which behaves as documented here. Mission Control will call that function to load the plugin.

Mission Control also uses functions from this part of the library, to load the plugins.

Functions

mcp_plugin_ref_nth_object ()

GObject *
mcp_plugin_ref_nth_object (guint n);

Implemented by each plugin (not implemented in this library!) as a hook point; it will be called repeatedly with an increasing argument, and must return a GObject reference each time, until it returns NULL.

Mission Control will query each object for the GInterfaces it implements, and behave accordingly; for instance, the objects might implement McpRequestPolicy and/or McpDispatchOperationPolicy.

As currently implemented, these objects are never unreferenced.

Parameters

n

object number, starting from 0

 

Returns

a new reference to a GObject, or NULL if n is at least the number of objects supported by this plugin


mcp_set_debug ()

void
mcp_set_debug (gboolean debug);

Set whether debug output will be produced via g_debug() for the plugin loader. Plugins shouldn't normally need to call this function.

Parameters

debug

whether to log debug output

 

mcp_add_object ()

void
mcp_add_object (gpointer object);

Add an object to the list of "plugin objects". Mission Control does this automatically for the objects returned by mcp_plugin_ref_nth_object(), so you should only need to use this if you're embedding part of Mission Control in a larger process.

As currently implemented, these objects are never unreferenced.

Mission Control uses this function to load its plugins; plugins shouldn't call it.

Parameters

object

an object implementing one or more plugin interfaces

 

mcp_read_dir ()

void
mcp_read_dir (const gchar *path);

Read plugins from the given path. Any file with prefix "mcp-" and suffix G_MODULE_SUFFIX is considered as a potential plugin, and loaded; if it contains the symbol mcp_plugin_ref_nth_object(), the plugin is made resident, then that symbol is called as a function until it returns NULL.

Mission Control uses this function to load its plugins; plugins shouldn't call it.

Parameters

path

full path to a plugins directory

 

mcp_list_objects ()

const GList *
mcp_list_objects (void);

Return a list of objects that might implement plugin interfaces.

Mission Control uses this function to iterate through the loaded plugin objects; plugins shouldn't need to call it.

Returns

a constant list of plugin objects

Types and Values

MCP_PLUGIN_REF_NTH_OBJECT_SYMBOL

#define MCP_PLUGIN_REF_NTH_OBJECT_SYMBOL "mcp_plugin_ref_nth_object"

A string constant whose value is the name mcp_plugin_ref_nth_object().

telepathy-mission-control-5.16.4/doc/reference/mission-control-plugins/html/home.png0000644000175000017500000000040012762352250031736 0ustar00gkiagiagkiagia00000000000000PNG  IHDRabKGD pHYs B(xtIME &IDAT8ҽ Aߞf`n v`6`/`Yܡ`f&k$,} 0b+ԸaQW~b O e{y N[L}.piBzmm o.I]7^[;%:VIENDB`telepathy-mission-control-5.16.4/doc/reference/mission-control-plugins/html/style.css0000644000175000017500000002115412762352250032163 0ustar00gkiagiagkiagia00000000000000body { font-family: cantarell, sans-serif; } .synopsis, .classsynopsis { /* tango:aluminium 1/2 */ background: #eeeeec; background: rgba(238, 238, 236, 0.5); border: solid 1px rgb(238, 238, 236); padding: 0.5em; } .programlisting { /* tango:sky blue 0/1 */ /* fallback for no rgba support */ background: #e6f3ff; border: solid 1px #729fcf; background: rgba(114, 159, 207, 0.1); border: solid 1px rgba(114, 159, 207, 0.2); padding: 0.5em; } .variablelist { padding: 4px; margin-left: 3em; } .variablelist td:first-child { vertical-align: top; } div.gallery-float { float: left; padding: 10px; } div.gallery-float img { border-style: none; } div.gallery-spacer { clear: both; } a, a:visited { text-decoration: none; /* tango:sky blue 2 */ color: #3465a4; } a:hover { text-decoration: underline; /* tango:sky blue 1 */ color: #729fcf; } div.informaltable table { border-collapse: separate; border-spacing: 1em 0.3em; border: none; } div.informaltable table td, div.informaltable table th { vertical-align: top; } .function_type, .variable_type, .property_type, .signal_type, .parameter_name, .struct_member_name, .union_member_name, .define_keyword, .datatype_keyword, .typedef_keyword { text-align: right; } /* dim non-primary columns */ .c_punctuation, .function_type, .variable_type, .property_type, .signal_type, .define_keyword, .datatype_keyword, .typedef_keyword, .property_flags, .signal_flags, .parameter_annotations, .enum_member_annotations, .struct_member_annotations, .union_member_annotations { color: #888a85; } .function_type a, .function_type a:visited, .function_type a:hover, .property_type a, .property_type a:visited, .property_type a:hover, .signal_type a, .signal_type a:visited, .signal_type a:hover, .signal_flags a, .signal_flags a:visited, .signal_flags a:hover { color: #729fcf; } td p { margin: 0.25em; } div.table table { border-collapse: collapse; border-spacing: 0px; /* tango:aluminium 3 */ border: solid 1px #babdb6; } div.table table td, div.table table th { /* tango:aluminium 3 */ border: solid 1px #babdb6; padding: 3px; vertical-align: top; } div.table table th { /* tango:aluminium 2 */ background-color: #d3d7cf; } h4 { color: #555753; margin-top: 1em; margin-bottom: 1em; } hr { /* tango:aluminium 1 */ color: #d3d7cf; background: #d3d7cf; border: none 0px; height: 1px; clear: both; margin: 2.0em 0em 2.0em 0em; } dl.toc dt { padding-bottom: 0.25em; } dl.toc > dt { padding-top: 0.25em; padding-bottom: 0.25em; font-weight: bold; } dl.toc > dl { padding-bottom: 0.5em; } .parameter { font-style: normal; } .footer { padding-top: 3.5em; /* tango:aluminium 3 */ color: #babdb6; text-align: center; font-size: 80%; } .informalfigure, .figure { margin: 1em; } .informalexample, .example { margin-top: 1em; margin-bottom: 1em; } .warning { /* tango:orange 0/1 */ background: #ffeed9; background: rgba(252, 175, 62, 0.1); border-color: #ffb04f; border-color: rgba(252, 175, 62, 0.2); } .note { /* tango:chameleon 0/0.5 */ background: #d8ffb2; background: rgba(138, 226, 52, 0.1); border-color: #abf562; border-color: rgba(138, 226, 52, 0.2); } div.blockquote { border-color: #eeeeec; } .note, .warning, div.blockquote { padding: 0.5em; border-width: 1px; border-style: solid; margin: 2em; } .note p, .warning p { margin: 0; } div.warning h3.title, div.note h3.title { display: none; } p + div.section { margin-top: 1em; } div.refnamediv, div.refsynopsisdiv, div.refsect1, div.refsect2, div.toc, div.section { margin-bottom: 1em; } /* blob links */ h2 .extralinks, h3 .extralinks { float: right; /* tango:aluminium 3 */ color: #babdb6; font-size: 80%; font-weight: normal; } .lineart { color: #d3d7cf; font-weight: normal; } .annotation { /* tango:aluminium 5 */ color: #555753; font-weight: normal; } .structfield { font-style: normal; font-weight: normal; } acronym,abbr { border-bottom: 1px dotted gray; } /* code listings */ .listing_code .programlisting .normal, .listing_code .programlisting .normal a, .listing_code .programlisting .number, .listing_code .programlisting .cbracket, .listing_code .programlisting .symbol { color: #555753; } .listing_code .programlisting .comment, .listing_code .programlisting .linenum { color: #babdb6; } /* tango: aluminium 3 */ .listing_code .programlisting .function, .listing_code .programlisting .function a, .listing_code .programlisting .preproc { color: #204a87; } /* tango: sky blue 3 */ .listing_code .programlisting .string { color: #ad7fa8; } /* tango: plum */ .listing_code .programlisting .keyword, .listing_code .programlisting .usertype, .listing_code .programlisting .type, .listing_code .programlisting .type a { color: #4e9a06; } /* tango: chameleon 3 */ .listing_frame { /* tango:sky blue 1 */ border: solid 1px #729fcf; border: solid 1px rgba(114, 159, 207, 0.2); padding: 0px; } .listing_lines, .listing_code { margin-top: 0px; margin-bottom: 0px; padding: 0.5em; } .listing_lines { /* tango:sky blue 0.5 */ background: #a6c5e3; background: rgba(114, 159, 207, 0.2); /* tango:aluminium 6 */ color: #2e3436; } .listing_code { /* tango:sky blue 0 */ background: #e6f3ff; background: rgba(114, 159, 207, 0.1); } .listing_code .programlisting { /* override from previous */ border: none 0px; padding: 0px; background: none; } .listing_lines pre, .listing_code pre { margin: 0px; } @media screen { /* these have a as a first child, but since there are no parent selectors * we can't use that. */ a.footnote { position: relative; top: 0em ! important; } /* this is needed so that the local anchors are displayed below the naviagtion */ div.footnote a[name], div.refnamediv a[name], div.refsect1 a[name], div.refsect2 a[name], div.index a[name], div.glossary a[name], div.sect1 a[name] { display: inline-block; position: relative; top:-5em; } /* this seems to be a bug in the xsl style sheets when generating indexes */ div.index div.index { top: 0em; } /* make space for the fixed navigation bar and add space at the bottom so that * link targets appear somewhat close to top */ body { padding-top: 2.5em; padding-bottom: 500px; max-width: 60em; } p { max-width: 60em; } /* style and size the navigation bar */ table.navigation#top { position: fixed; background: #e2e2e2; border-bottom: solid 1px #babdb6; border-spacing: 5px; margin-top: 0; margin-bottom: 0; top: 0; left: 0; z-index: 10; } table.navigation#top td { padding-left: 6px; padding-right: 6px; } .navigation a, .navigation a:visited { /* tango:sky blue 3 */ color: #204a87; } .navigation a:hover { /* tango:sky blue 2 */ color: #3465a4; } td.shortcuts { /* tango:sky blue 2 */ color: #3465a4; font-size: 80%; white-space: nowrap; } td.shortcuts .dim { color: #babdb6; } .navigation .title { font-size: 80%; max-width: none; margin: 0px; font-weight: normal; } } @media screen and (min-width: 60em) { /* screen larger than 60em */ body { margin: auto; } } @media screen and (max-width: 60em) { /* screen less than 60em */ #nav_hierarchy { display: none; } #nav_interfaces { display: none; } #nav_prerequisites { display: none; } #nav_derived_interfaces { display: none; } #nav_implementations { display: none; } #nav_child_properties { display: none; } #nav_style_properties { display: none; } #nav_index { display: none; } #nav_glossary { display: none; } .gallery_image { display: none; } .property_flags { display: none; } .signal_flags { display: none; } .parameter_annotations { display: none; } .enum_member_annotations { display: none; } .struct_member_annotations { display: none; } .union_member_annotations { display: none; } /* now that a column is hidden, optimize space */ col.parameters_name { width: auto; } col.parameters_description { width: auto; } col.struct_members_name { width: auto; } col.struct_members_description { width: auto; } col.enum_members_name { width: auto; } col.enum_members_description { width: auto; } col.union_members_name { width: auto; } col.union_members_description { width: auto; } .listing_lines { display: none; } } @media print { table.navigation { visibility: collapse; display: none; } div.titlepage table.navigation { visibility: visible; display: table; background: #e2e2e2; border: solid 1px #babdb6; margin-top: 0; margin-bottom: 0; top: 0; left: 0; height: 3em; } } telepathy-mission-control-5.16.4/doc/reference/mission-control-plugins/html/left.png0000644000175000017500000000040612762352250031746 0ustar00gkiagiagkiagia00000000000000PNG  IHDRabKGD pHYs B(xtIME,`m;IDAT8үa?DAPY\$[p+IIMlf('}Mpy{_ޥ}^q xZ <=Yj) <04\~+Pl#",Qϑp Iǐlsw>[/]_i03IENDB`telepathy-mission-control-5.16.4/doc/reference/mission-control-plugins/html/left-insensitive.png0000644000175000017500000000061312762352250034304 0ustar00gkiagiagkiagia00000000000000PNG  IHDRabKGD pHYs B(xtIMEƫqIDAT8͒NQ@pds`*4@W@ A!Ԇ@6^ 5hxIH R`sQp̙339B|sKEQTK@۝΁i^~Wʆ`0TJ6TcYn6A ƀ~߱>}ǭs; lYkwr 5U= /" "uU=ɲlArDzp5I4^E+P3Ɯq_p ̥iUYp=#IENDB`telepathy-mission-control-5.16.4/doc/reference/mission-control-plugins/html/up-insensitive.png0000644000175000017500000000056612762352250034005 0ustar00gkiagiagkiagia00000000000000PNG  IHDRabKGD pHYs B(xtIMEwIIDAT8?/Qϙ?[u$VHTDۈBM+! Mission Control Plugins Reference Manual: Mission Control Plugins Reference Manual

The latest version of this documentation in this stable branch can be found on-line at http://telepathy.freedesktop.org/doc/mission-control-plugins-5.16.x/.


Global functions
Plugin loader and global functions — Writing a plugin, or loading plugins
Account storage
McpAccountStorage — Account Storage object, implemented by plugins
McpAccountManager — Object representing the account manager, implemented by Mission Control
Channel requests
McpRequestPolicy — Request-policy object, implemented by plugins
McpRequest — Request object, implemented by Mission Control
Channel dispatch operations
McpDispatchOperationPolicy — Dispatch Operation policy object, implemented by plugins
McpDispatchOperation — Dispatch operation object, implemented by Mission Control
Object Hierarchy
API Index
Annotation Glossary
telepathy-mission-control-5.16.4/doc/reference/mission-control-plugins/html/ch04.html0000644000175000017500000000414512762352250031736 0ustar00gkiagiagkiagia00000000000000 Channel dispatch operations: Mission Control Plugins Reference Manual

Channel dispatch operations

McpDispatchOperationPolicy — Dispatch Operation policy object, implemented by plugins
McpDispatchOperation — Dispatch operation object, implemented by Mission Control
telepathy-mission-control-5.16.4/doc/reference/mission-control-plugins/html/McpRequestPolicy.html0000644000175000017500000002656112762352250034456 0ustar00gkiagiagkiagia00000000000000 McpRequestPolicy: Mission Control Plugins Reference Manual

McpRequestPolicy

McpRequestPolicy — Request-policy object, implemented by plugins

Object Hierarchy

    GInterface
    ╰── McpRequestPolicy

Includes

#include <mission-control-plugins/mission-control-plugins.h>

Description

Plugins may implement McpRequestPolicy in order to apply policy to Telepathy channel requests passing through the Channel Dispatcher part of Mission Control. The plugins are run just after the requesting client calls the ChannelRequest.Proceed method, and can inspect the request, delay its processing, and/or make it fail.

To do so, the plugin must implement a GObject subclass that implements McpRequestPolicy, then return an instance of that subclass from mcp_plugin_ref_nth_object().

An implementation of this plugin might look like this:

Example 2. 

G_DEFINE_TYPE_WITH_CODE (MyPlugin, my_plugin,
   G_TYPE_OBJECT,
   G_IMPLEMENT_INTERFACE (...);
   G_IMPLEMENT_INTERFACE (MCP_TYPE_REQUEST_POLICY,
     request_policy_iface_init);
   G_IMPLEMENT_INTERFACE (...))
/* ... */
static void
request_policy_iface_init (McpRequestPolicyIface *iface,
    gpointer unused G_GNUC_UNUSED)
{
  iface->check = my_plugin_check_request;
}

A single object can implement more than one interface; for instance, it may be useful to combine this interface with McpDispatchOperationPolicy.

Functions

McpRequestPolicyCb ()

void
(*McpRequestPolicyCb) (McpRequestPolicy *policy,
                       McpRequest *request);

Signature of an implementation of mcp_request_policy_check().

Parameters

policy

an implementation of this interface, provided by a plugin

 

request

an object representing a channel request

 

mcp_request_policy_check ()

void
mcp_request_policy_check (McpRequestPolicy *policy,
                          McpRequest *request);

Check what to do with a channel request. Implementations of this method can use methods on request to examine the request, delay processing, make the request fail, etc. in order to impose whatever policy the plugin requires.

Mission Control calls this function in each plugin just after the requesting client calls the Proceed method on the Telepathy ChannelRequest. If the plugin makes the request fail, this does not take effect until all plugins have been notified.

Parameters

policy

an implementation of this interface, provided by a plugin

 

request

an object representing a channel request

 

mcp_request_policy_iface_implement_check ()

void
mcp_request_policy_iface_implement_check
                               (McpRequestPolicyIface *iface,
                                void (*impl) (McpRequestPolicy *, McpRequest *));

This function is no longer needed, since McpRequestPolicyIface is now public API. Use "iface->check = impl" instead.

Parameters

iface

the interface

 

impl

an implementation of the virtual method mcp_request_policy_check()

 

Types and Values

See Also

McpRequest

telepathy-mission-control-5.16.4/doc/reference/mission-control-plugins/html/right.png0000644000175000017500000000040512762352250032130 0ustar00gkiagiagkiagia00000000000000PNG  IHDRabKGD pHYs B(xtIME!GIDAT8үa?MIdEr,-hAIl ry}sX6 !9#D r$-Br$G"$;WZ&!cq \`軀O=QoufIENDB`mission-control-plugins.devhelp20000644000175000017500000003354012762352250036505 0ustar00gkiagiagkiagia00000000000000telepathy-mission-control-5.16.4/doc/reference/mission-control-plugins/html McpDispatchOperation.html0000644000175000017500000013076412762352250035210 0ustar00gkiagiagkiagia00000000000000telepathy-mission-control-5.16.4/doc/reference/mission-control-plugins/html McpDispatchOperation: Mission Control Plugins Reference Manual

McpDispatchOperation

McpDispatchOperation — Dispatch operation object, implemented by Mission Control

Types and Values

Object Hierarchy

    GInterface
    ╰── McpDispatchOperation

Includes

#include <mission-control-plugins/mission-control-plugins.h>

Description

This object represents a Telepathy ChannelDispatchOperation object, as used by Approvers. A ChannelDispatchOperation represents a bundle of one or more Telepathy Channels being dispatched to user interfaces or other clients.

The virtual method mcd_dispatch_operation_policy_check() receives an object provided by Mission Control that implements this interface. It can be used to inspect the channels, delay dispatching of the bundle until the plugin is ready to continue, or close the channels in various ways.

Only Mission Control should implement this interface.

Functions

mcp_dispatch_operation_find_channel_by_type ()

gboolean
mcp_dispatch_operation_find_channel_by_type
                               (McpDispatchOperation *self,
                                guint start_from,
                                TpHandleType handle_type,
                                GQuark channel_type,
                                guint *ret_index,
                                gchar **ret_dup_path,
                                GHashTable **ret_ref_immutable_properties,
                                TpChannel **ret_ref_channel);

Attempt to find a channel matching the given handle type and channel type in the bundle. This is an easy way to test whether the bundle contains any channels of interest to a particular plugin.

Parameters

self

a dispatch operation

 

start_from

index at which to start searching, usually 0

 

handle_type

the handle type to match

 

channel_type

the channel type to match

 

ret_index

if not NULL, used to return the index of the first matching channel, suitable for use with mcp_dispatch_operation_get_nth_channel_path() etc.

 

ret_dup_path

if not NULL, used to return the object path of the first matching channel, which must be freed with g_free()

 

ret_ref_immutable_properties

if not NULL, used to return a reference to immutable properties, as if via mcp_dispatch_operation_ref_nth_channel_properties(), which must be released with g_hash_table_unref()

 

ret_ref_channel

if not NULL, used to return a TpChannel, which is not guaranteed to be ready immediately, and must be released with g_object_unref()

 

Returns

TRUE if a matching channel was found, or FALSE (without touching ret_index , ret_dup_path , ret_ref_immutable_properties or ret_ref_channel ) if not


mcp_dispatch_operation_ref_connection ()

TpConnection *
mcp_dispatch_operation_ref_connection (McpDispatchOperation *self);

Return a TpConnection object. It is not guaranteed to be ready immediately; use tp_connection_call_when_ready().

Parameters

self

a dispatch operation

 

Returns

a reference to a TpConnection, which must be released with g_object_unref() by the caller


mcp_dispatch_operation_ref_nth_channel ()

TpChannel *
mcp_dispatch_operation_ref_nth_channel
                               (McpDispatchOperation *self,
                                guint n);

Return a TpChannel object. It is not guaranteed to be ready immediately; use tp_channel_call_when_ready().

Parameters

self

a dispatch operation

 

n

index of the channel to inspect

 

Returns

a reference to a TpChannel, which must be released with g_object_unref() by the caller, or NULL if n is too large


mcp_dispatch_operation_get_account_path ()

const gchar *
mcp_dispatch_operation_get_account_path
                               (McpDispatchOperation *self);

Parameters

self

a dispatch operation

 

Returns

the D-Bus object path of the Account with which the channels are associated. The string is owned by self and must not be freed; it is only valid as long as a reference to self is held.


mcp_dispatch_operation_get_connection_path ()

const gchar *
mcp_dispatch_operation_get_connection_path
                               (McpDispatchOperation *self);

Parameters

self

a dispatch operation

 

Returns

the D-Bus object path of the Connection with which the channels are associated. The string is owned by self and must not be freed; it is only valid as long as a reference to self is held.


mcp_dispatch_operation_get_protocol ()

const gchar *
mcp_dispatch_operation_get_protocol (McpDispatchOperation *self);

Parameters

self

a dispatch operation

 

Returns

the Telepathy identifier for the protocol, such as 'jabber' or 'icq' (the Protocol type in telepathy-spec). The string is owned by self and must not be freed; it is only valid as long as a reference to self is held.


mcp_dispatch_operation_get_cm_name ()

const gchar *
mcp_dispatch_operation_get_cm_name (McpDispatchOperation *self);

Parameters

self

a dispatch operation

 

Returns

the short name of the Telepathy connection manager, such as 'gabble' or 'haze' (the Connection_Manager_Name type in telepathy-spec). The string is owned by self and must not be freed; it is only valid as long as a reference to self is held.


mcp_dispatch_operation_get_n_channels ()

guint
mcp_dispatch_operation_get_n_channels (McpDispatchOperation *self);

Parameters

self

a dispatch operation

 

Returns

the number of channels in this dispatch operation.


mcp_dispatch_operation_get_nth_channel_path ()

const gchar *
mcp_dispatch_operation_get_nth_channel_path
                               (McpDispatchOperation *self,
                                guint n);

Parameters

self

a dispatch operation

 

n

index of the channel to inspect

 

Returns

the D-Bus object path of the n 'th channel (starting from 0), or NULL if n is greater than or equal to mcp_dispatch_operation_get_n_channels(). The string is owned by self and must not be freed; it is only valid as long as a reference to self is held.


mcp_dispatch_operation_ref_nth_channel_properties ()

GHashTable *
mcp_dispatch_operation_ref_nth_channel_properties
                               (McpDispatchOperation *self,
                                guint n);

Return the immutable properties of the n 'th channel (starting from 0), or NULL if n is greater than or equal to mcp_dispatch_operation_get_n_channels().

The keys of the hash table are strings and the values are in GValue structures, using the same representation as dbus-glib, tp_asv_get_string() etc. Do not add or remove entries in this hash table.

Parameters

self

a dispatch operation

 

n

index of the channel to inspect

 

Returns

a reference to a hash table, which must be released with g_hash_table_unref() by the caller


mcp_dispatch_operation_start_delay ()

McpDispatchOperationDelay *
mcp_dispatch_operation_start_delay (McpDispatchOperation *self);

Start to delay the dispatch operation, for instance while waiting for an asynchronous operation to finish. The returned token must be passed to mcp_dispatch_operation_end_delay() exactly once, at which point dispatching will continue and the token becomes invalid.

This is similar to an Observer delaying the return from ObserveChannels, except that there is no time limit - a dispatch operation policy plugin can delay the dispatch operation indefinitely.

Parameters

self

a dispatch operation

 

Returns

a token which can be used to end the delay


mcp_dispatch_operation_end_delay ()

void
mcp_dispatch_operation_end_delay (McpDispatchOperation *self,
                                  McpDispatchOperationDelay *delay);

Stop delaying the dispatch operation, allowing dispatching to proceed.

Parameters

self

a dispatch operation

 

delay

a token obtained by calling mcp_dispatch_operation_start_delay() on self previously

 

mcp_dispatch_operation_leave_channels ()

void
mcp_dispatch_operation_leave_channels (McpDispatchOperation *self,
                                       gboolean wait_for_observers,
                                       TpChannelGroupChangeReason reason,
                                       const gchar *message);

mcp_dispatch_operation_leave_channels has been deprecated since version 5.15.1 and should not be used in newly-written code.

Use tp_call_channel_hangup_async() to hang up Call channels, mcp_dispatch_operation_close_channels() to close generic channels, or mcp_dispatch_operation_destroy_channels() to terminate the channel destructively.

Leave all channels in this bundle by using RemoveMembersWithReason if the channel has the Group interface, or Close if not.

This method was intended for StreamedMedia channels, which (ab)used the Group interface for call control. StreamedMedia channels have been superseded by Call channels, which have a proper "hang up" method which should be used instead.

Parameters

self

a dispatch operation

 

wait_for_observers

if FALSE, leave the channels immediately; if TRUE (usually recommended), wait for Observers to reply first

 

reason

the reason code to give

 

message

a human-readable message provided by the user, or either the empty string or NULL if no message has been provided

 

mcp_dispatch_operation_close_channels ()

void
mcp_dispatch_operation_close_channels (McpDispatchOperation *self,
                                       gboolean wait_for_observers);

Close all channels in this bundle by using the Close D-Bus method.

Plugins that terminate an audio or audio/video call should use tp_call_channel_hangup_async() instead.

Parameters

self

a dispatch operation

 

wait_for_observers

if FALSE, close the channels immediately; if TRUE (usually recommended), wait for Observers to reply first

 

mcp_dispatch_operation_destroy_channels ()

void
mcp_dispatch_operation_destroy_channels
                               (McpDispatchOperation *self,
                                gboolean wait_for_observers);

Close all channels in this bundle destructively, by using the Destroy D-Bus method if implemented, or the Close D-Bus method if not.

Plugins that terminate an audio or audio/video call should use tp_call_channel_hangup_async() instead.

Parameters

self

a dispatch operation

 

wait_for_observers

if FALSE, close the channels immediately; if TRUE (usually recommended), wait for Observers to reply first

 

Types and Values

McpDispatchOperationDelay

typedef struct _McpDispatchOperationDelay McpDispatchOperationDelay;
telepathy-mission-control-5.16.4/doc/reference/mission-control-plugins/html/ch01.html0000644000175000017500000000376412762352250031741 0ustar00gkiagiagkiagia00000000000000 Global functions: Mission Control Plugins Reference Manual

Global functions

Plugin loader and global functions — Writing a plugin, or loading plugins
telepathy-mission-control-5.16.4/doc/reference/mission-control-plugins/html/McpRequest.html0000644000175000017500000003231212762352250033265 0ustar00gkiagiagkiagia00000000000000 McpRequest: Mission Control Plugins Reference Manual

McpRequest

McpRequest — Request object, implemented by Mission Control

Types and Values

Object Hierarchy

    GInterface
    ╰── McpRequest

Includes

#include <mission-control-plugins/mission-control-plugins.h>

Description

Functions

mcp_request_find_request_by_type ()

gboolean
mcp_request_find_request_by_type (McpRequest *self,
                                  guint start_from,
                                  GQuark channel_type,
                                  guint *ret_index,
                                  GHashTable **ret_ref_requested_properties);

mcp_request_get_account_path ()

const gchar *
mcp_request_get_account_path (McpRequest *self);

mcp_request_get_protocol ()

const gchar *
mcp_request_get_protocol (McpRequest *self);

mcp_request_get_cm_name ()

const gchar *
mcp_request_get_cm_name (McpRequest *self);

mcp_request_get_user_action_time ()

gint64
mcp_request_get_user_action_time (McpRequest *self);

mcp_request_get_n_requests ()

guint
mcp_request_get_n_requests (McpRequest *self);

mcp_request_ref_nth_request ()

GHashTable *
mcp_request_ref_nth_request (McpRequest *self,
                             guint n);

mcp_request_deny ()

void
mcp_request_deny (McpRequest *self,
                  GQuark domain,
                  gint code,
                  const gchar *message);

mcp_request_start_delay ()

McpRequestDelay *
mcp_request_start_delay (McpRequest *self);

mcp_request_end_delay ()

void
mcp_request_end_delay (McpRequest *self,
                       McpRequestDelay *delay);

Types and Values

McpRequestDelay

typedef struct _McpRequestDelay McpRequestDelay;

See Also

McpRequestPolicy

McpDispatchOperationPolicy.html0000644000175000017500000006622612762352250036371 0ustar00gkiagiagkiagia00000000000000telepathy-mission-control-5.16.4/doc/reference/mission-control-plugins/html McpDispatchOperationPolicy: Mission Control Plugins Reference Manual

McpDispatchOperationPolicy

McpDispatchOperationPolicy — Dispatch Operation policy object, implemented by plugins

Object Hierarchy

    GInterface
    ╰── McpDispatchOperationPolicy

Includes

#include <mission-control-plugins/mission-control-plugins.h>

Description

Plugins may implement McpDispatchOperationPolicy in order to apply policy to Telepathy channel dispatch operations passing through the Channel Dispatcher part of Mission Control. This interface behaves rather like the Observer clients in the Telepathy specification, and has access to the same information, but runs within the Mission Control process rather than being invoked over D-Bus.

To do so, the plugin must implement a GObject subclass that implements McpDispatchOperationPolicy, then return an instance of that subclass from mcp_plugin_ref_nth_object().

A typical plugin might look like this:

Example 3. 

G_DEFINE_TYPE_WITH_CODE (MyPlugin, my_plugin,
   G_TYPE_OBJECT,
   G_IMPLEMENT_INTERFACE (...);
   G_IMPLEMENT_INTERFACE (MCP_TYPE_DISPATCH_OPERATION_POLICY,
     cdo_policy_iface_init);
   G_IMPLEMENT_INTERFACE (...))
/* ... */
static void
cdo_policy_iface_init (McpDispatchOperationPolicyIface *iface,
    gpointer unused G_GNUC_UNUSED)
{
  iface->check = my_plugin_check_cdo;
  iface->handler_is_suitable_async = my_plugin_handler_is_suitable_async;
  iface->handler_is_suitable_finish = my_plugin_handler_is_suitable_finish;
}

A single object can implement more than one interface; for instance, it may be useful to combine this interface with McpRequestPolicy.

Functions

McpDispatchOperationPolicyCb ()

void
(*McpDispatchOperationPolicyCb) (McpDispatchOperationPolicy *policy,
                                 McpDispatchOperation *dispatch_operation);

Signature of an implementation of mcp_dispatch_operation_policy_check().

Parameters

policy

an implementation of this interface, provided by a plugin

 

dispatch_operation

an object representing a dispatch operation, i.e. a bundle of channels being dispatched

 

mcp_dispatch_operation_policy_check ()

void
mcp_dispatch_operation_policy_check (McpDispatchOperationPolicy *policy,
                                     McpDispatchOperation *dispatch_operation);

Check what to do with a bundle of channels. Implementations of this method can use methods on dispatch_operation to examine the channels, delay dispatching, close the channels, etc. in order to impose whatever policy the plugin requires.

Mission Control calls this function in each plugin after invoking Observers, but before Approvers, and without waiting for Observers to reply.

Parameters

policy

an implementation of this interface, provided by a plugin

 

dispatch_operation

an object representing a dispatch operation, i.e. a bundle of channels being dispatched

 

McpDispatchOperationPolicyHandlerIsSuitableAsync ()

void
(*McpDispatchOperationPolicyHandlerIsSuitableAsync)
                               (McpDispatchOperationPolicy *policy,
                                TpClient *handler,
                                const gchar *unique_name,
                                McpDispatchOperation *dispatch_operation,
                                GAsyncReadyCallback callback,
                                gpointer user_data);

Signature of mcp_dispatch_operation_policy_handler_is_suitable_async()

Parameters

policy

an implementation of this interface, provided by a plugin

 

handler

a proxy for the Handler's D-Bus API, or NULL if the Handler is calling Claim (so its well-known name is not immediately obvious)

 

unique_name

The Handler's unique name, or empty or NULL if it has not yet been started

 

dispatch_operation

an object representing a dispatch operation, i.e. a bundle of channels being dispatched

 

callback

callback to be called on success or failure

 

user_data

user data for the callback

 

McpDispatchOperationPolicyFinisher ()

gboolean
(*McpDispatchOperationPolicyFinisher) (McpDispatchOperationPolicy *policy,
                                       GAsyncResult *result,
                                       GError **error);

Signature of a virtual method used to finish an asynchronous operation that succeeds or fails, but does not return any additional value.

Parameters

policy

an implementation of this interface, provided by a plugin

 

result

the asynchronous result passed to a GAsyncReadyCallback

 

error

used to return an error.

[allow-none]

Returns

TRUE if the operation succeeded, FALSE on error


mcp_dispatch_operation_policy_handler_is_suitable_async ()

void
mcp_dispatch_operation_policy_handler_is_suitable_async
                               (McpDispatchOperationPolicy *policy,
                                TpClient *handler,
                                const gchar *unique_name,
                                McpDispatchOperation *dispatch_operation,
                                GAsyncReadyCallback callback,
                                gpointer user_data);

Check whether a handler is "suitable" for these channels. For instance, this could be used to ensure that only the platform's default UI can be used for particular channels, even if MC would normally consider a third-party UI to be a better match.

Mission Control calls all implementations of this method in parallel and waits for them all to return. If any of them raises an error, the handler is considered to be unsuitable.

Parameters

policy

an implementation of this interface, provided by a plugin

 

handler

a proxy for the Handler's D-Bus API, or NULL if the Handler is calling Claim (so its well-known name is not immediately obvious)

 

unique_name

The Handler's unique name, or empty or NULL if it has not yet been started

 

dispatch_operation

an object representing a dispatch operation, i.e. a bundle of channels being dispatched

 

callback

callback to be called on success or failure

 

user_data

user data for the callback

 

mcp_dispatch_operation_policy_handler_is_suitable_finish ()

gboolean
mcp_dispatch_operation_policy_handler_is_suitable_finish
                               (McpDispatchOperationPolicy *policy,
                                GAsyncResult *result,
                                GError **error);

Finish a call to mcp_dispatch_operation_policy_handler_is_suitable_async().

Parameters

policy

an implementation of this interface, provided by a plugin

 

result

the asynchronous result passed to the GAsyncReadyCallback

 

error

used to return an error.

[allow-none]

Returns

TRUE if the handler is suitable; FALSE if the handler is unsuitable or there was an error


mcp_dispatch_operation_policy_iface_implement_check ()

void
mcp_dispatch_operation_policy_iface_implement_check
                               (McpDispatchOperationPolicyIface *iface,
                                McpDispatchOperationPolicyCb impl);

This method is no longer necessary: just set iface->check = impl instead.

Parameters

iface

the interface

 

impl

an implementation of the virtual method mcp_dispatch_operation_policy_check()

 

Types and Values

mission-control-plugins-overrides.txt0000644000175000017500000000000012762351725036636 0ustar00gkiagiagkiagia00000000000000telepathy-mission-control-5.16.4/doc/reference/mission-control-pluginsmission-control-plugins-docs.sgml0000644000175000017500000000312612735242352035716 0ustar00gkiagiagkiagia00000000000000telepathy-mission-control-5.16.4/doc/reference/mission-control-plugins ]> Mission Control Plugins Reference Manual The latest version of this documentation in this stable branch can be found on-line at http://telepathy.freedesktop.org/doc/mission-control-plugins-5.16.x/. Global functions Account storage Channel requests Channel dispatch operations Object Hierarchy API Index telepathy-mission-control-5.16.4/doc/reference/Makefile.am0000644000175000017500000000004212735241312024550 0ustar00gkiagiagkiagia00000000000000SUBDIRS = mission-control-plugins telepathy-mission-control-5.16.4/doc/reference/Makefile.in0000644000175000017500000004644312762351617024612 0ustar00gkiagiagkiagia00000000000000# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__make_dryrun = \ { \ am__dry=no; \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ *) \ for am__flg in $$MAKEFLAGS; do \ case $$am__flg in \ *=*|--*) ;; \ *n*) am__dry=yes; break;; \ esac; \ done;; \ esac; \ test $$am__dry = yes; \ } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = doc/reference DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/gtk-doc.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/tp-compiler-flag.m4 \ $(top_srcdir)/m4/tp-compiler-warnings.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACCOUNTS_CACHE_DIR = @ACCOUNTS_CACHE_DIR@ ACCOUNTS_DIR = @ACCOUNTS_DIR@ ACLOCAL = @ACLOCAL@ AEGIS_LIBS = @AEGIS_LIBS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DBUS_CFLAGS = @DBUS_CFLAGS@ DBUS_LIBS = @DBUS_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ERROR_CFLAGS = @ERROR_CFLAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GIO_UNIX_CFLAGS = @GIO_UNIX_CFLAGS@ GIO_UNIX_LIBS = @GIO_UNIX_LIBS@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_COMPILE_SCHEMAS = @GLIB_COMPILE_SCHEMAS@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ GLIB_MKENUMS = @GLIB_MKENUMS@ GREP = @GREP@ GSETTINGS_DISABLE_SCHEMAS_COMPILE = @GSETTINGS_DISABLE_SCHEMAS_COMPILE@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ HTML_DIR = @HTML_DIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBACCOUNTS_SSO_CFLAGS = @LIBACCOUNTS_SSO_CFLAGS@ LIBACCOUNTS_SSO_LIBS = @LIBACCOUNTS_SSO_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MCE_CFLAGS = @MCE_CFLAGS@ MCE_LIBS = @MCE_LIBS@ MCP_ABI_VERSION = @MCP_ABI_VERSION@ MCP_API_VERSION = @MCP_API_VERSION@ MCP_LT_AGE = @MCP_LT_AGE@ MCP_LT_CURRENT = @MCP_LT_CURRENT@ MCP_LT_REVISION = @MCP_LT_REVISION@ MKDIR_P = @MKDIR_P@ NETWORK_MANAGER_CFLAGS = @NETWORK_MANAGER_CFLAGS@ NETWORK_MANAGER_LIBS = @NETWORK_MANAGER_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PYTHON = @PYTHON@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TELEPATHY_CFLAGS = @TELEPATHY_CFLAGS@ TELEPATHY_LIBS = @TELEPATHY_LIBS@ UPOWER_GLIB_CFLAGS = @UPOWER_GLIB_CFLAGS@ UPOWER_GLIB_LIBS = @UPOWER_GLIB_LIBS@ VERSION = @VERSION@ XSLTPROC = @XSLTPROC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gsettingsschemadir = @gsettingsschemadir@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mctestsdir = @mctestsdir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ pluginlibdir = @pluginlibdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = mission-control-plugins all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/reference/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu doc/reference/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-am clean clean-generic clean-libtool \ ctags ctags-recursive distclean distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: telepathy-mission-control-5.16.4/doc/Makefile.am0000644000175000017500000000061012735242352022620 0ustar00gkiagiagkiagia00000000000000SUBDIRS = reference SPECS = $(top_srcdir)/xml/all.xml SPECS_DOC = mc-dbus-iface.html all-local: $(SPECS_DOC) $(SPECS_DOC): $(top_srcdir)/xml/all.xml $(wildcard $(top_srcdir)/xml/*.xml) $(top_srcdir)/tools/doc-generator.xsl $(XSLTPROC) --xinclude --novalid \ --param allow-undefined-interfaces "true()" \ $(top_srcdir)/tools/doc-generator.xsl $< > $@ clean-local: rm -f $(SPECS_DOC) telepathy-mission-control-5.16.4/doc/Makefile.in0000644000175000017500000004722612762351617022654 0ustar00gkiagiagkiagia00000000000000# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__make_dryrun = \ { \ am__dry=no; \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ *) \ for am__flg in $$MAKEFLAGS; do \ case $$am__flg in \ *=*|--*) ;; \ *n*) am__dry=yes; break;; \ esac; \ done;; \ esac; \ test $$am__dry = yes; \ } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = doc DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/gtk-doc.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/tp-compiler-flag.m4 \ $(top_srcdir)/m4/tp-compiler-warnings.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACCOUNTS_CACHE_DIR = @ACCOUNTS_CACHE_DIR@ ACCOUNTS_DIR = @ACCOUNTS_DIR@ ACLOCAL = @ACLOCAL@ AEGIS_LIBS = @AEGIS_LIBS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DBUS_CFLAGS = @DBUS_CFLAGS@ DBUS_LIBS = @DBUS_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ERROR_CFLAGS = @ERROR_CFLAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GIO_UNIX_CFLAGS = @GIO_UNIX_CFLAGS@ GIO_UNIX_LIBS = @GIO_UNIX_LIBS@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_COMPILE_SCHEMAS = @GLIB_COMPILE_SCHEMAS@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ GLIB_MKENUMS = @GLIB_MKENUMS@ GREP = @GREP@ GSETTINGS_DISABLE_SCHEMAS_COMPILE = @GSETTINGS_DISABLE_SCHEMAS_COMPILE@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ HTML_DIR = @HTML_DIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBACCOUNTS_SSO_CFLAGS = @LIBACCOUNTS_SSO_CFLAGS@ LIBACCOUNTS_SSO_LIBS = @LIBACCOUNTS_SSO_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MCE_CFLAGS = @MCE_CFLAGS@ MCE_LIBS = @MCE_LIBS@ MCP_ABI_VERSION = @MCP_ABI_VERSION@ MCP_API_VERSION = @MCP_API_VERSION@ MCP_LT_AGE = @MCP_LT_AGE@ MCP_LT_CURRENT = @MCP_LT_CURRENT@ MCP_LT_REVISION = @MCP_LT_REVISION@ MKDIR_P = @MKDIR_P@ NETWORK_MANAGER_CFLAGS = @NETWORK_MANAGER_CFLAGS@ NETWORK_MANAGER_LIBS = @NETWORK_MANAGER_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PYTHON = @PYTHON@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TELEPATHY_CFLAGS = @TELEPATHY_CFLAGS@ TELEPATHY_LIBS = @TELEPATHY_LIBS@ UPOWER_GLIB_CFLAGS = @UPOWER_GLIB_CFLAGS@ UPOWER_GLIB_LIBS = @UPOWER_GLIB_LIBS@ VERSION = @VERSION@ XSLTPROC = @XSLTPROC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gsettingsschemadir = @gsettingsschemadir@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mctestsdir = @mctestsdir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ pluginlibdir = @pluginlibdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = reference SPECS = $(top_srcdir)/xml/all.xml SPECS_DOC = mc-dbus-iface.html all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu doc/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile all-local installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool clean-local mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am all-local check check-am clean clean-generic \ clean-libtool clean-local ctags ctags-recursive distclean \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs installdirs-am \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-recursive uninstall uninstall-am all-local: $(SPECS_DOC) $(SPECS_DOC): $(top_srcdir)/xml/all.xml $(wildcard $(top_srcdir)/xml/*.xml) $(top_srcdir)/tools/doc-generator.xsl $(XSLTPROC) --xinclude --novalid \ --param allow-undefined-interfaces "true()" \ $(top_srcdir)/tools/doc-generator.xsl $< > $@ clean-local: rm -f $(SPECS_DOC) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: telepathy-mission-control-5.16.4/configure0000755000175000017500000240613612762351617021752 0ustar00gkiagiagkiagia00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69 for telepathy-mission-control 5.16.4. # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then _as_can_reexec=no; export _as_can_reexec; # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 as_fn_exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1 test \$(( 1 + 1 )) = 2 || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, $0: including any error possibly output before this $0: message. Then install a modern shell, or manually run $0: the script under such a shell if you do have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" SHELL=${CONFIG_SHELL-/bin/sh} test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME='telepathy-mission-control' PACKAGE_TARNAME='telepathy-mission-control' PACKAGE_VERSION='5.16.4' PACKAGE_STRING='telepathy-mission-control 5.16.4' PACKAGE_BUGREPORT='' PACKAGE_URL='' ac_unique_file="Makefile.am" # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LIBOBJS pluginlibdir GSETTINGS_RULES GLIB_COMPILE_SCHEMAS gsettingsschemadir GSETTINGS_DISABLE_SCHEMAS_COMPILE GTK_DOC_USE_REBASE_FALSE GTK_DOC_USE_REBASE_TRUE GTK_DOC_USE_LIBTOOL_FALSE GTK_DOC_USE_LIBTOOL_TRUE GTK_DOC_BUILD_PDF_FALSE GTK_DOC_BUILD_PDF_TRUE GTK_DOC_BUILD_HTML_FALSE GTK_DOC_BUILD_HTML_TRUE ENABLE_GTK_DOC_FALSE ENABLE_GTK_DOC_TRUE HAVE_GTK_DOC_FALSE HAVE_GTK_DOC_TRUE GTKDOC_DEPS_LIBS GTKDOC_DEPS_CFLAGS HTML_DIR GTKDOC_MKPDF GTKDOC_REBASE GTKDOC_CHECK_PATH GTKDOC_CHECK GLIB_MKENUMS GLIB_GENMARSHAL UPOWER_GLIB_LIBS UPOWER_GLIB_CFLAGS ENABLE_CONN_SETTING_FALSE ENABLE_CONN_SETTING_TRUE HAVE_NM_FALSE HAVE_NM_TRUE NETWORK_MANAGER_LIBS NETWORK_MANAGER_CFLAGS HAVE_MCE_FALSE HAVE_MCE_TRUE MCE_LIBS MCE_CFLAGS GIO_UNIX_LIBS GIO_UNIX_CFLAGS GLIB_LIBS GLIB_CFLAGS TELEPATHY_LIBS TELEPATHY_CFLAGS DBUS_LIBS DBUS_CFLAGS ENABLE_LIBACCOUNTS_GLIB_HIDDEN_FALSE ENABLE_LIBACCOUNTS_GLIB_HIDDEN_TRUE ENABLE_LIBACCOUNTS_SSO_FALSE ENABLE_LIBACCOUNTS_SSO_TRUE LIBACCOUNTS_SSO_LIBS LIBACCOUNTS_SSO_CFLAGS PKG_CONFIG_LIBDIR PKG_CONFIG_PATH PKG_CONFIG ENABLE_AEGIS_FALSE ENABLE_AEGIS_TRUE AEGIS_LIBS ACCOUNTS_CACHE_DIR ACCOUNTS_DIR mctestsdir ENABLE_INSTALLED_TESTS_FALSE ENABLE_INSTALLED_TESTS_TRUE WANT_TWISTED_TESTS_FALSE WANT_TWISTED_TESTS_TRUE pkgpyexecdir pyexecdir pkgpythondir pythondir PYTHON_PLATFORM PYTHON_EXEC_PREFIX PYTHON_PREFIX PYTHON_VERSION PYTHON XSLTPROC ERROR_CFLAGS MCP_ABI_VERSION MCP_LT_AGE MCP_LT_REVISION MCP_LT_CURRENT MCP_API_VERSION CXXCPP LT_SYS_LIBRARY_PATH OTOOL64 OTOOL LIPO NMEDIT DSYMUTIL MANIFEST_TOOL RANLIB ac_ct_AR AR DLLTOOL OBJDUMP LN_S NM ac_ct_DUMPBIN DUMPBIN LD FGREP EGREP GREP SED LIBTOOL am__fastdepCXX_FALSE am__fastdepCXX_TRUE CXXDEPMODE ac_ct_CXX CXXFLAGS CXX CPP am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE am__nodep AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE am__quote am__include DEPDIR OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC host_os host_vendor host_cpu host build_os build_vendor build_cpu build AM_BACKSLASH AM_DEFAULT_VERBOSITY AM_DEFAULT_V AM_V am__untar am__tar AMTAR am__leading_dot SET_MAKE AWK mkdir_p MKDIR_P INSTALL_STRIP_PROGRAM STRIP install_sh MAKEINFO AUTOHEADER AUTOMAKE AUTOCONF ACLOCAL VERSION PACKAGE CYGPATH_W am__isrc INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking enable_silent_rules enable_dependency_tracking enable_shared enable_static with_pic enable_fast_install with_aix_soname with_gnu_ld with_sysroot enable_libtool_lock enable_Werror enable_debug enable_cast_checks enable_asserts enable_checks enable_coverage enable_installed_tests with_accounts_dir with_accounts_cache_dir enable_aegis enable_libaccounts_sso with_accounts_glib_hidden_service_type with_connectivity enable_conn_setting enable_upower with_html_dir enable_gtk_doc enable_gtk_doc_html enable_gtk_doc_pdf enable_schemas_compile ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP CXX CXXFLAGS CCC LT_SYS_LIBRARY_PATH CXXCPP PYTHON PKG_CONFIG PKG_CONFIG_PATH PKG_CONFIG_LIBDIR LIBACCOUNTS_SSO_CFLAGS LIBACCOUNTS_SSO_LIBS DBUS_CFLAGS DBUS_LIBS TELEPATHY_CFLAGS TELEPATHY_LIBS GLIB_CFLAGS GLIB_LIBS GIO_UNIX_CFLAGS GIO_UNIX_LIBS MCE_CFLAGS MCE_LIBS NETWORK_MANAGER_CFLAGS NETWORK_MANAGER_LIBS UPOWER_GLIB_CFLAGS UPOWER_GLIB_LIBS GTKDOC_DEPS_CFLAGS GTKDOC_DEPS_LIBS' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures telepathy-mission-control 5.16.4 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/telepathy-mission-control] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of telepathy-mission-control 5.16.4:";; esac cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-silent-rules less verbose build output (undo: `make V=1') --disable-silent-rules verbose build output (undo: `make V=0') --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --enable-shared[=PKGS] build shared libraries [default=yes] --enable-static[=PKGS] build static libraries [default=yes] --enable-fast-install[=PKGS] optimize for fast installation [default=yes] --disable-libtool-lock avoid locking (might break parallel builds) --disable-Werror compile without -Werror (normally enabled in development builds) --disable-debug compile without debug code --disable-cast-checks compile with GLIB cast checks disabled --disable-asserts compile with GLIB assertions disabled --disable-checks compile with GLIB checks disabled --enable-coverage compile with coverage info --enable-installed-tests make tests installable --enable-aegis Aegis security framework support --enable-libaccounts-sso build with SSO suport. default=no --enable-conn-setting use a GSetting to control automatic connectivity [default=yes] --enable-upower monitor device suspending and resuming using upower-glib [default=auto] --enable-gtk-doc use gtk-doc to build documentation [[default=no]] --enable-gtk-doc-html build documentation in html format [[default=yes]] --enable-gtk-doc-pdf build documentation in pdf format [[default=no]] --disable-schemas-compile Disable regeneration of gschemas.compiled on install Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use both] --with-aix-soname=aix|svr4|both shared library versioning (aka "SONAME") variant to provide on AIX, [default=aix]. --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-sysroot[=DIR] Search for dependent libraries within DIR (or the compiler's sysroot if not specified). --with-accounts-dir= Directory in which accounts were previously stored --with-accounts-cache-dir= Directory for account/connection mapping for crash recovery --with-accounts-glib-hidden-service-type mark accounts with the provided service type as hidden [default=no] --with-connectivity=[nm/auto/no] build with connectivity support --with-html-dir=PATH path to installed docs Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor CXX C++ compiler command CXXFLAGS C++ compiler flags LT_SYS_LIBRARY_PATH User-defined run-time library search path. CXXCPP C++ preprocessor PYTHON the Python interpreter PKG_CONFIG path to pkg-config utility PKG_CONFIG_PATH directories to add to pkg-config's search path PKG_CONFIG_LIBDIR path overriding pkg-config's built-in search path LIBACCOUNTS_SSO_CFLAGS C compiler flags for LIBACCOUNTS_SSO, overriding pkg-config LIBACCOUNTS_SSO_LIBS linker flags for LIBACCOUNTS_SSO, overriding pkg-config DBUS_CFLAGS C compiler flags for DBUS, overriding pkg-config DBUS_LIBS linker flags for DBUS, overriding pkg-config TELEPATHY_CFLAGS C compiler flags for TELEPATHY, overriding pkg-config TELEPATHY_LIBS linker flags for TELEPATHY, overriding pkg-config GLIB_CFLAGS C compiler flags for GLIB, overriding pkg-config GLIB_LIBS linker flags for GLIB, overriding pkg-config GIO_UNIX_CFLAGS C compiler flags for GIO_UNIX, overriding pkg-config GIO_UNIX_LIBS linker flags for GIO_UNIX, overriding pkg-config MCE_CFLAGS C compiler flags for MCE, overriding pkg-config MCE_LIBS linker flags for MCE, overriding pkg-config NETWORK_MANAGER_CFLAGS C compiler flags for NETWORK_MANAGER, overriding pkg-config NETWORK_MANAGER_LIBS linker flags for NETWORK_MANAGER, overriding pkg-config UPOWER_GLIB_CFLAGS C compiler flags for UPOWER_GLIB, overriding pkg-config UPOWER_GLIB_LIBS linker flags for UPOWER_GLIB, overriding pkg-config GTKDOC_DEPS_CFLAGS C compiler flags for GTKDOC_DEPS, overriding pkg-config GTKDOC_DEPS_LIBS linker flags for GTKDOC_DEPS, overriding pkg-config Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to the package provider. _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF telepathy-mission-control configure 5.16.4 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_c_try_compile LINENO # -------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile # ac_fn_c_try_cpp LINENO # ---------------------- # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_cpp # ac_fn_cxx_try_compile LINENO # ---------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_cxx_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_compile # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in # INCLUDES, setting the cache variable VAR accordingly. ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile # ac_fn_c_try_run LINENO # ---------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes # that executables *can* be run. ac_fn_c_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then : ac_retval=0 else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_run # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $2 (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $2 /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $2 (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$2 || defined __stub___$2 choke me #endif int main () { return $2 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func # ac_fn_cxx_try_cpp LINENO # ------------------------ # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_cxx_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_cpp # ac_fn_cxx_try_link LINENO # ------------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_cxx_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_link # ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists, giving a warning if it cannot be compiled using # the include files in INCLUDES and setting the cache variable VAR # accordingly. ac_fn_c_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if eval \${$3+:} false; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 $as_echo_n "checking $2 usability... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_header_compiler=yes else ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 $as_echo_n "checking $2 presence... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <$2> _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : ac_header_preproc=yes else ac_header_preproc=no fi rm -f conftest.err conftest.i conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( yes:no: ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; no:yes:* ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_mongrel cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by telepathy-mission-control $as_me 5.16.4, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo $as_echo "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo $as_echo "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then $as_echo "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then $as_echo "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h $as_echo "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_URL "$PACKAGE_URL" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then # We do not want a PATH search for config.site. case $CONFIG_SITE in #(( -*) ac_site_file1=./$CONFIG_SITE;; */*) ac_site_file1=$CONFIG_SITE;; *) ac_site_file1=./$CONFIG_SITE;; esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_aux_dir= for ac_dir in build-aux "$srcdir"/build-aux; do if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then as_fn_error $? "cannot find install-sh, install.sh, or shtool in build-aux \"$srcdir\"/build-aux" "$LINENO" 5 fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. am__api_version='1.11' # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if ${ac_cv_path_install+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in #(( ./ | .// | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 $as_echo "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 $as_echo_n "checking whether build environment is sane... " >&6; } # Just in case sleep 1 echo timestamp > conftest.file # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;; esac # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi rm -f conftest.file if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". as_fn_error $? "ls -t appears to fail. Make sure there is not a broken alias in your environment" "$LINENO" 5 fi test "$2" = conftest.file ) then # Ok. : else as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. # By default was `s,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5 $as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} fi if test x"${install_sh}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if ${ac_cv_path_mkdir+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi test -d ./--version && rmdir ./--version if test "${ac_cv_path_mkdir+set}" = set; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. MKDIR_P="$ac_install_sh -d" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 $as_echo "$MKDIR_P" >&6; } mkdir_p="$MKDIR_P" case $mkdir_p in [\\/$]* | ?:[\\/]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; esac for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AWK+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 $as_echo "$AWK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AWK" && break done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE='telepathy-mission-control' VERSION='5.16.4' cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # We need awk for the "check" target. The system "awk" is bad on # some platforms. # Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AMTAR='$${TAR-tar}' { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to create a ustar tar archive" >&5 $as_echo_n "checking how to create a ustar tar archive... " >&6; } # Loop over all known methods to create a tar archive until one works. _am_tools='gnutar plaintar pax cpio none' _am_tools=${am_cv_prog_tar_ustar-$_am_tools} # Do not fold the above two line into one, because Tru64 sh and # Solaris sh will not grok spaces in the rhs of `-'. for _am_tool in $_am_tools do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do { echo "$as_me:$LINENO: $_am_tar --version" >&5 ($_am_tar --version) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && break done am__tar="$_am_tar --format=ustar -chf - "'"$$tardir"' am__tar_="$_am_tar --format=ustar -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x ustar -w "$$tardir"' am__tar_='pax -L -x ustar -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H ustar -L' am__tar_='find "$tardir" -print | cpio -o -H ustar -L' am__untar='cpio -i -H ustar -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_ustar}" && break # tar/untar a dummy directory, and stop if the command works rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file { echo "$as_me:$LINENO: tardir=conftest.dir && eval $am__tar_ >conftest.tar" >&5 (tardir=conftest.dir && eval $am__tar_ >conftest.tar) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } rm -rf conftest.dir if test -s conftest.tar; then { echo "$as_me:$LINENO: $am__untar &5 ($am__untar &5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } grep GrepMe conftest.dir/file >/dev/null 2>&1 && break fi done rm -rf conftest.dir if ${am_cv_prog_tar_ustar+:} false; then : $as_echo_n "(cached) " >&6 else am_cv_prog_tar_ustar=$_am_tool fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_tar_ustar" >&5 $as_echo "$am_cv_prog_tar_ustar" >&6; } # Check whether --enable-silent-rules was given. if test "${enable_silent_rules+set}" = set; then : enableval=$enable_silent_rules; fi case $enable_silent_rules in yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=1;; esac am_make=${MAKE-make} { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 $as_echo_n "checking whether $am_make supports nested variables... " >&6; } if ${am_cv_make_support_nested_variables+:} false; then : $as_echo_n "(cached) " >&6 else if $as_echo 'TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 $as_echo "$am_cv_make_support_nested_variables" >&6; } if test $am_cv_make_support_nested_variables = yes; then AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AM_BACKSLASH='\' ac_config_headers="$ac_config_headers config.h" # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 $as_echo_n "checking build system type... " >&6; } if ${ac_cv_build+:} false; then : $as_echo_n "(cached) " >&6 else ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` test "x$ac_build_alias" = x && as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 $as_echo "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' set x $ac_cv_build shift build_cpu=$1 build_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: build_os=$* IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 $as_echo_n "checking host system type... " >&6; } if ${ac_cv_host+:} false; then : $as_echo_n "(cached) " >&6 else if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 $as_echo "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' set x $ac_cv_host shift host_cpu=$1 host_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: host_os=$* IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 $as_echo_n "checking whether the C compiler works... " >&6; } ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { { ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi if test -z "$ac_file"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 $as_echo_n "checking for C compiler default output file name... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 $as_echo "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 $as_echo_n "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 $as_echo_n "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } if ${ac_cv_objext+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 $as_echo_n "checking for style of include used by $am_make... " >&6; } am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from `make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 $as_echo "$_am_result" >&6; } rm -f confinc confmf # Check whether --enable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then : enableval=$enable_dependency_tracking; fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi depcc="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CC_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok `-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 $as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if ${ac_cv_prog_CPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 $as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test -z "$CXX"; then if test -n "$CCC"; then CXX=$CCC else if test -n "$ac_tool_prefix"; then for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CXX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 $as_echo "$CXX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CXX" && break done fi if test -z "$CXX"; then ac_ct_CXX=$CXX for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CXX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CXX"; then ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CXX="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 $as_echo "$ac_ct_CXX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CXX" && break done if test "x$ac_ct_CXX" = x; then CXX="g++" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CXX=$ac_ct_CXX fi fi fi fi # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5 $as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } if ${ac_cv_cxx_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_cxx_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 $as_echo "$ac_cv_cxx_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GXX=yes else GXX= fi ac_test_CXXFLAGS=${CXXFLAGS+set} ac_save_CXXFLAGS=$CXXFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 $as_echo_n "checking whether $CXX accepts -g... " >&6; } if ${ac_cv_prog_cxx_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_cxx_werror_flag=$ac_cxx_werror_flag ac_cxx_werror_flag=yes ac_cv_prog_cxx_g=no CXXFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_prog_cxx_g=yes else CXXFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : else ac_cxx_werror_flag=$ac_save_cxx_werror_flag CXXFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_prog_cxx_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cxx_werror_flag=$ac_save_cxx_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 $as_echo "$ac_cv_prog_cxx_g" >&6; } if test "$ac_test_CXXFLAGS" = set; then CXXFLAGS=$ac_save_CXXFLAGS elif test $ac_cv_prog_cxx_g = yes; then if test "$GXX" = yes; then CXXFLAGS="-g -O2" else CXXFLAGS="-g" fi else if test "$GXX" = yes; then CXXFLAGS="-O2" else CXXFLAGS= fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CXX" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CXX_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CXX_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok `-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CXX_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CXX_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5 $as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; } CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then am__fastdepCXX_TRUE= am__fastdepCXX_FALSE='#' else am__fastdepCXX_TRUE='#' am__fastdepCXX_FALSE= fi case `pwd` in *\ * | *\ *) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 $as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; esac macro_version='2.4.6' macro_revision='2.4.6' ltmain=$ac_aux_dir/ltmain.sh # Backslashify metacharacters that are still active within # double-quoted strings. sed_quote_subst='s/\(["`$\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 $as_echo_n "checking how to print strings... " >&6; } # Test print first, because it will be a builtin if present. if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='print -r --' elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='printf %s\n' else # Use this function as a fallback that always works. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } ECHO='func_fallback_echo' fi # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "" } case $ECHO in printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5 $as_echo "printf" >&6; } ;; print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 $as_echo "print -r" >&6; } ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5 $as_echo "cat" >&6; } ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 $as_echo_n "checking for a sed that does not truncate output... " >&6; } if ${ac_cv_path_SED+:} false; then : $as_echo_n "(cached) " >&6 else ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for ac_i in 1 2 3 4 5 6 7; do ac_script="$ac_script$as_nl$ac_script" done echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed { ac_script=; unset ac_script;} if test -z "$SED"; then ac_path_SED_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_SED" || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED case `"$ac_path_SED" --version 2>&1` in *GNU*) ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo '' >> "conftest.nl" "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_SED_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_SED="$ac_path_SED" ac_path_SED_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_SED_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_SED"; then as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 fi else ac_cv_path_SED=$SED fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 $as_echo "$ac_cv_path_SED" >&6; } SED="$ac_cv_path_SED" rm -f conftest.sed test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if ${ac_cv_path_GREP+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if ${ac_cv_path_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 $as_echo_n "checking for fgrep... " >&6; } if ${ac_cv_path_FGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 then ac_cv_path_FGREP="$GREP -F" else if test -z "$FGREP"; then ac_path_FGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in fgrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_FGREP" || continue # Check for GNU ac_path_FGREP and select it if it is found. # Check for GNU $ac_path_FGREP case `"$ac_path_FGREP" --version 2>&1` in *GNU*) ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'FGREP' >> "conftest.nl" "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_FGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_FGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_FGREP"; then as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_FGREP=$FGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 $as_echo "$ac_cv_path_FGREP" >&6; } FGREP="$ac_cv_path_FGREP" test -z "$GREP" && GREP=grep # Check whether --with-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then : withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes else with_gnu_ld=no fi ac_prog=ld if test yes = "$GCC"; then # Check if gcc -print-prog-name=ld gives a path. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 $as_echo_n "checking for ld used by $CC... " >&6; } case $host in *-*-mingw*) # gcc leaves a trailing carriage return, which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD=$ac_prog ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test yes = "$with_gnu_ld"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 $as_echo_n "checking for GNU ld... " >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 $as_echo_n "checking for non-GNU ld... " >&6; } fi if ${lt_cv_path_LD+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$LD"; then lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD=$ac_dir/$ac_prog # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 $as_echo "$LD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } if ${lt_cv_prog_gnu_ld+:} false; then : $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 $as_echo "$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 $as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } if ${lt_cv_path_NM+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM=$NM else lt_nm_to_check=${ac_tool_prefix}nm if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. tmp_nm=$ac_dir/$lt_tmp_nm if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then # Check to see if the nm accepts a BSD-compat flag. # Adding the 'sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file # MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty case $build_os in mingw*) lt_bad_file=conftest.nm/nofile ;; *) lt_bad_file=/dev/null ;; esac case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in *$lt_bad_file* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break 2 ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break 2 ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS=$lt_save_ifs done : ${lt_cv_path_NM=no} fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 $as_echo "$lt_cv_path_NM" >&6; } if test no != "$lt_cv_path_NM"; then NM=$lt_cv_path_NM else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else if test -n "$ac_tool_prefix"; then for ac_prog in dumpbin "link -dump" do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DUMPBIN"; then ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DUMPBIN=$ac_cv_prog_DUMPBIN if test -n "$DUMPBIN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 $as_echo "$DUMPBIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$DUMPBIN" && break done fi if test -z "$DUMPBIN"; then ac_ct_DUMPBIN=$DUMPBIN for ac_prog in dumpbin "link -dump" do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DUMPBIN"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN if test -n "$ac_ct_DUMPBIN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 $as_echo "$ac_ct_DUMPBIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_DUMPBIN" && break done if test "x$ac_ct_DUMPBIN" = x; then DUMPBIN=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DUMPBIN=$ac_ct_DUMPBIN fi fi case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols -headers" ;; *) DUMPBIN=: ;; esac fi if test : != "$DUMPBIN"; then NM=$DUMPBIN fi fi test -z "$NM" && NM=nm { $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 $as_echo_n "checking the name lister ($NM) interface... " >&6; } if ${lt_cv_nm_interface+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: output\"" >&5) cat conftest.out >&5 if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 $as_echo "$lt_cv_nm_interface" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 $as_echo_n "checking whether ln -s works... " >&6; } LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 $as_echo "no, using $LN_S" >&6; } fi # find the maximum length of command line arguments { $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 $as_echo_n "checking the maximum length of command line arguments... " >&6; } if ${lt_cv_sys_max_cmd_len+:} false; then : $as_echo_n "(cached) " >&6 else i=0 teststring=ABCD case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; mint*) # On MiNT this can take a long time and run out of memory. lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; os2*) # The test takes a long time on OS/2. lt_cv_sys_max_cmd_len=8192 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len" && \ test undefined != "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test X`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test 17 != "$i" # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac fi if test -n "$lt_cv_sys_max_cmd_len"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 $as_echo "$lt_cv_sys_max_cmd_len" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 $as_echo "none" >&6; } fi max_cmd_len=$lt_cv_sys_max_cmd_len : ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 $as_echo_n "checking how to convert $build file names to $host format... " >&6; } if ${lt_cv_to_host_file_cmd+:} false; then : $as_echo_n "(cached) " >&6 else case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ;; esac ;; *-*-cygwin* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_noop ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ;; esac ;; * ) # unhandled hosts (and "normal" native builds) lt_cv_to_host_file_cmd=func_convert_file_noop ;; esac fi to_host_file_cmd=$lt_cv_to_host_file_cmd { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 $as_echo "$lt_cv_to_host_file_cmd" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 $as_echo_n "checking how to convert $build file names to toolchain format... " >&6; } if ${lt_cv_to_tool_file_cmd+:} false; then : $as_echo_n "(cached) " >&6 else #assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac ;; esac fi to_tool_file_cmd=$lt_cv_to_tool_file_cmd { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 $as_echo "$lt_cv_to_tool_file_cmd" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 $as_echo_n "checking for $LD option to reload object files... " >&6; } if ${lt_cv_ld_reload_flag+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_reload_flag='-r' fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 $as_echo "$lt_cv_ld_reload_flag" >&6; } reload_flag=$lt_cv_ld_reload_flag case $reload_flag in "" | " "*) ;; *) reload_flag=" $reload_flag" ;; esac reload_cmds='$LD$reload_flag -o $output$reload_objs' case $host_os in cygwin* | mingw* | pw32* | cegcc*) if test yes != "$GCC"; then reload_cmds=false fi ;; darwin*) if test yes = "$GCC"; then reload_cmds='$LTCC $LTCFLAGS -nostdlib $wl-r -o $output$reload_objs' else reload_cmds='$LD$reload_flag -o $output$reload_objs' fi ;; esac if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. set dummy ${ac_tool_prefix}objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OBJDUMP"; then ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OBJDUMP=$ac_cv_prog_OBJDUMP if test -n "$OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 $as_echo "$OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OBJDUMP"; then ac_ct_OBJDUMP=$OBJDUMP # Extract the first word of "objdump", so it can be a program name with args. set dummy objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OBJDUMP"; then ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OBJDUMP="objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP if test -n "$ac_ct_OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 $as_echo "$ac_ct_OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OBJDUMP" = x; then OBJDUMP="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OBJDUMP=$ac_ct_OBJDUMP fi else OBJDUMP="$ac_cv_prog_OBJDUMP" fi test -z "$OBJDUMP" && OBJDUMP=objdump { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 $as_echo_n "checking how to recognize dependent libraries... " >&6; } if ${lt_cv_deplibs_check_method+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. # 'unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # 'file_magic [[regex]]' -- check by looking for files in library path # that responds to the $file_magic_cmd with a given extended regex. # If you have 'file' or equivalent on your system and you're not sure # whether 'pass_all' will *always* work, you probably want this one. case $host_os in aix[4-9]*) lt_cv_deplibs_check_method=pass_all ;; beos*) lt_cv_deplibs_check_method=pass_all ;; bsdi[45]*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' lt_cv_file_magic_cmd='/usr/bin/file -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; cygwin*) # func_win32_libid is a shell function defined in ltmain.sh lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' ;; mingw* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. if ( file / ) >/dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; haiku*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]' lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[3-9]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) lt_cv_deplibs_check_method=pass_all ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd* | bitrig*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; os2*) lt_cv_deplibs_check_method=pass_all ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 $as_echo "$lt_cv_deplibs_check_method" >&6; } file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in mingw* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"` fi ;; esac fi file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. set dummy ${ac_tool_prefix}dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DLLTOOL"; then ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DLLTOOL=$ac_cv_prog_DLLTOOL if test -n "$DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 $as_echo "$DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_DLLTOOL"; then ac_ct_DLLTOOL=$DLLTOOL # Extract the first word of "dlltool", so it can be a program name with args. set dummy dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DLLTOOL"; then ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DLLTOOL="dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL if test -n "$ac_ct_DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 $as_echo "$ac_ct_DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DLLTOOL" = x; then DLLTOOL="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DLLTOOL=$ac_ct_DLLTOOL fi else DLLTOOL="$ac_cv_prog_DLLTOOL" fi test -z "$DLLTOOL" && DLLTOOL=dlltool { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 $as_echo_n "checking how to associate runtime and link libraries... " >&6; } if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in cygwin* | mingw* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh; # decide which one to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ;; *) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ;; esac ;; *) # fallback: assume linklib IS sharedlib lt_cv_sharedlib_from_linklib_cmd=$ECHO ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 $as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; } sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO if test -n "$ac_tool_prefix"; then for ac_prog in ar do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AR="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 $as_echo "$AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AR" && break done fi if test -z "$AR"; then ac_ct_AR=$AR for ac_prog in ar do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AR="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 $as_echo "$ac_ct_AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_AR" && break done if test "x$ac_ct_AR" = x; then AR="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac AR=$ac_ct_AR fi fi : ${AR=ar} : ${AR_FLAGS=cru} { $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 $as_echo_n "checking for archiver @FILE support... " >&6; } if ${lt_cv_ar_at_file+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ar_at_file=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test 0 -eq "$ac_status"; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test 0 -ne "$ac_status"; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 $as_echo "$lt_cv_ar_at_file" >&6; } if test no = "$lt_cv_ar_at_file"; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi test -z "$STRIP" && STRIP=: if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 $as_echo "$RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 $as_echo "$ac_ct_RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then RANLIB=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB fi else RANLIB="$ac_cv_prog_RANLIB" fi test -z "$RANLIB" && RANLIB=: # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in bitrig* | openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in darwin*) lock_old_archive_extraction=yes ;; *) lock_old_archive_extraction=no ;; esac # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Check for command to grab the raw symbol name followed by C symbol from nm. { $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 $as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } if ${lt_cv_sys_global_symbol_pipe+:} false; then : $as_echo_n "(cached) " >&6 else # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[BCDEGRST]' # Regexp to match symbols that can be accessed directly from C. sympat='\([_A-Za-z][_A-Za-z0-9]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[BCDT]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[ABCDGISTW]' ;; hpux*) if test ia64 = "$host_cpu"; then symcode='[ABCDEGRST]' fi ;; irix* | nonstopux*) symcode='[BCDEGRST]' ;; osf*) symcode='[BCDEGQRST]' ;; solaris*) symcode='[BDRT]' ;; sco3.2v5*) symcode='[DT]' ;; sysv4.2uw2*) symcode='[DT]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[ABDT]' ;; sysv4) symcode='[DFNSTU]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[ABCDGIRSTW]' ;; esac if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Gets list of data symbols to import. lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'" # Adjust the below global symbol transforms to fixup imported variables. lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'" lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'" lt_c_name_lib_hook="\ -e 's/^I .* \(lib.*\)$/ {\"\1\", (void *) 0},/p'\ -e 's/^I .* \(.*\)$/ {\"lib\1\", (void *) 0},/p'" else # Disable hooks by default. lt_cv_sys_global_symbol_to_import= lt_cdecl_hook= lt_c_name_hook= lt_c_name_lib_hook= fi # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="sed -n"\ $lt_cdecl_hook\ " -e 's/^T .* \(.*\)$/extern int \1();/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n"\ $lt_c_name_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'" # Transform an extracted symbol line into symbol name with lib prefix and # symbol address. lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\ $lt_c_name_lib_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"lib\1\", (void *) \&\1},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function, # D for any global variable and I for any imported variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK '"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\ " /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\ " /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\ " {split(\$ 0,a,/\||\r/); split(a[2],s)};"\ " s[1]~/^[@?]/{print f,s[1],s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then # Now try to grab the symbols. nlist=conftest.nm if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5 (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE /* DATA imports from DLLs on WIN32 can't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #elif defined __osf__ /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ LT_DLSYM_CONST struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS LIBS=conftstm.$ac_objext CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest$ac_exeext; then pipe_works=yes fi LIBS=$lt_globsym_save_LIBS CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&5 fi else echo "cannot find nm_test_var in $nlist" >&5 fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 fi else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test yes = "$pipe_works"; then break else lt_cv_sys_global_symbol_pipe= fi done fi if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5 $as_echo "failed" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 $as_echo "ok" >&6; } fi # Response file support. if test "$lt_cv_nm_interface" = "MS dumpbin"; then nm_file_list_spec='@' elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then nm_file_list_spec='@' fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 $as_echo_n "checking for sysroot... " >&6; } # Check whether --with-sysroot was given. if test "${with_sysroot+set}" = set; then : withval=$with_sysroot; else with_sysroot=no fi lt_sysroot= case $with_sysroot in #( yes) if test yes = "$GCC"; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_sysroot" >&5 $as_echo "$with_sysroot" >&6; } as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 $as_echo "${lt_sysroot:-no}" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a working dd" >&5 $as_echo_n "checking for a working dd... " >&6; } if ${ac_cv_path_lt_DD+:} false; then : $as_echo_n "(cached) " >&6 else printf 0123456789abcdef0123456789abcdef >conftest.i cat conftest.i conftest.i >conftest2.i : ${lt_DD:=$DD} if test -z "$lt_DD"; then ac_path_lt_DD_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in dd; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_lt_DD="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_lt_DD" || continue if "$ac_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=: fi $ac_path_lt_DD_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_lt_DD"; then : fi else ac_cv_path_lt_DD=$lt_DD fi rm -f conftest.i conftest2.i conftest.out fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_lt_DD" >&5 $as_echo "$ac_cv_path_lt_DD" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to truncate binary pipes" >&5 $as_echo_n "checking how to truncate binary pipes... " >&6; } if ${lt_cv_truncate_bin+:} false; then : $as_echo_n "(cached) " >&6 else printf 0123456789abcdef0123456789abcdef >conftest.i cat conftest.i conftest.i >conftest2.i lt_cv_truncate_bin= if "$ac_cv_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1" fi rm -f conftest.i conftest2.i conftest.out test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_truncate_bin" >&5 $as_echo "$lt_cv_truncate_bin" >&6; } # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. func_cc_basename () { for cc_temp in $*""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` } # Check whether --enable-libtool-lock was given. if test "${enable_libtool_lock+set}" = set; then : enableval=$enable_libtool_lock; fi test no = "$enable_libtool_lock" || enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out what ABI is being produced by ac_compile, and set mode # options accordingly. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE=32 ;; *ELF-64*) HPUX_IA64_MODE=64 ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo '#line '$LINENO' "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then if test yes = "$lt_cv_prog_gnu_ld"; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; mips64*-*linux*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo '#line '$LINENO' "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then emul=elf case `/usr/bin/file conftest.$ac_objext` in *32-bit*) emul="${emul}32" ;; *64-bit*) emul="${emul}64" ;; esac case `/usr/bin/file conftest.$ac_objext` in *MSB*) emul="${emul}btsmip" ;; *LSB*) emul="${emul}ltsmip" ;; esac case `/usr/bin/file conftest.$ac_objext` in *N32*) emul="${emul}n32" ;; esac LD="${LD-ld} -m $emul" fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. Note that the listed cases only cover the # situations where additional linker options are needed (such as when # doing 32-bit compilation for a host where ld defaults to 64-bit, or # vice versa); the common cases where no linker options are needed do # not appear in the list. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) case `/usr/bin/file conftest.o` in *x86-64*) LD="${LD-ld} -m elf32_x86_64" ;; *) LD="${LD-ld} -m elf_i386" ;; esac ;; powerpc64le-*linux*) LD="${LD-ld} -m elf32lppclinux" ;; powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; powerpcle-*linux*) LD="${LD-ld} -m elf64lppc" ;; powerpc-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS=$CFLAGS CFLAGS="$CFLAGS -belf" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 $as_echo_n "checking whether the C compiler needs -belf... " >&6; } if ${lt_cv_cc_needs_belf+:} false; then : $as_echo_n "(cached) " >&6 else ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_cc_needs_belf=yes else lt_cv_cc_needs_belf=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 $as_echo "$lt_cv_cc_needs_belf" >&6; } if test yes != "$lt_cv_cc_needs_belf"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS=$SAVE_CFLAGS fi ;; *-*solaris*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) case $host in i?86-*-solaris*|x86_64-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) LD="${LD-ld} -m elf64_sparc" ;; esac # GNU ld 2.21 introduced _sol2 emulations. Use them if available. if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then LD=${LD-ld}_sol2 fi ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks=$enable_libtool_lock if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. set dummy ${ac_tool_prefix}mt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_MANIFEST_TOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$MANIFEST_TOOL"; then ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL if test -n "$MANIFEST_TOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 $as_echo "$MANIFEST_TOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_MANIFEST_TOOL"; then ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL # Extract the first word of "mt", so it can be a program name with args. set dummy mt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_MANIFEST_TOOL"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL if test -n "$ac_ct_MANIFEST_TOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 $as_echo "$ac_ct_MANIFEST_TOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_MANIFEST_TOOL" = x; then MANIFEST_TOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL fi else MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL" fi test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 $as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } if ${lt_cv_path_mainfest_tool+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&5 if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_mainfest_tool=yes fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 $as_echo "$lt_cv_path_mainfest_tool" >&6; } if test yes != "$lt_cv_path_mainfest_tool"; then MANIFEST_TOOL=: fi case $host_os in rhapsody* | darwin*) if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DSYMUTIL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DSYMUTIL"; then ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DSYMUTIL=$ac_cv_prog_DSYMUTIL if test -n "$DSYMUTIL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 $as_echo "$DSYMUTIL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_DSYMUTIL"; then ac_ct_DSYMUTIL=$DSYMUTIL # Extract the first word of "dsymutil", so it can be a program name with args. set dummy dsymutil; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DSYMUTIL"; then ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL if test -n "$ac_ct_DSYMUTIL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 $as_echo "$ac_ct_DSYMUTIL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DSYMUTIL" = x; then DSYMUTIL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DSYMUTIL=$ac_ct_DSYMUTIL fi else DSYMUTIL="$ac_cv_prog_DSYMUTIL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. set dummy ${ac_tool_prefix}nmedit; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_NMEDIT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$NMEDIT"; then ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi NMEDIT=$ac_cv_prog_NMEDIT if test -n "$NMEDIT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 $as_echo "$NMEDIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_NMEDIT"; then ac_ct_NMEDIT=$NMEDIT # Extract the first word of "nmedit", so it can be a program name with args. set dummy nmedit; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_NMEDIT"; then ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_NMEDIT="nmedit" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT if test -n "$ac_ct_NMEDIT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 $as_echo "$ac_ct_NMEDIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_NMEDIT" = x; then NMEDIT=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac NMEDIT=$ac_ct_NMEDIT fi else NMEDIT="$ac_cv_prog_NMEDIT" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. set dummy ${ac_tool_prefix}lipo; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$LIPO"; then ac_cv_prog_LIPO="$LIPO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_LIPO="${ac_tool_prefix}lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi LIPO=$ac_cv_prog_LIPO if test -n "$LIPO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 $as_echo "$LIPO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_LIPO"; then ac_ct_LIPO=$LIPO # Extract the first word of "lipo", so it can be a program name with args. set dummy lipo; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_LIPO"; then ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_LIPO="lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO if test -n "$ac_ct_LIPO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 $as_echo "$ac_ct_LIPO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_LIPO" = x; then LIPO=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac LIPO=$ac_ct_LIPO fi else LIPO="$ac_cv_prog_LIPO" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. set dummy ${ac_tool_prefix}otool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL"; then ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL="${ac_tool_prefix}otool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OTOOL=$ac_cv_prog_OTOOL if test -n "$OTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 $as_echo "$OTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL"; then ac_ct_OTOOL=$OTOOL # Extract the first word of "otool", so it can be a program name with args. set dummy otool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL"; then ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL="otool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL if test -n "$ac_ct_OTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 $as_echo "$ac_ct_OTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL" = x; then OTOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL=$ac_ct_OTOOL fi else OTOOL="$ac_cv_prog_OTOOL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. set dummy ${ac_tool_prefix}otool64; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OTOOL64+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL64"; then ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OTOOL64=$ac_cv_prog_OTOOL64 if test -n "$OTOOL64"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 $as_echo "$OTOOL64" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL64"; then ac_ct_OTOOL64=$OTOOL64 # Extract the first word of "otool64", so it can be a program name with args. set dummy otool64; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL64"; then ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL64="otool64" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 if test -n "$ac_ct_OTOOL64"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 $as_echo "$ac_ct_OTOOL64" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL64" = x; then OTOOL64=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL64=$ac_ct_OTOOL64 fi else OTOOL64="$ac_cv_prog_OTOOL64" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 $as_echo_n "checking for -single_module linker flag... " >&6; } if ${lt_cv_apple_cc_single_mod+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_apple_cc_single_mod=no if test -z "$LT_MULTI_MODULE"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&5 $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? # If there is a non-empty error log, and "single_module" # appears in it, assume the flag caused a linker warning if test -s conftest.err && $GREP single_module conftest.err; then cat conftest.err >&5 # Otherwise, if the output was created with a 0 exit code from # the compiler, it worked. elif test -f libconftest.dylib && test 0 = "$_lt_result"; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&5 fi rm -rf libconftest.dylib* rm -f conftest.* fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 $as_echo "$lt_cv_apple_cc_single_mod" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 $as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } if ${lt_cv_ld_exported_symbols_list+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_ld_exported_symbols_list=yes else lt_cv_ld_exported_symbols_list=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 $as_echo "$lt_cv_ld_exported_symbols_list" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 $as_echo_n "checking for -force_load linker flag... " >&6; } if ${lt_cv_ld_force_load+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 echo "$AR cru libconftest.a conftest.o" >&5 $AR cru libconftest.a conftest.o 2>&5 echo "$RANLIB libconftest.a" >&5 $RANLIB libconftest.a 2>&5 cat > conftest.c << _LT_EOF int main() { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? if test -s conftest.err && $GREP force_load conftest.err; then cat conftest.err >&5 elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then lt_cv_ld_force_load=yes else cat conftest.err >&5 fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 $as_echo "$lt_cv_ld_force_load" >&6; } case $host_os in rhapsody* | darwin1.[012]) _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[91]*) _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; 10.[012][,.]*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test yes = "$lt_cv_apple_cc_single_mod"; then _lt_dar_single_mod='$single_module' fi if test yes = "$lt_cv_ld_exported_symbols_list"; then _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib' fi if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac # func_munge_path_list VARIABLE PATH # ----------------------------------- # VARIABLE is name of variable containing _space_ separated list of # directories to be munged by the contents of PATH, which is string # having a format: # "DIR[:DIR]:" # string "DIR[ DIR]" will be prepended to VARIABLE # ":DIR[:DIR]" # string "DIR[ DIR]" will be appended to VARIABLE # "DIRP[:DIRP]::[DIRA:]DIRA" # string "DIRP[ DIRP]" will be prepended to VARIABLE and string # "DIRA[ DIRA]" will be appended to VARIABLE # "DIR[:DIR]" # VARIABLE will be replaced by "DIR[ DIR]" func_munge_path_list () { case x$2 in x) ;; *:) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\" ;; x:*) eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\" ;; *::*) eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\" ;; *) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\" ;; esac } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in dlfcn.h do : ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default " if test "x$ac_cv_header_dlfcn_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_DLFCN_H 1 _ACEOF fi done func_stripname_cnf () { case $2 in .*) func_stripname_result=`$ECHO "$3" | $SED "s%^$1%%; s%\\\\$2\$%%"`;; *) func_stripname_result=`$ECHO "$3" | $SED "s%^$1%%; s%$2\$%%"`;; esac } # func_stripname_cnf # Set options enable_dlopen=no enable_win32_dll=no # Check whether --enable-shared was given. if test "${enable_shared+set}" = set; then : enableval=$enable_shared; p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS=$lt_save_ifs ;; esac else enable_shared=yes fi # Check whether --enable-static was given. if test "${enable_static+set}" = set; then : enableval=$enable_static; p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS=$lt_save_ifs ;; esac else enable_static=yes fi # Check whether --with-pic was given. if test "${with_pic+set}" = set; then : withval=$with_pic; lt_p=${PACKAGE-default} case $withval in yes|no) pic_mode=$withval ;; *) pic_mode=default # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for lt_pkg in $withval; do IFS=$lt_save_ifs if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done IFS=$lt_save_ifs ;; esac else pic_mode=default fi # Check whether --enable-fast-install was given. if test "${enable_fast_install+set}" = set; then : enableval=$enable_fast_install; p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS=$lt_save_ifs ;; esac else enable_fast_install=yes fi shared_archive_member_spec= case $host,$enable_shared in power*-*-aix[5-9]*,yes) { $as_echo "$as_me:${as_lineno-$LINENO}: checking which variant of shared library versioning to provide" >&5 $as_echo_n "checking which variant of shared library versioning to provide... " >&6; } # Check whether --with-aix-soname was given. if test "${with_aix_soname+set}" = set; then : withval=$with_aix_soname; case $withval in aix|svr4|both) ;; *) as_fn_error $? "Unknown argument to --with-aix-soname" "$LINENO" 5 ;; esac lt_cv_with_aix_soname=$with_aix_soname else if ${lt_cv_with_aix_soname+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_with_aix_soname=aix fi with_aix_soname=$lt_cv_with_aix_soname fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_aix_soname" >&5 $as_echo "$with_aix_soname" >&6; } if test aix != "$with_aix_soname"; then # For the AIX way of multilib, we name the shared archive member # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o', # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File. # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag, # the AIX toolchain works better with OBJECT_MODE set (default 32). if test 64 = "${OBJECT_MODE-32}"; then shared_archive_member_spec=shr_64 else shared_archive_member_spec=shr fi fi ;; *) with_aix_soname=aix ;; esac # This can be used to rebuild libtool when needed LIBTOOL_DEPS=$ltmain # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' test -z "$LN_S" && LN_S="ln -s" if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 $as_echo_n "checking for objdir... " >&6; } if ${lt_cv_objdir+:} false; then : $as_echo_n "(cached) " >&6 else rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 $as_echo "$lt_cv_objdir" >&6; } objdir=$lt_cv_objdir cat >>confdefs.h <<_ACEOF #define LT_OBJDIR "$lt_cv_objdir/" _ACEOF case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a '.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a with_gnu_ld=$lt_cv_prog_gnu_ld old_CC=$CC old_CFLAGS=$CFLAGS # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o func_cc_basename $compiler cc_basename=$func_cc_basename_result # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 $as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } if ${lt_cv_path_MAGIC_CMD+:} false; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD=$MAGIC_CMD lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/${ac_tool_prefix}file"; then lt_cv_path_MAGIC_CMD=$ac_dir/"${ac_tool_prefix}file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD=$lt_cv_path_MAGIC_CMD if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS=$lt_save_ifs MAGIC_CMD=$lt_save_MAGIC_CMD ;; esac fi MAGIC_CMD=$lt_cv_path_MAGIC_CMD if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5 $as_echo_n "checking for file... " >&6; } if ${lt_cv_path_MAGIC_CMD+:} false; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD=$MAGIC_CMD lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/file"; then lt_cv_path_MAGIC_CMD=$ac_dir/"file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD=$lt_cv_path_MAGIC_CMD if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS=$lt_save_ifs MAGIC_CMD=$lt_save_MAGIC_CMD ;; esac fi MAGIC_CMD=$lt_cv_path_MAGIC_CMD if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi else MAGIC_CMD=: fi fi fi ;; esac # Use C for the default configuration in the libtool script lt_save_CC=$CC ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o objext=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then lt_prog_compiler_no_builtin_flag= if test yes = "$GCC"; then case $cc_basename in nvcc*) lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; *) lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 $as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-fno-rtti -fno-exceptions" ## exclude from sc_useless_quotes_in_assignment # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_rtti_exceptions=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 $as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; } if test yes = "$lt_cv_prog_compiler_rtti_exceptions"; then lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" else : fi fi lt_prog_compiler_wl= lt_prog_compiler_pic= lt_prog_compiler_static= if test yes = "$GCC"; then lt_prog_compiler_wl='-Wl,' lt_prog_compiler_static='-static' case $host_os in aix*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' fi lt_prog_compiler_pic='-fPIC' ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support lt_prog_compiler_pic='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the '-m68020' flag to GCC prevents building anything better, # like '-m68040'. lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries lt_prog_compiler_pic='-DDLL_EXPORT' case $host_os in os2*) lt_prog_compiler_static='$wl-static' ;; esac ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. lt_prog_compiler_static= ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) lt_prog_compiler_pic='-fPIC' ;; esac ;; interix[3-9]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic=-Kconform_pic fi ;; *) lt_prog_compiler_pic='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 lt_prog_compiler_wl='-Xlinker ' if test -n "$lt_prog_compiler_pic"; then lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic" fi ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl='-Wl,' if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' else lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' fi ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' case $cc_basename in nagfor*) # NAG Fortran compiler lt_prog_compiler_wl='-Wl,-Wl,,' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; esac ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic='-DDLL_EXPORT' case $host_os in os2*) lt_prog_compiler_static='$wl-static' ;; esac ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static='$wl-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in # old Intel for x86_64, which still supported -KPIC. ecc*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; # Lahey Fortran 8.1. lf95*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='--shared' lt_prog_compiler_static='--static' ;; nagfor*) # NAG Fortran compiler lt_prog_compiler_wl='-Wl,-Wl,,' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; tcc*) # Fabrice Bellard et al's Tiny C Compiler lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; ccc*) lt_prog_compiler_wl='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-qpic' lt_prog_compiler_static='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='' ;; *Sun\ F* | *Sun*Fortran*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Qoption ld ' ;; *Sun\ C*) # Sun C 5.9 lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Wl,' ;; *Intel*\ [CF]*Compiler*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; *Portland\ Group*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; esac ;; esac ;; newsos6) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static='-non_shared' ;; rdos*) lt_prog_compiler_static='-non_shared' ;; solaris*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) lt_prog_compiler_wl='-Qoption ld ';; *) lt_prog_compiler_wl='-Wl,';; esac ;; sunos4*) lt_prog_compiler_wl='-Qoption ld ' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic='-Kconform_pic' lt_prog_compiler_static='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; unicos*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_can_build_shared=no ;; uts4*) lt_prog_compiler_pic='-pic' lt_prog_compiler_static='-Bstatic' ;; *) lt_prog_compiler_can_build_shared=no ;; esac fi case $host_os in # For platforms that do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic= ;; *) lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 $as_echo_n "checking for $compiler option to produce PIC... " >&6; } if ${lt_cv_prog_compiler_pic+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic=$lt_prog_compiler_pic fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 $as_echo "$lt_cv_prog_compiler_pic" >&6; } lt_prog_compiler_pic=$lt_cv_prog_compiler_pic # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } if ${lt_cv_prog_compiler_pic_works+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_works=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic -DPIC" ## exclude from sc_useless_quotes_in_assignment # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 $as_echo "$lt_cv_prog_compiler_pic_works" >&6; } if test yes = "$lt_cv_prog_compiler_pic_works"; then case $lt_prog_compiler_pic in "" | " "*) ;; *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; esac else lt_prog_compiler_pic= lt_prog_compiler_can_build_shared=no fi fi # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 $as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } if ${lt_cv_prog_compiler_static_works+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_static_works=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works=yes fi else lt_cv_prog_compiler_static_works=yes fi fi $RM -r conftest* LDFLAGS=$save_LDFLAGS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 $as_echo "$lt_cv_prog_compiler_static_works" >&6; } if test yes = "$lt_cv_prog_compiler_static_works"; then : else lt_prog_compiler_static= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } hard_links=nottested if test no = "$lt_cv_prog_compiler_c_o" && test no != "$need_locks"; then # do not overwrite the value of need_locks provided by the user { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 $as_echo_n "checking if we can lock with hard links... " >&6; } hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 $as_echo "$hard_links" >&6; } if test no = "$hard_links"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5 $as_echo "$as_me: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } runpath_var= allow_undefined_flag= always_export_symbols=no archive_cmds= archive_expsym_cmds= compiler_needs_object=no enable_shared_with_static_runtimes=no export_dynamic_flag_spec= export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' hardcode_automatic=no hardcode_direct=no hardcode_direct_absolute=no hardcode_libdir_flag_spec= hardcode_libdir_separator= hardcode_minus_L=no hardcode_shlibpath_var=unsupported inherit_rpath=no link_all_deplibs=unknown module_cmds= module_expsym_cmds= old_archive_from_new_cmds= old_archive_from_expsyms_cmds= thread_safe_flag_spec= whole_archive_flag_spec= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ' (' and ')$', so one must not match beginning or # end of line. Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc', # as well as any symbol that contains 'd'. exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test yes != "$GCC"; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd* | bitrig*) with_gnu_ld=no ;; esac ld_shlibs=yes # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no if test yes = "$with_gnu_ld"; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility # with the native linker. However, as the warning in the GNU ld # block says, versions before 2.19.5* couldn't really create working # shared libraries, regardless of the interface used. case `$LD -v 2>&1` in *\ \(GNU\ Binutils\)\ 2.19.5*) ;; *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; *\ \(GNU\ Binutils\)\ [3-9]*) ;; *) lt_use_gnu_ld_interface=yes ;; esac ;; *) lt_use_gnu_ld_interface=yes ;; esac fi if test yes = "$lt_use_gnu_ld_interface"; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='$wl' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' export_dynamic_flag_spec='$wl--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then whole_archive_flag_spec=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' else whole_archive_flag_spec= fi supports_anon_versioning=no case `$LD -v | $SED -e 's/(^)\+)\s\+//' 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[3-9]*) # On AIX/PPC, the GNU linker is very broken if test ia64 != "$host_cpu"; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then allow_undefined_flag=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' else ld_shlibs=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' export_dynamic_flag_spec='$wl--export-all-symbols' allow_undefined_flag=unsupported always_export_symbols=no enable_shared_with_static_runtimes=yes export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file, use it as # is; otherwise, prepend EXPORTS... archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs=no fi ;; haiku*) archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' link_all_deplibs=yes ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported shrext_cmds=.dll archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' enable_shared_with_static_runtimes=yes ;; interix[3-9]*) hardcode_direct=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='$wl-rpath,$libdir' export_dynamic_flag_spec='$wl-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test linux-dietlibc = "$host_os"; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test no = "$tmp_diet" then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 whole_archive_flag_spec= tmp_sharedflag='--shared' ;; nagfor*) # NAGFOR 5.3 tmp_sharedflag='-Wl,-shared' ;; xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' compiler_needs_object=yes ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 whole_archive_flag_spec='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' compiler_needs_object=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' if test yes = "$supports_anon_versioning"; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi case $cc_basename in tcc*) export_dynamic_flag_spec='-rdynamic' ;; xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test yes = "$supports_anon_versioning"; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else ld_shlibs=no fi ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac ;; sunos4*) archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct=yes hardcode_shlibpath_var=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac if test no = "$ld_shlibs"; then runpath_var= hardcode_libdir_flag_spec= export_dynamic_flag_spec= whole_archive_flag_spec= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag=unsupported always_export_symbols=yes archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported fi ;; aix[4-9]*) if test ia64 = "$host_cpu"; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag= else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to GNU nm, but means don't demangle to AIX nm. # Without the "-l" option, or with the "-B" option, AIX nm treats # weak defined symbols like other global defined symbols, whereas # GNU nm marks them as "W". # While the 'weak' keyword is ignored in the Export File, we need # it in the Import File for the 'aix-soname' feature, so we have # to replace the "-B" option with "-P" for AIX nm. if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else export_symbols_cmds='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # have runtime linking enabled, and use it for executables. # For shared libraries, we enable/disable runtime linking # depending on the kind of the shared library created - # when "with_aix_soname,aix_use_runtimelinking" is: # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables # "aix,yes" lib.so shared, rtl:yes, for executables # lib.a static archive # "both,no" lib.so.V(shr.o) shared, rtl:yes # lib.a(lib.so.V) shared, rtl:no, for executables # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a(lib.so.V) shared, rtl:no # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a static archive case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then aix_use_runtimelinking=yes break fi done if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then # With aix-soname=svr4, we create the lib.so.V shared archives only, # so we don't have lib.a shared libs to link our executables. # We have to force runtime linking in this case. aix_use_runtimelinking=yes LDFLAGS="$LDFLAGS -Wl,-brtl" fi ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds='' hardcode_direct=yes hardcode_direct_absolute=yes hardcode_libdir_separator=':' link_all_deplibs=yes file_list_spec='$wl-f,' case $with_aix_soname,$aix_use_runtimelinking in aix,*) ;; # traditional, no import file svr4,* | *,yes) # use import file # The Import File defines what to hardcode. hardcode_direct=no hardcode_direct_absolute=no ;; esac if test yes = "$GCC"; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`$CC -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 hardcode_direct=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L=yes hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_separator= fi ;; esac shared_flag='-shared' if test yes = "$aix_use_runtimelinking"; then shared_flag="$shared_flag "'$wl-G' fi # Need to ensure runtime linking is disabled for the traditional # shared library, or the linker may eventually find shared libraries # /with/ Import File - we do not want to mix them. shared_flag_aix='-shared' shared_flag_svr4='-shared $wl-G' else # not using gcc if test ia64 = "$host_cpu"; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test yes = "$aix_use_runtimelinking"; then shared_flag='$wl-G' else shared_flag='$wl-bM:SRE' fi shared_flag_aix='$wl-bM:SRE' shared_flag_svr4='$wl-G' fi fi export_dynamic_flag_spec='$wl-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols=yes if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag='-berok' # Determine the default libpath from the value encoded in an # empty executable. if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath_+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=/usr/lib:/lib fi fi aix_libpath=$lt_cv_aix_libpath_ fi hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag else if test ia64 = "$host_cpu"; then hardcode_libdir_flag_spec='$wl-R $libdir:/usr/lib:/lib' allow_undefined_flag="-z nodefs" archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath_+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=/usr/lib:/lib fi fi aix_libpath=$lt_cv_aix_libpath_ fi hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag=' $wl-bernotok' allow_undefined_flag=' $wl-berok' if test yes = "$with_gnu_ld"; then # We only use this code for GNU lds that support --whole-archive. whole_archive_flag_spec='$wl--whole-archive$convenience $wl--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec='$convenience' fi archive_cmds_need_lc=yes archive_expsym_cmds='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' # -brtl affects multiple linker settings, -berok does not and is overridden later compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([, ]\\)%-berok\\1%g"`' if test svr4 != "$with_aix_soname"; then # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' fi if test aix != "$with_aix_soname"; then archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' else # used by -dlpreopen to get the symbols archive_expsym_cmds="$archive_expsym_cmds"'~$MV $output_objdir/$realname.d/$soname $output_objdir' fi archive_expsym_cmds="$archive_expsym_cmds"'~$RM -r $output_objdir/$realname.d' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; bsdi[45]*) export_dynamic_flag_spec=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl*) # Native MSVC hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported always_export_symbols=yes file_list_spec='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then cp "$export_symbols" "$output_objdir/$soname.def"; echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; else $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, )='true' enable_shared_with_static_runtimes=yes exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib old_postinstall_cmds='chmod 644 $oldlib' postlink_cmds='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile=$lt_outputfile.exe lt_tool_outputfile=$lt_tool_outputfile.exe ;; esac~ if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # Assume MSVC wrapper hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_from_new_cmds='true' # FIXME: Should let the user specify the lib program. old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' enable_shared_with_static_runtimes=yes ;; esac ;; darwin* | rhapsody*) archive_cmds_need_lc=no hardcode_direct=no hardcode_automatic=yes hardcode_shlibpath_var=unsupported if test yes = "$lt_cv_ld_force_load"; then whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' else whole_archive_flag_spec='' fi link_all_deplibs=yes allow_undefined_flag=$_lt_dar_allow_undefined case $cc_basename in ifort*|nagfor*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test yes = "$_lt_dar_can_shared"; then output_verbose_link_cmd=func_echo_all archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" archive_expsym_cmds="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" module_expsym_cmds="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" else ld_shlibs=no fi ;; dgux*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2.*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; hpux9*) if test yes = "$GCC"; then archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' else archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec='$wl+b $wl$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes export_dynamic_flag_spec='$wl-E' ;; hpux10*) if test yes,no = "$GCC,$with_gnu_ld"; then archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test no = "$with_gnu_ld"; then hardcode_libdir_flag_spec='$wl+b $wl$libdir' hardcode_libdir_separator=: hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='$wl-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes fi ;; hpux11*) if test yes,no = "$GCC,$with_gnu_ld"; then case $host_cpu in hppa*64*) archive_cmds='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) archive_cmds='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 $as_echo_n "checking if $CC understands -b... " >&6; } if ${lt_cv_prog_compiler__b+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler__b=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -b" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler__b=yes fi else lt_cv_prog_compiler__b=yes fi fi $RM -r conftest* LDFLAGS=$save_LDFLAGS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 $as_echo "$lt_cv_prog_compiler__b" >&6; } if test yes = "$lt_cv_prog_compiler__b"; then archive_cmds='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi ;; esac fi if test no = "$with_gnu_ld"; then hardcode_libdir_flag_spec='$wl+b $wl$libdir' hardcode_libdir_separator=: case $host_cpu in hppa*64*|ia64*) hardcode_direct=no hardcode_shlibpath_var=no ;; *) hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='$wl-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test yes = "$GCC"; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 $as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; } if ${lt_cv_irix_exported_symbol+:} false; then : $as_echo_n "(cached) " >&6 else save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int foo (void) { return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_irix_exported_symbol=yes else lt_cv_irix_exported_symbol=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 $as_echo "$lt_cv_irix_exported_symbol" >&6; } if test yes = "$lt_cv_irix_exported_symbol"; then archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib' fi else archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' hardcode_libdir_separator=: inherit_rpath=yes link_all_deplibs=yes ;; linux*) case $cc_basename in tcc*) # Fabrice Bellard et al's Tiny C Compiler ld_shlibs=yes archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; newsos6) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' hardcode_libdir_separator=: hardcode_shlibpath_var=no ;; *nto* | *qnx*) ;; openbsd* | bitrig*) if test -f /usr/libexec/ld.so; then hardcode_direct=yes hardcode_shlibpath_var=no hardcode_direct_absolute=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols' hardcode_libdir_flag_spec='$wl-rpath,$libdir' export_dynamic_flag_spec='$wl-E' else archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='$wl-rpath,$libdir' fi else ld_shlibs=no fi ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported shrext_cmds=.dll archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' enable_shared_with_static_runtimes=yes ;; osf3*) if test yes = "$GCC"; then allow_undefined_flag=' $wl-expect_unresolved $wl\*' archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test yes = "$GCC"; then allow_undefined_flag=' $wl-expect_unresolved $wl\*' archive_cmds='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' fi archive_cmds_need_lc='no' hardcode_libdir_separator=: ;; solaris*) no_undefined_flag=' -z defs' if test yes = "$GCC"; then wlarc='$wl' archive_cmds='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' archive_cmds='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='$wl' archive_cmds='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi hardcode_libdir_flag_spec='-R$libdir' hardcode_shlibpath_var=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands '-z linker_flag'. GCC discards it without '$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test yes = "$GCC"; then whole_archive_flag_spec='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' else whole_archive_flag_spec='-z allextract$convenience -z defaultextract' fi ;; esac link_all_deplibs=yes ;; sunos4*) if test sequent = "$host_vendor"; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; sysv4) case $host_vendor in sni) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds='$CC -r -o $output$reload_objs' hardcode_direct=no ;; motorola) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var=no ;; sysv4.3*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no export_dynamic_flag_spec='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) no_undefined_flag='$wl-z,text' archive_cmds_need_lc=no hardcode_shlibpath_var=no runpath_var='LD_RUN_PATH' if test yes = "$GCC"; then archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We CANNOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. no_undefined_flag='$wl-z,text' allow_undefined_flag='$wl-z,nodefs' archive_cmds_need_lc=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='$wl-R,$libdir' hardcode_libdir_separator=':' link_all_deplibs=yes export_dynamic_flag_spec='$wl-Bexport' runpath_var='LD_RUN_PATH' if test yes = "$GCC"; then archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; *) ld_shlibs=no ;; esac if test sni = "$host_vendor"; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) export_dynamic_flag_spec='$wl-Blargedynsym' ;; esac fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 $as_echo "$ld_shlibs" >&6; } test no = "$ld_shlibs" && can_build_shared=no with_gnu_ld=$with_gnu_ld # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc" in x|xyes) # Assume -lc should be added archive_cmds_need_lc=yes if test yes,yes = "$GCC,$enable_shared"; then case $archive_cmds in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } if ${lt_cv_archive_cmds_need_lc+:} false; then : $as_echo_n "(cached) " >&6 else $RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl pic_flag=$lt_prog_compiler_pic compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag allow_undefined_flag= if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then lt_cv_archive_cmds_need_lc=no else lt_cv_archive_cmds_need_lc=yes fi allow_undefined_flag=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 $as_echo "$lt_cv_archive_cmds_need_lc" >&6; } archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc ;; esac fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 $as_echo_n "checking dynamic linker characteristics... " >&6; } if test yes = "$GCC"; then case $host_os in darwin*) lt_awk_arg='/^libraries:/,/LR/' ;; *) lt_awk_arg='/^libraries:/' ;; esac case $host_os in mingw* | cegcc*) lt_sed_strip_eq='s|=\([A-Za-z]:\)|\1|g' ;; *) lt_sed_strip_eq='s|=/|/|g' ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in *\;*) # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` ;; *) lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` ;; esac # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary... lt_tmp_lt_search_path_spec= lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` # ...but if some path component already ends with the multilib dir we assume # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer). case "$lt_multi_os_dir; $lt_search_path_spec " in "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*) lt_multi_os_dir= ;; esac for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir" elif test -n "$lt_multi_os_dir"; then test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS = " "; FS = "/|\n";} { lt_foo = ""; lt_count = 0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo = "/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[lt_foo]++; } if (lt_freq[lt_foo] == 1) { print lt_foo; } }'` # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's|/\([A-Za-z]:\)|\1|g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=.so postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='$libname$release$shared_ext$major' ;; aix[4-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test ia64 = "$host_cpu"; then # AIX 5 supports IA64 library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line '#! .'. This would cause the generated library to # depend on '.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # Using Import Files as archive members, it is possible to support # filename-based versioning of shared library archives on AIX. While # this would work for both with and without runtime linking, it will # prevent static linking of such archives. So we do filename-based # shared library versioning with .so extension only, which is used # when both runtime linking and shared linking is enabled. # Unfortunately, runtime linking may impact performance, so we do # not want this to be the default eventually. Also, we use the # versioned .so libs for executables only if there is the -brtl # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only. # To allow for filename-based versioning support, we need to create # libNAME.so.V as an archive file, containing: # *) an Import File, referring to the versioned filename of the # archive as well as the shared archive member, telling the # bitwidth (32 or 64) of that shared object, and providing the # list of exported symbols of that shared object, eventually # decorated with the 'weak' keyword # *) the shared object with the F_LOADONLY flag set, to really avoid # it being seen by the linker. # At run time we better use the real file rather than another symlink, # but for link time we create the symlink libNAME.so -> libNAME.so.V case $with_aix_soname,$aix_use_runtimelinking in # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. aix,yes) # traditional libtool dynamic_linker='AIX unversionable lib.so' # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; aix,no) # traditional AIX only dynamic_linker='AIX lib.a(lib.so.V)' # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' ;; svr4,*) # full svr4 only dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o)" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,yes) # both, prefer svr4 dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o), lib.a(lib.so.V)" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # unpreferred sharedlib libNAME.a needs extra handling postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,no) # both, prefer aix dynamic_linker="AIX lib.a(lib.so.V), lib.so.V($shared_archive_member_spec.o)" library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' ;; esac shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='$libname$shared_ext' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl*) # Native MSVC libname_spec='$name' soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' library_names_spec='$libname.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec=$LIB if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC wrapper library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='$libname$release$major$shared_ext $libname$shared_ext' soname_spec='$libname$release$major$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[23].*) objformat=aout ;; *) objformat=elf ;; esac fi # Handle Gentoo/FreeBSD as it was Linux case $host_vendor in gentoo) version_type=linux ;; *) version_type=freebsd-$objformat ;; esac case $version_type in freebsd-elf*) library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' need_version=yes ;; linux) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' need_lib_prefix=no need_version=no ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=no sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' if test 32 = "$HPUX_IA64_MODE"; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" sys_lib_dlsearch_path_spec=/usr/lib/hpux32 else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" sys_lib_dlsearch_path_spec=/usr/lib/hpux64 fi ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[3-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test yes = "$lt_cv_prog_gnu_ld"; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='$libname$release$shared_ext$major' library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff" sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; linux*android*) version_type=none # Android doesn't support versioned libraries. need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext' soname_spec='$libname$release$shared_ext' finish_cmds= shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes dynamic_linker='Android linker' # Don't embed -rpath directories since the linker doesn't support them. hardcode_libdir_flag_spec='-L$libdir' ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH if ${lt_cv_shlibpath_overrides_runpath+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : lt_cv_shlibpath_overrides_runpath=yes fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir fi shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Ideally, we could use ldconfig to report *all* directores which are # searched for libraries, however this is still not possible. Aside from not # being certain /sbin/ldconfig is available, command # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, # even though it is searched at run-time. Try to do the best guess by # appending ld.so.conf contents (and includes) to the search path. if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd* | bitrig*) version_type=sunos sys_lib_dlsearch_path_spec=/usr/lib need_lib_prefix=no if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then need_version=no else need_version=yes fi library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; os2*) libname_spec='$name' version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no # OS/2 can only load a DLL with a base name of 8 characters or less. soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; v=$($ECHO $release$versuffix | tr -d .-); n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); $ECHO $n$v`$shared_ext' library_names_spec='${libname}_dll.$libext' dynamic_linker='OS/2 ld.exe' shlibpath_var=BEGINLIBPATH sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='$libname$release$shared_ext$major' library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test yes = "$with_gnu_ld"; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec; then version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext' soname_spec='$libname$shared_ext.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=sco need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test yes = "$with_gnu_ld"; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 $as_echo "$dynamic_linker" >&6; } test no = "$dynamic_linker" && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test yes = "$GCC"; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec fi if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec fi # remember unaugmented sys_lib_dlsearch_path content for libtool script decls... configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec # ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" # to be used as default LT_SYS_LIBRARY_PATH value in generated libtool configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 $as_echo_n "checking how to hardcode library paths into programs... " >&6; } hardcode_action= if test -n "$hardcode_libdir_flag_spec" || test -n "$runpath_var" || test yes = "$hardcode_automatic"; then # We can hardcode non-existent directories. if test no != "$hardcode_direct" && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, )" && test no != "$hardcode_minus_L"; then # Linking always hardcodes the temporary library directory. hardcode_action=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action=unsupported fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 $as_echo "$hardcode_action" >&6; } if test relink = "$hardcode_action" || test yes = "$inherit_rpath"; then # Fast installation is not supported enable_fast_install=no elif test yes = "$shlibpath_overrides_runpath" || test no = "$enable_shared"; then # Fast installation is not necessary enable_fast_install=needless fi if test yes != "$enable_dlopen"; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen=load_add_on lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) lt_cv_dlopen=LoadLibrary lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen=dlopen lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes; then : lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl else lt_cv_dlopen=dyld lt_cv_dlopen_libs= lt_cv_dlopen_self=yes fi ;; tpf*) # Don't try to run any link tests for TPF. We know it's impossible # because TPF is a cross-compiler, and we know how we open DSOs. lt_cv_dlopen=dlopen lt_cv_dlopen_libs= lt_cv_dlopen_self=no ;; *) ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" if test "x$ac_cv_func_shl_load" = xyes; then : lt_cv_dlopen=shl_load else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 $as_echo_n "checking for shl_load in -ldld... " >&6; } if ${ac_cv_lib_dld_shl_load+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char shl_load (); int main () { return shl_load (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_shl_load=yes else ac_cv_lib_dld_shl_load=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 $as_echo "$ac_cv_lib_dld_shl_load" >&6; } if test "x$ac_cv_lib_dld_shl_load" = xyes; then : lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld else ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" if test "x$ac_cv_func_dlopen" = xyes; then : lt_cv_dlopen=dlopen else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes; then : lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 $as_echo_n "checking for dlopen in -lsvld... " >&6; } if ${ac_cv_lib_svld_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_svld_dlopen=yes else ac_cv_lib_svld_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 $as_echo "$ac_cv_lib_svld_dlopen" >&6; } if test "x$ac_cv_lib_svld_dlopen" = xyes; then : lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 $as_echo_n "checking for dld_link in -ldld... " >&6; } if ${ac_cv_lib_dld_dld_link+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dld_link (); int main () { return dld_link (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_dld_link=yes else ac_cv_lib_dld_dld_link=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 $as_echo "$ac_cv_lib_dld_dld_link" >&6; } if test "x$ac_cv_lib_dld_dld_link" = xyes; then : lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld fi fi fi fi fi fi ;; esac if test no = "$lt_cv_dlopen"; then enable_dlopen=no else enable_dlopen=yes fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS=$CPPFLAGS test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS=$LDFLAGS wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS=$LIBS LIBS="$lt_cv_dlopen_libs $LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 $as_echo_n "checking whether a program can dlopen itself... " >&6; } if ${lt_cv_dlopen_self+:} false; then : $as_echo_n "(cached) " >&6 else if test yes = "$cross_compiling"; then : lt_cv_dlopen_self=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisibility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; esac else : # compilation failed lt_cv_dlopen_self=no fi fi rm -fr conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 $as_echo "$lt_cv_dlopen_self" >&6; } if test yes = "$lt_cv_dlopen_self"; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 $as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } if ${lt_cv_dlopen_self_static+:} false; then : $as_echo_n "(cached) " >&6 else if test yes = "$cross_compiling"; then : lt_cv_dlopen_self_static=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisibility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; esac else : # compilation failed lt_cv_dlopen_self_static=no fi fi rm -fr conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 $as_echo "$lt_cv_dlopen_self_static" >&6; } fi CPPFLAGS=$save_CPPFLAGS LDFLAGS=$save_LDFLAGS LIBS=$save_LIBS ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi striplib= old_striplib= { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 $as_echo_n "checking whether stripping libraries is possible... " >&6; } if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP"; then striplib="$STRIP -x" old_striplib="$STRIP -S" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ;; esac fi # Report what library types will actually be built { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 $as_echo_n "checking if libtool supports shared libraries... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 $as_echo "$can_build_shared" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 $as_echo_n "checking whether to build shared libraries... " >&6; } test no = "$can_build_shared" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[4-9]*) if test ia64 != "$host_cpu"; then case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in yes,aix,yes) ;; # shared object as lib.so file only yes,svr4,*) ;; # shared object as lib.so archive member only yes,*) enable_static=no ;; # shared object in lib.a archive as well esac fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 $as_echo "$enable_shared" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 $as_echo_n "checking whether to build static libraries... " >&6; } # Make sure either enable_shared or enable_static is yes. test yes = "$enable_shared" || enable_static=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 $as_echo "$enable_static" >&6; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CC=$lt_save_CC if test -n "$CXX" && ( test no != "$CXX" && ( (test g++ = "$CXX" && `g++ -v >/dev/null 2>&1` ) || (test g++ != "$CXX"))); then ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5 $as_echo_n "checking how to run the C++ preprocessor... " >&6; } if test -z "$CXXCPP"; then if ${ac_cv_prog_CXXCPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CXXCPP needs to be expanded for CXXCPP in "$CXX -E" "/lib/cpp" do ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CXXCPP=$CXXCPP fi CXXCPP=$ac_cv_prog_CXXCPP else ac_cv_prog_CXXCPP=$CXXCPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5 $as_echo "$CXXCPP" >&6; } ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C++ preprocessor \"$CXXCPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu else _lt_caught_CXX_error=yes fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu archive_cmds_need_lc_CXX=no allow_undefined_flag_CXX= always_export_symbols_CXX=no archive_expsym_cmds_CXX= compiler_needs_object_CXX=no export_dynamic_flag_spec_CXX= hardcode_direct_CXX=no hardcode_direct_absolute_CXX=no hardcode_libdir_flag_spec_CXX= hardcode_libdir_separator_CXX= hardcode_minus_L_CXX=no hardcode_shlibpath_var_CXX=unsupported hardcode_automatic_CXX=no inherit_rpath_CXX=no module_cmds_CXX= module_expsym_cmds_CXX= link_all_deplibs_CXX=unknown old_archive_cmds_CXX=$old_archive_cmds reload_flag_CXX=$reload_flag reload_cmds_CXX=$reload_cmds no_undefined_flag_CXX= whole_archive_flag_spec_CXX= enable_shared_with_static_runtimes_CXX=no # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o objext_CXX=$objext # No sense in running all these tests if we already determined that # the CXX compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test yes != "$_lt_caught_CXX_error"; then # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *[]) { return(0); }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else $as_unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else $as_unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} CFLAGS=$CXXFLAGS compiler=$CC compiler_CXX=$CC func_cc_basename $compiler cc_basename=$func_cc_basename_result if test -n "$compiler"; then # We don't want -fno-exception when compiling C++ code, so set the # no_builtin_flag separately if test yes = "$GXX"; then lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin' else lt_prog_compiler_no_builtin_flag_CXX= fi if test yes = "$GXX"; then # Set up default GNU C++ configuration # Check whether --with-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then : withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes else with_gnu_ld=no fi ac_prog=ld if test yes = "$GCC"; then # Check if gcc -print-prog-name=ld gives a path. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 $as_echo_n "checking for ld used by $CC... " >&6; } case $host in *-*-mingw*) # gcc leaves a trailing carriage return, which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD=$ac_prog ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test yes = "$with_gnu_ld"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 $as_echo_n "checking for GNU ld... " >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 $as_echo_n "checking for non-GNU ld... " >&6; } fi if ${lt_cv_path_LD+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$LD"; then lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD=$ac_dir/$ac_prog # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 $as_echo "$LD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } if ${lt_cv_prog_gnu_ld+:} false; then : $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 $as_echo "$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test yes = "$with_gnu_ld"; then archive_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' export_dynamic_flag_spec_CXX='$wl--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) wlarc='$wl' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | $GREP 'no-whole-archive' > /dev/null; then whole_archive_flag_spec_CXX=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' else whole_archive_flag_spec_CXX= fi else with_gnu_ld=no wlarc= # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } ld_shlibs_CXX=yes case $host_os in aix3*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aix[4-9]*) if test ia64 = "$host_cpu"; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag= else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # have runtime linking enabled, and use it for executables. # For shared libraries, we enable/disable runtime linking # depending on the kind of the shared library created - # when "with_aix_soname,aix_use_runtimelinking" is: # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables # "aix,yes" lib.so shared, rtl:yes, for executables # lib.a static archive # "both,no" lib.so.V(shr.o) shared, rtl:yes # lib.a(lib.so.V) shared, rtl:no, for executables # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a(lib.so.V) shared, rtl:no # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a static archive case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac done if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then # With aix-soname=svr4, we create the lib.so.V shared archives only, # so we don't have lib.a shared libs to link our executables. # We have to force runtime linking in this case. aix_use_runtimelinking=yes LDFLAGS="$LDFLAGS -Wl,-brtl" fi ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds_CXX='' hardcode_direct_CXX=yes hardcode_direct_absolute_CXX=yes hardcode_libdir_separator_CXX=':' link_all_deplibs_CXX=yes file_list_spec_CXX='$wl-f,' case $with_aix_soname,$aix_use_runtimelinking in aix,*) ;; # no import file svr4,* | *,yes) # use import file # The Import File defines what to hardcode. hardcode_direct_CXX=no hardcode_direct_absolute_CXX=no ;; esac if test yes = "$GXX"; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`$CC -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 hardcode_direct_CXX=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L_CXX=yes hardcode_libdir_flag_spec_CXX='-L$libdir' hardcode_libdir_separator_CXX= fi esac shared_flag='-shared' if test yes = "$aix_use_runtimelinking"; then shared_flag=$shared_flag' $wl-G' fi # Need to ensure runtime linking is disabled for the traditional # shared library, or the linker may eventually find shared libraries # /with/ Import File - we do not want to mix them. shared_flag_aix='-shared' shared_flag_svr4='-shared $wl-G' else # not using gcc if test ia64 = "$host_cpu"; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test yes = "$aix_use_runtimelinking"; then shared_flag='$wl-G' else shared_flag='$wl-bM:SRE' fi shared_flag_aix='$wl-bM:SRE' shared_flag_svr4='$wl-G' fi fi export_dynamic_flag_spec_CXX='$wl-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to # export. always_export_symbols_CXX=yes if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. # The "-G" linker flag allows undefined symbols. no_undefined_flag_CXX='-bernotok' # Determine the default libpath from the value encoded in an empty # executable. if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath__CXX+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath__CXX"; then lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath__CXX"; then lt_cv_aix_libpath__CXX=/usr/lib:/lib fi fi aix_libpath=$lt_cv_aix_libpath__CXX fi hardcode_libdir_flag_spec_CXX='$wl-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag else if test ia64 = "$host_cpu"; then hardcode_libdir_flag_spec_CXX='$wl-R $libdir:/usr/lib:/lib' allow_undefined_flag_CXX="-z nodefs" archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath__CXX+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath__CXX"; then lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath__CXX"; then lt_cv_aix_libpath__CXX=/usr/lib:/lib fi fi aix_libpath=$lt_cv_aix_libpath__CXX fi hardcode_libdir_flag_spec_CXX='$wl-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag_CXX=' $wl-bernotok' allow_undefined_flag_CXX=' $wl-berok' if test yes = "$with_gnu_ld"; then # We only use this code for GNU lds that support --whole-archive. whole_archive_flag_spec_CXX='$wl--whole-archive$convenience $wl--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec_CXX='$convenience' fi archive_cmds_need_lc_CXX=yes archive_expsym_cmds_CXX='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' # -brtl affects multiple linker settings, -berok does not and is overridden later compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([, ]\\)%-berok\\1%g"`' if test svr4 != "$with_aix_soname"; then # This is similar to how AIX traditionally builds its shared # libraries. Need -bnortl late, we may have -brtl in LDFLAGS. archive_expsym_cmds_CXX="$archive_expsym_cmds_CXX"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' fi if test aix != "$with_aix_soname"; then archive_expsym_cmds_CXX="$archive_expsym_cmds_CXX"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' else # used by -dlpreopen to get the symbols archive_expsym_cmds_CXX="$archive_expsym_cmds_CXX"'~$MV $output_objdir/$realname.d/$soname $output_objdir' fi archive_expsym_cmds_CXX="$archive_expsym_cmds_CXX"'~$RM -r $output_objdir/$realname.d' fi fi ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then allow_undefined_flag_CXX=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds_CXX='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' else ld_shlibs_CXX=no fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; cygwin* | mingw* | pw32* | cegcc*) case $GXX,$cc_basename in ,cl* | no,cl*) # Native MSVC # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec_CXX=' ' allow_undefined_flag_CXX=unsupported always_export_symbols_CXX=yes file_list_spec_CXX='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. archive_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' archive_expsym_cmds_CXX='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then cp "$export_symbols" "$output_objdir/$soname.def"; echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; else $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, CXX)='true' enable_shared_with_static_runtimes_CXX=yes # Don't use ranlib old_postinstall_cmds_CXX='chmod 644 $oldlib' postlink_cmds_CXX='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile=$lt_outputfile.exe lt_tool_outputfile=$lt_tool_outputfile.exe ;; esac~ func_to_tool_file "$lt_outputfile"~ if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # g++ # _LT_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec_CXX='-L$libdir' export_dynamic_flag_spec_CXX='$wl--export-all-symbols' allow_undefined_flag_CXX=unsupported always_export_symbols_CXX=no enable_shared_with_static_runtimes_CXX=yes if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file, use it as # is; otherwise, prepend EXPORTS... archive_expsym_cmds_CXX='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs_CXX=no fi ;; esac ;; darwin* | rhapsody*) archive_cmds_need_lc_CXX=no hardcode_direct_CXX=no hardcode_automatic_CXX=yes hardcode_shlibpath_var_CXX=unsupported if test yes = "$lt_cv_ld_force_load"; then whole_archive_flag_spec_CXX='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' else whole_archive_flag_spec_CXX='' fi link_all_deplibs_CXX=yes allow_undefined_flag_CXX=$_lt_dar_allow_undefined case $cc_basename in ifort*|nagfor*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test yes = "$_lt_dar_can_shared"; then output_verbose_link_cmd=func_echo_all archive_cmds_CXX="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" module_cmds_CXX="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" archive_expsym_cmds_CXX="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" module_expsym_cmds_CXX="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" if test yes != "$lt_cv_apple_cc_single_mod"; then archive_cmds_CXX="\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dsymutil" archive_expsym_cmds_CXX="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil" fi else ld_shlibs_CXX=no fi ;; os2*) hardcode_libdir_flag_spec_CXX='-L$libdir' hardcode_minus_L_CXX=yes allow_undefined_flag_CXX=unsupported shrext_cmds=.dll archive_cmds_CXX='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' archive_expsym_cmds_CXX='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' old_archive_From_new_cmds_CXX='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' enable_shared_with_static_runtimes_CXX=yes ;; dgux*) case $cc_basename in ec++*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; ghcx*) # Green Hills C++ Compiler # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; freebsd2.*) # C++ shared libraries reported to be fairly broken before # switch to ELF ld_shlibs_CXX=no ;; freebsd-elf*) archive_cmds_need_lc_CXX=no ;; freebsd* | dragonfly*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions ld_shlibs_CXX=yes ;; haiku*) archive_cmds_CXX='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' link_all_deplibs_CXX=yes ;; hpux9*) hardcode_libdir_flag_spec_CXX='$wl+b $wl$libdir' hardcode_libdir_separator_CXX=: export_dynamic_flag_spec_CXX='$wl-E' hardcode_direct_CXX=yes hardcode_minus_L_CXX=yes # Not in the search PATH, # but as the default # location of the library. case $cc_basename in CC*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aCC*) archive_cmds_CXX='$RM $output_objdir/$soname~$CC -b $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes = "$GXX"; then archive_cmds_CXX='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; hpux10*|hpux11*) if test no = "$with_gnu_ld"; then hardcode_libdir_flag_spec_CXX='$wl+b $wl$libdir' hardcode_libdir_separator_CXX=: case $host_cpu in hppa*64*|ia64*) ;; *) export_dynamic_flag_spec_CXX='$wl-E' ;; esac fi case $host_cpu in hppa*64*|ia64*) hardcode_direct_CXX=no hardcode_shlibpath_var_CXX=no ;; *) hardcode_direct_CXX=yes hardcode_direct_absolute_CXX=yes hardcode_minus_L_CXX=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aCC*) case $host_cpu in hppa*64*) archive_cmds_CXX='$CC -b $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) archive_cmds_CXX='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) archive_cmds_CXX='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes = "$GXX"; then if test no = "$with_gnu_ld"; then case $host_cpu in hppa*64*) archive_cmds_CXX='$CC -shared -nostdlib -fPIC $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) archive_cmds_CXX='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) archive_cmds_CXX='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; interix[3-9]*) hardcode_direct_CXX=no hardcode_shlibpath_var_CXX=no hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' export_dynamic_flag_spec_CXX='$wl-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds_CXX='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds_CXX='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in CC*) # SGI C++ archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test yes = "$GXX"; then if test no = "$with_gnu_ld"; then archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' else archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` -o $lib' fi fi link_all_deplibs_CXX=yes ;; esac hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' hardcode_libdir_separator_CXX=: inherit_rpath_CXX=yes ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib $wl-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' export_dynamic_flag_spec_CXX='$wl--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc* | ecpc* ) # Intel C++ with_gnu_ld=yes # version 8.0 and above of icpc choke on multiply defined symbols # if we add $predep_objects and $postdep_objects, however 7.1 and # earlier do not add the objects themselves. case `$CC -V 2>&1` in *"Version 7."*) archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 8.0 or newer tmp_idyn= case $host_cpu in ia64*) tmp_idyn=' -i_dynamic';; esac archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; esac archive_cmds_need_lc_CXX=no hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' export_dynamic_flag_spec_CXX='$wl--export-dynamic' whole_archive_flag_spec_CXX='$wl--whole-archive$convenience $wl--no-whole-archive' ;; pgCC* | pgcpp*) # Portland Group C++ compiler case `$CC -V` in *pgCC\ [1-5].* | *pgcpp\ [1-5].*) prelink_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' old_archive_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ $RANLIB $oldlib' archive_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 6 and above use weak symbols archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; esac hardcode_libdir_flag_spec_CXX='$wl--rpath $wl$libdir' export_dynamic_flag_spec_CXX='$wl--export-dynamic' whole_archive_flag_spec_CXX='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' ;; cxx*) # Compaq C++ archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib $wl-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec_CXX='-rpath $libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' ;; xl* | mpixl* | bgxl*) # IBM XL 8.0 on PPC, with GNU ld hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' export_dynamic_flag_spec_CXX='$wl--export-dynamic' archive_cmds_CXX='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' if test yes = "$supports_anon_versioning"; then archive_expsym_cmds_CXX='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 no_undefined_flag_CXX=' -zdefs' archive_cmds_CXX='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' archive_expsym_cmds_CXX='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file $wl$export_symbols' hardcode_libdir_flag_spec_CXX='-R$libdir' whole_archive_flag_spec_CXX='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' compiler_needs_object_CXX=yes # Not sure whether something based on # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 # would be better. output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' ;; esac ;; esac ;; lynxos*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; m88k*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds_CXX='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= hardcode_libdir_flag_spec_CXX='-R$libdir' hardcode_direct_CXX=yes hardcode_shlibpath_var_CXX=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; *nto* | *qnx*) ld_shlibs_CXX=yes ;; openbsd* | bitrig*) if test -f /usr/libexec/ld.so; then hardcode_direct_CXX=yes hardcode_shlibpath_var_CXX=no hardcode_direct_absolute_CXX=yes archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`"; then archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file,$export_symbols -o $lib' export_dynamic_flag_spec_CXX='$wl-E' whole_archive_flag_spec_CXX=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' fi output_verbose_link_cmd=func_echo_all else ld_shlibs_CXX=no fi ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' hardcode_libdir_separator_CXX=: # Archives containing C++ object files must be created using # the KAI C++ compiler. case $host in osf3*) old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;; *) old_archive_cmds_CXX='$CC -o $oldlib $oldobjs' ;; esac ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; cxx*) case $host in osf3*) allow_undefined_flag_CXX=' $wl-expect_unresolved $wl\*' archive_cmds_CXX='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $soname `test -n "$verstring" && func_echo_all "$wl-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' ;; *) allow_undefined_flag_CXX=' -expect_unresolved \*' archive_cmds_CXX='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname $wl-input $wl$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~ $RM $lib.exp' hardcode_libdir_flag_spec_CXX='-rpath $libdir' ;; esac hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes,no = "$GXX,$with_gnu_ld"; then allow_undefined_flag_CXX=' $wl-expect_unresolved $wl\*' case $host in osf3*) archive_cmds_CXX='$CC -shared -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' ;; *) archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' ;; esac hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ archive_cmds_need_lc_CXX=yes no_undefined_flag_CXX=' -zdefs' archive_cmds_CXX='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G$allow_undefined_flag $wl-M $wl$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' hardcode_libdir_flag_spec_CXX='-R$libdir' hardcode_shlibpath_var_CXX=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands '-z linker_flag'. # Supported since Solaris 2.6 (maybe 2.5.1?) whole_archive_flag_spec_CXX='-z allextract$convenience -z defaultextract' ;; esac link_all_deplibs_CXX=yes output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test yes,no = "$GXX,$with_gnu_ld"; then no_undefined_flag_CXX=' $wl-z ${wl}defs' if $CC --version | $GREP -v '^2\.7' > /dev/null; then archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # g++ 2.7 appears to require '-G' NOT '-shared' on this # platform. archive_cmds_CXX='$CC -G -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' fi hardcode_libdir_flag_spec_CXX='$wl-R $wl$libdir' case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) whole_archive_flag_spec_CXX='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' ;; esac fi ;; esac ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) no_undefined_flag_CXX='$wl-z,text' archive_cmds_need_lc_CXX=no hardcode_shlibpath_var_CXX=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) archive_cmds_CXX='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_CXX='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We CANNOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. no_undefined_flag_CXX='$wl-z,text' allow_undefined_flag_CXX='$wl-z,nodefs' archive_cmds_need_lc_CXX=no hardcode_shlibpath_var_CXX=no hardcode_libdir_flag_spec_CXX='$wl-R,$libdir' hardcode_libdir_separator_CXX=':' link_all_deplibs_CXX=yes export_dynamic_flag_spec_CXX='$wl-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in CC*) archive_cmds_CXX='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' old_archive_cmds_CXX='$CC -Tprelink_objects $oldobjs~ '"$old_archive_cmds_CXX" reload_cmds_CXX='$CC -Tprelink_objects $reload_objs~ '"$reload_cmds_CXX" ;; *) archive_cmds_CXX='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5 $as_echo "$ld_shlibs_CXX" >&6; } test no = "$ld_shlibs_CXX" && can_build_shared=no GCC_CXX=$GXX LD_CXX=$LD ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... # Dependencies to place before and after the object being linked: predep_objects_CXX= postdep_objects_CXX= predeps_CXX= postdeps_CXX= compiler_lib_search_path_CXX= cat > conftest.$ac_ext <<_LT_EOF class Foo { public: Foo (void) { a = 0; } private: int a; }; _LT_EOF _lt_libdeps_save_CFLAGS=$CFLAGS case "$CC $CFLAGS " in #( *\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; *\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; *\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; esac if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then # Parse the compiler output and extract the necessary # objects, libraries and library flags. # Sentinel used to keep track of whether or not we are before # the conftest object file. pre_test_object_deps_done=no for p in `eval "$output_verbose_link_cmd"`; do case $prev$p in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. # Remove the space. if test x-L = "$p" || test x-R = "$p"; then prev=$p continue fi # Expand the sysroot to ease extracting the directories later. if test -z "$prev"; then case $p in -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; esac fi case $p in =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; esac if test no = "$pre_test_object_deps_done"; then case $prev in -L | -R) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. if test -z "$compiler_lib_search_path_CXX"; then compiler_lib_search_path_CXX=$prev$p else compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} $prev$p" fi ;; # The "-l" case would never come before the object being # linked, so don't bother handling this case. esac else if test -z "$postdeps_CXX"; then postdeps_CXX=$prev$p else postdeps_CXX="${postdeps_CXX} $prev$p" fi fi prev= ;; *.lto.$objext) ;; # Ignore GCC LTO objects *.$objext) # This assumes that the test object file only shows up # once in the compiler output. if test "$p" = "conftest.$objext"; then pre_test_object_deps_done=yes continue fi if test no = "$pre_test_object_deps_done"; then if test -z "$predep_objects_CXX"; then predep_objects_CXX=$p else predep_objects_CXX="$predep_objects_CXX $p" fi else if test -z "$postdep_objects_CXX"; then postdep_objects_CXX=$p else postdep_objects_CXX="$postdep_objects_CXX $p" fi fi ;; *) ;; # Ignore the rest. esac done # Clean up. rm -f a.out a.exe else echo "libtool.m4: error: problem compiling CXX test program" fi $RM -f confest.$objext CFLAGS=$_lt_libdeps_save_CFLAGS # PORTME: override above test on systems where it is broken case $host_os in interix[3-9]*) # Interix 3.5 installs completely hosed .la files for C++, so rather than # hack all around it, let's just trust "g++" to DTRT. predep_objects_CXX= postdep_objects_CXX= postdeps_CXX= ;; esac case " $postdeps_CXX " in *" -lc "*) archive_cmds_need_lc_CXX=no ;; esac compiler_lib_search_dirs_CXX= if test -n "${compiler_lib_search_path_CXX}"; then compiler_lib_search_dirs_CXX=`echo " ${compiler_lib_search_path_CXX}" | $SED -e 's! -L! !g' -e 's!^ !!'` fi lt_prog_compiler_wl_CXX= lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX= # C++ specific cases for pic, static, wl, etc. if test yes = "$GXX"; then lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='-static' case $host_os in aix*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_CXX='-Bstatic' fi lt_prog_compiler_pic_CXX='-fPIC' ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support lt_prog_compiler_pic_CXX='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the '-m68020' flag to GCC prevents building anything better, # like '-m68040'. lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries lt_prog_compiler_pic_CXX='-DDLL_EXPORT' case $host_os in os2*) lt_prog_compiler_static_CXX='$wl-static' ;; esac ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic_CXX='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all lt_prog_compiler_pic_CXX= ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. lt_prog_compiler_static_CXX= ;; interix[3-9]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic_CXX=-Kconform_pic fi ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) ;; *) lt_prog_compiler_pic_CXX='-fPIC' ;; esac ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic_CXX='-fPIC -shared' ;; *) lt_prog_compiler_pic_CXX='-fPIC' ;; esac else case $host_os in aix[4-9]*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_CXX='-Bstatic' else lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; esac ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic_CXX='-DDLL_EXPORT' ;; dgux*) case $cc_basename in ec++*) lt_prog_compiler_pic_CXX='-KPIC' ;; ghcx*) # Green Hills C++ Compiler lt_prog_compiler_pic_CXX='-pic' ;; *) ;; esac ;; freebsd* | dragonfly*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='$wl-a ${wl}archive' if test ia64 != "$host_cpu"; then lt_prog_compiler_pic_CXX='+Z' fi ;; aCC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='$wl-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic_CXX='+Z' ;; esac ;; *) ;; esac ;; interix*) # This is c89, which is MS Visual C++ (no shared libs) # Anyone wants to do a port? ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # KAI C++ Compiler lt_prog_compiler_wl_CXX='--backend -Wl,' lt_prog_compiler_pic_CXX='-fPIC' ;; ecpc* ) # old Intel C++ for x86_64, which still supported -KPIC. lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-static' ;; icpc* ) # Intel C++, used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-fPIC' lt_prog_compiler_static_CXX='-static' ;; pgCC* | pgcpp*) # Portland Group C++ compiler lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-fpic' lt_prog_compiler_static_CXX='-Bstatic' ;; cxx*) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX='-non_shared' ;; xlc* | xlC* | bgxl[cC]* | mpixl[cC]*) # IBM XL 8.0, 9.0 on PPC and BlueGene lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-qpic' lt_prog_compiler_static_CXX='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' lt_prog_compiler_wl_CXX='-Qoption ld ' ;; esac ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) lt_prog_compiler_pic_CXX='-W c,exportall' ;; *) ;; esac ;; netbsd*) ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic_CXX='-fPIC -shared' ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) lt_prog_compiler_wl_CXX='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 lt_prog_compiler_pic_CXX='-pic' ;; cxx*) # Digital/Compaq C++ lt_prog_compiler_wl_CXX='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX='-non_shared' ;; *) ;; esac ;; psos*) ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' lt_prog_compiler_wl_CXX='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler lt_prog_compiler_pic_CXX='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x lt_prog_compiler_pic_CXX='-pic' lt_prog_compiler_static_CXX='-Bstatic' ;; lcc*) # Lucid lt_prog_compiler_pic_CXX='-pic' ;; *) ;; esac ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 lt_prog_compiler_pic_CXX='-KPIC' ;; *) ;; esac ;; vxworks*) ;; *) lt_prog_compiler_can_build_shared_CXX=no ;; esac fi case $host_os in # For platforms that do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic_CXX= ;; *) lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC" ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 $as_echo_n "checking for $compiler option to produce PIC... " >&6; } if ${lt_cv_prog_compiler_pic_CXX+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_CXX=$lt_prog_compiler_pic_CXX fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_CXX" >&5 $as_echo "$lt_cv_prog_compiler_pic_CXX" >&6; } lt_prog_compiler_pic_CXX=$lt_cv_prog_compiler_pic_CXX # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic_CXX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... " >&6; } if ${lt_cv_prog_compiler_pic_works_CXX+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_works_CXX=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC" ## exclude from sc_useless_quotes_in_assignment # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works_CXX=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works_CXX" >&5 $as_echo "$lt_cv_prog_compiler_pic_works_CXX" >&6; } if test yes = "$lt_cv_prog_compiler_pic_works_CXX"; then case $lt_prog_compiler_pic_CXX in "" | " "*) ;; *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;; esac else lt_prog_compiler_pic_CXX= lt_prog_compiler_can_build_shared_CXX=no fi fi # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 $as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } if ${lt_cv_prog_compiler_static_works_CXX+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_static_works_CXX=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works_CXX=yes fi else lt_cv_prog_compiler_static_works_CXX=yes fi fi $RM -r conftest* LDFLAGS=$save_LDFLAGS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works_CXX" >&5 $as_echo "$lt_cv_prog_compiler_static_works_CXX" >&6; } if test yes = "$lt_cv_prog_compiler_static_works_CXX"; then : else lt_prog_compiler_static_CXX= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o_CXX+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o_CXX=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o_CXX=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5 $as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o_CXX+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o_CXX=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o_CXX=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5 $as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; } hard_links=nottested if test no = "$lt_cv_prog_compiler_c_o_CXX" && test no != "$need_locks"; then # do not overwrite the value of need_locks provided by the user { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 $as_echo_n "checking if we can lock with hard links... " >&6; } hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 $as_echo "$hard_links" >&6; } if test no = "$hard_links"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5 $as_echo "$as_me: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' exclude_expsyms_CXX='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' case $host_os in aix[4-9]*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to GNU nm, but means don't demangle to AIX nm. # Without the "-l" option, or with the "-B" option, AIX nm treats # weak defined symbols like other global defined symbols, whereas # GNU nm marks them as "W". # While the 'weak' keyword is ignored in the Export File, we need # it in the Import File for the 'aix-soname' feature, so we have # to replace the "-B" option with "-P" for AIX nm. if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else export_symbols_cmds_CXX='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi ;; pw32*) export_symbols_cmds_CXX=$ltdll_cmds ;; cygwin* | mingw* | cegcc*) case $cc_basename in cl*) exclude_expsyms_CXX='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' ;; *) export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' exclude_expsyms_CXX='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' ;; esac ;; *) export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5 $as_echo "$ld_shlibs_CXX" >&6; } test no = "$ld_shlibs_CXX" && can_build_shared=no with_gnu_ld_CXX=$with_gnu_ld # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc_CXX" in x|xyes) # Assume -lc should be added archive_cmds_need_lc_CXX=yes if test yes,yes = "$GCC,$enable_shared"; then case $archive_cmds_CXX in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } if ${lt_cv_archive_cmds_need_lc_CXX+:} false; then : $as_echo_n "(cached) " >&6 else $RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl_CXX pic_flag=$lt_prog_compiler_pic_CXX compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag_CXX allow_undefined_flag_CXX= if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then lt_cv_archive_cmds_need_lc_CXX=no else lt_cv_archive_cmds_need_lc_CXX=yes fi allow_undefined_flag_CXX=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc_CXX" >&5 $as_echo "$lt_cv_archive_cmds_need_lc_CXX" >&6; } archive_cmds_need_lc_CXX=$lt_cv_archive_cmds_need_lc_CXX ;; esac fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 $as_echo_n "checking dynamic linker characteristics... " >&6; } library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=.so postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='$libname$release$shared_ext$major' ;; aix[4-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test ia64 = "$host_cpu"; then # AIX 5 supports IA64 library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line '#! .'. This would cause the generated library to # depend on '.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # Using Import Files as archive members, it is possible to support # filename-based versioning of shared library archives on AIX. While # this would work for both with and without runtime linking, it will # prevent static linking of such archives. So we do filename-based # shared library versioning with .so extension only, which is used # when both runtime linking and shared linking is enabled. # Unfortunately, runtime linking may impact performance, so we do # not want this to be the default eventually. Also, we use the # versioned .so libs for executables only if there is the -brtl # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only. # To allow for filename-based versioning support, we need to create # libNAME.so.V as an archive file, containing: # *) an Import File, referring to the versioned filename of the # archive as well as the shared archive member, telling the # bitwidth (32 or 64) of that shared object, and providing the # list of exported symbols of that shared object, eventually # decorated with the 'weak' keyword # *) the shared object with the F_LOADONLY flag set, to really avoid # it being seen by the linker. # At run time we better use the real file rather than another symlink, # but for link time we create the symlink libNAME.so -> libNAME.so.V case $with_aix_soname,$aix_use_runtimelinking in # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. aix,yes) # traditional libtool dynamic_linker='AIX unversionable lib.so' # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; aix,no) # traditional AIX only dynamic_linker='AIX lib.a(lib.so.V)' # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' ;; svr4,*) # full svr4 only dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o)" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,yes) # both, prefer svr4 dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o), lib.a(lib.so.V)" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # unpreferred sharedlib libNAME.a needs extra handling postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,no) # both, prefer aix dynamic_linker="AIX lib.a(lib.so.V), lib.so.V($shared_archive_member_spec.o)" library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' ;; esac shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='$libname$shared_ext' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl*) # Native MSVC libname_spec='$name' soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' library_names_spec='$libname.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec=$LIB if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC wrapper library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='$libname$release$major$shared_ext $libname$shared_ext' soname_spec='$libname$release$major$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[23].*) objformat=aout ;; *) objformat=elf ;; esac fi # Handle Gentoo/FreeBSD as it was Linux case $host_vendor in gentoo) version_type=linux ;; *) version_type=freebsd-$objformat ;; esac case $version_type in freebsd-elf*) library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' need_version=yes ;; linux) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' need_lib_prefix=no need_version=no ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=no sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' if test 32 = "$HPUX_IA64_MODE"; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" sys_lib_dlsearch_path_spec=/usr/lib/hpux32 else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" sys_lib_dlsearch_path_spec=/usr/lib/hpux64 fi ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[3-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test yes = "$lt_cv_prog_gnu_ld"; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='$libname$release$shared_ext$major' library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff" sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; linux*android*) version_type=none # Android doesn't support versioned libraries. need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext' soname_spec='$libname$release$shared_ext' finish_cmds= shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes dynamic_linker='Android linker' # Don't embed -rpath directories since the linker doesn't support them. hardcode_libdir_flag_spec_CXX='-L$libdir' ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH if ${lt_cv_shlibpath_overrides_runpath+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$lt_prog_compiler_wl_CXX\"; \ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec_CXX\"" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : lt_cv_shlibpath_overrides_runpath=yes fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir fi shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Ideally, we could use ldconfig to report *all* directores which are # searched for libraries, however this is still not possible. Aside from not # being certain /sbin/ldconfig is available, command # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, # even though it is searched at run-time. Try to do the best guess by # appending ld.so.conf contents (and includes) to the search path. if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd* | bitrig*) version_type=sunos sys_lib_dlsearch_path_spec=/usr/lib need_lib_prefix=no if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then need_version=no else need_version=yes fi library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; os2*) libname_spec='$name' version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no # OS/2 can only load a DLL with a base name of 8 characters or less. soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; v=$($ECHO $release$versuffix | tr -d .-); n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); $ECHO $n$v`$shared_ext' library_names_spec='${libname}_dll.$libext' dynamic_linker='OS/2 ld.exe' shlibpath_var=BEGINLIBPATH sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='$libname$release$shared_ext$major' library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test yes = "$with_gnu_ld"; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec; then version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext' soname_spec='$libname$shared_ext.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=sco need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test yes = "$with_gnu_ld"; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 $as_echo "$dynamic_linker" >&6; } test no = "$dynamic_linker" && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test yes = "$GCC"; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec fi if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec fi # remember unaugmented sys_lib_dlsearch_path content for libtool script decls... configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec # ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" # to be used as default LT_SYS_LIBRARY_PATH value in generated libtool configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 $as_echo_n "checking how to hardcode library paths into programs... " >&6; } hardcode_action_CXX= if test -n "$hardcode_libdir_flag_spec_CXX" || test -n "$runpath_var_CXX" || test yes = "$hardcode_automatic_CXX"; then # We can hardcode non-existent directories. if test no != "$hardcode_direct_CXX" && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, CXX)" && test no != "$hardcode_minus_L_CXX"; then # Linking always hardcodes the temporary library directory. hardcode_action_CXX=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action_CXX=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action_CXX=unsupported fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action_CXX" >&5 $as_echo "$hardcode_action_CXX" >&6; } if test relink = "$hardcode_action_CXX" || test yes = "$inherit_rpath_CXX"; then # Fast installation is not supported enable_fast_install=no elif test yes = "$shlibpath_overrides_runpath" || test no = "$enable_shared"; then # Fast installation is not necessary enable_fast_install=needless fi fi # test -n "$compiler" CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld fi # test yes != "$_lt_caught_CXX_error" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_config_commands="$ac_config_commands libtool" # Only expand once: mkdir_p="$MKDIR_P" case $mkdir_p in [\\/$]* | ?:[\\/]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h fi for ac_header in sys/stat.h sys/types.h sysexits.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in umask do : ac_fn_c_check_func "$LINENO" "umask" "ac_cv_func_umask" if test "x$ac_cv_func_umask" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_UMASK 1 _ACEOF fi done case "$PACKAGE_VERSION" in *+) mc_is_release=no ;; *) mc_is_release=yes ;; esac # If API has been removed or changed since last release, change MCP_API (which # is part of the directory name under /usr/include) to the version that # changed it MCP_API_VERSION=5.5 # If ABI has been removed or changed since last release # increment current # set age and revision to 0 # else if ABI has been added since last release # increment age and current # set revision to 0 # else if library source has changed since last release # increment revision MCP_LT_CURRENT=5 MCP_LT_REVISION=1 MCP_LT_AGE=5 # The ABI version appears in the name of the plugin directory MCP_ABI_VERSION=`expr ${MCP_LT_CURRENT} - ${MCP_LT_AGE}` # Recommended CFLAGS for pedantic checking, from telepathy-glib { $as_echo "$as_me:${as_lineno-$LINENO}: checking to see if compiler understands " >&5 $as_echo_n "checking to see if compiler understands ... " >&6; } save_CFLAGS="$CFLAGS" save_CXXFLAGS="$CXXFLAGS" CFLAGS="$CFLAGS " CXXFLAGS="$CXXFLAGS " cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : flag_ok=yes else flag_ok=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CFLAGS="$save_CFLAGS" CXXFLAGS="$save_CXXFLAGS" if test "X$flag_ok" = Xyes ; then true else true fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $flag_ok" >&5 $as_echo "$flag_ok" >&6; } tp_warnings="" for tp_flag in all \ extra \ declaration-after-statement \ shadow \ strict-prototypes \ missing-prototypes \ missing-declarations \ sign-compare \ nested-externs \ pointer-arith \ format-security \ init-self \ ; do { $as_echo "$as_me:${as_lineno-$LINENO}: checking to see if compiler understands -W$tp_flag" >&5 $as_echo_n "checking to see if compiler understands -W$tp_flag... " >&6; } save_CFLAGS="$CFLAGS" save_CXXFLAGS="$CXXFLAGS" CFLAGS="$CFLAGS -W$tp_flag" CXXFLAGS="$CXXFLAGS -W$tp_flag" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : flag_ok=yes else flag_ok=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CFLAGS="$save_CFLAGS" CXXFLAGS="$save_CXXFLAGS" if test "X$flag_ok" = Xyes ; then tp_warnings="$tp_warnings -W$tp_flag" true else true fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $flag_ok" >&5 $as_echo "$flag_ok" >&6; } done tp_error_flags="-Werror" { $as_echo "$as_me:${as_lineno-$LINENO}: checking to see if compiler understands -Werror" >&5 $as_echo_n "checking to see if compiler understands -Werror... " >&6; } save_CFLAGS="$CFLAGS" save_CXXFLAGS="$CXXFLAGS" CFLAGS="$CFLAGS -Werror" CXXFLAGS="$CXXFLAGS -Werror" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : flag_ok=yes else flag_ok=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CFLAGS="$save_CFLAGS" CXXFLAGS="$save_CXXFLAGS" if test "X$flag_ok" = Xyes ; then tp_werror=yes true else tp_werror=no true fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $flag_ok" >&5 $as_echo "$flag_ok" >&6; } for tp_flag in missing-field-initializers \ deprecated-declarations \ unused-parameter; do { $as_echo "$as_me:${as_lineno-$LINENO}: checking to see if compiler understands -Wno-$tp_flag" >&5 $as_echo_n "checking to see if compiler understands -Wno-$tp_flag... " >&6; } save_CFLAGS="$CFLAGS" save_CXXFLAGS="$CXXFLAGS" CFLAGS="$CFLAGS -Wno-$tp_flag" CXXFLAGS="$CXXFLAGS -Wno-$tp_flag" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : flag_ok=yes else flag_ok=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CFLAGS="$save_CFLAGS" CXXFLAGS="$save_CXXFLAGS" if test "X$flag_ok" = Xyes ; then tp_warnings="$tp_warnings -Wno-$tp_flag" true else true fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $flag_ok" >&5 $as_echo "$flag_ok" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking to see if compiler understands -Wno-error=$tp_flag" >&5 $as_echo_n "checking to see if compiler understands -Wno-error=$tp_flag... " >&6; } save_CFLAGS="$CFLAGS" save_CXXFLAGS="$CXXFLAGS" CFLAGS="$CFLAGS -Wno-error=$tp_flag" CXXFLAGS="$CXXFLAGS -Wno-error=$tp_flag" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : flag_ok=yes else flag_ok=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CFLAGS="$save_CFLAGS" CXXFLAGS="$save_CXXFLAGS" if test "X$flag_ok" = Xyes ; then tp_error_flags="$tp_error_flags -Wno-error=$tp_flag" true else tp_werror=no true fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $flag_ok" >&5 $as_echo "$flag_ok" >&6; } done # Check whether --enable-Werror was given. if test "${enable_Werror+set}" = set; then : enableval=$enable_Werror; tp_werror=$enableval else : fi if test "x$tp_werror" = xyes && test "x$mc_is_release" = xno; then ERROR_CFLAGS="$tp_warnings $tp_error_flags" else ERROR_CFLAGS="$tp_warnings" fi XSLTPROC= for ac_prog in xsltproc do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_XSLTPROC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$XSLTPROC"; then ac_cv_prog_XSLTPROC="$XSLTPROC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_XSLTPROC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi XSLTPROC=$ac_cv_prog_XSLTPROC if test -n "$XSLTPROC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XSLTPROC" >&5 $as_echo "$XSLTPROC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$XSLTPROC" && break done if test -z "$XSLTPROC"; then as_fn_error $? "xsltproc (from the libxslt source package) is required" "$LINENO" 5 fi if test -n "$PYTHON"; then # If the user set $PYTHON, use it and don't search something else. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $PYTHON version >= 2.6" >&5 $as_echo_n "checking whether $PYTHON version >= 2.6... " >&6; } prog="import sys # split strings by '.' and convert to numeric. Append some zeros # because we need at least 4 digits for the hex conversion. # map returns an iterator in Python 3.0 and a list in 2.x minver = list(map(int, '2.6'.split('.'))) + [0, 0, 0] minverhex = 0 # xrange is not present in Python 3.0 and range returns an iterator for i in list(range(0, 4)): minverhex = (minverhex << 8) + minver[i] sys.exit(sys.hexversion < minverhex)" if { echo "$as_me:$LINENO: $PYTHON -c "$prog"" >&5 ($PYTHON -c "$prog") >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else as_fn_error $? "too old" "$LINENO" 5 fi am_display_PYTHON=$PYTHON else # Otherwise, try each interpreter until we find one that satisfies # VERSION. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a Python interpreter with version >= 2.6" >&5 $as_echo_n "checking for a Python interpreter with version >= 2.6... " >&6; } if ${am_cv_pathless_PYTHON+:} false; then : $as_echo_n "(cached) " >&6 else for am_cv_pathless_PYTHON in python python2 python3 python3.2 python3.1 python3.0 python2.7 python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python2.0 none; do test "$am_cv_pathless_PYTHON" = none && break prog="import sys # split strings by '.' and convert to numeric. Append some zeros # because we need at least 4 digits for the hex conversion. # map returns an iterator in Python 3.0 and a list in 2.x minver = list(map(int, '2.6'.split('.'))) + [0, 0, 0] minverhex = 0 # xrange is not present in Python 3.0 and range returns an iterator for i in list(range(0, 4)): minverhex = (minverhex << 8) + minver[i] sys.exit(sys.hexversion < minverhex)" if { echo "$as_me:$LINENO: $am_cv_pathless_PYTHON -c "$prog"" >&5 ($am_cv_pathless_PYTHON -c "$prog") >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then : break fi done fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_pathless_PYTHON" >&5 $as_echo "$am_cv_pathless_PYTHON" >&6; } # Set $PYTHON to the absolute path of $am_cv_pathless_PYTHON. if test "$am_cv_pathless_PYTHON" = none; then PYTHON=: else # Extract the first word of "$am_cv_pathless_PYTHON", so it can be a program name with args. set dummy $am_cv_pathless_PYTHON; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_PYTHON+:} false; then : $as_echo_n "(cached) " >&6 else case $PYTHON in [\\/]* | ?:[\\/]*) ac_cv_path_PYTHON="$PYTHON" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PYTHON="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi PYTHON=$ac_cv_path_PYTHON if test -n "$PYTHON"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON" >&5 $as_echo "$PYTHON" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi am_display_PYTHON=$am_cv_pathless_PYTHON fi if test "$PYTHON" = :; then as_fn_error $? "no suitable Python interpreter found" "$LINENO" 5 else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON version" >&5 $as_echo_n "checking for $am_display_PYTHON version... " >&6; } if ${am_cv_python_version+:} false; then : $as_echo_n "(cached) " >&6 else am_cv_python_version=`$PYTHON -c "import sys; sys.stdout.write(sys.version[:3])"` fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_version" >&5 $as_echo "$am_cv_python_version" >&6; } PYTHON_VERSION=$am_cv_python_version PYTHON_PREFIX='${prefix}' PYTHON_EXEC_PREFIX='${exec_prefix}' { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON platform" >&5 $as_echo_n "checking for $am_display_PYTHON platform... " >&6; } if ${am_cv_python_platform+:} false; then : $as_echo_n "(cached) " >&6 else am_cv_python_platform=`$PYTHON -c "import sys; sys.stdout.write(sys.platform)"` fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_platform" >&5 $as_echo "$am_cv_python_platform" >&6; } PYTHON_PLATFORM=$am_cv_python_platform { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON script directory" >&5 $as_echo_n "checking for $am_display_PYTHON script directory... " >&6; } if ${am_cv_python_pythondir+:} false; then : $as_echo_n "(cached) " >&6 else if test "x$prefix" = xNONE then am_py_prefix=$ac_default_prefix else am_py_prefix=$prefix fi am_cv_python_pythondir=`$PYTHON -c "import sys; from distutils import sysconfig; sys.stdout.write(sysconfig.get_python_lib(0,0,prefix='$am_py_prefix'))" 2>/dev/null` case $am_cv_python_pythondir in $am_py_prefix*) am__strip_prefix=`echo "$am_py_prefix" | sed 's|.|.|g'` am_cv_python_pythondir=`echo "$am_cv_python_pythondir" | sed "s,^$am__strip_prefix,$PYTHON_PREFIX,"` ;; *) case $am_py_prefix in /usr|/System*) ;; *) am_cv_python_pythondir=$PYTHON_PREFIX/lib/python$PYTHON_VERSION/site-packages ;; esac ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_pythondir" >&5 $as_echo "$am_cv_python_pythondir" >&6; } pythondir=$am_cv_python_pythondir pkgpythondir=\${pythondir}/$PACKAGE { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON extension module directory" >&5 $as_echo_n "checking for $am_display_PYTHON extension module directory... " >&6; } if ${am_cv_python_pyexecdir+:} false; then : $as_echo_n "(cached) " >&6 else if test "x$exec_prefix" = xNONE then am_py_exec_prefix=$am_py_prefix else am_py_exec_prefix=$exec_prefix fi am_cv_python_pyexecdir=`$PYTHON -c "import sys; from distutils import sysconfig; sys.stdout.write(sysconfig.get_python_lib(1,0,prefix='$am_py_exec_prefix'))" 2>/dev/null` case $am_cv_python_pyexecdir in $am_py_exec_prefix*) am__strip_prefix=`echo "$am_py_exec_prefix" | sed 's|.|.|g'` am_cv_python_pyexecdir=`echo "$am_cv_python_pyexecdir" | sed "s,^$am__strip_prefix,$PYTHON_EXEC_PREFIX,"` ;; *) case $am_py_exec_prefix in /usr|/System*) ;; *) am_cv_python_pyexecdir=$PYTHON_EXEC_PREFIX/lib/python$PYTHON_VERSION/site-packages ;; esac ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_pyexecdir" >&5 $as_echo "$am_cv_python_pyexecdir" >&6; } pyexecdir=$am_cv_python_pyexecdir pkgpyexecdir=\${pyexecdir}/$PACKAGE fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for enough Python for the tests" >&5 $as_echo_n "checking for enough Python for the tests... " >&6; } mc_want_twisted_tests=no if $PYTHON -c "import twisted.internet.reactor, dbus.mainloop.glib"\ >/dev/null 2>&1; then mc_want_twisted_tests=yes fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $mc_want_twisted_tests" >&5 $as_echo "$mc_want_twisted_tests" >&6; } if test yes = "$mc_want_twisted_tests"; then WANT_TWISTED_TESTS_TRUE= WANT_TWISTED_TESTS_FALSE='#' else WANT_TWISTED_TESTS_TRUE='#' WANT_TWISTED_TESTS_FALSE= fi # Check whether --enable-debug was given. if test "${enable_debug+set}" = set; then : enableval=$enable_debug; enable_debug=${enableval} else enable_debug=yes fi if test "x$enable_debug" = "xyes"; then CFLAGS="$CFLAGS -DENABLE_DEBUG" fi # Check whether --enable-cast-checks was given. if test "${enable_cast_checks+set}" = set; then : enableval=$enable_cast_checks; cchecks=${enableval} else cchecks=yes fi if test "x$cchecks" = "xno"; then CFLAGS="$CFLAGS -DG_DISABLE_CAST_CHECKS" fi # Check whether --enable-asserts was given. if test "${enable_asserts+set}" = set; then : enableval=$enable_asserts; asserts=${enableval} else asserts=yes fi if test "x$asserts" = "xno"; then CFLAGS="$CFLAGS -DG_DISABLE_ASSERTS" fi # Check whether --enable-checks was given. if test "${enable_checks+set}" = set; then : enableval=$enable_checks; checks=${enableval} else checks=yes fi if test "x$checks" = "xno"; then CFLAGS="$CFLAGS -DG_DISABLE_CHECKS" fi # Check whether --enable-coverage was given. if test "${enable_coverage+set}" = set; then : enableval=$enable_coverage; enable_coverage=${enableval} else enable_coverage=no fi if test "x$enable_coverage" = "xyes"; then CFLAGS="$CFLAGS -g -fprofile-arcs -ftest-coverage" fi # Check whether --enable-installed-tests was given. if test "${enable_installed_tests+set}" = set; then : enableval=$enable_installed_tests; installed_tests=$enableval else installed_tests=no fi if test x$installed_tests = xyes; then $as_echo "#define ENABLE_INSTALLED_TESTS /**/" >>confdefs.h fi if test "x$installed_tests" = xyes; then ENABLE_INSTALLED_TESTS_TRUE= ENABLE_INSTALLED_TESTS_FALSE='#' else ENABLE_INSTALLED_TESTS_TRUE='#' ENABLE_INSTALLED_TESTS_FALSE= fi mctestsdir=${libdir}/telepathy-mission-control-tests # Check whether --with-accounts_dir was given. if test "${with_accounts_dir+set}" = set; then : withval=$with_accounts_dir; fi if test -z "$with_accounts_dir" ; then ACCOUNTS_DIR="~/.mission-control/accounts" else ACCOUNTS_DIR=$with_accounts_dir fi cat >>confdefs.h <<_ACEOF #define ACCOUNTS_DIR "$ACCOUNTS_DIR" _ACEOF # Check whether --with-accounts_cache_dir was given. if test "${with_accounts_cache_dir+set}" = set; then : withval=$with_accounts_cache_dir; fi if test -z "$with_accounts_cache_dir" ; then ACCOUNTS_CACHE_DIR="" else ACCOUNTS_CACHE_DIR=$with_accounts_cache_dir fi cat >>confdefs.h <<_ACEOF #define ACCOUNTS_CACHE_DIR "$ACCOUNTS_CACHE_DIR" _ACEOF aegis_enabled="no" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with Aegis (libcreds) support" >&5 $as_echo_n "checking whether to build with Aegis (libcreds) support... " >&6; } # Check whether --enable-aegis was given. if test "${enable_aegis+set}" = set; then : enableval=$enable_aegis; { $as_echo "$as_me:${as_lineno-$LINENO}: checking for creds_init in -lcreds" >&5 $as_echo_n "checking for creds_init in -lcreds... " >&6; } if ${ac_cv_lib_creds_creds_init+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcreds $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char creds_init (); int main () { return creds_init (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_creds_creds_init=yes else ac_cv_lib_creds_creds_init=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_creds_creds_init" >&5 $as_echo "$ac_cv_lib_creds_creds_init" >&6; } if test "x$ac_cv_lib_creds_creds_init" = xyes; then : $as_echo "#define ENABLE_AEGIS 1" >>confdefs.h AEGIS_LIBS=-lcreds else as_fn_error $? "Aegis: libcreds not found" "$LINENO" 5 fi aegis_enabled="yes" else aegis_enabled="no" { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "#define ENABLE_AEGIS 0" >>confdefs.h fi if test x$aegis_enabled = xyes; then ENABLE_AEGIS_TRUE= ENABLE_AEGIS_FALSE='#' else ENABLE_AEGIS_TRUE='#' ENABLE_AEGIS_FALSE= fi if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_PKG_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG if test -n "$PKG_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 $as_echo "$PKG_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_path_PKG_CONFIG"; then ac_pt_PKG_CONFIG=$PKG_CONFIG # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $ac_pt_PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG if test -n "$ac_pt_PKG_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5 $as_echo "$ac_pt_PKG_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_pt_PKG_CONFIG" = x; then PKG_CONFIG="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac PKG_CONFIG=$ac_pt_PKG_CONFIG fi else PKG_CONFIG="$ac_cv_path_PKG_CONFIG" fi fi if test -n "$PKG_CONFIG"; then _pkg_min_version=0.9.0 { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5 $as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; } if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } PKG_CONFIG="" fi fi libaccounts_sso_enabled="no" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with libaccounts-glib SSO suport" >&5 $as_echo_n "checking whether to build with libaccounts-glib SSO suport... " >&6; } # Check whether --enable-libaccounts-sso was given. if test "${enable_libaccounts_sso+set}" = set; then : enableval=$enable_libaccounts_sso; { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${enableval}" >&5 $as_echo "${enableval}" >&6; } libaccounts_sso_enabled="${enableval}" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$libaccounts_sso_enabled" = xauto ; then : if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libaccounts-glib\""; } >&5 ($PKG_CONFIG --exists --print-errors "libaccounts-glib") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then libaccounts_sso_enabled=yes else libaccounts_sso_enabled=no fi fi if test "x$libaccounts_sso_enabled" = xyes ; then : ENABLE_LIBACCOUNTS_SSO=yes $as_echo "#define ENABLE_LIBACCOUNTS_SSO 1" >>confdefs.h pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBACCOUNTS_SSO" >&5 $as_echo_n "checking for LIBACCOUNTS_SSO... " >&6; } if test -n "$LIBACCOUNTS_SSO_CFLAGS"; then pkg_cv_LIBACCOUNTS_SSO_CFLAGS="$LIBACCOUNTS_SSO_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libaccounts-glib >= 0.26\""; } >&5 ($PKG_CONFIG --exists --print-errors "libaccounts-glib >= 0.26") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_LIBACCOUNTS_SSO_CFLAGS=`$PKG_CONFIG --cflags "libaccounts-glib >= 0.26" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$LIBACCOUNTS_SSO_LIBS"; then pkg_cv_LIBACCOUNTS_SSO_LIBS="$LIBACCOUNTS_SSO_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libaccounts-glib >= 0.26\""; } >&5 ($PKG_CONFIG --exists --print-errors "libaccounts-glib >= 0.26") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_LIBACCOUNTS_SSO_LIBS=`$PKG_CONFIG --libs "libaccounts-glib >= 0.26" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then LIBACCOUNTS_SSO_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libaccounts-glib >= 0.26" 2>&1` else LIBACCOUNTS_SSO_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libaccounts-glib >= 0.26" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$LIBACCOUNTS_SSO_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (libaccounts-glib >= 0.26) were not met: $LIBACCOUNTS_SSO_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables LIBACCOUNTS_SSO_CFLAGS and LIBACCOUNTS_SSO_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables LIBACCOUNTS_SSO_CFLAGS and LIBACCOUNTS_SSO_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details" "$LINENO" 5; } else LIBACCOUNTS_SSO_CFLAGS=$pkg_cv_LIBACCOUNTS_SSO_CFLAGS LIBACCOUNTS_SSO_LIBS=$pkg_cv_LIBACCOUNTS_SSO_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi else $as_echo "#define ENABLE_LIBACCOUNTS_SSO 0" >>confdefs.h fi if test x$libaccounts_sso_enabled = xyes; then ENABLE_LIBACCOUNTS_SSO_TRUE= ENABLE_LIBACCOUNTS_SSO_FALSE='#' else ENABLE_LIBACCOUNTS_SSO_TRUE='#' ENABLE_LIBACCOUNTS_SSO_FALSE= fi # Check whether --with-accounts-glib-hidden-service-type was given. if test "${with_accounts_glib_hidden_service_type+set}" = set; then : withval=$with_accounts_glib_hidden_service_type; else with_accounts_glib_hidden_service_type=no fi if test "x$with_accounts_glib_hidden_service_type" != xno ; then : cat >>confdefs.h <<_ACEOF #define ACCOUNTS_GLIB_HIDDEN_SERVICE_TYPE "$with_accounts_glib_hidden_service_type" _ACEOF fi if test x$with_accounts_glib_hidden_service_type != xno; then ENABLE_LIBACCOUNTS_GLIB_HIDDEN_TRUE= ENABLE_LIBACCOUNTS_GLIB_HIDDEN_FALSE='#' else ENABLE_LIBACCOUNTS_GLIB_HIDDEN_TRUE='#' ENABLE_LIBACCOUNTS_GLIB_HIDDEN_FALSE= fi pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DBUS" >&5 $as_echo_n "checking for DBUS... " >&6; } if test -n "$DBUS_CFLAGS"; then pkg_cv_DBUS_CFLAGS="$DBUS_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"dbus-1 >= 0.95, dbus-glib-1 >= 0.82\""; } >&5 ($PKG_CONFIG --exists --print-errors "dbus-1 >= 0.95, dbus-glib-1 >= 0.82") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_DBUS_CFLAGS=`$PKG_CONFIG --cflags "dbus-1 >= 0.95, dbus-glib-1 >= 0.82" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$DBUS_LIBS"; then pkg_cv_DBUS_LIBS="$DBUS_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"dbus-1 >= 0.95, dbus-glib-1 >= 0.82\""; } >&5 ($PKG_CONFIG --exists --print-errors "dbus-1 >= 0.95, dbus-glib-1 >= 0.82") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_DBUS_LIBS=`$PKG_CONFIG --libs "dbus-1 >= 0.95, dbus-glib-1 >= 0.82" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then DBUS_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "dbus-1 >= 0.95, dbus-glib-1 >= 0.82" 2>&1` else DBUS_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "dbus-1 >= 0.95, dbus-glib-1 >= 0.82" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$DBUS_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (dbus-1 >= 0.95, dbus-glib-1 >= 0.82) were not met: $DBUS_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables DBUS_CFLAGS and DBUS_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables DBUS_CFLAGS and DBUS_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details" "$LINENO" 5; } else DBUS_CFLAGS=$pkg_cv_DBUS_CFLAGS DBUS_LIBS=$pkg_cv_DBUS_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for TELEPATHY" >&5 $as_echo_n "checking for TELEPATHY... " >&6; } if test -n "$TELEPATHY_CFLAGS"; then pkg_cv_TELEPATHY_CFLAGS="$TELEPATHY_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"telepathy-glib >= 0.20.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "telepathy-glib >= 0.20.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_TELEPATHY_CFLAGS=`$PKG_CONFIG --cflags "telepathy-glib >= 0.20.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$TELEPATHY_LIBS"; then pkg_cv_TELEPATHY_LIBS="$TELEPATHY_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"telepathy-glib >= 0.20.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "telepathy-glib >= 0.20.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_TELEPATHY_LIBS=`$PKG_CONFIG --libs "telepathy-glib >= 0.20.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then TELEPATHY_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "telepathy-glib >= 0.20.0" 2>&1` else TELEPATHY_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "telepathy-glib >= 0.20.0" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$TELEPATHY_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (telepathy-glib >= 0.20.0) were not met: $TELEPATHY_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables TELEPATHY_CFLAGS and TELEPATHY_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables TELEPATHY_CFLAGS and TELEPATHY_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details" "$LINENO" 5; } else TELEPATHY_CFLAGS=$pkg_cv_TELEPATHY_CFLAGS TELEPATHY_LIBS=$pkg_cv_TELEPATHY_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi $as_echo "#define TP_VERSION_MIN_REQUIRED TP_VERSION_0_18" >>confdefs.h $as_echo "#define TP_VERSION_MAX_ALLOWED TP_VERSION_0_20" >>confdefs.h $as_echo "#define TP_SEAL_ENABLE /**/" >>confdefs.h $as_echo "#define TP_DISABLE_SINGLE_INCLUDE /**/" >>confdefs.h pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GLIB" >&5 $as_echo_n "checking for GLIB... " >&6; } if test -n "$GLIB_CFLAGS"; then pkg_cv_GLIB_CFLAGS="$GLIB_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glib-2.0 >= 2.46, gobject-2.0, gmodule-no-export-2.0, gio-2.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "glib-2.0 >= 2.46, gobject-2.0, gmodule-no-export-2.0, gio-2.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_GLIB_CFLAGS=`$PKG_CONFIG --cflags "glib-2.0 >= 2.46, gobject-2.0, gmodule-no-export-2.0, gio-2.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$GLIB_LIBS"; then pkg_cv_GLIB_LIBS="$GLIB_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glib-2.0 >= 2.46, gobject-2.0, gmodule-no-export-2.0, gio-2.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "glib-2.0 >= 2.46, gobject-2.0, gmodule-no-export-2.0, gio-2.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_GLIB_LIBS=`$PKG_CONFIG --libs "glib-2.0 >= 2.46, gobject-2.0, gmodule-no-export-2.0, gio-2.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then GLIB_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "glib-2.0 >= 2.46, gobject-2.0, gmodule-no-export-2.0, gio-2.0" 2>&1` else GLIB_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "glib-2.0 >= 2.46, gobject-2.0, gmodule-no-export-2.0, gio-2.0" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$GLIB_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (glib-2.0 >= 2.46, gobject-2.0, gmodule-no-export-2.0, gio-2.0) were not met: $GLIB_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables GLIB_CFLAGS and GLIB_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables GLIB_CFLAGS and GLIB_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details" "$LINENO" 5; } else GLIB_CFLAGS=$pkg_cv_GLIB_CFLAGS GLIB_LIBS=$pkg_cv_GLIB_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GIO_UNIX" >&5 $as_echo_n "checking for GIO_UNIX... " >&6; } if test -n "$GIO_UNIX_CFLAGS"; then pkg_cv_GIO_UNIX_CFLAGS="$GIO_UNIX_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gio-unix-2.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "gio-unix-2.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_GIO_UNIX_CFLAGS=`$PKG_CONFIG --cflags "gio-unix-2.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$GIO_UNIX_LIBS"; then pkg_cv_GIO_UNIX_LIBS="$GIO_UNIX_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gio-unix-2.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "gio-unix-2.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_GIO_UNIX_LIBS=`$PKG_CONFIG --libs "gio-unix-2.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then GIO_UNIX_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "gio-unix-2.0" 2>&1` else GIO_UNIX_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "gio-unix-2.0" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$GIO_UNIX_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (gio-unix-2.0) were not met: $GIO_UNIX_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables GIO_UNIX_CFLAGS and GIO_UNIX_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables GIO_UNIX_CFLAGS and GIO_UNIX_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details" "$LINENO" 5; } else GIO_UNIX_CFLAGS=$pkg_cv_GIO_UNIX_CFLAGS GIO_UNIX_LIBS=$pkg_cv_GIO_UNIX_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } $as_echo "#define HAVE_GIO_UNIX /**/" >>confdefs.h GLIB_CFLAGS="$GLIB_CFLAGS $GIO_UNIX_CFLAGS" GLIB_LIBS="$GLIB_LIBS $GIO_UNIX_LIBS" fi $as_echo "#define GLIB_VERSION_MIN_REQUIRED GLIB_VERSION_2_46" >>confdefs.h $as_echo "#define GLIB_VERSION_MAX_ALLOWED GLIB_VERSION_2_46" >>confdefs.h pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MCE" >&5 $as_echo_n "checking for MCE... " >&6; } if test -n "$MCE_CFLAGS"; then pkg_cv_MCE_CFLAGS="$MCE_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"mce >= 1.5\""; } >&5 ($PKG_CONFIG --exists --print-errors "mce >= 1.5") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_MCE_CFLAGS=`$PKG_CONFIG --cflags "mce >= 1.5" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$MCE_LIBS"; then pkg_cv_MCE_LIBS="$MCE_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"mce >= 1.5\""; } >&5 ($PKG_CONFIG --exists --print-errors "mce >= 1.5") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_MCE_LIBS=`$PKG_CONFIG --libs "mce >= 1.5" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then MCE_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "mce >= 1.5" 2>&1` else MCE_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "mce >= 1.5" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$MCE_PKG_ERRORS" >&5 HAVE_MCE=no elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } HAVE_MCE=no else MCE_CFLAGS=$pkg_cv_MCE_CFLAGS MCE_LIBS=$pkg_cv_MCE_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } HAVE_MCE=yes fi if test x"$HAVE_MCE" = xyes; then HAVE_MCE_TRUE= HAVE_MCE_FALSE='#' else HAVE_MCE_TRUE='#' HAVE_MCE_FALSE= fi if test x"$HAVE_MCE" = xyes; then $as_echo "#define HAVE_MCE 1" >>confdefs.h fi # ----------------------------------------------------------- # Connectivity integration # ----------------------------------------------------------- # Check whether --with-connectivity was given. if test "${with_connectivity+set}" = set; then : withval=$with_connectivity; else with_connectivity=auto fi # --with-connectivity=connman always used to turn off NM support, # so treat it as "no" now that ConnMan doesn't need anything special. if test "x$with_connectivity" = "xno" || test "x$with_connectivity" = "xconnman"; then have_nm=no else pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for NETWORK_MANAGER" >&5 $as_echo_n "checking for NETWORK_MANAGER... " >&6; } if test -n "$NETWORK_MANAGER_CFLAGS"; then pkg_cv_NETWORK_MANAGER_CFLAGS="$NETWORK_MANAGER_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \" libnm \""; } >&5 ($PKG_CONFIG --exists --print-errors " libnm ") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_NETWORK_MANAGER_CFLAGS=`$PKG_CONFIG --cflags " libnm " 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$NETWORK_MANAGER_LIBS"; then pkg_cv_NETWORK_MANAGER_LIBS="$NETWORK_MANAGER_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \" libnm \""; } >&5 ($PKG_CONFIG --exists --print-errors " libnm ") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_NETWORK_MANAGER_LIBS=`$PKG_CONFIG --libs " libnm " 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then NETWORK_MANAGER_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs " libnm " 2>&1` else NETWORK_MANAGER_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs " libnm " 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$NETWORK_MANAGER_PKG_ERRORS" >&5 have_nm="no" elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } have_nm="no" else NETWORK_MANAGER_CFLAGS=$pkg_cv_NETWORK_MANAGER_CFLAGS NETWORK_MANAGER_LIBS=$pkg_cv_NETWORK_MANAGER_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } have_nm="yes" fi if test "x$have_nm" = "xyes"; then $as_echo "#define HAVE_NM 1" >>confdefs.h fi fi if test "x$with_connectivity" = "xnm" -a "x$have_nm" != "xyes"; then as_fn_error $? "Couldn't find Network Manager dependencies: $NETWORK_MANAGER_PKG_ERRORS" "$LINENO" 5 fi if test "x$have_nm" = "xyes"; then HAVE_NM_TRUE= HAVE_NM_FALSE='#' else HAVE_NM_TRUE='#' HAVE_NM_FALSE= fi # Check whether --enable-conn-setting was given. if test "${enable_conn_setting+set}" = set; then : enableval=$enable_conn_setting; else enable_conn_setting=yes fi if test x"$enable_conn_setting" = xyes; then $as_echo "#define ENABLE_CONN_SETTING 1" >>confdefs.h fi if test x"$enable_conn_setting" = xyes; then ENABLE_CONN_SETTING_TRUE= ENABLE_CONN_SETTING_FALSE='#' else ENABLE_CONN_SETTING_TRUE='#' ENABLE_CONN_SETTING_FALSE= fi # ----------------------------------------------------------- # Suspend/resume tracking goop # ----------------------------------------------------------- # Check whether --enable-upower was given. if test "${enable_upower+set}" = set; then : enableval=$enable_upower; else enable_upower=auto fi if test "x$enable_upower" != xno; then pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for UPOWER_GLIB" >&5 $as_echo_n "checking for UPOWER_GLIB... " >&6; } if test -n "$UPOWER_GLIB_CFLAGS"; then pkg_cv_UPOWER_GLIB_CFLAGS="$UPOWER_GLIB_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"upower-glib < 0.99\""; } >&5 ($PKG_CONFIG --exists --print-errors "upower-glib < 0.99") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_UPOWER_GLIB_CFLAGS=`$PKG_CONFIG --cflags "upower-glib < 0.99" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$UPOWER_GLIB_LIBS"; then pkg_cv_UPOWER_GLIB_LIBS="$UPOWER_GLIB_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"upower-glib < 0.99\""; } >&5 ($PKG_CONFIG --exists --print-errors "upower-glib < 0.99") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_UPOWER_GLIB_LIBS=`$PKG_CONFIG --libs "upower-glib < 0.99" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then UPOWER_GLIB_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "upower-glib < 0.99" 2>&1` else UPOWER_GLIB_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "upower-glib < 0.99" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$UPOWER_GLIB_PKG_ERRORS" >&5 if test "x$enable_upower" == xyes; then as_fn_error $? "$UPOWER_GLIB_PKG_ERRORS" "$LINENO" 5 else have_upower=no fi elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if test "x$enable_upower" == xyes; then as_fn_error $? "$UPOWER_GLIB_PKG_ERRORS" "$LINENO" 5 else have_upower=no fi else UPOWER_GLIB_CFLAGS=$pkg_cv_UPOWER_GLIB_CFLAGS UPOWER_GLIB_LIBS=$pkg_cv_UPOWER_GLIB_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } $as_echo "#define HAVE_UPOWER 1" >>confdefs.h have_upower=yes fi else have_upower=no fi GLIB_GENMARSHAL="`$PKG_CONFIG --variable=glib_genmarshal glib-2.0`" GLIB_MKENUMS="`$PKG_CONFIG --variable=glib_mkenums glib-2.0`" gtk_doc_requires="gtk-doc >= 1.17" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gtk-doc" >&5 $as_echo_n "checking for gtk-doc... " >&6; } if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$gtk_doc_requires\""; } >&5 ($PKG_CONFIG --exists --print-errors "$gtk_doc_requires") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then have_gtk_doc=yes else have_gtk_doc=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_gtk_doc" >&5 $as_echo "$have_gtk_doc" >&6; } if test "$have_gtk_doc" = "no"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: You will not be able to create source packages with 'make dist' because $gtk_doc_requires is not found." >&5 $as_echo "$as_me: WARNING: You will not be able to create source packages with 'make dist' because $gtk_doc_requires is not found." >&2;} fi # Extract the first word of "gtkdoc-check", so it can be a program name with args. set dummy gtkdoc-check; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_GTKDOC_CHECK+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$GTKDOC_CHECK"; then ac_cv_prog_GTKDOC_CHECK="$GTKDOC_CHECK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_GTKDOC_CHECK="gtkdoc-check.test" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi GTKDOC_CHECK=$ac_cv_prog_GTKDOC_CHECK if test -n "$GTKDOC_CHECK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GTKDOC_CHECK" >&5 $as_echo "$GTKDOC_CHECK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of "gtkdoc-check", so it can be a program name with args. set dummy gtkdoc-check; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_GTKDOC_CHECK_PATH+:} false; then : $as_echo_n "(cached) " >&6 else case $GTKDOC_CHECK_PATH in [\\/]* | ?:[\\/]*) ac_cv_path_GTKDOC_CHECK_PATH="$GTKDOC_CHECK_PATH" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_GTKDOC_CHECK_PATH="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi GTKDOC_CHECK_PATH=$ac_cv_path_GTKDOC_CHECK_PATH if test -n "$GTKDOC_CHECK_PATH"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GTKDOC_CHECK_PATH" >&5 $as_echo "$GTKDOC_CHECK_PATH" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi for ac_prog in gtkdoc-rebase do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_GTKDOC_REBASE+:} false; then : $as_echo_n "(cached) " >&6 else case $GTKDOC_REBASE in [\\/]* | ?:[\\/]*) ac_cv_path_GTKDOC_REBASE="$GTKDOC_REBASE" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_GTKDOC_REBASE="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi GTKDOC_REBASE=$ac_cv_path_GTKDOC_REBASE if test -n "$GTKDOC_REBASE"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GTKDOC_REBASE" >&5 $as_echo "$GTKDOC_REBASE" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$GTKDOC_REBASE" && break done test -n "$GTKDOC_REBASE" || GTKDOC_REBASE="true" # Extract the first word of "gtkdoc-mkpdf", so it can be a program name with args. set dummy gtkdoc-mkpdf; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_GTKDOC_MKPDF+:} false; then : $as_echo_n "(cached) " >&6 else case $GTKDOC_MKPDF in [\\/]* | ?:[\\/]*) ac_cv_path_GTKDOC_MKPDF="$GTKDOC_MKPDF" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_GTKDOC_MKPDF="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi GTKDOC_MKPDF=$ac_cv_path_GTKDOC_MKPDF if test -n "$GTKDOC_MKPDF"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GTKDOC_MKPDF" >&5 $as_echo "$GTKDOC_MKPDF" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Check whether --with-html-dir was given. if test "${with_html_dir+set}" = set; then : withval=$with_html_dir; else with_html_dir='${datadir}/gtk-doc/html' fi HTML_DIR="$with_html_dir" # Check whether --enable-gtk-doc was given. if test "${enable_gtk_doc+set}" = set; then : enableval=$enable_gtk_doc; else enable_gtk_doc=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build gtk-doc documentation" >&5 $as_echo_n "checking whether to build gtk-doc documentation... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_gtk_doc" >&5 $as_echo "$enable_gtk_doc" >&6; } if test "x$enable_gtk_doc" = "xyes" && test "$have_gtk_doc" = "no"; then as_fn_error $? " You must have $gtk_doc_requires installed to build documentation for $PACKAGE_NAME. Please install gtk-doc or disable building the documentation by adding '--disable-gtk-doc' to '$0'." "$LINENO" 5 fi if test "x$PACKAGE_NAME" != "xglib"; then pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GTKDOC_DEPS" >&5 $as_echo_n "checking for GTKDOC_DEPS... " >&6; } if test -n "$GTKDOC_DEPS_CFLAGS"; then pkg_cv_GTKDOC_DEPS_CFLAGS="$GTKDOC_DEPS_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_GTKDOC_DEPS_CFLAGS=`$PKG_CONFIG --cflags "glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$GTKDOC_DEPS_LIBS"; then pkg_cv_GTKDOC_DEPS_LIBS="$GTKDOC_DEPS_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_GTKDOC_DEPS_LIBS=`$PKG_CONFIG --libs "glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then GTKDOC_DEPS_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0" 2>&1` else GTKDOC_DEPS_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$GTKDOC_DEPS_PKG_ERRORS" >&5 : elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } : else GTKDOC_DEPS_CFLAGS=$pkg_cv_GTKDOC_DEPS_CFLAGS GTKDOC_DEPS_LIBS=$pkg_cv_GTKDOC_DEPS_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi fi # Check whether --enable-gtk-doc-html was given. if test "${enable_gtk_doc_html+set}" = set; then : enableval=$enable_gtk_doc_html; else enable_gtk_doc_html=yes fi # Check whether --enable-gtk-doc-pdf was given. if test "${enable_gtk_doc_pdf+set}" = set; then : enableval=$enable_gtk_doc_pdf; else enable_gtk_doc_pdf=no fi if test -z "$GTKDOC_MKPDF"; then enable_gtk_doc_pdf=no fi if test -z "$AM_DEFAULT_VERBOSITY"; then AM_DEFAULT_VERBOSITY=1 fi if test x$have_gtk_doc = xyes; then HAVE_GTK_DOC_TRUE= HAVE_GTK_DOC_FALSE='#' else HAVE_GTK_DOC_TRUE='#' HAVE_GTK_DOC_FALSE= fi if test x$enable_gtk_doc = xyes; then ENABLE_GTK_DOC_TRUE= ENABLE_GTK_DOC_FALSE='#' else ENABLE_GTK_DOC_TRUE='#' ENABLE_GTK_DOC_FALSE= fi if test x$enable_gtk_doc_html = xyes; then GTK_DOC_BUILD_HTML_TRUE= GTK_DOC_BUILD_HTML_FALSE='#' else GTK_DOC_BUILD_HTML_TRUE='#' GTK_DOC_BUILD_HTML_FALSE= fi if test x$enable_gtk_doc_pdf = xyes; then GTK_DOC_BUILD_PDF_TRUE= GTK_DOC_BUILD_PDF_FALSE='#' else GTK_DOC_BUILD_PDF_TRUE='#' GTK_DOC_BUILD_PDF_FALSE= fi if test -n "$LIBTOOL"; then GTK_DOC_USE_LIBTOOL_TRUE= GTK_DOC_USE_LIBTOOL_FALSE='#' else GTK_DOC_USE_LIBTOOL_TRUE='#' GTK_DOC_USE_LIBTOOL_FALSE= fi if test -n "$GTKDOC_REBASE"; then GTK_DOC_USE_REBASE_TRUE= GTK_DOC_USE_REBASE_FALSE='#' else GTK_DOC_USE_REBASE_TRUE='#' GTK_DOC_USE_REBASE_FALSE= fi # Check whether --enable-schemas-compile was given. if test "${enable_schemas_compile+set}" = set; then : enableval=$enable_schemas_compile; case ${enableval} in yes) GSETTINGS_DISABLE_SCHEMAS_COMPILE="" ;; no) GSETTINGS_DISABLE_SCHEMAS_COMPILE="1" ;; *) as_fn_error $? "bad value ${enableval} for --enable-schemas-compile" "$LINENO" 5 ;; esac fi if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_PKG_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG if test -n "$PKG_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 $as_echo "$PKG_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_path_PKG_CONFIG"; then ac_pt_PKG_CONFIG=$PKG_CONFIG # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $ac_pt_PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG if test -n "$ac_pt_PKG_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5 $as_echo "$ac_pt_PKG_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_pt_PKG_CONFIG" = x; then PKG_CONFIG="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac PKG_CONFIG=$ac_pt_PKG_CONFIG fi else PKG_CONFIG="$ac_cv_path_PKG_CONFIG" fi fi if test -n "$PKG_CONFIG"; then _pkg_min_version=0.16 { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5 $as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; } if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } PKG_CONFIG="" fi fi gsettingsschemadir=${datadir}/glib-2.0/schemas if test x$cross_compiling != xyes; then GLIB_COMPILE_SCHEMAS=`$PKG_CONFIG --variable glib_compile_schemas gio-2.0` else # Extract the first word of "glib-compile-schemas", so it can be a program name with args. set dummy glib-compile-schemas; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_GLIB_COMPILE_SCHEMAS+:} false; then : $as_echo_n "(cached) " >&6 else case $GLIB_COMPILE_SCHEMAS in [\\/]* | ?:[\\/]*) ac_cv_path_GLIB_COMPILE_SCHEMAS="$GLIB_COMPILE_SCHEMAS" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_GLIB_COMPILE_SCHEMAS="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi GLIB_COMPILE_SCHEMAS=$ac_cv_path_GLIB_COMPILE_SCHEMAS if test -n "$GLIB_COMPILE_SCHEMAS"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GLIB_COMPILE_SCHEMAS" >&5 $as_echo "$GLIB_COMPILE_SCHEMAS" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test "x$GLIB_COMPILE_SCHEMAS" = "x"; then as_fn_error $? "glib-compile-schemas not found." "$LINENO" 5 else : fi GSETTINGS_RULES=' .PHONY : uninstall-gsettings-schemas install-gsettings-schemas clean-gsettings-schemas mostlyclean-am: clean-gsettings-schemas gsettings__enum_file = $(addsuffix .enums.xml,$(gsettings_ENUM_NAMESPACE)) %.gschema.valid: %.gschema.xml $(gsettings__enum_file) $(AM_V_GEN) $(GLIB_COMPILE_SCHEMAS) --strict --dry-run $(addprefix --schema-file=,$(gsettings__enum_file)) --schema-file=$< && mkdir -p $(@D) && touch $@ all-am: $(gsettings_SCHEMAS:.xml=.valid) uninstall-am: uninstall-gsettings-schemas install-data-am: install-gsettings-schemas .SECONDARY: $(gsettings_SCHEMAS) install-gsettings-schemas: $(gsettings_SCHEMAS) $(gsettings__enum_file) @$(NORMAL_INSTALL) if test -n "$^"; then \ test -z "$(gsettingsschemadir)" || $(MKDIR_P) "$(DESTDIR)$(gsettingsschemadir)"; \ $(INSTALL_DATA) $^ "$(DESTDIR)$(gsettingsschemadir)"; \ test -n "$(GSETTINGS_DISABLE_SCHEMAS_COMPILE)$(DESTDIR)" || $(GLIB_COMPILE_SCHEMAS) $(gsettingsschemadir); \ fi uninstall-gsettings-schemas: @$(NORMAL_UNINSTALL) @list='\''$(gsettings_SCHEMAS) $(gsettings__enum_file)'\''; test -n "$(gsettingsschemadir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e '\''s|^.*/||'\''`; \ test -n "$$files" || exit 0; \ echo " ( cd '\''$(DESTDIR)$(gsettingsschemadir)'\'' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(gsettingsschemadir)" && rm -f $$files test -n "$(GSETTINGS_DISABLE_SCHEMAS_COMPILE)$(DESTDIR)" || $(GLIB_COMPILE_SCHEMAS) $(gsettingsschemadir) clean-gsettings-schemas: rm -f $(gsettings_SCHEMAS:.xml=.valid) $(gsettings__enum_file) ifdef gsettings_ENUM_NAMESPACE $(gsettings__enum_file): $(gsettings_ENUM_FILES) $(AM_V_GEN) glib-mkenums --comments '\'''\'' --fhead "" --vhead " <@type@ id='\''$(gsettings_ENUM_NAMESPACE).@EnumName@'\''>" --vprod " " --vtail " " --ftail "" $^ > $@.tmp && mv $@.tmp $@ endif ' pluginlibdir=$libdir/mission-control ac_config_files="$ac_config_files Makefile data/Makefile doc/Makefile doc/reference/Makefile doc/reference/mission-control-plugins/Makefile m4/Makefile mission-control-plugins.pc mission-control-plugins-uninstalled.pc mission-control-plugins/Makefile plugins/Makefile server/Makefile src/Makefile tests/Makefile tests/twisted/Makefile tests/twisted/tools/Makefile tools/Makefile util/Makefile xml/Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' else am__EXEEXT_TRUE='#' am__EXEEXT_FALSE= fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then as_fn_error $? "conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCXX\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${WANT_TWISTED_TESTS_TRUE}" && test -z "${WANT_TWISTED_TESTS_FALSE}"; then as_fn_error $? "conditional \"WANT_TWISTED_TESTS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_INSTALLED_TESTS_TRUE}" && test -z "${ENABLE_INSTALLED_TESTS_FALSE}"; then as_fn_error $? "conditional \"ENABLE_INSTALLED_TESTS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_AEGIS_TRUE}" && test -z "${ENABLE_AEGIS_FALSE}"; then as_fn_error $? "conditional \"ENABLE_AEGIS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_LIBACCOUNTS_SSO_TRUE}" && test -z "${ENABLE_LIBACCOUNTS_SSO_FALSE}"; then as_fn_error $? "conditional \"ENABLE_LIBACCOUNTS_SSO\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_LIBACCOUNTS_GLIB_HIDDEN_TRUE}" && test -z "${ENABLE_LIBACCOUNTS_GLIB_HIDDEN_FALSE}"; then as_fn_error $? "conditional \"ENABLE_LIBACCOUNTS_GLIB_HIDDEN\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_MCE_TRUE}" && test -z "${HAVE_MCE_FALSE}"; then as_fn_error $? "conditional \"HAVE_MCE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_NM_TRUE}" && test -z "${HAVE_NM_FALSE}"; then as_fn_error $? "conditional \"HAVE_NM\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_CONN_SETTING_TRUE}" && test -z "${ENABLE_CONN_SETTING_FALSE}"; then as_fn_error $? "conditional \"ENABLE_CONN_SETTING\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_GTK_DOC_TRUE}" && test -z "${HAVE_GTK_DOC_FALSE}"; then as_fn_error $? "conditional \"HAVE_GTK_DOC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_GTK_DOC_TRUE}" && test -z "${ENABLE_GTK_DOC_FALSE}"; then as_fn_error $? "conditional \"ENABLE_GTK_DOC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${GTK_DOC_BUILD_HTML_TRUE}" && test -z "${GTK_DOC_BUILD_HTML_FALSE}"; then as_fn_error $? "conditional \"GTK_DOC_BUILD_HTML\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${GTK_DOC_BUILD_PDF_TRUE}" && test -z "${GTK_DOC_BUILD_PDF_FALSE}"; then as_fn_error $? "conditional \"GTK_DOC_BUILD_PDF\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${GTK_DOC_USE_LIBTOOL_TRUE}" && test -z "${GTK_DOC_USE_LIBTOOL_FALSE}"; then as_fn_error $? "conditional \"GTK_DOC_USE_LIBTOOL\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${GTK_DOC_USE_REBASE_TRUE}" && test -z "${GTK_DOC_USE_REBASE_FALSE}"; then as_fn_error $? "conditional \"GTK_DOC_USE_REBASE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by telepathy-mission-control $as_me 5.16.4, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac case $ac_config_headers in *" "*) set x $ac_config_headers; shift; ac_config_headers=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" config_commands="$ac_config_commands" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Configuration commands: $config_commands Report bugs to the package provider." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ telepathy-mission-control config.status 5.16.4 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' MKDIR_P='$MKDIR_P' AWK='$AWK' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`' macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`' enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' shared_archive_member_spec='`$ECHO "$shared_archive_member_spec" | $SED "$delay_single_quote_subst"`' SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`' host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`' build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`' build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`' SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`' Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`' GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`' EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`' FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`' LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`' NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`' LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`' max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`' ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`' exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`' lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`' lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`' want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`' old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`' lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`' CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`' CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`' compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`' GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_import='`$ECHO "$lt_cv_sys_global_symbol_to_import" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' lt_cv_nm_interface='`$ECHO "$lt_cv_nm_interface" | $SED "$delay_single_quote_subst"`' nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`' lt_cv_truncate_bin='`$ECHO "$lt_cv_truncate_bin" | $SED "$delay_single_quote_subst"`' objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`' DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`' OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`' libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`' shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`' extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`' enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`' export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`' whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`' compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`' old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`' old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`' archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`' module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`' module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`' with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`' hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`' hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`' file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`' version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`' runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`' libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`' library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`' soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`' install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`' postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`' postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`' finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' configure_time_dlsearch_path='`$ECHO "$configure_time_dlsearch_path" | $SED "$delay_single_quote_subst"`' configure_time_lt_sys_library_path='`$ECHO "$configure_time_lt_sys_library_path" | $SED "$delay_single_quote_subst"`' hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' compiler_lib_search_dirs='`$ECHO "$compiler_lib_search_dirs" | $SED "$delay_single_quote_subst"`' predep_objects='`$ECHO "$predep_objects" | $SED "$delay_single_quote_subst"`' postdep_objects='`$ECHO "$postdep_objects" | $SED "$delay_single_quote_subst"`' predeps='`$ECHO "$predeps" | $SED "$delay_single_quote_subst"`' postdeps='`$ECHO "$postdeps" | $SED "$delay_single_quote_subst"`' compiler_lib_search_path='`$ECHO "$compiler_lib_search_path" | $SED "$delay_single_quote_subst"`' LD_CXX='`$ECHO "$LD_CXX" | $SED "$delay_single_quote_subst"`' reload_flag_CXX='`$ECHO "$reload_flag_CXX" | $SED "$delay_single_quote_subst"`' reload_cmds_CXX='`$ECHO "$reload_cmds_CXX" | $SED "$delay_single_quote_subst"`' old_archive_cmds_CXX='`$ECHO "$old_archive_cmds_CXX" | $SED "$delay_single_quote_subst"`' compiler_CXX='`$ECHO "$compiler_CXX" | $SED "$delay_single_quote_subst"`' GCC_CXX='`$ECHO "$GCC_CXX" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_no_builtin_flag_CXX='`$ECHO "$lt_prog_compiler_no_builtin_flag_CXX" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_pic_CXX='`$ECHO "$lt_prog_compiler_pic_CXX" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_wl_CXX='`$ECHO "$lt_prog_compiler_wl_CXX" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_static_CXX='`$ECHO "$lt_prog_compiler_static_CXX" | $SED "$delay_single_quote_subst"`' lt_cv_prog_compiler_c_o_CXX='`$ECHO "$lt_cv_prog_compiler_c_o_CXX" | $SED "$delay_single_quote_subst"`' archive_cmds_need_lc_CXX='`$ECHO "$archive_cmds_need_lc_CXX" | $SED "$delay_single_quote_subst"`' enable_shared_with_static_runtimes_CXX='`$ECHO "$enable_shared_with_static_runtimes_CXX" | $SED "$delay_single_quote_subst"`' export_dynamic_flag_spec_CXX='`$ECHO "$export_dynamic_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' whole_archive_flag_spec_CXX='`$ECHO "$whole_archive_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' compiler_needs_object_CXX='`$ECHO "$compiler_needs_object_CXX" | $SED "$delay_single_quote_subst"`' old_archive_from_new_cmds_CXX='`$ECHO "$old_archive_from_new_cmds_CXX" | $SED "$delay_single_quote_subst"`' old_archive_from_expsyms_cmds_CXX='`$ECHO "$old_archive_from_expsyms_cmds_CXX" | $SED "$delay_single_quote_subst"`' archive_cmds_CXX='`$ECHO "$archive_cmds_CXX" | $SED "$delay_single_quote_subst"`' archive_expsym_cmds_CXX='`$ECHO "$archive_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`' module_cmds_CXX='`$ECHO "$module_cmds_CXX" | $SED "$delay_single_quote_subst"`' module_expsym_cmds_CXX='`$ECHO "$module_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`' with_gnu_ld_CXX='`$ECHO "$with_gnu_ld_CXX" | $SED "$delay_single_quote_subst"`' allow_undefined_flag_CXX='`$ECHO "$allow_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`' no_undefined_flag_CXX='`$ECHO "$no_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`' hardcode_libdir_flag_spec_CXX='`$ECHO "$hardcode_libdir_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' hardcode_libdir_separator_CXX='`$ECHO "$hardcode_libdir_separator_CXX" | $SED "$delay_single_quote_subst"`' hardcode_direct_CXX='`$ECHO "$hardcode_direct_CXX" | $SED "$delay_single_quote_subst"`' hardcode_direct_absolute_CXX='`$ECHO "$hardcode_direct_absolute_CXX" | $SED "$delay_single_quote_subst"`' hardcode_minus_L_CXX='`$ECHO "$hardcode_minus_L_CXX" | $SED "$delay_single_quote_subst"`' hardcode_shlibpath_var_CXX='`$ECHO "$hardcode_shlibpath_var_CXX" | $SED "$delay_single_quote_subst"`' hardcode_automatic_CXX='`$ECHO "$hardcode_automatic_CXX" | $SED "$delay_single_quote_subst"`' inherit_rpath_CXX='`$ECHO "$inherit_rpath_CXX" | $SED "$delay_single_quote_subst"`' link_all_deplibs_CXX='`$ECHO "$link_all_deplibs_CXX" | $SED "$delay_single_quote_subst"`' always_export_symbols_CXX='`$ECHO "$always_export_symbols_CXX" | $SED "$delay_single_quote_subst"`' export_symbols_cmds_CXX='`$ECHO "$export_symbols_cmds_CXX" | $SED "$delay_single_quote_subst"`' exclude_expsyms_CXX='`$ECHO "$exclude_expsyms_CXX" | $SED "$delay_single_quote_subst"`' include_expsyms_CXX='`$ECHO "$include_expsyms_CXX" | $SED "$delay_single_quote_subst"`' prelink_cmds_CXX='`$ECHO "$prelink_cmds_CXX" | $SED "$delay_single_quote_subst"`' postlink_cmds_CXX='`$ECHO "$postlink_cmds_CXX" | $SED "$delay_single_quote_subst"`' file_list_spec_CXX='`$ECHO "$file_list_spec_CXX" | $SED "$delay_single_quote_subst"`' hardcode_action_CXX='`$ECHO "$hardcode_action_CXX" | $SED "$delay_single_quote_subst"`' compiler_lib_search_dirs_CXX='`$ECHO "$compiler_lib_search_dirs_CXX" | $SED "$delay_single_quote_subst"`' predep_objects_CXX='`$ECHO "$predep_objects_CXX" | $SED "$delay_single_quote_subst"`' postdep_objects_CXX='`$ECHO "$postdep_objects_CXX" | $SED "$delay_single_quote_subst"`' predeps_CXX='`$ECHO "$predeps_CXX" | $SED "$delay_single_quote_subst"`' postdeps_CXX='`$ECHO "$postdeps_CXX" | $SED "$delay_single_quote_subst"`' compiler_lib_search_path_CXX='`$ECHO "$compiler_lib_search_path_CXX" | $SED "$delay_single_quote_subst"`' LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } # Quote evaled strings. for var in SHELL \ ECHO \ PATH_SEPARATOR \ SED \ GREP \ EGREP \ FGREP \ LD \ NM \ LN_S \ lt_SP2NL \ lt_NL2SP \ reload_flag \ OBJDUMP \ deplibs_check_method \ file_magic_cmd \ file_magic_glob \ want_nocaseglob \ DLLTOOL \ sharedlib_from_linklib_cmd \ AR \ AR_FLAGS \ archiver_list_spec \ STRIP \ RANLIB \ CC \ CFLAGS \ compiler \ lt_cv_sys_global_symbol_pipe \ lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_import \ lt_cv_sys_global_symbol_to_c_name_address \ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ lt_cv_nm_interface \ nm_file_list_spec \ lt_cv_truncate_bin \ lt_prog_compiler_no_builtin_flag \ lt_prog_compiler_pic \ lt_prog_compiler_wl \ lt_prog_compiler_static \ lt_cv_prog_compiler_c_o \ need_locks \ MANIFEST_TOOL \ DSYMUTIL \ NMEDIT \ LIPO \ OTOOL \ OTOOL64 \ shrext_cmds \ export_dynamic_flag_spec \ whole_archive_flag_spec \ compiler_needs_object \ with_gnu_ld \ allow_undefined_flag \ no_undefined_flag \ hardcode_libdir_flag_spec \ hardcode_libdir_separator \ exclude_expsyms \ include_expsyms \ file_list_spec \ variables_saved_for_relink \ libname_spec \ library_names_spec \ soname_spec \ install_override_mode \ finish_eval \ old_striplib \ striplib \ compiler_lib_search_dirs \ predep_objects \ postdep_objects \ predeps \ postdeps \ compiler_lib_search_path \ LD_CXX \ reload_flag_CXX \ compiler_CXX \ lt_prog_compiler_no_builtin_flag_CXX \ lt_prog_compiler_pic_CXX \ lt_prog_compiler_wl_CXX \ lt_prog_compiler_static_CXX \ lt_cv_prog_compiler_c_o_CXX \ export_dynamic_flag_spec_CXX \ whole_archive_flag_spec_CXX \ compiler_needs_object_CXX \ with_gnu_ld_CXX \ allow_undefined_flag_CXX \ no_undefined_flag_CXX \ hardcode_libdir_flag_spec_CXX \ hardcode_libdir_separator_CXX \ exclude_expsyms_CXX \ include_expsyms_CXX \ file_list_spec_CXX \ compiler_lib_search_dirs_CXX \ predep_objects_CXX \ postdep_objects_CXX \ predeps_CXX \ postdeps_CXX \ compiler_lib_search_path_CXX; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in reload_cmds \ old_postinstall_cmds \ old_postuninstall_cmds \ old_archive_cmds \ extract_expsyms_cmds \ old_archive_from_new_cmds \ old_archive_from_expsyms_cmds \ archive_cmds \ archive_expsym_cmds \ module_cmds \ module_expsym_cmds \ export_symbols_cmds \ prelink_cmds \ postlink_cmds \ postinstall_cmds \ postuninstall_cmds \ finish_cmds \ sys_lib_search_path_spec \ configure_time_dlsearch_path \ configure_time_lt_sys_library_path \ reload_cmds_CXX \ old_archive_cmds_CXX \ old_archive_from_new_cmds_CXX \ old_archive_from_expsyms_cmds_CXX \ archive_cmds_CXX \ archive_expsym_cmds_CXX \ module_cmds_CXX \ module_expsym_cmds_CXX \ export_symbols_cmds_CXX \ prelink_cmds_CXX \ postlink_cmds_CXX; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done ac_aux_dir='$ac_aux_dir' # See if we are running on zsh, and set the options that allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi PACKAGE='$PACKAGE' VERSION='$VERSION' RM='$RM' ofile='$ofile' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "data/Makefile") CONFIG_FILES="$CONFIG_FILES data/Makefile" ;; "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; "doc/reference/Makefile") CONFIG_FILES="$CONFIG_FILES doc/reference/Makefile" ;; "doc/reference/mission-control-plugins/Makefile") CONFIG_FILES="$CONFIG_FILES doc/reference/mission-control-plugins/Makefile" ;; "m4/Makefile") CONFIG_FILES="$CONFIG_FILES m4/Makefile" ;; "mission-control-plugins.pc") CONFIG_FILES="$CONFIG_FILES mission-control-plugins.pc" ;; "mission-control-plugins-uninstalled.pc") CONFIG_FILES="$CONFIG_FILES mission-control-plugins-uninstalled.pc" ;; "mission-control-plugins/Makefile") CONFIG_FILES="$CONFIG_FILES mission-control-plugins/Makefile" ;; "plugins/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/Makefile" ;; "server/Makefile") CONFIG_FILES="$CONFIG_FILES server/Makefile" ;; "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; "tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;; "tests/twisted/Makefile") CONFIG_FILES="$CONFIG_FILES tests/twisted/Makefile" ;; "tests/twisted/tools/Makefile") CONFIG_FILES="$CONFIG_FILES tests/twisted/tools/Makefile" ;; "tools/Makefile") CONFIG_FILES="$CONFIG_FILES tools/Makefile" ;; "util/Makefile") CONFIG_FILES="$CONFIG_FILES util/Makefile" ;; "xml/Makefile") CONFIG_FILES="$CONFIG_FILES xml/Makefile" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF # Transform confdefs.h into an awk script `defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. # Create a delimiter string that does not exist in confdefs.h, to ease # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do ac_tt=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_tt"; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done # For the awk script, D is an array of macro values keyed by name, # likewise P contains macro parameters if any. Preserve backslash # newline sequences. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* sed -n ' s/.\{148\}/&'"$ac_delim"'/g t rset :rset s/^[ ]*#[ ]*define[ ][ ]*/ / t def d :def s/\\$// t bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3"/p s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p d :bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3\\\\\\n"\\/p t cont s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p t cont d :cont n s/.\{148\}/&'"$ac_delim"'/g t clear :clear s/\\$// t bsnlc s/["\\]/\\&/g; s/^/"/; s/$/"/p d :bsnlc s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p b cont ' >$CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 for (key in D) D_is_set[key] = 1 FS = "" } /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { line = \$ 0 split(line, arg, " ") if (arg[1] == "#") { defundef = arg[2] mac1 = arg[3] } else { defundef = substr(arg[1], 2) mac1 = arg[2] } split(mac1, mac2, "(") #) macro = mac2[1] prefix = substr(line, 1, index(line, defundef) - 1) if (D_is_set[macro]) { # Preserve the white space surrounding the "#". print prefix "define", macro P[macro] D[macro] next } else { # Replace #undef with comments. This is necessary, for example, # in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. if (defundef == "undef") { print "/*", prefix defundef, macro, "*/" next } } } { print } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi # Compute "$ac_file"'s index in $config_headers. _am_arg="$ac_file" _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || $as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$_am_arg" : 'X\(//\)[^/]' \| \ X"$_am_arg" : 'X\(//\)$' \| \ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$_am_arg" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'`/stamp-h$_am_stamp_count ;; :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 $as_echo "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || { # Autoconf 2.62 quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`$as_dirname -- "$mf" || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ X"$mf" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running `make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`$as_dirname -- "$file" || $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ X"$file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir=$dirpart/$fdir; as_fn_mkdir_p # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ;; "libtool":C) # See if we are running on zsh, and set the options that allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi cfgfile=${ofile}T trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # Generated automatically by $as_me ($PACKAGE) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # Provide generalized library-building support services. # Written by Gordon Matzigkeit, 1996 # Copyright (C) 2014 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # GNU Libtool is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of of the License, or # (at your option) any later version. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program or library that is built # using GNU Libtool, you may include this file under the same # distribution terms that you use for the rest of that program. # # GNU Libtool is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # The names of the tagged configurations supported by this script. available_tags='CXX ' # Configured defaults for sys_lib_dlsearch_path munging. : \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"} # ### BEGIN LIBTOOL CONFIG # Which release of libtool.m4 was used? macro_version=$macro_version macro_revision=$macro_revision # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # What type of objects to build. pic_mode=$pic_mode # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # Shared archive member basename,for filename based shared library versioning on AIX. shared_archive_member_spec=$shared_archive_member_spec # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # An echo program that protects backslashes. ECHO=$lt_ECHO # The PATH separator for the build system. PATH_SEPARATOR=$lt_PATH_SEPARATOR # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # A sed program that does not truncate output. SED=$lt_SED # Sed that helps us avoid accidentally triggering echo(1) options like -n. Xsed="\$SED -e 1s/^X//" # A grep program that handles long lines. GREP=$lt_GREP # An ERE matcher. EGREP=$lt_EGREP # A literal string matcher. FGREP=$lt_FGREP # A BSD- or MS-compatible name lister. NM=$lt_NM # Whether we need soft or hard links. LN_S=$lt_LN_S # What is the maximum length of a command? max_cmd_len=$max_cmd_len # Object file suffix (normally "o"). objext=$ac_objext # Executable file suffix (normally ""). exeext=$exeext # whether the shell understands "unset". lt_unset=$lt_unset # turn spaces into newlines. SP2NL=$lt_lt_SP2NL # turn newlines into spaces. NL2SP=$lt_lt_NL2SP # convert \$build file names to \$host format. to_host_file_cmd=$lt_cv_to_host_file_cmd # convert \$build files to toolchain format. to_tool_file_cmd=$lt_cv_to_tool_file_cmd # An object symbol dumper. OBJDUMP=$lt_OBJDUMP # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method = "file_magic". file_magic_cmd=$lt_file_magic_cmd # How to find potential files when deplibs_check_method = "file_magic". file_magic_glob=$lt_file_magic_glob # Find potential files using nocaseglob when deplibs_check_method = "file_magic". want_nocaseglob=$lt_want_nocaseglob # DLL creation program. DLLTOOL=$lt_DLLTOOL # Command to associate shared and link libraries. sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd # The archiver. AR=$lt_AR # Flags to create an archive. AR_FLAGS=$lt_AR_FLAGS # How to feed a file listing to the archiver. archiver_list_spec=$lt_archiver_list_spec # A symbol stripping program. STRIP=$lt_STRIP # Commands used to install an old-style archive. RANLIB=$lt_RANLIB old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Whether to use a lock for old archive extraction. lock_old_archive_extraction=$lock_old_archive_extraction # A C compiler. LTCC=$lt_CC # LTCC compiler flags. LTCFLAGS=$lt_CFLAGS # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration. global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm into a list of symbols to manually relocate. global_symbol_to_import=$lt_lt_cv_sys_global_symbol_to_import # Transform the output of nm in a C name address pair. global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # Transform the output of nm in a C name address pair when lib prefix is needed. global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix # The name lister interface. nm_interface=$lt_lt_cv_nm_interface # Specify filename containing input files for \$NM. nm_file_list_spec=$lt_nm_file_list_spec # The root where to search for dependent libraries,and where our libraries should be installed. lt_sysroot=$lt_sysroot # Command to truncate a binary pipe. lt_truncate_bin=$lt_lt_cv_truncate_bin # The name of the directory that contains temporary libtool files. objdir=$objdir # Used to examine libraries when file_magic_cmd begins with "file". MAGIC_CMD=$MAGIC_CMD # Must we lock files when doing compilation? need_locks=$lt_need_locks # Manifest tool. MANIFEST_TOOL=$lt_MANIFEST_TOOL # Tool to manipulate archived DWARF debug symbol files on Mac OS X. DSYMUTIL=$lt_DSYMUTIL # Tool to change global to local symbols on Mac OS X. NMEDIT=$lt_NMEDIT # Tool to manipulate fat objects and archives on Mac OS X. LIPO=$lt_LIPO # ldd/readelf like tool for Mach-O binaries on Mac OS X. OTOOL=$lt_OTOOL # ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. OTOOL64=$lt_OTOOL64 # Old archive suffix (normally "a"). libext=$libext # Shared library suffix (normally ".so"). shrext_cmds=$lt_shrext_cmds # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Variables whose values should be saved in libtool wrapper scripts and # restored at link time. variables_saved_for_relink=$lt_variables_saved_for_relink # Do we need the "lib" prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Library versioning type. version_type=$version_type # Shared library runtime path variable. runpath_var=$runpath_var # Shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Permission mode override for installation of shared libraries. install_override_mode=$lt_install_override_mode # Command to use after installation of a shared archive. postinstall_cmds=$lt_postinstall_cmds # Command to use after uninstallation of a shared archive. postuninstall_cmds=$lt_postuninstall_cmds # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # As "finish_cmds", except a single script fragment to be evaled but # not shown. finish_eval=$lt_finish_eval # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Compile-time system search path for libraries. sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Detected run-time system search path for libraries. sys_lib_dlsearch_path_spec=$lt_configure_time_dlsearch_path # Explicit LT_SYS_LIBRARY_PATH set during ./configure time. configure_time_lt_sys_library_path=$lt_configure_time_lt_sys_library_path # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # The linker used to build libraries. LD=$lt_LD # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds # A language specific compiler. CC=$lt_compiler # Is the compiler the GNU compiler? with_gcc=$GCC # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc # Whether or not to disallow shared libs when runtime libs are static. allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec # Whether the compiler copes with passing no objects directly. compiler_needs_object=$lt_compiler_needs_object # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds # Commands used to build a shared archive. archive_cmds=$lt_archive_cmds archive_expsym_cmds=$lt_archive_expsym_cmds # Commands used to build a loadable module if different from building # a shared archive. module_cmds=$lt_module_cmds module_expsym_cmds=$lt_module_expsym_cmds # Whether we are building with GNU ld or not. with_gnu_ld=$lt_with_gnu_ld # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag # Flag that enforces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec # Whether we need a single "-rpath" flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator # Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes # DIR into the resulting binary. hardcode_direct=$hardcode_direct # Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes # DIR into the resulting binary and the resulting library dependency is # "absolute",i.e impossible to change by setting \$shlibpath_var if the # library is relocated. hardcode_direct_absolute=$hardcode_direct_absolute # Set to "yes" if using the -LDIR flag during linking hardcodes DIR # into the resulting binary. hardcode_minus_L=$hardcode_minus_L # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR # into the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var # Set to "yes" if building a shared library automatically hardcodes DIR # into the library and all subsequent libraries and executables linked # against it. hardcode_automatic=$hardcode_automatic # Set to yes if linker adds runtime paths of dependent libraries # to runtime path list. inherit_rpath=$inherit_rpath # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs # Set to "yes" if exported symbols are required. always_export_symbols=$always_export_symbols # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms # Symbols that must always be exported. include_expsyms=$lt_include_expsyms # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds # Commands necessary for finishing linking programs. postlink_cmds=$lt_postlink_cmds # Specify filename containing input files. file_list_spec=$lt_file_list_spec # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action # The directories searched by this compiler when creating a shared library. compiler_lib_search_dirs=$lt_compiler_lib_search_dirs # Dependencies to place before and after the objects being linked to # create a shared library. predep_objects=$lt_predep_objects postdep_objects=$lt_postdep_objects predeps=$lt_predeps postdeps=$lt_postdeps # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path # ### END LIBTOOL CONFIG _LT_EOF cat <<'_LT_EOF' >> "$cfgfile" # ### BEGIN FUNCTIONS SHARED WITH CONFIGURE # func_munge_path_list VARIABLE PATH # ----------------------------------- # VARIABLE is name of variable containing _space_ separated list of # directories to be munged by the contents of PATH, which is string # having a format: # "DIR[:DIR]:" # string "DIR[ DIR]" will be prepended to VARIABLE # ":DIR[:DIR]" # string "DIR[ DIR]" will be appended to VARIABLE # "DIRP[:DIRP]::[DIRA:]DIRA" # string "DIRP[ DIRP]" will be prepended to VARIABLE and string # "DIRA[ DIRA]" will be appended to VARIABLE # "DIR[:DIR]" # VARIABLE will be replaced by "DIR[ DIR]" func_munge_path_list () { case x$2 in x) ;; *:) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\" ;; x:*) eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\" ;; *::*) eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\" ;; *) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\" ;; esac } # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. func_cc_basename () { for cc_temp in $*""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` } # ### END FUNCTIONS SHARED WITH CONFIGURE _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac ltmain=$ac_aux_dir/ltmain.sh # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" cat <<_LT_EOF >> "$ofile" # ### BEGIN LIBTOOL TAG CONFIG: CXX # The linker used to build libraries. LD=$lt_LD_CXX # How to create reloadable object files. reload_flag=$lt_reload_flag_CXX reload_cmds=$lt_reload_cmds_CXX # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds_CXX # A language specific compiler. CC=$lt_compiler_CXX # Is the compiler the GNU compiler? with_gcc=$GCC_CXX # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic_CXX # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl_CXX # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static_CXX # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc_CXX # Whether or not to disallow shared libs when runtime libs are static. allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX # Whether the compiler copes with passing no objects directly. compiler_needs_object=$lt_compiler_needs_object_CXX # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX # Commands used to build a shared archive. archive_cmds=$lt_archive_cmds_CXX archive_expsym_cmds=$lt_archive_expsym_cmds_CXX # Commands used to build a loadable module if different from building # a shared archive. module_cmds=$lt_module_cmds_CXX module_expsym_cmds=$lt_module_expsym_cmds_CXX # Whether we are building with GNU ld or not. with_gnu_ld=$lt_with_gnu_ld_CXX # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag_CXX # Flag that enforces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag_CXX # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX # Whether we need a single "-rpath" flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX # Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes # DIR into the resulting binary. hardcode_direct=$hardcode_direct_CXX # Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes # DIR into the resulting binary and the resulting library dependency is # "absolute",i.e impossible to change by setting \$shlibpath_var if the # library is relocated. hardcode_direct_absolute=$hardcode_direct_absolute_CXX # Set to "yes" if using the -LDIR flag during linking hardcodes DIR # into the resulting binary. hardcode_minus_L=$hardcode_minus_L_CXX # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR # into the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX # Set to "yes" if building a shared library automatically hardcodes DIR # into the library and all subsequent libraries and executables linked # against it. hardcode_automatic=$hardcode_automatic_CXX # Set to yes if linker adds runtime paths of dependent libraries # to runtime path list. inherit_rpath=$inherit_rpath_CXX # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs_CXX # Set to "yes" if exported symbols are required. always_export_symbols=$always_export_symbols_CXX # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds_CXX # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms_CXX # Symbols that must always be exported. include_expsyms=$lt_include_expsyms_CXX # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds_CXX # Commands necessary for finishing linking programs. postlink_cmds=$lt_postlink_cmds_CXX # Specify filename containing input files. file_list_spec=$lt_file_list_spec_CXX # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action_CXX # The directories searched by this compiler when creating a shared library. compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_CXX # Dependencies to place before and after the objects being linked to # create a shared library. predep_objects=$lt_predep_objects_CXX postdep_objects=$lt_postdep_objects_CXX predeps=$lt_predeps_CXX postdeps=$lt_postdeps_CXX # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path_CXX # ### END LIBTOOL TAG CONFIG: CXX _LT_EOF ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi echo " Configure summary: Compiler.....................: ${CC} Compiler Flags...............: ${CFLAGS} ${ERROR_CFLAGS} Linker Flags.................: ${LDFLAGS} Prefix.......................: ${prefix} Enable debug.................: ${enable_debug} Python tests.................: ${mc_want_twisted_tests} Install unit tests...........: ${installed_tests} Options: Account storage directory....: ${ACCOUNTS_DIR} Crash recovery directory.....: ${ACCOUNTS_CACHE_DIR:-\$XDG_CACHE_HOME} Features: Plugin API documentation.....: ${enable_gtk_doc} Network Manager integration..: ${have_nm} ConnMan integration..........: ${have_connman} Connectivity GSetting........: ${enable_conn_setting} Suspend tracking with UPower.: ${have_upower} Aegis........................: ${aegis_enabled} libaccounts-glib backend.....: ${libaccounts_sso_enabled} Hidden accounts-glib accounts: ${with_accounts_glib_hidden_service_type} Nokia Mode Control Entity....: ${HAVE_MCE} " telepathy-mission-control-5.16.4/tests/0000755000175000017500000000000012762352250021163 5ustar00gkiagiagkiagia00000000000000telepathy-mission-control-5.16.4/tests/twisted/0000755000175000017500000000000012762352250022646 5ustar00gkiagiagkiagia00000000000000telepathy-mission-control-5.16.4/tests/twisted/mctest.py0000644000175000017500000014217612735242352024533 0ustar00gkiagiagkiagia00000000000000# python sucks! vim: set fileencoding=utf-8 : # Copyright © 2009–2010 Nokia Corporation # Copyright © 2009–2010 Collabora Ltd. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA # 02110-1301 USA """ Infrastructure code for testing Mission Control """ import base64 import os import sys import constants as cs import servicetest import twisted from twisted.internet import reactor import dbus import dbus.service from fakeaccountsservice import FakeAccountsService from fakeconnectivity import FakeConnectivity def install_colourer(): def red(s): return '\x1b[31m%s\x1b[0m' % s def green(s): return '\x1b[32m%s\x1b[0m' % s patterns = { 'handled': green, 'not handled': red, } class Colourer: def __init__(self, fh, patterns): self.fh = fh self.patterns = patterns def write(self, s): f = self.patterns.get(s, lambda x: x) self.fh.write(f(s)) sys.stdout = Colourer(sys.stdout, patterns) return sys.stdout class MC(dbus.proxies.ProxyObject): def __init__(self, queue, bus, wait_for_names=True, initially_online=True): """ Arguments: queue: an event queue bus: a D-Bus connection wait_for_names: if True, the constructor will wait for MC to have been service-activated before returning. if False, the caller may later call wait_for_names(). initially_online: whether the fake implementations of Network Manager and ConnMan should claim to be online or offline. """ dbus.proxies.ProxyObject.__init__(self, conn=bus, bus_name=cs.MC, object_path=cs.MC_PATH, follow_name_owner_changes=True) self.connectivity = FakeConnectivity(queue, bus, initially_online) self.q = queue self.bus = bus if wait_for_names: self.wait_for_names() def wait_for_names(self, *also_expect): """ Waits for MC to have claimed all its bus names, along with the (optional) EventPatterns passed as arguments. """ patterns = [ servicetest.EventPattern('dbus-signal', signal='NameOwnerChanged', predicate=lambda e, name=name: e.args[0] == name and e.args[2] != '') for name in [cs.AM, cs.CD, cs.MC] if not self.bus.name_has_owner(name)] patterns.extend(also_expect) events = self.q.expect_many(*patterns) return events[3:] def exec_test_deferred (fun, params, protocol=None, timeout=None, preload_mc=True, initially_online=True, use_fake_accounts_service=True, pass_kwargs=False): colourer = None if sys.stdout.isatty(): colourer = install_colourer() queue = servicetest.IteratingEventQueue(timeout) queue.verbose = ( os.environ.get('CHECK_TWISTED_VERBOSE', '') != '' or '-v' in sys.argv) bus = dbus.SessionBus() queue.attach_to_bus(bus) error = None if preload_mc: try: mc = MC(queue, bus, initially_online=initially_online) except Exception, e: import traceback traceback.print_exc() os._exit(1) else: mc = None if use_fake_accounts_service: fake_accounts_service = FakeAccountsService(queue, bus) if preload_mc: queue.expect('dbus-signal', path=cs.TEST_DBUS_ACCOUNT_PLUGIN_PATH, interface=cs.TEST_DBUS_ACCOUNT_PLUGIN_IFACE, signal='Active') else: fake_accounts_service = None if pass_kwargs: kwargs=dict(fake_accounts_service=fake_accounts_service) else: kwargs=dict() try: fun(queue, bus, mc, **kwargs) except Exception, e: import traceback traceback.print_exc() error = e queue.verbose = False # Clean up any accounts which are left over from the test. try: am = AccountManager(bus) am_props = am.Properties.GetAll(cs.AM) for a in (am_props.get('ValidAccounts', []) + am_props.get('InvalidAccounts', [])): account = Account(bus, a) try: account.Properties.Set(cs.ACCOUNT, 'RequestedPresence', (dbus.UInt32(cs.PRESENCE_TYPE_OFFLINE), 'offline', '')) except dbus.DBusException, e: print >> sys.stderr, "Can't set %s offline: %s" % (a, e) try: account.Properties.Set(cs.ACCOUNT, 'Enabled', False) except dbus.DBusException, e: print >> sys.stderr, "Can't disable %s: %s" % (a, e) try: account.Remove() except dbus.DBusException, e: print >> sys.stderr, "Can't remove %s: %s" % (a, e) servicetest.sync_dbus(bus, queue, am) except dbus.DBusException, e: print >> sys.stderr, "Couldn't clean up left-over accounts: %s" % e except Exception, e: import traceback traceback.print_exc() error = e queue.cleanup() if error is None: reactor.callLater(0, reactor.stop) else: # please ignore the POSIX behind the curtain os._exit(1) if colourer: sys.stdout = colourer.fh def exec_test(fun, params=None, protocol=None, timeout=None, preload_mc=True, initially_online=True, use_fake_accounts_service=True, pass_kwargs=False): reactor.callWhenRunning (exec_test_deferred, fun, params, protocol, timeout, preload_mc, initially_online, use_fake_accounts_service, pass_kwargs) reactor.run() class SimulatedConnection(object): def ensure_handle(self, type, identifier): if (type, identifier) in self._handles: return self._handles[(type, identifier)] self._last_handle += 1 self._handles[(type, identifier)] = self._last_handle self._identifiers[(type, self._last_handle)] = identifier return self._last_handle def __init__(self, q, bus, cmname, protocol, account_part, self_ident, self_alias=None, implement_get_interfaces=True, has_requests=True, has_presence=False, has_aliasing=False, has_avatars=False, avatars_persist=True, extra_interfaces=[], has_hidden=False, implement_get_aliases=True, initial_avatar=None, server_delays_avatar=False): self.q = q self.bus = bus if self_alias is None: self_alias = self_ident self.bus_name = '.'.join([cs.tp_name_prefix, 'Connection', cmname, protocol.replace('-', '_'), account_part]) self._bus_name_ref = dbus.service.BusName(self.bus_name, self.bus) self.object_path = '/' + self.bus_name.replace('.', '/') self._last_handle = 41 self._handles = {} self._identifiers = {} self.status = cs.CONN_STATUS_DISCONNECTED self.reason = cs.CONN_STATUS_CONNECTING self.self_ident = self_ident self.self_alias = self_alias self.self_handle = self.ensure_handle(cs.HT_CONTACT, self_ident) self.channels = [] self.has_requests = has_requests self.has_presence = has_presence self.has_aliasing = has_aliasing self.has_avatars = has_avatars self.avatars_persist = avatars_persist self.extra_interfaces = extra_interfaces[:] self.avatar_delayed = server_delays_avatar self.interfaces = [] self.interfaces.append(cs.CONN_IFACE_CONTACTS) if self.has_requests: self.interfaces.append(cs.CONN_IFACE_REQUESTS) if self.has_aliasing: self.interfaces.append(cs.CONN_IFACE_ALIASING) if self.has_avatars: self.interfaces.append(cs.CONN_IFACE_AVATARS) if self.has_presence: self.interfaces.append(cs.CONN_IFACE_SIMPLE_PRESENCE) if self.extra_interfaces: self.interfaces.extend(self.extra_interfaces) if initial_avatar is not None: self.avatar = initial_avatar elif self.avatars_persist: self.avatar = dbus.Struct((dbus.ByteArray('my old avatar'), 'text/plain'), signature='ays') else: self.avatar = None q.add_dbus_method_impl(self.Connect, path=self.object_path, interface=cs.CONN, method='Connect') q.add_dbus_method_impl(self.Disconnect, path=self.object_path, interface=cs.CONN, method='Disconnect') q.add_dbus_method_impl(self.GetSelfHandle, path=self.object_path, interface=cs.CONN, method='GetSelfHandle') q.add_dbus_method_impl(self.GetStatus, path=self.object_path, interface=cs.CONN, method='GetStatus') q.add_dbus_method_impl(self.GetAll_Connection, path=self.object_path, interface=cs.PROPERTIES_IFACE, method='GetAll', args=[cs.CONN]) if implement_get_interfaces: q.add_dbus_method_impl(self.GetInterfaces, path=self.object_path, interface=cs.CONN, method='GetInterfaces') q.add_dbus_method_impl(self.RequestHandles, path=self.object_path, interface=cs.CONN, method='RequestHandles') q.add_dbus_method_impl(self.InspectHandles, path=self.object_path, interface=cs.CONN, method='InspectHandles') q.add_dbus_method_impl(self.HoldHandles, path=self.object_path, interface=cs.CONN, method='HoldHandles') q.add_dbus_method_impl(self.GetAll_Requests, path=self.object_path, interface=cs.PROPERTIES_IFACE, method='GetAll', args=[cs.CONN_IFACE_REQUESTS]) q.add_dbus_method_impl(self.GetContactAttributes, path=self.object_path, interface=cs.CONN_IFACE_CONTACTS, method='GetContactAttributes') q.add_dbus_method_impl(self.GetContactByID, path=self.object_path, interface=cs.CONN_IFACE_CONTACTS, method='GetContactByID') q.add_dbus_method_impl(self.Get_ContactAttributeInterfaces, path=self.object_path, interface=cs.PROPERTIES_IFACE, method='Get', args=[cs.CONN_IFACE_CONTACTS, 'ContactAttributeInterfaces']) q.add_dbus_method_impl(self.GetAll_Contacts, path=self.object_path, interface=cs.PROPERTIES_IFACE, method='GetAll', args=[cs.CONN_IFACE_CONTACTS]) if not has_requests: q.add_dbus_method_impl(self.ListChannels, path=self.object_path, interface=cs.CONN, method='ListChannels') if has_presence: q.add_dbus_method_impl(self.SetPresence, path=self.object_path, interface=cs.CONN_IFACE_SIMPLE_PRESENCE, method='SetPresence') q.add_dbus_method_impl(self.GetPresences, path=self.object_path, interface=cs.CONN_IFACE_SIMPLE_PRESENCE, method='GetPresences') q.add_dbus_method_impl(self.Get_SimplePresenceStatuses, path=self.object_path, interface=cs.PROPERTIES_IFACE, method='Get', args=[cs.CONN_IFACE_SIMPLE_PRESENCE, 'Statuses']) q.add_dbus_method_impl(self.GetAll_SimplePresence, path=self.object_path, interface=cs.PROPERTIES_IFACE, method='GetAll', args=[cs.CONN_IFACE_SIMPLE_PRESENCE]) if has_aliasing: q.add_dbus_method_impl(self.GetAliasFlags, path=self.object_path, interface=cs.CONN_IFACE_ALIASING, method='GetAliasFlags', args=[]) if implement_get_aliases: q.add_dbus_method_impl(self.GetAliases, path=self.object_path, interface=cs.CONN_IFACE_ALIASING, method='GetAliases') if has_avatars: q.add_dbus_method_impl(self.GetAvatarRequirements, path=self.object_path, interface=cs.CONN_IFACE_AVATARS, method='GetAvatarRequirements', args=[]) q.add_dbus_method_impl(self.GetAll_Avatars, path=self.object_path, interface=cs.PROPERTIES_IFACE, method='GetAll', args=[cs.CONN_IFACE_AVATARS]) q.add_dbus_method_impl(self.GetKnownAvatarTokens, path=self.object_path, interface=cs.CONN_IFACE_AVATARS, method='GetKnownAvatarTokens') q.add_dbus_method_impl(self.SetAvatar, path=self.object_path, interface=cs.CONN_IFACE_AVATARS, method='SetAvatar') self.statuses = dbus.Dictionary({ 'available': (cs.PRESENCE_TYPE_AVAILABLE, True, True), 'away': (cs.PRESENCE_TYPE_AWAY, True, True), 'lunch': (cs.PRESENCE_TYPE_XA, True, True), 'busy': (cs.PRESENCE_TYPE_BUSY, True, True), 'phone': (cs.PRESENCE_TYPE_BUSY, True, True), 'offline': (cs.PRESENCE_TYPE_OFFLINE, False, False), 'error': (cs.PRESENCE_TYPE_ERROR, False, False), 'unknown': (cs.PRESENCE_TYPE_UNKNOWN, False, False), }, signature='s(ubb)') if has_hidden: self.statuses['hidden'] = (cs.PRESENCE_TYPE_HIDDEN, True, True) # "dbus.UInt32" to work around # https://bugs.freedesktop.org/show_bug.cgi?id=69967 self.presence = dbus.Struct((dbus.UInt32(cs.PRESENCE_TYPE_OFFLINE), 'offline', ''), signature='uss') def change_self_ident(self, ident): self.self_ident = ident self.self_handle = self.ensure_handle(cs.HT_CONTACT, ident) self.q.dbus_emit(self.object_path, cs.CONN, 'SelfHandleChanged', self.self_handle, signature='u') def change_self_alias(self, alias): self.self_alias = alias self.q.dbus_emit(self.object_path, cs.CONN_IFACE_ALIASING, 'AliasesChanged', [(self.self_handle, self.self_alias)], signature='a(us)') def release_name(self): del self._bus_name_ref def GetAll_Connection(self, e): self.q.dbus_return(e.message, { 'Interfaces': dbus.Array(self.interfaces, signature='s'), 'SelfHandle': dbus.UInt32(self.self_handle), 'Status': dbus.UInt32(self.status), 'HasImmortalHandles': dbus.Boolean(True), }, signature='a{sv}') def forget_avatar(self): self.avatar = (dbus.ByteArray(''), '') self.avatar_delayed = False # not actually very relevant for MC so hard-code 0 for now def GetAliasFlags(self, e): self.q.dbus_return(e.message, 0, signature='u') def GetAliases(self, e): ret = dbus.Dictionary(signature='us') if self.self_handle in e.args[0]: ret[self.self_handle] = self.self_alias self.q.dbus_return(e.message, ret, signature='a{us}') # mostly for the UI's benefit; for now hard-code the requirements from XMPP def GetAvatarRequirements(self, e): self.q.dbus_return(e.message, ['image/jpeg'], 0, 0, 96, 96, 8192, signature='asqqqqu') def GetAll_Avatars(self, e): self.q.dbus_return(e.message, { 'SupportedAvatarMIMETypes': ['image/jpeg'], 'MinimumAvatarWidth': 0, 'RecommendedAvatarWidth': 64, 'MaximumAvatarWidth': 96, 'MinimumAvatarHeight': 0, 'RecommendedAvatarHeight': 64, 'MaximumAvatarHeight': 96, 'MaximumAvatarBytes': 8192, }, signature='a{sv}') def GetKnownAvatarTokens(self, e): ret = dbus.Dictionary(signature='us') # the user has an avatar already, if they persist; nobody else does if self.self_handle in e.args[0]: if self.avatar is None: # GetKnownAvatarTokens has the special case that "where # the avatar does not persist between connections, a CM # should omit the self handle from the returned map until # an avatar is explicitly set or cleared". We'd have been # better off with a more explicit design, but it's too # late now... assert not self.avatars_persist else: # "a CM must always have the tokens for the self handle # if one is set (even if it is set to no avatar)" # so behave as though we'd done a network round-trip to # check what our token was, and found our configured # token if self.avatar_delayed: self.q.dbus_emit(self.object_path, cs.CONN_IFACE_AVATARS, 'AvatarUpdated', self.self_handle, str(self.avatar[0]), signature='us') # we just stringify the avatar as the token # (also, empty avatar => no avatar => empty token) ret[self.self_handle] = str(self.avatar[0]) self.q.dbus_return(e.message, ret, signature='a{us}') def SetAvatar(self, e): self.avatar = dbus.Struct(e.args, signature='ays') self.avatar_delayed = False # we just stringify the avatar as the token self.q.dbus_return(e.message, str(self.avatar[0]), signature='s') self.q.dbus_emit(self.object_path, cs.CONN_IFACE_AVATARS, 'AvatarRetrieved', self.self_handle, str(self.avatar[0]), self.avatar[0], self.avatar[1], signature='usays') def GetPresences(self, e): ret = dbus.Dictionary(signature='u(uss)') contacts = e.args[0] for contact in contacts: if contact == self.self_handle: ret[contact] = self.presence else: # stub - MC doesn't care ret[contact] = dbus.Struct( (cs.PRESENCE_TYPE_UNKNOWN, 'unknown', ''), signature='uss') self.q.dbus_return(e.message, ret, signature='a{u(uss)}') def SetPresence(self, e): if e.args[0] in self.statuses: # "dbus.UInt32" to work around # https://bugs.freedesktop.org/show_bug.cgi?id=69967 presence = dbus.Struct((dbus.UInt32(self.statuses[e.args[0]][0]), e.args[0], e.args[1]), signature='uss') old_presence = self.presence if presence != old_presence: self.presence = presence self.q.dbus_emit(self.object_path, cs.CONN_IFACE_SIMPLE_PRESENCE, 'PresencesChanged', { self.self_handle : presence }, signature='a{u(uss)}') self.q.dbus_return(e.message, signature='') else: self.q.dbus_raise(cs.INVALID_ARGUMENT, 'Unknown status') def Get_SimplePresenceStatuses(self, e): self.q.dbus_return(e.message, self.statuses, signature='v') def GetAll_SimplePresence(self, e): self.q.dbus_return(e.message, {'Statuses': self.statuses}, signature='a{sv}') def GetInterfaces(self, e): self.q.dbus_return(e.message, self.interfaces, signature='as') def Connect(self, e): self.StatusChanged(cs.CONN_STATUS_CONNECTING, cs.CONN_STATUS_REASON_REQUESTED) self.q.dbus_return(e.message, signature='') def Disconnect(self, e): self.StatusChanged(cs.CONN_STATUS_DISCONNECTED, cs.CONN_STATUS_REASON_REQUESTED) self.q.dbus_return(e.message, signature='') for c in self.channels: c.close() def inspect_handles(self, handles, htype=cs.HT_CONTACT): ret = [] for h in handles: if (htype, h) in self._identifiers: ret.append(self._identifiers[(htype, h)]) else: raise Exception(h) return ret def InspectHandles(self, e): htype, hs = e.args try: ret = self.inspect_handles(hs, htype) self.q.dbus_return(e.message, ret, signature='as') except e: self.q.dbus_raise(e.message, INVALID_HANDLE, str(e.args[0])) def RequestHandles(self, e): htype, idents = e.args self.q.dbus_return(e.message, [self.ensure_handle(htype, i) for i in idents], signature='au') def GetStatus(self, e): self.q.dbus_return(e.message, self.status, signature='u') def ConnectionError(self, error, details): self.q.dbus_emit(self.object_path, cs.CONN, 'ConnectionError', error, details, signature='sa{sv}') def StatusChanged(self, status, reason): self.status = status self.reason = reason self.q.dbus_emit(self.object_path, cs.CONN, 'StatusChanged', status, reason, signature='uu') if self.status == cs.CONN_STATUS_CONNECTED and self.has_presence: if self.presence[0] == cs.PRESENCE_TYPE_OFFLINE: # "dbus.UInt32" to work around # https://bugs.freedesktop.org/show_bug.cgi?id=69967 self.presence = dbus.Struct(( dbus.UInt32(cs.PRESENCE_TYPE_AVAILABLE), 'available', ''), signature='uss') self.q.dbus_emit(self.object_path, cs.CONN_IFACE_SIMPLE_PRESENCE, 'PresencesChanged', { self.self_handle : self.presence }, signature='a{u(uss)}') def ListChannels(self, e): arr = dbus.Array(signature='(osuu)') for c in self.channels: arr.append(dbus.Struct( (c.object_path, c.immutable[cs.CHANNEL + '.ChannelType'], c.immutable.get(cs.CHANNEL + '.TargetHandleType', 0), c.immutable.get(cs.CHANNEL + '.TargetHandle', 0) ), signature='osuu')) self.q.dbus_return(e.message, arr, signature='a(osuu)') def get_channel_details(self): return dbus.Array([(c.object_path, c.immutable) for c in self.channels], signature='(oa{sv})') def GetAll_Requests(self, e): if self.has_requests: self.q.dbus_return(e.message, { 'Channels': self.get_channel_details(), }, signature='a{sv}') else: self.q.dbus_raise(e.message, cs.NOT_IMPLEMENTED, 'no Requests') def GetSelfHandle(self, e): self.q.dbus_return(e.message, self.self_handle, signature='u') def HoldHandles(self, e): # do nothing self.q.dbus_return(e.message, signature='') def NewChannels(self, channels): for channel in channels: assert not channel.announced channel.announced = True self.channels.append(channel) self.q.dbus_emit(self.object_path, cs.CONN, 'NewChannel', channel.object_path, channel.immutable[cs.CHANNEL + '.ChannelType'], channel.immutable.get(cs.CHANNEL + '.TargetHandleType', 0), channel.immutable.get(cs.CHANNEL + '.TargetHandle', 0), channel.immutable.get(cs.CHANNEL + '.Requested', False), signature='osuub') if self.has_requests: self.q.dbus_emit(self.object_path, cs.CONN_IFACE_REQUESTS, 'NewChannels', [(channel.object_path, channel.immutable) for channel in channels], signature='a(oa{sv})') def get_contact_attributes(self, h, ifaces): id = self.inspect_handles([h])[0] ifaces = set(ifaces).intersection( self.get_contact_attribute_interfaces()) ret = dbus.Dictionary({}, signature='sv') ret[cs.ATTR_CONTACT_ID] = id if cs.CONN_IFACE_ALIASING in ifaces: if h == self.self_handle: ret[cs.ATTR_ALIAS] = self.self_alias else: ret[cs.ATTR_ALIAS] = id if cs.CONN_IFACE_AVATARS in ifaces: if h == self.self_handle: if self.avatar is not None and not self.avatar_delayed: # We just stringify the avatar as the token # (also, empty avatar => no avatar => empty token). # This doesn't have the same special case that # GetKnownAvatarTokens does - if we don't know the # token yet, we don't wait. ret[cs.ATTR_AVATAR_TOKEN] = str(self.avatar[0]) if cs.CONN_IFACE_SIMPLE_PRESENCE in ifaces: if h == self.self_handle: ret[cs.ATTR_PRESENCE] = self.presence else: # stub - MC doesn't care # "dbus.UInt32" to work around # https://bugs.freedesktop.org/show_bug.cgi?id=69967 ret[cs.ATTR_PRESENCE] = (dbus.UInt32(cs.PRESENCE_UNKNOWN), 'unknown', '') return ret def get_contact_attribute_interfaces(self): return set(self.interfaces).intersection(set([ cs.CONN_IFACE_ALIASING, cs.CONN_IFACE_AVATARS, cs.CONN_IFACE_SIMPLE_PRESENCE, ])) def GetContactAttributes(self, e): ret = dbus.Dictionary({}, signature='ua{sv}') try: for h in e.args[0]: ret[dbus.UInt32(h)] = self.get_contact_attributes(h, e.args[1]) self.q.dbus_return(e.message, ret, signature='a{ua{sv}}') except e: self.q.dbus_raise(e.message, INVALID_HANDLE, str(e.args[0])) def GetContactByID(self, e): h = self.ensure_handle(e.args[0]) self.q.dbus_return(e.message, h, self.get_contact_attributes(h, e.args[1]), signature='ua{sv}') def GetAll_Contacts(self, e): self.q.dbus_return(e.message, { 'ContactAttributeInterfaces': self.get_contact_attribute_interfaces(), }, signature='a{sv}') def Get_ContactAttributeInterfaces(self, e): self.q.dbus_return(e.message, dbus.Array(self.get_contact_attribute_interfaces(), signature='s'), signature='v') class SimulatedChannel(object): def __init__(self, conn, immutable, mutable={}, destroyable=False, group=False): self.conn = conn self.q = conn.q self.bus = conn.bus self.object_path = conn.object_path + ('/_%x' % id(self)) self.immutable = immutable self.properties = dbus.Dictionary({}, signature='sv') self.properties.update(immutable) self.properties.update(mutable) self.q.add_dbus_method_impl(self.GetAll, path=self.object_path, interface=cs.PROPERTIES_IFACE, method='GetAll') self.q.add_dbus_method_impl(self.Get, path=self.object_path, interface=cs.PROPERTIES_IFACE, method='Get') self.q.add_dbus_method_impl(self.Close, path=self.object_path, interface=cs.CHANNEL, method='Close') self.q.add_dbus_method_impl(self.GetInterfaces, path=self.object_path, interface=cs.CHANNEL, method='GetInterfaces') if destroyable: self.q.add_dbus_method_impl(self.Close, path=self.object_path, interface=cs.CHANNEL_IFACE_DESTROYABLE, method='Destroy') if group: self.q.add_dbus_method_impl(self.GetGroupFlags, path=self.object_path, interface=cs.CHANNEL_IFACE_GROUP, method='GetGroupFlags') self.q.add_dbus_method_impl(self.GetSelfHandle, path=self.object_path, interface=cs.CHANNEL_IFACE_GROUP, method='GetSelfHandle') self.q.add_dbus_method_impl(self.GetAllMembers, path=self.object_path, interface=cs.CHANNEL_IFACE_GROUP, method='GetAllMembers') self.q.add_dbus_method_impl(self.GetLocalPendingMembersWithInfo, path=self.object_path, interface=cs.CHANNEL_IFACE_GROUP, method='GetLocalPendingMembersWithInfo') self.properties[cs.CHANNEL_IFACE_GROUP + '.SelfHandle'] \ = self.conn.self_handle self.announced = False self.closed = False def GetGroupFlags(self, e): self.q.dbus_return(e.message, 0, signature='u') def GetSelfHandle(self, e): self.q.dbus_return(e.message, self.properties[cs.CHANNEL_IFACE_GROUP + '.SelfHandle'], signature='u') def GetAllMembers(self, e): # stub self.q.dbus_return(e.message, [self.properties[cs.CHANNEL_IFACE_GROUP + '.SelfHandle']], [], [], signature='auauau') def GetLocalPendingMembersWithInfo(self, e): # stub self.q.dbus_return(e.message, [], signature='a(uuus)') def announce(self): self.conn.NewChannels([self]) def Close(self, e): if not self.closed: self.close() self.q.dbus_return(e.message, signature='') def close(self): assert self.announced assert not self.closed self.closed = True self.conn.channels.remove(self) self.q.dbus_emit(self.object_path, cs.CHANNEL, 'Closed', signature='') self.q.dbus_emit(self.conn.object_path, cs.CONN_IFACE_REQUESTS, 'ChannelClosed', self.object_path, signature='o') def GetInterfaces(self, e): self.q.dbus_return(e.message, self.properties[cs.CHANNEL + '.Interfaces'], signature='as') def GetAll(self, e): iface = e.args[0] + '.' ret = dbus.Dictionary({}, signature='sv') for k in self.properties: if k.startswith(iface): tail = k[len(iface):] if '.' not in tail: ret[tail] = self.properties[k] assert ret # die on attempts to get unimplemented interfaces self.q.dbus_return(e.message, ret, signature='a{sv}') def Get(self, e): prop = e.args[0] + '.' + e.args[1] self.q.dbus_return(e.message, self.properties[prop], signature='v') def aasv(x): return dbus.Array([dbus.Dictionary(d, signature='sv') for d in x], signature='a{sv}') class SimulatedClient(object): def __init__(self, q, bus, clientname, observe=[], approve=[], handle=[], cap_tokens=[], bypass_approval=False, wants_recovery=False, request_notification=True, implement_get_interfaces=True, is_handler=None, bypass_observers=False, delay_approvers=False): self.q = q self.bus = bus self.bus_name = '.'.join([cs.tp_name_prefix, 'Client', clientname]) self._bus_name_ref = dbus.service.BusName(self.bus_name, self.bus) self.object_path = '/' + self.bus_name.replace('.', '/') self.observe = aasv(observe) self.approve = aasv(approve) self.handle = aasv(handle) self.bypass_approval = bool(bypass_approval) self.bypass_observers = bool(bypass_observers) self.delay_approvers = bool(delay_approvers) self.wants_recovery = bool(wants_recovery) self.request_notification = bool(request_notification) self.handled_channels = dbus.Array([], signature='o') self.cap_tokens = dbus.Array(cap_tokens, signature='s') self.is_handler = is_handler if self.is_handler is None: self.is_handler = bool(handle) if implement_get_interfaces: q.add_dbus_method_impl(self.Get_Interfaces, path=self.object_path, interface=cs.PROPERTIES_IFACE, method='Get', args=[cs.CLIENT, 'Interfaces']) q.add_dbus_method_impl(self.GetAll_Client, path=self.object_path, interface=cs.PROPERTIES_IFACE, method='GetAll', args=[cs.CLIENT]) q.add_dbus_method_impl(self.Get_ObserverChannelFilter, path=self.object_path, interface=cs.PROPERTIES_IFACE, method='Get', args=[cs.OBSERVER, 'ObserverChannelFilter']) q.add_dbus_method_impl(self.GetAll_Observer, path=self.object_path, interface=cs.PROPERTIES_IFACE, method='GetAll', args=[cs.OBSERVER]) q.add_dbus_method_impl(self.Get_ApproverChannelFilter, path=self.object_path, interface=cs.PROPERTIES_IFACE, method='Get', args=[cs.APPROVER, 'ApproverChannelFilter']) q.add_dbus_method_impl(self.GetAll_Approver, path=self.object_path, interface=cs.PROPERTIES_IFACE, method='GetAll', args=[cs.APPROVER]) q.add_dbus_method_impl(self.Get_HandlerChannelFilter, path=self.object_path, interface=cs.PROPERTIES_IFACE, method='Get', args=[cs.HANDLER, 'HandlerChannelFilter']) q.add_dbus_method_impl(self.Get_Capabilities, path=self.object_path, interface=cs.PROPERTIES_IFACE, method='Get', args=[cs.HANDLER, 'Capabilities']) q.add_dbus_method_impl(self.Get_HandledChannels, path=self.object_path, interface=cs.PROPERTIES_IFACE, method='Get', args=[cs.HANDLER, 'HandledChannels']) q.add_dbus_method_impl(self.Get_BypassApproval, path=self.object_path, interface=cs.PROPERTIES_IFACE, method='Get', args=[cs.HANDLER, 'BypassApproval']) q.add_dbus_method_impl(self.Get_Recover, path=self.object_path, interface=cs.PROPERTIES_IFACE, method='Get', args=[cs.OBSERVER, 'Recover']) q.add_dbus_method_impl(self.GetAll_Handler, path=self.object_path, interface=cs.PROPERTIES_IFACE, method='GetAll', args=[cs.HANDLER]) def release_name(self): del self._bus_name_ref def reacquire_name(self): self._bus_name_ref = dbus.service.BusName(self.bus_name, self.bus) def get_interfaces(self): ret = dbus.Array([], signature='s', variant_level=1) if self.observe: ret.append(cs.OBSERVER) if self.approve: ret.append(cs.APPROVER) if self.is_handler: ret.append(cs.HANDLER) if self.request_notification: ret.append(cs.CLIENT_IFACE_REQUESTS) return ret def Get_Interfaces(self, e): self.q.dbus_return(e.message, self.get_interfaces(), signature='v', bus=self.bus) def GetAll_Client(self, e): self.q.dbus_return(e.message, {'Interfaces': self.get_interfaces()}, signature='a{sv}', bus=self.bus) def GetAll_Observer(self, e): assert self.observe self.q.dbus_return(e.message, { 'ObserverChannelFilter': self.observe, 'Recover': dbus.Boolean(self.wants_recovery), 'DelayApprovers': dbus.Boolean(self.delay_approvers), }, signature='a{sv}', bus=self.bus) def Get_ObserverChannelFilter(self, e): assert self.observe self.q.dbus_return(e.message, self.observe, signature='v', bus=self.bus) def GetAll_Approver(self, e): assert self.approve self.q.dbus_return(e.message, {'ApproverChannelFilter': self.approve}, signature='a{sv}', bus=self.bus) def Get_ApproverChannelFilter(self, e): assert self.approve self.q.dbus_return(e.message, self.approve, signature='v', bus=self.bus) def GetAll_Handler(self, e): assert self.is_handler self.q.dbus_return(e.message, { 'HandlerChannelFilter': self.handle, 'BypassApproval': self.bypass_approval, 'BypassObservers': self.bypass_observers, 'HandledChannels': self.handled_channels, 'Capabilities': self.cap_tokens, }, signature='a{sv}', bus=self.bus) def Get_Capabilities(self, e): self.q.dbus_return(e.message, self.cap_tokens, signature='v', bus=self.bus) def Get_HandledChannels(self, e): self.q.dbus_return(e.message, self.handled_channels, signature='v', bus=self.bus) def Get_HandlerChannelFilter(self, e): assert self.handle self.q.dbus_return(e.message, self.handle, signature='v', bus=self.bus) def Get_BypassApproval(self, e): assert self.handle self.q.dbus_return(e.message, self.bypass_approval, signature='v', bus=self.bus) def Get_BypassApproval(self, e): assert self.handle self.q.dbus_return(e.message, self.bypass_observers, signature='v', bus=self.bus) def Get_Recover(self, e): assert self.handle self.q.dbus_return(e.message, self.recover, signature='v', bus=self.bus) def take_fakecm_name(bus): return dbus.service.BusName(cs.CM + '.fakecm', bus=bus) def create_fakecm_account(q, bus, mc, params, properties={}, cm_bus=None): """Create a fake connection manager and an account that uses it. Optional keyword arguments: properties -- a dictionary from qualified property names to values to pass to CreateAccount. If provided, this function will check that the newly-created account has these properties. cm_bus -- if not None, a BusConnection via which to claim the CM's name. If None, 'bus' will be used. Returns: (a BusName for the fake CM, an Account proxy)""" if cm_bus is None: cm_bus = bus cm_name_ref = take_fakecm_name(cm_bus) account_manager = AccountManager(bus) servicetest.call_async(q, account_manager, 'CreateAccount', 'fakecm', 'fakeprotocol', 'fakeaccount', params, properties) # Check whether the account being created is to be hidden; if so, then # expect a different signal. It annoys me that this has to be in here, but, # eh. if properties.get(cs.ACCOUNT_IFACE_HIDDEN + '.Hidden', False): validity_changed_pattern = servicetest.EventPattern('dbus-signal', path=cs.AM_PATH, signal='HiddenAccountValidityChanged', interface=cs.AM_IFACE_HIDDEN) else: validity_changed_pattern = servicetest.EventPattern('dbus-signal', path=cs.AM_PATH, signal='AccountValidityChanged', interface=cs.AM) # The spec has no order guarantee here. # FIXME: MC ought to also introspect the CM and find out that the params # are in fact sufficient a_signal, am_signal, ret = q.expect_many( servicetest.EventPattern('dbus-signal', signal='AccountPropertyChanged', interface=cs.ACCOUNT, predicate=(lambda e: 'Valid' in e.args[0])), validity_changed_pattern, servicetest.EventPattern('dbus-return', method='CreateAccount'), ) account_path = ret.value[0] assert am_signal.args == [account_path, True], am_signal.args assert a_signal.args[0]['Valid'] == True, a_signal.args assert account_path is not None account = Account(bus, account_path) for key, value in properties.iteritems(): interface, prop = key.rsplit('.', 1) servicetest.assertEquals(value, account.Properties.Get(interface, prop)) return (cm_name_ref, account) def get_fakecm_account(bus, mc, account_path): account = Account(bus, account_path) # Introspect Account for debugging purpose account_introspected = account.Introspect( dbus_interface=cs.INTROSPECTABLE_IFACE) #print account_introspected return account def enable_fakecm_account(q, bus, mc, account, expected_params, **kwargs): # I'm too lazy to manually pass all the other kwargs to # expect_fakecm_connection try: requested_presence = kwargs['requested_presence'] del kwargs['requested_presence'] except KeyError: requested_presence = (2, 'available', '') # Enable the account account.Properties.Set(cs.ACCOUNT, 'Enabled', True) if requested_presence is not None: requested_presence = dbus.Struct( (dbus.UInt32(requested_presence[0]),) + tuple(requested_presence[1:]), signature='uss') account.Properties.Set(cs.ACCOUNT, 'RequestedPresence', requested_presence) return expect_fakecm_connection(q, bus, mc, account, expected_params, **kwargs) def expect_fakecm_connection(q, bus, mc, account, expected_params, has_requests=True, has_presence=False, has_aliasing=False, has_avatars=False, avatars_persist=True, extra_interfaces=[], expect_before_connect=(), expect_after_connect=(), has_hidden=False, self_ident='myself'): # make (safely) mutable copies expect_before_connect = list(expect_before_connect) expect_after_connect = list(expect_after_connect) e = q.expect('dbus-method-call', method='RequestConnection', args=['fakeprotocol', expected_params], destination=cs.tp_name_prefix + '.ConnectionManager.fakecm', path=cs.tp_path_prefix + '/ConnectionManager/fakecm', interface=cs.tp_name_prefix + '.ConnectionManager', handled=False) conn = SimulatedConnection(q, bus, 'fakecm', 'fakeprotocol', account.object_path.split('/')[-1], self_ident, has_requests=has_requests, has_presence=has_presence, has_aliasing=has_aliasing, has_avatars=has_avatars, avatars_persist=avatars_persist, extra_interfaces=extra_interfaces, has_hidden=has_hidden) q.dbus_return(e.message, conn.bus_name, conn.object_path, signature='so') if has_requests: expect_before_connect.append( servicetest.EventPattern('dbus-method-call', interface=cs.PROPERTIES_IFACE, method='GetAll', args=[cs.CONN_IFACE_REQUESTS], path=conn.object_path, handled=True)) if expect_before_connect: events = list(q.expect_many(*expect_before_connect)) if has_requests: del events[-1] else: events = [] q.expect('dbus-method-call', method='Connect', path=conn.object_path, handled=True) conn.StatusChanged(cs.CONN_STATUS_CONNECTED, cs.CONN_STATUS_REASON_NONE) expect_after_connect = list(expect_after_connect) if not has_requests: expect_after_connect.append( servicetest.EventPattern('dbus-method-call', interface=cs.CONN, method='ListChannels', args=[], path=conn.object_path, handled=True)) events = events + list(q.expect_many(*expect_after_connect)) if not has_requests: del events[-1] if events: return (conn,) + tuple(events) return conn def expect_client_setup(q, clients, got_interfaces_already=False): patterns = [] def is_client_setup(e): if e.method == 'Get' and e.args == [cs.CLIENT, 'Interfaces']: return True if e.method == 'GetAll' and e.args == [cs.CLIENT]: return True return False def is_approver_setup(e): if e.method == 'Get' and \ e.args == [cs.APPROVER, 'ApproverChannelFilter']: return True if e.method == 'GetAll' and e.args == [cs.APPROVER]: return True return False def is_observer_setup(e): if e.method == 'Get' and \ e.args == [cs.OBSERVER, 'ObserverChannelFilter']: return True if e.method == 'GetAll' and e.args == [cs.OBSERVER]: return True return False def is_handler_setup(e): if e.method == 'Get' and \ e.args == [cs.HANDLER, 'HandlerChannelFilter']: return True if e.method == 'GetAll' and e.args == [cs.HANDLER]: return True return False for client in clients: if not got_interfaces_already: patterns.append(servicetest.EventPattern('dbus-method-call', interface=cs.PROPERTIES_IFACE, path=client.object_path, handled=True, predicate=is_client_setup)) if client.observe: patterns.append(servicetest.EventPattern('dbus-method-call', interface=cs.PROPERTIES_IFACE, path=client.object_path, handled=True, predicate=is_observer_setup)) if client.approve: patterns.append(servicetest.EventPattern('dbus-method-call', interface=cs.PROPERTIES_IFACE, path=client.object_path, handled=True, predicate=is_approver_setup)) if client.handle: patterns.append(servicetest.EventPattern('dbus-method-call', interface=cs.PROPERTIES_IFACE, path=client.object_path, predicate=is_handler_setup)) q.expect_many(*patterns) def get_account_manager(bus): """ A backwards-compatibility synonym for constructing a new AccountManager object. Please don't use this in new tests. """ return AccountManager(bus) class AccountManager(servicetest.ProxyWrapper): def __init__(self, bus): bare_am = bus.get_object(cs.AM, cs.AM_PATH, follow_name_owner_changes=True) servicetest.ProxyWrapper.__init__(self, bare_am, cs.AM, {}) class Account(servicetest.ProxyWrapper): def __init__(self, bus, account_path): servicetest.ProxyWrapper.__init__(self, bus.get_object(cs.AM, account_path), cs.ACCOUNT, {}) class ChannelDispatcher(servicetest.ProxyWrapper): def __init__(self, bus): bare_cd = bus.get_object(cs.CD, cs.CD_PATH, follow_name_owner_changes=True) servicetest.ProxyWrapper.__init__(self, bare_cd, cs.CD, {}) class ChannelDispatchOperation(servicetest.ProxyWrapper): def __init__(self, bus, path): bare_cdo = bus.get_object(cs.CD, path) servicetest.ProxyWrapper.__init__(self, bare_cdo, cs.CDO, {}) class ChannelRequest(servicetest.ProxyWrapper): def __init__(self, bus, path): bare_cr = bus.get_object(cs.CD, path) servicetest.ProxyWrapper.__init__(self, bare_cr, cs.CR, {}) def connect_to_mc(q, bus, mc): account_manager = AccountManager(bus) # Introspect AccountManager for debugging purpose account_manager_introspected = account_manager.Introspect( dbus_interface=cs.INTROSPECTABLE_IFACE) #print account_manager_introspected # Check AccountManager has D-Bus property interface properties = account_manager.Properties.GetAll(cs.AM) assert properties is not None interfaces = properties.get('Interfaces') return account_manager, properties, interfaces def tell_mc_to_die(q, bus): """Instructs the running Mission Control to die via a magic method call in the version built for tests.""" secret_debug_api = dbus.Interface(bus.get_object(cs.AM, "/"), 'org.freedesktop.Telepathy.MissionControl5.RegressionTests') secret_debug_api.Abort() # Make sure MC exits q.expect('dbus-signal', signal='NameOwnerChanged', predicate=(lambda e: e.args[0] == 'org.freedesktop.Telepathy.AccountManager' and e.args[2] == '')) def resuscitate_mc(q, bus, mc): """Having killed MC with tell_mc_to_die(), this function revives it.""" # We kick the daemon asynchronously because nm-glib makes blocking calls # back to us during initialization... bus.call_async(dbus.BUS_DAEMON_NAME, dbus.BUS_DAEMON_PATH, dbus.BUS_DAEMON_IFACE, 'StartServiceByName', 'su', (cs.MC, 0), reply_handler=None, error_handler=None) # Wait until it's up mc.wait_for_names() return connect_to_mc(q, bus, mc) def keyfile_read(fname): groups = { None: {} } group = None for line in open(fname): line = line[:-1].decode('utf-8').strip() if not line or line.startswith('#'): continue if line.startswith('[') and line.endswith(']'): group = line[1:-1] groups[group] = {} continue if '=' in line: k, v = line.split('=', 1) else: k = line v = None groups[group][k] = v return groups def read_account_keyfile(): """Reads the keyfile used by the 'diverted' storage plugin used by most of the tests.""" key_file_name = os.path.join(os.getenv('XDG_CACHE_HOME'), 'mcp-test-diverted-account-plugin.conf') return keyfile_read(key_file_name) telepathy-mission-control-5.16.4/tests/twisted/account/0000755000175000017500000000000012762352250024302 5ustar00gkiagiagkiagia00000000000000telepathy-mission-control-5.16.4/tests/twisted/account/addressing.py0000755000175000017500000000776212735242352027017 0ustar00gkiagiagkiagia00000000000000# Copyright (C) 2010 Nokia Corporation # Copyright (C) 2010 Collabora Ltd. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA # 02110-1301 USA import dbus import dbus import dbus.service from servicetest import unwrap, assertContains, assertEquals, assertSameSets from mctest import exec_test, create_fakecm_account import constants as cs def get_schemes(props): return unwrap (props.Get (cs.ACCOUNT_IFACE_ADDRESSING, 'URISchemes')) def test(q, bus, mc): params = dbus.Dictionary ({"account": "jc.denton@example.com", "password": "ionstorm"}, signature='sv') (cm_name_ref, account) = create_fakecm_account (q, bus, mc, params) account_iface = dbus.Interface (account, cs.ACCOUNT) account_props = dbus.Interface (account, cs.PROPERTIES_IFACE) address_iface = dbus.Interface (account, cs.ACCOUNT_IFACE_ADDRESSING) uri_schemes = get_schemes (account_props) # initial URI scheme list is empty assertEquals (uri_schemes, []) # remove URI from empty list: address_iface.SetURISchemeAssociation ('mailto', False) uri_schemes = get_schemes (account_props) assertEquals (uri_schemes, []) # add association to empty list address_iface.SetURISchemeAssociation ('mailto', True) uri_schemes = get_schemes (account_props) assertEquals (uri_schemes, ['mailto']) # add association to list where it already resides address_iface.SetURISchemeAssociation ('mailto', True) uri_schemes = get_schemes (account_props) assertEquals (uri_schemes, ['mailto']) q.expect('dbus-signal', signal='PropertiesChanged', predicate=(lambda e: e.args[0] == cs.ACCOUNT_IFACE_ADDRESSING and set(e.args[1]['URISchemes']) == set(['mailto']))) # add a second association address_iface.SetURISchemeAssociation ('telnet', True) uri_schemes = get_schemes (account_props) assertSameSets (['mailto','telnet',], uri_schemes) q.expect('dbus-signal', signal='PropertiesChanged', predicate=(lambda e: e.args[0] == cs.ACCOUNT_IFACE_ADDRESSING and set(e.args[1]['URISchemes']) == set(['telnet', 'mailto']))) # remove associations to produce empty list address_iface.SetURISchemeAssociation ('mailto', False) address_iface.SetURISchemeAssociation ('telnet', False) uri_schemes = get_schemes (account_props) assertEquals (uri_schemes, []) # extend list to 3 schemes, with some redundant additions: address_iface.SetURISchemeAssociation ('scheme-a', True) address_iface.SetURISchemeAssociation ('scheme-b', True) address_iface.SetURISchemeAssociation ('scheme-c', True) address_iface.SetURISchemeAssociation ('scheme-a', True) address_iface.SetURISchemeAssociation ('scheme-c', True) uri_schemes = get_schemes (account_props) assertSameSets (['scheme-a','scheme-b','scheme-c'], uri_schemes) # remove a scheme that's not there from a non-empty list address_iface.SetURISchemeAssociation ('scheme-d', False) uri_schemes = get_schemes (account_props) assertSameSets (['scheme-a','scheme-b','scheme-c'], uri_schemes) # remove one that is there: address_iface.SetURISchemeAssociation ('scheme-b', False) uri_schemes = get_schemes (account_props) assertSameSets (['scheme-a','scheme-c'], uri_schemes) if __name__ == '__main__': exec_test(test, {}) telepathy-mission-control-5.16.4/tests/twisted/tools/0000755000175000017500000000000012762352250024006 5ustar00gkiagiagkiagia00000000000000telepathy-mission-control-5.16.4/tests/twisted/tools/exec-with-log.sh.in0000644000175000017500000000524412735241312027424 0ustar00gkiagiagkiagia00000000000000#!/bin/sh # Copyright (C) 2009 Nokia Corporation # Copyright (C) 2009 Collabora Ltd. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA # 02110-1301 USA G_MESSAGES_DEBUG=all export G_MESSAGES_DEBUG ulimit -c unlimited if test -z "$MC_TEST_CURDIR"; then echo "MC_TEST_CURDIR must be set" exit 1 fi cd "${MC_TEST_CURDIR}" || exit 1 if test -z "$MC_TEST_LOG_DIR"; then echo "MC_TEST_LOG_DIR must be set" exit 1 fi exec > ${MC_TEST_LOG_DIR}/missioncontrol-$$.log 2>&1 ln -f ${MC_TEST_LOG_DIR}/missioncontrol-$$.log missioncontrol.log if test -n "$MISSIONCONTROL_TEST_VALGRIND"; then G_DEBUG="$G_DEBUG,gc-friendly" export G_DEBUG G_SLICE=always-malloc export G_SLICE MISSIONCONTROL_WRAPPER="valgrind --leak-check=full --num-callers=20" MISSIONCONTROL_WRAPPER="$MISSIONCONTROL_WRAPPER --track-origins=yes" MISSIONCONTROL_WRAPPER="$MISSIONCONTROL_WRAPPER -v" MISSIONCONTROL_WRAPPER="$MISSIONCONTROL_WRAPPER --suppressions=@abs_top_srcdir@/tests/twisted/tools/valgrind.supp" MISSIONCONTROL_WRAPPER="$MISSIONCONTROL_WRAPPER --gen-suppressions=all" MISSIONCONTROL_WRAPPER="$MISSIONCONTROL_WRAPPER --show-reachable=yes" elif test -n "$MISSIONCONTROL_TEST_REFDBG"; then if test -z "$REFDBG_OPTIONS" ; then REFDBG_OPTIONS="btnum=10" export REFDBG_OPTIONS fi if test -z "$MISSIONCONTROL_WRAPPER" ; then MISSIONCONTROL_WRAPPER="refdbg" fi elif test -n "$MISSIONCONTROL_TEST_BACKTRACE"; then MISSIONCONTROL_WRAPPER="gdb -x @abs_top_srcdir@/tools/run_and_bt.gdb" fi # The bus-daemon that is activating us doesn't know it's also the system bus DBUS_SYSTEM_BUS_ADDRESS="$DBUS_SESSION_BUS_ADDRESS" export DBUS_SYSTEM_BUS_ADDRESS if test "z$MC_EXECUTABLE" = z; then MC_EXECUTABLE=@abs_top_builddir@/tests/twisted/mc-debug-server fi GSETTINGS_SCHEMA_DIR=@abs_top_builddir@/data export GSETTINGS_SCHEMA_DIR exec @abs_top_builddir@/libtool --mode=execute \ $MISSIONCONTROL_WRAPPER \ $MC_EXECUTABLE telepathy-mission-control-5.16.4/tests/twisted/tools/servicedir-installed/0000755000175000017500000000000012762352250030122 5ustar00gkiagiagkiagia00000000000000telepathy-mission-control-5.16.4/tests/twisted/tools/servicedir-installed/Client.Logger.service.in0000644000175000017500000000023512735241312034541 0ustar00gkiagiagkiagia00000000000000[D-BUS Service] Name=org.freedesktop.Telepathy.Client.Logger Exec=/bin/sh @mctestsdir@/twisted/tools/fake-startup.sh org.freedesktop.Telepathy.Client.Logger telepathy-mission-control-5.16.4/tests/twisted/tools/servicedir-installed/Client.AbiWord.service.in0000644000175000017500000000023712735241312034653 0ustar00gkiagiagkiagia00000000000000[D-BUS Service] Name=org.freedesktop.Telepathy.Client.AbiWord Exec=/bin/sh @mctestsdir@/twisted/tools/fake-startup.sh org.freedesktop.Telepathy.Client.AbiWord telepathy-mission-control-5.16.4/tests/twisted/tools/servicedir-installed/MissionControl5.service.in0000644000175000017500000000015112735241312035151 0ustar00gkiagiagkiagia00000000000000[D-BUS Service] Name=org.freedesktop.Telepathy.MissionControl5 Exec=@mctestsdir@/twisted/tools/run-mc.sh telepathy-mission-control-5.16.4/tests/twisted/tools/servicedir-installed/tmp-session-bus.conf.in0000644000175000017500000000163112735241312034443 0ustar00gkiagiagkiagia00000000000000 session unix:tmpdir=/tmp @mctestsdir@/twisted/tools/servicedir-installed telepathy-mission-control-5.16.4/tests/twisted/tools/run-mc.sh.in0000755000175000017500000000120612735241312026146 0ustar00gkiagiagkiagia00000000000000#!/bin/sh G_MESSAGES_DEBUG=all export G_MESSAGES_DEBUG ulimit -c unlimited if test -z "$MC_TEST_LOG_DIR"; then echo "MC_TEST_LOG_DIR must be set" exit 1 fi if test -z "$MC_TEST_CURDIR"; then echo "MC_TEST_CURDIR must be set" exit 1 fi cd "${MC_TEST_CURDIR}" || exit 1 exec > ${MC_TEST_LOG_DIR}/missioncontrol-$$.log 2>&1 ln -f ${MC_TEST_LOG_DIR}/missioncontrol-$$.log missioncontrol.log # Our fake session bus is also a fake system bus, but it doesn't know that # when it service-activates us DBUS_SYSTEM_BUS_ADDRESS="$DBUS_SESSION_BUS_ADDRESS" export DBUS_SYSTEM_BUS_ADDRESS @libexecdir@/mission-control-5 telepathy-mission-control-5.16.4/tests/twisted/tools/Makefile.am0000644000175000017500000000624312735242352026050 0ustar00gkiagiagkiagia00000000000000if ENABLE_INSTALLED_TESTS twistedtestsdir = @mctestsdir@/twisted/tools nobase_nodist_twistedtests_SCRIPTS = \ run-mc.sh \ fake-startup.sh \ $(NULL) nobase_dist_twistedtests_SCRIPTS = \ with-session-bus.sh \ $(NULL) nobase_nodist_twistedtests_DATA = \ $(installed_conf_files) \ $(installed_service_files) \ $(NULL) endif exec-with-log.sh: exec-with-log.sh.in Makefile $(AM_V_GEN)sed -e "s|[@]abs_top_srcdir[@]|@abs_top_srcdir@|g" \ -e "s|[@]abs_top_builddir[@]|@abs_top_builddir@|g" \ $< > $@ $(AM_V_at)chmod +x $@ run-mc.sh: run-mc.sh.in Makefile $(AM_V_GEN)sed \ -e "s|[@]mctestsdir[@]|@mctestsdir@|g" \ -e "s|[@]libexecdir[@]|$(libexecdir)|g" \ $< > $@ @chmod +x $@ servicedir-uninstalled/%.conf: servicedir-uninstalled/%.conf.in Makefile $(AM_V_at)$(mkdir_p) servicedir-uninstalled $(AM_V_GEN)sed -e "s|[@]abs_top_builddir[@]|@abs_top_builddir@|g" $< > $@ servicedir-installed/%.conf: servicedir-installed/%.conf.in Makefile $(AM_V_at)$(mkdir_p) servicedir-installed $(AM_V_GEN)sed -e "s|[@]mctestsdir[@]|@mctestsdir@|g" $< > $@ # We don't use the full filename for the .in because > 99 character filenames # in tarballs are non-portable (and automake 1.8 doesn't let us build # non-archaic tarballs) servicedir-uninstalled/org.freedesktop.Telepathy.%.service: servicedir-uninstalled/%.service.in Makefile $(AM_V_at)$(mkdir_p) servicedir-uninstalled $(AM_V_GEN)sed \ -e "s|[@]abs_top_srcdir[@]|@abs_top_srcdir@|g" \ -e "s|[@]abs_top_builddir[@]|@abs_top_builddir@|g" \ $< > $@ servicedir-installed/org.freedesktop.Telepathy.%.service: servicedir-installed/%.service.in Makefile $(AM_V_at)$(mkdir_p) servicedir-installed $(AM_V_GEN)sed \ -e "s|[@]mctestsdir[@]|@mctestsdir@|g" \ $< > $@ # D-Bus service file for testing uninstalled_service_in_files = \ servicedir-uninstalled/MissionControl5.service.in \ servicedir-uninstalled/Client.AbiWord.service.in \ servicedir-uninstalled/Client.Logger.service.in uninstalled_service_files = $(patsubst servicedir-uninstalled/%.in,servicedir-uninstalled/org.freedesktop.Telepathy.%, $(uninstalled_service_in_files)) installed_service_in_files = \ servicedir-installed/MissionControl5.service.in \ servicedir-installed/Client.AbiWord.service.in \ servicedir-installed/Client.Logger.service.in installed_service_files = $(patsubst servicedir-installed/%.in,servicedir-installed/org.freedesktop.Telepathy.%, $(installed_service_in_files)) # D-Bus config file for testing uninstalled_conf_in_files = servicedir-uninstalled/tmp-session-bus.conf.in uninstalled_conf_files = $(uninstalled_conf_in_files:.conf.in=.conf) installed_conf_in_files = servicedir-installed/tmp-session-bus.conf.in installed_conf_files = $(installed_conf_in_files:.conf.in=.conf) BUILT_SOURCES = \ $(uninstalled_service_files) $(uninstalled_conf_files) \ $(installed_service_files) $(installed_conf_files) \ exec-with-log.sh EXTRA_DIST = \ $(uninstalled_service_in_files) \ $(uninstalled_conf_in_files) \ $(installed_service_in_files) \ $(installed_conf_in_files) \ exec-with-log.sh.in \ fake-startup.sh \ valgrind.supp \ with-session-bus.sh \ run-mc.sh.in \ $(NULL) CLEANFILES = \ $(BUILT_SOURCES) \ missioncontrol.log \ missioncontrol-*.log telepathy-mission-control-5.16.4/tests/twisted/tools/Makefile.in0000644000175000017500000005577112762351620026072 0ustar00gkiagiagkiagia00000000000000# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__make_dryrun = \ { \ am__dry=no; \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ *) \ for am__flg in $$MAKEFLAGS; do \ case $$am__flg in \ *=*|--*) ;; \ *n*) am__dry=yes; break;; \ esac; \ done;; \ esac; \ test $$am__dry = yes; \ } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = tests/twisted/tools DIST_COMMON = $(am__nobase_dist_twistedtests_SCRIPTS_DIST) \ $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/gtk-doc.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/tp-compiler-flag.m4 \ $(top_srcdir)/m4/tp-compiler-warnings.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__nobase_dist_twistedtests_SCRIPTS_DIST = with-session-bus.sh am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(twistedtestsdir)" \ "$(DESTDIR)$(twistedtestsdir)" "$(DESTDIR)$(twistedtestsdir)" SCRIPTS = $(nobase_dist_twistedtests_SCRIPTS) \ $(nobase_nodist_twistedtests_SCRIPTS) AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac DATA = $(nobase_nodist_twistedtests_DATA) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACCOUNTS_CACHE_DIR = @ACCOUNTS_CACHE_DIR@ ACCOUNTS_DIR = @ACCOUNTS_DIR@ ACLOCAL = @ACLOCAL@ AEGIS_LIBS = @AEGIS_LIBS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DBUS_CFLAGS = @DBUS_CFLAGS@ DBUS_LIBS = @DBUS_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ERROR_CFLAGS = @ERROR_CFLAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GIO_UNIX_CFLAGS = @GIO_UNIX_CFLAGS@ GIO_UNIX_LIBS = @GIO_UNIX_LIBS@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_COMPILE_SCHEMAS = @GLIB_COMPILE_SCHEMAS@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ GLIB_MKENUMS = @GLIB_MKENUMS@ GREP = @GREP@ GSETTINGS_DISABLE_SCHEMAS_COMPILE = @GSETTINGS_DISABLE_SCHEMAS_COMPILE@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ HTML_DIR = @HTML_DIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBACCOUNTS_SSO_CFLAGS = @LIBACCOUNTS_SSO_CFLAGS@ LIBACCOUNTS_SSO_LIBS = @LIBACCOUNTS_SSO_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MCE_CFLAGS = @MCE_CFLAGS@ MCE_LIBS = @MCE_LIBS@ MCP_ABI_VERSION = @MCP_ABI_VERSION@ MCP_API_VERSION = @MCP_API_VERSION@ MCP_LT_AGE = @MCP_LT_AGE@ MCP_LT_CURRENT = @MCP_LT_CURRENT@ MCP_LT_REVISION = @MCP_LT_REVISION@ MKDIR_P = @MKDIR_P@ NETWORK_MANAGER_CFLAGS = @NETWORK_MANAGER_CFLAGS@ NETWORK_MANAGER_LIBS = @NETWORK_MANAGER_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PYTHON = @PYTHON@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TELEPATHY_CFLAGS = @TELEPATHY_CFLAGS@ TELEPATHY_LIBS = @TELEPATHY_LIBS@ UPOWER_GLIB_CFLAGS = @UPOWER_GLIB_CFLAGS@ UPOWER_GLIB_LIBS = @UPOWER_GLIB_LIBS@ VERSION = @VERSION@ XSLTPROC = @XSLTPROC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gsettingsschemadir = @gsettingsschemadir@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mctestsdir = @mctestsdir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ pluginlibdir = @pluginlibdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ @ENABLE_INSTALLED_TESTS_TRUE@twistedtestsdir = @mctestsdir@/twisted/tools @ENABLE_INSTALLED_TESTS_TRUE@nobase_nodist_twistedtests_SCRIPTS = \ @ENABLE_INSTALLED_TESTS_TRUE@ run-mc.sh \ @ENABLE_INSTALLED_TESTS_TRUE@ fake-startup.sh \ @ENABLE_INSTALLED_TESTS_TRUE@ $(NULL) @ENABLE_INSTALLED_TESTS_TRUE@nobase_dist_twistedtests_SCRIPTS = \ @ENABLE_INSTALLED_TESTS_TRUE@ with-session-bus.sh \ @ENABLE_INSTALLED_TESTS_TRUE@ $(NULL) @ENABLE_INSTALLED_TESTS_TRUE@nobase_nodist_twistedtests_DATA = \ @ENABLE_INSTALLED_TESTS_TRUE@ $(installed_conf_files) \ @ENABLE_INSTALLED_TESTS_TRUE@ $(installed_service_files) \ @ENABLE_INSTALLED_TESTS_TRUE@ $(NULL) # D-Bus service file for testing uninstalled_service_in_files = \ servicedir-uninstalled/MissionControl5.service.in \ servicedir-uninstalled/Client.AbiWord.service.in \ servicedir-uninstalled/Client.Logger.service.in uninstalled_service_files = $(patsubst servicedir-uninstalled/%.in,servicedir-uninstalled/org.freedesktop.Telepathy.%, $(uninstalled_service_in_files)) installed_service_in_files = \ servicedir-installed/MissionControl5.service.in \ servicedir-installed/Client.AbiWord.service.in \ servicedir-installed/Client.Logger.service.in installed_service_files = $(patsubst servicedir-installed/%.in,servicedir-installed/org.freedesktop.Telepathy.%, $(installed_service_in_files)) # D-Bus config file for testing uninstalled_conf_in_files = servicedir-uninstalled/tmp-session-bus.conf.in uninstalled_conf_files = $(uninstalled_conf_in_files:.conf.in=.conf) installed_conf_in_files = servicedir-installed/tmp-session-bus.conf.in installed_conf_files = $(installed_conf_in_files:.conf.in=.conf) BUILT_SOURCES = \ $(uninstalled_service_files) $(uninstalled_conf_files) \ $(installed_service_files) $(installed_conf_files) \ exec-with-log.sh EXTRA_DIST = \ $(uninstalled_service_in_files) \ $(uninstalled_conf_in_files) \ $(installed_service_in_files) \ $(installed_conf_in_files) \ exec-with-log.sh.in \ fake-startup.sh \ valgrind.supp \ with-session-bus.sh \ run-mc.sh.in \ $(NULL) CLEANFILES = \ $(BUILT_SOURCES) \ missioncontrol.log \ missioncontrol-*.log all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tests/twisted/tools/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu tests/twisted/tools/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-nobase_dist_twistedtestsSCRIPTS: $(nobase_dist_twistedtests_SCRIPTS) @$(NORMAL_INSTALL) @list='$(nobase_dist_twistedtests_SCRIPTS)'; test -n "$(twistedtestsdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(twistedtestsdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(twistedtestsdir)" || exit 1; \ fi; \ $(am__nobase_strip_setup); \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n' \ -e "s|$$srcdirstrip/||" -e 'h;s|[^/]*$$||; s|^$$|.|' \ -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) { files[d] = files[d] " " $$1; \ if (++n[d] == $(am__install_max)) { \ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ else { print "f", d "/" $$4, $$1 } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ case $$type in \ d) echo " $(MKDIR_P) '$(DESTDIR)$(twistedtestsdir)/$$dir'"; \ $(MKDIR_P) "$(DESTDIR)$(twistedtestsdir)/$$dir" || exit $$?;; \ f) \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(twistedtestsdir)$$dir'"; \ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(twistedtestsdir)$$dir" || exit $$?; \ } \ ;; esac \ ; done uninstall-nobase_dist_twistedtestsSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(nobase_dist_twistedtests_SCRIPTS)'; test -n "$(twistedtestsdir)" || exit 0; \ $(am__nobase_strip_setup); \ files=`$(am__nobase_strip) \ -e 'h;s,.*/,,;$(transform);x;s|[^/]*$$||;G;s,\n,,'`; \ dir='$(DESTDIR)$(twistedtestsdir)'; $(am__uninstall_files_from_dir) install-nobase_nodist_twistedtestsSCRIPTS: $(nobase_nodist_twistedtests_SCRIPTS) @$(NORMAL_INSTALL) @list='$(nobase_nodist_twistedtests_SCRIPTS)'; test -n "$(twistedtestsdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(twistedtestsdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(twistedtestsdir)" || exit 1; \ fi; \ $(am__nobase_strip_setup); \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n' \ -e "s|$$srcdirstrip/||" -e 'h;s|[^/]*$$||; s|^$$|.|' \ -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) { files[d] = files[d] " " $$1; \ if (++n[d] == $(am__install_max)) { \ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ else { print "f", d "/" $$4, $$1 } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ case $$type in \ d) echo " $(MKDIR_P) '$(DESTDIR)$(twistedtestsdir)/$$dir'"; \ $(MKDIR_P) "$(DESTDIR)$(twistedtestsdir)/$$dir" || exit $$?;; \ f) \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(twistedtestsdir)$$dir'"; \ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(twistedtestsdir)$$dir" || exit $$?; \ } \ ;; esac \ ; done uninstall-nobase_nodist_twistedtestsSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(nobase_nodist_twistedtests_SCRIPTS)'; test -n "$(twistedtestsdir)" || exit 0; \ $(am__nobase_strip_setup); \ files=`$(am__nobase_strip) \ -e 'h;s,.*/,,;$(transform);x;s|[^/]*$$||;G;s,\n,,'`; \ dir='$(DESTDIR)$(twistedtestsdir)'; $(am__uninstall_files_from_dir) mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-nobase_nodist_twistedtestsDATA: $(nobase_nodist_twistedtests_DATA) @$(NORMAL_INSTALL) @list='$(nobase_nodist_twistedtests_DATA)'; test -n "$(twistedtestsdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(twistedtestsdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(twistedtestsdir)" || exit 1; \ fi; \ $(am__nobase_list) | while read dir files; do \ xfiles=; for file in $$files; do \ if test -f "$$file"; then xfiles="$$xfiles $$file"; \ else xfiles="$$xfiles $(srcdir)/$$file"; fi; done; \ test -z "$$xfiles" || { \ test "x$$dir" = x. || { \ echo " $(MKDIR_P) '$(DESTDIR)$(twistedtestsdir)/$$dir'"; \ $(MKDIR_P) "$(DESTDIR)$(twistedtestsdir)/$$dir"; }; \ echo " $(INSTALL_DATA) $$xfiles '$(DESTDIR)$(twistedtestsdir)/$$dir'"; \ $(INSTALL_DATA) $$xfiles "$(DESTDIR)$(twistedtestsdir)/$$dir" || exit $$?; }; \ done uninstall-nobase_nodist_twistedtestsDATA: @$(NORMAL_UNINSTALL) @list='$(nobase_nodist_twistedtests_DATA)'; test -n "$(twistedtestsdir)" || list=; \ $(am__nobase_strip_setup); files=`$(am__nobase_strip)`; \ dir='$(DESTDIR)$(twistedtestsdir)'; $(am__uninstall_files_from_dir) tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-am all-am: Makefile $(SCRIPTS) $(DATA) installdirs: for dir in "$(DESTDIR)$(twistedtestsdir)" "$(DESTDIR)$(twistedtestsdir)" "$(DESTDIR)$(twistedtestsdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-nobase_dist_twistedtestsSCRIPTS \ install-nobase_nodist_twistedtestsDATA \ install-nobase_nodist_twistedtestsSCRIPTS install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-nobase_dist_twistedtestsSCRIPTS \ uninstall-nobase_nodist_twistedtestsDATA \ uninstall-nobase_nodist_twistedtestsSCRIPTS .MAKE: all check install install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man \ install-nobase_dist_twistedtestsSCRIPTS \ install-nobase_nodist_twistedtestsDATA \ install-nobase_nodist_twistedtestsSCRIPTS install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am \ uninstall-nobase_dist_twistedtestsSCRIPTS \ uninstall-nobase_nodist_twistedtestsDATA \ uninstall-nobase_nodist_twistedtestsSCRIPTS exec-with-log.sh: exec-with-log.sh.in Makefile $(AM_V_GEN)sed -e "s|[@]abs_top_srcdir[@]|@abs_top_srcdir@|g" \ -e "s|[@]abs_top_builddir[@]|@abs_top_builddir@|g" \ $< > $@ $(AM_V_at)chmod +x $@ run-mc.sh: run-mc.sh.in Makefile $(AM_V_GEN)sed \ -e "s|[@]mctestsdir[@]|@mctestsdir@|g" \ -e "s|[@]libexecdir[@]|$(libexecdir)|g" \ $< > $@ @chmod +x $@ servicedir-uninstalled/%.conf: servicedir-uninstalled/%.conf.in Makefile $(AM_V_at)$(mkdir_p) servicedir-uninstalled $(AM_V_GEN)sed -e "s|[@]abs_top_builddir[@]|@abs_top_builddir@|g" $< > $@ servicedir-installed/%.conf: servicedir-installed/%.conf.in Makefile $(AM_V_at)$(mkdir_p) servicedir-installed $(AM_V_GEN)sed -e "s|[@]mctestsdir[@]|@mctestsdir@|g" $< > $@ # We don't use the full filename for the .in because > 99 character filenames # in tarballs are non-portable (and automake 1.8 doesn't let us build # non-archaic tarballs) servicedir-uninstalled/org.freedesktop.Telepathy.%.service: servicedir-uninstalled/%.service.in Makefile $(AM_V_at)$(mkdir_p) servicedir-uninstalled $(AM_V_GEN)sed \ -e "s|[@]abs_top_srcdir[@]|@abs_top_srcdir@|g" \ -e "s|[@]abs_top_builddir[@]|@abs_top_builddir@|g" \ $< > $@ servicedir-installed/org.freedesktop.Telepathy.%.service: servicedir-installed/%.service.in Makefile $(AM_V_at)$(mkdir_p) servicedir-installed $(AM_V_GEN)sed \ -e "s|[@]mctestsdir[@]|@mctestsdir@|g" \ $< > $@ # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: telepathy-mission-control-5.16.4/tests/twisted/tools/valgrind.supp0000644000175000017500000003657612735241312026542 0ustar00gkiagiagkiagia00000000000000# Valgrind error suppression file { dbus-glib, https://bugs.freedesktop.org/show_bug.cgi?id=14125 Memcheck:Addr4 fun:g_hash_table_foreach obj:/usr/lib/libdbus-glib-1.so.2.1.0 fun:g_object_run_dispose } { libdbus shared connection via tp_get_bus (1) Memcheck:Leak ... fun:dbus_malloc obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* fun:dbus_g_bus_get fun:tp_get_bus } { libdbus shared connection via tp_dbus_daemon_dup (1) Memcheck:Leak ... fun:dbus_malloc obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* fun:dbus_g_bus_get fun:tp_dbus_daemon_dup } { libdbus shared connection via tp_get_bus (2) Memcheck:Leak ... fun:dbus_malloc0 obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* fun:dbus_g_bus_get fun:tp_get_bus } { libdbus shared connection via tp_dbus_daemon_dup (2) Memcheck:Leak ... fun:dbus_malloc0 obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* fun:dbus_g_bus_get fun:tp_dbus_daemon_dup } { libdbus shared connection via tp_get_bus (3) Memcheck:Leak ... fun:dbus_realloc obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* fun:dbus_g_bus_get fun:tp_get_bus } { libdbus shared connection via tp_dbus_daemon_dup (3) Memcheck:Leak ... fun:dbus_realloc obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* fun:dbus_g_bus_get fun:tp_dbus_daemon_dup } { libdbus shared connection via tp_get_bus (4) Memcheck:Leak fun:malloc obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* fun:dbus_g_bus_get fun:tp_get_bus } { libdbus shared connection via tp_dbus_daemon_dup (4) Memcheck:Leak fun:malloc obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* fun:dbus_g_bus_get fun:tp_dbus_daemon_dup } { libdbus shared connection via tp_get_bus (5) Memcheck:Leak fun:malloc obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* fun:dbus_g_bus_get fun:tp_get_bus } { libdbus shared connection via tp_dbus_daemon_dup (5) Memcheck:Leak fun:malloc obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* fun:dbus_g_bus_get fun:tp_dbus_daemon_dup } { libdbus shared connection via tp_get_bus (6) Memcheck:Leak fun:calloc obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* fun:dbus_g_bus_get fun:tp_get_bus } { libdbus shared connection via tp_dbus_daemon_dup (6) Memcheck:Leak fun:calloc obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* fun:dbus_g_bus_get fun:tp_dbus_daemon_dup } { libdbus shared connection via tp_get_bus (7) Memcheck:Leak fun:calloc obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* fun:dbus_g_bus_get fun:tp_get_bus } { libdbus shared connection via tp_dbus_daemon_dup (7) Memcheck:Leak fun:calloc obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* fun:dbus_g_bus_get fun:tp_dbus_daemon_dup } { libdbus shared connection via tp_get_bus (8) Memcheck:Leak fun:calloc obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* fun:dbus_g_bus_get fun:tp_get_bus } { libdbus shared connection via tp_dbus_daemon_dup (8) Memcheck:Leak fun:calloc obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* fun:dbus_g_bus_get fun:tp_dbus_daemon_dup } { libdbus shared connection via tp_get_bus (9) Memcheck:Leak fun:malloc obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* fun:dbus_g_bus_get fun:tp_get_bus } { libdbus shared connection via tp_dbus_daemon_dup (9) Memcheck:Leak fun:malloc obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* fun:dbus_g_bus_get fun:tp_dbus_daemon_dup } { libdbus shared connection via tp_get_bus (10) Memcheck:Leak fun:calloc obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* fun:dbus_g_bus_get fun:tp_get_bus } { libdbus shared connection via tp_dbus_daemon_dup (10) Memcheck:Leak fun:calloc obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* fun:dbus_g_bus_get fun:tp_dbus_daemon_dup } { libdbus shared connection via tp_get_bus (11) Memcheck:Leak fun:calloc obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* fun:dbus_g_bus_get fun:tp_get_bus } { libdbus shared connection via tp_dbus_daemon_dup (11) Memcheck:Leak fun:calloc obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* fun:dbus_g_bus_get fun:tp_dbus_daemon_dup } { libdbus shared connection via tp_get_bus (12) Memcheck:Leak fun:realloc obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* fun:dbus_g_bus_get fun:tp_get_bus } { libdbus shared connection via tp_dbus_daemon_dup (12) Memcheck:Leak fun:realloc obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* fun:dbus_g_bus_get fun:tp_dbus_daemon_dup } { libdbus shared connection via tp_get_bus (13. sigh.) Memcheck:Leak fun:malloc obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* fun:dbus_g_bus_get fun:tp_get_bus } { libdbus shared connection via tp_dbus_daemon_dup (13. sigh.) Memcheck:Leak fun:malloc obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* fun:dbus_g_bus_get fun:tp_dbus_daemon_dup } { libdbus shared connection via tp_get_bus (14) Memcheck:Leak fun:malloc obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* fun:dbus_g_bus_get fun:tp_get_bus } { libdbus shared connection via tp_dbus_daemon_dup (14) Memcheck:Leak fun:malloc obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* fun:dbus_g_bus_get fun:tp_dbus_daemon_dup } { libdbus shared connection via tp_get_bus (15) Memcheck:Leak fun:calloc obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* fun:dbus_g_bus_get fun:tp_get_bus } { libdbus shared connection via tp_dbus_daemon_dup (15) Memcheck:Leak fun:calloc obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* obj:*/libdbus-1.so.* fun:dbus_g_bus_get fun:tp_dbus_daemon_dup } { anything called by g_type_init_with_debug_flags Memcheck:Leak ... fun:g_type_init_with_debug_flags } { static GType registration Memcheck:Leak ... fun:g_realloc obj:/usr/lib/libgobject-2.0.so.* obj:/usr/lib/libgobject-2.0.so.* fun:g_type_register_static } { g_slice_init_nomessage (1) Memcheck:Leak fun:calloc fun:g_malloc0 obj:/usr/lib/libglib-2.0.so.* fun:g_slice_alloc } { creating param specs in tp_proxy_class_intern_init Memcheck:Leak fun:memalign fun:posix_memalign fun:slab_allocator_alloc_chunk fun:g_slice_alloc fun:g_slice_alloc0 fun:g_type_create_instance fun:g_param_spec_internal fun:g_param_spec_string } { shared global default g_main_context (1) Memcheck:Leak fun:calloc fun:g_malloc0 fun:g_main_context_new fun:g_main_context_default } { shared global default g_main_context (2) Memcheck:Leak fun:memalign fun:posix_memalign fun:slab_allocator_alloc_chunk fun:g_slice_alloc fun:g_ptr_array_sized_new fun:g_ptr_array_new fun:g_main_context_new fun:g_main_context_default } { shared global default g_main_context (2) (with G_SLICE_DEBUG=always-malloc) Memcheck:Leak fun:malloc fun:g_malloc fun:g_slice_alloc fun:g_ptr_array_sized_new fun:g_ptr_array_new fun:g_main_context_new fun:g_main_context_default } { GQuarks can't be freed Memcheck:Leak ... fun:g_quark_from_static_string } { dlopen initialization, triggered by handle-leak-debug code on glibc 2.7 Memcheck:Leak fun:malloc fun:local_strdup fun:_dl_map_object fun:dl_open_worker fun:_dl_catch_error fun:_dl_open fun:do_dlopen fun:_dl_catch_error fun:dlerror_run fun:__libc_dlopen_mode fun:init fun:backtrace fun:handle_leak_debug_bt fun:dynamic_ensure_handle fun:tp_handle_ensure } { dlopen initialization, triggered by handle-leak-debug code on older glibc Memcheck:Leak fun:malloc fun:_dl_map_object fun:dl_open_worker fun:_dl_catch_error fun:_dl_open fun:do_dlopen fun:_dl_catch_error fun:dlerror_run fun:__libc_dlopen_mode fun:init fun:backtrace fun:handle_leak_debug_bt fun:dynamic_ensure_handle fun:tp_handle_ensure } { dlopen initialization, triggered by handle-leak-debug code (2) Memcheck:Leak fun:malloc fun:_dl_new_object fun:_dl_map_object_from_fd fun:_dl_map_object fun:dl_open_worker fun:_dl_catch_error fun:_dl_open fun:do_dlopen fun:_dl_catch_error fun:dlerror_run fun:__libc_dlopen_mode fun:init fun:backtrace fun:handle_leak_debug_bt fun:dynamic_ensure_handle fun:tp_handle_ensure } { dlopen initialization, triggered by handle-leak-debug code (3) Memcheck:Leak fun:malloc fun:_dl_map_object_deps fun:dl_open_worker fun:_dl_catch_error fun:_dl_open fun:do_dlopen fun:_dl_catch_error fun:dlerror_run fun:__libc_dlopen_mode fun:init fun:backtrace fun:handle_leak_debug_bt fun:dynamic_ensure_handle fun:tp_handle_ensure } { dlopen initialization, triggered by handle-leak-debug code (4) Memcheck:Leak fun:calloc fun:_dl_check_map_versions fun:dl_open_worker fun:_dl_catch_error fun:_dl_open fun:do_dlopen fun:_dl_catch_error fun:dlerror_run fun:__libc_dlopen_mode fun:init fun:backtrace fun:handle_leak_debug_bt fun:dynamic_ensure_handle fun:tp_handle_ensure fun:pretend_connected fun:g_timeout_dispatch fun:g_main_context_dispatch fun:g_main_context_iterate fun:g_main_loop_run fun:tp_connection_run_until_ready } { dlopen initialization, triggered by handle-leak-debug code (5) Memcheck:Leak fun:calloc fun:_dl_new_object fun:_dl_map_object_from_fd fun:_dl_map_object fun:dl_open_worker fun:_dl_catch_error fun:_dl_open fun:do_dlopen fun:_dl_catch_error fun:dlerror_run fun:__libc_dlopen_mode fun:init fun:backtrace fun:handle_leak_debug_bt fun:dynamic_ensure_handle fun:tp_handle_ensure } { dlopen initialization, triggered by handle-leak-debug code (6) Memcheck:Leak fun:calloc fun:_dl_check_map_versions fun:dl_open_worker fun:_dl_catch_error fun:_dl_open fun:do_dlopen fun:_dl_catch_error fun:dlerror_run fun:__libc_dlopen_mode fun:init fun:backtrace fun:handle_leak_debug_bt fun:dynamic_ensure_handle fun:tp_handle_ensure } { ld.so initialization + selinux Memcheck:Leak fun:malloc obj:/lib/libselinux.so.* obj:/lib/libselinux.so.* obj:/lib/libselinux.so.* fun:call_init fun:_dl_init obj:/lib/ld-*.so } { ld.so initialization + selinux Memcheck:Leak fun:malloc fun:vasprintf fun:asprintf obj:/lib/libselinux.so.* obj:/lib/libselinux.so.* obj:/lib/libselinux.so.* fun:call_init fun:_dl_init obj:/lib/ld-*.so } { ld.so initialization + selinux Memcheck:Leak fun:realloc fun:vasprintf fun:asprintf obj:/lib/libselinux.so.* obj:/lib/libselinux.so.* obj:/lib/libselinux.so.* fun:call_init fun:_dl_init obj:/lib/ld-*.so } { ld.so initialization on glibc 2.9 Memcheck:Cond fun:_dl_relocate_object fun:dl_main fun:_dl_sysdep_start fun:_dl_start obj:/lib/ld-2.9.so } { ld.so initialization on glibc 2.9 Memcheck:Cond fun:strlen fun:_dl_init_paths fun:dl_main fun:_dl_sysdep_start fun:_dl_start obj:/lib/ld-2.9.so } { GTest initialization Memcheck:Leak ... fun:g_test_init } { g_random_int makes default GRand Memcheck:Leak ... fun:g_rand_new fun:g_random_int } { GTest logging Memcheck:Leak fun:malloc fun:realloc fun:g_realloc fun:g_array_maybe_expand fun:g_array_set_size fun:g_static_private_set fun:g_get_charset fun:g_print fun:g_test_log fun:g_test_run_suite_internal fun:g_test_run_suite_internal fun:g_test_run_suite fun:g_test_run fun:main } { dlopen initialization Memcheck:Leak fun:calloc fun:_dlerror_run fun:dlopen@@GLIBC_2.1 fun:g_module_open fun:mcd_master_constructor fun:g_object_newv fun:g_object_new_valist fun:g_object_new fun:mcd_service_new fun:main } { more dlopen initialization Memcheck:Leak fun:malloc fun:add_to_global fun:dl_open_worker fun:_dl_catch_error fun:_dl_open fun:dlopen_doit fun:_dl_catch_error fun:_dlerror_run fun:dlopen@@GLIBC_2.1 fun:g_module_open fun:mcd_master_constructor fun:g_object_newv fun:g_object_new_valist fun:g_object_new fun:mcd_service_new fun:main } telepathy-mission-control-5.16.4/tests/twisted/tools/fake-startup.sh0000644000175000017500000000025512735241312026746 0ustar00gkiagiagkiagia00000000000000#!/bin/sh dbus-send --session --type=signal --print-reply \ /org/freedesktop/Telepathy/RegressionTests \ org.freedesktop.Telepathy.RegressionTests.FakeStartup \ string:"$1" telepathy-mission-control-5.16.4/tests/twisted/tools/servicedir-uninstalled/0000755000175000017500000000000012762352250030465 5ustar00gkiagiagkiagia00000000000000telepathy-mission-control-5.16.4/tests/twisted/tools/servicedir-uninstalled/Client.Logger.service.in0000644000175000017500000000024712735241312035107 0ustar00gkiagiagkiagia00000000000000[D-BUS Service] Name=org.freedesktop.Telepathy.Client.Logger Exec=/bin/sh @abs_top_srcdir@/tests/twisted/tools/fake-startup.sh org.freedesktop.Telepathy.Client.Logger Client.AbiWord.service.in0000644000175000017500000000025112735241312035133 0ustar00gkiagiagkiagia00000000000000telepathy-mission-control-5.16.4/tests/twisted/tools/servicedir-uninstalled[D-BUS Service] Name=org.freedesktop.Telepathy.Client.AbiWord Exec=/bin/sh @abs_top_srcdir@/tests/twisted/tools/fake-startup.sh org.freedesktop.Telepathy.Client.AbiWord MissionControl5.service.in0000644000175000017500000000017412735241312035442 0ustar00gkiagiagkiagia00000000000000telepathy-mission-control-5.16.4/tests/twisted/tools/servicedir-uninstalled[D-BUS Service] Name=org.freedesktop.Telepathy.MissionControl5 Exec=@abs_top_builddir@/tests/twisted/tools/exec-with-log.sh telepathy-mission-control-5.16.4/tests/twisted/tools/servicedir-uninstalled/tmp-session-bus.conf.in0000644000175000017500000000164712735241312035015 0ustar00gkiagiagkiagia00000000000000 session unix:tmpdir=/tmp @abs_top_builddir@/tests/twisted/tools/servicedir-uninstalled telepathy-mission-control-5.16.4/tests/twisted/tools/with-session-bus.sh0000644000175000017500000000603212735241312027562 0ustar00gkiagiagkiagia00000000000000#!/bin/sh # with-session-bus.sh - run a program with a temporary D-Bus session daemon # # The canonical location of this program is the telepathy-glib tools/ # directory, please synchronize any changes with that copy. # # Copyright (C) 2007-2008 Collabora Ltd. # # Copying and distribution of this file, with or without modification, # are permitted in any medium without royalty provided the copyright # notice and this notice are preserved. set -e me=with-session-bus dbus_daemon_args="--print-address=5 --print-pid=6 --fork" sleep=0 usage () { echo "usage: $me [options] -- program [program_options]" >&2 echo "Requires write access to the current directory." >&2 echo "" >&2 echo "If \$WITH_SESSION_BUS_FORK_DBUS_MONITOR is set, fork dbus-monitor" >&2 echo "with the arguments in \$WITH_SESSION_BUS_FORK_DBUS_MONITOR_OPT." >&2 echo "The output of dbus-monitor is saved in $me-.dbus-monitor-logs" >&2 exit 2 } while test "z$1" != "z--"; do case "$1" in --sleep=*) sleep="$1" sleep="${sleep#--sleep=}" shift ;; --session) dbus_daemon_args="$dbus_daemon_args --session" shift ;; --config-file=*) # FIXME: assumes config file doesn't contain any special characters dbus_daemon_args="$dbus_daemon_args $1" shift ;; --also-for-system) with_system_bus=1 shift ;; *) usage ;; esac done shift if test "z$1" = "z"; then usage; fi exec 5> $me-$$.address exec 6> $me-$$.pid cleanup () { pid=`head -n1 $me-$$.pid` if test -n "$pid" ; then if [ -n "$CHECK_TWISTED_VERBOSE" ] || [ -n "$VERBOSE_TESTS" ]; then echo "Killing temporary bus daemon: $pid" >&2 fi kill -INT "$pid" fi rm -f $me-$$.address rm -f $me-$$.pid } trap cleanup INT HUP TERM dbus-daemon $dbus_daemon_args if [ -n "$CHECK_TWISTED_VERBOSE" ] || [ -n "$VERBOSE_TESTS" ]; then { echo -n "Temporary bus daemon is "; cat $me-$$.address; } >&2 { echo -n "Temporary bus daemon PID is "; head -n1 $me-$$.pid; } >&2 fi e=0 # These might be non-null when run from e.g. gnome-terminal 3.8, which uses # an activatable service for its windows; we don't want to inherit them either unset DBUS_STARTER_ADDRESS unset DBUS_STARTER_BUS_TYPE DBUS_SESSION_BUS_ADDRESS="`cat $me-$$.address`" export DBUS_SESSION_BUS_ADDRESS if [ -n "$with_system_bus" ] ; then DBUS_SYSTEM_BUS_ADDRESS="$DBUS_SESSION_BUS_ADDRESS" export DBUS_SYSTEM_BUS_ADDRESS fi if [ -n "$WITH_SESSION_BUS_FORK_DBUS_MONITOR" ] ; then DBUS_MONITOR_LOG_FILE="$me-$$.dbus-monitor-logs" echo "Running dbus-monitor $WITH_SESSION_BUS_FORK_DBUS_MONITOR_OPT" >&2 echo "Its output will be in $DBUS_MONITOR_LOG_FILE" >&2 dbus-monitor $WITH_SESSION_BUS_FORK_DBUS_MONITOR_OPT \ > $DBUS_MONITOR_LOG_FILE 2>&1 & fi if [ -n "$GABBLE_TEST_BUSTLE" ]; then BUSTLE_LOG_FILE="tools/$me-$$.bustle-logs" echo "Running bustle-dbus-monitor; log file $BUSTLE_LOG_FILE" >&2 bustle-dbus-monitor > $BUSTLE_LOG_FILE 2>&1 & fi "$@" || e=$? if test $sleep != 0; then sleep $sleep fi trap - INT HUP TERM cleanup exit $e telepathy-mission-control-5.16.4/tests/twisted/run-test.sh.in0000644000175000017500000000715612735242352025402 0ustar00gkiagiagkiagia00000000000000#!/bin/sh # This script assumes that it is run in a temporary directory where it can # create and delete subdirectories for files, logs, etc., but other users # cannot write (for instance, /tmp is unsuitable, but # the directory created by `mktemp -d /tmp/test.XXXXXXXXXX` is fine). # # During "make check" or "make installcheck" it runs in # ${top_builddir}/tests/twisted. # # During installed testing, the test environment must run it in a # suitable location. set -e MC_TEST_CURDIR="`pwd`" export MC_TEST_CURDIR if test "x$MC_TEST_UNINSTALLED" = x; then script_fullname=`readlink -e "@mctestsdir@/twisted/run-test.sh"` if [ `readlink -e "$0"` != "$script_fullname" ] ; then echo "This script is meant to be installed at $script_fullname" >&2 exit 1 fi test_src="@mctestsdir@" test_build="@mctestsdir@" config_file="@mctestsdir@/twisted/tools/servicedir-installed/tmp-session-bus.conf" plugins="@mctestsdir@/twisted/plugins" PYTHONPATH="@mctestsdir@/twisted" export PYTHONPATH MC_TWISTED_PATH="@mctestsdir@/twisted" export MC_TWISTED_PATH else if test -z "$MC_ABS_TOP_SRCDIR"; then echo "MC_ABS_TOP_SRCDIR must be set" >&2 exit 1 fi if test -z "$MC_ABS_TOP_BUILDDIR"; then echo "MC_ABS_TOP_BUILDDIR must be set" >&2 exit 1 fi test_src="${MC_ABS_TOP_SRCDIR}/tests" test_build="${MC_ABS_TOP_BUILDDIR}/tests" config_file="${test_build}/twisted/tools/servicedir-uninstalled/tmp-session-bus.conf" plugins="${test_build}/twisted/.libs" PYTHONPATH="${test_src}/twisted:${test_build}/twisted" export PYTHONPATH MC_TWISTED_PATH="${test_src}/twisted" export MC_TWISTED_PATH fi MC_DEBUG=all export MC_DEBUG G_DEBUG=fatal-criticals export G_DEBUG # for ENABLE_LIBACCOUNTS_SSO AG_DEBUG=all export AG_DEBUG GIO_EXTRA_MODULES="${plugins}" export GIO_EXTRA_MODULES MC_FILTER_PLUGIN_DIR="${plugins}" export MC_FILTER_PLUGIN_DIR XDG_CONFIG_DIRS="${test_src}/twisted" export XDG_CONFIG_DIRS MC_CLIENTS_DIR="${test_src}/twisted/telepathy/clients" export MC_CLIENTS_DIR MC_MANAGER_DIR="${test_src}/twisted/telepathy/managers" export MC_MANAGER_DIR if [ -n "$1" ] ; then list="$1" else list=$(cat "${test_build}"/twisted/mc-twisted-tests.list) fi any_failed=0 for i in $list ; do echo "Testing $i ..." tmp="${MC_TEST_CURDIR}/tmp-`echo $i | tr ./ __`" rm -fr "$tmp" mkdir "$tmp" MC_TEST_LOG_DIR="${tmp}" export MC_TEST_LOG_DIR MC_ACCOUNT_DIR="${tmp}/mc-account-dir" export MC_ACCOUNT_DIR XDG_CONFIG_HOME="${tmp}/config" export XDG_CONFIG_HOME XDG_DATA_HOME="${tmp}/localshare" export XDG_DATA_HOME XDG_DATA_DIRS="${tmp}/share:${test_src}/twisted" export XDG_DATA_DIRS XDG_CACHE_HOME="${tmp}/cache" export XDG_CACHE_HOME XDG_CACHE_DIR="${tmp}/cache" export XDG_CACHE_DIR # for ENABLE_LIBACCOUNTS_SSO ACCOUNTS="${tmp}/libaccounts-accounts" export ACCOUNTS AG_SERVICES="${tmp}/libaccounts-services" export AG_SERVICES CHECK_TWISTED_VERBOSE=1 export CHECK_TWISTED_VERBOSE e=0 sh "${test_src}/twisted/tools/with-session-bus.sh" \ ${MC_TEST_SLEEP} \ --also-for-system \ --config-file="${config_file}" \ -- \ @TEST_PYTHON@ -u "${test_src}/twisted/$i" \ > "$tmp"/test.log 2>&1 || e=$? case "$e" in (0) echo "PASS: $i" if test -z "$MC_TEST_KEEP_TEMP"; then rm -fr "$tmp" fi ;; (77) echo "SKIP: $i" if test -z "$MC_TEST_KEEP_TEMP"; then rm -fr "$tmp" fi ;; (*) any_failed=1 echo "FAIL: $i ($e)" ( cd $tmp && for x in *.log; do echo "===== log file: $x =====" cat "$x" done ) ;; esac done exit $any_failed telepathy-mission-control-5.16.4/tests/twisted/account-storage/0000755000175000017500000000000012762352250025744 5ustar00gkiagiagkiagia00000000000000telepathy-mission-control-5.16.4/tests/twisted/account-storage/default-keyring-storage.py0000644000175000017500000001757412735242352033071 0ustar00gkiagiagkiagia00000000000000# Test for default account storage backend. # # Copyright (C) 2009-2010 Nokia Corporation # Copyright (C) 2009-2010 Collabora Ltd. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA # 02110-1301 USA import time import os import os.path import signal import dbus import dbus.service from servicetest import EventPattern, tp_name_prefix, tp_path_prefix, \ call_async, assertEquals from mctest import ( exec_test, create_fakecm_account, get_fakecm_account, connect_to_mc, keyfile_read, tell_mc_to_die, resuscitate_mc ) import constants as cs # This doesn't escape its parameters before passing them to the shell, # so be careful. def account_store(op, backend, key=None, value=None, account='fakecm/fakeprotocol/dontdivert_40example_2ecom0'): cmd = [ '../account-store', op, backend, account ] if key: cmd.append(key) if value: cmd.append(value) lines = os.popen(' '.join(cmd)).read() ret = [] for line in lines.split('\n'): if line.startswith('** '): continue if line: ret.append(line) if len(ret) > 0: return ret[0] else: return None def test(q, bus, mc): ctl_dir = os.environ['MC_ACCOUNT_DIR'] old_key_file_name = os.path.join(ctl_dir, 'accounts.cfg') new_key_file_name = os.path.join(os.environ['XDG_DATA_HOME'], 'telepathy', 'mission-control', 'accounts.cfg') group = 'fakecm/fakeprotocol/dontdivert_40example_2ecom0' account_manager, properties, interfaces = connect_to_mc(q, bus, mc) assert properties.get('ValidAccounts') == [], \ properties.get('ValidAccounts') assert properties.get('InvalidAccounts') == [], \ properties.get('InvalidAccounts') params = dbus.Dictionary({"account": "dontdivert@example.com", "password": "secrecy"}, signature='sv') (cm_name_ref, account) = create_fakecm_account(q, bus, mc, params) account_path = account.__dbus_object_path__ # Check the account is correctly created properties = account_manager.GetAll(cs.AM, dbus_interface=cs.PROPERTIES_IFACE) assert properties is not None assert properties.get('ValidAccounts') == [account_path], properties account_path = properties['ValidAccounts'][0] assert isinstance(account_path, dbus.ObjectPath), repr(account_path) assert properties.get('InvalidAccounts') == [], properties account_iface = dbus.Interface(account, cs.ACCOUNT) account_props = dbus.Interface(account, cs.PROPERTIES_IFACE) # Alter some miscellaneous r/w properties account_props.Set(cs.ACCOUNT, 'DisplayName', 'Work account') account_props.Set(cs.ACCOUNT, 'Icon', 'im-jabber') account_props.Set(cs.ACCOUNT, 'Nickname', 'Joe Bloggs') tell_mc_to_die(q, bus) # .. let's check the keyfile assert not os.path.exists(old_key_file_name) kf = keyfile_read(new_key_file_name) assert group in kf, kf assert kf[group]['manager'] == 'fakecm' assert kf[group]['protocol'] == 'fakeprotocol' assert kf[group]['param-account'] == params['account'], kf assert kf[group]['DisplayName'] == 'Work account', kf assert kf[group]['Icon'] == 'im-jabber', kf assert kf[group]['Nickname'] == 'Joe Bloggs', kf # This works wherever the password is stored pwd = account_store('get', 'default', 'param-password') assert pwd == params['password'], pwd # We no longer use gnome-keyring, so the password is stored as clear-text. assert kf[group]['param-password'] == params['password'], kf # Reactivate MC account_manager, properties, interfaces = resuscitate_mc(q, bus, mc) account = get_fakecm_account(bus, mc, account_path) account_iface = dbus.Interface(account, cs.ACCOUNT) # Delete the account assert account_iface.Remove() is None account_event, account_manager_event = q.expect_many( EventPattern('dbus-signal', path=account_path, signal='Removed', interface=cs.ACCOUNT, args=[] ), EventPattern('dbus-signal', path=cs.AM_PATH, signal='AccountRemoved', interface=cs.AM, args=[account_path] ), ) # Check the account is correctly deleted assert not os.path.exists(old_key_file_name) kf = keyfile_read(new_key_file_name) assert group not in kf, kf # Tell MC to die, again tell_mc_to_die(q, bus) low_prio_key_file_name = os.path.join( os.environ['XDG_DATA_DIRS'].split(':')[0], 'telepathy', 'mission-control', 'accounts.cfg') os.makedirs(os.path.dirname(low_prio_key_file_name), 0700) # This is deliberately a lower-priority location os.remove(new_key_file_name) open(low_prio_key_file_name, 'w').write( r"""# Telepathy accounts [%s] manager=fakecm protocol=fakeprotocol param-account=dontdivert@example.com param-password=password_in_keyfile DisplayName=New and improved account AutomaticPresence=2;available;; """ % group) account_manager, properties, interfaces = resuscitate_mc(q, bus, mc) account = get_fakecm_account(bus, mc, account_path) account_iface = dbus.Interface(account, cs.ACCOUNT) # Files in lower-priority XDG locations aren't copied until something # actually changes, and they aren't deleted. assert not os.path.exists(new_key_file_name) assert os.path.exists(low_prio_key_file_name) # Delete the password (only), like Empathy 3.0-3.4 do when migrating account_iface.UpdateParameters({}, ['password']) q.expect('dbus-signal', path=account_path, signal='AccountPropertyChanged', interface=cs.ACCOUNT, predicate=(lambda e: 'Parameters' in e.args[0]), ) # Tell MC to die yet again tell_mc_to_die(q, bus) # Check the account has copied (not moved! XDG_DATA_DIRS are, # conceptually, read-only) from the old to the new name assert not os.path.exists(old_key_file_name) assert os.path.exists(low_prio_key_file_name) kf = keyfile_read(new_key_file_name) assert 'param-password' not in kf[group] pwd = account_store('get', 'default', 'param-password') assertEquals(None, pwd) # Write out an account configuration in the old keyfile, to test # migration os.remove(new_key_file_name) os.remove(low_prio_key_file_name) open(old_key_file_name, 'w').write( r"""# Telepathy accounts [%s] manager=fakecm protocol=fakeprotocol param-account=dontdivert@example.com DisplayName=Ye olde account AutomaticPresence=2;available;; """ % group) account_manager, properties, interfaces = resuscitate_mc(q, bus, mc) account = get_fakecm_account(bus, mc, account_path) account_iface = dbus.Interface(account, cs.ACCOUNT) # This time it *does* get moved (really copied+deleted) automatically # during MC startup assert not os.path.exists(old_key_file_name) assert not os.path.exists(low_prio_key_file_name) kf = keyfile_read(new_key_file_name) assert 'param-password' not in kf[group] assertEquals('Ye olde account', kf[group]['DisplayName']) if __name__ == '__main__': ctl_dir = os.environ['MC_ACCOUNT_DIR'] try: os.mkdir(ctl_dir, 0700) except OSError: pass exec_test(test, {}, timeout=10, use_fake_accounts_service=False) telepathy-mission-control-5.16.4/tests/twisted/account-storage/diverted-storage.py0000644000175000017500000001034312735242352031570 0ustar00gkiagiagkiagia00000000000000# Copyright (C) 2009-2010 Nokia Corporation # Copyright (C) 2009-2010 Collabora Ltd. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA # 02110-1301 USA import time import os import os.path import signal import dbus import dbus.service from servicetest import EventPattern, tp_name_prefix, tp_path_prefix, \ call_async from mctest import ( exec_test, create_fakecm_account, get_fakecm_account, connect_to_mc, keyfile_read, read_account_keyfile, tell_mc_to_die, resuscitate_mc, ) import constants as cs def test(q, bus, mc): accounts_dir = os.environ['MC_ACCOUNT_DIR'] try: os.mkdir(accounts_dir, 0700) except OSError: pass empty_key_file_name = os.path.join(os.environ['XDG_DATA_HOME'], 'telepathy', 'mission-control', 'accounts.cfg') group = 'fakecm/fakeprotocol/someguy_40example_2ecom0' account_manager, properties, interfaces = connect_to_mc(q, bus, mc) assert properties.get('ValidAccounts') == [], \ properties.get('ValidAccounts') assert properties.get('InvalidAccounts') == [], \ properties.get('InvalidAccounts') params = dbus.Dictionary({"account": "someguy@example.com", "password": "secrecy"}, signature='sv') (cm_name_ref, account) = create_fakecm_account(q, bus, mc, params) account_path = account.__dbus_object_path__ # Check the account is correctly created properties = account_manager.GetAll(cs.AM, dbus_interface=cs.PROPERTIES_IFACE) assert properties is not None assert properties.get('ValidAccounts') == [account_path], properties account_path = properties['ValidAccounts'][0] assert isinstance(account_path, dbus.ObjectPath), repr(account_path) assert properties.get('InvalidAccounts') == [], properties account_iface = dbus.Interface(account, cs.ACCOUNT) account_props = dbus.Interface(account, cs.PROPERTIES_IFACE) # Alter some miscellaneous r/w properties account_props.Set(cs.ACCOUNT, 'Icon', 'im-jabber') account_props.Set(cs.ACCOUNT, 'DisplayName', 'Work account') account_props.Set(cs.ACCOUNT, 'Nickname', 'Joe Bloggs') tell_mc_to_die(q, bus) # .. let's check the diverted keyfile kf = read_account_keyfile() assert group in kf, kf assert kf[group]['manager'] == 'fakecm' assert kf[group]['protocol'] == 'fakeprotocol' assert kf[group]['param-account'] == params['account'], kf assert kf[group]['param-password'] == params['password'], kf assert kf[group]['DisplayName'] == 'Work account', kf assert kf[group]['Icon'] == 'im-jabber', kf assert kf[group]['Nickname'] == 'Joe Bloggs', kf # default keyfile should be empty ekf = keyfile_read(empty_key_file_name) assert ekf == { None: {} }, ekf # Reactivate MC account_manager, properties, interfaces = resuscitate_mc(q, bus, mc) account = get_fakecm_account(bus, mc, account_path) account_iface = dbus.Interface(account, cs.ACCOUNT) # Delete the account assert account_iface.Remove() is None account_event, account_manager_event = q.expect_many( EventPattern('dbus-signal', path=account_path, signal='Removed', interface=cs.ACCOUNT, args=[] ), EventPattern('dbus-signal', path=cs.AM_PATH, signal='AccountRemoved', interface=cs.AM, args=[account_path] ), ) # Check the account is correctly deleted kf = read_account_keyfile() assert group not in kf, kf if __name__ == '__main__': exec_test(test, {}, timeout=10, use_fake_accounts_service=False) telepathy-mission-control-5.16.4/tests/twisted/constants.py0000644000175000017500000001606212735242352025242 0ustar00gkiagiagkiagia00000000000000# Copyright (C) 2009 Nokia Corporation # Copyright (C) 2009-2012 Collabora Ltd. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA # 02110-1301 USA """ Some handy constants for other tests to share and enjoy. """ from dbus import PROPERTIES_IFACE, INTROSPECTABLE_IFACE from servicetest import tp_name_prefix, tp_path_prefix CM = "org.freedesktop.Telepathy.ConnectionManager" DBUS_ERROR_NO_REPLY = 'org.freedesktop.DBus.Error.NoReply' HT_CONTACT = 1 HT_ROOM = 2 CHANNEL = tp_name_prefix + ".Channel" CHANNEL_IFACE_DESTROYABLE = CHANNEL + ".Interface.Destroyable" CHANNEL_IFACE_GROUP = CHANNEL + ".Interface.Group" CHANNEL_IFACE_HOLD = CHANNEL + ".Interface.Hold" CHANNEL_IFACE_MEDIA_SIGNALLING = CHANNEL + ".Interface.MediaSignalling" CHANNEL_TYPE_TEXT = CHANNEL + ".Type.Text" CHANNEL_TYPE_TUBES = CHANNEL + ".Type.Tubes" CHANNEL_IFACE_TUBE = CHANNEL + ".Interface.Tube" CHANNEL_TYPE_STREAM_TUBE = CHANNEL + ".Type.StreamTube" CHANNEL_TYPE_DBUS_TUBE = CHANNEL + ".Type.DBusTube" CHANNEL_TYPE_STREAMED_MEDIA = CHANNEL + ".Type.StreamedMedia" CHANNEL_TYPE_TEXT = CHANNEL + ".Type.Text" TP_AWKWARD_PROPERTIES = tp_name_prefix + ".Properties" PROPERTY_FLAG_READ = 1 PROPERTY_FLAG_WRITE = 2 CHANNEL_TYPE = CHANNEL + '.ChannelType' TARGET_HANDLE_TYPE = CHANNEL + '.TargetHandleType' TARGET_HANDLE = CHANNEL + '.TargetHandle' TARGET_ID = CHANNEL + '.TargetID' REQUESTED = CHANNEL + '.Requested' INITIATOR_HANDLE = CHANNEL + '.InitiatorHandle' INITIATOR_ID = CHANNEL + '.InitiatorID' INTERFACES = CHANNEL + '.Interfaces' CONN = tp_name_prefix + ".Connection" CONN_IFACE_ALIASING = CONN + '.Interface.Aliasing' CONN_IFACE_AVATARS = CONN + '.Interface.Avatars' CONN_IFACE_CAPS = CONN + '.Interface.Capabilities' CONN_IFACE_CONTACTS = CONN + '.Interface.Contacts' CONN_IFACE_CONTACT_CAPS = CONN + '.Interface.ContactCapabilities' CONN_IFACE_REQUESTS = CONN + '.Interface.Requests' CONN_IFACE_SIMPLE_PRESENCE = CONN + '.Interface.SimplePresence' CONN_IFACE_POWER_SAVING = CONN + '.Interface.PowerSaving' CONN_IFACE_SERVICE_POINT = CONN + '.Interface.ServicePoint' CONN_STATUS_CONNECTED = 0 CONN_STATUS_CONNECTING = 1 CONN_STATUS_DISCONNECTED = 2 ATTR_CONTACT_ID = CONN + '/contact-id' ATTR_ALIAS = CONN_IFACE_ALIASING + '/alias' ATTR_AVATAR_TOKEN = CONN_IFACE_AVATARS + '/token' ATTR_PRESENCE = CONN_IFACE_SIMPLE_PRESENCE + '/presence' CONN_STATUS_REASON_NONE = 0 CONN_STATUS_REASON_REQUESTED = 1 CONN_STATUS_REASON_NETWORK_ERROR = 2 GROUP_REASON_NONE = 0 GROUP_REASON_OFFLINE = 1 GROUP_REASON_KICKED = 2 GROUP_REASON_BUSY = 3 GROUP_REASON_INVITED = 4 GROUP_REASON_BANNED = 5 GROUP_REASON_ERROR = 6 GROUP_REASON_INVALID_CONTACT = 7 GROUP_REASON_NO_ANSWER = 8 GROUP_REASON_RENAMED = 9 GROUP_REASON_PERMISSION_DENIED = 10 GROUP_REASON_SEPARATED = 11 PRESENCE_TYPE_UNSET = 0 PRESENCE_TYPE_OFFLINE = 1 PRESENCE_TYPE_AVAILABLE = 2 PRESENCE_TYPE_AWAY = 3 PRESENCE_TYPE_XA = 4 PRESENCE_TYPE_HIDDEN = 5 PRESENCE_TYPE_BUSY = 6 PRESENCE_TYPE_UNKNOWN = 7 PRESENCE_TYPE_ERROR = 8 ERROR = tp_name_prefix + '.Error' INVALID_ARGUMENT = ERROR + '.InvalidArgument' INVALID_HANDLE = ERROR + '.InvalidHandle' NOT_IMPLEMENTED = ERROR + '.NotImplemented' NOT_AVAILABLE = ERROR + '.NotAvailable' PERMISSION_DENIED = ERROR + '.PermissionDenied' CANCELLED = ERROR + '.Cancelled' NOT_YOURS = ERROR + '.NotYours' DISCONNECTED = ERROR + '.Disconnected' NOT_CAPABLE = ERROR + '.NotCapable' TUBE_PARAMETERS = CHANNEL_IFACE_TUBE + '.Parameters' TUBE_STATE = CHANNEL_IFACE_TUBE + '.State' STREAM_TUBE_SERVICE = CHANNEL_TYPE_STREAM_TUBE + '.Service' DBUS_TUBE_SERVICE_NAME = CHANNEL_TYPE_DBUS_TUBE + '.ServiceName' DBUS_TUBE_DBUS_NAMES = CHANNEL_TYPE_DBUS_TUBE + '.DBusNames' TUBE_CHANNEL_STATE_LOCAL_PENDING = 0 TUBE_CHANNEL_STATE_REMOTE_PENDING = 1 TUBE_CHANNEL_STATE_OPEN = 2 TUBE_CHANNEL_STATE_NOT_OFFERED = 3 MEDIA_STREAM_TYPE_AUDIO = 0 MEDIA_STREAM_TYPE_VIDEO = 1 SOCKET_ADDRESS_TYPE_UNIX = 0 SOCKET_ADDRESS_TYPE_ABSTRACT_UNIX = 1 SOCKET_ADDRESS_TYPE_IPV4 = 2 SOCKET_ADDRESS_TYPE_IPV6 = 3 SOCKET_ACCESS_CONTROL_LOCALHOST = 0 SOCKET_ACCESS_CONTROL_PORT = 1 SOCKET_ACCESS_CONTROL_NETMASK = 2 SOCKET_ACCESS_CONTROL_CREDENTIALS = 3 TUBE_STATE_LOCAL_PENDING = 0 TUBE_STATE_REMOTE_PENDING = 1 TUBE_STATE_OPEN = 2 TUBE_STATE_NOT_OFFERED = 3 TUBE_TYPE_DBUS = 0 TUBE_TYPE_STREAM = 1 MEDIA_STREAM_DIRECTION_NONE = 0 MEDIA_STREAM_DIRECTION_SEND = 1 MEDIA_STREAM_DIRECTION_RECEIVE = 2 MEDIA_STREAM_DIRECTION_BIDIRECTIONAL = 3 MEDIA_STREAM_PENDING_LOCAL_SEND = 1 MEDIA_STREAM_PENDING_REMOTE_SEND = 2 MEDIA_STREAM_TYPE_AUDIO = 0 MEDIA_STREAM_TYPE_VIDEO = 1 MEDIA_STREAM_STATE_DISCONNECTED = 0 MEDIA_STREAM_STATE_CONNECTING = 1 MEDIA_STREAM_STATE_CONNECTED = 2 MEDIA_STREAM_DIRECTION_NONE = 0 MEDIA_STREAM_DIRECTION_SEND = 1 MEDIA_STREAM_DIRECTION_RECEIVE = 2 MEDIA_STREAM_DIRECTION_BIDIRECTIONAL = 3 SERVICE_POINT_TYPE_NONE = 0 SERVICE_POINT_TYPE_EMERGENCY = 1 SERVICE_POINT_TYPE_COUNSELING = 2 CLIENT = tp_name_prefix + '.Client' CLIENT_PATH = tp_path_prefix + '/Client' OBSERVER = tp_name_prefix + '.Client.Observer' APPROVER = tp_name_prefix + '.Client.Approver' HANDLER = tp_name_prefix + '.Client.Handler' CLIENT_IFACE_REQUESTS = CLIENT + '.Interface.Requests' ACCOUNT = tp_name_prefix + '.Account' ACCOUNT_IFACE_AVATAR = ACCOUNT + '.Interface.Avatar' ACCOUNT_IFACE_ADDRESSING = ACCOUNT + '.Interface.Addressing' ACCOUNT_IFACE_HIDDEN = ACCOUNT + '.Interface.Hidden.DRAFT1' ACCOUNT_IFACE_NOKIA_CONDITIONS = 'com.nokia.Account.Interface.Conditions' ACCOUNT_PATH_PREFIX = tp_path_prefix + '/Account/' AM = tp_name_prefix + '.AccountManager' AM_IFACE_HIDDEN = AM + '.Interface.Hidden.DRAFT1' AM_PATH = tp_path_prefix + '/AccountManager' CR = tp_name_prefix + '.ChannelRequest' CDO = tp_name_prefix + '.ChannelDispatchOperation' CD = tp_name_prefix + '.ChannelDispatcher' CD_IFACE_OP_LIST = tp_name_prefix + '.ChannelDispatcher.Interface.OperationList' CD_PATH = tp_path_prefix + '/ChannelDispatcher' CD_REDISPATCH = CD + '.Interface.Redispatch.DRAFT' MC = tp_name_prefix + '.MissionControl5' MC_PATH = tp_path_prefix + '/MissionControl5' TESTDOT = "org.freedesktop.Telepathy.MC.Test." TESTSLASH = "/org/freedesktop/Telepathy/MC/Test/" TEST_DBUS_ACCOUNT_SERVICE = TESTDOT + "DBusAccountService" TEST_DBUS_ACCOUNT_SERVICE_PATH = TESTSLASH + "DBusAccountService" TEST_DBUS_ACCOUNT_SERVICE_IFACE = TEST_DBUS_ACCOUNT_SERVICE TEST_DBUS_ACCOUNT_PLUGIN_PATH = TESTSLASH + "DBusAccountPlugin" TEST_DBUS_ACCOUNT_PLUGIN_IFACE = TESTDOT + "DBusAccountPlugin" PARAM_FLAG_REQUIRED = 1 PARAM_FLAG_REGISTER = 2 PARAM_FLAG_HAS_DEFAULT = 4 PARAM_FLAG_SECRET = 8 PARAM_FLAG_DBUS_PROPERTY = 16 telepathy-mission-control-5.16.4/tests/twisted/fakeconnectivity.py0000644000175000017500000001413112762067123026567 0ustar00gkiagiagkiagia00000000000000import dbus from dbus.service import Object, method, signal import sys class FakeConnectivity(object): NM_BUS_NAME = 'org.freedesktop.NetworkManager' NM_PATH = '/org/freedesktop/NetworkManager' NM_PATH_SETTINGS = NM_PATH + '/Settings' NM_INTERFACE = NM_BUS_NAME NM_INTERFACE_SETTINGS = NM_INTERFACE + '.Settings' NM_STATE_UNKNOWN = 0 NM_STATE_ASLEEP = 10 NM_STATE_DISCONNECTED = 20 NM_STATE_DISCONNECTING = 30 NM_STATE_CONNECTING = 40 NM_STATE_CONNECTED_LOCAL = 50 NM_STATE_CONNECTED_SITE = 60 NM_STATE_CONNECTED_GLOBAL = 70 # Our fake GNetworkMonitor uses the ConnMan 0.79 D-Bus API - we don't # have any special support for ConnMan any more, but it's as good an # API as any. The important thing is that it's not NM, because we *do* # have a bit of special support for that. CONNMAN_BUS_NAME = 'net.connman' CONNMAN_PATH = '/' CONNMAN_INTERFACE = 'net.connman.Manager' CONNMAN_OFFLINE = "offline" CONNMAN_ONLINE = "online" def __init__(self, q, bus, initially_online): self.q = q self.bus = bus self.nm_name_ref = dbus.service.BusName(self.NM_BUS_NAME, bus) self.connman_name_ref = dbus.service.BusName(self.CONNMAN_BUS_NAME, bus) q.add_dbus_method_impl(self.NM_GetPermissions, path=self.NM_PATH, interface=self.NM_INTERFACE, method='GetPermissions') q.add_dbus_method_impl(self.NM_Get, path=self.NM_PATH, interface=dbus.PROPERTIES_IFACE, method='Get', predicate=lambda e: e.args[0] == self.NM_INTERFACE) q.add_dbus_method_impl(self.NM_GetAll, path=self.NM_PATH, interface=dbus.PROPERTIES_IFACE, method='GetAll', predicate=lambda e: e.args[0] == self.NM_INTERFACE) q.add_dbus_method_impl(self.NM_GetDevices, path=self.NM_PATH, interface=self.NM_INTERFACE, method='GetDevices') q.add_dbus_method_impl(self.NM_Settings_Get, path=self.NM_PATH_SETTINGS, interface=dbus.PROPERTIES_IFACE, method='Get', predicate=lambda e: e.args[0] == self.NM_INTERFACE_SETTINGS) q.add_dbus_method_impl(self.NM_Settings_GetAll, path=self.NM_PATH_SETTINGS, interface=dbus.PROPERTIES_IFACE, method='GetAll', predicate=lambda e: e.args[0] == self.NM_INTERFACE_SETTINGS) q.add_dbus_method_impl(self.ConnMan_GetProperties, path=self.CONNMAN_PATH, interface=self.CONNMAN_INTERFACE, method='GetProperties') self.change_state(initially_online) def NM_GetPermissions(self, e): permissions = { self.NM_INTERFACE + '.network-control': 'yes', self.NM_INTERFACE + '.enable-disable-wwan': 'yes', self.NM_INTERFACE + '.settings.modify.own': 'yes', self.NM_INTERFACE + '.wifi.share.protected': 'yes', self.NM_INTERFACE + '.wifi.share.open': 'yes', self.NM_INTERFACE + '.enable-disable-network': 'yes', self.NM_INTERFACE + '.enable-disable-wimax': 'yes', self.NM_INTERFACE + '.sleep-wake': 'no', self.NM_INTERFACE + '.enable-disable-wifi': 'yes', self.NM_INTERFACE + '.settings.modify.system': 'auth', self.NM_INTERFACE + '.settings.modify.hostname': 'auth', } self.q.dbus_return(e.message, permissions, signature='a{ss}') def nm_props(self): return { 'NetworkingEnabled': True, 'WirelessEnabled': True, 'WirelessHardwareEnabled': True, 'WwanEnabled': False, 'WwanHardwareEnabled': True, 'WimaxEnabled': True, 'WimaxHardwareEnabled': True, 'ActiveConnections': dbus.Array([], signature='o'), 'Version': '0.9.0', 'State': dbus.UInt32(self.nm_state), } def NM_Get(self, e): self.q.dbus_return(e.message, self.nm_props()[e.args[1]], signature='v') def NM_GetAll(self, e): self.q.dbus_return(e.message, self.nm_props(), signature='a{sv}') def NM_GetDevices(self, e): self.q.dbus_return(e.message, [], signature='ao') def nm_settings_props(self): return { 'CanModify': False, 'Hostname': 'localhost', 'Connections': dbus.Array([], signature='o'), } def NM_Settings_Get(self, e): self.q.dbus_return(e.message, self.nm_settings_props()[e.args[1]], signature='v') def NM_Settings_GetAll(self, e): self.q.dbus_return(e.message, self.nm_settings_props(), signature='a{sv}') def Connman_props(self): return { 'OfflineMode': False, 'SessionMode': False, 'State': self.connman_state, } def ConnMan_GetProperties(self, e): self.q.dbus_return(e.message, self.Connman_props(), signature='a{sv}') def change_state(self, online, indeterminate=False): if indeterminate: self.nm_state = self.NM_STATE_DISCONNECTING # keep the previous "ConnMan" (GNetworkMonitor) state; # any other GNetworkMonitor would probably do the same # while trying to disconnect, because e.g. netlink will say the # interface is still up elif online: self.nm_state = self.NM_STATE_CONNECTED_GLOBAL self.connman_state = self.CONNMAN_ONLINE else: self.nm_state = self.NM_STATE_DISCONNECTED self.connman_state = self.CONNMAN_OFFLINE self.q.dbus_emit(self.NM_PATH, self.NM_INTERFACE, 'PropertiesChanged', { "State": dbus.UInt32(self.nm_state) }, signature='a{sv}') self.q.dbus_emit(self.NM_PATH, self.NM_INTERFACE, 'StateChanged', self.nm_state, signature='u') if not indeterminate: self.q.dbus_emit(self.CONNMAN_PATH, self.CONNMAN_INTERFACE, 'PropertyChanged', "State", self.connman_state, signature='sv') def go_online(self): self.change_state(True) def go_offline(self): self.change_state(False) def go_indeterminate(self): self.change_state(None, True) telepathy-mission-control-5.16.4/tests/twisted/accounts/0000755000175000017500000000000012762352250024465 5ustar00gkiagiagkiagia00000000000000telepathy-mission-control-5.16.4/tests/twisted/accounts/README0000644000175000017500000000026212735241312025341 0ustar00gkiagiagkiagia00000000000000Directory for twisted test to write the accounts.cfg file. $MC_ACCOUNT_DIR is set to this directory in the twisted environment. accounts.cfg is deleted before running any test. telepathy-mission-control-5.16.4/tests/twisted/dbus-account-plugin.h0000644000175000017500000000420112735241312026673 0ustar00gkiagiagkiagia00000000000000/* * A demonstration plugin that diverts account storage to D-Bus, where the * regression tests can manipulate it. * * Copyright © 2010 Nokia Corporation * Copyright © 2010-2012 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef TEST_DBUS_ACCOUNT_PLUGIN_H #define TEST_DBUS_ACCOUNT_PLUGIN_H #include typedef struct _TestDBusAccountPlugin TestDBusAccountPlugin; typedef struct _TestDBusAccountPluginClass TestDBusAccountPluginClass; typedef struct _TestDBusAccountPluginPrivate TestDBusAccountPluginPrivate; GType test_dbus_account_plugin_get_type (void); #define TEST_TYPE_DBUS_ACCOUNT_PLUGIN \ (test_dbus_account_plugin_get_type ()) #define TEST_DBUS_ACCOUNT_PLUGIN(obj) \ (G_TYPE_CHECK_INSTANCE_CAST ((obj), TEST_TYPE_DBUS_ACCOUNT_PLUGIN, \ TestDBusAccountPlugin)) #define TEST_DBUS_ACCOUNT_PLUGIN_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST ((klass), TEST_TYPE_DBUS_ACCOUNT_PLUGIN, \ TestDBusAccountPluginClass)) #define TEST_IS_DBUS_ACCOUNT_PLUGIN(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TEST_TYPE_DBUS_ACCOUNT_PLUGIN)) #define TEST_IS_DBUS_ACCOUNT_PLUGIN_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE ((klass), TEST_TYPE_DBUS_ACCOUNT_PLUGIN)) #define TEST_DBUS_ACCOUNT_PLUGIN_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), TEST_TYPE_DBUS_ACCOUNT_PLUGIN, \ TestDBusAccountPluginClass)) #endif telepathy-mission-control-5.16.4/tests/twisted/dispatcher/0000755000175000017500000000000012762352250024774 5ustar00gkiagiagkiagia00000000000000telepathy-mission-control-5.16.4/tests/twisted/dispatcher/dispatch-rejected-by-mini-plugin.py0000644000175000017500000002113212735242352033566 0ustar00gkiagiagkiagia00000000000000# Copyright (C) 2009 Nokia Corporation # Copyright (C) 2009 Collabora Ltd. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA # 02110-1301 USA import dbus """Regression test for plugins rejecting an incoming channel immediately. """ import dbus import dbus.service from servicetest import EventPattern, tp_name_prefix, tp_path_prefix, \ call_async, sync_dbus from mctest import exec_test, SimulatedConnection, SimulatedClient, \ create_fakecm_account, enable_fakecm_account, SimulatedChannel, \ expect_client_setup import constants as cs def test(q, bus, mc): params = dbus.Dictionary({"account": "someguy@example.com", "password": "secrecy"}, signature='sv') cm_name_ref, account = create_fakecm_account(q, bus, mc, params) conn = enable_fakecm_account(q, bus, mc, account, params) text_fixed_properties = dbus.Dictionary({ cs.CHANNEL + '.TargetHandleType': cs.HT_CONTACT, cs.CHANNEL + '.ChannelType': cs.CHANNEL_TYPE_TEXT, }, signature='sv') # Throughout this entire test, we should never be asked to approve or # handle a channel. forbidden = [ EventPattern('dbus-method-call', method='AddDispatchOperation'), EventPattern('dbus-method-call', method='HandleChannels'), ] q.forbid_events(forbidden) # Two clients want to observe, approve and handle channels empathy = SimulatedClient(q, bus, 'Empathy', observe=[text_fixed_properties], approve=[text_fixed_properties], handle=[text_fixed_properties], bypass_approval=False) kopete = SimulatedClient(q, bus, 'Kopete', observe=[text_fixed_properties], approve=[text_fixed_properties], handle=[text_fixed_properties], bypass_approval=False) # wait for MC to download the properties expect_client_setup(q, [empathy, kopete]) # subscribe to the OperationList interface (MC assumes that until this # property has been retrieved once, nobody cares) cd = bus.get_object(cs.CD, cs.CD_PATH) cd_props = dbus.Interface(cd, cs.PROPERTIES_IFACE) assert cd_props.Get(cs.CD_IFACE_OP_LIST, 'DispatchOperations') == [] # This ID is special-cased by the mcp-plugin plugin, which rejects # channels to or from it by destroying them, without waiting for observers # to return target = 'rick.astley@example.net' channel_properties = dbus.Dictionary(text_fixed_properties, signature='sv') channel_properties[cs.CHANNEL + '.TargetID'] = target channel_properties[cs.CHANNEL + '.TargetHandle'] = \ conn.ensure_handle(cs.HT_CONTACT, target) channel_properties[cs.CHANNEL + '.InitiatorID'] = target channel_properties[cs.CHANNEL + '.InitiatorHandle'] = \ conn.ensure_handle(cs.HT_CONTACT, target) channel_properties[cs.CHANNEL + '.Requested'] = False channel_properties[cs.CHANNEL + '.Interfaces'] = \ dbus.Array([cs.CHANNEL_IFACE_DESTROYABLE, cs.CHANNEL_IFACE_GROUP, ],signature='s') chan = SimulatedChannel(conn, channel_properties, group=True) chan.announce() # A channel dispatch operation is created e = q.expect('dbus-signal', path=cs.CD_PATH, interface=cs.CD_IFACE_OP_LIST, signal='NewDispatchOperation') cdo_path = e.args[0] cdo_properties = e.args[1] assert cdo_properties[cs.CDO + '.Account'] == account.object_path assert cdo_properties[cs.CDO + '.Connection'] == conn.object_path assert cs.CDO + '.Interfaces' in cdo_properties handlers = cdo_properties[cs.CDO + '.PossibleHandlers'][:] handlers.sort() assert handlers == [cs.tp_name_prefix + '.Client.Empathy', cs.tp_name_prefix + '.Client.Kopete'], handlers # The plugin realises we've been rickrolled, and responds. It calls Destroy # even though neither Empathy nor Kopete has returned from ObserveChannels # yet destruction, e, k = q.expect_many( EventPattern('dbus-method-call', path=chan.object_path, interface=cs.CHANNEL_IFACE_DESTROYABLE, method='Destroy', args=[], handled=False), EventPattern('dbus-method-call', path=empathy.object_path, interface=cs.OBSERVER, method='ObserveChannels', handled=False), EventPattern('dbus-method-call', path=kopete.object_path, interface=cs.OBSERVER, method='ObserveChannels', handled=False), ) # treat the destruction like Close chan.Close(destruction) # Both Observers indicate that they are ready to proceed (somewhat late) q.dbus_return(k.message, signature='') q.dbus_return(e.message, signature='') # When the Observers have returned, the CDO finishes q.expect_many( EventPattern('dbus-signal', path=cdo_path, interface=cs.CDO, signal='Finished'), EventPattern('dbus-signal', path=cs.CD_PATH, interface=cs.CD_IFACE_OP_LIST, signal='DispatchOperationFinished', args=[cdo_path]), ) # This ID is also special-cased target = 'mc.hammer@example.net' channel_properties = dbus.Dictionary(text_fixed_properties, signature='sv') channel_properties[cs.CHANNEL + '.TargetID'] = target channel_properties[cs.CHANNEL + '.TargetHandle'] = \ conn.ensure_handle(cs.HT_CONTACT, target) channel_properties[cs.CHANNEL + '.InitiatorID'] = target channel_properties[cs.CHANNEL + '.InitiatorHandle'] = \ conn.ensure_handle(cs.HT_CONTACT, target) channel_properties[cs.CHANNEL + '.Requested'] = False channel_properties[cs.CHANNEL + '.Interfaces'] = \ dbus.Array([cs.CHANNEL_IFACE_DESTROYABLE, cs.CHANNEL_IFACE_GROUP, ],signature='s') chan = SimulatedChannel(conn, channel_properties, group=True) chan.announce() # A channel dispatch operation is created e = q.expect('dbus-signal', path=cs.CD_PATH, interface=cs.CD_IFACE_OP_LIST, signal='NewDispatchOperation') cdo_path = e.args[0] cdo_properties = e.args[1] assert cdo_properties[cs.CDO + '.Account'] == account.object_path assert cdo_properties[cs.CDO + '.Connection'] == conn.object_path assert cs.CDO + '.Interfaces' in cdo_properties handlers = cdo_properties[cs.CDO + '.PossibleHandlers'][:] handlers.sort() assert handlers == [cs.tp_name_prefix + '.Client.Empathy', cs.tp_name_prefix + '.Client.Kopete'], handlers # The plugin realises it's MC Hammer, and responds, but its response waits # for the observers to return e, k = q.expect_many( EventPattern('dbus-method-call', path=empathy.object_path, interface=cs.OBSERVER, method='ObserveChannels', handled=False), EventPattern('dbus-method-call', path=kopete.object_path, interface=cs.OBSERVER, method='ObserveChannels', handled=False), ) sync_dbus(bus, q, account) # Both Observers indicate that they are ready to proceed q.dbus_return(k.message, signature='') q.dbus_return(e.message, signature='') _, _, e = q.expect_many( EventPattern('dbus-signal', path=cdo_path, interface=cs.CDO, signal='Finished'), EventPattern('dbus-signal', path=cs.CD_PATH, interface=cs.CD_IFACE_OP_LIST, signal='DispatchOperationFinished', args=[cdo_path]), EventPattern('dbus-method-call', path=chan.object_path, interface=cs.CHANNEL_IFACE_GROUP, method='RemoveMembersWithReason', args=[[conn.self_handle], "Can't touch this", cs.GROUP_REASON_PERMISSION_DENIED], handled=False), ) q.dbus_return(e.message, signature='') chan.close() if __name__ == '__main__': exec_test(test, {}) telepathy-mission-control-5.16.4/tests/twisted/dispatcher/dispatch-activatable.py0000644000175000017500000001251612735242352031430 0ustar00gkiagiagkiagia00000000000000# Copyright (C) 2009 Nokia Corporation # Copyright (C) 2009 Collabora Ltd. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA # 02110-1301 USA import dbus """Regression test for dispatching an incoming AbiWord StreamTube channel. """ import dbus import dbus.service from servicetest import EventPattern, tp_name_prefix, tp_path_prefix, \ call_async from mctest import exec_test, SimulatedConnection, SimulatedClient, \ create_fakecm_account, enable_fakecm_account, SimulatedChannel, \ expect_client_setup import constants as cs def test(q, bus, mc): params = dbus.Dictionary({"account": "someguy@example.com", "password": "secrecy"}, signature='sv') cm_name_ref, account = create_fakecm_account(q, bus, mc, params) conn = enable_fakecm_account(q, bus, mc, account, params) abiword_fixed_properties = dbus.Dictionary({ cs.CHANNEL_TYPE_STREAM_TUBE + '.Service': 'x-abiword', cs.CHANNEL + '.ChannelType': cs.CHANNEL_TYPE_STREAM_TUBE, }, signature='sv') # subscribe to the OperationList interface (MC assumes that until this # property has been retrieved once, nobody cares) cd = bus.get_object(cs.CD, cs.CD_PATH) cd_props = dbus.Interface(cd, cs.PROPERTIES_IFACE) assert cd_props.Get(cs.CD_IFACE_OP_LIST, 'DispatchOperations') == [] channel_properties = dbus.Dictionary(abiword_fixed_properties, signature='sv') channel_properties[cs.CHANNEL + '.TargetHandleType'] = cs.HT_CONTACT channel_properties[cs.CHANNEL + '.TargetID'] = 'juliet' channel_properties[cs.CHANNEL + '.TargetHandle'] = \ conn.ensure_handle(cs.HT_CONTACT, 'juliet') channel_properties[cs.CHANNEL + '.InitiatorID'] = 'juliet' channel_properties[cs.CHANNEL + '.InitiatorHandle'] = \ conn.ensure_handle(cs.HT_CONTACT, 'juliet') channel_properties[cs.CHANNEL + '.Requested'] = False channel_properties[cs.CHANNEL + '.Interfaces'] = dbus.Array(signature='s') chan = SimulatedChannel(conn, channel_properties) chan.announce() # A channel dispatch operation is created e = q.expect('dbus-signal', path=cs.CD_PATH, interface=cs.CD_IFACE_OP_LIST, signal='NewDispatchOperation') cdo_path = e.args[0] cdo_properties = e.args[1] assert cdo_properties[cs.CDO + '.Account'] == account.object_path assert cdo_properties[cs.CDO + '.Connection'] == conn.object_path assert cs.CDO + '.Interfaces' in cdo_properties handlers = cdo_properties[cs.CDO + '.PossibleHandlers'][:] assert handlers == [cs.tp_name_prefix + '.Client.AbiWord'], handlers assert cs.CD_IFACE_OP_LIST in cd_props.Get(cs.CD, 'Interfaces') assert cd_props.Get(cs.CD_IFACE_OP_LIST, 'DispatchOperations') ==\ [(cdo_path, cdo_properties)] cdo = bus.get_object(cs.CD, cdo_path) cdo_iface = dbus.Interface(cdo, cs.CDO) cdo_props_iface = dbus.Interface(cdo, cs.PROPERTIES_IFACE) assert cdo_props_iface.Get(cs.CDO, 'Interfaces') == \ cdo_properties[cs.CDO + '.Interfaces'] assert cdo_props_iface.Get(cs.CDO, 'Connection') == conn.object_path assert cdo_props_iface.Get(cs.CDO, 'Account') == account.object_path assert cdo_props_iface.Get(cs.CDO, 'Channels') == [(chan.object_path, channel_properties)] assert cdo_props_iface.Get(cs.CDO, 'PossibleHandlers') == \ cdo_properties[cs.CDO + '.PossibleHandlers'] abiword_object_path = cs.tp_path_prefix + '/Client/AbiWord' # There are no approvers so the only Handler is asked to handle the # channels # The fake AbiWord implementation is run e = q.expect('dbus-signal', path=cs.tp_path_prefix + '/RegressionTests', interface=cs.tp_name_prefix + '.RegressionTests', signal='FakeStartup', args=[cs.tp_name_prefix + '.Client.AbiWord'], ) # We take on its identity to be able to continue with the test abiword = SimulatedClient(q, bus, 'AbiWord', handle=[abiword_fixed_properties]) e = q.expect('dbus-method-call', path=abiword.object_path, interface=cs.HANDLER, method='HandleChannels', handled=False) # AbiWord accepts the channels q.dbus_return(e.message, signature='') # FIXME: this isn't currently emitted (part of the same bug as emitting # it as soon as HandleChannels is called) #q.expect('dbus-signal', path=cdo_path, signal='Finished') #q.expect('dbus-signal', path=cs.CD_PATH, # signal='DispatchOperationFinished', args=[cdo_path]) # Now there are no more active channel dispatch operations assert cd_props.Get(cs.CD_IFACE_OP_LIST, 'DispatchOperations') == [] if __name__ == '__main__': exec_test(test, {}) telepathy-mission-control-5.16.4/tests/twisted/dispatcher/delay-then-call-handle-with.py0000644000175000017500000001314612735242352032521 0ustar00gkiagiagkiagia00000000000000# Copyright (C) 2010 Collabora Ltd. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA # 02110-1301 USA import dbus import dbus.bus import dbus.service from servicetest import EventPattern, tp_name_prefix, tp_path_prefix, \ call_async, sync_dbus from mctest import exec_test, SimulatedConnection, SimulatedClient, \ create_fakecm_account, enable_fakecm_account, SimulatedChannel, \ expect_client_setup import constants as cs def test(q, bus, mc): params = dbus.Dictionary({"account": "someguy@example.com", "password": "secrecy"}, signature='sv') cm_name_ref, account = create_fakecm_account(q, bus, mc, params) conn = enable_fakecm_account(q, bus, mc, account, params) text_fixed_properties = dbus.Dictionary({ cs.CHANNEL + '.TargetHandleType': cs.HT_CONTACT, cs.CHANNEL + '.ChannelType': cs.CHANNEL_TYPE_TEXT, }, signature='sv') # Empathy is an observer for text channels with # DelayApprovers=TRUE. empathy = SimulatedClient(q, bus, 'Empathy', observe=[text_fixed_properties], approve=[], handle=[], delay_approvers=True) # Kopete is an approver and handler for text channels. kopete = SimulatedClient(q, bus, 'Kopete', observe=[], approve=[text_fixed_properties], handle=[text_fixed_properties]) expect_client_setup(q, [empathy, kopete]) # subscribe to the OperationList interface (MC assumes that until this # property has been retrieved once, nobody cares) cd = bus.get_object(cs.CD, cs.CD_PATH) cd_props = dbus.Interface(cd, cs.PROPERTIES_IFACE) assert cd_props.Get(cs.CD_IFACE_OP_LIST, 'DispatchOperations') == [] # A text channel appears! channel_properties = dbus.Dictionary(text_fixed_properties, signature='sv') channel_properties[cs.CHANNEL + '.TargetID'] = 'juliet' channel_properties[cs.CHANNEL + '.TargetHandle'] = \ conn.ensure_handle(cs.HT_CONTACT, 'juliet') channel_properties[cs.CHANNEL + '.InitiatorID'] = 'juliet' channel_properties[cs.CHANNEL + '.InitiatorHandle'] = \ conn.ensure_handle(cs.HT_CONTACT, 'juliet') channel_properties[cs.CHANNEL + '.Requested'] = False channel_properties[cs.CHANNEL + '.Interfaces'] = dbus.Array(signature='s') chan = SimulatedChannel(conn, channel_properties) chan.announce() e = q.expect('dbus-signal', path=cs.CD_PATH, interface=cs.CD_IFACE_OP_LIST, signal='NewDispatchOperation') cdo_path = e.args[0] cdo = bus.get_object(cs.CD, cdo_path) cdo_iface = dbus.Interface(cdo, cs.CDO) cdo_props_iface = dbus.Interface(cdo, cs.PROPERTIES_IFACE) # Empathy, the observer, gets the channel to observe. Because it # has DelayApprovers=TRUE, Kopete should not have # AddDispatchOperation called on it until Empathy returns from # ObserveChannels, but Empathy will call HandleWith(Kopete) on the # CDO so we should ensure ADO is never called on any approver. forbidden = [EventPattern('dbus-method-call', interface=cs.APPROVER, method='AddDispatchOperation')] q.forbid_events(forbidden) o = q.expect('dbus-method-call', path=empathy.object_path, interface=cs.OBSERVER, method='ObserveChannels', handled=False) # Waste a little time here and there. We can't call sync_dbus # here because it calls Ping and libdbus returns from Ping # synchronously and doesn't turn the main loop handle enough. call_async(q, cd_props, 'Get', cs.CD_IFACE_OP_LIST, 'DispatchOperations') event = q.expect('dbus-return', method='Get') # We can't call this synchronously because MC won't return until # HandleChannels returns. call_async(q, cdo_iface, 'HandleWith', cs.CLIENT + '.Kopete') # Finally return from ObserveChannels. q.dbus_return(o.message, bus=bus, signature='') h = q.expect('dbus-method-call', path=kopete.object_path, interface=cs.HANDLER, method='HandleChannels', handled=False) # Waste a little time here and there. We can't call sync_dbus # here because it calls Ping and libdbus returns from Ping # synchronously and doesn't turn the main loop handle enough. call_async(q, cd_props, 'Get', cs.CD_IFACE_OP_LIST, 'DispatchOperations') event = q.expect('dbus-return', method='Get') # Return from HandleChannels. q.dbus_return(h.message, bus=bus, signature='') # MC finally returns from HandleWith. q.expect('dbus-return', method='HandleWith') q.expect_many( EventPattern('dbus-signal', interface=cs.CDO, signal='Finished'), EventPattern('dbus-signal', interface=cs.CD_IFACE_OP_LIST, signal='DispatchOperationFinished'), ) # Now there are no more active channel dispatch operations assert cd_props.Get(cs.CD_IFACE_OP_LIST, 'DispatchOperations') == [] q.unforbid_events(forbidden) if __name__ == '__main__': exec_test(test, {}) telepathy-mission-control-5.16.4/tests/twisted/dispatcher/create-no-preferred-handler.py0000644000175000017500000001720112735242352032614 0ustar00gkiagiagkiagia00000000000000# Copyright (C) 2009 Nokia Corporation # Copyright (C) 2009 Collabora Ltd. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA # 02110-1301 USA import dbus """Regression test for https://bugs.freedesktop.org/show_bug.cgi?id=22169, and for http://bugs.freedesktop.org/show_bug.cgi?id=23935 """ import dbus import dbus.service from servicetest import EventPattern, tp_name_prefix, tp_path_prefix, \ call_async from mctest import exec_test, SimulatedConnection, SimulatedClient, \ create_fakecm_account, enable_fakecm_account, SimulatedChannel, \ expect_client_setup import constants as cs def test(q, bus, mc): params = dbus.Dictionary({"account": "someguy@example.com", "password": "secrecy"}, signature='sv') cm_name_ref, account = create_fakecm_account(q, bus, mc, params) conn = enable_fakecm_account(q, bus, mc, account, params) text_fixed_properties = dbus.Dictionary({ cs.CHANNEL + '.TargetHandleType': cs.HT_CONTACT, cs.CHANNEL + '.ChannelType': cs.CHANNEL_TYPE_TEXT, }, signature='sv') # Emulate a handler that only wants to get outgoing channels, as a # regression test for , # in which those didn't work text_requested = dbus.Dictionary(text_fixed_properties, signature='sv') text_requested[cs.CHANNEL + '.Requested'] = True client = SimulatedClient(q, bus, 'Empathy', observe=[text_fixed_properties], approve=[text_fixed_properties], handle=[text_requested], bypass_approval=False) # No Approver should be invoked at any point during this test, because the # Channel was Requested def fail_on_approval(e): raise AssertionError('Approver should not be invoked') q.add_dbus_method_impl(fail_on_approval, path=client.object_path, interface=cs.APPROVER, method='AddDispatchOperation') # wait for MC to download the properties expect_client_setup(q, [client]) test_channel_creation(q, bus, account, client, conn, False) test_channel_creation(q, bus, account, client, conn, True) def test_channel_creation(q, bus, account, client, conn, ensure): user_action_time = dbus.Int64(1238582606) cd = bus.get_object(cs.CD, cs.CD_PATH) cd_props = dbus.Interface(cd, cs.PROPERTIES_IFACE) # chat UI calls ChannelDispatcher.EnsureChannel or CreateChannel request = dbus.Dictionary({ cs.CHANNEL + '.ChannelType': cs.CHANNEL_TYPE_TEXT, cs.CHANNEL + '.TargetHandleType': cs.HT_CONTACT, cs.CHANNEL + '.TargetID': 'juliet', }, signature='sv') call_async(q, cd, (ensure and 'EnsureChannel' or 'CreateChannel'), account.object_path, request, user_action_time, "", dbus_interface=cs.CD) ret = q.expect('dbus-return', method=(ensure and 'EnsureChannel' or 'CreateChannel')) request_path = ret.value[0] # chat UI connects to signals and calls ChannelRequest.Proceed() cr = bus.get_object(cs.AM, request_path) request_props = cr.GetAll(cs.CR, dbus_interface=cs.PROPERTIES_IFACE) assert request_props['Account'] == account.object_path assert request_props['Requests'] == [request] assert request_props['UserActionTime'] == user_action_time assert request_props['PreferredHandler'] == "" assert request_props['Interfaces'] == [] cr.Proceed(dbus_interface=cs.CR) # FIXME: should the EnsureChannel/CreateChannel call, and the AddRequest # call, be in a defined order? Probably not though, since CMs and Clients # aren't meant to be the same process! cm_request_call, add_request_call = q.expect_many( EventPattern('dbus-method-call', interface=cs.CONN_IFACE_REQUESTS, method=(ensure and 'EnsureChannel' or 'CreateChannel'), path=conn.object_path, args=[request], handled=False), EventPattern('dbus-method-call', handled=False, interface=cs.CLIENT_IFACE_REQUESTS, method='AddRequest', path=client.object_path), ) assert add_request_call.args[0] == request_path request_props = add_request_call.args[1] assert request_props[cs.CR + '.Account'] == account.object_path assert request_props[cs.CR + '.Requests'] == [request] assert request_props[cs.CR + '.UserActionTime'] == user_action_time assert request_props[cs.CR + '.PreferredHandler'] == "" assert request_props[cs.CR + '.Interfaces'] == [] q.dbus_return(add_request_call.message, signature='') # Time passes. A channel is returned. channel_immutable = dbus.Dictionary(request) channel_immutable[cs.CHANNEL + '.InitiatorID'] = conn.self_ident channel_immutable[cs.CHANNEL + '.InitiatorHandle'] = conn.self_handle channel_immutable[cs.CHANNEL + '.Requested'] = True channel_immutable[cs.CHANNEL + '.Interfaces'] = \ dbus.Array([], signature='s') channel_immutable[cs.CHANNEL + '.TargetHandle'] = \ conn.ensure_handle(cs.HT_CONTACT, 'juliet') channel = SimulatedChannel(conn, channel_immutable) # this order of events is guaranteed by telepathy-spec (since 0.17.14) if ensure: q.dbus_return(cm_request_call.message, True, # <- Yours channel.object_path, channel.immutable, signature='boa{sv}') else: # Create q.dbus_return(cm_request_call.message, channel.object_path, channel.immutable, signature='oa{sv}') channel.announce() # Observer should get told, processing waits for it e = q.expect('dbus-method-call', path=client.object_path, interface=cs.OBSERVER, method='ObserveChannels', handled=False) assert e.args[0] == account.object_path, e.args assert e.args[1] == conn.object_path, e.args assert e.args[3] == '/', e.args # no dispatch operation assert e.args[4] == [request_path], e.args channels = e.args[2] assert len(channels) == 1, channels assert channels[0][0] == channel.object_path, channels assert channels[0][1] == channel_immutable, channels # Observer says "OK, go" q.dbus_return(e.message, signature='') # Handler is next e = q.expect('dbus-method-call', path=client.object_path, interface=cs.HANDLER, method='HandleChannels', handled=False) assert e.args[0] == account.object_path, e.args assert e.args[1] == conn.object_path, e.args channels = e.args[2] assert len(channels) == 1, channels assert channels[0][0] == channel.object_path, channels assert channels[0][1] == channel_immutable, channels assert e.args[3] == [request_path], e.args assert e.args[4] == user_action_time assert isinstance(e.args[5], dict) assert len(e.args) == 6 # Handler accepts the Channels q.dbus_return(e.message, signature='') # CR emits Succeeded q.expect('dbus-signal', path=request_path, interface=cs.CR, signal='Succeeded') # Close the channel channel.close() if __name__ == '__main__': exec_test(test, {}) telepathy-mission-control-5.16.4/tests/twisted/dispatcher/bypass-approval.py0000644000175000017500000002537012735242352030501 0ustar00gkiagiagkiagia00000000000000# Copyright (C) 2009 Nokia Corporation # Copyright (C) 2009 Collabora Ltd. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA # 02110-1301 USA import dbus """Regression test for dispatching an incoming Text channel with bypassed approval. """ import dbus import dbus.service from servicetest import EventPattern, tp_name_prefix, tp_path_prefix, \ call_async, sync_dbus from mctest import exec_test, SimulatedConnection, SimulatedClient, \ create_fakecm_account, enable_fakecm_account, SimulatedChannel, \ expect_client_setup import constants as cs text_fixed_properties = dbus.Dictionary({ cs.CHANNEL + '.ChannelType': cs.CHANNEL_TYPE_TEXT, }, signature='sv') contact_text_fixed_properties = dbus.Dictionary({ cs.CHANNEL + '.TargetHandleType': cs.HT_CONTACT, cs.CHANNEL + '.ChannelType': cs.CHANNEL_TYPE_TEXT, }, signature='sv') urgent_fixed_properties = dbus.Dictionary({ cs.CHANNEL + '.TargetHandleType': cs.HT_CONTACT, cs.CHANNEL + '.ChannelType': cs.CHANNEL_TYPE_TEXT, 'com.example.Urgency.Urgent': True, }, signature='sv') def announce_common(q, bus, empathy, kopete, account, conn, cd_props, urgent=False): if urgent: jid = 'friar.lawrence' else: jid = 'juliet' channel_properties = dbus.Dictionary(contact_text_fixed_properties, signature='sv') channel_properties[cs.CHANNEL + '.TargetID'] = jid channel_properties[cs.CHANNEL + '.TargetHandle'] = \ conn.ensure_handle(cs.HT_CONTACT, jid) channel_properties[cs.CHANNEL + '.InitiatorID'] = jid channel_properties[cs.CHANNEL + '.InitiatorHandle'] = \ conn.ensure_handle(cs.HT_CONTACT, jid) channel_properties[cs.CHANNEL + '.Requested'] = False channel_properties[cs.CHANNEL + '.Interfaces'] = dbus.Array(signature='s') if urgent: channel_properties['com.example.Urgency.Urgent'] = True chan = SimulatedChannel(conn, channel_properties) chan.announce() # A channel dispatch operation is created e = q.expect('dbus-signal', path=cs.CD_PATH, interface=cs.CD_IFACE_OP_LIST, signal='NewDispatchOperation') cdo_path = e.args[0] cdo_properties = e.args[1] assert cdo_properties[cs.CDO + '.Account'] == account.object_path assert cdo_properties[cs.CDO + '.Connection'] == conn.object_path assert cs.CDO + '.Interfaces' in cdo_properties handlers = cdo_properties[cs.CDO + '.PossibleHandlers'][:] if urgent: # The handler with BypassApproval is first assert handlers[0] == cs.tp_name_prefix + '.Client.Kopete.BypassApproval' # Kopete's filter is more specific than Empathy's, so it comes next assert handlers[1] == cs.tp_name_prefix + '.Client.Kopete' # Empathy's filter is the least specific, so it's last assert handlers[2] == cs.tp_name_prefix + '.Client.Empathy' assert len(handlers) == 3 else: handlers.sort() assert handlers == [cs.tp_name_prefix + '.Client.Empathy', cs.tp_name_prefix + '.Client.Kopete'], handlers assert cs.CD_IFACE_OP_LIST in cd_props.Get(cs.CD, 'Interfaces') assert cd_props.Get(cs.CD_IFACE_OP_LIST, 'DispatchOperations') ==\ [(cdo_path, cdo_properties)] cdo = bus.get_object(cs.CD, cdo_path) cdo_iface = dbus.Interface(cdo, cs.CDO) # Both Observers are told about the new channel e, k = q.expect_many( EventPattern('dbus-method-call', path=empathy.object_path, interface=cs.OBSERVER, method='ObserveChannels', handled=False), EventPattern('dbus-method-call', path=kopete.object_path, interface=cs.OBSERVER, method='ObserveChannels', handled=False), ) assert e.args[0] == account.object_path, e.args assert e.args[1] == conn.object_path, e.args assert e.args[3] == cdo_path, e.args assert e.args[4] == [], e.args # no requests satisfied channels = e.args[2] assert len(channels) == 1, channels assert channels[0][0] == chan.object_path, channels assert channels[0][1] == channel_properties, channels assert k.args == e.args return cdo_iface, chan, channel_properties, [e, k] def expect_and_exercise_approval(q, bus, chan, channel_properties, empathy, kopete, cdo_iface, cd_props): # The Approvers are next e, k = q.expect_many( EventPattern('dbus-method-call', path=empathy.object_path, interface=cs.APPROVER, method='AddDispatchOperation', handled=False), EventPattern('dbus-method-call', path=kopete.object_path, interface=cs.APPROVER, method='AddDispatchOperation', handled=False), ) assert e.args[0] == [(chan.object_path, channel_properties)] assert k.args == e.args # Both Approvers indicate that they are ready to proceed q.dbus_return(e.message, signature='') q.dbus_return(k.message, signature='') # Both Approvers now have a flashing icon or something, trying to get the # user's attention # The user responds to Empathy first call_async(q, cdo_iface, 'HandleWith', cs.tp_name_prefix + '.Client.Empathy') # Empathy is asked to handle the channels e = q.expect('dbus-method-call', path=empathy.object_path, interface=cs.HANDLER, method='HandleChannels', handled=False) # Empathy accepts the channels q.dbus_return(e.message, signature='') q.expect_many( EventPattern('dbus-return', method='HandleWith'), EventPattern('dbus-signal', interface=cs.CDO, signal='Finished'), EventPattern('dbus-signal', interface=cs.CD_IFACE_OP_LIST, signal='DispatchOperationFinished'), ) # Now there are no more active channel dispatch operations assert cd_props.Get(cs.CD_IFACE_OP_LIST, 'DispatchOperations') == [] def test(q, bus, mc): params = dbus.Dictionary({"account": "someguy@example.com", "password": "secrecy"}, signature='sv') cm_name_ref, account = create_fakecm_account(q, bus, mc, params) conn = enable_fakecm_account(q, bus, mc, account, params) # Two clients want to observe, approve and handle channels. Additionally, # Kopete recognises an "Urgent" flag on certain incoming channels, and # wants to bypass approval for them. empathy = SimulatedClient(q, bus, 'Empathy', observe=[text_fixed_properties], approve=[text_fixed_properties], handle=[text_fixed_properties], bypass_approval=False) kopete = SimulatedClient(q, bus, 'Kopete', observe=[contact_text_fixed_properties], approve=[contact_text_fixed_properties], handle=[contact_text_fixed_properties], bypass_approval=False) bypass = SimulatedClient(q, bus, 'Kopete.BypassApproval', observe=[], approve=[], handle=[urgent_fixed_properties], bypass_approval=True) # wait for MC to download the properties expect_client_setup(q, [empathy, kopete, bypass]) # subscribe to the OperationList interface (MC assumes that until this # property has been retrieved once, nobody cares) cd = bus.get_object(cs.CD, cs.CD_PATH) cd_props = dbus.Interface(cd, cs.PROPERTIES_IFACE) assert cd_props.Get(cs.CD_IFACE_OP_LIST, 'DispatchOperations') == [] # First, a non-urgent channel is created cdo_iface, chan, channel_properties, observe_events = announce_common(q, bus, empathy, kopete, account, conn, cd_props, False) # Both Observers indicate that they are ready to proceed for e in observe_events: q.dbus_return(e.message, signature='') expect_and_exercise_approval(q, bus, chan, channel_properties, empathy, kopete, cdo_iface, cd_props) # Now a channel that bypasses approval comes in. During this process, # we should never be asked to approve anything. approval = [ EventPattern('dbus-method-call', method='AddDispatchOperation'), ] q.forbid_events(approval) cdo_iface, chan, channel_properties, observe_events = announce_common(q, bus, empathy, kopete, account, conn, cd_props, True) # Both Observers indicate that they are ready to proceed for e in observe_events: q.dbus_return(e.message, signature='') # Kopete's BypassApproval part is asked to handle the channels e = q.expect('dbus-method-call', path=bypass.object_path, interface=cs.HANDLER, method='HandleChannels', handled=False) # Kopete accepts the channels q.dbus_return(e.message, signature='') q.unforbid_events(approval) # Regression test for fd.o #22670 closure = [ EventPattern('dbus-method-call', method='Close'), ] q.forbid_events(closure) bypass.release_name() sync_dbus(bus, q, mc) q.unforbid_events(closure) # Bring back that handler del bypass bypass = SimulatedClient(q, bus, 'Kopete.BypassApproval', observe=[], approve=[], handle=[urgent_fixed_properties], bypass_approval=True) expect_client_setup(q, [bypass]) # Another channel that bypasses approval comes in, but the handler that # bypasses approval fails. cdo_iface, chan, channel_properties, observe_events = announce_common(q, bus, empathy, kopete, account, conn, cd_props, True) # Both Observers indicate that they are ready to proceed for e in observe_events: q.dbus_return(e.message, signature='') # Kopete's BypassApproval part is asked to handle the channels e = q.expect('dbus-method-call', path=bypass.object_path, interface=cs.HANDLER, method='HandleChannels', handled=False) # Kopete's BypassApproval part fails to accept the channels q.dbus_raise(e.message, 'com.example.Broken', 'No way') # MC recovers by running the approvers and doing what they say expect_and_exercise_approval(q, bus, chan, channel_properties, empathy, kopete, cdo_iface, cd_props) if __name__ == '__main__': exec_test(test, {}) telepathy-mission-control-5.16.4/tests/twisted/dispatcher/bypass-observers.py0000644000175000017500000002472312735242352030670 0ustar00gkiagiagkiagia00000000000000# Copyright (C) 2009-2010 Nokia Corporation # Copyright (C) 2009-2010 Collabora Ltd. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA # 02110-1301 USA import dbus """Regression test for dispatching an incoming Text channel with bypassed observers. """ import dbus import dbus.service from servicetest import EventPattern, tp_name_prefix, tp_path_prefix, \ call_async, sync_dbus, assertEquals, assertLength, assertContains from mctest import exec_test, SimulatedConnection, SimulatedClient, \ create_fakecm_account, enable_fakecm_account, SimulatedChannel, \ expect_client_setup import constants as cs text_fixed_properties = dbus.Dictionary({ cs.CHANNEL + '.ChannelType': cs.CHANNEL_TYPE_TEXT, }, signature='sv') contact_text_fixed_properties = dbus.Dictionary({ cs.CHANNEL + '.TargetHandleType': cs.HT_CONTACT, cs.CHANNEL + '.ChannelType': cs.CHANNEL_TYPE_TEXT, }, signature='sv') secret_fixed_properties = dbus.Dictionary({ cs.CHANNEL + '.TargetHandleType': cs.HT_CONTACT, cs.CHANNEL + '.ChannelType': cs.CHANNEL_TYPE_TEXT, 'com.example.Secrecy.Secret': True, }, signature='sv') def announce_common(q, bus, empathy, kopete, account, conn, cd_props, secret=False): if secret: jid = 'friar.lawrence' else: jid = 'juliet' channel_properties = dbus.Dictionary(contact_text_fixed_properties, signature='sv') channel_properties[cs.CHANNEL + '.TargetID'] = jid channel_properties[cs.CHANNEL + '.TargetHandle'] = \ conn.ensure_handle(cs.HT_CONTACT, jid) channel_properties[cs.CHANNEL + '.InitiatorID'] = jid channel_properties[cs.CHANNEL + '.InitiatorHandle'] = \ conn.ensure_handle(cs.HT_CONTACT, jid) channel_properties[cs.CHANNEL + '.Requested'] = False channel_properties[cs.CHANNEL + '.Interfaces'] = dbus.Array(signature='s') if secret: channel_properties['com.example.Secrecy.Secret'] = True chan = SimulatedChannel(conn, channel_properties) chan.announce() # A channel dispatch operation is created e = q.expect('dbus-signal', path=cs.CD_PATH, interface=cs.CD_IFACE_OP_LIST, signal='NewDispatchOperation') cdo_path = e.args[0] cdo_properties = e.args[1] assertEquals(cdo_properties[cs.CDO + '.Account'], account.object_path) assertEquals(cdo_properties[cs.CDO + '.Connection'], conn.object_path) assertContains(cs.CDO + '.Interfaces', cdo_properties) handlers = cdo_properties[cs.CDO + '.PossibleHandlers'][:] if secret: # The handler with BypassApproval is first assertEquals(cs.tp_name_prefix + '.Client.Kopete.Bypasser', handlers[0]) else: handlers.sort() assertEquals([cs.tp_name_prefix + '.Client.Empathy', cs.tp_name_prefix + '.Client.Kopete'], handlers) assertContains(cs.CD_IFACE_OP_LIST, cd_props.Get(cs.CD, 'Interfaces')) assertEquals([(cdo_path, cdo_properties)], cd_props.Get(cs.CD_IFACE_OP_LIST, 'DispatchOperations')) cdo = bus.get_object(cs.CD, cdo_path) cdo_iface = dbus.Interface(cdo, cs.CDO) # Both Observers are told about the new channel if secret: observe_events = [] else: e, k = q.expect_many( EventPattern('dbus-method-call', path=empathy.object_path, interface=cs.OBSERVER, method='ObserveChannels', handled=False), EventPattern('dbus-method-call', path=kopete.object_path, interface=cs.OBSERVER, method='ObserveChannels', handled=False), ) assertEquals(account.object_path, e.args[0]) assertEquals(conn.object_path, e.args[1]) assertEquals(cdo_path, e.args[3]) assertEquals([], e.args[4]) # no requests satisfied channels = e.args[2] assertLength(1, channels) assertEquals(chan.object_path, channels[0][0]) assertEquals(channel_properties, channels[0][1]) assertEquals(k.args, e.args) observe_events = [e, k] return cdo_iface, chan, channel_properties, observe_events def expect_and_exercise_approval(q, bus, chan, channel_properties, empathy, kopete, cdo_iface, cd_props): # The Approvers are next e, k = q.expect_many( EventPattern('dbus-method-call', path=empathy.object_path, interface=cs.APPROVER, method='AddDispatchOperation', handled=False), EventPattern('dbus-method-call', path=kopete.object_path, interface=cs.APPROVER, method='AddDispatchOperation', handled=False), ) assertEquals([(chan.object_path, channel_properties)], e.args[0]) assertEquals(k.args, e.args) # Both Approvers indicate that they are ready to proceed q.dbus_return(e.message, signature='') q.dbus_return(k.message, signature='') # Both Approvers now have a flashing icon or something, trying to get the # user's attention # The user responds to Kopete first call_async(q, cdo_iface, 'HandleWith', cs.tp_name_prefix + '.Client.Kopete') # Kopete is asked to handle the channels e = q.expect('dbus-method-call', path=kopete.object_path, interface=cs.HANDLER, method='HandleChannels', handled=False) # Kopete accepts the channels q.dbus_return(e.message, signature='') q.expect_many( EventPattern('dbus-return', method='HandleWith'), EventPattern('dbus-signal', interface=cs.CDO, signal='Finished'), EventPattern('dbus-signal', interface=cs.CD_IFACE_OP_LIST, signal='DispatchOperationFinished'), ) # Now there are no more active channel dispatch operations assertEquals([], cd_props.Get(cs.CD_IFACE_OP_LIST, 'DispatchOperations')) def test(q, bus, mc): params = dbus.Dictionary({"account": "someguy@example.com", "password": "secrecy"}, signature='sv') cm_name_ref, account = create_fakecm_account(q, bus, mc, params) conn = enable_fakecm_account(q, bus, mc, account, params) # Two clients want to observe, approve and handle channels. Additionally, # Kopete recognises a "Secret" flag on certain incoming channels, and # wants to bypass approval and observers for them. Also, Empathy is a # respawnable observer, which wants to get notified of existing channels # if it gets restarted. empathy = SimulatedClient(q, bus, 'Empathy', observe=[text_fixed_properties], approve=[text_fixed_properties], handle=[text_fixed_properties], bypass_approval=False, wants_recovery=True) kopete = SimulatedClient(q, bus, 'Kopete', observe=[contact_text_fixed_properties], approve=[contact_text_fixed_properties], handle=[contact_text_fixed_properties], bypass_approval=False) bypass = SimulatedClient(q, bus, 'Kopete.Bypasser', observe=[], approve=[], handle=[secret_fixed_properties], bypass_approval=True, bypass_observers=True) # wait for MC to download the properties expect_client_setup(q, [empathy, kopete, bypass]) # subscribe to the OperationList interface (MC assumes that until this # property has been retrieved once, nobody cares) cd = bus.get_object(cs.CD, cs.CD_PATH) cd_props = dbus.Interface(cd, cs.PROPERTIES_IFACE) assertEquals([], cd_props.Get(cs.CD_IFACE_OP_LIST, 'DispatchOperations')) # First, a non-secret channel is created cdo_iface, chan, channel_properties, observe_events = announce_common(q, bus, empathy, kopete, account, conn, cd_props, False) # Both Observers indicate that they are ready to proceed for e in observe_events: q.dbus_return(e.message, signature='') expect_and_exercise_approval(q, bus, chan, channel_properties, empathy, kopete, cdo_iface, cd_props) nonsecret_chan = chan # Now a channel that bypasses approval and observers comes in. # During this process, we should never be asked to approve or # observe anything. approval = [ EventPattern('dbus-method-call', method='AddDispatchOperation'), ] q.forbid_events(approval) cdo_iface, chan, channel_properties, observe_events = announce_common(q, bus, empathy, kopete, account, conn, cd_props, True) # Both Observers indicate that they are ready to proceed for e in observe_events: q.dbus_return(e.message, signature='') # Kopete's BypassApproval part is asked to handle the channels e = q.expect('dbus-method-call', path=bypass.object_path, interface=cs.HANDLER, method='HandleChannels', handled=False) # Kopete accepts the channels q.dbus_return(e.message, signature='') q.unforbid_events(approval) # Empathy, the observer, crashes empathy.release_name() e = q.expect('dbus-signal', signal='NameOwnerChanged', predicate=(lambda e: e.args[0] == empathy.bus_name and e.args[2] == ''), ) empathy_unique_name = e.args[1] bus.flush() # Empathy gets restarted empathy.reacquire_name() e = q.expect('dbus-signal', signal='NameOwnerChanged', predicate=(lambda e: e.args[0] == empathy.bus_name and e.args[1] == ''), ) empathy_unique_name = e.args[2] # Empathy is told to observe only the non-secret channel e = q.expect('dbus-method-call', path=empathy.object_path, interface=cs.OBSERVER, method='ObserveChannels', handled=False) channels = e.args[2] assertLength(1, channels) assertEquals(nonsecret_chan.object_path, channels[0][0]) if __name__ == '__main__': exec_test(test, {}) telepathy-mission-control-5.16.4/tests/twisted/dispatcher/connect-for-request.py0000644000175000017500000001414212735242352031254 0ustar00gkiagiagkiagia00000000000000# Copyright (C) 2009 Nokia Corporation # Copyright (C) 2009 Collabora Ltd. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA # 02110-1301 USA import dbus import dbus import dbus.service from servicetest import EventPattern, tp_name_prefix, tp_path_prefix, \ call_async, sync_dbus from mctest import exec_test, create_fakecm_account, SimulatedConnection, \ SimulatedChannel import constants as cs def test(q, bus, mc): params = dbus.Dictionary({"account": "smcv@example.com", "password": "secrecy"}, signature='sv') (cm_name_ref, account) = create_fakecm_account(q, bus, mc, params) account_iface = dbus.Interface(account, cs.ACCOUNT) account_props = dbus.Interface(account, cs.PROPERTIES_IFACE) # Ensure that it's enabled but has offline RP and doesn't connect # automatically call_async(q, account_props, 'Set', cs.ACCOUNT, 'RequestedPresence', (dbus.UInt32(cs.PRESENCE_TYPE_OFFLINE), 'offline', '')) q.expect('dbus-return', method='Set') call_async(q, account_props, 'Set', cs.ACCOUNT, 'AutomaticPresence', (dbus.UInt32(cs.PRESENCE_TYPE_BUSY), 'busy', 'Testing automatic presence')) q.expect('dbus-return', method='Set') q.expect('dbus-signal', signal='AccountPropertyChanged', predicate=lambda e: e.args[0].get('AutomaticPresence', (None, None, None))[1] == 'busy') call_async(q, account_props, 'Set', cs.ACCOUNT, 'ConnectAutomatically', False) q.expect('dbus-return', method='Set') call_async(q, account_props, 'Set', cs.ACCOUNT, 'Enabled', True) q.expect('dbus-return', method='Set') q.expect('dbus-signal', signal='AccountPropertyChanged', predicate=lambda e: e.args[0].get('Enabled')) # Requesting a channel will put us online user_action_time = dbus.Int64(1238582606) cd = bus.get_object(cs.CD, cs.CD_PATH) request = dbus.Dictionary({ cs.CHANNEL + '.ChannelType': cs.CHANNEL_TYPE_TEXT, cs.CHANNEL + '.TargetHandleType': cs.HT_CONTACT, cs.CHANNEL + '.TargetID': 'juliet', }, signature='sv') call_async(q, cd, 'CreateChannel', account.object_path, request, user_action_time, "", dbus_interface=cs.CD) ret = q.expect('dbus-return', method='CreateChannel') request_path = ret.value[0] cr = bus.get_object(cs.AM, request_path) request_props = cr.GetAll(cs.CR, dbus_interface=cs.PROPERTIES_IFACE) assert request_props['Account'] == account.object_path assert request_props['Requests'] == [request] assert request_props['UserActionTime'] == user_action_time assert request_props['PreferredHandler'] == "" assert request_props['Interfaces'] == [] # make sure RequestConnection doesn't get called until we Proceed events = [EventPattern('dbus-method-call', method='RequestConnection')] q.forbid_events(events) sync_dbus(bus, q, mc) q.unforbid_events(events) cr.Proceed(dbus_interface=cs.CR) e = q.expect('dbus-method-call', method='RequestConnection', args=['fakeprotocol', params], destination=cs.tp_name_prefix + '.ConnectionManager.fakecm', path=cs.tp_path_prefix + '/ConnectionManager/fakecm', interface=cs.tp_name_prefix + '.ConnectionManager', handled=False) conn = SimulatedConnection(q, bus, 'fakecm', 'fakeprotocol', '_', 'myself', has_requests=True, has_presence=True) q.dbus_return(e.message, conn.bus_name, conn.object_path, signature='so') q.expect('dbus-method-call', method='Connect', path=conn.object_path, handled=True) conn.StatusChanged(cs.CONN_STATUS_CONNECTED, cs.CONN_STATUS_REASON_NONE) conn.presence = dbus.Struct((cs.PRESENCE_TYPE_AVAILABLE, 'available', ''), signature='uss') _, cm_request_call = q.expect_many( EventPattern('dbus-method-call', path=conn.object_path, interface=cs.CONN_IFACE_SIMPLE_PRESENCE, method='SetPresence', args=['busy', 'Testing automatic presence'], handled=True), EventPattern('dbus-method-call', path=conn.object_path, interface=cs.CONN_IFACE_REQUESTS, method='CreateChannel', args=[request], handled=False), ) q.dbus_emit(conn.object_path, cs.CONN_IFACE_SIMPLE_PRESENCE, 'PresencesChanged', {conn.self_handle: (dbus.UInt32(cs.PRESENCE_TYPE_BUSY), 'busy', 'Testing automatic presence')}, signature='a{u(uss)}') # Time passes. A channel is returned. channel_immutable = dbus.Dictionary(request) channel_immutable[cs.CHANNEL + '.InitiatorID'] = conn.self_ident channel_immutable[cs.CHANNEL + '.InitiatorHandle'] = conn.self_handle channel_immutable[cs.CHANNEL + '.Requested'] = True channel_immutable[cs.CHANNEL + '.Interfaces'] = \ dbus.Array([], signature='s') channel_immutable[cs.CHANNEL + '.TargetHandle'] = \ conn.ensure_handle(cs.HT_CONTACT, 'juliet') channel = SimulatedChannel(conn, channel_immutable) # this order of events is guaranteed by telepathy-spec (since 0.17.14) q.dbus_return(cm_request_call.message, channel.object_path, channel.immutable, signature='oa{sv}') channel.announce() # there's no handler, so it gets shot down q.expect('dbus-method-call', path=channel.object_path, method='Close', handled=True) if __name__ == '__main__': exec_test(test, {}) telepathy-mission-control-5.16.4/tests/twisted/dispatcher/ensure-and-redispatch.py0000644000175000017500000003274612735242352031550 0ustar00gkiagiagkiagia00000000000000# Copyright (C) 2009 Nokia Corporation # Copyright (C) 2009 Collabora Ltd. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA # 02110-1301 USA """Feature test ensuring that MC deals correctly with EnsureChannel returning a channel that has already been dispatched to a handler. """ import dbus import dbus.service from servicetest import (EventPattern, tp_name_prefix, tp_path_prefix, call_async, assertContains, assertLength, assertEquals) from mctest import exec_test, SimulatedConnection, SimulatedClient, \ create_fakecm_account, enable_fakecm_account, SimulatedChannel, \ expect_client_setup import constants as cs def test(q, bus, mc): params = dbus.Dictionary({"account": "someguy@example.com", "password": "secrecy"}, signature='sv') cm_name_ref, account = create_fakecm_account(q, bus, mc, params) conn = enable_fakecm_account(q, bus, mc, account, params) text_fixed_properties = dbus.Dictionary({ cs.CHANNEL + '.TargetHandleType': cs.HT_CONTACT, cs.CHANNEL + '.ChannelType': cs.CHANNEL_TYPE_TEXT, }, signature='sv') # We have more than one Client "head" on the same unique name, to test # fd.o #24645 - we want the same "head" to be reinvoked if at all possible # This one is first in alphabetical order, is discovered first, and can # handle all channels, but is not the one we want empathy_worse_match = SimulatedClient(q, bus, 'A.Temporary.Handler', observe=[], approve=[], handle=[[]], bypass_approval=False) # This is the one we actually want empathy = SimulatedClient(q, bus, 'Empathy', observe=[text_fixed_properties], approve=[text_fixed_properties], handle=[text_fixed_properties], bypass_approval=False) # this one is a closer match, but not the preferred handler closer_match = dbus.Dictionary(text_fixed_properties) closer_match[cs.CHANNEL + '.TargetID'] = 'juliet' empathy_better_match = SimulatedClient(q, bus, 'Empathy.BetterMatch', observe=[], approve=[], handle=[closer_match], bypass_approval=False) # wait for MC to download the properties expect_client_setup(q, [empathy_worse_match, empathy, empathy_better_match]) channel = test_channel_creation(q, bus, account, empathy, conn) # After the channel has been dispatched, a handler that would normally # be a closer match turns up. Regardless, we should not redispatch to it. # For the better client to be treated as if it's in a different process, # it needs its own D-Bus connection. closer_match = dbus.Dictionary(text_fixed_properties) closer_match[cs.CHANNEL + '.TargetID'] = 'juliet' closer_match[cs.CHANNEL + '.InitiatorID'] = conn.self_ident better_bus = dbus.bus.BusConnection() q.attach_to_bus(better_bus) better = SimulatedClient(q, better_bus, 'BetterMatch', observe=[], approve=[], handle=[closer_match], bypass_approval=False) expect_client_setup(q, [better]) test_channel_redispatch(q, bus, account, empathy, conn, channel) test_channel_redispatch(q, bus, account, empathy, conn, channel, ungrateful_handler=True) empathy.release_name() empathy_better_match.release_name() empathy_worse_match.release_name() test_channel_redispatch(q, bus, account, empathy, conn, channel, client_gone=True) channel.close() def test_channel_creation(q, bus, account, client, conn): user_action_time = dbus.Int64(1238582606) cd = bus.get_object(cs.CD, cs.CD_PATH) cd_props = dbus.Interface(cd, cs.PROPERTIES_IFACE) # chat UI calls ChannelDispatcher.EnsureChannel request = dbus.Dictionary({ cs.CHANNEL + '.ChannelType': cs.CHANNEL_TYPE_TEXT, cs.CHANNEL + '.TargetHandleType': cs.HT_CONTACT, cs.CHANNEL + '.TargetID': 'juliet', }, signature='sv') call_async(q, cd, 'EnsureChannel', account.object_path, request, user_action_time, client.bus_name, dbus_interface=cs.CD) ret = q.expect('dbus-return', method='EnsureChannel') request_path = ret.value[0] # chat UI connects to signals and calls ChannelRequest.Proceed() cr = bus.get_object(cs.AM, request_path) request_props = cr.GetAll(cs.CR, dbus_interface=cs.PROPERTIES_IFACE) assert request_props['Account'] == account.object_path assert request_props['Requests'] == [request] assert request_props['UserActionTime'] == user_action_time assert request_props['PreferredHandler'] == client.bus_name assert request_props['Interfaces'] == [] cr.Proceed(dbus_interface=cs.CR) cm_request_call, add_request_call = q.expect_many( EventPattern('dbus-method-call', interface=cs.CONN_IFACE_REQUESTS, method='EnsureChannel', path=conn.object_path, args=[request], handled=False), EventPattern('dbus-method-call', handled=False, interface=cs.CLIENT_IFACE_REQUESTS, method='AddRequest', path=client.object_path), ) assert add_request_call.args[0] == request_path request_props = add_request_call.args[1] assert request_props[cs.CR + '.Account'] == account.object_path assert request_props[cs.CR + '.Requests'] == [request] assert request_props[cs.CR + '.UserActionTime'] == user_action_time assert request_props[cs.CR + '.PreferredHandler'] == client.bus_name assert request_props[cs.CR + '.Interfaces'] == [] q.dbus_return(add_request_call.message, signature='') # Time passes. A channel is returned. channel_immutable = dbus.Dictionary(request) channel_immutable[cs.CHANNEL + '.InitiatorID'] = conn.self_ident channel_immutable[cs.CHANNEL + '.InitiatorHandle'] = conn.self_handle channel_immutable[cs.CHANNEL + '.Requested'] = True channel_immutable[cs.CHANNEL + '.Interfaces'] = \ dbus.Array([], signature='s') channel_immutable[cs.CHANNEL + '.TargetHandle'] = \ conn.ensure_handle(cs.HT_CONTACT, 'juliet') channel = SimulatedChannel(conn, channel_immutable) # this order of events is guaranteed by telepathy-spec (since 0.17.14) q.dbus_return(cm_request_call.message, True, # <- Yours channel.object_path, channel.immutable, signature='boa{sv}') channel.announce() # Observer should get told, processing waits for it e = q.expect('dbus-method-call', path=client.object_path, interface=cs.OBSERVER, method='ObserveChannels', handled=False) assert e.args[0] == account.object_path, e.args assert e.args[1] == conn.object_path, e.args assert e.args[3] == '/', e.args # no dispatch operation assert e.args[4] == [request_path], e.args channels = e.args[2] assert len(channels) == 1, channels assert channels[0][0] == channel.object_path, channels assert channels[0][1] == channel_immutable, channels # Observer says "OK, go" q.dbus_return(e.message, signature='') # Handler is next e = q.expect('dbus-method-call', path=client.object_path, interface=cs.HANDLER, method='HandleChannels', handled=False) assert e.args[0] == account.object_path, e.args assert e.args[1] == conn.object_path, e.args channels = e.args[2] assert len(channels) == 1, channels assert channels[0][0] == channel.object_path, channels assert channels[0][1] == channel_immutable, channels assert e.args[3] == [request_path], e.args assert e.args[4] == user_action_time assert isinstance(e.args[5], dict) assert len(e.args) == 6 # Handler accepts the Channels q.dbus_return(e.message, signature='') # CR emits Succeeded q.expect('dbus-signal', path=request_path, interface=cs.CR, signal='Succeeded') return channel def test_channel_redispatch(q, bus, account, client, conn, channel, ungrateful_handler=False, client_gone=False): user_action_time = dbus.Int64(1244444444) forbidden = [ # Because we create no new channels, nothing should be observed. EventPattern('dbus-method-call', method='ObserveChannels'), # Even though there is a better handler on a different unique # name, the channels must not be re-dispatched to it. EventPattern('dbus-method-call', method='HandleChannels', predicate=lambda e: e.path != client.object_path), # If the handler rejects the re-handle call, the channel must not # be closed. EventPattern('dbus-method-call', method='Close'), ] if client_gone: # There's nothing to call these methods on any more. forbidden.append(EventPattern('dbus-method-call', method='HandleChannels')) forbidden.append(EventPattern('dbus-method-call', method='AddRequest')) q.forbid_events(forbidden) cd = bus.get_object(cs.CD, cs.CD_PATH) cd_props = dbus.Interface(cd, cs.PROPERTIES_IFACE) # UI calls ChannelDispatcher.EnsureChannel again request = dbus.Dictionary({ cs.CHANNEL + '.ChannelType': cs.CHANNEL_TYPE_TEXT, cs.CHANNEL + '.TargetHandleType': cs.HT_CONTACT, cs.CHANNEL + '.TargetID': 'juliet', }, signature='sv') call_async(q, cd, 'EnsureChannel', account.object_path, request, user_action_time, client.bus_name, dbus_interface=cs.CD) ret = q.expect('dbus-return', method='EnsureChannel') request_path = ret.value[0] # UI connects to signals and calls ChannelRequest.Proceed() cr = bus.get_object(cs.AM, request_path) request_props = cr.GetAll(cs.CR, dbus_interface=cs.PROPERTIES_IFACE) assert request_props['Account'] == account.object_path assert request_props['Requests'] == [request] assert request_props['UserActionTime'] == user_action_time assert request_props['PreferredHandler'] == client.bus_name assert request_props['Interfaces'] == [] cr.Proceed(dbus_interface=cs.CR) cm_request_pattern = EventPattern('dbus-method-call', interface=cs.CONN_IFACE_REQUESTS, method='EnsureChannel', path=conn.object_path, args=[request], handled=False) if client_gone: (cm_request_call,) = q.expect_many(cm_request_pattern) add_request_call = None else: (cm_request_call, add_request_call) = q.expect_many( cm_request_pattern, EventPattern('dbus-method-call', handled=False, interface=cs.CLIENT_IFACE_REQUESTS, method='AddRequest', path=client.object_path), ) if add_request_call is not None: assert add_request_call.args[0] == request_path request_props = add_request_call.args[1] assert request_props[cs.CR + '.Account'] == account.object_path assert request_props[cs.CR + '.Requests'] == [request] assert request_props[cs.CR + '.UserActionTime'] == user_action_time assert request_props[cs.CR + '.PreferredHandler'] == client.bus_name assert request_props[cs.CR + '.Interfaces'] == [] q.dbus_return(add_request_call.message, signature='') # Time passes. The same channel is returned. q.dbus_return(cm_request_call.message, False, # <- Yours channel.object_path, channel.immutable, signature='boa{sv}') if not client_gone: # Handler is re-invoked. This HandleChannels call is only said to # satisfy the new request, because the earlier request has already # been satisfied. e = q.expect('dbus-method-call', path=client.object_path, interface=cs.HANDLER, method='HandleChannels', handled=False) assert e.args[0] == account.object_path, e.args assert e.args[1] == conn.object_path, e.args channels = e.args[2] assert len(channels) == 1, channels assert channels[0][0] == channel.object_path, channels assert channels[0][1] == channel.immutable, channels assert e.args[3] == [request_path], e.args assert e.args[4] == user_action_time assert isinstance(e.args[5], dict) assertContains('request-properties', e.args[5]) assertContains(request_path, e.args[5]['request-properties']) assertLength(1, e.args[5]['request-properties']) assertEquals(request_props, e.args[5]['request-properties'][request_path]) assert len(e.args) == 6 if ungrateful_handler: q.dbus_raise(e.message, cs.INVALID_ARGUMENT, 'I am very strict in my misunderstanding of telepathy-spec') else: # Handler accepts the Channels q.dbus_return(e.message, signature='') # CR emits Succeeded q.expect('dbus-signal', path=request_path, interface=cs.CR, signal='Succeeded') q.unforbid_events(forbidden) if __name__ == '__main__': exec_test(test, {}) telepathy-mission-control-5.16.4/tests/twisted/dispatcher/create-rejected-by-mini-plugin.py0000644000175000017500000000756112735242352033244 0ustar00gkiagiagkiagia00000000000000# Copyright (C) 2009 Nokia Corporation # Copyright (C) 2009 Collabora Ltd. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA # 02110-1301 USA import dbus """Regression test for ChannelDispatcher rejecting channel creation due to a plugin. """ import dbus import dbus.service from servicetest import EventPattern, tp_name_prefix, tp_path_prefix, \ call_async from mctest import exec_test, SimulatedConnection, SimulatedClient, \ create_fakecm_account, enable_fakecm_account, SimulatedChannel, \ expect_client_setup import constants as cs # Rejected by the plugin FORBIDDEN_CTYPE = 'com.example.ForbiddenChannel' def test(q, bus, mc): # For this test, we should never actually be asked to make a channel. forbidden = [ EventPattern('dbus-method-call', method='CreateChannel'), EventPattern('dbus-method-call', method='EnsureChannel'), EventPattern('dbus-method-call', method='ObserveChannels'), EventPattern('dbus-method-call', method='AddDispatchOperation'), EventPattern('dbus-method-call', method='HandleChannels'), ] q.forbid_events(forbidden) params = dbus.Dictionary({"account": "someguy@example.com", "password": "secrecy"}, signature='sv') cm_name_ref, account = create_fakecm_account(q, bus, mc, params) conn = enable_fakecm_account(q, bus, mc, account, params) fixed_properties = dbus.Dictionary({ cs.CHANNEL + '.TargetHandleType': cs.HT_CONTACT, cs.CHANNEL + '.ChannelType': FORBIDDEN_CTYPE, }, signature='sv') client = SimulatedClient(q, bus, 'Empathy', observe=[fixed_properties], approve=[fixed_properties], handle=[fixed_properties], bypass_approval=False) # wait for MC to download the properties expect_client_setup(q, [client]) user_action_time = dbus.Int64(1238582606) cd = bus.get_object(cs.CD, cs.CD_PATH) cd_props = dbus.Interface(cd, cs.PROPERTIES_IFACE) # UI calls ChannelDispatcher.CreateChannel request = dbus.Dictionary({ cs.CHANNEL + '.ChannelType': FORBIDDEN_CTYPE, cs.CHANNEL + '.TargetHandleType': cs.HT_CONTACT, cs.CHANNEL + '.TargetID': 'juliet', }, signature='sv') call_async(q, cd, 'CreateChannel', account.object_path, request, user_action_time, client.bus_name, dbus_interface=cs.CD) ret = q.expect('dbus-return', method='CreateChannel') request_path = ret.value[0] # UI connects to signals and calls ChannelRequest.Proceed() cr = bus.get_object(cs.AM, request_path) request_props = cr.GetAll(cs.CR, dbus_interface=cs.PROPERTIES_IFACE) assert request_props['Account'] == account.object_path assert request_props['Requests'] == [request] assert request_props['UserActionTime'] == user_action_time assert request_props['PreferredHandler'] == client.bus_name assert request_props['Interfaces'] == [] call_async(q, cr, 'Proceed', dbus_interface=cs.CR) q.expect('dbus-return', method='Proceed') q.expect('dbus-signal', path=cr.object_path, interface=cs.CR, signal='Failed', args=[cs.PERMISSION_DENIED, "No, you don't"]) if __name__ == '__main__': exec_test(test, {}) telepathy-mission-control-5.16.4/tests/twisted/dispatcher/respawn-activatable-observers.py0000644000175000017500000002134212735242352033315 0ustar00gkiagiagkiagia00000000000000# Copyright (C) 2009,2010 Nokia Corporation # Copyright (C) 2009,2010 Collabora Ltd. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA # 02110-1301 USA import dbus """Regression test for respawning crashed Observers. """ import dbus import dbus.bus import dbus.service from servicetest import EventPattern, tp_name_prefix, tp_path_prefix, \ call_async, sync_dbus from mctest import exec_test, SimulatedConnection, SimulatedClient, \ create_fakecm_account, enable_fakecm_account, SimulatedChannel, \ expect_client_setup import constants as cs def test(q, bus, mc): params = dbus.Dictionary({"account": "someguy@example.com", "password": "secrecy"}, signature='sv') cm_name_ref, account = create_fakecm_account(q, bus, mc, params) conn = enable_fakecm_account(q, bus, mc, account, params) text_fixed_properties = dbus.Dictionary({ cs.CHANNEL + '.TargetHandleType': cs.HT_CONTACT, cs.CHANNEL + '.ChannelType': cs.CHANNEL + '.Type.RespawnObservers' }, signature='sv') # Logger is an activatable Observer who will crash logger_bus = dbus.bus.BusConnection() logger_bus.set_exit_on_disconnect(False) # we'll disconnect later # Kopete is an Approver, Handler and will not crash kopete_bus = dbus.bus.BusConnection() q.attach_to_bus(logger_bus) q.attach_to_bus(kopete_bus) kopete = SimulatedClient(q, kopete_bus, 'Kopete', observe=[], approve=[text_fixed_properties], handle=[text_fixed_properties], bypass_approval=False) # wait for MC to download the properties expect_client_setup(q, [kopete]) # subscribe to the OperationList interface (MC assumes that until this # property has been retrieved once, nobody cares) cd = bus.get_object(cs.CD, cs.CD_PATH) cd_props = dbus.Interface(cd, cs.PROPERTIES_IFACE) assert cd_props.Get(cs.CD_IFACE_OP_LIST, 'DispatchOperations') == [] channel_properties = dbus.Dictionary(text_fixed_properties, signature='sv') channel_properties[cs.CHANNEL + '.TargetID'] = 'juliet' channel_properties[cs.CHANNEL + '.TargetHandle'] = \ conn.ensure_handle(cs.HT_CONTACT, 'juliet') channel_properties[cs.CHANNEL + '.InitiatorID'] = 'juliet' channel_properties[cs.CHANNEL + '.InitiatorHandle'] = \ conn.ensure_handle(cs.HT_CONTACT, 'juliet') channel_properties[cs.CHANNEL + '.Requested'] = False channel_properties[cs.CHANNEL + '.Interfaces'] = dbus.Array(signature='s') chan = SimulatedChannel(conn, channel_properties) chan.announce() # A channel dispatch operation is created e = q.expect('dbus-signal', path=cs.CD_PATH, interface=cs.CD_IFACE_OP_LIST, signal='NewDispatchOperation') cdo_path = e.args[0] cdo_properties = e.args[1] assert cdo_properties[cs.CDO + '.Account'] == account.object_path assert cdo_properties[cs.CDO + '.Connection'] == conn.object_path assert cs.CDO + '.Interfaces' in cdo_properties handlers = cdo_properties[cs.CDO + '.PossibleHandlers'][:] handlers.sort() assert handlers == [cs.tp_name_prefix + '.Client.Kopete'], handlers assert cs.CD_IFACE_OP_LIST in cd_props.Get(cs.CD, 'Interfaces') assert cd_props.Get(cs.CD_IFACE_OP_LIST, 'DispatchOperations') ==\ [(cdo_path, cdo_properties)] cdo = bus.get_object(cs.CD, cdo_path) cdo_iface = dbus.Interface(cdo, cs.CDO) cdo_props_iface = dbus.Interface(cdo, cs.PROPERTIES_IFACE) assert cdo_props_iface.Get(cs.CDO, 'Interfaces') == \ cdo_properties[cs.CDO + '.Interfaces'] assert cdo_props_iface.Get(cs.CDO, 'Connection') == conn.object_path assert cdo_props_iface.Get(cs.CDO, 'Account') == account.object_path assert cdo_props_iface.Get(cs.CDO, 'Channels') == [(chan.object_path, channel_properties)] assert cdo_props_iface.Get(cs.CDO, 'PossibleHandlers') == \ cdo_properties[cs.CDO + '.PossibleHandlers'] k = q.expect('dbus-method-call', path=kopete.object_path, interface=cs.APPROVER, method='AddDispatchOperation', handled=False) assert k.args == [[(chan.object_path, channel_properties)], cdo_path, cdo_properties] q.dbus_return(k.message, bus=kopete_bus, signature='') # The fake Logger implementation is run e = q.expect('dbus-signal', path=cs.tp_path_prefix + '/RegressionTests', interface=cs.tp_name_prefix + '.RegressionTests', signal='FakeStartup', args=[cs.tp_name_prefix + '.Client.Logger'], ) # We take on its identity to be able to continue with the test logger = SimulatedClient(q, bus, 'Logger', observe=[text_fixed_properties]) # Logger is told about the new channel e = q.expect('dbus-method-call', path=logger.object_path, interface=cs.OBSERVER, method='ObserveChannels', handled=False) assert e.args[0] == account.object_path, e.args assert e.args[1] == conn.object_path, e.args assert e.args[3] == cdo_path, e.args assert e.args[4] == [], e.args # no requests satisfied channels = e.args[2] assert len(channels) == 1, channels assert channels[0][0] == chan.object_path, channels assert channels[0][1] == channel_properties, channels # Logger indicates that it is ready to proceed q.dbus_return(e.message, bus=logger_bus, signature='') # The Approver (Kopete) is next # The user responds to Kopete call_async(q, cdo_iface, 'HandleWith', cs.tp_name_prefix + '.Client.Kopete') # Kopete is asked to handle the channels k = q.expect('dbus-method-call', path=kopete.object_path, interface=cs.HANDLER, method='HandleChannels', handled=False) # Kopete accepts the channels q.dbus_return(k.message, bus=kopete_bus, signature='') q.expect_many( EventPattern('dbus-return', method='HandleWith'), EventPattern('dbus-signal', interface=cs.CDO, signal='Finished'), EventPattern('dbus-signal', interface=cs.CD_IFACE_OP_LIST, signal='DispatchOperationFinished'), ) # Now there are no more active channel dispatch operations assert cd_props.Get(cs.CD_IFACE_OP_LIST, 'DispatchOperations') == [] # Logger crashes logger.release_name() e = q.expect('dbus-signal', signal='NameOwnerChanged', predicate=(lambda e: e.args[0] == logger.bus_name and e.args[2] == ''), ) logger_unique_name = e.args[1] logger_bus.flush() # Logger gets restart request e = q.expect('dbus-signal', path=cs.tp_path_prefix + '/RegressionTests', interface=cs.tp_name_prefix + '.RegressionTests', signal='FakeStartup', args=[cs.tp_name_prefix + '.Client.Logger'], ) # Logger gets restarted logger.reacquire_name() e = q.expect('dbus-signal', signal='NameOwnerChanged', predicate=(lambda e: e.args[0] == logger.bus_name and e.args[1] == ''), ) logger_unique_name = e.args[2] e = q.expect('dbus-method-call', path=logger.object_path, interface=cs.OBSERVER, method='ObserveChannels', handled=False) # FIXME: assert the same things as before, except CDO (which we don't # have) and account path (which we don't know how to get); also check # that the recovering observer info key is set assert e.args[0] == account.object_path, e.args assert e.args[1] == conn.object_path, e.args assert e.args[4] == [], e.args # no requests satisfied assert e.args[5]['recovering'] == 1, e.args # due to observer recovery channels = e.args[2] assert len(channels) == 1, channels assert channels[0][0] == chan.object_path, channels assert channels[0][1] == channel_properties, channels # Logger indicates that it is ready to proceed q.dbus_return(e.message, bus=logger_bus, signature='') sync_dbus(bus, q, mc) if __name__ == '__main__': exec_test(test, {}) telepathy-mission-control-5.16.4/tests/twisted/dispatcher/redispatch-channels.py0000644000175000017500000002430212735242352031267 0ustar00gkiagiagkiagia00000000000000# Copyright (C) 2009-2011 Collabora Ltd. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA # 02110-1301 USA """Test CD.DelegateChannels and Cd.PresentChannel """ import dbus import dbus.service from servicetest import call_async, assertEquals from mctest import ( exec_test, SimulatedClient, create_fakecm_account, enable_fakecm_account, SimulatedChannel, expect_client_setup, ChannelDispatcher, ChannelDispatchOperation, ChannelRequest) import constants as cs REQUEST = dbus.Dictionary({ cs.CHANNEL_TYPE: cs.CHANNEL_TYPE_TEXT, cs.TARGET_HANDLE_TYPE: cs.HT_CONTACT, cs.TARGET_ID: 'juliet', }, signature='sv') def test_ensure(q, bus, account, conn, chan, expected_handler_path): """Tests that a client Ensure-ing the channel causes HandleChannels to be called on the current handler. (Previously, DelegateChannels() and PresentChannel() both broke this.)""" cd = ChannelDispatcher(bus) call_async(q, cd, 'EnsureChannel', account.object_path, REQUEST, 0, '') e = q.expect('dbus-return', method='EnsureChannel') cr = ChannelRequest(bus, e.value[0]) cr.Proceed() e = q.expect('dbus-method-call', interface=cs.CONN_IFACE_REQUESTS, method='EnsureChannel', path=conn.object_path, args=[REQUEST], handled=False) q.dbus_return(e.message, False, chan.object_path, chan.immutable, signature='boa{sv}') e = q.expect('dbus-method-call', interface=cs.HANDLER, method='HandleChannels', handled=False) assertEquals(expected_handler_path, e.path) q.dbus_return(e.message, signature='') def test_delegate_channel(q, bus, mc, account, conn, chan, empathy, empathy_bus, gs): # Test that re-Ensure-ing works before we start Delegating and Presenting. test_ensure(q, bus, account, conn, chan, gs.object_path) # Now gnome-shell wants to give the channel to another handler gs_cd = ChannelDispatcher(bus) call_async(q, gs_cd, 'DelegateChannels', [chan.object_path], 0, "") # Empathy is asked to handle the channel and accept e = q.expect('dbus-method-call', path=empathy.object_path, interface=cs.HANDLER, method='HandleChannels', handled=False) q.dbus_return(e.message, signature='') e = q.expect('dbus-return', method='DelegateChannels') assertEquals(([chan.object_path], {}), e.value) # Test that re-Ensure-ing the channel still works, and sends it to # the right place. test_ensure(q, bus, account, conn, chan, empathy.object_path) # Let's play ping-pong with the channel! Empathy gives the channel # back to GS emp_cd = ChannelDispatcher(empathy_bus) call_async(q, emp_cd, 'DelegateChannels', [chan.object_path], 0, "") # gnome-shell is asked to handle the channel and accept e = q.expect('dbus-method-call', path=gs.object_path, interface=cs.HANDLER, method='HandleChannels', handled=False) q.dbus_return(e.message, signature='') e = q.expect('dbus-return', method='DelegateChannels') assertEquals(([chan.object_path], {}), e.value) # Test that re-Ensure-ing the channel sttill works, and sends it # to the right place. test_ensure(q, bus, account, conn, chan, gs.object_path) # gnome-shell wants to give it back, again call_async(q, gs_cd, 'DelegateChannels', [chan.object_path], 0, "") # Empathy is asked to handle the channel but refuses e = q.expect('dbus-method-call', path=empathy.object_path, interface=cs.HANDLER, method='HandleChannels', handled=False) q.dbus_raise(e.message, cs.NOT_AVAILABLE, "No thanks") # DelegateChannels failed so gnome-shell is still handling the channel e = q.expect('dbus-return', method='DelegateChannels') assertEquals(([], {chan.object_path: (cs.NOT_AVAILABLE, 'No thanks')}), e.value) # Test that re-Ensure-ing the channel sttill works, and sends it # to the right place. test_ensure(q, bus, account, conn, chan, gs.object_path) # Empathy doesn't handle the channel atm but tries to delegates it call_async(q, emp_cd, 'DelegateChannels', [chan.object_path], 0, "") q.expect('dbus-error', method='DelegateChannels', name=cs.NOT_YOURS) # gnome-shell which is handling the channel asks to re-ensure it call_async(q, gs_cd, 'PresentChannel', chan.object_path, 0) # gnome-shell is asked to re-handle the channel e = q.expect('dbus-method-call', path=gs.object_path, interface=cs.HANDLER, method='HandleChannels', handled=False) q.dbus_return(e.message, signature='') q.expect('dbus-return', method='PresentChannel') # empathy which is not handling the channel asks to re-ensure it call_async(q, emp_cd, 'PresentChannel', chan.object_path, 0) # gnome-shell is asked to re-handle the channel e = q.expect('dbus-method-call', path=gs.object_path, interface=cs.HANDLER, method='HandleChannels', handled=False) q.dbus_return(e.message, signature='') q.expect('dbus-return', method='PresentChannel') # Test that re-Ensure-ing the channel *still* works, and sends it # to the right place. test_ensure(q, bus, account, conn, chan, gs.object_path) # Empathy crashes empathy.release_name() e = q.expect('dbus-signal', signal='NameOwnerChanged', predicate=(lambda e: e.args[0] == empathy.bus_name and e.args[2] == ''), ) # gnome-shell wants to delegate, but there is no other handler call_async(q, gs_cd, 'DelegateChannels', [chan.object_path], 0, "") e = q.expect('dbus-return', method='DelegateChannels') delegated, not_delegated = e.value assertEquals([], delegated) error = not_delegated[chan.object_path] assertEquals (error[0], cs.NOT_CAPABLE) chan.close() def test(q, bus, mc): params = dbus.Dictionary({"account": "someguy@example.com", "password": "secrecy"}, signature='sv') cm_name_ref, account = create_fakecm_account(q, bus, mc, params) conn = enable_fakecm_account(q, bus, mc, account, params) text_fixed_properties = dbus.Dictionary({ cs.TARGET_HANDLE_TYPE: cs.HT_CONTACT, cs.CHANNEL_TYPE: cs.CHANNEL_TYPE_TEXT, }, signature='sv') # Empathy Chat is a text handler empathy_bus = dbus.bus.BusConnection() empathy = SimulatedClient(q, empathy_bus, 'EmpathyChat', handle=[text_fixed_properties], bypass_approval=False) q.attach_to_bus(empathy_bus) # gnome-shell is a text approver and handler gs = SimulatedClient(q, bus, 'GnomeShell', approve=[text_fixed_properties], handle=[text_fixed_properties], bypass_approval=False) # wait for MC to download the properties expect_client_setup(q, [empathy, gs]) cd = ChannelDispatcher(bus) # incoming text channel channel_properties = dbus.Dictionary(text_fixed_properties, signature='sv') channel_properties[cs.CHANNEL + '.TargetID'] = 'juliet' channel_properties[cs.CHANNEL + '.TargetHandle'] = \ conn.ensure_handle(cs.HT_CONTACT, 'juliet') channel_properties[cs.CHANNEL + '.InitiatorID'] = 'juliet' channel_properties[cs.CHANNEL + '.InitiatorHandle'] = \ conn.ensure_handle(cs.HT_CONTACT, 'juliet') channel_properties[cs.CHANNEL + '.Requested'] = False channel_properties[cs.CHANNEL + '.Interfaces'] = dbus.Array(signature='s') chan = SimulatedChannel(conn, channel_properties) chan.announce() # gnome-shell's approver is notified e = q.expect('dbus-method-call', path=gs.object_path, interface=cs.APPROVER, method='AddDispatchOperation', handled=False) channels, cdo_path,props = e.args cdo = ChannelDispatchOperation(bus, cdo_path) q.dbus_return(e.message, signature='') # gnome-shell handles the channel itself first call_async(q, cdo, 'HandleWith', cs.tp_name_prefix + '.Client.GnomeShell') e = q.expect('dbus-method-call', path=gs.object_path, interface=cs.HANDLER, method='HandleChannels', handled=False) q.dbus_return(e.message, signature='') # test delegating an incoming channel test_delegate_channel(q, bus, mc, account, conn, chan, empathy, empathy_bus, gs) # Empathy is back empathy = SimulatedClient(q, empathy_bus, 'EmpathyChat', handle=[text_fixed_properties], bypass_approval=False) expect_client_setup(q, [empathy]) # gnome-shell requests a channel for itself call_async(q, cd, 'CreateChannelWithHints', account.object_path, REQUEST, 0, cs.tp_name_prefix + '.Client.GnomeShell', {}) e = q.expect('dbus-return', method='CreateChannelWithHints') cr = ChannelRequest(bus, e.value[0]) cr.Proceed() e = q.expect('dbus-method-call', interface=cs.CONN_IFACE_REQUESTS, method='CreateChannel', path=conn.object_path, args=[REQUEST], handled=False) # channel is created chan = SimulatedChannel(conn, REQUEST) q.dbus_return(e.message, chan.object_path, chan.immutable, signature='oa{sv}') chan.announce() # gnome-shell handles the channel e = q.expect('dbus-method-call', path=gs.object_path, interface=cs.HANDLER, method='HandleChannels', handled=False) q.dbus_return(e.message, signature='') # test delegating an outgoing channel test_delegate_channel(q, bus, mc, account, conn, chan, empathy, empathy_bus, gs) if __name__ == '__main__': exec_test(test, {}) telepathy-mission-control-5.16.4/tests/twisted/dispatcher/handle-channels-fails.py0000644000175000017500000002140412735242352031470 0ustar00gkiagiagkiagia00000000000000# Copyright (C) 2009 Nokia Corporation # Copyright (C) 2009 Collabora Ltd. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA # 02110-1301 USA import dbus """Regression test for dispatching an incoming Text channel. """ import dbus import dbus.bus import dbus.service from servicetest import EventPattern, tp_name_prefix, tp_path_prefix, \ call_async, sync_dbus from mctest import exec_test, SimulatedConnection, SimulatedClient, \ create_fakecm_account, enable_fakecm_account, SimulatedChannel, \ expect_client_setup import constants as cs def test(q, bus, mc): params = dbus.Dictionary({"account": "someguy@example.com", "password": "secrecy"}, signature='sv') cm_name_ref, account = create_fakecm_account(q, bus, mc, params) conn = enable_fakecm_account(q, bus, mc, account, params) text_fixed_properties = dbus.Dictionary({ cs.CHANNEL + '.TargetHandleType': cs.HT_CONTACT, cs.CHANNEL + '.ChannelType': cs.CHANNEL_TYPE_TEXT, }, signature='sv') vague_fixed_properties = dbus.Dictionary({ cs.CHANNEL + '.ChannelType': cs.CHANNEL_TYPE_TEXT, }, signature='sv') empathy_bus = dbus.bus.BusConnection() q.attach_to_bus(empathy_bus) empathy = SimulatedClient(q, empathy_bus, 'Empathy', observe=[text_fixed_properties], approve=[text_fixed_properties], handle=[text_fixed_properties], bypass_approval=False) # Kopete's filter is less specific than Empathy's, so we'll prefer Empathy kopete_bus = dbus.bus.BusConnection() q.attach_to_bus(kopete_bus) kopete = SimulatedClient(q, kopete_bus, 'Kopete', observe=[], approve=[], handle=[vague_fixed_properties], bypass_approval=False) # wait for MC to download the properties expect_client_setup(q, [empathy, kopete]) # subscribe to the OperationList interface (MC assumes that until this # property has been retrieved once, nobody cares) cd = bus.get_object(cs.CD, cs.CD_PATH) cd_props = dbus.Interface(cd, cs.PROPERTIES_IFACE) assert cd_props.Get(cs.CD_IFACE_OP_LIST, 'DispatchOperations') == [] channel_properties = dbus.Dictionary(text_fixed_properties, signature='sv') channel_properties[cs.CHANNEL + '.TargetID'] = 'juliet' channel_properties[cs.CHANNEL + '.TargetHandle'] = \ conn.ensure_handle(cs.HT_CONTACT, 'juliet') channel_properties[cs.CHANNEL + '.InitiatorID'] = 'juliet' channel_properties[cs.CHANNEL + '.InitiatorHandle'] = \ conn.ensure_handle(cs.HT_CONTACT, 'juliet') channel_properties[cs.CHANNEL + '.Requested'] = False channel_properties[cs.CHANNEL + '.Interfaces'] = dbus.Array(signature='s') chan = SimulatedChannel(conn, channel_properties) chan.announce() # A channel dispatch operation is created e = q.expect('dbus-signal', path=cs.CD_PATH, interface=cs.CD_IFACE_OP_LIST, signal='NewDispatchOperation') cdo_path = e.args[0] cdo_properties = e.args[1] assert cdo_properties[cs.CDO + '.Account'] == account.object_path assert cdo_properties[cs.CDO + '.Connection'] == conn.object_path assert cs.CDO + '.Interfaces' in cdo_properties # In this test Empathy's filter has more things in it than Kopete's, so # MC will prefer Empathy handlers = cdo_properties[cs.CDO + '.PossibleHandlers'][:] assert handlers == [cs.tp_name_prefix + '.Client.Empathy', cs.tp_name_prefix + '.Client.Kopete'], handlers assert cs.CD_IFACE_OP_LIST in cd_props.Get(cs.CD, 'Interfaces') assert cd_props.Get(cs.CD_IFACE_OP_LIST, 'DispatchOperations') ==\ [(cdo_path, cdo_properties)] cdo = bus.get_object(cs.CD, cdo_path) cdo_iface = dbus.Interface(cdo, cs.CDO) cdo_props_iface = dbus.Interface(cdo, cs.PROPERTIES_IFACE) assert cdo_props_iface.Get(cs.CDO, 'Interfaces') == \ cdo_properties[cs.CDO + '.Interfaces'] assert cdo_props_iface.Get(cs.CDO, 'Connection') == conn.object_path assert cdo_props_iface.Get(cs.CDO, 'Account') == account.object_path assert cdo_props_iface.Get(cs.CDO, 'Channels') == [(chan.object_path, channel_properties)] assert cdo_props_iface.Get(cs.CDO, 'PossibleHandlers') == \ cdo_properties[cs.CDO + '.PossibleHandlers'] e = q.expect('dbus-method-call', path=empathy.object_path, interface=cs.OBSERVER, method='ObserveChannels', handled=False) assert e.args[0] == account.object_path, e.args assert e.args[1] == conn.object_path, e.args assert e.args[3] == cdo_path, e.args assert e.args[4] == [], e.args # no requests satisfied channels = e.args[2] assert len(channels) == 1, channels assert channels[0][0] == chan.object_path, channels assert channels[0][1] == channel_properties, channels q.dbus_return(e.message, bus=empathy_bus, signature='') e = q.expect('dbus-method-call', path=empathy.object_path, interface=cs.APPROVER, method='AddDispatchOperation', handled=False) assert e.args == [[(chan.object_path, channel_properties)], cdo_path, cdo_properties] q.dbus_return(e.message, bus=empathy_bus, signature='') call_async(q, cdo_iface, 'HandleWith', cs.tp_name_prefix + '.Client.Empathy') # Empathy is asked to handle the channels e = q.expect('dbus-method-call', path=empathy.object_path, interface=cs.HANDLER, method='HandleChannels', handled=False) # Empathy rejects the channels q.dbus_raise(e.message, cs.NOT_AVAILABLE, 'Blind drunk', bus=empathy_bus) e = q.expect('dbus-error', method='HandleWith') assert e.error.get_dbus_name() == cs.NOT_AVAILABLE assert e.error.get_dbus_message() == 'Blind drunk' # The channels no longer count as having been approved. Check that MC # doesn't carry on regardless forbidden = [EventPattern('dbus-method-call', method='HandleChannels')] q.forbid_events(forbidden) sync_dbus(bus, q, mc) q.unforbid_events(forbidden) # I'm Feeling Lucky. It might work if I try again? Maybe? call_async(q, cdo_iface, 'HandleWith', cs.tp_name_prefix + '.Client.Empathy') # Empathy is asked to handle the channels, again e = q.expect('dbus-method-call', path=empathy.object_path, interface=cs.HANDLER, method='HandleChannels', handled=False) # Empathy rejects the channels, again q.dbus_raise(e.message, cs.NOT_CAPABLE, 'Still drunk', bus=empathy_bus) e = q.expect('dbus-error', method='HandleWith') assert e.error.get_dbus_name() == cs.NOT_CAPABLE assert e.error.get_dbus_message() == 'Still drunk' # OK, OK, is anyone else competent enough to handle them? # (Also, assert that MC doesn't offer them back to Empathy, knowing that # it already tried and failed) forbidden = [EventPattern('dbus-method-call', method='HandleChannels', path=empathy.object_path)] q.forbid_events(forbidden) call_async(q, cdo_iface, 'HandleWith', '') # Kopete is asked to handle the channels k = q.expect('dbus-method-call', path=kopete.object_path, interface=cs.HANDLER, method='HandleChannels', handled=False) # Kopete rejects the channels too q.dbus_raise(k.message, cs.NOT_AVAILABLE, 'Also blind drunk', bus=kopete_bus) e = q.expect('dbus-error', method='HandleWith') assert e.error.get_dbus_name() == cs.NOT_AVAILABLE assert e.error.get_dbus_message() == 'Also blind drunk' # MC gives up and closes the channel. This is the end of the CDO. q.expect_many( EventPattern('dbus-method-call', path=chan.object_path, interface=cs.CHANNEL, method='Close', args=[]), EventPattern('dbus-signal', interface=cs.CDO, signal='Finished'), EventPattern('dbus-signal', interface=cs.CD_IFACE_OP_LIST, signal='DispatchOperationFinished'), ) # Now there are no more active channel dispatch operations assert cd_props.Get(cs.CD_IFACE_OP_LIST, 'DispatchOperations') == [] if __name__ == '__main__': exec_test(test, {}) telepathy-mission-control-5.16.4/tests/twisted/dispatcher/dispatch-text.py0000644000175000017500000005135012735242352030134 0ustar00gkiagiagkiagia00000000000000# Copyright (C) 2009 Nokia Corporation # Copyright (C) 2009 Collabora Ltd. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA # 02110-1301 USA import dbus """Regression test for dispatching an incoming Text channel. """ import dbus import dbus.bus import dbus.service from servicetest import EventPattern, tp_name_prefix, tp_path_prefix, \ call_async, sync_dbus from mctest import exec_test, SimulatedConnection, SimulatedClient, \ create_fakecm_account, enable_fakecm_account, SimulatedChannel, \ expect_client_setup import constants as cs def test(q, bus, mc): params = dbus.Dictionary({"account": "someguy@example.com", "password": "secrecy"}, signature='sv') cm_name_ref, account = create_fakecm_account(q, bus, mc, params) conn = enable_fakecm_account(q, bus, mc, account, params) text_fixed_properties = dbus.Dictionary({ cs.CHANNEL + '.TargetHandleType': cs.HT_CONTACT, cs.CHANNEL + '.ChannelType': cs.CHANNEL_TYPE_TEXT, }, signature='sv') empathy_bus = dbus.bus.BusConnection() empathy_bus.set_exit_on_disconnect(False) # we'll disconnect later kopete_bus = dbus.bus.BusConnection() q.attach_to_bus(empathy_bus) q.attach_to_bus(kopete_bus) # Two clients want to observe, approve and handle channels empathy = SimulatedClient(q, empathy_bus, 'Empathy', observe=[text_fixed_properties], approve=[text_fixed_properties], handle=[text_fixed_properties], bypass_approval=False) kopete = SimulatedClient(q, kopete_bus, 'Kopete', observe=[text_fixed_properties], approve=[text_fixed_properties], handle=[text_fixed_properties], bypass_approval=False) # wait for MC to download the properties expect_client_setup(q, [empathy, kopete]) # subscribe to the OperationList interface (MC assumes that until this # property has been retrieved once, nobody cares) cd = bus.get_object(cs.CD, cs.CD_PATH) cd_props = dbus.Interface(cd, cs.PROPERTIES_IFACE) assert cd_props.Get(cs.CD_IFACE_OP_LIST, 'DispatchOperations') == [] channel_properties = dbus.Dictionary(text_fixed_properties, signature='sv') channel_properties[cs.CHANNEL + '.TargetID'] = 'juliet' channel_properties[cs.CHANNEL + '.TargetHandle'] = \ conn.ensure_handle(cs.HT_CONTACT, 'juliet') channel_properties[cs.CHANNEL + '.InitiatorID'] = 'juliet' channel_properties[cs.CHANNEL + '.InitiatorHandle'] = \ conn.ensure_handle(cs.HT_CONTACT, 'juliet') channel_properties[cs.CHANNEL + '.Requested'] = False channel_properties[cs.CHANNEL + '.Interfaces'] = dbus.Array(signature='s') chan = SimulatedChannel(conn, channel_properties) chan.announce() # A channel dispatch operation is created e = q.expect('dbus-signal', path=cs.CD_PATH, interface=cs.CD_IFACE_OP_LIST, signal='NewDispatchOperation') cdo_path = e.args[0] cdo_properties = e.args[1] assert cdo_properties[cs.CDO + '.Account'] == account.object_path assert cdo_properties[cs.CDO + '.Connection'] == conn.object_path assert cs.CDO + '.Interfaces' in cdo_properties handlers = cdo_properties[cs.CDO + '.PossibleHandlers'][:] handlers.sort() assert handlers == [cs.tp_name_prefix + '.Client.Empathy', cs.tp_name_prefix + '.Client.Kopete'], handlers assert cs.CD_IFACE_OP_LIST in cd_props.Get(cs.CD, 'Interfaces') assert cd_props.Get(cs.CD_IFACE_OP_LIST, 'DispatchOperations') ==\ [(cdo_path, cdo_properties)] cdo = bus.get_object(cs.CD, cdo_path) cdo_iface = dbus.Interface(cdo, cs.CDO) cdo_props_iface = dbus.Interface(cdo, cs.PROPERTIES_IFACE) assert cdo_props_iface.Get(cs.CDO, 'Interfaces') == \ cdo_properties[cs.CDO + '.Interfaces'] assert cdo_props_iface.Get(cs.CDO, 'Connection') == conn.object_path assert cdo_props_iface.Get(cs.CDO, 'Account') == account.object_path assert cdo_props_iface.Get(cs.CDO, 'Channels') == [(chan.object_path, channel_properties)] assert cdo_props_iface.Get(cs.CDO, 'PossibleHandlers') == \ cdo_properties[cs.CDO + '.PossibleHandlers'] # Both Observers are told about the new channel e, k = q.expect_many( EventPattern('dbus-method-call', path=empathy.object_path, interface=cs.OBSERVER, method='ObserveChannels', handled=False), EventPattern('dbus-method-call', path=kopete.object_path, interface=cs.OBSERVER, method='ObserveChannels', handled=False), ) assert e.args[0] == account.object_path, e.args assert e.args[1] == conn.object_path, e.args assert e.args[3] == cdo_path, e.args assert e.args[4] == [], e.args # no requests satisfied channels = e.args[2] assert len(channels) == 1, channels assert channels[0][0] == chan.object_path, channels assert channels[0][1] == channel_properties, channels assert k.args == e.args # Both Observers indicate that they are ready to proceed q.dbus_return(k.message, bus=empathy_bus, signature='') q.dbus_return(e.message, bus=kopete_bus, signature='') # The Approvers are next e, k = q.expect_many( EventPattern('dbus-method-call', path=empathy.object_path, interface=cs.APPROVER, method='AddDispatchOperation', handled=False), EventPattern('dbus-method-call', path=kopete.object_path, interface=cs.APPROVER, method='AddDispatchOperation', handled=False), ) assert e.args == [[(chan.object_path, channel_properties)], cdo_path, cdo_properties] assert k.args == e.args q.dbus_return(e.message, bus=empathy_bus, signature='') q.dbus_return(k.message, bus=kopete_bus, signature='') # Both Approvers now have a flashing icon or something, trying to get the # user's attention # Using an invalid Handler name should fail call_async(q, cdo_iface, 'HandleWith', cs.tp_name_prefix + '.The.Moon.On.A.Stick') q.expect('dbus-error', method='HandleWith') call_async(q, cdo_iface, 'HandleWith', cs.tp_name_prefix + '.Client.the moon on a stick') q.expect('dbus-error', method='HandleWith') # The user responds to Empathy first call_async(q, cdo_iface, 'HandleWith', cs.tp_name_prefix + '.Client.Empathy') # Empathy is asked to handle the channels e = q.expect('dbus-method-call', path=empathy.object_path, interface=cs.HANDLER, method='HandleChannels', handled=False) # Empathy accepts the channels q.dbus_return(e.message, bus=empathy_bus, signature='') q.expect_many( EventPattern('dbus-return', method='HandleWith'), EventPattern('dbus-signal', interface=cs.CDO, signal='Finished'), EventPattern('dbus-signal', interface=cs.CD_IFACE_OP_LIST, signal='DispatchOperationFinished'), ) # Now there are no more active channel dispatch operations assert cd_props.Get(cs.CD_IFACE_OP_LIST, 'DispatchOperations') == [] # Approve another channel using HandleWithTime() channel_properties = dbus.Dictionary(text_fixed_properties, signature='sv') channel_properties[cs.CHANNEL + '.TargetID'] = 'lucien' channel_properties[cs.CHANNEL + '.TargetHandle'] = \ conn.ensure_handle(cs.HT_CONTACT, 'lucien') channel_properties[cs.CHANNEL + '.InitiatorID'] = 'lucien' channel_properties[cs.CHANNEL + '.InitiatorHandle'] = \ conn.ensure_handle(cs.HT_CONTACT, 'lucien') channel_properties[cs.CHANNEL + '.Requested'] = False channel_properties[cs.CHANNEL + '.Interfaces'] = dbus.Array(signature='s') chan = SimulatedChannel(conn, channel_properties) chan.announce() # A channel dispatch operation is created e = q.expect('dbus-signal', path=cs.CD_PATH, interface=cs.CD_IFACE_OP_LIST, signal='NewDispatchOperation') cdo_path = e.args[0] cdo_properties = e.args[1] assert cdo_properties[cs.CDO + '.Account'] == account.object_path assert cdo_properties[cs.CDO + '.Connection'] == conn.object_path assert cs.CDO + '.Interfaces' in cdo_properties handlers = cdo_properties[cs.CDO + '.PossibleHandlers'][:] handlers.sort() assert handlers == [cs.tp_name_prefix + '.Client.Empathy', cs.tp_name_prefix + '.Client.Kopete'], handlers assert cs.CD_IFACE_OP_LIST in cd_props.Get(cs.CD, 'Interfaces') assert cd_props.Get(cs.CD_IFACE_OP_LIST, 'DispatchOperations') ==\ [(cdo_path, cdo_properties)] cdo = bus.get_object(cs.CD, cdo_path) cdo_iface = dbus.Interface(cdo, cs.CDO) cdo_props_iface = dbus.Interface(cdo, cs.PROPERTIES_IFACE) assert cdo_props_iface.Get(cs.CDO, 'Interfaces') == \ cdo_properties[cs.CDO + '.Interfaces'] assert cdo_props_iface.Get(cs.CDO, 'Connection') == conn.object_path assert cdo_props_iface.Get(cs.CDO, 'Account') == account.object_path assert cdo_props_iface.Get(cs.CDO, 'Channels') == [(chan.object_path, channel_properties)] assert cdo_props_iface.Get(cs.CDO, 'PossibleHandlers') == \ cdo_properties[cs.CDO + '.PossibleHandlers'] # Both Observers are told about the new channel e, k = q.expect_many( EventPattern('dbus-method-call', path=empathy.object_path, interface=cs.OBSERVER, method='ObserveChannels', handled=False), EventPattern('dbus-method-call', path=kopete.object_path, interface=cs.OBSERVER, method='ObserveChannels', handled=False), ) assert e.args[0] == account.object_path, e.args assert e.args[1] == conn.object_path, e.args assert e.args[3] == cdo_path, e.args assert e.args[4] == [], e.args # no requests satisfied channels = e.args[2] assert len(channels) == 1, channels assert channels[0][0] == chan.object_path, channels assert channels[0][1] == channel_properties, channels assert k.args == e.args # Both Observers indicate that they are ready to proceed q.dbus_return(k.message, bus=empathy_bus, signature='') q.dbus_return(e.message, bus=kopete_bus, signature='') # The Approvers are next e, k = q.expect_many( EventPattern('dbus-method-call', path=empathy.object_path, interface=cs.APPROVER, method='AddDispatchOperation', handled=False), EventPattern('dbus-method-call', path=kopete.object_path, interface=cs.APPROVER, method='AddDispatchOperation', handled=False), ) assert e.args == [[(chan.object_path, channel_properties)], cdo_path, cdo_properties] assert k.args == e.args q.dbus_return(e.message, bus=empathy_bus, signature='') q.dbus_return(k.message, bus=kopete_bus, signature='') # Both Approvers now have a flashing icon or something, trying to get the # user's attention # The user responds to Empathy first call_async(q, cdo_iface, 'HandleWithTime', cs.tp_name_prefix + '.Client.Empathy', 13) # Empathy is asked to handle the channels e = q.expect('dbus-method-call', path=empathy.object_path, interface=cs.HANDLER, method='HandleChannels', handled=False) account_path, conn_path, channels, requests, action_time, info = e.args assert action_time == 13 # Empathy accepts the channels q.dbus_return(e.message, bus=empathy_bus, signature='') q.expect_many( EventPattern('dbus-return', method='HandleWithTime'), EventPattern('dbus-signal', interface=cs.CDO, signal='Finished'), EventPattern('dbus-signal', interface=cs.CD_IFACE_OP_LIST, signal='DispatchOperationFinished'), ) # Now there are no more active channel dispatch operations assert cd_props.Get(cs.CD_IFACE_OP_LIST, 'DispatchOperations') == [] # From now on, it is an error to get HandleChannels (because we're # testing Claim()) forbidden = [ EventPattern('dbus-method-call', method='HandleChannels'), ] q.forbid_events(forbidden) # Another channel channel_properties = dbus.Dictionary(text_fixed_properties, signature='sv') channel_properties[cs.CHANNEL + '.TargetID'] = 'mercutio' channel_properties[cs.CHANNEL + '.TargetHandle'] = \ conn.ensure_handle(cs.HT_CONTACT, 'mercutio') channel_properties[cs.CHANNEL + '.InitiatorID'] = 'mercutio' channel_properties[cs.CHANNEL + '.InitiatorHandle'] = \ conn.ensure_handle(cs.HT_CONTACT, 'mercutio') channel_properties[cs.CHANNEL + '.Requested'] = False channel_properties[cs.CHANNEL + '.Interfaces'] = dbus.Array(signature='s') claimed_chan = SimulatedChannel(conn, channel_properties) claimed_chan.announce() # A channel dispatch operation is created e = q.expect('dbus-signal', path=cs.CD_PATH, interface=cs.CD_IFACE_OP_LIST, signal='NewDispatchOperation') cdo_path = e.args[0] cdo_properties = e.args[1] assert cdo_properties[cs.CDO + '.Account'] == account.object_path assert cdo_properties[cs.CDO + '.Connection'] == conn.object_path assert cs.CDO + '.Interfaces' in cdo_properties handlers = cdo_properties[cs.CDO + '.PossibleHandlers'][:] handlers.sort() assert handlers == [cs.tp_name_prefix + '.Client.Empathy', cs.tp_name_prefix + '.Client.Kopete'], handlers assert cs.CD_IFACE_OP_LIST in cd_props.Get(cs.CD, 'Interfaces') assert cd_props.Get(cs.CD_IFACE_OP_LIST, 'DispatchOperations') ==\ [(cdo_path, cdo_properties)] cdo = bus.get_object(cs.CD, cdo_path) cdo_iface = dbus.Interface(cdo, cs.CDO) # Both Observers are told about the new channel e, k = q.expect_many( EventPattern('dbus-method-call', path=empathy.object_path, interface=cs.OBSERVER, method='ObserveChannels', handled=False), EventPattern('dbus-method-call', path=kopete.object_path, interface=cs.OBSERVER, method='ObserveChannels', handled=False), ) assert e.args[0] == account.object_path, e.args assert e.args[1] == conn.object_path, e.args assert e.args[3] == cdo_path, e.args assert e.args[4] == [], e.args # no requests satisfied channels = e.args[2] assert len(channels) == 1, channels assert channels[0][0] == claimed_chan.object_path, channels assert channels[0][1] == channel_properties, channels assert k.args == e.args # Both Observers indicate that they are ready to proceed q.dbus_return(k.message, bus=kopete_bus, signature='') q.dbus_return(e.message, bus=empathy_bus, signature='') # The Approvers are next e, k = q.expect_many( EventPattern('dbus-method-call', path=empathy.object_path, interface=cs.APPROVER, method='AddDispatchOperation', handled=False), EventPattern('dbus-method-call', path=kopete.object_path, interface=cs.APPROVER, method='AddDispatchOperation', handled=False), ) assert e.args == [[(claimed_chan.object_path, channel_properties)], cdo_path, cdo_properties] assert k.args == e.args q.dbus_return(e.message, bus=empathy_bus, signature='') q.dbus_return(k.message, bus=kopete_bus, signature='') # Both Approvers now have a flashing icon or something, trying to get the # user's attention # The user responds to Empathy first, and Empathy decides it wants the # channel for itself empathy_cdo = empathy_bus.get_object(cdo.bus_name, cdo.object_path) empathy_cdo_iface = dbus.Interface(empathy_cdo, cs.CDO) call_async(q, empathy_cdo_iface, 'Claim') q.expect_many( EventPattern('dbus-signal', path=cdo_path, signal='Finished'), EventPattern('dbus-signal', path=cs.CD_PATH, signal='DispatchOperationFinished', args=[cdo_path]), EventPattern('dbus-return', method='Claim'), ) # Now there are no more active channel dispatch operations assert cd_props.Get(cs.CD_IFACE_OP_LIST, 'DispatchOperations') == [] # A third channel channel_properties = dbus.Dictionary(text_fixed_properties, signature='sv') channel_properties[cs.CHANNEL + '.TargetID'] = 'benvolio' channel_properties[cs.CHANNEL + '.TargetHandle'] = \ conn.ensure_handle(cs.HT_CONTACT, 'benvolio') channel_properties[cs.CHANNEL + '.InitiatorID'] = 'benvolio' channel_properties[cs.CHANNEL + '.InitiatorHandle'] = \ conn.ensure_handle(cs.HT_CONTACT, 'benvolio') channel_properties[cs.CHANNEL + '.Requested'] = False channel_properties[cs.CHANNEL + '.Interfaces'] = dbus.Array(signature='s') third_chan = SimulatedChannel(conn, channel_properties) third_chan.announce() # third_chan should not be closed q.unforbid_events(forbidden) forbidden.append(EventPattern('dbus-method-call', method='Close', path=third_chan.object_path)) q.forbid_events(forbidden) # A channel dispatch operation is created e = q.expect('dbus-signal', path=cs.CD_PATH, interface=cs.CD_IFACE_OP_LIST, signal='NewDispatchOperation') cdo_path = e.args[0] cdo_properties = e.args[1] cdo = bus.get_object(cs.CD, cdo_path) cdo_iface = dbus.Interface(cdo, cs.CDO) e, k = q.expect_many( EventPattern('dbus-method-call', path=empathy.object_path, interface=cs.OBSERVER, method='ObserveChannels', handled=False), EventPattern('dbus-method-call', path=kopete.object_path, interface=cs.OBSERVER, method='ObserveChannels', handled=False), ) q.dbus_return(k.message, bus=kopete_bus, signature='') q.dbus_return(e.message, bus=empathy_bus, signature='') e, k = q.expect_many( EventPattern('dbus-method-call', path=empathy.object_path, interface=cs.APPROVER, method='AddDispatchOperation', handled=False), EventPattern('dbus-method-call', path=kopete.object_path, interface=cs.APPROVER, method='AddDispatchOperation', handled=False), ) q.dbus_return(e.message, bus=empathy_bus, signature='') q.dbus_return(k.message, bus=kopete_bus, signature='') # Kopete closes this one kopete_cdo = kopete_bus.get_object(cdo.bus_name, cdo.object_path) kopete_cdo_iface = dbus.Interface(kopete_cdo, cs.CDO) call_async(q, kopete_cdo_iface, 'Claim') q.expect_many( EventPattern('dbus-signal', path=cdo_path, signal='Finished'), EventPattern('dbus-signal', path=cs.CD_PATH, signal='DispatchOperationFinished', args=[cdo_path]), EventPattern('dbus-return', method='Claim'), ) # Empathy crashes empathy.release_name() e = q.expect('dbus-signal', signal='NameOwnerChanged', predicate=(lambda e: e.args[0] == empathy.bus_name and e.args[2] == ''), ) empathy_unique_name = e.args[1] empathy_bus.flush() empathy_bus.close() # In response, the channels that were being handled by Empathy are closed. # Kopete's channel is *not* closed. q.expect_many( EventPattern('dbus-signal', signal='NameOwnerChanged', predicate=(lambda e: e.args[0] == empathy_unique_name and e.args[2] == '')), EventPattern('dbus-method-call', path=chan.object_path, method='Close'), EventPattern('dbus-method-call', path=claimed_chan.object_path, method='Close'), ) sync_dbus(bus, q, mc) q.unforbid_events(forbidden) if __name__ == '__main__': exec_test(test, {}) telepathy-mission-control-5.16.4/tests/twisted/dispatcher/some-delay-approvers.py0000644000175000017500000001417512735242352031435 0ustar00gkiagiagkiagia00000000000000# Copyright (C) 2010 Collabora Ltd. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA # 02110-1301 USA import dbus import dbus.bus import dbus.service from servicetest import EventPattern, tp_name_prefix, tp_path_prefix, \ call_async, sync_dbus from mctest import exec_test, SimulatedConnection, SimulatedClient, \ create_fakecm_account, enable_fakecm_account, SimulatedChannel, \ expect_client_setup import constants as cs def test(q, bus, mc): params = dbus.Dictionary({"account": "someguy@example.com", "password": "secrecy"}, signature='sv') cm_name_ref, account = create_fakecm_account(q, bus, mc, params) conn = enable_fakecm_account(q, bus, mc, account, params) text_fixed_properties = dbus.Dictionary({ cs.CHANNEL + '.TargetHandleType': cs.HT_CONTACT, cs.CHANNEL + '.ChannelType': cs.CHANNEL_TYPE_TEXT, }, signature='sv') # Empathy is an observer for text channels with # DelayApprovers=TRUE. empathy = SimulatedClient(q, bus, 'Empathy', observe=[text_fixed_properties], approve=[], handle=[], delay_approvers=True) # Loggy is an observer for text channels with # DelayApprovers=FALSE. loggy = SimulatedClient(q, bus, 'Loggy', observe=[text_fixed_properties], approve=[], handle=[], delay_approvers=False) # Kopete is an approver and handler for text channels. kopete = SimulatedClient(q, bus, 'Kopete', observe=[], approve=[text_fixed_properties], handle=[text_fixed_properties]) expect_client_setup(q, [empathy, loggy, kopete]) # subscribe to the OperationList interface (MC assumes that until this # property has been retrieved once, nobody cares) cd = bus.get_object(cs.CD, cs.CD_PATH) cd_props = dbus.Interface(cd, cs.PROPERTIES_IFACE) assert cd_props.Get(cs.CD_IFACE_OP_LIST, 'DispatchOperations') == [] # A text channel appears! channel_properties = dbus.Dictionary(text_fixed_properties, signature='sv') channel_properties[cs.CHANNEL + '.TargetID'] = 'juliet' channel_properties[cs.CHANNEL + '.TargetHandle'] = \ conn.ensure_handle(cs.HT_CONTACT, 'juliet') channel_properties[cs.CHANNEL + '.InitiatorID'] = 'juliet' channel_properties[cs.CHANNEL + '.InitiatorHandle'] = \ conn.ensure_handle(cs.HT_CONTACT, 'juliet') channel_properties[cs.CHANNEL + '.Requested'] = False channel_properties[cs.CHANNEL + '.Interfaces'] = dbus.Array(signature='s') chan = SimulatedChannel(conn, channel_properties) chan.announce() e = q.expect('dbus-signal', path=cs.CD_PATH, interface=cs.CD_IFACE_OP_LIST, signal='NewDispatchOperation') cdo_path = e.args[0] cdo = bus.get_object(cs.CD, cdo_path) cdo_iface = dbus.Interface(cdo, cs.CDO) cdo_props_iface = dbus.Interface(cdo, cs.PROPERTIES_IFACE) # Empathy, the observer, gets the channel to observe. Because it # has DelayApprovers=TRUE, Kopete should not have # AddDispatchOperation called on it until Empathy returns from # ObserveChannels. Because Loggy has DelayApprovers=False, # however, ADO can be called on Kopete before Loggy returns, but # again, only after Empathy returns. forbidden = [EventPattern('dbus-method-call', path=kopete.object_path, interface=cs.APPROVER, method='AddDispatchOperation')] q.forbid_events(forbidden) e, l = q.expect_many(EventPattern('dbus-method-call', path=empathy.object_path, interface=cs.OBSERVER, method='ObserveChannels', handled=False), EventPattern('dbus-method-call', path=loggy.object_path, interface=cs.OBSERVER, method='ObserveChannels', handled=False), ) # Waste a little time here and there. We can't call sync_dbus # here because it calls Ping and libdbus returns from Ping # synchronously and doesn't turn the main loop handle enough. call_async(q, cd_props, 'Get', cs.CD_IFACE_OP_LIST, 'DispatchOperations') event = q.expect('dbus-return', method='Get') # Finally return from ObserveChannels from Empathy, so now we # expect ADO to be called on Kopete. q.dbus_return(e.message, bus=bus, signature='') q.unforbid_events(forbidden) e = q.expect('dbus-method-call', path=kopete.object_path, interface=cs.APPROVER, method='AddDispatchOperation', handled=False) q.dbus_return(e.message, bus=bus, signature='') # Return from loggy's ObserveChannels. q.dbus_return(l.message, bus=bus, signature='') # The user responds to Kopete call_async(q, cdo_iface, 'HandleWith', cs.tp_name_prefix + '.Client.Kopete') # Kopete is asked to handle the channels k = q.expect('dbus-method-call', path=kopete.object_path, interface=cs.HANDLER, method='HandleChannels', handled=False) # Kopete accepts the channels q.dbus_return(k.message, bus=bus, signature='') q.expect_many( EventPattern('dbus-return', method='HandleWith'), EventPattern('dbus-signal', interface=cs.CDO, signal='Finished'), EventPattern('dbus-signal', interface=cs.CD_IFACE_OP_LIST, signal='DispatchOperationFinished'), ) # Now there are no more active channel dispatch operations assert cd_props.Get(cs.CD_IFACE_OP_LIST, 'DispatchOperations') == [] if __name__ == '__main__': exec_test(test, {}) telepathy-mission-control-5.16.4/tests/twisted/dispatcher/approver-fails.py0000644000175000017500000001436112735242352030306 0ustar00gkiagiagkiagia00000000000000# Copyright (C) 2009 Nokia Corporation # Copyright (C) 2009 Collabora Ltd. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA # 02110-1301 USA import dbus """Regression test for dispatching an incoming Text channel. """ import dbus import dbus.bus import dbus.service from servicetest import EventPattern, tp_name_prefix, tp_path_prefix, \ call_async, sync_dbus from mctest import exec_test, SimulatedConnection, SimulatedClient, \ create_fakecm_account, enable_fakecm_account, SimulatedChannel, \ expect_client_setup import constants as cs def test(q, bus, mc): params = dbus.Dictionary({"account": "someguy@example.com", "password": "secrecy"}, signature='sv') cm_name_ref, account = create_fakecm_account(q, bus, mc, params) conn = enable_fakecm_account(q, bus, mc, account, params) text_fixed_properties = dbus.Dictionary({ cs.CHANNEL + '.TargetHandleType': cs.HT_CONTACT, cs.CHANNEL + '.ChannelType': cs.CHANNEL_TYPE_TEXT, }, signature='sv') empathy_bus = dbus.bus.BusConnection() q.attach_to_bus(empathy_bus) empathy = SimulatedClient(q, empathy_bus, 'Empathy', observe=[text_fixed_properties], approve=[text_fixed_properties], handle=[text_fixed_properties], bypass_approval=False) # wait for MC to download the properties expect_client_setup(q, [empathy]) # subscribe to the OperationList interface (MC assumes that until this # property has been retrieved once, nobody cares) cd = bus.get_object(cs.CD, cs.CD_PATH) cd_props = dbus.Interface(cd, cs.PROPERTIES_IFACE) assert cd_props.Get(cs.CD_IFACE_OP_LIST, 'DispatchOperations') == [] channel_properties = dbus.Dictionary(text_fixed_properties, signature='sv') channel_properties[cs.CHANNEL + '.TargetID'] = 'juliet' channel_properties[cs.CHANNEL + '.TargetHandle'] = \ conn.ensure_handle(cs.HT_CONTACT, 'juliet') channel_properties[cs.CHANNEL + '.InitiatorID'] = 'juliet' channel_properties[cs.CHANNEL + '.InitiatorHandle'] = \ conn.ensure_handle(cs.HT_CONTACT, 'juliet') channel_properties[cs.CHANNEL + '.Requested'] = False channel_properties[cs.CHANNEL + '.Interfaces'] = dbus.Array(signature='s') chan = SimulatedChannel(conn, channel_properties) chan.announce() # A channel dispatch operation is created e = q.expect('dbus-signal', path=cs.CD_PATH, interface=cs.CD_IFACE_OP_LIST, signal='NewDispatchOperation') cdo_path = e.args[0] cdo_properties = e.args[1] assert cdo_properties[cs.CDO + '.Account'] == account.object_path assert cdo_properties[cs.CDO + '.Connection'] == conn.object_path assert cs.CDO + '.Interfaces' in cdo_properties handlers = cdo_properties[cs.CDO + '.PossibleHandlers'][:] assert handlers == [cs.tp_name_prefix + '.Client.Empathy'], handlers assert cs.CD_IFACE_OP_LIST in cd_props.Get(cs.CD, 'Interfaces') assert cd_props.Get(cs.CD_IFACE_OP_LIST, 'DispatchOperations') ==\ [(cdo_path, cdo_properties)] cdo = bus.get_object(cs.CD, cdo_path) cdo_iface = dbus.Interface(cdo, cs.CDO) cdo_props_iface = dbus.Interface(cdo, cs.PROPERTIES_IFACE) assert cdo_props_iface.Get(cs.CDO, 'Interfaces') == \ cdo_properties[cs.CDO + '.Interfaces'] assert cdo_props_iface.Get(cs.CDO, 'Connection') == conn.object_path assert cdo_props_iface.Get(cs.CDO, 'Account') == account.object_path assert cdo_props_iface.Get(cs.CDO, 'Channels') == [(chan.object_path, channel_properties)] assert cdo_props_iface.Get(cs.CDO, 'PossibleHandlers') == \ cdo_properties[cs.CDO + '.PossibleHandlers'] e = q.expect('dbus-method-call', path=empathy.object_path, interface=cs.OBSERVER, method='ObserveChannels', handled=False) assert e.args[0] == account.object_path, e.args assert e.args[1] == conn.object_path, e.args assert e.args[3] == cdo_path, e.args assert e.args[4] == [], e.args # no requests satisfied channels = e.args[2] assert len(channels) == 1, channels assert channels[0][0] == chan.object_path, channels assert channels[0][1] == channel_properties, channels q.dbus_return(e.message, bus=empathy_bus, signature='') e = q.expect('dbus-method-call', path=empathy.object_path, interface=cs.APPROVER, method='AddDispatchOperation', handled=False) assert e.args == [[(chan.object_path, channel_properties)], cdo_path, cdo_properties] # Empathy rejects the channels q.dbus_raise(e.message, cs.NOT_AVAILABLE, 'Blind drunk', bus=empathy_bus) # No approver works, so Empathy-the-Handler is asked to handle the channels e = q.expect('dbus-method-call', path=empathy.object_path, interface=cs.HANDLER, method='HandleChannels', handled=False) # Empathy rejects the channels q.dbus_raise(e.message, cs.NOT_AVAILABLE, 'Still drunk', bus=empathy_bus) q.expect_many( EventPattern('dbus-method-call', path=chan.object_path, interface=cs.CHANNEL, method='Close', handled=True), EventPattern('dbus-signal', path=cdo.object_path, interface=cs.CDO, signal='Finished'), EventPattern('dbus-signal', path=cd.object_path, interface=cs.CD_IFACE_OP_LIST, signal='DispatchOperationFinished'), ) # Now there are no more active channel dispatch operations assert cd_props.Get(cs.CD_IFACE_OP_LIST, 'DispatchOperations') == [] if __name__ == '__main__': exec_test(test, {}) telepathy-mission-control-5.16.4/tests/twisted/dispatcher/exploding-bundles.py0000644000175000017500000004077712735242352031011 0ustar00gkiagiagkiagia00000000000000# Copyright (C) 2009 Nokia Corporation # Copyright (C) 2009 Collabora Ltd. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA # 02110-1301 USA import dbus """Regression test for dispatching several incoming channels. """ import dbus import dbus.service from servicetest import EventPattern, tp_name_prefix, tp_path_prefix, \ call_async from mctest import exec_test, SimulatedConnection, SimulatedClient, \ create_fakecm_account, enable_fakecm_account, SimulatedChannel, \ expect_client_setup import constants as cs def test(q, bus, mc): params = dbus.Dictionary({"account": "someguy@example.com", "password": "secrecy"}, signature='sv') cm_name_ref, account = create_fakecm_account(q, bus, mc, params) conn = enable_fakecm_account(q, bus, mc, account, params) text_fixed_properties = dbus.Dictionary({ cs.CHANNEL + '.TargetHandleType': cs.HT_CONTACT, cs.CHANNEL + '.ChannelType': cs.CHANNEL_TYPE_TEXT, }, signature='sv') media_fixed_properties = dbus.Dictionary({ cs.CHANNEL + '.TargetHandleType': cs.HT_CONTACT, cs.CHANNEL + '.ChannelType': cs.CHANNEL_TYPE_STREAMED_MEDIA, }, signature='sv') misc_fixed_properties = dbus.Dictionary({ cs.CHANNEL + '.TargetHandleType': cs.HT_CONTACT, cs.CHANNEL + '.ChannelType': 'com.example.Extension', }, signature='sv') # Two clients want to observe, approve and handle channels. Empathy handles # VoIP, Kopete does not. empathy = SimulatedClient(q, bus, 'org.gnome.Empathy', observe=[text_fixed_properties, media_fixed_properties], approve=[text_fixed_properties, media_fixed_properties], handle=[text_fixed_properties, media_fixed_properties], bypass_approval=False) kopete = SimulatedClient(q, bus, 'org.kde.Kopete', observe=[text_fixed_properties], approve=[text_fixed_properties], handle=[text_fixed_properties], bypass_approval=False) # wait for MC to download the properties expect_client_setup(q, [empathy, kopete]) # subscribe to the OperationList interface (MC assumes that until this # property has been retrieved once, nobody cares) cd = bus.get_object(cs.CD, cs.CD_PATH) cd_props = dbus.Interface(cd, cs.PROPERTIES_IFACE) assert cd_props.Get(cs.CD_IFACE_OP_LIST, 'DispatchOperations') == [] # Part 1. A bundle that Empathy, but not Kopete, can handle text_channel_properties = dbus.Dictionary(text_fixed_properties, signature='sv') text_channel_properties[cs.CHANNEL + '.TargetID'] = 'juliet' text_channel_properties[cs.CHANNEL + '.TargetHandle'] = \ conn.ensure_handle(cs.HT_CONTACT, 'juliet') text_channel_properties[cs.CHANNEL + '.InitiatorID'] = 'juliet' text_channel_properties[cs.CHANNEL + '.InitiatorHandle'] = \ conn.ensure_handle(cs.HT_CONTACT, 'juliet') text_channel_properties[cs.CHANNEL + '.Requested'] = False text_channel_properties[cs.CHANNEL + '.Interfaces'] = dbus.Array( [cs.CHANNEL_IFACE_DESTROYABLE], signature='s') text_chan = SimulatedChannel(conn, text_channel_properties, destroyable=True) media_channel_properties = dbus.Dictionary(media_fixed_properties, signature='sv') media_channel_properties[cs.CHANNEL + '.TargetID'] = 'juliet' media_channel_properties[cs.CHANNEL + '.TargetHandle'] = \ conn.ensure_handle(cs.HT_CONTACT, 'juliet') media_channel_properties[cs.CHANNEL + '.InitiatorID'] = 'juliet' media_channel_properties[cs.CHANNEL + '.InitiatorHandle'] = \ conn.ensure_handle(cs.HT_CONTACT, 'juliet') media_channel_properties[cs.CHANNEL + '.Requested'] = False media_channel_properties[cs.CHANNEL + '.Interfaces'] = dbus.Array( signature='s') media_chan = SimulatedChannel(conn, media_channel_properties, destroyable=False) conn.NewChannels([text_chan, media_chan]) # A channel dispatch operation is created for the Text channel first. e = q.expect('dbus-signal', path=cs.CD_PATH, interface=cs.CD_IFACE_OP_LIST, signal='NewDispatchOperation') text_cdo_path = e.args[0] text_cdo_properties = e.args[1] assert text_cdo_properties[cs.CDO + '.Account'] == account.object_path assert text_cdo_properties[cs.CDO + '.Connection'] == conn.object_path handlers = text_cdo_properties[cs.CDO + '.PossibleHandlers'][:] assert (sorted(handlers) == [cs.tp_name_prefix + '.Client.org.gnome.Empathy', cs.tp_name_prefix + '.Client.org.kde.Kopete']), handlers text_cdo = bus.get_object(cs.CD, text_cdo_path) text_cdo_iface = dbus.Interface(text_cdo, cs.CDO) # Both Observers are told about the new Text channel e_observe_text, k_observe_text = q.expect_many( EventPattern('dbus-method-call', path=empathy.object_path, interface=cs.OBSERVER, method='ObserveChannels', handled=False), EventPattern('dbus-method-call', path=kopete.object_path, interface=cs.OBSERVER, method='ObserveChannels', handled=False), ) assert e_observe_text.args[0] == account.object_path, e_observe_text.args assert e_observe_text.args[1] == conn.object_path, e_observe_text.args assert e_observe_text.args[3] == text_cdo_path, e_observe_text.args assert e_observe_text.args[4] == [], e_observe_text.args channels = e_observe_text.args[2] assert len(channels) == 1, channels assert (text_chan.object_path, text_channel_properties) in channels assert k_observe_text.args[0] == e_observe_text.args[0], k_observe_text.args assert k_observe_text.args[1] == e_observe_text.args[1], k_observe_text.args assert (k_observe_text.args[2] == [(text_chan.object_path, text_channel_properties)]) # Now a separate CDO is created for the media channel. e = q.expect('dbus-signal', path=cs.CD_PATH, interface=cs.CD_IFACE_OP_LIST, signal='NewDispatchOperation') media_cdo_path = e.args[0] media_cdo_properties = e.args[1] assert media_cdo_properties[cs.CDO + '.Account'] == account.object_path assert media_cdo_properties[cs.CDO + '.Connection'] == conn.object_path handlers = media_cdo_properties[cs.CDO + '.PossibleHandlers'][:] # only Empathy can handle it assert (sorted(handlers) == [cs.tp_name_prefix + '.Client.org.gnome.Empathy']), handlers assert cs.CD_IFACE_OP_LIST in cd_props.Get(cs.CD, 'Interfaces') assert (sorted(cd_props.Get(cs.CD_IFACE_OP_LIST, 'DispatchOperations')) == [(text_cdo_path, text_cdo_properties), (media_cdo_path, media_cdo_properties)]) media_cdo = bus.get_object(cs.CD, media_cdo_path) media_cdo_iface = dbus.Interface(media_cdo, cs.CDO) # Only Empathy is told about the new media channel e_observe_media = q.expect('dbus-method-call', path=empathy.object_path, interface=cs.OBSERVER, method='ObserveChannels', handled=False) assert e_observe_media.args[0] == account.object_path, e_observe_media.args assert e_observe_media.args[1] == conn.object_path, e_observe_media.args assert e_observe_media.args[3] == media_cdo_path, e_observe_media.args assert e_observe_media.args[4] == [], e_observe_media.args channels = e_observe_media.args[2] assert len(channels) == 1, channels assert (media_chan.object_path, media_channel_properties) in channels # All Observers reply. q.dbus_return(e_observe_text.message, signature='') q.dbus_return(k_observe_text.message, signature='') q.dbus_return(e_observe_media.message, signature='') # The Approvers are next e_approve_text, k_approve_text, e_approve_media = q.expect_many( EventPattern('dbus-method-call', path=empathy.object_path, interface=cs.APPROVER, method='AddDispatchOperation', predicate=lambda e: e.args[1] == text_cdo_path, handled=False), EventPattern('dbus-method-call', path=kopete.object_path, interface=cs.APPROVER, method='AddDispatchOperation', handled=False), EventPattern('dbus-method-call', path=empathy.object_path, interface=cs.APPROVER, method='AddDispatchOperation', predicate=lambda e: e.args[1] == media_cdo_path, handled=False) ) assert len(e_approve_text.args[0]) == 1 assert ((text_chan.object_path, text_channel_properties) in e_approve_text.args[0]) assert e_approve_text.args[1:] == [text_cdo_path, text_cdo_properties] assert k_approve_text.args == e_approve_text.args assert len(e_approve_media.args[0]) == 1 assert ((media_chan.object_path, media_channel_properties) in e_approve_media.args[0]) assert e_approve_media.args[1:] == [media_cdo_path, media_cdo_properties] q.dbus_return(e_approve_text.message, signature='') q.dbus_return(k_approve_text.message, signature='') q.dbus_return(e_approve_media.message, signature='') # Both Approvers now have a flashing icon or something, trying to get the # user's attention. The user clicks on Empathy call_async(q, text_cdo_iface, 'HandleWith', cs.tp_name_prefix + '.Client.org.gnome.Empathy') # Empathy is asked to handle the channel e = q.expect('dbus-method-call', path=empathy.object_path, interface=cs.HANDLER, method='HandleChannels', handled=False) # Empathy accepts the channel q.dbus_return(e.message, signature='') q.expect_many( EventPattern('dbus-return', method='HandleWith'), EventPattern('dbus-signal', interface=cs.CDO, signal='Finished'), EventPattern('dbus-signal', interface=cs.CD_IFACE_OP_LIST, signal='DispatchOperationFinished'), ) # The user doesn't care which client will handle the channel - because # Empathy is the only possibility, it will be chosen (this is also a # regression test for the ability to leave the handler unspecified). call_async(q, media_cdo_iface, 'HandleWith', '') # Empathy is asked to handle the channel e = q.expect('dbus-method-call', path=empathy.object_path, interface=cs.HANDLER, method='HandleChannels', handled=False) # Empathy accepts the channel q.dbus_return(e.message, signature='') q.expect_many( EventPattern('dbus-return', method='HandleWith'), EventPattern('dbus-signal', interface=cs.CDO, signal='Finished'), EventPattern('dbus-signal', interface=cs.CD_IFACE_OP_LIST, signal='DispatchOperationFinished'), ) # Now there are no more active channel dispatch operations assert cd_props.Get(cs.CD_IFACE_OP_LIST, 'DispatchOperations') == [] text_chan.close() media_chan.close() # Part 2. A bundle that neither client can handle in its entirety respawning_channel_properties = dbus.Dictionary(misc_fixed_properties, signature='sv') respawning_channel_properties[cs.CHANNEL + '.TargetID'] = 'juliet' respawning_channel_properties[cs.CHANNEL + '.TargetHandle'] = \ conn.ensure_handle(cs.HT_CONTACT, 'juliet') respawning_channel_properties[cs.CHANNEL + '.InitiatorID'] = 'juliet' respawning_channel_properties[cs.CHANNEL + '.InitiatorHandle'] = \ conn.ensure_handle(cs.HT_CONTACT, 'juliet') respawning_channel_properties[cs.CHANNEL + '.Requested'] = False respawning_channel_properties[cs.CHANNEL + '.Interfaces'] = dbus.Array( [cs.CHANNEL_IFACE_DESTROYABLE], signature='s') ext_channel_properties = dbus.Dictionary(misc_fixed_properties, signature='sv') ext_channel_properties[cs.CHANNEL + '.TargetID'] = 'juliet' ext_channel_properties[cs.CHANNEL + '.TargetHandle'] = \ conn.ensure_handle(cs.HT_CONTACT, 'juliet') ext_channel_properties[cs.CHANNEL + '.InitiatorID'] = 'juliet' ext_channel_properties[cs.CHANNEL + '.InitiatorHandle'] = \ conn.ensure_handle(cs.HT_CONTACT, 'juliet') ext_channel_properties[cs.CHANNEL + '.Requested'] = False ext_channel_properties[cs.CHANNEL + '.Interfaces'] = dbus.Array( signature='s') text_chan = SimulatedChannel(conn, text_channel_properties, destroyable=True) media_chan = SimulatedChannel(conn, media_channel_properties, destroyable=False) respawning_chan = SimulatedChannel(conn, respawning_channel_properties, destroyable=True) ext_chan = SimulatedChannel(conn, ext_channel_properties, destroyable=False) conn.NewChannels([text_chan, media_chan, ext_chan, respawning_chan]) # No client can handle all four channels, so the bundle explodes into # two dispatch operations and two failures. We can only match the first # CDO here - we look at the others later. e_observe_media, e_observe_text, k_observe_text, \ e_approve_media, e_approve_text, k_approve_text, \ _, _, _ = q.expect_many( EventPattern('dbus-method-call', path=empathy.object_path, interface=cs.OBSERVER, method='ObserveChannels', predicate=(lambda e: e.args[2][0][0] == media_chan.object_path), handled=False), EventPattern('dbus-method-call', path=empathy.object_path, interface=cs.OBSERVER, method='ObserveChannels', predicate=(lambda e: e.args[2][0][0] == text_chan.object_path), handled=False), EventPattern('dbus-method-call', path=kopete.object_path, interface=cs.OBSERVER, method='ObserveChannels', predicate=(lambda e: e.args[2][0][0] == text_chan.object_path), handled=False), EventPattern('dbus-method-call', path=empathy.object_path, interface=cs.APPROVER, method='AddDispatchOperation', predicate=(lambda e: e.args[0][0][0] == media_chan.object_path), handled=False), EventPattern('dbus-method-call', path=empathy.object_path, interface=cs.APPROVER, method='AddDispatchOperation', predicate=(lambda e: e.args[0][0][0] == text_chan.object_path), handled=False), EventPattern('dbus-method-call', path=kopete.object_path, interface=cs.APPROVER, method='AddDispatchOperation', predicate=(lambda e: e.args[0][0][0] == text_chan.object_path), handled=False), EventPattern('dbus-method-call', interface=cs.CHANNEL_IFACE_DESTROYABLE, method='Destroy', path=respawning_chan.object_path, handled=True), EventPattern('dbus-method-call', interface=cs.CHANNEL, method='Close', path=ext_chan.object_path, handled=True), # we can't distinguish between the two NewDispatchOperation signals # since we no longer see the Channels property (it's mutable) EventPattern('dbus-signal', path=cs.CD_PATH, interface=cs.CD_IFACE_OP_LIST, signal='NewDispatchOperation'), ) q.dbus_return(e_observe_media.message, signature='') q.dbus_return(e_observe_text.message, signature='') q.dbus_return(k_observe_text.message, signature='') q.dbus_return(e_approve_media.message, signature='') q.dbus_return(e_approve_text.message, signature='') q.dbus_return(k_approve_text.message, signature='') if __name__ == '__main__': exec_test(test, {}) telepathy-mission-control-5.16.4/tests/twisted/dispatcher/create-hints.py0000644000175000017500000001750412735242352027744 0ustar00gkiagiagkiagia00000000000000# Copyright (C) 2009 Nokia Corporation # Copyright (C) 2009-2010 Collabora Ltd. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA # 02110-1301 USA import dbus """Test CD.{Create,Ensure}ChannelWithHints """ import dbus import dbus.service from servicetest import EventPattern, tp_name_prefix, tp_path_prefix, \ call_async, assertEquals from mctest import exec_test, SimulatedConnection, SimulatedClient, \ create_fakecm_account, enable_fakecm_account, SimulatedChannel, \ expect_client_setup, ChannelDispatcher import constants as cs def test(q, bus, mc): params = dbus.Dictionary({"account": "someguy@example.com", "password": "secrecy"}, signature='sv') cm_name_ref, account = create_fakecm_account(q, bus, mc, params) conn = enable_fakecm_account(q, bus, mc, account, params) text_fixed_properties = dbus.Dictionary({ cs.CHANNEL + '.TargetHandleType': cs.HT_CONTACT, cs.CHANNEL + '.ChannelType': cs.CHANNEL_TYPE_TEXT, }, signature='sv') client = SimulatedClient(q, bus, 'Empathy', observe=[text_fixed_properties], handle=[text_fixed_properties], bypass_approval=False) # wait for MC to download the properties expect_client_setup(q, [client]) test_channel_creation(q, bus, account, client, conn, False) test_channel_creation(q, bus, account, client, conn, True) def test_channel_creation(q, bus, account, client, conn, ensure=False, prefer=None, channel_type=cs.CHANNEL_TYPE_TEXT): user_action_time = dbus.Int64(1238582606) hints = dbus.Dictionary({ 'badger': 42, 'snake': 'pony' }, signature='sv') if prefer is None: prefer = client cd = ChannelDispatcher(bus) assert cd.Properties.Get(cs.CD, "SupportsRequestHints") # chat UI calls ChannelDispatcher.EnsureChannelWithHints or # CreateChannelWithHints request = dbus.Dictionary({ cs.CHANNEL + '.ChannelType': channel_type, cs.CHANNEL + '.TargetHandleType': cs.HT_CONTACT, cs.CHANNEL + '.TargetID': 'juliet', }, signature='sv') call_async(q, cd, (ensure and 'EnsureChannelWithHints' or 'CreateChannelWithHints'), account.object_path, request, user_action_time, prefer.bus_name, hints, dbus_interface=cs.CD) ret = q.expect('dbus-return', method=(ensure and 'EnsureChannelWithHints' or 'CreateChannelWithHints')) request_path = ret.value[0] # chat UI connects to signals and calls ChannelRequest.Proceed() cr = bus.get_object(cs.AM, request_path) request_props = cr.GetAll(cs.CR, dbus_interface=cs.PROPERTIES_IFACE) assert request_props['Account'] == account.object_path assert request_props['Requests'] == [request] assert request_props['UserActionTime'] == user_action_time assert request_props['PreferredHandler'] == prefer.bus_name assert request_props['Interfaces'] == [] assertEquals(hints, request_props['Hints']) cr.Proceed(dbus_interface=cs.CR) # FIXME: should the EnsureChannel/CreateChannel call, and the AddRequest # call, be in a defined order? Probably not though, since CMs and Clients # aren't meant to be the same process! cm_request_call, add_request_call = q.expect_many( EventPattern('dbus-method-call', interface=cs.CONN_IFACE_REQUESTS, method=(ensure and 'EnsureChannel' or 'CreateChannel'), path=conn.object_path, args=[request], handled=False), EventPattern('dbus-method-call', handled=False, interface=cs.CLIENT_IFACE_REQUESTS, method='AddRequest'), ) assert add_request_call.args[0] == request_path assert add_request_call.path == prefer.object_path request_props = add_request_call.args[1] assert request_props[cs.CR + '.Account'] == account.object_path assert request_props[cs.CR + '.Requests'] == [request] assert request_props[cs.CR + '.UserActionTime'] == user_action_time assert request_props[cs.CR + '.PreferredHandler'] == prefer.bus_name assert request_props[cs.CR + '.Interfaces'] == [] q.dbus_return(add_request_call.message, signature='') # Time passes. A channel is returned. channel_immutable = dbus.Dictionary(request) channel_immutable[cs.CHANNEL + '.InitiatorID'] = conn.self_ident channel_immutable[cs.CHANNEL + '.InitiatorHandle'] = conn.self_handle channel_immutable[cs.CHANNEL + '.Requested'] = True channel_immutable[cs.CHANNEL + '.Interfaces'] = \ dbus.Array([], signature='s') channel_immutable[cs.CHANNEL + '.TargetHandle'] = \ conn.ensure_handle(cs.HT_CONTACT, 'juliet') channel = SimulatedChannel(conn, channel_immutable) # this order of events is guaranteed by telepathy-spec (since 0.17.14) if ensure: q.dbus_return(cm_request_call.message, True, # <- Yours channel.object_path, channel.immutable, signature='boa{sv}') else: # Create q.dbus_return(cm_request_call.message, channel.object_path, channel.immutable, signature='oa{sv}') channel.announce() if channel_type == cs.CHANNEL_TYPE_TEXT: # Observer should get told, processing waits for it e = q.expect('dbus-method-call', path=client.object_path, interface=cs.OBSERVER, method='ObserveChannels', handled=False) assert e.args[0] == account.object_path, e.args assert e.args[1] == conn.object_path, e.args assert e.args[3] == '/', e.args # no dispatch operation assert e.args[4] == [request_path], e.args channels = e.args[2] assert len(channels) == 1, channels assert channels[0][0] == channel.object_path, channels assert channels[0][1] == channel_immutable, channels info = e.args[5] assert info['request-properties'] == {request_path: request_props}, info # Observer says "OK, go" q.dbus_return(e.message, signature='') # Handler is next e = q.expect('dbus-method-call', path=prefer.object_path, interface=cs.HANDLER, method='HandleChannels', handled=False) assert e.args[0] == account.object_path, e.args assert e.args[1] == conn.object_path, e.args channels = e.args[2] assert len(channels) == 1, channels assert channels[0][0] == channel.object_path, channels assert channels[0][1] == channel_immutable, channels assert e.args[3] == [request_path], e.args assert e.args[4] == user_action_time assert isinstance(e.args[5], dict) assert len(e.args) == 6 # Handler accepts the Channels q.dbus_return(e.message, signature='') # SucceededWithChannel is fired first e = q.expect('dbus-signal', path=request_path, interface=cs.CR, signal='SucceededWithChannel') assertEquals(conn.object_path, e.args[0]) assert isinstance(e.args[1], dict), e.args[1] assertEquals(channel.object_path, e.args[2]) assertEquals(channel_immutable, e.args[3]) # CR emits Succeeded q.expect('dbus-signal', path=request_path, interface=cs.CR, signal='Succeeded') # Close the channel channel.close() if __name__ == '__main__': exec_test(test, {}) telepathy-mission-control-5.16.4/tests/twisted/dispatcher/respawn-observers.py0000644000175000017500000003020112735242352031032 0ustar00gkiagiagkiagia00000000000000# Copyright (C) 2009,2010 Nokia Corporation # Copyright (C) 2009,2010 Collabora Ltd. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA # 02110-1301 USA import dbus """Regression test for respawning crashed Observers. """ import dbus import dbus.bus import dbus.service from servicetest import EventPattern, tp_name_prefix, tp_path_prefix, \ call_async, sync_dbus from mctest import exec_test, SimulatedConnection, SimulatedClient, \ create_fakecm_account, enable_fakecm_account, SimulatedChannel, \ expect_client_setup import constants as cs def test(q, bus, mc): params = dbus.Dictionary({"account": "someguy@example.com", "password": "secrecy"}, signature='sv') cm_name_ref, account = create_fakecm_account(q, bus, mc, params) conn = enable_fakecm_account(q, bus, mc, account, params) text_fixed_properties = dbus.Dictionary({ cs.CHANNEL + '.TargetHandleType': cs.HT_CONTACT, cs.CHANNEL + '.ChannelType': cs.CHANNEL_TYPE_TEXT, }, signature='sv') # Empathy is an Observers who will crash empathy_bus = dbus.bus.BusConnection() empathy_bus.set_exit_on_disconnect(False) # we'll disconnect later # Kopete is an Approver, Handler and will not crash kopete_bus = dbus.bus.BusConnection() q.attach_to_bus(empathy_bus) q.attach_to_bus(kopete_bus) # Two clients want to observe, approve and handle channels empathy = SimulatedClient(q, empathy_bus, 'Empathy', observe=[text_fixed_properties], approve=[], handle=[], wants_recovery=True) kopete = SimulatedClient(q, kopete_bus, 'Kopete', observe=[], approve=[text_fixed_properties], handle=[text_fixed_properties], bypass_approval=False) # wait for MC to download the properties expect_client_setup(q, [empathy, kopete]) # subscribe to the OperationList interface (MC assumes that until this # property has been retrieved once, nobody cares) cd = bus.get_object(cs.CD, cs.CD_PATH) cd_props = dbus.Interface(cd, cs.PROPERTIES_IFACE) assert cd_props.Get(cs.CD_IFACE_OP_LIST, 'DispatchOperations') == [] channel_properties = dbus.Dictionary(text_fixed_properties, signature='sv') channel_properties[cs.CHANNEL + '.TargetID'] = 'juliet' channel_properties[cs.CHANNEL + '.TargetHandle'] = \ conn.ensure_handle(cs.HT_CONTACT, 'juliet') channel_properties[cs.CHANNEL + '.InitiatorID'] = 'juliet' channel_properties[cs.CHANNEL + '.InitiatorHandle'] = \ conn.ensure_handle(cs.HT_CONTACT, 'juliet') channel_properties[cs.CHANNEL + '.Requested'] = False channel_properties[cs.CHANNEL + '.Interfaces'] = dbus.Array(signature='s') chan = SimulatedChannel(conn, channel_properties) chan.announce() # A channel dispatch operation is created e = q.expect('dbus-signal', path=cs.CD_PATH, interface=cs.CD_IFACE_OP_LIST, signal='NewDispatchOperation') cdo_path = e.args[0] cdo_properties = e.args[1] assert cdo_properties[cs.CDO + '.Account'] == account.object_path assert cdo_properties[cs.CDO + '.Connection'] == conn.object_path assert cs.CDO + '.Interfaces' in cdo_properties handlers = cdo_properties[cs.CDO + '.PossibleHandlers'][:] handlers.sort() assert handlers == [cs.tp_name_prefix + '.Client.Kopete'], handlers assert cs.CD_IFACE_OP_LIST in cd_props.Get(cs.CD, 'Interfaces') assert cd_props.Get(cs.CD_IFACE_OP_LIST, 'DispatchOperations') ==\ [(cdo_path, cdo_properties)] cdo = bus.get_object(cs.CD, cdo_path) cdo_iface = dbus.Interface(cdo, cs.CDO) cdo_props_iface = dbus.Interface(cdo, cs.PROPERTIES_IFACE) assert cdo_props_iface.Get(cs.CDO, 'Interfaces') == \ cdo_properties[cs.CDO + '.Interfaces'] assert cdo_props_iface.Get(cs.CDO, 'Connection') == conn.object_path assert cdo_props_iface.Get(cs.CDO, 'Account') == account.object_path assert cdo_props_iface.Get(cs.CDO, 'Channels') == [(chan.object_path, channel_properties)] assert cdo_props_iface.Get(cs.CDO, 'PossibleHandlers') == \ cdo_properties[cs.CDO + '.PossibleHandlers'] # The Observer (Empathy) is told about the new channel e = q.expect('dbus-method-call', path=empathy.object_path, interface=cs.OBSERVER, method='ObserveChannels', handled=False) assert e.args[0] == account.object_path, e.args assert e.args[1] == conn.object_path, e.args assert e.args[3] == cdo_path, e.args assert e.args[4] == [], e.args # no requests satisfied channels = e.args[2] assert len(channels) == 1, channels assert channels[0][0] == chan.object_path, channels assert channels[0][1] == channel_properties, channels # Empathy indicates that it is ready to proceed q.dbus_return(e.message, bus=empathy_bus, signature='') # The Approver (Kopete) is next k = q.expect('dbus-method-call', path=kopete.object_path, interface=cs.APPROVER, method='AddDispatchOperation', handled=False) assert k.args == [[(chan.object_path, channel_properties)], cdo_path, cdo_properties] q.dbus_return(k.message, bus=kopete_bus, signature='') # The user responds to Kopete call_async(q, cdo_iface, 'HandleWith', cs.tp_name_prefix + '.Client.Kopete') # Kopete is asked to handle the channels k = q.expect('dbus-method-call', path=kopete.object_path, interface=cs.HANDLER, method='HandleChannels', handled=False) # Kopete accepts the channels q.dbus_return(k.message, bus=kopete_bus, signature='') q.expect_many( EventPattern('dbus-return', method='HandleWith'), EventPattern('dbus-signal', interface=cs.CDO, signal='Finished'), EventPattern('dbus-signal', interface=cs.CD_IFACE_OP_LIST, signal='DispatchOperationFinished'), ) # Now there are no more active channel dispatch operations assert cd_props.Get(cs.CD_IFACE_OP_LIST, 'DispatchOperations') == [] # Another channel: this one will remain unapproved channel2_properties = dbus.Dictionary(text_fixed_properties, signature='sv') channel2_properties[cs.CHANNEL + '.TargetID'] = 'mercutio' channel2_properties[cs.CHANNEL + '.TargetHandle'] = \ conn.ensure_handle(cs.HT_CONTACT, 'mercutio') channel2_properties[cs.CHANNEL + '.InitiatorID'] = 'mercutio' channel2_properties[cs.CHANNEL + '.InitiatorHandle'] = \ conn.ensure_handle(cs.HT_CONTACT, 'mercutio') channel2_properties[cs.CHANNEL + '.Requested'] = False channel2_properties[cs.CHANNEL + '.Interfaces'] = dbus.Array(signature='s') chan2 = SimulatedChannel(conn, channel2_properties) chan2.announce() # A channel dispatch operation is created e = q.expect('dbus-signal', path=cs.CD_PATH, interface=cs.CD_IFACE_OP_LIST, signal='NewDispatchOperation') cdo2_path = e.args[0] cdo2_properties = e.args[1] assert cdo2_properties[cs.CDO + '.Account'] == account.object_path assert cdo2_properties[cs.CDO + '.Connection'] == conn.object_path assert cs.CDO + '.Interfaces' in cdo_properties handlers = cdo_properties[cs.CDO + '.PossibleHandlers'][:] handlers.sort() assert handlers == [cs.tp_name_prefix + '.Client.Kopete'], handlers assert cs.CD_IFACE_OP_LIST in cd_props.Get(cs.CD, 'Interfaces') assert cd_props.Get(cs.CD_IFACE_OP_LIST, 'DispatchOperations') ==\ [(cdo2_path, cdo2_properties)] cdo2 = bus.get_object(cs.CD, cdo2_path) cdo2_iface = dbus.Interface(cdo2, cs.CDO) cdo2_props_iface = dbus.Interface(cdo2, cs.PROPERTIES_IFACE) assert cdo2_props_iface.Get(cs.CDO, 'Interfaces') == \ cdo2_properties[cs.CDO + '.Interfaces'] assert cdo2_props_iface.Get(cs.CDO, 'Connection') == conn.object_path assert cdo2_props_iface.Get(cs.CDO, 'Account') == account.object_path assert cdo2_props_iface.Get(cs.CDO, 'Channels') == [(chan2.object_path, channel2_properties)] assert cdo2_props_iface.Get(cs.CDO, 'PossibleHandlers') == \ cdo2_properties[cs.CDO + '.PossibleHandlers'] # The Observer (Empathy) is told about the new channel e = q.expect('dbus-method-call', path=empathy.object_path, interface=cs.OBSERVER, method='ObserveChannels', handled=False) assert e.args[0] == account.object_path, e.args assert e.args[1] == conn.object_path, e.args assert e.args[3] == cdo2_path, e.args assert e.args[4] == [], e.args # no requests satisfied channels = e.args[2] assert len(channels) == 1, channels assert channels[0][0] == chan2.object_path, channels assert channels[0][1] == channel2_properties, channels # Empathy indicates that it is ready to proceed q.dbus_return(e.message, bus=empathy_bus, signature='') # The Approver (Kopete) is next; this time, we don't approve k = q.expect('dbus-method-call', path=kopete.object_path, interface=cs.APPROVER, method='AddDispatchOperation', handled=False) assert k.args == [[(chan2.object_path, channel2_properties)], cdo2_path, cdo2_properties] q.dbus_return(k.message, bus=kopete_bus, signature='') # Empathy crashes empathy.release_name() e = q.expect('dbus-signal', signal='NameOwnerChanged', predicate=(lambda e: e.args[0] == empathy.bus_name and e.args[2] == ''), ) empathy_unique_name = e.args[1] empathy_bus.flush() # Empathy gets restarted empathy.reacquire_name() e = q.expect('dbus-signal', signal='NameOwnerChanged', predicate=(lambda e: e.args[0] == empathy.bus_name and e.args[1] == ''), ) empathy_unique_name = e.args[2] e1, e2 = q.expect_many( EventPattern('dbus-method-call', path=empathy.object_path, interface=cs.OBSERVER, method='ObserveChannels', predicate=lambda e: e.args[2][0][0] == chan.object_path, handled=False), EventPattern('dbus-method-call', path=empathy.object_path, interface=cs.OBSERVER, method='ObserveChannels', predicate=lambda e: e.args[2][0][0] == chan2.object_path, handled=False), ) assert e1.args[0] == account.object_path, e1.args assert e1.args[1] == conn.object_path, e1.args assert e1.args[4] == [], e1.args # no requests satisfied assert e1.args[5]['recovering'] == 1, e1.args # due to observer recovery channels = e1.args[2] assert len(channels) == 1, channels assert channels[0][0] == chan.object_path, channels assert channels[0][1] == channel_properties, channels assert e2.args[0] == account.object_path, e2.args assert e2.args[1] == conn.object_path, e2.args assert e2.args[4] == [], e2.args # no requests satisfied assert e2.args[5]['recovering'] == 1, e2.args # due to observer recovery channels = e2.args[2] assert len(channels) == 1, channels assert channels[0][0] == chan2.object_path, channels assert channels[0][1] == channel2_properties, channels # Empathy indicates that it is ready to proceed q.dbus_return(e1.message, bus=empathy_bus, signature='') q.dbus_return(e2.message, bus=empathy_bus, signature='') sync_dbus(bus, q, mc) if __name__ == '__main__': exec_test(test, {}) telepathy-mission-control-5.16.4/tests/twisted/dispatcher/cdo-claim.py0000644000175000017500000001137212735242352027203 0ustar00gkiagiagkiagia00000000000000 # Copyright (C) 2009-2011 Collabora Ltd. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA # 02110-1301 USA """Test ChannelDispatchOperation.Claim(). See fd.o#40283 """ import dbus import dbus.service from servicetest import call_async, assertEquals, EventPattern from mctest import exec_test, SimulatedClient, \ create_fakecm_account, enable_fakecm_account, SimulatedChannel, \ expect_client_setup import constants as cs def test(q, bus, mc): params = dbus.Dictionary({"account": "someguy@example.com", "password": "secrecy"}, signature='sv') cm_name_ref, account = create_fakecm_account(q, bus, mc, params) conn = enable_fakecm_account(q, bus, mc, account, params) text_fixed_properties = dbus.Dictionary({ cs.TARGET_HANDLE_TYPE: cs.HT_CONTACT, cs.CHANNEL_TYPE: cs.CHANNEL_TYPE_TEXT, }, signature='sv') # Logger is a text observer wanting recovery logger = SimulatedClient(q, bus, 'LoggerChat', observe=[text_fixed_properties], bypass_approval=False, wants_recovery=True) # gnome-shell is a text approver and handler gs = SimulatedClient(q, bus, 'GnomeShell', approve=[text_fixed_properties], handle=[text_fixed_properties], bypass_approval=False) # wait for MC to download the properties expect_client_setup(q, [logger, gs]) cd = bus.get_object(cs.CD, cs.CD_PATH) # incoming text channel channel_properties = dbus.Dictionary(text_fixed_properties, signature='sv') channel_properties[cs.CHANNEL + '.TargetID'] = 'juliet' channel_properties[cs.CHANNEL + '.TargetHandle'] = \ conn.ensure_handle(cs.HT_CONTACT, 'juliet') channel_properties[cs.CHANNEL + '.InitiatorID'] = 'juliet' channel_properties[cs.CHANNEL + '.InitiatorHandle'] = \ conn.ensure_handle(cs.HT_CONTACT, 'juliet') channel_properties[cs.CHANNEL + '.Requested'] = False channel_properties[cs.CHANNEL + '.Interfaces'] = dbus.Array(signature='s') chan = SimulatedChannel(conn, channel_properties) chan.announce() # gnome-shell's approver and logger's observer are notified e, k = q.expect_many( EventPattern('dbus-method-call', path=logger.object_path, interface=cs.OBSERVER, method='ObserveChannels', handled=False), EventPattern('dbus-method-call', path=gs.object_path, interface=cs.APPROVER, method='AddDispatchOperation', handled=False), ) channels, cdo_path, props = k.args cdo = bus.get_object(cs.CD, cdo_path) cdo_iface = dbus.Interface(cdo, cs.CDO) q.dbus_return(e.message, signature='') q.dbus_return(k.message, signature='') # gnome-shell claims the channel call_async(q, cdo_iface, 'Claim') e = q.expect('dbus-return', method='Claim') # Logger crash logger.release_name() e = q.expect('dbus-signal', signal='NameOwnerChanged', predicate=(lambda e: e.args[0] == logger.bus_name and e.args[2] == ''), ) bus.flush() # Logger gets restarted logger.reacquire_name() e = q.expect('dbus-signal', signal='NameOwnerChanged', predicate=(lambda e: e.args[0] == logger.bus_name and e.args[1] == ''), ) # Logger recovers the channel e = q.expect('dbus-method-call', path=logger.object_path, interface=cs.OBSERVER, method='ObserveChannels', handled=False) # gnome-shell which is handling the channel asks to re-ensure it cd_iface = dbus.Interface(cd, cs.CD) call_async(q, cd_iface, 'PresentChannel', chan.object_path, 0) # gnome-shell is asked to re-handle the channel e = q.expect('dbus-method-call', path=gs.object_path, interface=cs.HANDLER, method='HandleChannels', handled=False) q.dbus_return(e.message, signature='') q.expect('dbus-return', method='PresentChannel') chan.close() if __name__ == '__main__': exec_test(test, {}) telepathy-mission-control-5.16.4/tests/twisted/dispatcher/fdo-21034.py0000644000175000017500000000574212735242352026576 0ustar00gkiagiagkiagia00000000000000# Copyright (C) 2009 Nokia Corporation # Copyright (C) 2009 Collabora Ltd. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA # 02110-1301 USA import dbus """Regression test for https://bugs.freedesktop.org/show_bug.cgi?id=21034 """ import dbus import dbus.service from servicetest import EventPattern, tp_name_prefix, tp_path_prefix, \ call_async from mctest import exec_test, SimulatedConnection, SimulatedClient, \ create_fakecm_account, enable_fakecm_account, SimulatedChannel, \ expect_client_setup import constants as cs def test(q, bus, mc): params = dbus.Dictionary({"account": "someguy@example.com", "password": "secrecy"}, signature='sv') cm_name_ref, account = create_fakecm_account(q, bus, mc, params) conn = enable_fakecm_account(q, bus, mc, account, params) text_fixed_properties = dbus.Dictionary({ cs.CHANNEL + '.TargetHandleType': cs.HT_CONTACT, cs.CHANNEL + '.ChannelType': cs.CHANNEL_TYPE_TEXT, }, signature='sv') client = SimulatedClient(q, bus, 'Empathy', observe=[text_fixed_properties], approve=[text_fixed_properties], handle=[text_fixed_properties], bypass_approval=False) # wait for MC to download the properties expect_client_setup(q, [client]) cd = bus.get_object(cs.CD, cs.CD_PATH) cd_props = dbus.Interface(cd, cs.PROPERTIES_IFACE) # chat UI calls ChannelDispatcher.EnsureChannel or CreateChannel request = dbus.Dictionary({ cs.CHANNEL + '.ChannelType': cs.CHANNEL_TYPE_TEXT, cs.CHANNEL + '.TargetHandleType': cs.HT_CONTACT, cs.CHANNEL + '.TargetID': 'juliet', }, signature='sv') call_async(q, cd, 'CreateChannel', account.object_path, request, dbus.Int64(1234), 'grr.arg', # a valid bus name, but the wrong prefix dbus_interface=cs.CD) ret = q.expect('dbus-error', method='CreateChannel') assert ret.error.get_dbus_name() == cs.INVALID_ARGUMENT call_async(q, cd, 'CreateChannel', account.object_path, request, dbus.Int64(1234), 'can has cheeseburger?', # a totally invalid bus name dbus_interface=cs.CD) ret = q.expect('dbus-error', method='CreateChannel') assert ret.error.get_dbus_name() == cs.INVALID_ARGUMENT if __name__ == '__main__': exec_test(test, {}) telepathy-mission-control-5.16.4/tests/twisted/dispatcher/created-behind-our-back.py0000644000175000017500000001031712735242352031710 0ustar00gkiagiagkiagia00000000000000# Copyright (C) 2009 Nokia Corporation # Copyright (C) 2009 Collabora Ltd. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA # 02110-1301 USA """Regression test for channels created "by going behind MC's back".""" import dbus import dbus.service from servicetest import EventPattern, tp_name_prefix, tp_path_prefix, \ call_async, sync_dbus from mctest import exec_test, SimulatedConnection, SimulatedClient, \ create_fakecm_account, enable_fakecm_account, SimulatedChannel, \ expect_client_setup import constants as cs def test(q, bus, mc): # Because the channels are handled by another process, we should never be # asked to approve or handle them. forbidden = [ EventPattern('dbus-method-call', method='HandleChannels'), EventPattern('dbus-method-call', method='AddDispatchOperation'), ] q.forbid_events(forbidden) params = dbus.Dictionary({"account": "someguy@example.com", "password": "secrecy"}, signature='sv') cm_name_ref, account = create_fakecm_account(q, bus, mc, params) conn = enable_fakecm_account(q, bus, mc, account, params) text_fixed_properties = dbus.Dictionary({ cs.CHANNEL + '.TargetHandleType': cs.HT_CONTACT, cs.CHANNEL + '.ChannelType': cs.CHANNEL_TYPE_TEXT, }, signature='sv') empathy = SimulatedClient(q, bus, 'Empathy', observe=[text_fixed_properties], approve=[text_fixed_properties], handle=[text_fixed_properties], bypass_approval=False) kopete = SimulatedClient(q, bus, 'Kopete', observe=[text_fixed_properties], approve=[text_fixed_properties], handle=[text_fixed_properties], bypass_approval=False) expect_client_setup(q, [empathy, kopete]) # a non-MC-using client goes behind our back to call CreateChannel or # EnsureChannel on the Connection directly # # (This is not simulated here: we just behave as though it had happened) channel_immutable = dbus.Dictionary(text_fixed_properties) channel_immutable[cs.CHANNEL + '.InitiatorID'] = conn.self_ident channel_immutable[cs.CHANNEL + '.InitiatorHandle'] = conn.self_handle channel_immutable[cs.CHANNEL + '.Requested'] = True channel_immutable[cs.CHANNEL + '.Interfaces'] = \ dbus.Array([], signature='s') channel_immutable[cs.CHANNEL + '.TargetHandle'] = \ conn.ensure_handle(cs.HT_CONTACT, 'juliet') channel_immutable[cs.CHANNEL + '.TargetID'] = 'juliet' channel = SimulatedChannel(conn, channel_immutable) channel.announce() # Observer should get told, processing waits for it e, k = q.expect_many( EventPattern('dbus-method-call', path=empathy.object_path, interface=cs.OBSERVER, method='ObserveChannels', handled=False), EventPattern('dbus-method-call', path=kopete.object_path, interface=cs.OBSERVER, method='ObserveChannels', handled=False), ) assert e.args[0] == account.object_path, e.args assert e.args[1] == conn.object_path, e.args assert e.args[3] == '/', e.args # no dispatch operation assert e.args[4] == [], e.args channels = e.args[2] assert len(channels) == 1, channels assert channels[0][0] == channel.object_path, channels assert channels[0][1] == channel_immutable, channels assert e.args == k.args # Observers say "OK, go" q.dbus_return(k.message, signature='') q.dbus_return(e.message, signature='') sync_dbus(bus, q, mc) if __name__ == '__main__': exec_test(test, {}) telepathy-mission-control-5.16.4/tests/twisted/dispatcher/lose-text.py0000644000175000017500000001536512735242352027305 0ustar00gkiagiagkiagia00000000000000# Copyright (C) 2009 Nokia Corporation # Copyright (C) 2009 Collabora Ltd. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA # 02110-1301 USA import dbus """Regression test for losing a channel while AddDispatchOperation is being called. """ import dbus import dbus.service from servicetest import EventPattern, tp_name_prefix, tp_path_prefix, \ call_async from mctest import exec_test, SimulatedConnection, SimulatedClient, \ create_fakecm_account, enable_fakecm_account, SimulatedChannel, \ expect_client_setup import constants as cs def test(q, bus, mc): params = dbus.Dictionary({"account": "someguy@example.com", "password": "secrecy"}, signature='sv') cm_name_ref, account = create_fakecm_account(q, bus, mc, params) conn = enable_fakecm_account(q, bus, mc, account, params) text_fixed_properties = dbus.Dictionary({ cs.CHANNEL + '.TargetHandleType': cs.HT_CONTACT, cs.CHANNEL + '.ChannelType': cs.CHANNEL_TYPE_TEXT, }, signature='sv') # Two clients want to observe, approve and handle channels empathy = SimulatedClient(q, bus, 'Empathy', observe=[text_fixed_properties], approve=[text_fixed_properties], handle=[text_fixed_properties], bypass_approval=False) kopete = SimulatedClient(q, bus, 'Kopete', observe=[text_fixed_properties], approve=[text_fixed_properties], handle=[text_fixed_properties], bypass_approval=False) # wait for MC to download the properties expect_client_setup(q, [empathy, kopete]) # subscribe to the OperationList interface (MC assumes that until this # property has been retrieved once, nobody cares) cd = bus.get_object(cs.CD, cs.CD_PATH) cd_props = dbus.Interface(cd, cs.PROPERTIES_IFACE) assert cd_props.Get(cs.CD_IFACE_OP_LIST, 'DispatchOperations') == [] channel_properties = dbus.Dictionary(text_fixed_properties, signature='sv') channel_properties[cs.CHANNEL + '.TargetID'] = 'juliet' channel_properties[cs.CHANNEL + '.TargetHandle'] = \ conn.ensure_handle(cs.HT_CONTACT, 'juliet') channel_properties[cs.CHANNEL + '.InitiatorID'] = 'juliet' channel_properties[cs.CHANNEL + '.InitiatorHandle'] = \ conn.ensure_handle(cs.HT_CONTACT, 'juliet') channel_properties[cs.CHANNEL + '.Requested'] = False channel_properties[cs.CHANNEL + '.Interfaces'] = dbus.Array(signature='s') chan = SimulatedChannel(conn, channel_properties) chan.announce() # A channel dispatch operation is created e = q.expect('dbus-signal', path=cs.CD_PATH, interface=cs.CD_IFACE_OP_LIST, signal='NewDispatchOperation') cdo_path = e.args[0] cdo_properties = e.args[1] assert cdo_properties[cs.CDO + '.Account'] == account.object_path assert cdo_properties[cs.CDO + '.Connection'] == conn.object_path assert cs.CDO + '.Interfaces' in cdo_properties handlers = cdo_properties[cs.CDO + '.PossibleHandlers'][:] handlers.sort() assert handlers == [cs.tp_name_prefix + '.Client.Empathy', cs.tp_name_prefix + '.Client.Kopete'], handlers assert cs.CD_IFACE_OP_LIST in cd_props.Get(cs.CD, 'Interfaces') assert cd_props.Get(cs.CD_IFACE_OP_LIST, 'DispatchOperations') ==\ [(cdo_path, cdo_properties)] cdo = bus.get_object(cs.CD, cdo_path) cdo_iface = dbus.Interface(cdo, cs.CDO) # Both Observers are told about the new channel e, k = q.expect_many( EventPattern('dbus-method-call', path=empathy.object_path, interface=cs.OBSERVER, method='ObserveChannels', handled=False), EventPattern('dbus-method-call', path=kopete.object_path, interface=cs.OBSERVER, method='ObserveChannels', handled=False), ) assert e.args[0] == account.object_path, e.args assert e.args[1] == conn.object_path, e.args channels = e.args[2] assert len(channels) == 1, channels assert channels[0][0] == chan.object_path, channels assert channels[0][1] == channel_properties, channels assert k.args == e.args # Both Observers indicate that they are ready to proceed q.dbus_return(k.message, signature='') q.dbus_return(e.message, signature='') # The Approvers are next e, k = q.expect_many( EventPattern('dbus-method-call', path=empathy.object_path, interface=cs.APPROVER, method='AddDispatchOperation', handled=False), EventPattern('dbus-method-call', path=kopete.object_path, interface=cs.APPROVER, method='AddDispatchOperation', handled=False), ) assert e.args == [[(chan.object_path, channel_properties)], cdo_path, cdo_properties] assert k.args == e.args q.dbus_return(e.message, signature='') # The channel closes before Kopete has said yes. As a result, MC isn't # allowed to emit ChannelLost or Finished yet. chan.close() # Empathy wants to handle the channel, but is too late call_async(q, cdo_iface, 'HandleWith', cs.tp_name_prefix + '.Client.Empathy') e = q.expect('dbus-error') # FIXME: e.error.get_dbus_name() == [...Disconnected] which doesn't # seem like the most appropriate thing for MC to do (but at least it's # consistent with ChannelLost) # *Now* Kopete is happy... q.dbus_return(k.message, signature='') # ... and in response, the channel dispatch operation finishes e = q.expect('dbus-signal', path=cdo_path, signal='ChannelLost') assert e.args[0] == chan.object_path # FIXME: e.args[1:] == [...Disconnected, 'Channel aborted'] which doesn't # seem like the most appropriate thing for MC to do q.expect('dbus-signal', path=cdo_path, signal='Finished') q.expect('dbus-signal', path=cs.CD_PATH, signal='DispatchOperationFinished', args=[cdo_path]) # Now there are no more active channel dispatch operations assert cd_props.Get(cs.CD_IFACE_OP_LIST, 'DispatchOperations') == [] if __name__ == '__main__': exec_test(test, {}) telepathy-mission-control-5.16.4/tests/twisted/dispatcher/ensure-is-approval.py0000644000175000017500000002475012735242352031113 0ustar00gkiagiagkiagia00000000000000# Copyright (C) 2009 Nokia Corporation # Copyright (C) 2009 Collabora Ltd. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA # 02110-1301 USA import dbus """Regression test for EnsureChannel counting as approval of an incoming text channel. """ import dbus import dbus.bus import dbus.service from servicetest import EventPattern, tp_name_prefix, tp_path_prefix, \ call_async, sync_dbus from mctest import exec_test, SimulatedConnection, SimulatedClient, \ create_fakecm_account, enable_fakecm_account, SimulatedChannel, \ expect_client_setup import constants as cs def test(q, bus, mc): params = dbus.Dictionary({"account": "someguy@example.com", "password": "secrecy"}, signature='sv') cm_name_ref, account = create_fakecm_account(q, bus, mc, params) conn = enable_fakecm_account(q, bus, mc, account, params) # One client (Kopete) has less specific filters than the other (Empathy), # to make sure that the dispatcher would normally prefer Empathy; this # means that when we use Kopete as the preferred handler, we know that # if Kopete is invoked, then preferring the preferred handler correctly # took precedence over the normal logic. vague_fixed_properties = dbus.Dictionary({ cs.CHANNEL + '.ChannelType': cs.CHANNEL_TYPE_TEXT, }, signature='sv') text_fixed_properties = dbus.Dictionary({ cs.CHANNEL + '.TargetHandleType': cs.HT_CONTACT, cs.CHANNEL + '.ChannelType': cs.CHANNEL_TYPE_TEXT, }, signature='sv') empathy_bus = dbus.bus.BusConnection() kopete_bus = dbus.bus.BusConnection() q.attach_to_bus(empathy_bus) q.attach_to_bus(kopete_bus) # Two clients want to observe, approve and handle channels empathy = SimulatedClient(q, empathy_bus, 'Empathy', observe=[text_fixed_properties], approve=[text_fixed_properties], handle=[text_fixed_properties], bypass_approval=False) kopete = SimulatedClient(q, kopete_bus, 'Kopete', observe=[vague_fixed_properties], approve=[vague_fixed_properties], handle=[vague_fixed_properties], bypass_approval=False) # wait for MC to download the properties expect_client_setup(q, [empathy, kopete]) # subscribe to the OperationList interface (MC assumes that until this # property has been retrieved once, nobody cares) cd = bus.get_object(cs.CD, cs.CD_PATH) cd_props = dbus.Interface(cd, cs.PROPERTIES_IFACE) assert cd_props.Get(cs.CD_IFACE_OP_LIST, 'DispatchOperations') == [] channel_properties = dbus.Dictionary(text_fixed_properties, signature='sv') channel_properties[cs.CHANNEL + '.TargetID'] = 'juliet' channel_properties[cs.CHANNEL + '.TargetHandle'] = \ conn.ensure_handle(cs.HT_CONTACT, 'juliet') channel_properties[cs.CHANNEL + '.InitiatorID'] = 'juliet' channel_properties[cs.CHANNEL + '.InitiatorHandle'] = \ conn.ensure_handle(cs.HT_CONTACT, 'juliet') channel_properties[cs.CHANNEL + '.Requested'] = False channel_properties[cs.CHANNEL + '.Interfaces'] = dbus.Array(signature='s') chan = SimulatedChannel(conn, channel_properties) chan.announce() # A channel dispatch operation is created e = q.expect('dbus-signal', path=cs.CD_PATH, interface=cs.CD_IFACE_OP_LIST, signal='NewDispatchOperation') cdo_path = e.args[0] cdo_properties = e.args[1] assert cdo_properties[cs.CDO + '.Account'] == account.object_path assert cdo_properties[cs.CDO + '.Connection'] == conn.object_path assert cs.CDO + '.Interfaces' in cdo_properties handlers = cdo_properties[cs.CDO + '.PossibleHandlers'][:] # Empathy has a more specific filter, so it comes first assert handlers == [cs.tp_name_prefix + '.Client.Empathy', cs.tp_name_prefix + '.Client.Kopete'], handlers assert cs.CD_IFACE_OP_LIST in cd_props.Get(cs.CD, 'Interfaces') assert cd_props.Get(cs.CD_IFACE_OP_LIST, 'DispatchOperations') ==\ [(cdo_path, cdo_properties)] cdo = bus.get_object(cs.CD, cdo_path) cdo_iface = dbus.Interface(cdo, cs.CDO) cdo_props_iface = dbus.Interface(cdo, cs.PROPERTIES_IFACE) assert cdo_props_iface.Get(cs.CDO, 'Interfaces') == \ cdo_properties[cs.CDO + '.Interfaces'] assert cdo_props_iface.Get(cs.CDO, 'Connection') == conn.object_path assert cdo_props_iface.Get(cs.CDO, 'Account') == account.object_path assert cdo_props_iface.Get(cs.CDO, 'Channels') == [(chan.object_path, channel_properties)] assert cdo_props_iface.Get(cs.CDO, 'PossibleHandlers') == \ cdo_properties[cs.CDO + '.PossibleHandlers'] # Both Observers are told about the new channel e, k = q.expect_many( EventPattern('dbus-method-call', path=empathy.object_path, interface=cs.OBSERVER, method='ObserveChannels', handled=False), EventPattern('dbus-method-call', path=kopete.object_path, interface=cs.OBSERVER, method='ObserveChannels', handled=False), ) assert e.args[0] == account.object_path, e.args assert e.args[1] == conn.object_path, e.args assert e.args[3] == cdo_path, e.args assert e.args[4] == [], e.args # no requests satisfied channels = e.args[2] assert len(channels) == 1, channels assert channels[0][0] == chan.object_path, channels assert channels[0][1] == channel_properties, channels assert k.args == e.args # Both Observers indicate that they are ready to proceed q.dbus_return(k.message, bus=empathy_bus, signature='') q.dbus_return(e.message, bus=kopete_bus, signature='') # The Approvers are next e, k = q.expect_many( EventPattern('dbus-method-call', path=empathy.object_path, interface=cs.APPROVER, method='AddDispatchOperation', handled=False), EventPattern('dbus-method-call', path=kopete.object_path, interface=cs.APPROVER, method='AddDispatchOperation', handled=False), ) assert e.args == [[(chan.object_path, channel_properties)], cdo_path, cdo_properties] assert k.args == e.args q.dbus_return(e.message, bus=empathy_bus, signature='') q.dbus_return(k.message, bus=kopete_bus, signature='') # Both Approvers now have a flashing icon or something, trying to get the # user's attention. However, the user is busy looking through the address # book, and independently decides to talk to Juliet. The address book # is from KDE so wants Kopete to be used. user_action_time = dbus.Int64(1238582606) request = dbus.Dictionary({ cs.CHANNEL + '.ChannelType': cs.CHANNEL_TYPE_TEXT, cs.CHANNEL + '.TargetHandleType': cs.HT_CONTACT, cs.CHANNEL + '.TargetID': 'juliet', }, signature='sv') call_async(q, cd, 'EnsureChannel', account.object_path, request, user_action_time, kopete.bus_name, dbus_interface=cs.CD) ret, add_request_call = q.expect_many( EventPattern('dbus-return', method='EnsureChannel'), EventPattern('dbus-method-call', handled=False, interface=cs.CLIENT_IFACE_REQUESTS, method='AddRequest', path=kopete.object_path), ) request_path = ret.value[0] assert add_request_call.args[0] == request_path request_props = add_request_call.args[1] assert request_props[cs.CR + '.Account'] == account.object_path assert request_props[cs.CR + '.Requests'] == [request] assert request_props[cs.CR + '.UserActionTime'] == user_action_time assert request_props[cs.CR + '.PreferredHandler'] == kopete.bus_name assert request_props[cs.CR + '.Interfaces'] == [] # UI connects to signals and calls ChannelRequest.Proceed() cr = bus.get_object(cs.AM, request_path) request_props = cr.GetAll(cs.CR, dbus_interface=cs.PROPERTIES_IFACE) assert request_props['Account'] == account.object_path assert request_props['Requests'] == [request] assert request_props['UserActionTime'] == user_action_time assert request_props['PreferredHandler'] == kopete.bus_name assert request_props['Interfaces'] == [] cr.Proceed(dbus_interface=cs.CR) cm_request_call = q.expect('dbus-method-call', interface=cs.CONN_IFACE_REQUESTS, method='EnsureChannel', path=conn.object_path, args=[request], handled=False) q.dbus_return(add_request_call.message, bus=kopete_bus, signature='') # Time passes. The CM returns the existing channel q.dbus_return(cm_request_call.message, False, chan.object_path, chan.immutable, signature='boa{sv}') # EnsureChannel constitutes approval, so Kopete is told to handle the # channel e = q.expect('dbus-method-call', path=kopete.object_path, interface=cs.HANDLER, method='HandleChannels', handled=False) assert e.args[0] == account.object_path, e.args assert e.args[1] == conn.object_path, e.args channels = e.args[2] assert len(channels) == 1, channels assert channels[0][0] == chan.object_path, channels assert channels[0][1] == chan.immutable, channels assert e.args[3] == [request_path], e.args assert e.args[4] == user_action_time, (e.args[4], user_action_time) assert isinstance(e.args[5], dict) assert len(e.args) == 6 q.dbus_return(e.message, bus=kopete_bus, signature='') q.expect_many( EventPattern('dbus-signal', interface=cs.CDO, signal='Finished'), EventPattern('dbus-signal', interface=cs.CD_IFACE_OP_LIST, signal='DispatchOperationFinished'), ) # Now there are no more active channel dispatch operations assert cd_props.Get(cs.CD_IFACE_OP_LIST, 'DispatchOperations') == [] if __name__ == '__main__': exec_test(test, {}) telepathy-mission-control-5.16.4/tests/twisted/dispatcher/recover-from-disconnect.py0000644000175000017500000002456712735242352032122 0ustar00gkiagiagkiagia00000000000000# Copyright (C) 2009 Nokia Corporation # Copyright (C) 2009 Collabora Ltd. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA # 02110-1301 USA import dbus import dbus import dbus.service from servicetest import EventPattern, tp_name_prefix, tp_path_prefix, \ call_async, sync_dbus from mctest import exec_test, SimulatedConnection, create_fakecm_account,\ SimulatedChannel, SimulatedClient, expect_client_setup import constants as cs text_fixed_properties = dbus.Dictionary({ cs.CHANNEL + '.TargetHandleType': cs.HT_CONTACT, cs.CHANNEL + '.ChannelType': cs.CHANNEL_TYPE_TEXT, }, signature='sv') empathy_bus = dbus.bus.BusConnection() kopete_bus = dbus.bus.BusConnection() def test(q, bus, mc): q.attach_to_bus(empathy_bus) q.attach_to_bus(kopete_bus) # Two clients want to observe, approve and handle channels empathy = SimulatedClient(q, empathy_bus, 'Empathy', observe=[text_fixed_properties], approve=[text_fixed_properties], handle=[text_fixed_properties], bypass_approval=False) kopete = SimulatedClient(q, kopete_bus, 'Kopete', observe=[text_fixed_properties], approve=[text_fixed_properties], handle=[text_fixed_properties], bypass_approval=False) # wait for MC to download the properties expect_client_setup(q, [empathy, kopete]) cm_name_ref = dbus.service.BusName( tp_name_prefix + '.ConnectionManager.fakecm', bus=bus) # Create an account params = dbus.Dictionary({"account": "someguy@example.com", "password": "secrecy"}, signature='sv') (cm_name_ref, account) = create_fakecm_account(q, bus, mc, params) account_iface = dbus.Interface(account, cs.ACCOUNT) account_props = dbus.Interface(account, cs.PROPERTIES_IFACE) call_async(q, account, 'Set', cs.ACCOUNT, 'Enabled', False, dbus_interface=cs.PROPERTIES_IFACE) q.expect('dbus-return', method='Set') # Enable the account call_async(q, account, 'Set', cs.ACCOUNT, 'Enabled', True, dbus_interface=cs.PROPERTIES_IFACE) # Set online presence presence = dbus.Struct((dbus.UInt32(cs.PRESENCE_TYPE_BUSY), 'busy', 'Fixing MC bugs'), signature='uss') call_async(q, account, 'Set', cs.ACCOUNT, 'RequestedPresence', presence, dbus_interface=cs.PROPERTIES_IFACE) e = q.expect('dbus-method-call', method='RequestConnection', args=['fakeprotocol', params], destination=tp_name_prefix + '.ConnectionManager.fakecm', path=tp_path_prefix + '/ConnectionManager/fakecm', interface=tp_name_prefix + '.ConnectionManager', handled=False) conn = SimulatedConnection(q, bus, 'fakecm', 'fakeprotocol', 'first', 'myself') q.dbus_return(e.message, conn.bus_name, conn.object_path, signature='so') q.expect_many( EventPattern('dbus-method-call', interface=cs.PROPERTIES_IFACE, method='GetAll', args=[cs.CONN_IFACE_REQUESTS], path=conn.object_path, handled=True), ) # MC calls GetStatus (maybe) and then Connect q.expect('dbus-method-call', method='Connect', path=conn.object_path, handled=True) # Connect succeeds conn.StatusChanged(cs.CONN_STATUS_CONNECTED, cs.CONN_STATUS_REASON_NONE) test_dispatching(q, bus, conn, account, empathy, kopete) # Connection falls over for a miscellaneous reason conn.StatusChanged(cs.CONN_STATUS_DISCONNECTED, cs.CONN_STATUS_REASON_NETWORK_ERROR) # MC reconnects e = q.expect('dbus-method-call', method='RequestConnection', args=['fakeprotocol', params], destination=tp_name_prefix + '.ConnectionManager.fakecm', path=tp_path_prefix + '/ConnectionManager/fakecm', interface=tp_name_prefix + '.ConnectionManager', handled=False) conn = SimulatedConnection(q, bus, 'fakecm', 'fakeprotocol', 'second', 'myself') q.dbus_return(e.message, conn.bus_name, conn.object_path, signature='so') q.expect_many( EventPattern('dbus-method-call', interface=cs.PROPERTIES_IFACE, method='GetAll', args=[cs.CONN_IFACE_REQUESTS], path=conn.object_path, handled=True), ) # MC calls GetStatus (maybe) and then Connect q.expect('dbus-method-call', method='Connect', path=conn.object_path, handled=True) # Connect succeeds conn.StatusChanged(cs.CONN_STATUS_CONNECTED, cs.CONN_STATUS_REASON_NONE) test_dispatching(q, bus, conn, account, empathy, kopete) def test_dispatching(q, bus, conn, account, empathy, kopete): # subscribe to the OperationList interface (MC assumes that until this # property has been retrieved once, nobody cares) cd = bus.get_object(cs.CD, cs.CD_PATH) cd_props = dbus.Interface(cd, cs.PROPERTIES_IFACE) ops = cd_props.Get(cs.CD_IFACE_OP_LIST, 'DispatchOperations') assert ops == [], ops channel_properties = dbus.Dictionary(text_fixed_properties, signature='sv') channel_properties[cs.CHANNEL + '.TargetID'] = 'juliet' channel_properties[cs.CHANNEL + '.TargetHandle'] = \ conn.ensure_handle(cs.HT_CONTACT, 'juliet') channel_properties[cs.CHANNEL + '.InitiatorID'] = 'juliet' channel_properties[cs.CHANNEL + '.InitiatorHandle'] = \ conn.ensure_handle(cs.HT_CONTACT, 'juliet') channel_properties[cs.CHANNEL + '.Requested'] = False channel_properties[cs.CHANNEL + '.Interfaces'] = dbus.Array(signature='s') chan = SimulatedChannel(conn, channel_properties) chan.announce() # A channel dispatch operation is created e = q.expect('dbus-signal', path=cs.CD_PATH, interface=cs.CD_IFACE_OP_LIST, signal='NewDispatchOperation') cdo_path = e.args[0] cdo_properties = e.args[1] assert cdo_properties[cs.CDO + '.Account'] == account.object_path assert cdo_properties[cs.CDO + '.Connection'] == conn.object_path assert cs.CDO + '.Interfaces' in cdo_properties handlers = cdo_properties[cs.CDO + '.PossibleHandlers'][:] handlers.sort() assert handlers == [cs.tp_name_prefix + '.Client.Empathy', cs.tp_name_prefix + '.Client.Kopete'], handlers assert cs.CD_IFACE_OP_LIST in cd_props.Get(cs.CD, 'Interfaces') assert cd_props.Get(cs.CD_IFACE_OP_LIST, 'DispatchOperations') ==\ [(cdo_path, cdo_properties)] cdo = bus.get_object(cs.CD, cdo_path) cdo_iface = dbus.Interface(cdo, cs.CDO) cdo_props_iface = dbus.Interface(cdo, cs.PROPERTIES_IFACE) assert cdo_props_iface.Get(cs.CDO, 'Interfaces') == \ cdo_properties[cs.CDO + '.Interfaces'] assert cdo_props_iface.Get(cs.CDO, 'Connection') == conn.object_path assert cdo_props_iface.Get(cs.CDO, 'Account') == account.object_path assert cdo_props_iface.Get(cs.CDO, 'Channels') == [(chan.object_path, channel_properties)] assert cdo_props_iface.Get(cs.CDO, 'PossibleHandlers') == \ cdo_properties[cs.CDO + '.PossibleHandlers'] # Both Observers are told about the new channel e, k = q.expect_many( EventPattern('dbus-method-call', path=empathy.object_path, interface=cs.OBSERVER, method='ObserveChannels', handled=False), EventPattern('dbus-method-call', path=kopete.object_path, interface=cs.OBSERVER, method='ObserveChannels', handled=False), ) assert e.args[0] == account.object_path, e.args assert e.args[1] == conn.object_path, e.args assert e.args[3] == cdo_path, e.args assert e.args[4] == [], e.args # no requests satisfied channels = e.args[2] assert len(channels) == 1, channels assert channels[0][0] == chan.object_path, channels assert channels[0][1] == channel_properties, channels assert k.args == e.args # Both Observers indicate that they are ready to proceed q.dbus_return(k.message, bus=empathy_bus, signature='') q.dbus_return(e.message, bus=kopete_bus, signature='') # The Approvers are next e, k = q.expect_many( EventPattern('dbus-method-call', path=empathy.object_path, interface=cs.APPROVER, method='AddDispatchOperation', handled=False), EventPattern('dbus-method-call', path=kopete.object_path, interface=cs.APPROVER, method='AddDispatchOperation', handled=False), ) assert e.args == [[(chan.object_path, channel_properties)], cdo_path, cdo_properties] assert k.args == e.args q.dbus_return(e.message, bus=empathy_bus, signature='') q.dbus_return(k.message, bus=kopete_bus, signature='') # Both Approvers now have a flashing icon or something, trying to get the # user's attention # The user responds to Empathy first call_async(q, cdo_iface, 'HandleWith', cs.tp_name_prefix + '.Client.Empathy') # Empathy is asked to handle the channels e = q.expect('dbus-method-call', path=empathy.object_path, interface=cs.HANDLER, method='HandleChannels', handled=False) # Empathy accepts the channels q.dbus_return(e.message, bus=empathy_bus, signature='') q.expect_many( EventPattern('dbus-return', method='HandleWith'), EventPattern('dbus-signal', interface=cs.CDO, signal='Finished'), EventPattern('dbus-signal', interface=cs.CD_IFACE_OP_LIST, signal='DispatchOperationFinished'), ) # Now there are no more active channel dispatch operations assert cd_props.Get(cs.CD_IFACE_OP_LIST, 'DispatchOperations') == [] if __name__ == '__main__': exec_test(test, {}) telepathy-mission-control-5.16.4/tests/twisted/dispatcher/undispatchable.py0000644000175000017500000001025312735242352030336 0ustar00gkiagiagkiagia00000000000000# Copyright (C) 2009 Nokia Corporation # Copyright (C) 2009 Collabora Ltd. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA # 02110-1301 USA import dbus """Regression test for dispatching an incoming channel for which there are no handlers. """ import dbus import dbus.bus import dbus.service from servicetest import EventPattern, tp_name_prefix, tp_path_prefix, \ call_async, sync_dbus, assertEquals from mctest import exec_test, SimulatedConnection, SimulatedClient, \ create_fakecm_account, enable_fakecm_account, SimulatedChannel, \ expect_client_setup import constants as cs def test(q, bus, mc): params = dbus.Dictionary({"account": "someguy@example.com", "password": "secrecy"}, signature='sv') cm_name_ref, account = create_fakecm_account(q, bus, mc, params) conn = enable_fakecm_account(q, bus, mc, account, params) text_fixed_properties = dbus.Dictionary({ cs.CHANNEL + '.ChannelType': cs.CHANNEL_TYPE_TEXT, cs.CHANNEL + '.TargetHandleType': cs.HT_CONTACT, }, signature='sv') # subscribe to the OperationList interface (MC assumes that until this # property has been retrieved once, nobody cares) cd = bus.get_object(cs.CD, cs.CD_PATH) cd_props = dbus.Interface(cd, cs.PROPERTIES_IFACE) assert cd_props.Get(cs.CD_IFACE_OP_LIST, 'DispatchOperations') == [] client = SimulatedClient(q, bus, 'Client', observe=[text_fixed_properties], approve=[text_fixed_properties], handle=[], bypass_approval=False) # wait for MC to download the properties expect_client_setup(q, [client]) channel_properties = dbus.Dictionary(text_fixed_properties, signature='sv') channel_properties[cs.CHANNEL + '.TargetID'] = 'juliet' channel_properties[cs.CHANNEL + '.TargetHandle'] = \ conn.ensure_handle(cs.HT_CONTACT, 'juliet') channel_properties[cs.CHANNEL + '.InitiatorID'] = 'juliet' channel_properties[cs.CHANNEL + '.InitiatorHandle'] = \ conn.ensure_handle(cs.HT_CONTACT, 'juliet') channel_properties[cs.CHANNEL + '.Requested'] = False channel_properties[cs.CHANNEL + '.Interfaces'] = dbus.Array(signature='s') forbidden = [ EventPattern('dbus-method-call', method='AddDispatchOperation'), ] q.forbid_events(forbidden) chan = SimulatedChannel(conn, channel_properties) chan.announce() e = q.expect('dbus-signal', path=cs.CD_PATH, interface=cs.CD_IFACE_OP_LIST, signal='NewDispatchOperation') cdo_path = e.args[0] cdo_properties = e.args[1] assert cdo_properties[cs.CDO + '.Account'] == account.object_path assert cdo_properties[cs.CDO + '.Connection'] == conn.object_path assert cs.CDO + '.Interfaces' in cdo_properties handlers = cdo_properties[cs.CDO + '.PossibleHandlers'][:] assertEquals([], handlers) e = q.expect('dbus-method-call', path=client.object_path, interface=cs.OBSERVER, method='ObserveChannels', handled=False) sync_dbus(bus, q, mc) q.dbus_return(e.message, signature='') # now (but only now) MC kills the channel q.expect_many( EventPattern('dbus-signal', path=cdo_path, signal='Finished'), EventPattern('dbus-method-call', path=chan.object_path, method='Close', handled=True), ) # There are no active channel dispatch operations assert cd_props.Get(cs.CD_IFACE_OP_LIST, 'DispatchOperations') == [] if __name__ == '__main__': exec_test(test, {}) telepathy-mission-control-5.16.4/tests/twisted/dispatcher/already-has-channel.py0000644000175000017500000002037612735242352031157 0ustar00gkiagiagkiagia00000000000000# Copyright (C) 2009 Nokia Corporation # Copyright (C) 2009 Collabora Ltd. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA # 02110-1301 USA import dbus """Regression test for dispatching an incoming Text channel that was already there before the Connection became ready. """ import dbus import dbus.service from servicetest import EventPattern, tp_name_prefix, tp_path_prefix, \ call_async from mctest import exec_test, SimulatedConnection, SimulatedClient, \ create_fakecm_account, SimulatedChannel, expect_client_setup import constants as cs def test(q, bus, mc): params = dbus.Dictionary({"account": "someguy@example.com", "password": "secrecy"}, signature='sv') cm_name_ref, account = create_fakecm_account(q, bus, mc, params) text_fixed_properties = dbus.Dictionary({ cs.CHANNEL + '.TargetHandleType': cs.HT_CONTACT, cs.CHANNEL + '.ChannelType': cs.CHANNEL_TYPE_TEXT, }, signature='sv') # Two clients want to observe, approve and handle channels empathy = SimulatedClient(q, bus, 'Empathy', observe=[text_fixed_properties], approve=[text_fixed_properties], handle=[text_fixed_properties], bypass_approval=False) kopete = SimulatedClient(q, bus, 'Kopete', observe=[text_fixed_properties], approve=[text_fixed_properties], handle=[text_fixed_properties], bypass_approval=False) # wait for MC to download the properties expect_client_setup(q, [empathy, kopete]) # Enable the account account.Set(cs.ACCOUNT, 'Enabled', True, dbus_interface=cs.PROPERTIES_IFACE) requested_presence = dbus.Struct((dbus.UInt32(2L), dbus.String(u'available'), dbus.String(u''))) account.Set(cs.ACCOUNT, 'RequestedPresence', requested_presence, dbus_interface=cs.PROPERTIES_IFACE) e = q.expect('dbus-method-call', method='RequestConnection', args=['fakeprotocol', params], destination=cs.tp_name_prefix + '.ConnectionManager.fakecm', path=cs.tp_path_prefix + '/ConnectionManager/fakecm', interface=cs.tp_name_prefix + '.ConnectionManager', handled=False) # Don't allow the Connection to become ready until we want it to, by # avoiding a return from GetInterfaces conn = SimulatedConnection(q, bus, 'fakecm', 'fakeprotocol', '_', 'myself', implement_get_interfaces=False) q.dbus_return(e.message, conn.bus_name, conn.object_path, signature='so') # this is the pre-Connect one e = q.expect('dbus-method-call', method='GetInterfaces', path=conn.object_path, handled=False) q.dbus_raise(e.message, cs.DISCONNECTED, 'Not connected yet') q.expect('dbus-method-call', method='Connect', path=conn.object_path, handled=True) conn.StatusChanged(cs.CONN_STATUS_CONNECTED, cs.CONN_STATUS_REASON_NONE) get_interfaces_call = q.expect('dbus-method-call', method='GetInterfaces', path=conn.object_path, handled=False) # subscribe to the OperationList interface (MC assumes that until this # property has been retrieved once, nobody cares) cd = bus.get_object(cs.CD, cs.CD_PATH) cd_props = dbus.Interface(cd, cs.PROPERTIES_IFACE) assert cd_props.Get(cs.CD_IFACE_OP_LIST, 'DispatchOperations') == [] # Before returning from GetInterfaces, make a Channel spring into # existence channel_properties = dbus.Dictionary(text_fixed_properties, signature='sv') channel_properties[cs.CHANNEL + '.TargetID'] = 'juliet' channel_properties[cs.CHANNEL + '.TargetHandle'] = \ conn.ensure_handle(cs.HT_CONTACT, 'juliet') channel_properties[cs.CHANNEL + '.InitiatorID'] = 'juliet' channel_properties[cs.CHANNEL + '.InitiatorHandle'] = \ conn.ensure_handle(cs.HT_CONTACT, 'juliet') channel_properties[cs.CHANNEL + '.Requested'] = False channel_properties[cs.CHANNEL + '.Interfaces'] = dbus.Array(signature='s') chan = SimulatedChannel(conn, channel_properties) chan.announce() # Now reply to GetInterfaces and say we have Requests conn.GetInterfaces(get_interfaces_call) # A channel dispatch operation is created for the channel we already had e = q.expect('dbus-signal', path=cs.CD_PATH, interface=cs.CD_IFACE_OP_LIST, signal='NewDispatchOperation') cdo_path = e.args[0] cdo_properties = e.args[1] assert cdo_properties[cs.CDO + '.Account'] == account.object_path assert cdo_properties[cs.CDO + '.Connection'] == conn.object_path handlers = cdo_properties[cs.CDO + '.PossibleHandlers'][:] handlers.sort() assert handlers == [cs.tp_name_prefix + '.Client.Empathy', cs.tp_name_prefix + '.Client.Kopete'], handlers assert cs.CD_IFACE_OP_LIST in cd_props.Get(cs.CD, 'Interfaces') assert cd_props.Get(cs.CD_IFACE_OP_LIST, 'DispatchOperations') ==\ [(cdo_path, cdo_properties)] cdo = bus.get_object(cs.CD, cdo_path) cdo_iface = dbus.Interface(cdo, cs.CDO) # Both Observers are told about the new channel e, k = q.expect_many( EventPattern('dbus-method-call', path=empathy.object_path, interface=cs.OBSERVER, method='ObserveChannels', handled=False), EventPattern('dbus-method-call', path=kopete.object_path, interface=cs.OBSERVER, method='ObserveChannels', handled=False), ) assert e.args[0] == account.object_path, e.args assert e.args[1] == conn.object_path, e.args assert e.args[3] == cdo_path, e.args assert e.args[4] == [], e.args # no requests satisfied channels = e.args[2] assert len(channels) == 1, channels assert channels[0][0] == chan.object_path, channels assert channels[0][1] == channel_properties, channels assert k.args == e.args # Both Observers indicate that they are ready to proceed q.dbus_return(k.message, signature='') q.dbus_return(e.message, signature='') # The Approvers are next e, k = q.expect_many( EventPattern('dbus-method-call', path=empathy.object_path, interface=cs.APPROVER, method='AddDispatchOperation', handled=False), EventPattern('dbus-method-call', path=kopete.object_path, interface=cs.APPROVER, method='AddDispatchOperation', handled=False), ) assert e.args == [[(chan.object_path, channel_properties)], cdo_path, cdo_properties] assert k.args == e.args q.dbus_return(e.message, signature='') q.dbus_return(k.message, signature='') # Both Approvers now have a flashing icon or something, trying to get the # user's attention # The user responds to Empathy first call_async(q, cdo_iface, 'HandleWith', cs.tp_name_prefix + '.Client.Empathy') # Empathy is asked to handle the channels e = q.expect('dbus-method-call', path=empathy.object_path, interface=cs.HANDLER, method='HandleChannels', handled=False) # Empathy accepts the channels q.dbus_return(e.message, signature='') q.expect_many( EventPattern('dbus-return', method='HandleWith'), EventPattern('dbus-signal', interface=cs.CDO, signal='Finished'), EventPattern('dbus-signal', interface=cs.CD_IFACE_OP_LIST, signal='DispatchOperationFinished'), ) # Now there are no more active channel dispatch operations assert cd_props.Get(cs.CD_IFACE_OP_LIST, 'DispatchOperations') == [] if __name__ == '__main__': exec_test(test, {}) telepathy-mission-control-5.16.4/tests/twisted/dispatcher/dispatch-before-connected.py0000644000175000017500000001003112735242352032341 0ustar00gkiagiagkiagia00000000000000# Copyright (C) 2010 Collabora Ltd. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA # 02110-1301 USA """Feature test ensuring that MC dispatches channels that are created before the connection status is connected. """ import dbus import dbus.service from servicetest import EventPattern, tp_name_prefix, tp_path_prefix, \ call_async, sync_dbus from mctest import exec_test, SimulatedConnection, SimulatedClient, \ create_fakecm_account, enable_fakecm_account, SimulatedChannel, \ expect_client_setup import constants as cs CHANNEL_TYPE_SERVER_VERIFICATION = \ 'org.freedesktop.Telepathy.Channel.Type.ServerVerification.DRAFT' CHANNEL_IFACE_VERIFICATION = \ 'org.freedesktop.Telepathy.Channel.Interface.Verification.DRAFT ' CHANNEL_IFACE_IDENT_EXCHANGE = \ 'org.freedesktop.Telepathy.Channel.Interface.IdentityExchange.DRAFT' def test(q, bus, mc): params = dbus.Dictionary({"account": "someone@example.com", "password": "secrecy"}, signature='sv') (cm_name_ref, account) = create_fakecm_account(q, bus, mc, params) account_iface = dbus.Interface(account, cs.ACCOUNT) account_props = dbus.Interface(account, cs.PROPERTIES_IFACE) # Ensure that it's enabled but has offline RP and doesn't connect # automatically verification_filter = dbus.Dictionary({ cs.CHANNEL + '.TargetHandleType': 0, cs.CHANNEL + '.ChannelType': CHANNEL_TYPE_SERVER_VERIFICATION, }, signature='sv') verifier_bus = dbus.bus.BusConnection() q.attach_to_bus(verifier_bus) verifier = SimulatedClient(q, verifier_bus, 'Verifier', handle=[verification_filter]) # wait for MC to download the properties expect_client_setup(q, [verifier]) account_props.Set(cs.ACCOUNT, 'RequestedPresence', (dbus.UInt32(cs.PRESENCE_TYPE_AVAILABLE), 'available', '')) account_props.Set(cs.ACCOUNT, 'Enabled', True) e = q.expect('dbus-method-call', method='RequestConnection', args=['fakeprotocol', params], destination=cs.tp_name_prefix + '.ConnectionManager.fakecm', path=cs.tp_path_prefix + '/ConnectionManager/fakecm', interface=cs.tp_name_prefix + '.ConnectionManager', handled=False) conn = SimulatedConnection(q, bus, 'fakecm', 'fakeprotocol', '_', 'myself', has_requests=True, has_presence=True) q.dbus_return(e.message, conn.bus_name, conn.object_path, signature='so') e = q.expect('dbus-method-call', method='Connect', path=conn.object_path, interface=cs.CONN) channel_properties = dbus.Dictionary(verification_filter, signature='sv') channel_properties[cs.CHANNEL + '.TargetID'] = '' channel_properties[cs.CHANNEL + '.TargetHandle'] = 0 channel_properties[cs.CHANNEL + '.InitiatorID'] = '' channel_properties[cs.CHANNEL + '.InitiatorHandle'] = 0 channel_properties[cs.CHANNEL + '.Requested'] = False channel_properties[cs.CHANNEL + '.Interfaces'] = dbus.Array([ CHANNEL_IFACE_IDENT_EXCHANGE, CHANNEL_IFACE_VERIFICATION, cs.CHANNEL], signature='s') chan = SimulatedChannel(conn, channel_properties) chan.announce() e = q.expect('dbus-method-call', path=verifier.object_path, interface=cs.HANDLER, method='HandleChannels', handled=False) if __name__ == '__main__': exec_test(test, {}) telepathy-mission-control-5.16.4/tests/twisted/dispatcher/already-has-obsolete.py0000644000175000017500000002067212735242352031362 0ustar00gkiagiagkiagia00000000000000# Copyright (C) 2009 Nokia Corporation # Copyright (C) 2009 Collabora Ltd. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA # 02110-1301 USA import dbus """Regression test for dispatching an incoming Text channel that was already there before the Connection became ready. """ import dbus import dbus.service from servicetest import EventPattern, tp_name_prefix, tp_path_prefix, \ call_async from mctest import exec_test, SimulatedConnection, SimulatedClient, \ create_fakecm_account, SimulatedChannel, expect_client_setup import constants as cs def test(q, bus, mc): params = dbus.Dictionary({"account": "someguy@example.com", "password": "secrecy"}, signature='sv') cm_name_ref, account = create_fakecm_account(q, bus, mc, params) text_fixed_properties = dbus.Dictionary({ cs.CHANNEL + '.TargetHandleType': cs.HT_CONTACT, cs.CHANNEL + '.ChannelType': cs.CHANNEL_TYPE_TEXT, }, signature='sv') # Two clients want to observe, approve and handle channels empathy = SimulatedClient(q, bus, 'Empathy', observe=[text_fixed_properties], approve=[text_fixed_properties], handle=[text_fixed_properties], bypass_approval=False) kopete = SimulatedClient(q, bus, 'Kopete', observe=[text_fixed_properties], approve=[text_fixed_properties], handle=[text_fixed_properties], bypass_approval=False) # wait for MC to download the properties expect_client_setup(q, [empathy, kopete]) # Enable the account account.Set(cs.ACCOUNT, 'Enabled', True, dbus_interface=cs.PROPERTIES_IFACE) requested_presence = dbus.Struct((dbus.UInt32(2L), dbus.String(u'available'), dbus.String(u''))) account.Set(cs.ACCOUNT, 'RequestedPresence', requested_presence, dbus_interface=cs.PROPERTIES_IFACE) e = q.expect('dbus-method-call', method='RequestConnection', args=['fakeprotocol', params], destination=cs.tp_name_prefix + '.ConnectionManager.fakecm', path=cs.tp_path_prefix + '/ConnectionManager/fakecm', interface=cs.tp_name_prefix + '.ConnectionManager', handled=False) # Don't allow the Connection to become ready until we want it to, by # avoiding a return from GetInterfaces conn = SimulatedConnection(q, bus, 'fakecm', 'fakeprotocol', '_', 'myself', implement_get_interfaces=False, has_requests=False) q.dbus_return(e.message, conn.bus_name, conn.object_path, signature='so') # this is the pre-Connect one e = q.expect('dbus-method-call', method='GetInterfaces', path=conn.object_path, handled=False) q.dbus_raise(e.message, cs.DISCONNECTED, 'Not connected yet') q.expect('dbus-method-call', method='Connect', path=conn.object_path, handled=True) conn.StatusChanged(cs.CONN_STATUS_CONNECTED, cs.CONN_STATUS_REASON_NONE) get_interfaces_call = q.expect('dbus-method-call', method='GetInterfaces', path=conn.object_path, handled=False) # subscribe to the OperationList interface (MC assumes that until this # property has been retrieved once, nobody cares) cd = bus.get_object(cs.CD, cs.CD_PATH) cd_props = dbus.Interface(cd, cs.PROPERTIES_IFACE) assert cd_props.Get(cs.CD_IFACE_OP_LIST, 'DispatchOperations') == [] # Before returning from GetInterfaces, make a Channel spring into # existence channel_properties = dbus.Dictionary(text_fixed_properties, signature='sv') channel_properties[cs.CHANNEL + '.TargetID'] = 'juliet' channel_properties[cs.CHANNEL + '.TargetHandle'] = \ conn.ensure_handle(cs.HT_CONTACT, 'juliet') channel_properties[cs.CHANNEL + '.InitiatorID'] = 'juliet' channel_properties[cs.CHANNEL + '.InitiatorHandle'] = \ conn.ensure_handle(cs.HT_CONTACT, 'juliet') channel_properties[cs.CHANNEL + '.Requested'] = False channel_properties[cs.CHANNEL + '.Interfaces'] = dbus.Array(signature='s') chan = SimulatedChannel(conn, channel_properties) chan.announce() # Now reply to GetInterfaces and say we don't have Requests conn.GetInterfaces(get_interfaces_call) q.expect('dbus-method-call', interface=cs.CONN, method='ListChannels', args=[], path=conn.object_path, handled=True) # A channel dispatch operation is created for the channel we already had e = q.expect('dbus-signal', path=cs.CD_PATH, interface=cs.CD_IFACE_OP_LIST, signal='NewDispatchOperation') cdo_path = e.args[0] cdo_properties = e.args[1] assert cdo_properties[cs.CDO + '.Account'] == account.object_path assert cdo_properties[cs.CDO + '.Connection'] == conn.object_path handlers = cdo_properties[cs.CDO + '.PossibleHandlers'][:] handlers.sort() assert handlers == [cs.tp_name_prefix + '.Client.Empathy', cs.tp_name_prefix + '.Client.Kopete'], handlers assert cs.CD_IFACE_OP_LIST in cd_props.Get(cs.CD, 'Interfaces') assert cd_props.Get(cs.CD_IFACE_OP_LIST, 'DispatchOperations') ==\ [(cdo_path, cdo_properties)] cdo = bus.get_object(cs.CD, cdo_path) cdo_iface = dbus.Interface(cdo, cs.CDO) # Both Observers are told about the new channel e, k = q.expect_many( EventPattern('dbus-method-call', path=empathy.object_path, interface=cs.OBSERVER, method='ObserveChannels', handled=False), EventPattern('dbus-method-call', path=kopete.object_path, interface=cs.OBSERVER, method='ObserveChannels', handled=False), ) assert e.args[0] == account.object_path, e.args assert e.args[1] == conn.object_path, e.args assert e.args[3] == cdo_path, e.args assert e.args[4] == [], e.args # no requests satisfied channels = e.args[2] assert len(channels) == 1, channels assert channels[0][0] == chan.object_path, channels assert k.args == e.args # Both Observers indicate that they are ready to proceed q.dbus_return(k.message, signature='') q.dbus_return(e.message, signature='') # The Approvers are next e, k = q.expect_many( EventPattern('dbus-method-call', path=empathy.object_path, interface=cs.APPROVER, method='AddDispatchOperation', handled=False), EventPattern('dbus-method-call', path=kopete.object_path, interface=cs.APPROVER, method='AddDispatchOperation', handled=False), ) assert len(e.args) == 3 assert len(e.args[0]) == 1 assert e.args[0][0][0] == chan.object_path assert e.args[1] == cdo_path assert e.args[2] == cdo_properties assert k.args == e.args q.dbus_return(e.message, signature='') q.dbus_return(k.message, signature='') # Both Approvers now have a flashing icon or something, trying to get the # user's attention # The user responds to Empathy first call_async(q, cdo_iface, 'HandleWith', cs.tp_name_prefix + '.Client.Empathy') # Empathy is asked to handle the channels e = q.expect('dbus-method-call', path=empathy.object_path, interface=cs.HANDLER, method='HandleChannels', handled=False) # Empathy accepts the channels q.dbus_return(e.message, signature='') q.expect_many( EventPattern('dbus-return', method='HandleWith'), EventPattern('dbus-signal', interface=cs.CDO, signal='Finished'), EventPattern('dbus-signal', interface=cs.CD_IFACE_OP_LIST, signal='DispatchOperationFinished'), ) # Now there are no more active channel dispatch operations assert cd_props.Get(cs.CD_IFACE_OP_LIST, 'DispatchOperations') == [] if __name__ == '__main__': exec_test(test, {}) telepathy-mission-control-5.16.4/tests/twisted/dispatcher/create-at-startup.py0000644000175000017500000002332012735242352030714 0ustar00gkiagiagkiagia00000000000000# Copyright (C) 2009 Nokia Corporation # Copyright (C) 2009 Collabora Ltd. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA # 02110-1301 USA import dbus """Regression test for activating MC due to, or immediately before, a request. """ import os import dbus import dbus.service from servicetest import EventPattern, tp_name_prefix, tp_path_prefix, \ call_async from mctest import exec_test, SimulatedConnection, SimulatedClient, \ create_fakecm_account, enable_fakecm_account, SimulatedChannel, \ expect_client_setup, MC import constants as cs account_id = 'fakecm/fakeprotocol/jc_2edenton_40unatco_2eint' def preseed(q, bus, fake_accounts_service): accounts_dir = os.environ['MC_ACCOUNT_DIR'] try: os.mkdir(accounts_dir, 0700) except OSError: pass fake_accounts_service.update_attributes(account_id, changed={ 'manager': 'fakecm', 'protocol': 'fakeprotocol', 'DisplayName': 'Work account', 'NormalizedName': 'jc.denton@unatco.int', 'Enabled': True, 'ConnectAutomatically': False, 'AutomaticPresence': (dbus.UInt32(2), 'available', ''), }) fake_accounts_service.update_parameters(account_id, untyped={ 'account': 'jc.denton@unatco.int', 'password': 'ionstorm', }) account_connections_file = open(accounts_dir + '/.mc_connections', 'w') account_connections_file.write("") account_connections_file.close() def test(q, bus, unused, **kwargs): fake_accounts_service = kwargs['fake_accounts_service'] preseed(q, bus, fake_accounts_service) text_fixed_properties = dbus.Dictionary({ cs.CHANNEL + '.TargetHandleType': cs.HT_CONTACT, cs.CHANNEL + '.ChannelType': cs.CHANNEL_TYPE_TEXT, }, signature='sv') user_action_time = dbus.Int64(1238582606) # A client and a CM are already running client = SimulatedClient(q, bus, 'Empathy', observe=[text_fixed_properties], approve=[text_fixed_properties], handle=[text_fixed_properties], bypass_approval=False, implement_get_interfaces=False) cm_name_ref = dbus.service.BusName( cs.tp_name_prefix + '.ConnectionManager.fakecm', bus=bus) # service-activate MC; it will try to introspect the running client. mc = MC(q, bus, wait_for_names=False) get_interfaces, = mc.wait_for_names( EventPattern('dbus-method-call', path=client.object_path, interface=cs.PROPERTIES_IFACE, method='Get', args=[cs.CLIENT, 'Interfaces'], handled=False)) # The client doesn't reply just yet; meanwhile, immediately make a channel # request account = bus.get_object(cs.MC, cs.tp_path_prefix + '/Account/fakecm/fakeprotocol/jc_2edenton_40unatco_2eint') cd = bus.get_object(cs.MC, cs.CD_PATH) cd_props = dbus.Interface(cd, cs.PROPERTIES_IFACE) request = dbus.Dictionary({ cs.CHANNEL + '.ChannelType': cs.CHANNEL_TYPE_TEXT, cs.CHANNEL + '.TargetHandleType': cs.HT_CONTACT, cs.CHANNEL + '.TargetID': 'bob.page@versalife.com', }, signature='sv') call_async(q, cd, 'CreateChannel', account.object_path, request, user_action_time, client.bus_name, dbus_interface=cs.CD) ret = q.expect('dbus-return', method='CreateChannel') request_path = ret.value[0] # chat UI connects to signals and calls ChannelRequest.Proceed() cr = bus.get_object(cs.MC, request_path) request_props = cr.GetAll(cs.CR, dbus_interface=cs.PROPERTIES_IFACE) assert request_props['Account'] == account.object_path assert request_props['Requests'] == [request] assert request_props['UserActionTime'] == user_action_time assert request_props['PreferredHandler'] == client.bus_name assert request_props['Interfaces'] == [] call_async(q, cr, 'Proceed', dbus_interface=cs.CR) e = q.expect('dbus-method-call', method='RequestConnection', args=['fakeprotocol', { 'account': 'jc.denton@unatco.int', 'password': 'ionstorm', }], destination=cs.tp_name_prefix + '.ConnectionManager.fakecm', path=cs.tp_path_prefix + '/ConnectionManager/fakecm', interface=cs.tp_name_prefix + '.ConnectionManager', handled=False) conn = SimulatedConnection(q, bus, 'fakecm', 'fakeprotocol', 'the_conn', 'jc.denton@unatco.int') q.dbus_return(e.message, conn.bus_name, conn.object_path, signature='so') q.expect('dbus-method-call', method='Connect', path=conn.object_path, handled=True) conn.StatusChanged(cs.CONN_STATUS_CONNECTED, cs.CONN_STATUS_REASON_NONE) # A channel appears spontaneously announcement_immutable = dbus.Dictionary(text_fixed_properties) announcement_immutable[cs.CHANNEL + '.TargetID'] = 'gunther@unatco.int' announcement_immutable[cs.CHANNEL + '.TargetHandle'] = \ conn.ensure_handle(cs.HT_CONTACT, 'gunther@unatco.int') announcement_immutable[cs.CHANNEL + '.InitiatorHandle'] = \ announcement_immutable[cs.CHANNEL + '.TargetHandle'] announcement_immutable[cs.CHANNEL + '.InitiatorID'] = \ announcement_immutable[cs.CHANNEL + '.TargetID'] announcement_immutable[cs.CHANNEL + '.Interfaces'] = \ dbus.Array([], signature='s') announcement_immutable[cs.CHANNEL + '.Requested'] = False announcement = SimulatedChannel(conn, announcement_immutable) announcement.announce() # Now the Client returns its info q.dbus_return(get_interfaces.message, dbus.Array([cs.HANDLER, cs.OBSERVER, cs.APPROVER, cs.CLIENT_IFACE_REQUESTS], signature='s'), signature='v') expect_client_setup(q, [client], got_interfaces_already=True) # Now that the dispatcher is ready to go, we start looking for channels, # and also make the actual request # Empathy observes the channel we originally requested. _, a, cm_request_call = q.expect_many( EventPattern('dbus-method-call', interface=cs.PROPERTIES_IFACE, method='GetAll', args=[cs.CONN_IFACE_REQUESTS], path=conn.object_path, handled=True), EventPattern('dbus-method-call', path=client.object_path, interface=cs.OBSERVER, method='ObserveChannels', handled=False), EventPattern('dbus-method-call', interface=cs.CONN_IFACE_REQUESTS, method='CreateChannel', path=conn.object_path, args=[request], handled=False), ) assert a.args[0] == account.object_path, a.args assert a.args[1] == conn.object_path, a.args assert a.args[3] != '/', a.args # there is a dispatch operation assert a.args[4] == [], a.args channels = a.args[2] assert len(channels) == 1, channels assert channels[0][0] == announcement.object_path, channels assert channels[0][1] == announcement_immutable, channels # Time passes. A channel is returned. channel_immutable = dbus.Dictionary(request) channel_immutable[cs.CHANNEL + '.InitiatorID'] = conn.self_ident channel_immutable[cs.CHANNEL + '.InitiatorHandle'] = conn.self_handle channel_immutable[cs.CHANNEL + '.Requested'] = True channel_immutable[cs.CHANNEL + '.Interfaces'] = \ dbus.Array([], signature='s') channel_immutable[cs.CHANNEL + '.TargetHandle'] = \ conn.ensure_handle(cs.HT_CONTACT, 'bob.page@versalife.com') channel = SimulatedChannel(conn, channel_immutable) q.dbus_return(cm_request_call.message, channel.object_path, channel.immutable, signature='oa{sv}') channel.announce() # Empathy observes the newly-created channel. e = q.expect('dbus-method-call', path=client.object_path, interface=cs.OBSERVER, method='ObserveChannels', handled=False) assert e.args[0] == account.object_path, e.args assert e.args[1] == conn.object_path, e.args assert e.args[3] == '/', e.args # no dispatch operation assert e.args[4] == [request_path], e.args channels = e.args[2] assert len(channels) == 1, channels assert channels[0][0] == channel.object_path, channels assert channels[0][1] == channel_immutable, channels # Observer says "OK, go" q.dbus_return(a.message, signature='') q.dbus_return(e.message, signature='') # Empathy is asked to handle the channel e = q.expect('dbus-method-call', path=client.object_path, interface=cs.HANDLER, method='HandleChannels', handled=False) assert e.args[0] == account.object_path, e.args assert e.args[1] == conn.object_path, e.args channels = e.args[2] assert len(channels) == 1, channels assert channels[0][0] == channel.object_path, channels assert channels[0][1] == channel_immutable, channels assert e.args[3] == [request_path], e.args assert e.args[4] == user_action_time assert isinstance(e.args[5], dict) assert len(e.args) == 6 if __name__ == '__main__': exec_test(test, {}, preload_mc=False, use_fake_accounts_service=True, pass_kwargs=True) telepathy-mission-control-5.16.4/tests/twisted/dispatcher/cancel.py0000644000175000017500000001330712735242352026600 0ustar00gkiagiagkiagia00000000000000# Copyright (C) 2009 Nokia Corporation # Copyright (C) 2009 Collabora Ltd. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA # 02110-1301 USA import dbus """Regression test for the unofficial Account.Interface.Requests API when a channel can be created successfully. """ import dbus import dbus.service from servicetest import EventPattern, tp_name_prefix, tp_path_prefix, \ call_async from mctest import exec_test, SimulatedConnection, SimulatedClient, \ create_fakecm_account, enable_fakecm_account, SimulatedChannel, \ expect_client_setup import constants as cs def test(q, bus, mc): params = dbus.Dictionary({"account": "someguy@example.com", "password": "secrecy"}, signature='sv') cm_name_ref, account = create_fakecm_account(q, bus, mc, params) conn = enable_fakecm_account(q, bus, mc, account, params) text_fixed_properties = dbus.Dictionary({ cs.CHANNEL + '.TargetHandleType': cs.HT_CONTACT, cs.CHANNEL + '.ChannelType': cs.CHANNEL_TYPE_TEXT, }, signature='sv') client = SimulatedClient(q, bus, 'Empathy', observe=[text_fixed_properties], approve=[text_fixed_properties], handle=[text_fixed_properties], bypass_approval=False) # No Approver should be invoked at any point during this test, because the # Channel was Requested def fail_on_approval(e): raise AssertionError('Approver should not be invoked') q.add_dbus_method_impl(fail_on_approval, path=client.object_path, interface=cs.APPROVER, method='AddDispatchOperation') # wait for MC to download the properties expect_client_setup(q, [client]) test_channel_creation(q, bus, account, client, conn, False) test_channel_creation(q, bus, account, client, conn, True) def test_channel_creation(q, bus, account, client, conn, cancel_before_proceed): user_action_time = dbus.Int64(1238582606) cd = bus.get_object(cs.CD, cs.CD_PATH) cd_props = dbus.Interface(cd, cs.PROPERTIES_IFACE) # chat UI calls ChannelDispatcher.CreateChannel request = dbus.Dictionary({ cs.CHANNEL + '.ChannelType': cs.CHANNEL_TYPE_TEXT, cs.CHANNEL + '.TargetHandleType': cs.HT_CONTACT, cs.CHANNEL + '.TargetID': 'juliet', }, signature='sv') call_async(q, cd, 'CreateChannel', account.object_path, request, user_action_time, client.bus_name, dbus_interface=cs.CD) ret = q.expect('dbus-return', method='CreateChannel') request_path = ret.value[0] cr = bus.get_object(cs.AM, request_path) request_props = cr.GetAll(cs.CR, dbus_interface=cs.PROPERTIES_IFACE) assert request_props['Account'] == account.object_path assert request_props['Requests'] == [request] assert request_props['UserActionTime'] == user_action_time if cancel_before_proceed: cr.Cancel(dbus_interface=cs.CR) stdsig = q.expect('dbus-signal', path=request_path, interface=cs.CR, signal='Failed') assert stdsig.args[0] == cs.CANCELLED # the channel request has gone away try: cr.Proceed(dbus_interface=cs.CR) except dbus.DBusException, e: pass else: raise AssertionError('Wanted an error') return cr.Proceed(dbus_interface=cs.CR) cm_request_call, add_request_call = q.expect_many( EventPattern('dbus-method-call', interface=cs.CONN_IFACE_REQUESTS, method='CreateChannel', path=conn.object_path, args=[request], handled=False), EventPattern('dbus-method-call', handled=False, interface=cs.CLIENT_IFACE_REQUESTS, method='AddRequest', path=client.object_path), ) assert add_request_call.args[0] == request_path q.dbus_return(add_request_call.message, signature='') # Actually, never mind. cr.Cancel(dbus_interface=cs.CR) # Time passes. A channel is returned. channel_immutable = dbus.Dictionary(request) channel_immutable[cs.CHANNEL + '.InitiatorID'] = conn.self_ident channel_immutable[cs.CHANNEL + '.InitiatorHandle'] = conn.self_handle channel_immutable[cs.CHANNEL + '.Requested'] = True channel_immutable[cs.CHANNEL + '.Interfaces'] = \ dbus.Array([], signature='s') channel_immutable[cs.CHANNEL + '.TargetHandle'] = \ conn.ensure_handle(cs.HT_CONTACT, 'juliet') channel = SimulatedChannel(conn, channel_immutable) # this order of events is guaranteed by telepathy-spec (since 0.17.14) q.dbus_return(cm_request_call.message, channel.object_path, channel.immutable, signature='oa{sv}') channel.announce() # Channel is unwanted now, MC stabs it in the face stdsig, _ = q.expect_many( EventPattern('dbus-signal', path=request_path, interface=cs.CR, signal='Failed'), EventPattern('dbus-method-call', path=channel.object_path, interface=cs.CHANNEL, method='Close', handled=True), ) assert stdsig.args[0] == cs.CANCELLED if __name__ == '__main__': exec_test(test, {}) telepathy-mission-control-5.16.4/tests/twisted/dispatcher/ensure-rapidly.py0000644000175000017500000002320712735242352030316 0ustar00gkiagiagkiagia00000000000000# Copyright (C) 2009 Nokia Corporation # Copyright (C) 2009 Collabora Ltd. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA # 02110-1301 USA """Feature test ensuring that MC deals correctly with EnsureChannel returning a channel that has already been dispatched to a handler. """ import dbus import dbus.service from servicetest import (EventPattern, tp_name_prefix, tp_path_prefix, call_async, assertContains, assertLength, assertEquals) from mctest import exec_test, SimulatedConnection, SimulatedClient, \ create_fakecm_account, enable_fakecm_account, SimulatedChannel, \ expect_client_setup import constants as cs def test(q, bus, mc): params = dbus.Dictionary({"account": "someguy@example.com", "password": "secrecy"}, signature='sv') cm_name_ref, account = create_fakecm_account(q, bus, mc, params) conn = enable_fakecm_account(q, bus, mc, account, params) text_fixed_properties = dbus.Dictionary({ cs.CHANNEL + '.TargetHandleType': cs.HT_CONTACT, cs.CHANNEL + '.ChannelType': cs.CHANNEL_TYPE_TEXT, }, signature='sv') client = SimulatedClient(q, bus, 'Empathy', observe=[text_fixed_properties], approve=[text_fixed_properties], handle=[text_fixed_properties], bypass_approval=False) # wait for MC to download the properties expect_client_setup(q, [client]) channel = test_channel_creation(q, bus, account, client, conn, yours_first=True, swap_requests=False) channel.close() channel = test_channel_creation(q, bus, account, client, conn, yours_first=True, swap_requests=True) channel.close() channel = test_channel_creation(q, bus, account, client, conn, yours_first=False, swap_requests=False) channel.close() channel = test_channel_creation(q, bus, account, client, conn, yours_first=False, swap_requests=True) channel.close() def test_channel_creation(q, bus, account, client, conn, yours_first=True, swap_requests=False): user_action_time1 = dbus.Int64(1238582606) user_action_time2 = dbus.Int64(1244444444) cd = bus.get_object(cs.CD, cs.CD_PATH) cd_props = dbus.Interface(cd, cs.PROPERTIES_IFACE) # chat UI calls ChannelDispatcher.EnsureChannel request = dbus.Dictionary({ cs.CHANNEL + '.ChannelType': cs.CHANNEL_TYPE_TEXT, cs.CHANNEL + '.TargetHandleType': cs.HT_CONTACT, cs.CHANNEL + '.TargetID': 'juliet', }, signature='sv') call_async(q, cd, 'EnsureChannel', account.object_path, request, user_action_time1, client.bus_name, dbus_interface=cs.CD) ret = q.expect('dbus-return', method='EnsureChannel') request_path = ret.value[0] # chat UI connects to signals and calls ChannelRequest.Proceed() cr1 = bus.get_object(cs.AM, request_path) request_props = cr1.GetAll(cs.CR, dbus_interface=cs.PROPERTIES_IFACE) assert request_props['Account'] == account.object_path assert request_props['Requests'] == [request] assert request_props['UserActionTime'] == user_action_time1 assert request_props['PreferredHandler'] == client.bus_name assert request_props['Interfaces'] == [] cr1.Proceed(dbus_interface=cs.CR) cm_request_call1, add_request_call1 = q.expect_many( EventPattern('dbus-method-call', interface=cs.CONN_IFACE_REQUESTS, method='EnsureChannel', path=conn.object_path, args=[request], handled=False), EventPattern('dbus-method-call', handled=False, interface=cs.CLIENT_IFACE_REQUESTS, method='AddRequest', path=client.object_path), ) # Before the first request has succeeded, the user gets impatient and # the UI re-requests. call_async(q, cd, 'EnsureChannel', account.object_path, request, user_action_time2, client.bus_name, dbus_interface=cs.CD) ret = q.expect('dbus-return', method='EnsureChannel') request_path = ret.value[0] cr2 = bus.get_object(cs.AM, request_path) request_props = cr2.GetAll(cs.CR, dbus_interface=cs.PROPERTIES_IFACE) assert request_props['Account'] == account.object_path assert request_props['Requests'] == [request] assert request_props['UserActionTime'] == user_action_time2 assert request_props['PreferredHandler'] == client.bus_name assert request_props['Interfaces'] == [] cr2.Proceed(dbus_interface=cs.CR) cm_request_call2, add_request_call2 = q.expect_many( EventPattern('dbus-method-call', interface=cs.CONN_IFACE_REQUESTS, method='EnsureChannel', path=conn.object_path, args=[request], handled=False), EventPattern('dbus-method-call', handled=False, interface=cs.CLIENT_IFACE_REQUESTS, method='AddRequest', path=client.object_path), ) assert add_request_call1.args[0] == cr1.object_path request_props1 = add_request_call1.args[1] assert request_props1[cs.CR + '.Account'] == account.object_path assert request_props1[cs.CR + '.Requests'] == [request] assert request_props1[cs.CR + '.UserActionTime'] == user_action_time1 assert request_props1[cs.CR + '.PreferredHandler'] == client.bus_name assert request_props1[cs.CR + '.Interfaces'] == [] assert add_request_call2.args[0] == cr2.object_path request_props2 = add_request_call2.args[1] assert request_props2[cs.CR + '.Account'] == account.object_path assert request_props2[cs.CR + '.Requests'] == [request] assert request_props2[cs.CR + '.UserActionTime'] == user_action_time2 assert request_props2[cs.CR + '.PreferredHandler'] == client.bus_name assert request_props2[cs.CR + '.Interfaces'] == [] q.dbus_return(add_request_call1.message, signature='') q.dbus_return(add_request_call2.message, signature='') # Time passes. A channel is returned. channel_immutable = dbus.Dictionary(request) channel_immutable[cs.CHANNEL + '.InitiatorID'] = conn.self_ident channel_immutable[cs.CHANNEL + '.InitiatorHandle'] = conn.self_handle channel_immutable[cs.CHANNEL + '.Requested'] = True channel_immutable[cs.CHANNEL + '.Interfaces'] = \ dbus.Array([], signature='s') channel_immutable[cs.CHANNEL + '.TargetHandle'] = \ conn.ensure_handle(cs.HT_CONTACT, 'juliet') channel = SimulatedChannel(conn, channel_immutable) # Having announce() (i.e. NewChannels) come last is guaranteed by # telepathy-spec (since 0.17.14). There is no other ordering guarantee. if swap_requests: m2, m1 = cm_request_call1.message, cm_request_call2.message else: m1, m2 = cm_request_call1.message, cm_request_call2.message q.dbus_return(m1, yours_first, channel.object_path, channel.immutable, signature='boa{sv}') q.dbus_return(m2, not yours_first, channel.object_path, channel.immutable, signature='boa{sv}') channel.announce() # Observer should get told, processing waits for it e = q.expect('dbus-method-call', path=client.object_path, interface=cs.OBSERVER, method='ObserveChannels', handled=False) assert e.args[0] == account.object_path, e.args assert e.args[1] == conn.object_path, e.args assert e.args[3] == '/', e.args # no dispatch operation assert sorted(e.args[4]) == sorted([cr1.object_path, cr2.object_path]), e.args channels = e.args[2] assert len(channels) == 1, channels assert channels[0][0] == channel.object_path, channels assert channels[0][1] == channel.immutable, channels # Observer says "OK, go" q.dbus_return(e.message, signature='') # Handler is next e = q.expect('dbus-method-call', path=client.object_path, interface=cs.HANDLER, method='HandleChannels', handled=False) assert e.args[0] == account.object_path, e.args assert e.args[1] == conn.object_path, e.args channels = e.args[2] assert len(channels) == 1, channels assert channels[0][0] == channel.object_path, channels assert channels[0][1] == channel_immutable, channels assert sorted(e.args[3]) == sorted([cr1.object_path, cr2.object_path]), e.args assert e.args[4] == user_action_time2, (e.args[4], user_action_time2) assert isinstance(e.args[5], dict) assertContains('request-properties', e.args[5]) assertContains(cr1.object_path, e.args[5]['request-properties']) assertContains(cr2.object_path, e.args[5]['request-properties']) assertLength(2, e.args[5]['request-properties']) assertEquals(request_props1, e.args[5]['request-properties'][cr1.object_path]) assertEquals(request_props2, e.args[5]['request-properties'][cr2.object_path]) assert len(e.args) == 6 # Handler accepts the Channels q.dbus_return(e.message, signature='') # CR emits Succeeded q.expect('dbus-signal', path=request_path, interface=cs.CR, signal='Succeeded') return channel if __name__ == '__main__': exec_test(test, {}) telepathy-mission-control-5.16.4/tests/twisted/dispatcher/request-disabled-account.py0000644000175000017500000000715212735242352032243 0ustar00gkiagiagkiagia00000000000000# Copyright (C) 2009 Nokia Corporation # Copyright (C) 2009 Collabora Ltd. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA # 02110-1301 USA import dbus import dbus import dbus.service from servicetest import EventPattern, tp_name_prefix, tp_path_prefix, \ call_async, sync_dbus from mctest import exec_test, create_fakecm_account, SimulatedConnection, \ SimulatedChannel import constants as cs def test(q, bus, mc): params = dbus.Dictionary({"account": "smcv@example.com", "password": "secrecy"}, signature='sv') (cm_name_ref, account) = create_fakecm_account(q, bus, mc, params) account_iface = dbus.Interface(account, cs.ACCOUNT) account_props = dbus.Interface(account, cs.PROPERTIES_IFACE) call_async(q, account_props, 'Set', cs.ACCOUNT, 'RequestedPresence', (dbus.UInt32(cs.PRESENCE_TYPE_OFFLINE), 'offline', '')) q.expect('dbus-return', method='Set') call_async(q, account_props, 'Set', cs.ACCOUNT, 'AutomaticPresence', (dbus.UInt32(cs.PRESENCE_TYPE_BUSY), 'busy', 'Testing automatic presence')) q.expect('dbus-return', method='Set') q.expect('dbus-signal', signal='AccountPropertyChanged', predicate=lambda e: e.args[0].get('AutomaticPresence', (None, None, None))[1] == 'busy') call_async(q, account_props, 'Set', cs.ACCOUNT, 'Enabled', False) q.expect('dbus-return', method='Set') call_async(q, account_props, 'Set', cs.ACCOUNT, 'ConnectAutomatically', False) q.expect('dbus-return', method='Set') # Requesting a channel won't put us online, since it's disabled # make sure RequestConnection doesn't get called events = [EventPattern('dbus-method-call', method='RequestConnection')] q.forbid_events(events) user_action_time = dbus.Int64(1238582606) cd = bus.get_object(cs.CD, cs.CD_PATH) request = dbus.Dictionary({ cs.CHANNEL + '.ChannelType': cs.CHANNEL_TYPE_TEXT, cs.CHANNEL + '.TargetHandleType': cs.HT_CONTACT, cs.CHANNEL + '.TargetID': 'juliet', }, signature='sv') call_async(q, cd, 'CreateChannel', account.object_path, request, user_action_time, "", dbus_interface=cs.CD) ret = q.expect('dbus-return', method='CreateChannel') request_path = ret.value[0] cr = bus.get_object(cs.AM, request_path) request_props = cr.GetAll(cs.CR, dbus_interface=cs.PROPERTIES_IFACE) assert request_props['Account'] == account.object_path assert request_props['Requests'] == [request] assert request_props['UserActionTime'] == user_action_time assert request_props['PreferredHandler'] == "" assert request_props['Interfaces'] == [] sync_dbus(bus, q, mc) cr.Proceed(dbus_interface=cs.CR) # FIXME: error isn't specified (NotAvailable perhaps?) q.expect('dbus-signal', path=cr.object_path, interface=cs.CR, signal='Failed') if __name__ == '__main__': exec_test(test, {}) telepathy-mission-control-5.16.4/tests/twisted/dispatcher/create-text.py0000644000175000017500000002170612735242352027602 0ustar00gkiagiagkiagia00000000000000# Copyright (C) 2009 Nokia Corporation # Copyright (C) 2009 Collabora Ltd. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA # 02110-1301 USA import dbus """Regression test for the unofficial Account.Interface.Requests API when a channel can be created successfully. """ import dbus import dbus.service from servicetest import (EventPattern, tp_name_prefix, tp_path_prefix, call_async, assertEquals, assertContains, assertLength) from mctest import exec_test, SimulatedConnection, SimulatedClient, \ create_fakecm_account, enable_fakecm_account, SimulatedChannel, \ expect_client_setup import constants as cs def test(q, bus, mc): params = dbus.Dictionary({"account": "someguy@example.com", "password": "secrecy"}, signature='sv') cm_name_ref, account = create_fakecm_account(q, bus, mc, params) conn = enable_fakecm_account(q, bus, mc, account, params) text_fixed_properties = dbus.Dictionary({ cs.CHANNEL + '.TargetHandleType': cs.HT_CONTACT, cs.CHANNEL + '.ChannelType': cs.CHANNEL_TYPE_TEXT, }, signature='sv') client = SimulatedClient(q, bus, 'Empathy', observe=[text_fixed_properties], approve=[text_fixed_properties], handle=[text_fixed_properties], bypass_approval=False) # This client doesn't say it can handle channels, but if it requests one # for itself, we'll at least try dispatching to it. # # A real-world use case for this is if a client wants to request channels, # and handle the channels that it, itself, requested, but not handle # anything requested by others: for instance, nautilus-sendto behaves # like this. See fd.o #23651 unsuitable = SimulatedClient(q, bus, 'Unsuitable', observe=[], approve=[], handle=[], is_handler=True, bypass_approval=False) # No Approver should be invoked at any point during this test, because the # Channel was Requested def fail_on_approval(e): raise AssertionError('Approver should not be invoked') q.add_dbus_method_impl(fail_on_approval, path=client.object_path, interface=cs.APPROVER, method='AddDispatchOperation') # wait for MC to download the properties expect_client_setup(q, [client, unsuitable]) test_channel_creation(q, bus, account, client, conn, False) test_channel_creation(q, bus, account, client, conn, True) test_channel_creation(q, bus, account, client, conn, False, unsuitable) test_channel_creation(q, bus, account, client, conn, False, unsuitable, cs.CHANNEL_TYPE_STREAMED_MEDIA) def test_channel_creation(q, bus, account, client, conn, ensure=False, prefer=None, channel_type=cs.CHANNEL_TYPE_TEXT): user_action_time = dbus.Int64(1238582606) if prefer is None: prefer = client cd = bus.get_object(cs.CD, cs.CD_PATH) cd_props = dbus.Interface(cd, cs.PROPERTIES_IFACE) # chat UI calls ChannelDispatcher.EnsureChannel or CreateChannel request = dbus.Dictionary({ cs.CHANNEL + '.ChannelType': channel_type, cs.CHANNEL + '.TargetHandleType': cs.HT_CONTACT, cs.CHANNEL + '.TargetID': 'juliet', }, signature='sv') call_async(q, cd, (ensure and 'EnsureChannel' or 'CreateChannel'), account.object_path, request, user_action_time, prefer.bus_name, dbus_interface=cs.CD) ret = q.expect('dbus-return', method=(ensure and 'EnsureChannel' or 'CreateChannel')) request_path = ret.value[0] # chat UI connects to signals and calls ChannelRequest.Proceed() cr = bus.get_object(cs.AM, request_path) request_props = cr.GetAll(cs.CR, dbus_interface=cs.PROPERTIES_IFACE) assert request_props['Account'] == account.object_path assert request_props['Requests'] == [request] assert request_props['UserActionTime'] == user_action_time assert request_props['PreferredHandler'] == prefer.bus_name assert request_props['Interfaces'] == [] cr.Proceed(dbus_interface=cs.CR) # FIXME: should the EnsureChannel/CreateChannel call, and the AddRequest # call, be in a defined order? Probably not though, since CMs and Clients # aren't meant to be the same process! cm_request_call, add_request_call = q.expect_many( EventPattern('dbus-method-call', interface=cs.CONN_IFACE_REQUESTS, method=(ensure and 'EnsureChannel' or 'CreateChannel'), path=conn.object_path, args=[request], handled=False), EventPattern('dbus-method-call', handled=False, interface=cs.CLIENT_IFACE_REQUESTS, method='AddRequest'), ) assert add_request_call.args[0] == request_path assert add_request_call.path == prefer.object_path request_props = add_request_call.args[1] assert request_props[cs.CR + '.Account'] == account.object_path assert request_props[cs.CR + '.Requests'] == [request] assert request_props[cs.CR + '.UserActionTime'] == user_action_time assert request_props[cs.CR + '.PreferredHandler'] == prefer.bus_name assert request_props[cs.CR + '.Interfaces'] == [] q.dbus_return(add_request_call.message, signature='') # Time passes. A channel is returned. channel_immutable = dbus.Dictionary(request) channel_immutable[cs.CHANNEL + '.InitiatorID'] = conn.self_ident channel_immutable[cs.CHANNEL + '.InitiatorHandle'] = conn.self_handle channel_immutable[cs.CHANNEL + '.Requested'] = True channel_immutable[cs.CHANNEL + '.Interfaces'] = \ dbus.Array([], signature='s') channel_immutable[cs.CHANNEL + '.TargetHandle'] = \ conn.ensure_handle(cs.HT_CONTACT, 'juliet') channel = SimulatedChannel(conn, channel_immutable) # this order of events is guaranteed by telepathy-spec (since 0.17.14) if ensure: q.dbus_return(cm_request_call.message, True, # <- Yours channel.object_path, channel.immutable, signature='boa{sv}') else: # Create q.dbus_return(cm_request_call.message, channel.object_path, channel.immutable, signature='oa{sv}') channel.announce() if channel_type == cs.CHANNEL_TYPE_TEXT: # Observer should get told, processing waits for it e = q.expect('dbus-method-call', path=client.object_path, interface=cs.OBSERVER, method='ObserveChannels', handled=False) assert e.args[0] == account.object_path, e.args assert e.args[1] == conn.object_path, e.args assert e.args[3] == '/', e.args # no dispatch operation assert e.args[4] == [request_path], e.args channels = e.args[2] assert len(channels) == 1, channels assert channels[0][0] == channel.object_path, channels assert channels[0][1] == channel_immutable, channels # Observer says "OK, go" q.dbus_return(e.message, signature='') # Handler is next e = q.expect('dbus-method-call', path=prefer.object_path, interface=cs.HANDLER, method='HandleChannels', handled=False) assert e.args[0] == account.object_path, e.args assert e.args[1] == conn.object_path, e.args channels = e.args[2] assert len(channels) == 1, channels assert channels[0][0] == channel.object_path, channels assert channels[0][1] == channel_immutable, channels assert e.args[3] == [request_path], e.args assert e.args[4] == user_action_time assert isinstance(e.args[5], dict) assertContains('request-properties', e.args[5]) assertContains(request_path, e.args[5]['request-properties']) assertLength(1, e.args[5]['request-properties']) assertEquals(request_props, e.args[5]['request-properties'][request_path]) assert len(e.args) == 6 # Handler accepts the Channels q.dbus_return(e.message, signature='') # SucceededWithChannel is fired first e = q.expect('dbus-signal', path=request_path, interface=cs.CR, signal='SucceededWithChannel') assertEquals(conn.object_path, e.args[0]) assert isinstance(e.args[1], dict), e.args[1] assertEquals(channel.object_path, e.args[2]) assertEquals(channel_immutable, e.args[3]) # CR emits Succeeded q.expect('dbus-signal', path=request_path, interface=cs.CR, signal='Succeeded') # Close the channel channel.close() if __name__ == '__main__': exec_test(test, {}) telepathy-mission-control-5.16.4/tests/twisted/dispatcher/delay-then-dont-call-approvers.py0000644000175000017500000001212612735242352033275 0ustar00gkiagiagkiagia00000000000000# Copyright (C) 2010 Collabora Ltd. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA # 02110-1301 USA import dbus import dbus.bus import dbus.service from servicetest import EventPattern, tp_name_prefix, tp_path_prefix, \ call_async, sync_dbus from mctest import exec_test, SimulatedConnection, SimulatedClient, \ create_fakecm_account, enable_fakecm_account, SimulatedChannel, \ expect_client_setup import constants as cs def test(q, bus, mc): params = dbus.Dictionary({"account": "someguy@example.com", "password": "secrecy"}, signature='sv') cm_name_ref, account = create_fakecm_account(q, bus, mc, params) conn = enable_fakecm_account(q, bus, mc, account, params) text_fixed_properties = dbus.Dictionary({ cs.CHANNEL + '.TargetHandleType': cs.HT_CONTACT, cs.CHANNEL + '.ChannelType': cs.CHANNEL_TYPE_TEXT, }, signature='sv') # Empathy is an observer for text channels with # DelayApprovers=TRUE. empathy = SimulatedClient(q, bus, 'Empathy', observe=[text_fixed_properties], approve=[], handle=[], delay_approvers=True) # Kopete is an approver and handler for text channels. kopete = SimulatedClient(q, bus, 'Kopete', observe=[], approve=[text_fixed_properties], handle=[text_fixed_properties]) expect_client_setup(q, [empathy, kopete]) # subscribe to the OperationList interface (MC assumes that until this # property has been retrieved once, nobody cares) cd = bus.get_object(cs.CD, cs.CD_PATH) cd_props = dbus.Interface(cd, cs.PROPERTIES_IFACE) assert cd_props.Get(cs.CD_IFACE_OP_LIST, 'DispatchOperations') == [] # A text channel appears! channel_properties = dbus.Dictionary(text_fixed_properties, signature='sv') channel_properties[cs.CHANNEL + '.TargetID'] = 'juliet' channel_properties[cs.CHANNEL + '.TargetHandle'] = \ conn.ensure_handle(cs.HT_CONTACT, 'juliet') channel_properties[cs.CHANNEL + '.InitiatorID'] = 'juliet' channel_properties[cs.CHANNEL + '.InitiatorHandle'] = \ conn.ensure_handle(cs.HT_CONTACT, 'juliet') channel_properties[cs.CHANNEL + '.Requested'] = False channel_properties[cs.CHANNEL + '.Interfaces'] = dbus.Array(signature='s') chan = SimulatedChannel(conn, channel_properties) chan.announce() e = q.expect('dbus-signal', path=cs.CD_PATH, interface=cs.CD_IFACE_OP_LIST, signal='NewDispatchOperation') cdo_path = e.args[0] cdo = bus.get_object(cs.CD, cdo_path) cdo_iface = dbus.Interface(cdo, cs.CDO) cdo_props_iface = dbus.Interface(cdo, cs.PROPERTIES_IFACE) # Empathy, the observer, gets the channel to observe. Because it # has DelayApprovers=TRUE, Kopete should not have # AddDispatchOperation called on it until Empathy returns from # ObserveChannels, but Empathy will call Claim on the CDO so we # should ensure neither ADO or HC is called on any of our clients. forbidden = [EventPattern('dbus-method-call', interface=cs.APPROVER, method='AddDispatchOperation'), EventPattern('dbus-method-call', interface=cs.HANDLER, method='HandleChannels')] q.forbid_events(forbidden) o = q.expect('dbus-method-call', path=empathy.object_path, interface=cs.OBSERVER, method='ObserveChannels', handled=False) # Waste a little time here and there. We can't call sync_dbus # here because it calls Ping and libdbus returns from Ping # synchronously and doesn't turn the main loop handle enough. call_async(q, cd_props, 'Get', cs.CD_IFACE_OP_LIST, 'DispatchOperations') event = q.expect('dbus-return', method='Get') # We can't call this synchronously because MC won't return until # ObserveChannels calls return. call_async(q, cdo_iface, 'Claim') # Finally return from ObserveChannels. q.dbus_return(o.message, bus=bus, signature='') q.expect('dbus-return', method='Claim') q.expect_many( EventPattern('dbus-signal', interface=cs.CDO, signal='Finished'), EventPattern('dbus-signal', interface=cs.CD_IFACE_OP_LIST, signal='DispatchOperationFinished'), ) # Now there are no more active channel dispatch operations assert cd_props.Get(cs.CD_IFACE_OP_LIST, 'DispatchOperations') == [] q.unforbid_events(forbidden) if __name__ == '__main__': exec_test(test, {}) telepathy-mission-control-5.16.4/tests/twisted/dispatcher/dispatch-delayed-by-mini-plugin.py0000644000175000017500000003234712735242352033422 0ustar00gkiagiagkiagia00000000000000# Copyright (C) 2009 Nokia Corporation # Copyright (C) 2009 Collabora Ltd. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA # 02110-1301 USA import dbus """Regression test for dispatching an incoming Text channel. """ import dbus import dbus.service from servicetest import EventPattern, tp_name_prefix, tp_path_prefix, \ call_async, sync_dbus from mctest import exec_test, SimulatedConnection, SimulatedClient, \ create_fakecm_account, enable_fakecm_account, SimulatedChannel, \ expect_client_setup import constants as cs text_fixed_properties = dbus.Dictionary({ cs.CHANNEL + '.TargetHandleType': cs.HT_CONTACT, cs.CHANNEL + '.ChannelType': cs.CHANNEL_TYPE_TEXT, }, signature='sv') def signal_channel_expect_query(q, bus, account, conn, empathy, kopete): # This target is special-cased in test-plugin.c target = 'policy@example.net' channel_properties = dbus.Dictionary(text_fixed_properties, signature='sv') channel_properties[cs.CHANNEL + '.TargetID'] = target channel_properties[cs.CHANNEL + '.TargetHandle'] = \ conn.ensure_handle(cs.HT_CONTACT, target) channel_properties[cs.CHANNEL + '.InitiatorID'] = target channel_properties[cs.CHANNEL + '.InitiatorHandle'] = \ conn.ensure_handle(cs.HT_CONTACT, target) channel_properties[cs.CHANNEL + '.Requested'] = False channel_properties[cs.CHANNEL + '.Interfaces'] = \ dbus.Array([cs.CHANNEL_IFACE_DESTROYABLE, cs.CHANNEL_IFACE_GROUP, ],signature='s') chan = SimulatedChannel(conn, channel_properties, group=True) chan.announce() e = q.expect('dbus-signal', path=cs.CD_PATH, interface=cs.CD_IFACE_OP_LIST, signal='NewDispatchOperation') cdo_path = e.args[0] cdo_properties = e.args[1] assert cdo_properties[cs.CDO + '.Account'] == account.object_path assert cdo_properties[cs.CDO + '.Connection'] == conn.object_path assert cs.CDO + '.Interfaces' in cdo_properties handlers = cdo_properties[cs.CDO + '.PossibleHandlers'][:] handlers.sort() assert handlers == [cs.tp_name_prefix + '.Client.Empathy', cs.tp_name_prefix + '.Client.Kopete'], handlers e, k = q.expect_many( EventPattern('dbus-method-call', path=empathy.object_path, interface=cs.OBSERVER, method='ObserveChannels', handled=False), EventPattern('dbus-method-call', path=kopete.object_path, interface=cs.OBSERVER, method='ObserveChannels', handled=False), ) # What does the policy service think? permission = q.expect('dbus-method-call', path='/com/example/Policy', interface='com.example.Policy', method='RequestPermission') # Think about it for a bit sync_dbus(bus, q, account) # Both Observers indicate that they are ready to proceed q.dbus_return(k.message, signature='') q.dbus_return(e.message, signature='') # Let the test code decide how to reply return permission, chan, cdo_path def test(q, bus, mc): params = dbus.Dictionary({"account": "someguy@example.com", "password": "secrecy"}, signature='sv') cm_name_ref, account = create_fakecm_account(q, bus, mc, params) conn = enable_fakecm_account(q, bus, mc, account, params) policy_bus_name_ref = dbus.service.BusName('com.example.Policy', bus) # For the beginning of this test, we should never be asked to handle # a channel. forbidden = [ EventPattern('dbus-method-call', method='HandleChannels'), ] q.forbid_events(forbidden) # Two clients want to observe, approve and handle channels empathy = SimulatedClient(q, bus, 'Empathy', observe=[text_fixed_properties], approve=[text_fixed_properties], handle=[text_fixed_properties], bypass_approval=False) kopete = SimulatedClient(q, bus, 'Kopete', observe=[text_fixed_properties], approve=[text_fixed_properties], handle=[text_fixed_properties], bypass_approval=False) # wait for MC to download the properties expect_client_setup(q, [empathy, kopete]) # subscribe to the OperationList interface (MC assumes that until this # property has been retrieved once, nobody cares) cd = bus.get_object(cs.CD, cs.CD_PATH) cd_props = dbus.Interface(cd, cs.PROPERTIES_IFACE) assert cd_props.Get(cs.CD_IFACE_OP_LIST, 'DispatchOperations') == [] e, chan, cdo_path = signal_channel_expect_query(q, bus, account, conn, empathy, kopete) # No. q.dbus_raise(e.message, 'com.example.Errors.No', 'Denied!') # The plugin responds _, _, e = q.expect_many( EventPattern('dbus-signal', path=cdo_path, interface=cs.CDO, signal='Finished'), EventPattern('dbus-signal', path=cs.CD_PATH, interface=cs.CD_IFACE_OP_LIST, signal='DispatchOperationFinished', args=[cdo_path]), EventPattern('dbus-method-call', path=chan.object_path, interface=cs.CHANNEL_IFACE_GROUP, # this error message is from the plugin method='RemoveMembersWithReason', args=[[conn.self_handle], "Computer says no", cs.GROUP_REASON_PERMISSION_DENIED], handled=False), ) q.dbus_return(e.message, signature='') chan.close() # Try again e, chan, cdo_path = signal_channel_expect_query(q, bus, account, conn, empathy, kopete) # Yes. q.dbus_return(e.message, signature='') e, k = q.expect_many( EventPattern('dbus-method-call', path=empathy.object_path, interface=cs.APPROVER, method='AddDispatchOperation', handled=False), EventPattern('dbus-method-call', path=kopete.object_path, interface=cs.APPROVER, method='AddDispatchOperation', handled=False), ) q.dbus_return(e.message, signature='') q.dbus_return(k.message, signature='') empathy_cdo = bus.get_object(cs.CD, cdo_path) empathy_cdo_iface = dbus.Interface(empathy_cdo, cs.CDO) call_async(q, empathy_cdo_iface, 'Claim') check_handler = q.expect('dbus-method-call', path='/com/example/Policy', interface='com.example.Policy', method='CheckHandler') q.dbus_raise(check_handler.message, 'com.example.Errors.No', "That handler doesn't have enough options") q.expect('dbus-error', method='Claim', name=cs.PERMISSION_DENIED) kopete_cdo = bus.get_object(cs.CD, cdo_path) kopete_cdo_iface = dbus.Interface(kopete_cdo, cs.CDO) call_async(q, kopete_cdo_iface, 'Claim') check_handler = q.expect('dbus-method-call', path='/com/example/Policy', interface='com.example.Policy', method='CheckHandler') q.dbus_return(check_handler.message, signature='') q.expect_many( EventPattern('dbus-signal', path=cdo_path, signal='Finished'), EventPattern('dbus-signal', path=cs.CD_PATH, signal='DispatchOperationFinished', args=[cdo_path]), EventPattern('dbus-return', method='Claim'), ) sync_dbus(bus, q, mc) # Try again; this time we'll reject a selected handler e, chan, cdo_path = signal_channel_expect_query(q, bus, account, conn, empathy, kopete) # The request is fine, continue... q.dbus_return(e.message, signature='') e, k = q.expect_many( EventPattern('dbus-method-call', path=empathy.object_path, interface=cs.APPROVER, method='AddDispatchOperation', handled=False), EventPattern('dbus-method-call', path=kopete.object_path, interface=cs.APPROVER, method='AddDispatchOperation', handled=False), ) q.dbus_return(e.message, signature='') q.dbus_return(k.message, signature='') kopete_cdo = bus.get_object(cs.CD, cdo_path) kopete_cdo_iface = dbus.Interface(kopete_cdo, cs.CDO) call_async(q, kopete_cdo_iface, 'HandleWith', cs.tp_name_prefix + '.Client.Kopete') check_handler = q.expect('dbus-method-call', path='/com/example/Policy', interface='com.example.Policy', method='CheckHandler') q.dbus_raise(check_handler.message, 'com.example.Errors.No', 'That handler is not good enough') q.expect('dbus-error', method='HandleWith', name=cs.PERMISSION_DENIED) # well, let's try *something*... Kopete has been marked as failed, # so this will try Empathy call_async(q, kopete_cdo_iface, 'HandleWith', '') check_handler = q.expect('dbus-method-call', path='/com/example/Policy', interface='com.example.Policy', method='CheckHandler') q.dbus_raise(check_handler.message, 'com.example.Errors.No', 'That handler is no good either') # Oops... we ran out of handlers _, _, _, e = q.expect_many( EventPattern('dbus-error', method='HandleWith', name=cs.PERMISSION_DENIED), EventPattern('dbus-signal', path=cdo_path, interface=cs.CDO, signal='Finished'), EventPattern('dbus-signal', path=cs.CD_PATH, interface=cs.CD_IFACE_OP_LIST, signal='DispatchOperationFinished', args=[cdo_path]), EventPattern('dbus-method-call', path=chan.object_path, interface=cs.CHANNEL_IFACE_DESTROYABLE, method='Destroy', handled=False), ) q.dbus_return(e.message, signature='') chan.close() sync_dbus(bus, q, mc) # From now on we no longer want to forbid HandleChannels, but we do want # to forbid AddDispatchOperation q.unforbid_events(forbidden) forbidden = [ EventPattern('dbus-method-call', method='AddDispatchOperation'), ] q.forbid_events(forbidden) # Try yet again policy_request, chan, cdo_path = signal_channel_expect_query(q, bus, account, conn, empathy, kopete) # Before the policy service replies, someone requests the same channel user_action_time = dbus.Int64(1238582606) call_async(q, cd, 'EnsureChannel', account.object_path, chan.immutable, user_action_time, kopete.bus_name, dbus_interface=cs.CD) ret, add_request_call = q.expect_many( EventPattern('dbus-return', method='EnsureChannel'), EventPattern('dbus-method-call', handled=False, interface=cs.CLIENT_IFACE_REQUESTS, method='AddRequest', path=kopete.object_path), ) request_path = ret.value[0] cr = bus.get_object(cs.CD, request_path) cr.Proceed(dbus_interface=cs.CR) cm_request_call = q.expect('dbus-method-call', interface=cs.CONN_IFACE_REQUESTS, method='EnsureChannel', path=conn.object_path, args=[chan.immutable], handled=False) q.dbus_return(add_request_call.message, signature='') # Time passes. The CM returns the existing channel, and the policy # service gets round to replying q.dbus_return(cm_request_call.message, False, chan.object_path, chan.immutable, signature='boa{sv}') q.dbus_return(policy_request.message, signature='') # Now we want to pass the channel to the selected handler. # What does the policy service think about that? check_handler = q.expect('dbus-method-call', path='/com/example/Policy', interface='com.example.Policy', method='CheckHandler') # Yeah, we're OK with that. q.dbus_return(check_handler.message, signature='') e = q.expect('dbus-method-call', path=kopete.object_path, interface=cs.HANDLER, method='HandleChannels', handled=False) assert e.args[0] == account.object_path, e.args assert e.args[1] == conn.object_path, e.args channels = e.args[2] assert len(channels) == 1, channels assert channels[0][0] == chan.object_path, channels assert channels[0][1] == chan.immutable, channels assert e.args[3] == [request_path], e.args assert e.args[4] == user_action_time, (e.args[4], user_action_time) assert isinstance(e.args[5], dict) assert len(e.args) == 6 # Handler accepts the Channels q.dbus_return(e.message, signature='') q.expect_many( EventPattern('dbus-signal', interface=cs.CDO, signal='Finished'), EventPattern('dbus-signal', interface=cs.CD_IFACE_OP_LIST, signal='DispatchOperationFinished'), ) sync_dbus(bus, q, mc) if __name__ == '__main__': exec_test(test, {}) telepathy-mission-control-5.16.4/tests/twisted/dispatcher/dispatch-obsolete.py0000644000175000017500000001660412735242352030767 0ustar00gkiagiagkiagia00000000000000# Copyright (C) 2009 Nokia Corporation # Copyright (C) 2009 Collabora Ltd. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA # 02110-1301 USA import dbus """Regression test for dispatching an incoming Text channel from a CM without Requests. """ import dbus import dbus.service from servicetest import EventPattern, tp_name_prefix, tp_path_prefix, \ call_async from mctest import exec_test, SimulatedConnection, SimulatedClient, \ create_fakecm_account, enable_fakecm_account, SimulatedChannel, \ expect_client_setup import constants as cs def test(q, bus, mc): params = dbus.Dictionary({"account": "someguy@example.com", "password": "secrecy"}, signature='sv') cm_name_ref, account = create_fakecm_account(q, bus, mc, params) conn = enable_fakecm_account(q, bus, mc, account, params, has_requests=False) text_fixed_properties = dbus.Dictionary({ cs.CHANNEL + '.TargetHandleType': cs.HT_CONTACT, cs.CHANNEL + '.ChannelType': cs.CHANNEL_TYPE_TEXT, }, signature='sv') # Two clients want to observe, approve and handle channels empathy = SimulatedClient(q, bus, 'Empathy', observe=[text_fixed_properties], approve=[text_fixed_properties], handle=[text_fixed_properties], bypass_approval=False) kopete = SimulatedClient(q, bus, 'Kopete', observe=[text_fixed_properties], approve=[text_fixed_properties], handle=[text_fixed_properties], bypass_approval=False) # wait for MC to download the properties expect_client_setup(q, [empathy, kopete]) # subscribe to the OperationList interface (MC assumes that until this # property has been retrieved once, nobody cares) cd = bus.get_object(cs.CD, cs.CD_PATH) cd_props = dbus.Interface(cd, cs.PROPERTIES_IFACE) assert cd_props.Get(cs.CD_IFACE_OP_LIST, 'DispatchOperations') == [] channel_properties = dbus.Dictionary(text_fixed_properties, signature='sv') channel_properties[cs.CHANNEL + '.TargetID'] = 'juliet' channel_properties[cs.CHANNEL + '.TargetHandle'] = \ conn.ensure_handle(cs.HT_CONTACT, 'juliet') channel_properties[cs.CHANNEL + '.InitiatorID'] = 'juliet' channel_properties[cs.CHANNEL + '.InitiatorHandle'] = \ conn.ensure_handle(cs.HT_CONTACT, 'juliet') channel_properties[cs.CHANNEL + '.Requested'] = False channel_properties[cs.CHANNEL + '.Interfaces'] = dbus.Array(signature='s') chan = SimulatedChannel(conn, channel_properties) chan.announce() # A channel dispatch operation is created e = q.expect('dbus-signal', path=cs.CD_PATH, interface=cs.CD_IFACE_OP_LIST, signal='NewDispatchOperation') cdo_path = e.args[0] cdo_properties = e.args[1] assert cdo_properties[cs.CDO + '.Account'] == account.object_path assert cdo_properties[cs.CDO + '.Connection'] == conn.object_path assert cs.CDO + '.Interfaces' in cdo_properties handlers = cdo_properties[cs.CDO + '.PossibleHandlers'][:] handlers.sort() assert handlers == [cs.tp_name_prefix + '.Client.Empathy', cs.tp_name_prefix + '.Client.Kopete'], handlers assert cs.CD_IFACE_OP_LIST in cd_props.Get(cs.CD, 'Interfaces') assert cd_props.Get(cs.CD_IFACE_OP_LIST, 'DispatchOperations') ==\ [(cdo_path, cdo_properties)] cdo = bus.get_object(cs.CD, cdo_path) cdo_iface = dbus.Interface(cdo, cs.CDO) # Both Observers are told about the new channel e, k = q.expect_many( EventPattern('dbus-method-call', path=empathy.object_path, interface=cs.OBSERVER, method='ObserveChannels', handled=False), EventPattern('dbus-method-call', path=kopete.object_path, interface=cs.OBSERVER, method='ObserveChannels', handled=False), ) assert e.args[0] == account.object_path, e.args assert e.args[1] == conn.object_path, e.args assert e.args[3] == cdo_path, e.args assert e.args[4] == [], e.args # no requests satisfied channels = e.args[2] assert len(channels) == 1, channels assert channels[0][0] == chan.object_path, channels # the announced channel properties are some subset of what it actually has for key in channels[0][1]: assert channel_properties[key] == channels[0][1][key], key assert cs.CHANNEL + '.TargetHandleType' in channels[0][1] assert cs.CHANNEL + '.ChannelType' in channels[0][1] assert cs.CHANNEL + '.TargetHandle' in channels[0][1] assert k.args == e.args # Both Observers indicate that they are ready to proceed q.dbus_return(k.message, signature='') q.dbus_return(e.message, signature='') # The Approvers are next e, k = q.expect_many( EventPattern('dbus-method-call', path=empathy.object_path, interface=cs.APPROVER, method='AddDispatchOperation', handled=False), EventPattern('dbus-method-call', path=kopete.object_path, interface=cs.APPROVER, method='AddDispatchOperation', handled=False), ) assert e.args[1:] == [cdo_path, cdo_properties] channels = e.args[0] assert len(channels) == 1, channels assert channels[0][0] == chan.object_path, channels # the announced channel properties are some subset of what it actually has for key in channels[0][1]: assert channel_properties[key] == channels[0][1][key], key assert cs.CHANNEL + '.TargetHandleType' in channels[0][1] assert cs.CHANNEL + '.ChannelType' in channels[0][1] assert cs.CHANNEL + '.TargetHandle' in channels[0][1] assert k.args == e.args q.dbus_return(e.message, signature='') q.dbus_return(k.message, signature='') # Both Approvers now have a flashing icon or something, trying to get the # user's attention # The user responds to Empathy first call_async(q, cdo_iface, 'HandleWith', cs.tp_name_prefix + '.Client.Empathy') # Empathy is asked to handle the channels e = q.expect('dbus-method-call', path=empathy.object_path, interface=cs.HANDLER, method='HandleChannels', handled=False) # Empathy accepts the channels q.dbus_return(e.message, signature='') q.expect_many( EventPattern('dbus-return', method='HandleWith'), EventPattern('dbus-signal', interface=cs.CDO, signal='Finished'), EventPattern('dbus-signal', interface=cs.CD_IFACE_OP_LIST, signal='DispatchOperationFinished'), ) # Now there are no more active channel dispatch operations assert cd_props.Get(cs.CD_IFACE_OP_LIST, 'DispatchOperations') == [] if __name__ == '__main__': exec_test(test, {}) telepathy-mission-control-5.16.4/tests/twisted/dispatcher/vanishing-client.py0000644000175000017500000000770612735242352030623 0ustar00gkiagiagkiagia00000000000000# Copyright (C) 2009 Nokia Corporation # Copyright (C) 2009 Collabora Ltd. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA # 02110-1301 USA import dbus """Regression test for a client crashing when Get is called. """ import dbus import dbus.service from servicetest import EventPattern, tp_name_prefix, tp_path_prefix, \ call_async, sync_dbus from mctest import exec_test, SimulatedConnection, SimulatedClient, \ create_fakecm_account, enable_fakecm_account, SimulatedChannel, \ expect_client_setup import constants as cs def test(q, bus, mc): params = dbus.Dictionary({"account": "someguy@example.com", "password": "secrecy"}, signature='sv') cm_name_ref, account = create_fakecm_account(q, bus, mc, params) conn = enable_fakecm_account(q, bus, mc, account, params) bus_name = '.'.join([tp_name_prefix, 'Client.CrashMe']) bus_name_ref = dbus.service.BusName(bus_name, bus) object_path = '/' + bus_name.replace('.', '/') # MC inspects it e = q.expect('dbus-method-call', interface=cs.PROPERTIES_IFACE, method='Get', path=object_path, args=[cs.CLIENT, 'Interfaces'], handled=False) # Simulate a crash del bus_name_ref sync_dbus(bus, q, account) # This might crash MC in sympathy q.dbus_raise(e.message, cs.DBUS_ERROR_NO_REPLY, 'I crashed') sync_dbus(bus, q, account) # Try again bus_name = '.'.join([tp_name_prefix, 'Client.CrashMeAgain']) bus_name_ref = dbus.service.BusName(bus_name, bus) object_path = '/' + bus_name.replace('.', '/') # MC inspects it e = q.expect('dbus-method-call', interface=cs.PROPERTIES_IFACE, method='Get', path=object_path, args=[cs.CLIENT, 'Interfaces'], handled=False) # Don't crash just yet q.dbus_return(e.message, dbus.Array([cs.OBSERVER], signature='s'), signature='v') # MC investigates further e = q.expect('dbus-method-call', interface=cs.PROPERTIES_IFACE, method='GetAll', path=object_path, args=[cs.OBSERVER], handled=False) # Simulate another crash del bus_name_ref sync_dbus(bus, q, account) q.dbus_raise(e.message, cs.DBUS_ERROR_NO_REPLY, 'I crashed') # Try again bus_name = '.'.join([tp_name_prefix, 'Client.CrashMeHarder']) bus_name_ref = dbus.service.BusName(bus_name, bus) object_path = '/' + bus_name.replace('.', '/') # MC inspects it e = q.expect('dbus-method-call', interface=cs.PROPERTIES_IFACE, method='Get', path=object_path, args=[cs.CLIENT, 'Interfaces'], handled=False) # Don't crash just yet q.dbus_return(e.message, dbus.Array([cs.OBSERVER], signature='s'), signature='v') # MC investigates further e = q.expect('dbus-method-call', interface=cs.PROPERTIES_IFACE, method='GetAll', path=object_path, args=[cs.OBSERVER], handled=False) # Simulate a crash with highly unfortunate timing del bus_name_ref sync_dbus(bus, q, account) q.dbus_return(e.message, dbus.Array([dbus.Dictionary({ 'x': 'y', }, signature='sv')], signature='a{sv}'), signature='v') sync_dbus(bus, q, account) if __name__ == '__main__': exec_test(test, {}) telepathy-mission-control-5.16.4/tests/twisted/dispatcher/create-delayed-by-mini-plugin.py0000644000175000017500000001740612735242352033065 0ustar00gkiagiagkiagia00000000000000# -*- coding: utf-8 -*- # Copyright © 2009 Nokia Corporation. # Copyright © 2009-2010 Collabora Ltd. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA # 02110-1301 USA import dbus """Regression test for ChannelDispatcher delaying channel creation due to a plugin. """ import dbus import dbus.service from servicetest import EventPattern, tp_name_prefix, tp_path_prefix, \ call_async, sync_dbus from mctest import exec_test, SimulatedConnection, SimulatedClient, \ create_fakecm_account, enable_fakecm_account, SimulatedChannel, \ expect_client_setup import constants as cs # Rejected by the plugin DELAYED_CTYPE = 'com.example.QuestionableChannel' def test(q, bus, mc): policy_bus_name_ref = dbus.service.BusName('com.example.Policy', bus) params = dbus.Dictionary({"account": "someguy@example.com", "password": "secrecy"}, signature='sv') cm_name_ref, account = create_fakecm_account(q, bus, mc, params) conn, e = enable_fakecm_account(q, bus, mc, account, params, extra_interfaces=[cs.CONN_IFACE_SERVICE_POINT], expect_after_connect=[ EventPattern('dbus-method-call', method='Get', args=[cs.CONN_IFACE_SERVICE_POINT, 'KnownServicePoints']), ]) e_numbers = ['911', '112'] points = dbus.Array([((cs.SERVICE_POINT_TYPE_EMERGENCY, 'urn:service:sos'), e_numbers)], signature='((us)as)') q.dbus_return(e.message, points, signature='v') # MC looks up the handles for these numbers patterns = [EventPattern('dbus-method-call', path=conn.object_path, interface=cs.CONN, method='RequestHandles', args=[cs.HT_CONTACT, [num]], handled=True) for num in e_numbers] q.expect_many(*patterns) # the service points change e_numbers = ['911', '112', '999'] points = dbus.Array([((cs.SERVICE_POINT_TYPE_EMERGENCY, 'urn:service:sos'), e_numbers)], signature='((us)as)') q.dbus_emit(conn.object_path, cs.CONN_IFACE_SERVICE_POINT, 'ServicePointsChanged', points, signature='a((us)as)') # MC looks up the new handles patterns = [EventPattern('dbus-method-call', path=conn.object_path, interface=cs.CONN, method='RequestHandles', args=[cs.HT_CONTACT, [num]], handled=True) for num in e_numbers] q.expect_many(*patterns) # MC used to critical if more than one emergency service point was # given by the CM. That's silly, so let's test it. e_numbers1 = ['911'] e_numbers2 = ['999'] points = dbus.Array([((cs.SERVICE_POINT_TYPE_EMERGENCY, 'urn:service:sos'), e_numbers1), ((cs.SERVICE_POINT_TYPE_EMERGENCY, 'urn:service:sos'), e_numbers2)], signature='((us)as)') q.dbus_emit(conn.object_path, cs.CONN_IFACE_SERVICE_POINT, 'ServicePointsChanged', points, signature='a((us)as)') e_numbers = e_numbers1 + e_numbers2 patterns = [EventPattern('dbus-method-call', path=conn.object_path, interface=cs.CONN, method='RequestHandles', args=[cs.HT_CONTACT, [num]], handled=True) for num in e_numbers] q.expect_many(*patterns) fixed_properties = dbus.Dictionary({ cs.CHANNEL + '.TargetHandleType': cs.HT_CONTACT, cs.CHANNEL + '.ChannelType': DELAYED_CTYPE, }, signature='sv') client = SimulatedClient(q, bus, 'Empathy', observe=[fixed_properties], approve=[fixed_properties], handle=[fixed_properties], bypass_approval=False) # wait for MC to download the properties expect_client_setup(q, [client]) user_action_time = dbus.Int64(1238582606) cd = bus.get_object(cs.CD, cs.CD_PATH) cd_props = dbus.Interface(cd, cs.PROPERTIES_IFACE) for emergency in False, True: if emergency: target_id = '112' forbidden = [ EventPattern('dbus-method-call', method='RequestRequest'), ] else: target_id = 'juliet' # For now, we should never actually be asked to make a channel. forbidden = [ EventPattern('dbus-method-call', method='CreateChannel'), EventPattern('dbus-method-call', method='EnsureChannel'), EventPattern('dbus-method-call', method='ObserveChannels'), EventPattern('dbus-method-call', method='AddDispatchOperation'), EventPattern('dbus-method-call', method='HandleChannels'), ] q.forbid_events(forbidden) # UI calls ChannelDispatcher.CreateChannel request = dbus.Dictionary({ cs.CHANNEL + '.ChannelType': DELAYED_CTYPE, cs.CHANNEL + '.TargetHandleType': cs.HT_CONTACT, cs.CHANNEL + '.TargetID': target_id, }, signature='sv') call_async(q, cd, 'CreateChannel', account.object_path, request, user_action_time, client.bus_name, dbus_interface=cs.CD) ret = q.expect('dbus-return', method='CreateChannel') request_path = ret.value[0] # UI connects to signals and calls ChannelRequest.Proceed() cr = bus.get_object(cs.AM, request_path) request_props = cr.GetAll(cs.CR, dbus_interface=cs.PROPERTIES_IFACE) assert request_props['Account'] == account.object_path assert request_props['Requests'] == [request] assert request_props['UserActionTime'] == user_action_time assert request_props['PreferredHandler'] == client.bus_name assert request_props['Interfaces'] == [] call_async(q, cr, 'Proceed', dbus_interface=cs.CR) q.expect('dbus-return', method='Proceed') if emergency: # The CM is asked to create the channel anyway, because this # looks a bit like an emergency call cm_request_call = q.expect('dbus-method-call', interface=cs.CONN_IFACE_REQUESTS, method='CreateChannel', path=conn.object_path, args=[request], handled=False) q.dbus_raise(cm_request_call.message, cs.INVALID_ARGUMENT, 'No') sync_dbus(bus, q, account) q.unforbid_events(forbidden) else: # What does the policy service think? permission = q.expect('dbus-method-call', path='/com/example/Policy', interface='com.example.Policy', method='RequestRequest') # Think about it for a bit, then allow dispatching to continue sync_dbus(bus, q, account) q.unforbid_events(forbidden) q.dbus_return(permission.message, signature='') # Only now does the CM's CreateChannel method get called cm_request_call = q.expect('dbus-method-call', interface=cs.CONN_IFACE_REQUESTS, method='CreateChannel', path=conn.object_path, args=[request], handled=False) q.dbus_raise(cm_request_call.message, cs.INVALID_ARGUMENT, 'No') if __name__ == '__main__': exec_test(test, {}) telepathy-mission-control-5.16.4/tests/twisted/dispatcher/create-handler-fails.py0000644000175000017500000001722612735242352031331 0ustar00gkiagiagkiagia00000000000000# Copyright (C) 2009 Nokia Corporation # Copyright (C) 2009 Collabora Ltd. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA # 02110-1301 USA import dbus """Regression test for ChannelDispatcher when a channel can be created, but the Handler rejects it. """ import dbus import dbus.service from servicetest import EventPattern, tp_name_prefix, tp_path_prefix, \ call_async from mctest import exec_test, SimulatedConnection, SimulatedClient, \ create_fakecm_account, enable_fakecm_account, SimulatedChannel, \ expect_client_setup import constants as cs def test(q, bus, mc): params = dbus.Dictionary({"account": "someguy@example.com", "password": "secrecy"}, signature='sv') cm_name_ref, account = create_fakecm_account(q, bus, mc, params) conn = enable_fakecm_account(q, bus, mc, account, params) text_fixed_properties = dbus.Dictionary({ cs.CHANNEL + '.TargetHandleType': cs.HT_CONTACT, cs.CHANNEL + '.ChannelType': cs.CHANNEL_TYPE_TEXT, }, signature='sv') client = SimulatedClient(q, bus, 'Empathy', observe=[text_fixed_properties], approve=[text_fixed_properties], handle=[text_fixed_properties], bypass_approval=False) # No Approver should be invoked at any point during this test, because the # Channel was Requested def fail_on_approval(e): raise AssertionError('Approver should not be invoked') q.add_dbus_method_impl(fail_on_approval, path=client.object_path, interface=cs.APPROVER, method='AddDispatchOperation') # wait for MC to download the properties expect_client_setup(q, [client]) test_channel_creation(q, bus, account, client, conn, False) def test_channel_creation(q, bus, account, client, conn, ensure): user_action_time = dbus.Int64(1238582606) cd = bus.get_object(cs.CD, cs.CD_PATH) cd_props = dbus.Interface(cd, cs.PROPERTIES_IFACE) # chat UI calls ChannelDispatcher.EnsureChannel or CreateChannel request = dbus.Dictionary({ cs.CHANNEL + '.ChannelType': cs.CHANNEL_TYPE_TEXT, cs.CHANNEL + '.TargetHandleType': cs.HT_CONTACT, cs.CHANNEL + '.TargetID': 'juliet', }, signature='sv') call_async(q, cd, (ensure and 'EnsureChannel' or 'CreateChannel'), account.object_path, request, user_action_time, client.bus_name, dbus_interface=cs.CD) ret = q.expect('dbus-return', method=(ensure and 'EnsureChannel' or 'CreateChannel')) request_path = ret.value[0] # chat UI connects to signals and calls ChannelRequest.Proceed() cr = bus.get_object(cs.AM, request_path) request_props = cr.GetAll(cs.CR, dbus_interface=cs.PROPERTIES_IFACE) assert request_props['Account'] == account.object_path assert request_props['Requests'] == [request] assert request_props['UserActionTime'] == user_action_time assert request_props['PreferredHandler'] == client.bus_name assert request_props['Interfaces'] == [] cr.Proceed(dbus_interface=cs.CR) # FIXME: should the EnsureChannel/CreateChannel call, and the AddRequest # call, be in a defined order? Probably not though, since CMs and Clients # aren't meant to be the same process! cm_request_call, add_request_call = q.expect_many( EventPattern('dbus-method-call', interface=cs.CONN_IFACE_REQUESTS, method=(ensure and 'EnsureChannel' or 'CreateChannel'), path=conn.object_path, args=[request], handled=False), EventPattern('dbus-method-call', handled=False, interface=cs.CLIENT_IFACE_REQUESTS, method='AddRequest', path=client.object_path), ) assert add_request_call.args[0] == request_path request_props = add_request_call.args[1] assert request_props[cs.CR + '.Account'] == account.object_path assert request_props[cs.CR + '.Requests'] == [request] assert request_props[cs.CR + '.UserActionTime'] == user_action_time assert request_props[cs.CR + '.PreferredHandler'] == client.bus_name assert request_props[cs.CR + '.Interfaces'] == [] q.dbus_return(add_request_call.message, signature='') # Time passes. A channel is returned. channel_immutable = dbus.Dictionary(request) channel_immutable[cs.CHANNEL + '.InitiatorID'] = conn.self_ident channel_immutable[cs.CHANNEL + '.InitiatorHandle'] = conn.self_handle channel_immutable[cs.CHANNEL + '.Requested'] = True channel_immutable[cs.CHANNEL + '.Interfaces'] = \ dbus.Array([], signature='s') channel_immutable[cs.CHANNEL + '.TargetHandle'] = \ conn.ensure_handle(cs.HT_CONTACT, 'juliet') channel = SimulatedChannel(conn, channel_immutable) # this order of events is guaranteed by telepathy-spec (since 0.17.14) if ensure: q.dbus_return(cm_request_call.message, True, # <- Yours channel.object_path, channel.immutable, signature='boa{sv}') else: # Create q.dbus_return(cm_request_call.message, channel.object_path, channel.immutable, signature='oa{sv}') channel.announce() # Observer should get told, processing waits for it e = q.expect('dbus-method-call', path=client.object_path, interface=cs.OBSERVER, method='ObserveChannels', handled=False) assert e.args[0] == account.object_path, e.args assert e.args[1] == conn.object_path, e.args assert e.args[3] == '/', e.args # no dispatch operation assert e.args[4] == [request_path], e.args channels = e.args[2] assert len(channels) == 1, channels assert channels[0][0] == channel.object_path, channels assert channels[0][1] == channel_immutable, channels # Observer says "OK, go" q.dbus_return(e.message, signature='') # Handler is next e = q.expect('dbus-method-call', path=client.object_path, interface=cs.HANDLER, method='HandleChannels', handled=False) assert e.args[0] == account.object_path, e.args assert e.args[1] == conn.object_path, e.args channels = e.args[2] assert len(channels) == 1, channels assert channels[0][0] == channel.object_path, channels assert channels[0][1] == channel_immutable, channels assert e.args[3] == [request_path], e.args assert e.args[4] == user_action_time assert isinstance(e.args[5], dict) assert len(e.args) == 6 # Handler fails at handling channels q.dbus_raise(e.message, cs.INVALID_ARGUMENT, 'Parlez vous Freezepop?') e = q.expect('dbus-method-call', path=client.object_path, interface=cs.CLIENT_IFACE_REQUESTS, method='RemoveRequest', handled=False) q.dbus_raise(e.message, cs.INVALID_ARGUMENT, 'Do you realise?') q.expect_many( EventPattern('dbus-signal', path=cr.object_path, interface=cs.CR, signal='Failed'), EventPattern('dbus-method-call', path=channel.object_path, interface=cs.CHANNEL, method='Close', handled=True), ) if __name__ == '__main__': exec_test(test, {}) telepathy-mission-control-5.16.4/tests/twisted/dispatcher/delay-approvers.py0000644000175000017500000001265512735242352030475 0ustar00gkiagiagkiagia00000000000000# Copyright (C) 2010 Collabora Ltd. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA # 02110-1301 USA import dbus import dbus.bus import dbus.service from servicetest import EventPattern, tp_name_prefix, tp_path_prefix, \ call_async, sync_dbus from mctest import exec_test, SimulatedConnection, SimulatedClient, \ create_fakecm_account, enable_fakecm_account, SimulatedChannel, \ expect_client_setup import constants as cs def test(q, bus, mc): params = dbus.Dictionary({"account": "someguy@example.com", "password": "secrecy"}, signature='sv') cm_name_ref, account = create_fakecm_account(q, bus, mc, params) conn = enable_fakecm_account(q, bus, mc, account, params) text_fixed_properties = dbus.Dictionary({ cs.CHANNEL + '.TargetHandleType': cs.HT_CONTACT, cs.CHANNEL + '.ChannelType': cs.CHANNEL_TYPE_TEXT, }, signature='sv') # Empathy is an observer for text channels with # DelayApprovers=TRUE. empathy = SimulatedClient(q, bus, 'Empathy', observe=[text_fixed_properties], approve=[], handle=[], delay_approvers=True) # Kopete is an approver and handler for text channels. kopete = SimulatedClient(q, bus, 'Kopete', observe=[], approve=[text_fixed_properties], handle=[text_fixed_properties]) expect_client_setup(q, [empathy, kopete]) # subscribe to the OperationList interface (MC assumes that until this # property has been retrieved once, nobody cares) cd = bus.get_object(cs.CD, cs.CD_PATH) cd_props = dbus.Interface(cd, cs.PROPERTIES_IFACE) assert cd_props.Get(cs.CD_IFACE_OP_LIST, 'DispatchOperations') == [] # A text channel appears! channel_properties = dbus.Dictionary(text_fixed_properties, signature='sv') channel_properties[cs.CHANNEL + '.TargetID'] = 'juliet' channel_properties[cs.CHANNEL + '.TargetHandle'] = \ conn.ensure_handle(cs.HT_CONTACT, 'juliet') channel_properties[cs.CHANNEL + '.InitiatorID'] = 'juliet' channel_properties[cs.CHANNEL + '.InitiatorHandle'] = \ conn.ensure_handle(cs.HT_CONTACT, 'juliet') channel_properties[cs.CHANNEL + '.Requested'] = False channel_properties[cs.CHANNEL + '.Interfaces'] = dbus.Array(signature='s') chan = SimulatedChannel(conn, channel_properties) chan.announce() e = q.expect('dbus-signal', path=cs.CD_PATH, interface=cs.CD_IFACE_OP_LIST, signal='NewDispatchOperation') cdo_path = e.args[0] cdo = bus.get_object(cs.CD, cdo_path) cdo_iface = dbus.Interface(cdo, cs.CDO) cdo_props_iface = dbus.Interface(cdo, cs.PROPERTIES_IFACE) # Empathy, the observer, gets the channel to observe. Because it # has DelayApprovers=TRUE, Kopete should not have # AddDispatchOperation called on it until Empathy returns from # ObserveChannels. forbidden = [EventPattern('dbus-method-call', path=kopete.object_path, interface=cs.APPROVER, method='AddDispatchOperation')] q.forbid_events(forbidden) o = q.expect('dbus-method-call', path=empathy.object_path, interface=cs.OBSERVER, method='ObserveChannels', handled=False) # Waste a little time here and there. We can't call sync_dbus # here because it calls Ping and libdbus returns from Ping # synchronously and doesn't turn the main loop handle enough. call_async(q, cd_props, 'Get', cs.CD_IFACE_OP_LIST, 'DispatchOperations') event = q.expect('dbus-return', method='Get') # Finally return from ObserveChannels, so now we expect ADO to be # called on Kopete. q.dbus_return(o.message, bus=bus, signature='') q.unforbid_events(forbidden) e = q.expect('dbus-method-call', path=kopete.object_path, interface=cs.APPROVER, method='AddDispatchOperation', handled=False) q.dbus_return(e.message, bus=bus, signature='') # The user responds to Kopete call_async(q, cdo_iface, 'HandleWith', cs.tp_name_prefix + '.Client.Kopete') # Kopete is asked to handle the channels k = q.expect('dbus-method-call', path=kopete.object_path, interface=cs.HANDLER, method='HandleChannels', handled=False) # Kopete accepts the channels q.dbus_return(k.message, bus=bus, signature='') q.expect_many( EventPattern('dbus-return', method='HandleWith'), EventPattern('dbus-signal', interface=cs.CDO, signal='Finished'), EventPattern('dbus-signal', interface=cs.CD_IFACE_OP_LIST, signal='DispatchOperationFinished'), ) # Now there are no more active channel dispatch operations assert cd_props.Get(cs.CD_IFACE_OP_LIST, 'DispatchOperations') == [] if __name__ == '__main__': exec_test(test, {}) telepathy-mission-control-5.16.4/tests/twisted/dispatcher/capture-bundle.py0000644000175000017500000002525212735242352030267 0ustar00gkiagiagkiagia00000000000000# Copyright (C) 2009 Nokia Corporation # Copyright (C) 2009 Collabora Ltd. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA # 02110-1301 USA import dbus """Feature test for a VoIP UI stealing closely-related Text channels as described in the telepathy-spec rationale. """ import dbus import dbus.service from servicetest import EventPattern, tp_name_prefix, tp_path_prefix, \ call_async from mctest import exec_test, SimulatedConnection, SimulatedClient, \ create_fakecm_account, enable_fakecm_account, SimulatedChannel, \ expect_client_setup import constants as cs def test(q, bus, mc): params = dbus.Dictionary({"account": "someguy@example.com", "password": "secrecy"}, signature='sv') cm_name_ref, account = create_fakecm_account(q, bus, mc, params) conn = enable_fakecm_account(q, bus, mc, account, params) text_fixed_properties = dbus.Dictionary({ cs.CHANNEL + '.TargetHandleType': cs.HT_CONTACT, cs.CHANNEL + '.ChannelType': cs.CHANNEL_TYPE_TEXT, }, signature='sv') voip_fixed_properties = dbus.Dictionary({ cs.CHANNEL + '.TargetHandleType': cs.HT_CONTACT, cs.CHANNEL + '.ChannelType': cs.CHANNEL_TYPE_STREAMED_MEDIA, }, signature='sv') # Two clients want to observe, approve and handle text and VoIP channels. empathy = SimulatedClient(q, bus, 'Empathy', observe=[text_fixed_properties, voip_fixed_properties], approve=[text_fixed_properties, voip_fixed_properties], handle=[text_fixed_properties, voip_fixed_properties], bypass_approval=False) kopete = SimulatedClient(q, bus, 'Kopete', observe=[text_fixed_properties, voip_fixed_properties], approve=[text_fixed_properties, voip_fixed_properties], handle=[text_fixed_properties, voip_fixed_properties], bypass_approval=False) # wait for MC to download the properties expect_client_setup(q, [empathy, kopete]) # subscribe to the OperationList interface (MC assumes that until this # property has been retrieved once, nobody cares) cd = bus.get_object(cs.CD, cs.CD_PATH) cd_props = dbus.Interface(cd, cs.PROPERTIES_IFACE) assert cd_props.Get(cs.CD_IFACE_OP_LIST, 'DispatchOperations') == [] # First, a VoIP channel is created BUNDLE = '/8de0d29d-83e1-40f5-b24f-748c0aa86c82' channel_properties = dbus.Dictionary(voip_fixed_properties, signature='sv') channel_properties[cs.CHANNEL + '.TargetID'] = 'juliet' channel_properties[cs.CHANNEL + '.TargetHandle'] = \ conn.ensure_handle(cs.HT_CONTACT, 'juliet') channel_properties[cs.CHANNEL + '.InitiatorID'] = 'juliet' channel_properties[cs.CHANNEL + '.InitiatorHandle'] = \ conn.ensure_handle(cs.HT_CONTACT, 'juliet') channel_properties[cs.CHANNEL + '.Requested'] = False channel_properties[cs.CHANNEL + '.Interfaces'] = dbus.Array(signature='s') channel_properties[cs.CHANNEL + '.FUTURE.Bundle'] = BUNDLE chan = SimulatedChannel(conn, channel_properties) chan.announce() # A channel dispatch operation is created e = q.expect('dbus-signal', path=cs.CD_PATH, interface=cs.CD_IFACE_OP_LIST, signal='NewDispatchOperation') cdo_path = e.args[0] cdo_properties = e.args[1] assert cdo_properties[cs.CDO + '.Account'] == account.object_path assert cdo_properties[cs.CDO + '.Connection'] == conn.object_path assert cs.CDO + '.Interfaces' in cdo_properties handlers = cdo_properties[cs.CDO + '.PossibleHandlers'][:] handlers.sort() assert handlers == [cs.tp_name_prefix + '.Client.Empathy', cs.tp_name_prefix + '.Client.Kopete'], handlers assert cs.CD_IFACE_OP_LIST in cd_props.Get(cs.CD, 'Interfaces') assert cd_props.Get(cs.CD_IFACE_OP_LIST, 'DispatchOperations') ==\ [(cdo_path, cdo_properties)] cdo = bus.get_object(cs.CD, cdo_path) cdo_iface = dbus.Interface(cdo, cs.CDO) # Both Observers are told about the new channel e, k = q.expect_many( EventPattern('dbus-method-call', path=empathy.object_path, interface=cs.OBSERVER, method='ObserveChannels', handled=False), EventPattern('dbus-method-call', path=kopete.object_path, interface=cs.OBSERVER, method='ObserveChannels', handled=False), ) assert e.args[0] == account.object_path, e.args assert e.args[1] == conn.object_path, e.args assert e.args[3] == cdo_path, e.args assert e.args[4] == [], e.args # no requests satisfied channels = e.args[2] assert len(channels) == 1, channels assert channels[0][0] == chan.object_path, channels assert channels[0][1] == channel_properties, channels assert k.args == e.args # Both Observers indicate that they are ready to proceed q.dbus_return(k.message, signature='') q.dbus_return(e.message, signature='') # The Approvers are next e, k = q.expect_many( EventPattern('dbus-method-call', path=empathy.object_path, interface=cs.APPROVER, method='AddDispatchOperation', handled=False), EventPattern('dbus-method-call', path=kopete.object_path, interface=cs.APPROVER, method='AddDispatchOperation', handled=False), ) assert e.args == [[(chan.object_path, channel_properties)], cdo_path, cdo_properties] assert k.args == e.args q.dbus_return(e.message, signature='') q.dbus_return(k.message, signature='') # Both Approvers now have a flashing icon or something, trying to get the # user's attention # The user responds to Empathy first call_async(q, cdo_iface, 'HandleWith', cs.tp_name_prefix + '.Client.Empathy') # Empathy is asked to handle the channels e = q.expect('dbus-method-call', path=empathy.object_path, interface=cs.HANDLER, method='HandleChannels', handled=False) # Empathy accepts the channels q.dbus_return(e.message, signature='') q.expect_many( EventPattern('dbus-return', method='HandleWith'), EventPattern('dbus-signal', interface=cs.CDO, signal='Finished'), EventPattern('dbus-signal', interface=cs.CD_IFACE_OP_LIST, signal='DispatchOperationFinished'), ) # Now there are no more active channel dispatch operations assert cd_props.Get(cs.CD_IFACE_OP_LIST, 'DispatchOperations') == [] # Now that Empathy has the VoIP channel, it wants to steal incoming Text # channels from the same bundle same_bundle_properties = dbus.Dictionary(text_fixed_properties, signature='sv') same_bundle_properties[cs.CHANNEL + '.FUTURE.Bundle'] = BUNDLE bypass = SimulatedClient(q, bus, 'Empathy._1_42.Window2', observe=[], approve=[], handle=[same_bundle_properties], bypass_approval=True) # wait for MC to download the properties expect_client_setup(q, [bypass]) # From now on, this test must fail if we're asked to approve anything approval = [ EventPattern('dbus-method-call', method='AddDispatchOperation'), ] q.forbid_events(approval) channel_properties = dbus.Dictionary(text_fixed_properties, signature='sv') channel_properties[cs.CHANNEL + '.TargetHandleType'] = cs.HT_CONTACT channel_properties[cs.CHANNEL + '.TargetID'] = 'juliet' channel_properties[cs.CHANNEL + '.TargetHandle'] = \ conn.ensure_handle(cs.HT_CONTACT, 'juliet') channel_properties[cs.CHANNEL + '.InitiatorID'] = 'juliet' channel_properties[cs.CHANNEL + '.InitiatorHandle'] = \ conn.ensure_handle(cs.HT_CONTACT, 'juliet') channel_properties[cs.CHANNEL + '.Requested'] = False channel_properties[cs.CHANNEL + '.FUTURE.Bundle'] = BUNDLE channel_properties[cs.CHANNEL + '.Interfaces'] = dbus.Array(signature='s') chan = SimulatedChannel(conn, channel_properties) chan.announce() # Again, there's a CDO e = q.expect('dbus-signal', path=cs.CD_PATH, interface=cs.CD_IFACE_OP_LIST, signal='NewDispatchOperation') cdo_path = e.args[0] cdo_properties = e.args[1] assert cdo_properties[cs.CDO + '.Account'] == account.object_path assert cdo_properties[cs.CDO + '.Connection'] == conn.object_path assert cs.CDO + '.Interfaces' in cdo_properties handlers = cdo_properties[cs.CDO + '.PossibleHandlers'][:] # The handler with BypassApproval is first assert handlers[0] == bypass.bus_name # The other two handlers are still possibilities assert len(handlers) == 3 # Observers are invoked as usual e, k = q.expect_many( EventPattern('dbus-method-call', path=empathy.object_path, interface=cs.OBSERVER, method='ObserveChannels', handled=False), EventPattern('dbus-method-call', path=kopete.object_path, interface=cs.OBSERVER, method='ObserveChannels', handled=False), ) assert e.args[0] == account.object_path, e.args assert e.args[1] == conn.object_path, e.args assert e.args[3] == cdo_path, e.args assert e.args[4] == [], e.args # no requests satisfied channels = e.args[2] assert len(channels) == 1, channels assert channels[0][0] == chan.object_path, channels assert channels[0][1] == channel_properties, channels assert k.args == e.args # Both Observers indicate that they are ready to proceed q.dbus_return(k.message, signature='') q.dbus_return(e.message, signature='') # Empathy's BypassApproval part is asked to handle the channels e = q.expect('dbus-method-call', path=bypass.object_path, interface=cs.HANDLER, method='HandleChannels', handled=False) # Empathy accepts the channels q.dbus_return(e.message, signature='') if __name__ == '__main__': exec_test(test, {}) telepathy-mission-control-5.16.4/tests/twisted/mcp-account-diversion.c0000644000175000017500000001510112735242352027222 0ustar00gkiagiagkiagia00000000000000/* * A demonstration plugin that diverts account storage to an alternate location. * * Copyright © 2010 Nokia Corporation * Copyright © 2010 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include #define DONT_DIVERT "fakecm/fakeprotocol/dontdivert" #define CONFFILE "mcp-test-diverted-account-plugin.conf" #define PLUGIN_NAME "diverted-keyfile" #define PLUGIN_PRIORITY MCP_ACCOUNT_STORAGE_PLUGIN_PRIO_NORMAL #define PLUGIN_DESCRIPTION \ "Test plugin that grabs all accounts it receives (except '" \ DONT_DIVERT "*') and diverts them to '" CONFFILE \ "' in g_get_user_cache_dir () instead of the usual location." #define DEBUG g_debug typedef struct { GObject parent; GKeyFile *keyfile; gboolean save; gboolean loaded; } AccountDiversionPlugin; typedef struct { GObjectClass parent_class; } AccountDiversionPluginClass; GType account_diversion_plugin_get_type (void) G_GNUC_CONST; static void account_storage_iface_init (McpAccountStorageIface *, gpointer); #define ACCOUNT_DIVERSION_PLUGIN(o) \ (G_TYPE_CHECK_INSTANCE_CAST ((o), account_diversion_plugin_get_type (), \ AccountDiversionPlugin)) G_DEFINE_TYPE_WITH_CODE (AccountDiversionPlugin, account_diversion_plugin, G_TYPE_OBJECT, G_IMPLEMENT_INTERFACE (MCP_TYPE_ACCOUNT_STORAGE, account_storage_iface_init)); static void account_diversion_plugin_init (AccountDiversionPlugin *self) { DEBUG ("account_diversion_plugin_init"); self->keyfile = g_key_file_new (); self->save = FALSE; self->loaded = FALSE; } static void account_diversion_plugin_class_init (AccountDiversionPluginClass *cls) { DEBUG ("account_diversion_plugin_class_init"); } static gchar * _conf_filename (void) { static gchar *file = NULL; if (file == NULL) { const gchar *dir = g_get_user_cache_dir (); file = g_build_path (G_DIR_SEPARATOR_S, dir, CONFFILE, NULL); } return file; } static gboolean _have_config (void) { const gchar *file = _conf_filename (); DEBUG ("checking for %s", file); return g_file_test (file, G_FILE_TEST_EXISTS); } static void _create_config (void) { gchar *file = _conf_filename (); gchar *dir = g_path_get_dirname (file); g_mkdir_with_parents (dir, 0700); g_free (dir); g_file_set_contents (file, "# diverted accounts\n", -1, NULL); DEBUG ("created %s", file); } static gboolean _set (const McpAccountStorage *self, const McpAccountManager *am, const gchar *account, const gchar *key, const gchar *val) { AccountDiversionPlugin *adp = ACCOUNT_DIVERSION_PLUGIN (self); if (g_str_has_prefix (account, DONT_DIVERT)) return FALSE; adp->save = TRUE; g_key_file_set_value (adp->keyfile, account, key, val); return TRUE; } static gboolean _get (const McpAccountStorage *self, const McpAccountManager *am, const gchar *account, const gchar *key) { AccountDiversionPlugin *adp = ACCOUNT_DIVERSION_PLUGIN (self); if (key != NULL) { gchar *v = g_key_file_get_value (adp->keyfile, account, key, NULL); if (v == NULL) return FALSE; mcp_account_manager_set_value (am, account, key, v); g_free (v); } else { gsize i; gsize n; GStrv keys = g_key_file_get_keys (adp->keyfile, account, &n, NULL); if (keys == NULL) n = 0; for (i = 0; i < n; i++) { gchar *v = g_key_file_get_value (adp->keyfile, account, keys[i], NULL); if (v != NULL) mcp_account_manager_set_value (am, account, keys[i], v); g_free (v); } g_strfreev (keys); } return TRUE; } static gboolean _delete (const McpAccountStorage *self, const McpAccountManager *am, const gchar *account, const gchar *key) { AccountDiversionPlugin *adp = ACCOUNT_DIVERSION_PLUGIN (self); if (key == NULL) { if (g_key_file_remove_group (adp->keyfile, account, NULL)) adp->save = TRUE; } else { gsize n; GStrv keys; if (g_key_file_remove_key (adp->keyfile, account, key, NULL)) adp->save = TRUE; keys = g_key_file_get_keys (adp->keyfile, account, &n, NULL); if (keys == NULL || n == 0) g_key_file_remove_group (adp->keyfile, account, NULL); g_strfreev (keys); } return TRUE; } static gboolean _commit (const McpAccountStorage *self, const McpAccountManager *am) { gsize n; gchar *data; AccountDiversionPlugin *adp = ACCOUNT_DIVERSION_PLUGIN (self); gboolean rval = FALSE; if (!adp->save) return TRUE; if (!_have_config ()) _create_config (); data = g_key_file_to_data (adp->keyfile, &n, NULL); rval = g_file_set_contents (_conf_filename (), data, n, NULL); adp->save = !rval; g_free (data); return rval; } static GList * _list (const McpAccountStorage *self, const McpAccountManager *am) { gsize i; gsize n; GStrv accounts; GList *rval = NULL; AccountDiversionPlugin *adp = ACCOUNT_DIVERSION_PLUGIN (self); if (!_have_config ()) _create_config (); if (!adp->loaded) adp->loaded = g_key_file_load_from_file (adp->keyfile, _conf_filename (), G_KEY_FILE_KEEP_COMMENTS, NULL); accounts = g_key_file_get_groups (adp->keyfile, &n); for (i = 0; i < n; i++) rval = g_list_prepend (rval, g_strdup (accounts[i])); g_strfreev (accounts); return rval; } static void account_storage_iface_init (McpAccountStorageIface *iface, gpointer unused G_GNUC_UNUSED) { iface->name = PLUGIN_NAME; iface->desc = PLUGIN_DESCRIPTION; iface->priority = PLUGIN_PRIORITY; iface->get = _get; iface->set = _set; iface->delete = _delete; iface->commit = _commit; iface->list = _list; } GObject * mcp_plugin_ref_nth_object (guint n) { DEBUG ("Initializing mcp-account-diversion-plugin (n=%u)", n); switch (n) { case 0: return g_object_new (account_diversion_plugin_get_type (), NULL); default: return NULL; } } telepathy-mission-control-5.16.4/tests/twisted/mc-debug-server.c0000644000175000017500000001563712735242352026016 0ustar00gkiagiagkiagia00000000000000/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 8 -*- */ /* * This file is part of mission-control * * Copyright (C) 2007-2009 Nokia Corporation * Copyright (C) 2009 Collabora Ltd. * * Contact: Naba Kumar * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * version 2.1 as published by the Free Software Foundation. * * This library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA * */ #include "config.h" #include #include #include #include #include #include #include #include "mcd-service.h" TpDBusDaemon *bus_daemon = NULL; static McdService *mcd = NULL; static gboolean the_end (gpointer data) { g_main_loop_quit (data); return FALSE; } static void on_abort (gpointer unused G_GNUC_UNUSED) { g_debug ("McdService aborted, unreffing it"); mcd_debug_print_tree (mcd); tp_clear_object (&mcd); } static gboolean delayed_abort (gpointer data G_GNUC_UNUSED) { g_message ("Aborting by popular request"); mcd_mission_abort ((McdMission *) mcd); return FALSE; } static gboolean billy_idle (gpointer user_data) { DBusMessage *reply = user_data; DBusConnection *connection = dbus_g_connection_get_connection ( tp_proxy_get_dbus_connection (bus_daemon)); if (!dbus_connection_send (connection, reply, NULL)) g_error ("Out of memory"); return FALSE; } #define MCD_SYSTEM_MEMORY_CONSERVED (1 << 1) #define MCD_SYSTEM_IDLE (1 << 5) static DBusHandlerResult dbus_filter_function (DBusConnection *connection, DBusMessage *message, void *user_data) { if (dbus_message_is_signal (message, DBUS_INTERFACE_LOCAL, "Disconnected") && !tp_strdiff (dbus_message_get_path (message), DBUS_PATH_LOCAL)) { /* MC initialization sets exit on disconnect - turn it off again, so we * get a graceful exit instead (to keep gcov happy) */ dbus_connection_set_exit_on_disconnect (connection, FALSE); g_message ("Got disconnected from the session bus"); mcd_mission_abort ((McdMission *) mcd); } else if (dbus_message_is_method_call (message, "org.freedesktop.Telepathy.MissionControl5.RegressionTests", "Abort")) { DBusMessage *reply; g_idle_add (delayed_abort, NULL); reply = dbus_message_new_method_return (message); if (reply == NULL || !dbus_connection_send (connection, reply, NULL)) g_error ("Out of memory"); dbus_message_unref (reply); return DBUS_HANDLER_RESULT_HANDLED; } else if (dbus_message_is_method_call (message, "org.freedesktop.Telepathy.MissionControl5.RegressionTests", "BillyIdle")) { /* Used to drive a souped-up version of sync_dbus(), where we need to * ensure that all idles have fired, on top of the D-Bus queue being * drained. */ DBusMessage *reply = dbus_message_new_method_return (message); GVariant *variant; GDBusConnection *system_bus; if (reply == NULL) g_error ("Out of memory"); /* Sync GDBus, too, to make sure we have received any pending * FakeNetworkMonitor messages. */ system_bus = g_bus_get_sync (G_BUS_TYPE_SYSTEM, NULL, NULL); g_assert (system_bus != NULL); variant = g_dbus_connection_call_sync (system_bus, "org.freedesktop.DBus", "/org/freedesktop/DBus", "org.freedesktop.DBus", "ListNames", NULL, NULL, G_DBUS_CALL_FLAGS_NONE, -1, NULL, NULL); g_assert (variant != NULL); g_variant_unref (variant); g_object_unref (system_bus); g_idle_add_full (G_PRIORITY_LOW, billy_idle, reply, (GDestroyNotify) dbus_message_unref); return DBUS_HANDLER_RESULT_HANDLED; } return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; } int main (int argc, char **argv) { GError *error = NULL; GDBusConnection *gdbus = NULL; DBusConnection *connection = NULL; int ret = 1; GMainLoop *teardown_loop; guint linger_time = 5; g_type_init (); g_set_application_name ("Mission Control regression tests"); mcd_debug_init (); tp_debug_set_flags (g_getenv ("MC_TP_DEBUG")); /* Not all warnings are fatal due to MC spamming warnings (fd.o #23486), * but GLib and GObject warnings are pretty serious */ g_log_set_fatal_mask ("GLib", G_LOG_FATAL_MASK | G_LOG_LEVEL_CRITICAL | G_LOG_LEVEL_WARNING); g_log_set_fatal_mask ("GLib-GObject", G_LOG_FATAL_MASK | G_LOG_LEVEL_CRITICAL | G_LOG_LEVEL_WARNING); gdbus = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, &error); if (gdbus == NULL) { g_warning ("%s", error->message); g_error_free (error); error = NULL; goto out; } g_dbus_connection_set_exit_on_close (gdbus, FALSE); bus_daemon = tp_dbus_daemon_dup (&error); if (bus_daemon == NULL) { g_warning ("%s", error->message); g_error_free (error); error = NULL; goto out; } /* It appears that dbus-glib registers a filter that wrongly returns * DBUS_HANDLER_RESULT_HANDLED for signals, so for *our* filter to have any * effect, we need to install it as soon as possible */ connection = dbus_g_connection_get_connection ( tp_proxy_get_dbus_connection (bus_daemon)); dbus_connection_add_filter (connection, dbus_filter_function, NULL, NULL); mcd = mcd_service_new (); /* Listen for suicide notification */ g_signal_connect_after (mcd, "abort", G_CALLBACK (on_abort), NULL); /* connect */ mcd_mission_connect (MCD_MISSION (mcd)); dbus_connection_set_exit_on_disconnect (connection, FALSE); mcd_service_run (MCD_OBJECT (mcd)); ret = 0; teardown_loop = g_main_loop_new (NULL, FALSE); if (g_getenv ("MC_LINGER_TIME") != NULL) { linger_time = g_ascii_strtoull (g_getenv ("MC_LINGER_TIME"), NULL, 10); } /* Keep running in the background until it's all over. This means valgrind * and refdbg can get complete information. */ g_timeout_add_seconds_full (G_PRIORITY_DEFAULT, linger_time, the_end, teardown_loop, (GDestroyNotify) g_main_loop_unref); g_main_loop_run (teardown_loop); out: if (connection != NULL) { dbus_connection_flush (connection); } tp_clear_object (&gdbus); tp_clear_object (&bus_daemon); dbus_shutdown (); g_message ("Exiting with %d", ret); return ret; } telepathy-mission-control-5.16.4/tests/twisted/telepathy/0000755000175000017500000000000012762352250024645 5ustar00gkiagiagkiagia00000000000000telepathy-mission-control-5.16.4/tests/twisted/telepathy/clients/0000755000175000017500000000000012762352250026306 5ustar00gkiagiagkiagia00000000000000telepathy-mission-control-5.16.4/tests/twisted/telepathy/clients/Logger.client0000644000175000017500000000056712735241312030731 0ustar00gkiagiagkiagia00000000000000[org.freedesktop.Telepathy.Client] Interfaces=org.freedesktop.Telepathy.Client.Observer [org.freedesktop.Telepathy.Client.Observer] Recover=true [org.freedesktop.Telepathy.Client.Observer.ObserverChannelFilter 0] org.freedesktop.Telepathy.Channel.ChannelType s=org.freedesktop.Telepathy.Channel.Type.RespawnObservers org.freedesktop.Telepathy.Channel.TargetHandleType u=1 telepathy-mission-control-5.16.4/tests/twisted/telepathy/clients/AbiWord.client0000644000175000017500000000137612735241312031040 0ustar00gkiagiagkiagia00000000000000[org.freedesktop.Telepathy.Client] Interfaces=org.freedesktop.Telepathy.Client.Handler [org.freedesktop.Telepathy.Client.Handler.HandlerChannelFilter 0] org.freedesktop.Telepathy.Channel.ChannelType s=org.freedesktop.Telepathy.Channel.Type.StreamTube org.freedesktop.Telepathy.Channel.TargetHandleType u=1 org.freedesktop.Telepathy.Channel.Type.StreamTube.Service s=x-abiword [org.freedesktop.Telepathy.Client.Handler.HandlerChannelFilter 1] org.freedesktop.Telepathy.Channel.ChannelType s=org.freedesktop.Telepathy.Channel.Type.StreamTube org.freedesktop.Telepathy.Channel.TargetHandleType u=2 org.freedesktop.Telepathy.Channel.Type.StreamTube.Service s=x-abiword [org.freedesktop.Telepathy.Client.Handler.Capabilities] com.example.Foo=true com.example.Bar=true telepathy-mission-control-5.16.4/tests/twisted/telepathy/clients/README0000644000175000017500000000024512735241312027163 0ustar00gkiagiagkiagia00000000000000This directory contains .clients files used by Mission Control when it is run by twisted test. $MC_CLIENTS_DIR is set to this directory in the twisted environment. telepathy-mission-control-5.16.4/tests/twisted/telepathy/managers/0000755000175000017500000000000012762352250026442 5ustar00gkiagiagkiagia00000000000000telepathy-mission-control-5.16.4/tests/twisted/telepathy/managers/fakecm.manager0000644000175000017500000000075112735241312031223 0ustar00gkiagiagkiagia00000000000000[ConnectionManager] BusName=com.example.FakeCM ObjectPath=/com/example/FakeCM/ConnectionManager [Protocol fakeprotocol] param-account=s register required param-password=s register required secret param-nickname=s register param-register=b param-com.example.Badgerable.Badgered=b dbus-property param-secret-mushroom=s param-snakes=u param-contrived-example=u default-register=0 default-com.example.Badgerable.Badgered=0 default-com.example.Badgerable.Episode=5 default-contrived-example=5 telepathy-mission-control-5.16.4/tests/twisted/telepathy/managers/onewitheverything.manager0000644000175000017500000000136112735241312033555 0ustar00gkiagiagkiagia00000000000000[Protocol serializable] # All the types for which telepathy-spec defines a serialization param-s=s required param-o=o param-b=b param-q=q param-u=u param-t=t param-n=n param-i=i param-x=x param-d=d param-as=as param-y=y [Protocol defaults] # All the types, plus a default for each param-s=s default-s=foo param-o=o default-o=/foo param-b=b default-b=true param-q=q default-q=1 param-u=u default-u=1 param-t=t default-t=1 param-n=n default-n=-1 param-i=i default-i=-1 param-x=x default-x=-1 param-d=d default-d=1.5 param-as=as default-as=foo;bar;baz; param-y=y default-y=1 [Protocol flags] # All the flags param-account=s required register param-name=s register param-key=s required register secret param-com.example.Badgerable.Badgers=s dbus-property telepathy-mission-control-5.16.4/tests/twisted/telepathy/managers/README0000644000175000017500000000024512735241312027317 0ustar00gkiagiagkiagia00000000000000This directory contains .manager files used by Mission Control when it is run by twisted test. $MC_MANAGER_DIR is set to this directory in the twisted environment. telepathy-mission-control-5.16.4/tests/twisted/capabilities/0000755000175000017500000000000012762352250025277 5ustar00gkiagiagkiagia00000000000000telepathy-mission-control-5.16.4/tests/twisted/capabilities/contact-caps.py0000644000175000017500000001376212735242352030242 0ustar00gkiagiagkiagia00000000000000# Copyright (C) 2009 Nokia Corporation # Copyright (C) 2009 Collabora Ltd. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA # 02110-1301 USA import dbus """Regression test for pushing clients' capabilities into a CM with ContactCapabilities (final version, which is the same as draft 2). """ import dbus import dbus.service from servicetest import EventPattern, tp_name_prefix, tp_path_prefix, \ call_async from mctest import exec_test, SimulatedConnection, SimulatedClient, \ create_fakecm_account, enable_fakecm_account, SimulatedChannel, \ expect_client_setup import constants as cs def test(q, bus, mc): forbidden = [ EventPattern('dbus-method-call', handled=False, interface=cs.CONN_IFACE_CAPS, method='AdvertiseCapabilities'), ] q.forbid_events(forbidden) # Two clients want to handle channels: MediaCall is running, and AbiWord # is activatable. # this must match the .client file abi_contact_fixed_properties = dbus.Dictionary({ cs.CHANNEL + '.ChannelType': cs.CHANNEL_TYPE_STREAM_TUBE, cs.CHANNEL + '.TargetHandleType': cs.HT_CONTACT, cs.CHANNEL_TYPE_STREAM_TUBE + '.Service': 'x-abiword', }, signature='sv') abi_room_fixed_properties = dbus.Dictionary({ cs.CHANNEL + '.ChannelType': cs.CHANNEL_TYPE_STREAM_TUBE, cs.CHANNEL + '.TargetHandleType': cs.HT_ROOM, cs.CHANNEL_TYPE_STREAM_TUBE + '.Service': 'x-abiword', }, signature='sv') media_fixed_properties = dbus.Dictionary({ cs.CHANNEL + '.ChannelType': cs.CHANNEL_TYPE_STREAMED_MEDIA, }, signature='sv') media_call = SimulatedClient(q, bus, 'MediaCall', observe=[], approve=[], handle=[media_fixed_properties], cap_tokens=[cs.CHANNEL_IFACE_MEDIA_SIGNALLING + '/ice-udp', cs.CHANNEL_IFACE_MEDIA_SIGNALLING + '/audio/speex', cs.CHANNEL_IFACE_MEDIA_SIGNALLING + '/video/theora'], bypass_approval=False) # wait for MC to download the properties expect_client_setup(q, [media_call]) def check_contact_caps(e): structs = e.args[0] filters = {} tokens = {} assert len(structs) == 3 for struct in structs: assert struct[0] not in filters filters[struct[0]] = sorted(struct[1]) tokens[struct[0]] = sorted(struct[2]) assert media_fixed_properties in filters[cs.CLIENT + '.MediaCall'] assert len(filters[cs.CLIENT + '.MediaCall']) == 1 assert abi_room_fixed_properties in filters[cs.CLIENT + '.AbiWord'] assert abi_contact_fixed_properties in filters[cs.CLIENT + '.AbiWord'] assert len(filters[cs.CLIENT + '.AbiWord']) == 2 assert len(tokens[cs.CLIENT + '.MediaCall']) == 3 assert cs.CHANNEL_IFACE_MEDIA_SIGNALLING + '/ice-udp' in \ tokens[cs.CLIENT + '.MediaCall'] assert cs.CHANNEL_IFACE_MEDIA_SIGNALLING + '/audio/speex' in \ tokens[cs.CLIENT + '.MediaCall'] assert cs.CHANNEL_IFACE_MEDIA_SIGNALLING + '/video/theora' in \ tokens[cs.CLIENT + '.MediaCall'] assert len(tokens[cs.CLIENT + '.AbiWord']) == 2 assert 'com.example.Foo' in tokens[cs.CLIENT + '.AbiWord'] assert 'com.example.Bar' in tokens[cs.CLIENT + '.AbiWord'] return True params = dbus.Dictionary({"account": "someguy@example.com", "password": "secrecy"}, signature='sv') cm_name_ref, account = create_fakecm_account(q, bus, mc, params) conn, before = enable_fakecm_account(q, bus, mc, account, params, extra_interfaces=[cs.CONN_IFACE_CONTACT_CAPS, cs.CONN_IFACE_CAPS], expect_before_connect=[ EventPattern('dbus-method-call', handled=False, interface=cs.CONN_IFACE_CONTACT_CAPS, method='UpdateCapabilities', predicate=check_contact_caps), ]) q.dbus_return(before.message, signature='') irssi_bus = dbus.bus.BusConnection() irssi_bus.set_exit_on_disconnect(False) # we'll disconnect later q.attach_to_bus(irssi_bus) irssi_fixed_properties = dbus.Dictionary({ cs.CHANNEL + '.ChannelType': cs.CHANNEL_TYPE_TEXT, cs.CHANNEL + '.TargetHandleType': cs.HT_ROOM, }, signature='sv') irssi = SimulatedClient(q, irssi_bus, 'Irssi', observe=[], approve=[], handle=[irssi_fixed_properties], cap_tokens=[], bypass_approval=False) # wait for MC to download the properties expect_client_setup(q, [irssi]) e = q.expect('dbus-method-call', handled=False, interface=cs.CONN_IFACE_CONTACT_CAPS, method='UpdateCapabilities') assert len(e.args[0]) == 1 struct = e.args[0][0] assert struct[0] == cs.CLIENT + '.Irssi' assert struct[1] == [irssi_fixed_properties] assert struct[2] == [] # When Irssi exits, the CM is told it has gone irssi.release_name() del irssi irssi_bus.flush() irssi_bus.close() e = q.expect('dbus-method-call', handled=False, interface=cs.CONN_IFACE_CONTACT_CAPS, method='UpdateCapabilities') assert len(e.args[0]) == 1 struct = e.args[0][0] assert struct[0] == cs.CLIENT + '.Irssi' assert struct[1] == [] assert struct[2] == [] if __name__ == '__main__': exec_test(test, {}) telepathy-mission-control-5.16.4/tests/twisted/README0000644000175000017500000000313312735241312023522 0ustar00gkiagiagkiagia00000000000000To run Twisted tests: make -C tests/twisted check-twisted To run an individual Twisted test: make -C tests/twisted check-twisted \ TWISTED_TESTS=dispatcher/create-at-startup.py Debug information (the test's own log, and Mission Control's log) is recorded in a subdirectory of tests-twisted whose name is based on the test's name, like tests/twisted/tmp-dispatcher_create-at-startup_py. The same tmp-* directory also contains the account data used in the test. If the test fails, its output will be sent to stdout. These directories are normally deleted after a test passes or is skipped, and kept for analysis if it fails. Set the environment variable MC_TEST_KEEP_TEMP to avoid deleting them. To debug an individual test you can set one of the following env variable: * MISSIONCONTROL_TEST_VALGRIND : to run Mission Control inside valgrind. The report is added to missioncontrol.log. You'll probably also want MC_TEST_KEEP_TEMP to keep the logs in tests/twisted/tmp-*, even when tests passed. * MISSIONCONTROL_TEST_REFDBG : to run Mission Control inside refdbg. The report is written to refdbg.log. You can change MISSIONCONTROL_WRAPPER to use an alternative refdbg and change REFDBG_OPTIONS to set your own parameters. Example: export MISSIONCONTROL_TEST_REFDBG=1 export MISSIONCONTROL_WRAPPER="/path/to/refdbg" export REFDBG_OPTIONS="btnum=16" * MISSIONCONTROL_WRAPPER="nemiver" : to run Mission Control inside the graphical debugger nemiver. You'll be able to set up breakpoints; then hit the "continue" button to launch Mission Control. telepathy-mission-control-5.16.4/tests/twisted/fakeclient.py0000644000175000017500000001032112735242352025323 0ustar00gkiagiagkiagia00000000000000# Copyright (C) 2009 Nokia Corporation # Copyright (C) 2009 Collabora Ltd. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA # 02110-1301 USA import dbus import dbus.service from servicetest import Event from servicetest import EventPattern, tp_name_prefix, tp_path_prefix client_iface = "org.freedesktop.Telepathy.Client" client_observer_iface = "org.freedesktop.Telepathy.Client.Observer" client_approver_iface = "org.freedesktop.Telepathy.Client.Approver" client_handler_iface = "org.freedesktop.Telepathy.Client.Handler" properties_iface = "org.freedesktop.DBus.Properties" empty_caps = dbus.Array([], signature='a{sv}') class FakeClient(dbus.service.Object): def __init__(self, object_path, q, bus, bus_name, nameref, caps = empty_caps): self.object_path = object_path self.q = q self.bus = bus self.bus_name = bus_name # keep a reference on nameref, otherwise, the name will be lost! self.nameref = nameref self.caps = caps dbus.service.Object.__init__(self, bus, object_path) @dbus.service.method(dbus_interface=properties_iface, in_signature='ss', out_signature='v') def Get(self, interface_name, property_name): self.q.append(Event('dbus-method-call', name="Get", obj=self, interface_name=interface_name, property_name=property_name)) if interface_name == client_iface and property_name == "Interfaces": return dbus.Array([ client_observer_iface, client_approver_iface, client_handler_iface ], signature='s') if interface_name == client_observer_iface and \ property_name == "ObserverChannelFilter": return empty_caps if interface_name == client_approver_iface and \ property_name == "ApproverChannelFilter": return empty_caps if interface_name == client_handler_iface and \ property_name == "HandlerChannelFilter": return self.caps print "Error: interface_name=%s property_name=%s" % \ (interface_name, property_name) return None @dbus.service.method(dbus_interface=properties_iface, in_signature='s', out_signature='a{sv}') def GetAll(self, interface_name): self.q.append(Event('dbus-method-call', name="GetAll", obj=self, interface_name=interface_name)) if interface_name == client_iface: return dbus.Dictionary({ 'Interfaces': dbus.Array([ client_observer_iface, client_approver_iface, client_handler_iface ]) }, signature='sv') return None @dbus.service.method(dbus_interface=client_handler_iface, in_signature='ooa(oa{sv})aot', out_signature='') def HandleChannels(self, account, connection, channels, requests_satisfied, user_action_time): self.q.append(Event('dbus-method-call', name="HandleChannels", obj=self, account=account, connection=connection, channels=channels, requests_satisfied=requests_satisfied, user_action_time=user_action_time)) def start_fake_client(q, bus, bus_name, object_path, caps): nameref = dbus.service.BusName(bus_name, bus=bus) client = FakeClient(object_path, q, bus, bus_name, nameref, caps) return client telepathy-mission-control-5.16.4/tests/twisted/fakecm.py0000644000175000017500000002645412735242352024462 0ustar00gkiagiagkiagia00000000000000# Copyright (C) 2009 Nokia Corporation # Copyright (C) 2009 Collabora Ltd. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA # 02110-1301 USA import dbus import dbus.service from servicetest import Event from servicetest import EventPattern, tp_name_prefix, tp_path_prefix from twisted.internet import reactor properties_iface = "org.freedesktop.DBus.Properties" cm_iface = "org.freedesktop.Telepathy.ConnectionManager" conn_iface = "org.freedesktop.Telepathy.Connection" caps_iface = \ "org.freedesktop.Telepathy.Connection.Interface.ContactCapabilities.DRAFT" requests_iface = "org.freedesktop.Telepathy.Connection.Interface.Requests" channel_iface = "org.freedesktop.Telepathy.Channel" class FakeChannel(dbus.service.Object): def __init__(self, conn, object_path, q, bus, nameref, props): self.conn = conn self.object_path = object_path self.q = q self.bus = bus # keep a reference on nameref, otherwise, the name will be lost! self.nameref = nameref self.props = props if channel_iface + '.TargetHandle' not in props: self.props[channel_iface + '.TargetHandle'] = \ self.conn.get_handle(props[channel_iface + '.TargetID']) dbus.service.Object.__init__(self, bus, object_path) def called(self, method): self.q.append(Event('dbus-method-call', name=method, obj=self, path=self.object_path)) @dbus.service.method(dbus_interface=channel_iface, in_signature='', out_signature='as') def GetInterfaces(self): self.called('GetInterfaces') return [self.props[channel_iface + '.ChannelType']] @dbus.service.method(dbus_interface=channel_iface, in_signature='', out_signature='u') def GetHandle(self): return self.props[channel_iface + '.TargetHandle'] @dbus.service.method(dbus_interface=channel_iface, in_signature='', out_signature='') def Close(self): self.Closed() @dbus.service.signal(dbus_interface=channel_iface, signature='') def Closed(self): pass class FakeConn(dbus.service.Object): def __init__(self, object_path, q, bus, nameref): self.object_path = object_path self.q = q self.bus = bus # keep a reference on nameref, otherwise, the name will be lost! self.nameref = nameref self.status = 2 # Connection_Status_Disconnected self.next_channel_id = 1 self.channels = [] self.handles = {} self.next_handle = 1337 # break people depending on SelfHandle == 1 dbus.service.Object.__init__(self, bus, object_path) # interface Connection @dbus.service.method(dbus_interface=conn_iface, in_signature='', out_signature='') def Connect(self): self.StatusChanged(1, 1) self.StatusChanged(0, 1) self.q.append(Event('dbus-method-call', name="Connect", obj=self, path=self.object_path)) return None @dbus.service.method(dbus_interface=conn_iface, in_signature='', out_signature='as') def GetInterfaces(self): self.q.append(Event('dbus-method-call', name="GetInterfaces", obj=self, path=self.object_path)) return dbus.Array([conn_iface, caps_iface, requests_iface]) def get_handle(self, id): for handle, id_ in self.handles.iteritems(): if id_ == id: return handle handle = self.next_handle self.next_handle += 1 self.handles[handle] = id return handle @dbus.service.method(dbus_interface=conn_iface, in_signature='', out_signature='u') def GetSelfHandle(self): self.q.append(Event('dbus-method-call', name="GetSelfHandle", obj=self, path=self.object_path)) return self.get_handle('fakeaccount') @dbus.service.method(dbus_interface=conn_iface, in_signature='', out_signature='u') def GetStatus(self): self.q.append(Event('dbus-method-call', name="GetStatus", obj=self, path=self.object_path)) return self.status @dbus.service.method(dbus_interface=conn_iface, in_signature='uau', out_signature='as') def InspectHandles(self, handle_type, handles): self.q.append(Event('dbus-method-call', name="InspectHandles", obj=self, path=self.object_path, handle_type=handle_type, handles=handles)) if handle_type != 1: raise "non-contact handles don't exist" ret = [] for handle in handles: if handle not in self.handles: raise "%d is not a valid handle" % handle ret.append(self.handles[handle]) return ret @dbus.service.method(dbus_interface=conn_iface, in_signature='uas', out_signature='au') def RequestHandles(self, type, ids): if type != 1: raise "non-contact handles don't exist" ret = [] for id in ids: ret.append(self.get_handle(id)) return ret @dbus.service.signal(dbus_interface=conn_iface, signature='uu') def StatusChanged(self, status, reason): self.status = status # interface Connection.Interface.ContactCapabilities.DRAFT @dbus.service.method(dbus_interface=caps_iface, in_signature='aa{sv}', out_signature='') def SetSelfCapabilities(self, caps): self.q.append(Event('dbus-method-call', name="SetSelfCapabilities", obj=self, path=self.object_path, caps=caps)) return None @dbus.service.signal(dbus_interface=requests_iface, signature='a(oa{sv})') def NewChannels(self, array): self.channels = self.channels + array @dbus.service.signal(dbus_interface=conn_iface, signature='osuub') def NewChannel(self, object_path, channel_type, handle_type, handle, suppress_handle): pass @dbus.service.method(dbus_interface=properties_iface, in_signature='ss', out_signature='v') def Get(self, interface_name, property_name): self.q.append(Event('dbus-method-call', name="Get", obj=self, interface_name=interface_name, property_name=property_name)) if interface_name == requests_iface and \ property_name == "Channels": return dbus.Array(self.channels, signature='(oa{sv})') print "Error: interface_name=%s property_name=%s" % \ (interface_name, property_name) return None @dbus.service.method(dbus_interface=properties_iface, in_signature='s', out_signature='a{sv}') def GetAll(self, interface_name): self.q.append(Event('dbus-method-call', name="GetAll", obj=self, interface_name=interface_name)) if interface_name == conn_iface: return dbus.Dictionary({ 'SelfHandle': 0L }, signature='sv') if interface_name == requests_iface: return dbus.Dictionary({ 'Channels': dbus.Array(self.channels, signature='(oa{sv})') }, signature='sv') return None def new_incoming_channel(self, object_path, asv): self.NewChannels(dbus.Array([(object_path, asv)], signature='(oa{sv})')) self.NewChannel(object_path, asv['org.freedesktop.Telepathy.Channel.ChannelType'], asv['org.freedesktop.Telepathy.Channel.TargetHandleType'], asv['org.freedesktop.Telepathy.Channel.TargetHandle'], False) # interface Connection.Interface.Requests def make_channel(self, props): path = self.object_path + "/channel%d" % self.next_channel_id self.next_channel_id += 1 chan = FakeChannel(self, path, self.q, self.bus, self.nameref, props) reactor.callLater(0, self.NewChannels, [(chan, props)]) return chan @dbus.service.method(dbus_interface=requests_iface, in_signature='a{sv}', out_signature='oa{sv}') def CreateChannel(self, request): self.q.append(Event('dbus-method-call', name="CreateChannel", obj=self, interface_name=requests_iface)) chan = self.make_channel(request) return (chan, request) @dbus.service.method(dbus_interface=requests_iface, in_signature='a{sv}', out_signature='boa{sv}') def EnsureChannel(self, request): self.q.append(Event('dbus-method-call', name="EnsureChannel", obj=self, interface_name=requests_iface)) chan = self.make_channel(request) self.q return (True, chan, request) @dbus.service.signal(dbus_interface=requests_iface, signature="o") def ChannelClosed(self, channel): pass class FakeCM(dbus.service.Object): def __init__(self, object_path, q, bus, bus_name, nameref): self.object_path = object_path self.q = q self.bus = bus self.bus_name = bus_name # keep a reference on nameref, otherwise, the name will be lost! self.nameref = nameref dbus.service.Object.__init__(self, bus, object_path) @dbus.service.method(dbus_interface=cm_iface, in_signature='s', out_signature='a(susv)') def GetParameters(self, protocol): self.q.append(Event('dbus-method-call', name="GetParameters", protocol=protocol, obj=self)) return [] @dbus.service.method(dbus_interface=cm_iface, in_signature='', out_signature='as') def ListProtocols(self, protocol): self.q.append(Event('dbus-method-call', name="ListProtocols", obj=self)) return ['fakeprotocol'] @dbus.service.method(dbus_interface=cm_iface, in_signature='sa{sv}', out_signature='so') def RequestConnection(self, protocol, parameters): conn_path = tp_path_prefix + "/Connection/fakecm/fakeprotocol/conn1" conn = FakeConn(conn_path, self.q, self.bus, self.nameref) self.q.append(Event('dbus-method-call', name="RequestConnection", protocol=protocol, parameters=parameters, conn=conn, obj=self)) return [self.bus_name, conn_path] def start_fake_connection_manager(q, bus, bus_name, object_path): nameref = dbus.service.BusName(bus_name, bus=bus) cm = FakeCM(object_path, q, bus, bus_name, nameref) return cm telepathy-mission-control-5.16.4/tests/twisted/account-manager/0000755000175000017500000000000012762352250025712 5ustar00gkiagiagkiagia00000000000000telepathy-mission-control-5.16.4/tests/twisted/account-manager/create-twice.py0000644000175000017500000000416612735242352030650 0ustar00gkiagiagkiagia00000000000000# Copyright (C) 2009 Nokia Corporation # Copyright (C) 2009-2010 Collabora Ltd. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA # 02110-1301 USA import dbus import dbus import dbus.service from servicetest import EventPattern, tp_name_prefix, tp_path_prefix, \ call_async from mctest import exec_test, create_fakecm_account, get_account_manager import constants as cs def test(q, bus, mc): account_manager = get_account_manager(bus) account_manager_iface = dbus.Interface(account_manager, cs.AM) # fd.o #25684: creating similarly-named accounts in very quick succession # used to fail params = dbus.Dictionary({"account": "create-twice", "password": "secrecy"}, signature='sv') cm_name_ref = dbus.service.BusName(cs.tp_name_prefix + '.ConnectionManager.fakecm', bus=bus) account_manager = bus.get_object(cs.AM, cs.AM_PATH) am_iface = dbus.Interface(account_manager, cs.AM) call_async(q, am_iface, 'CreateAccount', 'fakecm', 'fakeprotocol', 'fakeaccount', params, {}) call_async(q, am_iface, 'CreateAccount', 'fakecm', 'fakeprotocol', 'fakeaccount', params, {}) ret1 = q.expect('dbus-return', method='CreateAccount') ret2 = q.expect('dbus-return', method='CreateAccount') path1 = ret1.value[0] path2 = ret2.value[0] assert path1 != path2 if __name__ == '__main__': exec_test(test, {}) telepathy-mission-control-5.16.4/tests/twisted/account-manager/server-drops-us.py0000644000175000017500000001114712735242352031351 0ustar00gkiagiagkiagia00000000000000# Copyright (C) 2009 Nokia Corporation # Copyright (C) 2009 Collabora Ltd. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA # 02110-1301 USA import dbus import dbus import dbus.service from servicetest import EventPattern, tp_name_prefix, tp_path_prefix, \ call_async, sync_dbus, TimeoutError from mctest import exec_test, SimulatedConnection, create_fakecm_account,\ SimulatedChannel import constants as cs params = dbus.Dictionary({"account": "someguy@example.com", "password": "secrecy"}, signature='sv') def test(q, bus, mc): cm_name_ref = dbus.service.BusName( tp_name_prefix + '.ConnectionManager.fakecm', bus=bus) # Create an account (cm_name_ref, account) = create_fakecm_account(q, bus, mc, params) account_iface = dbus.Interface(account, cs.ACCOUNT) account_props = dbus.Interface(account, cs.PROPERTIES_IFACE) call_async(q, account, 'Set', cs.ACCOUNT, 'Enabled', False, dbus_interface=cs.PROPERTIES_IFACE) q.expect('dbus-return', method='Set') # Enable the account call_async(q, account, 'Set', cs.ACCOUNT, 'Enabled', True, dbus_interface=cs.PROPERTIES_IFACE) # Set online presence presence = dbus.Struct((dbus.UInt32(cs.PRESENCE_TYPE_BUSY), 'busy', 'Fixing MC bugs'), signature='uss') call_async(q, account, 'Set', cs.ACCOUNT, 'RequestedPresence', presence, dbus_interface=cs.PROPERTIES_IFACE) e = q.expect('dbus-method-call', method='RequestConnection', args=['fakeprotocol', params], destination=tp_name_prefix + '.ConnectionManager.fakecm', path=tp_path_prefix + '/ConnectionManager/fakecm', interface=tp_name_prefix + '.ConnectionManager', handled=False) conn = SimulatedConnection(q, bus, 'fakecm', 'fakeprotocol', '_', 'myself', has_presence=True) q.dbus_return(e.message, conn.bus_name, conn.object_path, signature='so') # MC calls GetStatus (maybe) and then Connect q.expect('dbus-method-call', method='Connect', path=conn.object_path, handled=True) # Connect succeeds conn.StatusChanged(cs.CONN_STATUS_CONNECTED, cs.CONN_STATUS_REASON_NONE) conn = drop_and_expect_reconnect(q, bus, conn) conn = drop_and_expect_reconnect(q, bus, conn) conn = drop_and_expect_reconnect(q, bus, conn) forbidden = [EventPattern('dbus-method-call', method='RequestConnection')] q.forbid_events(forbidden) # Connection falls over for a miscellaneous reason conn.StatusChanged(cs.CONN_STATUS_DISCONNECTED, cs.CONN_STATUS_REASON_NETWORK_ERROR) # Right, that's it, I'm giving up... # This test can be considered to have succeeded if we don't # RequestConnection again before the test fails due to timeout. try: q.expect('the end of the world') except TimeoutError: return else: raise AssertionError('An impossible event happened') def drop_and_expect_reconnect(q, bus, conn): # Connection falls over for a miscellaneous reason conn.StatusChanged(cs.CONN_STATUS_DISCONNECTED, cs.CONN_STATUS_REASON_NETWORK_ERROR) # MC reconnects e = q.expect('dbus-method-call', method='RequestConnection', args=['fakeprotocol', params], destination=tp_name_prefix + '.ConnectionManager.fakecm', path=tp_path_prefix + '/ConnectionManager/fakecm', interface=tp_name_prefix + '.ConnectionManager', handled=False) conn = SimulatedConnection(q, bus, 'fakecm', 'fakeprotocol', '_', 'myself', has_presence=True) q.dbus_return(e.message, conn.bus_name, conn.object_path, signature='so') # MC calls GetStatus (maybe) and then Connect q.expect('dbus-method-call', method='Connect', path=conn.object_path, handled=True) # Connect succeeds conn.StatusChanged(cs.CONN_STATUS_CONNECTED, cs.CONN_STATUS_REASON_NONE) return conn if __name__ == '__main__': exec_test(test, {}) telepathy-mission-control-5.16.4/tests/twisted/account-manager/service.py0000644000175000017500000001052212735242352027725 0ustar00gkiagiagkiagia00000000000000# Copyright (C) 2010 Nokia Corporation # Copyright (C) 2010 Collabora Ltd. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA # 02110-1301 USA import dbus import dbus import dbus.service from servicetest import EventPattern, tp_name_prefix, call_async, assertEquals from mctest import exec_test, create_fakecm_account import constants as cs def test(q, bus, mc): params = dbus.Dictionary({"account": "wjt@example.com", "password": "secrecy"}, signature='sv') (cm_name_ref, account) = create_fakecm_account(q, bus, mc, params) srv_name = 'fu-bar-42' account_iface = dbus.Interface(account, cs.ACCOUNT) account_props = dbus.Interface(account, cs.PROPERTIES_IFACE) # defaults to the empty string assertEquals(account_props.Get(cs.ACCOUNT, 'Service'), ''); # set to a new value after creation call_async(q, account_props, 'Set', cs.ACCOUNT, 'Service', srv_name); q.expect_many( EventPattern('dbus-signal', path=account.object_path, signal='AccountPropertyChanged', interface=cs.ACCOUNT, args=[{'Service': srv_name}]), EventPattern('dbus-return', method='Set'), ) assertEquals(account_props.Get(cs.ACCOUNT, 'Service'), srv_name) # set to an invalid value (no actual change should occur) # leading non-alphabetic (make sure _ isn't considered alphabetic) call_async(q, account_props, 'Set', cs.ACCOUNT, 'Service', '_fu-bar'); q.expect_many(EventPattern('dbus-error', method='Set')) assertEquals(account_props.Get(cs.ACCOUNT, 'Service'), srv_name) # leading non-alphabetic call_async(q, account_props, 'Set', cs.ACCOUNT, 'Service', '.moose'); q.expect_many(EventPattern('dbus-error', method='Set')) assertEquals(account_props.Get(cs.ACCOUNT, 'Service'), srv_name) # gregexes have an option to be lenient about trailing newlines: # this makes sure we haven't made that mistake call_async(q, account_props, 'Set', cs.ACCOUNT, 'Service', srv_name + '\n'); q.expect_many(EventPattern('dbus-error', method='Set')) assertEquals(account_props.Get(cs.ACCOUNT, 'Service'), srv_name) # set to an empty string call_async(q, account_props, 'Set', cs.ACCOUNT, 'Service', ''); q.expect_many(EventPattern('dbus-return', method='Set')) assertEquals(account_props.Get(cs.ACCOUNT, 'Service'), '') # test creation with a service account_manager = bus.get_object(cs.AM, cs.AM_PATH) am_iface = dbus.Interface(account_manager, cs.AM) service_prop = dbus.Dictionary({ cs.ACCOUNT + '.Service': "moomin-troll", }, signature='sv') call_async(q, am_iface, 'CreateAccount', 'fakecm', # Connection_Manager 'fakeprotocol', # Protocol 'fakeaccount', # Display_Name params, # Parameters service_prop, # Properties ) ret = q.expect('dbus-return', method='CreateAccount') path = ret.value[0] account = bus.get_object(cs.tp_name_prefix + '.AccountManager', path) if_props = dbus.Interface(account, cs.PROPERTIES_IFACE) props = if_props.GetAll(cs.ACCOUNT) assertEquals(props.get('Service'), 'moomin-troll') # attempt creation with a bogus service service_prop = dbus.Dictionary({cs.ACCOUNT + '.Service': "1337"}, signature='sv') call_async(q, am_iface, 'CreateAccount', 'fakecm', # Connection_Manager 'fakeprotocol', # Protocol 'fakeaccount', # Display_Name params, # Parameters service_prop, # Properties ) ret = q.expect('dbus-error', method='CreateAccount') if __name__ == '__main__': exec_test(test, {}) telepathy-mission-control-5.16.4/tests/twisted/account-manager/create-with-properties.py0000644000175000017500000001466312735242352032705 0ustar00gkiagiagkiagia00000000000000# Copyright (C) 2009 Nokia Corporation # Copyright (C) 2009-2012 Collabora Ltd. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA # 02110-1301 USA import dbus import dbus import dbus.service from servicetest import EventPattern, tp_name_prefix, tp_path_prefix, \ call_async, assertEquals, assertContains from mctest import exec_test, create_fakecm_account, AccountManager import constants as cs def test(q, bus, mc): account_manager = AccountManager(bus) # Check AccountManager has D-Bus property interface call_async(q, account_manager.Properties, 'GetAll', cs.AM) properties, = q.expect('dbus-return', method='GetAll').value assert properties is not None assert properties.get('ValidAccounts') == [], \ properties.get('ValidAccounts') assert properties.get('InvalidAccounts') == [], \ properties.get('InvalidAccounts') interfaces = properties.get('Interfaces') supported = properties.get('SupportedAccountProperties') assert (cs.ACCOUNT + '.AutomaticPresence') in supported assert (cs.ACCOUNT + '.Enabled') in supported assert (cs.ACCOUNT + '.Icon') in supported assert (cs.ACCOUNT + '.Nickname') in supported assert (cs.ACCOUNT + '.ConnectAutomatically') in supported assert (cs.ACCOUNT_IFACE_AVATAR + '.Avatar') in supported assert (cs.ACCOUNT_IFACE_NOKIA_CONDITIONS + '.Condition') in supported assert (cs.ACCOUNT + '.RequestedPresence') in supported assert (cs.ACCOUNT + '.Supersedes') in supported assertContains(cs.ACCOUNT + '.Service', supported) params = dbus.Dictionary({"account": "anarki@example.com", "password": "secrecy"}, signature='sv') cm_name_ref = dbus.service.BusName(cs.tp_name_prefix + '.ConnectionManager.fakecm', bus=bus) creation_properties = dbus.Dictionary({ cs.ACCOUNT + '.Enabled': True, cs.ACCOUNT + '.AutomaticPresence': dbus.Struct(( dbus.UInt32(cs.PRESENCE_TYPE_BUSY), 'busy', 'Exploding'), signature='uss'), cs.ACCOUNT + '.RequestedPresence': dbus.Struct(( dbus.UInt32(cs.PRESENCE_TYPE_AWAY), 'away', 'Respawning'), signature='uss'), cs.ACCOUNT + '.Icon': 'quake3arena', cs.ACCOUNT + '.Nickname': 'AnArKi', cs.ACCOUNT + '.ConnectAutomatically': True, cs.ACCOUNT_IFACE_AVATAR + '.Avatar': (dbus.ByteArray('foo'), 'image/jpeg'), cs.ACCOUNT_IFACE_NOKIA_CONDITIONS + '.Condition': dbus.Dictionary({ 'has-quad-damage': ':y' }, signature='ss'), cs.ACCOUNT + '.Supersedes': dbus.Array([ cs.ACCOUNT_PATH_PREFIX + 'q1/q1/Ranger', cs.ACCOUNT_PATH_PREFIX + 'q2/q2/Grunt', ], signature='o'), cs.ACCOUNT + '.Service': 'arena', }, signature='sv') call_async(q, account_manager, 'CreateAccount', 'fakecm', 'fakeprotocol', 'fakeaccount', params, creation_properties) # The spec has no order guarantee here. # FIXME: MC ought to also introspect the CM and find out that the params # are in fact sufficient am_signal, ret, rc = q.expect_many( EventPattern('dbus-signal', path=cs.AM_PATH, signal='AccountValidityChanged', interface=cs.AM), EventPattern('dbus-return', method='CreateAccount'), EventPattern('dbus-method-call', method='RequestConnection'), ) account_path = ret.value[0] assert am_signal.args == [account_path, True], am_signal.args assert account_path is not None account = bus.get_object( cs.tp_name_prefix + '.AccountManager', account_path) account_props = dbus.Interface(account, cs.PROPERTIES_IFACE) properties = account_props.GetAll(cs.ACCOUNT) assert properties.get('AutomaticPresence') == (cs.PRESENCE_TYPE_BUSY, 'busy', 'Exploding'), \ properties.get('AutomaticPresence') assert properties.get('RequestedPresence') == (cs.PRESENCE_TYPE_AWAY, 'away', 'Respawning'), \ properties.get('RequestedPresence') assert properties.get('ConnectAutomatically') == True, \ properties.get('ConnectAutomatically') assert properties.get('Enabled') == True, \ properties.get('Enabled') assert properties.get('Valid') == True, \ properties.get('Valid') assert properties.get('Icon') == 'quake3arena', \ properties.get('Icon') assert properties.get('Nickname') == 'AnArKi', \ properties.get('Nickname') assertEquals( dbus.Array([ cs.ACCOUNT_PATH_PREFIX + 'q1/q1/Ranger', cs.ACCOUNT_PATH_PREFIX + 'q2/q2/Grunt', ], signature='o'), properties.get('Supersedes')) assertEquals('arena', properties.get('Service')) properties = account_props.GetAll(cs.ACCOUNT_IFACE_AVATAR) assert properties.get('Avatar') == ([ord('f'), ord('o'), ord('o')], 'image/jpeg') properties = account_props.GetAll(cs.ACCOUNT_IFACE_NOKIA_CONDITIONS) assert properties.get('Condition') == { 'has-quad-damage': ':y', } # tests for errors when creating an account creation_properties2 = creation_properties.copy() creation_properties2[cs.ACCOUNT + '.NonExistent'] = 'foo' call_async(q, account_manager, 'CreateAccount', 'fakecm', 'fakeprotocol', 'fakeaccount', params, creation_properties2) q.expect('dbus-error', method='CreateAccount') params2 = params.copy() params2['fake_param'] = 'foo' call_async(q, account_manager, 'CreateAccount', 'fakecm', 'fakeprotocol', 'fakeaccount', params2, creation_properties) q.expect('dbus-error', method='CreateAccount') if __name__ == '__main__': exec_test(test, {}) telepathy-mission-control-5.16.4/tests/twisted/account-manager/crashy-cm.py0000644000175000017500000000626312735242352030162 0ustar00gkiagiagkiagia00000000000000# vim: set fileencoding=utf-8 : # # crashy-cm: tests that MC sets at least moderately-useful error information on # accounts when they're disconnected due to the CM crashing. # # Copyright © 2011 Collabora Ltd. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA # 02110-1301 USA import dbus from servicetest import ( tp_name_prefix, tp_path_prefix, assertEquals, ) from mctest import ( exec_test, create_fakecm_account, SimulatedConnection, ) import constants as cs def test(q, bus, mc): cm_bus = dbus.bus.BusConnection() cm_bus.set_exit_on_disconnect(False) # we'll disconnect later q.attach_to_bus(cm_bus) params = dbus.Dictionary( {"account": "someguy@example.com", "password": "secrecy", }, signature='sv') (cm_name_ref, account) = create_fakecm_account(q, bus, mc, params, cm_bus=cm_bus) account.Properties.Set(cs.ACCOUNT, 'Enabled', True) # Set online presence presence = dbus.Struct( (dbus.UInt32(cs.PRESENCE_TYPE_BUSY), 'busy', 'Fixing MC bugs'), signature='uss') account.Properties.Set(cs.ACCOUNT, 'RequestedPresence', presence) e = q.expect('dbus-method-call', method='RequestConnection', args=['fakeprotocol', params], destination=tp_name_prefix + '.ConnectionManager.fakecm', path=tp_path_prefix + '/ConnectionManager/fakecm', interface=tp_name_prefix + '.ConnectionManager', handled=False) conn = SimulatedConnection(q, cm_bus, 'fakecm', 'fakeprotocol', '_', 'myself', has_presence=True) q.dbus_return(e.message, conn.bus_name, conn.object_path, signature='so') q.expect('dbus-method-call', method='Connect', path=conn.object_path, handled=True) # Connect succeeds conn.StatusChanged(cs.CONN_STATUS_CONNECTED, cs.CONN_STATUS_REASON_NONE) # CM crashes conn.release_name() del cm_name_ref cm_bus.flush() cm_bus.close() # MC should report the connection dying. e = q.expect('dbus-signal', signal='AccountPropertyChanged', predicate=lambda e: 'ConnectionError' in e.args[0]) changed, = e.args assertEquals('/', changed['Connection']) assertEquals(cs.CONN_STATUS_DISCONNECTED, changed['ConnectionStatus']) # In the absence of a better code, None will have to do. assertEquals(cs.CONN_STATUS_REASON_NONE, changed['ConnectionStatusReason']) # And NoReply will do as “it crashed”. assertEquals(cs.DBUS_ERROR_NO_REPLY, changed['ConnectionError']) if __name__ == '__main__': exec_test(test) telepathy-mission-control-5.16.4/tests/twisted/account-manager/connectivity.py0000644000175000017500000001520412735242352031005 0ustar00gkiagiagkiagia00000000000000# vim: set fileencoding=utf-8 : # Copyright © 2011 Collabora Ltd. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA # 02110-1301 USA import dbus import dbus.service from servicetest import ( EventPattern, call_async, sync_dbus, assertEquals, ) from mctest import ( exec_test, create_fakecm_account, expect_fakecm_connection, SimulatedConnection, ) import constants as cs import config def sync_connectivity_state(mc): # We cannot simply use sync_dbus here, because nm-glib reports property # changes in an idle (presumably to batch them all together). This is fine # and all that, but means we have to find a way to make sure MC has flushed # its idle queue to avoid this test being racy. (This isn't just # theoretical: this test failed about once per five runs when it used sync_dbus.) # # The test-specific version of MC implements the 'BillyIdle' method, which # returns from a low-priority idle. mc.BillyIdle(dbus_interface='org.freedesktop.Telepathy.MissionControl5.RegressionTests') def test(q, bus, mc): params = dbus.Dictionary( {"account": "yum yum network manager", "password": "boo boo connman (although your API *is* simpler)", }, signature='sv') (cm_name_ref, account) = create_fakecm_account(q, bus, mc, params) # While we're not connected to the internet, RequestConnection should not # be called. request_connection_event = [ EventPattern('dbus-method-call', method='RequestConnection'), ] q.forbid_events(request_connection_event) account.Properties.Set(cs.ACCOUNT, 'RequestedPresence', (dbus.UInt32(cs.PRESENCE_TYPE_BUSY), 'busy', 'hlaghalgh')) # Turn the account on, re-request an online presence, and even tell it to # connect automatically, to check that none of these make it sign in. call_async(q, account.Properties, 'Set', cs.ACCOUNT, 'Enabled', True) q.expect('dbus-return', method='Set') requested_presence = (dbus.UInt32(cs.PRESENCE_TYPE_BUSY), 'busy', 'gtfo') call_async(q, account.Properties, 'Set', cs.ACCOUNT, 'RequestedPresence', requested_presence) q.expect('dbus-return', method='Set') call_async(q, account.Properties, 'Set', cs.ACCOUNT, 'ConnectAutomatically', True) q.expect('dbus-return', method='Set') # (but actually let's turn ConnectAutomatically off: we want to check that # MC continues to try to apply RequestedPresence if the network connection # goes away and comes back again, regardless of this setting) call_async(q, account.Properties, 'Set', cs.ACCOUNT, 'ConnectAutomatically', False) q.expect('dbus-return', method='Set') sync_dbus(bus, q, mc) q.unforbid_events(request_connection_event) # Okay, I'm satisfied. Turn the network on. mc.connectivity.go_online() expect_fakecm_connection(q, bus, mc, account, params, has_presence=True, expect_before_connect=[ EventPattern('dbus-method-call', method='SetPresence', args=list(requested_presence[1:])), ]) if config.HAVE_NM: # If NetworkManager tells us that it is going to disconnect soon, # the connection should be banished. GNetworkMonitor can't tell us # that; either it's online or it isn't. mc.connectivity.go_indeterminate() q.expect('dbus-method-call', method='Disconnect') mc.connectivity.go_offline() sync_connectivity_state(mc) # When we turn the network back on, MC should try to sign us back on. # In the process, our RequestedPresence should not have been # trampled on, as below. mc.connectivity.go_online() expect_fakecm_connection(q, bus, mc, account, params, has_presence=True, expect_before_connect=[ EventPattern('dbus-method-call', method='SetPresence', args=list(requested_presence[1:])), ]) assertEquals(requested_presence, account.Properties.Get(cs.ACCOUNT, 'RequestedPresence')) # If we turn the network off, the connection should be banished. mc.connectivity.go_offline() q.expect('dbus-method-call', method='Disconnect') # When we turn the network back on, MC should try to sign us back on. mc.connectivity.go_online() e = q.expect('dbus-method-call', method='RequestConnection') # In the process, our RequestedPresence should not have been trampled on. # (Historically, MC would replace it with the AutomaticPresence, but that # behaviour was unexpected: if the user explicitly set a status or message, # why should the network connection cutting out and coming back up cause # that to be lost?) assertEquals(requested_presence, account.Properties.Get(cs.ACCOUNT, 'RequestedPresence')) # But if we get disconnected before RequestConnection returns, MC should # clean up the new connection when it does, rather than trying to sign it # in. connect_event = [ EventPattern('dbus-method-call', method='Connect'), ] q.forbid_events(connect_event) mc.connectivity.go_offline() # Make sure that MC has noticed that the network connection has gone away. sync_connectivity_state(mc) conn = SimulatedConnection(q, bus, 'fakecm', 'fakeprotocol', account.object_path.split('/')[-1], 'myself') q.dbus_return(e.message, conn.bus_name, conn.object_path, signature='so') q.expect('dbus-method-call', method='Disconnect') # So now the user gives up and sets their RequestedPresence to offline. # Because this account does not ConnectAutomatically, if the network # connection comes back up the account should not be brought back online. q.forbid_events(request_connection_event) account.Properties.Set(cs.ACCOUNT, 'RequestedPresence', (dbus.UInt32(cs.PRESENCE_TYPE_OFFLINE), 'offline', '')) mc.connectivity.go_online() # Make sure MC has noticed that the network connection has come back. sync_connectivity_state(mc) if __name__ == '__main__': exec_test(test, initially_online=False) telepathy-mission-control-5.16.4/tests/twisted/account-manager/enable-auto-connect.py0000644000175000017500000000526512735242352032120 0ustar00gkiagiagkiagia00000000000000# Copyright (C) 2009 Nokia Corporation # Copyright (C) 2009 Collabora Ltd. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA # 02110-1301 USA import dbus import dbus import dbus.service from servicetest import EventPattern, tp_name_prefix, tp_path_prefix, \ call_async from mctest import exec_test, create_fakecm_account import constants as cs def test(q, bus, mc): params = dbus.Dictionary({"account": "smcv@example.com", "password": "secrecy"}, signature='sv') (cm_name_ref, account) = create_fakecm_account(q, bus, mc, params) account_iface = dbus.Interface(account, cs.ACCOUNT) account_props = dbus.Interface(account, cs.PROPERTIES_IFACE) # Ensure that it's enabled but has offline RP call_async(q, account_props, 'Set', cs.ACCOUNT, 'RequestedPresence', (dbus.UInt32(cs.PRESENCE_TYPE_OFFLINE), 'offline', '')) q.expect('dbus-return', method='Set') call_async(q, account_props, 'Set', cs.ACCOUNT, 'AutomaticPresence', (dbus.UInt32(cs.PRESENCE_TYPE_BUSY), 'busy', 'Testing automatic presence')) q.expect('dbus-return', method='Set') q.expect('dbus-signal', signal='AccountPropertyChanged', predicate=lambda e: e.args[0].get('AutomaticPresence', (None, None, None))[1] == 'busy') call_async(q, account_props, 'Set', cs.ACCOUNT, 'Enabled', False) q.expect('dbus-return', method='Set') call_async(q, account_props, 'Set', cs.ACCOUNT, 'ConnectAutomatically', True) q.expect('dbus-return', method='Set') # Go online by enabling the account call_async(q, account_props, 'Set', cs.ACCOUNT, 'Enabled', True) e = q.expect('dbus-method-call', method='RequestConnection', args=['fakeprotocol', params], destination=cs.tp_name_prefix + '.ConnectionManager.fakecm', path=cs.tp_path_prefix + '/ConnectionManager/fakecm', interface=cs.tp_name_prefix + '.ConnectionManager', handled=False) if __name__ == '__main__': exec_test(test, {}) telepathy-mission-control-5.16.4/tests/twisted/account-manager/make-valid.py0000644000175000017500000002154112735242352030302 0ustar00gkiagiagkiagia00000000000000# Copyright (C) 2009 Nokia Corporation # Copyright (C) 2009 Collabora Ltd. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA # 02110-1301 USA import dbus """Feature test for accounts becoming valid. """ import os import dbus import dbus.service from servicetest import EventPattern, tp_name_prefix, tp_path_prefix, \ call_async, sync_dbus from mctest import exec_test, SimulatedConnection, create_fakecm_account, MC import constants as cs cm_name_ref = dbus.service.BusName( cs.tp_name_prefix + '.ConnectionManager.fakecm', bus=dbus.SessionBus()) account1_id = 'fakecm/fakeprotocol/jc_2edenton_40unatco_2eint' account2_id = 'fakecm/fakeprotocol/jc_2edenton_40example_2ecom' def preseed(q, bus, fake_accounts_service): accounts_dir = os.environ['MC_ACCOUNT_DIR'] try: os.mkdir(accounts_dir, 0700) except OSError: pass fake_accounts_service.update_attributes(account1_id, changed={ 'manager': 'fakecm', 'protocol': 'fakeprotocol', 'DisplayName': 'Work account', 'NormalizedName': 'jc.denton@unatco.int', 'Enabled': True, 'ConnectAutomatically': True, 'AutomaticPresenceType': dbus.UInt32(2), 'AutomaticPresenceStatus': 'available', 'AutomaticPresenceMessage': 'My vision is augmented', 'Nickname': 'JC', 'AvatarMime': 'image/jpeg', }) fake_accounts_service.update_attributes(account2_id, changed={ 'manager': 'fakecm', 'protocol': 'fakeprotocol', 'DisplayName': 'Personal account', 'NormalizedName': 'jc.denton@example.com', 'Enabled': True, 'ConnectAutomatically': False, 'AutomaticPresenceType': dbus.UInt32(2), 'AutomaticPresenceStatus': 'available', 'AutomaticPresenceMessage': 'My vision is augmented', 'Nickname': 'JC', 'AvatarMime': 'image/jpeg', }) # The passwords are missing, so the accounts can't connect yet. fake_accounts_service.update_parameters(account1_id, changed={ 'account': 'jc.denton@unatco.int', }) fake_accounts_service.update_parameters(account2_id, changed={ 'account': 'jc.denton@example.com', }) os.makedirs(accounts_dir + '/' + account1_id) avatar_bin = open(accounts_dir + '/' + account1_id + '/avatar.bin', 'w') avatar_bin.write('Deus Ex') avatar_bin.close() os.makedirs(accounts_dir + '/' + account2_id) avatar_bin = open(accounts_dir + '/' + account2_id + '/avatar.bin', 'w') avatar_bin.write('Invisible War') avatar_bin.close() account_connections_file = open(accounts_dir + '/.mc_connections', 'w') account_connections_file.write("") account_connections_file.close() def test(q, bus, unused, **kwargs): # make sure RequestConnection doesn't get called yet events = [EventPattern('dbus-method-call', method='RequestConnection')] q.forbid_events(events) fake_accounts_service = kwargs['fake_accounts_service'] preseed(q, bus, fake_accounts_service) # Wait for MC to load mc = MC(q, bus) # Trying to make a channel on account 1 doesn't work, because it's # not valid account_path = (cs.tp_path_prefix + '/Account/' + account1_id) cd = bus.get_object(cs.CD, cs.CD_PATH) user_action_time = dbus.Int64(1238582606) request = dbus.Dictionary({ cs.CHANNEL + '.ChannelType': cs.CHANNEL_TYPE_TEXT, cs.CHANNEL + '.TargetHandleType': cs.HT_CONTACT, cs.CHANNEL + '.TargetID': 'juliet', }, signature='sv') call_async(q, cd, 'CreateChannel', account_path, request, user_action_time, "", dbus_interface=cs.CD) ret = q.expect('dbus-return', method='CreateChannel') request_path = ret.value[0] cr = bus.get_object(cs.CD, request_path) request_props = cr.GetAll(cs.CR, dbus_interface=cs.PROPERTIES_IFACE) assert request_props['Account'] == account_path assert request_props['Requests'] == [request] assert request_props['UserActionTime'] == user_action_time assert request_props['PreferredHandler'] == "" assert request_props['Interfaces'] == [] sync_dbus(bus, q, mc) cr.Proceed(dbus_interface=cs.CR) # FIXME: error isn't specified (NotAvailable perhaps?) q.expect('dbus-signal', path=cr.object_path, interface=cs.CR, signal='Failed') # Make account 1 valid: it should connect automatically account_path = (cs.tp_path_prefix + '/Account/' + account1_id) account = bus.get_object(cs.MC, account_path) sync_dbus(bus, q, mc) q.unforbid_events(events) call_async(q, account, 'UpdateParameters', {'password': 'nanotech'}, [], dbus_interface=cs.ACCOUNT) expected_params = {'password': 'nanotech', 'account': 'jc.denton@unatco.int'} e = q.expect('dbus-method-call', method='RequestConnection', args=['fakeprotocol', expected_params], destination=cs.tp_name_prefix + '.ConnectionManager.fakecm', path=cs.tp_path_prefix + '/ConnectionManager/fakecm', interface=cs.tp_name_prefix + '.ConnectionManager', handled=False) conn = SimulatedConnection(q, bus, 'fakecm', 'fakeprotocol', 'account1', 'myself', has_presence=True) q.dbus_return(e.message, conn.bus_name, conn.object_path, signature='so') q.expect('dbus-method-call', method='Connect', path=conn.object_path, handled=True, interface=cs.CONN) conn.StatusChanged(cs.CONN_STATUS_CONNECTED, cs.CONN_STATUS_REASON_NONE) set_presence, e = q.expect_many( EventPattern('dbus-method-call', path=conn.object_path, interface=cs.CONN_IFACE_SIMPLE_PRESENCE, method='SetPresence', handled=True), EventPattern('dbus-signal', signal='AccountPropertyChanged', path=account_path, interface=cs.ACCOUNT, predicate=lambda e: 'CurrentPresence' in e.args[0] and e.args[0]['CurrentPresence'][2] != ''), ) assert e.args[0]['CurrentPresence'] == (cs.PRESENCE_TYPE_AVAILABLE, 'available', 'My vision is augmented') # Request an online presence on account 2, then make it valid q.forbid_events(events) account_path = (cs.tp_path_prefix + '/Account/' + account2_id) account = bus.get_object(cs.MC, account_path) requested_presence = dbus.Struct((dbus.UInt32(cs.PRESENCE_TYPE_BUSY), 'busy', 'Talking to Illuminati')) account.Set(cs.ACCOUNT, 'RequestedPresence', dbus.Struct(requested_presence, variant_level=1), dbus_interface=cs.PROPERTIES_IFACE) sync_dbus(bus, q, mc) q.unforbid_events(events) # Make the account valid call_async(q, account, 'UpdateParameters', {'password': 'nanotech'}, [], dbus_interface=cs.ACCOUNT) expected_params = {'password': 'nanotech', 'account': 'jc.denton@example.com'} e = q.expect('dbus-method-call', method='RequestConnection', args=['fakeprotocol', expected_params], destination=cs.tp_name_prefix + '.ConnectionManager.fakecm', path=cs.tp_path_prefix + '/ConnectionManager/fakecm', interface=cs.tp_name_prefix + '.ConnectionManager', handled=False) conn = SimulatedConnection(q, bus, 'fakecm', 'fakeprotocol', 'account2', 'myself', has_presence=True) q.dbus_return(e.message, conn.bus_name, conn.object_path, signature='so') q.expect('dbus-method-call', method='Connect', path=conn.object_path, handled=True, interface=cs.CONN) conn.StatusChanged(cs.CONN_STATUS_CONNECTED, cs.CONN_STATUS_REASON_NONE) set_presence = q.expect('dbus-method-call', path=conn.object_path, interface=cs.CONN_IFACE_SIMPLE_PRESENCE, method='SetPresence', handled=True) e = q.expect('dbus-signal', signal='AccountPropertyChanged', path=account_path, interface=cs.ACCOUNT, predicate=lambda e: 'CurrentPresence' in e.args[0] and e.args[0]['CurrentPresence'][1] == 'busy') assert e.args[0]['CurrentPresence'] == (cs.PRESENCE_TYPE_BUSY, 'busy', 'Talking to Illuminati') if __name__ == '__main__': exec_test(test, {}, preload_mc=False, use_fake_accounts_service=True, pass_kwargs=True) telepathy-mission-control-5.16.4/tests/twisted/account-manager/device-idle.py0000644000175000017500000001224212735242352030440 0ustar00gkiagiagkiagia00000000000000# Copyright (C) 2009 Nokia Corporation # Copyright (C) 2009 Collabora Ltd. # Copyright (C) 2013 Intel Corporation # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA # 02110-1301 USA import config import dbus.service from servicetest import EventPattern, tp_name_prefix, tp_path_prefix, \ call_async, unwrap, sync_dbus from mctest import exec_test, create_fakecm_account, SimulatedConnection, \ enable_fakecm_account import constants as cs # Fake SessionManager constants, cloned from mcd-slacker.c STATUS_AVAILABLE = 0 STATUS_INVISIBLE = 1 STATUS_BUSY = 2 STATUS_IDLE = 3 SERVICE_NAME = "org.gnome.SessionManager" SERVICE_OBJECT_PATH = "/org/gnome/SessionManager/Presence" SERVICE_INTERFACE = "org.gnome.SessionManager.Presence" SERVICE_PROP_NAME = "status" SERVICE_SIG_NAME = "StatusChanged" class SimulatedSession(object): def __init__(self, q, bus, status=STATUS_AVAILABLE): self.bus = bus self.q = q self.status = status self.object_path = SERVICE_OBJECT_PATH self._name_ref = dbus.service.BusName(SERVICE_NAME, bus) self.q.add_dbus_method_impl(self.GetAll, path=self.object_path, interface=cs.PROPERTIES_IFACE, method='GetAll') self.q.add_dbus_method_impl(self.Get, path=self.object_path, interface=cs.PROPERTIES_IFACE, method='Get') def GetAll(self, e): ret = dbus.Dictionary({}, signature='sv') ret[SERVICE_PROP_NAME] = dbus.UInt32(self.status) self.q.dbus_return(e.message, ret, signature='a{sv}') def Get(self, e): if e.args[0] == SERVICE_INTERFACE and e.args[1] == SERVICE_PROP_NAME: self.q.dbus_return(e.message, dbus.UInt32(self.status), signature='v') return self.q.dbus_raise(e.message, cs.NOT_IMPLEMENTED, \ "Unknown property %s on interface %s" % (e.args[0], e.args[1])) def StatusChanged(self, new_value): self.status = new_value self.q.dbus_emit(self.object_path, SERVICE_INTERFACE, SERVICE_SIG_NAME, dbus.UInt32(self.status), signature="u") def release_name(self): del self._name_ref def _create_and_enable(q, bus, mc, account_name, power_saving_supported, expect_after_connect=[]): extra_interfaces = [] if power_saving_supported: extra_interfaces = [cs.CONN_IFACE_POWER_SAVING] params = dbus.Dictionary({"account": account_name, "password": "secrecy"}, signature='sv') cm_name_ref, account = create_fakecm_account(q, bus, mc, params) conn = enable_fakecm_account(q, bus, mc, account, params, has_requests=False, extra_interfaces=extra_interfaces, expect_after_connect=expect_after_connect) if isinstance(conn, tuple): conn = conn[0] return account, conn def _disable_account(q, bus, mc, account, conn): account.Set(cs.ACCOUNT, 'Enabled', False, dbus_interface=cs.PROPERTIES_IFACE) q.expect('dbus-method-call', method='Disconnect', path=conn.object_path, handled=True) def test(q, bus, mc): service = SimulatedSession(q, bus, STATUS_IDLE) account1, conn1 = _create_and_enable( q, bus, mc, "first@example.com", True, [EventPattern('dbus-method-call', method='SetPowerSaving', args=[True])]) account2, conn2 = _create_and_enable(q, bus, mc, "second@example.com", False) # Second account does not support PowerSaving interface, don't call SetPowerSaving forbid_no_iface =[EventPattern('dbus-method-call', method='SetPowerSaving', path=conn2.object_path)] q.forbid_events(forbid_no_iface) for status in [STATUS_AVAILABLE, STATUS_IDLE, STATUS_BUSY]: service.StatusChanged(status) q.expect('dbus-method-call', method='SetPowerSaving', args=[status == STATUS_IDLE], interface=cs.CONN_IFACE_POWER_SAVING, path=conn1.object_path) _disable_account(q, bus, mc, account1, conn1) _disable_account(q, bus, mc, account2, conn2) q.unforbid_events(forbid_no_iface) # Make sure we don't call SetPowerSaving on a disconnected connection. forbid_when_disconnected =[EventPattern('dbus-method-call', method='SetPowerSaving')] q.forbid_events(forbid_when_disconnected) service.StatusChanged(STATUS_IDLE) sync_dbus(bus, q, account1) q.unforbid_events(forbid_when_disconnected) service.release_name() if __name__ == '__main__': exec_test(test, {}) telepathy-mission-control-5.16.4/tests/twisted/account-manager/nickname.py0000644000175000017500000001612712735242352030061 0ustar00gkiagiagkiagia00000000000000# Copyright (C) 2009 Nokia Corporation # Copyright (C) 2009 Collabora Ltd. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA # 02110-1301 USA import dbus import dbus import dbus.service from servicetest import (EventPattern, tp_name_prefix, tp_path_prefix, call_async, assertEquals, assertLength, sync_dbus) from mctest import exec_test, create_fakecm_account, enable_fakecm_account import constants as cs def test(q, bus, mc, nickname): params = dbus.Dictionary({"account": "wjt@example.com", "password": "secrecy"}, signature='sv') (cm_name_ref, account) = create_fakecm_account(q, bus, mc, params) account_iface = dbus.Interface(account, cs.ACCOUNT) account_props = dbus.Interface(account, cs.PROPERTIES_IFACE) call_async(q, account_props, 'Set', cs.ACCOUNT, 'Nickname', nickname) if nickname == '': q.expect('dbus-return', method='Set') else: q.expect_many( EventPattern('dbus-signal', path=account.object_path, signal='AccountPropertyChanged', interface=cs.ACCOUNT, args=[{'Nickname': nickname}]), EventPattern('dbus-return', method='Set'), ) assertEquals(nickname, account_props.Get(cs.ACCOUNT, 'Nickname')) # OK, let's go online expect_after_connect = [ EventPattern('dbus-method-call', interface=cs.CONN_IFACE_CONTACTS, predicate=(lambda e: e.method in ( 'GetContactAttributes', 'GetContactByID' ) and cs.CONN_IFACE_ALIASING in e.args[1]), handled=True), ] forbidden = [] if nickname == params['account'] or nickname == '': forbidden.append(EventPattern('dbus-method-call', method='SetAliases')) q.forbid_events(forbidden) if nickname == '': expect_after_connect.append(EventPattern('dbus-signal', path=account.object_path, signal='AccountPropertyChanged', interface=cs.ACCOUNT, predicate=(lambda e: e.args[0].get('Nickname') == params['account']))) else: expect_after_connect.append(EventPattern('dbus-method-call', interface=cs.CONN_IFACE_ALIASING, method='SetAliases', handled=False)) results = enable_fakecm_account(q, bus, mc, account, params, has_aliasing=True, expect_after_connect=expect_after_connect, self_ident=params['account']) conn = results[0] get_aliases = results[1] assert get_aliases.args[0] == [ conn.self_handle ] if nickname == params['account']: assertLength(2, results) elif nickname == '': assertLength(3, results) else: assertLength(3, results) set_aliases = results[2] assert set_aliases.args[0] == { conn.self_handle: nickname } q.dbus_return(set_aliases.message, signature='') if forbidden: sync_dbus(bus, q, mc) q.unforbid_events(forbidden) # Change alias after going online call_async(q, account_props, 'Set', cs.ACCOUNT, 'Nickname', 'Will Thomspon') e = q.expect('dbus-method-call', interface=cs.CONN_IFACE_ALIASING, method='SetAliases', args=[{ conn.self_handle: 'Will Thomspon' }], handled=False) # Set returns immediately; the change happens asynchronously q.expect('dbus-return', method='Set') q.dbus_return(e.message, signature='') someone_else = conn.ensure_handle(cs.HT_CONTACT, 'alberto@example.com') # Another client changes our alias remotely q.dbus_emit(conn.object_path, cs.CONN_IFACE_ALIASING, 'AliasesChanged', dbus.Array([(conn.self_handle, 'wjt'), (someone_else, 'mardy')], signature='(us)'), signature='a(us)') q.expect('dbus-signal', path=account.object_path, signal='AccountPropertyChanged', interface=cs.ACCOUNT, args=[{'Nickname': 'wjt'}]) # If we set a trivial nickname while connected, MC does use it nickname = params['account'] call_async(q, account_props, 'Set', cs.ACCOUNT, 'Nickname', params['account']) _, _, e = q.expect_many( EventPattern('dbus-signal', path=account.object_path, signal='AccountPropertyChanged', interface=cs.ACCOUNT, args=[{'Nickname': params['account']}]), EventPattern('dbus-return', method='Set'), EventPattern('dbus-method-call', interface=cs.CONN_IFACE_ALIASING, method='SetAliases', args=[{ conn.self_handle: params['account'] }], handled=False) ) assertEquals(nickname, account_props.Get(cs.ACCOUNT, 'Nickname')) q.dbus_return(e.message, signature='') # Set the nickname back to something else nickname = 'wjt' call_async(q, account_props, 'Set', cs.ACCOUNT, 'Nickname', nickname) _, _, e = q.expect_many( EventPattern('dbus-signal', path=account.object_path, signal='AccountPropertyChanged', interface=cs.ACCOUNT, args=[{'Nickname': nickname}]), EventPattern('dbus-return', method='Set'), EventPattern('dbus-method-call', interface=cs.CONN_IFACE_ALIASING, method='SetAliases', args=[{ conn.self_handle: nickname }], handled=False) ) assertEquals(nickname, account_props.Get(cs.ACCOUNT, 'Nickname')) q.dbus_return(e.message, signature='') # If we set an empty nickname while connected, MC uses our normalized # name (identifier) instead. call_async(q, account_props, 'Set', cs.ACCOUNT, 'Nickname', '') _, _, e = q.expect_many( EventPattern('dbus-signal', path=account.object_path, signal='AccountPropertyChanged', interface=cs.ACCOUNT, args=[{'Nickname': params['account']}]), EventPattern('dbus-return', method='Set'), EventPattern('dbus-method-call', interface=cs.CONN_IFACE_ALIASING, method='SetAliases', args=[{ conn.self_handle: params['account'] }], handled=False) ) assertEquals(params['account'], account_props.Get(cs.ACCOUNT, 'Nickname')) q.dbus_return(e.message, signature='') def test_both(q, bus, mc): test(q, bus, mc, nickname='resiak') test(q, bus, mc, nickname='wjt@example.com') test(q, bus, mc, nickname='') if __name__ == '__main__': exec_test(test_both, {}) telepathy-mission-control-5.16.4/tests/twisted/account-manager/enable.py0000644000175000017500000000463512735242352027523 0ustar00gkiagiagkiagia00000000000000# Copyright (C) 2009 Nokia Corporation # Copyright (C) 2009 Collabora Ltd. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA # 02110-1301 USA import dbus import dbus import dbus.service from servicetest import EventPattern, tp_name_prefix, tp_path_prefix, \ call_async from mctest import exec_test, create_fakecm_account import constants as cs def test(q, bus, mc): params = dbus.Dictionary({"account": "smcv@example.com", "password": "secrecy"}, signature='sv') (cm_name_ref, account) = create_fakecm_account(q, bus, mc, params) account_iface = dbus.Interface(account, cs.ACCOUNT) account_props = dbus.Interface(account, cs.PROPERTIES_IFACE) call_async(q, account_props, 'Set', cs.ACCOUNT, 'RequestedPresence', (dbus.UInt32(cs.PRESENCE_TYPE_OFFLINE), 'offline', '')) q.expect('dbus-return', method='Set') call_async(q, account_props, 'Set', cs.ACCOUNT, 'Enabled', False) q.expect('dbus-return', method='Set') call_async(q, account_props, 'Set', cs.ACCOUNT, 'ConnectAutomatically', False) q.expect('dbus-return', method='Set') call_async(q, account_props, 'Set', cs.ACCOUNT, 'RequestedPresence', (dbus.UInt32(cs.PRESENCE_TYPE_BUSY), 'busy', 'Testing Enabled')) q.expect('dbus-return', method='Set') # Go online by setting Enabled call_async(q, account_props, 'Set', cs.ACCOUNT, 'Enabled', True) e = q.expect('dbus-method-call', method='RequestConnection', args=['fakeprotocol', params], destination=cs.tp_name_prefix + '.ConnectionManager.fakecm', path=cs.tp_path_prefix + '/ConnectionManager/fakecm', interface=cs.tp_name_prefix + '.ConnectionManager', handled=False) if __name__ == '__main__': exec_test(test, {}) telepathy-mission-control-5.16.4/tests/twisted/account-manager/backend-makes-changes.py0000644000175000017500000003516612735242352032373 0ustar00gkiagiagkiagia00000000000000# Copyright (C) 2009 Nokia Corporation # Copyright (C) 2009-2012 Collabora Ltd. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA # 02110-1301 USA import dbus import dbus.service from servicetest import EventPattern, call_async, assertEquals from mctest import exec_test, create_fakecm_account, Account import constants as cs def test(q, bus, mc, fake_accounts_service=None, **kwargs): account_tail = 'fakecm/fakeprotocol/ezio_2efirenze_40fic0' account_path = cs.ACCOUNT_PATH_PREFIX + account_tail fake_accounts_service.create_account(account_tail, {'Enabled': False, 'manager': 'fakecm', 'protocol': 'fakeprotocol'}, {}, # attr flags {'account': 'ezio@firenze.fic', 'password': 'nothing is true'}, {}, # untyped parameters {'password': cs.PARAM_FLAG_SECRET}) # param flags q.expect_many( EventPattern('dbus-signal', path=cs.TEST_DBUS_ACCOUNT_SERVICE_PATH, signal='AccountCreated', args=[account_tail, {'Enabled': False, 'manager': 'fakecm', 'protocol': 'fakeprotocol'}, {'Enabled': 0, 'manager': 0, 'protocol': 0}, {'account': 'ezio@firenze.fic', 'password': 'nothing is true'}, {}, {'account': 0, 'password': cs.PARAM_FLAG_SECRET}]), EventPattern('dbus-signal', path=cs.AM_PATH, signal='AccountValidityChanged', args=[account_path, True]), ) account = Account(bus, account_path) # changing something via MC ensures that the plugin has caught up # with account creation call_async(q, account.Properties, 'Set', cs.ACCOUNT, 'Nickname', 'Ezio Auditore di Firenze') q.expect_many( EventPattern('dbus-signal', path=account_path, signal='AccountPropertyChanged', interface=cs.ACCOUNT, # Can't match on args because Valid: True sometimes gets into # this AccountPropertyChanged signal. MC should stop merging # unrelated signals one day... predicate=(lambda e: e.args[0].get('Nickname') == 'Ezio Auditore di Firenze')), EventPattern('dbus-signal', interface=cs.TEST_DBUS_ACCOUNT_PLUGIN_IFACE, signal='DeferringSetAttribute', args=[account_path, 'Nickname', 'Ezio Auditore di Firenze']), EventPattern('dbus-signal', interface=cs.TEST_DBUS_ACCOUNT_PLUGIN_IFACE, signal='CommittingOne', args=[account_path]), EventPattern('dbus-method-call', interface=cs.TEST_DBUS_ACCOUNT_SERVICE_IFACE, method='UpdateAttributes', args=[account_tail, {'Nickname': 'Ezio Auditore di Firenze'}, {'Nickname': 0}, # flags []], ), EventPattern('dbus-return', method='Set'), ) assertEquals('Ezio Auditore di Firenze', account.Properties.Get(cs.ACCOUNT, 'Nickname')) # Now change something from the accounts service side. In principle this # could be a generic account-editing UI that knows nothing about # Telepathy, if the plugin translated between Telepathy and libaccounts # terminology or whatever. fake_accounts_service.update_attributes(account_tail, {'Enabled': True}) q.expect_many( EventPattern('dbus-signal', path=cs.TEST_DBUS_ACCOUNT_SERVICE_PATH, signal='AttributesChanged', args=[account_tail, {'Enabled': True}, {'Enabled': 0}, []]), EventPattern('dbus-signal', path=account_path, signal='AccountPropertyChanged', interface=cs.ACCOUNT, args=[{'Enabled': True}]), EventPattern('dbus-signal', path=cs.TEST_DBUS_ACCOUNT_PLUGIN_PATH, signal='Toggled', args=[account_path, True]), ) assertEquals(True, account.Properties.Get(cs.ACCOUNT, 'Enabled')) fake_accounts_service.update_attributes(account_tail, {cs.ACCOUNT_IFACE_ADDRESSING + '.URISchemes': ['xmpp']}) q.expect_many( EventPattern('dbus-signal', path=cs.TEST_DBUS_ACCOUNT_SERVICE_PATH, signal='AttributesChanged', args=[account_tail, {cs.ACCOUNT_IFACE_ADDRESSING + '.URISchemes': ['xmpp']}, {cs.ACCOUNT_IFACE_ADDRESSING + '.URISchemes': 0}, []]), EventPattern('dbus-signal', path=cs.TEST_DBUS_ACCOUNT_PLUGIN_PATH, signal='AttributeChanged', args=[account_path, cs.ACCOUNT_IFACE_ADDRESSING + '.URISchemes']), ) assertEquals(['xmpp'], account.Properties.Get(cs.ACCOUNT_IFACE_ADDRESSING, 'URISchemes')) fake_accounts_service.update_attributes(account_tail, {'ConnectAutomatically': True}) q.expect_many( EventPattern('dbus-signal', path=cs.TEST_DBUS_ACCOUNT_SERVICE_PATH, signal='AttributesChanged', args=[account_tail, {'ConnectAutomatically': True}, {'ConnectAutomatically': 0}, []]), EventPattern('dbus-signal', path=account_path, signal='AccountPropertyChanged', interface=cs.ACCOUNT, predicate=(lambda e: e.args[0].get('ConnectAutomatically') == True)), EventPattern('dbus-signal', path=cs.TEST_DBUS_ACCOUNT_PLUGIN_PATH, signal='AttributeChanged', args=[account_path, 'ConnectAutomatically']), ) assertEquals(True, account.Properties.Get(cs.ACCOUNT, 'ConnectAutomatically')) fake_accounts_service.update_attributes(account_tail, {'Supersedes': [cs.ACCOUNT_PATH_PREFIX + 'ac1/game/altair']}) q.expect_many( EventPattern('dbus-signal', path=cs.TEST_DBUS_ACCOUNT_SERVICE_PATH, signal='AttributesChanged', args=[account_tail, {'Supersedes': [cs.ACCOUNT_PATH_PREFIX + 'ac1/game/altair']}, {'Supersedes': 0}, []]), EventPattern('dbus-signal', path=account_path, signal='AccountPropertyChanged', interface=cs.ACCOUNT, args=[{'Supersedes': [cs.ACCOUNT_PATH_PREFIX + 'ac1/game/altair']}], ), EventPattern('dbus-signal', path=cs.TEST_DBUS_ACCOUNT_PLUGIN_PATH, signal='AttributeChanged', args=[account_path, 'Supersedes']), ) assertEquals([cs.ACCOUNT_PATH_PREFIX + 'ac1/game/altair'], account.Properties.Get(cs.ACCOUNT, 'Supersedes')) fake_accounts_service.update_attributes(account_tail, {'AutomaticPresence': (dbus.UInt32(cs.PRESENCE_TYPE_HIDDEN), 'hidden', 'in a haystack or something')}) q.expect_many( EventPattern('dbus-signal', path=cs.TEST_DBUS_ACCOUNT_SERVICE_PATH, signal='AttributesChanged', args=[account_tail, {'AutomaticPresence': (cs.PRESENCE_TYPE_HIDDEN, 'hidden', 'in a haystack or something')}, {'AutomaticPresence': 0}, []]), EventPattern('dbus-signal', path=account_path, signal='AccountPropertyChanged', interface=cs.ACCOUNT, args=[{'AutomaticPresence': (cs.PRESENCE_TYPE_HIDDEN, 'hidden', 'in a haystack or something')}]), EventPattern('dbus-signal', path=cs.TEST_DBUS_ACCOUNT_PLUGIN_PATH, signal='AttributeChanged', args=[account_path, 'AutomaticPresence']), ) assertEquals((cs.PRESENCE_TYPE_HIDDEN, 'hidden', 'in a haystack or something'), account.Properties.Get(cs.ACCOUNT, 'AutomaticPresence')) fake_accounts_service.update_attributes(account_tail, { 'DisplayName': 'Ezio\'s IM account'}) q.expect_many( EventPattern('dbus-signal', path=cs.TEST_DBUS_ACCOUNT_SERVICE_PATH, signal='AttributesChanged', args=[account_tail, {'DisplayName': 'Ezio\'s IM account'}, {'DisplayName': 0}, []]), EventPattern('dbus-signal', path=account_path, signal='AccountPropertyChanged', interface=cs.ACCOUNT, args=[{'DisplayName': 'Ezio\'s IM account'}]), EventPattern('dbus-signal', path=cs.TEST_DBUS_ACCOUNT_PLUGIN_PATH, signal='AttributeChanged', args=[account_path, 'DisplayName']), ) assertEquals("Ezio's IM account", account.Properties.Get(cs.ACCOUNT, 'DisplayName')) fake_accounts_service.update_attributes(account_tail, { 'Icon': 'im-machiavelli'}) q.expect_many( EventPattern('dbus-signal', path=cs.TEST_DBUS_ACCOUNT_SERVICE_PATH, signal='AttributesChanged', args=[account_tail, {'Icon': 'im-machiavelli'}, {'Icon': 0}, []]), EventPattern('dbus-signal', path=account_path, signal='AccountPropertyChanged', interface=cs.ACCOUNT, args=[{'Icon': 'im-machiavelli'}]), EventPattern('dbus-signal', path=cs.TEST_DBUS_ACCOUNT_PLUGIN_PATH, signal='AttributeChanged', args=[account_path, 'Icon']), ) assertEquals('im-machiavelli', account.Properties.Get(cs.ACCOUNT, 'Icon')) fake_accounts_service.update_attributes(account_tail, { 'Service': 'machiavelli-talk'}) q.expect_many( EventPattern('dbus-signal', path=cs.TEST_DBUS_ACCOUNT_SERVICE_PATH, signal='AttributesChanged', args=[account_tail, {'Service': 'machiavelli-talk'}, {'Service': 0}, []]), EventPattern('dbus-signal', path=account_path, signal='AccountPropertyChanged', interface=cs.ACCOUNT, args=[{'Service': 'machiavelli-talk'}]), EventPattern('dbus-signal', path=cs.TEST_DBUS_ACCOUNT_PLUGIN_PATH, signal='AttributeChanged', args=[account_path, 'Service']), ) assertEquals('machiavelli-talk', account.Properties.Get(cs.ACCOUNT, 'Service')) fake_accounts_service.update_parameters(account_tail, { 'password': 'high profile'}, flags={'password': cs.PARAM_FLAG_SECRET}) q.expect_many( EventPattern('dbus-signal', path=cs.TEST_DBUS_ACCOUNT_SERVICE_PATH, signal='ParametersChanged', args=[account_tail, {'password': 'high profile'}, {}, {'password': cs.PARAM_FLAG_SECRET}, []]), EventPattern('dbus-signal', path=account_path, signal='AccountPropertyChanged', interface=cs.ACCOUNT, args=[{'Parameters': {'account': 'ezio@firenze.fic', 'password': 'high profile'}}]), EventPattern('dbus-signal', path=cs.TEST_DBUS_ACCOUNT_PLUGIN_PATH, signal='ParameterChanged', args=[account_path, 'password']), ) fake_accounts_service.update_parameters(account_tail, untyped={ 'password': r'\\\n'}, flags={'password': cs.PARAM_FLAG_SECRET}) q.expect_many( EventPattern('dbus-signal', path=cs.TEST_DBUS_ACCOUNT_SERVICE_PATH, signal='ParametersChanged', args=[account_tail, {}, {'password': r'\\\n'}, {'password': cs.PARAM_FLAG_SECRET}, []]), EventPattern('dbus-signal', path=account_path, signal='AccountPropertyChanged', interface=cs.ACCOUNT, args=[{'Parameters': {'account': 'ezio@firenze.fic', 'password': '\\\n'}}]), EventPattern('dbus-signal', path=cs.TEST_DBUS_ACCOUNT_PLUGIN_PATH, signal='ParameterChanged', args=[account_path, 'password']), ) fake_accounts_service.update_parameters(account_tail, deleted=[ 'password']) q.expect_many( EventPattern('dbus-signal', path=cs.TEST_DBUS_ACCOUNT_SERVICE_PATH, signal='ParametersChanged', args=[account_tail, {}, {}, {}, ['password']]), EventPattern('dbus-signal', path=account_path, signal='AccountPropertyChanged', interface=cs.ACCOUNT, args=[{'Parameters': {'account': 'ezio@firenze.fic'}}]), EventPattern('dbus-signal', path=cs.TEST_DBUS_ACCOUNT_PLUGIN_PATH, signal='ParameterDeleted', args=[account_path, 'password']), ) fake_accounts_service.delete_account(account_tail) q.expect_many( EventPattern('dbus-signal', path=cs.TEST_DBUS_ACCOUNT_SERVICE_PATH, signal='AccountDeleted', args=[account_tail]), EventPattern('dbus-signal', signal='AccountRemoved', interface=cs.AM, args=[account_path]), ) if __name__ == '__main__': exec_test(test, {}, pass_kwargs=True) telepathy-mission-control-5.16.4/tests/twisted/account-manager/update-parameters.py0000644000175000017500000002423212735242352031713 0ustar00gkiagiagkiagia00000000000000# vim: set fileencoding=utf-8 : # Copyright © 2009 Nokia Corporation # Copyright © 2009–2011 Collabora Ltd. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA # 02110-1301 USA import os import time import dbus import dbus.service from servicetest import EventPattern, tp_name_prefix, tp_path_prefix, \ call_async, assertEquals, assertSameSets from mctest import exec_test, SimulatedConnection, create_fakecm_account,\ SimulatedChannel import constants as cs def test(q, bus, mc, **kwargs): cm_name_ref = dbus.service.BusName( tp_name_prefix + '.ConnectionManager.fakecm', bus=bus) # Create an account params = dbus.Dictionary( {"account": "someguy@example.com", "password": "secrecy", "nickname": "albinoblacksheep", }, signature='sv') (cm_name_ref, account) = create_fakecm_account(q, bus, mc, params) # Enable the account account.Set(cs.ACCOUNT, 'Enabled', True, dbus_interface=cs.PROPERTIES_IFACE) q.expect('dbus-signal', path=account.object_path, signal='AccountPropertyChanged', interface=cs.ACCOUNT) # Go online requested_presence = dbus.Struct((dbus.UInt32(2L), dbus.String(u'brb'), dbus.String(u'Be back soon!'))) account.Set(cs.ACCOUNT, 'RequestedPresence', requested_presence, dbus_interface=cs.PROPERTIES_IFACE) e = q.expect('dbus-method-call', method='RequestConnection', args=['fakeprotocol', params], destination=tp_name_prefix + '.ConnectionManager.fakecm', path=tp_path_prefix + '/ConnectionManager/fakecm', interface=tp_name_prefix + '.ConnectionManager', handled=False) conn = SimulatedConnection(q, bus, 'fakecm', 'fakeprotocol', '_', 'myself') q.dbus_return(e.message, conn.bus_name, conn.object_path, signature='so') # MC does some setup, including fetching the list of Channels q.expect_many( EventPattern('dbus-method-call', interface=cs.PROPERTIES_IFACE, method='GetAll', args=[cs.CONN_IFACE_REQUESTS], path=conn.object_path, handled=True), ) # MC calls GetStatus (maybe) and then Connect q.expect('dbus-method-call', method='Connect', path=conn.object_path, handled=True) # Connect succeeds conn.StatusChanged(cs.CONN_STATUS_CONNECTED, cs.CONN_STATUS_REASON_NONE) # Assert that the NormalizedName is harvested from the Connection at some # point while 1: e = q.expect('dbus-signal', interface=cs.ACCOUNT, signal='AccountPropertyChanged', path=account.object_path) if 'NormalizedName' in e.args[0]: assert e.args[0]['NormalizedName'] == 'myself', e.args break # Check the requested presence is online properties = account.GetAll(cs.ACCOUNT, dbus_interface=cs.PROPERTIES_IFACE) assert properties is not None assert properties.get('RequestedPresence') == requested_presence, \ properties.get('RequestedPresence') # Set some parameters. They include setting account to \\, as a regression # test for part of fd.o #28557. call_async(q, account, 'UpdateParameters', { 'account': r'\\', 'secret-mushroom': '/Amanita muscaria/', 'snakes': dbus.UInt32(42), 'com.example.Badgerable.Badgered': True, }, [], dbus_interface=cs.ACCOUNT) set_call, ret, _ = q.expect_many( EventPattern('dbus-method-call', path=conn.object_path, interface=cs.PROPERTIES_IFACE, method='Set', args=['com.example.Badgerable', 'Badgered', True], handled=False), EventPattern('dbus-return', method='UpdateParameters'), EventPattern('dbus-signal', path=account.object_path, interface=cs.ACCOUNT, signal='AccountPropertyChanged', args=[{'Parameters': { 'account': r'\\', 'com.example.Badgerable.Badgered': True, 'password': 'secrecy', 'nickname': 'albinoblacksheep', 'secret-mushroom': '/Amanita muscaria/', 'snakes': 42, }}]), ) # the D-Bus property should be set instantly; the others will take effect # on reconnection not_yet = ret.value[0] not_yet.sort() assert not_yet == ['account', 'secret-mushroom', 'snakes'], not_yet # Try to update 'account' to a value of the wrong type; MC should complain, # without having changed the value of 'snakes'. call_async(q, account, 'UpdateParameters', { 'account': dbus.UInt32(39), 'snakes': dbus.UInt32(39), }, [], dbus_interface=cs.ACCOUNT) q.expect('dbus-error', name=cs.INVALID_ARGUMENT) props = account.Get(cs.ACCOUNT, 'Parameters', dbus_interface=cs.PROPERTIES_IFACE) assertEquals(42, props['snakes']) # Try to update a parameter that doesn't exist; again, 'snakes' should not # be changed. call_async(q, account, 'UpdateParameters', { 'accccccount': dbus.UInt32(39), 'snakes': dbus.UInt32(39), }, [], dbus_interface=cs.ACCOUNT) q.expect('dbus-error', name=cs.INVALID_ARGUMENT) props = account.Get(cs.ACCOUNT, 'Parameters', dbus_interface=cs.PROPERTIES_IFACE) assertEquals(42, props['snakes']) # Unset some parameters, including a parameter which doesn't exist at all. # The spec says that “If the given parameters […] do not exist at all, the # account manager MUST accept this without error.” call_async(q, account, 'UpdateParameters', {}, ['nickname', 'com.example.Badgerable.Badgered', 'froufrou'], dbus_interface=cs.ACCOUNT) ret, _, _ = q.expect_many( EventPattern('dbus-return', method='UpdateParameters'), EventPattern('dbus-signal', path=account.object_path, interface=cs.ACCOUNT, signal='AccountPropertyChanged', args=[{'Parameters': { 'account': r'\\', 'password': 'secrecy', 'secret-mushroom': '/Amanita muscaria/', 'snakes': 42, }}]), EventPattern('dbus-method-call', path=conn.object_path, interface=cs.PROPERTIES_IFACE, method='Set', args=['com.example.Badgerable', 'Badgered', False], handled=False), ) # Because com.example.Badgerable.Badgered has a default value (namely # False), unsetting that parameter should cause the default value to be set # on the CM. not_yet = ret.value[0] assertEquals(['nickname'], not_yet) # Set contrived-example to its default value; since there's been no # practical change, we shouldn't be told we need to reconnect to apply it. call_async(q, account, 'UpdateParameters', { 'contrived-example': dbus.UInt32(5) }, []) ret, _ = q.expect_many( EventPattern('dbus-return', method='UpdateParameters'), EventPattern('dbus-signal', path=account.object_path, interface=cs.ACCOUNT, signal='AccountPropertyChanged', args=[{'Parameters': { 'account': r'\\', 'password': 'secrecy', 'secret-mushroom': '/Amanita muscaria/', 'snakes': 42, "contrived-example": 5, }}]), ) not_yet = ret.value[0] assertEquals([], not_yet) # Unset contrived-example; again, MC should be smart enough to know we # don't need to do anything. call_async(q, account, 'UpdateParameters', {}, ['contrived-example']) ret, _ = q.expect_many( EventPattern('dbus-return', method='UpdateParameters'), EventPattern('dbus-signal', path=account.object_path, interface=cs.ACCOUNT, signal='AccountPropertyChanged', args=[{'Parameters': { 'account': r'\\', 'password': 'secrecy', 'secret-mushroom': '/Amanita muscaria/', 'snakes': 42, }}]), ) not_yet = ret.value[0] assertEquals([], not_yet) # Unset contrived-example again; the spec decrees that “If the given # parameters were not, in fact, stored, […] the account manager MUST accept # this without error.” call_async(q, account, 'UpdateParameters', {}, ['contrived-example']) ret = q.expect('dbus-return', method='UpdateParameters') not_yet = ret.value[0] assertEquals([], not_yet) cache_dir = os.environ['XDG_CACHE_HOME'] # Now that we're using GVariant-based storage, the backslashes aren't # escaped. assertEquals(r'\\', kwargs['fake_accounts_service'].accounts [account.object_path[len(cs.ACCOUNT_PATH_PREFIX):]] [2] # parameters of known type ['account']) assertEquals(None, kwargs['fake_accounts_service'].accounts [account.object_path[len(cs.ACCOUNT_PATH_PREFIX):]] [3] # parameters of unknown type .get('account', None)) if __name__ == '__main__': exec_test(test, {}, pass_kwargs=True) telepathy-mission-control-5.16.4/tests/twisted/account-manager/presence.py0000755000175000017500000001660112735242352030100 0ustar00gkiagiagkiagia00000000000000# Copyright (C) 2009 Nokia Corporation # Copyright (C) 2009 Collabora Ltd. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA # 02110-1301 USA import dbus import dbus import dbus.service from servicetest import EventPattern, tp_name_prefix, tp_path_prefix, \ call_async, sync_dbus from mctest import exec_test, create_fakecm_account, enable_fakecm_account import constants as cs def test(q, bus, mc): params = dbus.Dictionary({"account": "jc.denton@example.com", "password": "ionstorm"}, signature='sv') (cm_name_ref, account) = create_fakecm_account(q, bus, mc, params) presence = dbus.Struct((dbus.UInt32(cs.PRESENCE_TYPE_BUSY), 'busy', 'Fighting conspiracies'), signature='uss') def mk_offline(message=''): return dbus.Struct((dbus.UInt32(cs.PRESENCE_TYPE_OFFLINE), 'offline', message), signature='uss') offline = mk_offline() # While the account is disabled, pushing stuff into RequestedPresence # should not make ChangingPresence become True. assert not account.Properties.Get(cs.ACCOUNT, 'Enabled') assert not account.Properties.Get(cs.ACCOUNT, 'ChangingPresence') events = [ EventPattern('dbus-signal', signal='AccountPropertyChanged', predicate=lambda e: 'ChangingPresence' in e.args[0]), EventPattern('dbus-method-call', method='RequestConnection'), ] q.forbid_events(events) account.Properties.Set(cs.ACCOUNT, 'RequestedPresence', presence) account.Properties.Set(cs.ACCOUNT, 'RequestedPresence', offline) account.Properties.Set(cs.ACCOUNT, 'RequestedPresence', presence) account.Properties.Set(cs.ACCOUNT, 'RequestedPresence', offline) # Check that changing the message associated with our requested offline # presence doesn't make anything happen either. account.Properties.Set(cs.ACCOUNT, 'RequestedPresence', mk_offline('byeeee')) # Enable the account; RequestedPresence is still offline, so this should # have no effect on ChangingPresence. account.Properties.Set(cs.ACCOUNT, 'Enabled', True) account.Properties.Set(cs.ACCOUNT, 'Enabled', False) sync_dbus(bus, q, account) assert not account.Properties.Get(cs.ACCOUNT, 'ChangingPresence') q.unforbid_events(events) # Go online with a particular presence log = [] # FIXME: using predicate for its side-effects here is weird conn, _, _, _, _, _, _ = enable_fakecm_account(q, bus, mc, account, params, has_presence=True, requested_presence=presence, expect_before_connect=[ EventPattern('dbus-method-call', interface=cs.CONN, method='GetInterfaces', args=[], handled=True, predicate=(lambda e: log.append('GetInterfaces') or True)), EventPattern('dbus-method-call', interface=cs.PROPERTIES_IFACE, method='Get', args=[cs.CONN_IFACE_SIMPLE_PRESENCE, 'Statuses'], handled=True, predicate=(lambda e: log.append('Get(Statuses)[1]') or True)), EventPattern('dbus-method-call', interface=cs.CONN_IFACE_SIMPLE_PRESENCE, method='SetPresence', args=list(presence[1:]), handled=True, predicate=(lambda e: log.append('SetPresence[1]') or True)), ], expect_after_connect=[ EventPattern('dbus-method-call', interface=cs.PROPERTIES_IFACE, method='Get', args=[cs.CONN_IFACE_SIMPLE_PRESENCE, 'Statuses'], handled=True, predicate=(lambda e: log.append('Get(Statuses)[2]') or True)), EventPattern('dbus-method-call', interface=cs.CONN_IFACE_SIMPLE_PRESENCE, method='SetPresence', args=list(presence[1:]), handled=True, predicate=(lambda e: log.append('SetPresence[2]') or True)), EventPattern('dbus-signal', path=account.object_path, interface=cs.ACCOUNT, signal='AccountPropertyChanged', predicate=lambda e: e.args[0].get('CurrentPresence') == presence), ]) # The events before Connect must happen in this order. GetInterfaces() may # be called once or 2 times if len(log) == 5: assert log == ['GetInterfaces', 'Get(Statuses)[1]', 'SetPresence[1]', 'Get(Statuses)[2]', 'SetPresence[2]'], log else: assert log == ['GetInterfaces', 'GetInterfaces', 'Get(Statuses)[1]', 'SetPresence[1]', 'Get(Statuses)[2]', 'SetPresence[2]'], log # Change requested presence after going online presence = dbus.Struct((dbus.UInt32(cs.PRESENCE_TYPE_AWAY), 'away', 'In Hong Kong'), signature='uss') call_async(q, account.Properties, 'Set', cs.ACCOUNT, 'RequestedPresence', presence) e, _, _ = q.expect_many( EventPattern('dbus-method-call', interface=cs.CONN_IFACE_SIMPLE_PRESENCE, method='SetPresence', args=list(presence[1:]), handled=True), EventPattern('dbus-signal', path=account.object_path, interface=cs.ACCOUNT, signal='AccountPropertyChanged', predicate=lambda e: e.args[0].get('ChangingPresence') == True and e.args[0].get('RequestedPresence') == presence), EventPattern('dbus-signal', path=account.object_path, interface=cs.ACCOUNT, signal='AccountPropertyChanged', predicate=lambda e: e.args[0].get('CurrentPresence') == presence and e.args[0].get('ChangingPresence') == False)) # Setting RequestedPresence=RequestedPresence causes a (possibly redundant) # call to the CM, so we get any side-effects there might be, either in the # CM or in MC (e.g. asking connectivity services to go online). However, # AccountPropertyChanged is not emitted for RequestedPresence. sync_dbus(bus, q, mc) events = [EventPattern('dbus-signal', signal='AccountPropertyChanged', predicate=lambda e: e.args[0].get('RequestedPresence') is not None)] q.forbid_events(events) presence = dbus.Struct((dbus.UInt32(cs.PRESENCE_TYPE_AWAY), 'away', 'In Hong Kong'), signature='uss') call_async(q, account.Properties, 'Set', cs.ACCOUNT, 'RequestedPresence', presence) e = q.expect('dbus-method-call', interface=cs.CONN_IFACE_SIMPLE_PRESENCE, method='SetPresence', args=list(presence[1:]), handled=True) sync_dbus(bus, q, mc) q.unforbid_events(events) if __name__ == '__main__': exec_test(test, {}) telepathy-mission-control-5.16.4/tests/twisted/account-manager/param-types.py0000644000175000017500000000572212735242352030535 0ustar00gkiagiagkiagia00000000000000# Copyright (C) 2009 Nokia Corporation # Copyright (C) 2009 Collabora Ltd. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA # 02110-1301 USA import dbus import dbus import dbus.service from servicetest import EventPattern, tp_name_prefix, tp_path_prefix, \ call_async from mctest import exec_test, create_fakecm_account, get_account_manager import constants as cs def test(q, bus, mc): cm_name_ref = dbus.service.BusName( cs.tp_name_prefix + '.ConnectionManager.onewitheverything', bus=bus) # Get the AccountManager interface account_manager = get_account_manager(bus) account_manager_iface = dbus.Interface(account_manager, cs.AM) params = dbus.Dictionary({ 's': 'lalala', 'o': dbus.ObjectPath('/lalala'), 'b': False, 'q': dbus.UInt16(42), 'u': dbus.UInt32(0xFFFFFFFFL), 't': dbus.UInt64(0xFFFFffffFFFFffffL), 'n': dbus.Int16(-42), 'i': dbus.Int32(-42), 'x': dbus.Int64(-1 * 0x7FFFffffFFFFffffL), 'd': 4.5, 'y': dbus.Byte(42), 'as': dbus.Array(['one', 'two', 'three'], signature='s') }, signature='sv') # Create an account call_async(q, account_manager_iface, 'CreateAccount', 'onewitheverything', # Connection_Manager 'serializable', # Protocol 'fakeaccount', #Display_Name params, # Parameters {}, # Properties ) am_signal, ret = q.expect_many( EventPattern('dbus-signal', path=cs.AM_PATH, interface=cs.AM, signal='AccountValidityChanged'), EventPattern('dbus-return', method='CreateAccount'), ) account_path = ret.value[0] assert am_signal.args == [account_path, True], am_signal.args assert account_path is not None account = bus.get_object( cs.tp_name_prefix + '.AccountManager', account_path) account_iface = dbus.Interface(account, cs.ACCOUNT) account_props = dbus.Interface(account, cs.PROPERTIES_IFACE) stored_params = account_props.Get(cs.ACCOUNT, 'Parameters') for k in stored_params: assert k in params, k for k in params: assert k in stored_params, k assert stored_params[k] == params[k], (k, stored_params[k], params[k]) if __name__ == '__main__': exec_test(test, {}) telepathy-mission-control-5.16.4/tests/twisted/account-manager/account-basics.py0000644000175000017500000003223312735242352031166 0ustar00gkiagiagkiagia00000000000000# Copyright (C) 2009 Nokia Corporation # Copyright (C) 2009-2012 Collabora Ltd. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA # 02110-1301 USA import dbus import dbus.service from servicetest import EventPattern, tp_name_prefix, tp_path_prefix, \ call_async, assertEquals from mctest import exec_test, create_fakecm_account, get_account_manager import constants as cs def test(q, bus, mc): # Get the AccountManager interface account_manager = get_account_manager(bus) account_manager_iface = dbus.Interface(account_manager, cs.AM) # Introspect AccountManager for debugging purpose account_manager_introspected = account_manager.Introspect( dbus_interface=cs.INTROSPECTABLE_IFACE) #print account_manager_introspected # Check AccountManager has D-Bus property interface properties = account_manager.GetAll(cs.AM, dbus_interface=cs.PROPERTIES_IFACE) assert properties is not None assert properties.get('ValidAccounts') == [], \ properties.get('ValidAccounts') assert properties.get('InvalidAccounts') == [], \ properties.get('InvalidAccounts') interfaces = properties.get('Interfaces') params = dbus.Dictionary({"account": "someguy@example.com", "password": "secrecy"}, signature='sv') (cm_name_ref, account) = create_fakecm_account(q, bus, mc, params) account_path = account.__dbus_object_path__ # Check the account is correctly created properties = account_manager.GetAll(cs.AM, dbus_interface=cs.PROPERTIES_IFACE) assert properties is not None assert properties.get('ValidAccounts') == [account_path], properties account_path = properties['ValidAccounts'][0] assert isinstance(account_path, dbus.ObjectPath), repr(account_path) assert properties.get('InvalidAccounts') == [], properties account_iface = dbus.Interface(account, cs.ACCOUNT) account_props = dbus.Interface(account, cs.PROPERTIES_IFACE) # Introspect Account for debugging purpose account_introspected = account.Introspect( dbus_interface=cs.INTROSPECTABLE_IFACE) #print account_introspected # Check Account has D-Bus property interface properties = account_props.GetAll(cs.ACCOUNT) assert properties is not None assert properties.get('DisplayName') == 'fakeaccount', \ properties.get('DisplayName') assert properties.get('Icon') == '', properties.get('Icon') assert properties.get('Valid') == True, properties.get('Valid') assert properties.get('Enabled') == False, properties.get('Enabled') #assert properties.get('Nickname') == 'fakenick', properties.get('Nickname') assert properties.get('Parameters') == params, properties.get('Parameters') assert properties.get('Connection') == '/', properties.get('Connection') assert properties.get('NormalizedName') == '', \ properties.get('NormalizedName') interfaces = properties.get('Interfaces') assert cs.ACCOUNT_IFACE_AVATAR in interfaces, interfaces assert cs.ACCOUNT_IFACE_NOKIA_CONDITIONS in interfaces, interfaces # sanity check for k in properties: assert account_props.Get(cs.ACCOUNT, k) == properties[k], k # Alter some miscellaneous r/w properties call_async(q, account_props, 'Set', cs.ACCOUNT, 'DisplayName', 'Work account') q.expect_many( EventPattern('dbus-signal', path=account_path, signal='AccountPropertyChanged', interface=cs.ACCOUNT, args=[{'DisplayName': 'Work account'}]), EventPattern('dbus-signal', interface=cs.TEST_DBUS_ACCOUNT_PLUGIN_IFACE, signal='DeferringSetAttribute', args=[account_path, 'DisplayName', 'Work account']), EventPattern('dbus-signal', interface=cs.TEST_DBUS_ACCOUNT_PLUGIN_IFACE, signal='CommittingOne', args=[account_path]), EventPattern('dbus-method-call', interface=cs.TEST_DBUS_ACCOUNT_SERVICE_IFACE, method='UpdateAttributes', args=[account_path[len(cs.ACCOUNT_PATH_PREFIX):], {'DisplayName': 'Work account'}, {'DisplayName': 0}, # flags []], ), EventPattern('dbus-return', method='Set'), ) assert account_props.Get(cs.ACCOUNT, 'DisplayName') == 'Work account' call_async(q, account_props, 'Set', cs.ACCOUNT, 'Icon', 'im-jabber') q.expect_many( EventPattern('dbus-signal', path=account_path, signal='AccountPropertyChanged', interface=cs.ACCOUNT, args=[{'Icon': 'im-jabber'}]), EventPattern('dbus-signal', interface=cs.TEST_DBUS_ACCOUNT_PLUGIN_IFACE, signal='DeferringSetAttribute', args=[account_path, 'Icon', 'im-jabber']), EventPattern('dbus-signal', interface=cs.TEST_DBUS_ACCOUNT_PLUGIN_IFACE, signal='CommittingOne', args=[account_path]), EventPattern('dbus-method-call', interface=cs.TEST_DBUS_ACCOUNT_SERVICE_IFACE, method='UpdateAttributes', args=[account_path[len(cs.ACCOUNT_PATH_PREFIX):], {'Icon': 'im-jabber'}, {'Icon': 0}, # flags []], ), EventPattern('dbus-return', method='Set'), ) assert account_props.Get(cs.ACCOUNT, 'Icon') == 'im-jabber' assert account_props.Get(cs.ACCOUNT, 'HasBeenOnline') == False call_async(q, account_props, 'Set', cs.ACCOUNT, 'Nickname', 'Joe Bloggs') q.expect_many( EventPattern('dbus-signal', path=account_path, signal='AccountPropertyChanged', interface=cs.ACCOUNT, args=[{'Nickname': 'Joe Bloggs'}]), EventPattern('dbus-return', method='Set'), EventPattern('dbus-signal', interface=cs.TEST_DBUS_ACCOUNT_PLUGIN_IFACE, signal='DeferringSetAttribute', args=[account_path, 'Nickname', 'Joe Bloggs']), EventPattern('dbus-signal', interface=cs.TEST_DBUS_ACCOUNT_PLUGIN_IFACE, signal='CommittingOne', args=[account_path]), EventPattern('dbus-method-call', interface=cs.TEST_DBUS_ACCOUNT_SERVICE_IFACE, method='UpdateAttributes', args=[account_path[len(cs.ACCOUNT_PATH_PREFIX):], {'Nickname': 'Joe Bloggs'}, {'Nickname': 0}, # flags []], ), ) assert account_props.Get(cs.ACCOUNT, 'Nickname') == 'Joe Bloggs' call_async(q, account_props, 'Set', cs.ACCOUNT_IFACE_NOKIA_CONDITIONS, 'Condition', dbus.Dictionary({':foo': 'bar'}, signature='ss')) # there's no change notification for the Condition q.expect_many( EventPattern('dbus-return', method='Set'), EventPattern('dbus-signal', interface=cs.TEST_DBUS_ACCOUNT_PLUGIN_IFACE, signal='DeferringSetAttribute', args=[account_path, 'condition-:foo', 'bar']), EventPattern('dbus-signal', interface=cs.TEST_DBUS_ACCOUNT_PLUGIN_IFACE, signal='CommittingOne', args=[account_path]), EventPattern('dbus-method-call', interface=cs.TEST_DBUS_ACCOUNT_SERVICE_IFACE, method='UpdateAttributes', args=[account_path[len(cs.ACCOUNT_PATH_PREFIX):], {'condition-:foo': 'bar'}, {'condition-:foo': 0}, # flags []], ), ) assert account_props.Get(cs.ACCOUNT_IFACE_NOKIA_CONDITIONS, 'Condition') == {':foo': 'bar'} assertEquals(dbus.Array(signature='o'), account_props.Get(cs.ACCOUNT, 'Supersedes')) call_async(q, account_props, 'Set', cs.ACCOUNT, 'Supersedes', dbus.Array([cs.ACCOUNT_PATH_PREFIX + 'x/y/z'], signature='o')) q.expect_many( EventPattern('dbus-signal', path=account_path, signal='AccountPropertyChanged', interface=cs.ACCOUNT, args=[{'Supersedes': [cs.ACCOUNT_PATH_PREFIX + 'x/y/z']}]), EventPattern('dbus-return', method='Set'), EventPattern('dbus-signal', interface=cs.TEST_DBUS_ACCOUNT_PLUGIN_IFACE, signal='DeferringSetAttribute', args=[account_path, 'Supersedes', [cs.ACCOUNT_PATH_PREFIX + 'x/y/z']]), EventPattern('dbus-signal', interface=cs.TEST_DBUS_ACCOUNT_PLUGIN_IFACE, signal='CommittingOne', args=[account_path]), EventPattern('dbus-method-call', interface=cs.TEST_DBUS_ACCOUNT_SERVICE_IFACE, method='UpdateAttributes', args=[account_path[len(cs.ACCOUNT_PATH_PREFIX):], {'Supersedes': [cs.ACCOUNT_PATH_PREFIX + 'x/y/z']}, {'Supersedes': 0}, # flags []], ), ) assertEquals(dbus.Array([cs.ACCOUNT_PATH_PREFIX + 'x/y/z'], signature='o'), account_props.Get(cs.ACCOUNT, 'Supersedes')) # Set some properties to invalidly typed values - this currently succeeds # but is a no-op, although in future it should change to raising an # exception forbidden = [ EventPattern('dbus-signal', interface=cs.TEST_DBUS_ACCOUNT_PLUGIN_IFACE, signal='DeferringSetAttribute'), EventPattern('dbus-method-call', interface=cs.TEST_DBUS_ACCOUNT_SERVICE_IFACE, method='UpdateAttributes'), ] q.forbid_events(forbidden) # this variable's D-Bus type must differ from the types of all known # properties badly_typed = dbus.Struct(('wrongly typed',), signature='s') for p in ('DisplayName', 'Icon', 'Enabled', 'Nickname', 'AutomaticPresence', 'ConnectAutomatically', 'RequestedPresence'): try: account_props.Set(cs.ACCOUNT, p, badly_typed) except dbus.DBusException, e: assert e.get_dbus_name() == cs.INVALID_ARGUMENT, \ (p, e.get_dbus_name()) else: raise AssertionError('Setting %s with wrong type should fail' % p) for p in ('Avatar',): try: account_props.Set(cs.ACCOUNT_IFACE_AVATAR, p, badly_typed) except dbus.DBusException, e: assert e.get_dbus_name() == cs.INVALID_ARGUMENT, \ (p, e.get_dbus_name()) else: raise AssertionError('Setting %s with wrong type should fail' % p) for p in ('Condition',): try: account_props.Set(cs.ACCOUNT_IFACE_NOKIA_CONDITIONS, p, badly_typed) except dbus.DBusException, e: assert e.get_dbus_name() == cs.INVALID_ARGUMENT, \ (p, e.get_dbus_name()) else: raise AssertionError('Setting %s with wrong type should fail' % p) # Make sure MC hasn't crashed yet, and make sure some properties are what # we expect them to be properties = account_props.GetAll(cs.ACCOUNT) assert properties['DisplayName'] == 'Work account' assert properties['Icon'] == 'im-jabber' properties = account_props.GetAll(cs.ACCOUNT_IFACE_AVATAR) assert properties['Avatar'] == ([], '') q.unforbid_events(forbidden) # Delete the account call_async(q, account_iface, 'Remove') q.expect_many( EventPattern('dbus-return', method='Remove'), EventPattern('dbus-signal', path=account_path, signal='Removed', interface=cs.ACCOUNT, args=[] ), EventPattern('dbus-signal', path=cs.AM_PATH, signal='AccountRemoved', interface=cs.AM, args=[account_path] ), EventPattern('dbus-signal', interface=cs.TEST_DBUS_ACCOUNT_PLUGIN_IFACE, signal='DeferringDelete', args=[account_path]), EventPattern('dbus-signal', interface=cs.TEST_DBUS_ACCOUNT_PLUGIN_IFACE, signal='CommittingOne', args=[account_path]), EventPattern('dbus-method-call', interface=cs.TEST_DBUS_ACCOUNT_SERVICE_IFACE, method='DeleteAccount', args=[account_path[len(cs.ACCOUNT_PATH_PREFIX):]]), ) # Check the account is correctly deleted properties = account_manager.GetAll(cs.AM, dbus_interface=cs.PROPERTIES_IFACE) assert properties is not None assert properties.get('ValidAccounts') == [], properties assert properties.get('InvalidAccounts') == [], properties if __name__ == '__main__': exec_test(test, {}) telepathy-mission-control-5.16.4/tests/twisted/account-manager/reconnect.py0000644000175000017500000001741212735242352030252 0ustar00gkiagiagkiagia00000000000000# Copyright (C) 2009 Nokia Corporation # Copyright (C) 2009 Collabora Ltd. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA # 02110-1301 USA import dbus import dbus import dbus.service from servicetest import EventPattern, tp_name_prefix, tp_path_prefix, \ call_async, sync_dbus from mctest import exec_test, SimulatedConnection, create_fakecm_account,\ SimulatedChannel import constants as cs def test(q, bus, mc): cm_name_ref = dbus.service.BusName( tp_name_prefix + '.ConnectionManager.fakecm', bus=bus) # Create an account params = dbus.Dictionary({"account": "someguy@example.com", "password": "secrecy"}, signature='sv') (cm_name_ref, account) = create_fakecm_account(q, bus, mc, params) # Events that indicate that Reconnect might have done something looks_like_reconnection = [ EventPattern('dbus-method-call', method='RequestConnection'), EventPattern('dbus-method-call', method='Disconnect'), ] q.forbid_events(looks_like_reconnection) # While we want to be online but the account is disabled, Reconnect is a # no-op. Set Enabled to False explicitly, so we're less reliant on initial # state. call_async(q, account, 'Set', cs.ACCOUNT, 'Enabled', False, dbus_interface=cs.PROPERTIES_IFACE) q.expect('dbus-return', method='Set') requested_presence = dbus.Struct((dbus.UInt32(cs.PRESENCE_TYPE_AVAILABLE), dbus.String(u'available'), dbus.String(u''))) call_async(q, account, 'Set', cs.ACCOUNT, 'RequestedPresence', requested_presence, dbus_interface=cs.PROPERTIES_IFACE) q.expect('dbus-return', method='Set') call_async(q, account, 'Reconnect', dbus_interface=cs.ACCOUNT) q.expect('dbus-return', method='Reconnect') sync_dbus(bus, q, account) # While we want to be offline but the account is enabled, Reconnect is # still a no-op. requested_presence = dbus.Struct((dbus.UInt32(cs.PRESENCE_TYPE_OFFLINE), dbus.String(u'offline'), dbus.String(u''))) call_async(q, account, 'Set', cs.ACCOUNT, 'RequestedPresence', requested_presence, dbus_interface=cs.PROPERTIES_IFACE) q.expect_many( EventPattern('dbus-return', method='Set'), EventPattern('dbus-signal', path=account.object_path, signal='AccountPropertyChanged', interface=cs.ACCOUNT), ) # Enable the account call_async(q, account, 'Set', cs.ACCOUNT, 'Enabled', True, dbus_interface=cs.PROPERTIES_IFACE) q.expect_many( EventPattern('dbus-return', method='Set'), EventPattern('dbus-signal', path=account.object_path, signal='AccountPropertyChanged', interface=cs.ACCOUNT), ) call_async(q, account, 'Reconnect', dbus_interface=cs.ACCOUNT) q.expect('dbus-return', method='Reconnect') sync_dbus(bus, q, account) # Actually go online now q.unforbid_events(looks_like_reconnection) requested_presence = dbus.Struct((dbus.UInt32(cs.PRESENCE_TYPE_AVAILABLE), dbus.String(u'brb'), dbus.String(u'Be back soon!'))) account.Set(cs.ACCOUNT, 'RequestedPresence', requested_presence, dbus_interface=cs.PROPERTIES_IFACE) e = q.expect('dbus-method-call', method='RequestConnection', args=['fakeprotocol', params], destination=tp_name_prefix + '.ConnectionManager.fakecm', path=tp_path_prefix + '/ConnectionManager/fakecm', interface=tp_name_prefix + '.ConnectionManager', handled=False) conn = SimulatedConnection(q, bus, 'fakecm', 'fakeprotocol', '_', 'myself') q.dbus_return(e.message, conn.bus_name, conn.object_path, signature='so') # MC does some setup, including fetching the list of Channels q.expect_many( EventPattern('dbus-method-call', interface=cs.PROPERTIES_IFACE, method='GetAll', args=[cs.CONN_IFACE_REQUESTS], path=conn.object_path, handled=True), ) # MC calls GetStatus (maybe) and then Connect q.expect('dbus-method-call', method='Connect', path=conn.object_path, handled=True) # Connect succeeds conn.StatusChanged(cs.CONN_STATUS_CONNECTED, cs.CONN_STATUS_REASON_NONE) # Assert that the NormalizedName is harvested from the Connection at some # point while 1: e = q.expect('dbus-signal', interface=cs.ACCOUNT, signal='AccountPropertyChanged', path=account.object_path) if 'NormalizedName' in e.args[0]: assert e.args[0]['NormalizedName'] == 'myself', e.args break # Check the requested presence is online properties = account.GetAll(cs.ACCOUNT, dbus_interface=cs.PROPERTIES_IFACE) assert properties is not None assert properties.get('RequestedPresence') == requested_presence, \ properties.get('RequestedPresence') # Reconnect account.Reconnect(dbus_interface=cs.ACCOUNT) q.expect('dbus-method-call', method='Disconnect', path=conn.object_path, handled=True) e = q.expect('dbus-method-call', method='RequestConnection', args=['fakeprotocol', params], destination=tp_name_prefix + '.ConnectionManager.fakecm', path=tp_path_prefix + '/ConnectionManager/fakecm', interface=tp_name_prefix + '.ConnectionManager', handled=False) # The object path needs to be different from the first simulated # connection which we made above, because the object isn't removed # from this bus and it's actually hard to do so because it's not # really on a bus, it's on the queue. So let's just change the # object path and it's fine. conn = SimulatedConnection(q, bus, 'fakecm', 'fakeprotocol', 'second', 'myself') q.dbus_return(e.message, conn.bus_name, conn.object_path, signature='so') q.expect_many( EventPattern('dbus-method-call', interface=cs.PROPERTIES_IFACE, method='GetAll', args=[cs.CONN_IFACE_REQUESTS], path=conn.object_path, handled=True), ) q.expect('dbus-method-call', method='Connect', path=conn.object_path, handled=True) conn.StatusChanged(cs.CONN_STATUS_CONNECTED, cs.CONN_STATUS_REASON_NONE) # Put the account offline requested_presence = (dbus.UInt32(cs.PRESENCE_TYPE_OFFLINE), 'offline', '') account.Set(cs.ACCOUNT, 'RequestedPresence', requested_presence, dbus_interface=cs.PROPERTIES_IFACE) # In response, MC tells us to Disconnect, and we do q.expect('dbus-method-call', method='Disconnect', path=conn.object_path, handled=True) properties = account.GetAll(cs.ACCOUNT, dbus_interface=cs.PROPERTIES_IFACE) assert properties['Connection'] == '/' assert properties['ConnectionStatus'] == cs.CONN_STATUS_DISCONNECTED assert properties['CurrentPresence'] == requested_presence assert properties['RequestedPresence'] == requested_presence if __name__ == '__main__': exec_test(test, {}) telepathy-mission-control-5.16.4/tests/twisted/account-manager/req-conn-fails.py0000644000175000017500000000454112735242352031107 0ustar00gkiagiagkiagia00000000000000# vim: set fileencoding=utf-8 : # # Copyright © 2011-2012 Collabora Ltd. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA # 02110-1301 USA import dbus from servicetest import ( tp_name_prefix, tp_path_prefix, assertEquals, ) from mctest import ( exec_test, create_fakecm_account, SimulatedConnection, ) import constants as cs def test(q, bus, mc): params = dbus.Dictionary( {"account": "someguy@example.com", "password": "secrecy", }, signature='sv') (cm_name_ref, account) = create_fakecm_account(q, bus, mc, params) account.Properties.Set(cs.ACCOUNT, 'Enabled', True) # Set online presence presence = dbus.Struct( (dbus.UInt32(cs.PRESENCE_TYPE_BUSY), 'busy', 'Fixing MC bugs'), signature='uss') account.Properties.Set(cs.ACCOUNT, 'RequestedPresence', presence) e = q.expect('dbus-method-call', method='RequestConnection', args=['fakeprotocol', params], destination=tp_name_prefix + '.ConnectionManager.fakecm', path=tp_path_prefix + '/ConnectionManager/fakecm', interface=tp_name_prefix + '.ConnectionManager', handled=False) q.dbus_raise(e.message, cs.NOT_IMPLEMENTED, "CM is broken") # MC should report the connection dying. e = q.expect('dbus-signal', signal='AccountPropertyChanged', predicate=lambda e: 'ConnectionError' in e.args[0]) changed, = e.args assertEquals('/', changed['Connection']) assertEquals(cs.CONN_STATUS_DISCONNECTED, changed['ConnectionStatus']) assertEquals(cs.CONN_STATUS_REASON_NONE, changed['ConnectionStatusReason']) assertEquals(cs.NOT_IMPLEMENTED, changed['ConnectionError']) if __name__ == '__main__': exec_test(test) telepathy-mission-control-5.16.4/tests/twisted/account-manager/avatar.py0000644000175000017500000001757012762070301027546 0ustar00gkiagiagkiagia00000000000000# Copyright (C) 2009 Nokia Corporation # Copyright (C) 2009 Collabora Ltd. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA # 02110-1301 USA import os import dbus import dbus.service from servicetest import EventPattern, tp_name_prefix, tp_path_prefix, \ call_async, assertEquals from mctest import exec_test, create_fakecm_account, enable_fakecm_account import constants as cs def test(q, bus, mc): params = dbus.Dictionary({"account": "me@example.com", "password": "secrecy"}, signature='sv') (cm_name_ref, account) = create_fakecm_account(q, bus, mc, params) account_iface = dbus.Interface(account, cs.ACCOUNT) account_props = dbus.Interface(account, cs.PROPERTIES_IFACE) assertEquals(cs.ACCOUNT_PATH_PREFIX, account.object_path[:len(cs.ACCOUNT_PATH_PREFIX)]) avatar_filename = account.object_path[len(cs.ACCOUNT_PATH_PREFIX):] avatar_filename = avatar_filename.replace('/', '-') + '.avatar' avatar_filename = (os.environ['XDG_DATA_HOME'] + '/telepathy/mission-control/' + avatar_filename) call_async(q, account_props, 'Set', cs.ACCOUNT_IFACE_AVATAR, 'Avatar', dbus.Struct((dbus.ByteArray('AAAA'), 'image/jpeg'))) q.expect_many( EventPattern('dbus-signal', path=account.object_path, signal='AvatarChanged', interface=cs.ACCOUNT_IFACE_AVATAR, args=[]), EventPattern('dbus-return', method='Set'), EventPattern('dbus-signal', interface=cs.TEST_DBUS_ACCOUNT_PLUGIN_IFACE, signal='DeferringSetAttribute', args=[account.object_path, 'AvatarMime', 'image/jpeg']), EventPattern('dbus-signal', interface=cs.TEST_DBUS_ACCOUNT_PLUGIN_IFACE, signal='CommittingOne', args=[account.object_path]), EventPattern('dbus-method-call', interface=cs.TEST_DBUS_ACCOUNT_SERVICE_IFACE, method='UpdateAttributes'), ) assert account_props.Get(cs.ACCOUNT_IFACE_AVATAR, 'Avatar', byte_arrays=True) == ('AAAA', 'image/jpeg') assertEquals('AAAA', ''.join(open(avatar_filename, 'r').readlines())) # We aren't storing in the old location assert not os.path.exists(os.environ['MC_ACCOUNT_DIR'] + '/fakecm') # OK, let's go online. The avatar is set regardless of the CM conn, e = enable_fakecm_account(q, bus, mc, account, params, has_avatars=True, avatars_persist=True, expect_after_connect=[ EventPattern('dbus-method-call', interface=cs.CONN_IFACE_AVATARS, method='SetAvatar', handled=True, args=['AAAA', 'image/jpeg']), ]) # Change avatar after going online call_async(q, account_props, 'Set', cs.ACCOUNT_IFACE_AVATAR, 'Avatar', (dbus.ByteArray('BBBB'), 'image/png')) q.expect_many( EventPattern('dbus-method-call', interface=cs.CONN_IFACE_AVATARS, method='SetAvatar', args=['BBBB', 'image/png'], handled=True), EventPattern('dbus-signal', path=account.object_path, interface=cs.ACCOUNT_IFACE_AVATAR, signal='AvatarChanged'), EventPattern('dbus-return', method='Set'), EventPattern('dbus-signal', interface=cs.TEST_DBUS_ACCOUNT_PLUGIN_IFACE, signal='DeferringSetAttribute', args=[account.object_path, 'AvatarMime', 'image/png']), EventPattern('dbus-signal', interface=cs.TEST_DBUS_ACCOUNT_PLUGIN_IFACE, signal='CommittingOne', args=[account.object_path]), EventPattern('dbus-method-call', interface=cs.TEST_DBUS_ACCOUNT_SERVICE_IFACE, method='UpdateAttributes'), ) assert account_props.Get(cs.ACCOUNT_IFACE_AVATAR, 'Avatar', byte_arrays=True) == ('BBBB', 'image/png') assertEquals('BBBB', ''.join(open(avatar_filename, 'r').readlines())) assert not os.path.exists(os.environ['MC_ACCOUNT_DIR'] + '/fakecm') someone_else = conn.ensure_handle(cs.HT_CONTACT, 'alberto@example.com') # Another contact changes their avatar: ignored q.dbus_emit(conn.object_path, cs.CONN_IFACE_AVATARS, 'AvatarUpdated', someone_else, "mardy's avatar token", signature='us') # Another client changes our avatar remotely q.dbus_emit(conn.object_path, cs.CONN_IFACE_AVATARS, 'AvatarUpdated', conn.self_handle, 'CCCC', signature='us') e = q.expect('dbus-method-call', interface=cs.CONN_IFACE_AVATARS, method='RequestAvatars', args=[[conn.self_handle]], handled=False) q.dbus_return(e.message, signature='') q.dbus_emit(conn.object_path, cs.CONN_IFACE_AVATARS, 'AvatarRetrieved', conn.self_handle, 'CCCC', dbus.ByteArray('CCCC'), 'image/svg', signature='usays') q.expect_many( EventPattern('dbus-signal', path=account.object_path, interface=cs.ACCOUNT_IFACE_AVATAR, signal='AvatarChanged'), EventPattern('dbus-signal', interface=cs.TEST_DBUS_ACCOUNT_PLUGIN_IFACE, signal='DeferringSetAttribute', args=[account.object_path, 'avatar_token', 'CCCC']), EventPattern('dbus-signal', interface=cs.TEST_DBUS_ACCOUNT_PLUGIN_IFACE, signal='CommittingOne', args=[account.object_path]), EventPattern('dbus-method-call', interface=cs.TEST_DBUS_ACCOUNT_SERVICE_IFACE, method='UpdateAttributes'), ) assert account_props.Get(cs.ACCOUNT_IFACE_AVATAR, 'Avatar', byte_arrays=True) == ('CCCC', 'image/svg') assertEquals('CCCC', ''.join(open(avatar_filename, 'r').readlines())) # empty avatar tests conn.forget_avatar() q.dbus_emit(conn.object_path, cs.CONN_IFACE_AVATARS, 'AvatarUpdated', conn.self_handle, '', signature='us') q.expect_many( EventPattern('dbus-signal', interface=cs.TEST_DBUS_ACCOUNT_PLUGIN_IFACE, signal='DeferringSetAttribute', args=[account.object_path, 'avatar_token', '']), EventPattern('dbus-signal', interface=cs.TEST_DBUS_ACCOUNT_PLUGIN_IFACE, signal='DeferringSetAttribute', args=[account.object_path, 'AvatarMime', '']), EventPattern('dbus-signal', path=account.object_path, interface=cs.ACCOUNT_IFACE_AVATAR, signal='AvatarChanged'), EventPattern('dbus-signal', interface=cs.TEST_DBUS_ACCOUNT_PLUGIN_IFACE, signal='CommittingOne', args=[account.object_path]), EventPattern('dbus-method-call', interface=cs.TEST_DBUS_ACCOUNT_SERVICE_IFACE, method='UpdateAttributes'), ) assertEquals(account_props.Get(cs.ACCOUNT_IFACE_AVATAR, 'Avatar', byte_arrays=False), ([], '')) # empty avatars are represented by an empty file, not no file, # to get the right precedence over XDG_DATA_DIRS assertEquals('', ''.join(open(avatar_filename, 'r').readlines())) if __name__ == '__main__': exec_test(test, {}) telepathy-mission-control-5.16.4/tests/twisted/account-manager/auto-connect.py0000644000175000017500000002011012735242352030656 0ustar00gkiagiagkiagia00000000000000# Copyright (C) 2009 Nokia Corporation # Copyright (C) 2009 Collabora Ltd. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA # 02110-1301 USA import dbus """Feature test for automatically signing in and setting presence etc. """ import os import dbus import dbus.service from servicetest import EventPattern, tp_name_prefix, tp_path_prefix, \ call_async, assertEquals from mctest import exec_test, SimulatedConnection, create_fakecm_account, MC import constants as cs cm_name_ref = dbus.service.BusName( cs.tp_name_prefix + '.ConnectionManager.fakecm', bus=dbus.SessionBus()) account_id = 'fakecm/fakeprotocol/jc_2edenton_40unatco_2eint' def preseed(q, bus, fake_accounts_service): accounts_dir = os.environ['MC_ACCOUNT_DIR'] try: os.mkdir(accounts_dir, 0700) except OSError: pass fake_accounts_service.update_attributes(account_id, changed={ 'manager': 'fakecm', 'protocol': 'fakeprotocol', 'DisplayName': 'Work account', 'NormalizedName': 'jc.denton@unatco.int', 'Enabled': True, 'ConnectAutomatically': True, # These are in the old format. They'll be combined shortly. 'AutomaticPresenceType': dbus.UInt32(2), 'AutomaticPresenceStatus': 'available', 'AutomaticPresenceMessage': 'My vision is augmented', 'Nickname': 'JC', 'AvatarMime': 'image/jpeg', }) # As a regression test for part of fd.o #28557, the password starts and # ends with a double backslash, which is represented in the file as a # quadruple backslash. We use the untyped-parameters dict in order to # exercise that. fake_accounts_service.update_parameters(account_id, untyped={ 'account': 'jc.denton@unatco.int', 'password': r'\\\\ionstorm\\\\', }) os.makedirs(accounts_dir + '/' + account_id) avatar_bin = open(accounts_dir + '/' + account_id + '/avatar.bin', 'w') avatar_bin.write('Deus Ex') avatar_bin.close() account_connections_file = open(accounts_dir + '/.mc_connections', 'w') account_connections_file.write("") account_connections_file.close() def test(q, bus, unused, **kwargs): fake_accounts_service = kwargs['fake_accounts_service'] preseed(q, bus, fake_accounts_service) expected_params = { 'account': 'jc.denton@unatco.int', 'password': r'\\ionstorm\\', } mc = MC(q, bus, wait_for_names=False) mc.wait_for_names( # Migration step: the three separate attributes get combined # (before the names are taken, so we need to expect it here) EventPattern('dbus-method-call', interface=cs.TEST_DBUS_ACCOUNT_SERVICE_IFACE, method='UpdateAttributes', predicate=(lambda e: e.args[0] == account_id and e.args[1] == {'AutomaticPresence': (2, 'available', 'My vision is augmented')} and e.args[2] == {'AutomaticPresence': 0} and # flags set(e.args[3]) == set([ # no particular order 'AutomaticPresenceType', 'AutomaticPresenceStatus', 'AutomaticPresenceMessage', ]))) ) request_conn, prop_changed = q.expect_many( EventPattern('dbus-method-call', method='RequestConnection', args=['fakeprotocol', expected_params], destination=cs.tp_name_prefix + '.ConnectionManager.fakecm', path=cs.tp_path_prefix + '/ConnectionManager/fakecm', interface=cs.tp_name_prefix + '.ConnectionManager', handled=False), EventPattern('dbus-signal', signal='AccountPropertyChanged', predicate=(lambda e: 'ConnectionStatus' in e.args[0])), ) conn = SimulatedConnection(q, bus, 'fakecm', 'fakeprotocol', '_', 'myself', has_presence=True, has_aliasing=True, has_avatars=True) assertEquals('/', prop_changed.args[0].get('Connection')) assertEquals('', prop_changed.args[0].get('ConnectionError')) assertEquals({}, prop_changed.args[0].get('ConnectionErrorDetails')) assertEquals(cs.CONN_STATUS_CONNECTING, prop_changed.args[0].get('ConnectionStatus')) assertEquals(cs.CONN_STATUS_REASON_REQUESTED, prop_changed.args[0].get('ConnectionStatusReason')) q.dbus_return(request_conn.message, conn.bus_name, conn.object_path, signature='so') account_path = (cs.tp_path_prefix + '/Account/' + account_id) account = bus.get_object( cs.tp_name_prefix + '.AccountManager', account_path) prop_changed, _ = q.expect_many( EventPattern('dbus-signal', signal='AccountPropertyChanged', predicate=(lambda e: 'ConnectionStatus' in e.args[0])), EventPattern('dbus-method-call', method='Connect', path=conn.object_path, handled=True, interface=cs.CONN), ) assertEquals(conn.object_path, prop_changed.args[0].get('Connection')) assertEquals('', prop_changed.args[0].get('ConnectionError')) assertEquals({}, prop_changed.args[0].get('ConnectionErrorDetails')) assertEquals(cs.CONN_STATUS_CONNECTING, prop_changed.args[0].get('ConnectionStatus')) assertEquals(cs.CONN_STATUS_REASON_REQUESTED, prop_changed.args[0].get('ConnectionStatusReason')) props = account.GetAll(cs.ACCOUNT, dbus_interface=cs.PROPERTIES_IFACE) assert props['Connection'] == conn.object_path assert props['ConnectionStatus'] == cs.CONN_STATUS_CONNECTING assert props['ConnectionStatusReason'] == cs.CONN_STATUS_REASON_REQUESTED print "becoming connected" conn.StatusChanged(cs.CONN_STATUS_CONNECTED, cs.CONN_STATUS_REASON_NONE) set_aliases, set_presence, set_avatar, prop_changed = q.expect_many( EventPattern('dbus-method-call', interface=cs.CONN_IFACE_ALIASING, method='SetAliases', args=[{ conn.self_handle: 'JC' }], handled=False), EventPattern('dbus-method-call', path=conn.object_path, interface=cs.CONN_IFACE_SIMPLE_PRESENCE, method='SetPresence', handled=True), EventPattern('dbus-method-call', interface=cs.CONN_IFACE_AVATARS, method='SetAvatar', args=['Deus Ex', 'image/jpeg'], handled=True), EventPattern('dbus-signal', signal='AccountPropertyChanged', path=account_path, interface=cs.ACCOUNT, predicate=(lambda e: e.args[0].get('ConnectionStatus') == cs.CONN_STATUS_CONNECTED), ), ) assertEquals(conn.object_path, prop_changed.args[0].get('Connection')) assertEquals('', prop_changed.args[0].get('ConnectionError')) assertEquals({}, prop_changed.args[0].get('ConnectionErrorDetails')) assertEquals(cs.CONN_STATUS_CONNECTED, prop_changed.args[0].get('ConnectionStatus')) assertEquals(cs.CONN_STATUS_REASON_REQUESTED, prop_changed.args[0].get('ConnectionStatusReason')) assert account.Get(cs.ACCOUNT, 'CurrentPresence', dbus_interface=cs.PROPERTIES_IFACE) == (cs.PRESENCE_TYPE_AVAILABLE, 'available', 'My vision is augmented') q.dbus_return(set_aliases.message, signature='') if __name__ == '__main__': exec_test(test, {}, preload_mc=False, use_fake_accounts_service=True, pass_kwargs=True) telepathy-mission-control-5.16.4/tests/twisted/account-manager/recover-from-disconnect.py0000644000175000017500000002007412735242352033025 0ustar00gkiagiagkiagia00000000000000# Copyright (C) 2009 Nokia Corporation # Copyright (C) 2009-2010 Collabora Ltd. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA # 02110-1301 USA import dbus from servicetest import (EventPattern, tp_name_prefix, tp_path_prefix, call_async, assertEquals) from mctest import exec_test, SimulatedConnection, create_fakecm_account import constants as cs def test(q, bus, mc): # Create an account. We're setting register=True here to verify # that after one successful connection, it'll be removed (fd.o #28118). params = dbus.Dictionary({"account": "someguy@example.com", "password": "secrecy", "register": True}, signature='sv') (cm_name_ref, account) = create_fakecm_account(q, bus, mc, params) call_async(q, account.Properties, 'Set', cs.ACCOUNT, 'Enabled', False) q.expect('dbus-return', method='Set') # Enable the account call_async(q, account.Properties, 'Set', cs.ACCOUNT, 'Enabled', True) # Set online presence presence = dbus.Struct((dbus.UInt32(cs.PRESENCE_TYPE_BUSY), 'busy', 'Fixing MC bugs'), signature='uss') call_async(q, account.Properties, 'Set', cs.ACCOUNT, 'RequestedPresence', presence) e = q.expect('dbus-method-call', method='RequestConnection', args=['fakeprotocol', params], destination=tp_name_prefix + '.ConnectionManager.fakecm', path=tp_path_prefix + '/ConnectionManager/fakecm', interface=tp_name_prefix + '.ConnectionManager', handled=False) conn = SimulatedConnection(q, bus, 'fakecm', 'fakeprotocol', '_', 'myself', has_presence=True) q.dbus_return(e.message, conn.bus_name, conn.object_path, signature='so') # MC calls GetStatus (maybe) and then Connect q.expect('dbus-method-call', method='Connect', path=conn.object_path, handled=True) # Connect succeeds conn.StatusChanged(cs.CONN_STATUS_CONNECTED, cs.CONN_STATUS_REASON_NONE) q.expect('dbus-method-call', interface=cs.CONN_IFACE_SIMPLE_PRESENCE, method='SetPresence', args=list(presence[1:]), handled=True) # Connection falls over for a miscellaneous reason conn.ConnectionError('com.example.My.Network.Is.Full.Of.Eels', {'eels': 23, 'capacity': 23, 'debug-message': 'Too many eels'}) conn.StatusChanged(cs.CONN_STATUS_DISCONNECTED, cs.CONN_STATUS_REASON_NETWORK_ERROR) # MC reconnects. This time, we expect it to have deleted the 'register' # parameter. del params['register'] disconnected, connecting, e = q.expect_many( EventPattern('dbus-signal', signal='AccountPropertyChanged', predicate=(lambda e: e.args[0].get('ConnectionStatus') == cs.CONN_STATUS_DISCONNECTED), ), EventPattern('dbus-signal', signal='AccountPropertyChanged', predicate=(lambda e: e.args[0].get('ConnectionStatus') == cs.CONN_STATUS_CONNECTING), ), EventPattern('dbus-method-call', method='RequestConnection', args=['fakeprotocol', params], destination=tp_name_prefix + '.ConnectionManager.fakecm', path=tp_path_prefix + '/ConnectionManager/fakecm', interface=tp_name_prefix + '.ConnectionManager', handled=False), ) assertEquals('/', disconnected.args[0].get('Connection')) assertEquals('com.example.My.Network.Is.Full.Of.Eels', disconnected.args[0].get('ConnectionError')) assertEquals( {'eels': 23, 'capacity': 23, 'debug-message': 'Too many eels'}, disconnected.args[0].get('ConnectionErrorDetails')) assertEquals(cs.CONN_STATUS_DISCONNECTED, disconnected.args[0].get('ConnectionStatus')) assertEquals(cs.CONN_STATUS_REASON_NETWORK_ERROR, disconnected.args[0].get('ConnectionStatusReason')) assertEquals('/', connecting.args[0].get('Connection')) assertEquals('com.example.My.Network.Is.Full.Of.Eels', connecting.args[0].get('ConnectionError')) assertEquals( {'eels': 23, 'capacity': 23, 'debug-message': 'Too many eels'}, connecting.args[0].get('ConnectionErrorDetails')) assertEquals(cs.CONN_STATUS_CONNECTING, connecting.args[0].get('ConnectionStatus')) assertEquals(cs.CONN_STATUS_REASON_REQUESTED, connecting.args[0].get('ConnectionStatusReason')) # The object path needs to be different from the first simulated # connection which we made above, because the object isn't removed # from this bus and it's actually hard to do so because it's not # really on a bus, it's on the queue. So let's just change the # object path and it's fine. conn = SimulatedConnection(q, bus, 'fakecm', 'fakeprotocol', 'second', 'myself', has_presence=True) q.dbus_return(e.message, conn.bus_name, conn.object_path, signature='so') # MC calls GetStatus (maybe) and then Connect connecting, _ = q.expect_many( EventPattern('dbus-signal', signal='AccountPropertyChanged', predicate=(lambda e: e.args[0].get('ConnectionStatus') == cs.CONN_STATUS_CONNECTING), ), EventPattern('dbus-method-call', method='Connect', path=conn.object_path, handled=True), ) assertEquals(conn.object_path, connecting.args[0].get('Connection')) assertEquals('com.example.My.Network.Is.Full.Of.Eels', connecting.args[0].get('ConnectionError')) assertEquals( {'eels': 23, 'capacity': 23, 'debug-message': 'Too many eels'}, connecting.args[0].get('ConnectionErrorDetails')) assertEquals(cs.CONN_STATUS_CONNECTING, connecting.args[0].get('ConnectionStatus')) assertEquals(cs.CONN_STATUS_REASON_REQUESTED, connecting.args[0].get('ConnectionStatusReason')) assertEquals('com.example.My.Network.Is.Full.Of.Eels', account.Properties.Get(cs.ACCOUNT, 'ConnectionError')) assertEquals( {'eels': 23, 'capacity': 23, 'debug-message': 'Too many eels'}, account.Properties.Get(cs.ACCOUNT, 'ConnectionErrorDetails')) # Connect succeeds conn.StatusChanged(cs.CONN_STATUS_CONNECTED, cs.CONN_STATUS_REASON_NONE) connected, _ = q.expect_many( EventPattern('dbus-signal', signal='AccountPropertyChanged', predicate=(lambda e: e.args[0].get('ConnectionStatus') == cs.CONN_STATUS_CONNECTED), ), EventPattern('dbus-method-call', interface=cs.CONN_IFACE_SIMPLE_PRESENCE, method='SetPresence', args=list(presence[1:]), handled=True), ) assertEquals(conn.object_path, connected.args[0].get('Connection')) assertEquals('', connected.args[0].get('ConnectionError')) assertEquals({}, connected.args[0].get('ConnectionErrorDetails')) assertEquals(cs.CONN_STATUS_CONNECTED, connected.args[0].get('ConnectionStatus')) assertEquals(cs.CONN_STATUS_REASON_REQUESTED, connected.args[0].get('ConnectionStatusReason')) assertEquals('', account.Properties.Get(cs.ACCOUNT, 'ConnectionError')) assertEquals({}, account.Properties.Get(cs.ACCOUNT, 'ConnectionErrorDetails')) if __name__ == '__main__': exec_test(test, {}) telepathy-mission-control-5.16.4/tests/twisted/account-manager/bad-cm.py0000644000175000017500000000600412735242352027410 0ustar00gkiagiagkiagia00000000000000# Copyright (C) 2009 Nokia Corporation # Copyright (C) 2009 Collabora Ltd. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA # 02110-1301 USA """Regression test for https://bugs.freedesktop.org/show_bug.cgi?id=20880 """ import dbus from servicetest import call_async, assertEquals, assertContains from mctest import exec_test, AccountManager import constants as cs def test(q, bus, mc): am = AccountManager(bus) def call_create(cm='fakecm', protocol='fakeprotocol', parameters=None): if parameters is None: parameters = {"account": "someguy@example.com", "password": "secrecy", } call_async(q, am, 'CreateAccount', cm, protocol, 'this is a beautiful account', dbus.Dictionary(parameters, signature='sv'), {}) # Create an account with a bad Connection_Manager - it should fail call_create(cm='nonexistent_cm') e = q.expect('dbus-error', method='CreateAccount') assertEquals(cs.NOT_IMPLEMENTED, e.name) assertContains("nonexistent_cm", e.message) # Create an account with a bad Protocol - it should fail call_create(protocol='nonexistent-protocol') e = q.expect('dbus-error', method='CreateAccount') assertEquals(cs.NOT_IMPLEMENTED, e.name) assertContains("nonexistent-protocol", e.message) # Create an account with incomplete Parameters - it should fail call_create(parameters={"account": "someguy@example.com"}) e = q.expect('dbus-error', method='CreateAccount') assertEquals(cs.INVALID_ARGUMENT, e.name) assertContains("password", e.message) # Create an account with unknown parameters call_create(parameters={ "account": "someguy@example.com", "password": "secrecy", "deerhoof": "evil", }) e = q.expect('dbus-error', method='CreateAccount') assertEquals(cs.INVALID_ARGUMENT, e.name) assertContains("deerhoof", e.message) # Create an account with parameters with the wrong types call_create(parameters={ "account": "someguy@example.com", "password": 1234, }) e = q.expect('dbus-error', method='CreateAccount') assertEquals(cs.INVALID_ARGUMENT, e.name) assertContains("password", e.message) if __name__ == '__main__': exec_test(test, {}) telepathy-mission-control-5.16.4/tests/twisted/account-manager/create-auto-connect.py0000644000175000017500000000531212735242352032126 0ustar00gkiagiagkiagia00000000000000# Copyright (C) 2009 Nokia Corporation # Copyright (C) 2009 Collabora Ltd. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA # 02110-1301 USA import dbus import dbus import dbus.service from servicetest import EventPattern, tp_name_prefix, tp_path_prefix, \ call_async from mctest import exec_test, create_fakecm_account import constants as cs def test(q, bus, mc): params = dbus.Dictionary({"account": "smcv@example.com", "password": "secrecy"}, signature='sv') (cm_name_ref, account) = create_fakecm_account(q, bus, mc, params) account_iface = dbus.Interface(account, cs.ACCOUNT) account_props = dbus.Interface(account, cs.PROPERTIES_IFACE) # Ensure that it's enabled but has offline RP call_async(q, account_props, 'Set', cs.ACCOUNT, 'RequestedPresence', (dbus.UInt32(cs.PRESENCE_TYPE_OFFLINE), 'offline', '')) q.expect('dbus-return', method='Set') call_async(q, account_props, 'Set', cs.ACCOUNT, 'AutomaticPresence', (dbus.UInt32(cs.PRESENCE_TYPE_BUSY), 'busy', 'Testing automatic presence')) q.expect('dbus-return', method='Set') q.expect('dbus-signal', signal='AccountPropertyChanged', predicate=lambda e: e.args[0].get('AutomaticPresence', (None, None, None))[1] == 'busy') call_async(q, account_props, 'Set', cs.ACCOUNT, 'Enabled', True) q.expect('dbus-return', method='Set') q.expect('dbus-signal', signal='AccountPropertyChanged', predicate=lambda e: e.args[0].get('Enabled')) # Go online by telling it to connect automatically call_async(q, account_props, 'Set', cs.ACCOUNT, 'ConnectAutomatically', True) e = q.expect('dbus-method-call', method='RequestConnection', args=['fakeprotocol', params], destination=cs.tp_name_prefix + '.ConnectionManager.fakecm', path=cs.tp_path_prefix + '/ConnectionManager/fakecm', interface=cs.tp_name_prefix + '.ConnectionManager', handled=False) if __name__ == '__main__': exec_test(test, {}) telepathy-mission-control-5.16.4/tests/twisted/account-manager/avatar-refresh.py0000644000175000017500000003645112735242352031210 0ustar00gkiagiagkiagia00000000000000# Copyright (C) 2009 Nokia Corporation # Copyright (C) 2009 Collabora Ltd. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA # 02110-1301 USA import dbus """Feature test for signing in and setting an avatar, on CMs like Salut where the avatar must be reset every time you sign in. """ import os import dbus import dbus.service from servicetest import (EventPattern, tp_name_prefix, tp_path_prefix, call_async, assertEquals, sync_dbus) from mctest import exec_test, SimulatedConnection, create_fakecm_account, MC import constants as cs cm_name_ref = dbus.service.BusName( cs.tp_name_prefix + '.ConnectionManager.fakecm', bus=dbus.SessionBus()) class Account(object): def __init__(self, fake_accounts_service, accounts_dir, avatars_persist, server_delays, local_avatar, remote_avatar): self.avatars_persist = avatars_persist self.server_delays = server_delays self.local_avatar = local_avatar self.remote_avatar = remote_avatar if avatars_persist: s_persist = 'persist' else: s_persist = 'transient' if server_delays: s_delay = 'delay' else: s_delay = 'immediate' self.id = ('fakecm/fakeprotocol/%s_%s_L%s_R%s' % (s_persist, s_delay, local_avatar, remote_avatar)) fake_accounts_service.update_attributes(self.id, changed={ 'manager': 'fakecm', 'protocol': 'fakeprotocol', 'DisplayName': 'Test account', 'NormalizedName': 'jc.denton@unatco.int', 'Enabled': False, 'ConnectAutomatically': True, 'AutomaticPresence': (dbus.UInt32(2), 'available', 'My vision is augmented'), 'Nickname': 'JC', }) fake_accounts_service.update_parameters(self.id, untyped={ 'account': self.id, 'password': self.id, }) self.avatar_location = None if local_avatar is not None: if local_avatar: mime = 'image/jpeg' if remote_avatar and avatars_persist: # exercise override of an avatar in $XDG_DATA_DIRS self.avatar_location = 'datadir' avatar_filename = self.id datadir = os.environ['XDG_DATA_DIRS'].split(':')[0] datadir += '/telepathy/mission-control' avatar_filename = ( avatar_filename.replace('/', '-') + '.avatar') if not os.path.isdir(datadir): os.makedirs(datadir) avatar_filename = datadir + '/' + avatar_filename avatar_bin = open(avatar_filename, 'w') avatar_bin.write(local_avatar) avatar_bin.close() elif not avatars_persist: self.avatar_location = 'old' # exercise migration from ~/.mission-control in a # situation where MC should "win" os.makedirs(accounts_dir + '/' + self.id) avatar_bin = open( accounts_dir + '/' + self.id + '/avatar.bin', 'w') avatar_bin.write(local_avatar) avatar_bin.close() else: # store it in the normal location self.avatar_location = 'home' avatar_filename = self.id datadir = os.environ['XDG_DATA_HOME'] datadir += '/telepathy/mission-control' avatar_filename = ( avatar_filename.replace('/', '-') + '.avatar') if not os.path.isdir(datadir): os.makedirs(datadir) avatar_filename = datadir + '/' + avatar_filename avatar_bin = open(avatar_filename, 'w') avatar_bin.write(local_avatar) avatar_bin.close() else: mime = '' if local_avatar == 'old': # the fake CM just uses the avatar string as its own token fake_accounts_service.update_attributes(self.id, changed={ 'AvatarMime': mime, 'avatar_token': local_avatar, }) else: # either the local avatar is "no avatar", or it was set # while offline so we don't know its token fake_accounts_service.update_attributes(self.id, changed={ 'AvatarMime': mime, 'avatar_token': '', }) # Ideal behaviour: if local_avatar == 'new': # If the local avatar has been set since last login, MC # should upload it self.winner = 'MC' elif local_avatar and not avatars_persist: # If we have an avatar and it doesn't persist, MC should # upload it self.winner = 'MC' elif avatars_persist and remote_avatar: # If the server stores our avatar, MC should download it self.winner = 'service' else: # Nobody has an avatar - nothing should happen self.winner = None def test(self, q, bus, mc): expected_params = { 'account': self.id, 'password': self.id, } account_path = (cs.ACCOUNT_PATH_PREFIX + self.id) account_proxy = bus.get_object(cs.AM, account_path) account_proxy.Set(cs.ACCOUNT, 'Enabled', True, dbus_interface=cs.PROPERTIES_IFACE) e = q.expect('dbus-method-call', method='RequestConnection', args=['fakeprotocol', expected_params], destination=cs.tp_name_prefix + '.ConnectionManager.fakecm', path=cs.tp_path_prefix + '/ConnectionManager/fakecm', interface=cs.tp_name_prefix + '.ConnectionManager', handled=False) if self.remote_avatar is None: initial_avatar = None elif self.remote_avatar: initial_avatar = dbus.Struct((dbus.ByteArray(self.remote_avatar), 'text/plain'), signature='ays') else: initial_avatar = dbus.Struct((dbus.ByteArray(''), ''), signature='ays') conn = SimulatedConnection(q, bus, 'fakecm', 'fakeprotocol', self.id.replace('fakecm/fakeprotocol/', ''), 'myself', has_avatars=True, avatars_persist=self.avatars_persist, server_delays_avatar=self.server_delays, initial_avatar=initial_avatar, ) q.dbus_return(e.message, conn.bus_name, conn.object_path, signature='so') forbidden = [] if self.winner != 'MC': forbidden.append( EventPattern('dbus-method-call', method='SetAvatar')) if self.winner != 'service': forbidden.append( EventPattern('dbus-signal', signal='AvatarChanged', path=account_path)) q.forbid_events(forbidden) q.expect('dbus-method-call', method='Connect', path=conn.object_path, handled=True, interface=cs.CONN) conn.StatusChanged(cs.CONN_STATUS_CONNECTED, cs.CONN_STATUS_REASON_NONE) if self.winner == 'MC': # MC should upload the avatar. _, e = q.expect_many( EventPattern('dbus-method-call', interface=cs.CONN_IFACE_AVATARS, method='SetAvatar', args=[self.local_avatar, 'image/jpeg'], handled=True), EventPattern('dbus-signal', signal='AccountPropertyChanged', path=account_path, interface=cs.ACCOUNT, predicate=(lambda e: e.args[0].get('ConnectionStatus') == cs.CONN_STATUS_CONNECTED), ), ) elif self.winner == 'service': # We haven't changed the avatar since we last signed in, so we # don't set it - on the contrary, we pick up the remote avatar # (which has changed since we were last here) to store it in the # Account, unless the token says there is no avatar. if conn.avatar[0]: request_avatars_call, e = q.expect_many( EventPattern('dbus-method-call', interface=cs.CONN_IFACE_AVATARS, method='RequestAvatars', args=[[conn.self_handle]], handled=False), EventPattern('dbus-signal', signal='AccountPropertyChanged', path=account_path, interface=cs.ACCOUNT, predicate=(lambda e: e.args[0].get('ConnectionStatus') == cs.CONN_STATUS_CONNECTED), ), ) q.dbus_return(request_avatars_call.message, signature='') q.dbus_emit(conn.object_path, cs.CONN_IFACE_AVATARS, 'AvatarRetrieved', conn.self_handle, str(conn.avatar[0]), dbus.ByteArray(conn.avatar[0]), conn.avatar[1], signature='usays') q.expect('dbus-signal', path=account_path, interface=cs.ACCOUNT_IFACE_AVATAR, signal='AvatarChanged'), account_props = dbus.Interface(account_proxy, cs.PROPERTIES_IFACE) assert account_props.Get(cs.ACCOUNT_IFACE_AVATAR, 'Avatar', byte_arrays=True) == conn.avatar sync_dbus(bus, q, mc) q.unforbid_events(forbidden) if self.local_avatar: self.test_migration(bus, q, conn, account_proxy) def test_migration(self, bus, q, conn, account_proxy): if self.avatar_location == 'old': # The avatar got migrated to the new location. assert not os.path.exists(os.environ['MC_ACCOUNT_DIR'] + '/' + self.id + '/avatar.bin') assert not os.path.exists(os.environ['MC_ACCOUNT_DIR'] + '/fakecm') avatar_filename = self.id avatar_filename = avatar_filename.replace('/', '-') + '.avatar' avatar_filename = (os.environ['XDG_DATA_HOME'] + '/telepathy/mission-control/' + avatar_filename) assertEquals(conn.avatar[0], ''.join(open(avatar_filename, 'r').readlines())) elif self.avatar_location == 'datadir' and self.winner == 'service': # The avatar wasn't deleted from $XDG_DATA_DIRS, but it was # overridden. assert not os.path.exists(os.environ['MC_ACCOUNT_DIR'] + '/' + self.id + '/avatar.bin') assert not os.path.exists(os.environ['MC_ACCOUNT_DIR'] + '/fakecm') avatar_filename = self.id avatar_filename = avatar_filename.replace('/', '-') + '.avatar' avatar_filename = (os.environ['XDG_DATA_HOME'] + '/telepathy/mission-control/' + avatar_filename) assertEquals(self.remote_avatar, ''.join(open(avatar_filename, 'r').readlines())) datadirs = os.environ['XDG_DATA_DIRS'].split(':') low_prio_filename = self.id low_prio_filename = low_prio_filename.replace('/', '-') + '.avatar' low_prio_filename = (datadirs[0] + '/telepathy/mission-control/' + low_prio_filename) assertEquals(self.local_avatar, ''.join(open(low_prio_filename, 'r').readlines())) account_props = dbus.Interface(account_proxy, cs.PROPERTIES_IFACE) # If we set the avatar to be empty, that's written out as a file, # so it'll override the one in XDG_DATA_DIRS call_async(q, account_props, 'Set', cs.ACCOUNT_IFACE_AVATAR, 'Avatar', (dbus.ByteArray(''), '')) q.expect_many( EventPattern('dbus-method-call', interface=cs.CONN_IFACE_AVATARS, method='ClearAvatar', args=[]), EventPattern('dbus-signal', path=account_proxy.object_path, interface=cs.ACCOUNT_IFACE_AVATAR, signal='AvatarChanged'), EventPattern('dbus-return', method='Set') ) assert account_props.Get(cs.ACCOUNT_IFACE_AVATAR, 'Avatar', byte_arrays=True) == ('', '') assertEquals('', ''.join(open(avatar_filename, 'r').readlines())) assertEquals(self.local_avatar, ''.join(open(low_prio_filename, 'r').readlines())) def preseed(q, bus, fake_accounts_service): accounts = [] accounts_dir = os.environ['MC_ACCOUNT_DIR'] try: os.mkdir(accounts_dir, 0700) except OSError: pass account_connections_file = open(accounts_dir + '/.mc_connections', 'w') account_connections_file.write("") account_connections_file.close() i = 0 for local_avatar in ('new', 'old', '', None): # This is what the spec says Salut should do: omit the remote # avatar from the result of ContactAttributeInterfaces # and GetKnownAvatarTokens. accounts.append(Account(fake_accounts_service, accounts_dir, avatars_persist=False, server_delays=False, local_avatar=local_avatar, remote_avatar=None)) for have_remote_avatar in (True, False): for server_delays in (True, False): if have_remote_avatar: # the avatars have to be unique, otherwise the # avatar cache will break our RequestAvatars expectation remote_avatar = 'remote%d' % i i += 1 else: remote_avatar = '' accounts.append(Account(fake_accounts_service, accounts_dir, avatars_persist=True, server_delays=server_delays, local_avatar=local_avatar, remote_avatar=remote_avatar)) return accounts def test(q, bus, unused, **kwargs): fake_accounts_service = kwargs['fake_accounts_service'] accounts = preseed(q, bus, fake_accounts_service) mc = MC(q, bus) for account in accounts: account.test(q, bus, mc) if __name__ == '__main__': exec_test(test, {}, preload_mc=False, use_fake_accounts_service=True, pass_kwargs=True) telepathy-mission-control-5.16.4/tests/twisted/account-manager/hidden.py0000644000175000017500000001020412735242352027515 0ustar00gkiagiagkiagia00000000000000# vim: set fileencoding=utf-8 : thanks python! you've been great # Copyright © 2010 Nokia Corporation # Copyright © 2010 Collabora Ltd. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA # 02110-1301 USA from mctest import ( exec_test, create_fakecm_account, Account, AccountManager, tell_mc_to_die, resuscitate_mc, ) from servicetest import ( EventPattern, assertEquals, assertContains, assertDoesNotContain, call_async, ) import constants as cs def test_unhidden_account(q, bus, mc): """ Check that accounts don't default to being hidden, and don't show up in the lists of hidden accounts. """ am = AccountManager(bus) params = { "account": "oh", "password": "hai" } (cm_name_ref, account) = create_fakecm_account(q, bus, mc, params) assert not account.Properties.Get(cs.ACCOUNT_IFACE_HIDDEN, 'Hidden') am_hidden_props = am.Properties.GetAll(cs.AM_IFACE_HIDDEN) assertEquals([], am_hidden_props['ValidHiddenAccounts']) assertEquals([], am_hidden_props['InvalidHiddenAccounts']) def test_create_hidden_account(q, bus, mc): """ Check that a newly-created hidden account does not show up on the main AccountManager interface, but does show up on AM.I.Hidden, has its Hidden property set to True, and can be removed. """ am = AccountManager(bus) call_async(q, am.Properties, 'Get', cs.AM, 'SupportedAccountProperties') supported = q.expect('dbus-return', method='Get').value[0] assertContains(cs.ACCOUNT_IFACE_HIDDEN + '.Hidden', supported) # Make a new hidden account, and check that it really is hidden. params = { "account": "aperture@porti.co", "password": "tollgate" } properties = { cs.ACCOUNT_IFACE_HIDDEN + '.Hidden': True } q.forbid_events([ EventPattern('dbus-signal', path=cs.AM_PATH, signal='AccountValidityChanged', interface=cs.AM), ]) cm_name_ref, account = create_fakecm_account(q, bus, mc, params, properties) valid_accounts = am.Properties.Get(cs.AM, 'ValidAccounts') assertDoesNotContain(account.object_path, valid_accounts) valid_hidden_accounts = am.Properties.Get(cs.AM_IFACE_HIDDEN, 'ValidHiddenAccounts') assertContains(account.object_path, valid_hidden_accounts) # Blow MC away, revive it, and check that the account is still hidden. tell_mc_to_die(q, bus) am, properties, interfaces = resuscitate_mc(q, bus, mc) account = Account(bus, account.object_path) assert account.Properties.Get(cs.ACCOUNT_IFACE_HIDDEN, 'Hidden') assertDoesNotContain(account.object_path, properties['ValidAccounts']) valid_hidden_accounts = am.Properties.Get(cs.AM_IFACE_HIDDEN, 'ValidHiddenAccounts') assertContains(account.object_path, valid_hidden_accounts) # Delete the account, and check that its removal is signalled only on # AM.I.Hidden, not on the main AM interface. q.forbid_events([ EventPattern('dbus-signal', path=cs.AM_PATH, signal='AccountRemoved', interface=cs.AM, args=[account.object_path]), ]) account.Remove() q.expect_many( EventPattern('dbus-signal', path=cs.AM_PATH, signal='HiddenAccountRemoved', interface=cs.AM_IFACE_HIDDEN), EventPattern('dbus-signal', path=account.object_path, signal='Removed', interface=cs.ACCOUNT), ) def test(q, bus, mc): test_unhidden_account(q, bus, mc) test_create_hidden_account(q, bus, mc) if __name__ == '__main__': exec_test(test, {}, timeout=10) telepathy-mission-control-5.16.4/tests/twisted/account-manager/irc.py0000644000175000017500000001357012735242352027050 0ustar00gkiagiagkiagia00000000000000# encoding: utf-8 # # Test the odd things about IRC: it has no presence, and nicknames # are the same thing as identifiers. # # Copyright © 2009 Nokia Corporation # Copyright © 2009-2013 Collabora Ltd. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA # 02110-1301 USA import dbus import dbus import dbus.service from servicetest import (EventPattern, call_async, assertEquals, sync_dbus) from mctest import (exec_test, create_fakecm_account, enable_fakecm_account) import constants as cs def test(q, bus, mc): params = dbus.Dictionary({"account": "brucewayne", "password": "secrecy"}, signature='sv') (cm_name_ref, account) = create_fakecm_account(q, bus, mc, params) account_iface = dbus.Interface(account, cs.ACCOUNT) account_props = dbus.Interface(account, cs.PROPERTIES_IFACE) call_async(q, account_props, 'Set', cs.ACCOUNT, 'Nickname', "BruceWayne") q.expect_many( EventPattern('dbus-signal', path=account.object_path, signal='AccountPropertyChanged', interface=cs.ACCOUNT, args=[{'Nickname': "BruceWayne"}]), EventPattern('dbus-return', method='Set'), ) assertEquals("BruceWayne", account_props.Get(cs.ACCOUNT, 'Nickname')) expect_after_connect = [ EventPattern('dbus-method-call', interface=cs.CONN_IFACE_CONTACTS, predicate=(lambda e: e.method in ( 'GetContactAttributes', 'GetContactByID' ) and cs.CONN_IFACE_ALIASING in e.args[1]), handled=True), EventPattern('dbus-method-call', interface=cs.CONN_IFACE_ALIASING, method='SetAliases', handled=False), EventPattern('dbus-signal', interface=cs.ACCOUNT, predicate=lambda e: e.args[0].get('CurrentPresence') == (cs.PRESENCE_TYPE_UNSET, '', '')), ] conn, get_aliases, set_aliases, _ = enable_fakecm_account(q, bus, mc, account, params, has_aliasing=True, expect_after_connect=expect_after_connect, self_ident=params['account']) assert get_aliases.args[0] == [ conn.self_handle ] assert set_aliases.args[0] == { conn.self_handle: 'BruceWayne' } q.dbus_return(set_aliases.message, signature='') # FIXME: fd.o #55666 in telepathy-glib breaks the rest of this test. # Reinstate it when we depend on a version that has that fixed. return # Another client changes our alias remotely, but because this is IRC, # that manifests itself as a handle change conn.change_self_ident('thebatman') conn.change_self_alias('TheBatman') get_aliases, _ = q.expect_many( EventPattern('dbus-method-call', interface=cs.CONN_IFACE_CONTACTS, predicate=(lambda e: e.method in ( 'GetContactAttributes', 'GetContactByID' ) and cs.CONN_IFACE_ALIASING in e.args[1]), handled=True), EventPattern('dbus-signal', path=account.object_path, signal='AccountPropertyChanged', interface=cs.ACCOUNT, predicate=(lambda e: e.args[0].get('NormalizedName') == 'thebatman')), ) assert get_aliases.args[0] in ([conn.self_handle], conn.self_id) q.expect('dbus-signal', path=account.object_path, signal='AccountPropertyChanged', interface=cs.ACCOUNT, args=[{'Nickname': 'TheBatman'}]) # We change our nickname back call_async(q, account_props, 'Set', cs.ACCOUNT, 'Nickname', 'BruceWayne') _, _, e = q.expect_many( EventPattern('dbus-signal', path=account.object_path, signal='AccountPropertyChanged', interface=cs.ACCOUNT, predicate=(lambda e: e.args[0].get('Nickname') == 'BruceWayne')), EventPattern('dbus-return', method='Set'), EventPattern('dbus-method-call', interface=cs.CONN_IFACE_ALIASING, method='SetAliases', args=[{ conn.self_handle: 'BruceWayne', }], handled=False) ) assertEquals('BruceWayne', account_props.Get(cs.ACCOUNT, 'Nickname')) conn.change_self_ident('brucewayne') conn.change_self_alias('BruceWayne') q.dbus_return(e.message, signature='') # In response to the self-handle change, we check our nickname again get_aliases, _ = q.expect_many( EventPattern('dbus-method-call', interface=cs.CONN_IFACE_CONTACTS, predicate=(lambda e: e.method in ( 'GetContactAttributes', 'GetContactByID' ) and cs.CONN_IFACE_ALIASING in e.args[1]), handled=True), EventPattern('dbus-signal', path=account.object_path, signal='AccountPropertyChanged', interface=cs.ACCOUNT, predicate=(lambda e: e.args[0].get('NormalizedName') == 'brucewayne')), ) assert get_aliases.args[0] in ([conn.self_handle], conn.self_id) forbidden = [EventPattern('dbus-signal', signal='AccountPropertyChanged', predicate=lambda e: 'Nickname' in e.args[0])] q.forbid_events(forbidden) sync_dbus(bus, q, mc) if __name__ == '__main__': exec_test(test, {}) telepathy-mission-control-5.16.4/tests/twisted/account-manager/request-online.py0000644000175000017500000001503512735242352031243 0ustar00gkiagiagkiagia00000000000000# Python is really rubbish. vim: set fileencoding=utf-8 : # Copyright © 2009–2010 Nokia Corporation # Copyright © 2009–2010 Collabora Ltd. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA # 02110-1301 USA import dbus import dbus.service from servicetest import ( EventPattern, tp_name_prefix, tp_path_prefix, assertEquals, ) from mctest import ( exec_test, SimulatedConnection, create_fakecm_account, SimulatedChannel, SimulatedClient, expect_client_setup, ) import constants as cs def test(q, bus, mc): cm_name_ref = dbus.service.BusName( tp_name_prefix + '.ConnectionManager.fakecm', bus=bus) http_fixed_properties = dbus.Dictionary({ cs.CHANNEL + '.TargetHandleType': 1L, cs.CHANNEL + '.ChannelType': cs.CHANNEL_TYPE_STREAM_TUBE, cs.CHANNEL_TYPE_STREAM_TUBE + '.Service': 'http' }, signature='sv') caps = dbus.Array([http_fixed_properties], signature='a{sv}') # Be a Client client = SimulatedClient(q, bus, 'downloader', observe=[], approve=[], handle=[http_fixed_properties], bypass_approval=False) expect_client_setup(q, [client]) # Create an account params = dbus.Dictionary({"account": "someguy@example.com", "password": "secrecy"}, signature='sv') (cm_name_ref, account) = create_fakecm_account(q, bus, mc, params) # The account is initially valid but disabled, and hence offline props = account.GetAll(cs.ACCOUNT, dbus_interface=cs.PROPERTIES_IFACE) assert not props['Enabled'] assert props['Valid'] # The spec says it should be (Offline, "", "") but I don't think the # strings really matter. If anything, the second one should start out at # "offline". assertEquals(cs.PRESENCE_TYPE_OFFLINE, props['CurrentPresence'][0]) # Enable the account account.Set(cs.ACCOUNT, 'Enabled', True, dbus_interface=cs.PROPERTIES_IFACE) q.expect('dbus-signal', path=account.object_path, signal='AccountPropertyChanged', interface=cs.ACCOUNT) props = account.GetAll(cs.ACCOUNT, dbus_interface=cs.PROPERTIES_IFACE) assert props['Enabled'] assert props['Valid'] # Ditto above re. string fields. assertEquals(cs.PRESENCE_TYPE_OFFLINE, props['CurrentPresence'][0]) # Go online requested_presence = dbus.Struct((dbus.UInt32(2L), dbus.String(u'brb'), dbus.String(u'Be back soon!'))) account.Set(cs.ACCOUNT, 'RequestedPresence', requested_presence, dbus_interface=cs.PROPERTIES_IFACE) e = q.expect('dbus-method-call', method='RequestConnection', args=['fakeprotocol', params], destination=tp_name_prefix + '.ConnectionManager.fakecm', path=tp_path_prefix + '/ConnectionManager/fakecm', interface=tp_name_prefix + '.ConnectionManager', handled=False) conn = SimulatedConnection(q, bus, 'fakecm', 'fakeprotocol', '_', 'myself') q.dbus_return(e.message, conn.bus_name, conn.object_path, signature='so') # MC does some setup, including fetching the list of Channels q.expect_many( EventPattern('dbus-method-call', interface=cs.PROPERTIES_IFACE, method='GetAll', args=[cs.CONN_IFACE_REQUESTS], path=conn.object_path, handled=True), ) # MC calls GetStatus (maybe) and then Connect q.expect('dbus-method-call', method='Connect', path=conn.object_path, handled=True) # Connect succeeds conn.StatusChanged(cs.CONN_STATUS_CONNECTED, cs.CONN_STATUS_REASON_NONE) # Assert that the NormalizedName is harvested from the Connection at some # point while 1: e = q.expect('dbus-signal', interface=cs.ACCOUNT, signal='AccountPropertyChanged', path=account.object_path) if 'NormalizedName' in e.args[0]: assert e.args[0]['NormalizedName'] == 'myself', e.args break # Check the requested presence is online properties = account.GetAll(cs.ACCOUNT, dbus_interface=cs.PROPERTIES_IFACE) assert properties is not None assert properties.get('HasBeenOnline') assertEquals(requested_presence, properties.get('RequestedPresence')) # Since this Connection doesn't support SimplePresence, but it's online, # the spec says that CurrentPresence should be Unset. assertEquals((cs.PRESENCE_TYPE_UNSET, "", ""), properties.get('CurrentPresence')) new_channel = http_fixed_properties buddy_handle = conn.ensure_handle(cs.HT_CONTACT, "buddy") new_channel[cs.CHANNEL + '.TargetID'] = "buddy" new_channel[cs.CHANNEL + '.TargetHandle'] = buddy_handle new_channel[cs.CHANNEL + '.Requested'] = False new_channel[cs.CHANNEL + '.Interfaces'] = dbus.Array(signature='s') chan = SimulatedChannel(conn, new_channel) chan.announce() e = q.expect('dbus-method-call', method='HandleChannels') q.dbus_return(e.message, signature='') # Put the account offline requested_presence = (dbus.UInt32(cs.PRESENCE_TYPE_OFFLINE), 'offline', '') account.Set(cs.ACCOUNT, 'RequestedPresence', requested_presence, dbus_interface=cs.PROPERTIES_IFACE) # In response, MC tells us to Disconnect, and we do. But it should not # Close() the open channel. q.forbid_events([ EventPattern('dbus-method-call', method='Close', path=conn.object_path), ]) q.expect('dbus-method-call', method='Disconnect', path=conn.object_path, handled=True) properties = account.GetAll(cs.ACCOUNT, dbus_interface=cs.PROPERTIES_IFACE) assertEquals('/', properties['Connection']) assertEquals(cs.CONN_STATUS_DISCONNECTED, properties['ConnectionStatus']) assertEquals(requested_presence, properties['CurrentPresence']) assertEquals(requested_presence, properties['RequestedPresence']) if __name__ == '__main__': exec_test(test, {}) telepathy-mission-control-5.16.4/tests/twisted/crash-recovery/0000755000175000017500000000000012762352250025602 5ustar00gkiagiagkiagia00000000000000telepathy-mission-control-5.16.4/tests/twisted/crash-recovery/crash-recovery.py0000644000175000017500000001232312735242352031112 0ustar00gkiagiagkiagia00000000000000# Copyright (C) 2009 Nokia Corporation # Copyright (C) 2009 Collabora Ltd. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA # 02110-1301 USA import dbus """Regression test for recovering from an MC crash. """ import os import dbus import dbus.service from servicetest import EventPattern, call_async from mctest import exec_test, SimulatedConnection, SimulatedClient, \ create_fakecm_account, enable_fakecm_account, SimulatedChannel, \ expect_client_setup, MC import constants as cs account_id = 'fakecm/fakeprotocol/jc_2edenton_40unatco_2eint' def preseed(q, bus, fake_accounts_service): accounts_dir = os.environ['MC_ACCOUNT_DIR'] try: os.mkdir(accounts_dir, 0700) except OSError: pass fake_accounts_service.update_attributes(account_id, changed={ 'manager': 'fakecm', 'protocol': 'fakeprotocol', 'DisplayName': 'Work account', 'NormalizedName': 'jc.denton@unatco.int', 'Enabled': True, }) fake_accounts_service.update_parameters(account_id, untyped={ 'account': 'jc.denton@unatco.int', 'password': 'ionstorm', }) account_connections_file = open(accounts_dir + '/.mc_connections', 'w') account_connections_file.write("%s\t%s\t%s\n" % (cs.tp_path_prefix + '/Connection/fakecm/fakeprotocol/jc', cs.tp_name_prefix + '.Connection.fakecm.fakeprotocol.jc', 'fakecm/fakeprotocol/jc_2edenton_40unatco_2eint')) def test(q, bus, unused, **kwargs): fake_accounts_service = kwargs['fake_accounts_service'] preseed(q, bus, fake_accounts_service) text_fixed_properties = dbus.Dictionary({ cs.CHANNEL + '.TargetHandleType': cs.HT_CONTACT, cs.CHANNEL + '.ChannelType': cs.CHANNEL_TYPE_TEXT, }, signature='sv') conn = SimulatedConnection(q, bus, 'fakecm', 'fakeprotocol', 'jc', 'jc.denton@unatco.int') conn.StatusChanged(cs.CONN_STATUS_CONNECTED, 0) unhandled_properties = dbus.Dictionary(text_fixed_properties, signature='sv') unhandled_properties[cs.CHANNEL + '.Interfaces'] = dbus.Array(signature='s') unhandled_properties[cs.CHANNEL + '.TargetID'] = 'anna.navarre@unatco.int' unhandled_properties[cs.CHANNEL + '.TargetHandle'] = \ dbus.UInt32(conn.ensure_handle(cs.HT_CONTACT, 'anna.navarre@unatco.int')) unhandled_properties[cs.CHANNEL + '.InitiatorHandle'] = dbus.UInt32(conn.self_handle) unhandled_properties[cs.CHANNEL + '.InitiatorID'] = conn.self_ident unhandled_properties[cs.CHANNEL + '.Requested'] = True unhandled_chan = SimulatedChannel(conn, unhandled_properties) unhandled_chan.announce() handled_properties = dbus.Dictionary(text_fixed_properties, signature='sv') handled_properties[cs.CHANNEL + '.Interfaces'] = dbus.Array(signature='s') handled_properties[cs.CHANNEL + '.TargetID'] = 'gunther.hermann@unatco.int' handled_properties[cs.CHANNEL + '.TargetHandle'] = \ dbus.UInt32(conn.ensure_handle(cs.HT_CONTACT, 'gunther.hermann@unatco.int')) handled_properties[cs.CHANNEL + '.InitiatorHandle'] = dbus.UInt32(conn.self_handle) handled_properties[cs.CHANNEL + '.InitiatorID'] = conn.self_ident handled_properties[cs.CHANNEL + '.Requested'] = True handled_chan = SimulatedChannel(conn, handled_properties) handled_chan.announce() client = SimulatedClient(q, bus, 'Empathy', observe=[text_fixed_properties], approve=[text_fixed_properties], handle=[text_fixed_properties], bypass_approval=False) client.handled_channels.append(handled_chan.object_path) # Service-activate MC. # We're told about the other channel as an observer... mc = MC(q, bus, wait_for_names=False) e, = mc.wait_for_names( EventPattern('dbus-method-call', path=client.object_path, interface=cs.OBSERVER, method='ObserveChannels', handled=False), ) assert e.args[1] == conn.object_path, e.args channels = e.args[2] assert channels[0][0] == unhandled_chan.object_path, channels q.dbus_return(e.message, signature='') # ... and as a handler e = q.expect('dbus-method-call', path=client.object_path, interface=cs.HANDLER, method='HandleChannels', handled=False) assert e.args[1] == conn.object_path, e.args channels = e.args[2] assert channels[0][0] == unhandled_chan.object_path, channels q.dbus_return(e.message, signature='') if __name__ == '__main__': exec_test(test, {}, preload_mc=False, use_fake_accounts_service=True, pass_kwargs=True) telepathy-mission-control-5.16.4/tests/twisted/Makefile.am0000644000175000017500000001740612735242352024713 0ustar00gkiagiagkiagia00000000000000# Tests that don't need their own MC instance, although in practice # we currently run them in their own MC instance anyway. TWISTED_BASIC_TESTS = \ account-manager/account-basics.py \ account-manager/avatar.py \ account-manager/backend-makes-changes.py \ account-manager/bad-cm.py \ account-manager/crashy-cm.py \ account-manager/create-auto-connect.py \ account-manager/create-twice.py \ account-manager/create-with-properties.py \ account-manager/enable-auto-connect.py \ account-manager/enable.py \ account-manager/irc.py \ account-manager/nickname.py \ account-manager/param-types.py \ account-manager/presence.py \ account-manager/reconnect.py \ account-manager/recover-from-disconnect.py \ account-manager/req-conn-fails.py \ account-manager/request-online.py \ account-manager/service.py \ account-manager/update-parameters.py \ account-requests/cancel.py \ account-requests/create-text.py \ account-requests/delete-account-during-request.py \ account/addressing.py \ capabilities/contact-caps.py \ dispatcher/already-has-channel.py \ dispatcher/already-has-obsolete.py \ dispatcher/approver-fails.py \ dispatcher/bypass-approval.py \ dispatcher/bypass-observers.py \ dispatcher/cancel.py \ dispatcher/capture-bundle.py \ dispatcher/cdo-claim.py \ dispatcher/connect-for-request.py \ dispatcher/create-delayed-by-mini-plugin.py \ dispatcher/create-handler-fails.py \ dispatcher/create-hints.py \ dispatcher/create-no-preferred-handler.py \ dispatcher/create-rejected-by-mini-plugin.py \ dispatcher/create-text.py \ dispatcher/created-behind-our-back.py \ dispatcher/delay-approvers.py \ dispatcher/delay-then-call-handle-with.py \ dispatcher/delay-then-dont-call-approvers.py \ dispatcher/dispatch-activatable.py \ dispatcher/dispatch-before-connected.py \ dispatcher/dispatch-delayed-by-mini-plugin.py \ dispatcher/dispatch-obsolete.py \ dispatcher/dispatch-rejected-by-mini-plugin.py \ dispatcher/dispatch-text.py \ dispatcher/ensure-and-redispatch.py \ dispatcher/ensure-is-approval.py \ dispatcher/ensure-rapidly.py \ dispatcher/exploding-bundles.py \ dispatcher/fdo-21034.py \ dispatcher/handle-channels-fails.py \ dispatcher/lose-text.py \ dispatcher/recover-from-disconnect.py \ dispatcher/redispatch-channels.py \ dispatcher/request-disabled-account.py \ dispatcher/respawn-activatable-observers.py \ dispatcher/respawn-observers.py \ dispatcher/some-delay-approvers.py \ dispatcher/undispatchable.py \ dispatcher/vanishing-client.py \ $(NULL) # Tests that aren't to be run if we're running the real (installed) MC, # because they rely on special behaviour of mc-debug-server. # # For simplicity, these are also separate tests: at least # account-storage/*.py need their own instances. TWISTED_SPECIAL_BUILD_TESTS = \ account-manager/connectivity.py \ account-manager/hidden.py \ account-storage/default-keyring-storage.py \ account-storage/diverted-storage.py # Tests that are usually too slow to run. TWISTED_SLOW_TESTS = \ account-manager/server-drops-us.py # Tests that need their own MC instance. TWISTED_SEPARATE_TESTS = \ account-manager/auto-connect.py \ account-manager/avatar-refresh.py \ account-manager/device-idle.py \ account-manager/make-valid.py \ crash-recovery/crash-recovery.py \ dispatcher/create-at-startup.py # All the tests that are run by "make check" TWISTED_TESTS = \ $(TWISTED_BASIC_TESTS) \ $(TWISTED_SEPARATE_TESTS) \ $(TWISTED_SPECIAL_BUILD_TESTS) \ $(NULL) # other files used by the twisted tests, but are not tests and are not built # source TWISTED_OTHER_FILES = \ constants.py \ fakeaccountsservice.py \ fakeclient.py \ fakecm.py \ fakeconnectivity.py \ mctest.py \ servicetest.py \ telepathy/clients/README \ telepathy/clients/AbiWord.client \ telepathy/clients/Logger.client \ telepathy/managers/fakecm.manager \ telepathy/managers/onewitheverything.manager \ telepathy/managers/README \ $(NULL) # This deliberately doesn't include the TWISTED_SPECIAL_BUILD_TESTS # since it's testing the real binary, not the "debug" binary. mc-twisted-tests.list: $(AM_V_GEN)echo $(TWISTED_BASIC_TESTS) $(TWISTED_SEPARATE_TESTS) > $@ run-test.sh: run-test.sh.in Makefile $(AM_V_GEN)sed \ -e "s|[@]mctestsdir[@]|@mctestsdir@|g" \ -e "s|[@]TEST_PYTHON[@]|$(PYTHON)|g" \ $< > $@ @chmod +x $@ if ENABLE_INSTALLED_TESTS # Install files in each directory. They could be tests, pristine data files, # scripts or built source twistedtestsdir = @mctestsdir@/twisted nobase_nodist_twistedtests_SCRIPTS = \ run-test.sh \ $(NULL) nobase_dist_twistedtests_DATA = \ $(TWISTED_BASIC_TESTS) \ $(TWISTED_SEPARATE_TESTS) \ $(TWISTED_OTHER_FILES) \ $(NULL) nobase_nodist_twistedtests_DATA = \ config.py \ mc-twisted-tests.list \ $(NULL) endif if HAVE_MCE HAVE_MCE_PYBOOL = True else HAVE_MCE_PYBOOL = False endif if HAVE_NM HAVE_NM_PYBOOL = True else HAVE_NM_PYBOOL = False endif config.py: Makefile $(AM_V_GEN) { \ echo "HAVE_MCE = $(HAVE_MCE_PYBOOL)"; \ echo "HAVE_NM = $(HAVE_NM_PYBOOL)"; \ } > $@ BUILT_SOURCES = \ config.py \ mc-twisted-tests.list \ run-test.sh \ $(NULL) AM_CFLAGS = $(ERROR_CFLAGS) plugins_list = \ mcp-plugin.la \ mcp-account-diversion.la \ mcp-dbus-caller-permission.la \ libgiofakenetworkmonitor.la \ $(NULL) if ENABLE_INSTALLED_TESTS noinst_LTLIBRARIES = \ $(NULL) testplugindir = @mctestsdir@/twisted/plugins testplugin_LTLIBRARIES = \ $(plugins_list) \ $(NULL) else # A demo dispatcher plugin (new, minimal API) noinst_LTLIBRARIES = $(plugins_list) endif mcp_plugin_la_SOURCES = \ dbus-account-plugin.c \ dbus-account-plugin.h \ mcp-plugin.c \ $(NULL) # these runes are necessary to make libtool build a dlopen()able shared # library even though it's not going to be installed - the default for noinst # libraries is static mcp_plugin_la_LDFLAGS = -module -shared -avoid-version -rpath @abs_builddir@ libgiofakenetworkmonitor_la_SOURCES = \ fake-network-monitor.c \ $(NULL) libgiofakenetworkmonitor_la_LDFLAGS = $(mcp_plugin_la_LDFLAGS) mcp_account_diversion_la_SOURCES = mcp-account-diversion.c mcp_account_diversion_la_LDFLAGS = $(mcp_plugin_la_LDFLAGS) mcp_dbus_caller_permission_la_SOURCES = mcp-dbus-caller-permission.c mcp_dbus_caller_permission_la_LDFLAGS = $(mcp_plugin_la_LDFLAGS) # A debug version of the normal MC executable, which exits cleanly on # disconnection from D-Bus (so gcov info gets written out) noinst_PROGRAMS = mc-debug-server mc_debug_server_SOURCES = mc-debug-server.c mc_debug_server_LDADD = \ $(top_builddir)/src/libmcd-convenience.la INCLUDES = \ -I$(top_srcdir) -I$(top_builddir) \ -I$(top_srcdir)/src -I$(top_builddir)/src \ $(DBUS_CFLAGS) \ $(TELEPATHY_CFLAGS) \ -DMC_DISABLE_DEPRECATED \ -DLIBDIR="@libdir@" -DLIBVERSION="0" TESTS = if WANT_TWISTED_TESTS check-local: check-twisted installcheck-local: installcheck-twisted installcheck-twisted: $(MAKE) check-twisted \ TWISTED_SPECIAL_BUILD_TESTS= \ MC_EXECUTABLE=$(DESTDIR)@libexecdir@/mission-control-5 endif # WANT_TWISTED_TESTS CHECK_TWISTED_SLOW = check-twisted: $(BUILT_SOURCES) $(MAKE) -C tools rm -f core failed=0; \ if test x$(CHECK_TWISTED_SLOW) = x; then \ extra_tests= ; \ else \ extra_tests=' $$(TWISTED_SLOW_TESTS)'; \ fi; \ MC_TEST_UNINSTALLED=1 \ MC_ABS_TOP_SRCDIR=@abs_top_srcdir@ \ MC_ABS_TOP_BUILDDIR=@abs_top_builddir@ \ sh run-test.sh "${TWISTED_TESTS}${extra_tests}" if test -e core; then\ echo "Core dump exists: core";\ exit 1;\ fi EXTRA_DIST = \ $(TWISTED_BASIC_TESTS) \ $(TWISTED_SEPARATE_TESTS) \ $(TWISTED_SLOW_TESTS) \ $(TWISTED_SPECIAL_BUILD_TESTS) \ $(TWISTED_OTHER_FILES) \ accounts/README \ run-test.sh.in \ $(NULL) CLEANFILES = \ accounts/accounts.cfg \ accounts/.mc_connections \ mc-[1-9]*.log \ missioncontrol.log \ *.pyc \ */*.pyc \ with-session-bus-*.dbus-monitor-logs \ $(BUILT_SOURCES) \ $(NULL) check_misc_sources = $(TESTS) SUBDIRS = tools telepathy-mission-control-5.16.4/tests/twisted/mcp-plugin.c0000644000175000017500000003751312735242352025077 0ustar00gkiagiagkiagia00000000000000/* * A demonstration plugin that acts as a channel filter. * * Copyright © 2008-2009 Nokia Corporation * Copyright © 2009-2010 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #undef MC_DISABLE_DEPRECATED #include "config.h" #include #include #include #include #include #include "dbus-account-plugin.h" #define DEBUG g_debug /* ------ TestNoOpPlugin -------------------------------------- */ /* doesn't implement anything, to check that NULL pointers are OK */ typedef struct { GObject parent; } TestNoOpPlugin; typedef struct { GObjectClass parent_class; } TestNoOpPluginClass; GType test_no_op_plugin_get_type (void) G_GNUC_CONST; G_DEFINE_TYPE_WITH_CODE (TestNoOpPlugin, test_no_op_plugin, G_TYPE_OBJECT, G_IMPLEMENT_INTERFACE (MCP_TYPE_DBUS_ACL, NULL); G_IMPLEMENT_INTERFACE (MCP_TYPE_REQUEST_POLICY, NULL); G_IMPLEMENT_INTERFACE (MCP_TYPE_DISPATCH_OPERATION_POLICY, NULL)) static void test_no_op_plugin_init (TestNoOpPlugin *self) { } static void test_no_op_plugin_class_init (TestNoOpPluginClass *cls) { } /* ------ TestPermissionPlugin -------------------------------------- */ typedef struct { GObject parent; } TestPermissionPlugin; typedef struct { GObjectClass parent_class; } TestPermissionPluginClass; GType test_permission_plugin_get_type (void) G_GNUC_CONST; static void cdo_policy_iface_init (McpDispatchOperationPolicyIface *, gpointer); static void req_policy_iface_init (McpRequestPolicyIface *, gpointer); G_DEFINE_TYPE_WITH_CODE (TestPermissionPlugin, test_permission_plugin, G_TYPE_OBJECT, G_IMPLEMENT_INTERFACE (MCP_TYPE_REQUEST_POLICY, req_policy_iface_init); G_IMPLEMENT_INTERFACE (MCP_TYPE_DISPATCH_OPERATION_POLICY, cdo_policy_iface_init)) static void test_permission_plugin_init (TestPermissionPlugin *self) { } static void test_permission_plugin_class_init (TestPermissionPluginClass *cls) { } typedef struct { McpDispatchOperation *dispatch_operation; McpDispatchOperationDelay *delay; GSimpleAsyncResult *result; } PermissionContext; static void permission_context_free (gpointer p) { PermissionContext *ctx = p; if (ctx->delay != NULL) mcp_dispatch_operation_end_delay (ctx->dispatch_operation, ctx->delay); if (ctx->result != NULL) { g_simple_async_result_complete_in_idle (ctx->result); g_object_unref (ctx->result); } g_object_unref (ctx->dispatch_operation); g_slice_free (PermissionContext, ctx); } static void permission_cb (DBusPendingCall *pc, gpointer data) { PermissionContext *ctx = data; DBusMessage *message = dbus_pending_call_steal_reply (pc); if (dbus_message_get_type (message) == DBUS_MESSAGE_TYPE_ERROR) { DEBUG ("Permission denied"); if (ctx->result != NULL) { g_simple_async_result_set_error (ctx->result, TP_ERROR, TP_ERROR_PERMISSION_DENIED, "No, sorry"); } else { G_GNUC_BEGIN_IGNORE_DEPRECATIONS mcp_dispatch_operation_leave_channels (ctx->dispatch_operation, TRUE, TP_CHANNEL_GROUP_CHANGE_REASON_PERMISSION_DENIED, "Computer says no"); G_GNUC_END_IGNORE_DEPRECATIONS } } else { DEBUG ("Permission granted"); } dbus_message_unref (message); dbus_pending_call_unref (pc); } static void test_permission_plugin_check_cdo (McpDispatchOperationPolicy *policy, McpDispatchOperation *dispatch_operation) { GHashTable *properties = mcp_dispatch_operation_ref_nth_channel_properties ( dispatch_operation, 0); PermissionContext *ctx = NULL; DEBUG ("enter"); if (properties == NULL) { DEBUG ("no channels!?"); return; } /* currently this example just checks the first channel */ if (!tp_strdiff (tp_asv_get_string (properties, TP_IFACE_CHANNEL ".TargetID"), "policy@example.net")) { TpDBusDaemon *dbus_daemon = tp_dbus_daemon_dup (NULL); DBusGConnection *gconn = tp_proxy_get_dbus_connection (dbus_daemon); DBusConnection *libdbus = dbus_g_connection_get_connection (gconn); DBusPendingCall *pc = NULL; DBusMessage *message; ctx = g_slice_new0 (PermissionContext); ctx->dispatch_operation = g_object_ref (dispatch_operation); ctx->delay = mcp_dispatch_operation_start_delay (dispatch_operation); /* in a real policy-mechanism you'd give some details, like the * channel's properties or object path */ message = dbus_message_new_method_call ("com.example.Policy", "/com/example/Policy", "com.example.Policy", "RequestPermission"); if (!dbus_connection_send_with_reply (libdbus, message, &pc, -1)) { g_error ("out of memory"); } dbus_message_unref (message); if (pc == NULL) { DEBUG ("got disconnected from D-Bus..."); goto finally; } /* pc is unreffed by permission_cb */ DEBUG ("Waiting for permission"); if (dbus_pending_call_get_completed (pc)) { permission_cb (pc, ctx); goto finally; } if (!dbus_pending_call_set_notify (pc, permission_cb, ctx, permission_context_free)) { g_error ("Out of memory"); } /* ctx will be freed later */ ctx = NULL; } finally: if (ctx != NULL) permission_context_free (ctx); g_hash_table_unref (properties); } static void handler_is_suitable_async (McpDispatchOperationPolicy *self, TpClient *recipient, const gchar *unique_name, McpDispatchOperation *dispatch_operation, GAsyncReadyCallback callback, gpointer user_data) { GSimpleAsyncResult *simple = g_simple_async_result_new ((GObject *) self, callback, user_data, handler_is_suitable_async); GHashTable *properties = mcp_dispatch_operation_ref_nth_channel_properties ( dispatch_operation, 0); PermissionContext *ctx = NULL; DEBUG ("enter"); if (properties == NULL) { DEBUG ("no channels!?"); goto finally; } /* currently this example just checks the first channel */ if (!tp_strdiff (tp_asv_get_string (properties, TP_IFACE_CHANNEL ".TargetID"), "policy@example.net")) { TpDBusDaemon *dbus_daemon = tp_dbus_daemon_dup (NULL); DBusGConnection *gconn = tp_proxy_get_dbus_connection (dbus_daemon); DBusConnection *libdbus = dbus_g_connection_get_connection (gconn); DBusPendingCall *pc = NULL; DBusMessage *message; ctx = g_slice_new0 (PermissionContext); ctx->dispatch_operation = g_object_ref (dispatch_operation); ctx->result = simple; /* take ownership */ simple = NULL; /* in a real policy-mechanism you'd give some details, like the * channel's properties or object path, and the name of the handler */ message = dbus_message_new_method_call ("com.example.Policy", "/com/example/Policy", "com.example.Policy", "CheckHandler"); if (!dbus_connection_send_with_reply (libdbus, message, &pc, -1)) { g_error ("out of memory"); } dbus_message_unref (message); if (pc == NULL) { DEBUG ("got disconnected from D-Bus..."); goto finally; } /* pc is unreffed by permission_cb */ DEBUG ("Waiting for permission"); if (dbus_pending_call_get_completed (pc)) { permission_cb (pc, ctx); goto finally; } if (!dbus_pending_call_set_notify (pc, permission_cb, ctx, permission_context_free)) { g_error ("Out of memory"); } /* ctx will be freed later */ ctx = NULL; } finally: if (ctx != NULL) permission_context_free (ctx); g_hash_table_unref (properties); if (simple != NULL) { g_simple_async_result_complete_in_idle (simple); g_object_unref (simple); } } static void cdo_policy_iface_init (McpDispatchOperationPolicyIface *iface, gpointer unused G_GNUC_UNUSED) { iface->check = test_permission_plugin_check_cdo; iface->handler_is_suitable_async = handler_is_suitable_async; /* the default finish function accepts our GSimpleAsyncResult */ } typedef struct { McpRequest *request; McpRequestDelay *delay; } RequestPermissionContext; static void request_permission_context_free (gpointer p) { RequestPermissionContext *ctx = p; mcp_request_end_delay (ctx->request, ctx->delay); g_object_unref (ctx->request); g_slice_free (RequestPermissionContext, ctx); } static void request_permission_cb (DBusPendingCall *pc, gpointer data) { RequestPermissionContext *ctx = data; DBusMessage *message = dbus_pending_call_steal_reply (pc); if (dbus_message_get_type (message) == DBUS_MESSAGE_TYPE_ERROR) { DEBUG ("Permission denied"); mcp_request_deny (ctx->request, TP_ERROR, TP_CHANNEL_GROUP_CHANGE_REASON_PERMISSION_DENIED, "Computer says no"); } else { DEBUG ("Permission granted"); } dbus_message_unref (message); dbus_pending_call_unref (pc); } static void test_permission_plugin_check_request (McpRequestPolicy *policy, McpRequest *request) { GHashTable *properties = mcp_request_ref_nth_request (request, 0); RequestPermissionContext *ctx = NULL; DEBUG ("%s", G_STRFUNC); if (mcp_request_find_request_by_type (request, 0, g_quark_from_static_string ("com.example.QuestionableChannel"), NULL, NULL)) { TpDBusDaemon *dbus_daemon = tp_dbus_daemon_dup (NULL); DBusGConnection *gconn = tp_proxy_get_dbus_connection (dbus_daemon); DBusConnection *libdbus = dbus_g_connection_get_connection (gconn); DBusPendingCall *pc = NULL; DBusMessage *message; DEBUG ("Questionable channel detected, asking for permission"); ctx = g_slice_new0 (RequestPermissionContext); ctx->request = g_object_ref (request); ctx->delay = mcp_request_start_delay (request); /* in a real policy-mechanism you'd give some details, like the * channel's properties or object path */ message = dbus_message_new_method_call ("com.example.Policy", "/com/example/Policy", "com.example.Policy", "RequestRequest"); if (!dbus_connection_send_with_reply (libdbus, message, &pc, -1)) { g_error ("out of memory"); } dbus_message_unref (message); if (pc == NULL) { DEBUG ("got disconnected from D-Bus..."); goto finally; } /* pc is unreffed by permission_cb */ DEBUG ("Waiting for permission"); if (dbus_pending_call_get_completed (pc)) { request_permission_cb (pc, ctx); goto finally; } if (!dbus_pending_call_set_notify (pc, request_permission_cb, ctx, request_permission_context_free)) { g_error ("Out of memory"); } /* ctx will be freed later */ ctx = NULL; } finally: if (ctx != NULL) request_permission_context_free (ctx); g_hash_table_unref (properties); } static void req_policy_iface_init (McpRequestPolicyIface *iface, gpointer unused G_GNUC_UNUSED) { mcp_request_policy_iface_implement_check (iface, test_permission_plugin_check_request); } /* ------ TestRejectionPlugin --------------------------------------- */ typedef struct { GObject parent; } TestRejectionPlugin; typedef struct { GObjectClass parent_class; } TestRejectionPluginClass; GType test_rejection_plugin_get_type (void) G_GNUC_CONST; static void rej_cdo_policy_iface_init (McpDispatchOperationPolicyIface *, gpointer); static void rej_req_policy_iface_init (McpRequestPolicyIface *, gpointer); G_DEFINE_TYPE_WITH_CODE (TestRejectionPlugin, test_rejection_plugin, G_TYPE_OBJECT, G_IMPLEMENT_INTERFACE (MCP_TYPE_REQUEST_POLICY, rej_req_policy_iface_init); G_IMPLEMENT_INTERFACE (MCP_TYPE_DISPATCH_OPERATION_POLICY, rej_cdo_policy_iface_init)) static void test_rejection_plugin_init (TestRejectionPlugin *self) { } static void test_rejection_plugin_class_init (TestRejectionPluginClass *cls) { } static void test_rejection_plugin_check_cdo (McpDispatchOperationPolicy *policy, McpDispatchOperation *dispatch_operation) { GHashTable *properties = mcp_dispatch_operation_ref_nth_channel_properties ( dispatch_operation, 0); const gchar *target_id; DEBUG ("enter"); if (properties == NULL) { DEBUG ("no channels!?"); return; } /* currently this example just checks the first channel */ target_id = tp_asv_get_string (properties, TP_IFACE_CHANNEL ".TargetID"); if (!tp_strdiff (target_id, "rick.astley@example.net")) { DEBUG ("rickrolling detected, destroying channels immediately!"); mcp_dispatch_operation_destroy_channels (dispatch_operation, FALSE); } else if (!tp_strdiff (target_id, "mc.hammer@example.net")) { DEBUG ("MC Hammer detected, leaving channels when observers have run"); G_GNUC_BEGIN_IGNORE_DEPRECATIONS mcp_dispatch_operation_leave_channels (dispatch_operation, TRUE, TP_CHANNEL_GROUP_CHANGE_REASON_PERMISSION_DENIED, "Can't touch this"); G_GNUC_END_IGNORE_DEPRECATIONS } g_hash_table_unref (properties); } static void rej_cdo_policy_iface_init (McpDispatchOperationPolicyIface *iface, gpointer unused G_GNUC_UNUSED) { iface->check = test_rejection_plugin_check_cdo; } static void test_rejection_plugin_check_request (McpRequestPolicy *policy, McpRequest *request) { GHashTable *properties = mcp_request_ref_nth_request (request, 0); DEBUG ("%s", G_STRFUNC); if (!tp_strdiff ( tp_asv_get_string (properties, TP_IFACE_CHANNEL ".ChannelType"), "com.example.ForbiddenChannel")) { DEBUG ("Forbidden channel detected, denying request"); mcp_request_deny (request, TP_ERROR, TP_ERROR_PERMISSION_DENIED, "No, you don't"); } if (mcp_request_find_request_by_type (request, 0, g_quark_from_static_string ("com.example.ForbiddenChannel"), NULL, NULL)) { DEBUG ("Forbidden channel detected, denying request"); mcp_request_deny (request, TP_ERROR, TP_ERROR_PERMISSION_DENIED, "No, you don't"); } g_hash_table_unref (properties); } static void rej_req_policy_iface_init (McpRequestPolicyIface *iface, gpointer unused G_GNUC_UNUSED) { mcp_request_policy_iface_implement_check (iface, test_rejection_plugin_check_request); } /* ------ Initialization -------------------------------------------- */ GObject * mcp_plugin_ref_nth_object (guint n) { DEBUG ("Initializing mcp-plugin (n=%u)", n); switch (n) { case 0: return g_object_new (test_no_op_plugin_get_type (), NULL); case 1: return g_object_new (test_permission_plugin_get_type (), NULL); case 2: return g_object_new (test_rejection_plugin_get_type (), NULL); case 3: return g_object_new (test_no_op_plugin_get_type (), NULL); case 4: return g_object_new (test_dbus_account_plugin_get_type (), NULL); default: return NULL; } } telepathy-mission-control-5.16.4/tests/twisted/servicetest.py0000644000175000017500000005045612735242352025573 0ustar00gkiagiagkiagia00000000000000# Copyright (C) 2009 Nokia Corporation # Copyright (C) 2009 Collabora Ltd. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA # 02110-1301 USA """ Infrastructure code for testing Mission Control """ from twisted.internet import glib2reactor from twisted.internet.protocol import Protocol, Factory, ClientFactory glib2reactor.install() import sys import pprint import unittest import dbus import dbus.lowlevel import dbus.glib from twisted.internet import reactor tp_name_prefix = 'org.freedesktop.Telepathy' tp_path_prefix = '/org/freedesktop/Telepathy' class Event: def __init__(self, type, **kw): self.__dict__.update(kw) self.type = type def __str__(self): return '\n'.join([ str(type(self)) ] + format_event(self)) def format_event(event): ret = ['- type %s' % event.type] for key in dir(event): if key != 'type' and not key.startswith('_'): ret.append('- %s: %s' % ( key, pprint.pformat(getattr(event, key)))) if key == 'error': ret.append('%s' % getattr(event, key)) return ret class EventPattern: def __init__(self, type, **properties): self.type = type self.predicate = lambda x: True if 'predicate' in properties: self.predicate = properties['predicate'] del properties['predicate'] self.properties = properties def __repr__(self): properties = dict(self.properties) if self.predicate: properties['predicate'] = self.predicate return '%s(%r, **%r)' % ( self.__class__.__name__, self.type, properties) def match(self, event): if event.type != self.type: return False for key, value in self.properties.iteritems(): try: if getattr(event, key) != value: return False except AttributeError: return False if self.predicate(event): return True return False class TimeoutError(Exception): pass class ForbiddenEventOccurred(Exception): def __init__(self, event): Exception.__init__(self) self.event = event def __str__(self): return '\n' + '\n'.join(format_event(self.event)) class BaseEventQueue: """Abstract event queue base class. Implement the wait() method to have something that works. """ def __init__(self, timeout=None): self.verbose = False self.past_events = [] self.forbidden_events = set() if timeout is None: self.timeout = 5 else: self.timeout = timeout def log(self, s): if self.verbose: print s def log_event(self, event): if self.verbose: self.log('got event:') if self.verbose: map(self.log, format_event(event)) def flush_past_events(self): self.past_events = [] def expect_racy(self, type, **kw): pattern = EventPattern(type, **kw) for event in self.past_events: if pattern.match(event): self.log('past event handled') map(self.log, format_event(event)) self.log('') self.past_events.remove(event) return event return self.expect(type, **kw) def forbid_events(self, patterns): """ Add patterns (an iterable of EventPattern) to the set of forbidden events. If a forbidden event occurs during an expect or expect_many, the test will fail. """ self.forbidden_events.update(set(patterns)) def unforbid_events(self, patterns): """ Remove 'patterns' (an iterable of EventPattern) from the set of forbidden events. These must be the same EventPattern pointers that were passed to forbid_events. """ self.forbidden_events.difference_update(set(patterns)) def _check_forbidden(self, event): for e in self.forbidden_events: if e.match(event): raise ForbiddenEventOccurred(event) def expect(self, type, **kw): pattern = EventPattern(type, **kw) while True: event = self.wait() self.log_event(event) self._check_forbidden(event) if pattern.match(event): self.log('handled') self.log('') return event self.past_events.append(event) self.log('not handled') self.log('') def expect_many(self, *patterns): ret = [None] * len(patterns) while None in ret: try: event = self.wait() except TimeoutError: self.log('timeout') self.log('still expecting:') for i, pattern in enumerate(patterns): if ret[i] is None: self.log(' - %r' % pattern) raise self.log_event(event) self._check_forbidden(event) for i, pattern in enumerate(patterns): if ret[i] is None and pattern.match(event): self.log('handled') self.log('') ret[i] = event break else: self.past_events.append(event) self.log('not handled') self.log('') return ret def demand(self, type, **kw): pattern = EventPattern(type, **kw) event = self.wait() self.log_event(event) if pattern.match(event): self.log('handled') self.log('') return event self.log('not handled') raise RuntimeError('expected %r, got %r' % (pattern, event)) class IteratingEventQueue(BaseEventQueue): """Event queue that works by iterating the Twisted reactor.""" def __init__(self, timeout=None): BaseEventQueue.__init__(self, timeout) self.events = [] self._dbus_method_impls = [] self._buses = [] # a message filter which will claim we handled everything self._dbus_dev_null = \ lambda bus, message: dbus.lowlevel.HANDLER_RESULT_HANDLED def wait(self): stop = [False] def later(): stop[0] = True delayed_call = reactor.callLater(self.timeout, later) while (not self.events) and (not stop[0]): reactor.iterate(0.1) if self.events: delayed_call.cancel() return self.events.pop(0) else: raise TimeoutError def append(self, event): self.events.append(event) # compatibility handle_event = append def add_dbus_method_impl(self, cb, bus=None, **kwargs): if bus is None: bus = self._buses[0] self._dbus_method_impls.append( (EventPattern('dbus-method-call', **kwargs), cb)) def dbus_emit(self, path, iface, name, *a, **k): bus = k.pop('bus', self._buses[0]) assert 'signature' in k, k message = dbus.lowlevel.SignalMessage(path, iface, name) message.append(*a, **k) bus.send_message(message) def dbus_return(self, in_reply_to, *a, **k): bus = k.pop('bus', self._buses[0]) assert 'signature' in k, k reply = dbus.lowlevel.MethodReturnMessage(in_reply_to) reply.append(*a, **k) bus.send_message(reply) def dbus_raise(self, in_reply_to, name, message=None, bus=None): if bus is None: bus = self._buses[0] reply = dbus.lowlevel.ErrorMessage(in_reply_to, name, message) bus.send_message(reply) def attach_to_bus(self, bus): if not self._buses: # first-time setup self._dbus_filter_bound_method = self._dbus_filter self._buses.append(bus) # Only subscribe to messages on the first bus connection (assumed to # be the shared session bus connection used by the simulated connection # manager and most of the test suite), not on subsequent bus # connections (assumed to represent extra clients). # # When we receive a method call on the other bus connections, ignore # it - the eavesdropping filter installed on the first bus connection # will see it too. # # This is highly counter-intuitive, but it means our messages are in # a guaranteed order (we don't have races between messages arriving on # various connections). if len(self._buses) > 1: bus.add_message_filter(self._dbus_dev_null) return try: # for dbus > 1.5 bus.add_match_string("eavesdrop=true,type='signal'") except dbus.DBusException: bus.add_match_string("type='signal'") bus.add_match_string("type='method_call'") else: bus.add_match_string("eavesdrop=true,type='method_call'") bus.add_message_filter(self._dbus_filter_bound_method) bus.add_signal_receiver( lambda *args, **kw: self.append( Event('dbus-signal', path=unwrap(kw['path']), signal=kw['member'], args=map(unwrap, args), interface=kw['interface'])), None, None, None, path_keyword='path', member_keyword='member', interface_keyword='interface', byte_arrays=True, ) def cleanup(self): if self._buses: self._buses[0].remove_message_filter(self._dbus_filter_bound_method) for bus in self._buses[1:]: bus.remove_message_filter(self._dbus_dev_null) self._buses = [] self._dbus_method_impls = [] def _dbus_filter(self, bus, message): if isinstance(message, dbus.lowlevel.MethodCallMessage): destination = message.get_destination() sender = message.get_sender() if (destination == 'org.freedesktop.DBus' or sender == self._buses[0].get_unique_name()): # suppress reply and don't make an Event return dbus.lowlevel.HANDLER_RESULT_HANDLED e = Event('dbus-method-call', message=message, interface=message.get_interface(), path=message.get_path(), raw_args=message.get_args_list(byte_arrays=True), args=map(unwrap, message.get_args_list(byte_arrays=True)), destination=str(destination), method=message.get_member(), sender=message.get_sender(), handled=False) for pair in self._dbus_method_impls: pattern, cb = pair if pattern.match(e): cb(e) e.handled = True break self.append(e) return dbus.lowlevel.HANDLER_RESULT_HANDLED return dbus.lowlevel.HANDLER_RESULT_NOT_YET_HANDLED class TestEventQueue(BaseEventQueue): def __init__(self, events): BaseEventQueue.__init__(self) self.events = events def wait(self): if self.events: return self.events.pop(0) else: raise TimeoutError class EventQueueTest(unittest.TestCase): def test_expect(self): queue = TestEventQueue([Event('foo'), Event('bar')]) assert queue.expect('foo').type == 'foo' assert queue.expect('bar').type == 'bar' def test_expect_many(self): queue = TestEventQueue([Event('foo'), Event('bar')]) bar, foo = queue.expect_many( EventPattern('bar'), EventPattern('foo')) assert bar.type == 'bar' assert foo.type == 'foo' def test_expect_many2(self): # Test that events are only matched against patterns that haven't yet # been matched. This tests a regression. queue = TestEventQueue([Event('foo', x=1), Event('foo', x=2)]) foo1, foo2 = queue.expect_many( EventPattern('foo'), EventPattern('foo')) assert foo1.type == 'foo' and foo1.x == 1 assert foo2.type == 'foo' and foo2.x == 2 def test_timeout(self): queue = TestEventQueue([]) self.assertRaises(TimeoutError, queue.expect, 'foo') def test_demand(self): queue = TestEventQueue([Event('foo'), Event('bar')]) foo = queue.demand('foo') assert foo.type == 'foo' def test_demand_fail(self): queue = TestEventQueue([Event('foo'), Event('bar')]) self.assertRaises(RuntimeError, queue.demand, 'bar') def unwrap(x): """Hack to unwrap D-Bus values, so that they're easier to read when printed.""" if isinstance(x, list): return map(unwrap, x) if isinstance(x, tuple): return tuple(map(unwrap, x)) if isinstance(x, dict): return dict([(unwrap(k), unwrap(v)) for k, v in x.iteritems()]) if isinstance(x, dbus.Boolean): return bool(x) for t in [unicode, str, long, int, float]: if isinstance(x, t): return t(x) return x def call_async(test, proxy, method, *args, **kw): """Call a D-Bus method asynchronously and generate an event for the resulting method return/error.""" def reply_func(*ret): test.handle_event(Event('dbus-return', method=method, value=unwrap(ret))) def error_func(err): test.handle_event(Event('dbus-error', method=method, error=err, name=err.get_dbus_name(), message=str(err))) method_proxy = getattr(proxy, method) kw.update({'reply_handler': reply_func, 'error_handler': error_func}) method_proxy(*args, **kw) def sync_dbus(bus, q, proxy): # Dummy D-Bus method call. We can't use DBus.Peer.Ping() because libdbus # replies to that message immediately, rather than handing it up to # dbus-glib and thence the application, which means that Ping()ing the # application doesn't ensure that it's processed all D-Bus messages prior # to our ping. call_async(q, dbus.Interface(proxy, 'org.freedesktop.Telepathy.Tests'), 'DummySyncDBus') q.expect('dbus-error', method='DummySyncDBus') class ProxyWrapper: def __init__(self, object, default, others): self.object = object self.default_interface = dbus.Interface(object, default) self.Properties = dbus.Interface(object, dbus.PROPERTIES_IFACE) self.TpProperties = \ dbus.Interface(object, tp_name_prefix + '.Properties') self.interfaces = dict([ (name, dbus.Interface(object, iface)) for name, iface in others.iteritems()]) def __getattr__(self, name): if name in self.interfaces: return self.interfaces[name] if name in self.object.__dict__: return getattr(self.object, name) return getattr(self.default_interface, name) def wrap_channel(chan, type_, extra=None): interfaces = { type_: tp_name_prefix + '.Channel.Type.' + type_, 'Group': tp_name_prefix + '.Channel.Interface.Group', } if extra: interfaces.update(dict([ (name, tp_name_prefix + '.Channel.Interface.' + name) for name in extra])) return ProxyWrapper(chan, tp_name_prefix + '.Channel', interfaces) def make_connection(bus, event_func, name, proto, params): cm = bus.get_object( tp_name_prefix + '.ConnectionManager.%s' % name, tp_path_prefix + '/ConnectionManager/%s' % name) cm_iface = dbus.Interface(cm, tp_name_prefix + '.ConnectionManager') connection_name, connection_path = cm_iface.RequestConnection( proto, params) conn = wrap_connection(bus.get_object(connection_name, connection_path)) return conn def make_channel_proxy(conn, path, iface): bus = dbus.SessionBus() chan = bus.get_object(conn.object.bus_name, path) chan = dbus.Interface(chan, tp_name_prefix + '.' + iface) return chan # block_reading can be used if the test want to choose when we start to read # data from the socket. class EventProtocol(Protocol): def __init__(self, queue=None, block_reading=False): self.queue = queue self.block_reading = block_reading def dataReceived(self, data): if self.queue is not None: self.queue.handle_event(Event('socket-data', protocol=self, data=data)) def sendData(self, data): self.transport.write(data) def connectionMade(self): if self.block_reading: self.transport.stopReading() def connectionLost(self, reason=None): if self.queue is not None: self.queue.handle_event(Event('socket-disconnected', protocol=self)) class EventProtocolFactory(Factory): def __init__(self, queue, block_reading=False): self.queue = queue self.block_reading = block_reading def _create_protocol(self): return EventProtocol(self.queue, self.block_reading) def buildProtocol(self, addr): proto = self._create_protocol() self.queue.handle_event(Event('socket-connected', protocol=proto)) return proto class EventProtocolClientFactory(EventProtocolFactory, ClientFactory): pass def watch_tube_signals(q, tube): def got_signal_cb(*args, **kwargs): q.handle_event(Event('tube-signal', path=kwargs['path'], signal=kwargs['member'], args=map(unwrap, args), tube=tube)) tube.add_signal_receiver(got_signal_cb, path_keyword='path', member_keyword='member', byte_arrays=True) def pretty(x): return pprint.pformat(unwrap(x)) def assertEquals(expected, value): if expected != value: raise AssertionError( "expected:\n%s\ngot:\n%s" % (pretty(expected), pretty(value))) def assertNotEquals(expected, value): if expected == value: raise AssertionError( "expected something other than:\n%s" % pretty(value)) def assertContains(element, value): if element not in value: raise AssertionError( "expected:\n%s\nin:\n%s" % (pretty(element), pretty(value))) def assertDoesNotContain(element, value): if element in value: raise AssertionError( "expected:\n%s\nnot in:\n%s" % (pretty(element), pretty(value))) def assertLength(length, value): if len(value) != length: raise AssertionError("expected: length %d, got length %d:\n%s" % ( length, len(value), pretty(value))) def assertFlagsSet(flags, value): masked = value & flags if masked != flags: raise AssertionError( "expected flags %u, of which only %u are set in %u" % ( flags, masked, value)) def assertFlagsUnset(flags, value): masked = value & flags if masked != 0: raise AssertionError( "expected none of flags %u, but %u are set in %u" % ( flags, masked, value)) def assertSameSets(expected, value): exp_set = set(expected) val_set = set(value) if exp_set != val_set: raise AssertionError( "expected contents:\n%s\ngot:\n%s" % ( pretty(exp_set), pretty(val_set))) def install_colourer(): def red(s): return '\x1b[31m%s\x1b[0m' % s def green(s): return '\x1b[32m%s\x1b[0m' % s patterns = { 'handled': green, 'not handled': red, } class Colourer: def __init__(self, fh, patterns): self.fh = fh self.patterns = patterns def write(self, s): f = self.patterns.get(s, lambda x: x) self.fh.write(f(s)) sys.stdout = Colourer(sys.stdout, patterns) return sys.stdout if __name__ == '__main__': unittest.main() telepathy-mission-control-5.16.4/tests/twisted/mcp-dbus-caller-permission.c0000644000175000017500000001621212735242352030155 0ustar00gkiagiagkiagia00000000000000/* * A demonstration plugin that checks a DBus caller's md5sum * * Copyright © 2010 Nokia Corporation * Copyright © 2010 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #define CONFFILE "mcp-dbus-caller-permissions.conf" #define DEBUG g_debug #define PLUGIN_NAME "dbus-caller-permission-checker" #define PLUGIN_DESCRIPTION \ "Test plugin that checks the md5 checksum of a DBus caller. " \ "gkeyfile g_get_user_cache_dir()/" CONFFILE " holds the [paths " \ "to] the binaries, and the permission tokens associated with each." /* Example conf file: [/usr/local/bin/mc-tool] org.freedesktop.Telepathy.AccountManager=1 *=1 */ static void dbus_acl_iface_init (McpDBusAclIface *, gpointer); typedef struct { GObject parent; GKeyFile *permits; gboolean loaded; } DBusCallerPermission; typedef struct { GObjectClass parent_class; } DBusCallerPermissionClass; GType dbus_caller_permission_get_type (void) G_GNUC_CONST; #define DBUS_CALLER_PERMISSION(o) \ (G_TYPE_CHECK_INSTANCE_CAST ((o), dbus_caller_permission_get_type (), \ DBusCallerPermission)) G_DEFINE_TYPE_WITH_CODE (DBusCallerPermission, dbus_caller_permission, G_TYPE_OBJECT, G_IMPLEMENT_INTERFACE (MCP_TYPE_DBUS_ACL, dbus_acl_iface_init)); static void dbus_caller_permission_init (DBusCallerPermission *self) { const gchar *dir; gchar *file = NULL; self->permits = g_key_file_new (); dir = g_get_user_cache_dir (); file = g_build_path (G_DIR_SEPARATOR_S, dir, CONFFILE, NULL); if (!g_file_test (file, G_FILE_TEST_EXISTS)) { g_mkdir_with_parents (dir, 0700); g_file_set_contents (file, "# MC DBus permissions\n", -1, NULL); } DEBUG ("conf file %s", file); g_key_file_load_from_file (self->permits, file, G_KEY_FILE_NONE, NULL); g_free (file); } static void dbus_caller_permission_class_init (DBusCallerPermissionClass *cls) { } static gboolean is_filtered (const McpDBusAcl *self, DBusAclType type, const gchar *name) { DBusCallerPermission *plugin = DBUS_CALLER_PERMISSION (self); GKeyFile *permits = plugin->permits; switch (type) { case DBUS_ACL_TYPE_METHOD: return g_key_file_get_boolean (permits, "methods", name, NULL); case DBUS_ACL_TYPE_GET_PROPERTY: return g_key_file_get_boolean (permits, "get-property", name, NULL); case DBUS_ACL_TYPE_SET_PROPERTY: return g_key_file_get_boolean (permits, "set-property", name, NULL); default: return FALSE; } } static gboolean pid_is_permitted (const McpDBusAcl *self, const gchar *name, pid_t pid) { gboolean ok = FALSE; if (pid != 0) { gchar *path = g_strdup_printf ("/proc/%d/exe", pid); gchar *executable = g_file_read_link (path, NULL); if (executable != NULL) { DBusCallerPermission *plugin = DBUS_CALLER_PERMISSION (self); GKeyFile *permits = plugin->permits; DEBUG ("executable to check for permission is %s", executable); ok = g_key_file_get_boolean (permits, executable, name, NULL); DEBUG ("%s:%s = %s", executable, name, ok ? "TRUE" : "FALSE"); g_free (executable); } g_free (path); } return ok; } static gboolean caller_authorised (const McpDBusAcl *self, const TpDBusDaemon *dbus, const DBusGMethodInvocation *call, DBusAclType type, const gchar *name, const GHashTable *params) { DBusGConnection *dgc = tp_proxy_get_dbus_connection ((TpDBusDaemon *)dbus); gboolean ok = TRUE; if (is_filtered (self, type, name)) { pid_t pid = 0; GError *error = NULL; gchar *caller = dbus_g_method_get_sender ((DBusGMethodInvocation *) call); DBusGProxy *proxy = dbus_g_proxy_new_for_name (dgc, DBUS_SERVICE_DBUS, DBUS_PATH_DBUS, DBUS_INTERFACE_DBUS); dbus_g_proxy_call (proxy, "GetConnectionUnixProcessID", &error, G_TYPE_STRING, caller, G_TYPE_INVALID, G_TYPE_UINT, &pid, G_TYPE_INVALID); ok = pid_is_permitted (self, name, pid); g_free (caller); g_object_unref (proxy); } DEBUG ("sync caller-permission ACL check [%s]", ok ? "Allowed" : "Forbidden"); return ok; } static void async_authorised_cb (DBusGProxy *proxy, DBusGProxyCall *call, gpointer data) { GError *error = NULL; DBusAclAuthData *ad = data; pid_t pid = 0; const McpDBusAcl *self = ad->acl; gboolean permitted = FALSE; /* if this returns FALSE, there's no PID, which means something bizarre * * and untrustowrthy is going on, which in turn means we must deny: can't * * authorise without first authenticating */ permitted = dbus_g_proxy_end_call (proxy, call, &error, G_TYPE_UINT, &pid, G_TYPE_INVALID); if (permitted) permitted = pid_is_permitted (self, ad->name, pid); else g_error_free (error); DEBUG ("finished async caller-permission ACL check [%u -> %s]", pid, permitted ? "Allowed" : "Forbidden"); mcp_dbus_acl_authorised_async_step (ad, permitted); } static void caller_async_authorised (const McpDBusAcl *self, DBusAclAuthData *data) { DBusGConnection *dgc = tp_proxy_get_dbus_connection (data->dbus); DBusGProxy *proxy = dbus_g_proxy_new_for_name (dgc, DBUS_SERVICE_DBUS, DBUS_PATH_DBUS, DBUS_INTERFACE_DBUS); DEBUG ("starting async caller-permission ACL check"); if (is_filtered (self, data->type, data->name)) { gchar *caller = dbus_g_method_get_sender (data->context); dbus_g_proxy_begin_call (proxy, "GetConnectionUnixProcessID", async_authorised_cb, data, NULL, G_TYPE_STRING, caller, G_TYPE_INVALID); g_free (caller); } else /* not filtered, so the call is allowed: */ { mcp_dbus_acl_authorised_async_step (data, TRUE); } } static void dbus_acl_iface_init (McpDBusAclIface *iface, gpointer unused G_GNUC_UNUSED) { mcp_dbus_acl_iface_set_name (iface, PLUGIN_NAME); mcp_dbus_acl_iface_set_desc (iface, PLUGIN_DESCRIPTION); mcp_dbus_acl_iface_implement_authorised (iface, caller_authorised); mcp_dbus_acl_iface_implement_authorised_async (iface, caller_async_authorised); } GObject * mcp_plugin_ref_nth_object (guint n) { DEBUG ("Initializing mcp-dbus-caller-id plugin (n=%u)", n); switch (n) { case 0: return g_object_new (dbus_caller_permission_get_type (), NULL); default: return NULL; } } telepathy-mission-control-5.16.4/tests/twisted/fakeaccountsservice.py0000644000175000017500000001653612735242352027263 0ustar00gkiagiagkiagia00000000000000# vim: set fileencoding=utf-8 # # Copyright © 2009 Nokia Corporation # Copyright © 2009-2012 Collabora Ltd. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA # 02110-1301 USA import dbus import dbus.service from servicetest import (Event, EventPattern) import constants as cs # indices into the tuple of dicts representing an account ATTRS = 0 ATTR_FLAGS = 1 PARAMS = 2 UNTYPED_PARAMS = 3 PARAM_FLAGS = 4 class FakeAccountsService(object): def __init__(self, q, bus): self.q = q self.bus = bus self.nameref = dbus.service.BusName(cs.TEST_DBUS_ACCOUNT_SERVICE, self.bus) self.object_path = cs.TEST_DBUS_ACCOUNT_SERVICE_PATH self.accounts = {} q.add_dbus_method_impl(self.GetAccounts, path=self.object_path, interface=cs.TEST_DBUS_ACCOUNT_SERVICE_IFACE, method='GetAccounts') q.add_dbus_method_impl(self.CreateAccount, path=self.object_path, interface=cs.TEST_DBUS_ACCOUNT_SERVICE_IFACE, method='CreateAccount') q.add_dbus_method_impl(self.DeleteAccount, path=self.object_path, interface=cs.TEST_DBUS_ACCOUNT_SERVICE_IFACE, method='DeleteAccount') q.add_dbus_method_impl(self.UpdateAttributes, path=self.object_path, interface=cs.TEST_DBUS_ACCOUNT_SERVICE_IFACE, method='UpdateAttributes') q.add_dbus_method_impl(self.UpdateParameters, path=self.object_path, interface=cs.TEST_DBUS_ACCOUNT_SERVICE_IFACE, method='UpdateParameters') def create_account(self, account, attrs={}, attr_flags={}, params={}, untyped_params={}, param_flags={}): if account in self.accounts: raise KeyError('Account %s already exists' % account) self.accounts[account] = ({}, {}, {}, {}, {}) self.accounts[account][ATTRS].update(attrs) for attr in attrs: self.accounts[account][ATTR_FLAGS][attr] = dbus.UInt32(0) self.accounts[account][ATTR_FLAGS].update(attr_flags) self.accounts[account][PARAMS].update(params) for param in params: self.accounts[account][PARAM_FLAGS][param] = dbus.UInt32(0) self.accounts[account][UNTYPED_PARAMS].update(untyped_params) for param in untyped_params: self.accounts[account][PARAM_FLAGS][param] = dbus.UInt32(0) self.accounts[account][PARAM_FLAGS].update(param_flags) self.q.dbus_emit(self.object_path, cs.TEST_DBUS_ACCOUNT_SERVICE_IFACE, 'AccountCreated', account, *self.accounts[account], signature='sa{sv}a{su}a{sv}a{ss}a{su}') def CreateAccount(self, e): try: self.create_account(*e.raw_args) except Exception as ex: self.q.dbus_raise(e.message, cs.NOT_AVAILABLE, str(ex)) else: self.q.dbus_return(e.message, signature='') def delete_account(self, account): # raises if not found del self.accounts[account] self.q.dbus_emit(self.object_path, cs.TEST_DBUS_ACCOUNT_SERVICE_IFACE, 'AccountDeleted', account, signature='s') def DeleteAccount(self, e): try: self.delete_account(*e.raw_args) except Exception as ex: self.q.dbus_raise(e.message, cs.NOT_AVAILABLE, str(ex)) else: self.q.dbus_return(e.message, signature='') def GetAccounts(self, e): self.q.dbus_return(e.message, self.accounts, signature='a{s(a{sv}a{su}a{sv}a{ss}a{su})}') def update_attributes(self, account, changed={}, flags={}, deleted=[]): if account not in self.accounts: self.create_account(account) for (attribute, value) in changed.items(): self.accounts[account][ATTRS][attribute] = value self.accounts[account][ATTR_FLAGS][attribute] = flags.get( attribute, dbus.UInt32(0)) for attribute in deleted: if attribute in self.accounts[account][ATTRS]: del self.accounts[account][ATTRS][attribute] if attribute in self.accounts[account][ATTR_FLAGS]: del self.accounts[account][ATTR_FLAGS][attribute] self.q.dbus_emit(self.object_path, cs.TEST_DBUS_ACCOUNT_SERVICE_IFACE, 'AttributesChanged', account, changed, dict([(a, self.accounts[account][ATTR_FLAGS][a]) for a in changed]), deleted, signature='sa{sv}a{su}as') def UpdateAttributes(self, e): try: self.update_attributes(*e.raw_args) except Exception as ex: self.q.dbus_raise(e.message, cs.NOT_AVAILABLE, str(ex)) else: self.q.dbus_return(e.message, signature='') def update_parameters(self, account, changed={}, untyped={}, flags={}, deleted=[]): if account not in self.accounts: self.create_account(account) for (param, value) in changed.items(): self.accounts[account][PARAMS][param] = value if param in self.accounts[account][UNTYPED_PARAMS]: del self.accounts[account][UNTYPED_PARAMS][param] self.accounts[account][PARAM_FLAGS][param] = flags.get( param, dbus.UInt32(0)) for (param, value) in untyped.items(): self.accounts[account][UNTYPED_PARAMS][param] = value if param in self.accounts[account][PARAMS]: del self.accounts[account][PARAMS][param] self.accounts[account][PARAM_FLAGS][param] = flags.get( param, dbus.UInt32(0)) for param in deleted: if param in self.accounts[account][PARAMS]: del self.accounts[account][PARAMS][param] if param in self.accounts[account][UNTYPED_PARAMS]: del self.accounts[account][UNTYPED_PARAMS][param] if param in self.accounts[account][PARAM_FLAGS]: del self.accounts[account][PARAM_FLAGS][param] self.q.dbus_emit(self.object_path, cs.TEST_DBUS_ACCOUNT_SERVICE_IFACE, 'ParametersChanged', account, changed, untyped, dict([(p, self.accounts[account][PARAM_FLAGS][p]) for p in (set(changed.keys()) | set(untyped.keys()))]), deleted, signature='sa{sv}a{ss}a{su}as') def UpdateParameters(self, e): try: self.update_parameters(*e.raw_args) except Exception as ex: self.q.dbus_raise(e.message, cs.NOT_AVAILABLE, str(ex)) else: self.q.dbus_return(e.message, signature='') telepathy-mission-control-5.16.4/tests/twisted/Makefile.in0000644000175000017500000014244412762351620024724 0ustar00gkiagiagkiagia00000000000000# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__make_dryrun = \ { \ am__dry=no; \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ *) \ for am__flg in $$MAKEFLAGS; do \ case $$am__flg in \ *=*|--*) ;; \ *n*) am__dry=yes; break;; \ esac; \ done;; \ esac; \ test $$am__dry = yes; \ } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ noinst_PROGRAMS = mc-debug-server$(EXEEXT) TESTS = subdir = tests/twisted DIST_COMMON = README $(am__nobase_dist_twistedtests_DATA_DIST) \ $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/gtk-doc.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/tp-compiler-flag.m4 \ $(top_srcdir)/m4/tp-compiler-warnings.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(testplugindir)" \ "$(DESTDIR)$(twistedtestsdir)" "$(DESTDIR)$(twistedtestsdir)" \ "$(DESTDIR)$(twistedtestsdir)" LTLIBRARIES = $(noinst_LTLIBRARIES) $(testplugin_LTLIBRARIES) libgiofakenetworkmonitor_la_LIBADD = am_libgiofakenetworkmonitor_la_OBJECTS = fake-network-monitor.lo libgiofakenetworkmonitor_la_OBJECTS = \ $(am_libgiofakenetworkmonitor_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent libgiofakenetworkmonitor_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(AM_CFLAGS) $(CFLAGS) $(libgiofakenetworkmonitor_la_LDFLAGS) \ $(LDFLAGS) -o $@ @ENABLE_INSTALLED_TESTS_FALSE@am_libgiofakenetworkmonitor_la_rpath = @ENABLE_INSTALLED_TESTS_TRUE@am_libgiofakenetworkmonitor_la_rpath = \ @ENABLE_INSTALLED_TESTS_TRUE@ -rpath $(testplugindir) mcp_account_diversion_la_LIBADD = am_mcp_account_diversion_la_OBJECTS = mcp-account-diversion.lo mcp_account_diversion_la_OBJECTS = \ $(am_mcp_account_diversion_la_OBJECTS) mcp_account_diversion_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(AM_CFLAGS) $(CFLAGS) $(mcp_account_diversion_la_LDFLAGS) \ $(LDFLAGS) -o $@ @ENABLE_INSTALLED_TESTS_FALSE@am_mcp_account_diversion_la_rpath = @ENABLE_INSTALLED_TESTS_TRUE@am_mcp_account_diversion_la_rpath = \ @ENABLE_INSTALLED_TESTS_TRUE@ -rpath $(testplugindir) mcp_dbus_caller_permission_la_LIBADD = am_mcp_dbus_caller_permission_la_OBJECTS = \ mcp-dbus-caller-permission.lo mcp_dbus_caller_permission_la_OBJECTS = \ $(am_mcp_dbus_caller_permission_la_OBJECTS) mcp_dbus_caller_permission_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(AM_CFLAGS) $(CFLAGS) \ $(mcp_dbus_caller_permission_la_LDFLAGS) $(LDFLAGS) -o $@ @ENABLE_INSTALLED_TESTS_FALSE@am_mcp_dbus_caller_permission_la_rpath = @ENABLE_INSTALLED_TESTS_TRUE@am_mcp_dbus_caller_permission_la_rpath = \ @ENABLE_INSTALLED_TESTS_TRUE@ -rpath $(testplugindir) mcp_plugin_la_LIBADD = am_mcp_plugin_la_OBJECTS = dbus-account-plugin.lo mcp-plugin.lo mcp_plugin_la_OBJECTS = $(am_mcp_plugin_la_OBJECTS) mcp_plugin_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(mcp_plugin_la_LDFLAGS) $(LDFLAGS) -o $@ @ENABLE_INSTALLED_TESTS_FALSE@am_mcp_plugin_la_rpath = @ENABLE_INSTALLED_TESTS_TRUE@am_mcp_plugin_la_rpath = -rpath \ @ENABLE_INSTALLED_TESTS_TRUE@ $(testplugindir) PROGRAMS = $(noinst_PROGRAMS) am_mc_debug_server_OBJECTS = mc-debug-server.$(OBJEXT) mc_debug_server_OBJECTS = $(am_mc_debug_server_OBJECTS) mc_debug_server_DEPENDENCIES = \ $(top_builddir)/src/libmcd-convenience.la SCRIPTS = $(nobase_nodist_twistedtests_SCRIPTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; SOURCES = $(libgiofakenetworkmonitor_la_SOURCES) \ $(mcp_account_diversion_la_SOURCES) \ $(mcp_dbus_caller_permission_la_SOURCES) \ $(mcp_plugin_la_SOURCES) $(mc_debug_server_SOURCES) DIST_SOURCES = $(libgiofakenetworkmonitor_la_SOURCES) \ $(mcp_account_diversion_la_SOURCES) \ $(mcp_dbus_caller_permission_la_SOURCES) \ $(mcp_plugin_la_SOURCES) $(mc_debug_server_SOURCES) RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__nobase_dist_twistedtests_DATA_DIST = \ account-manager/account-basics.py account-manager/avatar.py \ account-manager/backend-makes-changes.py \ account-manager/bad-cm.py account-manager/crashy-cm.py \ account-manager/create-auto-connect.py \ account-manager/create-twice.py \ account-manager/create-with-properties.py \ account-manager/enable-auto-connect.py \ account-manager/enable.py account-manager/irc.py \ account-manager/nickname.py account-manager/param-types.py \ account-manager/presence.py account-manager/reconnect.py \ account-manager/recover-from-disconnect.py \ account-manager/req-conn-fails.py \ account-manager/request-online.py account-manager/service.py \ account-manager/update-parameters.py \ account-requests/cancel.py account-requests/create-text.py \ account-requests/delete-account-during-request.py \ account/addressing.py capabilities/contact-caps.py \ dispatcher/already-has-channel.py \ dispatcher/already-has-obsolete.py \ dispatcher/approver-fails.py dispatcher/bypass-approval.py \ dispatcher/bypass-observers.py dispatcher/cancel.py \ dispatcher/capture-bundle.py dispatcher/cdo-claim.py \ dispatcher/connect-for-request.py \ dispatcher/create-delayed-by-mini-plugin.py \ dispatcher/create-handler-fails.py dispatcher/create-hints.py \ dispatcher/create-no-preferred-handler.py \ dispatcher/create-rejected-by-mini-plugin.py \ dispatcher/create-text.py \ dispatcher/created-behind-our-back.py \ dispatcher/delay-approvers.py \ dispatcher/delay-then-call-handle-with.py \ dispatcher/delay-then-dont-call-approvers.py \ dispatcher/dispatch-activatable.py \ dispatcher/dispatch-before-connected.py \ dispatcher/dispatch-delayed-by-mini-plugin.py \ dispatcher/dispatch-obsolete.py \ dispatcher/dispatch-rejected-by-mini-plugin.py \ dispatcher/dispatch-text.py \ dispatcher/ensure-and-redispatch.py \ dispatcher/ensure-is-approval.py dispatcher/ensure-rapidly.py \ dispatcher/exploding-bundles.py dispatcher/fdo-21034.py \ dispatcher/handle-channels-fails.py dispatcher/lose-text.py \ dispatcher/recover-from-disconnect.py \ dispatcher/redispatch-channels.py \ dispatcher/request-disabled-account.py \ dispatcher/respawn-activatable-observers.py \ dispatcher/respawn-observers.py \ dispatcher/some-delay-approvers.py \ dispatcher/undispatchable.py dispatcher/vanishing-client.py \ account-manager/auto-connect.py \ account-manager/avatar-refresh.py \ account-manager/device-idle.py account-manager/make-valid.py \ crash-recovery/crash-recovery.py \ dispatcher/create-at-startup.py constants.py \ fakeaccountsservice.py fakeclient.py fakecm.py \ fakeconnectivity.py mctest.py servicetest.py \ telepathy/clients/README telepathy/clients/AbiWord.client \ telepathy/clients/Logger.client \ telepathy/managers/fakecm.manager \ telepathy/managers/onewitheverything.manager \ telepathy/managers/README DATA = $(nobase_dist_twistedtests_DATA) \ $(nobase_nodist_twistedtests_DATA) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir ETAGS = etags CTAGS = ctags am__tty_colors = \ red=; grn=; lgn=; blu=; std= DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACCOUNTS_CACHE_DIR = @ACCOUNTS_CACHE_DIR@ ACCOUNTS_DIR = @ACCOUNTS_DIR@ ACLOCAL = @ACLOCAL@ AEGIS_LIBS = @AEGIS_LIBS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DBUS_CFLAGS = @DBUS_CFLAGS@ DBUS_LIBS = @DBUS_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ERROR_CFLAGS = @ERROR_CFLAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GIO_UNIX_CFLAGS = @GIO_UNIX_CFLAGS@ GIO_UNIX_LIBS = @GIO_UNIX_LIBS@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_COMPILE_SCHEMAS = @GLIB_COMPILE_SCHEMAS@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ GLIB_MKENUMS = @GLIB_MKENUMS@ GREP = @GREP@ GSETTINGS_DISABLE_SCHEMAS_COMPILE = @GSETTINGS_DISABLE_SCHEMAS_COMPILE@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ HTML_DIR = @HTML_DIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBACCOUNTS_SSO_CFLAGS = @LIBACCOUNTS_SSO_CFLAGS@ LIBACCOUNTS_SSO_LIBS = @LIBACCOUNTS_SSO_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MCE_CFLAGS = @MCE_CFLAGS@ MCE_LIBS = @MCE_LIBS@ MCP_ABI_VERSION = @MCP_ABI_VERSION@ MCP_API_VERSION = @MCP_API_VERSION@ MCP_LT_AGE = @MCP_LT_AGE@ MCP_LT_CURRENT = @MCP_LT_CURRENT@ MCP_LT_REVISION = @MCP_LT_REVISION@ MKDIR_P = @MKDIR_P@ NETWORK_MANAGER_CFLAGS = @NETWORK_MANAGER_CFLAGS@ NETWORK_MANAGER_LIBS = @NETWORK_MANAGER_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PYTHON = @PYTHON@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TELEPATHY_CFLAGS = @TELEPATHY_CFLAGS@ TELEPATHY_LIBS = @TELEPATHY_LIBS@ UPOWER_GLIB_CFLAGS = @UPOWER_GLIB_CFLAGS@ UPOWER_GLIB_LIBS = @UPOWER_GLIB_LIBS@ VERSION = @VERSION@ XSLTPROC = @XSLTPROC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gsettingsschemadir = @gsettingsschemadir@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mctestsdir = @mctestsdir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ pluginlibdir = @pluginlibdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ # Tests that don't need their own MC instance, although in practice # we currently run them in their own MC instance anyway. TWISTED_BASIC_TESTS = \ account-manager/account-basics.py \ account-manager/avatar.py \ account-manager/backend-makes-changes.py \ account-manager/bad-cm.py \ account-manager/crashy-cm.py \ account-manager/create-auto-connect.py \ account-manager/create-twice.py \ account-manager/create-with-properties.py \ account-manager/enable-auto-connect.py \ account-manager/enable.py \ account-manager/irc.py \ account-manager/nickname.py \ account-manager/param-types.py \ account-manager/presence.py \ account-manager/reconnect.py \ account-manager/recover-from-disconnect.py \ account-manager/req-conn-fails.py \ account-manager/request-online.py \ account-manager/service.py \ account-manager/update-parameters.py \ account-requests/cancel.py \ account-requests/create-text.py \ account-requests/delete-account-during-request.py \ account/addressing.py \ capabilities/contact-caps.py \ dispatcher/already-has-channel.py \ dispatcher/already-has-obsolete.py \ dispatcher/approver-fails.py \ dispatcher/bypass-approval.py \ dispatcher/bypass-observers.py \ dispatcher/cancel.py \ dispatcher/capture-bundle.py \ dispatcher/cdo-claim.py \ dispatcher/connect-for-request.py \ dispatcher/create-delayed-by-mini-plugin.py \ dispatcher/create-handler-fails.py \ dispatcher/create-hints.py \ dispatcher/create-no-preferred-handler.py \ dispatcher/create-rejected-by-mini-plugin.py \ dispatcher/create-text.py \ dispatcher/created-behind-our-back.py \ dispatcher/delay-approvers.py \ dispatcher/delay-then-call-handle-with.py \ dispatcher/delay-then-dont-call-approvers.py \ dispatcher/dispatch-activatable.py \ dispatcher/dispatch-before-connected.py \ dispatcher/dispatch-delayed-by-mini-plugin.py \ dispatcher/dispatch-obsolete.py \ dispatcher/dispatch-rejected-by-mini-plugin.py \ dispatcher/dispatch-text.py \ dispatcher/ensure-and-redispatch.py \ dispatcher/ensure-is-approval.py \ dispatcher/ensure-rapidly.py \ dispatcher/exploding-bundles.py \ dispatcher/fdo-21034.py \ dispatcher/handle-channels-fails.py \ dispatcher/lose-text.py \ dispatcher/recover-from-disconnect.py \ dispatcher/redispatch-channels.py \ dispatcher/request-disabled-account.py \ dispatcher/respawn-activatable-observers.py \ dispatcher/respawn-observers.py \ dispatcher/some-delay-approvers.py \ dispatcher/undispatchable.py \ dispatcher/vanishing-client.py \ $(NULL) # Tests that aren't to be run if we're running the real (installed) MC, # because they rely on special behaviour of mc-debug-server. # # For simplicity, these are also separate tests: at least # account-storage/*.py need their own instances. TWISTED_SPECIAL_BUILD_TESTS = \ account-manager/connectivity.py \ account-manager/hidden.py \ account-storage/default-keyring-storage.py \ account-storage/diverted-storage.py # Tests that are usually too slow to run. TWISTED_SLOW_TESTS = \ account-manager/server-drops-us.py # Tests that need their own MC instance. TWISTED_SEPARATE_TESTS = \ account-manager/auto-connect.py \ account-manager/avatar-refresh.py \ account-manager/device-idle.py \ account-manager/make-valid.py \ crash-recovery/crash-recovery.py \ dispatcher/create-at-startup.py # All the tests that are run by "make check" TWISTED_TESTS = \ $(TWISTED_BASIC_TESTS) \ $(TWISTED_SEPARATE_TESTS) \ $(TWISTED_SPECIAL_BUILD_TESTS) \ $(NULL) # other files used by the twisted tests, but are not tests and are not built # source TWISTED_OTHER_FILES = \ constants.py \ fakeaccountsservice.py \ fakeclient.py \ fakecm.py \ fakeconnectivity.py \ mctest.py \ servicetest.py \ telepathy/clients/README \ telepathy/clients/AbiWord.client \ telepathy/clients/Logger.client \ telepathy/managers/fakecm.manager \ telepathy/managers/onewitheverything.manager \ telepathy/managers/README \ $(NULL) # Install files in each directory. They could be tests, pristine data files, # scripts or built source @ENABLE_INSTALLED_TESTS_TRUE@twistedtestsdir = @mctestsdir@/twisted @ENABLE_INSTALLED_TESTS_TRUE@nobase_nodist_twistedtests_SCRIPTS = \ @ENABLE_INSTALLED_TESTS_TRUE@ run-test.sh \ @ENABLE_INSTALLED_TESTS_TRUE@ $(NULL) @ENABLE_INSTALLED_TESTS_TRUE@nobase_dist_twistedtests_DATA = \ @ENABLE_INSTALLED_TESTS_TRUE@ $(TWISTED_BASIC_TESTS) \ @ENABLE_INSTALLED_TESTS_TRUE@ $(TWISTED_SEPARATE_TESTS) \ @ENABLE_INSTALLED_TESTS_TRUE@ $(TWISTED_OTHER_FILES) \ @ENABLE_INSTALLED_TESTS_TRUE@ $(NULL) @ENABLE_INSTALLED_TESTS_TRUE@nobase_nodist_twistedtests_DATA = \ @ENABLE_INSTALLED_TESTS_TRUE@ config.py \ @ENABLE_INSTALLED_TESTS_TRUE@ mc-twisted-tests.list \ @ENABLE_INSTALLED_TESTS_TRUE@ $(NULL) @HAVE_MCE_FALSE@HAVE_MCE_PYBOOL = False @HAVE_MCE_TRUE@HAVE_MCE_PYBOOL = True @HAVE_NM_FALSE@HAVE_NM_PYBOOL = False @HAVE_NM_TRUE@HAVE_NM_PYBOOL = True BUILT_SOURCES = \ config.py \ mc-twisted-tests.list \ run-test.sh \ $(NULL) AM_CFLAGS = $(ERROR_CFLAGS) plugins_list = \ mcp-plugin.la \ mcp-account-diversion.la \ mcp-dbus-caller-permission.la \ libgiofakenetworkmonitor.la \ $(NULL) # A demo dispatcher plugin (new, minimal API) @ENABLE_INSTALLED_TESTS_FALSE@noinst_LTLIBRARIES = $(plugins_list) @ENABLE_INSTALLED_TESTS_TRUE@noinst_LTLIBRARIES = \ @ENABLE_INSTALLED_TESTS_TRUE@ $(NULL) @ENABLE_INSTALLED_TESTS_TRUE@testplugindir = @mctestsdir@/twisted/plugins @ENABLE_INSTALLED_TESTS_TRUE@testplugin_LTLIBRARIES = \ @ENABLE_INSTALLED_TESTS_TRUE@ $(plugins_list) \ @ENABLE_INSTALLED_TESTS_TRUE@ $(NULL) mcp_plugin_la_SOURCES = \ dbus-account-plugin.c \ dbus-account-plugin.h \ mcp-plugin.c \ $(NULL) # these runes are necessary to make libtool build a dlopen()able shared # library even though it's not going to be installed - the default for noinst # libraries is static mcp_plugin_la_LDFLAGS = -module -shared -avoid-version -rpath @abs_builddir@ libgiofakenetworkmonitor_la_SOURCES = \ fake-network-monitor.c \ $(NULL) libgiofakenetworkmonitor_la_LDFLAGS = $(mcp_plugin_la_LDFLAGS) mcp_account_diversion_la_SOURCES = mcp-account-diversion.c mcp_account_diversion_la_LDFLAGS = $(mcp_plugin_la_LDFLAGS) mcp_dbus_caller_permission_la_SOURCES = mcp-dbus-caller-permission.c mcp_dbus_caller_permission_la_LDFLAGS = $(mcp_plugin_la_LDFLAGS) mc_debug_server_SOURCES = mc-debug-server.c mc_debug_server_LDADD = \ $(top_builddir)/src/libmcd-convenience.la INCLUDES = \ -I$(top_srcdir) -I$(top_builddir) \ -I$(top_srcdir)/src -I$(top_builddir)/src \ $(DBUS_CFLAGS) \ $(TELEPATHY_CFLAGS) \ -DMC_DISABLE_DEPRECATED \ -DLIBDIR="@libdir@" -DLIBVERSION="0" CHECK_TWISTED_SLOW = EXTRA_DIST = \ $(TWISTED_BASIC_TESTS) \ $(TWISTED_SEPARATE_TESTS) \ $(TWISTED_SLOW_TESTS) \ $(TWISTED_SPECIAL_BUILD_TESTS) \ $(TWISTED_OTHER_FILES) \ accounts/README \ run-test.sh.in \ $(NULL) CLEANFILES = \ accounts/accounts.cfg \ accounts/.mc_connections \ mc-[1-9]*.log \ missioncontrol.log \ *.pyc \ */*.pyc \ with-session-bus-*.dbus-monitor-logs \ $(BUILT_SOURCES) \ $(NULL) check_misc_sources = $(TESTS) SUBDIRS = tools all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tests/twisted/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu tests/twisted/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done install-testpluginLTLIBRARIES: $(testplugin_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(testplugin_LTLIBRARIES)'; test -n "$(testplugindir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(testplugindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(testplugindir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(testplugindir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(testplugindir)"; \ } uninstall-testpluginLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(testplugin_LTLIBRARIES)'; test -n "$(testplugindir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(testplugindir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(testplugindir)/$$f"; \ done clean-testpluginLTLIBRARIES: -test -z "$(testplugin_LTLIBRARIES)" || rm -f $(testplugin_LTLIBRARIES) @list='$(testplugin_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libgiofakenetworkmonitor.la: $(libgiofakenetworkmonitor_la_OBJECTS) $(libgiofakenetworkmonitor_la_DEPENDENCIES) $(EXTRA_libgiofakenetworkmonitor_la_DEPENDENCIES) $(AM_V_CCLD)$(libgiofakenetworkmonitor_la_LINK) $(am_libgiofakenetworkmonitor_la_rpath) $(libgiofakenetworkmonitor_la_OBJECTS) $(libgiofakenetworkmonitor_la_LIBADD) $(LIBS) mcp-account-diversion.la: $(mcp_account_diversion_la_OBJECTS) $(mcp_account_diversion_la_DEPENDENCIES) $(EXTRA_mcp_account_diversion_la_DEPENDENCIES) $(AM_V_CCLD)$(mcp_account_diversion_la_LINK) $(am_mcp_account_diversion_la_rpath) $(mcp_account_diversion_la_OBJECTS) $(mcp_account_diversion_la_LIBADD) $(LIBS) mcp-dbus-caller-permission.la: $(mcp_dbus_caller_permission_la_OBJECTS) $(mcp_dbus_caller_permission_la_DEPENDENCIES) $(EXTRA_mcp_dbus_caller_permission_la_DEPENDENCIES) $(AM_V_CCLD)$(mcp_dbus_caller_permission_la_LINK) $(am_mcp_dbus_caller_permission_la_rpath) $(mcp_dbus_caller_permission_la_OBJECTS) $(mcp_dbus_caller_permission_la_LIBADD) $(LIBS) mcp-plugin.la: $(mcp_plugin_la_OBJECTS) $(mcp_plugin_la_DEPENDENCIES) $(EXTRA_mcp_plugin_la_DEPENDENCIES) $(AM_V_CCLD)$(mcp_plugin_la_LINK) $(am_mcp_plugin_la_rpath) $(mcp_plugin_la_OBJECTS) $(mcp_plugin_la_LIBADD) $(LIBS) clean-noinstPROGRAMS: @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list mc-debug-server$(EXEEXT): $(mc_debug_server_OBJECTS) $(mc_debug_server_DEPENDENCIES) $(EXTRA_mc_debug_server_DEPENDENCIES) @rm -f mc-debug-server$(EXEEXT) $(AM_V_CCLD)$(LINK) $(mc_debug_server_OBJECTS) $(mc_debug_server_LDADD) $(LIBS) install-nobase_nodist_twistedtestsSCRIPTS: $(nobase_nodist_twistedtests_SCRIPTS) @$(NORMAL_INSTALL) @list='$(nobase_nodist_twistedtests_SCRIPTS)'; test -n "$(twistedtestsdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(twistedtestsdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(twistedtestsdir)" || exit 1; \ fi; \ $(am__nobase_strip_setup); \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n' \ -e "s|$$srcdirstrip/||" -e 'h;s|[^/]*$$||; s|^$$|.|' \ -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) { files[d] = files[d] " " $$1; \ if (++n[d] == $(am__install_max)) { \ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ else { print "f", d "/" $$4, $$1 } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ case $$type in \ d) echo " $(MKDIR_P) '$(DESTDIR)$(twistedtestsdir)/$$dir'"; \ $(MKDIR_P) "$(DESTDIR)$(twistedtestsdir)/$$dir" || exit $$?;; \ f) \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(twistedtestsdir)$$dir'"; \ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(twistedtestsdir)$$dir" || exit $$?; \ } \ ;; esac \ ; done uninstall-nobase_nodist_twistedtestsSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(nobase_nodist_twistedtests_SCRIPTS)'; test -n "$(twistedtestsdir)" || exit 0; \ $(am__nobase_strip_setup); \ files=`$(am__nobase_strip) \ -e 'h;s,.*/,,;$(transform);x;s|[^/]*$$||;G;s,\n,,'`; \ dir='$(DESTDIR)$(twistedtestsdir)'; $(am__uninstall_files_from_dir) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbus-account-plugin.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fake-network-monitor.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mc-debug-server.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mcp-account-diversion.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mcp-dbus-caller-permission.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mcp-plugin.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-nobase_dist_twistedtestsDATA: $(nobase_dist_twistedtests_DATA) @$(NORMAL_INSTALL) @list='$(nobase_dist_twistedtests_DATA)'; test -n "$(twistedtestsdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(twistedtestsdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(twistedtestsdir)" || exit 1; \ fi; \ $(am__nobase_list) | while read dir files; do \ xfiles=; for file in $$files; do \ if test -f "$$file"; then xfiles="$$xfiles $$file"; \ else xfiles="$$xfiles $(srcdir)/$$file"; fi; done; \ test -z "$$xfiles" || { \ test "x$$dir" = x. || { \ echo " $(MKDIR_P) '$(DESTDIR)$(twistedtestsdir)/$$dir'"; \ $(MKDIR_P) "$(DESTDIR)$(twistedtestsdir)/$$dir"; }; \ echo " $(INSTALL_DATA) $$xfiles '$(DESTDIR)$(twistedtestsdir)/$$dir'"; \ $(INSTALL_DATA) $$xfiles "$(DESTDIR)$(twistedtestsdir)/$$dir" || exit $$?; }; \ done uninstall-nobase_dist_twistedtestsDATA: @$(NORMAL_UNINSTALL) @list='$(nobase_dist_twistedtests_DATA)'; test -n "$(twistedtestsdir)" || list=; \ $(am__nobase_strip_setup); files=`$(am__nobase_strip)`; \ dir='$(DESTDIR)$(twistedtestsdir)'; $(am__uninstall_files_from_dir) install-nobase_nodist_twistedtestsDATA: $(nobase_nodist_twistedtests_DATA) @$(NORMAL_INSTALL) @list='$(nobase_nodist_twistedtests_DATA)'; test -n "$(twistedtestsdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(twistedtestsdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(twistedtestsdir)" || exit 1; \ fi; \ $(am__nobase_list) | while read dir files; do \ xfiles=; for file in $$files; do \ if test -f "$$file"; then xfiles="$$xfiles $$file"; \ else xfiles="$$xfiles $(srcdir)/$$file"; fi; done; \ test -z "$$xfiles" || { \ test "x$$dir" = x. || { \ echo " $(MKDIR_P) '$(DESTDIR)$(twistedtestsdir)/$$dir'"; \ $(MKDIR_P) "$(DESTDIR)$(twistedtestsdir)/$$dir"; }; \ echo " $(INSTALL_DATA) $$xfiles '$(DESTDIR)$(twistedtestsdir)/$$dir'"; \ $(INSTALL_DATA) $$xfiles "$(DESTDIR)$(twistedtestsdir)/$$dir" || exit $$?; }; \ done uninstall-nobase_nodist_twistedtestsDATA: @$(NORMAL_UNINSTALL) @list='$(nobase_nodist_twistedtests_DATA)'; test -n "$(twistedtestsdir)" || list=; \ $(am__nobase_strip_setup); files=`$(am__nobase_strip)`; \ dir='$(DESTDIR)$(twistedtestsdir)'; $(am__uninstall_files_from_dir) # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags check-TESTS: $(TESTS) @failed=0; all=0; xfail=0; xpass=0; skip=0; \ srcdir=$(srcdir); export srcdir; \ list=' $(TESTS) '; \ $(am__tty_colors); \ if test -n "$$list"; then \ for tst in $$list; do \ if test -f ./$$tst; then dir=./; \ elif test -f $$tst; then dir=; \ else dir="$(srcdir)/"; fi; \ if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \ all=`expr $$all + 1`; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$tst[\ \ ]*) \ xpass=`expr $$xpass + 1`; \ failed=`expr $$failed + 1`; \ col=$$red; res=XPASS; \ ;; \ *) \ col=$$grn; res=PASS; \ ;; \ esac; \ elif test $$? -ne 77; then \ all=`expr $$all + 1`; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$tst[\ \ ]*) \ xfail=`expr $$xfail + 1`; \ col=$$lgn; res=XFAIL; \ ;; \ *) \ failed=`expr $$failed + 1`; \ col=$$red; res=FAIL; \ ;; \ esac; \ else \ skip=`expr $$skip + 1`; \ col=$$blu; res=SKIP; \ fi; \ echo "$${col}$$res$${std}: $$tst"; \ done; \ if test "$$all" -eq 1; then \ tests="test"; \ All=""; \ else \ tests="tests"; \ All="All "; \ fi; \ if test "$$failed" -eq 0; then \ if test "$$xfail" -eq 0; then \ banner="$$All$$all $$tests passed"; \ else \ if test "$$xfail" -eq 1; then failures=failure; else failures=failures; fi; \ banner="$$All$$all $$tests behaved as expected ($$xfail expected $$failures)"; \ fi; \ else \ if test "$$xpass" -eq 0; then \ banner="$$failed of $$all $$tests failed"; \ else \ if test "$$xpass" -eq 1; then passes=pass; else passes=passes; fi; \ banner="$$failed of $$all $$tests did not behave as expected ($$xpass unexpected $$passes)"; \ fi; \ fi; \ dashes="$$banner"; \ skipped=""; \ if test "$$skip" -ne 0; then \ if test "$$skip" -eq 1; then \ skipped="($$skip test was not run)"; \ else \ skipped="($$skip tests were not run)"; \ fi; \ test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \ dashes="$$skipped"; \ fi; \ report=""; \ if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \ report="Please report to $(PACKAGE_BUGREPORT)"; \ test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \ dashes="$$report"; \ fi; \ dashes=`echo "$$dashes" | sed s/./=/g`; \ if test "$$failed" -eq 0; then \ col="$$grn"; \ else \ col="$$red"; \ fi; \ echo "$${col}$$dashes$${std}"; \ echo "$${col}$$banner$${std}"; \ test -z "$$skipped" || echo "$${col}$$skipped$${std}"; \ test -z "$$report" || echo "$${col}$$report$${std}"; \ echo "$${col}$$dashes$${std}"; \ test "$$failed" -eq 0; \ else :; fi distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done @WANT_TWISTED_TESTS_FALSE@check-local: check-am: all-am $(MAKE) $(AM_MAKEFLAGS) check-TESTS check-local check: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-recursive all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(SCRIPTS) $(DATA) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(testplugindir)" "$(DESTDIR)$(twistedtestsdir)" "$(DESTDIR)$(twistedtestsdir)" "$(DESTDIR)$(twistedtestsdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) @WANT_TWISTED_TESTS_FALSE@installcheck-local: clean: clean-recursive clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ clean-noinstPROGRAMS clean-testpluginLTLIBRARIES \ mostlyclean-am distclean: distclean-recursive -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-nobase_dist_twistedtestsDATA \ install-nobase_nodist_twistedtestsDATA \ install-nobase_nodist_twistedtestsSCRIPTS \ install-testpluginLTLIBRARIES install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: installcheck-local maintainer-clean: maintainer-clean-recursive -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-nobase_dist_twistedtestsDATA \ uninstall-nobase_nodist_twistedtestsDATA \ uninstall-nobase_nodist_twistedtestsSCRIPTS \ uninstall-testpluginLTLIBRARIES .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all check \ check-am ctags-recursive install install-am install-strip \ tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-TESTS check-am check-local clean \ clean-generic clean-libtool clean-noinstLTLIBRARIES \ clean-noinstPROGRAMS clean-testpluginLTLIBRARIES ctags \ ctags-recursive distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man \ install-nobase_dist_twistedtestsDATA \ install-nobase_nodist_twistedtestsDATA \ install-nobase_nodist_twistedtestsSCRIPTS install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ install-testpluginLTLIBRARIES installcheck installcheck-am \ installcheck-local installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-recursive uninstall uninstall-am \ uninstall-nobase_dist_twistedtestsDATA \ uninstall-nobase_nodist_twistedtestsDATA \ uninstall-nobase_nodist_twistedtestsSCRIPTS \ uninstall-testpluginLTLIBRARIES # This deliberately doesn't include the TWISTED_SPECIAL_BUILD_TESTS # since it's testing the real binary, not the "debug" binary. mc-twisted-tests.list: $(AM_V_GEN)echo $(TWISTED_BASIC_TESTS) $(TWISTED_SEPARATE_TESTS) > $@ run-test.sh: run-test.sh.in Makefile $(AM_V_GEN)sed \ -e "s|[@]mctestsdir[@]|@mctestsdir@|g" \ -e "s|[@]TEST_PYTHON[@]|$(PYTHON)|g" \ $< > $@ @chmod +x $@ config.py: Makefile $(AM_V_GEN) { \ echo "HAVE_MCE = $(HAVE_MCE_PYBOOL)"; \ echo "HAVE_NM = $(HAVE_NM_PYBOOL)"; \ } > $@ @WANT_TWISTED_TESTS_TRUE@check-local: check-twisted @WANT_TWISTED_TESTS_TRUE@installcheck-local: installcheck-twisted @WANT_TWISTED_TESTS_TRUE@installcheck-twisted: @WANT_TWISTED_TESTS_TRUE@ $(MAKE) check-twisted \ @WANT_TWISTED_TESTS_TRUE@ TWISTED_SPECIAL_BUILD_TESTS= \ @WANT_TWISTED_TESTS_TRUE@ MC_EXECUTABLE=$(DESTDIR)@libexecdir@/mission-control-5 check-twisted: $(BUILT_SOURCES) $(MAKE) -C tools rm -f core failed=0; \ if test x$(CHECK_TWISTED_SLOW) = x; then \ extra_tests= ; \ else \ extra_tests=' $$(TWISTED_SLOW_TESTS)'; \ fi; \ MC_TEST_UNINSTALLED=1 \ MC_ABS_TOP_SRCDIR=@abs_top_srcdir@ \ MC_ABS_TOP_BUILDDIR=@abs_top_builddir@ \ sh run-test.sh "${TWISTED_TESTS}${extra_tests}" if test -e core; then\ echo "Core dump exists: core";\ exit 1;\ fi # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: telepathy-mission-control-5.16.4/tests/twisted/fake-network-monitor.c0000644000175000017500000002055612741445541027107 0ustar00gkiagiagkiagia00000000000000/* * Fake GNetworkMonitor, using ConnMan's D-Bus API (it's as good as any). * * Copyright © 2013 Intel Corporation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "config.h" #include #include typedef struct { GObject parent; GDBusProxy *proxy; gboolean available; } FakeNetworkMonitor; typedef struct { GObjectClass parent_class; } FakeNetworkMonitorClass; static GType fake_network_monitor_get_type (void); #define FAKE_NETWORK_MONITOR(x) \ G_TYPE_CHECK_INSTANCE_CAST (x, fake_network_monitor_get_type (), FakeNetworkMonitor) #define DEBUG(format, ...) \ g_debug ("%s: " format, G_STRFUNC, ##__VA_ARGS__) enum { PROP_0, PROP_NETWORK_AVAILABLE, PROP_NETWORK_METERED, PROP_CONNECTIVITY }; static void initable_iface_init (GInitableIface *); static void monitor_iface_init (GNetworkMonitorInterface *); G_DEFINE_DYNAMIC_TYPE_EXTENDED (FakeNetworkMonitor, fake_network_monitor, G_TYPE_OBJECT, 0, G_IMPLEMENT_INTERFACE_DYNAMIC (G_TYPE_INITABLE, initable_iface_init); G_IMPLEMENT_INTERFACE_DYNAMIC (G_TYPE_NETWORK_MONITOR, monitor_iface_init)) static void fake_network_monitor_init (FakeNetworkMonitor *self) { DEBUG ("enter"); self->available = FALSE; } static void fake_network_monitor_get_property (GObject *object, guint param_id, GValue *value, GParamSpec *pspec) { FakeNetworkMonitor *self = FAKE_NETWORK_MONITOR (object); switch (param_id) { case PROP_NETWORK_AVAILABLE: g_value_set_boolean (value, self->available); break; case PROP_NETWORK_METERED: g_value_set_boolean (value, FALSE); break; case PROP_CONNECTIVITY: g_value_set_enum (value, self->available ? G_NETWORK_CONNECTIVITY_FULL : G_NETWORK_CONNECTIVITY_LOCAL); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec); break; }; } static void fake_network_monitor_dispose (GObject *object) { FakeNetworkMonitor *self = FAKE_NETWORK_MONITOR (object); DEBUG ("enter"); g_clear_object (&self->proxy); G_OBJECT_CLASS (fake_network_monitor_parent_class)->dispose (object); } static void fake_network_monitor_class_init (FakeNetworkMonitorClass *cls) { GObjectClass *oclass = G_OBJECT_CLASS (cls); DEBUG ("enter"); oclass->dispose = fake_network_monitor_dispose; oclass->get_property = fake_network_monitor_get_property; g_object_class_override_property (oclass, PROP_NETWORK_AVAILABLE, "network-available"); g_object_class_override_property (oclass, PROP_NETWORK_METERED, "network-metered"); g_object_class_override_property (oclass, PROP_CONNECTIVITY, "connectivity"); } static void fake_network_monitor_class_finalize (FakeNetworkMonitorClass *cls) { } static void fake_network_monitor_emit_network_changed (FakeNetworkMonitor *self) { DEBUG ("available=%d", self->available); g_signal_emit_by_name (self, "network-changed", self->available); } static gboolean fake_network_monitor_can_reach (GNetworkMonitor *monitor, GSocketConnectable *connectable, GCancellable *cancellable, GError **error) { g_error ("Telepathy components should not block like this"); return FALSE; } static void fake_network_monitor_can_reach_async (GNetworkMonitor *monitor, GSocketConnectable *connectable, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) { /* The Mission Control tests don't need this, so I didn't implement it. * In principle, it should wait for the initial GetProperties() to finish. */ g_error ("FIXME: implement this"); } static gboolean fake_network_monitor_can_reach_finish (GNetworkMonitor *monitor, GAsyncResult *result, GError **error) { /* See can_reach_async */ g_error ("FIXME: implement this"); return FALSE; } static void fake_network_monitor_set_state (FakeNetworkMonitor *self, const gchar *state) { gboolean available = (!tp_strdiff (state, "online") || !tp_strdiff (state, "ready")); DEBUG ("New fake ConnMan network state %s (%san available state)", state, available ? "" : "not "); if (available != self->available) { DEBUG ("notify::network-available"); self->available = available; g_object_notify (G_OBJECT (self), "network-available"); } fake_network_monitor_emit_network_changed (self); } static void fake_network_monitor_dbus_signal_cb (GDBusProxy *proxy, const gchar *sender_name, const gchar *signal_name, GVariant *parameters, gpointer user_data) { FakeNetworkMonitor *self = FAKE_NETWORK_MONITOR (user_data); const gchar *name; GVariant *value; if (tp_strdiff (signal_name, "PropertyChanged") || !g_variant_is_of_type (parameters, G_VARIANT_TYPE ("(sv)"))) return; g_variant_get (parameters, "(&sv)", &name, &value); if (!tp_strdiff (name, "State")) { fake_network_monitor_set_state (self, g_variant_get_string (value, NULL)); } g_variant_unref (value); } static void fake_network_monitor_get_properties_cb (GObject *proxy, GAsyncResult *result, gpointer user_data) { FakeNetworkMonitor *self = tp_weak_ref_dup_object (user_data); GVariant *tuple = NULL; GVariant *asv = NULL; const gchar *state; if (self == NULL) return; tuple = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), result, NULL); if (tuple == NULL) { DEBUG ("GetProperties() failed"); goto finally; } if (!g_variant_is_of_type (tuple, G_VARIANT_TYPE ("(a{sv})"))) { DEBUG ("GetProperties() returned wrong type"); goto finally; } asv = g_variant_get_child_value (tuple, 0); if (g_variant_lookup (asv, "State", "&s", &state)) { DEBUG ("Initial state: %s", state); fake_network_monitor_set_state (self, state); } else { DEBUG ("Failed to get initial state, not in GetProperties return"); fake_network_monitor_set_state (self, "offline"); } finally: if (asv != NULL) g_variant_unref (asv); if (tuple != NULL) g_variant_unref (tuple); g_object_unref (self); } static gboolean fake_network_monitor_initable_init (GInitable *initable, GCancellable *cancellable, GError **error) { FakeNetworkMonitor *self = FAKE_NETWORK_MONITOR (initable); if (self->proxy != NULL) return TRUE; self->proxy = g_dbus_proxy_new_for_bus_sync (G_BUS_TYPE_SYSTEM, G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES, NULL, "net.connman", "/", "net.connman.Manager", cancellable, error); if (self->proxy == NULL) return FALSE; tp_g_signal_connect_object (self->proxy, "g-signal", G_CALLBACK (fake_network_monitor_dbus_signal_cb), self, 0); g_dbus_proxy_call (self->proxy, "GetProperties", NULL, G_DBUS_CALL_FLAGS_NONE, -1, NULL, fake_network_monitor_get_properties_cb, tp_weak_ref_new (self, NULL, NULL)); return TRUE; } static void initable_iface_init (GInitableIface *iface) { iface->init = fake_network_monitor_initable_init; } static void monitor_iface_init (GNetworkMonitorInterface *iface) { iface->can_reach = fake_network_monitor_can_reach; iface->can_reach_async = fake_network_monitor_can_reach_async; iface->can_reach_finish = fake_network_monitor_can_reach_finish; } void g_io_module_load (GIOModule *module) { DEBUG ("FakeNetworkMonitor plugin"); fake_network_monitor_register_type (G_TYPE_MODULE (module)); g_io_extension_point_implement (G_NETWORK_MONITOR_EXTENSION_POINT_NAME, fake_network_monitor_get_type (), "fake", G_MAXINT); } void g_io_module_unload (GIOModule *module) { } gchar ** g_io_module_query (void) { gchar *contents[] = { G_NETWORK_MONITOR_EXTENSION_POINT_NAME, NULL }; DEBUG ("FakeNetworkMonitor plugin"); return g_strdupv (contents); } telepathy-mission-control-5.16.4/tests/twisted/account-requests/0000755000175000017500000000000012762352250026153 5ustar00gkiagiagkiagia00000000000000telepathy-mission-control-5.16.4/tests/twisted/account-requests/cancel.py0000644000175000017500000001137112735242352027756 0ustar00gkiagiagkiagia00000000000000# Copyright (C) 2009 Nokia Corporation # Copyright (C) 2009 Collabora Ltd. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA # 02110-1301 USA import dbus """Regression test for the unofficial Account.Interface.Requests API when a channel can be created successfully. """ import dbus import dbus.service from servicetest import EventPattern, tp_name_prefix, tp_path_prefix, \ call_async from mctest import exec_test, SimulatedConnection, SimulatedClient, \ create_fakecm_account, enable_fakecm_account, SimulatedChannel, \ expect_client_setup, ChannelDispatcher import constants as cs def test(q, bus, mc): params = dbus.Dictionary({"account": "someguy@example.com", "password": "secrecy"}, signature='sv') cm_name_ref, account = create_fakecm_account(q, bus, mc, params) conn = enable_fakecm_account(q, bus, mc, account, params) text_fixed_properties = dbus.Dictionary({ cs.CHANNEL + '.TargetHandleType': cs.HT_CONTACT, cs.CHANNEL + '.ChannelType': cs.CHANNEL_TYPE_TEXT, }, signature='sv') client = SimulatedClient(q, bus, 'Empathy', observe=[text_fixed_properties], approve=[text_fixed_properties], handle=[text_fixed_properties], bypass_approval=False) # No Approver should be invoked at any point during this test, because the # Channel was Requested def fail_on_approval(e): raise AssertionError('Approver should not be invoked') q.add_dbus_method_impl(fail_on_approval, path=client.object_path, interface=cs.APPROVER, method='AddDispatchOperation') # wait for MC to download the properties expect_client_setup(q, [client]) user_action_time = dbus.Int64(1238582606) # chat UI calls ChannelDispatcher.CreateChannel cd = ChannelDispatcher(bus) request = dbus.Dictionary({ cs.CHANNEL + '.ChannelType': cs.CHANNEL_TYPE_TEXT, cs.CHANNEL + '.TargetHandleType': cs.HT_CONTACT, cs.CHANNEL + '.TargetID': 'juliet', }, signature='sv') request_path = cd.CreateChannel(account.object_path, request, user_action_time, client.bus_name) add_request = q.expect('dbus-method-call', handled=False, interface=cs.CLIENT_IFACE_REQUESTS, method='AddRequest', path=client.object_path) assert add_request.args[0] == request_path q.dbus_return(add_request.message, signature='') cr = bus.get_object(cs.CD, request_path) request_props = cr.GetAll(cs.CR, dbus_interface=cs.PROPERTIES_IFACE) assert request_props['Account'] == account.object_path assert request_props['Requests'] == [request] assert request_props['UserActionTime'] == user_action_time # chat UI connects to signals and calls ChannelRequest.Proceed() cr.Proceed() cm_request_call = q.expect('dbus-method-call', interface=cs.CONN_IFACE_REQUESTS, method='CreateChannel', path=conn.object_path, args=[request], handled=False) # Actually, never mind. cr.Cancel() # Time passes. A channel is returned. channel_immutable = dbus.Dictionary(request) channel_immutable[cs.CHANNEL + '.InitiatorID'] = conn.self_ident channel_immutable[cs.CHANNEL + '.InitiatorHandle'] = conn.self_handle channel_immutable[cs.CHANNEL + '.Requested'] = True channel_immutable[cs.CHANNEL + '.Interfaces'] = \ dbus.Array([], signature='s') channel_immutable[cs.CHANNEL + '.TargetHandle'] = \ conn.ensure_handle(cs.HT_CONTACT, 'juliet') channel = SimulatedChannel(conn, channel_immutable) # this order of events is guaranteed by telepathy-spec (since 0.17.14) q.dbus_return(cm_request_call.message, channel.object_path, channel.immutable, signature='oa{sv}') channel.announce() # Channel is unwanted now, MC stabs it in the face stdsig, _ = q.expect_many( EventPattern('dbus-signal', path=request_path, interface=cs.CR, signal='Failed'), EventPattern('dbus-method-call', path=channel.object_path, interface=cs.CHANNEL, method='Close', handled=True), ) if __name__ == '__main__': exec_test(test, {}) telepathy-mission-control-5.16.4/tests/twisted/account-requests/create-text.py0000644000175000017500000001514412735242352030760 0ustar00gkiagiagkiagia00000000000000# Copyright (C) 2009 Nokia Corporation # Copyright (C) 2009 Collabora Ltd. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA # 02110-1301 USA import dbus """Regression test for the unofficial Account.Interface.Requests API when a channel can be created successfully. """ import dbus import dbus.service from servicetest import EventPattern, tp_name_prefix, tp_path_prefix, \ call_async from mctest import exec_test, SimulatedConnection, SimulatedClient, \ create_fakecm_account, enable_fakecm_account, SimulatedChannel, \ expect_client_setup, ChannelDispatcher import constants as cs def test(q, bus, mc): params = dbus.Dictionary({"account": "someguy@example.com", "password": "secrecy"}, signature='sv') cm_name_ref, account = create_fakecm_account(q, bus, mc, params) conn = enable_fakecm_account(q, bus, mc, account, params) text_fixed_properties = dbus.Dictionary({ cs.CHANNEL + '.TargetHandleType': cs.HT_CONTACT, cs.CHANNEL + '.ChannelType': cs.CHANNEL_TYPE_TEXT, }, signature='sv') client = SimulatedClient(q, bus, 'Empathy', observe=[text_fixed_properties], approve=[text_fixed_properties], handle=[text_fixed_properties], bypass_approval=False) # No Approver should be invoked at any point during this test, because the # Channel was Requested def fail_on_approval(e): raise AssertionError('Approver should not be invoked') q.add_dbus_method_impl(fail_on_approval, path=client.object_path, interface=cs.APPROVER, method='AddDispatchOperation') # wait for MC to download the properties expect_client_setup(q, [client]) test_channel_creation(q, bus, account, client, conn, False) test_channel_creation(q, bus, account, client, conn, True) def test_channel_creation(q, bus, account, client, conn, ensure): user_action_time = dbus.Int64(1238582606) # chat UI calls ChannelDispatcher.EnsureChannel or CreateChannel cd = ChannelDispatcher(bus) request = dbus.Dictionary({ cs.CHANNEL + '.ChannelType': cs.CHANNEL_TYPE_TEXT, cs.CHANNEL + '.TargetHandleType': cs.HT_CONTACT, cs.CHANNEL + '.TargetID': 'juliet', }, signature='sv') if ensure: method = cd.EnsureChannel else: method = cd.CreateChannel request_path = method(account.object_path, request, user_action_time, client.bus_name) cr = bus.get_object(cs.CD, request_path) request_props = cr.GetAll(cs.CR, dbus_interface=cs.PROPERTIES_IFACE) assert request_props['Account'] == account.object_path assert request_props['Requests'] == [request] assert request_props['UserActionTime'] == user_action_time add_request = q.expect('dbus-method-call', handled=False, interface=cs.CLIENT_IFACE_REQUESTS, method='AddRequest', path=client.object_path) assert add_request.args[0] == request_path request_props = add_request.args[1] assert request_props[cs.CR + '.Account'] == account.object_path assert request_props[cs.CR + '.Requests'] == [request] assert request_props[cs.CR + '.UserActionTime'] == user_action_time assert request_props[cs.CR + '.PreferredHandler'] == client.bus_name q.dbus_return(add_request.message, signature='') # chat UI connects to signals and calls ChannelRequest.Proceed() cr.Proceed() cm_request_call = q.expect('dbus-method-call', interface=cs.CONN_IFACE_REQUESTS, method=(ensure and 'EnsureChannel' or 'CreateChannel'), path=conn.object_path, args=[request], handled=False) # Time passes. A channel is returned. channel_immutable = dbus.Dictionary(request) channel_immutable[cs.CHANNEL + '.InitiatorID'] = conn.self_ident channel_immutable[cs.CHANNEL + '.InitiatorHandle'] = conn.self_handle channel_immutable[cs.CHANNEL + '.Requested'] = True channel_immutable[cs.CHANNEL + '.Interfaces'] = \ dbus.Array([], signature='s') channel_immutable[cs.CHANNEL + '.TargetHandle'] = \ conn.ensure_handle(cs.HT_CONTACT, 'juliet') channel = SimulatedChannel(conn, channel_immutable) # this order of events is guaranteed by telepathy-spec (since 0.17.14) if ensure: q.dbus_return(cm_request_call.message, True, # <- Yours channel.object_path, channel.immutable, signature='boa{sv}') else: # Create q.dbus_return(cm_request_call.message, channel.object_path, channel.immutable, signature='oa{sv}') channel.announce() # Observer should get told, processing waits for it e = q.expect('dbus-method-call', path=client.object_path, interface=cs.OBSERVER, method='ObserveChannels', handled=False) assert e.args[0] == account.object_path, e.args assert e.args[1] == conn.object_path, e.args assert e.args[3] == '/', e.args # no dispatch operation assert e.args[4] == [request_path], e.args channels = e.args[2] assert len(channels) == 1, channels assert channels[0][0] == channel.object_path, channels assert channels[0][1] == channel_immutable, channels # Observer says "OK, go" q.dbus_return(e.message, signature='') # Handler is next e = q.expect('dbus-method-call', path=client.object_path, interface=cs.HANDLER, method='HandleChannels', handled=False) assert e.args[0] == account.object_path, e.args assert e.args[1] == conn.object_path, e.args channels = e.args[2] assert len(channels) == 1, channels assert channels[0][0] == channel.object_path, channels assert channels[0][1] == channel_immutable, channels assert e.args[3] == [request_path], e.args # Handler accepts the Channels q.dbus_return(e.message, signature='') # CR emits Succeeded q.expect('dbus-signal', path=request_path, interface=cs.CR, signal='Succeeded') # Close the channel channel.close() if __name__ == '__main__': exec_test(test, {}) telepathy-mission-control-5.16.4/tests/twisted/account-requests/delete-account-during-request.py0000644000175000017500000001112212735242352034373 0ustar00gkiagiagkiagia00000000000000# Copyright (C) 2009 Nokia Corporation # Copyright (C) 2009 Collabora Ltd. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA # 02110-1301 USA import dbus """Regression test for the unofficial Account.Interface.Requests API, when an account is deleted while requesting a channel from that account. """ import dbus import dbus.service from servicetest import EventPattern, tp_name_prefix, tp_path_prefix, \ call_async from mctest import exec_test, SimulatedConnection, SimulatedClient, \ create_fakecm_account, enable_fakecm_account, SimulatedChannel, \ expect_client_setup, ChannelDispatcher import constants as cs def test(q, bus, mc): params = dbus.Dictionary({"account": "someguy@example.com", "password": "secrecy"}, signature='sv') cm_name_ref, account = create_fakecm_account(q, bus, mc, params) conn = enable_fakecm_account(q, bus, mc, account, params) text_fixed_properties = dbus.Dictionary({ cs.CHANNEL + '.TargetHandleType': cs.HT_CONTACT, cs.CHANNEL + '.ChannelType': cs.CHANNEL_TYPE_TEXT, }, signature='sv') client = SimulatedClient(q, bus, 'Empathy', observe=[text_fixed_properties], approve=[text_fixed_properties], handle=[text_fixed_properties], bypass_approval=False) # wait for MC to download the properties expect_client_setup(q, [client]) user_action_time = dbus.Int64(1238582606) # chat UI calls ChannelDispatcher.CreateChannel cd = ChannelDispatcher(bus) request = dbus.Dictionary({ cs.CHANNEL + '.ChannelType': cs.CHANNEL_TYPE_TEXT, cs.CHANNEL + '.TargetHandleType': cs.HT_CONTACT, cs.CHANNEL + '.TargetID': 'juliet', }, signature='sv') request_path = cd.CreateChannel(account.object_path, request, user_action_time, client.bus_name) add_request = q.expect('dbus-method-call', handled=False, interface=cs.CLIENT_IFACE_REQUESTS, method='AddRequest', path=client.object_path) assert add_request.args[0] == request_path q.dbus_return(add_request.message, signature='') # chat UI connects to signals and calls ChannelRequest.Proceed() cr = bus.get_object(cs.CD, request_path) cr.Proceed() cm_request_call = q.expect('dbus-method-call', interface=cs.CONN_IFACE_REQUESTS, method='CreateChannel', path=conn.object_path, args=[request], handled=False) # Before the channel is returned, we delete the account account_iface = dbus.Interface(account, cs.ACCOUNT) assert account_iface.Remove() is None account_event, account_manager_event = q.expect_many( EventPattern('dbus-signal', path=account.object_path, signal='Removed', interface=cs.ACCOUNT, args=[] ), EventPattern('dbus-signal', path=cs.AM_PATH, signal='AccountRemoved', interface=cs.AM, args=[account.object_path] ), ) # You know that request I told you about? Not going to happen. remove_request = q.expect('dbus-method-call', interface=cs.CLIENT_IFACE_REQUESTS, method='RemoveRequest', handled=False) assert remove_request.args[0] == request_path # FIXME: the spec should maybe define what error this will be. Currently, # it's Disconnected assert remove_request.args[1].startswith(tp_name_prefix + '.Error.') q.expect('dbus-signal', path=request_path, interface=cs.CR, signal='Failed', args=remove_request.args[1:]) q.dbus_return(remove_request.message, signature='') # ... and the Connection is told to disconnect, hopefully before the # Channel has actually been established e = q.expect('dbus-method-call', path=conn.object_path, interface=cs.CONN, method='Disconnect', args=[], handled=True) if __name__ == '__main__': exec_test(test, {}) telepathy-mission-control-5.16.4/tests/twisted/dbus-account-plugin.c0000644000175000017500000014015212735242352026701 0ustar00gkiagiagkiagia00000000000000/* * A demonstration plugin that diverts account storage to D-Bus, where the * regression tests can manipulate it. * * Copyright © 2010 Nokia Corporation * Copyright © 2010-2012 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "config.h" #include "dbus-account-plugin.h" #define DEBUG(format, ...) g_debug ("%s: " format, G_STRFUNC, ##__VA_ARGS__) #define TESTDOT "org.freedesktop.Telepathy.MC.Test." #define TESTSLASH "/org/freedesktop/Telepathy/MC/Test/" #define TEST_DBUS_ACCOUNT_SERVICE TESTDOT "DBusAccountService" #define TEST_DBUS_ACCOUNT_SERVICE_PATH TESTSLASH "DBusAccountService" #define TEST_DBUS_ACCOUNT_SERVICE_IFACE TEST_DBUS_ACCOUNT_SERVICE #define TEST_DBUS_ACCOUNT_PLUGIN_PATH TESTSLASH "DBusAccountPlugin" #define TEST_DBUS_ACCOUNT_PLUGIN_IFACE TESTDOT "DBusAccountPlugin" typedef struct { gchar *path; /* string => GVariant */ GHashTable *attributes; /* string => GUINT_TO_POINTER(guint32) */ GHashTable *attribute_flags; /* set of strings */ GHashTable *uncommitted_attributes; /* string => GVariant */ GHashTable *parameters; /* string => string */ GHashTable *untyped_parameters; /* string => GUINT_TO_POINTER(guint32) */ GHashTable *parameter_flags; /* set of strings */ GHashTable *uncommitted_parameters; enum { UNCOMMITTED_CREATION, UNCOMMITTED_DELETION } flags; } Account; static void test_dbus_account_free (gpointer p) { Account *account = p; g_hash_table_unref (account->attributes); g_hash_table_unref (account->attribute_flags); g_hash_table_unref (account->parameters); g_hash_table_unref (account->untyped_parameters); g_hash_table_unref (account->parameter_flags); g_hash_table_unref (account->uncommitted_attributes); g_hash_table_unref (account->uncommitted_parameters); g_slice_free (Account, account); } static void account_storage_iface_init (McpAccountStorageIface *); struct _TestDBusAccountPlugin { GObject parent; GDBusConnection *bus; GHashTable *accounts; McpAccountManager *feedback; GQueue events; gboolean active; }; struct _TestDBusAccountPluginClass { GObjectClass parent_class; }; G_DEFINE_TYPE_WITH_CODE (TestDBusAccountPlugin, test_dbus_account_plugin, G_TYPE_OBJECT, G_IMPLEMENT_INTERFACE (MCP_TYPE_ACCOUNT_STORAGE, account_storage_iface_init)); typedef struct { TestDBusAccountPlugin *self; gchar *account_name; } AsyncData; static AsyncData * async_data_new (TestDBusAccountPlugin *self, const gchar *account_name) { AsyncData *ret = g_slice_new0 (AsyncData); ret->self = g_object_ref (self); ret->account_name = g_strdup (account_name); return ret; } static void async_data_free (AsyncData *ad) { g_clear_object (&ad->self); g_free (ad->account_name); g_slice_free (AsyncData, ad); } typedef enum { EVENT_PARAMS, EVENT_ATTRS, EVENT_CREATION, EVENT_DELETION } EventType; typedef struct { EventType type; GVariant *args; } Event; static Event * event_new (EventType type, GVariant *args) { Event *e = g_slice_new0 (Event); e->type = type; e->args = g_variant_ref_sink (args); return e; } static Account * lookup_account (TestDBusAccountPlugin *self, const gchar *account_name) { return g_hash_table_lookup (self->accounts, account_name); } static Account * ensure_account (TestDBusAccountPlugin *self, const gchar *account_name) { Account *account = lookup_account (self, account_name); if (account == NULL) { account = g_slice_new (Account); account->path = g_strdup_printf ("%s%s", TP_ACCOUNT_OBJECT_PATH_BASE, account_name); account->attributes = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, (GDestroyNotify) g_variant_unref); account->attribute_flags = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL); account->parameters = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, (GDestroyNotify) g_variant_unref); account->untyped_parameters = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free); account->parameter_flags = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL); account->uncommitted_attributes = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL); account->uncommitted_parameters = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL); account->flags = UNCOMMITTED_CREATION; g_hash_table_insert (self->accounts, g_strdup (account_name), account); } account->flags &= ~UNCOMMITTED_DELETION; return account; } static void service_appeared_cb (GDBusConnection *bus, const gchar *name, const gchar *owner, gpointer user_data) { TestDBusAccountPlugin *self = TEST_DBUS_ACCOUNT_PLUGIN (user_data); self->active = TRUE; /* FIXME: for now, we assume there are no accounts. */ g_dbus_connection_emit_signal (self->bus, NULL, TEST_DBUS_ACCOUNT_PLUGIN_PATH, TEST_DBUS_ACCOUNT_PLUGIN_IFACE, "Active", NULL, NULL); } static void service_vanished_cb (GDBusConnection *bus, const gchar *name, gpointer user_data) { TestDBusAccountPlugin *self = TEST_DBUS_ACCOUNT_PLUGIN (user_data); GHashTableIter iter; gpointer k, v; self->active = FALSE; g_hash_table_iter_init (&iter, self->accounts); while (g_hash_table_iter_next (&iter, &k, &v)) { Account *account = v; if ((account->flags & UNCOMMITTED_DELETION) == 0) mcp_account_storage_emit_deleted (MCP_ACCOUNT_STORAGE (self), k); g_hash_table_iter_remove (&iter); } g_dbus_connection_emit_signal (self->bus, NULL, TEST_DBUS_ACCOUNT_PLUGIN_PATH, TEST_DBUS_ACCOUNT_PLUGIN_IFACE, "Inactive", NULL, NULL); } static void test_dbus_account_plugin_init (TestDBusAccountPlugin *self) { GError *error = NULL; DEBUG ("called"); self->accounts = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, test_dbus_account_free); self->bus = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, &error); g_assert_no_error (error); g_assert (self->bus != NULL); g_queue_init (&self->events); g_bus_watch_name (G_BUS_TYPE_SESSION, TEST_DBUS_ACCOUNT_SERVICE, G_BUS_NAME_WATCHER_FLAGS_NONE, service_appeared_cb, service_vanished_cb, g_object_ref (self), g_object_unref); } static void test_dbus_account_plugin_class_init (TestDBusAccountPluginClass *cls) { DEBUG ("called"); } static Account * test_dbus_account_plugin_add_account (TestDBusAccountPlugin *self, const gchar *account_name, GVariant *attributes, GVariant *attribute_flags, GVariant *parameters, GVariant *untyped_parameters, GVariant *param_flags) { GVariantIter iter; const gchar *k; GVariant *v; const gchar *s; guint32 u; Account *account = ensure_account (self, account_name); g_variant_iter_init (&iter, attributes); while (g_variant_iter_loop (&iter, "{sv}", &k, &v)) g_hash_table_insert (account->attributes, g_strdup (k), g_variant_ref (v)); g_variant_iter_init (&iter, attribute_flags); while (g_variant_iter_loop (&iter, "{su}", &k, &u)) g_hash_table_insert (account->attribute_flags, g_strdup (k), GUINT_TO_POINTER (u)); g_variant_iter_init (&iter, parameters); while (g_variant_iter_loop (&iter, "{sv}", &k, &v)) g_hash_table_insert (account->parameters, g_strdup (k), g_variant_ref (v)); g_variant_iter_init (&iter, untyped_parameters); while (g_variant_iter_loop (&iter, "{ss}", &k, &s)) g_hash_table_insert (account->untyped_parameters, g_strdup (k), g_strdup (s)); g_variant_iter_init (&iter, param_flags); while (g_variant_iter_loop (&iter, "{su}", &k, &u)) g_hash_table_insert (account->parameter_flags, g_strdup (k), GUINT_TO_POINTER (u)); return account; } static void test_dbus_account_plugin_process_account_creation (TestDBusAccountPlugin *self, GVariant *args) { const gchar *account_name; Account *account; GVariant *attrs; GVariant *params; GVariant *untyped_params; GVariant *attr_flags; GVariant *param_flags; g_variant_get (args, "(&s@a{sv}@a{su}@a{sv}@a{ss}@a{su})", &account_name, &attrs, &attr_flags, ¶ms, &untyped_params, ¶m_flags); DEBUG ("%s", account_name); account = lookup_account (self, account_name); if (account != NULL) { /* we already knew about it; assume nothing changed? */ } else { /* FIXME: this silently drops any uncommitted changes, * if we're racing with the service, is that right? */ /* we don't have to emit altered-one so we can skip * a lot of rubbish */ account = test_dbus_account_plugin_add_account (self, account_name, attrs, attr_flags, params, untyped_params, param_flags); mcp_account_storage_emit_created ( MCP_ACCOUNT_STORAGE (self), account_name); g_dbus_connection_emit_signal (self->bus, NULL, TEST_DBUS_ACCOUNT_PLUGIN_PATH, TEST_DBUS_ACCOUNT_PLUGIN_IFACE, "AccountCreated", g_variant_new_parsed ("(%o,)", account->path), NULL); } g_variant_unref (attrs); g_variant_unref (attr_flags); g_variant_unref (params); g_variant_unref (untyped_params); g_variant_unref (param_flags); } static void test_dbus_account_plugin_process_account_deletion (TestDBusAccountPlugin *self, GVariant *args) { const gchar *account_name; Account *account; g_variant_get (args, "(&s)", &account_name); DEBUG ("%s", account_name); account = lookup_account (self, account_name); if (account == NULL) { g_warning ("accounts service deleted %s but we don't " "have any record of that account", account_name); } else { gchar *path = g_strdup (account->path); /* FIXME: this silently drops any uncommitted changes, * is that right? */ g_hash_table_remove (self->accounts, account_name); mcp_account_storage_emit_deleted ( MCP_ACCOUNT_STORAGE (self), account_name); g_dbus_connection_emit_signal (self->bus, NULL, TEST_DBUS_ACCOUNT_PLUGIN_PATH, TEST_DBUS_ACCOUNT_PLUGIN_IFACE, "AccountDeleted", g_variant_new_parsed ("(%o,)", path), NULL); g_free (path); } } static void test_dbus_account_plugin_process_attributes (TestDBusAccountPlugin *self, GVariant *args) { const gchar *account_name; Account *account; GVariant *attrs; GVariant *attr_flags; GVariant *deleted; g_variant_get (args, "(&s@a{sv}@a{su}@as)", &account_name, &attrs, &attr_flags, &deleted); DEBUG ("%s", account_name); account = lookup_account (self, account_name); if (account == NULL) { g_warning ("accounts service altered %s but we don't " "have any record of that account", account_name); } else { GVariantIter iter; const gchar *attr; GVariant *value; gboolean enabled; g_variant_iter_init (&iter, attrs); while (g_variant_iter_loop (&iter, "{sv}", &attr, &value)) { GVariant *stored = g_hash_table_lookup ( account->attributes, attr); if (tp_strdiff (attr, "Enabled") && !g_hash_table_contains ( account->uncommitted_attributes, attr) && (stored == NULL || !g_variant_equal (value, stored))) { gchar *repr = g_variant_print (value, TRUE); guint32 flags; DEBUG ("%s changed to %s, signalling MC", attr, repr); g_free (repr); if (!g_variant_lookup (attr_flags, attr, "u", &flags)) flags = 0; g_hash_table_insert (account->attributes, g_strdup (attr), g_variant_ref (value)); mcp_account_manager_set_attribute (self->feedback, account_name, attr, value, flags); mcp_account_storage_emit_altered_one ( MCP_ACCOUNT_STORAGE (self), account_name, attr); g_dbus_connection_emit_signal (self->bus, NULL, TEST_DBUS_ACCOUNT_PLUGIN_PATH, TEST_DBUS_ACCOUNT_PLUGIN_IFACE, "AttributeChanged", g_variant_new_parsed ("(%o, %s)", account->path, attr), NULL); } } g_variant_iter_init (&iter, deleted); while (g_variant_iter_loop (&iter, "s", &attr)) { if (!g_hash_table_contains ( account->uncommitted_attributes, attr) && g_hash_table_contains (account->attributes, attr)) { DEBUG ("%s deleted", attr); g_hash_table_remove (account->attributes, attr); mcp_account_manager_set_attribute (self->feedback, account_name, attr, NULL, 0); mcp_account_storage_emit_altered_one ( MCP_ACCOUNT_STORAGE (self), account_name, attr); g_dbus_connection_emit_signal (self->bus, NULL, TEST_DBUS_ACCOUNT_PLUGIN_PATH, TEST_DBUS_ACCOUNT_PLUGIN_IFACE, "AttributeDeleted", g_variant_new_parsed ("(%o, %s)", account->path, attr), NULL); } } /* Deal with Enabled separately: we don't have to call set_value() * for this one */ if (g_variant_lookup (attrs, "Enabled", "b", &enabled)) { DEBUG ("Enabled changed to %s", enabled ? "true" : "false"); mcp_account_storage_emit_toggled ( MCP_ACCOUNT_STORAGE (self), account_name, enabled); g_dbus_connection_emit_signal (self->bus, NULL, TEST_DBUS_ACCOUNT_PLUGIN_PATH, TEST_DBUS_ACCOUNT_PLUGIN_IFACE, "Toggled", g_variant_new_parsed ("(%o, %b)", account->path, enabled), NULL); } } g_variant_unref (attrs); g_variant_unref (attr_flags); g_variant_unref (deleted); } static void test_dbus_account_plugin_process_parameters (TestDBusAccountPlugin *self, GVariant *args) { const gchar *account_name; Account *account; GVariant *params; GVariant *untyped_params; GVariant *param_flags; GVariant *deleted; g_variant_get (args, "(&s@a{sv}@a{ss}@a{su}@as)", &account_name, ¶ms, &untyped_params, ¶m_flags, &deleted); DEBUG ("%s", account_name); account = lookup_account (self, account_name); if (account == NULL) { g_warning ("accounts service altered %s but we don't " "have any record of that account", account_name); } else { GVariantIter iter; const gchar *param; GVariant *value; gchar *key; gchar *escaped; g_variant_iter_init (&iter, params); while (g_variant_iter_loop (&iter, "{sv}", ¶m, &value)) { GVariant *stored = g_hash_table_lookup ( account->parameters, param); if (!g_hash_table_contains ( account->uncommitted_parameters, param) && (stored == NULL || !g_variant_equal (value, stored))) { guint32 flags; if (!g_variant_lookup (param_flags, param, "u", &flags)) flags = 0; g_hash_table_insert (account->parameters, g_strdup (param), g_variant_ref (value)); key = g_strdup_printf ("param-%s", param); mcp_account_manager_set_parameter (self->feedback, account_name, param, value, flags); mcp_account_storage_emit_altered_one ( MCP_ACCOUNT_STORAGE (self), account_name, key); g_free (key); g_dbus_connection_emit_signal (self->bus, NULL, TEST_DBUS_ACCOUNT_PLUGIN_PATH, TEST_DBUS_ACCOUNT_PLUGIN_IFACE, "ParameterChanged", g_variant_new_parsed ("(%o, %s)", account->path, param), NULL); } } g_variant_iter_init (&iter, untyped_params); while (g_variant_iter_loop (&iter, "{ss}", ¶m, &escaped)) { GVariant *stored = g_hash_table_lookup ( account->untyped_parameters, param); if (!g_hash_table_contains ( account->uncommitted_parameters, param) && (stored == NULL || !g_variant_equal (value, stored))) { g_hash_table_insert (account->untyped_parameters, g_strdup (param), g_strdup (escaped)); key = g_strdup_printf ("param-%s", param); mcp_account_manager_set_value (self->feedback, account_name, key, escaped); mcp_account_storage_emit_altered_one ( MCP_ACCOUNT_STORAGE (self), account_name, key); g_free (key); g_dbus_connection_emit_signal (self->bus, NULL, TEST_DBUS_ACCOUNT_PLUGIN_PATH, TEST_DBUS_ACCOUNT_PLUGIN_IFACE, "ParameterChanged", g_variant_new_parsed ("(%o, %s)", account->path, param), NULL); } } g_variant_iter_init (&iter, deleted); while (g_variant_iter_loop (&iter, "s", ¶m)) { if (!g_hash_table_contains ( account->uncommitted_parameters, param) && (g_hash_table_contains (account->parameters, param) || g_hash_table_contains ( account->untyped_parameters, param))) { g_hash_table_remove (account->parameters, param); g_hash_table_remove (account->untyped_parameters, param); key = g_strdup_printf ("param-%s", param); mcp_account_manager_set_parameter (self->feedback, account_name, param, NULL, 0); mcp_account_storage_emit_altered_one ( MCP_ACCOUNT_STORAGE (self), account_name, key); g_free (key); g_dbus_connection_emit_signal (self->bus, NULL, TEST_DBUS_ACCOUNT_PLUGIN_PATH, TEST_DBUS_ACCOUNT_PLUGIN_IFACE, "ParameterDeleted", g_variant_new_parsed ("(%o, %s)", account->path, param), NULL); } } } g_variant_unref (params); g_variant_unref (untyped_params); g_variant_unref (param_flags); g_variant_unref (deleted); } static void test_dbus_account_plugin_process_events (TestDBusAccountPlugin *self) { Event *event; if (self->feedback == NULL) return; while ((event = g_queue_pop_head (&self->events)) != NULL) { switch (event->type) { case EVENT_CREATION: test_dbus_account_plugin_process_account_creation (self, event->args); break; case EVENT_DELETION: test_dbus_account_plugin_process_account_deletion (self, event->args); break; case EVENT_ATTRS: test_dbus_account_plugin_process_attributes (self, event->args); break; case EVENT_PARAMS: test_dbus_account_plugin_process_parameters (self, event->args); break; } g_variant_unref (event->args); g_slice_free (Event, event); } } static void account_created_cb (GDBusConnection *bus, const gchar *sender_name, const gchar *object_path, const gchar *iface_name, const gchar *signal_name, GVariant *tuple, gpointer user_data) { TestDBusAccountPlugin *self = TEST_DBUS_ACCOUNT_PLUGIN (user_data); const gchar *account_name; g_variant_get (tuple, "(&s@a{sv}@a{su}@a{sv}@a{ss}@a{su})", &account_name, NULL, NULL, NULL, NULL, NULL); DEBUG ("%s", account_name); g_queue_push_tail (&self->events, event_new (EVENT_CREATION, tuple)); test_dbus_account_plugin_process_events (self); } static void account_deleted_cb (GDBusConnection *bus, const gchar *sender_name, const gchar *object_path, const gchar *iface_name, const gchar *signal_name, GVariant *tuple, gpointer user_data) { TestDBusAccountPlugin *self = TEST_DBUS_ACCOUNT_PLUGIN (user_data); const gchar *account_name; g_variant_get (tuple, "(&s)", &account_name); DEBUG ("%s", account_name); g_queue_push_tail (&self->events, event_new (EVENT_DELETION, tuple)); test_dbus_account_plugin_process_events (self); } static void attributes_changed_cb (GDBusConnection *bus, const gchar *sender_name, const gchar *object_path, const gchar *iface_name, const gchar *signal_name, GVariant *tuple, gpointer user_data) { TestDBusAccountPlugin *self = TEST_DBUS_ACCOUNT_PLUGIN (user_data); const gchar *account_name; g_variant_get (tuple, "(&s@a{sv}@a{su}@as)", &account_name, NULL, NULL, NULL); DEBUG ("%s", account_name); g_queue_push_tail (&self->events, event_new (EVENT_ATTRS, tuple)); test_dbus_account_plugin_process_events (self); } static void parameters_changed_cb (GDBusConnection *bus, const gchar *sender_name, const gchar *object_path, const gchar *iface_name, const gchar *signal_name, GVariant *tuple, gpointer user_data) { TestDBusAccountPlugin *self = TEST_DBUS_ACCOUNT_PLUGIN (user_data); const gchar *account_name; g_variant_get (tuple, "(&s@a{sv}@a{ss}@a{su}@as)", &account_name, NULL, NULL, NULL, NULL); DEBUG ("%s", account_name); g_queue_push_tail (&self->events, event_new (EVENT_PARAMS, tuple)); test_dbus_account_plugin_process_events (self); } static GList * test_dbus_account_plugin_list (const McpAccountStorage *storage, const McpAccountManager *am) { TestDBusAccountPlugin *self = TEST_DBUS_ACCOUNT_PLUGIN (storage); GError *error = NULL; GVariant *tuple, *accounts; GVariant *attributes, *attribute_flags; GVariant *parameters, *untyped_parameters, *param_flags; GVariantIter account_iter; const gchar *account_name; GList *ret = NULL; DEBUG ("called"); g_dbus_connection_emit_signal (self->bus, NULL, TEST_DBUS_ACCOUNT_PLUGIN_PATH, TEST_DBUS_ACCOUNT_PLUGIN_IFACE, "Listing", NULL, NULL); g_dbus_connection_signal_subscribe (self->bus, TEST_DBUS_ACCOUNT_SERVICE, TEST_DBUS_ACCOUNT_SERVICE_IFACE, "AccountCreated", TEST_DBUS_ACCOUNT_SERVICE_PATH, NULL, /* no arg0 */ G_DBUS_SIGNAL_FLAGS_NONE, account_created_cb, g_object_ref (self), g_object_unref); g_dbus_connection_signal_subscribe (self->bus, TEST_DBUS_ACCOUNT_SERVICE, TEST_DBUS_ACCOUNT_SERVICE_IFACE, "AccountDeleted", TEST_DBUS_ACCOUNT_SERVICE_PATH, NULL, /* no arg0 */ G_DBUS_SIGNAL_FLAGS_NONE, account_deleted_cb, g_object_ref (self), g_object_unref); g_dbus_connection_signal_subscribe (self->bus, TEST_DBUS_ACCOUNT_SERVICE, TEST_DBUS_ACCOUNT_SERVICE_IFACE, "AttributesChanged", TEST_DBUS_ACCOUNT_SERVICE_PATH, NULL, /* no arg0 */ G_DBUS_SIGNAL_FLAGS_NONE, attributes_changed_cb, g_object_ref (self), g_object_unref); g_dbus_connection_signal_subscribe (self->bus, TEST_DBUS_ACCOUNT_SERVICE, TEST_DBUS_ACCOUNT_SERVICE_IFACE, "ParametersChanged", TEST_DBUS_ACCOUNT_SERVICE_PATH, NULL, /* no arg0 */ G_DBUS_SIGNAL_FLAGS_NONE, parameters_changed_cb, g_object_ref (self), g_object_unref); /* list is allowed to block */ tuple = g_dbus_connection_call_sync (self->bus, TEST_DBUS_ACCOUNT_SERVICE, TEST_DBUS_ACCOUNT_SERVICE_PATH, TEST_DBUS_ACCOUNT_SERVICE_IFACE, "GetAccounts", NULL, /* no parameters */ G_VARIANT_TYPE ("(a{s(a{sv}a{su}a{sv}a{ss}a{su})})"), G_DBUS_CALL_FLAGS_NONE, -1, NULL, /* no cancellable */ &error); if (g_error_matches (error, G_DBUS_ERROR, G_DBUS_ERROR_NAME_HAS_NO_OWNER) || g_error_matches (error, G_DBUS_ERROR, G_DBUS_ERROR_SERVICE_UNKNOWN)) { /* this regression test isn't using the fake accounts service */ g_clear_error (&error); return NULL; } self->active = TRUE; g_assert_no_error (error); g_variant_get (tuple, "(@*)", &accounts); g_variant_iter_init (&account_iter, accounts); while (g_variant_iter_loop (&account_iter, "{s(@a{sv}@a{su}@a{sv}@a{ss}@a{su})}", &account_name, &attributes, &attribute_flags, ¶meters, &untyped_parameters, ¶m_flags)) { test_dbus_account_plugin_add_account (self, account_name, attributes, attribute_flags, parameters, untyped_parameters, param_flags); ret = g_list_prepend (ret, g_strdup (account_name)); } g_variant_unref (accounts); g_variant_unref (tuple); return ret; } static void test_dbus_account_plugin_ready (const McpAccountStorage *storage, const McpAccountManager *am) { TestDBusAccountPlugin *self = TEST_DBUS_ACCOUNT_PLUGIN (storage); DEBUG ("called"); g_dbus_connection_emit_signal (self->bus, NULL, TEST_DBUS_ACCOUNT_PLUGIN_PATH, TEST_DBUS_ACCOUNT_PLUGIN_IFACE, "Ready", NULL, NULL); self->feedback = MCP_ACCOUNT_MANAGER (am); test_dbus_account_plugin_process_events (self); } static gchar * test_dbus_account_plugin_create (const McpAccountStorage *storage, const McpAccountManager *am, const gchar *manager, const gchar *protocol, GHashTable *params, GError **error) { TestDBusAccountPlugin *self = TEST_DBUS_ACCOUNT_PLUGIN (storage); Account *account; gchar *name; if (!self->active) return FALSE; name = mcp_account_manager_get_unique_name ((McpAccountManager *) am, manager, protocol, params); account = ensure_account (self, name); g_dbus_connection_emit_signal (self->bus, NULL, TEST_DBUS_ACCOUNT_PLUGIN_PATH, TEST_DBUS_ACCOUNT_PLUGIN_IFACE, "DeferringCreate", g_variant_new_parsed ("(%o,)", account->path), NULL); return name; } static gboolean test_dbus_account_plugin_delete (const McpAccountStorage *storage, const McpAccountManager *am, const gchar *account_name, const gchar *key) { TestDBusAccountPlugin *self = TEST_DBUS_ACCOUNT_PLUGIN (storage); Account *account = lookup_account (self, account_name); DEBUG ("called"); if (account == NULL || !self->active) return FALSE; if (key == NULL) { account->flags |= UNCOMMITTED_DELETION; g_hash_table_remove_all (account->attributes); g_hash_table_remove_all (account->parameters); g_hash_table_remove_all (account->untyped_parameters); g_hash_table_remove_all (account->attribute_flags); g_hash_table_remove_all (account->parameter_flags); account->flags &= ~UNCOMMITTED_CREATION; g_hash_table_remove_all (account->uncommitted_attributes); g_hash_table_remove_all (account->uncommitted_parameters); g_dbus_connection_emit_signal (self->bus, NULL, TEST_DBUS_ACCOUNT_PLUGIN_PATH, TEST_DBUS_ACCOUNT_PLUGIN_IFACE, "DeferringDelete", g_variant_new_parsed ("(%o,)", account->path), NULL); } else if (g_str_has_prefix (key, "param-")) { g_hash_table_remove (account->parameters, key + 6); g_hash_table_remove (account->untyped_parameters, key + 6); g_hash_table_remove (account->parameter_flags, key + 6); g_hash_table_add (account->uncommitted_parameters, g_strdup (key + 6)); g_dbus_connection_emit_signal (self->bus, NULL, TEST_DBUS_ACCOUNT_PLUGIN_PATH, TEST_DBUS_ACCOUNT_PLUGIN_IFACE, "DeferringDeleteParameter", g_variant_new_parsed ("(%o, %s)", account->path, key + 6), NULL); } else { g_hash_table_remove (account->attributes, key); g_hash_table_remove (account->attribute_flags, key); g_hash_table_add (account->uncommitted_attributes, g_strdup (key)); g_dbus_connection_emit_signal (self->bus, NULL, TEST_DBUS_ACCOUNT_PLUGIN_PATH, TEST_DBUS_ACCOUNT_PLUGIN_IFACE, "DeferringDeleteAttribute", g_variant_new_parsed ("(%o, %s)", account->path, key), NULL); } return TRUE; } static gboolean test_dbus_account_plugin_get (const McpAccountStorage *storage, const McpAccountManager *am, const gchar *account_name, const gchar *key) { TestDBusAccountPlugin *self = TEST_DBUS_ACCOUNT_PLUGIN (storage); Account *account = lookup_account (self, account_name); if (!self->active || account == NULL || (account->flags & UNCOMMITTED_DELETION)) return FALSE; if (key == NULL) { GHashTableIter iter; gpointer k, v; /* get everything */ g_dbus_connection_emit_signal (self->bus, NULL, TEST_DBUS_ACCOUNT_PLUGIN_PATH, TEST_DBUS_ACCOUNT_PLUGIN_IFACE, "GetAllKeys", g_variant_new_parsed ("(%o,)", account->path), NULL); g_hash_table_iter_init (&iter, account->attributes); while (g_hash_table_iter_next (&iter, &k, &v)) { gchar *escaped = mcp_account_manager_escape_variant_for_keyfile (am, v); mcp_account_manager_set_value (am, account_name, k, escaped); g_free (escaped); } g_hash_table_iter_init (&iter, account->untyped_parameters); while (g_hash_table_iter_next (&iter, &k, &v)) { gchar *param_foo; McpParameterFlags flags; param_foo = g_strdup_printf ("param-%s", (const gchar *) k); mcp_account_manager_set_value (am, account_name, param_foo, v); flags = GPOINTER_TO_UINT (g_hash_table_lookup ( account->parameter_flags, k)); if (flags & MCP_PARAMETER_FLAG_SECRET) mcp_account_manager_parameter_make_secret (am, account_name, param_foo); g_free (param_foo); } g_hash_table_iter_init (&iter, account->parameters); while (g_hash_table_iter_next (&iter, &k, &v)) { gchar *param_foo; guint32 flags; gchar *escaped = mcp_account_manager_escape_variant_for_keyfile (am, v); param_foo = g_strdup_printf ("param-%s", (const gchar *) k); mcp_account_manager_set_value (am, account_name, param_foo, escaped); g_free (escaped); flags = GPOINTER_TO_UINT (g_hash_table_lookup (account->parameter_flags, k)); if (flags & MCP_PARAMETER_FLAG_SECRET) mcp_account_manager_parameter_make_secret (am, account_name, param_foo); g_free (param_foo); } return TRUE; } /* get one parameter */ if (g_str_has_prefix (key, "param-")) { GVariant *v = g_hash_table_lookup (account->parameters, key + 6); const gchar *s = g_hash_table_lookup (account->untyped_parameters, key + 6); guint32 flags = GPOINTER_TO_UINT ( g_hash_table_lookup (account->parameter_flags, key + 6)); g_dbus_connection_emit_signal (self->bus, NULL, TEST_DBUS_ACCOUNT_PLUGIN_PATH, TEST_DBUS_ACCOUNT_PLUGIN_IFACE, "GetParameter", g_variant_new_parsed ("(%o, %s)", account->path, key + 6), NULL); if (flags & MCP_PARAMETER_FLAG_SECRET) mcp_account_manager_parameter_make_secret (am, account_name, key); if (v != NULL) { gchar *escaped = mcp_account_manager_escape_variant_for_keyfile (am, v); mcp_account_manager_set_value (am, account_name, key, escaped); g_free (escaped); } else if (s != NULL) { mcp_account_manager_set_value (am, account_name, key, s); } else { return FALSE; } } else { GVariant *v = g_hash_table_lookup (account->attributes, key); g_dbus_connection_emit_signal (self->bus, NULL, TEST_DBUS_ACCOUNT_PLUGIN_PATH, TEST_DBUS_ACCOUNT_PLUGIN_IFACE, "GetAttribute", g_variant_new_parsed ("(%o, %s)", account->path, key), NULL); if (v != NULL) { gchar *escaped = mcp_account_manager_escape_variant_for_keyfile (am, v); mcp_account_manager_set_value (am, account_name, key, escaped); g_free (escaped); } else { return FALSE; } } return TRUE; } static gboolean test_dbus_account_plugin_set (const McpAccountStorage *storage, const McpAccountManager *am, const gchar *account_name, const gchar *key, const gchar *value) { /* Now that we implement set_attribute and set_parameter, this no longer * needs a real implementation. */ return FALSE; } static gboolean test_dbus_account_plugin_set_attribute (McpAccountStorage *storage, McpAccountManager *am, const gchar *account_name, const gchar *attribute, GVariant *value, McpAttributeFlags flags) { TestDBusAccountPlugin *self = TEST_DBUS_ACCOUNT_PLUGIN (storage); Account *account = lookup_account (self, account_name); g_return_val_if_fail (account_name != NULL, FALSE); g_return_val_if_fail (attribute != NULL, FALSE); /* for deletions, MC would call delete() instead */ g_return_val_if_fail (value != NULL, FALSE); DEBUG ("%s of %s", attribute, account_name); if (!self->active || account == NULL || (account->flags & UNCOMMITTED_DELETION)) return FALSE; g_hash_table_insert (account->attributes, g_strdup (attribute), g_variant_ref (value)); g_hash_table_insert (account->attribute_flags, g_strdup (attribute), GUINT_TO_POINTER (flags)); g_hash_table_add (account->uncommitted_attributes, g_strdup (attribute)); g_dbus_connection_emit_signal (self->bus, NULL, TEST_DBUS_ACCOUNT_PLUGIN_PATH, TEST_DBUS_ACCOUNT_PLUGIN_IFACE, "DeferringSetAttribute", g_variant_new_parsed ("(%o, %s, %v)", account->path, attribute, value), NULL); return TRUE; } static gboolean test_dbus_account_plugin_set_parameter (McpAccountStorage *storage, McpAccountManager *am, const gchar *account_name, const gchar *parameter, GVariant *value, McpParameterFlags flags) { TestDBusAccountPlugin *self = TEST_DBUS_ACCOUNT_PLUGIN (storage); Account *account = lookup_account (self, account_name); g_return_val_if_fail (account_name != NULL, FALSE); g_return_val_if_fail (parameter != NULL, FALSE); /* for deletions, MC would call delete() instead */ g_return_val_if_fail (value != NULL, FALSE); DEBUG ("%s of %s", parameter, account_name); if (!self->active || account == NULL || (account->flags & UNCOMMITTED_DELETION)) return FALSE; g_hash_table_remove (account->untyped_parameters, parameter); g_hash_table_insert (account->parameters, g_strdup (parameter), g_variant_ref (value)); g_hash_table_insert (account->parameter_flags, g_strdup (parameter), GUINT_TO_POINTER (flags)); g_hash_table_add (account->uncommitted_parameters, g_strdup (parameter)); g_dbus_connection_emit_signal (self->bus, NULL, TEST_DBUS_ACCOUNT_PLUGIN_PATH, TEST_DBUS_ACCOUNT_PLUGIN_IFACE, "DeferringSetParameter", g_variant_new_parsed ("(%o, %s, %v)", account->path, parameter, value), NULL); return TRUE; } static gboolean test_dbus_account_plugin_commit (const McpAccountStorage *storage, const McpAccountManager *am) { TestDBusAccountPlugin *self = TEST_DBUS_ACCOUNT_PLUGIN (storage); GHashTableIter iter; gpointer k; DEBUG ("called"); if (!self->active) return FALSE; g_dbus_connection_emit_signal (self->bus, NULL, TEST_DBUS_ACCOUNT_PLUGIN_PATH, TEST_DBUS_ACCOUNT_PLUGIN_IFACE, "CommittingAll", NULL, NULL); g_hash_table_iter_init (&iter, self->accounts); while (g_hash_table_iter_next (&iter, &k, NULL)) { if (!mcp_account_storage_commit_one (storage, am, k)) { g_warning ("declined to commit account %s", (const gchar *) k); } } return TRUE; } static void delete_account_cb (GObject *source_object, GAsyncResult *res, gpointer user_data) { AsyncData *ad = user_data; GVariant *tuple; GError *error = NULL; tuple = g_dbus_connection_call_finish (ad->self->bus, res, &error); if (tuple != NULL) { g_hash_table_remove (ad->self->accounts, ad->account_name); g_variant_unref (tuple); } else { g_warning ("Unable to delete account %s: %s", ad->account_name, error->message); g_clear_error (&error); /* FIXME: we could roll back the deletion by claiming that * the service re-created the account? */ } async_data_free (ad); } static void create_account_cb (GObject *source_object, GAsyncResult *res, gpointer user_data) { AsyncData *ad = user_data; GVariant *tuple; GError *error = NULL; tuple = g_dbus_connection_call_finish (ad->self->bus, res, &error); if (tuple != NULL) { Account *account = lookup_account (ad->self, ad->account_name); if (account != NULL) account->flags &= ~UNCOMMITTED_CREATION; g_variant_unref (tuple); } else { g_warning ("Unable to create account %s: %s", ad->account_name, error->message); g_clear_error (&error); /* FIXME: we could roll back the creation by claiming that * the service deleted the account? If we do, we will have * to do it in an idle because we might be iterating over * all accounts in commit() */ } async_data_free (ad); } static void update_attributes_cb (GObject *source_object, GAsyncResult *res, gpointer user_data) { AsyncData *ad = user_data; GVariant *tuple; GError *error = NULL; tuple = g_dbus_connection_call_finish (ad->self->bus, res, &error); if (tuple != NULL) { Account *account = lookup_account (ad->self, ad->account_name); DEBUG ("Successfully committed attributes of %s", ad->account_name); if (account != NULL) g_hash_table_remove_all (account->uncommitted_attributes); g_variant_unref (tuple); } else { g_warning ("Unable to update attributes on %s: %s", ad->account_name, error->message); g_clear_error (&error); /* FIXME: we could roll back the creation by claiming that * the service restored the old attributes? */ } async_data_free (ad); } static void update_parameters_cb (GObject *source_object, GAsyncResult *res, gpointer user_data) { AsyncData *ad = user_data; GVariant *tuple; GError *error = NULL; tuple = g_dbus_connection_call_finish (ad->self->bus, res, &error); if (tuple != NULL) { Account *account = lookup_account (ad->self, ad->account_name); DEBUG ("Successfully committed parameters of %s", ad->account_name); if (account != NULL) g_hash_table_remove_all (account->uncommitted_parameters); g_variant_unref (tuple); } else { g_warning ("Unable to update parameters on %s: %s", ad->account_name, error->message); g_clear_error (&error); /* FIXME: we could roll back the creation by claiming that * the service restored the old parameters? */ } async_data_free (ad); } static gboolean test_dbus_account_plugin_commit_one (const McpAccountStorage *storage, const McpAccountManager *am, const gchar *account_name) { TestDBusAccountPlugin *self = TEST_DBUS_ACCOUNT_PLUGIN (storage); Account *account = lookup_account (self, account_name); GHashTableIter iter; gpointer k; GVariantBuilder a_sv_builder; GVariantBuilder a_ss_builder; GVariantBuilder a_su_builder; GVariantBuilder as_builder; DEBUG ("%s", account_name); /* MC does not call @commit_one with parameter %NULL (meaning "all accounts") * if we also implement commit(), which, as it happens, we do */ g_return_val_if_fail (account_name != NULL, FALSE); if (!self->active || account == NULL) return FALSE; g_dbus_connection_emit_signal (self->bus, NULL, TEST_DBUS_ACCOUNT_PLUGIN_PATH, TEST_DBUS_ACCOUNT_PLUGIN_IFACE, "CommittingOne", g_variant_new_parsed ("(%o,)", account->path), NULL); if (account->flags & UNCOMMITTED_DELETION) { g_dbus_connection_call (self->bus, TEST_DBUS_ACCOUNT_SERVICE, TEST_DBUS_ACCOUNT_SERVICE_PATH, TEST_DBUS_ACCOUNT_SERVICE_IFACE, "DeleteAccount", g_variant_new_parsed ("(%s,)", account_name), G_VARIANT_TYPE_UNIT, G_DBUS_CALL_FLAGS_NONE, -1, NULL, /* no cancellable */ delete_account_cb, async_data_new (self, account_name)); /* this doesn't mean we succeeded: it means we tried */ return TRUE; } if (account->flags & UNCOMMITTED_CREATION) { g_dbus_connection_call (self->bus, TEST_DBUS_ACCOUNT_SERVICE, TEST_DBUS_ACCOUNT_SERVICE_PATH, TEST_DBUS_ACCOUNT_SERVICE_IFACE, "CreateAccount", g_variant_new_parsed ("(%s,)", account_name), G_VARIANT_TYPE_UNIT, G_DBUS_CALL_FLAGS_NONE, -1, NULL, /* no cancellable */ create_account_cb, async_data_new (self, account_name)); } if (g_hash_table_size (account->uncommitted_attributes) != 0) { g_variant_builder_init (&a_sv_builder, G_VARIANT_TYPE_VARDICT); g_variant_builder_init (&a_su_builder, G_VARIANT_TYPE ("a{su}")); g_variant_builder_init (&as_builder, G_VARIANT_TYPE_STRING_ARRAY); g_hash_table_iter_init (&iter, account->uncommitted_attributes); while (g_hash_table_iter_next (&iter, &k, NULL)) { GVariant *v = g_hash_table_lookup (account->attributes, k); DEBUG ("Attribute %s uncommitted, committing it now", (const gchar *) k); if (v != NULL) { g_variant_builder_add (&a_sv_builder, "{sv}", k, v); g_variant_builder_add (&a_su_builder, "{su}", k, GPOINTER_TO_UINT (g_hash_table_lookup (account->attribute_flags, k))); } else { g_variant_builder_add (&as_builder, "s", k); } } g_dbus_connection_call (self->bus, TEST_DBUS_ACCOUNT_SERVICE, TEST_DBUS_ACCOUNT_SERVICE_PATH, TEST_DBUS_ACCOUNT_SERVICE_IFACE, "UpdateAttributes", g_variant_new_parsed ("(%s, %v, %v, %v)", account_name, g_variant_builder_end (&a_sv_builder), g_variant_builder_end (&a_su_builder), g_variant_builder_end (&as_builder)), G_VARIANT_TYPE_UNIT, G_DBUS_CALL_FLAGS_NONE, -1, NULL, /* no cancellable */ update_attributes_cb, async_data_new (self, account_name)); } else { DEBUG ("no attributes to commit"); } if (g_hash_table_size (account->uncommitted_parameters) != 0) { g_variant_builder_init (&a_sv_builder, G_VARIANT_TYPE_VARDICT); g_variant_builder_init (&a_ss_builder, G_VARIANT_TYPE ("a{ss}")); g_variant_builder_init (&a_su_builder, G_VARIANT_TYPE ("a{su}")); g_variant_builder_init (&as_builder, G_VARIANT_TYPE_STRING_ARRAY); g_hash_table_iter_init (&iter, account->uncommitted_parameters); while (g_hash_table_iter_next (&iter, &k, NULL)) { GVariant *v = g_hash_table_lookup (account->parameters, k); const gchar *s = g_hash_table_lookup (account->untyped_parameters, k); DEBUG ("Parameter %s uncommitted, committing it now", (const gchar *) k); if (v != NULL) { g_variant_builder_add (&a_sv_builder, "{sv}", k, v); g_variant_builder_add (&a_su_builder, "{su}", k, GPOINTER_TO_UINT (g_hash_table_lookup (account->parameter_flags, k))); } else if (s != NULL) { g_variant_builder_add (&a_ss_builder, "{ss}", k, s); g_variant_builder_add (&a_su_builder, "{su}", k, GPOINTER_TO_UINT (g_hash_table_lookup (account->parameter_flags, k))); } else { g_variant_builder_add (&as_builder, "s", k); } } g_dbus_connection_call (self->bus, TEST_DBUS_ACCOUNT_SERVICE, TEST_DBUS_ACCOUNT_SERVICE_PATH, TEST_DBUS_ACCOUNT_SERVICE_IFACE, "UpdateParameters", g_variant_new_parsed ("(%s, %v, %v, %v, %v)", account_name, g_variant_builder_end (&a_sv_builder), g_variant_builder_end (&a_ss_builder), g_variant_builder_end (&a_su_builder), g_variant_builder_end (&as_builder)), G_VARIANT_TYPE_UNIT, G_DBUS_CALL_FLAGS_NONE, -1, NULL, /* no cancellable */ update_parameters_cb, async_data_new (self, account_name)); } else { DEBUG ("no parameters to commit"); } return TRUE; } static void test_dbus_account_plugin_get_identifier (const McpAccountStorage *storage, const gchar *account_name, GValue *identifier) { TestDBusAccountPlugin *self = TEST_DBUS_ACCOUNT_PLUGIN (storage); Account *account = lookup_account (self, account_name); DEBUG ("%s", account_name); if (!self->active || account == NULL || (account->flags & UNCOMMITTED_DELETION)) return; /* Our "library-specific unique identifier" is just the object-path * as a string. */ g_value_init (identifier, G_TYPE_STRING); g_value_set_string (identifier, account->path); } static GHashTable * test_dbus_account_plugin_get_additional_info (const McpAccountStorage *storage, const gchar *account_name) { TestDBusAccountPlugin *self = TEST_DBUS_ACCOUNT_PLUGIN (storage); Account *account = lookup_account (self, account_name); GHashTable *ret; DEBUG ("%s", account_name); if (!self->active || account == NULL || (account->flags & UNCOMMITTED_DELETION)) return NULL; ret = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, (GDestroyNotify) tp_g_value_slice_free); g_hash_table_insert (ret, g_strdup ("hello"), tp_g_value_slice_new_static_string ("world")); return ret; } static guint test_dbus_account_plugin_get_restrictions (const McpAccountStorage *storage, const gchar *account_name) { TestDBusAccountPlugin *self = TEST_DBUS_ACCOUNT_PLUGIN (storage); Account *account = lookup_account (self, account_name); DEBUG ("%s", account_name); if (!self->active || account == NULL || (account->flags & UNCOMMITTED_DELETION)) return 0; /* FIXME: actually enforce this restriction */ return TP_STORAGE_RESTRICTION_FLAG_CANNOT_SET_SERVICE; } static gboolean test_dbus_account_plugin_owns (McpAccountStorage *storage, McpAccountManager *am, const gchar *account_name) { TestDBusAccountPlugin *self = TEST_DBUS_ACCOUNT_PLUGIN (storage); Account *account = lookup_account (self, account_name); DEBUG ("%s", account_name); if (!self->active || account == NULL || (account->flags & UNCOMMITTED_DELETION)) return FALSE; return TRUE; } static void account_storage_iface_init (McpAccountStorageIface *iface) { iface->name = "TestDBusAccount"; iface->desc = "Regression test plugin"; /* this should be higher priority than the diverted-keyfile one */ iface->priority = MCP_ACCOUNT_STORAGE_PLUGIN_PRIO_NORMAL + 100; iface->get = test_dbus_account_plugin_get; iface->set = test_dbus_account_plugin_set; iface->set_attribute = test_dbus_account_plugin_set_attribute; iface->set_parameter = test_dbus_account_plugin_set_parameter; iface->list = test_dbus_account_plugin_list; iface->ready = test_dbus_account_plugin_ready; iface->delete = test_dbus_account_plugin_delete; iface->commit = test_dbus_account_plugin_commit; iface->commit_one = test_dbus_account_plugin_commit_one; iface->get_identifier = test_dbus_account_plugin_get_identifier; iface->get_additional_info = test_dbus_account_plugin_get_additional_info; iface->get_restrictions = test_dbus_account_plugin_get_restrictions; iface->create = test_dbus_account_plugin_create; iface->owns = test_dbus_account_plugin_owns; } telepathy-mission-control-5.16.4/tests/account-store-libaccounts.h0000644000175000017500000000247612735242352026440 0ustar00gkiagiagkiagia00000000000000/* * MC account storage backend inspector, libaccounts backend * * Copyright © 2010 Nokia Corporation * Copyright © 2010 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include #ifndef _ACCOUNT_STORE_LIBACCOUNTS_H_ #define _ACCOUNT_STORE_LIBACCOUNTS_H_ G_BEGIN_DECLS gchar * libaccounts_get (const gchar *mc_account, const gchar *key); gboolean libaccounts_set (const gchar *mc_account, const gchar *key, const gchar *value); gboolean libaccounts_delete (const gchar *mc_account); gboolean libaccounts_exists (const gchar *mc_account); GStrv libaccounts_list (void); G_END_DECLS #endif telepathy-mission-control-5.16.4/tests/tease-the-minotaur.c0000644000175000017500000000331312735241312025036 0ustar00gkiagiagkiagia00000000000000/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */ /* * tease-the-minotaur: a simple interactive test app for McdConnectivityMonitor * * Copyright © 2009–2011 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * * Authors: * Will Thompson */ #include "config.h" #include "connectivity-monitor.h" static void state_change_cb ( McdConnectivityMonitor *minotaur, gboolean connected, McdInhibit *inhibit, gpointer user_data) { g_print (connected ? "connected\n" : "disconnected\n"); } int main ( int argc, char *argv[]) { McdConnectivityMonitor *minotaur; GMainLoop *im_feeling_loopy; g_type_init (); minotaur = mcd_connectivity_monitor_new (); g_signal_connect (minotaur, "state-change", (GCallback) state_change_cb, NULL); state_change_cb (minotaur, mcd_connectivity_monitor_is_online (minotaur), NULL, NULL); im_feeling_loopy = g_main_loop_new (NULL, FALSE); g_main_loop_run (im_feeling_loopy); return 0; } telepathy-mission-control-5.16.4/tests/keyfile.c0000644000175000017500000002240612735241312022757 0ustar00gkiagiagkiagia00000000000000/* * Regression test for keyfile (un)escaping * * Copyright © 2012 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA * */ #include "config.h" #include #include #include "mcd-storage.h" typedef enum { FAILS = 1, NOT_NORMALIZED = 2 } Flags; #define SIMPLE_TEST(NAME, GTYPE, CMP, GET) \ static void \ test_ ## NAME (void) \ { \ guint i; \ \ for (i = 0; NAME ## _tests[i].escaped != NULL; i++) \ { \ gboolean success; \ gchar *escaped; \ GValue unescaped = G_VALUE_INIT; \ GError *error = NULL; \ \ g_value_init (&unescaped, GTYPE); \ \ success = mcd_keyfile_unescape_value (NAME ## _tests[i].escaped, \ &unescaped, &error); \ \ if (NAME ## _tests[i].flags & FAILS) \ { \ if (success || error == NULL) \ g_error ("Interpreting '%s' as %s was meant to fail", \ NAME ## _tests[i].escaped, g_type_name (GTYPE)); \ \ g_error_free (error); \ } \ else \ { \ if (error != NULL) \ g_error ("Interpreting '%s' as %s was meant to succeed: %s", \ NAME ## _tests[i].escaped, g_type_name (GTYPE), error->message); \ \ if (!success) \ g_error ("Interpreting '%s' as %s was meant to succeed", \ NAME ## _tests[i].escaped, g_type_name (GTYPE)); \ \ g_assert (success); \ CMP (GET (&unescaped), ==, \ NAME ## _tests[i].unescaped); \ \ escaped = mcd_keyfile_escape_value (&unescaped); \ \ if (NAME ## _tests[i].flags & NOT_NORMALIZED) \ g_assert (escaped != NULL); \ else \ g_assert_cmpstr (escaped, ==, NAME ## _tests[i].escaped); \ \ g_free (escaped); \ } \ \ g_value_unset (&unescaped); \ } \ } struct { const gchar *escaped; gint32 unescaped; Flags flags; } int32_tests[] = { { "-2147483649", 0, FAILS }, { "-2147483648", G_MININT32, 0 }, { "-2147483647", -2147483647, 0 }, { "-1", -1, 0 }, { "x", 0, FAILS }, { "0", 0, 0 }, { "000", 0, NOT_NORMALIZED }, { "1", 1, 0 }, { "001", 1, NOT_NORMALIZED }, { "042", 42, NOT_NORMALIZED }, { "2147483647", 2147483647, 0 }, { "2147483648", 0, FAILS }, { NULL, 0, 0 } }; struct { const gchar *escaped; guint32 unescaped; Flags flags; } uint32_tests[] = { { "-1", 0, FAILS }, { "x", 0, FAILS }, { "0", 0, 0 }, { "000", 0, NOT_NORMALIZED }, { "1", 1, 0 }, { "001", 1, NOT_NORMALIZED }, { "042", 42, NOT_NORMALIZED }, { "2147483647", 2147483647, 0 }, { "2147483648", 2147483648u, 0 }, { "4294967295", 4294967295u, 0 }, { "4294967296", 0, FAILS }, { NULL, 0, 0 } }; struct { const gchar *escaped; gint64 unescaped; Flags flags; } int64_tests[] = { #if 0 /* This actually "succeeds". tp_g_key_file_get_int64() and _uint64(), * and the copy of them that was merged in GLib, don't detect overflow */ { "-9223372036854775809", 0, FAILS }, #endif { "-9223372036854775808", G_MININT64, 0 }, { "-1", -1, 0 }, { "0", 0, 0 }, { "1", 1, 0 }, { "9223372036854775807", G_GINT64_CONSTANT (9223372036854775807), 0 }, #if 0 { "9223372036854775808", 0, FAILS }, #endif { "x", 0, FAILS }, { NULL, 0, 0 } }; struct { const gchar *escaped; guint64 unescaped; Flags flags; } uint64_tests[] = { #if 0 { "-1", 0, FAILS }, #endif { "0", 0, 0 }, { "1", 1, 0 }, { "9223372036854775807", G_GUINT64_CONSTANT (9223372036854775807), 0 }, { "9223372036854775808", G_GUINT64_CONSTANT (9223372036854775808), 0 }, { "18446744073709551615", G_GUINT64_CONSTANT (18446744073709551615), 0 }, #if 0 { "18446744073709551616", 0, FAILS }, #endif { "x", 0, FAILS }, { NULL, 0, 0 } }; struct { const gchar *escaped; guchar unescaped; Flags flags; } byte_tests[] = { { "-1", 0, FAILS }, { "x", 0, FAILS }, { "0", 0, 0 }, { "1", 1, 0 }, { "255", 255, 0 }, { "256", 0, FAILS }, { NULL, 0, 0 } }; struct { const gchar *escaped; gboolean unescaped; Flags flags; } boolean_tests[] = { { "true", TRUE, 0 }, { "false", FALSE, 0 }, { "0", FALSE, NOT_NORMALIZED }, { "1", TRUE, NOT_NORMALIZED }, { "2", 0, FAILS }, { "", 0, FAILS }, { NULL, 0, 0 } }; struct { const gchar *escaped; const gchar *unescaped; Flags flags; } string_tests[] = { { "lol", "lol", 0 }, { "\\s", " ", 0 }, { "\\s ", " ", NOT_NORMALIZED }, { "\\t", "\t", 0 }, { NULL, NULL, 0 } }; struct { const gchar *escaped; const gchar *unescaped; Flags flags; } path_tests[] = { { "/", "/", 0 }, { "/foo", "/foo", 0 }, { "x", NULL, FAILS }, { NULL, NULL, 0 } }; struct { const gchar *escaped; double unescaped; Flags flags; } double_tests[] = { { "0", 0.0, 0 }, { "0.5", 0.5, 0 }, { "x", 0.0, FAILS }, { NULL, 0.0, 0 } }; SIMPLE_TEST (int32, G_TYPE_INT, g_assert_cmpint, g_value_get_int) SIMPLE_TEST (uint32, G_TYPE_UINT, g_assert_cmpuint, g_value_get_uint) SIMPLE_TEST (int64, G_TYPE_INT64, g_assert_cmpint, g_value_get_int64) SIMPLE_TEST (uint64, G_TYPE_UINT64, g_assert_cmpuint, g_value_get_uint64) SIMPLE_TEST (byte, G_TYPE_UCHAR, g_assert_cmpuint, g_value_get_uchar) SIMPLE_TEST (boolean, G_TYPE_BOOLEAN, g_assert_cmpuint, g_value_get_boolean) SIMPLE_TEST (string, G_TYPE_STRING, g_assert_cmpstr, g_value_get_string) SIMPLE_TEST (path, DBUS_TYPE_G_OBJECT_PATH, g_assert_cmpstr, g_value_get_boxed) SIMPLE_TEST (double, G_TYPE_DOUBLE, g_assert_cmpfloat, g_value_get_double) static void test_strv (void) { gboolean success; gchar *escaped; GValue unescaped = G_VALUE_INIT; GError *error = NULL; gchar **unescaped_strv; g_value_init (&unescaped, G_TYPE_STRV); success = mcd_keyfile_unescape_value ("x;\\t;z;", &unescaped, &error); g_assert_no_error (error); g_assert (success); unescaped_strv = g_value_get_boxed (&unescaped); g_assert_cmpstr (unescaped_strv[0], ==, "x"); g_assert_cmpstr (unescaped_strv[1], ==, "\t"); g_assert_cmpstr (unescaped_strv[2], ==, "z"); g_assert_cmpstr (unescaped_strv[3], ==, NULL); escaped = mcd_keyfile_escape_value (&unescaped); g_assert_cmpstr (escaped, ==, "x;\\t;z;"); g_free (escaped); g_value_unset (&unescaped); } static void test_ao (void) { gboolean success; gchar *escaped; GValue unescaped = G_VALUE_INIT; GError *error = NULL; GPtrArray *unescaped_pa; g_value_init (&unescaped, TP_ARRAY_TYPE_OBJECT_PATH_LIST); success = mcd_keyfile_unescape_value ("/x;/;", &unescaped, &error); g_assert_no_error (error); g_assert (success); unescaped_pa = g_value_get_boxed (&unescaped); g_assert_cmpuint (unescaped_pa->len, ==, 2); g_assert_cmpstr (g_ptr_array_index (unescaped_pa, 0), ==, "/x"); g_assert_cmpstr (g_ptr_array_index (unescaped_pa, 1), ==, "/"); escaped = mcd_keyfile_escape_value (&unescaped); g_assert_cmpstr (escaped, ==, "/x;/;"); g_free (escaped); g_value_unset (&unescaped); } static void test_uss (void) { gboolean success; gchar *escaped; GValue unescaped = G_VALUE_INIT; GError *error = NULL; GValueArray *unescaped_va; g_value_init (&unescaped, TP_STRUCT_TYPE_SIMPLE_PRESENCE); success = mcd_keyfile_unescape_value ("2;available;\\;;", &unescaped, &error); g_assert_no_error (error); g_assert (success); unescaped_va = g_value_get_boxed (&unescaped); g_assert_cmpuint (g_value_get_uint (unescaped_va->values + 0), ==, 2); g_assert_cmpstr (g_value_get_string (unescaped_va->values + 1), ==, "available"); g_assert_cmpstr (g_value_get_string (unescaped_va->values + 2), ==, ";"); escaped = mcd_keyfile_escape_value (&unescaped); g_assert_cmpstr (escaped, ==, "2;available;\\;;"); g_free (escaped); g_value_unset (&unescaped); } int main (int argc, char **argv) { g_test_init (&argc, &argv, NULL); g_test_bug_base ("http://bugs.freedesktop.org/show_bug.cgi?id="); g_type_init (); g_test_add_func ("/keyfile/int32", test_int32); g_test_add_func ("/keyfile/uint32", test_uint32); g_test_add_func ("/keyfile/int64", test_int64); g_test_add_func ("/keyfile/uint64", test_uint64); g_test_add_func ("/keyfile/string", test_string); g_test_add_func ("/keyfile/byte", test_byte); g_test_add_func ("/keyfile/boolean", test_boolean); g_test_add_func ("/keyfile/double", test_double); g_test_add_func ("/keyfile/path", test_path); g_test_add_func ("/keyfile/strv", test_strv); g_test_add_func ("/keyfile/ao", test_ao); g_test_add_func ("/keyfile/uss", test_uss); return g_test_run (); } telepathy-mission-control-5.16.4/tests/README0000644000175000017500000000313312735241312022037 0ustar00gkiagiagkiagia00000000000000To run Twisted tests: make -C tests/twisted check-twisted To run an individual Twisted test: make -C tests/twisted check-twisted \ TWISTED_TESTS=dispatcher/create-at-startup.py Debug information (the test's own log, and Mission Control's log) is recorded in a subdirectory of tests-twisted whose name is based on the test's name, like tests/twisted/tmp-dispatcher_create-at-startup_py. The same tmp-* directory also contains the account data used in the test. If the test fails, its output will be sent to stdout. These directories are normally deleted after a test passes or is skipped, and kept for analysis if it fails. Set the environment variable MC_TEST_KEEP_TEMP to avoid deleting them. To debug an individual test you can set one of the following env variable: * MISSIONCONTROL_TEST_VALGRIND : to run Mission Control inside valgrind. The report is added to missioncontrol.log. You'll probably also want MC_TEST_KEEP_TEMP to keep the logs in tests/twisted/tmp-*, even when tests passed. * MISSIONCONTROL_TEST_REFDBG : to run Mission Control inside refdbg. The report is written to refdbg.log. You can change MISSIONCONTROL_WRAPPER to use an alternative refdbg and change REFDBG_OPTIONS to set your own parameters. Example: export MISSIONCONTROL_TEST_REFDBG=1 export MISSIONCONTROL_WRAPPER="/path/to/refdbg" export REFDBG_OPTIONS="btnum=16" * MISSIONCONTROL_WRAPPER="nemiver" : to run Mission Control inside the graphical debugger nemiver. You'll be able to set up breakpoints; then hit the "continue" button to launch Mission Control. telepathy-mission-control-5.16.4/tests/account-store-default.h0000644000175000017500000000241012735242352025542 0ustar00gkiagiagkiagia00000000000000/* * MC account storage backend inspector, default backend * * Copyright © 2010 Nokia Corporation * Copyright © 2010 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef _ACCOUNT_STORE_DEFAULT_H_ #define _ACCOUNT_STORE_DEFAULT_H_ #include #include gchar * default_get (const gchar *account, const gchar *key); gboolean default_set (const gchar *account, const gchar *key, const gchar *value); gboolean default_delete (const gchar *account); gboolean default_exists (const gchar *account); GStrv default_list (void); #endif telepathy-mission-control-5.16.4/tests/Makefile.am0000644000175000017500000000231412735242352023220 0ustar00gkiagiagkiagia00000000000000INCLUDES = \ $(DBUS_CFLAGS) \ $(TELEPATHY_CFLAGS) \ -I$(top_srcdir) \ -I$(top_builddir) \ -I$(top_srcdir)/src \ -I$(top_builddir)/src \ -DMC_DISABLE_DEPRECATED \ -DLIBDIR="@libdir@" -DLIBVERSION="0" AM_CFLAGS = $(ERROR_CFLAGS) SUBDIRS = . twisted TEST_EXECUTABLES = \ test-keyfile \ test-value-is-same \ $(NULL) NON_TEST_EXECUTABLES = account-store tease-the-minotaur noinst_PROGRAMS = $(TEST_EXECUTABLES) $(NON_TEST_EXECUTABLES) TESTS = $(TEST_EXECUTABLES) # This test needs linking against the convenience library, so it can use # MC internals. test_value_is_same_SOURCES = value-is-same.c test_value_is_same_LDADD = $(top_builddir)/src/libmcd-convenience.la test_keyfile_SOURCES = keyfile.c test_keyfile_LDADD = $(top_builddir)/src/libmcd-convenience.la tease_the_minotaur_SOURCES = tease-the-minotaur.c tease_the_minotaur_LDADD = $(top_builddir)/src/libmcd-convenience.la account_store_LDADD = $(GLIB_LIBS) account_store_SOURCES = \ account-store.c \ account-store-default.c \ account-store-default.h if ENABLE_LIBACCOUNTS_SSO account_store_SOURCES += account-store-libaccounts.c account-store-libaccounts.h account_store_LDADD += $(LIBACCOUNTS_SSO_LIBS) INCLUDES += $(LIBACCOUNTS_SSO_CFLAGS) endif telepathy-mission-control-5.16.4/tests/account-store-default.c0000644000175000017500000000544412735242352025547 0ustar00gkiagiagkiagia00000000000000/* * MC account storage backend inspector, default backend * * Copyright © 2010 Nokia Corporation * Copyright © 2010 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "config.h" #include #include #include "account-store-default.h" static const gchar *default_config (void) { return g_build_filename (g_get_user_data_dir (), "telepathy", "mission-control", "accounts.cfg", NULL); } static GKeyFile * default_keyfile (void) { GError *error = NULL; static GKeyFile *keyfile = NULL; const gchar *path = NULL; if (keyfile != NULL) return keyfile; path = default_config (); keyfile = g_key_file_new (); if (!g_key_file_load_from_file (keyfile, path, 0, &error)) { if (error != NULL) g_warning ("keyfile '%s' error: %s", path, error->message); else g_warning ("keyfile '%s' error: unknown error", path); g_key_file_free (keyfile); g_error_free (error); keyfile = NULL; } return keyfile; } static gboolean commit_changes (void) { gsize n = 0; gchar *data = NULL; gboolean done = FALSE; GKeyFile *keyfile = default_keyfile (); const gchar *config = default_config (); data = g_key_file_to_data (keyfile, &n, NULL); done = g_file_set_contents (config, data, n, NULL); g_free (data); return done; } gchar * default_get (const gchar *account, const gchar *key) { return g_key_file_get_string (default_keyfile (), account, key, NULL); } gboolean default_set (const gchar *account, const gchar *key, const gchar *value) { GKeyFile *keyfile = NULL; keyfile = default_keyfile (); if (keyfile == NULL) return FALSE; g_key_file_set_string (keyfile, account, key, value); return commit_changes (); } gboolean default_delete (const gchar *account) { GKeyFile *keyfile = default_keyfile (); g_key_file_remove_group (keyfile, account, NULL); return commit_changes (); } gboolean default_exists (const gchar *account) { return g_key_file_has_group (default_keyfile (), account); } GStrv default_list (void) { return g_key_file_get_groups (default_keyfile (), NULL); } telepathy-mission-control-5.16.4/tests/account-store-libaccounts.c0000644000175000017500000004037412735242352026432 0ustar00gkiagiagkiagia00000000000000/* * MC account storage backend inspector, libaccounts backend * * Copyright © 2010 Nokia Corporation * Copyright © 2010 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "account-store-libaccounts.h" #include #include #include #include #undef G_LOG_DOMAIN #define G_LOG_DOMAIN "account-store-libaccounts" /* MC <-> AG global/local setting meta data */ #define MCPP "param-" #define AGPP "parameters/" #define LIBACCT_ID_KEY "libacct-uid" #define MC_ENABLED_KEY "Enabled" #define AG_ENABLED_KEY "enabled" #define AG_LABEL_KEY "name" #define MC_LABEL_KEY "DisplayName" #define AG_ACCOUNT_KEY "username" #define MC_ACCOUNT_KEY "account" #define PASSWORD_KEY "password" #define AG_ACCOUNT_ALT_KEY AGPP "account" #define MC_CMANAGER_KEY "manager" #define MC_PROTOCOL_KEY "protocol" #define MC_IDENTITY_KEY "tmc-uid" #define SERVICES_KEY "sso-services" #define MC_SERVICE_KEY "Service" typedef struct { gchar *mc_name; gchar *ag_name; gboolean global; /* global ag setting or service specific? */ gboolean readable; /* does the _standard_ read method copy this into MC? */ gboolean writable; /* does the _standard_ write method copy this into AG? */ gboolean freeable; /* should clear_setting_data deallocate the names? */ } Setting; #define GLOBAL TRUE #define SERVICE FALSE #define READABLE TRUE #define UNREADABLE FALSE #define WRITABLE TRUE #define UNWRITABLE FALSE typedef enum { SETTING_MC, SETTING_AG, } SettingType; Setting setting_map[] = { { MC_ENABLED_KEY , AG_ENABLED_KEY , GLOBAL , UNREADABLE, UNWRITABLE }, { MCPP MC_ACCOUNT_KEY, AG_ACCOUNT_KEY , GLOBAL , READABLE , UNWRITABLE }, { MCPP PASSWORD_KEY , PASSWORD_KEY , GLOBAL , READABLE , WRITABLE }, { MC_LABEL_KEY , AG_LABEL_KEY , GLOBAL , READABLE , WRITABLE }, { LIBACCT_ID_KEY , LIBACCT_ID_KEY , GLOBAL , UNREADABLE, UNWRITABLE }, { MC_IDENTITY_KEY , MC_IDENTITY_KEY, SERVICE, READABLE , WRITABLE }, { MC_CMANAGER_KEY , MC_CMANAGER_KEY, SERVICE, READABLE , UNWRITABLE }, { MC_PROTOCOL_KEY , MC_PROTOCOL_KEY, SERVICE, READABLE , UNWRITABLE }, { MC_SERVICE_KEY , MC_SERVICE_KEY , SERVICE, UNREADABLE, UNWRITABLE }, { SERVICES_KEY , SERVICES_KEY , GLOBAL , UNREADABLE, UNWRITABLE }, { NULL , NULL , SERVICE, UNREADABLE, UNWRITABLE } }; static void clear_setting_data (Setting *setting) { if (setting == NULL) return; if (!setting->freeable) return; g_free (setting->mc_name); g_free (setting->ag_name); setting->mc_name = NULL; setting->ag_name = NULL; } static Setting * setting_data (const gchar *name, SettingType type) { guint i = 0; static Setting parameter = { NULL, NULL, SERVICE, READABLE, WRITABLE, TRUE }; const gchar *prefix; for (; setting_map[i].mc_name != NULL; i++) { const gchar *setting_name = NULL; if (type == SETTING_MC) setting_name = setting_map[i].mc_name; else setting_name = setting_map[i].ag_name; if (g_strcmp0 (name, setting_name) == 0) return &setting_map[i]; } prefix = (type == SETTING_MC) ? MCPP : AGPP; if (!g_str_has_prefix (name, prefix)) { /* a non-parameter setting */ parameter.mc_name = g_strdup (name); parameter.ag_name = g_strdup (name); } else { /* a setting that is a parameter on both sides (AG & MC) */ const guint plength = strlen (prefix); parameter.mc_name = g_strdup_printf ("%s%s", MCPP, name + plength); parameter.ag_name = g_strdup_printf ("%s%s", AGPP, name + plength); } return ¶meter; } /* logging helpers: */ static void _g_log_handler (const gchar *log_domain, GLogLevelFlags log_level, const gchar *message, gpointer unused_data) { /* the libaccounts code is currently very chatty when debugging: * * we are only interested in or own debugging output for now. */ if ((gchar *)log_domain != (gchar *)G_LOG_DOMAIN) return; g_log_default_handler (log_domain, log_level, message, unused_data); } static void toggle_mute (void) { static GLogFunc old = NULL; if (old == NULL) { old = g_log_set_default_handler (_g_log_handler, NULL); } else { g_log_set_default_handler (old, NULL); old = NULL; } } static gchar * _gvalue_to_string (const GValue *val) { switch (G_VALUE_TYPE (val)) { case G_TYPE_STRING: return g_value_dup_string (val); case G_TYPE_BOOLEAN: return g_strdup (g_value_get_boolean (val) ? "true" : "false"); case G_TYPE_CHAR: return g_strdup_printf ("%c", g_value_get_uchar (val)); case G_TYPE_UCHAR: return g_strdup_printf ("%c", g_value_get_char (val)); case G_TYPE_INT: return g_strdup_printf ("%i", g_value_get_int (val)); case G_TYPE_UINT: return g_strdup_printf ("%u", g_value_get_uint (val)); case G_TYPE_LONG: return g_strdup_printf ("%ld", g_value_get_long (val)); case G_TYPE_ULONG: return g_strdup_printf ("%lu", g_value_get_ulong (val)); case G_TYPE_INT64: return g_strdup_printf ("%" G_GINT64_FORMAT, g_value_get_int64 (val)); case G_TYPE_UINT64: return g_strdup_printf ("%" G_GUINT64_FORMAT, g_value_get_uint64 (val)); case G_TYPE_ENUM: return g_strdup_printf ("%d" , g_value_get_enum (val)); case G_TYPE_FLAGS: return g_strdup_printf ("%u", g_value_get_flags (val)); case G_TYPE_FLOAT: return g_strdup_printf ("%f", g_value_get_float (val)); case G_TYPE_DOUBLE: return g_strdup_printf ("%g", g_value_get_double (val)); default: g_warning ("Unsupported type %s", G_VALUE_TYPE_NAME (val)); return NULL; } } static AgManager * get_ag_manager (void) { static AgManager *agm = NULL; toggle_mute (); if (agm != NULL) return agm; agm = ag_manager_new (); toggle_mute (); return agm; } static AgAccount * get_ag_account (const gchar *mc_account) { AgAccount *ag_account = NULL; AgManager *ag_manager = get_ag_manager (); GList *ag_ids = NULL; GList *ag_id; toggle_mute (); ag_ids = ag_manager_list_by_service_type (ag_manager, "IM"); g_debug ("%d accounts in SSO", g_list_length (ag_ids)); for (ag_id = ag_ids; ag_id != NULL; ag_id = g_list_next (ag_id)) { AgAccountId id = GPOINTER_TO_UINT (ag_id->data); AgAccount *account = ag_manager_get_account (ag_manager, id); if (account != NULL) { GValue value = G_VALUE_INIT; AgSettingSource source = AG_SETTING_SOURCE_NONE; g_value_init (&value, G_TYPE_STRING); ag_account_select_service (account, NULL); source = ag_account_get_value (account, MC_IDENTITY_KEY, &value); if (source != AG_SETTING_SOURCE_NONE) { if (g_str_equal (g_value_get_string (&value), mc_account)) { ag_account = g_object_ref (account); ag_id = NULL; } g_value_unset (&value); } g_object_unref (account); } } ag_manager_list_free (ag_ids); toggle_mute (); return ag_account; } static gboolean _ag_account_select_default_im_service (AgAccount *account) { gboolean have_im_service = FALSE; GList *first = ag_account_list_services_by_type (account, "IM"); if (first != NULL && first->data != NULL) { have_im_service = TRUE; ag_account_select_service (account, first->data); } ag_service_list_free (first); return have_im_service; } /* enabled is actually a tri-state<->boolean mapping */ static gboolean _sso_account_enabled (AgAccount *account, AgService *service) { gboolean local = FALSE; gboolean global = FALSE; AgService *original = ag_account_get_selected_service (account); if (service == NULL) { _ag_account_select_default_im_service (account); local = ag_account_get_enabled (account); } else { if (original != service) ag_account_select_service (account, service); local = ag_account_get_enabled (account); } ag_account_select_service (account, NULL); global = ag_account_get_enabled (account); ag_account_select_service (account, original); g_debug ("_sso_account_enabled: global:%d && local:%d", global, local); return local && global; } static void _sso_account_enable (AgAccount *account, AgService *service, gboolean on) { AgService *original = ag_account_get_selected_service (account); /* turn the local enabled flag on/off as required */ if (service != NULL) ag_account_select_service (account, service); else _ag_account_select_default_im_service (account); ag_account_set_enabled (account, on); /* if we are turning the account on, the global flag must also be set * * NOTE: this isn't needed when turning the account off */ if (on) { ag_account_select_service (account, NULL); ag_account_set_enabled (account, on); } ag_account_select_service (account, original); } /* saving settings other than the enabled tri-state */ static void save_setting (AgAccount *account, const Setting *setting, const gchar *val) { AgService *service = ag_account_get_selected_service (account); if (!setting->writable) return; if (setting->global) ag_account_select_service (account, NULL); else if (service == NULL) _ag_account_select_default_im_service (account); if (val != NULL) { GValue value = G_VALUE_INIT; g_value_init (&value, G_TYPE_STRING); g_value_set_string (&value, val); ag_account_set_value (account, setting->ag_name, &value); g_value_unset (&value); } else { ag_account_set_value (account, setting->ag_name, NULL); } /* leave the selected service as we found it: */ ag_account_select_service (account, service); } gchar * libaccounts_get (const gchar *mc_account, const gchar *key) { gchar *rval = NULL; AgAccount *ag_account = get_ag_account (mc_account); Setting *setting = setting_data (key, SETTING_MC); toggle_mute (); if (ag_account != NULL) { if (setting == NULL) { g_debug ("setting %s is unknown/unmapped, aborting update", key); rval = g_strdup (""); goto done; } g_debug ("MC key %s -> AG key %s", key, setting->ag_name); if (g_str_equal (setting->ag_name, AG_ENABLED_KEY)) { gboolean on = _sso_account_enabled (ag_account, NULL); rval = g_strdup (on ? "true" : "false"); goto done; } else { GValue value = G_VALUE_INIT; AgSettingSource source = AG_SETTING_SOURCE_NONE; g_value_init (&value, G_TYPE_STRING); /* the 'account' parameter is a special case for historical reasons */ if (g_str_equal (key, MCPP MC_ACCOUNT_KEY)) { _ag_account_select_default_im_service (ag_account); source = ag_account_get_value (ag_account, AG_ACCOUNT_ALT_KEY, &value); if (source != AG_SETTING_SOURCE_NONE) goto found; } if (setting->global) ag_account_select_service (ag_account, NULL); else _ag_account_select_default_im_service (ag_account); source = ag_account_get_value (ag_account, setting->ag_name, &value); found: if (source != AG_SETTING_SOURCE_NONE) { rval = _gvalue_to_string (&value); g_value_unset (&value); } } } done: toggle_mute (); if (ag_account) g_object_unref (ag_account); clear_setting_data (setting); return rval; } gboolean libaccounts_set (const gchar *mc_account, const gchar *key, const gchar *value) { gboolean done = FALSE; AgAccount *ag_account = get_ag_account (mc_account); Setting *setting = setting_data (key, SETTING_MC); toggle_mute (); if (ag_account != NULL) { if (setting == NULL) { g_debug ("setting %s is unknown/unmapped, aborting update", key); goto done; } if (g_str_equal (setting->ag_name, MC_ENABLED_KEY)) { gboolean on = g_str_equal (value, "true"); _sso_account_enable (ag_account, NULL, on); done = TRUE; goto done; } else { save_setting (ag_account, setting, value); done = TRUE; } if (done) ag_account_store (ag_account, NULL, NULL); } done: toggle_mute (); if (ag_account) g_object_unref (ag_account); clear_setting_data (setting); return done; } gboolean libaccounts_delete (const gchar *mc_account) { gboolean done = FALSE; AgAccount *ag_account = get_ag_account (mc_account); toggle_mute (); if(ag_account != NULL) { ag_account_delete (ag_account); ag_account_store (ag_account, NULL, NULL); g_object_unref (ag_account); done = TRUE; } toggle_mute (); return done; } gboolean libaccounts_exists (const gchar *mc_account) { gboolean exists = FALSE; AgAccount *ag_account = get_ag_account (mc_account); toggle_mute (); if (ag_account != NULL) { exists = TRUE; g_object_unref (ag_account); } toggle_mute (); return exists; } GStrv libaccounts_list (void) { AgManager *ag_manager = get_ag_manager (); GList *ag_ids = ag_manager_list_by_service_type (ag_manager, "IM"); guint len = g_list_length (ag_ids); GStrv rval = NULL; GList *id; guint i = 0; Setting *setting = setting_data (MC_IDENTITY_KEY, SETTING_AG); if (len == 0) goto done; rval = g_new (gchar *, len + 1); rval[len] = NULL; for (id = ag_ids; id && i < len; id = g_list_next (id)) { GValue value = G_VALUE_INIT; AgAccountId uid = GPOINTER_TO_UINT (id->data); AgAccount *ag_account = ag_manager_get_account (ag_manager, uid); AgSettingSource source = AG_SETTING_SOURCE_NONE; if (ag_account) { if (setting->global) ag_account_select_service (ag_account, NULL); else _ag_account_select_default_im_service (ag_account); source = ag_account_get_value (ag_account, setting->ag_name, &value); } if (source != AG_SETTING_SOURCE_NONE) { rval[i++] = _gvalue_to_string (&value); g_value_unset (&value); } else { GValue cmanager = G_VALUE_INIT; GValue protocol = G_VALUE_INIT; GValue account = G_VALUE_INIT; const gchar *acct = NULL; const gchar *cman = NULL; const gchar *proto = NULL; g_value_init (&cmanager, G_TYPE_STRING); g_value_init (&protocol, G_TYPE_STRING); g_value_init (&account, G_TYPE_STRING); _ag_account_select_default_im_service (ag_account); ag_account_get_value (ag_account, MC_CMANAGER_KEY, &cmanager); cman = g_value_get_string (&cmanager); ag_account_get_value (ag_account, MC_PROTOCOL_KEY, &protocol); proto = g_value_get_string (&protocol); ag_account_select_service (ag_account, NULL); ag_account_get_value (ag_account, AG_ACCOUNT_KEY, &account); acct = g_value_get_string (&account); rval[i++] = g_strdup_printf ("unnamed account #%u (%s/%s/%s)", uid, cman, proto, acct); g_value_unset (&cmanager); g_value_unset (&protocol); g_value_unset (&account); } } done: g_list_free (ag_ids); clear_setting_data (setting); return rval; } telepathy-mission-control-5.16.4/tests/value-is-same.c0000644000175000017500000001574112735242352024010 0ustar00gkiagiagkiagia00000000000000/* vi: set et sw=4 ts=8 cino=t0,(0: */ /* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4; tab-width: 8 -*- */ /* * Regression test for value_is_same() * * Copyright (C) 2009 Nokia Corporation * Copyright (C) 2009 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA * */ /* Yes, this is a hack */ #include "mcd-account.c" static inline void assert_and_unset (GValue *value, GValue *same, GValue *different) { g_assert (value_is_same (value, same)); g_assert (value_is_same (same, value)); g_assert (value_is_same (value, value)); g_assert (!value_is_same (value, different)); g_assert (!value_is_same (different, value)); g_value_unset (value); g_value_unset (same); g_value_unset (different); } static inline void assert_and_reset (GValue *value, GValue *same, GValue *different) { g_assert (value_is_same (value, same)); g_assert (value_is_same (same, value)); g_assert (value_is_same (value, value)); g_assert (!value_is_same (value, different)); g_assert (!value_is_same (different, value)); g_value_reset (value); g_value_reset (same); g_value_reset (different); } static void test_numeric (void) { GValue value = G_VALUE_INIT; GValue same = G_VALUE_INIT; GValue different = G_VALUE_INIT; g_value_set_int (g_value_init (&value, G_TYPE_INT), -42); g_value_set_int (g_value_init (&same, G_TYPE_INT), -42); g_value_set_int (g_value_init (&different, G_TYPE_INT), -23); assert_and_unset (&value, &same, &different); g_value_set_uint (g_value_init (&value, G_TYPE_UINT), 42); g_value_set_uint (g_value_init (&same, G_TYPE_UINT), 42); g_value_set_uint (g_value_init (&different, G_TYPE_UINT), 23); assert_and_unset (&value, &same, &different); g_value_set_int64 (g_value_init (&value, G_TYPE_INT64), -42); g_value_set_int64 (g_value_init (&same, G_TYPE_INT64), -42); g_value_set_int64 (g_value_init (&different, G_TYPE_INT64), -23); assert_and_unset (&value, &same, &different); g_value_set_uint64 (g_value_init (&value, G_TYPE_UINT64), -42); g_value_set_uint64 (g_value_init (&same, G_TYPE_UINT64), -42); g_value_set_uint64 (g_value_init (&different, G_TYPE_UINT64), -23); assert_and_unset (&value, &same, &different); g_value_set_uchar (g_value_init (&value, G_TYPE_UCHAR), 42); g_value_set_uchar (g_value_init (&same, G_TYPE_UCHAR), 42); g_value_set_uchar (g_value_init (&different, G_TYPE_UCHAR), 23); assert_and_unset (&value, &same, &different); g_value_set_double (g_value_init (&value, G_TYPE_DOUBLE), 4.5); g_value_set_double (g_value_init (&same, G_TYPE_DOUBLE), 4.5); g_value_set_double (g_value_init (&different, G_TYPE_DOUBLE), -1.25); assert_and_unset (&value, &same, &different); g_value_set_boolean (g_value_init (&value, G_TYPE_BOOLEAN), TRUE); g_value_set_boolean (g_value_init (&same, G_TYPE_BOOLEAN), TRUE); g_value_set_boolean (g_value_init (&different, G_TYPE_BOOLEAN), FALSE); assert_and_unset (&value, &same, &different); g_value_set_boolean (g_value_init (&value, G_TYPE_BOOLEAN), FALSE); g_value_set_boolean (g_value_init (&same, G_TYPE_BOOLEAN), FALSE); g_value_set_boolean (g_value_init (&different, G_TYPE_BOOLEAN), TRUE); assert_and_unset (&value, &same, &different); } static void test_string (void) { GValue value = G_VALUE_INIT; GValue same = G_VALUE_INIT; GValue different = G_VALUE_INIT; g_value_init (&value, G_TYPE_STRING); g_value_init (&same, G_TYPE_STRING); g_value_init (&different, G_TYPE_STRING); g_value_set_static_string (&value, NULL); g_value_set_static_string (&same, NULL); g_value_set_static_string (&different, ""); assert_and_reset (&value, &same, &different); g_value_set_static_string (&value, ""); g_value_set_static_string (&same, ""); g_value_set_static_string (&different, NULL); assert_and_reset (&value, &same, &different); g_value_set_static_string (&value, "foo"); g_value_take_string (&same, g_strdup ("foo")); g_value_set_static_string (&different, "bar"); assert_and_reset (&value, &same, &different); g_value_unset (&value); g_value_unset (&same); g_value_unset (&different); } static void test_object_path (void) { GValue value = G_VALUE_INIT; GValue same = G_VALUE_INIT; GValue different = G_VALUE_INIT; g_value_init (&value, DBUS_TYPE_G_OBJECT_PATH); g_value_init (&same, DBUS_TYPE_G_OBJECT_PATH); g_value_init (&different, DBUS_TYPE_G_OBJECT_PATH); g_value_set_static_boxed (&value, "/foo"); g_value_take_boxed (&same, g_strdup ("/foo")); g_value_set_static_boxed (&different, "/bar"); assert_and_reset (&value, &same, &different); g_value_unset (&value); g_value_unset (&same); g_value_unset (&different); } static void test_strv (void) { const gchar * const empty[] = { NULL }; const gchar * const small[] = { "foo", "bar", NULL }; const gchar * const large[] = { "foo", "bar", "baz", NULL }; GValue value = G_VALUE_INIT; GValue same = G_VALUE_INIT; GValue different = G_VALUE_INIT; g_value_init (&value, G_TYPE_STRV); g_value_init (&same, G_TYPE_STRV); g_value_init (&different, G_TYPE_STRV); g_value_set_static_boxed (&value, (GStrv) small); g_value_take_boxed (&same, g_strdupv ((GStrv) small)); g_value_set_static_boxed (&different, (GStrv) large); assert_and_reset (&value, &same, &different); g_value_set_static_boxed (&value, (GStrv) large); g_value_take_boxed (&same, g_strdupv ((GStrv) large)); g_value_set_static_boxed (&different, (GStrv) small); assert_and_reset (&value, &same, &different); g_value_set_static_boxed (&value, NULL); g_value_set_static_boxed (&same, (GStrv) empty); g_value_set_static_boxed (&different, (GStrv) small); assert_and_reset (&value, &same, &different); g_value_set_static_boxed (&value, (GStrv) empty); g_value_set_static_boxed (&same, NULL); g_value_set_static_boxed (&different, (GStrv) large); assert_and_reset (&value, &same, &different); g_value_unset (&value); g_value_unset (&same); g_value_unset (&different); } int main (int argc, char **argv) { g_test_init (&argc, &argv, NULL); g_test_bug_base ("http://bugs.freedesktop.org/show_bug.cgi?id="); g_type_init (); g_test_add_func ("/value-is-same/numeric", test_numeric); g_test_add_func ("/value-is-same/string", test_string); g_test_add_func ("/value-is-same/object-path", test_object_path); g_test_add_func ("/value-is-same/strv", test_strv); return g_test_run (); } telepathy-mission-control-5.16.4/tests/Makefile.in0000644000175000017500000007176012762351617023251 0ustar00gkiagiagkiagia00000000000000# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__make_dryrun = \ { \ am__dry=no; \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ *) \ for am__flg in $$MAKEFLAGS; do \ case $$am__flg in \ *=*|--*) ;; \ *n*) am__dry=yes; break;; \ esac; \ done;; \ esac; \ test $$am__dry = yes; \ } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ noinst_PROGRAMS = $(am__EXEEXT_1) $(am__EXEEXT_2) TESTS = $(am__EXEEXT_1) @ENABLE_LIBACCOUNTS_SSO_TRUE@am__append_1 = account-store-libaccounts.c account-store-libaccounts.h @ENABLE_LIBACCOUNTS_SSO_TRUE@am__append_2 = $(LIBACCOUNTS_SSO_LIBS) @ENABLE_LIBACCOUNTS_SSO_TRUE@am__append_3 = $(LIBACCOUNTS_SSO_CFLAGS) subdir = tests DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/gtk-doc.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/tp-compiler-flag.m4 \ $(top_srcdir)/m4/tp-compiler-warnings.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__EXEEXT_1 = test-keyfile$(EXEEXT) test-value-is-same$(EXEEXT) am__EXEEXT_2 = account-store$(EXEEXT) tease-the-minotaur$(EXEEXT) PROGRAMS = $(noinst_PROGRAMS) am__account_store_SOURCES_DIST = account-store.c \ account-store-default.c account-store-default.h \ account-store-libaccounts.c account-store-libaccounts.h @ENABLE_LIBACCOUNTS_SSO_TRUE@am__objects_1 = account-store-libaccounts.$(OBJEXT) am_account_store_OBJECTS = account-store.$(OBJEXT) \ account-store-default.$(OBJEXT) $(am__objects_1) account_store_OBJECTS = $(am_account_store_OBJECTS) am__DEPENDENCIES_1 = @ENABLE_LIBACCOUNTS_SSO_TRUE@am__DEPENDENCIES_2 = \ @ENABLE_LIBACCOUNTS_SSO_TRUE@ $(am__DEPENDENCIES_1) account_store_DEPENDENCIES = $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_2) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am_tease_the_minotaur_OBJECTS = tease-the-minotaur.$(OBJEXT) tease_the_minotaur_OBJECTS = $(am_tease_the_minotaur_OBJECTS) tease_the_minotaur_DEPENDENCIES = \ $(top_builddir)/src/libmcd-convenience.la am_test_keyfile_OBJECTS = keyfile.$(OBJEXT) test_keyfile_OBJECTS = $(am_test_keyfile_OBJECTS) test_keyfile_DEPENDENCIES = $(top_builddir)/src/libmcd-convenience.la am_test_value_is_same_OBJECTS = value-is-same.$(OBJEXT) test_value_is_same_OBJECTS = $(am_test_value_is_same_OBJECTS) test_value_is_same_DEPENDENCIES = \ $(top_builddir)/src/libmcd-convenience.la DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; SOURCES = $(account_store_SOURCES) $(tease_the_minotaur_SOURCES) \ $(test_keyfile_SOURCES) $(test_value_is_same_SOURCES) DIST_SOURCES = $(am__account_store_SOURCES_DIST) \ $(tease_the_minotaur_SOURCES) $(test_keyfile_SOURCES) \ $(test_value_is_same_SOURCES) RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir ETAGS = etags CTAGS = ctags am__tty_colors = \ red=; grn=; lgn=; blu=; std= DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACCOUNTS_CACHE_DIR = @ACCOUNTS_CACHE_DIR@ ACCOUNTS_DIR = @ACCOUNTS_DIR@ ACLOCAL = @ACLOCAL@ AEGIS_LIBS = @AEGIS_LIBS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DBUS_CFLAGS = @DBUS_CFLAGS@ DBUS_LIBS = @DBUS_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ERROR_CFLAGS = @ERROR_CFLAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GIO_UNIX_CFLAGS = @GIO_UNIX_CFLAGS@ GIO_UNIX_LIBS = @GIO_UNIX_LIBS@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_COMPILE_SCHEMAS = @GLIB_COMPILE_SCHEMAS@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ GLIB_MKENUMS = @GLIB_MKENUMS@ GREP = @GREP@ GSETTINGS_DISABLE_SCHEMAS_COMPILE = @GSETTINGS_DISABLE_SCHEMAS_COMPILE@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ HTML_DIR = @HTML_DIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBACCOUNTS_SSO_CFLAGS = @LIBACCOUNTS_SSO_CFLAGS@ LIBACCOUNTS_SSO_LIBS = @LIBACCOUNTS_SSO_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MCE_CFLAGS = @MCE_CFLAGS@ MCE_LIBS = @MCE_LIBS@ MCP_ABI_VERSION = @MCP_ABI_VERSION@ MCP_API_VERSION = @MCP_API_VERSION@ MCP_LT_AGE = @MCP_LT_AGE@ MCP_LT_CURRENT = @MCP_LT_CURRENT@ MCP_LT_REVISION = @MCP_LT_REVISION@ MKDIR_P = @MKDIR_P@ NETWORK_MANAGER_CFLAGS = @NETWORK_MANAGER_CFLAGS@ NETWORK_MANAGER_LIBS = @NETWORK_MANAGER_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PYTHON = @PYTHON@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TELEPATHY_CFLAGS = @TELEPATHY_CFLAGS@ TELEPATHY_LIBS = @TELEPATHY_LIBS@ UPOWER_GLIB_CFLAGS = @UPOWER_GLIB_CFLAGS@ UPOWER_GLIB_LIBS = @UPOWER_GLIB_LIBS@ VERSION = @VERSION@ XSLTPROC = @XSLTPROC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gsettingsschemadir = @gsettingsschemadir@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mctestsdir = @mctestsdir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ pluginlibdir = @pluginlibdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ INCLUDES = $(DBUS_CFLAGS) $(TELEPATHY_CFLAGS) -I$(top_srcdir) \ -I$(top_builddir) -I$(top_srcdir)/src -I$(top_builddir)/src \ -DMC_DISABLE_DEPRECATED -DLIBDIR="@libdir@" -DLIBVERSION="0" \ $(am__append_3) AM_CFLAGS = $(ERROR_CFLAGS) SUBDIRS = . twisted TEST_EXECUTABLES = \ test-keyfile \ test-value-is-same \ $(NULL) NON_TEST_EXECUTABLES = account-store tease-the-minotaur # This test needs linking against the convenience library, so it can use # MC internals. test_value_is_same_SOURCES = value-is-same.c test_value_is_same_LDADD = $(top_builddir)/src/libmcd-convenience.la test_keyfile_SOURCES = keyfile.c test_keyfile_LDADD = $(top_builddir)/src/libmcd-convenience.la tease_the_minotaur_SOURCES = tease-the-minotaur.c tease_the_minotaur_LDADD = $(top_builddir)/src/libmcd-convenience.la account_store_LDADD = $(GLIB_LIBS) $(am__append_2) account_store_SOURCES = account-store.c account-store-default.c \ account-store-default.h $(am__append_1) all: all-recursive .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tests/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu tests/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstPROGRAMS: @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list account-store$(EXEEXT): $(account_store_OBJECTS) $(account_store_DEPENDENCIES) $(EXTRA_account_store_DEPENDENCIES) @rm -f account-store$(EXEEXT) $(AM_V_CCLD)$(LINK) $(account_store_OBJECTS) $(account_store_LDADD) $(LIBS) tease-the-minotaur$(EXEEXT): $(tease_the_minotaur_OBJECTS) $(tease_the_minotaur_DEPENDENCIES) $(EXTRA_tease_the_minotaur_DEPENDENCIES) @rm -f tease-the-minotaur$(EXEEXT) $(AM_V_CCLD)$(LINK) $(tease_the_minotaur_OBJECTS) $(tease_the_minotaur_LDADD) $(LIBS) test-keyfile$(EXEEXT): $(test_keyfile_OBJECTS) $(test_keyfile_DEPENDENCIES) $(EXTRA_test_keyfile_DEPENDENCIES) @rm -f test-keyfile$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_keyfile_OBJECTS) $(test_keyfile_LDADD) $(LIBS) test-value-is-same$(EXEEXT): $(test_value_is_same_OBJECTS) $(test_value_is_same_DEPENDENCIES) $(EXTRA_test_value_is_same_DEPENDENCIES) @rm -f test-value-is-same$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_value_is_same_OBJECTS) $(test_value_is_same_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/account-store-default.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/account-store-libaccounts.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/account-store.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/keyfile.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tease-the-minotaur.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/value-is-same.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags check-TESTS: $(TESTS) @failed=0; all=0; xfail=0; xpass=0; skip=0; \ srcdir=$(srcdir); export srcdir; \ list=' $(TESTS) '; \ $(am__tty_colors); \ if test -n "$$list"; then \ for tst in $$list; do \ if test -f ./$$tst; then dir=./; \ elif test -f $$tst; then dir=; \ else dir="$(srcdir)/"; fi; \ if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \ all=`expr $$all + 1`; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$tst[\ \ ]*) \ xpass=`expr $$xpass + 1`; \ failed=`expr $$failed + 1`; \ col=$$red; res=XPASS; \ ;; \ *) \ col=$$grn; res=PASS; \ ;; \ esac; \ elif test $$? -ne 77; then \ all=`expr $$all + 1`; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$tst[\ \ ]*) \ xfail=`expr $$xfail + 1`; \ col=$$lgn; res=XFAIL; \ ;; \ *) \ failed=`expr $$failed + 1`; \ col=$$red; res=FAIL; \ ;; \ esac; \ else \ skip=`expr $$skip + 1`; \ col=$$blu; res=SKIP; \ fi; \ echo "$${col}$$res$${std}: $$tst"; \ done; \ if test "$$all" -eq 1; then \ tests="test"; \ All=""; \ else \ tests="tests"; \ All="All "; \ fi; \ if test "$$failed" -eq 0; then \ if test "$$xfail" -eq 0; then \ banner="$$All$$all $$tests passed"; \ else \ if test "$$xfail" -eq 1; then failures=failure; else failures=failures; fi; \ banner="$$All$$all $$tests behaved as expected ($$xfail expected $$failures)"; \ fi; \ else \ if test "$$xpass" -eq 0; then \ banner="$$failed of $$all $$tests failed"; \ else \ if test "$$xpass" -eq 1; then passes=pass; else passes=passes; fi; \ banner="$$failed of $$all $$tests did not behave as expected ($$xpass unexpected $$passes)"; \ fi; \ fi; \ dashes="$$banner"; \ skipped=""; \ if test "$$skip" -ne 0; then \ if test "$$skip" -eq 1; then \ skipped="($$skip test was not run)"; \ else \ skipped="($$skip tests were not run)"; \ fi; \ test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \ dashes="$$skipped"; \ fi; \ report=""; \ if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \ report="Please report to $(PACKAGE_BUGREPORT)"; \ test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \ dashes="$$report"; \ fi; \ dashes=`echo "$$dashes" | sed s/./=/g`; \ if test "$$failed" -eq 0; then \ col="$$grn"; \ else \ col="$$red"; \ fi; \ echo "$${col}$$dashes$${std}"; \ echo "$${col}$$banner$${std}"; \ test -z "$$skipped" || echo "$${col}$$skipped$${std}"; \ test -z "$$report" || echo "$${col}$$report$${std}"; \ echo "$${col}$$dashes$${std}"; \ test "$$failed" -eq 0; \ else :; fi distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: check-recursive all-am: Makefile $(PROGRAMS) installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ mostlyclean-am distclean: distclean-recursive -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) check-am \ ctags-recursive install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-TESTS check-am clean clean-generic \ clean-libtool clean-noinstPROGRAMS ctags ctags-recursive \ distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-recursive uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: telepathy-mission-control-5.16.4/tests/account-store.c0000644000175000017500000001312312735242352024116 0ustar00gkiagiagkiagia00000000000000/* * MC account storage backend inspector * * Copyright © 2010 Nokia Corporation * Copyright © 2010 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "config.h" #include #include #include #include #include #include "account-store-default.h" #define DOCSTRING_A \ "%s OP BACKEND ACCOUNT [KEY [VALUE]]\n\n" \ " OP := \n" \ " BACKEND := <" #define DOCSTRING_B \ ">\n" \ " ACCOUNT := //\n" \ " KEY := >\n" \ " VALUE := \n\n" #if ENABLE_LIBACCOUNTS_SSO #include "account-store-libaccounts.h" #endif typedef struct { const gchar *name; gchar * (*get) (const gchar *account, const gchar *key); gboolean (*set) (const gchar *account, const gchar *key, const gchar *value); gboolean (*delete) (const gchar *account); gboolean (*exists) (const gchar *account); GStrv (*list) (void); } Backend; typedef enum { OP_UNKNOWN, OP_GET, OP_SET, OP_DELETE, OP_EXISTS, OP_LIST } Operation; const Backend backends[] = { { "default", default_get, default_set, default_delete, default_exists, default_list }, #if ENABLE_LIBACCOUNTS_SSO { "libaccounts", libaccounts_get, libaccounts_set, libaccounts_delete, libaccounts_exists, libaccounts_list }, #endif { NULL } }; static void usage (const gchar *name, const gchar *fmt, ...) G_GNUC_NORETURN G_GNUC_PRINTF (2, 3); int main (int argc, char **argv) { int i; const gchar *op_name = NULL; const gchar *backend = NULL; const gchar *account = NULL; const gchar *setting = NULL; const gchar *value = NULL; const Backend *store = NULL; Operation op = OP_UNKNOWN; gchar *output = NULL; gboolean success = FALSE; g_type_init (); g_set_application_name (argv[0]); if (argc < 3) usage (argv[0], "Not enough arguments"); op_name = argv[1]; backend = argv[2]; for (i = 0; backends[i].name != NULL; i++) { if (g_str_equal (backends[i].name, backend)) { store = &backends[i]; break; } } if (store == NULL) usage (argv[0], "No such backend %s", backend); if (g_str_equal (op_name, "get")) op = OP_GET; else if (g_str_equal (op_name, "set")) op = OP_SET; else if (g_str_equal (op_name, "del")) op = OP_DELETE; else if (g_str_equal (op_name, "has")) op = OP_EXISTS; else if (g_str_equal (op_name, "list")) op = OP_LIST; switch (op) { case OP_SET: if (argc >= 6) value = argv[5]; case OP_GET: if (argc < 5) usage (argv[0], "op '%s' requires an account and key", op_name); account = argv[3]; setting = argv[4]; if (account == NULL || *account == '\0') usage (argv[0], "op '%s' requires an account", op_name); if (setting == NULL || *setting == '\0') usage (argv[0], "op '%s' requires a key", op_name); break; case OP_DELETE: case OP_EXISTS: if (argc < 4) usage (argv[0], "op '%s' requires an account", op_name); account = argv[3]; break; case OP_LIST: if (argc < 3) usage (argv[0], "op '%s' requires an backend", op_name); break; case OP_UNKNOWN: usage (argv[0], "Unknown operation: %s", op_name); } /* if we got this far, we have all the args we need: */ switch (op) { GStrv list; case OP_GET: output = store->get (account, setting); success = output != NULL; break; case OP_SET: success = store->set (account, setting, value); output = g_strdup_printf ("%s.%s set to '%s' in %s", account, setting, value, store->name); break; case OP_DELETE: success = store->delete (account); output = g_strdup_printf ("%s deleted from %s", account, store->name); break; case OP_EXISTS: success = store->exists (account); if (success) output = g_strdup_printf ("Exists in %s", store->name); break; case OP_LIST: list = store->list (); output = g_strjoinv ("\n", list); g_strfreev (list); break; default: output = g_strdup ("Unknown operation"); } if (output != NULL) printf ("%s\n", output); g_free (output); return success ? 0 : 1; } static void usage (const gchar *name, const gchar *fmt, ...) { guint i; va_list ap; fprintf (stderr, DOCSTRING_A, name); fprintf (stderr, "%s", backends[0].name); for (i = 1; backends[i].name != NULL; i++) fprintf (stderr, " | %s", backends[i].name); fprintf (stderr, DOCSTRING_B); va_start (ap, fmt); vfprintf (stderr, fmt, ap); va_end (ap); exit (1); } telepathy-mission-control-5.16.4/xml/0000755000175000017500000000000012762352247020627 5ustar00gkiagiagkiagia00000000000000telepathy-mission-control-5.16.4/xml/Account_Interface_Hidden.xml0000644000175000017500000000617612735242352026205 0ustar00gkiagiagkiagia00000000000000 Copyright © 2010 Collabora Ltd.

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

(draft 1)

An interface for flagging certain accounts as hidden, so that they do not appear in the account manager's standard lists of accounts. Accounts whose Hidden property is True are intended for non-interactive use (by non-user-visible services), and appear on the AccountManager.Interface.Hidden.DRAFT1 interface; in all other respects, they behave like any other account.

XMPP, in particular, is increasingly used for purposes other than instant messaging and VoIP. For instance, extensions exist for inter-device bookmark synchronization.

While obviously these services could re-use connections intended for instant messaging, in some cases you might want to use a different account. (Perhaps your bookmark sync provider is not your IM provider.) This API allows such auxiliary accounts to exist in Telepathy, while not being displayed in standard user interfaces for IM, VoIP, and friends.

If True, this account is intended for non-interactive use, and thus should not be presented to the user. It will not appear in properties and signals on the main AccountManager interface; instead, it will show up on AccountManager.Interface.Hidden.DRAFT1.

telepathy-mission-control-5.16.4/xml/Account_Manager_Interface_Hidden.xml0000644000175000017500000000774312735242352027640 0ustar00gkiagiagkiagia00000000000000 Copyright © 2010 Collabora Ltd. Copyright © 2010 Nokia Corporation

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

This interface lists accounts whose Hidden property is True.

first draft A list of valid (complete, usable) Accounts intended exclusively for noninteractive applications. These accounts are not included in AccountManager.ValidAccounts. Change notification is via HiddenAccountValidityChanged. A list of incomplete or otherwise unusable Accounts intended exclusively for noninteractive applications. Change notification is via HiddenAccountValidityChanged. The given account has been removed from ValidHiddenAccounts or InvalidHiddenAccounts. An Account, which must not be used any more. The validity of the given account has changed. New magic accounts are also indicated by this signal, as an account validity change (usually to True) on an account that did not previously exist. This is effectively change notification for the valid and invalid accounts lists. An Account. True if the account is now valid.
telepathy-mission-control-5.16.4/xml/Account_Interface_External_Password_Storage.xml0000644000175000017500000000500712735242352032132 0ustar00gkiagiagkiagia00000000000000 Copyright © 2011 Collabora Ltd.

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

(draft 1)

An interface for Accounts whose passwords are stored externally and SHOULD NOT be stored by either the AccountManager nor any ServerAuthentication handler.

This interface SHOULD only appear on accounts for which the related Connection Manager implements ConnectionManager.Interface.AccountStorage.DRAFT.

Clears any saved password associated with this account.

Indicates whether the account has a saved password or not.

Change notification for this property is provided by the standard D-Bus PropertiesChanged signal.

telepathy-mission-control-5.16.4/xml/Channel_Dispatcher_Interface_Messages_DRAFT.xml0000644000175000017500000000437012735242352031615 0ustar00gkiagiagkiagia00000000000000 Copyright (C) 2011 Collabora Ltd. Copyright (C) 2011 Nokia Corporation

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

This interface allows DBus clients to use the ChannelDispatcher to send one-off text messages to a contact, identified by account and target ID, without requiring the caller to handle channels or be the primary message UI.

This enables entities other than the main UI to send messages to contacts.

telepathy-mission-control-5.16.4/xml/generic-types.xml0000644000175000017500000002105712735242352024127 0ustar00gkiagiagkiagia00000000000000 An unsigned 32-bit integer representing time as the number of seconds elapsed since the Unix epoch (1970-01-01T00:00:00Z) An signed 64-bit integer representing time as the number of seconds elapsed since the Unix epoch (1970-01-01T00:00:00Z); negative for times before the epoch The Text interface is the only user of Unix_Timestamp so far, and we'd like to be Y2038 compatible in future interfaces. A string representing a D-Bus bus name - either a well-known name like "org.freedesktop.Telepathy.MissionControl" or a unique name like ":1.123" A string representing a D-Bus well-known name like "org.freedesktop.Telepathy.MissionControl". A string representing a D-Bus unique name, such as ":1.123" An ASCII string representing a D-Bus interface - two or more elements separated by dots, where each element is a non-empty string of ASCII letters, digits and underscores, not starting with a digit. The maximum total length is 255 characters. For example, "org.freedesktop.DBus.Peer". An ASCII string representing a D-Bus error. This is syntactically the same as a DBus_Interface, but the meaning is different. A string representing a D-Bus signature (the 'g' type isn't used because of poor interoperability, particularly with dbus-glib) An ASCII string representing a D-Bus method, signal or property name - a non-empty string of ASCII letters, digits and underscores, not starting with a digit, with a maximum length of 255 characters. For example, "Ping". A string representing the full name of a D-Bus method, signal or property, consisting of a DBus_Interface, followed by a dot, followed by a DBus_Member. For example, "org.freedesktop.DBus.Peer.Ping". A mapping from strings representing D-Bus properties (by their namespaced names) to their values. A D-Bus interface name, followed by a dot and a D-Bus property name. The value of the property. A mapping from strings to variants representing extra key-value pairs. A mapping from strings to strings representing extra key-value pairs. An IP address and port. Either a dotted-quad IPv4 address literal as for Socket_Address_IPv4, or an RFC2373 IPv6 address as for Socket_Address_IPv6. The TCP or UDP port number. An IPv4 address and port. A dotted-quad IPv4 address literal: four ASCII decimal numbers, each between 0 and 255 inclusive, e.g. "192.168.0.1". The TCP or UDP port number. An IPv6 address and port. An IPv6 address literal as specified by RFC2373 section 2.2, e.g. "2001:DB8::8:800:200C:4171". The TCP or UDP port number. An IPv4 network or subnet. A dotted-quad IPv4 address literal: four ASCII decimal numbers, each between 0 and 255 inclusive, e.g. "192.168.0.1". The number of leading bits of the address that must match, for this netmask to be considered to match an address. An IPv6 network or subnet. An IPv6 address literal as specified by RFC2373 section 2.2, e.g. "2001:DB8::8:800:200C:4171". The number of leading bits of the address that must match, for this netmask to be considered to match an address.

The time at which an user action occurred. This type has the 2 following special values:

0: the action doesn't involve any user action. Clients SHOULD avoid stealing focus when presenting the channel.

MAX_INT64: clients SHOULD behave as though the user action happened at the current time, e.g. a client MAY request that its window gains focus.

This can be used by clients that can't know the X server time like command line applications for example.

For all the other values it corresponds to the time of the user action. Clients SHOULD use this for focus-stealing prevention, if applicable. Note that the time is dependant on the local environment and so is not necessarily a wall-clock time. For example in an X environment it's expected to be the X timestamp of events. This corresponds to the _NET_WM_USER_TIME property in EWMH.

A mapping from object path to the immutable properties of the object. The object path of an object The immutable properties of the object
telepathy-mission-control-5.16.4/xml/Account_Interface_Conditions.xml0000644000175000017500000001076412735242352027121 0ustar00gkiagiagkiagia00000000000000 Copyright (C) 2008 Nokia Corporation

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

The Conditions interface specifies under what conditions an account can be put online. When the conditions are met and the ConnectAutomatically property on the account is set to True, then the account will automatically try to connect. On the other hand, if the conditions are not met, the account won't attempt to connect, not even if requested so.

The main goal is to bind accounts to connectivity: most TCP and UDP based protocols require a network route to be present, while link-local does not; some protocol might be specifically designed to work only over bluetooth, in which case we don't want to attempt a connection if bluetooth is not available. Then, some accounts might work only in certain VPNs.

There is also the case of user preferences: one might want to activate a certain account only when he is at home (in that case, he could set a rule on the network ESSID) or when he is not at work (this requires the possibility of negating rules).

The proposed format of a rule is (name, value), where name is a string (which is typically a connectivity parameter, such as "ip-address", "vpn-name", "essid", maybe prefixed with some namespacing convention) and value is the value the parameter must assume for the rule to be met. The value, it will be specified as a string, but we want to be able to specify multiple alternatives (for instance a rule might be "connect if ESSID is HOME or WORK"), as well as negative matches. The proposed syntax is simple yet expressive enough.

Conditions consists of a list of rules, which take the form of a struct (name, value), where:

  • name is a string which names the rule
  • value is the value

The condition is a list of rules, consisting of a name and of a value, both strings. The syntax for the value is:

value ::= [logic] (":" singlevalue | "[" listvalue)
logic ::= ("!" | <possibly other operators>)
singlevalue ::= <possibly any ASCII string>
listvalue ::= separator list
separator ::= <any non-blank ASCII character>
list ::= singlevaluenonsep (separator singlevaluenonsep)*
singlevaluenonsep ::= <ASCII string not containing the separator character>

Some examples of values:

:my_essid_name
!:my_essid_name
[,my_essid_name,his_essid_name
![,my_essid_name,his_essid_name

Questions:

  • Should it be a(ss) or a{ss}?
  • Should we specify namespacing rules for the name?
  • Should we allow wildcards in the values?
telepathy-mission-control-5.16.4/xml/Connection_Manager_Interface_Account_Storage.xml0000644000175000017500000001115212735242352032215 0ustar00gkiagiagkiagia00000000000000 Copyright © 2011 Collabora Ltd.

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

(draft 1)

An interface for connection managers that store account details internally. At the moment this consists only of storing an account's credentials, but other functionality may be added in the future.

Account objects representing accounts on a connection manager that implements this interface should implement the ExternalPasswordStorage.DRAFT interface.

A set of flags representing the status of the Account stored in the Connection Manager. The associated account has its authentication credentials (password) stored in the connection manager A mapping from Account_Ids to account flags.

The set of Accounts stored in this Connection Manager, and flags indicating their status.

Change notification for this property is provided by the standard D-Bus PropertiesChanged signal.

Clears any saved credentials associated with the specified Account_Id. Any other saved data related to the account will be unaffected. An account id as returned from Protocol.IdentifyAccount. The account id is invalid. Completely removes all data associated with an account from the connection manager's internal storage. An account id as returned from Protocol.IdentifyAccount. The account id is invalid.
telepathy-mission-control-5.16.4/xml/Makefile.am0000644000175000017500000000156412735242352022664 0ustar00gkiagiagkiagia00000000000000tools_dir = $(top_srcdir)/tools XSLTFLAGS = --nonet --novalid DROP_NAMESPACE = sed -e 's@xmlns:tp="http://telepathy\.freedesktop\.org/wiki/DbusSpec.extensions-v0"@@g' DROP_TPTYPE = sed -e 's@tp:type="[^"]*"@@g' SPECS = \ Account_Manager_Interface_Hidden.xml \ Account_Interface_Conditions.xml \ Account_Interface_External_Password_Storage.xml \ Account_Interface_Hidden.xml \ Connection_Manager_Interface_Account_Storage.xml \ Channel_Dispatcher_Interface_Messages_DRAFT.xml SPECS_GEN = ${SPECS:%.xml=_gen/introspect-%.xml} all-local: $(SPECS_GEN) _gen/introspect-%.xml: %.xml $(tools_dir)/spec-to-introspect.xsl $(AM_V_at)$(mkdir_p) _gen $(AM_V_GEN)$(XSLTPROC) $(XSLTFLAGS) $(tools_dir)/spec-to-introspect.xsl $< \ | $(DROP_NAMESPACE) > $@ clean-local: rm -f $(SPECS_GEN) EXTRA_DIST = \ all.xml \ nmc5.xml \ generic-types.xml \ telepathy-types.xml \ $(SPECS) telepathy-mission-control-5.16.4/xml/telepathy-types.xml0000644000175000017500000000656712735242352024523 0ustar00gkiagiagkiagia00000000000000

Mapping representing a class of channels that can be requested from a connection manager, can be handled by a user interface, are supported by a contact, etc.

Classes of channel are identified by the fixed values of a subset of their properties.

Channel classes SHOULD always include the keys org.freedesktop.Telepathy.Channel.ChannelType and org.freedesktop.Telepathy.Channel.TargetHandleType.

A D-Bus interface name, followed by a dot and a D-Bus property name. The value of the property.
(as stable API) Enough details of a channel that clients can work out how to dispatch or handle it. The object path of the channel.

Properties of the channel.

Connection managers MUST NOT include properties in this mapping if their values can change. Clients MUST ignore properties that appear in this mapping if their values can change.

If properties that could change were included, the following race condition would be likely to exist in some cases:

  • NewChannels or Get("Channels") includes a property P with value V1
  • Client creates a proxy object for the channel
  • The value of P changes to V2
  • Client connects to PChanged signal
  • Client should call Get("P") or GetAll here, to avoid the race, but client's author has forgotten to do so
  • Proxy object thinks P == V1, but actually P == V2

We've taken the opportunity to make the API encourage the client author to get it right. Where possible, we intend that properties whose value will be used in channel dispatching or other "early" processing will be defined so that they are immutable (can never change).

Each dictionary MUST contain the keys org.freedesktop.Telepathy.Channel.ChannelType, org.freedesktop.Telepathy.Channel.TargetHandleType, org.freedesktop.Telepathy.Channel.TargetHandle and org.freedesktop.Telepathy.Channel.TargetID.

We expect these to be crucial to the channel-dispatching process.

telepathy-mission-control-5.16.4/xml/nmc5.xml0000644000175000017500000000100312735242352022200 0ustar00gkiagiagkiagia00000000000000 Copyright (C) 2008 Nokia Corporation telepathy-mission-control-5.16.4/xml/all.xml0000644000175000017500000000266612735242352022126 0ustar00gkiagiagkiagia00000000000000 Copyright (C) 2008 Nokia Corporation telepathy-mission-control-5.16.4/xml/Makefile.in0000644000175000017500000003220012762351620022663 0ustar00gkiagiagkiagia00000000000000# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__make_dryrun = \ { \ am__dry=no; \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ *) \ for am__flg in $$MAKEFLAGS; do \ case $$am__flg in \ *=*|--*) ;; \ *n*) am__dry=yes; break;; \ esac; \ done;; \ esac; \ test $$am__dry = yes; \ } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = xml DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/gtk-doc.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/tp-compiler-flag.m4 \ $(top_srcdir)/m4/tp-compiler-warnings.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACCOUNTS_CACHE_DIR = @ACCOUNTS_CACHE_DIR@ ACCOUNTS_DIR = @ACCOUNTS_DIR@ ACLOCAL = @ACLOCAL@ AEGIS_LIBS = @AEGIS_LIBS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DBUS_CFLAGS = @DBUS_CFLAGS@ DBUS_LIBS = @DBUS_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ERROR_CFLAGS = @ERROR_CFLAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GIO_UNIX_CFLAGS = @GIO_UNIX_CFLAGS@ GIO_UNIX_LIBS = @GIO_UNIX_LIBS@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_COMPILE_SCHEMAS = @GLIB_COMPILE_SCHEMAS@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ GLIB_MKENUMS = @GLIB_MKENUMS@ GREP = @GREP@ GSETTINGS_DISABLE_SCHEMAS_COMPILE = @GSETTINGS_DISABLE_SCHEMAS_COMPILE@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ HTML_DIR = @HTML_DIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBACCOUNTS_SSO_CFLAGS = @LIBACCOUNTS_SSO_CFLAGS@ LIBACCOUNTS_SSO_LIBS = @LIBACCOUNTS_SSO_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MCE_CFLAGS = @MCE_CFLAGS@ MCE_LIBS = @MCE_LIBS@ MCP_ABI_VERSION = @MCP_ABI_VERSION@ MCP_API_VERSION = @MCP_API_VERSION@ MCP_LT_AGE = @MCP_LT_AGE@ MCP_LT_CURRENT = @MCP_LT_CURRENT@ MCP_LT_REVISION = @MCP_LT_REVISION@ MKDIR_P = @MKDIR_P@ NETWORK_MANAGER_CFLAGS = @NETWORK_MANAGER_CFLAGS@ NETWORK_MANAGER_LIBS = @NETWORK_MANAGER_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PYTHON = @PYTHON@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TELEPATHY_CFLAGS = @TELEPATHY_CFLAGS@ TELEPATHY_LIBS = @TELEPATHY_LIBS@ UPOWER_GLIB_CFLAGS = @UPOWER_GLIB_CFLAGS@ UPOWER_GLIB_LIBS = @UPOWER_GLIB_LIBS@ VERSION = @VERSION@ XSLTPROC = @XSLTPROC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gsettingsschemadir = @gsettingsschemadir@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mctestsdir = @mctestsdir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ pluginlibdir = @pluginlibdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ tools_dir = $(top_srcdir)/tools XSLTFLAGS = --nonet --novalid DROP_NAMESPACE = sed -e 's@xmlns:tp="http://telepathy\.freedesktop\.org/wiki/DbusSpec.extensions-v0"@@g' DROP_TPTYPE = sed -e 's@tp:type="[^"]*"@@g' SPECS = \ Account_Manager_Interface_Hidden.xml \ Account_Interface_Conditions.xml \ Account_Interface_External_Password_Storage.xml \ Account_Interface_Hidden.xml \ Connection_Manager_Interface_Account_Storage.xml \ Channel_Dispatcher_Interface_Messages_DRAFT.xml SPECS_GEN = ${SPECS:%.xml=_gen/introspect-%.xml} EXTRA_DIST = \ all.xml \ nmc5.xml \ generic-types.xml \ telepathy-types.xml \ $(SPECS) all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu xml/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu xml/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile all-local installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-local mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am all-local check check-am clean clean-generic \ clean-libtool clean-local distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ uninstall uninstall-am all-local: $(SPECS_GEN) _gen/introspect-%.xml: %.xml $(tools_dir)/spec-to-introspect.xsl $(AM_V_at)$(mkdir_p) _gen $(AM_V_GEN)$(XSLTPROC) $(XSLTFLAGS) $(tools_dir)/spec-to-introspect.xsl $< \ | $(DROP_NAMESPACE) > $@ clean-local: rm -f $(SPECS_GEN) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: telepathy-mission-control-5.16.4/config.h.in0000644000175000017500000000555712762351617022066 0ustar00gkiagiagkiagia00000000000000/* config.h.in. Generated from configure.ac by autoheader. */ /* Directory for account/connection mapping for crash recovery */ #undef ACCOUNTS_CACHE_DIR /* Directory in which accounts were previously stored */ #undef ACCOUNTS_DIR /* Defined to the non-IM service type for hidden accounts, if any */ #undef ACCOUNTS_GLIB_HIDDEN_SERVICE_TYPE /* Define if Aegis is supported */ #undef ENABLE_AEGIS /* Define to use the "use-conn" GSetting */ #undef ENABLE_CONN_SETTING /* Make tests installable */ #undef ENABLE_INSTALLED_TESTS /* Define if libaccounts SSO support is required */ #undef ENABLE_LIBACCOUNTS_SSO /* Prevent post 2.46 APIs */ #undef GLIB_VERSION_MAX_ALLOWED /* Ignore post 2.46 deprecations */ #undef GLIB_VERSION_MIN_REQUIRED /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H /* Define if GIO-Unix is available */ #undef HAVE_GIO_UNIX /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define if mce is available */ #undef HAVE_MCE /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define if you have libnm-glib */ #undef HAVE_NM /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the header file. */ #undef HAVE_SYSEXITS_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the `umask' function. */ #undef HAVE_UMASK /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to use upower-glib */ #undef HAVE_UPOWER /* Define to the sub-directory where libtool stores uninstalled libraries. */ #undef LT_OBJDIR /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the home page for this package. */ #undef PACKAGE_URL /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Avoid individual headers */ #undef TP_DISABLE_SINGLE_INCLUDE /* Define to hide deprecated struct fields */ #undef TP_SEAL_ENABLE /* Prevent post-0.20 APIs */ #undef TP_VERSION_MAX_ALLOWED /* Ignore post-0.18 deprecations */ #undef TP_VERSION_MIN_REQUIRED /* Version number of package */ #undef VERSION telepathy-mission-control-5.16.4/util/0000755000175000017500000000000012762352250020776 5ustar00gkiagiagkiagia00000000000000telepathy-mission-control-5.16.4/util/wait-for-name.c0000644000175000017500000001277412743213711023620 0ustar00gkiagiagkiagia00000000000000/* * Run until a bus name appears. This can be used as a service-activation * helper for a bus name that is not directly activatable, but will be provided * automatically (after a while) by the desktop session. * * Usage, in * $XDG_DATA_DIRS/dbus-1/services/....Client.Something.service: * * [D-BUS Service] * Name=....Client.Something * Exec=/usr/lib/telepathy/mc-wait-for-name ....Client.Something * * Alternatively, it can be used to activate something via an alternative * name, e.g. in * $XDG_DATA_DIRS/dbus-1/services/....AccountManager.service: * * [D-BUS Service] * Name=....AccountManager * Exec=/usr/lib/telepathy/mc-wait-for-name --activate ....MissionControl5 ....AccountManager * * Copyright (C) 2009 Nokia Corporation * Copyright (C) 2009, 2012 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA * */ #include "config.h" #ifdef HAVE_SYSEXITS_H # include #else # define EX_USAGE 64 # define EX_UNAVAILABLE 69 # define EX_SOFTWARE 70 # define EX_TEMPFAIL 75 #endif #include #include #include #include static int exit_status = EX_SOFTWARE; static guint timeout_id = 0; static guint idle_id = 0; static gboolean quit_because_found (gpointer data) { idle_id = 0; g_main_loop_quit (data); g_main_loop_unref (data); exit_status = 0; return FALSE; } static gboolean quit_because_timeout (gpointer data) { timeout_id = 0; g_main_loop_quit (data); g_main_loop_unref (data); exit_status = EX_TEMPFAIL; return FALSE; } static void noc_cb (TpDBusDaemon *bus_daemon, const gchar *name, const gchar *new_owner, gpointer data) { if (new_owner[0] == '\0') { g_debug ("Waiting for %s", name); } else { g_debug ("%s now owned by %s", name, new_owner); if (idle_id == 0) idle_id = g_idle_add (quit_because_found, g_main_loop_ref (data)); } } static void start_service_cb (TpDBusDaemon *bus_daemon, guint ret, const GError *error, gpointer user_data, GObject *weak_object) { GMainLoop *loop = user_data; if (error != NULL) { g_message ("%s", error->message); g_main_loop_quit (loop); exit_status = EX_TEMPFAIL; } else { switch (ret) { case 1: /* DBUS_START_REPLY_SUCCESS */ g_debug ("activated name successfully started"); break; case 2: /* DBUS_START_REPLY_ALREADY_RUNNING */ g_debug ("activated name already running"); break; default: g_message ("ignoring unknown result from StartServiceByName: %u", ret); break; } } } #define WFN_TIMEOUT (5 * 60) /* 5 minutes */ static gchar *activate = NULL; static GOptionEntry entries[] = { { "activate", 0, 0, G_OPTION_ARG_STRING, &activate, "Activate NAME before waiting for the other name", "NAME" }, { NULL } }; int main (int argc, char **argv) { TpDBusDaemon *bus_daemon; GMainLoop *loop; GError *error = NULL; GOptionContext *context; setlocale (LC_ALL, ""); g_set_prgname ("mc-wait-for-name"); context = g_option_context_new ("- wait for a bus name"); g_option_context_add_main_entries (context, entries, NULL); if (!g_option_context_parse (context, &argc, &argv, &error)) { g_message ("%s", error->message); g_error_free (error); return EX_USAGE; } if (activate != NULL && !tp_dbus_check_valid_bus_name (activate, TP_DBUS_NAME_TYPE_WELL_KNOWN, NULL)) { g_message ("Not a valid bus name: %s", activate); return EX_USAGE; } if (argc != 2 || !tp_dbus_check_valid_bus_name (argv[1], TP_DBUS_NAME_TYPE_WELL_KNOWN, NULL)) { g_message ("Usage: mc-wait-for-name [OPTIONS] com.example.SomeBusName"); return EX_USAGE; } g_type_init (); bus_daemon = tp_dbus_daemon_dup (&error); if (bus_daemon == NULL) { g_message ("%s", error->message); g_error_free (error); return EX_UNAVAILABLE; } loop = g_main_loop_new (NULL, FALSE); if (activate != NULL) { tp_cli_dbus_daemon_call_start_service_by_name (bus_daemon, -1, activate, 0 /* no flags */, start_service_cb, g_main_loop_ref (loop), (GDestroyNotify) g_main_loop_unref, NULL); } tp_dbus_daemon_watch_name_owner (bus_daemon, argv[1], noc_cb, g_main_loop_ref (loop), (GDestroyNotify) g_main_loop_unref); g_timeout_add_seconds (WFN_TIMEOUT, quit_because_timeout, g_main_loop_ref (loop)); g_main_loop_run (loop); if (timeout_id != 0) { g_source_remove (timeout_id); g_main_loop_unref (loop); } if (idle_id != 0) { g_source_remove (idle_id); g_main_loop_unref (loop); } g_main_loop_unref (loop); g_object_unref (bus_daemon); return exit_status; } telepathy-mission-control-5.16.4/util/mc-tool.10000644000175000017500000000746112735241312022436 0ustar00gkiagiagkiagia00000000000000.TH MC-TOOL "1" "July 2009" "Telepathy" "Utilities" \" Copyright © 2009 Collabora Ltd. \" This document may be distributed under the same terms as \" telepathy-mission-control itself. .SH NAME mc-tool \- manipulate Mission Control accounts from the command line .SH SYNOPSIS .B mc-tool list .PP .B mc-tool add .I PROFILE .I DISPLAY-NAME .IR "" [ PARAMETER-SETTINGS ...] .PP .B mc-tool add .IR MANAGER / PROTOCOL " [" PARAMETER-SETTINGS ...] .PP .B mc-tool update .IR ACCOUNT " [" PARAMETER-SETTINGS ...] .PP .B mc-tool display .I ACCOUNT DISPLAY-NAME .PP .B mc-tool nick .I ACCOUNT NICKNAME .PP .B mc-tool service .I ACCOUNT SERVICE-NAME .PP .B mc-tool icon .I ACCOUNT ICON .PP .B mc-tool show .I ACCOUNT .PP .B mc-tool get .I ACCOUNT .IR PARAMETER " [" PARAMETER ...] .PP .B mc-tool auto-presence .IR ACCOUNT " " STATUS " [" MESSAGE ] .PP .B mc-tool request .IR ACCOUNT " " STATUS " [" MESSAGE ] .PP .B mc-tool auto-connect .I ACCOUNT .BR on | off .PP .B mc-tool remove .I ACCOUNT .PP .SH DESCRIPTION .BR mc-tool 's usage depends on its first argument (the "command") .SS SPECIFYING ACCOUNTS Where an account name is needed, it may be given as a full object path (e.g. .BR /org/freedesktop/Telepathy/Account/gabble/jabber/example ), or as the unique account-specific suffix (e.g. .BR gabble/jabber/example ). .SS SPECIFYING PARAMETER SETTINGS Many commands take arguments that represent Telepathy connection manager parameters (see the Telepathy Specification for details of these). Each argument has the following form: .PP .IB TYPE : NAME = VALUE .PP where .I TYPE is either .BR int ", " uint ", " bool ", or " .BR string (other parameter types exist, but are currently unsupported by .BR mc-tool ), .I NAME is the name of the connection manager parameter (e.g. .BR account " or " password ), and .I VALUE is the parameter's value (with integers in decimal, and booleans as .BR 0 " or " 1 ). .PP The .B update command also accepts arguments of the form .BI clear: NAME which delete the named parameter from the account configuration. .SS LIST .B mc-tool list lists the available accounts. .SS ADD .B mc-tool add adds an account. The connection manager and protocol can either be given as the name of a Mission Control .IR profile , (e.g. .BR gtalk ), or as a slash-separated connection manager name and protocol (e.g. .BR gabble/jabber ). .SS DISPLAY .B mc-tool display .I ACCOUNT DISPLAY-NAME sets the .B DisplayName property of .IR ACCOUNT " to " DISPLAY-NAME. .SS NICK .B mc-tool nick .I ACCOUNT NICKNAME sets the .B Nickname property of .IR ACCOUNT " to " NICKNAME . .SS SERVICE .B mc-tool service .I ACCOUNT SERVICE-NAME sets the .B Service property of .IR ACCOUNT " to " SERVICE-NAME . .SS ICON .B mc-tool icon .I ACCOUNT ICON sets the .B Icon property of .IR ACCOUNT " to " ICON . .SS SHOW .B mc-tool show .I ACCOUNT shows information about .IR ACCOUNT . .SS GET .B mc-tool get .I ACCOUNT .IR PARAMETER " [" PARAMETER ...] shows the values of the given parameters of .IR ACCOUNT . .SS ENABLE .B mc-tool enable .I ACCOUNT sets the .B Enabled property of .IR ACCOUNT " to" .BR True . .SS DISABLE .B mc-tool disable .I ACCOUNT sets the .B Enabled property of .IR ACCOUNT " to" .BR False . .SS AUTO-PRESENCE .B mc-tool auto-presence .IR ACCOUNT " " STATUS " [" MESSAGE ] sets the .B AutomaticPresence property of .IR ACCOUNT " to" .IR STATUS " with optional message " MESSAGE . .SS REQUEST .B mc-tool request .IR ACCOUNT " " STATUS " [" MESSAGE ] sets the .B RequestedPresence property of .IR ACCOUNT " to" .IR STATUS " with optional message " MESSAGE ; this is how you tell an account to connect or go offline, for example. .SS AUTO-CONNECT .B mc-tool auto-connect .I ACCOUNT .B on sets the .B ConnectAutomatically property of .IR ACCOUNT " to" .BR True . .B mc-tool auto-connect .I ACCOUNT .B off sets it to .BR False . telepathy-mission-control-5.16.4/util/mc-wait-for-name.1.in0000644000175000017500000000235112735241312024525 0ustar00gkiagiagkiagia00000000000000.TH MC-WAIT-FOR-NAME "1" "July 2009" "Telepathy" "Utilities" \" Copyright © 2009 Collabora Ltd. \" This document may be distributed under the same terms as \" telepathy-mission-control itself. .SH NAME mc-wait-for-name \- run until a D-Bus name appears on the session bus .SH SYNOPSIS .B mc-wait-for-name .I WELL-KNOWN-NAME .PP .nf .B [D-BUS Service] .BI Name= org.freedesktop.Telepathy.Client.Something .BI Exec=@bindir@/mc-wait-for-name " org.freedesktop.Telepathy.Client.Something" .fi .SH DESCRIPTION .B mc-wait-for-name runs until a bus name appears, then exits successfully. This can be used as a service-activation helper for a bus name that is not directly activatable, but will be provided automatically (after a while) by the desktop session. .SH EXIT STATUS .TP 0 The bus name eventually appeared. .TP 64 (EX_USAGE) Invocation error (too many or too few arguments, or the bus name given was not a syntactically valid well-known bus name). .TP 69 (EX_UNAVAILABLE) mc-wait-for-name was unable to connect to the session bus. .TP 75 (EX_TEMPFAIL) The name did not appear within a reasonable time. .SH OPTIONS There are no additional command-line options. .SH BUGS The "reasonable time" to wait is currently hard-coded. telepathy-mission-control-5.16.4/util/Makefile.am0000644000175000017500000000167112735242352023040 0ustar00gkiagiagkiagia00000000000000AM_CPPFLAGS = \ -I$(top_srcdir) \ $(DBUS_CFLAGS) \ $(LIBFFI_CFLAGS) \ $(GLIB_CFLAGS) \ $(TELEPATHY_CFLAGS) \ $(NULL) LDADD = \ $(LIBFFI_LIBS) \ $(GLIB_LIBS) \ $(DBUS_LIBS) \ $(TELEPATHY_LIBS) \ $(NULL) AM_CFLAGS = $(ERROR_CFLAGS) bin_PROGRAMS = mc-tool mc-wait-for-name mc_tool_SOURCES = mc-tool.c mc_wait_for_name_SOURCES = wait-for-name.c dist_man1_MANS = mc-tool.1 man1_MANS = mc-wait-for-name.1 EXTRA_DIST = \ $(man1_MANS:%=%.in) CLEANFILES = $(man1_MANS) mc-wait-for-name.1: mc-wait-for-name.1.in Makefile $(AM_V_GEN)sed -e 's![@]bindir[@]!@bindir@!g' < $< > $@ Android.mk: Makefile.am androgenizer -:PROJECT telepathy_mission_controll \ -:EXECUTABLE mc-tool -:TAGS eng debug \ -:REL_TOP $(top_srcdir) -:ABS_TOP $(abs_top_srcdir) \ -:SOURCES $(mc_tool_SOURCES) \ -:CFLAGS $(DEFS) $(CFLAGS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CFLAGS) \ -:CPPFLAGS $(CPPFLAGS) $(AM_CPPFLAGS) \ -:LDFLAGS $(LDADD) \ > $@ telepathy-mission-control-5.16.4/util/mc-tool.c0000644000175000017500000011647712735241312022530 0ustar00gkiagiagkiagia00000000000000/* * This file is part of telepathy-mission-control * * Copyright (C) 2008 Nokia Corporation. * Copyright (C) 2010 Collabora Ltd. * * Contact: Pekka Pessi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * version 2.1 as published by the Free Software Foundation. * * This library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA * */ #include "config.h" #include #include #include #include #include #include #include static gchar *app_name; static GMainLoop *main_loop; static void show_help (gchar * err) { if (err) printf ("Error: %s\n", err); printf ("Usage:\n" " %1$s list\n" " %1$s summary\n" " %1$s dump\n" " %1$s add / [ ...]\n" " %1$s update [|clear:key] ...\n" " %1$s display \n" " %1$s nick \n" " %1$s service \n" " %1$s icon \n" " %1$s show \n" " %1$s get [key...]\n" " %1$s enable \n" " %1$s disable \n" " %1$s auto-presence []\n" " %1$s request []\n" " %1$s auto-connect [(on|off)]\n" " %1$s reconnect \n" " %1$s remove \n" " where matches (int|uint|bool|string|path):=\n", app_name); if (err) exit (-1); else exit (0); } static union command { struct common { void *callback; gchar const *name; gchar const *account; int ret; } common; union { gboolean (*manager) (TpAccountManager *manager); gboolean (*account) (TpAccount *account); } ready; struct { struct common common; gchar const *manager, *protocol, *display; GHashTable *parameters; } add; struct { struct common common; GHashTable *set; GPtrArray *unset; } update; struct { struct common common; GPtrArray *args; } get; struct { struct common common; gchar const *name; } display, nick, icon, service; struct { struct common common; TpConnectionPresenceType type; gchar const *status, *message; } presence; struct { struct common common; gboolean value; } boolean; } command; struct presence { TpConnectionPresenceType type; gchar *status; gchar *message; }; static const char *strip_prefix (char const *string, char const *prefix) { while (*prefix && *string) if (*prefix++ != *string++) return 0; return *prefix == '\0' ? (char *)string : NULL; } static char *ensure_prefix (char const *string) { if (g_str_has_prefix (string, TP_ACCOUNT_OBJECT_PATH_BASE)) return g_strdup (string); return g_strdup_printf ("%s%s", TP_ACCOUNT_OBJECT_PATH_BASE, string); } static void _g_value_free (gpointer data) { GValue *value = (GValue *) data; g_value_unset (value); g_free (value); } static GHashTable * new_params (void) { return g_hash_table_new_full (g_str_hash, g_str_equal, g_free, _g_value_free); } static gboolean set_param (GHashTable *parameters, GPtrArray *clear, gchar *param_value) { gchar **strv_param_value = NULL; gchar **strv_type_key = NULL; const gchar *param, *type, *key, *value; gboolean ret = 0; GValue *gvalue; if (!param_value) return FALSE; strv_type_key = g_strsplit (param_value, ":", 2); if (strv_type_key == NULL || strv_type_key[0] == NULL || strv_type_key[1] == NULL || strv_type_key[2] != NULL) goto CLEANUP; type = strv_type_key[0]; param = strv_type_key[1]; if (clear) { if (strcmp (type, "clear") == 0 || strcmp (type, "unset") == 0) { g_ptr_array_add (clear, g_strdup (param)); ret = TRUE; goto CLEANUP; } } strv_param_value = g_strsplit (param, "=", 2); if (strv_param_value == NULL || strv_param_value[0] == NULL || strv_param_value[1] == NULL || strv_param_value[2] != NULL) goto CLEANUP; key = strv_param_value[0]; value = strv_param_value[1]; gvalue = g_new0 (GValue, 1); /* Set the key */ if (strcmp (type, "int") == 0) { g_value_init (gvalue, G_TYPE_INT); g_value_set_int (gvalue, strtol (value, NULL, 10)); ret = TRUE; } else if (strcmp (type, "uint") == 0) { g_value_init (gvalue, G_TYPE_UINT); g_value_set_uint (gvalue, strtoul (value, NULL, 10)); ret = TRUE; } else if (strcmp (type, "bool") == 0 || strcmp (type, "boolean") == 0) { g_value_init (gvalue, G_TYPE_BOOLEAN); if (g_ascii_strcasecmp (value, "1") == 0 || g_ascii_strcasecmp (value, "true") == 0 || /* "yes please!" / "yes sir, captain tightpants" */ g_ascii_strncasecmp (value, "yes", 3) == 0 || g_ascii_strcasecmp (value, "mos def") == 0 || g_ascii_strcasecmp (value, "oui") == 0 || strcmp (value, "ou là là!") == 0) { g_value_set_boolean (gvalue, TRUE); ret = TRUE; } else if (g_ascii_strcasecmp (value, "0") == 0 || g_ascii_strcasecmp (value, "false") == 0 || g_ascii_strcasecmp (value, "no") == 0 || g_ascii_strcasecmp (value, "nope") == 0 || g_ascii_strcasecmp (value, "non") == 0) { g_value_set_boolean (gvalue, FALSE); ret = TRUE; } } else if (strcmp (type, "string") == 0) { g_value_init (gvalue, G_TYPE_STRING); g_value_set_string (gvalue, value); ret = TRUE; } else if (strcmp (type, "path") == 0) { g_value_init (gvalue, DBUS_TYPE_G_OBJECT_PATH); g_value_set_boxed (gvalue, value); ret = TRUE; } if (ret) g_hash_table_replace (parameters, g_strdup (key), gvalue); else g_free (gvalue); CLEANUP: g_strfreev (strv_param_value); g_strfreev (strv_type_key); return ret; } static void show_param (gchar const *key, GValue *value) { gchar const *type; gchar *decoded = NULL; int width; if (G_VALUE_HOLDS_STRING (value)) { type = "string"; decoded = g_value_dup_string (value); } else if (G_VALUE_HOLDS_UINT (value)) { type = "uint"; decoded = g_strdup_printf ("%u", g_value_get_uint (value)); } else if (G_VALUE_HOLDS_INT (value)) { type = "int"; decoded = g_strdup_printf ("%i", g_value_get_int (value)); } else if (G_VALUE_HOLDS_BOOLEAN (value)) { type = "bool"; decoded = g_strdup (g_value_get_boolean (value) ? "true" : "false"); } else if (G_VALUE_HOLDS (value, DBUS_TYPE_G_OBJECT_PATH)) { type = "path"; decoded = g_value_dup_boxed (value); } else { type = G_VALUE_TYPE_NAME (value); decoded = g_strdup_value_contents (value); } width = 11 - strlen (type); if (width < 0) width = 0; printf ("%*s (%s) %s = %s\n", width, "", type, key, decoded); g_free (decoded); } static int show (gchar const *what, gchar const *value) { if (value == NULL || value[0] == '\0') return 0; return printf ("%12s: %s\n", what, value); } static int show_presence (gchar const *what, struct presence *presence) { return printf ("%12s: %s (%d) \"%s\"\n", what, presence->status, presence->type, presence->message); } static int show_uri_schemes (const gchar * const *schemes) { int result; gchar *tmp; tmp = g_strjoinv (", ", (gchar **) schemes); result = printf ("%12s: %s\n", "URIScheme", tmp); g_free (tmp); return result; } static void free_presence (struct presence *presence) { g_free (presence->status); g_free (presence->message); } static TpConnectionPresenceType get_presence_type_for_status(char const *status) { if (g_ascii_strcasecmp(status, "unset") == 0) return TP_CONNECTION_PRESENCE_TYPE_UNSET; if (g_ascii_strcasecmp(status, "unknown") == 0) return TP_CONNECTION_PRESENCE_TYPE_UNKNOWN; if (g_ascii_strcasecmp(status, "offline") == 0) return TP_CONNECTION_PRESENCE_TYPE_OFFLINE; if (g_ascii_strcasecmp(status, "available") == 0 || g_ascii_strcasecmp(status, "online") == 0) return TP_CONNECTION_PRESENCE_TYPE_AVAILABLE; if (g_ascii_strcasecmp(status, "away") == 0 || g_ascii_strcasecmp(status, "brb") == 0) return TP_CONNECTION_PRESENCE_TYPE_AWAY; if (g_ascii_strcasecmp(status, "xa") == 0 || g_ascii_strcasecmp(status, "extended-away") == 0 || g_ascii_strcasecmp(status, "extendedaway") == 0) return TP_CONNECTION_PRESENCE_TYPE_EXTENDED_AWAY; if (g_ascii_strcasecmp(status, "hidden") == 0) return TP_CONNECTION_PRESENCE_TYPE_HIDDEN; if (g_ascii_strcasecmp(status, "busy") == 0 || g_ascii_strcasecmp(status, "dnd") == 0 || g_ascii_strcasecmp(status, "do_not_disturb") == 0 || g_ascii_strcasecmp(status, "donotdisturb") == 0) return TP_CONNECTION_PRESENCE_TYPE_BUSY; if (g_ascii_strcasecmp(status, "error") == 0) return TP_CONNECTION_PRESENCE_TYPE_ERROR; return TP_CONNECTION_PRESENCE_TYPE_UNKNOWN; } static gchar const * connection_status_as_string(TpConnectionStatus status) { switch (status) { case TP_CONNECTION_STATUS_CONNECTED: return "CONNECTED"; case TP_CONNECTION_STATUS_CONNECTING: return "CONNECTING"; case TP_CONNECTION_STATUS_DISCONNECTED: return "DISCONNECTED"; default: return ""; } } static gchar const * connection_status_reason_as_string(TpConnectionStatusReason reason) { switch (reason) { case TP_CONNECTION_STATUS_REASON_NONE_SPECIFIED: return "NONE"; case TP_CONNECTION_STATUS_REASON_REQUESTED: return "REQUESTED"; case TP_CONNECTION_STATUS_REASON_NETWORK_ERROR: return "NETWORK_ERROR"; case TP_CONNECTION_STATUS_REASON_AUTHENTICATION_FAILED: return "AUTHENTICATION_FAILED"; case TP_CONNECTION_STATUS_REASON_ENCRYPTION_ERROR: return "ENCRYPTION_ERROR"; case TP_CONNECTION_STATUS_REASON_NAME_IN_USE: return "NAME_IN_USE"; case TP_CONNECTION_STATUS_REASON_CERT_NOT_PROVIDED: return "CERT_NOT_PROVIDED"; case TP_CONNECTION_STATUS_REASON_CERT_UNTRUSTED: return "CERT_UNTRUSTED"; case TP_CONNECTION_STATUS_REASON_CERT_EXPIRED: return "CERT_EXPIRED"; case TP_CONNECTION_STATUS_REASON_CERT_NOT_ACTIVATED: return "CERT_NOT_ACTIVATED"; case TP_CONNECTION_STATUS_REASON_CERT_HOSTNAME_MISMATCH: return "CERT_HOSTNAME_MISMATCH"; case TP_CONNECTION_STATUS_REASON_CERT_FINGERPRINT_MISMATCH: return "CERT_FINGERPRINT_MISMATCH"; case TP_CONNECTION_STATUS_REASON_CERT_SELF_SIGNED: return "CERT_SELF_SIGNED"; case TP_CONNECTION_STATUS_REASON_CERT_OTHER_ERROR: return "CERT_OTHER_ERROR"; default: return ""; } } typedef enum { GET_PARAM, GET_STRING, GET_BOOLEAN, GET_PRESENCE, GET_PRESENCE_TYPE, GET_PRESENCE_STATUS, GET_PRESENCE_MESSAGE } GetterType; typedef struct _Getter { gchar const *name; GetterType type; gpointer function; } Getter; static GData *getter_list; static void getter_list_add(gchar const *name, GetterType type, gpointer function) { GQuark id; Getter *getter; id = g_quark_from_static_string(name); getter = g_new0(Getter, 1); getter->name = name; getter->type = type; getter->function = function; g_datalist_id_set_data(&getter_list, id, getter); } static void getter_list_init(void) { static int init; if (init) return; init = 1; getter_list_add("DisplayName", GET_STRING, tp_account_get_display_name); getter_list_add("Icon", GET_STRING, tp_account_get_icon_name); getter_list_add("Valid", GET_BOOLEAN, tp_account_is_valid); getter_list_add("Enabled", GET_BOOLEAN, tp_account_is_enabled); getter_list_add("Nickname", GET_STRING, tp_account_get_nickname); getter_list_add("ConnectAutomatically", GET_BOOLEAN, tp_account_get_connect_automatically); getter_list_add("NormalizedName", GET_STRING, tp_account_get_normalized_name); getter_list_add("AutomaticPresence", GET_PRESENCE, tp_account_get_automatic_presence); getter_list_add("AutomaticPresenceType", GET_PRESENCE_TYPE, tp_account_get_automatic_presence); getter_list_add("AutomaticPresenceStatus", GET_PRESENCE_STATUS, tp_account_get_automatic_presence); getter_list_add("AutomaticPresenceMessage", GET_PRESENCE_MESSAGE, tp_account_get_automatic_presence); getter_list_add("RequestedPresenceType", GET_PRESENCE_TYPE, tp_account_get_requested_presence); getter_list_add("RequestedPresenceStatus", GET_PRESENCE_STATUS, tp_account_get_requested_presence); getter_list_add("RequestedPresenceMessage", GET_PRESENCE_MESSAGE, tp_account_get_requested_presence); getter_list_add("CurrentPresenceType", GET_PRESENCE_TYPE, tp_account_get_current_presence); getter_list_add("CurrentPresenceStatus", GET_PRESENCE_STATUS, tp_account_get_current_presence); getter_list_add("CurrentPresenceMessage", GET_PRESENCE_MESSAGE, tp_account_get_current_presence); } static Getter * getter_by_name(char *name) { getter_list_init(); return g_datalist_get_data(&getter_list, name); } /* ====================================================================== */ static gint compare_accounts (gconstpointer a, gconstpointer b) { return strcmp (tp_account_get_path_suffix (TP_ACCOUNT (a)), tp_account_get_path_suffix (TP_ACCOUNT (b))); } static GList * dup_valid_accounts_sorted (TpAccountManager *manager) { return g_list_sort (tp_account_manager_dup_valid_accounts (manager), compare_accounts); } static gboolean command_list (TpAccountManager *manager) { GList *accounts = dup_valid_accounts_sorted (manager); if (accounts != NULL) { GList *ptr; command.common.ret = 0; for (ptr = accounts; ptr != NULL; ptr = ptr->next) { puts (tp_account_get_path_suffix (ptr->data)); } g_list_free_full (accounts, g_object_unref); } return FALSE; /* stop mainloop */ } static gboolean command_summary (TpAccountManager *manager) { GList *accounts, *l; guint longest_account = 0; accounts = tp_account_manager_dup_valid_accounts (manager); if (accounts == NULL) { return FALSE; } command.common.ret = 0; for (l = accounts; l != NULL; l = l->next) { TpAccount *account = TP_ACCOUNT (l->data); longest_account = MAX (longest_account, strlen (tp_account_get_path_suffix (account))); } /* The -6 is so we can line up the "Enabled" header to have the ticks and * crosses below the 7th and final character. We're only guaranteed * longest_account ≥ 5 in theory (a/b/c is the shortest legal suffix) but * in practice it's always going to be ≥ 7. */ g_return_val_if_fail (longest_account >= 7, FALSE); printf ("%-*s %s %s\n", longest_account - 6, "Account", "Enabled", "Requested"); printf ("%-*s %s %s\n", longest_account - 6, "=======", "=======", "========="); for (l = accounts; l != NULL; l = l->next) { TpAccount *account = TP_ACCOUNT (l->data); gchar *status; tp_account_get_requested_presence (account, &status, NULL); printf ("%-*s %s %s\n", longest_account, tp_account_get_path_suffix (account), tp_account_is_enabled (account) ? "✓" : "☐", status); } g_list_free_full (accounts, g_object_unref); return FALSE; /* stop mainloop */ } static void callback_for_create_account (GObject *source, GAsyncResult *result, gpointer user_data) { TpAccountManager *am = TP_ACCOUNT_MANAGER (source); TpAccount *account; GError *error = NULL; account = tp_account_manager_create_account_finish (am, result, &error); if (account != NULL) { command.common.ret = 0; puts (tp_account_get_path_suffix (account)); } else { fprintf (stderr, "%s %s: %s\n", app_name, command.common.name, error->message); } g_main_loop_quit (main_loop); } static gboolean command_add (TpAccountManager *manager) { GHashTable *properties = tp_asv_new (NULL, NULL); tp_account_manager_create_account_async (manager, command.add.manager, command.add.protocol, command.add.display, command.add.parameters, properties, callback_for_create_account, NULL); return TRUE; } static void callback_for_update_parameters (GObject *source, GAsyncResult *result, gpointer user_data G_GNUC_UNUSED) { TpAccount *account = TP_ACCOUNT (source); gchar **reconnect_required = NULL; GError *error = NULL; if (tp_account_update_parameters_finish (account, result, &reconnect_required, &error)) { if (reconnect_required[0] != NULL) { gchar *r = g_strjoinv (", ", reconnect_required); printf ("To apply changes to these parameters:\n"); printf (" %s\n", r); printf ("run:\n"); printf (" %s reconnect %s\n", app_name, tp_account_get_path_suffix (account)); g_free (r); g_strfreev (reconnect_required); } command.common.ret = 0; } else { fprintf (stderr, "%s %s: %s\n", app_name, command.common.name, error->message); } g_main_loop_quit (main_loop); } static void callback_for_async (GObject *account, GAsyncResult *res, gpointer user_data) { gboolean (* finish_func) (TpAccount *, GAsyncResult *, GError **); GError *error = NULL; finish_func = user_data; if (!finish_func (TP_ACCOUNT (account), res, &error)) { fprintf (stderr, "%s %s: %s\n", app_name, command.common.name, error->message); g_error_free (error); } else { command.common.ret = 0; } g_main_loop_quit (main_loop); } static gboolean command_remove (TpAccount *account) { tp_account_remove_async (account, callback_for_async, tp_account_remove_finish); return TRUE; } static gchar * dup_storage_restrictions (TpAccount *account) { TpStorageRestrictionFlags flags; GPtrArray *tmp; gchar *result; flags = tp_account_get_storage_restrictions (account); if (flags == 0) return g_strdup ("(none)"); tmp = g_ptr_array_new (); if (flags & TP_STORAGE_RESTRICTION_FLAG_CANNOT_SET_PARAMETERS) g_ptr_array_add (tmp, "Cannot_Set_Parameters"); if (flags & TP_STORAGE_RESTRICTION_FLAG_CANNOT_SET_ENABLED) g_ptr_array_add (tmp, "Cannot_Set_Enabled"); if (flags & TP_STORAGE_RESTRICTION_FLAG_CANNOT_SET_PRESENCE) g_ptr_array_add (tmp, "Cannot_Set_Presence"); if (flags & TP_STORAGE_RESTRICTION_FLAG_CANNOT_SET_SERVICE) g_ptr_array_add (tmp, "Cannot_Set_Service"); g_ptr_array_add (tmp, NULL); result = g_strjoinv (", ", (gchar **) tmp->pdata); g_ptr_array_unref (tmp); return result; } static gboolean command_show (TpAccount *account) { const GHashTable *parameters; GHashTableIter i[1]; gpointer keyp, valuep; struct presence automatic, current, requested; const gchar * const *schemes; const gchar *storage_provider; const gchar * const *supersedes; show ("Account", tp_account_get_path_suffix (account)); show ("Display Name", tp_account_get_display_name (account)); show ("Normalized", tp_account_get_normalized_name (account)); show ("Enabled", tp_account_is_enabled (account) ? "enabled" : "disabled"); show ("Valid", tp_account_is_valid (account) ? "" : "false"); show ("Icon", tp_account_get_icon_name (account)); show ("Connects", tp_account_get_connect_automatically (account) ? "automatically" : "only when requested"); show ("Nickname", tp_account_get_nickname (account)); show ("Service", tp_account_get_service (account)); puts (""); puts ("Presences:"); automatic.type = tp_account_get_automatic_presence (account, &automatic.status, &automatic.message); show_presence ("Automatic", &automatic); free_presence (&automatic); current.type = tp_account_get_current_presence (account, ¤t.status, ¤t.message); show_presence ("Current", ¤t); free_presence (¤t); requested.type = tp_account_get_requested_presence (account, &requested.status, &requested.message); show_presence ("Requested", &requested); free_presence (&requested); show ("Changing", tp_account_get_changing_presence (account) ? "yes" : "no"); schemes = tp_account_get_uri_schemes (account); if (schemes != NULL && schemes[0] != NULL) { puts (""); puts ("Addressing:"); show_uri_schemes (schemes); } storage_provider = tp_account_get_storage_provider (account); if (!tp_str_empty (storage_provider)) { GVariant *storage_identifier; gchar *storage_restrictions; puts (""); puts ("Storage:"); show ("Provider", storage_provider); storage_identifier = tp_account_dup_storage_identifier_variant ( account); if (storage_identifier != NULL) { gchar *tmp = g_variant_print (storage_identifier, TRUE); show ("Identifier", tmp); g_free (tmp); g_variant_unref (storage_identifier); } storage_restrictions = dup_storage_restrictions (account); show ("Restrictions", storage_restrictions); g_free (storage_restrictions); } supersedes = tp_account_get_supersedes (account); if (supersedes != NULL && supersedes[0] != NULL) { puts (""); puts ("Supersedes:"); for (; *supersedes != NULL; supersedes++) printf (" %s\n", *supersedes + strlen (TP_ACCOUNT_OBJECT_PATH_BASE)); } puts (""); parameters = tp_account_get_parameters (account); for (g_hash_table_iter_init (i, (GHashTable *) parameters); g_hash_table_iter_next (i, &keyp, &valuep);) { show_param (keyp, valuep); } command.common.ret = 0; return FALSE; } static gboolean command_dump (TpAccountManager *manager) { GList *accounts, *l; accounts = tp_account_manager_dup_valid_accounts (manager); if (accounts == NULL) { return FALSE; } command.common.ret = 0; for (l = accounts; l != NULL; l = l->next) { TpAccount *account = TP_ACCOUNT (l->data); command_show (account); if (l->next != NULL) printf ("\n------------------------------------------------------------\n\n"); } g_list_free_full (accounts, g_object_unref); return FALSE; /* stop mainloop */ } static gboolean command_connection (TpAccount *account) { TpConnection *conn; conn = tp_account_get_connection (account); if (conn != NULL) { TpConnectionStatus status; TpConnectionStatusReason reason; const gchar *name; name = tp_proxy_get_object_path (conn); status = tp_account_get_connection_status (account, &reason); printf("%s %s %s\n", name, connection_status_as_string(status), connection_status_reason_as_string(reason)); command.common.ret = 0; } else { fprintf(stderr, "%s: no connection\n", tp_account_get_path_suffix (account)); } return FALSE; } static gboolean command_get (TpAccount *account) { GPtrArray *args = command.get.args; GHashTable *parameters = NULL; guint i; command.common.ret = 0; for (i = 0; i < args->len; i++) { Getter *getter = g_ptr_array_index(args, i); if (getter->function) { gchar const *(*getstring)(TpAccount *) = getter->function; gboolean (*getboolean)(TpAccount *) = getter->function; TpConnectionPresenceType (*getpresence)(TpAccount *, gchar **status, gchar **message) = getter->function; if (getter->type == GET_STRING) { printf("\"%s\"\n", getstring(account)); } else if (getter->type == GET_BOOLEAN) { puts(getboolean(account) ? "true" : "false"); } else if (getter->type == GET_PRESENCE) { struct presence presence; presence.type = getpresence(account, &presence.status, &presence.message); printf ("(%u, \"%s\", \"%s\")\n", presence.type, presence.status, presence.message); free_presence (&presence); } else if (getter->type == GET_PRESENCE_TYPE || getter->type == GET_PRESENCE_STATUS || getter->type == GET_PRESENCE_MESSAGE) { struct presence presence; presence.type = getpresence(account, &presence.status, &presence.message); if (getter->type == GET_PRESENCE_TYPE) printf("%u\n", presence.type); else if (getter->type == GET_PRESENCE_STATUS) printf("\"%s\"\n", presence.status); else printf("\"%s\"\n", presence.message); free_presence (&presence); } else { } } else { GValue *gvalue; gchar *value; if (parameters == NULL) parameters = (GHashTable *) tp_account_get_parameters(account); gvalue = g_hash_table_lookup(parameters, getter->name); if (gvalue == NULL) { command.common.ret = 1; fprintf(stderr, "%s %s: param=%s: %s\n", app_name, command.common.name, getter->name, "not found"); continue; } value = g_strdup_value_contents (gvalue); puts(value); g_free(value); } } return FALSE; } static gboolean command_enable (TpAccount *account) { tp_account_set_enabled_async (account, TRUE, callback_for_async, tp_account_set_enabled_finish); return TRUE; } static gboolean command_disable (TpAccount *account) { tp_account_set_enabled_async (account, FALSE, callback_for_async, tp_account_set_enabled_finish); return TRUE; } static gboolean command_display (TpAccount *account) { tp_account_set_display_name_async (account, command.display.name, callback_for_async, tp_account_set_display_name_finish); return TRUE; } static gboolean command_nick (TpAccount *account) { tp_account_set_nickname_async (account, command.nick.name, callback_for_async, tp_account_set_nickname_finish); return TRUE; } static gboolean command_service (TpAccount *account) { tp_account_set_service_async (account, command.service.name, callback_for_async, tp_account_set_service_finish); return TRUE; } static gboolean command_icon (TpAccount *account) { tp_account_set_icon_name_async (account, command.icon.name, callback_for_async, tp_account_set_icon_name_finish); return TRUE; } static gboolean command_auto_connect (TpAccount *account) { tp_account_set_connect_automatically_async (account, command.boolean.value, callback_for_async, tp_account_set_connect_automatically_finish); return TRUE; } static gboolean command_reconnect (TpAccount *account) { tp_account_reconnect_async (account, callback_for_async, tp_account_reconnect_finish); return TRUE; } static gboolean command_update (TpAccount *account) { tp_account_update_parameters_async (account, command.update.set, (const gchar **) command.update.unset->pdata, callback_for_update_parameters, NULL); return TRUE; } static gboolean command_auto_presence (TpAccount *account) { tp_account_set_automatic_presence_async (account, command.presence.type, command.presence.status, command.presence.message, callback_for_async, tp_account_set_automatic_presence_finish); return TRUE; } static gboolean command_request (TpAccount *account) { tp_account_request_presence_async (account, command.presence.type, command.presence.status, command.presence.message, callback_for_async, tp_account_request_presence_finish); return TRUE; } static void parse (int argc, char **argv) { int i; gboolean status; app_name = basename (argv[0]); if (argc < 2) show_help ("No command specified"); g_type_init (); /* Command processing */ command.common.name = argv[1]; if (strcmp (argv[1], "add") == 0) { gchar **strv; /* Add account */ if (argc < 4) show_help ("Invalid add command."); if (strchr (argv[2], '/') != NULL) { strv = g_strsplit (argv[2], "/", 2); if (strv[0] == NULL || strv[1] == NULL || strv[2] != NULL) show_help ("Invalid add command."); command.add.manager = strv[0]; command.add.protocol = strv[1]; } else { show_help ("Invalid add command."); } command.ready.manager = command_add; command.add.display = argv[3]; command.add.parameters = new_params (); for (i = 4; i < argc; i++) { status = set_param (command.add.parameters, NULL, argv[i]); if (!status) { g_warning ("%s: bad parameter: %s", argv[1], argv[i]); exit (1); } } } else if (strcmp (argv[1], "list") == 0) { /* List accounts */ if (argc != 2) show_help ("Invalid list command."); command.ready.manager = command_list; } else if (strcmp (argv[1], "summary") == 0) { /* List accounts */ if (argc != 2) show_help ("Invalid summary command."); command.ready.manager = command_summary; } else if (strcmp (argv[1], "dump") == 0) { /* Dump all accounts */ if (argc != 2) show_help ("Invalid dump command."); command.ready.manager = command_dump; } else if (strcmp (argv[1], "remove") == 0 || strcmp (argv[1], "delete") == 0) { /* Remove account */ if (argc != 3) show_help ("Invalid remove command."); command.ready.account = command_remove; command.common.account = argv[2]; } else if (strcmp (argv[1], "show") == 0) { /* Show account details */ if (argc != 3) show_help ("Invalid show command."); command.ready.account = command_show; command.common.account = argv[2]; } else if (strcmp (argv[1], "get") == 0) { /* Get account details */ if (argc < 3) show_help ("Invalid get command."); command.ready.account = command_get; command.common.account = argv[2]; command.get.args = g_ptr_array_new(); for (i = 3; argv[i]; i++) { char *name = argv[i]; Getter *getter; const char *param = strip_prefix (name, "param="); if (param != NULL) { getter = g_new0(Getter, 1); getter->name = param; getter->type = GET_PARAM; getter->function = NULL; } else { getter = getter_by_name(name); if (getter == NULL) { fprintf(stderr, "%s %s: %s: unknown\n", app_name, "get", name); exit(1); } } g_ptr_array_add(command.get.args, getter); } } else if (strcmp (argv[1], "connection") == 0) { /* Show connection status */ if (argc != 3) show_help ("Invalid connection command."); command.ready.account = command_connection; command.common.account = argv[2]; } else if (strcmp (argv[1], "enable") == 0) { /* Enable account */ if (argc != 3) show_help ("Invalid enable command."); command.ready.account = command_enable; command.common.account = argv[2]; } else if (strcmp (argv[1], "disable") == 0) { /* Disable account */ if (argc != 3) show_help ("Invalid disable command."); command.ready.account = command_disable; command.common.account = argv[2]; } else if (strcmp (argv[1], "display") == 0) { /* Set display name */ if (argc != 4) show_help ("Invalid display command."); command.ready.account = command_display; command.common.account = argv[2]; command.display.name = argv[3]; } else if (strcmp (argv[1], "nick") == 0) { /* Set nickname */ if (argc != 4) show_help ("Invalid nick command."); command.ready.account = command_nick; command.common.account = argv[2]; command.nick.name = argv[3]; } else if (strcmp (argv[1], "service") == 0) { /* Set service */ if (argc != 4) show_help ("Invalid service command."); command.ready.account = command_service; command.common.account = argv[2]; command.service.name = argv[3]; } else if (strcmp (argv[1], "icon") == 0) { /* Set icon */ if (argc != 4) show_help ("Invalid icon command."); command.ready.account = command_icon; command.common.account = argv[2]; command.icon.name = argv[3]; } else if (strcmp (argv[1], "update") == 0 || strcmp (argv[1], "set") == 0) { /* Set account parameter (s) */ if (argc < 4) show_help ("Invalid update command."); command.ready.account = command_update; command.common.account = argv[2]; command.update.set = new_params (); command.update.unset = g_ptr_array_new (); for (i = 3; i < argc; i++) { status = set_param (command.update.set, command.update.unset, argv[i]); if (!status) { g_warning ("%s: bad parameter: %s", argv[1], argv[i]); exit (1); } } g_ptr_array_add (command.update.unset, NULL); } else if (strcmp (argv[1], "auto-presence") == 0) { /* Set automatic presence */ if (argc != 4 && argc != 5) show_help ("Invalid auto-presence command."); command.ready.account = command_auto_presence; command.common.account = argv[2]; command.presence.type = get_presence_type_for_status(argv[3]); command.presence.status = argv[3]; command.presence.message = argv[4] ? argv[4] : ""; switch (command.presence.type) { case TP_CONNECTION_PRESENCE_TYPE_UNKNOWN: case TP_CONNECTION_PRESENCE_TYPE_ERROR: fprintf(stderr, "%s: %s: unknown presence %s\n", app_name, argv[1], argv[3]); exit(1); break; default: break; } } else if (strcmp (argv[1], "request") == 0) { /* Set presence */ if (argc != 4 && argc != 5) show_help ("Invalid request command."); command.ready.account = command_request; command.common.account = argv[2]; command.presence.type = get_presence_type_for_status(argv[3]); command.presence.status = argv[3]; command.presence.message = argv[4] ? argv[4] : ""; switch (command.presence.type) { case TP_CONNECTION_PRESENCE_TYPE_UNKNOWN: case TP_CONNECTION_PRESENCE_TYPE_ERROR: fprintf(stderr, "%s: %s: unknown presence %s\n", app_name, argv[1], argv[3]); exit(1); break; default: break; } } else if (strcmp (argv[1], "auto-connect") == 0) { /* Turn on (or off) auto-connect */ if (argc != 3 && argc != 4) show_help ("Invalid auto-connect command."); command.ready.account = command_auto_connect; command.common.account = argv[2]; if (argv[3] == NULL || g_ascii_strcasecmp (argv[3], "on") == 0 || g_ascii_strcasecmp (argv[3], "true") == 0 || g_ascii_strcasecmp (argv[3], "1") == 0) command.boolean.value = TRUE; else if (g_ascii_strcasecmp (argv[3], "off") == 0 || g_ascii_strcasecmp (argv[3], "false") == 0 || g_ascii_strcasecmp (argv[3], "0") == 0) command.boolean.value = FALSE; else show_help ("Invalid auto-connect command."); } else if (strcmp (argv[1], "reconnect") == 0) { if (argc != 3) show_help ("Invalid reconnect command."); command.ready.account = command_reconnect; command.common.account = argv[2]; } else if (strcmp (argv[1], "help") == 0 || strcmp (argv[1], "-h") == 0 || strcmp (argv[1], "--help") == 0) { show_help (NULL); } else { show_help ("Unknown command."); } } static void manager_ready (GObject *manager, GAsyncResult *res, gpointer user_data) { GError *error = NULL; if (!tp_proxy_prepare_finish (manager, res, &error)) { fprintf (stderr, "%s: %s\n", app_name, error->message); g_error_free (error); } else { if (command.ready.manager (TP_ACCOUNT_MANAGER (manager))) return; } g_main_loop_quit (main_loop); } static void account_ready (GObject *source, GAsyncResult *res, gpointer user_data) { TpAccount *account = TP_ACCOUNT (source); GError *error = NULL; if (!tp_proxy_prepare_finish (account, res, &error)) { fprintf (stderr, "%s: couldn't load account '%s': %s\n", app_name, tp_account_get_path_suffix (account), error->message); fprintf (stderr, "Try '%s list' to list known accounts.\n", app_name); g_error_free (error); } else { if (command.ready.account (account)) return; } g_main_loop_quit (main_loop); } int main (int argc, char **argv) { TpAccountManager *am = NULL; TpAccount *a = NULL; TpDBusDaemon *dbus = NULL; TpSimpleClientFactory *client_factory = NULL; GError *error = NULL; const GQuark features[] = { TP_ACCOUNT_FEATURE_CORE, TP_ACCOUNT_FEATURE_ADDRESSING, TP_ACCOUNT_FEATURE_STORAGE, 0 }; g_type_init (); app_name = basename (argv[0]); parse (argc, argv); command.common.ret = 1; dbus = tp_dbus_daemon_dup (&error); if (error != NULL) { fprintf (stderr, "%s %s: Failed to connect to D-Bus: %s\n", app_name, command.common.name, error->message); goto out; } client_factory = tp_simple_client_factory_new (dbus); if (command.common.account == NULL) { TpSimpleClientFactory *factory; am = tp_account_manager_new (dbus); factory = tp_proxy_get_factory (am); tp_simple_client_factory_add_account_features (factory, features); tp_proxy_prepare_async (am, NULL, manager_ready, NULL); } else { command.common.account = ensure_prefix (command.common.account); a = tp_simple_client_factory_ensure_account (client_factory, command.common.account, NULL, &error); if (error != NULL) { fprintf (stderr, "%s %s: %s\n", app_name, command.common.name, error->message); goto out; } tp_proxy_prepare_async (a, features, account_ready, NULL); } main_loop = g_main_loop_new (NULL, FALSE); g_main_loop_run (main_loop); out: g_clear_error (&error); tp_clear_object (&client_factory); tp_clear_object (&dbus); tp_clear_object (&am); tp_clear_object (&a); tp_clear_pointer (&main_loop, g_main_loop_unref); return command.common.ret; } telepathy-mission-control-5.16.4/util/Makefile.in0000644000175000017500000006051412762351620023051 0ustar00gkiagiagkiagia00000000000000# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__make_dryrun = \ { \ am__dry=no; \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ *) \ for am__flg in $$MAKEFLAGS; do \ case $$am__flg in \ *=*|--*) ;; \ *n*) am__dry=yes; break;; \ esac; \ done;; \ esac; \ test $$am__dry = yes; \ } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ bin_PROGRAMS = mc-tool$(EXEEXT) mc-wait-for-name$(EXEEXT) subdir = util DIST_COMMON = $(dist_man1_MANS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/gtk-doc.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/tp-compiler-flag.m4 \ $(top_srcdir)/m4/tp-compiler-warnings.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" PROGRAMS = $(bin_PROGRAMS) am_mc_tool_OBJECTS = mc-tool.$(OBJEXT) mc_tool_OBJECTS = $(am_mc_tool_OBJECTS) mc_tool_LDADD = $(LDADD) am__DEPENDENCIES_1 = mc_tool_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am_mc_wait_for_name_OBJECTS = wait-for-name.$(OBJEXT) mc_wait_for_name_OBJECTS = $(am_mc_wait_for_name_OBJECTS) mc_wait_for_name_LDADD = $(LDADD) mc_wait_for_name_DEPENDENCIES = $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; SOURCES = $(mc_tool_SOURCES) $(mc_wait_for_name_SOURCES) DIST_SOURCES = $(mc_tool_SOURCES) $(mc_wait_for_name_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } man1dir = $(mandir)/man1 NROFF = nroff MANS = $(dist_man1_MANS) $(man1_MANS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACCOUNTS_CACHE_DIR = @ACCOUNTS_CACHE_DIR@ ACCOUNTS_DIR = @ACCOUNTS_DIR@ ACLOCAL = @ACLOCAL@ AEGIS_LIBS = @AEGIS_LIBS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DBUS_CFLAGS = @DBUS_CFLAGS@ DBUS_LIBS = @DBUS_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ERROR_CFLAGS = @ERROR_CFLAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GIO_UNIX_CFLAGS = @GIO_UNIX_CFLAGS@ GIO_UNIX_LIBS = @GIO_UNIX_LIBS@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_COMPILE_SCHEMAS = @GLIB_COMPILE_SCHEMAS@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ GLIB_MKENUMS = @GLIB_MKENUMS@ GREP = @GREP@ GSETTINGS_DISABLE_SCHEMAS_COMPILE = @GSETTINGS_DISABLE_SCHEMAS_COMPILE@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ HTML_DIR = @HTML_DIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBACCOUNTS_SSO_CFLAGS = @LIBACCOUNTS_SSO_CFLAGS@ LIBACCOUNTS_SSO_LIBS = @LIBACCOUNTS_SSO_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MCE_CFLAGS = @MCE_CFLAGS@ MCE_LIBS = @MCE_LIBS@ MCP_ABI_VERSION = @MCP_ABI_VERSION@ MCP_API_VERSION = @MCP_API_VERSION@ MCP_LT_AGE = @MCP_LT_AGE@ MCP_LT_CURRENT = @MCP_LT_CURRENT@ MCP_LT_REVISION = @MCP_LT_REVISION@ MKDIR_P = @MKDIR_P@ NETWORK_MANAGER_CFLAGS = @NETWORK_MANAGER_CFLAGS@ NETWORK_MANAGER_LIBS = @NETWORK_MANAGER_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PYTHON = @PYTHON@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TELEPATHY_CFLAGS = @TELEPATHY_CFLAGS@ TELEPATHY_LIBS = @TELEPATHY_LIBS@ UPOWER_GLIB_CFLAGS = @UPOWER_GLIB_CFLAGS@ UPOWER_GLIB_LIBS = @UPOWER_GLIB_LIBS@ VERSION = @VERSION@ XSLTPROC = @XSLTPROC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gsettingsschemadir = @gsettingsschemadir@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mctestsdir = @mctestsdir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ pluginlibdir = @pluginlibdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AM_CPPFLAGS = \ -I$(top_srcdir) \ $(DBUS_CFLAGS) \ $(LIBFFI_CFLAGS) \ $(GLIB_CFLAGS) \ $(TELEPATHY_CFLAGS) \ $(NULL) LDADD = \ $(LIBFFI_LIBS) \ $(GLIB_LIBS) \ $(DBUS_LIBS) \ $(TELEPATHY_LIBS) \ $(NULL) AM_CFLAGS = $(ERROR_CFLAGS) mc_tool_SOURCES = mc-tool.c mc_wait_for_name_SOURCES = wait-for-name.c dist_man1_MANS = mc-tool.1 man1_MANS = mc-wait-for-name.1 EXTRA_DIST = \ $(man1_MANS:%=%.in) CLEANFILES = $(man1_MANS) all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu util/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu util/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p || test -f $$p1; \ then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list mc-tool$(EXEEXT): $(mc_tool_OBJECTS) $(mc_tool_DEPENDENCIES) $(EXTRA_mc_tool_DEPENDENCIES) @rm -f mc-tool$(EXEEXT) $(AM_V_CCLD)$(LINK) $(mc_tool_OBJECTS) $(mc_tool_LDADD) $(LIBS) mc-wait-for-name$(EXEEXT): $(mc_wait_for_name_OBJECTS) $(mc_wait_for_name_DEPENDENCIES) $(EXTRA_mc_wait_for_name_DEPENDENCIES) @rm -f mc-wait-for-name$(EXEEXT) $(AM_V_CCLD)$(LINK) $(mc_wait_for_name_OBJECTS) $(mc_wait_for_name_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mc-tool.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wait-for-name.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-man1: $(dist_man1_MANS) $(man1_MANS) @$(NORMAL_INSTALL) @list1='$(dist_man1_MANS) $(man1_MANS)'; \ list2=''; \ test -n "$(man1dir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \ { for i in $$list1; do echo "$$i"; done; \ if test -n "$$list2"; then \ for i in $$list2; do echo "$$i"; done \ | sed -n '/\.1[a-z]*$$/p'; \ fi; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \ done; } uninstall-man1: @$(NORMAL_UNINSTALL) @list='$(dist_man1_MANS) $(man1_MANS)'; test -n "$(man1dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir) ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @list='$(MANS)'; if test -n "$$list"; then \ list=`for p in $$list; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \ if test -n "$$list" && \ grep 'ab help2man is required to generate this page' $$list >/dev/null; then \ echo "error: found man pages containing the \`missing help2man' replacement text:" >&2; \ grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/ /' >&2; \ echo " to fix them, install help2man, remove and regenerate the man pages;" >&2; \ echo " typically \`make maintainer-clean' will remove them" >&2; \ exit 1; \ else :; fi; \ else :; fi @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) $(MANS) installdirs: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-man install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-man1 install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-man uninstall-man: uninstall-man1 .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ clean-generic clean-libtool ctags distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-binPROGRAMS install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-man1 install-pdf install-pdf-am install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \ uninstall-am uninstall-binPROGRAMS uninstall-man \ uninstall-man1 mc-wait-for-name.1: mc-wait-for-name.1.in Makefile $(AM_V_GEN)sed -e 's![@]bindir[@]!@bindir@!g' < $< > $@ Android.mk: Makefile.am androgenizer -:PROJECT telepathy_mission_controll \ -:EXECUTABLE mc-tool -:TAGS eng debug \ -:REL_TOP $(top_srcdir) -:ABS_TOP $(abs_top_srcdir) \ -:SOURCES $(mc_tool_SOURCES) \ -:CFLAGS $(DEFS) $(CFLAGS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CFLAGS) \ -:CPPFLAGS $(CPPFLAGS) $(AM_CPPFLAGS) \ -:LDFLAGS $(LDADD) \ > $@ # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: telepathy-mission-control-5.16.4/NEWS0000644000175000017500000015531212762350442020530 0ustar00gkiagiagkiagia00000000000000telepathy-mission-control 5.16.4 (2016-09-02) ============================================= The "get modern" release. Fixes: • exit gracefully at startup if the D-Bus connection fails (Guillaume) • fix some warnings when building with clang (fd.o #94310, Ting-Wei Lan) • fix unit tests to work with GLib >= 2.46 (fd.o #96763, George Kiagiadakis) • mc-wait-for-name now shows readable output on the command line on exotic locales (fd.o #93661, Ting-Wei Lan) • UPower support is now disabled by default if UPower is >= 0.99. The features needed have now moved to logind, which is supported in MC since 5.15.1 (fd.o #70458, George Kiagiadakis) • fix some memory leaks and a potential crash (fd.o #76401, Simon) Dependencies: • GLib 2.46 is now required • NetworkManager support was ported to use libnm instead of the deprecated libnm-glib (fd.o #96707, Diane Trout) telepathy-mission-control 5.16.3 (2014-08-25) ============================================= Fixes: • mcd-connection: use tp_asv_new() properly (fd.o #81751, Steffen Kieß) telepathy-mission-control 5.16.2 (2014-06-11) ============================================= Fixes: • don't crash in 'mc-tool auto-presence' subcommand (fd.o #74187, Simon) • fix parallel build (Simon) • Use G_STRFUNC in mission-control-plugins's DEBUG macro (Guillaume) • Fix a crash when GOA is restarted (fd.o #79827, Guillaume) telepathy-mission-control 5.16.1 (2014-01-27) ============================================= The “/Dux magnus gentis venteris saginati/” release. Fixes: • Release logind sleep/shutdown inhibitor correctly, fixing slow sleep/shutdown (fd.o #73599, Michael Kuhn) • Avoid assertion failure for offline accounts that support power saving (fd.o #72652, John Brooks) • Fix a crash if unable to create XDG_DATA_HOME/telepathy/mission-control (fd.o #72138, Sebastien Bacher) • connectivity-monitor: start watching 'use-conn' key in constructed, fixing the ability to switch it off (Guillaume Desmottes) telepathy-mission-control 5.16.0 (2013-10-02) ============================================= The “all these little strings” release. This is a new stable branch, recommended for use with GNOME 3.10. Fixes since 5.15.1: • If a connection manager that stores avatars on the server is slow to discover whether we have a server-stored avatar, don't overwrite it with an outdated local avatar or lack-of-avatar. This was a regression in 5.15.0. (fd.o #69885, Simon) Here is a summary of significant changes since the previous stable branch, 5.14.x: Dependencies: • GLib 2.32 is required • The regression tests require Python 2.6 • ConnMan connectivity monitoring no longer requires special compilation options or extra libraries at compile time • gnome-keyring support has been removed, use a ServerAuthentication handler instead Enhancements: • When running under GNOME 3 or Unity, MC will attempt to enable connections' power-saving features while the session is idle; this is currently effective for Google Talk XMPP connections • MC now uses GNetworkMonitor to monitor connectivity; NetworkManager integration, which supplements this, is still available • New set_attribute(), set_parameter(), owns() methods for McpAccountStorage plugins • telepathy-spec 0.27.1: emit PropertiesChanged for URISchemes Fixes: • Don't try to reconnect on SoftwareUpgradeRequired or ConnectionRefused • McpAccountStorage::altered-one now works telepathy-mission-control 5.15.1 (2013-09-19) ============================================= The “where can I put giant plastic arthopods?” release. This is a release candidate for Mission Control 5.16. Dependencies: • There is no longer a special configuration option for ConnMan connectivity monitoring. MC now can use any GNetworkMonitor plugin, such as the Linux Netlink plugin provided with GLib, or . • On systems with NetworkManager, basic connectivity monitoring support no longer requires libnm-glib, although compiling with libnm-glib might still mean that disconnection can be detected more quickly. • gnome-keyring support has been removed. Use a ServerAuthentication Handler similar to the ones provided in Empathy or KDE-Telepathy if you don't want passwords to be stored in a file as clear text. Deprecations: • mcp_dispatch_operation_leave_channels() is deprecated. To hang up and close Call channels in a dispatch policy plugin, use tp_call_channel_hangup_async() and mcp_dispatch_operation_close_channels() instead. Enhancements: • Use GIO's GNetworkMonitor plugins to monitor connectivity (fd.o #56635, Simon) • Remove gnome-keyring integration in favour of recommending ServerAuthentication Handlers, which have better UI (fd.o #32578, Simon) • Internal cleanup related to the connectivity code (fd.o #68712, Simon) Fixes: • Don't emit critical warnings if more than one emergency "service point" is provided, and don't leak memory if any are provided (fd.o #55773, Simon) • Advertise Service and Hidden as properties that can be given when creating an account (fd.o #33127, Simon) • Fix a likely crash when upgrading the storage format of accounts, a regression in 5.15.0 (fd.o #69542, Simon) • Fix a crash when an account is disconnected while inspecting the self-contact, a regression in 5.15.0 (fd.o #69542, Simon) • Make the regression tests pass with the parallel test harness used by default in Automake 1.13+ (fd.o #69542, Simon) telepathy-mission-control 5.15.0 (2013-05-03) ============================================= The “any other citizen of the Queen” release. Running this version of Mission Control for the first time will automatically migrate some account data to a new format. If you subsequently downgrade to an older version, it will no longer understand all account data. Taking a backup copy of ~/.local/share/telepathy/mission-control before you upgrade is recommended. Requirements: • GLib 2.32 is now required. • The regression tests now require Python 2.6. Deprecations: • McpAccountStorage::altered, which appears to have never worked, is now deprecated (fd.o #28288). Emit ::altered-one instead. • mcp_account_storage_iface_set_priority() etc. are now deprecated. Use, for instance, "iface->priority = prio" instead. Enhancements: • Account storage plugins (McpAccountStorageIface) may, and should, implement the new set_attribute(), set_parameter() and owns() methods. These methods allow the plugin to know the type of each attribute or parameter, which is presented as a GVariant. (fd.o #54872, Simon) • `mc-tool get AutomaticPresence` now works (fd.o #54780, Simon) • When running under GNOME 3 or Unity, MC will attempt to enable connections' power-saving features while the session is idle; this is currently effective for Google Talk XMPP connections. (fd.o #62530; Xavier, Simon) Fixes: • Update to the current ConnMan D-Bus API (fd.o #56600; Mike Ruprecht, Joshua Lock) • If a stored parameter has a value inappropriate for its type (e.g. require-tls=2 where the connection manager expects require-tls to be boolean), invalidate the account, rather than treating the value as 0, "", [] etc. (fd.o #54870, Simon) • Handle Connection errors better, and in particular, don't try to reconnect on SoftwareUpgradeRequired or ConnectionRefused (fd.o #37844, Emilio Pozuelo Monfort) • Handle errors from RequestConnection correctly, rather than as NetworkError (fd.o #39334, Simon) • If the stored nickname for an account is the same as the normalized name (identifier), don't set it on connect, in case a better nickname is stored on the server (fd.o #39381, Simon) • Emit Properties.PropertiesChanged for URISchemes, as per the upcoming telepathy-spec 0.27.1 (fd.o #40393, Guillaume) • McpAccountStorage::altered-one now works as intended (fd.o #54780, Simon) Internal changes: • Refactor avatar and alias handling (fd.o #55668, Simon) • Refactor account storage (fd.o #54870, #54872; Simon) • Improve regression test coverage for account storage (fd.o #54873, Simon) • Start to remove uses of functions deprecated in telepathy-glib 0.20 (fd.o #55391; Jonny, Simon) telepathy-mission-control 5.14.1 (2013-05-03) ============================================= The “implicit maze” release. Fixes: • Only ignore passwords stored in our old gnome-keyring location if Empathy has actually copied them to its new location, fixing use of a gnome-keyring-enabled MC version with no Empathy or other SASLAuthentication handler (e.g. under Sugar). (fd.o #59468, Simon) • Build successfully with Automake 1.13 (fd.o #59605, Nuno Araujo) • Isolate regression tests better (fd.o #63119, Simon McVittie) • Respect NOCONFIGURE in autogen.sh (fd.o #57165, Cosimo Cecchi) telepathy-mission-control 5.14.0 (2012-10-03) ============================================= The "it helps if the video is intact" release. This starts a new stable branch, recommended for use with GNOME 3.6. Summary of changes since the last stable branch, 5.12: • Remove support for many deprecated interfaces. • If a connection manager announces two or more channels in the same NewChannels signal, behave as if it had announced each channel separately. • Accounts are now stored in the telepathy/mission-control subdirectory of g_get_user_data_dir(). On Unix, this usually means ~/.local/share/telepathy/mission-control, but can be changed with the standard $XDG_DATA_HOME and $XDG_DATA_DIRS environment variables. Accounts data are automatically migrated to this new location when running mission-control for the first time. • ./configure --with-accounts-dir (at build time) and $MC_ACCOUNTS_DIR (at runtime) no longer change where new accounts are stored. They now set what Mission Control considers to be the "old" location for accounts; accounts in that directory will be moved into the new location. Using this option is deprecated. • Various mc-tool improvements. There were no code changes since 5.13.2. telepathy-mission-control 5.13.2 (2012-09-20) ============================================= The "deconstructor ray" release. Running this version of Mission Control for the first time will automatically migrate your account data to a new location. If you subsequently downgrade to an older version, it will no longer find your account data. Taking a backup copy of ~/.mission-control before you upgrade is recommended. Configuration changes: • Accounts are now stored in the telepathy/mission-control subdirectory of g_get_user_data_dir(). On Unix, this usually means ~/.local/share/telepathy/mission-control, but can be changed with the standard $XDG_DATA_HOME and $XDG_DATA_DIRS environment variables. • ./configure --with-accounts-dir (at build time) and $MC_ACCOUNTS_DIR (at runtime) no longer change where new accounts are stored. They now set what Mission Control considers to be the "old" location for accounts; accounts in that directory will be moved into the new location. Using this option is deprecated. Enhancements: • Migrate accounts and avatars from ~/.mission-control to the location described above (fd.o #35896; W. Jon McCann, Jonny, Simon) • More removals of obsolete code and interfaces (fd.o #54633, Simon) Fixes: • Recover from incomplete password migrations caused by upgrading to Empathy 3 while running MC 5.12.1 or older, by deleting the old (MC) copy of the password if Empathy has already copied it (fd.o #42088, Simon) • Omit generated file mcp-signals-marshal.h from tarballs (Simon) telepathy-mission-control 5.13.1 (2012-09-06) ============================================= The "Triceratops" release. Changes: • On Unix platforms, umask() is now required. (Simon) • If a connection manager announces two or more channels in the same NewChannels signal, behave as if it had announced each channel separately. Simplify things that previously had to cope with multiple channels at a time. (fd.o #52305, Simon) • Improve mc-tool: display Account.Storage settings, add Supersedes, add "dump" subcommand (fd.o #53202; Guillaume, Xavier) • More internal reorganisation (fd.o #54151, Simon) Fixes: • Passwords are now deleted from gnome-keyring correctly (fd.o #42088, Simon) • When migrating Butterfly accounts to Haze, do the migration even if Butterfly isn't installed, and copy the password as well as the username (Debian #686835, Simon) • If compiled with UPower support, do not attempt to connect while going to sleep (fd.o #50009, Guillaume) • Set up the altered-one signal for account storage backends correctly (fd.o #52231, Xavier) • If service-activated under both names o.fd.Telepathy.MissionControl5 and o.fd.Telepathy.AccountManager simultaneously, avoid one or both failing to activate due to a race condition (fd.o #53220, Simon) • When built for Android, don't use GSettings (fd.o #53497, Simon) telepathy-mission-control 5.13.0 (2012-07-23) ============================================= Changes: • Remove support for many deprecated interfaces (fd.o #49753, fd.o #24762, fd.o #24899, fd.o #24914, fd.o #49648; Simon): · old-style (mcd_*) plugins, including McdPlugin and McdFilter · an obsolete auto-away mechanism · the non-standard Compat and Query interfaces · tracking group members in McdChannel · Capabilities (the predecessor of ContactCapabilities) · some remnants of ContactCapabilities draft 1 Fixes: • Stop using deprecated telepathy-glib symbols. (Jonny) • fdo#51842 - fix access to freed memory. (Xavier) • fix existing channel dispatching after using present/delegate. (Jonny) • Invalid GValue in libaccounts storage plugin (fd.o#48646, fledermaus) • fdo#52259 - Do not change RequestedPresence when disabling the account, otherwise it won't reconnect when enabling it. • fdo#52231 - Let client decide which storage provider to use when creating an account. telepathy-mission-control 5.12.0 (2012-04-02) ============================================= This is the start of a new stable branch. Changes since 5.11.0: • GLib ≥ 2.30 is now required. • Add mcd_service_stop() and stop the service when SIGINT is sent. (fd.o#47054, Alban) Summary of particularly noteworthy changes since 5.10.x: • GLib ≥ 2.30 and telepathy-glib ≥ 0.17.5 are now required • telepathy-butterfly accounts are migrated to telepathy-haze automatically if Haze is installed. • Mission Control can now be stopped by sending SIGINT to the daemon. telepathy-mission-control 5.11.0 (2012-02-21) ============================================= The "leaning on the fourth wall" release. Requirements: • telepathy-glib 0.17.5 is now required Enhancements: • Migrate telepathy-butterfly accounts to telepathy-haze automatically, if Haze is installed (fd.o #42814, Guillaume) • Improve mc-tool (fd.o #45308, Guillaume/Will) • Add Account.Supersedes (fd.o #42814, Simon) Fixes: • Prefer to destroy arrays with _unref instead of _free (Xavier) • Add support for building on Android (fd.o #42508, Alvaro/Derek) and Windows (Alvaro/Siraj) • Make the NetworkManager integration optional (fd.o #43791, Mikhail) • Don't crash on Get('Parameters') for a CM that isn't installed (fd.o #44939, Will) telepathy-mission-control 5.10.1 (2011-11-08) ============================================= The “Why would i want a debugger? I don't know. Why do you want a face?” release. Fixes: • An unnecessary enum definition, which conflicted with the one provided by Empathy, has been removed from the GSettings schema. (Thanks, ioni.) telepathy-mission-control 5.10.0 (2011-11-07) ============================================= The “Imagine ALL the people!” release. Welcome to a new stable branch of Mission Control. A quick summary of what's changed since 5.8.x: • DelegateChannels and PresentChannel, as used by Gnome Shell 3.2, have been added. • libmcclient has been removed. • MC now optionally uses Network Manager or ConnMan to monitor network connectivity state, and UPower to be notified that the machine is about to suspend. • Lots of crashes and leaks and bugs have been fixed. And, specifically since 5.9.3: • fd.o#41927: It is now possible to install the MC test suite. (albanc) • fd.o#42068: MC now has a GSettings key to force it to believe it is online, even if NM/ConnMan says it is offline. This key is kept in sync with the corresponding GSettings key provided by Empathy by some black magic with aliased DConf paths. (wjt) • http://bugs.debian.org/644589: fix build with UPower but no NM or ConnMan (jonny) • fd.o#42548: Account.ChangingPresence is now more accurate (particularly on disabled accounts). (wjt) telepathy-mission-control 5.9.3 (2011-10-04) ============================================ The “HELLO / YES, THIS IS DOG” release. Dependencies: • MC now has optional dependencies on nm-glib and upower-glib. Enhancements: • Mission Control can now use either Network Manager or ConnMan (or neither; the choice is controlled by a configure flag) to monitor the network connection going up and down, and bring IM accounts on and offline accordingly (whether due to ConnectAutomatically being True, or RequestedConnection being non-offline). (fd.o#38978, wjt) This appears to interact fine with Empathy, which also monitors the network state (using fundamentally the same code); in future, we intend that MC should be the sole party responsible for monitoring network state. • Mission Control now listens for notifications from upower that the machine is about to suspend, and tears down active connections. This should help avoid the user appearing to be online for a few minutes after they suspend their machine, until the server notices that they've gone. (fd.o#28370, wjt) Fixes: • The regression tests now work with D-Bus ≥ 1.5.6. (fd.o#41090, smcv) • An obscure assertion failure in the client bus name monitoring code is fixed, we hope! (fd.o#39767, wjt) • MC no longer crashes when recovering from a client crashing if that client was an Observer or Approver which had claimed the channel. (xclaesse) telepathy-mission-control 5.9.2 (2011-08-31) ============================================ The “unique versioning strategy” release. Changes: • The Compat.Profile property on accounts has been removed; as has libmcclient, which used it but which is no longer widely used. • Documentation for the old extension API, libmissioncontrol-server, is no longer built. Please use the mission-control-plugins API instead! Fixes: • fd.o #37861: Memory leak in collect_satisfied_requests in mcd-dispatch-operation.c (fledermaus). • fd.o #40562: Connection attempts aborted by McdTransport plugins did not trigger a status change signal - now they do (fledermaus) • fd.o #29022: Dispatch channels with no (known) handlers to observers anyway (smcv) • fd.o #40551: Memory leaks in the approval mechanism plugged (fledermaus) • mission-control-plugins now explicitly links to GIO. (Frédéric Péters) • mc-tool now parses 'bool:foo=true' as setting 'foo' to True, as opposed to setting 'foo' to False! (wjt) • fd.o#39796: always fully remove secret parameters when they are un-set. (cassidy) Enhancements: • fd.o#40337: improve error reporting when creating an account fails. (wjt) telepathy-mission-control 5.9.1 (2011-07-21) ============================================ Fixes: • fd.o #34025: when an Observer with Recover=TRUE catches up on channels, don't miss out channels that have run their observers but have not completed dispatching, mainly those waiting for approvers (smcv) • Fix various memory leaks (fledermaus) • If a storage plugin changes our nickname, propagate it to the CM (fledermaus) • The McdTransport framework should have considered "no plugins" to be equivalent to "procced", not "abort" (fledermaus) • Some files were missing G_END_DECLS, which broke C++ includes (fledermaus) telepathy-mission-control 5.9.0 (2011-05-18) ============================================ Dependencies: • telepathy-glib ≥ 0.15 is now required. • glib ≥ 2.28 is now required. Enhancements: • DelegateChannels and PresentChannel from spec version 0.23.2 have been implemented. (cassidy) Fixes: • fd.o#36483: All tests now pass, even with newer tp-glib. (jonny) • Implementation of the draft ChannelDispatcher.Messages interface did not correctly handle all internal requests which should have been dispatched to an existing channel (fledermaus) • The transport plugin infrastructure considered "no connected transports" to be the same as "we have an alternative transport available & ready": This could result in unwanted attempts to bring up the network on platforms which used the transport plugin mechanism (fledermaus) • The Aegis ACL plugin needs to activate inactive handlers if they are not runnng, as you cannot check the aegis credentials of a DBus name alone, a PID or DBus connection is required (fledermaus) Enhancements: • Centralised debug control for MCP plugins via MCP_DEBUG environment variable (and macro + flags so out-of-tree plugins can take advantage of same) (fledermaus) telepathy-mission-control 5.7.11 (2011-05-11) ============================================ The “Then you admit confirming not denying you ever said that?” release. Enhancements: • fd.o #36845: dispatch operation policy plugins can implement handler_is_suitable_async(), to say whether a Handler is acceptable for a particular dispatch operation (fledermaus, smcv) • All members of McpDBusAclIface may be NULL (the name defaults to the GObject class name, and NULL as a check allows everything) (smcv) • The McpDispatchOperationPolicyIface struct is directly visible to plugins, removing the need to call mcp_dispatch_operation_policy_iface_implement_check (smcv) • The implementation vtable of MCP plugin classes is no longer concealed, and maybe assigned to directly by implementations instead of using the _implement methods (wjt, smcv) • More/better documentation for the MCP plugin classes (smcv) Fixes: • If enabled, the Aegis plugin is now statically linked into the MC executable rather than being a loadable module (fledermaus) • Account plugins are no longer added to the cached list repeatedly (smcv) telepathy-mission-control 5.7.10 (2011-05-06) ============================================ The “Save the Alot” release. Enhancements: • Use the new arg0namespace matching to watch only interesting DBus name-owner-changed signals if DBus is new enough to allow this (fledermaus) Fixes: • Setting changes originating in storage backends (eg libaccounts) were not necessarily propagated to CMs if they were not parameters (fledermaus) telepathy-mission-control 5.7.9 (2011-04-05) ============================================ The “From Hell's Heart I Stab at const” release. Fixes: • Build failure due to warning/error promotion (fledermaus) telepathy-mission-control 5.7.8 (2011-04-05) ============================================ The “À la Recherche du Temps Perdu” release. Enhancements: • accounts can be flagged as "channels must always be dispatched" needed for telephony class accounts, but available generally (fledermaus) • Draft ChannelDispatcher.Messages interface implemented allows non-handlers to send messages to contacts (fledermaus) Fixes: • Segfault in the external password storage properties interface (sjoerd) • SSO account deletions explicitly force Account.Removed to be emitted They used to assume object disposal would happen immediately, which did not always happen (fledermaus) • The "Service" value for Maemo SSO accounts could be unset after account creation, a side effect of changes in 5.7.7 (fledermaus) • Memory leak in one of the Maemo DBus ACL plugins (fledermaus) Obsolescence: • Dead interface com.nokia.Account.Interface.Stats dropped (fledermaus) telepathy-mission-control 5.7.7 (2011-03-09) ============================================ The “Bulwer—Lytton Fiction Contest Entry” release. Fixes: • Updates the Maemo SSO plugin in line with SSO changes (fledermaus) telepathy-mission-control 5.7.6 (2011-03-07) ============================================ The “GRINNING CAT FACE WITH SMILING EYES” release. Enhancements: • Support the Observer.DelayApprovers property. (cassidy) telepathy-mission-control 5.7.5 (2011-03-01) ============================================ The “Beware the Ides of March” release. Fixes: • Build failures with new --no-add-needed ld default behaviour (fledermaus) • mc-tool: help no longer mentions obsolete add syntax (wjt) • Tests no longer hang forever if DBus name cannot be claimed (wjt) telepathy-mission-control 5.7.4 (2011-02-23) ============================================ The “Northern winters start to thaw” release. Enhancements: • fd.o#33271: implement ChannelDispatcher.RedispatchChannels() (cassidy) • fd.o#34416: support for Account.I.ExternalPasswordStorage (danni) Fixes: • fd.o#34316: UpdateParameters: bad handling of DBus_Property and Has_Default in Unset argument (wjt) telepathy-mission-control 5.7.3 (2011-02-15) ============================================ The "Future Events Like These Will Affect You in the Future" release. Dependencies: • telepathy-glib ≥ 0.13.13 is now required Enhancements: • The connection now uses Connection.Interface.ServicePoint.KnownServicePoints to determine which contacts correspond to emergency calls. (fledermaus) • Request policy plugins cannot affect emergency calls any more. (fledermaus) • mcd_debug now bypasses printf completely if neither debugging nor the debug cache is turned on. (fledermaus) Fixes: • Leak in the DBus ACL plugin mechanism fixed (barisione) • Potential leak in mcd_master initialisation code fixed (barisione) telepathy-mission-control 5.7.2 (2011-01-18) ============================================ The "Evil Geniuses for a Better Tomorrow" release. Dependencies: • telepathy-glib ≥ 0.13.7 is now required. Enhancements: • The functionality from the draft ChannelDispatcher.Interface.Hints and ChannelRequest.Interface.Hints interfaces is now on the main CD and CR interfaces, since it became stable in telepathy-spec 0.21.5. (cassidy) • fd.o#32979: AccountManager.Interface.Hidden.DRAFT1 (wjt) Changes to unstable API: • Support for the draft MinimumPresence interface has been removed. (wjt) Fixes: • Various bugs in the test suite, some caused by telepathy-glib changes and others which have been lingering for a while, have been fixed. (jonnylamb, wjt) • Certain account properties, such as Nickname, are now more reliably saved to disk when they are updated. (wjt) • The 'commit' virtual method for account storage plugins is once again optional, as documented and as was previously the case. (fd.o#32153, wjt) • libaccounts backend cannot be as eager to flush to disc as the regular keyfile backend as it is shared and excessive locking can interfere with other libaccounts clients (eeejay) telepathy-mission-control 5.7.1 (2010-12-06) ============================================ The "Ack... I've been gritted" release. Enhancements: • mc-tool: Improved error message for nonexistent accounts • Removed obsolete mapping of TP_ERROR_NOT_AVAILABLE to MC_CONTACT_DOES_NOT_SUPPORT_VOICE_ERROR Fixes: • fd.o #24779: CurrentPresence is Offline for online connections not implementing SimplePresence (wjt) telepathy-mission-control 5.7.0 (2010-11-18) ============================================ The "Incursion into Transcarcharid Space" release, starting a new development branch. Enhancements: • fd.o#31467: Account.Interface.Addressing interface (fledermaus, wjt) • fd.o #31263: implement stable Conn.I.PowerSaving, and optionally integrate it with Maemo's MCE service (eeejay) • fd.o #30000: implement draft ChannelDispatcher.I.Hints and ChannelRequest.I.Hints (smcv) Fixes: • fd.o#31678: AccountManager.AccountRemoved signal could be skipped (fledermaus) • fd.o#31680: g_error() on dbus name acquisition_progressition failure was interpreted as a core dump by automated test suites, resulting in a lot of false alarms (fledermaus) telepathy-mission-control 5.6.1 (2010-11-17) ============================================ The "I suppose Guinness is good for you" release. Enhancements: • Make mc-tool support object paths, and improve the help (wjt) Fixes: • fd.o #30447: don't "return x()", where x returns void, in void functions (Jeff Cai) • fd.o #30448: make type of mcp_account_storage_get_restrictions consistent with the header (smcv) • Fix support for libaccounts-glib (fledermaus) • Remove unnecessary use of _POSIX_C_SOURCE (Jeff Cai) telepathy-mission-control 5.6.0 (2010-09-16) ============================================ The "Back in the old days, we didn't have plural" release. Highlights since 5.4.x ---------------------- • MC implements features from telepathy-spec 0.20, including: · channels can be dispatched before a connection is CONNECTED, which is required for telepathy-gabble ≥ 0.9.17 · the Account.ConnectionError property indicating the last error · the Account.ChangingPresence property indicating that presence changes are in progress · the Account.Service property indicating where an account is stored · ChannelDispatchOperation.HandleWithTime to set focus-stealing-prevention timestamps • libmission-control-plugins provides a more stable plugin API for MC. Plugins written with this library can: · observe, delay and influence channel dispatching, much like Observers · observe, delay and/or reject channel requests · store accounts elsewhere • Bugfixes include: · tries harder to invoke the same handler for an already-handled channel · calls ended locally with reason No_Answer are treated as missed · fewer writes to gnome-keyring when committing changes · in-band XMPP account creation works better Fixes since 5.5.4 ----------------- • Fix various build warnings in the tests (Vincent Untz, smcv) • Fix a build warning when keyring support is disabled (fledermaus) • Install a missing header file (fledermaus) telepathy-mission-control 5.5.4 (2010-09-14) ============================================ The "salamander king" release. Enhancements: • fd.o #26699: add support for plugins that delay requests while deciding whether to allow them or not (smcv) • Restructure channel-requesting code (smcv) • Delete the old examples, which are no longer exemplary; use telepathy-glib or telepathy-qt4 instead of libmcclient (smcv) • fd.o #29812: add a trial implementation of the MinimumPresence (draft 2) API (ptlo) • fd.o #30000: add a trial implementation of SucceededWithChannel and {Create,Ensure}ChannelWithHints (cassidy, smcv) Fixes: • fd.o #28915: fix a regression in which parameters that are unset aren't necessarily saved to the configuration file (fledermaus) • Signal remote avatar deletion, for instance by another XMPP resource, in the same way as a remote avatar change (fledermaus) • Cancel the "probation" timer when the connection is released, avoiding a possible crash (fledermaus) • Ignore any partial pre-existing accounts that have no manager or protocol listed, and if a storage plugin creates a totally unusable account, ignore it (fledermaus) • Don't crash if Proceed() is called twice (smcv) • Various fixes for the Maemo SSO plugin (fledermaus, eeejay) • Fix linking with recent ld versions (smcv) telepathy-mission-control 5.5.3 (2010-07-22) ============================================ Dependencies: * telepathy-glib 0.11.9 is now required Enhancements: * Added support for the new Account.Service property in the MC core code and the SSO plugin (fledermaus) * Added support for the Service property to mc-tool (wjt) * Made account storage plugins able to notify MC that a single account has changed externally (fledermaus) * Added support for plugins that check D-Bus calls' callers against an ACL (fledermaus) Fixes: * Treat calls ended locally with No_Answer as missed (wjt) * fd.o #24645: when an existing channel is returned by EnsureChannel and its handler has more than one Handler bus name/object path sharing a unique name, MC now tries harder to invoke the same one as before (smcv) * Disable accounts when they're deleted by an account storage plugin (fledermaus) * Attempt re-connection of failed connections less rapidly (wjt) telepathy-mission-control 5.5.2 (2010-06-16) ============================================ The "513M accounts.cfg, which seems terribly wrong" release. Dependencies: * telepathy-glib 0.11.7 is now required Enhancements: * fd.o #28428: implement the new ConnectionError property from telepathy-spec 0.19.7, and if an Account's Connection-related property changes, put all the related properties in the change notification signal to make it easier to interpret (smcv) Fixes: * fd.o #28557: write account parameters to accounts.cfg correctly, rather than repeatedly escaping backslash, newline, tab etc., which resulted in doubling the number of backslashes with every write. If this has made your accounts.cfg so large that deleting accounts via Empathy is difficult, see https://bugs.freedesktop.org/show_bug.cgi?id=28557 for a workaround. (smcv) * fd.o #28390: drastically reduce writes to gnome-keyring when committing changes to accounts (wjt, smcv) * fd.o #28118: clear the 'register' parameter when an account connects successfully, fixing in-band XMPP account creation (smcv) This version includes the stable-branch bug fixes from 5.4.3. telepathy-mission-control 5.5.1 (2010-06-03) ============================================ The "red head headache" release. Enhancements: * Port mc-tool from libmcclient to telepathy-glib (danni) * Implement McpAccountStorage::toggled so that account plugins can toggle the Enabled property of accounts (danni) * Document mission-control-plugins (smcv) Fixes: * Change names of variables that shadow global functions (danni) telepathy-mission-control 5.5.0 (2010-05-26) ============================================ The "it's yours provided you take it away today" release. Dependencies: * telepathy-glib 0.11.6 is now required * GLib 2.24 is now required * D-Bus 0.95 is now required * dbus-glib 0.82 is now required Enhancements: * MC now has a new, smaller plugin API, libmission-control-plugins, which is expected to have medium- to long-term API/ABI stability. The API mostly mirrors the Telepathy D-Bus API. (smcv/fledermaus) * accounts now support the ChangingPresence property from telepathy-spec 0.19.6 (andrunko) * channel dispatch operations now support the HandleWithTime method from telepathy-spec 0.19.6 (ptlo) * channels can be dispatched before a connection goes CONNECTED, which is needed for SASL authentication channels (eeejay) * compiler warnings are correctly enabled (smcv) Removals: * libmcclient is no longer installed as a separate library unless the old plugin interface is enabled * fd.o #26634: the obsolete utility mc-account-convert, for migration from Mission Control 4, has been removed Fixes: * don't time out channel requests until many hours have passed (sjoerd) * instead of emitting AccountPropertyChanged signals in time-based batches with a small delay, change signals are now grouped into atomic changes (smcv) * fd.o #24876: no longer reimplements a GLib 2.22 method (smcv) * fd.o #25122, Debian #556488: link mc-wait-for-name to GLib correctly (jonny) * fd.o#26597: use TpDebugSender to send debug messages over D-Bus (eeejay) * don't crash mc-tool when the account name is invalid (wjt) * fd.o #27015: remove a misleading reference to GConf (tomeu) * fd.o #27129: update and simplify test/twisted/README (tomeu/smcv) * fd.o #25684: fix detection of accounts that already exist (Jani Monoses/smcv) * in libmcclient, don't crash on malformed profiles where a group is missing (smcv) Maemo-specific enhancements: * added a libaccounts-glib-based account storage backend (fledermaus) telepathy-mission-control 5.4.2 (2010-05-26) ============================================ The "everyone loves magical re-entrancy" release. Fixes: * don't assume that data structures borrowed from a TpConnectionManager remain valid after re-entering the main loop, which can cause a segfault on startup (smcv) * fix a memory leak in Claim() (fledermaus) * fix a failure to check for NULL, and a couple of potential leaks, in mc-tool (fledermaus) telepathy-mission-control 5.4.1 (2010-05-25) ============================================ The "badgers and tigers: only in Cambridge" release. Fixes: * set 0 as UserActionTime when HandleWith is used (cassidy) * make tests pass with more recent telepathy-glib, which can call GetInterfaces twice (cassidy) * don't cache whether we have the Requests interface, which caused one of the tests to regress (smcv) telepathy-mission-control 5.4.0 (2010-04-15) ============================================ The "coffee made without human interaction" release. Enhancements: * fd.o #27309: implement the Observer.Recover flag from the forthcoming telepathy-spec 0.19.4, which lets activatable observers recover (in a best-effort way) after crashing, and lets non-activatable observers catch up on active channels (again in a best-effort way) (ptlo) Fixes: * fd.o #24875: avoid a dependency on GLib >= 2.22 which was accidentally introduced in 5.3.2 (smcv) * Avoid a dependency on dbus-glib 0.80 (Danni) * fd.o #25122, Debian #556488: link mc-wait-for-name to GLib properly (Jonny) * mc-tool: don't crash on invalid account names (wjt) * Only time out channel requests after 5 hours (Sjoerd) * Remove a misleading reference to GConf (Tomeu) * fd.o #27021: fix error propagation when creating accounts with invalid properties/parameters (Tomeu) * Release startup locks even for incomplete accounts, avoiding failure to start (fledermaus) telepathy-mission-control 5.3.2 (2009-11-02) ============================================ The "Flight Of The Living Dead" release. Enhancements: * mc-wait-for-name: give up after 5 minutes and exit EX_TEMPFAIL. Also exit with EX_UNAVAILABLE (instead of 1) if the session bus doesn't work, EX_USAGE (instead of 1) on wrong arguments, and EX_USAGE (instead of g_critical() and never terminating) if the requested bus name is not valid (smcv) * fd.o #23651: strongly prefer the PreferredHandler for a channel request, and try dispatching to it even if its HandlerChannelFilters do not indicate that it could handle the channel, since this is very useful for clients like nautilus-sendto (smcv) * fd.o#24120: refactor McdDispatcher quite extensively: + always have a McdDispatchOperation for each McdDispatcherContext, even if no approval is needed + migrate the dispatching state machine into the dispatch operation + move client logic into McdClientProxy, removing the McdClient struct + migrate Client discovery and the client registry into a new class McdClientRegistry + remove many unused signals + use McdDispatcherContext for the plugin API and nothing else (smcv) * McdHandlerMap: operate in terms of TpChannel, not McdChannel, to make the code less tightly coupled; watch for channels closing and client crashing internally, rather than relying on other modules (smcv) * Run the regression tests with GLib and GObject warnings set to fatal (smcv) Fixes: * fd.o #23687: if all Handlers with BypassApproval fail, notify approvers and wait for approval before trying other Handlers (smcv) * fd.o #24474: notify Observers about channels that were requested without going via MC, e.g. by Empathy 2.28.x (smcv) * fd.o #21003: delay the return from HandleWith until HandleChannels has succeeded or failed, and pass on errors; do not consider HandleWith(H) to be general approval for the channel to be handled with handlers other than H (smcv) * fd.o #24637: don't emit Finished until the channel dispatch operation has really finished (smcv) * Fix a possible use-after-free when noting that a client has gone away (smcv) * Avoid re-dispatching a re-requested channel to a different handler (smcv) * When calling HandleChannels, use the most recent user-action time from among all requests that led to this channel, and all HandleWith() calls for this channel dispatch operation (smcv) * Don't call ReloadConfig() on the dbus-daemon (reopening fd.o#23921), to avoid triggering fd.o#24350 in dbus-daemon and causing service-activations to fail (sjoerd) * mc_account_conditions_call_when_ready: explain why it's OK to ignore the result of mc_iface_call_when_ready_int, which was a Coverity false-positive (smcv) * Consider calls to be potentially-missed if they terminate for reason ERROR, even if we're the actor, because that's what happens in Gabble >= 0.8.4 if the streaming implementation (i.e. telepathy-farsight) discovers that none of the candidates work and calls Error() (smcv) * Fix a race condition in the test account-manager/make-valid.py, which would sometimes incorrectly make it fail (smcv) * Add a regression test for dispatching and requests being delayed while waiting for a plugin to make an asynchronous request for permission (smcv) * Don't leak check_parameters_get_param_cb closure on error (smcv) * In libmcclient, invoke callbacks for GetAll() in the right order (mardy) All fixes from stable release 5.2.6 have been incorporated in this release. telepathy-mission-control 5.3.1 (2009-09-18) ============================================ The "only available in Belgium" release. Dependencies: * Python >= 2.5 is now required for compilation * telepathy-glib >= 0.7.37 is now required Enhancements: * Automatically migrate passwords and other secrets from accounts.cfg into the GNOME keyring (if enabled and available) on MC startup (jonnylamb) Fixes: * Deal with the user's alias in a race-free way by calling GetAliases as well as binding to the AliasesChanged signal (smcv/mardy) * Fix some race conditions in the regression tests (smcv) * Fix mcd_dispatcher_get_channel_type_usage sometimes counting aborted channels, by introducing MCD_CHANNEL_STATUS_ABORTED (mardy) * If we see too many transitions from CONNECTED to DISCONNECTED state (i.e. we get kicked off by the server more than 3 times in 2 minutes), stop reconnecting; also, don't reset the exponential backoff until we've been connected for 2 minutes. This avoids reconnecting in a tight loop if the server lets us connect, then immediately drops our connection. (smcv) * Fix some minor memory leaks (smcv) All fixes from stable releases 5.2.4 and 5.2.5 have been incorporated in this release. telepathy-mission-control 5.3.0 (2009-09-14) ============================================ The "displatcher" release, starting a new development branch. Dependencies: * The GNOME Keyring library is a new optional dependency (only if configured with --enable-gnome-keyring=yes or --enable-gnome-keyring=auto). If it is enabled, having the library at runtime is required, but having the daemon itself is optional - the current plain-text storage will be used for passwords if the keyring daemon is not available. Enhancements: * fd.o#20903: support the final version of ContactCapabilities, from telepathy-spec 0.17.28 (smcv) * fd.o#22231: add optional gnome-keyring integration. This is off by default, but distributions should consider configuring MC with --enable-gnome-keyring to get this functionality. (jonnylamb/smcv) * mc-tool: show full Presence information (sjoerd) * Use the "mcd" G_LOG_DOMAIN (smcv) * fd.o#23501: support TpDebugSender (smcv) * Stop #define'ing g_object_ref, g_object_unref (smcv) * fd.o#22705: support MC_DEBUG=all (smcv) Fixes: * Escape "-" in protocol names in Account names, as required by the Telepathy spec (sjoerd) * fd.o #23818: if HandleChannels fails, try all Handlers in sequence before giving up (smcv) * Refactor client locking in McdDispatcher to be more obviously correct (smcv) * Don't define macros used in glibc feature-test internals, possibly fixing failure to build from source on Debian GNU/kFreeBSD (smcv) * Fix a reference leak when shooting down an unwanted Connection (wjt/smcv) * fd.o#23921: force dbus-daemon to re-detect .service files on MC startup, as a partial workaround for D-Bus bug fd.o#23925 (George Goldberg) * fd.o#23935: call AddRequest if appropriate even on clients that match only channels with Requested=true, and use requested channels' complete properties in preference to the properties that were requested (smcv) * Make signed values in .client files work instead of g_critical'ing (smcv) * This release also includes all bugfixes from stable-branch versions up to and including 5.2.3. telepathy-mission-control 5.2.3 (2009-09-10) ============================================ The "Morden, via Bank" release. Fixes: * fd.o #23807: even if someone without gconf headers makes the tarball, ship the necessary files so people with gconf headers can compile it (smcv) * Resync what's in git with what's in tarball releases: remove some unused source files from git, add more support files to tarballs, and don't distribute any generated source in tarballs (smcv) telepathy-mission-control 5.2.2 (2009-09-07) ============================================ The "St. Pancreas" release. Enhancements: * Better debug output under various circumstances, including outputting the version number on startup (smcv) * Add the concept of always-on accounts, which can't be disabled or otherwise put offline (smcv) * Try to set initial presence before calling Connect (smcv) Fixes: * fd.o #23778: make sure account details (including passwords) are stored in directories readable only by the user. Distributions wanting this fix without any other changes should cherry-pick git commits 16c55625, 2a42ac03, c16f40ec and 3558c3b2 (smcv) * Replace deprecated g_strcasecmp with g_ascii_strcasecmp (Jonh Wendell) * Don't close old-style Tubes channels if they can't be dispatched, since that closes the new-style StreamTube/DBusTube channels that everyone should be using, as a side-effect (smcv) telepathy-mission-control 5.2.1 (2009-08-26) ============================================ The "secret cake" release. Enhancements: * Add change notification in the Compat interface (mardy) * Make the low-memory check overridable by subclasses (smcv) * Complete online requests with error on DISCONNECTED -> DISCONNECTED transition (i.e. cancellation) (mardy) * Set the initial connection status reason to Requested, since None_Specified usually means "generic error" (mardy) Fixes: * fd.o #23509: wait for observers and approvers to finish initial processing before letting Claim() finish (smcv) * Don't allow transition from one transport to another (smcv) * If a transport plugin stops a connection before RequestConnection has even returned, remember that, and disconnect that Connection later when it does turn up (smcv) telepathy-mission-control 5.2.0 (2009-07-30) ============================================ The "too many timeouts, reducing the advertised EDNS UDP packet size to 512 octets" release. This is the first release of a new 5.2.x stable branch, available in git as the 'telepathy-mission-control-5.2' branch. Feature development will continue in the 5.3.x series. Enhancements: * Update ContactCapabilities draft to the version in telepathy-spec 0.17.26 (smcv) * Add regression tests for Capabilities, and for ContactCapabilities draft 1 (smcv) Fixes: * McdConnection: fix a rare crash if no fallbacks for a presence are supported (smcv) * libmcclient: avoid invoking callback twice if the object is already ready (mardy) telepathy-mission-control 5.1.4 (2009-07-09) ============================================ The "I only came here seeking peas" release. Dependencies: * fd.o #22332: GConf is no longer required (if it is not available, then the MC 4 to MC 5 migration tool, mc-account-convert, will not be built) Enhancements: * fd.o #21378: support connection manager parameters whose value is a single byte (smcv) * Add simple man pages for the daemon and utilities (smcv) Fixes: * fd.o #22670: don't assume a client has crashed just because it has lost a well-known name (smcv) * Don't use the AutomaticPresence status from account configuration unless the presence type is an online presence (mardy) * fd.o #22585: remove symbols from libmissioncontrol-server that collide with symbols in libmcclient, allowing the telepathy-mission-control daemon to be statically linked on platforms that don't want to support plugins (smcv) telepathy-mission-control 5.1.3 (2009-07-01) ============================================ The "wilting" release. Enhancements: * Improve test coverage, including EnsureChannel (smcv) * In tests, add the ability to test an installed MC binary (installcheck) (smcv) Fixes: * Make sure that ChannelDispatchOperations emit Finished before they are unreffed for the last time (smcv) * Stop mcd_mission_abort() from implicitly closing channels, meaning that when Close() has an extra protocol-level meaning (for instance, when using an IRC proxy), we don't respond to connection loss by departing from all channels. Instead, explicitly close channels whenever desired (smcv) * Add API for plugins to destroy channels, close channels with a reason, or "forget" (do not dispatch) channels (smcv) * In situations where channels can't be handled, use Destroy() to terminate them, if available (smcv) * In wait-for-name, initialize error properly if we can't connect to D-Bus (smcv) * In tests, restructure `make check-torture` so it doesn't exceed command-line length limits (smcv) * Use g_file_set_contents to overwrite files (mardy) telepathy-mission-control 5.1.2 (2009-06-26) ============================================ The "don't cross the stream engines" release. Dependencies: * telepathy-glib >= 0.7.32 (or 0.7.33 if you want to run the regression tests) Enhancements: * Stop generating duplicate bindings in the daemon for interfaces that are now available in telepathy-glib 0.7.32 Fixes: * Fix a subtle use-after-free that can crash MC if more than 4 distinct properties change in a 10ms interval (!) * Make various fixes to putting accounts online: - ConnectAutomatically takes effect immediately - Fix a race between loading accounts and requesting channels - Never consider accounts to be Valid until they've loaded, meaning that we never try to put an account online before we've loaded its parameters (!) - Don't connect (automatically or by request) unless the account is Valid - Don't connect in order to satisfy a channel request unless the account is both Valid and Enabled - Allow setting RequestedPresence on disabled accounts, fixing creation of accounts that already have a RequestedPresence - Improve regression test coverage considerably - If an account's parameters change and it becomes Valid, consider putting it online - If an account becomes enabled after an online presence was requested, try to put it online * Change the default RequestedPresence on startup from UNSET to OFFLINE * Simplify API for low memory indication * Delete some unnecessary code from McdMaster, and simplify some redundant code * Forbid setting AutomaticPresence to a non-online status * Forbid setting RequestedPresence to a status that can't be set on yourself * Fix a memory leak and some races in the regression tests * Turn the daemon into a convenience library so one of the tests can link it statically even if it's eventually going to be a shared library, fixing make check with --enable-plugins telepathy-mission-control 5.1.1 (2009-06-16) ============================================ The "Beautiful And Damned" release. Fixes: * fd.o #22169: allowed PreferredHandler to be empty when requesting a channel (smcv) * Updated code generation from telepathy-glib and followed the recommendations of telepathy-glib 0.7.6's NEWS, fixing some possible assertion failures (smcv) * Ensured that AccountValidityChanged will be emitted if an account is added in an already-valid state (smcv) * fd.o #21377: added support for 64-bit integers, doubles and object paths as CM parameters, did some work towards supporting bytes as CM parameters, and fixed serialization of large 32-bit unsigned integers and deserialization of integers of large magnitude (smcv) * fd.o #21299: prevented automatic reconnection after Name_In_Use error (smcv) * fd.o #22201: avoided rewriting accounts.cfg if nothing changed (smcv) * Ensured that the transport was reset when a Connection disconnected (mardy) telepathy-mission-control 5.1.0 (2009-06-05) ============================================ The "beta 75 would have been silly" release. After months of development, this is the first numbered release of Mission Control 5. We jumped straight to 5.1 in order to use the Linux-style odd/even versioning seen in the other Telepathy components, so the 5.1.x development branch will lead to the 5.2.x stable branch. Changes since Mission Control 4 are too numerous to list here, but here are the major architectural changes. The proprietary MissionControl API no longer exists; the daemon is a telepathy-spec-compliant AccountManager, and also a telepathy-spec-compliant ChannelDispatcher. Consequences of this include: * Clients are no longer expected to implement the ChannelHandler interface. Instead, they may implement the Observer, Approver and/or Handler interfaces specified in telepathy-spec. * The design of channel dispatching copes better with having multiple user interface components installed. * Accounts' presence, avatar and nickname are now independent (stored per-account), allowing for more precise control by UIs. * Accounts no longer have to belong to a "profile", although they still can (albeit only by using a non-standard extension). Accounts are now stored in a flat file, rather than by abusing GConf. The included mc-account-convert tool might be able to convert MC 4 accounts to the MC 5 format, if you're lucky. libmissioncontrol-server has changed its API and ABI considerably, and is not yet considered stable in its new form either. It is no longer installed by default (in a normal configuration it'll just be compiled into the daemon). libmissioncontrol (based on libtelepathy and also known as libmissioncontrol-client) no longer exists, and has been replaced by libmcclient (based on telepathy-glib). Mission Control 5 is not a drop-in replacement for Mission Control 4, and cannot be used by Mission-Control-4-based applications like Empathy 2.26 and the Maemo 4 platform. However, both versions can be installed independently in the same directory prefix, to facilitate porting from one to the other. Known regressions since Mission Control 4: * There is no gnome-keyring integration yet. * The client and server library APIs are not considered to be stable yet. telepathy-mission-control-5.16.4/README0000644000175000017500000001147712735241312020707 0ustar00gkiagiagkiagia00000000000000=========================== telepathy-mission-control 5 =========================== Telepathy Mission Control 5 is an account manager and channel dispatcher for the Telepathy framework, allowing user interfaces and other clients to share connections to real-time communication services without conflicting. It implements the AccountManager and ChannelDispatcher D-Bus APIs as described by telepathy-spec. The account manager part stores real time communication account details, connects to the stored accounts on request, and sets the accounts' presence, nickname and avatar according to requests from Telepathy user interfaces and other components. The channel dispatcher part responds to incoming communication channels (message streams, voice/video calls, file transfers etc.) by dispatching them to suitable user interfaces, and requests outgoing communication channels according to requests from a Telepathy UI. Telepathy is a D-Bus framework for unifying real time communication, including instant messaging, voice calls and video calls. It abstracts differences between protocols to provide a unified interface for applications. Requirements ============ Building Mission Control requires: GLib, GObject libdbus The D-Bus GLib bindings telepathy-glib GNU make pkg-config libxslt, xsltproc Python and can also make use of: gtkdoc See configure.ac for full details, including versions required. Of the packages listed above, only GLib, GObject, libdbus, dbus-glib and telepathy-glib are required at runtime. Building from git also requires the GNU build system (Autoconf, Automake, libtool). Bugs, feature requests and to-do list ===================================== Report all bugs, feature requests and "to-do" items here: D-Bus API stability =================== Interfaces described as stable in the Telepathy Specification are considered stable and will not generally have incompatible changes. All other interfaces (including draft interfaces and Nokia-specific extensions) are subject to change. C API stability =============== The mission-control-plugins library introduced in Mission Control 5.5.0 contains a C API for plugins. All plugins should be compiled and linked against this library by using the CFLAGS and LIBS from mission-control-plugins.pc, and installed in the directory given by this pkg-config query: pkg-config --variable=plugindir mission-control-plugins Incompatible changes in this library's public API/ABI will be avoided whenever possible. The API and ABI versions can be retrieved with these pkg-config queries: pkg-config --variable=MCP_API_VERSION mission-control-plugins pkg-config --variable=MCP_ABI_VERSION mission-control-plugins The older libmcclient and libmissioncontrol-server have no API or ABI guarantees, and should not generally be used at all. Since version 5.5.0, their headers are not installed by default. Versioning ========== Mission Control follows the same Linux-style odd/even minor versioning policy as most other Telepathy components: for instance, the 5.1.x series were development releases leading to the 5.2.x stable branch. Intermediate versions built from the git repository have a "+" suffix on the version number, so version "5.1.0+" could be any snapshot taken between 5.1.0 and 5.1.1. Contact info ============ Mission Control was originally written by Nokia Corporation for the Maemo platform, but it is now maintained by the Telepathy project: Hacking ======= The current development version of MC is available from the 'master' branch in the git repository: (gitweb) Stable branches will be made available from branches with names like 'telepathy-mission-control-5.2' in the same repository. Contributions for review should be attached to bugs in freedesktop.org Bugzilla, with the "patch" tag. If there's no relevant bug, open one: MC does not yet follow . Please follow the style used in the current code. telepathy-mission-control-5.16.4/INSTALL0000644000175000017500000003660012762351620021057 0ustar00gkiagiagkiagia00000000000000Installation Instructions ************************* Copyright (C) 1994-1996, 1999-2002, 2004-2011 Free Software Foundation, Inc. Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. This file is offered as-is, without warranty of any kind. Basic Installation ================== Briefly, the shell commands `./configure; make; make install' should configure, build, and install this package. The following more-detailed instructions are generic; see the `README' file for instructions specific to this package. Some packages provide this `INSTALL' file but do not implement all of the features documented below. The lack of an optional feature in a given package is not necessarily a bug. More recommendations for GNU packages can be found in *note Makefile Conventions: (standards)Makefile Conventions. The `configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses those values to create a `Makefile' in each directory of the package. It may also create one or more `.h' files containing system-dependent definitions. Finally, it creates a shell script `config.status' that you can run in the future to recreate the current configuration, and a file `config.log' containing compiler output (useful mainly for debugging `configure'). It can also use an optional file (typically called `config.cache' and enabled with `--cache-file=config.cache' or simply `-C') that saves the results of its tests to speed up reconfiguring. Caching is disabled by default to prevent problems with accidental use of stale cache files. If you need to do unusual things to compile the package, please try to figure out how `configure' could check whether to do them, and mail diffs or instructions to the address given in the `README' so they can be considered for the next release. If you are using the cache, and at some point `config.cache' contains results you don't want to keep, you may remove or edit it. The file `configure.ac' (or `configure.in') is used to create `configure' by a program called `autoconf'. You need `configure.ac' if you want to change it or regenerate `configure' using a newer version of `autoconf'. The simplest way to compile this package is: 1. `cd' to the directory containing the package's source code and type `./configure' to configure the package for your system. Running `configure' might take a while. While running, it prints some messages telling which features it is checking for. 2. Type `make' to compile the package. 3. Optionally, type `make check' to run any self-tests that come with the package, generally using the just-built uninstalled binaries. 4. Type `make install' to install the programs and any data files and documentation. When installing into a prefix owned by root, it is recommended that the package be configured and built as a regular user, and only the `make install' phase executed with root privileges. 5. Optionally, type `make installcheck' to repeat any self-tests, but this time using the binaries in their final installed location. This target does not install anything. Running this target as a regular user, particularly if the prior `make install' required root privileges, verifies that the installation completed correctly. 6. You can remove the program binaries and object files from the source code directory by typing `make clean'. To also remove the files that `configure' created (so you can compile the package for a different kind of computer), type `make distclean'. There is also a `make maintainer-clean' target, but that is intended mainly for the package's developers. If you use it, you may have to get all sorts of other programs in order to regenerate files that came with the distribution. 7. Often, you can also type `make uninstall' to remove the installed files again. In practice, not all packages have tested that uninstallation works correctly, even though it is required by the GNU Coding Standards. 8. Some packages, particularly those that use Automake, provide `make distcheck', which can by used by developers to test that all other targets like `make install' and `make uninstall' work correctly. This target is generally not run by end users. Compilers and Options ===================== Some systems require unusual options for compilation or linking that the `configure' script does not know about. Run `./configure --help' for details on some of the pertinent environment variables. You can give `configure' initial values for configuration parameters by setting variables in the command line or in the environment. Here is an example: ./configure CC=c99 CFLAGS=-g LIBS=-lposix *Note Defining Variables::, for more details. Compiling For Multiple Architectures ==================================== You can compile the package for more than one kind of computer at the same time, by placing the object files for each architecture in their own directory. To do this, you can use GNU `make'. `cd' to the directory where you want the object files and executables to go and run the `configure' script. `configure' automatically checks for the source code in the directory that `configure' is in and in `..'. This is known as a "VPATH" build. With a non-GNU `make', it is safer to compile the package for one architecture at a time in the source code directory. After you have installed the package for one architecture, use `make distclean' before reconfiguring for another architecture. On MacOS X 10.5 and later systems, you can create libraries and executables that work on multiple system types--known as "fat" or "universal" binaries--by specifying multiple `-arch' options to the compiler but only a single `-arch' option to the preprocessor. Like this: ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ CPP="gcc -E" CXXCPP="g++ -E" This is not guaranteed to produce working output in all cases, you may have to build one architecture at a time and combine the results using the `lipo' tool if you have problems. Installation Names ================== By default, `make install' installs the package's commands under `/usr/local/bin', include files under `/usr/local/include', etc. You can specify an installation prefix other than `/usr/local' by giving `configure' the option `--prefix=PREFIX', where PREFIX must be an absolute file name. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you pass the option `--exec-prefix=PREFIX' to `configure', the package uses PREFIX as the prefix for installing programs and libraries. Documentation and other data files still use the regular prefix. In addition, if you use an unusual directory layout you can give options like `--bindir=DIR' to specify different values for particular kinds of files. Run `configure --help' for a list of the directories you can set and what kinds of files go in them. In general, the default for these options is expressed in terms of `${prefix}', so that specifying just `--prefix' will affect all of the other directory specifications that were not explicitly provided. The most portable way to affect installation locations is to pass the correct locations to `configure'; however, many packages provide one or both of the following shortcuts of passing variable assignments to the `make install' command line to change installation locations without having to reconfigure or recompile. The first method involves providing an override variable for each affected directory. For example, `make install prefix=/alternate/directory' will choose an alternate location for all directory configuration variables that were expressed in terms of `${prefix}'. Any directories that were specified during `configure', but not in terms of `${prefix}', must each be overridden at install time for the entire installation to be relocated. The approach of makefile variable overrides for each directory variable is required by the GNU Coding Standards, and ideally causes no recompilation. However, some platforms have known limitations with the semantics of shared libraries that end up requiring recompilation when using this method, particularly noticeable in packages that use GNU Libtool. The second method involves providing the `DESTDIR' variable. For example, `make install DESTDIR=/alternate/directory' will prepend `/alternate/directory' before all installation names. The approach of `DESTDIR' overrides is not required by the GNU Coding Standards, and does not work on platforms that have drive letters. On the other hand, it does better at avoiding recompilation issues, and works well even when some directory options were not specified in terms of `${prefix}' at `configure' time. Optional Features ================= If the package supports it, you can cause programs to be installed with an extra prefix or suffix on their names by giving `configure' the option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. Some packages pay attention to `--enable-FEATURE' options to `configure', where FEATURE indicates an optional part of the package. They may also pay attention to `--with-PACKAGE' options, where PACKAGE is something like `gnu-as' or `x' (for the X Window System). The `README' should mention any `--enable-' and `--with-' options that the package recognizes. For packages that use the X Window System, `configure' can usually find the X include and library files automatically, but if it doesn't, you can use the `configure' options `--x-includes=DIR' and `--x-libraries=DIR' to specify their locations. Some packages offer the ability to configure how verbose the execution of `make' will be. For these packages, running `./configure --enable-silent-rules' sets the default to minimal output, which can be overridden with `make V=1'; while running `./configure --disable-silent-rules' sets the default to verbose, which can be overridden with `make V=0'. Particular systems ================== On HP-UX, the default C compiler is not ANSI C compatible. If GNU CC is not installed, it is recommended to use the following options in order to use an ANSI C compiler: ./configure CC="cc -Ae -D_XOPEN_SOURCE=500" and if that doesn't work, install pre-built binaries of GCC for HP-UX. HP-UX `make' updates targets which have the same time stamps as their prerequisites, which makes it generally unusable when shipped generated files such as `configure' are involved. Use GNU `make' instead. On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot parse its `' header file. The option `-nodtk' can be used as a workaround. If GNU CC is not installed, it is therefore recommended to try ./configure CC="cc" and if that doesn't work, try ./configure CC="cc -nodtk" On Solaris, don't put `/usr/ucb' early in your `PATH'. This directory contains several dysfunctional programs; working variants of these programs are available in `/usr/bin'. So, if you need `/usr/ucb' in your `PATH', put it _after_ `/usr/bin'. On Haiku, software installed for all users goes in `/boot/common', not `/usr/local'. It is recommended to use the following options: ./configure --prefix=/boot/common Specifying the System Type ========================== There may be some features `configure' cannot figure out automatically, but needs to determine by the type of machine the package will run on. Usually, assuming the package is built to be run on the _same_ architectures, `configure' can figure that out, but if it prints a message saying it cannot guess the machine type, give it the `--build=TYPE' option. TYPE can either be a short name for the system type, such as `sun4', or a canonical name which has the form: CPU-COMPANY-SYSTEM where SYSTEM can have one of these forms: OS KERNEL-OS See the file `config.sub' for the possible values of each field. If `config.sub' isn't included in this package, then this package doesn't need to know the machine type. If you are _building_ compiler tools for cross-compiling, you should use the option `--target=TYPE' to select the type of system they will produce code for. If you want to _use_ a cross compiler, that generates code for a platform different from the build platform, you should specify the "host" platform (i.e., that on which the generated programs will eventually be run) with `--host=TYPE'. Sharing Defaults ================ If you want to set default values for `configure' scripts to share, you can create a site shell script called `config.site' that gives default values for variables like `CC', `cache_file', and `prefix'. `configure' looks for `PREFIX/share/config.site' if it exists, then `PREFIX/etc/config.site' if it exists. Or, you can set the `CONFIG_SITE' environment variable to the location of the site script. A warning: not all `configure' scripts look for a site script. Defining Variables ================== Variables not defined in a site shell script can be set in the environment passed to `configure'. However, some packages may run configure again during the build, and the customized values of these variables may be lost. In order to avoid this problem, you should set them in the `configure' command line, using `VAR=value'. For example: ./configure CC=/usr/local2/bin/gcc causes the specified `gcc' to be used as the C compiler (unless it is overridden in the site shell script). Unfortunately, this technique does not work for `CONFIG_SHELL' due to an Autoconf bug. Until the bug is fixed you can use this workaround: CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash `configure' Invocation ====================== `configure' recognizes the following options to control how it operates. `--help' `-h' Print a summary of all of the options to `configure', and exit. `--help=short' `--help=recursive' Print a summary of the options unique to this package's `configure', and exit. The `short' variant lists options used only in the top level, while the `recursive' variant lists options also present in any nested packages. `--version' `-V' Print the version of Autoconf used to generate the `configure' script, and exit. `--cache-file=FILE' Enable the cache: use and save the results of the tests in FILE, traditionally `config.cache'. FILE defaults to `/dev/null' to disable caching. `--config-cache' `-C' Alias for `--cache-file=config.cache'. `--quiet' `--silent' `-q' Do not print messages saying which checks are being made. To suppress all normal output, redirect it to `/dev/null' (any error messages will still be shown). `--srcdir=DIR' Look for the package's source code in directory DIR. Usually `configure' can determine that directory automatically. `--prefix=DIR' Use DIR as the installation prefix. *note Installation Names:: for more details, including other options available for fine-tuning the installation locations. `--no-create' `-n' Run the configure checks, but stop before creating any output files. `configure' also accepts some other, not widely useful, options. Run `configure --help' for more details. telepathy-mission-control-5.16.4/Makefile.am0000644000175000017500000000161312735242352022057 0ustar00gkiagiagkiagia00000000000000ACLOCAL_AMFLAGS = -I m4 CHECK_FOR_UNRELEASED := \ $(srcdir)/NEWS \ $(wildcard $(srcdir)/src/*.[ch]) \ $(wildcard $(mission-control-plugins)/*.[ch]) \ $(NULL) SUBDIRS = \ data \ m4 \ tools \ xml \ mission-control-plugins \ plugins \ src \ server \ util \ tests \ doc pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = mission-control-plugins.pc DISTCHECK_CONFIGURE_FLAGS = \ --enable-gtk-doc \ --disable-gnome-keyring \ $(NULL) maintainer-upload-release: _maintainer-upload-release-local _maintainer-upload-release-local: _maintainer-upload-release-check rsync -rvzPp --chmod=Dg+s,ug+rwX,o=rX doc/reference/mission-control-plugins/html/ \ telepathy.freedesktop.org:/srv/telepathy.freedesktop.org/www/doc/mission-control-plugins-5.16.x/ include tools/lcov.am include tools/telepathy.am CHANGELOG_RANGE=telepathy-mission-control-5.4.0.. telepathy-mission-control-5.16.4/gtk-doc.make0000644000175000017500000002351412757606714022230 0ustar00gkiagiagkiagia00000000000000# -*- mode: makefile -*- #################################### # Everything below here is generic # #################################### if GTK_DOC_USE_LIBTOOL GTKDOC_CC = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(INCLUDES) $(GTKDOC_DEPS_CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) GTKDOC_LD = $(LIBTOOL) --tag=CC --mode=link $(CC) $(GTKDOC_DEPS_LIBS) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) GTKDOC_RUN = $(LIBTOOL) --mode=execute else GTKDOC_CC = $(CC) $(INCLUDES) $(GTKDOC_DEPS_CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) GTKDOC_LD = $(CC) $(GTKDOC_DEPS_LIBS) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) GTKDOC_RUN = endif # We set GPATH here; this gives us semantics for GNU make # which are more like other make's VPATH, when it comes to # whether a source that is a target of one rule is then # searched for in VPATH/GPATH. # GPATH = $(srcdir) TARGET_DIR=$(HTML_DIR)/$(DOC_MODULE) SETUP_FILES = \ $(content_files) \ $(expand_content_files) \ $(DOC_MAIN_SGML_FILE) \ $(DOC_MODULE)-sections.txt \ $(DOC_MODULE)-overrides.txt EXTRA_DIST = \ $(HTML_IMAGES) \ $(SETUP_FILES) DOC_STAMPS=setup-build.stamp scan-build.stamp sgml-build.stamp \ html-build.stamp pdf-build.stamp \ sgml.stamp html.stamp pdf.stamp SCANOBJ_FILES = \ $(DOC_MODULE).args \ $(DOC_MODULE).hierarchy \ $(DOC_MODULE).interfaces \ $(DOC_MODULE).prerequisites \ $(DOC_MODULE).signals REPORT_FILES = \ $(DOC_MODULE)-undocumented.txt \ $(DOC_MODULE)-undeclared.txt \ $(DOC_MODULE)-unused.txt gtkdoc-check.test: Makefile $(AM_V_GEN)echo "#!/bin/sh -e" > $@; \ echo "$(GTKDOC_CHECK_PATH) || exit 1" >> $@; \ chmod +x $@ CLEANFILES = $(SCANOBJ_FILES) $(REPORT_FILES) $(DOC_STAMPS) gtkdoc-check.test if GTK_DOC_BUILD_HTML HTML_BUILD_STAMP=html-build.stamp else HTML_BUILD_STAMP= endif if GTK_DOC_BUILD_PDF PDF_BUILD_STAMP=pdf-build.stamp else PDF_BUILD_STAMP= endif all-gtk-doc: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP) .PHONY: all-gtk-doc if ENABLE_GTK_DOC all-local: all-gtk-doc endif docs: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP) $(REPORT_FILES): sgml-build.stamp #### setup #### GTK_DOC_V_SETUP=$(GTK_DOC_V_SETUP_$(V)) GTK_DOC_V_SETUP_=$(GTK_DOC_V_SETUP_$(AM_DEFAULT_VERBOSITY)) GTK_DOC_V_SETUP_0=@echo " DOC Preparing build"; setup-build.stamp: -$(GTK_DOC_V_SETUP)if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \ files=`echo $(SETUP_FILES) $(DOC_MODULE).types`; \ if test "x$$files" != "x" ; then \ for file in $$files ; do \ destdir=`dirname $(abs_builddir)/$$file`; \ test -d "$$destdir" || mkdir -p "$$destdir"; \ test -f $(abs_srcdir)/$$file && \ cp -pf $(abs_srcdir)/$$file $(abs_builddir)/$$file || true; \ done; \ fi; \ fi $(AM_V_at)touch setup-build.stamp #### scan #### GTK_DOC_V_SCAN=$(GTK_DOC_V_SCAN_$(V)) GTK_DOC_V_SCAN_=$(GTK_DOC_V_SCAN_$(AM_DEFAULT_VERBOSITY)) GTK_DOC_V_SCAN_0=@echo " DOC Scanning header files"; GTK_DOC_V_INTROSPECT=$(GTK_DOC_V_INTROSPECT_$(V)) GTK_DOC_V_INTROSPECT_=$(GTK_DOC_V_INTROSPECT_$(AM_DEFAULT_VERBOSITY)) GTK_DOC_V_INTROSPECT_0=@echo " DOC Introspecting gobjects"; scan-build.stamp: setup-build.stamp $(HFILE_GLOB) $(CFILE_GLOB) $(GTK_DOC_V_SCAN)_source_dir='' ; \ for i in $(DOC_SOURCE_DIR) ; do \ _source_dir="$${_source_dir} --source-dir=$$i" ; \ done ; \ gtkdoc-scan --module=$(DOC_MODULE) --ignore-headers="$(IGNORE_HFILES)" $${_source_dir} $(SCAN_OPTIONS) $(EXTRA_HFILES) $(GTK_DOC_V_INTROSPECT)if grep -l '^..*$$' $(DOC_MODULE).types > /dev/null 2>&1 ; then \ scanobj_options=""; \ gtkdoc-scangobj 2>&1 --help | grep >/dev/null "\-\-verbose"; \ if test "$$?" = "0"; then \ if test "x$(V)" = "x1"; then \ scanobj_options="--verbose"; \ fi; \ fi; \ CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" RUN="$(GTKDOC_RUN)" CFLAGS="$(GTKDOC_CFLAGS) $(CFLAGS)" LDFLAGS="$(GTKDOC_LIBS) $(LDFLAGS)" \ gtkdoc-scangobj $(SCANGOBJ_OPTIONS) $$scanobj_options --module=$(DOC_MODULE); \ else \ for i in $(SCANOBJ_FILES) ; do \ test -f $$i || touch $$i ; \ done \ fi $(AM_V_at)touch scan-build.stamp $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt: scan-build.stamp @true #### xml #### GTK_DOC_V_XML=$(GTK_DOC_V_XML_$(V)) GTK_DOC_V_XML_=$(GTK_DOC_V_XML_$(AM_DEFAULT_VERBOSITY)) GTK_DOC_V_XML_0=@echo " DOC Building XML"; sgml-build.stamp: setup-build.stamp $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(HFILE_GLOB) $(CFILE_GLOB) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt $(expand_content_files) xml/gtkdocentities.ent $(GTK_DOC_V_XML)_source_dir='' ; \ for i in $(DOC_SOURCE_DIR) ; do \ _source_dir="$${_source_dir} --source-dir=$$i" ; \ done ; \ gtkdoc-mkdb --module=$(DOC_MODULE) --output-format=xml --expand-content-files="$(expand_content_files)" --main-sgml-file=$(DOC_MAIN_SGML_FILE) $${_source_dir} $(MKDB_OPTIONS) $(AM_V_at)touch sgml-build.stamp sgml.stamp: sgml-build.stamp @true xml/gtkdocentities.ent: Makefile $(GTK_DOC_V_XML)$(MKDIR_P) $(@D) && ( \ echo ""; \ echo ""; \ echo ""; \ echo ""; \ echo ""; \ echo ""; \ echo ""; \ ) > $@ #### html #### GTK_DOC_V_HTML=$(GTK_DOC_V_HTML_$(V)) GTK_DOC_V_HTML_=$(GTK_DOC_V_HTML_$(AM_DEFAULT_VERBOSITY)) GTK_DOC_V_HTML_0=@echo " DOC Building HTML"; GTK_DOC_V_XREF=$(GTK_DOC_V_XREF_$(V)) GTK_DOC_V_XREF_=$(GTK_DOC_V_XREF_$(AM_DEFAULT_VERBOSITY)) GTK_DOC_V_XREF_0=@echo " DOC Fixing cross-references"; html-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files) $(expand_content_files) $(GTK_DOC_V_HTML)rm -rf html && mkdir html && \ mkhtml_options=""; \ gtkdoc-mkhtml 2>&1 --help | grep >/dev/null "\-\-verbose"; \ if test "$$?" = "0"; then \ if test "x$(V)" = "x1"; then \ mkhtml_options="$$mkhtml_options --verbose"; \ fi; \ fi; \ gtkdoc-mkhtml 2>&1 --help | grep >/dev/null "\-\-path"; \ if test "$$?" = "0"; then \ mkhtml_options="$$mkhtml_options --path=\"$(abs_srcdir)\""; \ fi; \ cd html && gtkdoc-mkhtml $$mkhtml_options $(MKHTML_OPTIONS) $(DOC_MODULE) ../$(DOC_MAIN_SGML_FILE) -@test "x$(HTML_IMAGES)" = "x" || \ for file in $(HTML_IMAGES) ; do \ if test -f $(abs_srcdir)/$$file ; then \ cp $(abs_srcdir)/$$file $(abs_builddir)/html; \ fi; \ if test -f $(abs_builddir)/$$file ; then \ cp $(abs_builddir)/$$file $(abs_builddir)/html; \ fi; \ done; $(GTK_DOC_V_XREF)gtkdoc-fixxref --module=$(DOC_MODULE) --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS) $(AM_V_at)touch html-build.stamp #### pdf #### GTK_DOC_V_PDF=$(GTK_DOC_V_PDF_$(V)) GTK_DOC_V_PDF_=$(GTK_DOC_V_PDF_$(AM_DEFAULT_VERBOSITY)) GTK_DOC_V_PDF_0=@echo " DOC Building PDF"; pdf-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files) $(expand_content_files) $(GTK_DOC_V_PDF)rm -f $(DOC_MODULE).pdf && \ mkpdf_options=""; \ gtkdoc-mkpdf 2>&1 --help | grep >/dev/null "\-\-verbose"; \ if test "$$?" = "0"; then \ if test "x$(V)" = "x1"; then \ mkpdf_options="$$mkpdf_options --verbose"; \ fi; \ fi; \ if test "x$(HTML_IMAGES)" != "x"; then \ for img in $(HTML_IMAGES); do \ part=`dirname $$img`; \ echo $$mkpdf_options | grep >/dev/null "\-\-imgdir=$$part "; \ if test $$? != 0; then \ mkpdf_options="$$mkpdf_options --imgdir=$$part"; \ fi; \ done; \ fi; \ gtkdoc-mkpdf --path="$(abs_srcdir)" $$mkpdf_options $(DOC_MODULE) $(DOC_MAIN_SGML_FILE) $(MKPDF_OPTIONS) $(AM_V_at)touch pdf-build.stamp ############## clean-local: @rm -f *~ *.bak @rm -rf .libs @if echo $(SCAN_OPTIONS) | grep -q "\-\-rebuild-types" ; then \ rm -f $(DOC_MODULE).types; \ fi @if echo $(SCAN_OPTIONS) | grep -q "\-\-rebuild-sections" ; then \ rm -f $(DOC_MODULE)-sections.txt; \ fi distclean-local: @rm -rf xml html $(REPORT_FILES) $(DOC_MODULE).pdf \ $(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt @if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \ rm -f $(SETUP_FILES) $(DOC_MODULE).types; \ fi maintainer-clean-local: @rm -rf xml html install-data-local: @installfiles=`echo $(builddir)/html/*`; \ if test "$$installfiles" = '$(builddir)/html/*'; \ then echo 1>&2 'Nothing to install' ; \ else \ if test -n "$(DOC_MODULE_VERSION)"; then \ installdir="$(DESTDIR)$(TARGET_DIR)-$(DOC_MODULE_VERSION)"; \ else \ installdir="$(DESTDIR)$(TARGET_DIR)"; \ fi; \ $(mkinstalldirs) $${installdir} ; \ for i in $$installfiles; do \ echo ' $(INSTALL_DATA) '$$i ; \ $(INSTALL_DATA) $$i $${installdir}; \ done; \ if test -n "$(DOC_MODULE_VERSION)"; then \ mv -f $${installdir}/$(DOC_MODULE).devhelp2 \ $${installdir}/$(DOC_MODULE)-$(DOC_MODULE_VERSION).devhelp2; \ fi; \ $(GTKDOC_REBASE) --relative --dest-dir=$(DESTDIR) --html-dir=$${installdir}; \ fi uninstall-local: @if test -n "$(DOC_MODULE_VERSION)"; then \ installdir="$(DESTDIR)$(TARGET_DIR)-$(DOC_MODULE_VERSION)"; \ else \ installdir="$(DESTDIR)$(TARGET_DIR)"; \ fi; \ rm -rf $${installdir} # # Require gtk-doc when making dist # if HAVE_GTK_DOC dist-check-gtkdoc: docs else dist-check-gtkdoc: @echo "*** gtk-doc is needed to run 'make dist'. ***" @echo "*** gtk-doc was not found when 'configure' ran. ***" @echo "*** please install gtk-doc and rerun 'configure'. ***" @false endif dist-hook: dist-check-gtkdoc all-gtk-doc dist-hook-local @mkdir $(distdir)/html @cp ./html/* $(distdir)/html @-cp ./$(DOC_MODULE).pdf $(distdir)/ @-cp ./$(DOC_MODULE).types $(distdir)/ @-cp ./$(DOC_MODULE)-sections.txt $(distdir)/ @cd $(distdir) && rm -f $(DISTCLEANFILES) @$(GTKDOC_REBASE) --online --relative --html-dir=$(distdir)/html .PHONY : dist-hook-local docs telepathy-mission-control-5.16.4/mission-control-plugins-uninstalled.pc.in0000644000175000017500000000112312735241312030101 0ustar00gkiagiagkiagia00000000000000prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ libexecdir=@libexecdir@ includedir=@includedir@ MCP_API_VERSION=@MCP_API_VERSION@ MCP_ABI_VERSION=@MCP_ABI_VERSION@ plugindir=${libdir}/mission-control-plugins.@MCP_ABI_VERSION@ missioncontrolpath=${libexecdir}/mission-control-5 abs_top_srcdir=@abs_top_srcdir@ abs_top_builddir=@abs_top_builddir@ Name: mission-control-plugins (uninstalled) Description: Mission Control plugin API, Not Installed Requires: telepathy-glib Version: @VERSION@ Libs: ${pc_top_builddir}/${pcfiledir}/libmission-control-plugins.la Cflags: -I${abs_top_srcdir} telepathy-mission-control-5.16.4/Makefile.in0000644000175000017500000010107012762351620022065 0ustar00gkiagiagkiagia00000000000000# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__make_dryrun = \ { \ am__dry=no; \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ *) \ for am__flg in $$MAKEFLAGS; do \ case $$am__flg in \ *=*|--*) ;; \ *n*) am__dry=yes; break;; \ esac; \ done;; \ esac; \ test $$am__dry = yes; \ } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(srcdir)/config.h.in \ $(srcdir)/mission-control-plugins-uninstalled.pc.in \ $(srcdir)/mission-control-plugins.pc.in \ $(srcdir)/tools/lcov.am $(srcdir)/tools/telepathy.am \ $(top_srcdir)/configure AUTHORS COPYING ChangeLog INSTALL NEWS \ build-aux/config.guess build-aux/config.sub build-aux/depcomp \ build-aux/install-sh build-aux/ltmain.sh build-aux/missing subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/gtk-doc.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/tp-compiler-flag.m4 \ $(top_srcdir)/m4/tp-compiler-warnings.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = mission-control-plugins.pc \ mission-control-plugins-uninstalled.pc CONFIG_CLEAN_VPATH_FILES = AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(pkgconfigdir)" DATA = $(pkgconfig_DATA) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir dist dist-all distcheck ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ if test -d "$(distdir)"; then \ find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -rf "$(distdir)" \ || { sleep 5 && rm -rf "$(distdir)"; }; \ else :; fi am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best distuninstallcheck_listfiles = find . -type f -print am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' distcleancheck_listfiles = find . -type f -print ACCOUNTS_CACHE_DIR = @ACCOUNTS_CACHE_DIR@ ACCOUNTS_DIR = @ACCOUNTS_DIR@ ACLOCAL = @ACLOCAL@ AEGIS_LIBS = @AEGIS_LIBS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DBUS_CFLAGS = @DBUS_CFLAGS@ DBUS_LIBS = @DBUS_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ERROR_CFLAGS = @ERROR_CFLAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GIO_UNIX_CFLAGS = @GIO_UNIX_CFLAGS@ GIO_UNIX_LIBS = @GIO_UNIX_LIBS@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_COMPILE_SCHEMAS = @GLIB_COMPILE_SCHEMAS@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ GLIB_MKENUMS = @GLIB_MKENUMS@ GREP = @GREP@ GSETTINGS_DISABLE_SCHEMAS_COMPILE = @GSETTINGS_DISABLE_SCHEMAS_COMPILE@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ HTML_DIR = @HTML_DIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBACCOUNTS_SSO_CFLAGS = @LIBACCOUNTS_SSO_CFLAGS@ LIBACCOUNTS_SSO_LIBS = @LIBACCOUNTS_SSO_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MCE_CFLAGS = @MCE_CFLAGS@ MCE_LIBS = @MCE_LIBS@ MCP_ABI_VERSION = @MCP_ABI_VERSION@ MCP_API_VERSION = @MCP_API_VERSION@ MCP_LT_AGE = @MCP_LT_AGE@ MCP_LT_CURRENT = @MCP_LT_CURRENT@ MCP_LT_REVISION = @MCP_LT_REVISION@ MKDIR_P = @MKDIR_P@ NETWORK_MANAGER_CFLAGS = @NETWORK_MANAGER_CFLAGS@ NETWORK_MANAGER_LIBS = @NETWORK_MANAGER_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PYTHON = @PYTHON@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TELEPATHY_CFLAGS = @TELEPATHY_CFLAGS@ TELEPATHY_LIBS = @TELEPATHY_LIBS@ UPOWER_GLIB_CFLAGS = @UPOWER_GLIB_CFLAGS@ UPOWER_GLIB_LIBS = @UPOWER_GLIB_LIBS@ VERSION = @VERSION@ XSLTPROC = @XSLTPROC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gsettingsschemadir = @gsettingsschemadir@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mctestsdir = @mctestsdir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ pluginlibdir = @pluginlibdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ ACLOCAL_AMFLAGS = -I m4 CHECK_FOR_UNRELEASED := \ $(srcdir)/NEWS \ $(wildcard $(srcdir)/src/*.[ch]) \ $(wildcard $(mission-control-plugins)/*.[ch]) \ $(NULL) SUBDIRS = \ data \ m4 \ tools \ xml \ mission-control-plugins \ plugins \ src \ server \ util \ tests \ doc pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = mission-control-plugins.pc DISTCHECK_CONFIGURE_FLAGS = \ --enable-gtk-doc \ --disable-gnome-keyring \ $(NULL) CHANGELOG_RANGE = telepathy-mission-control-5.4.0.. all: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: am--refresh: Makefile @: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(srcdir)/tools/lcov.am $(srcdir)/tools/telepathy.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --gnu'; \ $(am__cd) $(srcdir) && $(AUTOMAKE) --gnu \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ esac; $(srcdir)/tools/lcov.am $(srcdir)/tools/telepathy.am: $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: $(am__configure_deps) $(am__cd) $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): config.h: stamp-h1 @if test ! -f $@; then rm -f stamp-h1; else :; fi @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) stamp-h1; else :; fi stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status config.h $(srcdir)/config.h.in: $(am__configure_deps) ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f stamp-h1 touch $@ distclean-hdr: -rm -f config.h stamp-h1 mission-control-plugins.pc: $(top_builddir)/config.status $(srcdir)/mission-control-plugins.pc.in cd $(top_builddir) && $(SHELL) ./config.status $@ mission-control-plugins-uninstalled.pc: $(top_builddir)/config.status $(srcdir)/mission-control-plugins-uninstalled.pc.in cd $(top_builddir) && $(SHELL) ./config.status $@ mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool config.lt install-pkgconfigDATA: $(pkgconfig_DATA) @$(NORMAL_INSTALL) @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(pkgconfigdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgconfigdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgconfigdir)" || exit $$?; \ done uninstall-pkgconfigDATA: @$(NORMAL_UNINSTALL) @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(pkgconfigdir)'; $(am__uninstall_files_from_dir) # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) $(am__remove_distdir) test -d "$(distdir)" || mkdir "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$(top_distdir)" distdir="$(distdir)" \ dist-hook -test -n "$(am__skip_mode_fix)" \ || find "$(distdir)" -type d ! -perm -755 \ -exec chmod u+rwx,go+rx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r "$(distdir)" dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 $(am__remove_distdir) dist-lzip: distdir tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz $(am__remove_distdir) dist-lzma: distdir tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma $(am__remove_distdir) dist-xz: distdir tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz $(am__remove_distdir) dist-tarZ: distdir tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__remove_distdir) dist-shar: distdir shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__remove_distdir) dist dist-all: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lzma*) \ lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\ *.tar.lz*) \ lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ *.tar.xz*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir); chmod u+w $(distdir) mkdir $(distdir)/_build mkdir $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && $(MAKE) $(AM_MAKEFLAGS) distcheck-hook \ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build \ && ../configure --srcdir=.. --prefix="$$dc_install_base" \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ && cd "$$am__cwd" \ || exit 1 $(am__remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @test -n '$(distuninstallcheck_dir)' || { \ echo 'ERROR: trying to run $@ with an empty' \ '$$(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ $(am__cd) '$(distuninstallcheck_dir)' || { \ echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: check-recursive all-am: Makefile $(DATA) config.h installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(pkgconfigdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f Makefile distclean-am: clean-am distclean-generic distclean-hdr \ distclean-libtool distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-pkgconfigDATA install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-pkgconfigDATA .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all \ ctags-recursive install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am am--refresh check check-am clean clean-generic \ clean-libtool ctags ctags-recursive dist dist-all dist-bzip2 \ dist-gzip dist-hook dist-lzip dist-lzma dist-shar dist-tarZ \ dist-xz dist-zip distcheck distclean distclean-generic \ distclean-hdr distclean-libtool distclean-tags distcleancheck \ distdir distuninstallcheck dvi dvi-am html html-am info \ info-am install install-am install-data install-data-am \ install-dvi install-dvi-am install-exec install-exec-am \ install-html install-html-am install-info install-info-am \ install-man install-pdf install-pdf-am install-pkgconfigDATA \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ uninstall uninstall-am uninstall-pkgconfigDATA maintainer-upload-release: _maintainer-upload-release-local _maintainer-upload-release-local: _maintainer-upload-release-check rsync -rvzPp --chmod=Dg+s,ug+rwX,o=rX doc/reference/mission-control-plugins/html/ \ telepathy.freedesktop.org:/srv/telepathy.freedesktop.org/www/doc/mission-control-plugins-5.16.x/ lcov-reset: lcov --directory @top_srcdir@ --zerocounters lcov-report: lcov --directory @top_srcdir@ --capture \ --output-file @top_builddir@/lcov.info.tmp lcov --directory @top_srcdir@ --output-file @top_builddir@/lcov.info \ --remove @top_builddir@/lcov.info.tmp \ 'doc/reference/*/*-scan.c' rm @top_builddir@/lcov.info.tmp $(mkdir_p) @top_builddir@/lcov.html git_commit=`GIT_DIR=@top_srcdir@/.git git log -1 --pretty=format:%h 2>/dev/null`;\ genhtml --title "@PACKAGE_STRING@ $$git_commit" \ --output-directory @top_builddir@/lcov.html lcov.info @echo @echo 'lcov report can be found in:' @echo 'file://@abs_top_builddir@/lcov.html/index.html' @echo lcov-check: $(MAKE) lcov-reset $(MAKE) check sleep `expr $${MC_LINGER_TIME:-5}` sleep 1 $(MAKE) lcov-report dist-hook: chmod u+w ${distdir}/ChangeLog if test -d ${top_srcdir}/.git; then \ ( cd ${top_srcdir} && git log --date=iso $(CHANGELOG_RANGE) ) > ${distdir}/ChangeLog; \ fi distcheck-hook: @test "z$(CHECK_FOR_UNRELEASED)" = z || \ case @VERSION@ in \ *.*.*.*|*+) ;; \ *) \ if grep -r UNRELEASED $(CHECK_FOR_UNRELEASED); \ then \ echo "^^^ This is meant to be a release, but some files say UNRELEASED" >&2; \ exit 2; \ fi \ ;; \ esac _is-release-check: @case @VERSION@ in \ (*.*.*.*|*+) \ echo "Hey! @VERSION@ is not a release!" >&2; \ exit 2; \ ;; \ esac @cd ${top_srcdir} && \ if ! git diff --no-ext-diff --quiet --exit-code; then \ echo "Hey! Your tree is dirty! No release for you." >&2; \ exit 2; \ fi @cd ${top_srcdir} && \ if ! git diff --cached --no-ext-diff --quiet --exit-code; then \ echo "Hey! You have changes staged! No release for you." >&2; \ exit 2; \ fi @ENABLE_GTK_DOC_FALSE@ @echo "Hey! You need to pass --enable-gtk-doc to configure!" @ENABLE_GTK_DOC_FALSE@ @exit 2; %.tar.gz.asc: %.tar.gz $(AM_V_GEN)gpg --detach-sign --armor $@ @PACKAGE@-@VERSION@.tar.gz: $(MAKE) _is-release-check $(MAKE) check $(MAKE) distcheck maintainer-prepare-release: $(MAKE) _is-release-check $(MAKE) all $(MAKE) distcheck $(MAKE) release-mail git tag -s @PACKAGE@-@VERSION@ -m @PACKAGE@' '@VERSION@ gpg --detach-sign --armor @PACKAGE@-@VERSION@.tar.gz release-mail: NEWS $(AM_V_GEN)(python $(top_srcdir)/tools/make-release-mail.py \ @PACKAGE@ @VERSION@ $(top_srcdir)/NEWS > $@.tmp && \ mv $@.tmp $@) maintainer-upload-release: _maintainer-upload-release _maintainer-upload-release-check: _is-release-check test -f @PACKAGE@-@VERSION@.tar.gz test -f @PACKAGE@-@VERSION@.tar.gz.asc gpg --verify @PACKAGE@-@VERSION@.tar.gz.asc _maintainer-upload-release: _maintainer-upload-release-check rsync -vzP @PACKAGE@-@VERSION@.tar.gz telepathy.freedesktop.org:/srv/telepathy.freedesktop.org/www/releases/@PACKAGE@/@PACKAGE@-@VERSION@.tar.gz rsync -vzP @PACKAGE@-@VERSION@.tar.gz.asc telepathy.freedesktop.org:/srv/telepathy.freedesktop.org/www/releases/@PACKAGE@/@PACKAGE@-@VERSION@.tar.gz.asc maintainer-make-release: $(MAKE) maintainer-prepare-release $(MAKE) maintainer-upload-release @echo "Now:" @echo " • bump the nano-version;" @echo " • push the branch and tags upstream; and" @echo " • send release-mail to ." # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: telepathy-mission-control-5.16.4/m4/0000755000175000017500000000000012762352247020347 5ustar00gkiagiagkiagia00000000000000telepathy-mission-control-5.16.4/m4/libtool.m40000644000175000017500000112570012762351615022261 0ustar00gkiagiagkiagia00000000000000# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # # Copyright (C) 1996-2001, 2003-2015 Free Software Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. m4_define([_LT_COPYING], [dnl # Copyright (C) 2014 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # GNU Libtool is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of of the License, or # (at your option) any later version. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program or library that is built # using GNU Libtool, you may include this file under the same # distribution terms that you use for the rest of that program. # # GNU Libtool is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . ]) # serial 58 LT_INIT # LT_PREREQ(VERSION) # ------------------ # Complain and exit if this libtool version is less that VERSION. m4_defun([LT_PREREQ], [m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1, [m4_default([$3], [m4_fatal([Libtool version $1 or higher is required], 63)])], [$2])]) # _LT_CHECK_BUILDDIR # ------------------ # Complain if the absolute build directory name contains unusual characters m4_defun([_LT_CHECK_BUILDDIR], [case `pwd` in *\ * | *\ *) AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;; esac ]) # LT_INIT([OPTIONS]) # ------------------ AC_DEFUN([LT_INIT], [AC_PREREQ([2.62])dnl We use AC_PATH_PROGS_FEATURE_CHECK AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl AC_BEFORE([$0], [LT_LANG])dnl AC_BEFORE([$0], [LT_OUTPUT])dnl AC_BEFORE([$0], [LTDL_INIT])dnl m4_require([_LT_CHECK_BUILDDIR])dnl dnl Autoconf doesn't catch unexpanded LT_ macros by default: m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4 dnl unless we require an AC_DEFUNed macro: AC_REQUIRE([LTOPTIONS_VERSION])dnl AC_REQUIRE([LTSUGAR_VERSION])dnl AC_REQUIRE([LTVERSION_VERSION])dnl AC_REQUIRE([LTOBSOLETE_VERSION])dnl m4_require([_LT_PROG_LTMAIN])dnl _LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}]) dnl Parse OPTIONS _LT_SET_OPTIONS([$0], [$1]) # This can be used to rebuild libtool when needed LIBTOOL_DEPS=$ltmain # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' AC_SUBST(LIBTOOL)dnl _LT_SETUP # Only expand once: m4_define([LT_INIT]) ])# LT_INIT # Old names: AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT]) AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PROG_LIBTOOL], []) dnl AC_DEFUN([AM_PROG_LIBTOOL], []) # _LT_PREPARE_CC_BASENAME # ----------------------- m4_defun([_LT_PREPARE_CC_BASENAME], [ # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. func_cc_basename () { for cc_temp in @S|@*""; do case $cc_temp in compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; \-*) ;; *) break;; esac done func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` } ])# _LT_PREPARE_CC_BASENAME # _LT_CC_BASENAME(CC) # ------------------- # It would be clearer to call AC_REQUIREs from _LT_PREPARE_CC_BASENAME, # but that macro is also expanded into generated libtool script, which # arranges for $SED and $ECHO to be set by different means. m4_defun([_LT_CC_BASENAME], [m4_require([_LT_PREPARE_CC_BASENAME])dnl AC_REQUIRE([_LT_DECL_SED])dnl AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl func_cc_basename $1 cc_basename=$func_cc_basename_result ]) # _LT_FILEUTILS_DEFAULTS # ---------------------- # It is okay to use these file commands and assume they have been set # sensibly after 'm4_require([_LT_FILEUTILS_DEFAULTS])'. m4_defun([_LT_FILEUTILS_DEFAULTS], [: ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} ])# _LT_FILEUTILS_DEFAULTS # _LT_SETUP # --------- m4_defun([_LT_SETUP], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl _LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl dnl _LT_DECL([], [host_alias], [0], [The host system])dnl _LT_DECL([], [host], [0])dnl _LT_DECL([], [host_os], [0])dnl dnl _LT_DECL([], [build_alias], [0], [The build system])dnl _LT_DECL([], [build], [0])dnl _LT_DECL([], [build_os], [0])dnl dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl dnl AC_REQUIRE([AC_PROG_LN_S])dnl test -z "$LN_S" && LN_S="ln -s" _LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl dnl AC_REQUIRE([LT_CMD_MAX_LEN])dnl _LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl _LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl m4_require([_LT_CMD_RELOAD])dnl m4_require([_LT_CHECK_MAGIC_METHOD])dnl m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl m4_require([_LT_CMD_OLD_ARCHIVE])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_WITH_SYSROOT])dnl m4_require([_LT_CMD_TRUNCATE])dnl _LT_CONFIG_LIBTOOL_INIT([ # See if we are running on zsh, and set the options that allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi ]) if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi _LT_CHECK_OBJDIR m4_require([_LT_TAG_COMPILER])dnl case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a '.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a with_gnu_ld=$lt_cv_prog_gnu_ld old_CC=$CC old_CFLAGS=$CFLAGS # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o _LT_CC_BASENAME([$compiler]) # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then _LT_PATH_MAGIC fi ;; esac # Use C for the default configuration in the libtool script LT_SUPPORTED_TAG([CC]) _LT_LANG_C_CONFIG _LT_LANG_DEFAULT_CONFIG _LT_CONFIG_COMMANDS ])# _LT_SETUP # _LT_PREPARE_SED_QUOTE_VARS # -------------------------- # Define a few sed substitution that help us do robust quoting. m4_defun([_LT_PREPARE_SED_QUOTE_VARS], [# Backslashify metacharacters that are still active within # double-quoted strings. sed_quote_subst='s/\([["`$\\]]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\([["`\\]]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' ]) # _LT_PROG_LTMAIN # --------------- # Note that this code is called both from 'configure', and 'config.status' # now that we use AC_CONFIG_COMMANDS to generate libtool. Notably, # 'config.status' has no value for ac_aux_dir unless we are using Automake, # so we pass a copy along to make sure it has a sensible value anyway. m4_defun([_LT_PROG_LTMAIN], [m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl _LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir']) ltmain=$ac_aux_dir/ltmain.sh ])# _LT_PROG_LTMAIN ## ------------------------------------- ## ## Accumulate code for creating libtool. ## ## ------------------------------------- ## # So that we can recreate a full libtool script including additional # tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS # in macros and then make a single call at the end using the 'libtool' # label. # _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS]) # ---------------------------------------- # Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL_INIT], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_INIT], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_INIT]) # _LT_CONFIG_LIBTOOL([COMMANDS]) # ------------------------------ # Register COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS]) # _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS]) # ----------------------------------------------------- m4_defun([_LT_CONFIG_SAVE_COMMANDS], [_LT_CONFIG_LIBTOOL([$1]) _LT_CONFIG_LIBTOOL_INIT([$2]) ]) # _LT_FORMAT_COMMENT([COMMENT]) # ----------------------------- # Add leading comment marks to the start of each line, and a trailing # full-stop to the whole comment if one is not present already. m4_define([_LT_FORMAT_COMMENT], [m4_ifval([$1], [ m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])], [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.]) )]) ## ------------------------ ## ## FIXME: Eliminate VARNAME ## ## ------------------------ ## # _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?]) # ------------------------------------------------------------------- # CONFIGNAME is the name given to the value in the libtool script. # VARNAME is the (base) name used in the configure script. # VALUE may be 0, 1 or 2 for a computed quote escaped value based on # VARNAME. Any other value will be used directly. m4_define([_LT_DECL], [lt_if_append_uniq([lt_decl_varnames], [$2], [, ], [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name], [m4_ifval([$1], [$1], [$2])]) lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3]) m4_ifval([$4], [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])]) lt_dict_add_subkey([lt_decl_dict], [$2], [tagged?], [m4_ifval([$5], [yes], [no])])]) ]) # _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION]) # -------------------------------------------------------- m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])]) # lt_decl_tag_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_tag_varnames], [_lt_decl_filter([tagged?], [yes], $@)]) # _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..]) # --------------------------------------------------------- m4_define([_lt_decl_filter], [m4_case([$#], [0], [m4_fatal([$0: too few arguments: $#])], [1], [m4_fatal([$0: too few arguments: $#: $1])], [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)], [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)], [lt_dict_filter([lt_decl_dict], $@)])[]dnl ]) # lt_decl_quote_varnames([SEPARATOR], [VARNAME1...]) # -------------------------------------------------- m4_define([lt_decl_quote_varnames], [_lt_decl_filter([value], [1], $@)]) # lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_dquote_varnames], [_lt_decl_filter([value], [2], $@)]) # lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_varnames_tagged], [m4_assert([$# <= 2])dnl _$0(m4_quote(m4_default([$1], [[, ]])), m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]), m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))]) m4_define([_lt_decl_varnames_tagged], [m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])]) # lt_decl_all_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_all_varnames], [_$0(m4_quote(m4_default([$1], [[, ]])), m4_if([$2], [], m4_quote(lt_decl_varnames), m4_quote(m4_shift($@))))[]dnl ]) m4_define([_lt_decl_all_varnames], [lt_join($@, lt_decl_varnames_tagged([$1], lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl ]) # _LT_CONFIG_STATUS_DECLARE([VARNAME]) # ------------------------------------ # Quote a variable value, and forward it to 'config.status' so that its # declaration there will have the same value as in 'configure'. VARNAME # must have a single quote delimited value for this to work. m4_define([_LT_CONFIG_STATUS_DECLARE], [$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`']) # _LT_CONFIG_STATUS_DECLARATIONS # ------------------------------ # We delimit libtool config variables with single quotes, so when # we write them to config.status, we have to be sure to quote all # embedded single quotes properly. In configure, this macro expands # each variable declared with _LT_DECL (and _LT_TAGDECL) into: # # ='`$ECHO "$" | $SED "$delay_single_quote_subst"`' m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], [m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames), [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAGS # ---------------- # Output comment and list of tags supported by the script m4_defun([_LT_LIBTOOL_TAGS], [_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl available_tags='_LT_TAGS'dnl ]) # _LT_LIBTOOL_DECLARE(VARNAME, [TAG]) # ----------------------------------- # Extract the dictionary values for VARNAME (optionally with TAG) and # expand to a commented shell variable setting: # # # Some comment about what VAR is for. # visible_name=$lt_internal_name m4_define([_LT_LIBTOOL_DECLARE], [_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [description])))[]dnl m4_pushdef([_libtool_name], m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])), [0], [_libtool_name=[$]$1], [1], [_libtool_name=$lt_[]$1], [2], [_libtool_name=$lt_[]$1], [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl ]) # _LT_LIBTOOL_CONFIG_VARS # ----------------------- # Produce commented declarations of non-tagged libtool config variables # suitable for insertion in the LIBTOOL CONFIG section of the 'libtool' # script. Tagged libtool config variables (even for the LIBTOOL CONFIG # section) are produced by _LT_LIBTOOL_TAG_VARS. m4_defun([_LT_LIBTOOL_CONFIG_VARS], [m4_foreach([_lt_var], m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAG_VARS(TAG) # ------------------------- m4_define([_LT_LIBTOOL_TAG_VARS], [m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])]) # _LT_TAGVAR(VARNAME, [TAGNAME]) # ------------------------------ m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])]) # _LT_CONFIG_COMMANDS # ------------------- # Send accumulated output to $CONFIG_STATUS. Thanks to the lists of # variables for single and double quote escaping we saved from calls # to _LT_DECL, we can put quote escaped variables declarations # into 'config.status', and then the shell code to quote escape them in # for loops in 'config.status'. Finally, any additional code accumulated # from calls to _LT_CONFIG_LIBTOOL_INIT is expanded. m4_defun([_LT_CONFIG_COMMANDS], [AC_PROVIDE_IFELSE([LT_OUTPUT], dnl If the libtool generation code has been placed in $CONFIG_LT, dnl instead of duplicating it all over again into config.status, dnl then we will have config.status run $CONFIG_LT later, so it dnl needs to know what name is stored there: [AC_CONFIG_COMMANDS([libtool], [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])], dnl If the libtool generation code is destined for config.status, dnl expand the accumulated commands and init code now: [AC_CONFIG_COMMANDS([libtool], [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])]) ])#_LT_CONFIG_COMMANDS # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT], [ # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' _LT_CONFIG_STATUS_DECLARATIONS LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$[]1 _LTECHO_EOF' } # Quote evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_quote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_dquote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done _LT_OUTPUT_LIBTOOL_INIT ]) # _LT_GENERATED_FILE_INIT(FILE, [COMMENT]) # ------------------------------------ # Generate a child script FILE with all initialization necessary to # reuse the environment learned by the parent script, and make the # file executable. If COMMENT is supplied, it is inserted after the # '#!' sequence but before initialization text begins. After this # macro, additional text can be appended to FILE to form the body of # the child script. The macro ends with non-zero status if the # file could not be fully written (such as if the disk is full). m4_ifdef([AS_INIT_GENERATED], [m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])], [m4_defun([_LT_GENERATED_FILE_INIT], [m4_require([AS_PREPARE])]dnl [m4_pushdef([AS_MESSAGE_LOG_FD])]dnl [lt_write_fail=0 cat >$1 <<_ASEOF || lt_write_fail=1 #! $SHELL # Generated by $as_me. $2 SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$1 <<\_ASEOF || lt_write_fail=1 AS_SHELL_SANITIZE _AS_PREPARE exec AS_MESSAGE_FD>&1 _ASEOF test 0 = "$lt_write_fail" && chmod +x $1[]dnl m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT # LT_OUTPUT # --------- # This macro allows early generation of the libtool script (before # AC_OUTPUT is called), incase it is used in configure for compilation # tests. AC_DEFUN([LT_OUTPUT], [: ${CONFIG_LT=./config.lt} AC_MSG_NOTICE([creating $CONFIG_LT]) _LT_GENERATED_FILE_INIT(["$CONFIG_LT"], [# Run this file to recreate a libtool stub with the current configuration.]) cat >>"$CONFIG_LT" <<\_LTEOF lt_cl_silent=false exec AS_MESSAGE_LOG_FD>>config.log { echo AS_BOX([Running $as_me.]) } >&AS_MESSAGE_LOG_FD lt_cl_help="\ '$as_me' creates a local libtool stub from the current configuration, for use in further configure time tests before the real libtool is generated. Usage: $[0] [[OPTIONS]] -h, --help print this help, then exit -V, --version print version number, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files Report bugs to ." lt_cl_version="\ m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) configured by $[0], generated by m4_PACKAGE_STRING. Copyright (C) 2011 Free Software Foundation, Inc. This config.lt script is free software; the Free Software Foundation gives unlimited permision to copy, distribute and modify it." while test 0 != $[#] do case $[1] in --version | --v* | -V ) echo "$lt_cl_version"; exit 0 ;; --help | --h* | -h ) echo "$lt_cl_help"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --quiet | --q* | --silent | --s* | -q ) lt_cl_silent=: ;; -*) AC_MSG_ERROR([unrecognized option: $[1] Try '$[0] --help' for more information.]) ;; *) AC_MSG_ERROR([unrecognized argument: $[1] Try '$[0] --help' for more information.]) ;; esac shift done if $lt_cl_silent; then exec AS_MESSAGE_FD>/dev/null fi _LTEOF cat >>"$CONFIG_LT" <<_LTEOF _LT_OUTPUT_LIBTOOL_COMMANDS_INIT _LTEOF cat >>"$CONFIG_LT" <<\_LTEOF AC_MSG_NOTICE([creating $ofile]) _LT_OUTPUT_LIBTOOL_COMMANDS AS_EXIT(0) _LTEOF chmod +x "$CONFIG_LT" # configure is writing to config.log, but config.lt does its own redirection, # appending to config.log, which fails on DOS, as config.log is still kept # open by configure. Here we exec the FD to /dev/null, effectively closing # config.log, so it can be properly (re)opened and appended to by config.lt. lt_cl_success=: test yes = "$silent" && lt_config_lt_args="$lt_config_lt_args --quiet" exec AS_MESSAGE_LOG_FD>/dev/null $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false exec AS_MESSAGE_LOG_FD>>config.log $lt_cl_success || AS_EXIT(1) ])# LT_OUTPUT # _LT_CONFIG(TAG) # --------------- # If TAG is the built-in tag, create an initial libtool script with a # default configuration from the untagged config vars. Otherwise add code # to config.status for appending the configuration named by TAG from the # matching tagged config vars. m4_defun([_LT_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_CONFIG_SAVE_COMMANDS([ m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl m4_if(_LT_TAG, [C], [ # See if we are running on zsh, and set the options that allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi cfgfile=${ofile}T trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # Generated automatically by $as_me ($PACKAGE) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # Provide generalized library-building support services. # Written by Gordon Matzigkeit, 1996 _LT_COPYING _LT_LIBTOOL_TAGS # Configured defaults for sys_lib_dlsearch_path munging. : \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"} # ### BEGIN LIBTOOL CONFIG _LT_LIBTOOL_CONFIG_VARS _LT_LIBTOOL_TAG_VARS # ### END LIBTOOL CONFIG _LT_EOF cat <<'_LT_EOF' >> "$cfgfile" # ### BEGIN FUNCTIONS SHARED WITH CONFIGURE _LT_PREPARE_MUNGE_PATH_LIST _LT_PREPARE_CC_BASENAME # ### END FUNCTIONS SHARED WITH CONFIGURE _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac _LT_PROG_LTMAIN # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ], [cat <<_LT_EOF >> "$ofile" dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded dnl in a comment (ie after a #). # ### BEGIN LIBTOOL TAG CONFIG: $1 _LT_LIBTOOL_TAG_VARS(_LT_TAG) # ### END LIBTOOL TAG CONFIG: $1 _LT_EOF ])dnl /m4_if ], [m4_if([$1], [], [ PACKAGE='$PACKAGE' VERSION='$VERSION' RM='$RM' ofile='$ofile'], []) ])dnl /_LT_CONFIG_SAVE_COMMANDS ])# _LT_CONFIG # LT_SUPPORTED_TAG(TAG) # --------------------- # Trace this macro to discover what tags are supported by the libtool # --tag option, using: # autoconf --trace 'LT_SUPPORTED_TAG:$1' AC_DEFUN([LT_SUPPORTED_TAG], []) # C support is built-in for now m4_define([_LT_LANG_C_enabled], []) m4_define([_LT_TAGS], []) # LT_LANG(LANG) # ------------- # Enable libtool support for the given language if not already enabled. AC_DEFUN([LT_LANG], [AC_BEFORE([$0], [LT_OUTPUT])dnl m4_case([$1], [C], [_LT_LANG(C)], [C++], [_LT_LANG(CXX)], [Go], [_LT_LANG(GO)], [Java], [_LT_LANG(GCJ)], [Fortran 77], [_LT_LANG(F77)], [Fortran], [_LT_LANG(FC)], [Windows Resource], [_LT_LANG(RC)], [m4_ifdef([_LT_LANG_]$1[_CONFIG], [_LT_LANG($1)], [m4_fatal([$0: unsupported language: "$1"])])])dnl ])# LT_LANG # _LT_LANG(LANGNAME) # ------------------ m4_defun([_LT_LANG], [m4_ifdef([_LT_LANG_]$1[_enabled], [], [LT_SUPPORTED_TAG([$1])dnl m4_append([_LT_TAGS], [$1 ])dnl m4_define([_LT_LANG_]$1[_enabled], [])dnl _LT_LANG_$1_CONFIG($1)])dnl ])# _LT_LANG m4_ifndef([AC_PROG_GO], [ ############################################################ # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_GO. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # ############################################################ m4_defun([AC_PROG_GO], [AC_LANG_PUSH(Go)dnl AC_ARG_VAR([GOC], [Go compiler command])dnl AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl _AC_ARG_VAR_LDFLAGS()dnl AC_CHECK_TOOL(GOC, gccgo) if test -z "$GOC"; then if test -n "$ac_tool_prefix"; then AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo]) fi fi if test -z "$GOC"; then AC_CHECK_PROG(GOC, gccgo, gccgo, false) fi ])#m4_defun ])#m4_ifndef # _LT_LANG_DEFAULT_CONFIG # ----------------------- m4_defun([_LT_LANG_DEFAULT_CONFIG], [AC_PROVIDE_IFELSE([AC_PROG_CXX], [LT_LANG(CXX)], [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])]) AC_PROVIDE_IFELSE([AC_PROG_F77], [LT_LANG(F77)], [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])]) AC_PROVIDE_IFELSE([AC_PROG_FC], [LT_LANG(FC)], [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])]) dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal dnl pulling things in needlessly. AC_PROVIDE_IFELSE([AC_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([LT_PROG_GCJ], [LT_LANG(GCJ)], [m4_ifdef([AC_PROG_GCJ], [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([A][M_PROG_GCJ], [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([LT_PROG_GCJ], [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])]) AC_PROVIDE_IFELSE([AC_PROG_GO], [LT_LANG(GO)], [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])]) AC_PROVIDE_IFELSE([LT_PROG_RC], [LT_LANG(RC)], [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])]) ])# _LT_LANG_DEFAULT_CONFIG # Obsolete macros: AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)]) AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)]) AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)]) AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)]) AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_CXX], []) dnl AC_DEFUN([AC_LIBTOOL_F77], []) dnl AC_DEFUN([AC_LIBTOOL_FC], []) dnl AC_DEFUN([AC_LIBTOOL_GCJ], []) dnl AC_DEFUN([AC_LIBTOOL_RC], []) # _LT_TAG_COMPILER # ---------------- m4_defun([_LT_TAG_COMPILER], [AC_REQUIRE([AC_PROG_CC])dnl _LT_DECL([LTCC], [CC], [1], [A C compiler])dnl _LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl _LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl _LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC ])# _LT_TAG_COMPILER # _LT_COMPILER_BOILERPLATE # ------------------------ # Check for compiler boilerplate output or warnings with # the simple compiler test code. m4_defun([_LT_COMPILER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ])# _LT_COMPILER_BOILERPLATE # _LT_LINKER_BOILERPLATE # ---------------------- # Check for linker boilerplate output or warnings with # the simple link test code. m4_defun([_LT_LINKER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* ])# _LT_LINKER_BOILERPLATE # _LT_REQUIRED_DARWIN_CHECKS # ------------------------- m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ case $host_os in rhapsody* | darwin*) AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:]) AC_CHECK_TOOL([NMEDIT], [nmedit], [:]) AC_CHECK_TOOL([LIPO], [lipo], [:]) AC_CHECK_TOOL([OTOOL], [otool], [:]) AC_CHECK_TOOL([OTOOL64], [otool64], [:]) _LT_DECL([], [DSYMUTIL], [1], [Tool to manipulate archived DWARF debug symbol files on Mac OS X]) _LT_DECL([], [NMEDIT], [1], [Tool to change global to local symbols on Mac OS X]) _LT_DECL([], [LIPO], [1], [Tool to manipulate fat objects and archives on Mac OS X]) _LT_DECL([], [OTOOL], [1], [ldd/readelf like tool for Mach-O binaries on Mac OS X]) _LT_DECL([], [OTOOL64], [1], [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4]) AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod], [lt_cv_apple_cc_single_mod=no if test -z "$LT_MULTI_MODULE"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? # If there is a non-empty error log, and "single_module" # appears in it, assume the flag caused a linker warning if test -s conftest.err && $GREP single_module conftest.err; then cat conftest.err >&AS_MESSAGE_LOG_FD # Otherwise, if the output was created with a 0 exit code from # the compiler, it worked. elif test -f libconftest.dylib && test 0 = "$_lt_result"; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&AS_MESSAGE_LOG_FD fi rm -rf libconftest.dylib* rm -f conftest.* fi]) AC_CACHE_CHECK([for -exported_symbols_list linker flag], [lt_cv_ld_exported_symbols_list], [lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [lt_cv_ld_exported_symbols_list=yes], [lt_cv_ld_exported_symbols_list=no]) LDFLAGS=$save_LDFLAGS ]) AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load], [lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD cat > conftest.c << _LT_EOF int main() { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? if test -s conftest.err && $GREP force_load conftest.err; then cat conftest.err >&AS_MESSAGE_LOG_FD elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then lt_cv_ld_force_load=yes else cat conftest.err >&AS_MESSAGE_LOG_FD fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM ]) case $host_os in rhapsody* | darwin1.[[012]]) _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; 10.[[012]][[,.]]*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test yes = "$lt_cv_apple_cc_single_mod"; then _lt_dar_single_mod='$single_module' fi if test yes = "$lt_cv_ld_exported_symbols_list"; then _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib' fi if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac ]) # _LT_DARWIN_LINKER_FEATURES([TAG]) # --------------------------------- # Checks for linker and compiler features on darwin m4_defun([_LT_DARWIN_LINKER_FEATURES], [ m4_require([_LT_REQUIRED_DARWIN_CHECKS]) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported if test yes = "$lt_cv_ld_force_load"; then _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes], [FC], [_LT_TAGVAR(compiler_needs_object, $1)=yes]) else _LT_TAGVAR(whole_archive_flag_spec, $1)='' fi _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=$_lt_dar_allow_undefined case $cc_basename in ifort*|nagfor*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test yes = "$_lt_dar_can_shared"; then output_verbose_link_cmd=func_echo_all _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" m4_if([$1], [CXX], [ if test yes != "$lt_cv_apple_cc_single_mod"; then _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dsymutil" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil" fi ],[]) else _LT_TAGVAR(ld_shlibs, $1)=no fi ]) # _LT_SYS_MODULE_PATH_AIX([TAGNAME]) # ---------------------------------- # Links a minimal program and checks the executable # for the system default hardcoded library path. In most cases, # this is /usr/lib:/lib, but when the MPI compilers are used # the location of the communication and MPI libs are included too. # If we don't find anything, use the default library path according # to the aix ld manual. # Store the results from the different compilers for each TAGNAME. # Allow to override them for all tags through lt_cv_aix_libpath. m4_defun([_LT_SYS_MODULE_PATH_AIX], [m4_require([_LT_DECL_SED])dnl if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])], [AC_LINK_IFELSE([AC_LANG_PROGRAM],[ lt_aix_libpath_sed='[ /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }]' _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi],[]) if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=/usr/lib:/lib fi ]) aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1]) fi ])# _LT_SYS_MODULE_PATH_AIX # _LT_SHELL_INIT(ARG) # ------------------- m4_define([_LT_SHELL_INIT], [m4_divert_text([M4SH-INIT], [$1 ])])# _LT_SHELL_INIT # _LT_PROG_ECHO_BACKSLASH # ----------------------- # Find how we can fake an echo command that does not interpret backslash. # In particular, with Autoconf 2.60 or later we add some code to the start # of the generated configure script that will find a shell with a builtin # printf (that we can use as an echo command). m4_defun([_LT_PROG_ECHO_BACKSLASH], [ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO AC_MSG_CHECKING([how to print strings]) # Test print first, because it will be a builtin if present. if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='print -r --' elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='printf %s\n' else # Use this function as a fallback that always works. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $[]1 _LTECHO_EOF' } ECHO='func_fallback_echo' fi # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "$*" } case $ECHO in printf*) AC_MSG_RESULT([printf]) ;; print*) AC_MSG_RESULT([print -r]) ;; *) AC_MSG_RESULT([cat]) ;; esac m4_ifdef([_AS_DETECT_SUGGESTED], [_AS_DETECT_SUGGESTED([ test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test "X`printf %s $ECHO`" = "X$ECHO" \ || test "X`print -r -- $ECHO`" = "X$ECHO" )])]) _LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) _LT_DECL([], [ECHO], [1], [An echo program that protects backslashes]) ])# _LT_PROG_ECHO_BACKSLASH # _LT_WITH_SYSROOT # ---------------- AC_DEFUN([_LT_WITH_SYSROOT], [AC_MSG_CHECKING([for sysroot]) AC_ARG_WITH([sysroot], [AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@], [Search for dependent libraries within DIR (or the compiler's sysroot if not specified).])], [], [with_sysroot=no]) dnl lt_sysroot will always be passed unquoted. We quote it here dnl in case the user passed a directory name. lt_sysroot= case $with_sysroot in #( yes) if test yes = "$GCC"; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) AC_MSG_RESULT([$with_sysroot]) AC_MSG_ERROR([The sysroot must be an absolute path.]) ;; esac AC_MSG_RESULT([${lt_sysroot:-no}]) _LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl [dependent libraries, and where our libraries should be installed.])]) # _LT_ENABLE_LOCK # --------------- m4_defun([_LT_ENABLE_LOCK], [AC_ARG_ENABLE([libtool-lock], [AS_HELP_STRING([--disable-libtool-lock], [avoid locking (might break parallel builds)])]) test no = "$enable_libtool_lock" || enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out what ABI is being produced by ac_compile, and set mode # options accordingly. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE=32 ;; *ELF-64*) HPUX_IA64_MODE=64 ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then if test yes = "$lt_cv_prog_gnu_ld"; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; mips64*-*linux*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then emul=elf case `/usr/bin/file conftest.$ac_objext` in *32-bit*) emul="${emul}32" ;; *64-bit*) emul="${emul}64" ;; esac case `/usr/bin/file conftest.$ac_objext` in *MSB*) emul="${emul}btsmip" ;; *LSB*) emul="${emul}ltsmip" ;; esac case `/usr/bin/file conftest.$ac_objext` in *N32*) emul="${emul}n32" ;; esac LD="${LD-ld} -m $emul" fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. Note that the listed cases only cover the # situations where additional linker options are needed (such as when # doing 32-bit compilation for a host where ld defaults to 64-bit, or # vice versa); the common cases where no linker options are needed do # not appear in the list. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) case `/usr/bin/file conftest.o` in *x86-64*) LD="${LD-ld} -m elf32_x86_64" ;; *) LD="${LD-ld} -m elf_i386" ;; esac ;; powerpc64le-*linux*) LD="${LD-ld} -m elf32lppclinux" ;; powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; powerpcle-*linux*) LD="${LD-ld} -m elf64lppc" ;; powerpc-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS=$CFLAGS CFLAGS="$CFLAGS -belf" AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, [AC_LANG_PUSH(C) AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) AC_LANG_POP]) if test yes != "$lt_cv_cc_needs_belf"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS=$SAVE_CFLAGS fi ;; *-*solaris*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) case $host in i?86-*-solaris*|x86_64-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) LD="${LD-ld} -m elf64_sparc" ;; esac # GNU ld 2.21 introduced _sol2 emulations. Use them if available. if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then LD=${LD-ld}_sol2 fi ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks=$enable_libtool_lock ])# _LT_ENABLE_LOCK # _LT_PROG_AR # ----------- m4_defun([_LT_PROG_AR], [AC_CHECK_TOOLS(AR, [ar], false) : ${AR=ar} : ${AR_FLAGS=cru} _LT_DECL([], [AR], [1], [The archiver]) _LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive]) AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file], [lt_cv_ar_at_file=no AC_COMPILE_IFELSE([AC_LANG_PROGRAM], [echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD' AC_TRY_EVAL([lt_ar_try]) if test 0 -eq "$ac_status"; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a AC_TRY_EVAL([lt_ar_try]) if test 0 -ne "$ac_status"; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a ]) ]) if test no = "$lt_cv_ar_at_file"; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file fi _LT_DECL([], [archiver_list_spec], [1], [How to feed a file listing to the archiver]) ])# _LT_PROG_AR # _LT_CMD_OLD_ARCHIVE # ------------------- m4_defun([_LT_CMD_OLD_ARCHIVE], [_LT_PROG_AR AC_CHECK_TOOL(STRIP, strip, :) test -z "$STRIP" && STRIP=: _LT_DECL([], [STRIP], [1], [A symbol stripping program]) AC_CHECK_TOOL(RANLIB, ranlib, :) test -z "$RANLIB" && RANLIB=: _LT_DECL([], [RANLIB], [1], [Commands used to install an old-style archive]) # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in bitrig* | openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in darwin*) lock_old_archive_extraction=yes ;; *) lock_old_archive_extraction=no ;; esac _LT_DECL([], [old_postinstall_cmds], [2]) _LT_DECL([], [old_postuninstall_cmds], [2]) _LT_TAGDECL([], [old_archive_cmds], [2], [Commands used to build an old-style archive]) _LT_DECL([], [lock_old_archive_extraction], [0], [Whether to use a lock for old archive extraction]) ])# _LT_CMD_OLD_ARCHIVE # _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------------------- # Check whether the given compiler option works AC_DEFUN([_LT_COMPILER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$3" ## exclude from sc_useless_quotes_in_assignment # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi fi $RM conftest* ]) if test yes = "[$]$2"; then m4_if([$5], , :, [$5]) else m4_if([$6], , :, [$6]) fi ])# _LT_COMPILER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], []) # _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------- # Check whether the given linker option works AC_DEFUN([_LT_LINKER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS $3" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&AS_MESSAGE_LOG_FD $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi else $2=yes fi fi $RM -r conftest* LDFLAGS=$save_LDFLAGS ]) if test yes = "[$]$2"; then m4_if([$4], , :, [$4]) else m4_if([$5], , :, [$5]) fi ])# _LT_LINKER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], []) # LT_CMD_MAX_LEN #--------------- AC_DEFUN([LT_CMD_MAX_LEN], [AC_REQUIRE([AC_CANONICAL_HOST])dnl # find the maximum length of command line arguments AC_MSG_CHECKING([the maximum length of command line arguments]) AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl i=0 teststring=ABCD case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; mint*) # On MiNT this can take a long time and run out of memory. lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; os2*) # The test takes a long time on OS/2. lt_cv_sys_max_cmd_len=8192 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len" && \ test undefined != "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test X`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test 17 != "$i" # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac ]) if test -n "$lt_cv_sys_max_cmd_len"; then AC_MSG_RESULT($lt_cv_sys_max_cmd_len) else AC_MSG_RESULT(none) fi max_cmd_len=$lt_cv_sys_max_cmd_len _LT_DECL([], [max_cmd_len], [0], [What is the maximum length of a command?]) ])# LT_CMD_MAX_LEN # Old name: AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], []) # _LT_HEADER_DLFCN # ---------------- m4_defun([_LT_HEADER_DLFCN], [AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl ])# _LT_HEADER_DLFCN # _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, # ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) # ---------------------------------------------------------------- m4_defun([_LT_TRY_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test yes = "$cross_compiling"; then : [$4] else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF [#line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisibility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; }] _LT_EOF if AC_TRY_EVAL(ac_link) && test -s "conftest$ac_exeext" 2>/dev/null; then (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) $1 ;; x$lt_dlneed_uscore) $2 ;; x$lt_dlunknown|x*) $3 ;; esac else : # compilation failed $3 fi fi rm -fr conftest* ])# _LT_TRY_DLOPEN_SELF # LT_SYS_DLOPEN_SELF # ------------------ AC_DEFUN([LT_SYS_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test yes != "$enable_dlopen"; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen=load_add_on lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) lt_cv_dlopen=LoadLibrary lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen=dlopen lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl],[ lt_cv_dlopen=dyld lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ]) ;; tpf*) # Don't try to run any link tests for TPF. We know it's impossible # because TPF is a cross-compiler, and we know how we open DSOs. lt_cv_dlopen=dlopen lt_cv_dlopen_libs= lt_cv_dlopen_self=no ;; *) AC_CHECK_FUNC([shl_load], [lt_cv_dlopen=shl_load], [AC_CHECK_LIB([dld], [shl_load], [lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld], [AC_CHECK_FUNC([dlopen], [lt_cv_dlopen=dlopen], [AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl], [AC_CHECK_LIB([svld], [dlopen], [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld], [AC_CHECK_LIB([dld], [dld_link], [lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld]) ]) ]) ]) ]) ]) ;; esac if test no = "$lt_cv_dlopen"; then enable_dlopen=no else enable_dlopen=yes fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS=$CPPFLAGS test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS=$LDFLAGS wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS=$LIBS LIBS="$lt_cv_dlopen_libs $LIBS" AC_CACHE_CHECK([whether a program can dlopen itself], lt_cv_dlopen_self, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) ]) if test yes = "$lt_cv_dlopen_self"; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" AC_CACHE_CHECK([whether a statically linked program can dlopen itself], lt_cv_dlopen_self_static, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) ]) fi CPPFLAGS=$save_CPPFLAGS LDFLAGS=$save_LDFLAGS LIBS=$save_LIBS ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi _LT_DECL([dlopen_support], [enable_dlopen], [0], [Whether dlopen is supported]) _LT_DECL([dlopen_self], [enable_dlopen_self], [0], [Whether dlopen of programs is supported]) _LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0], [Whether dlopen of statically linked programs is supported]) ])# LT_SYS_DLOPEN_SELF # Old name: AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], []) # _LT_COMPILER_C_O([TAGNAME]) # --------------------------- # Check to see if options -c and -o are simultaneously supported by compiler. # This macro does not hard code the compiler like AC_PROG_CC_C_O. m4_defun([_LT_COMPILER_C_O], [m4_require([_LT_DECL_SED])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes fi fi chmod u+w . 2>&AS_MESSAGE_LOG_FD $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* ]) _LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1], [Does compiler simultaneously support -c and -o options?]) ])# _LT_COMPILER_C_O # _LT_COMPILER_FILE_LOCKS([TAGNAME]) # ---------------------------------- # Check to see if we can do hard links to lock some files if needed m4_defun([_LT_COMPILER_FILE_LOCKS], [m4_require([_LT_ENABLE_LOCK])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_COMPILER_C_O([$1]) hard_links=nottested if test no = "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" && test no != "$need_locks"; then # do not overwrite the value of need_locks provided by the user AC_MSG_CHECKING([if we can lock with hard links]) hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no AC_MSG_RESULT([$hard_links]) if test no = "$hard_links"; then AC_MSG_WARN(['$CC' does not support '-c -o', so 'make -j' may be unsafe]) need_locks=warn fi else need_locks=no fi _LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?]) ])# _LT_COMPILER_FILE_LOCKS # _LT_CHECK_OBJDIR # ---------------- m4_defun([_LT_CHECK_OBJDIR], [AC_CACHE_CHECK([for objdir], [lt_cv_objdir], [rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null]) objdir=$lt_cv_objdir _LT_DECL([], [objdir], [0], [The name of the directory that contains temporary libtool files])dnl m4_pattern_allow([LT_OBJDIR])dnl AC_DEFINE_UNQUOTED([LT_OBJDIR], "$lt_cv_objdir/", [Define to the sub-directory where libtool stores uninstalled libraries.]) ])# _LT_CHECK_OBJDIR # _LT_LINKER_HARDCODE_LIBPATH([TAGNAME]) # -------------------------------------- # Check hardcoding attributes. m4_defun([_LT_LINKER_HARDCODE_LIBPATH], [AC_MSG_CHECKING([how to hardcode library paths into programs]) _LT_TAGVAR(hardcode_action, $1)= if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" || test -n "$_LT_TAGVAR(runpath_var, $1)" || test yes = "$_LT_TAGVAR(hardcode_automatic, $1)"; then # We can hardcode non-existent directories. if test no != "$_LT_TAGVAR(hardcode_direct, $1)" && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" && test no != "$_LT_TAGVAR(hardcode_minus_L, $1)"; then # Linking always hardcodes the temporary library directory. _LT_TAGVAR(hardcode_action, $1)=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. _LT_TAGVAR(hardcode_action, $1)=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. _LT_TAGVAR(hardcode_action, $1)=unsupported fi AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)]) if test relink = "$_LT_TAGVAR(hardcode_action, $1)" || test yes = "$_LT_TAGVAR(inherit_rpath, $1)"; then # Fast installation is not supported enable_fast_install=no elif test yes = "$shlibpath_overrides_runpath" || test no = "$enable_shared"; then # Fast installation is not necessary enable_fast_install=needless fi _LT_TAGDECL([], [hardcode_action], [0], [How to hardcode a shared library path into an executable]) ])# _LT_LINKER_HARDCODE_LIBPATH # _LT_CMD_STRIPLIB # ---------------- m4_defun([_LT_CMD_STRIPLIB], [m4_require([_LT_DECL_EGREP]) striplib= old_striplib= AC_MSG_CHECKING([whether stripping libraries is possible]) if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" AC_MSG_RESULT([yes]) else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP"; then striplib="$STRIP -x" old_striplib="$STRIP -S" AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi ;; *) AC_MSG_RESULT([no]) ;; esac fi _LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) _LT_DECL([], [striplib], [1]) ])# _LT_CMD_STRIPLIB # _LT_PREPARE_MUNGE_PATH_LIST # --------------------------- # Make sure func_munge_path_list() is defined correctly. m4_defun([_LT_PREPARE_MUNGE_PATH_LIST], [[# func_munge_path_list VARIABLE PATH # ----------------------------------- # VARIABLE is name of variable containing _space_ separated list of # directories to be munged by the contents of PATH, which is string # having a format: # "DIR[:DIR]:" # string "DIR[ DIR]" will be prepended to VARIABLE # ":DIR[:DIR]" # string "DIR[ DIR]" will be appended to VARIABLE # "DIRP[:DIRP]::[DIRA:]DIRA" # string "DIRP[ DIRP]" will be prepended to VARIABLE and string # "DIRA[ DIRA]" will be appended to VARIABLE # "DIR[:DIR]" # VARIABLE will be replaced by "DIR[ DIR]" func_munge_path_list () { case x@S|@2 in x) ;; *:) eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'` \@S|@@S|@1\" ;; x:*) eval @S|@1=\"\@S|@@S|@1 `$ECHO @S|@2 | $SED 's/:/ /g'`\" ;; *::*) eval @S|@1=\"\@S|@@S|@1\ `$ECHO @S|@2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" eval @S|@1=\"`$ECHO @S|@2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \@S|@@S|@1\" ;; *) eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'`\" ;; esac } ]])# _LT_PREPARE_PATH_LIST # _LT_SYS_DYNAMIC_LINKER([TAG]) # ----------------------------- # PORTME Fill in your ld.so characteristics m4_defun([_LT_SYS_DYNAMIC_LINKER], [AC_REQUIRE([AC_CANONICAL_HOST])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_OBJDUMP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl m4_require([_LT_PREPARE_MUNGE_PATH_LIST])dnl AC_MSG_CHECKING([dynamic linker characteristics]) m4_if([$1], [], [ if test yes = "$GCC"; then case $host_os in darwin*) lt_awk_arg='/^libraries:/,/LR/' ;; *) lt_awk_arg='/^libraries:/' ;; esac case $host_os in mingw* | cegcc*) lt_sed_strip_eq='s|=\([[A-Za-z]]:\)|\1|g' ;; *) lt_sed_strip_eq='s|=/|/|g' ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in *\;*) # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` ;; *) lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` ;; esac # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary... lt_tmp_lt_search_path_spec= lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` # ...but if some path component already ends with the multilib dir we assume # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer). case "$lt_multi_os_dir; $lt_search_path_spec " in "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*) lt_multi_os_dir= ;; esac for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir" elif test -n "$lt_multi_os_dir"; then test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS = " "; FS = "/|\n";} { lt_foo = ""; lt_count = 0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo = "/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[[lt_foo]]++; } if (lt_freq[[lt_foo]] == 1) { print lt_foo; } }'` # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's|/\([[A-Za-z]]:\)|\1|g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi]) library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=.so postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown AC_ARG_VAR([LT_SYS_LIBRARY_PATH], [User-defined run-time library search path.]) case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='$libname$release$shared_ext$major' ;; aix[[4-9]]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test ia64 = "$host_cpu"; then # AIX 5 supports IA64 library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line '#! .'. This would cause the generated library to # depend on '.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[[01]] | aix4.[[01]].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # Using Import Files as archive members, it is possible to support # filename-based versioning of shared library archives on AIX. While # this would work for both with and without runtime linking, it will # prevent static linking of such archives. So we do filename-based # shared library versioning with .so extension only, which is used # when both runtime linking and shared linking is enabled. # Unfortunately, runtime linking may impact performance, so we do # not want this to be the default eventually. Also, we use the # versioned .so libs for executables only if there is the -brtl # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only. # To allow for filename-based versioning support, we need to create # libNAME.so.V as an archive file, containing: # *) an Import File, referring to the versioned filename of the # archive as well as the shared archive member, telling the # bitwidth (32 or 64) of that shared object, and providing the # list of exported symbols of that shared object, eventually # decorated with the 'weak' keyword # *) the shared object with the F_LOADONLY flag set, to really avoid # it being seen by the linker. # At run time we better use the real file rather than another symlink, # but for link time we create the symlink libNAME.so -> libNAME.so.V case $with_aix_soname,$aix_use_runtimelinking in # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. aix,yes) # traditional libtool dynamic_linker='AIX unversionable lib.so' # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; aix,no) # traditional AIX only dynamic_linker='AIX lib.a[(]lib.so.V[)]' # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' ;; svr4,*) # full svr4 only dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)]" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,yes) # both, prefer svr4 dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)], lib.a[(]lib.so.V[)]" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # unpreferred sharedlib libNAME.a needs extra handling postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,no) # both, prefer aix dynamic_linker="AIX lib.a[(]lib.so.V[)], lib.so.V[(]$shared_archive_member_spec.o[)]" library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' ;; esac shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='$libname$shared_ext' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[[45]]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"]) ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl*) # Native MSVC libname_spec='$name' soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' library_names_spec='$libname.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec=$LIB if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC wrapper library_names_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='$libname$release$major$shared_ext $libname$shared_ext' soname_spec='$libname$release$major$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"]) sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[[23]].*) objformat=aout ;; *) objformat=elf ;; esac fi # Handle Gentoo/FreeBSD as it was Linux case $host_vendor in gentoo) version_type=linux ;; *) version_type=freebsd-$objformat ;; esac case $version_type in freebsd-elf*) library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' need_version=yes ;; linux) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' need_lib_prefix=no need_version=no ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[[01]]* | freebsdelf3.[[01]]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=no sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' if test 32 = "$HPUX_IA64_MODE"; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" sys_lib_dlsearch_path_spec=/usr/lib/hpux32 else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" sys_lib_dlsearch_path_spec=/usr/lib/hpux64 fi ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[[3-9]]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test yes = "$lt_cv_prog_gnu_ld"; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='$libname$release$shared_ext$major' library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff" sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; linux*android*) version_type=none # Android doesn't support versioned libraries. need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext' soname_spec='$libname$release$shared_ext' finish_cmds= shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes dynamic_linker='Android linker' # Don't embed -rpath directories since the linker doesn't support them. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath], [lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], [lt_cv_shlibpath_overrides_runpath=yes])]) LDFLAGS=$save_LDFLAGS libdir=$save_libdir ]) shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Ideally, we could use ldconfig to report *all* directores which are # searched for libraries, however this is still not possible. Aside from not # being certain /sbin/ldconfig is available, command # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, # even though it is searched at run-time. Try to do the best guess by # appending ld.so.conf contents (and includes) to the search path. if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd* | bitrig*) version_type=sunos sys_lib_dlsearch_path_spec=/usr/lib need_lib_prefix=no if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then need_version=no else need_version=yes fi library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; os2*) libname_spec='$name' version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no # OS/2 can only load a DLL with a base name of 8 characters or less. soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; v=$($ECHO $release$versuffix | tr -d .-); n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); $ECHO $n$v`$shared_ext' library_names_spec='${libname}_dll.$libext' dynamic_linker='OS/2 ld.exe' shlibpath_var=BEGINLIBPATH sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='$libname$release$shared_ext$major' library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test yes = "$with_gnu_ld"; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec; then version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext' soname_spec='$libname$shared_ext.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=sco need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test yes = "$with_gnu_ld"; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac AC_MSG_RESULT([$dynamic_linker]) test no = "$dynamic_linker" && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test yes = "$GCC"; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec fi if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec fi # remember unaugmented sys_lib_dlsearch_path content for libtool script decls... configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec # ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" # to be used as default LT_SYS_LIBRARY_PATH value in generated libtool configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH _LT_DECL([], [variables_saved_for_relink], [1], [Variables whose values should be saved in libtool wrapper scripts and restored at link time]) _LT_DECL([], [need_lib_prefix], [0], [Do we need the "lib" prefix for modules?]) _LT_DECL([], [need_version], [0], [Do we need a version for libraries?]) _LT_DECL([], [version_type], [0], [Library versioning type]) _LT_DECL([], [runpath_var], [0], [Shared library runtime path variable]) _LT_DECL([], [shlibpath_var], [0],[Shared library path variable]) _LT_DECL([], [shlibpath_overrides_runpath], [0], [Is shlibpath searched before the hard-coded library search path?]) _LT_DECL([], [libname_spec], [1], [Format of library name prefix]) _LT_DECL([], [library_names_spec], [1], [[List of archive names. First name is the real one, the rest are links. The last name is the one that the linker finds with -lNAME]]) _LT_DECL([], [soname_spec], [1], [[The coded name of the library, if different from the real name]]) _LT_DECL([], [install_override_mode], [1], [Permission mode override for installation of shared libraries]) _LT_DECL([], [postinstall_cmds], [2], [Command to use after installation of a shared archive]) _LT_DECL([], [postuninstall_cmds], [2], [Command to use after uninstallation of a shared archive]) _LT_DECL([], [finish_cmds], [2], [Commands used to finish a libtool library installation in a directory]) _LT_DECL([], [finish_eval], [1], [[As "finish_cmds", except a single script fragment to be evaled but not shown]]) _LT_DECL([], [hardcode_into_libs], [0], [Whether we should hardcode library paths into libraries]) _LT_DECL([], [sys_lib_search_path_spec], [2], [Compile-time system search path for libraries]) _LT_DECL([sys_lib_dlsearch_path_spec], [configure_time_dlsearch_path], [2], [Detected run-time system search path for libraries]) _LT_DECL([], [configure_time_lt_sys_library_path], [2], [Explicit LT_SYS_LIBRARY_PATH set during ./configure time]) ])# _LT_SYS_DYNAMIC_LINKER # _LT_PATH_TOOL_PREFIX(TOOL) # -------------------------- # find a file program that can recognize shared library AC_DEFUN([_LT_PATH_TOOL_PREFIX], [m4_require([_LT_DECL_EGREP])dnl AC_MSG_CHECKING([for $1]) AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, [case $MAGIC_CMD in [[\\/*] | ?:[\\/]*]) lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD=$MAGIC_CMD lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR dnl $ac_dummy forces splitting on constant user-supplied paths. dnl POSIX.2 word splitting is done only on the output of word expansions, dnl not every word. This closes a longstanding sh security hole. ac_dummy="m4_if([$2], , $PATH, [$2])" for ac_dir in $ac_dummy; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$1"; then lt_cv_path_MAGIC_CMD=$ac_dir/"$1" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD=$lt_cv_path_MAGIC_CMD if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS=$lt_save_ifs MAGIC_CMD=$lt_save_MAGIC_CMD ;; esac]) MAGIC_CMD=$lt_cv_path_MAGIC_CMD if test -n "$MAGIC_CMD"; then AC_MSG_RESULT($MAGIC_CMD) else AC_MSG_RESULT(no) fi _LT_DECL([], [MAGIC_CMD], [0], [Used to examine libraries when file_magic_cmd begins with "file"])dnl ])# _LT_PATH_TOOL_PREFIX # Old name: AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], []) # _LT_PATH_MAGIC # -------------- # find a file program that can recognize a shared library m4_defun([_LT_PATH_MAGIC], [_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) else MAGIC_CMD=: fi fi ])# _LT_PATH_MAGIC # LT_PATH_LD # ---------- # find the pathname to the GNU or non-GNU linker AC_DEFUN([LT_PATH_LD], [AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_PROG_ECHO_BACKSLASH])dnl AC_ARG_WITH([gnu-ld], [AS_HELP_STRING([--with-gnu-ld], [assume the C compiler uses GNU ld @<:@default=no@:>@])], [test no = "$withval" || with_gnu_ld=yes], [with_gnu_ld=no])dnl ac_prog=ld if test yes = "$GCC"; then # Check if gcc -print-prog-name=ld gives a path. AC_MSG_CHECKING([for ld used by $CC]) case $host in *-*-mingw*) # gcc leaves a trailing carriage return, which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [[\\/]]* | ?:[[\\/]]*) re_direlt='/[[^/]][[^/]]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD=$ac_prog ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test yes = "$with_gnu_ld"; then AC_MSG_CHECKING([for GNU ld]) else AC_MSG_CHECKING([for non-GNU ld]) fi AC_CACHE_VAL(lt_cv_path_LD, [if test -z "$LD"; then lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD=$ac_dir/$ac_prog # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &1 conftest.i cat conftest.i conftest.i >conftest2.i : ${lt_DD:=$DD} AC_PATH_PROGS_FEATURE_CHECK([lt_DD], [dd], [if "$ac_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=: fi]) rm -f conftest.i conftest2.i conftest.out]) ])# _LT_PATH_DD # _LT_CMD_TRUNCATE # ---------------- # find command to truncate a binary pipe m4_defun([_LT_CMD_TRUNCATE], [m4_require([_LT_PATH_DD]) AC_CACHE_CHECK([how to truncate binary pipes], [lt_cv_truncate_bin], [printf 0123456789abcdef0123456789abcdef >conftest.i cat conftest.i conftest.i >conftest2.i lt_cv_truncate_bin= if "$ac_cv_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1" fi rm -f conftest.i conftest2.i conftest.out test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q"]) _LT_DECL([lt_truncate_bin], [lt_cv_truncate_bin], [1], [Command to truncate a binary pipe]) ])# _LT_CMD_TRUNCATE # _LT_CHECK_MAGIC_METHOD # ---------------------- # how to check for library dependencies # -- PORTME fill in with the dynamic library characteristics m4_defun([_LT_CHECK_MAGIC_METHOD], [m4_require([_LT_DECL_EGREP]) m4_require([_LT_DECL_OBJDUMP]) AC_CACHE_CHECK([how to recognize dependent libraries], lt_cv_deplibs_check_method, [lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. # 'unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # 'file_magic [[regex]]' -- check by looking for files in library path # that responds to the $file_magic_cmd with a given extended regex. # If you have 'file' or equivalent on your system and you're not sure # whether 'pass_all' will *always* work, you probably want this one. case $host_os in aix[[4-9]]*) lt_cv_deplibs_check_method=pass_all ;; beos*) lt_cv_deplibs_check_method=pass_all ;; bsdi[[45]]*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)' lt_cv_file_magic_cmd='/usr/bin/file -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; cygwin*) # func_win32_libid is a shell function defined in ltmain.sh lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' ;; mingw* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. if ( file / ) >/dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; haiku*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'] lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[[3-9]]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) lt_cv_deplibs_check_method=pass_all ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd* | bitrig*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; os2*) lt_cv_deplibs_check_method=pass_all ;; esac ]) file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in mingw* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"` fi ;; esac fi file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown _LT_DECL([], [deplibs_check_method], [1], [Method to check whether dependent libraries are shared objects]) _LT_DECL([], [file_magic_cmd], [1], [Command to use when deplibs_check_method = "file_magic"]) _LT_DECL([], [file_magic_glob], [1], [How to find potential files when deplibs_check_method = "file_magic"]) _LT_DECL([], [want_nocaseglob], [1], [Find potential files using nocaseglob when deplibs_check_method = "file_magic"]) ])# _LT_CHECK_MAGIC_METHOD # LT_PATH_NM # ---------- # find the pathname to a BSD- or MS-compatible name lister AC_DEFUN([LT_PATH_NM], [AC_REQUIRE([AC_PROG_CC])dnl AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM, [if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM=$NM else lt_nm_to_check=${ac_tool_prefix}nm if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. tmp_nm=$ac_dir/$lt_tmp_nm if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then # Check to see if the nm accepts a BSD-compat flag. # Adding the 'sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file # MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty case $build_os in mingw*) lt_bad_file=conftest.nm/nofile ;; *) lt_bad_file=/dev/null ;; esac case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in *$lt_bad_file* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break 2 ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break 2 ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS=$lt_save_ifs done : ${lt_cv_path_NM=no} fi]) if test no != "$lt_cv_path_NM"; then NM=$lt_cv_path_NM else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :) case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols -headers" ;; *) DUMPBIN=: ;; esac fi AC_SUBST([DUMPBIN]) if test : != "$DUMPBIN"; then NM=$DUMPBIN fi fi test -z "$NM" && NM=nm AC_SUBST([NM]) _LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface], [lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD) cat conftest.out >&AS_MESSAGE_LOG_FD if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest*]) ])# LT_PATH_NM # Old names: AU_ALIAS([AM_PROG_NM], [LT_PATH_NM]) AU_ALIAS([AC_PROG_NM], [LT_PATH_NM]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_PROG_NM], []) dnl AC_DEFUN([AC_PROG_NM], []) # _LT_CHECK_SHAREDLIB_FROM_LINKLIB # -------------------------------- # how to determine the name of the shared library # associated with a specific link library. # -- PORTME fill in with the dynamic library characteristics m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB], [m4_require([_LT_DECL_EGREP]) m4_require([_LT_DECL_OBJDUMP]) m4_require([_LT_DECL_DLLTOOL]) AC_CACHE_CHECK([how to associate runtime and link libraries], lt_cv_sharedlib_from_linklib_cmd, [lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in cygwin* | mingw* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh; # decide which one to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ;; *) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ;; esac ;; *) # fallback: assume linklib IS sharedlib lt_cv_sharedlib_from_linklib_cmd=$ECHO ;; esac ]) sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO _LT_DECL([], [sharedlib_from_linklib_cmd], [1], [Command to associate shared and link libraries]) ])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB # _LT_PATH_MANIFEST_TOOL # ---------------------- # locate the manifest tool m4_defun([_LT_PATH_MANIFEST_TOOL], [AC_CHECK_TOOL(MANIFEST_TOOL, mt, :) test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool], [lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&AS_MESSAGE_LOG_FD if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_mainfest_tool=yes fi rm -f conftest*]) if test yes != "$lt_cv_path_mainfest_tool"; then MANIFEST_TOOL=: fi _LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl ])# _LT_PATH_MANIFEST_TOOL # _LT_DLL_DEF_P([FILE]) # --------------------- # True iff FILE is a Windows DLL '.def' file. # Keep in sync with func_dll_def_p in the libtool script AC_DEFUN([_LT_DLL_DEF_P], [dnl test DEF = "`$SED -n dnl -e '\''s/^[[ ]]*//'\'' dnl Strip leading whitespace -e '\''/^\(;.*\)*$/d'\'' dnl Delete empty lines and comments -e '\''s/^\(EXPORTS\|LIBRARY\)\([[ ]].*\)*$/DEF/p'\'' dnl -e q dnl Only consider the first "real" line $1`" dnl ])# _LT_DLL_DEF_P # LT_LIB_M # -------- # check for math library AC_DEFUN([LT_LIB_M], [AC_REQUIRE([AC_CANONICAL_HOST])dnl LIBM= case $host in *-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*) # These system don't have libm, or don't need it ;; *-ncr-sysv4.3*) AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM=-lmw) AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") ;; *) AC_CHECK_LIB(m, cos, LIBM=-lm) ;; esac AC_SUBST([LIBM]) ])# LT_LIB_M # Old name: AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_CHECK_LIBM], []) # _LT_COMPILER_NO_RTTI([TAGNAME]) # ------------------------------- m4_defun([_LT_COMPILER_NO_RTTI], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= if test yes = "$GCC"; then case $cc_basename in nvcc*) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;; *) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;; esac _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], lt_cv_prog_compiler_rtti_exceptions, [-fno-rtti -fno-exceptions], [], [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) fi _LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1], [Compiler flag to turn off builtin functions]) ])# _LT_COMPILER_NO_RTTI # _LT_CMD_GLOBAL_SYMBOLS # ---------------------- m4_defun([_LT_CMD_GLOBAL_SYMBOLS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([LT_PATH_NM])dnl AC_REQUIRE([LT_PATH_LD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_TAG_COMPILER])dnl # Check for command to grab the raw symbol name followed by C symbol from nm. AC_MSG_CHECKING([command to parse $NM output from $compiler object]) AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], [ # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[[BCDEGRST]]' # Regexp to match symbols that can be accessed directly from C. sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[[BCDT]]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[[ABCDGISTW]]' ;; hpux*) if test ia64 = "$host_cpu"; then symcode='[[ABCDEGRST]]' fi ;; irix* | nonstopux*) symcode='[[BCDEGRST]]' ;; osf*) symcode='[[BCDEGQRST]]' ;; solaris*) symcode='[[BDRT]]' ;; sco3.2v5*) symcode='[[DT]]' ;; sysv4.2uw2*) symcode='[[DT]]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[[ABDT]]' ;; sysv4) symcode='[[DFNSTU]]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[[ABCDGIRSTW]]' ;; esac if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Gets list of data symbols to import. lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'" # Adjust the below global symbol transforms to fixup imported variables. lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'" lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'" lt_c_name_lib_hook="\ -e 's/^I .* \(lib.*\)$/ {\"\1\", (void *) 0},/p'\ -e 's/^I .* \(.*\)$/ {\"lib\1\", (void *) 0},/p'" else # Disable hooks by default. lt_cv_sys_global_symbol_to_import= lt_cdecl_hook= lt_c_name_hook= lt_c_name_lib_hook= fi # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="sed -n"\ $lt_cdecl_hook\ " -e 's/^T .* \(.*\)$/extern int \1();/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n"\ $lt_c_name_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'" # Transform an extracted symbol line into symbol name with lib prefix and # symbol address. lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\ $lt_c_name_lib_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"lib\1\", (void *) \&\1},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function, # D for any global variable and I for any imported variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK ['"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\ " /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\ " /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\ " {split(\$ 0,a,/\||\r/); split(a[2],s)};"\ " s[1]~/^[@?]/{print f,s[1],s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx]" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if AC_TRY_EVAL(ac_compile); then # Now try to grab the symbols. nlist=conftest.nm if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE /* DATA imports from DLLs on WIN32 can't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT@&t@_DLSYM_CONST #elif defined __osf__ /* This system does not cope well with relocations in const data. */ # define LT@&t@_DLSYM_CONST #else # define LT@&t@_DLSYM_CONST const #endif #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ LT@&t@_DLSYM_CONST struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[[]] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS LIBS=conftstm.$ac_objext CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" if AC_TRY_EVAL(ac_link) && test -s conftest$ac_exeext; then pipe_works=yes fi LIBS=$lt_globsym_save_LIBS CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD fi else echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test yes = "$pipe_works"; then break else lt_cv_sys_global_symbol_pipe= fi done ]) if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then AC_MSG_RESULT(failed) else AC_MSG_RESULT(ok) fi # Response file support. if test "$lt_cv_nm_interface" = "MS dumpbin"; then nm_file_list_spec='@' elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then nm_file_list_spec='@' fi _LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1], [Take the output of nm and produce a listing of raw symbols and C names]) _LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1], [Transform the output of nm in a proper C declaration]) _LT_DECL([global_symbol_to_import], [lt_cv_sys_global_symbol_to_import], [1], [Transform the output of nm into a list of symbols to manually relocate]) _LT_DECL([global_symbol_to_c_name_address], [lt_cv_sys_global_symbol_to_c_name_address], [1], [Transform the output of nm in a C name address pair]) _LT_DECL([global_symbol_to_c_name_address_lib_prefix], [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1], [Transform the output of nm in a C name address pair when lib prefix is needed]) _LT_DECL([nm_interface], [lt_cv_nm_interface], [1], [The name lister interface]) _LT_DECL([], [nm_file_list_spec], [1], [Specify filename containing input files for $NM]) ]) # _LT_CMD_GLOBAL_SYMBOLS # _LT_COMPILER_PIC([TAGNAME]) # --------------------------- m4_defun([_LT_COMPILER_PIC], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_wl, $1)= _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)= m4_if([$1], [CXX], [ # C++ specific cases for pic, static, wl, etc. if test yes = "$GXX"; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the '-m68020' flag to GCC prevents building anything better, # like '-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) case $host_os in os2*) _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static' ;; esac ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. _LT_TAGVAR(lt_prog_compiler_static, $1)= ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac else case $host_os in aix[[4-9]]*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; esac ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; dgux*) case $cc_basename in ec++*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; ghcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; freebsd* | dragonfly*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive' if test ia64 != "$host_cpu"; then _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' fi ;; aCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac ;; *) ;; esac ;; interix*) # This is c89, which is MS Visual C++ (no shared libs) # Anyone wants to do a port? ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # KAI C++ Compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; ecpc* ) # old Intel C++ for x86_64, which still supported -KPIC. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; icpc* ) # Intel C++, used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; pgCC* | pgcpp*) # Portland Group C++ compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; cxx*) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL 8.0, 9.0 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; esac ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' ;; *) ;; esac ;; netbsd*) ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; cxx*) # Digital/Compaq C++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; *) ;; esac ;; psos*) ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; lcc*) # Lucid _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; *) ;; esac ;; vxworks*) ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ], [ if test yes = "$GCC"; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the '-m68020' flag to GCC prevents building anything better, # like '-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) case $host_os in os2*) _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static' ;; esac ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. _LT_TAGVAR(lt_prog_compiler_static, $1)= ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker ' if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)" fi ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' case $cc_basename in nagfor*) # NAG Fortran compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) case $host_os in os2*) _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static' ;; esac ;; hpux9* | hpux10* | hpux11*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC (with -KPIC) is the default. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in # old Intel for x86_64, which still supported -KPIC. ecc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # Lahey Fortran 8.1. lf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared' _LT_TAGVAR(lt_prog_compiler_static, $1)='--static' ;; nagfor*) # NAG Fortran compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; tcc*) # Fabrice Bellard et al's Tiny C Compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; ccc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All Alpha code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='' ;; *Sun\ F* | *Sun*Fortran*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ;; *Intel*\ [[CF]]*Compiler*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; *Portland\ Group*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; esac ;; newsos6) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All OSF/1 code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; rdos*) _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; solaris*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; *) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; esac ;; sunos4*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; unicos*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; uts4*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ]) case $host_os in # For platforms that do not support PIC, -DPIC is meaningless: *djgpp*) _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])" ;; esac AC_CACHE_CHECK([for $compiler option to produce PIC], [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) _LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1) # # Check to make sure the PIC flag actually works. # if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works], [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)], [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [], [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in "" | " "*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;; esac], [_LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) fi _LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1], [Additional compiler flags for building library objects]) _LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], [How to pass a linker flag through the compiler]) # # Check to make sure the static flag actually works. # wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\" _LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1), $lt_tmp_static_flag, [], [_LT_TAGVAR(lt_prog_compiler_static, $1)=]) _LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1], [Compiler flag to prevent dynamic linking]) ])# _LT_COMPILER_PIC # _LT_LINKER_SHLIBS([TAGNAME]) # ---------------------------- # See if the linker supports building shared libraries. m4_defun([_LT_LINKER_SHLIBS], [AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl m4_require([_LT_PATH_MANIFEST_TOOL])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) m4_if([$1], [CXX], [ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] case $host_os in aix[[4-9]]*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to GNU nm, but means don't demangle to AIX nm. # Without the "-l" option, or with the "-B" option, AIX nm treats # weak defined symbols like other global defined symbols, whereas # GNU nm marks them as "W". # While the 'weak' keyword is ignored in the Export File, we need # it in the Import File for the 'aix-soname' feature, so we have # to replace the "-B" option with "-P" for AIX nm. if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi ;; pw32*) _LT_TAGVAR(export_symbols_cmds, $1)=$ltdll_cmds ;; cygwin* | mingw* | cegcc*) case $cc_basename in cl*) _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] ;; esac ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac ], [ runpath_var= _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_cmds, $1)= _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(old_archive_from_new_cmds, $1)= _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)= _LT_TAGVAR(thread_safe_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list _LT_TAGVAR(include_expsyms, $1)= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ' (' and ')$', so one must not match beginning or # end of line. Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc', # as well as any symbol that contains 'd'. _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. dnl Note also adjust exclude_expsyms for C++ above. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test yes != "$GCC"; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd* | bitrig*) with_gnu_ld=no ;; esac _LT_TAGVAR(ld_shlibs, $1)=yes # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no if test yes = "$with_gnu_ld"; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility # with the native linker. However, as the warning in the GNU ld # block says, versions before 2.19.5* couldn't really create working # shared libraries, regardless of the interface used. case `$LD -v 2>&1` in *\ \(GNU\ Binutils\)\ 2.19.5*) ;; *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;; *\ \(GNU\ Binutils\)\ [[3-9]]*) ;; *) lt_use_gnu_ld_interface=yes ;; esac ;; *) lt_use_gnu_ld_interface=yes ;; esac fi if test yes = "$lt_use_gnu_ld_interface"; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='$wl' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi supports_anon_versioning=no case `$LD -v | $SED -e 's/([^)]\+)\s\+//' 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[[3-9]]*) # On AIX/PPC, the GNU linker is very broken if test ia64 != "$host_cpu"; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file, use it as # is; otherwise, prepend EXPORTS... _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes ;; os2*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported shrext_cmds=.dll _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test linux-dietlibc = "$host_os"; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test no = "$tmp_diet" then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 _LT_TAGVAR(whole_archive_flag_spec, $1)= tmp_sharedflag='--shared' ;; nagfor*) # NAGFOR 5.3 tmp_sharedflag='-Wl,-shared' ;; xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' if test yes = "$supports_anon_versioning"; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi case $cc_basename in tcc*) _LT_TAGVAR(export_dynamic_flag_spec, $1)='-rdynamic' ;; xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test yes = "$supports_anon_versioning"; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; sunos4*) _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac if test no = "$_LT_TAGVAR(ld_shlibs, $1)"; then runpath_var= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. _LT_TAGVAR(hardcode_minus_L, $1)=yes if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. _LT_TAGVAR(hardcode_direct, $1)=unsupported fi ;; aix[[4-9]]*) if test ia64 = "$host_cpu"; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag= else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to GNU nm, but means don't demangle to AIX nm. # Without the "-l" option, or with the "-B" option, AIX nm treats # weak defined symbols like other global defined symbols, whereas # GNU nm marks them as "W". # While the 'weak' keyword is ignored in the Export File, we need # it in the Import File for the 'aix-soname' feature, so we have # to replace the "-B" option with "-P" for AIX nm. if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # have runtime linking enabled, and use it for executables. # For shared libraries, we enable/disable runtime linking # depending on the kind of the shared library created - # when "with_aix_soname,aix_use_runtimelinking" is: # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables # "aix,yes" lib.so shared, rtl:yes, for executables # lib.a static archive # "both,no" lib.so.V(shr.o) shared, rtl:yes # lib.a(lib.so.V) shared, rtl:no, for executables # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a(lib.so.V) shared, rtl:no # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a static archive case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then aix_use_runtimelinking=yes break fi done if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then # With aix-soname=svr4, we create the lib.so.V shared archives only, # so we don't have lib.a shared libs to link our executables. # We have to force runtime linking in this case. aix_use_runtimelinking=yes LDFLAGS="$LDFLAGS -Wl,-brtl" fi ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='$wl-f,' case $with_aix_soname,$aix_use_runtimelinking in aix,*) ;; # traditional, no import file svr4,* | *,yes) # use import file # The Import File defines what to hardcode. _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no ;; esac if test yes = "$GCC"; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`$CC -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi ;; esac shared_flag='-shared' if test yes = "$aix_use_runtimelinking"; then shared_flag="$shared_flag "'$wl-G' fi # Need to ensure runtime linking is disabled for the traditional # shared library, or the linker may eventually find shared libraries # /with/ Import File - we do not want to mix them. shared_flag_aix='-shared' shared_flag_svr4='-shared $wl-G' else # not using gcc if test ia64 = "$host_cpu"; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test yes = "$aix_use_runtimelinking"; then shared_flag='$wl-G' else shared_flag='$wl-bM:SRE' fi shared_flag_aix='$wl-bM:SRE' shared_flag_svr4='$wl-G' fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. _LT_TAGVAR(always_export_symbols, $1)=yes if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag else if test ia64 = "$host_cpu"; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok' if test yes = "$with_gnu_ld"; then # We only use this code for GNU lds that support --whole-archive. _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' # -brtl affects multiple linker settings, -berok does not and is overridden later compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`' if test svr4 != "$with_aix_soname"; then # This is similar to how AIX traditionally builds its shared libraries. _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' fi if test aix != "$with_aix_soname"; then _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' else # used by -dlpreopen to get the symbols _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV $output_objdir/$realname.d/$soname $output_objdir' fi _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; bsdi[[45]]*) _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl*) # Native MSVC _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then cp "$export_symbols" "$output_objdir/$soname.def"; echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; else $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile=$lt_outputfile.exe lt_tool_outputfile=$lt_tool_outputfile.exe ;; esac~ if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # Assume MSVC wrapper _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' # FIXME: Should let the user specify the lib program. _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; esac ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; dgux*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2.*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; hpux9*) if test yes = "$GCC"; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' else _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' ;; hpux10*) if test yes,no = "$GCC,$with_gnu_ld"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test no = "$with_gnu_ld"; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes fi ;; hpux11*) if test yes,no = "$GCC,$with_gnu_ld"; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) m4_if($1, [], [ # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) _LT_LINKER_OPTION([if $CC understands -b], _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b], [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'], [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])], [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags']) ;; esac fi if test no = "$with_gnu_ld"; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test yes = "$GCC"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol], [lt_cv_irix_exported_symbol], [save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null" AC_LINK_IFELSE( [AC_LANG_SOURCE( [AC_LANG_CASE([C], [[int foo (void) { return 0; }]], [C++], [[int foo (void) { return 0; }]], [Fortran 77], [[ subroutine foo end]], [Fortran], [[ subroutine foo end]])])], [lt_cv_irix_exported_symbol=yes], [lt_cv_irix_exported_symbol=no]) LDFLAGS=$save_LDFLAGS]) if test yes = "$lt_cv_irix_exported_symbol"; then _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib' fi else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes _LT_TAGVAR(link_all_deplibs, $1)=yes ;; linux*) case $cc_basename in tcc*) # Fabrice Bellard et al's Tiny C Compiler _LT_TAGVAR(ld_shlibs, $1)=yes _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; newsos6) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *nto* | *qnx*) ;; openbsd* | bitrig*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' fi else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; os2*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported shrext_cmds=.dll _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; osf3*) if test yes = "$GCC"; then _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test yes = "$GCC"; then _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; solaris*) _LT_TAGVAR(no_undefined_flag, $1)=' -z defs' if test yes = "$GCC"; then wlarc='$wl' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' _LT_TAGVAR(archive_cmds, $1)='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='$wl' _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands '-z linker_flag'. GCC discards it without '$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test yes = "$GCC"; then _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' else _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' fi ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes ;; sunos4*) if test sequent = "$host_vendor"; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4) case $host_vendor in sni) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' _LT_TAGVAR(hardcode_direct, $1)=no ;; motorola) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4.3*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes _LT_TAGVAR(ld_shlibs, $1)=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' if test yes = "$GCC"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We CANNOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport' runpath_var='LD_RUN_PATH' if test yes = "$GCC"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(ld_shlibs, $1)=no ;; esac if test sni = "$host_vendor"; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Blargedynsym' ;; esac fi fi ]) AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no _LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld _LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl _LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl _LT_DECL([], [extract_expsyms_cmds], [2], [The commands to extract the exported symbol list from a shared archive]) # # Do we need to explicitly link libc? # case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in x|xyes) # Assume -lc should be added _LT_TAGVAR(archive_cmds_need_lc, $1)=yes if test yes,yes = "$GCC,$enable_shared"; then case $_LT_TAGVAR(archive_cmds, $1) in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. AC_CACHE_CHECK([whether -lc should be explicitly linked in], [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1), [$RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if AC_TRY_EVAL(ac_compile) 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) _LT_TAGVAR(allow_undefined_flag, $1)= if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) then lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no else lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes fi _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* ]) _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1) ;; esac fi ;; esac _LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0], [Whether or not to add -lc for building shared libraries]) _LT_TAGDECL([allow_libtool_libs_with_static_runtimes], [enable_shared_with_static_runtimes], [0], [Whether or not to disallow shared libs when runtime libs are static]) _LT_TAGDECL([], [export_dynamic_flag_spec], [1], [Compiler flag to allow reflexive dlopens]) _LT_TAGDECL([], [whole_archive_flag_spec], [1], [Compiler flag to generate shared objects directly from archives]) _LT_TAGDECL([], [compiler_needs_object], [1], [Whether the compiler copes with passing no objects directly]) _LT_TAGDECL([], [old_archive_from_new_cmds], [2], [Create an old-style archive from a shared archive]) _LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2], [Create a temporary old-style archive to link instead of a shared archive]) _LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive]) _LT_TAGDECL([], [archive_expsym_cmds], [2]) _LT_TAGDECL([], [module_cmds], [2], [Commands used to build a loadable module if different from building a shared archive.]) _LT_TAGDECL([], [module_expsym_cmds], [2]) _LT_TAGDECL([], [with_gnu_ld], [1], [Whether we are building with GNU ld or not]) _LT_TAGDECL([], [allow_undefined_flag], [1], [Flag that allows shared libraries with undefined symbols to be built]) _LT_TAGDECL([], [no_undefined_flag], [1], [Flag that enforces no undefined symbols]) _LT_TAGDECL([], [hardcode_libdir_flag_spec], [1], [Flag to hardcode $libdir into a binary during linking. This must work even if $libdir does not exist]) _LT_TAGDECL([], [hardcode_libdir_separator], [1], [Whether we need a single "-rpath" flag with a separated argument]) _LT_TAGDECL([], [hardcode_direct], [0], [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_direct_absolute], [0], [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes DIR into the resulting binary and the resulting library dependency is "absolute", i.e impossible to change by setting $shlibpath_var if the library is relocated]) _LT_TAGDECL([], [hardcode_minus_L], [0], [Set to "yes" if using the -LDIR flag during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_shlibpath_var], [0], [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_automatic], [0], [Set to "yes" if building a shared library automatically hardcodes DIR into the library and all subsequent libraries and executables linked against it]) _LT_TAGDECL([], [inherit_rpath], [0], [Set to yes if linker adds runtime paths of dependent libraries to runtime path list]) _LT_TAGDECL([], [link_all_deplibs], [0], [Whether libtool must link a program against all its dependency libraries]) _LT_TAGDECL([], [always_export_symbols], [0], [Set to "yes" if exported symbols are required]) _LT_TAGDECL([], [export_symbols_cmds], [2], [The commands to list exported symbols]) _LT_TAGDECL([], [exclude_expsyms], [1], [Symbols that should not be listed in the preloaded symbols]) _LT_TAGDECL([], [include_expsyms], [1], [Symbols that must always be exported]) _LT_TAGDECL([], [prelink_cmds], [2], [Commands necessary for linking programs (against libraries) with templates]) _LT_TAGDECL([], [postlink_cmds], [2], [Commands necessary for finishing linking programs]) _LT_TAGDECL([], [file_list_spec], [1], [Specify filename containing input files]) dnl FIXME: Not yet implemented dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1], dnl [Compiler flag to generate thread safe objects]) ])# _LT_LINKER_SHLIBS # _LT_LANG_C_CONFIG([TAG]) # ------------------------ # Ensure that the configuration variables for a C compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to 'libtool'. m4_defun([_LT_LANG_C_CONFIG], [m4_require([_LT_DECL_EGREP])dnl lt_save_CC=$CC AC_LANG_PUSH(C) # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' _LT_TAG_COMPILER # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) LT_SYS_DLOPEN_SELF _LT_CMD_STRIPLIB # Report what library types will actually be built AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test no = "$can_build_shared" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test ia64 != "$host_cpu"; then case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in yes,aix,yes) ;; # shared object as lib.so file only yes,svr4,*) ;; # shared object as lib.so archive member only yes,*) enable_static=no ;; # shared object in lib.a archive as well esac fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test yes = "$enable_shared" || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_CONFIG($1) fi AC_LANG_POP CC=$lt_save_CC ])# _LT_LANG_C_CONFIG # _LT_LANG_CXX_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a C++ compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to 'libtool'. m4_defun([_LT_LANG_CXX_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_PATH_MANIFEST_TOOL])dnl if test -n "$CXX" && ( test no != "$CXX" && ( (test g++ = "$CXX" && `g++ -v >/dev/null 2>&1` ) || (test g++ != "$CXX"))); then AC_PROG_CXXCPP else _lt_caught_CXX_error=yes fi AC_LANG_PUSH(C++) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the CXX compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test yes != "$_lt_caught_CXX_error"; then # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else $as_unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else $as_unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} CFLAGS=$CXXFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then # We don't want -fno-exception when compiling C++ code, so set the # no_builtin_flag separately if test yes = "$GXX"; then _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' else _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= fi if test yes = "$GXX"; then # Set up default GNU C++ configuration LT_PATH_LD # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test yes = "$with_gnu_ld"; then _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) wlarc='$wl' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else with_gnu_ld=no wlarc= # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) _LT_TAGVAR(ld_shlibs, $1)=yes case $host_os in aix3*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aix[[4-9]]*) if test ia64 = "$host_cpu"; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag= else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # have runtime linking enabled, and use it for executables. # For shared libraries, we enable/disable runtime linking # depending on the kind of the shared library created - # when "with_aix_soname,aix_use_runtimelinking" is: # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables # "aix,yes" lib.so shared, rtl:yes, for executables # lib.a static archive # "both,no" lib.so.V(shr.o) shared, rtl:yes # lib.a(lib.so.V) shared, rtl:no, for executables # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a(lib.so.V) shared, rtl:no # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a static archive case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac done if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then # With aix-soname=svr4, we create the lib.so.V shared archives only, # so we don't have lib.a shared libs to link our executables. # We have to force runtime linking in this case. aix_use_runtimelinking=yes LDFLAGS="$LDFLAGS -Wl,-brtl" fi ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='$wl-f,' case $with_aix_soname,$aix_use_runtimelinking in aix,*) ;; # no import file svr4,* | *,yes) # use import file # The Import File defines what to hardcode. _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no ;; esac if test yes = "$GXX"; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`$CC -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi esac shared_flag='-shared' if test yes = "$aix_use_runtimelinking"; then shared_flag=$shared_flag' $wl-G' fi # Need to ensure runtime linking is disabled for the traditional # shared library, or the linker may eventually find shared libraries # /with/ Import File - we do not want to mix them. shared_flag_aix='-shared' shared_flag_svr4='-shared $wl-G' else # not using gcc if test ia64 = "$host_cpu"; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test yes = "$aix_use_runtimelinking"; then shared_flag='$wl-G' else shared_flag='$wl-bM:SRE' fi shared_flag_aix='$wl-bM:SRE' shared_flag_svr4='$wl-G' fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to # export. _LT_TAGVAR(always_export_symbols, $1)=yes if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. # The "-G" linker flag allows undefined symbols. _LT_TAGVAR(no_undefined_flag, $1)='-bernotok' # Determine the default libpath from the value encoded in an empty # executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag else if test ia64 = "$host_cpu"; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok' if test yes = "$with_gnu_ld"; then # We only use this code for GNU lds that support --whole-archive. _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' # -brtl affects multiple linker settings, -berok does not and is overridden later compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`' if test svr4 != "$with_aix_soname"; then # This is similar to how AIX traditionally builds its shared # libraries. Need -bnortl late, we may have -brtl in LDFLAGS. _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' fi if test aix != "$with_aix_soname"; then _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' else # used by -dlpreopen to get the symbols _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV $output_objdir/$realname.d/$soname $output_objdir' fi _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d' fi fi ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; cygwin* | mingw* | pw32* | cegcc*) case $GXX,$cc_basename in ,cl* | no,cl*) # Native MSVC # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then cp "$export_symbols" "$output_objdir/$soname.def"; echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; else $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile=$lt_outputfile.exe lt_tool_outputfile=$lt_tool_outputfile.exe ;; esac~ func_to_tool_file "$lt_outputfile"~ if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # g++ # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file, use it as # is; otherwise, prepend EXPORTS... _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; os2*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported shrext_cmds=.dll _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; dgux*) case $cc_basename in ec++*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; ghcx*) # Green Hills C++ Compiler # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; freebsd2.*) # C++ shared libraries reported to be fairly broken before # switch to ELF _LT_TAGVAR(ld_shlibs, $1)=no ;; freebsd-elf*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; freebsd* | dragonfly*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions _LT_TAGVAR(ld_shlibs, $1)=yes ;; haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes ;; hpux9*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes = "$GXX"; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; hpux10*|hpux11*) if test no = "$with_gnu_ld"; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) ;; *) _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' ;; esac fi case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes = "$GXX"; then if test no = "$with_gnu_ld"; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in CC*) # SGI C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test yes = "$GXX"; then if test no = "$with_gnu_ld"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` -o $lib' fi fi _LT_TAGVAR(link_all_deplibs, $1)=yes ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib $wl-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc* | ecpc* ) # Intel C++ with_gnu_ld=yes # version 8.0 and above of icpc choke on multiply defined symbols # if we add $predep_objects and $postdep_objects, however 7.1 and # earlier do not add the objects themselves. case `$CC -V 2>&1` in *"Version 7."*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 8.0 or newer tmp_idyn= case $host_cpu in ia64*) tmp_idyn=' -i_dynamic';; esac _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; esac _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive' ;; pgCC* | pgcpp*) # Portland Group C++ compiler case `$CC -V` in *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*) _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ $RANLIB $oldlib' _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 6 and above use weak symbols _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl--rpath $wl$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' ;; cxx*) # Compaq C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib $wl-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' ;; xl* | mpixl* | bgxl*) # IBM XL 8.0 on PPC, with GNU ld _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' if test yes = "$supports_anon_versioning"; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file $wl$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes # Not sure whether something based on # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 # would be better. output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; esac ;; esac ;; lynxos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; m88k*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; *nto* | *qnx*) _LT_TAGVAR(ld_shlibs, $1)=yes ;; openbsd* | bitrig*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`"; then _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file,$export_symbols -o $lib' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' fi output_verbose_link_cmd=func_echo_all else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Archives containing C++ object files must be created using # the KAI C++ compiler. case $host in osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; esac ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; cxx*) case $host in osf3*) _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $soname `test -n "$verstring" && func_echo_all "$wl-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' ;; *) _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname $wl-input $wl$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~ $RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' ;; esac _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes,no = "$GXX,$with_gnu_ld"; then _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' case $host in osf3*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(archive_cmds_need_lc,$1)=yes _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G$allow_undefined_flag $wl-M $wl$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands '-z linker_flag'. # Supported since Solaris 2.6 (maybe 2.5.1?) _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test yes,no = "$GXX,$with_gnu_ld"; then _LT_TAGVAR(no_undefined_flag, $1)=' $wl-z ${wl}defs' if $CC --version | $GREP -v '^2\.7' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # g++ 2.7 appears to require '-G' NOT '-shared' on this # platform. _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $wl$libdir' case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' ;; esac fi ;; esac ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We CANNOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~ '"$_LT_TAGVAR(old_archive_cmds, $1)" _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~ '"$_LT_TAGVAR(reload_cmds, $1)" ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no _LT_TAGVAR(GCC, $1)=$GXX _LT_TAGVAR(LD, $1)=$LD ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld fi # test yes != "$_lt_caught_CXX_error" AC_LANG_POP ])# _LT_LANG_CXX_CONFIG # _LT_FUNC_STRIPNAME_CNF # ---------------------- # func_stripname_cnf prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). # # This function is identical to the (non-XSI) version of func_stripname, # except this one can be used by m4 code that may be executed by configure, # rather than the libtool script. m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl AC_REQUIRE([_LT_DECL_SED]) AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH]) func_stripname_cnf () { case @S|@2 in .*) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%\\\\@S|@2\$%%"`;; *) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%@S|@2\$%%"`;; esac } # func_stripname_cnf ])# _LT_FUNC_STRIPNAME_CNF # _LT_SYS_HIDDEN_LIBDEPS([TAGNAME]) # --------------------------------- # Figure out "hidden" library dependencies from verbose # compiler output when linking a shared library. # Parse the compiler output and extract the necessary # objects, libraries and library flags. m4_defun([_LT_SYS_HIDDEN_LIBDEPS], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl # Dependencies to place before and after the object being linked: _LT_TAGVAR(predep_objects, $1)= _LT_TAGVAR(postdep_objects, $1)= _LT_TAGVAR(predeps, $1)= _LT_TAGVAR(postdeps, $1)= _LT_TAGVAR(compiler_lib_search_path, $1)= dnl we can't use the lt_simple_compile_test_code here, dnl because it contains code intended for an executable, dnl not a library. It's possible we should let each dnl tag define a new lt_????_link_test_code variable, dnl but it's only used here... m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF int a; void foo (void) { a = 0; } _LT_EOF ], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF class Foo { public: Foo (void) { a = 0; } private: int a; }; _LT_EOF ], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer*4 a a=0 return end _LT_EOF ], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer a a=0 return end _LT_EOF ], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF public class foo { private int a; public void bar (void) { a = 0; } }; _LT_EOF ], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF package foo func foo() { } _LT_EOF ]) _lt_libdeps_save_CFLAGS=$CFLAGS case "$CC $CFLAGS " in #( *\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; *\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; *\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; esac dnl Parse the compiler output and extract the necessary dnl objects, libraries and library flags. if AC_TRY_EVAL(ac_compile); then # Parse the compiler output and extract the necessary # objects, libraries and library flags. # Sentinel used to keep track of whether or not we are before # the conftest object file. pre_test_object_deps_done=no for p in `eval "$output_verbose_link_cmd"`; do case $prev$p in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. # Remove the space. if test x-L = "$p" || test x-R = "$p"; then prev=$p continue fi # Expand the sysroot to ease extracting the directories later. if test -z "$prev"; then case $p in -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; esac fi case $p in =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; esac if test no = "$pre_test_object_deps_done"; then case $prev in -L | -R) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then _LT_TAGVAR(compiler_lib_search_path, $1)=$prev$p else _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} $prev$p" fi ;; # The "-l" case would never come before the object being # linked, so don't bother handling this case. esac else if test -z "$_LT_TAGVAR(postdeps, $1)"; then _LT_TAGVAR(postdeps, $1)=$prev$p else _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} $prev$p" fi fi prev= ;; *.lto.$objext) ;; # Ignore GCC LTO objects *.$objext) # This assumes that the test object file only shows up # once in the compiler output. if test "$p" = "conftest.$objext"; then pre_test_object_deps_done=yes continue fi if test no = "$pre_test_object_deps_done"; then if test -z "$_LT_TAGVAR(predep_objects, $1)"; then _LT_TAGVAR(predep_objects, $1)=$p else _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p" fi else if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then _LT_TAGVAR(postdep_objects, $1)=$p else _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p" fi fi ;; *) ;; # Ignore the rest. esac done # Clean up. rm -f a.out a.exe else echo "libtool.m4: error: problem compiling $1 test program" fi $RM -f confest.$objext CFLAGS=$_lt_libdeps_save_CFLAGS # PORTME: override above test on systems where it is broken m4_if([$1], [CXX], [case $host_os in interix[[3-9]]*) # Interix 3.5 installs completely hosed .la files for C++, so rather than # hack all around it, let's just trust "g++" to DTRT. _LT_TAGVAR(predep_objects,$1)= _LT_TAGVAR(postdep_objects,$1)= _LT_TAGVAR(postdeps,$1)= ;; esac ]) case " $_LT_TAGVAR(postdeps, $1) " in *" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; esac _LT_TAGVAR(compiler_lib_search_dirs, $1)= if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | $SED -e 's! -L! !g' -e 's!^ !!'` fi _LT_TAGDECL([], [compiler_lib_search_dirs], [1], [The directories searched by this compiler when creating a shared library]) _LT_TAGDECL([], [predep_objects], [1], [Dependencies to place before and after the objects being linked to create a shared library]) _LT_TAGDECL([], [postdep_objects], [1]) _LT_TAGDECL([], [predeps], [1]) _LT_TAGDECL([], [postdeps], [1]) _LT_TAGDECL([], [compiler_lib_search_path], [1], [The library search path used internally by the compiler when linking a shared library]) ])# _LT_SYS_HIDDEN_LIBDEPS # _LT_LANG_F77_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a Fortran 77 compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_F77_CONFIG], [AC_LANG_PUSH(Fortran 77) if test -z "$F77" || test no = "$F77"; then _lt_disable_F77=yes fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for f77 test sources. ac_ext=f # Object file extension for compiled f77 test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the F77 compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test yes != "$_lt_disable_F77"; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${F77-"f77"} CFLAGS=$FFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) GCC=$G77 if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test no = "$can_build_shared" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test ia64 != "$host_cpu"; then case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in yes,aix,yes) ;; # shared object as lib.so file only yes,svr4,*) ;; # shared object as lib.so archive member only yes,*) enable_static=no ;; # shared object in lib.a archive as well esac fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test yes = "$enable_shared" || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)=$G77 _LT_TAGVAR(LD, $1)=$LD ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS fi # test yes != "$_lt_disable_F77" AC_LANG_POP ])# _LT_LANG_F77_CONFIG # _LT_LANG_FC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for a Fortran compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_FC_CONFIG], [AC_LANG_PUSH(Fortran) if test -z "$FC" || test no = "$FC"; then _lt_disable_FC=yes fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for fc test sources. ac_ext=${ac_fc_srcext-f} # Object file extension for compiled fc test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the FC compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test yes != "$_lt_disable_FC"; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${FC-"f95"} CFLAGS=$FCFLAGS compiler=$CC GCC=$ac_cv_fc_compiler_gnu _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test no = "$can_build_shared" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test ia64 != "$host_cpu"; then case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in yes,aix,yes) ;; # shared object as lib.so file only yes,svr4,*) ;; # shared object as lib.so archive member only yes,*) enable_static=no ;; # shared object in lib.a archive as well esac fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test yes = "$enable_shared" || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)=$ac_cv_fc_compiler_gnu _LT_TAGVAR(LD, $1)=$LD ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS fi # test yes != "$_lt_disable_FC" AC_LANG_POP ])# _LT_LANG_FC_CONFIG # _LT_LANG_GCJ_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for the GNU Java Compiler compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_GCJ_CONFIG], [AC_REQUIRE([LT_PROG_GCJ])dnl AC_LANG_SAVE # Source file extension for Java test sources. ac_ext=java # Object file extension for compiled Java test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="class foo {}" # Code to be used in simple link tests lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC=yes CC=${GCJ-"gcj"} CFLAGS=$GCJFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)=$LD _LT_CC_BASENAME([$compiler]) # GCJ did not exist at the time GCC didn't implicitly link libc in. _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi AC_LANG_RESTORE GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GCJ_CONFIG # _LT_LANG_GO_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for the GNU Go compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_GO_CONFIG], [AC_REQUIRE([LT_PROG_GO])dnl AC_LANG_SAVE # Source file extension for Go test sources. ac_ext=go # Object file extension for compiled Go test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="package main; func main() { }" # Code to be used in simple link tests lt_simple_link_test_code='package main; func main() { }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC=yes CC=${GOC-"gccgo"} CFLAGS=$GOFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)=$LD _LT_CC_BASENAME([$compiler]) # Go did not exist at the time GCC didn't implicitly link libc in. _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi AC_LANG_RESTORE GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GO_CONFIG # _LT_LANG_RC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for the Windows resource compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_RC_CONFIG], [AC_REQUIRE([LT_PROG_RC])dnl AC_LANG_SAVE # Source file extension for RC test sources. ac_ext=rc # Object file extension for compiled RC test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' # Code to be used in simple link tests lt_simple_link_test_code=$lt_simple_compile_test_code # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC= CC=${RC-"windres"} CFLAGS= compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes if test -n "$compiler"; then : _LT_CONFIG($1) fi GCC=$lt_save_GCC AC_LANG_RESTORE CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_RC_CONFIG # LT_PROG_GCJ # ----------- AC_DEFUN([LT_PROG_GCJ], [m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ], [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ], [AC_CHECK_TOOL(GCJ, gcj,) test set = "${GCJFLAGS+set}" || GCJFLAGS="-g -O2" AC_SUBST(GCJFLAGS)])])[]dnl ]) # Old name: AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_GCJ], []) # LT_PROG_GO # ---------- AC_DEFUN([LT_PROG_GO], [AC_CHECK_TOOL(GOC, gccgo,) ]) # LT_PROG_RC # ---------- AC_DEFUN([LT_PROG_RC], [AC_CHECK_TOOL(RC, windres,) ]) # Old name: AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_RC], []) # _LT_DECL_EGREP # -------------- # If we don't have a new enough Autoconf to choose the best grep # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_EGREP], [AC_REQUIRE([AC_PROG_EGREP])dnl AC_REQUIRE([AC_PROG_FGREP])dnl test -z "$GREP" && GREP=grep _LT_DECL([], [GREP], [1], [A grep program that handles long lines]) _LT_DECL([], [EGREP], [1], [An ERE matcher]) _LT_DECL([], [FGREP], [1], [A literal string matcher]) dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too AC_SUBST([GREP]) ]) # _LT_DECL_OBJDUMP # -------------- # If we don't have a new enough Autoconf to choose the best objdump # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_OBJDUMP], [AC_CHECK_TOOL(OBJDUMP, objdump, false) test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [An object symbol dumper]) AC_SUBST([OBJDUMP]) ]) # _LT_DECL_DLLTOOL # ---------------- # Ensure DLLTOOL variable is set. m4_defun([_LT_DECL_DLLTOOL], [AC_CHECK_TOOL(DLLTOOL, dlltool, false) test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [1], [DLL creation program]) AC_SUBST([DLLTOOL]) ]) # _LT_DECL_SED # ------------ # Check for a fully-functional sed program, that truncates # as few characters as possible. Prefer GNU sed if found. m4_defun([_LT_DECL_SED], [AC_PROG_SED test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" _LT_DECL([], [SED], [1], [A sed program that does not truncate output]) _LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"], [Sed that helps us avoid accidentally triggering echo(1) options like -n]) ])# _LT_DECL_SED m4_ifndef([AC_PROG_SED], [ ############################################################ # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_SED. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # ############################################################ m4_defun([AC_PROG_SED], [AC_MSG_CHECKING([for a sed that does not truncate output]) AC_CACHE_VAL(lt_cv_path_SED, [# Loop through the user's path and test for sed and gsed. # Then use that list of sed's as ones to test for truncation. as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for lt_ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" fi done done done IFS=$as_save_IFS lt_ac_max=0 lt_ac_count=0 # Add /usr/xpg4/bin/sed as it is typically found on Solaris # along with /bin/sed that truncates output. for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do test ! -f "$lt_ac_sed" && continue cat /dev/null > conftest.in lt_ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >conftest.in # Check for GNU sed and select it if it is found. if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then lt_cv_path_SED=$lt_ac_sed break fi while true; do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo >>conftest.nl $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break cmp -s conftest.out conftest.nl || break # 10000 chars as input seems more than enough test 10 -lt "$lt_ac_count" && break lt_ac_count=`expr $lt_ac_count + 1` if test "$lt_ac_count" -gt "$lt_ac_max"; then lt_ac_max=$lt_ac_count lt_cv_path_SED=$lt_ac_sed fi done done ]) SED=$lt_cv_path_SED AC_SUBST([SED]) AC_MSG_RESULT([$SED]) ])#AC_PROG_SED ])#m4_ifndef # Old name: AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_SED], []) # _LT_CHECK_SHELL_FEATURES # ------------------------ # Find out whether the shell is Bourne or XSI compatible, # or has some other useful features. m4_defun([_LT_CHECK_SHELL_FEATURES], [if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi _LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac _LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl _LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl ])# _LT_CHECK_SHELL_FEATURES # _LT_PATH_CONVERSION_FUNCTIONS # ----------------------------- # Determine what file name conversion functions should be used by # func_to_host_file (and, implicitly, by func_to_host_path). These are needed # for certain cross-compile configurations and native mingw. m4_defun([_LT_PATH_CONVERSION_FUNCTIONS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_MSG_CHECKING([how to convert $build file names to $host format]) AC_CACHE_VAL(lt_cv_to_host_file_cmd, [case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ;; esac ;; *-*-cygwin* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_noop ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ;; esac ;; * ) # unhandled hosts (and "normal" native builds) lt_cv_to_host_file_cmd=func_convert_file_noop ;; esac ]) to_host_file_cmd=$lt_cv_to_host_file_cmd AC_MSG_RESULT([$lt_cv_to_host_file_cmd]) _LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd], [0], [convert $build file names to $host format])dnl AC_MSG_CHECKING([how to convert $build file names to toolchain format]) AC_CACHE_VAL(lt_cv_to_tool_file_cmd, [#assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac ;; esac ]) to_tool_file_cmd=$lt_cv_to_tool_file_cmd AC_MSG_RESULT([$lt_cv_to_tool_file_cmd]) _LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd], [0], [convert $build files to toolchain format])dnl ])# _LT_PATH_CONVERSION_FUNCTIONS telepathy-mission-control-5.16.4/m4/ltsugar.m40000644000175000017500000001044012762351615022267 0ustar00gkiagiagkiagia00000000000000# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- # # Copyright (C) 2004-2005, 2007-2008, 2011-2015 Free Software # Foundation, Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 6 ltsugar.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) # lt_join(SEP, ARG1, [ARG2...]) # ----------------------------- # Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their # associated separator. # Needed until we can rely on m4_join from Autoconf 2.62, since all earlier # versions in m4sugar had bugs. m4_define([lt_join], [m4_if([$#], [1], [], [$#], [2], [[$2]], [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])]) m4_define([_lt_join], [m4_if([$#$2], [2], [], [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])]) # lt_car(LIST) # lt_cdr(LIST) # ------------ # Manipulate m4 lists. # These macros are necessary as long as will still need to support # Autoconf-2.59, which quotes differently. m4_define([lt_car], [[$1]]) m4_define([lt_cdr], [m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])], [$#], 1, [], [m4_dquote(m4_shift($@))])]) m4_define([lt_unquote], $1) # lt_append(MACRO-NAME, STRING, [SEPARATOR]) # ------------------------------------------ # Redefine MACRO-NAME to hold its former content plus 'SEPARATOR''STRING'. # Note that neither SEPARATOR nor STRING are expanded; they are appended # to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked). # No SEPARATOR is output if MACRO-NAME was previously undefined (different # than defined and empty). # # This macro is needed until we can rely on Autoconf 2.62, since earlier # versions of m4sugar mistakenly expanded SEPARATOR but not STRING. m4_define([lt_append], [m4_define([$1], m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])]) # lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...]) # ---------------------------------------------------------- # Produce a SEP delimited list of all paired combinations of elements of # PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list # has the form PREFIXmINFIXSUFFIXn. # Needed until we can rely on m4_combine added in Autoconf 2.62. m4_define([lt_combine], [m4_if(m4_eval([$# > 3]), [1], [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl [[m4_foreach([_Lt_prefix], [$2], [m4_foreach([_Lt_suffix], ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[, [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])]) # lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ]) # ----------------------------------------------------------------------- # Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited # by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ. m4_define([lt_if_append_uniq], [m4_ifdef([$1], [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1], [lt_append([$1], [$2], [$3])$4], [$5])], [lt_append([$1], [$2], [$3])$4])]) # lt_dict_add(DICT, KEY, VALUE) # ----------------------------- m4_define([lt_dict_add], [m4_define([$1($2)], [$3])]) # lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE) # -------------------------------------------- m4_define([lt_dict_add_subkey], [m4_define([$1($2:$3)], [$4])]) # lt_dict_fetch(DICT, KEY, [SUBKEY]) # ---------------------------------- m4_define([lt_dict_fetch], [m4_ifval([$3], m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]), m4_ifdef([$1($2)], [m4_defn([$1($2)])]))]) # lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE]) # ----------------------------------------------------------------- m4_define([lt_if_dict_fetch], [m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4], [$5], [$6])]) # lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...]) # -------------------------------------------------------------- m4_define([lt_dict_filter], [m4_if([$5], [], [], [lt_join(m4_quote(m4_default([$4], [[, ]])), lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]), [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl ]) telepathy-mission-control-5.16.4/m4/tp-compiler-warnings.m40000644000175000017500000000240112735241312024655 0ustar00gkiagiagkiagia00000000000000dnl TP_COMPILER_WARNINGS(VARIABLE, WERROR_BY_DEFAULT, DESIRABLE, UNDESIRABLE) dnl $1 (VARIABLE): the variable to put flags into dnl $2 (WERROR_BY_DEFAULT): a command returning true if -Werror should be the dnl default dnl $3 (DESIRABLE): warning flags we want (e.g. all extra shadow) dnl $4 (UNDESIRABLE): warning flags we don't want (e.g. dnl missing-field-initializers unused-parameter) AC_DEFUN([TP_COMPILER_WARNINGS], [ AC_REQUIRE([AC_ARG_ENABLE])dnl AC_REQUIRE([AC_HELP_STRING])dnl AC_REQUIRE([TP_COMPILER_FLAG])dnl tp_warnings="" for tp_flag in $3; do TP_COMPILER_FLAG([-W$tp_flag], [tp_warnings="$tp_warnings -W$tp_flag"]) done tp_error_flags="-Werror" TP_COMPILER_FLAG([-Werror], [tp_werror=yes], [tp_werror=no]) for tp_flag in $4; do TP_COMPILER_FLAG([-Wno-$tp_flag], [tp_warnings="$tp_warnings -Wno-$tp_flag"]) TP_COMPILER_FLAG([-Wno-error=$tp_flag], [tp_error_flags="$tp_error_flags -Wno-error=$tp_flag"], [tp_werror=no]) done AC_ARG_ENABLE([Werror], AC_HELP_STRING([--disable-Werror], [compile without -Werror (normally enabled in development builds)]), tp_werror=$enableval, :) if test "x$tp_werror" = xyes && $2; then $1="$tp_warnings $tp_error_flags" else $1="$tp_warnings" fi ]) telepathy-mission-control-5.16.4/m4/ltoptions.m40000644000175000017500000003426212762351615022651 0ustar00gkiagiagkiagia00000000000000# Helper functions for option handling. -*- Autoconf -*- # # Copyright (C) 2004-2005, 2007-2009, 2011-2015 Free Software # Foundation, Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 8 ltoptions.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) # _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME) # ------------------------------------------ m4_define([_LT_MANGLE_OPTION], [[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])]) # _LT_SET_OPTION(MACRO-NAME, OPTION-NAME) # --------------------------------------- # Set option OPTION-NAME for macro MACRO-NAME, and if there is a # matching handler defined, dispatch to it. Other OPTION-NAMEs are # saved as a flag. m4_define([_LT_SET_OPTION], [m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]), _LT_MANGLE_DEFUN([$1], [$2]), [m4_warning([Unknown $1 option '$2'])])[]dnl ]) # _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET]) # ------------------------------------------------------------ # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. m4_define([_LT_IF_OPTION], [m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])]) # _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET) # ------------------------------------------------------- # Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME # are set. m4_define([_LT_UNLESS_OPTIONS], [m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option), [m4_define([$0_found])])])[]dnl m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3 ])[]dnl ]) # _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST) # ---------------------------------------- # OPTION-LIST is a space-separated list of Libtool options associated # with MACRO-NAME. If any OPTION has a matching handler declared with # LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about # the unknown option and exit. m4_defun([_LT_SET_OPTIONS], [# Set options m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [_LT_SET_OPTION([$1], _LT_Option)]) m4_if([$1],[LT_INIT],[ dnl dnl Simply set some default values (i.e off) if boolean options were not dnl specified: _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no ]) _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no ]) dnl dnl If no reference was made to various pairs of opposing options, then dnl we run the default mode handler for the pair. For example, if neither dnl 'shared' nor 'disable-shared' was passed, we enable building of shared dnl archives by default: _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED]) _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC]) _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC]) _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install], [_LT_ENABLE_FAST_INSTALL]) _LT_UNLESS_OPTIONS([LT_INIT], [aix-soname=aix aix-soname=both aix-soname=svr4], [_LT_WITH_AIX_SONAME([aix])]) ]) ])# _LT_SET_OPTIONS ## --------------------------------- ## ## Macros to handle LT_INIT options. ## ## --------------------------------- ## # _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME) # ----------------------------------------- m4_define([_LT_MANGLE_DEFUN], [[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])]) # LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE) # ----------------------------------------------- m4_define([LT_OPTION_DEFINE], [m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl ])# LT_OPTION_DEFINE # dlopen # ------ LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes ]) AU_DEFUN([AC_LIBTOOL_DLOPEN], [_LT_SET_OPTION([LT_INIT], [dlopen]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the 'dlopen' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], []) # win32-dll # --------- # Declare package support for building win32 dll's. LT_OPTION_DEFINE([LT_INIT], [win32-dll], [enable_win32_dll=yes case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) AC_CHECK_TOOL(AS, as, false) AC_CHECK_TOOL(DLLTOOL, dlltool, false) AC_CHECK_TOOL(OBJDUMP, objdump, false) ;; esac test -z "$AS" && AS=as _LT_DECL([], [AS], [1], [Assembler program])dnl test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl ])# win32-dll AU_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_REQUIRE([AC_CANONICAL_HOST])dnl _LT_SET_OPTION([LT_INIT], [win32-dll]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the 'win32-dll' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], []) # _LT_ENABLE_SHARED([DEFAULT]) # ---------------------------- # implement the --enable-shared flag, and supports the 'shared' and # 'disable-shared' LT_INIT options. # DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'. m4_define([_LT_ENABLE_SHARED], [m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([shared], [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@], [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS=$lt_save_ifs ;; esac], [enable_shared=]_LT_ENABLE_SHARED_DEFAULT) _LT_DECL([build_libtool_libs], [enable_shared], [0], [Whether or not to build shared libraries]) ])# _LT_ENABLE_SHARED LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])]) # Old names: AC_DEFUN([AC_ENABLE_SHARED], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared]) ]) AC_DEFUN([AC_DISABLE_SHARED], [_LT_SET_OPTION([LT_INIT], [disable-shared]) ]) AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_SHARED], []) dnl AC_DEFUN([AM_DISABLE_SHARED], []) # _LT_ENABLE_STATIC([DEFAULT]) # ---------------------------- # implement the --enable-static flag, and support the 'static' and # 'disable-static' LT_INIT options. # DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'. m4_define([_LT_ENABLE_STATIC], [m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([static], [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@], [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS=$lt_save_ifs ;; esac], [enable_static=]_LT_ENABLE_STATIC_DEFAULT) _LT_DECL([build_old_libs], [enable_static], [0], [Whether or not to build static libraries]) ])# _LT_ENABLE_STATIC LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])]) # Old names: AC_DEFUN([AC_ENABLE_STATIC], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static]) ]) AC_DEFUN([AC_DISABLE_STATIC], [_LT_SET_OPTION([LT_INIT], [disable-static]) ]) AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_STATIC], []) dnl AC_DEFUN([AM_DISABLE_STATIC], []) # _LT_ENABLE_FAST_INSTALL([DEFAULT]) # ---------------------------------- # implement the --enable-fast-install flag, and support the 'fast-install' # and 'disable-fast-install' LT_INIT options. # DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'. m4_define([_LT_ENABLE_FAST_INSTALL], [m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([fast-install], [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS=$lt_save_ifs ;; esac], [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT) _LT_DECL([fast_install], [enable_fast_install], [0], [Whether or not to optimize for fast installation])dnl ])# _LT_ENABLE_FAST_INSTALL LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])]) # Old names: AU_DEFUN([AC_ENABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the 'fast-install' option into LT_INIT's first parameter.]) ]) AU_DEFUN([AC_DISABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], [disable-fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the 'disable-fast-install' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], []) dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], []) # _LT_WITH_AIX_SONAME([DEFAULT]) # ---------------------------------- # implement the --with-aix-soname flag, and support the `aix-soname=aix' # and `aix-soname=both' and `aix-soname=svr4' LT_INIT options. DEFAULT # is either `aix', `both' or `svr4'. If omitted, it defaults to `aix'. m4_define([_LT_WITH_AIX_SONAME], [m4_define([_LT_WITH_AIX_SONAME_DEFAULT], [m4_if($1, svr4, svr4, m4_if($1, both, both, aix))])dnl shared_archive_member_spec= case $host,$enable_shared in power*-*-aix[[5-9]]*,yes) AC_MSG_CHECKING([which variant of shared library versioning to provide]) AC_ARG_WITH([aix-soname], [AS_HELP_STRING([--with-aix-soname=aix|svr4|both], [shared library versioning (aka "SONAME") variant to provide on AIX, @<:@default=]_LT_WITH_AIX_SONAME_DEFAULT[@:>@.])], [case $withval in aix|svr4|both) ;; *) AC_MSG_ERROR([Unknown argument to --with-aix-soname]) ;; esac lt_cv_with_aix_soname=$with_aix_soname], [AC_CACHE_VAL([lt_cv_with_aix_soname], [lt_cv_with_aix_soname=]_LT_WITH_AIX_SONAME_DEFAULT) with_aix_soname=$lt_cv_with_aix_soname]) AC_MSG_RESULT([$with_aix_soname]) if test aix != "$with_aix_soname"; then # For the AIX way of multilib, we name the shared archive member # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o', # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File. # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag, # the AIX toolchain works better with OBJECT_MODE set (default 32). if test 64 = "${OBJECT_MODE-32}"; then shared_archive_member_spec=shr_64 else shared_archive_member_spec=shr fi fi ;; *) with_aix_soname=aix ;; esac _LT_DECL([], [shared_archive_member_spec], [0], [Shared archive member basename, for filename based shared library versioning on AIX])dnl ])# _LT_WITH_AIX_SONAME LT_OPTION_DEFINE([LT_INIT], [aix-soname=aix], [_LT_WITH_AIX_SONAME([aix])]) LT_OPTION_DEFINE([LT_INIT], [aix-soname=both], [_LT_WITH_AIX_SONAME([both])]) LT_OPTION_DEFINE([LT_INIT], [aix-soname=svr4], [_LT_WITH_AIX_SONAME([svr4])]) # _LT_WITH_PIC([MODE]) # -------------------- # implement the --with-pic flag, and support the 'pic-only' and 'no-pic' # LT_INIT options. # MODE is either 'yes' or 'no'. If omitted, it defaults to 'both'. m4_define([_LT_WITH_PIC], [AC_ARG_WITH([pic], [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@], [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], [lt_p=${PACKAGE-default} case $withval in yes|no) pic_mode=$withval ;; *) pic_mode=default # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for lt_pkg in $withval; do IFS=$lt_save_ifs if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done IFS=$lt_save_ifs ;; esac], [pic_mode=m4_default([$1], [default])]) _LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl ])# _LT_WITH_PIC LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])]) # Old name: AU_DEFUN([AC_LIBTOOL_PICMODE], [_LT_SET_OPTION([LT_INIT], [pic-only]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the 'pic-only' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_PICMODE], []) ## ----------------- ## ## LTDL_INIT Options ## ## ----------------- ## m4_define([_LTDL_MODE], []) LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive], [m4_define([_LTDL_MODE], [nonrecursive])]) LT_OPTION_DEFINE([LTDL_INIT], [recursive], [m4_define([_LTDL_MODE], [recursive])]) LT_OPTION_DEFINE([LTDL_INIT], [subproject], [m4_define([_LTDL_MODE], [subproject])]) m4_define([_LTDL_TYPE], []) LT_OPTION_DEFINE([LTDL_INIT], [installable], [m4_define([_LTDL_TYPE], [installable])]) LT_OPTION_DEFINE([LTDL_INIT], [convenience], [m4_define([_LTDL_TYPE], [convenience])]) telepathy-mission-control-5.16.4/m4/lt~obsolete.m40000644000175000017500000001377412762351615023175 0ustar00gkiagiagkiagia00000000000000# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- # # Copyright (C) 2004-2005, 2007, 2009, 2011-2015 Free Software # Foundation, Inc. # Written by Scott James Remnant, 2004. # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 5 lt~obsolete.m4 # These exist entirely to fool aclocal when bootstrapping libtool. # # In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN), # which have later been changed to m4_define as they aren't part of the # exported API, or moved to Autoconf or Automake where they belong. # # The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN # in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us # using a macro with the same name in our local m4/libtool.m4 it'll # pull the old libtool.m4 in (it doesn't see our shiny new m4_define # and doesn't know about Autoconf macros at all.) # # So we provide this file, which has a silly filename so it's always # included after everything else. This provides aclocal with the # AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything # because those macros already exist, or will be overwritten later. # We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. # # Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. # Yes, that means every name once taken will need to remain here until # we give up compatibility with versions before 1.7, at which point # we need to keep only those names which we still refer to. # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])]) m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])]) m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])]) m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])]) m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])]) m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])]) m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])]) m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])]) m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])]) m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])]) m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])]) m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])]) m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])]) m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])]) m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])]) m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])]) m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])]) m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])]) m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])]) m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])]) m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])]) m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])]) m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])]) m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])]) m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])]) m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])]) m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])]) m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])]) m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])]) m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])]) m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])]) m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])]) m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])]) m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])]) m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])]) m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])]) m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])]) m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])]) m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])]) m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])]) m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])]) m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])]) m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])]) m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])]) m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])]) m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])]) m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])]) m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])]) m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])]) m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])]) m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])]) m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])]) m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])]) m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])]) telepathy-mission-control-5.16.4/m4/ltversion.m40000644000175000017500000000127312762351615022637 0ustar00gkiagiagkiagia00000000000000# ltversion.m4 -- version numbers -*- Autoconf -*- # # Copyright (C) 2004, 2011-2015 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # @configure_input@ # serial 4179 ltversion.m4 # This file is part of GNU Libtool m4_define([LT_PACKAGE_VERSION], [2.4.6]) m4_define([LT_PACKAGE_REVISION], [2.4.6]) AC_DEFUN([LTVERSION_VERSION], [macro_version='2.4.6' macro_revision='2.4.6' _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) _LT_DECL(, macro_revision, 0) ]) telepathy-mission-control-5.16.4/m4/tp-compiler-flag.m40000644000175000017500000000170412735241312023743 0ustar00gkiagiagkiagia00000000000000dnl A version of AS_COMPILER_FLAG that supports both C and C++. dnl Based on: dnl as-compiler-flag.m4 0.1.0 dnl autostars m4 macro for detection of compiler flags dnl David Schleef dnl $Id: as-compiler-flag.m4,v 1.1 2005/06/18 18:02:46 burgerman Exp $ dnl TP_COMPILER_FLAG(CFLAGS, ACTION-IF-ACCEPTED, [ACTION-IF-NOT-ACCEPTED]) dnl Tries to compile with the given CFLAGS and CXXFLAGS. dnl dnl Runs ACTION-IF-ACCEPTED if the compiler for the currently selected dnl AC_LANG can compile with the flags, and ACTION-IF-NOT-ACCEPTED otherwise. AC_DEFUN([TP_COMPILER_FLAG], [ AC_MSG_CHECKING([to see if compiler understands $1]) save_CFLAGS="$CFLAGS" save_CXXFLAGS="$CXXFLAGS" CFLAGS="$CFLAGS $1" CXXFLAGS="$CXXFLAGS $1" AC_TRY_COMPILE([ ], [], [flag_ok=yes], [flag_ok=no]) CFLAGS="$save_CFLAGS" CXXFLAGS="$save_CXXFLAGS" if test "X$flag_ok" = Xyes ; then $2 true else $3 true fi AC_MSG_RESULT([$flag_ok]) ]) telepathy-mission-control-5.16.4/m4/as-compiler-flag.m40000644000175000017500000000136312735241312023724 0ustar00gkiagiagkiagia00000000000000dnl as-compiler-flag.m4 0.1.0 dnl autostars m4 macro for detection of compiler flags dnl David Schleef dnl $Id: as-compiler-flag.m4,v 1.1 2005/06/18 18:02:46 burgerman Exp $ dnl AS_COMPILER_FLAG(CFLAGS, ACTION-IF-ACCEPTED, [ACTION-IF-NOT-ACCEPTED]) dnl Tries to compile with the given CFLAGS. dnl Runs ACTION-IF-ACCEPTED if the compiler can compile with the flags, dnl and ACTION-IF-NOT-ACCEPTED otherwise. AC_DEFUN([AS_COMPILER_FLAG], [ AC_MSG_CHECKING([to see if compiler understands $1]) save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $1" AC_TRY_COMPILE([ ], [], [flag_ok=yes], [flag_ok=no]) CFLAGS="$save_CFLAGS" if test "X$flag_ok" = Xyes ; then $2 true else $3 true fi AC_MSG_RESULT([$flag_ok]) ]) telepathy-mission-control-5.16.4/m4/gtk-doc.m40000644000175000017500000000631212752773111022137 0ustar00gkiagiagkiagia00000000000000dnl -*- mode: autoconf -*- # serial 2 dnl Usage: dnl GTK_DOC_CHECK([minimum-gtk-doc-version]) AC_DEFUN([GTK_DOC_CHECK], [ AC_REQUIRE([PKG_PROG_PKG_CONFIG]) AC_BEFORE([AC_PROG_LIBTOOL],[$0])dnl setup libtool first AC_BEFORE([AM_PROG_LIBTOOL],[$0])dnl setup libtool first ifelse([$1],[],[gtk_doc_requires="gtk-doc"],[gtk_doc_requires="gtk-doc >= $1"]) AC_MSG_CHECKING([for gtk-doc]) PKG_CHECK_EXISTS([$gtk_doc_requires],[have_gtk_doc=yes],[have_gtk_doc=no]) AC_MSG_RESULT($have_gtk_doc) if test "$have_gtk_doc" = "no"; then AC_MSG_WARN([ You will not be able to create source packages with 'make dist' because $gtk_doc_requires is not found.]) fi dnl check for tools we added during development dnl Use AC_CHECK_PROG to avoid the check target using an absolute path that dnl may not be writable by the user. Currently, automake requires that the dnl test name must end in '.test'. dnl https://bugzilla.gnome.org/show_bug.cgi?id=701638 AC_CHECK_PROG([GTKDOC_CHECK],[gtkdoc-check],[gtkdoc-check.test]) AC_PATH_PROG([GTKDOC_CHECK_PATH],[gtkdoc-check]) AC_PATH_PROGS([GTKDOC_REBASE],[gtkdoc-rebase],[true]) AC_PATH_PROG([GTKDOC_MKPDF],[gtkdoc-mkpdf]) dnl for overriding the documentation installation directory AC_ARG_WITH([html-dir], AS_HELP_STRING([--with-html-dir=PATH], [path to installed docs]),, [with_html_dir='${datadir}/gtk-doc/html']) HTML_DIR="$with_html_dir" AC_SUBST([HTML_DIR]) dnl enable/disable documentation building AC_ARG_ENABLE([gtk-doc], AS_HELP_STRING([--enable-gtk-doc], [use gtk-doc to build documentation [[default=no]]]),, [enable_gtk_doc=no]) AC_MSG_CHECKING([whether to build gtk-doc documentation]) AC_MSG_RESULT($enable_gtk_doc) if test "x$enable_gtk_doc" = "xyes" && test "$have_gtk_doc" = "no"; then AC_MSG_ERROR([ You must have $gtk_doc_requires installed to build documentation for $PACKAGE_NAME. Please install gtk-doc or disable building the documentation by adding '--disable-gtk-doc' to '[$]0'.]) fi dnl don't check for glib if we build glib if test "x$PACKAGE_NAME" != "xglib"; then dnl don't fail if someone does not have glib PKG_CHECK_MODULES(GTKDOC_DEPS, glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0,,[:]) fi dnl enable/disable output formats AC_ARG_ENABLE([gtk-doc-html], AS_HELP_STRING([--enable-gtk-doc-html], [build documentation in html format [[default=yes]]]),, [enable_gtk_doc_html=yes]) AC_ARG_ENABLE([gtk-doc-pdf], AS_HELP_STRING([--enable-gtk-doc-pdf], [build documentation in pdf format [[default=no]]]),, [enable_gtk_doc_pdf=no]) if test -z "$GTKDOC_MKPDF"; then enable_gtk_doc_pdf=no fi if test -z "$AM_DEFAULT_VERBOSITY"; then AM_DEFAULT_VERBOSITY=1 fi AC_SUBST([AM_DEFAULT_VERBOSITY]) AM_CONDITIONAL([HAVE_GTK_DOC], [test x$have_gtk_doc = xyes]) AM_CONDITIONAL([ENABLE_GTK_DOC], [test x$enable_gtk_doc = xyes]) AM_CONDITIONAL([GTK_DOC_BUILD_HTML], [test x$enable_gtk_doc_html = xyes]) AM_CONDITIONAL([GTK_DOC_BUILD_PDF], [test x$enable_gtk_doc_pdf = xyes]) AM_CONDITIONAL([GTK_DOC_USE_LIBTOOL], [test -n "$LIBTOOL"]) AM_CONDITIONAL([GTK_DOC_USE_REBASE], [test -n "$GTKDOC_REBASE"]) ]) telepathy-mission-control-5.16.4/m4/Makefile.am0000644000175000017500000000016012735241312022366 0ustar00gkiagiagkiagia00000000000000EXTRA_DIST = \ as-compiler-flag.m4 \ tp-compiler-flag.m4 \ tp-compiler-warnings.m4 \ gtk-doc.m4 telepathy-mission-control-5.16.4/m4/Makefile.in0000644000175000017500000003051612762351617022421 0ustar00gkiagiagkiagia00000000000000# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__make_dryrun = \ { \ am__dry=no; \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ *) \ for am__flg in $$MAKEFLAGS; do \ case $$am__flg in \ *=*|--*) ;; \ *n*) am__dry=yes; break;; \ esac; \ done;; \ esac; \ test $$am__dry = yes; \ } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = m4 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/gtk-doc.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/tp-compiler-flag.m4 \ $(top_srcdir)/m4/tp-compiler-warnings.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACCOUNTS_CACHE_DIR = @ACCOUNTS_CACHE_DIR@ ACCOUNTS_DIR = @ACCOUNTS_DIR@ ACLOCAL = @ACLOCAL@ AEGIS_LIBS = @AEGIS_LIBS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DBUS_CFLAGS = @DBUS_CFLAGS@ DBUS_LIBS = @DBUS_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ERROR_CFLAGS = @ERROR_CFLAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GIO_UNIX_CFLAGS = @GIO_UNIX_CFLAGS@ GIO_UNIX_LIBS = @GIO_UNIX_LIBS@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_COMPILE_SCHEMAS = @GLIB_COMPILE_SCHEMAS@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ GLIB_MKENUMS = @GLIB_MKENUMS@ GREP = @GREP@ GSETTINGS_DISABLE_SCHEMAS_COMPILE = @GSETTINGS_DISABLE_SCHEMAS_COMPILE@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ HTML_DIR = @HTML_DIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBACCOUNTS_SSO_CFLAGS = @LIBACCOUNTS_SSO_CFLAGS@ LIBACCOUNTS_SSO_LIBS = @LIBACCOUNTS_SSO_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MCE_CFLAGS = @MCE_CFLAGS@ MCE_LIBS = @MCE_LIBS@ MCP_ABI_VERSION = @MCP_ABI_VERSION@ MCP_API_VERSION = @MCP_API_VERSION@ MCP_LT_AGE = @MCP_LT_AGE@ MCP_LT_CURRENT = @MCP_LT_CURRENT@ MCP_LT_REVISION = @MCP_LT_REVISION@ MKDIR_P = @MKDIR_P@ NETWORK_MANAGER_CFLAGS = @NETWORK_MANAGER_CFLAGS@ NETWORK_MANAGER_LIBS = @NETWORK_MANAGER_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PYTHON = @PYTHON@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TELEPATHY_CFLAGS = @TELEPATHY_CFLAGS@ TELEPATHY_LIBS = @TELEPATHY_LIBS@ UPOWER_GLIB_CFLAGS = @UPOWER_GLIB_CFLAGS@ UPOWER_GLIB_LIBS = @UPOWER_GLIB_LIBS@ VERSION = @VERSION@ XSLTPROC = @XSLTPROC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gsettingsschemadir = @gsettingsschemadir@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mctestsdir = @mctestsdir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ pluginlibdir = @pluginlibdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = \ as-compiler-flag.m4 \ tp-compiler-flag.m4 \ tp-compiler-warnings.m4 \ gtk-doc.m4 all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu m4/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu m4/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: telepathy-mission-control-5.16.4/configure.ac0000644000175000017500000003175612762351104022320 0ustar00gkiagiagkiagia00000000000000dnl Set the version number to e.g. 5.x.y immediately before a release. dnl Set the version number to e.g. 5.x.y+ immediately after (this will dnl enable -Werror). AC_INIT([telepathy-mission-control], [5.16.4]) AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_AUX_DIR([build-aux]) AC_CONFIG_SRCDIR(Makefile.am) AM_INIT_AUTOMAKE([1.9 tar-ustar -Wno-portability]) m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES]) AC_CONFIG_HEADERS(config.h) AC_CANONICAL_HOST AC_PROG_CC AC_PROG_CPP AC_PROG_CXX AC_PROG_INSTALL AC_PROG_LIBTOOL AM_PROG_MKDIR_P AC_HEADER_STDC AC_CHECK_HEADERS([sys/stat.h sys/types.h sysexits.h]) AC_CHECK_FUNCS([umask]) case "$PACKAGE_VERSION" in *+) mc_is_release=no ;; *) mc_is_release=yes ;; esac # If API has been removed or changed since last release, change MCP_API (which # is part of the directory name under /usr/include) to the version that # changed it MCP_API_VERSION=5.5 AC_SUBST([MCP_API_VERSION]) # If ABI has been removed or changed since last release # increment current # set age and revision to 0 # else if ABI has been added since last release # increment age and current # set revision to 0 # else if library source has changed since last release # increment revision MCP_LT_CURRENT=5 MCP_LT_REVISION=1 MCP_LT_AGE=5 AC_SUBST([MCP_LT_CURRENT]) AC_SUBST([MCP_LT_REVISION]) AC_SUBST([MCP_LT_AGE]) # The ABI version appears in the name of the plugin directory MCP_ABI_VERSION=`expr ${MCP_LT_CURRENT} - ${MCP_LT_AGE}` AC_SUBST([MCP_ABI_VERSION]) # Recommended CFLAGS for pedantic checking, from telepathy-glib TP_COMPILER_WARNINGS([ERROR_CFLAGS], [test "x$mc_is_release" = xno], dnl <- Disable -Werror in releases [all \ extra \ declaration-after-statement \ shadow \ strict-prototypes \ missing-prototypes \ missing-declarations \ sign-compare \ nested-externs \ pointer-arith \ format-security \ init-self \ ], [missing-field-initializers \ deprecated-declarations \ unused-parameter]) AC_SUBST([ERROR_CFLAGS]) XSLTPROC= AC_CHECK_PROGS([XSLTPROC], [xsltproc]) if test -z "$XSLTPROC"; then AC_MSG_ERROR([xsltproc (from the libxslt source package) is required]) fi AM_PATH_PYTHON([2.6]) AC_MSG_CHECKING([for enough Python for the tests]) mc_want_twisted_tests=no if $PYTHON -c "import twisted.internet.reactor, dbus.mainloop.glib"\ >/dev/null 2>&1; then mc_want_twisted_tests=yes fi AC_MSG_RESULT([$mc_want_twisted_tests]) AM_CONDITIONAL([WANT_TWISTED_TESTS], test yes = "$mc_want_twisted_tests") AC_ARG_ENABLE(debug, [ --disable-debug compile without debug code],[enable_debug=${enableval}], enable_debug=yes ) if test "x$enable_debug" = "xyes"; then CFLAGS="$CFLAGS -DENABLE_DEBUG" fi AC_ARG_ENABLE(cast-checks, [ --disable-cast-checks compile with GLIB cast checks disabled],[cchecks=${enableval}],cchecks=yes) if test "x$cchecks" = "xno"; then CFLAGS="$CFLAGS -DG_DISABLE_CAST_CHECKS" fi AC_ARG_ENABLE(asserts, [ --disable-asserts compile with GLIB assertions disabled],[asserts=${enableval}],asserts=yes) if test "x$asserts" = "xno"; then CFLAGS="$CFLAGS -DG_DISABLE_ASSERTS" fi AC_ARG_ENABLE(checks, [ --disable-checks compile with GLIB checks disabled],[checks=${enableval}],checks=yes) if test "x$checks" = "xno"; then CFLAGS="$CFLAGS -DG_DISABLE_CHECKS" fi AC_ARG_ENABLE(coverage, [ --enable-coverage compile with coverage info],[enable_coverage=${enableval}],enable_coverage=no) if test "x$enable_coverage" = "xyes"; then CFLAGS="$CFLAGS -g -fprofile-arcs -ftest-coverage" fi AC_ARG_ENABLE([installed-tests], AC_HELP_STRING([--enable-installed-tests], [make tests installable]), [installed_tests=$enableval], [installed_tests=no]) if test x$installed_tests = xyes; then AC_DEFINE(ENABLE_INSTALLED_TESTS, [], [Make tests installable]) fi AM_CONDITIONAL([ENABLE_INSTALLED_TESTS], [test "x$installed_tests" = xyes]) mctestsdir=${libdir}/telepathy-mission-control-tests AC_SUBST(mctestsdir) AC_ARG_WITH([accounts_dir], [AS_HELP_STRING([--with-accounts-dir=],[Directory in which accounts were previously stored])]) if test -z "$with_accounts_dir" ; then ACCOUNTS_DIR="~/.mission-control/accounts" else ACCOUNTS_DIR=$with_accounts_dir fi AC_SUBST(ACCOUNTS_DIR) AC_DEFINE_UNQUOTED([ACCOUNTS_DIR], ["$ACCOUNTS_DIR"], [Directory in which accounts were previously stored]) AC_ARG_WITH(accounts_cache_dir, AS_HELP_STRING([--with-accounts-cache-dir=],[Directory for account/connection mapping for crash recovery])) if test -z "$with_accounts_cache_dir" ; then ACCOUNTS_CACHE_DIR="" else ACCOUNTS_CACHE_DIR=$with_accounts_cache_dir fi AC_SUBST(ACCOUNTS_CACHE_DIR) AC_DEFINE_UNQUOTED(ACCOUNTS_CACHE_DIR,"$ACCOUNTS_CACHE_DIR", [Directory for account/connection mapping for crash recovery]) aegis_enabled="no" AC_MSG_CHECKING([whether to build with Aegis (libcreds) support]) AC_ARG_ENABLE(aegis, AC_HELP_STRING([--enable-aegis], [Aegis security framework support]), [ AC_CHECK_LIB(creds, creds_init, [ AC_DEFINE([ENABLE_AEGIS], [1], [Define if Aegis is supported]) AC_SUBST([AEGIS_LIBS], [-lcreds]) ], [ AC_MSG_ERROR([Aegis: libcreds not found]) ]) aegis_enabled="yes" ], [ aegis_enabled="no" AC_MSG_RESULT(no) AC_DEFINE([ENABLE_AEGIS], [0], [Define if Aegis is supported]) ]) AM_CONDITIONAL(ENABLE_AEGIS, [test x$aegis_enabled = xyes]) PKG_PROG_PKG_CONFIG() dnl libaccounts-glib SSO libaccounts_sso_enabled="no" AC_MSG_CHECKING(whether to build with libaccounts-glib SSO suport) AC_ARG_ENABLE([libaccounts-sso], AC_HELP_STRING([--enable-libaccounts-sso], [build with SSO suport. default=no]), [ AC_MSG_RESULT(${enableval}) libaccounts_sso_enabled="${enableval}" ], [ AC_MSG_RESULT(no) ] ) AS_IF([ test "x$libaccounts_sso_enabled" = xauto ], [ PKG_CHECK_EXISTS([libaccounts-glib], [libaccounts_sso_enabled=yes], [libaccounts_sso_enabled=no]) ]) dnl set up the shell/make variable, the #define and check the package version AS_IF([ test "x$libaccounts_sso_enabled" = xyes ], [ ENABLE_LIBACCOUNTS_SSO=yes AC_DEFINE(ENABLE_LIBACCOUNTS_SSO, [1], [Define if libaccounts SSO support is required]) PKG_CHECK_MODULES([LIBACCOUNTS_SSO], [libaccounts-glib >= 0.26]) ], [ AC_DEFINE(ENABLE_LIBACCOUNTS_SSO, [0]) ]) dnl export the CFLAGS and LDFLAGS equivalents determined by PKG_CHECK_MODULES AC_SUBST(LIBACCOUNTS_SSO_CFLAGS) AC_SUBST(LIBACCOUNTS_SSO_LIBS) dnl the automake conditional AM_CONDITIONAL(ENABLE_LIBACCOUNTS_SSO, [test x$libaccounts_sso_enabled = xyes]) dnl /libaccounts-glib SSO AC_ARG_WITH([accounts-glib-hidden-service-type], [AS_HELP_STRING([--with-accounts-glib-hidden-service-type], [mark accounts with the provided service type as hidden @<:@default=no@:>@])], [], [with_accounts_glib_hidden_service_type=no]) AS_IF([ test "x$with_accounts_glib_hidden_service_type" != xno ], [AC_DEFINE_UNQUOTED(ACCOUNTS_GLIB_HIDDEN_SERVICE_TYPE, ["$with_accounts_glib_hidden_service_type"], [Defined to the non-IM service type for hidden accounts, if any])]) AM_CONDITIONAL(ENABLE_LIBACCOUNTS_GLIB_HIDDEN, [test x$with_accounts_glib_hidden_service_type != xno]) PKG_CHECK_MODULES(DBUS, [dbus-1 >= 0.95, dbus-glib-1 >= 0.82]) AC_SUBST(DBUS_CFLAGS) AC_SUBST(DBUS_LIBS) PKG_CHECK_MODULES([TELEPATHY], [telepathy-glib >= 0.20.0]) AC_DEFINE([TP_VERSION_MIN_REQUIRED], [TP_VERSION_0_18], [Ignore post-0.18 deprecations]) AC_DEFINE([TP_VERSION_MAX_ALLOWED], [TP_VERSION_0_20], [Prevent post-0.20 APIs]) AC_DEFINE([TP_SEAL_ENABLE], [], [Define to hide deprecated struct fields]) AC_DEFINE([TP_DISABLE_SINGLE_INCLUDE], [], [Avoid individual headers]) PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.46, gobject-2.0, gmodule-no-export-2.0, gio-2.0]) PKG_CHECK_MODULES([GIO_UNIX], [gio-unix-2.0], [ AC_DEFINE(HAVE_GIO_UNIX, [], [Define if GIO-Unix is available]) GLIB_CFLAGS="$GLIB_CFLAGS $GIO_UNIX_CFLAGS" GLIB_LIBS="$GLIB_LIBS $GIO_UNIX_LIBS" ], []) AC_DEFINE([GLIB_VERSION_MIN_REQUIRED], [GLIB_VERSION_2_46], [Ignore post 2.46 deprecations]) AC_DEFINE([GLIB_VERSION_MAX_ALLOWED], [GLIB_VERSION_2_46], [Prevent post 2.46 APIs]) dnl Check for MCE, a Maemo service used to determine when the device is idle. PKG_CHECK_MODULES([MCE], mce >= 1.5, [HAVE_MCE=yes], [HAVE_MCE=no]) AM_CONDITIONAL([HAVE_MCE], [test x"$HAVE_MCE" = xyes]) if test x"$HAVE_MCE" = xyes; then AC_DEFINE([HAVE_MCE], [1], [Define if mce is available]) fi # ----------------------------------------------------------- # Connectivity integration # ----------------------------------------------------------- AC_ARG_WITH(connectivity, AS_HELP_STRING([--with-connectivity=@<:@nm/auto/no@:>@], [build with connectivity support]), , with_connectivity=auto) # --with-connectivity=connman always used to turn off NM support, # so treat it as "no" now that ConnMan doesn't need anything special. if test "x$with_connectivity" = "xno" || test "x$with_connectivity" = "xconnman"; then have_nm=no else PKG_CHECK_MODULES(NETWORK_MANAGER, [ libnm ], have_nm="yes", have_nm="no") if test "x$have_nm" = "xyes"; then AC_DEFINE(HAVE_NM, 1, [Define if you have libnm-glib]) fi fi if test "x$with_connectivity" = "xnm" -a "x$have_nm" != "xyes"; then AC_MSG_ERROR([Couldn't find Network Manager dependencies: $NETWORK_MANAGER_PKG_ERRORS]) fi AM_CONDITIONAL(HAVE_NM, test "x$have_nm" = "xyes") AC_ARG_ENABLE([conn-setting], [AS_HELP_STRING([--enable-conn-setting], [use a GSetting to control automatic connectivity @<:@default=yes@:>@])], [], [enable_conn_setting=yes]) if test x"$enable_conn_setting" = xyes; then AC_DEFINE([ENABLE_CONN_SETTING], [1], [Define to use the "use-conn" GSetting]) fi AM_CONDITIONAL([ENABLE_CONN_SETTING], [test x"$enable_conn_setting" = xyes]) # ----------------------------------------------------------- # Suspend/resume tracking goop # ----------------------------------------------------------- AC_ARG_ENABLE([upower], [AS_HELP_STRING([--enable-upower], [monitor device suspending and resuming using upower-glib @<:@default=auto@:>@])], [], [enable_upower=auto]) if test "x$enable_upower" != xno; then PKG_CHECK_MODULES([UPOWER_GLIB], [upower-glib < 0.99], [AC_DEFINE([HAVE_UPOWER], [1], [Define to use upower-glib]) have_upower=yes ], [if test "x$enable_upower" == xyes; then AC_MSG_ERROR([$UPOWER_GLIB_PKG_ERRORS]) else have_upower=no fi ]) else have_upower=no fi AC_SUBST([UPOWER_GLIB_CFLAGS]) AC_SUBST([UPOWER_GLIB_LIBS]) dnl *************************************************************************** dnl Check for marshal and enum generators dnl *************************************************************************** GLIB_GENMARSHAL="`$PKG_CONFIG --variable=glib_genmarshal glib-2.0`" AC_SUBST(GLIB_GENMARSHAL) GLIB_MKENUMS="`$PKG_CONFIG --variable=glib_mkenums glib-2.0`" AC_SUBST(GLIB_MKENUMS) GTK_DOC_CHECK([1.17],[--flavour no-tmpl]) GLIB_GSETTINGS pluginlibdir=$libdir/mission-control AC_SUBST(pluginlibdir) AC_OUTPUT([ Makefile \ data/Makefile \ doc/Makefile \ doc/reference/Makefile \ doc/reference/mission-control-plugins/Makefile \ m4/Makefile \ mission-control-plugins.pc \ mission-control-plugins-uninstalled.pc \ mission-control-plugins/Makefile \ plugins/Makefile \ server/Makefile \ src/Makefile \ tests/Makefile \ tests/twisted/Makefile \ tests/twisted/tools/Makefile \ tools/Makefile \ util/Makefile \ xml/Makefile \ ]) echo " Configure summary: Compiler.....................: ${CC} Compiler Flags...............: ${CFLAGS} ${ERROR_CFLAGS} Linker Flags.................: ${LDFLAGS} Prefix.......................: ${prefix} Enable debug.................: ${enable_debug} Python tests.................: ${mc_want_twisted_tests} Install unit tests...........: ${installed_tests} Options: Account storage directory....: ${ACCOUNTS_DIR} Crash recovery directory.....: ${ACCOUNTS_CACHE_DIR:-\$XDG_CACHE_HOME} Features: Plugin API documentation.....: ${enable_gtk_doc} Network Manager integration..: ${have_nm} ConnMan integration..........: ${have_connman} Connectivity GSetting........: ${enable_conn_setting} Suspend tracking with UPower.: ${have_upower} Aegis........................: ${aegis_enabled} libaccounts-glib backend.....: ${libaccounts_sso_enabled} Hidden accounts-glib accounts: ${with_accounts_glib_hidden_service_type} Nokia Mode Control Entity....: ${HAVE_MCE} " telepathy-mission-control-5.16.4/server/0000755000175000017500000000000012762352250021327 5ustar00gkiagiagkiagia00000000000000telepathy-mission-control-5.16.4/server/org.freedesktop.Telepathy.MissionControl5.service.in0000644000175000017500000000027412735241312033422 0ustar00gkiagiagkiagia00000000000000[D-BUS Service] Name=org.freedesktop.Telepathy.MissionControl5 Exec=@bindir@/mc-wait-for-name --activate org.freedesktop.Telepathy.AccountManager org.freedesktop.Telepathy.MissionControl5 telepathy-mission-control-5.16.4/server/mission-control-5.8.in0000644000175000017500000000333012735241312025321 0ustar00gkiagiagkiagia00000000000000.TH MISSION-CONTROL-5 "8" "July 2009" "Telepathy" "D-Bus services" \" Copyright © 2009 Collabora Ltd. \" This document may be distributed under the same terms as \" telepathy-mission-control itself. .SH NAME mission-control-5 \- Telepathy account manager/chanel dispatcher .SH SYNOPSIS \fB@libexecdir@/mission\-control\-5\fR .SH DESCRIPTION Mission Control 5 implements the AccountManager and ChannelDispatcher services described in the Telepathy D-Bus specification, allowing clients like .BR empathy (1) to store account details, connect to accounts, request communication channels, and have channels dispatched to them. .PP It is a D-Bus service which runs on the session bus, and should usually be started automatically by D-Bus activation. However, it might be useful to start it manually for debugging. .SH OPTIONS There are no command-line options. .SH ENVIRONMENT .TP \fBMC_DEBUG=all\fR or \fBMC_DEBUG=\fIcategory\fR[\fB,\fIcategory\fR...] May be set to "all" for full debug output from Mission Control and telepathy-glib, or various undocumented category names (which may change from release to release) to filter the output. See Mission Control and telepathy-glib source code for the available categories. .TP \fBMC_DEBUG=\fIlevel\fR Set a numeric debug level for Mission Control itself (but not telepathy-glib). Level 0 logs nothing, level 1 logs most messages, and level 2 logs all messages. .TP \fBMC_TP_DEBUG\fR=\fItype\fR May be set to "all" for full debug output from telepathy-glib, or various undocumented options (which may change from telepathy-glib release to release) to filter the output. See telepathy-glib source code for the available options. .SH SEE ALSO .IR http://telepathy.freedesktop.org/ telepathy-mission-control-5.16.4/server/mc-server.c0000644000175000017500000001233412735242352023402 0ustar00gkiagiagkiagia00000000000000/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 8 -*- */ /* * This file is part of mission-control * * Copyright (C) 2007 Nokia Corporation. * * Contact: Naba Kumar * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * version 2.1 as published by the Free Software Foundation. * * This library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA * */ #include "config.h" #include #include #include #ifdef G_OS_UNIX #include #include #include #include #include #include #include #endif #include #include "mcd-service.h" static TpDebugSender *debug_sender; static McdService *mcd = NULL; #ifdef G_OS_UNIX static int quit_pipe[2]; #define QUIT_READ_END 0 #define QUIT_WRITE_END 1 #endif #ifdef BUILD_AS_ANDROID_SERVICE int telepathy_mission_control_main (int argc, char **argv); #endif static void on_abort (McdService * _mcd) { g_debug ("Exiting now ..."); mcd_debug_print_tree (_mcd); g_debug ("MC now exits .. bye bye"); mcd_service_stop (_mcd); } #ifdef G_OS_UNIX static void signal_handler (int sig) { switch (sig) { case SIGINT: if ((quit_pipe[QUIT_WRITE_END] > 0) && write (quit_pipe[QUIT_WRITE_END], "\0", 1) != 1) { /* If we can't write to the socket, dying seems a good * response to SIGINT. We'd use exit(), but that's not * async-signal-safe, so we'll have to resort to _exit(). * We use write() because it is async-signal-safe. */ static const char message[] = "Unable to write to quit pipe - buffer full?\n" "Will exit instead.\n"; if (write (STDERR_FILENO, message, strlen (message)) == -1) { /* Ignore, we are returning anyway */ } _exit (1); } break; } } static gboolean quit_idle_cb (gpointer user_data) { mcd_mission_abort (MCD_MISSION (mcd)); return FALSE; } static gboolean quit_event_cb (GIOChannel *source, GIOCondition condition, gpointer data) { g_idle_add_full (G_PRIORITY_LOW, quit_idle_cb, NULL, NULL); return FALSE; } static void init_quit_pipe (void) { int i; GIOChannel *channel; GError *error = NULL; if (!g_unix_open_pipe (quit_pipe, FD_CLOEXEC, &error)) { g_warning ("Failed to get a pipe: %s", error->message); g_clear_error (&error); return; } for (i = 0 ; i < 2 ; i++) { int val; val = fcntl (quit_pipe[i], F_GETFL, 0); if (val < 0) { g_warning ("Failed to get flags from file descriptor %d: %s", quit_pipe[i], strerror (errno)); continue; } val = fcntl (quit_pipe[i], F_SETFL, val | O_NONBLOCK); if (val < 0) { g_warning ("Failed to set flags from file descriptor %d: %s", quit_pipe[i], strerror (errno)); continue; } } channel = g_io_channel_unix_new (quit_pipe[QUIT_READ_END]); g_io_add_watch (channel, G_IO_IN, quit_event_cb, NULL); } #endif int #ifdef BUILD_AS_ANDROID_SERVICE telepathy_mission_control_main (int argc, char **argv) #else main (int argc, char **argv) #endif { #ifdef G_OS_UNIX struct sigaction act; sigset_t empty_mask; #endif g_type_init (); g_set_application_name ("Account manager"); /* Keep a ref to the default TpDebugSender for the lifetime of the * McdMaster, so it will persist for the lifetime of MC, and subsequent * calls to tp_debug_sender_dup() will return it again */ debug_sender = tp_debug_sender_dup (); /* Send all debug messages through the Telepathy infrastructure. * * Unlike CMs, we don't have "subdomains" within MC yet, so we don't want * to exclude any domains. */ g_log_set_default_handler (tp_debug_sender_log_handler, NULL); mcd_debug_init (); tp_debug_set_flags (g_getenv ("MC_TP_DEBUG")); mcd = mcd_service_new (); if (mcd == NULL) return 1; /* Listen for suicide notification */ g_signal_connect_after (mcd, "abort", G_CALLBACK (on_abort), mcd); /* Set up signals */ #ifdef G_OS_UNIX init_quit_pipe (); sigemptyset (&empty_mask); act.sa_handler = signal_handler; act.sa_mask = empty_mask; act.sa_flags = 0; sigaction (SIGINT, &act, NULL); #endif /* connect */ mcd_mission_connect (MCD_MISSION (mcd)); mcd_service_run (MCD_OBJECT (mcd)); g_clear_object (&mcd); tp_clear_object (&debug_sender); return 0; } telepathy-mission-control-5.16.4/server/org.freedesktop.Telepathy.AccountManager.service.in0000644000175000017500000000014212735241312033234 0ustar00gkiagiagkiagia00000000000000[D-BUS Service] Name=org.freedesktop.Telepathy.AccountManager Exec=@libexecdir@/mission-control-5 telepathy-mission-control-5.16.4/server/Makefile.am0000644000175000017500000000332112735242352023363 0ustar00gkiagiagkiagia00000000000000AM_CPPFLAGS = \ -I$(top_srcdir) \ -I$(top_srcdir)/src \ -I$(top_builddir)/src \ $(DBUS_CFLAGS) \ $(GLIB_CFLAGS) \ $(TELEPATHY_CFLAGS) \ -DMC_DISABLE_DEPRECATED \ -DLIBDIR="@libdir@" -DLIBVERSION="0" AM_CFLAGS = $(ERROR_CFLAGS) EXTRA_DIST = org.freedesktop.Telepathy.MissionControl5.service.in \ org.freedesktop.Telepathy.AccountManager.service.in \ mission-control-5.8.in CLEANFILES = org.freedesktop.Telepathy.MissionControl5.service \ org.freedesktop.Telepathy.AccountManager.service \ mission-control-5.8 servicefiledir=$(prefix)/share/dbus-1/services servicefile_DATA=org.freedesktop.Telepathy.MissionControl5.service \ org.freedesktop.Telepathy.AccountManager.service %.service: %.service.in Makefile $(AM_V_GEN)sed \ -e 's![@]libexecdir[@]!$(libexecdir)!' \ -e 's![@]bindir[@]!$(bindir)!' \ $< > $@ man8_MANS = mission-control-5.8 %.8: %.8.in Makefile $(AM_V_GEN)sed -e 's![@]libexecdir[@]!$(libexecdir)!' $< > $@ libexec_PROGRAMS = mission-control-5 mission_control_5_SOURCES = mc-server.c mission_control_5_LDADD = \ $(GLIB_LIBS) \ $(TELEPATHY_LIBS) \ $(DBUS_LIBS) \ $(top_builddir)/src/libmcd-convenience.la \ $(top_builddir)/mission-control-plugins/libmission-control-plugins.la Android.mk: Makefile.am androgenizer -:PROJECT telepathy-mission-control \ -:SHARED libmission-control-5 -:TAGS eng debug \ -:REL_TOP $(top_srcdir) -:ABS_TOP $(abs_top_srcdir) \ -:SOURCES $(mission_control_5_SOURCES) \ -:CFLAGS $(DEFAULT_INCLUDES) $(DEFS) $(CFLAGS) $(AM_CFLAGS) \ -:CPPFLAGS $(CPPFLAGS) $(AM_CPPFLAGS) $(INCLUDES) \ -DBUILD_AS_ANDROID_SERVICE \ -:LDFLAGS $(mission_control_5_LDADD) \ -:LIBFILTER_STATIC mcd-convenience mission-control-plugins \ mcclient \ > $@ telepathy-mission-control-5.16.4/server/Makefile.in0000644000175000017500000006336412762351617023416 0ustar00gkiagiagkiagia00000000000000# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__make_dryrun = \ { \ am__dry=no; \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ *) \ for am__flg in $$MAKEFLAGS; do \ case $$am__flg in \ *=*|--*) ;; \ *n*) am__dry=yes; break;; \ esac; \ done;; \ esac; \ test $$am__dry = yes; \ } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ libexec_PROGRAMS = mission-control-5$(EXEEXT) subdir = server DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/gtk-doc.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/tp-compiler-flag.m4 \ $(top_srcdir)/m4/tp-compiler-warnings.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(libexecdir)" "$(DESTDIR)$(man8dir)" \ "$(DESTDIR)$(servicefiledir)" PROGRAMS = $(libexec_PROGRAMS) am_mission_control_5_OBJECTS = mc-server.$(OBJEXT) mission_control_5_OBJECTS = $(am_mission_control_5_OBJECTS) am__DEPENDENCIES_1 = mission_control_5_DEPENDENCIES = $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(top_builddir)/src/libmcd-convenience.la \ $(top_builddir)/mission-control-plugins/libmission-control-plugins.la AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; SOURCES = $(mission_control_5_SOURCES) DIST_SOURCES = $(mission_control_5_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } man8dir = $(mandir)/man8 NROFF = nroff MANS = $(man8_MANS) DATA = $(servicefile_DATA) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACCOUNTS_CACHE_DIR = @ACCOUNTS_CACHE_DIR@ ACCOUNTS_DIR = @ACCOUNTS_DIR@ ACLOCAL = @ACLOCAL@ AEGIS_LIBS = @AEGIS_LIBS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DBUS_CFLAGS = @DBUS_CFLAGS@ DBUS_LIBS = @DBUS_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ERROR_CFLAGS = @ERROR_CFLAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GIO_UNIX_CFLAGS = @GIO_UNIX_CFLAGS@ GIO_UNIX_LIBS = @GIO_UNIX_LIBS@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_COMPILE_SCHEMAS = @GLIB_COMPILE_SCHEMAS@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ GLIB_MKENUMS = @GLIB_MKENUMS@ GREP = @GREP@ GSETTINGS_DISABLE_SCHEMAS_COMPILE = @GSETTINGS_DISABLE_SCHEMAS_COMPILE@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ HTML_DIR = @HTML_DIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBACCOUNTS_SSO_CFLAGS = @LIBACCOUNTS_SSO_CFLAGS@ LIBACCOUNTS_SSO_LIBS = @LIBACCOUNTS_SSO_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MCE_CFLAGS = @MCE_CFLAGS@ MCE_LIBS = @MCE_LIBS@ MCP_ABI_VERSION = @MCP_ABI_VERSION@ MCP_API_VERSION = @MCP_API_VERSION@ MCP_LT_AGE = @MCP_LT_AGE@ MCP_LT_CURRENT = @MCP_LT_CURRENT@ MCP_LT_REVISION = @MCP_LT_REVISION@ MKDIR_P = @MKDIR_P@ NETWORK_MANAGER_CFLAGS = @NETWORK_MANAGER_CFLAGS@ NETWORK_MANAGER_LIBS = @NETWORK_MANAGER_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PYTHON = @PYTHON@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TELEPATHY_CFLAGS = @TELEPATHY_CFLAGS@ TELEPATHY_LIBS = @TELEPATHY_LIBS@ UPOWER_GLIB_CFLAGS = @UPOWER_GLIB_CFLAGS@ UPOWER_GLIB_LIBS = @UPOWER_GLIB_LIBS@ VERSION = @VERSION@ XSLTPROC = @XSLTPROC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gsettingsschemadir = @gsettingsschemadir@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mctestsdir = @mctestsdir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ pluginlibdir = @pluginlibdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AM_CPPFLAGS = \ -I$(top_srcdir) \ -I$(top_srcdir)/src \ -I$(top_builddir)/src \ $(DBUS_CFLAGS) \ $(GLIB_CFLAGS) \ $(TELEPATHY_CFLAGS) \ -DMC_DISABLE_DEPRECATED \ -DLIBDIR="@libdir@" -DLIBVERSION="0" AM_CFLAGS = $(ERROR_CFLAGS) EXTRA_DIST = org.freedesktop.Telepathy.MissionControl5.service.in \ org.freedesktop.Telepathy.AccountManager.service.in \ mission-control-5.8.in CLEANFILES = org.freedesktop.Telepathy.MissionControl5.service \ org.freedesktop.Telepathy.AccountManager.service \ mission-control-5.8 servicefiledir = $(prefix)/share/dbus-1/services servicefile_DATA = org.freedesktop.Telepathy.MissionControl5.service \ org.freedesktop.Telepathy.AccountManager.service man8_MANS = mission-control-5.8 mission_control_5_SOURCES = mc-server.c mission_control_5_LDADD = \ $(GLIB_LIBS) \ $(TELEPATHY_LIBS) \ $(DBUS_LIBS) \ $(top_builddir)/src/libmcd-convenience.la \ $(top_builddir)/mission-control-plugins/libmission-control-plugins.la all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu server/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu server/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-libexecPROGRAMS: $(libexec_PROGRAMS) @$(NORMAL_INSTALL) @list='$(libexec_PROGRAMS)'; test -n "$(libexecdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(libexecdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(libexecdir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p || test -f $$p1; \ then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(libexecdir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(libexecdir)$$dir" || exit $$?; \ } \ ; done uninstall-libexecPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(libexec_PROGRAMS)'; test -n "$(libexecdir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(libexecdir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(libexecdir)" && rm -f $$files clean-libexecPROGRAMS: @list='$(libexec_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list mission-control-5$(EXEEXT): $(mission_control_5_OBJECTS) $(mission_control_5_DEPENDENCIES) $(EXTRA_mission_control_5_DEPENDENCIES) @rm -f mission-control-5$(EXEEXT) $(AM_V_CCLD)$(LINK) $(mission_control_5_OBJECTS) $(mission_control_5_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mc-server.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-man8: $(man8_MANS) @$(NORMAL_INSTALL) @list1='$(man8_MANS)'; \ list2=''; \ test -n "$(man8dir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(man8dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(man8dir)" || exit 1; \ { for i in $$list1; do echo "$$i"; done; \ if test -n "$$list2"; then \ for i in $$list2; do echo "$$i"; done \ | sed -n '/\.8[a-z]*$$/p'; \ fi; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man8dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man8dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man8dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man8dir)" || exit $$?; }; \ done; } uninstall-man8: @$(NORMAL_UNINSTALL) @list='$(man8_MANS)'; test -n "$(man8dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man8dir)'; $(am__uninstall_files_from_dir) install-servicefileDATA: $(servicefile_DATA) @$(NORMAL_INSTALL) @list='$(servicefile_DATA)'; test -n "$(servicefiledir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(servicefiledir)'"; \ $(MKDIR_P) "$(DESTDIR)$(servicefiledir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(servicefiledir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(servicefiledir)" || exit $$?; \ done uninstall-servicefileDATA: @$(NORMAL_UNINSTALL) @list='$(servicefile_DATA)'; test -n "$(servicefiledir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(servicefiledir)'; $(am__uninstall_files_from_dir) ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @list='$(MANS)'; if test -n "$$list"; then \ list=`for p in $$list; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \ if test -n "$$list" && \ grep 'ab help2man is required to generate this page' $$list >/dev/null; then \ echo "error: found man pages containing the \`missing help2man' replacement text:" >&2; \ grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/ /' >&2; \ echo " to fix them, install help2man, remove and regenerate the man pages;" >&2; \ echo " typically \`make maintainer-clean' will remove them" >&2; \ exit 1; \ else :; fi; \ else :; fi @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) $(MANS) $(DATA) installdirs: for dir in "$(DESTDIR)$(libexecdir)" "$(DESTDIR)$(man8dir)" "$(DESTDIR)$(servicefiledir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libexecPROGRAMS clean-libtool \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-man install-servicefileDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-libexecPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-man8 install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-libexecPROGRAMS uninstall-man \ uninstall-servicefileDATA uninstall-man: uninstall-man8 .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libexecPROGRAMS clean-libtool ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am \ install-libexecPROGRAMS install-man install-man8 install-pdf \ install-pdf-am install-ps install-ps-am \ install-servicefileDATA install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-libexecPROGRAMS \ uninstall-man uninstall-man8 uninstall-servicefileDATA %.service: %.service.in Makefile $(AM_V_GEN)sed \ -e 's![@]libexecdir[@]!$(libexecdir)!' \ -e 's![@]bindir[@]!$(bindir)!' \ $< > $@ %.8: %.8.in Makefile $(AM_V_GEN)sed -e 's![@]libexecdir[@]!$(libexecdir)!' $< > $@ Android.mk: Makefile.am androgenizer -:PROJECT telepathy-mission-control \ -:SHARED libmission-control-5 -:TAGS eng debug \ -:REL_TOP $(top_srcdir) -:ABS_TOP $(abs_top_srcdir) \ -:SOURCES $(mission_control_5_SOURCES) \ -:CFLAGS $(DEFAULT_INCLUDES) $(DEFS) $(CFLAGS) $(AM_CFLAGS) \ -:CPPFLAGS $(CPPFLAGS) $(AM_CPPFLAGS) $(INCLUDES) \ -DBUILD_AS_ANDROID_SERVICE \ -:LDFLAGS $(mission_control_5_LDADD) \ -:LIBFILTER_STATIC mcd-convenience mission-control-plugins \ mcclient \ > $@ # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: telepathy-mission-control-5.16.4/aclocal.m40000644000175000017500000016364412762351616021704 0ustar00gkiagiagkiagia00000000000000# generated automatically by aclocal 1.11.6 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, # Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, [m4_warning([this file was generated for autoconf 2.69. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically `autoreconf'.])]) dnl GLIB_GSETTINGS dnl Defines GSETTINGS_SCHEMAS_INSTALL which controls whether dnl the schema should be compiled dnl AC_DEFUN([GLIB_GSETTINGS], [ m4_pattern_allow([AM_V_GEN]) AC_ARG_ENABLE(schemas-compile, AS_HELP_STRING([--disable-schemas-compile], [Disable regeneration of gschemas.compiled on install]), [case ${enableval} in yes) GSETTINGS_DISABLE_SCHEMAS_COMPILE="" ;; no) GSETTINGS_DISABLE_SCHEMAS_COMPILE="1" ;; *) AC_MSG_ERROR([bad value ${enableval} for --enable-schemas-compile]) ;; esac]) AC_SUBST([GSETTINGS_DISABLE_SCHEMAS_COMPILE]) PKG_PROG_PKG_CONFIG([0.16]) AC_SUBST(gsettingsschemadir, [${datadir}/glib-2.0/schemas]) if test x$cross_compiling != xyes; then GLIB_COMPILE_SCHEMAS=`$PKG_CONFIG --variable glib_compile_schemas gio-2.0` else AC_PATH_PROG(GLIB_COMPILE_SCHEMAS, glib-compile-schemas) fi AC_SUBST(GLIB_COMPILE_SCHEMAS) if test "x$GLIB_COMPILE_SCHEMAS" = "x"; then ifelse([$2],,[AC_MSG_ERROR([glib-compile-schemas not found.])],[$2]) else ifelse([$1],,[:],[$1]) fi GSETTINGS_RULES=' .PHONY : uninstall-gsettings-schemas install-gsettings-schemas clean-gsettings-schemas mostlyclean-am: clean-gsettings-schemas gsettings__enum_file = $(addsuffix .enums.xml,$(gsettings_ENUM_NAMESPACE)) %.gschema.valid: %.gschema.xml $(gsettings__enum_file) $(AM_V_GEN) $(GLIB_COMPILE_SCHEMAS) --strict --dry-run $(addprefix --schema-file=,$(gsettings__enum_file)) --schema-file=$< && mkdir -p [$](@D) && touch [$]@ all-am: $(gsettings_SCHEMAS:.xml=.valid) uninstall-am: uninstall-gsettings-schemas install-data-am: install-gsettings-schemas .SECONDARY: $(gsettings_SCHEMAS) install-gsettings-schemas: $(gsettings_SCHEMAS) $(gsettings__enum_file) @$(NORMAL_INSTALL) if test -n "$^"; then \ test -z "$(gsettingsschemadir)" || $(MKDIR_P) "$(DESTDIR)$(gsettingsschemadir)"; \ $(INSTALL_DATA) $^ "$(DESTDIR)$(gsettingsschemadir)"; \ test -n "$(GSETTINGS_DISABLE_SCHEMAS_COMPILE)$(DESTDIR)" || $(GLIB_COMPILE_SCHEMAS) $(gsettingsschemadir); \ fi uninstall-gsettings-schemas: @$(NORMAL_UNINSTALL) @list='\''$(gsettings_SCHEMAS) $(gsettings__enum_file)'\''; test -n "$(gsettingsschemadir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e '\''s|^.*/||'\''`; \ test -n "$$files" || exit 0; \ echo " ( cd '\''$(DESTDIR)$(gsettingsschemadir)'\'' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(gsettingsschemadir)" && rm -f $$files test -n "$(GSETTINGS_DISABLE_SCHEMAS_COMPILE)$(DESTDIR)" || $(GLIB_COMPILE_SCHEMAS) $(gsettingsschemadir) clean-gsettings-schemas: rm -f $(gsettings_SCHEMAS:.xml=.valid) $(gsettings__enum_file) ifdef gsettings_ENUM_NAMESPACE $(gsettings__enum_file): $(gsettings_ENUM_FILES) $(AM_V_GEN) glib-mkenums --comments '\'''\'' --fhead "" --vhead " <@type@ id='\''$(gsettings_ENUM_NAMESPACE).@EnumName@'\''>" --vprod " " --vtail " " --ftail "" [$]^ > [$]@.tmp && mv [$]@.tmp [$]@ endif ' _GSETTINGS_SUBST(GSETTINGS_RULES) ]) dnl _GSETTINGS_SUBST(VARIABLE) dnl Abstract macro to do either _AM_SUBST_NOTMAKE or AC_SUBST AC_DEFUN([_GSETTINGS_SUBST], [ AC_SUBST([$1]) m4_ifdef([_AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE([$1])]) ] ) dnl pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- dnl serial 11 (pkg-config-0.29.1) dnl dnl Copyright © 2004 Scott James Remnant . dnl Copyright © 2012-2015 Dan Nicholson dnl dnl This program is free software; you can redistribute it and/or modify dnl it under the terms of the GNU General Public License as published by dnl the Free Software Foundation; either version 2 of the License, or dnl (at your option) any later version. dnl dnl This program is distributed in the hope that it will be useful, but dnl WITHOUT ANY WARRANTY; without even the implied warranty of dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU dnl General Public License for more details. dnl dnl You should have received a copy of the GNU General Public License dnl along with this program; if not, write to the Free Software dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA dnl 02111-1307, USA. dnl dnl As a special exception to the GNU General Public License, if you dnl distribute this file as part of a program that contains a dnl configuration script generated by Autoconf, you may include it under dnl the same distribution terms that you use for the rest of that dnl program. dnl PKG_PREREQ(MIN-VERSION) dnl ----------------------- dnl Since: 0.29 dnl dnl Verify that the version of the pkg-config macros are at least dnl MIN-VERSION. Unlike PKG_PROG_PKG_CONFIG, which checks the user's dnl installed version of pkg-config, this checks the developer's version dnl of pkg.m4 when generating configure. dnl dnl To ensure that this macro is defined, also add: dnl m4_ifndef([PKG_PREREQ], dnl [m4_fatal([must install pkg-config 0.29 or later before running autoconf/autogen])]) dnl dnl See the "Since" comment for each macro you use to see what version dnl of the macros you require. m4_defun([PKG_PREREQ], [m4_define([PKG_MACROS_VERSION], [0.29.1]) m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1, [m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])]) ])dnl PKG_PREREQ dnl PKG_PROG_PKG_CONFIG([MIN-VERSION]) dnl ---------------------------------- dnl Since: 0.16 dnl dnl Search for the pkg-config tool and set the PKG_CONFIG variable to dnl first found in the path. Checks that the version of pkg-config found dnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is dnl used since that's the first version where most current features of dnl pkg-config existed. AC_DEFUN([PKG_PROG_PKG_CONFIG], [m4_pattern_forbid([^_?PKG_[A-Z_]+$]) m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$]) m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$]) AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility]) AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path]) AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path]) if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) fi if test -n "$PKG_CONFIG"; then _pkg_min_version=m4_default([$1], [0.9.0]) AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) PKG_CONFIG="" fi fi[]dnl ])dnl PKG_PROG_PKG_CONFIG dnl PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) dnl ------------------------------------------------------------------- dnl Since: 0.18 dnl dnl Check to see whether a particular set of modules exists. Similar to dnl PKG_CHECK_MODULES(), but does not set variables or print errors. dnl dnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) dnl only at the first occurence in configure.ac, so if the first place dnl it's called might be skipped (such as if it is within an "if", you dnl have to call PKG_CHECK_EXISTS manually AC_DEFUN([PKG_CHECK_EXISTS], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl if test -n "$PKG_CONFIG" && \ AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then m4_default([$2], [:]) m4_ifvaln([$3], [else $3])dnl fi]) dnl _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) dnl --------------------------------------------- dnl Internal wrapper calling pkg-config via PKG_CONFIG and setting dnl pkg_failed based on the result. m4_define([_PKG_CONFIG], [if test -n "$$1"; then pkg_cv_[]$1="$$1" elif test -n "$PKG_CONFIG"; then PKG_CHECK_EXISTS([$3], [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes ], [pkg_failed=yes]) else pkg_failed=untried fi[]dnl ])dnl _PKG_CONFIG dnl _PKG_SHORT_ERRORS_SUPPORTED dnl --------------------------- dnl Internal check to see if pkg-config supports short errors. AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], [AC_REQUIRE([PKG_PROG_PKG_CONFIG]) if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi[]dnl ])dnl _PKG_SHORT_ERRORS_SUPPORTED dnl PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], dnl [ACTION-IF-NOT-FOUND]) dnl -------------------------------------------------------------- dnl Since: 0.4.0 dnl dnl Note that if there is a possibility the first call to dnl PKG_CHECK_MODULES might not happen, you should be sure to include an dnl explicit call to PKG_PROG_PKG_CONFIG in your configure.ac AC_DEFUN([PKG_CHECK_MODULES], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl pkg_failed=no AC_MSG_CHECKING([for $1]) _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) _PKG_CONFIG([$1][_LIBS], [libs], [$2]) m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS and $1[]_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details.]) if test $pkg_failed = yes; then AC_MSG_RESULT([no]) _PKG_SHORT_ERRORS_SUPPORTED if test $_pkg_short_errors_supported = yes; then $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1` else $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD m4_default([$4], [AC_MSG_ERROR( [Package requirements ($2) were not met: $$1_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. _PKG_TEXT])[]dnl ]) elif test $pkg_failed = untried; then AC_MSG_RESULT([no]) m4_default([$4], [AC_MSG_FAILURE( [The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. _PKG_TEXT To get pkg-config, see .])[]dnl ]) else $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS $1[]_LIBS=$pkg_cv_[]$1[]_LIBS AC_MSG_RESULT([yes]) $3 fi[]dnl ])dnl PKG_CHECK_MODULES dnl PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], dnl [ACTION-IF-NOT-FOUND]) dnl --------------------------------------------------------------------- dnl Since: 0.29 dnl dnl Checks for existence of MODULES and gathers its build flags with dnl static libraries enabled. Sets VARIABLE-PREFIX_CFLAGS from --cflags dnl and VARIABLE-PREFIX_LIBS from --libs. dnl dnl Note that if there is a possibility the first call to dnl PKG_CHECK_MODULES_STATIC might not happen, you should be sure to dnl include an explicit call to PKG_PROG_PKG_CONFIG in your dnl configure.ac. AC_DEFUN([PKG_CHECK_MODULES_STATIC], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl _save_PKG_CONFIG=$PKG_CONFIG PKG_CONFIG="$PKG_CONFIG --static" PKG_CHECK_MODULES($@) PKG_CONFIG=$_save_PKG_CONFIG[]dnl ])dnl PKG_CHECK_MODULES_STATIC dnl PKG_INSTALLDIR([DIRECTORY]) dnl ------------------------- dnl Since: 0.27 dnl dnl Substitutes the variable pkgconfigdir as the location where a module dnl should install pkg-config .pc files. By default the directory is dnl $libdir/pkgconfig, but the default can be changed by passing dnl DIRECTORY. The user can override through the --with-pkgconfigdir dnl parameter. AC_DEFUN([PKG_INSTALLDIR], [m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])]) m4_pushdef([pkg_description], [pkg-config installation directory @<:@]pkg_default[@:>@]) AC_ARG_WITH([pkgconfigdir], [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],, [with_pkgconfigdir=]pkg_default) AC_SUBST([pkgconfigdir], [$with_pkgconfigdir]) m4_popdef([pkg_default]) m4_popdef([pkg_description]) ])dnl PKG_INSTALLDIR dnl PKG_NOARCH_INSTALLDIR([DIRECTORY]) dnl -------------------------------- dnl Since: 0.27 dnl dnl Substitutes the variable noarch_pkgconfigdir as the location where a dnl module should install arch-independent pkg-config .pc files. By dnl default the directory is $datadir/pkgconfig, but the default can be dnl changed by passing DIRECTORY. The user can override through the dnl --with-noarch-pkgconfigdir parameter. AC_DEFUN([PKG_NOARCH_INSTALLDIR], [m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])]) m4_pushdef([pkg_description], [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@]) AC_ARG_WITH([noarch-pkgconfigdir], [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],, [with_noarch_pkgconfigdir=]pkg_default) AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir]) m4_popdef([pkg_default]) m4_popdef([pkg_description]) ])dnl PKG_NOARCH_INSTALLDIR dnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE, dnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) dnl ------------------------------------------- dnl Since: 0.28 dnl dnl Retrieves the value of the pkg-config variable for the given module. AC_DEFUN([PKG_CHECK_VAR], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl _PKG_CONFIG([$1], [variable="][$3]["], [$2]) AS_VAR_COPY([$1], [pkg_cv_][$1]) AS_VAR_IF([$1], [""], [$5], [$4])dnl ])dnl PKG_CHECK_VAR # Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008, 2011 Free Software # Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 1 # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.11' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. m4_if([$1], [1.11.6], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) # _AM_AUTOCONF_VERSION(VERSION) # ----------------------------- # aclocal traces this macro to find the Autoconf version. # This is a private macro too. Using m4_define simplifies # the logic in aclocal, which can simply ignore this definition. m4_define([_AM_AUTOCONF_VERSION], []) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.11.6])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 1 # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to # `$srcdir', `$srcdir/..', or `$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and # therefore $ac_aux_dir as well) can be either absolute or relative, # depending on how configure is run. This is pretty annoying, since # it makes $ac_aux_dir quite unusable in subdirectories: in the top # source directory, any form will work fine, but in subdirectories a # relative path needs to be adjusted first. # # $ac_aux_dir/missing # fails when called from a subdirectory if $ac_aux_dir is relative # $top_srcdir/$ac_aux_dir/missing # fails if $ac_aux_dir is absolute, # fails when called from a subdirectory in a VPATH build with # a relative $ac_aux_dir # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually # harmless because $srcdir is `.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, # iff we strip the leading $srcdir from $ac_aux_dir. That would be: # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${SHELL} $am_aux_dir/missing" # This will work as long as MISSING is not called from configure, because # unfortunately $(top_srcdir) has no meaning in configure. # However there are other variables, like CC, which are often used in # configure, and could therefore not use this "fixed" $ac_aux_dir. # # Another solution, used here, is to always expand $ac_aux_dir to an # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], [dnl Rely on autoconf to set up CDPATH properly. AC_PREREQ([2.50])dnl # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 9 # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ(2.52)dnl ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE])dnl AC_SUBST([$1_FALSE])dnl _AM_SUBST_NOTMAKE([$1_TRUE])dnl _AM_SUBST_NOTMAKE([$1_FALSE])dnl m4_define([_AM_COND_VALUE_$1], [$2])dnl if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([[conditional "$1" was never defined. Usually this means the macro was only invoked conditionally.]]) fi])]) # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009, # 2010, 2011 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 12 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. # NAME is "CC", "CXX", "GCJ", or "OBJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular # dependency, and given that the user is not expected to run this macro, # just rely on AC_PROG_CC. AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl ifelse([$1], CC, [depcc="$CC" am_compiler_list=], [$1], CXX, [depcc="$CXX" am_compiler_list=], [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$1], UPC, [depcc="$UPC" am_compiler_list=], [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_$1_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi am__universal=false m4_case([$1], [CC], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac], [CXX], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac]) for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok `-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_$1_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_$1_dependencies_compiler_type=none fi ]) AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) AM_CONDITIONAL([am__fastdep$1], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE(dependency-tracking, [ --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH])dnl _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl AC_SUBST([am__nodep])dnl _AM_SUBST_NOTMAKE([am__nodep])dnl ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. #serial 5 # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [{ # Autoconf 2.62 quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`AS_DIRNAME("$mf")` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running `make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`AS_DIRNAME(["$file"])` AS_MKDIR_P([$dirpart/$fdir]) # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ])# _AM_OUTPUT_DEPENDENCY_COMMANDS # AM_OUTPUT_DEPENDENCY_COMMANDS # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking # is enabled. FIXME. This creates each `.P' file that we will # need in order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) ]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006, 2008, 2009 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 16 # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.62])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl # test to see if srcdir already configured if test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) AM_MISSING_PROG(AUTOCONF, autoconf) AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) AM_MISSING_PROG(AUTOHEADER, autoheader) AM_MISSING_PROG(MAKEINFO, makeinfo) AC_REQUIRE([AM_PROG_INSTALL_SH])dnl AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl AC_REQUIRE([AM_PROG_MKDIR_P])dnl # We need awk for the "check" target. The system "awk" is bad on # some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES(CC)], [define([AC_PROG_CC], defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES(CXX)], [define([AC_PROG_CXX], defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES(OBJC)], [define([AC_PROG_OBJC], defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl ]) _AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl dnl The `parallel-tests' driver may need to know about EXEEXT, so add the dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro dnl is hooked onto _AC_COMPILER_EXEEXT early, see below. AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl ]) dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further dnl mangled by Autoconf and run in a shell conditional statement. m4_define([_AC_COMPILER_EXEEXT], m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_arg=$1 _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001, 2003, 2005, 2008, 2011 Free Software Foundation, # Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 1 # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl if test x"${install_sh}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi AC_SUBST(install_sh)]) # Copyright (C) 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 4 # AM_MAKE_INCLUDE() # ----------------- # Check to see how make treats includes. AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. AC_MSG_CHECKING([for style of include used by $am_make]) am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from `make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi AC_SUBST([am__include]) AC_SUBST([am__quote]) AC_MSG_RESULT([$_am_result]) rm -f confinc confmf ]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 6 # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it supports --run. # If it does, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= AC_MSG_WARN([`missing' script is too old or missing]) fi ]) # Copyright (C) 2003, 2004, 2005, 2006, 2011 Free Software Foundation, # Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 1 # AM_PROG_MKDIR_P # --------------- # Check for `mkdir -p'. AC_DEFUN([AM_PROG_MKDIR_P], [AC_PREREQ([2.60])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, dnl while keeping a definition of mkdir_p for backward compatibility. dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of dnl Makefile.ins that do not define MKDIR_P, so we do our own dnl adjustment using top_builddir (which is defined more often than dnl MKDIR_P). AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl case $mkdir_p in [[\\/$]]* | ?:[[\\/]]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; esac ]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005, 2008, 2010 Free Software # Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 5 # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # -------------------- # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), 1)]) # _AM_SET_OPTIONS(OPTIONS) # ------------------------ # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008, 2009, # 2011 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # AM_PATH_PYTHON([MINIMUM-VERSION], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) # --------------------------------------------------------------------------- # Adds support for distributing Python modules and packages. To # install modules, copy them to $(pythondir), using the python_PYTHON # automake variable. To install a package with the same name as the # automake package, install to $(pkgpythondir), or use the # pkgpython_PYTHON automake variable. # # The variables $(pyexecdir) and $(pkgpyexecdir) are provided as # locations to install python extension modules (shared libraries). # Another macro is required to find the appropriate flags to compile # extension modules. # # If your package is configured with a different prefix to python, # users will have to add the install directory to the PYTHONPATH # environment variable, or create a .pth file (see the python # documentation for details). # # If the MINIMUM-VERSION argument is passed, AM_PATH_PYTHON will # cause an error if the version of python installed on the system # doesn't meet the requirement. MINIMUM-VERSION should consist of # numbers and dots only. AC_DEFUN([AM_PATH_PYTHON], [ dnl Find a Python interpreter. Python versions prior to 2.0 are not dnl supported. (2.0 was released on October 16, 2000). m4_define_default([_AM_PYTHON_INTERPRETER_LIST], [python python2 python3 python3.2 python3.1 python3.0 python2.7 dnl python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python2.0]) AC_ARG_VAR([PYTHON], [the Python interpreter]) m4_if([$1],[],[ dnl No version check is needed. # Find any Python interpreter. if test -z "$PYTHON"; then AC_PATH_PROGS([PYTHON], _AM_PYTHON_INTERPRETER_LIST, :) fi am_display_PYTHON=python ], [ dnl A version check is needed. if test -n "$PYTHON"; then # If the user set $PYTHON, use it and don't search something else. AC_MSG_CHECKING([whether $PYTHON version >= $1]) AM_PYTHON_CHECK_VERSION([$PYTHON], [$1], [AC_MSG_RESULT(yes)], [AC_MSG_ERROR(too old)]) am_display_PYTHON=$PYTHON else # Otherwise, try each interpreter until we find one that satisfies # VERSION. AC_CACHE_CHECK([for a Python interpreter with version >= $1], [am_cv_pathless_PYTHON],[ for am_cv_pathless_PYTHON in _AM_PYTHON_INTERPRETER_LIST none; do test "$am_cv_pathless_PYTHON" = none && break AM_PYTHON_CHECK_VERSION([$am_cv_pathless_PYTHON], [$1], [break]) done]) # Set $PYTHON to the absolute path of $am_cv_pathless_PYTHON. if test "$am_cv_pathless_PYTHON" = none; then PYTHON=: else AC_PATH_PROG([PYTHON], [$am_cv_pathless_PYTHON]) fi am_display_PYTHON=$am_cv_pathless_PYTHON fi ]) if test "$PYTHON" = :; then dnl Run any user-specified action, or abort. m4_default([$3], [AC_MSG_ERROR([no suitable Python interpreter found])]) else dnl Query Python for its version number. Getting [:3] seems to be dnl the best way to do this; it's what "site.py" does in the standard dnl library. AC_CACHE_CHECK([for $am_display_PYTHON version], [am_cv_python_version], [am_cv_python_version=`$PYTHON -c "import sys; sys.stdout.write(sys.version[[:3]])"`]) AC_SUBST([PYTHON_VERSION], [$am_cv_python_version]) dnl Use the values of $prefix and $exec_prefix for the corresponding dnl values of PYTHON_PREFIX and PYTHON_EXEC_PREFIX. These are made dnl distinct variables so they can be overridden if need be. However, dnl general consensus is that you shouldn't need this ability. AC_SUBST([PYTHON_PREFIX], ['${prefix}']) AC_SUBST([PYTHON_EXEC_PREFIX], ['${exec_prefix}']) dnl At times (like when building shared libraries) you may want dnl to know which OS platform Python thinks this is. AC_CACHE_CHECK([for $am_display_PYTHON platform], [am_cv_python_platform], [am_cv_python_platform=`$PYTHON -c "import sys; sys.stdout.write(sys.platform)"`]) AC_SUBST([PYTHON_PLATFORM], [$am_cv_python_platform]) dnl Set up 4 directories: dnl pythondir -- where to install python scripts. This is the dnl site-packages directory, not the python standard library dnl directory like in previous automake betas. This behavior dnl is more consistent with lispdir.m4 for example. dnl Query distutils for this directory. AC_CACHE_CHECK([for $am_display_PYTHON script directory], [am_cv_python_pythondir], [if test "x$prefix" = xNONE then am_py_prefix=$ac_default_prefix else am_py_prefix=$prefix fi am_cv_python_pythondir=`$PYTHON -c "import sys; from distutils import sysconfig; sys.stdout.write(sysconfig.get_python_lib(0,0,prefix='$am_py_prefix'))" 2>/dev/null` case $am_cv_python_pythondir in $am_py_prefix*) am__strip_prefix=`echo "$am_py_prefix" | sed 's|.|.|g'` am_cv_python_pythondir=`echo "$am_cv_python_pythondir" | sed "s,^$am__strip_prefix,$PYTHON_PREFIX,"` ;; *) case $am_py_prefix in /usr|/System*) ;; *) am_cv_python_pythondir=$PYTHON_PREFIX/lib/python$PYTHON_VERSION/site-packages ;; esac ;; esac ]) AC_SUBST([pythondir], [$am_cv_python_pythondir]) dnl pkgpythondir -- $PACKAGE directory under pythondir. Was dnl PYTHON_SITE_PACKAGE in previous betas, but this naming is dnl more consistent with the rest of automake. AC_SUBST([pkgpythondir], [\${pythondir}/$PACKAGE]) dnl pyexecdir -- directory for installing python extension modules dnl (shared libraries) dnl Query distutils for this directory. AC_CACHE_CHECK([for $am_display_PYTHON extension module directory], [am_cv_python_pyexecdir], [if test "x$exec_prefix" = xNONE then am_py_exec_prefix=$am_py_prefix else am_py_exec_prefix=$exec_prefix fi am_cv_python_pyexecdir=`$PYTHON -c "import sys; from distutils import sysconfig; sys.stdout.write(sysconfig.get_python_lib(1,0,prefix='$am_py_exec_prefix'))" 2>/dev/null` case $am_cv_python_pyexecdir in $am_py_exec_prefix*) am__strip_prefix=`echo "$am_py_exec_prefix" | sed 's|.|.|g'` am_cv_python_pyexecdir=`echo "$am_cv_python_pyexecdir" | sed "s,^$am__strip_prefix,$PYTHON_EXEC_PREFIX,"` ;; *) case $am_py_exec_prefix in /usr|/System*) ;; *) am_cv_python_pyexecdir=$PYTHON_EXEC_PREFIX/lib/python$PYTHON_VERSION/site-packages ;; esac ;; esac ]) AC_SUBST([pyexecdir], [$am_cv_python_pyexecdir]) dnl pkgpyexecdir -- $(pyexecdir)/$(PACKAGE) AC_SUBST([pkgpyexecdir], [\${pyexecdir}/$PACKAGE]) dnl Run any user-specified action. $2 fi ]) # AM_PYTHON_CHECK_VERSION(PROG, VERSION, [ACTION-IF-TRUE], [ACTION-IF-FALSE]) # --------------------------------------------------------------------------- # Run ACTION-IF-TRUE if the Python interpreter PROG has version >= VERSION. # Run ACTION-IF-FALSE otherwise. # This test uses sys.hexversion instead of the string equivalent (first # word of sys.version), in order to cope with versions such as 2.2c1. # This supports Python 2.0 or higher. (2.0 was released on October 16, 2000). AC_DEFUN([AM_PYTHON_CHECK_VERSION], [prog="import sys # split strings by '.' and convert to numeric. Append some zeros # because we need at least 4 digits for the hex conversion. # map returns an iterator in Python 3.0 and a list in 2.x minver = list(map(int, '$2'.split('.'))) + [[0, 0, 0]] minverhex = 0 # xrange is not present in Python 3.0 and range returns an iterator for i in list(range(0, 4)): minverhex = (minverhex << 8) + minver[[i]] sys.exit(sys.hexversion < minverhex)" AS_IF([AM_RUN_LOG([$1 -c "$prog"])], [$3], [$4])]) # Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 1 # AM_RUN_LOG(COMMAND) # ------------------- # Run COMMAND, save the exit status in ac_status, and log it. # (This has been adapted from Autoconf's _AC_RUN_LOG macro.) AC_DEFUN([AM_RUN_LOG], [{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD (exit $ac_status); }]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 5 # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Just in case sleep 1 echo timestamp > conftest.file # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[[\\\"\#\$\&\'\`$am_lf]]*) AC_MSG_ERROR([unsafe absolute working directory name]);; esac case $srcdir in *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);; esac # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi rm -f conftest.file if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT(yes)]) # Copyright (C) 2009, 2011 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # AM_SILENT_RULES([DEFAULT]) # -------------------------- # Enable less verbose build rules; with the default set to DEFAULT # (`yes' being less verbose, `no' or empty being verbose). AC_DEFUN([AM_SILENT_RULES], [AC_ARG_ENABLE([silent-rules], [ --enable-silent-rules less verbose build output (undo: `make V=1') --disable-silent-rules verbose build output (undo: `make V=0')]) case $enable_silent_rules in yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; esac dnl dnl A few `make' implementations (e.g., NonStop OS and NextStep) dnl do not support nested variable expansions. dnl See automake bug#9928 and bug#10237. am_make=${MAKE-make} AC_CACHE_CHECK([whether $am_make supports nested variables], [am_cv_make_support_nested_variables], [if AS_ECHO([['TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi]) if test $am_cv_make_support_nested_variables = yes; then dnl Using `$V' instead of `$(V)' breaks IRIX make. AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AC_SUBST([AM_V])dnl AM_SUBST_NOTMAKE([AM_V])dnl AC_SUBST([AM_DEFAULT_V])dnl AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl AC_SUBST([AM_DEFAULT_VERBOSITY])dnl AM_BACKSLASH='\' AC_SUBST([AM_BACKSLASH])dnl _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl ]) # Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 1 # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor `install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in `make install-strip', and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. dnl Don't test for $cross_compiling = yes, because it might be `maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Copyright (C) 2006, 2008, 2010 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 3 # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. # This macro is traced by Automake. AC_DEFUN([_AM_SUBST_NOTMAKE]) # AM_SUBST_NOTMAKE(VARIABLE) # -------------------------- # Public sister of _AM_SUBST_NOTMAKE. AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004, 2005, 2012 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. # FORMAT should be one of `v7', `ustar', or `pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory # $tardir. # tardir=directory && $(am__tar) > result.tar # # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AC_SUBST([AMTAR], ['$${TAR-tar}']) m4_if([$1], [v7], [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], [m4_case([$1], [ustar],, [pax],, [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' _am_tools=${am_cv_prog_tar_$1-$_am_tools} # Do not fold the above two line into one, because Tru64 sh and # Solaris sh will not grok spaces in the rhs of `-'. for _am_tool in $_am_tools do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR m4_include([m4/gtk-doc.m4]) m4_include([m4/libtool.m4]) m4_include([m4/ltoptions.m4]) m4_include([m4/ltsugar.m4]) m4_include([m4/ltversion.m4]) m4_include([m4/lt~obsolete.m4]) m4_include([m4/tp-compiler-flag.m4]) m4_include([m4/tp-compiler-warnings.m4])