dbus-glib-0.100.2/0000755000175000017500000000000012112654010010513 500000000000000dbus-glib-0.100.2/dbus/0000755000175000017500000000000012112654010011450 500000000000000dbus-glib-0.100.2/dbus/dbus-gsignature.c0000644000175000017500000001365012107524563014661 00000000000000/* -*- mode: C; c-file-style: "gnu" -*- */ /* dbus-gsignature.c Mapping from dbus type signatures to GType * * Copyright (C) 2005 Red Hat, Inc. * * Licensed under the Academic Free License version 2.1 * * 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 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * */ #include "config.h" #include "dbus-gtest.h" #include "dbus-gsignature.h" #include "dbus-gvalue-utils.h" #include #include #define MAP_BASIC(d_t, g_t) \ case DBUS_TYPE_##d_t: \ return G_TYPE_##g_t; static GType typecode_to_gtype (int type) { switch (type) { MAP_BASIC (BOOLEAN, BOOLEAN); MAP_BASIC (BYTE, UCHAR); MAP_BASIC (INT16, INT); MAP_BASIC (INT32, INT); MAP_BASIC (UINT16, UINT); MAP_BASIC (UINT32, UINT); MAP_BASIC (INT64, INT64); MAP_BASIC (UINT64, UINT64); MAP_BASIC (DOUBLE, DOUBLE); MAP_BASIC (STRING, STRING); default: return G_TYPE_INVALID; } } #undef MAP_BASIC static gboolean dbus_typecode_maps_to_basic (int typecode) { return typecode_to_gtype (typecode) != G_TYPE_INVALID; } GType _dbus_gtype_from_basic_typecode (int typecode) { g_assert (dbus_type_is_basic (typecode)); g_assert (dbus_typecode_maps_to_basic (typecode)); return typecode_to_gtype (typecode); } static GType signature_iter_to_g_type_dict (const DBusSignatureIter *subiter, gboolean is_client) { DBusSignatureIter iter; GType key_gtype; GType value_gtype; g_assert (dbus_signature_iter_get_current_type (subiter) == DBUS_TYPE_DICT_ENTRY); dbus_signature_iter_recurse (subiter, &iter); key_gtype = _dbus_gtype_from_signature_iter (&iter, is_client); if (key_gtype == G_TYPE_INVALID) return G_TYPE_INVALID; dbus_signature_iter_next (&iter); value_gtype = _dbus_gtype_from_signature_iter (&iter, is_client); if (value_gtype == G_TYPE_INVALID) return G_TYPE_INVALID; if (!_dbus_gtype_is_valid_hash_key (key_gtype) || !_dbus_gtype_is_valid_hash_value (value_gtype)) /* Later we need to return DBUS_TYPE_G_VALUE */ return G_TYPE_INVALID; return dbus_g_type_get_map ("GHashTable", key_gtype, value_gtype); } static GType signature_iter_to_g_type_array (DBusSignatureIter *iter, gboolean is_client) { GType elt_gtype; elt_gtype = _dbus_gtype_from_signature_iter (iter, is_client); if (elt_gtype == G_TYPE_INVALID) return G_TYPE_INVALID; if (elt_gtype == G_TYPE_OBJECT) return DBUS_TYPE_G_OBJECT_ARRAY; if (elt_gtype == G_TYPE_STRING) return G_TYPE_STRV; if (_dbus_g_type_is_fixed (elt_gtype)) return dbus_g_type_get_collection ("GArray", elt_gtype); else if (g_type_is_a (elt_gtype, G_TYPE_OBJECT) || g_type_is_a (elt_gtype, G_TYPE_BOXED)) return dbus_g_type_get_collection ("GPtrArray", elt_gtype); /* Later we need to return DBUS_TYPE_G_VALUE */ return G_TYPE_INVALID; } static GType signature_iter_to_g_type_struct (DBusSignatureIter *iter, gboolean is_client) { GArray *types; GType ret; types = g_array_new (FALSE, FALSE, sizeof (GType)); do { GType curtype; curtype = _dbus_gtype_from_signature_iter (iter, is_client); g_array_append_val (types, curtype); } while (dbus_signature_iter_next (iter)); ret = dbus_g_type_get_structv ("GValueArray", types->len, (GType*) types->data); g_array_free (types, TRUE); return ret; } GType _dbus_gtype_from_signature_iter (DBusSignatureIter *iter, gboolean is_client) { int current_type; current_type = dbus_signature_iter_get_current_type (iter); /* TODO: handle type 0? */ if (dbus_typecode_maps_to_basic (current_type)) return _dbus_gtype_from_basic_typecode (current_type); else if (current_type == DBUS_TYPE_OBJECT_PATH) return DBUS_TYPE_G_OBJECT_PATH; else if (current_type == DBUS_TYPE_SIGNATURE) return DBUS_TYPE_G_SIGNATURE; else { DBusSignatureIter subiter; g_assert (dbus_type_is_container (current_type)); if (current_type == DBUS_TYPE_VARIANT) return G_TYPE_VALUE; dbus_signature_iter_recurse (iter, &subiter); if (current_type == DBUS_TYPE_ARRAY) { int elt_type = dbus_signature_iter_get_current_type (&subiter); if (elt_type == DBUS_TYPE_DICT_ENTRY) return signature_iter_to_g_type_dict (&subiter, is_client); else return signature_iter_to_g_type_array (&subiter, is_client); } else if (current_type == DBUS_TYPE_STRUCT) { return signature_iter_to_g_type_struct (&subiter, is_client); } else { g_assert_not_reached (); return G_TYPE_INVALID; } } } GType _dbus_gtype_from_signature (const char *signature, gboolean is_client) { DBusSignatureIter iter; dbus_signature_iter_init (&iter, signature); return _dbus_gtype_from_signature_iter (&iter, is_client); } GArray * _dbus_gtypes_from_arg_signature (const char *argsig, gboolean is_client) { GArray *ret; int current_type; DBusSignatureIter sigiter; ret = g_array_new (FALSE, FALSE, sizeof (GType)); dbus_signature_iter_init (&sigiter, argsig); while ((current_type = dbus_signature_iter_get_current_type (&sigiter)) != DBUS_TYPE_INVALID) { GType curtype; curtype = _dbus_gtype_from_signature_iter (&sigiter, is_client); g_array_append_val (ret, curtype); dbus_signature_iter_next (&sigiter); } return ret; } dbus-glib-0.100.2/dbus/dbus-gparser.h0000644000175000017500000000475212107524563014164 00000000000000/* -*- mode: C; c-file-style: "gnu" -*- */ /* dbus-gparser.h parse DBus description files * * Copyright (C) 2003 Red Hat, Inc. * * Licensed under the Academic Free License version 2.1 * * 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 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * */ #ifndef DBUS_GLIB_PARSER_H #define DBUS_GLIB_PARSER_H #include #include #include "dbus-gidl.h" G_BEGIN_DECLS typedef struct Parser Parser; Parser* parser_new (void); Parser* parser_ref (Parser *parser); void parser_unref (Parser *parser); gboolean parser_check_doctype (Parser *parser, const char *doctype, GError **error); gboolean parser_start_element (Parser *parser, const char *element_name, const char **attribute_names, const char **attribute_values, GError **error); gboolean parser_end_element (Parser *parser, const char *element_name, GError **error); gboolean parser_content (Parser *parser, const char *content, int len, GError **error); gboolean parser_finished (Parser *parser, GError **error); NodeInfo* description_load_from_file (const char *filename, GError **error); NodeInfo* description_load_from_string (const char *str, int len, GError **error); NodeInfo* parser_get_nodes (Parser *parser); G_END_DECLS #endif /* DBUS_GLIB_GPARSER_H */ dbus-glib-0.100.2/dbus/dbus-gobject.c0000644000175000017500000032533612112652540014126 00000000000000/* -*- mode: C; c-file-style: "gnu" -*- */ /* dbus-gobject.c Exporting a GObject remotely * * Copyright (C) 2003, 2004, 2005 Red Hat, Inc. * Copyright (C) 2005 Nokia * * Licensed under the Academic Free License version 2.1 * * 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 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * */ #include #include #include #include #include "dbus-gtest.h" #include "dbus-gutils.h" #include "dbus-gobject.h" #include "dbus-gsignature.h" #include "dbus-gvalue.h" #include "dbus-gmarshal.h" #include "dbus-gvalue-utils.h" #include #include G_GNUC_NORETURN static void oom (const gchar *explanation) { g_error ("%s", explanation == NULL ? "Out of memory" : explanation); g_assert_not_reached (); } static DBusMessage * reply_or_die (DBusMessage *in_reply_to) { DBusMessage *reply; g_return_val_if_fail (in_reply_to != NULL, NULL); reply = dbus_message_new_method_return (in_reply_to); if (reply == NULL) oom ("dbus_message_new_method_return failed: out of memory?"); return reply; } static DBusMessage * error_or_die (DBusMessage *in_reply_to, const gchar *error_name, const gchar *error_message) { DBusMessage *reply; g_return_val_if_fail (in_reply_to != NULL, NULL); /* error names are syntactically the same as interface names */ g_return_val_if_fail (g_dbus_is_interface_name (error_name), NULL); g_return_val_if_fail (g_utf8_validate (error_message, -1, NULL), NULL); reply = dbus_message_new_error (in_reply_to, error_name, error_message); if (reply == NULL) oom ("dbus_message_new_error failed: out of memory?"); return reply; } static void connection_send_or_die (DBusConnection *connection, DBusMessage *message) { g_return_if_fail (connection != NULL); g_return_if_fail (message != NULL); if (!dbus_connection_send (connection, message, NULL)) oom ("dbus_connection_send failed: out of memory?"); } static char *lookup_property_name (GObject *object, const char *wincaps_propiface, const char *requested_propname); typedef struct { char *default_iface; GType code_enum; } DBusGErrorInfo; static GStaticRWLock globals_lock = G_STATIC_RW_LOCK_INIT; /* See comments in check_property_access */ static gboolean disable_legacy_property_access = FALSE; static GHashTable *marshal_table = NULL; static GData *error_metadata = NULL; static char* uscore_to_wincaps_full (const char *uscore, gboolean uppercase_first, gboolean strip_underscores) { const char *p; GString *str; gboolean last_was_uscore; last_was_uscore = uppercase_first; str = g_string_new (NULL); p = uscore; while (p && *p) { if (*p == '-' || (strip_underscores && *p == '_')) { last_was_uscore = TRUE; } else { if (last_was_uscore) { g_string_append_c (str, g_ascii_toupper (*p)); last_was_uscore = FALSE; } else g_string_append_c (str, *p); } ++p; } return g_string_free (str, FALSE); } /* Ugly yes - but we have to accept strings from both formats */ static gboolean compare_strings_ignoring_uscore_vs_dash (const char *a, const char *b) { guint i; for (i = 0; a[i] && b[i]; i++) { if ((a[i] == '-' && b[i] == '_') || (a[i] == '_' && b[i] == '-')) continue; if (a[i] != b[i]) return FALSE; } return (a[i] == '\0') && (b[i] == '\0'); } static char * uscore_to_wincaps (const char *uscore) { return uscore_to_wincaps_full (uscore, TRUE, TRUE); } static const char * string_table_next (const char *table) { return (table + (strlen (table) + 1)); } static const char * string_table_lookup (const char *table, int index) { const char *ret; ret = table; while (index--) ret = string_table_next (ret); return ret; } static const char * get_method_data (const DBusGObjectInfo *object, const DBusGMethodInfo *method) { return object->data + method->data_offset; } static char * object_error_domain_prefix_from_object_info (const DBusGObjectInfo *info) { /* FIXME */ return NULL; } static char * object_error_code_from_object_info (const DBusGObjectInfo *info, GQuark domain, gint code) { /* FIXME */ return NULL; } static const char * method_interface_from_object_info (const DBusGObjectInfo *object, const DBusGMethodInfo *method) { return string_table_lookup (get_method_data (object, method), 0); } static const char * method_name_from_object_info (const DBusGObjectInfo *object, const DBusGMethodInfo *method) { return string_table_lookup (get_method_data (object, method), 1); } static const char * method_arg_info_from_object_info (const DBusGObjectInfo *object, const DBusGMethodInfo *method) { return string_table_lookup (get_method_data (object, method), 3);/*RB was 2*/ } typedef enum { RETVAL_NONE, RETVAL_NOERROR, RETVAL_ERROR } RetvalType; /* * arg_iterate: * @data: a pointer to the beginning of an argument entry in a string table * @name: (out) (allow-none): used to return the name of the next argument * @in: (out) (allow-none): used to return %TRUE for an "in" argument or * %FALSE for an "out" argument * @constval: (out) (allow-none): used to return %TRUE if the argument is * an "out" argument and has the "C" (const) flag indicating that it * should not be freed after it is returned; normally, "out" arguments * are freed * @retval: (out) (allow-none): used to return %RETVAL_NONE if this * D-Bus argument is not an "out" argument or is obtained like a C "out" * parameter, %RETVAL_ERROR if this argument is obtained from the C * return value and is also used to signal errors, or %RETVAL_NOERROR * if this argument is obtained from the C return value and the method * can never raise an error * @type: (out) (allow-none): used to return the D-Bus signature of this * argument * * The data format is: * * argument name * \0 * direction: I or O * \0 * if direction == "O": * freeable? F or C * \0 * retval? N, E or R * \0 * signature * \0 * * If none of the arguments has @retval != %RETVAL_NONE, the method is * assumed to return a gboolean, which behaves like %RETVAL_ERROR but is * not sent over D-Bus at all. * * Returns: the value of @data to use for the next call, or a pointer to '\0' * if this function must not be called again */ static const char * arg_iterate (const char *data, const char **name, gboolean *in, gboolean *constval, RetvalType *retval, const char **type) { gboolean inarg; if (name) *name = data; data = string_table_next (data); switch (*data) { case 'I': inarg = TRUE; break; case 'O': inarg = FALSE; break; default: g_warning ("invalid arg direction '%c'", *data); inarg = FALSE; break; } if (in) *in = inarg; if (!inarg) { data = string_table_next (data); switch (*data) { case 'F': if (constval) *constval = FALSE; break; case 'C': if (constval) *constval = TRUE; break; default: g_warning ("invalid arg const value '%c'", *data); break; } data = string_table_next (data); switch (*data) { case 'N': if (retval) *retval = RETVAL_NONE; break; case 'E': if (retval) *retval = RETVAL_ERROR; break; case 'R': if (retval) *retval = RETVAL_NOERROR; break; default: g_warning ("invalid arg ret value '%c'", *data); break; } } else { if (constval) *constval = FALSE; if (retval) *retval = FALSE; } data = string_table_next (data); if (type) *type = data; return string_table_next (data); } static char * method_dir_signature_from_object_info (const DBusGObjectInfo *object, const DBusGMethodInfo *method, gboolean in) { const char *arg; GString *ret; arg = method_arg_info_from_object_info (object, method); ret = g_string_new (NULL); while (*arg) { const char *name; gboolean arg_in; const char *type; arg = arg_iterate (arg, &name, &arg_in, NULL, NULL, &type); if (arg_in == in) g_string_append (ret, type); } return g_string_free (ret, FALSE); } static char * method_input_signature_from_object_info (const DBusGObjectInfo *object, const DBusGMethodInfo *method) { return method_dir_signature_from_object_info (object, method, TRUE); } static char * method_output_signature_from_object_info (const DBusGObjectInfo *object, const DBusGMethodInfo *method) { return method_dir_signature_from_object_info (object, method, FALSE); } static const char * signal_iterate (const char *data, const char **iface, const char **name) { *iface = data; data = string_table_next (data); *name = data; return string_table_next (data); } static const char * property_iterate (const char *data, int format_version, const char **iface, const char **exported_name, const char **name_uscored, const char **access_type) { *iface = data; data = string_table_next (data); *exported_name = data; data = string_table_next (data); if (format_version == 1) { *name_uscored = data; data = string_table_next (data); *access_type = data; return string_table_next (data); } else { /* This tells the caller they need to compute it */ *name_uscored = NULL; /* We don't know here, however note that we will still check against the * readable/writable flags from GObject's metadata. */ *access_type = "readwrite"; return data; } } /** * property_info_from_object_info: * @object: introspection data * @interface_name: (allow-none): Expected interface name, or %NULL for any * @property_name: Expected property name (can use "-" or "_" as separator) * @access_type: (out): Can be one of "read", "write", "readwrite" * * Look up property introspection data for the given interface/name pair. * * Returns: %TRUE if property was found */ static gboolean property_info_from_object_info (const DBusGObjectInfo *object, const char *interface_name, const char *property_name, const char **access_type) { const char *properties_iter; properties_iter = object->exported_properties; while (properties_iter != NULL && *properties_iter) { const char *cur_interface_name; const char *cur_property_name; const char *cur_uscore_property_name; const char *cur_access_type; properties_iter = property_iterate (properties_iter, object->format_version, &cur_interface_name, &cur_property_name, &cur_uscore_property_name, &cur_access_type); if (interface_name && strcmp (interface_name, cur_interface_name) != 0) continue; /* This big pile of ugly is necessary to support the matrix resulting from multiplying * (v0 data, v1 data) * (FooBar, foo-bar) * In v1 data we have both forms of string, so we do a comparison against both without * having to malloc. * For v0 data, we need to reconstruct the foo-bar form. * * Adding to the complexity is that we *also* have to ignore the distinction between * '-' and '_', because g_object_{get,set} does. */ /* First, compare against the primary property name - no malloc required */ if (!compare_strings_ignoring_uscore_vs_dash (property_name, cur_property_name)) { if (cur_uscore_property_name != NULL && !compare_strings_ignoring_uscore_vs_dash (property_name, cur_uscore_property_name)) continue; else { /* v0 metadata, construct uscore */ char *tmp_uscored; gboolean matches; tmp_uscored = _dbus_gutils_wincaps_to_uscore (cur_property_name); matches = compare_strings_ignoring_uscore_vs_dash (property_name, tmp_uscored); g_free (tmp_uscored); if (!matches) continue; } } *access_type = cur_access_type; return TRUE; } return FALSE; } static GQuark dbus_g_object_type_dbus_metadata_quark (void) { static GQuark quark; if (!quark) quark = g_quark_from_static_string ("DBusGObjectTypeDBusMetadataQuark"); return quark; } /* Iterator function should return FALSE to stop iteration, TRUE to continue */ typedef gboolean (*ForeachObjectInfoFn) (const DBusGObjectInfo *info, GType gtype, gpointer user_data); static void foreach_object_info (GObject *object, ForeachObjectInfoFn callback, gpointer user_data) { GType *interfaces, *p; const DBusGObjectInfo *info; GType classtype; interfaces = g_type_interfaces (G_TYPE_FROM_INSTANCE (object), NULL); for (p = interfaces; *p != 0; p++) { info = g_type_get_qdata (*p, dbus_g_object_type_dbus_metadata_quark ()); if (info != NULL && info->format_version >= 0) { if (!callback (info, *p, user_data)) break; } } g_free (interfaces); for (classtype = G_TYPE_FROM_INSTANCE (object); classtype != 0; classtype = g_type_parent (classtype)) { info = g_type_get_qdata (classtype, dbus_g_object_type_dbus_metadata_quark ()); if (info != NULL && info->format_version >= 0) { if (!callback (info, classtype, user_data)) break; } } } static gboolean lookup_object_info_cb (const DBusGObjectInfo *info, GType gtype, gpointer user_data) { GList **list = (GList **) user_data; *list = g_list_prepend (*list, (gpointer) info); return TRUE; } static GList * lookup_object_info (GObject *object) { GList *info_list = NULL; foreach_object_info (object, lookup_object_info_cb, &info_list); return info_list; } typedef struct { const char *iface; const DBusGObjectInfo *info; gboolean fallback; GType iface_type; } LookupObjectInfoByIfaceData; static gboolean lookup_object_info_by_iface_cb (const DBusGObjectInfo *info, GType gtype, gpointer user_data) { LookupObjectInfoByIfaceData *lookup_data = (LookupObjectInfoByIfaceData *) user_data; /* If interface is not specified, choose the first info */ if (lookup_data->fallback && (!lookup_data->iface || strlen (lookup_data->iface) == 0)) { lookup_data->info = info; lookup_data->iface_type = gtype; } else if (info->exported_properties && !strcmp (info->exported_properties, lookup_data->iface)) { lookup_data->info = info; lookup_data->iface_type = gtype; } return !lookup_data->info; } static const DBusGObjectInfo * lookup_object_info_by_iface (GObject *object, const char *iface, gboolean fallback, GType *out_iface_type) { LookupObjectInfoByIfaceData data; data.iface = iface; data.info = NULL; data.fallback = fallback; data.iface_type = 0; foreach_object_info (object, lookup_object_info_by_iface_cb, &data); if (out_iface_type && data.info) *out_iface_type = data.iface_type; return data.info; } typedef struct { /* owned */ GSList *registrations; /* weak ref, or NULL if the object has been disposed */ GObject *object; } ObjectExport; typedef struct { /* pseudo-weak ref, never NULL */ DBusGConnection *connection; /* owned, never NULL */ gchar *object_path; /* borrowed pointer to parent, never NULL */ ObjectExport *export; } ObjectRegistration; static void object_export_object_died (gpointer user_data, GObject *dead); static void object_export_unregister_all (ObjectExport *oe) { while (oe->registrations != NULL) { GSList *old = oe->registrations; ObjectRegistration *o = oe->registrations->data; dbus_connection_unregister_object_path ( DBUS_CONNECTION_FROM_G_CONNECTION (o->connection), o->object_path); /* the link should have been removed by doing that */ g_assert (oe->registrations != old); } } static void object_export_free (ObjectExport *oe) { g_slice_free (ObjectExport, oe); } static ObjectExport * object_export_new (void) { return g_slice_new0 (ObjectExport); } static ObjectRegistration * object_registration_new (DBusGConnection *connection, const gchar *object_path, ObjectExport *export) { ObjectRegistration *o = g_slice_new0 (ObjectRegistration); o->connection = connection; o->object_path = g_strdup (object_path); o->export = export; return o; } static void object_registration_free (ObjectRegistration *o) { g_assert (o->export != NULL); o->export->registrations = g_slist_remove (o->export->registrations, o); g_free (o->object_path); g_slice_free (ObjectRegistration, o); } /* Called when the object falls off the bus (e.g. because connection just * closed) */ static void object_registration_unregistered (DBusConnection *connection, void *user_data) { object_registration_free (user_data); } typedef struct { GObject *object; GString *xml; GType gtype; const DBusGObjectInfo *object_info; } DBusGLibWriteIterfaceData; typedef struct { GSList *methods; GSList *signals; GSList *properties; } DBusGLibWriteInterfaceValues; static void write_interface (gpointer key, gpointer val, gpointer user_data) { const char *name; GSList *methods; GSList *signals; GSList *properties; GString *xml; const DBusGObjectInfo *object_info; DBusGLibWriteIterfaceData *data; DBusGLibWriteInterfaceValues *values; name = key; values = val; methods = values->methods; signals = values->signals; properties = values->properties; data = user_data; xml = data->xml; object_info = data->object_info; g_string_append_printf (xml, " \n", name); /* FIXME: recurse to parent types ? */ for (; methods; methods = methods->next) { DBusGMethodInfo *method; const char *args; method = methods->data; g_string_append_printf (xml, " \n", method_name_from_object_info (object_info, method)); args = method_arg_info_from_object_info (object_info, method); while (*args) { const char *name; gboolean arg_in; const char *type; args = arg_iterate (args, &name, &arg_in, NULL, NULL, &type); /* FIXME - handle container types */ g_string_append_printf (xml, " \n", name, type, arg_in ? "in" : "out"); } g_string_append (xml, " \n"); } g_slist_free (values->methods); for (; signals; signals = signals->next) { guint id; guint arg; const char *signame; GSignalQuery query; char *s; signame = signals->data; s = _dbus_gutils_wincaps_to_uscore (signame); id = g_signal_lookup (s, data->gtype); g_assert (id != 0); g_signal_query (id, &query); g_assert (query.return_type == G_TYPE_NONE); g_string_append_printf (xml, " \n", signame); for (arg = 0; arg < query.n_params; arg++) { char *dbus_type = _dbus_gtype_to_signature (query.param_types[arg]); g_assert (dbus_type != NULL); g_string_append (xml, " \n"); g_free (dbus_type); } g_string_append (xml, " \n"); g_free (s); } g_slist_free (values->signals); for (; properties; properties = properties->next) { const char *iface; const char *propname; const char *propname_uscore; const char *access_type; GParamSpec *spec; char *dbus_type; gboolean can_set; gboolean can_get; char *s; spec = NULL; property_iterate (properties->data, object_info->format_version, &iface, &propname, &propname_uscore, &access_type); s = lookup_property_name (data->object, name, propname); spec = g_object_class_find_property (g_type_class_peek (data->gtype), s); g_assert (spec != NULL); g_free (s); dbus_type = _dbus_gtype_to_signature (G_PARAM_SPEC_VALUE_TYPE (spec)); g_assert (dbus_type != NULL); can_set = strcmp (access_type, "readwrite") == 0 && ((spec->flags & G_PARAM_WRITABLE) != 0 && (spec->flags & G_PARAM_CONSTRUCT_ONLY) == 0); can_get = (spec->flags & G_PARAM_READABLE) != 0; if (can_set || can_get) { g_string_append_printf (xml, " \n"); } g_free (dbus_type); } g_slist_free (values->properties); g_free (values); g_string_append (xml, " \n"); } static DBusGLibWriteInterfaceValues * lookup_values (GHashTable *interfaces, const char *method_interface) { DBusGLibWriteInterfaceValues *values; if ((values = g_hash_table_lookup (interfaces, (gpointer) method_interface)) == NULL) { values = g_new0 (DBusGLibWriteInterfaceValues, 1); g_hash_table_insert (interfaces, (gpointer) method_interface, values); } return values; } static void introspect_interfaces (GObject *object, GString *xml) { GList *info_list; const GList *info_list_walk; const DBusGObjectInfo *info; DBusGLibWriteIterfaceData data; int i; GHashTable *interfaces; DBusGLibWriteInterfaceValues *values; const char *propsig; info_list = lookup_object_info (object); g_assert (info_list != NULL); /* Gather a list of all interfaces, indexed into their methods */ for (info_list_walk = info_list; info_list_walk != NULL; info_list_walk = g_list_next (info_list_walk)) { info = (DBusGObjectInfo *) info_list_walk->data; interfaces = g_hash_table_new (g_str_hash, g_str_equal); g_assert (info != NULL); for (i = 0; i < info->n_method_infos; i++) { const char *method_interface; const DBusGMethodInfo *method; method = &(info->method_infos[i]); method_interface = method_interface_from_object_info (info, method); values = lookup_values (interfaces, method_interface); values->methods = g_slist_prepend (values->methods, (gpointer) method); } propsig = info->exported_signals; while (propsig != NULL && *propsig) { const char *iface; const char *signame; propsig = signal_iterate (propsig, &iface, &signame); values = lookup_values (interfaces, iface); values->signals = g_slist_prepend (values->signals, (gpointer) signame); } propsig = info->exported_properties; while (propsig != NULL && *propsig) { const char *iface; const char *propname; const char *propname_uscore; const char *access_type; propsig = property_iterate (propsig, info->format_version, &iface, &propname, &propname_uscore, &access_type); values = lookup_values (interfaces, iface); values->properties = g_slist_prepend (values->properties, (gpointer)iface); } memset (&data, 0, sizeof (data)); data.xml = xml; data.gtype = G_TYPE_FROM_INSTANCE (object); data.object_info = info; data.object = object; g_hash_table_foreach (interfaces, write_interface, &data); g_hash_table_destroy (interfaces); } g_list_free (info_list); } static DBusHandlerResult handle_introspect (DBusConnection *connection, DBusMessage *message, GObject *object) { GString *xml; unsigned int i; DBusMessage *ret; char **children; if (!dbus_connection_list_registered (connection, dbus_message_get_path (message), &children)) oom (NULL); xml = g_string_new (NULL); g_string_append (xml, DBUS_INTROSPECT_1_0_XML_DOCTYPE_DECL_NODE); g_string_append (xml, "\n"); /* We are introspectable, though I guess that was pretty obvious */ g_string_append_printf (xml, " \n", DBUS_INTERFACE_INTROSPECTABLE); g_string_append (xml, " \n"); g_string_append_printf (xml, " \n", DBUS_TYPE_STRING_AS_STRING); g_string_append (xml, " \n"); g_string_append (xml, " \n"); /* We support get/set/getall properties */ g_string_append_printf (xml, " \n", DBUS_INTERFACE_PROPERTIES); g_string_append (xml, " \n"); g_string_append_printf (xml, " \n", DBUS_TYPE_STRING_AS_STRING); g_string_append_printf (xml, " \n", DBUS_TYPE_STRING_AS_STRING); g_string_append_printf (xml, " \n", DBUS_TYPE_VARIANT_AS_STRING); g_string_append (xml, " \n"); g_string_append (xml, " \n"); g_string_append_printf (xml, " \n", DBUS_TYPE_STRING_AS_STRING); g_string_append_printf (xml, " \n", DBUS_TYPE_STRING_AS_STRING); g_string_append_printf (xml, " \n", DBUS_TYPE_VARIANT_AS_STRING); g_string_append (xml, " \n"); g_string_append (xml, " \n"); g_string_append_printf (xml, " \n", DBUS_TYPE_STRING_AS_STRING); g_string_append_printf (xml, " \n", DBUS_TYPE_ARRAY_AS_STRING DBUS_DICT_ENTRY_BEGIN_CHAR_AS_STRING DBUS_TYPE_STRING_AS_STRING DBUS_TYPE_VARIANT_AS_STRING DBUS_DICT_ENTRY_END_CHAR_AS_STRING ); g_string_append (xml, " \n"); g_string_append (xml, " \n"); introspect_interfaces (object, xml); /* Append child nodes */ for (i = 0; children[i]; i++) g_string_append_printf (xml, " \n", children[i]); /* Close the XML, and send it to the requesting app */ g_string_append (xml, "\n"); ret = reply_or_die (message); dbus_message_append_args (ret, DBUS_TYPE_STRING, &xml->str, DBUS_TYPE_INVALID); connection_send_or_die (connection, ret); dbus_message_unref (ret); g_string_free (xml, TRUE); dbus_free_string_array (children); return DBUS_HANDLER_RESULT_HANDLED; } static DBusMessage* set_object_property (DBusConnection *connection, DBusMessage *message, DBusMessageIter *iter, GObject *object, GParamSpec *pspec) { GValue value = { 0, }; DBusMessage *ret; DBusMessageIter sub; DBusGValueMarshalCtx context; dbus_message_iter_recurse (iter, &sub); context.recursion_depth = 0; context.gconnection = DBUS_G_CONNECTION_FROM_CONNECTION (connection); context.proxy = NULL; g_value_init (&value, pspec->value_type); if (_dbus_gvalue_demarshal (&context, &sub, &value, NULL)) { g_object_set_property (object, pspec->name, &value); g_value_unset (&value); ret = reply_or_die (message); } else { ret = error_or_die (message, DBUS_ERROR_INVALID_ARGS, "Argument's D-BUS type can't be converted to a GType"); } return ret; } /* * @pspec: the paramspec for a D-Bus-exported property * * Returns: a reply for the Get() D-Bus method, either successful or error */ static DBusMessage* get_object_property (DBusConnection *connection, DBusMessage *message, GObject *object, GParamSpec *pspec) { GType value_gtype; GValue value = {0, }; gchar *variant_sig; DBusMessage *ret; DBusMessageIter iter, subiter; gchar *error_message = NULL; ret = reply_or_die (message); g_value_init (&value, pspec->value_type); g_object_get_property (object, pspec->name, &value); variant_sig = _dbus_gvalue_to_signature (&value); if (variant_sig == NULL) { value_gtype = G_VALUE_TYPE (&value); error_message = g_strdup_printf ( "Internal error: cannot marshal type \"%s\" in variant", g_type_name (value_gtype)); goto out; } dbus_message_iter_init_append (ret, &iter); if (!dbus_message_iter_open_container (&iter, DBUS_TYPE_VARIANT, variant_sig, &subiter)) { error_message = g_strdup_printf ( "Internal error: cannot open variant container for signature %s", variant_sig); goto out; } if (!_dbus_gvalue_marshal (&subiter, &value)) { dbus_message_iter_abandon_container (&iter, &subiter); error_message = g_strdup_printf ( "Internal error: could not marshal type \"%s\" in variant", G_VALUE_TYPE_NAME (&value)); goto out; } dbus_message_iter_close_container (&iter, &subiter); out: g_value_unset (&value); g_free (variant_sig); if (error_message != NULL) { dbus_message_unref (ret); ret = error_or_die (message, DBUS_ERROR_FAILED, error_message); g_critical ("%s", error_message); g_free (error_message); } return ret; } #define SHADOW_PROP_QUARK (dbus_g_object_type_dbus_shadow_property_quark ()) static GQuark dbus_g_object_type_dbus_shadow_property_quark (void) { static GQuark quark; if (!quark) quark = g_quark_from_static_string ("DBusGObjectTypeDBusShadowPropertyQuark"); return quark; } /* Look for shadow properties on the given interface first, otherwise * just return the original property name. This allows implementations to * get around the glib limitation of unique property names among all * GInterfaces by registering a "shadow" property name that the get/set * request will be redirected to. * * Shadow property data is stored as qdata on each GInterface. If there * is no interface info, or there is no registered shadow property, just * return the original property name. */ static char * lookup_property_name (GObject *object, const char *wincaps_propiface, const char *requested_propname) { const DBusGObjectInfo *object_info; GHashTable *shadow_props; char *shadow_prop_name = NULL, *uscore_name; GType iface_type = 0; g_assert (wincaps_propiface != NULL); g_assert (requested_propname != NULL); uscore_name = _dbus_gutils_wincaps_to_uscore (requested_propname); object_info = lookup_object_info_by_iface (object, wincaps_propiface, FALSE, &iface_type); if (!object_info) return uscore_name; shadow_props = (GHashTable *) g_type_get_qdata (iface_type, SHADOW_PROP_QUARK); if (shadow_props) { shadow_prop_name = g_strdup (g_hash_table_lookup (shadow_props, requested_propname)); if (shadow_prop_name) g_free (uscore_name); } return shadow_prop_name ? shadow_prop_name : uscore_name; } /** * dbus_g_object_type_register_shadow_property: * @iface_type: #GType for the #GInterface * @dbus_prop_name: D-Bus property name (as specified in the introspection data) * to override with the shadow property name (as specified in the GType's * initialization function, ie glib-style) * @shadow_prop_name: property name which should override the shadow property * * Registers a new property name @shadow_prop_name that overrides the * @dbus_prop_name in D-Bus property get/set requests. Since all properties for * all interfaces implemented by a GObject exist in the same namespace, this * allows implementations to use the same property name in two or more D-Bus * interfaces implemented by the same GObject, as long as one of those D-Bus * interface properties is registered with a shadow property name. * * For example, if both org.foobar.Baz.InterfaceA and org.foobar.Baz.InterfaceB * have a D-Bus property called "Bork", the developer assigns a shadow property * name to the conflicting property name in one or both of these GInterfaces to * resolve the conflict. Assume the GInterface implementing * org.foobar.Baz.InterfaceA registers a shadow property called "a-bork", while * the GInterface implementing org.foobar.Baz.InterfaceB registers a shadow * property called "b-bork". The GObject implementing both these GInterfaces * would then use #g_object_class_override_property() to implement both * "a-bork" and "b-bork" and D-Bus requests for "Bork" on either D-Bus interface * will not conflict. */ void dbus_g_object_type_register_shadow_property (GType iface_type, const char *dbus_prop_name, const char *shadow_prop_name) { GHashTable *shadow_props; g_return_if_fail (G_TYPE_IS_CLASSED (iface_type) || G_TYPE_IS_INTERFACE (iface_type)); g_return_if_fail (dbus_prop_name != NULL); g_return_if_fail (shadow_prop_name != NULL); shadow_props = (GHashTable *) g_type_get_qdata (iface_type, SHADOW_PROP_QUARK); if (!shadow_props) { shadow_props = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free); g_type_set_qdata (iface_type, dbus_g_object_type_dbus_shadow_property_quark (), shadow_props); } g_assert (shadow_props); g_hash_table_insert (shadow_props, g_strdup (dbus_prop_name), g_strdup (shadow_prop_name)); } static DBusMessage* get_all_object_properties (DBusConnection *connection, DBusMessage *message, const DBusGObjectInfo *object_info, const char *wincaps_propiface, GObject *object) { DBusMessage *ret; DBusMessageIter iter_ret; DBusMessageIter iter_dict; DBusMessageIter iter_dict_entry; DBusMessageIter iter_dict_value; const char *p; char *uscore_propname; ret = reply_or_die (message); dbus_message_iter_init_append (ret, &iter_ret); /* the types are all hard-coded, so this can only fail via OOM */ if (!dbus_message_iter_open_container (&iter_ret, DBUS_TYPE_ARRAY, DBUS_DICT_ENTRY_BEGIN_CHAR_AS_STRING DBUS_TYPE_STRING_AS_STRING DBUS_TYPE_VARIANT_AS_STRING DBUS_DICT_ENTRY_END_CHAR_AS_STRING, &iter_dict)) oom (NULL); p = object_info->exported_properties; while (p != NULL && *p != '\0') { const char *prop_ifname; const char *prop_name; const char *prop_uscored; const char *access_flags; GParamSpec *pspec; GType value_gtype; GValue value = {0, }; gchar *variant_sig; p = property_iterate (p, object_info->format_version, &prop_ifname, &prop_name, &prop_uscored, &access_flags); /* Conventionally, property names are valid member names, but dbus-glib * doesn't enforce this, and some dbus-glib services use GObject-style * property names (e.g. "foo-bar"). */ if (!g_utf8_validate (prop_name, -1, NULL)) { g_critical ("property name isn't UTF-8: %s", prop_name); continue; } uscore_propname = lookup_property_name (object, wincaps_propiface, prop_name); pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (object), uscore_propname); if (pspec == NULL) { g_warning ("introspection data references non-existing property %s", uscore_propname); g_free (uscore_propname); continue; } g_free (uscore_propname); g_value_init (&value, pspec->value_type); g_object_get_property (object, pspec->name, &value); variant_sig = _dbus_gvalue_to_signature (&value); if (variant_sig == NULL) { value_gtype = G_VALUE_TYPE (&value); g_warning ("Cannot marshal type \"%s\" in variant", g_type_name (value_gtype)); g_value_unset (&value); continue; } /* a signature returned by _dbus_gvalue_to_signature had better be * valid */ g_assert (g_variant_is_signature (variant_sig)); /* type is hard-coded, so this can't fail except by OOM */ if (!dbus_message_iter_open_container (&iter_dict, DBUS_TYPE_DICT_ENTRY, NULL, &iter_dict_entry)) oom (NULL); /* prop_name is valid UTF-8, so this can't fail except by OOM; no point * in abandoning @iter_dict_entry since we're about to crash out */ if (!dbus_message_iter_append_basic (&iter_dict_entry, DBUS_TYPE_STRING, &prop_name)) oom (NULL); /* variant_sig has been asserted to be valid, so this can't fail * except by OOM */ if (!dbus_message_iter_open_container (&iter_dict_entry, DBUS_TYPE_VARIANT, variant_sig, &iter_dict_value)) oom (NULL); g_free (variant_sig); /* this can fail via programming error: the GObject property was * malformed (non-UTF8 string or something) */ if (!_dbus_gvalue_marshal (&iter_dict_value, &value)) { gchar *contents = g_strdup_value_contents (&value); gchar *error_message = g_strdup_printf ( "cannot GetAll(%s): failed to serialize %s value of type %s: %s", wincaps_propiface, prop_name, G_VALUE_TYPE_NAME (&value), contents); g_critical ("%s", error_message); /* abandon ship! */ dbus_message_iter_abandon_container (&iter_dict_entry, &iter_dict_value); dbus_message_iter_abandon_container (&iter_dict, &iter_dict_entry); dbus_message_unref (ret); ret = error_or_die (message, DBUS_ERROR_FAILED, error_message); g_free (contents); g_free (error_message); g_value_unset (&value); return ret; } /* these shouldn't fail except by OOM now that we were successful */ if (!dbus_message_iter_close_container (&iter_dict_entry, &iter_dict_value)) oom (NULL); if (!dbus_message_iter_close_container (&iter_dict, &iter_dict_entry)) oom (NULL); g_value_unset (&value); } if (!dbus_message_iter_close_container (&iter_ret, &iter_dict)) oom (NULL); return ret; } static gboolean lookup_object_and_method (GObject *object, DBusMessage *message, const DBusGObjectInfo **object_ret, const DBusGMethodInfo **method_ret) { const char *interface; const char *member; const char *signature; GList *info_list; const GList *info_list_walk; const DBusGObjectInfo *info; int i; interface = dbus_message_get_interface (message); member = dbus_message_get_member (message); signature = dbus_message_get_signature (message); info_list = lookup_object_info (object); for (info_list_walk = info_list; info_list_walk != NULL; info_list_walk = g_list_next (info_list_walk)) { info = (DBusGObjectInfo *) info_list_walk->data; *object_ret = info; for (i = 0; i < info->n_method_infos; i++) { const char *expected_member; const char *expected_interface; char *expected_signature; const DBusGMethodInfo *method; method = &(info->method_infos[i]); /* Check method interface/name and input signature */ expected_interface = method_interface_from_object_info (*object_ret, method); expected_member = method_name_from_object_info (*object_ret, method); expected_signature = method_input_signature_from_object_info (*object_ret, method); if ((interface == NULL || strcmp (expected_interface, interface) == 0) && strcmp (expected_member, member) == 0 && strcmp (expected_signature, signature) == 0) { g_free (expected_signature); *method_ret = method; g_list_free (info_list); return TRUE; } g_free (expected_signature); } } if (info_list) g_list_free (info_list); return FALSE; } static char * gerror_domaincode_to_dbus_error_name (const DBusGObjectInfo *object_info, const char *msg_interface, GQuark domain, gint code) { const char *domain_str; const char *code_str; GString *dbus_error_name; domain_str = object_error_domain_prefix_from_object_info (object_info); code_str = object_error_code_from_object_info (object_info, domain, code); if (!domain_str || !code_str) { DBusGErrorInfo *info; g_static_rw_lock_reader_lock (&globals_lock); if (error_metadata != NULL) info = g_datalist_id_get_data (&error_metadata, domain); else info = NULL; g_static_rw_lock_reader_unlock (&globals_lock); if (info) { GEnumValue *value; GEnumClass *klass; klass = g_type_class_ref (info->code_enum); value = g_enum_get_value (klass, code); g_type_class_unref (klass); domain_str = info->default_iface; if (value) { code_str = value->value_nick; } else { g_warning ("Error code %d out of range for GError domain %s", code, g_quark_to_string (domain)); code_str = NULL; } } } if (!domain_str) domain_str = msg_interface; if (!domain_str || !code_str) { const char *domain_string; /* If we can't map it sensibly, make up an error name */ dbus_error_name = g_string_new ("org.freedesktop.DBus.GLib.UnmappedError."); domain_string = g_quark_to_string (domain); if (domain_string != NULL) { char *uscored = uscore_to_wincaps (domain_string); g_string_append (dbus_error_name, uscored); g_string_append_c (dbus_error_name, '.'); g_free (uscored); } /* Map -1 to (unsigned) -1 to avoid "-", which is not valid */ g_string_append_printf (dbus_error_name, "Code%u", (unsigned) code); } else { gchar *code_str_wincaps; dbus_error_name = g_string_new (domain_str); g_string_append_c (dbus_error_name, '.'); /* We can't uppercase here for backwards compatibility * reasons; if someone had a lowercase enumeration value, * previously we'd just send it across unaltered. */ code_str_wincaps = uscore_to_wincaps_full (code_str, FALSE, FALSE); g_string_append (dbus_error_name, code_str_wincaps); g_free (code_str_wincaps); } return g_string_free (dbus_error_name, FALSE); } static DBusMessage * gerror_to_dbus_error_message (const DBusGObjectInfo *object_info, DBusMessage *message, const GError *error) { DBusMessage *reply; if (!error) { char *error_msg; error_msg = g_strdup_printf ("Method invoked for %s returned FALSE but did not set error", dbus_message_get_member (message)); reply = error_or_die (message, "org.freedesktop.DBus.GLib.ErrorError", error_msg); g_free (error_msg); } else { if (error->domain == DBUS_GERROR) { const gchar *name = DBUS_ERROR_FAILED; switch (error->code) { case DBUS_GERROR_FAILED: name = DBUS_ERROR_FAILED; break; case DBUS_GERROR_NO_MEMORY: name = DBUS_ERROR_NO_MEMORY; break; case DBUS_GERROR_SERVICE_UNKNOWN: name = DBUS_ERROR_SERVICE_UNKNOWN; break; case DBUS_GERROR_NAME_HAS_NO_OWNER: name = DBUS_ERROR_NAME_HAS_NO_OWNER; break; case DBUS_GERROR_NO_REPLY: name = DBUS_ERROR_NO_REPLY; break; case DBUS_GERROR_IO_ERROR: name = DBUS_ERROR_IO_ERROR; break; case DBUS_GERROR_BAD_ADDRESS: name = DBUS_ERROR_BAD_ADDRESS; break; case DBUS_GERROR_NOT_SUPPORTED: name = DBUS_ERROR_NOT_SUPPORTED; break; case DBUS_GERROR_LIMITS_EXCEEDED: name = DBUS_ERROR_LIMITS_EXCEEDED; break; case DBUS_GERROR_ACCESS_DENIED: name = DBUS_ERROR_ACCESS_DENIED; break; case DBUS_GERROR_AUTH_FAILED: name = DBUS_ERROR_AUTH_FAILED; break; case DBUS_GERROR_NO_SERVER: name = DBUS_ERROR_NO_SERVER; break; case DBUS_GERROR_TIMEOUT: name = DBUS_ERROR_TIMEOUT; break; case DBUS_GERROR_NO_NETWORK: name = DBUS_ERROR_NO_NETWORK; break; case DBUS_GERROR_ADDRESS_IN_USE: name = DBUS_ERROR_ADDRESS_IN_USE; break; case DBUS_GERROR_DISCONNECTED: name = DBUS_ERROR_DISCONNECTED; break; case DBUS_GERROR_INVALID_ARGS: name = DBUS_ERROR_INVALID_ARGS; break; case DBUS_GERROR_FILE_NOT_FOUND: name = DBUS_ERROR_FILE_NOT_FOUND; break; case DBUS_GERROR_REMOTE_EXCEPTION: name = dbus_g_error_get_name ((GError*) error); break; } reply = error_or_die (message, name, error->message); } else { char *error_name; error_name = gerror_domaincode_to_dbus_error_name (object_info, dbus_message_get_interface (message), error->domain, error->code); reply = error_or_die (message, error_name, error->message); g_free (error_name); } } return reply; } /** * SECTION:dbus-gmethod * @short_description: GMethod Info & Invocation * @see_also: #DBusGMessage * @stability: Stable * * These types are used to call methods on #GObject objects. */ /** * DBusGMethodInvocation: * * The context of an asynchronous method call. See dbus_g_method_return() and * dbus_g_method_return_error(). */ struct _DBusGMethodInvocation { DBusGConnection *connection; /**< The connection */ DBusGMessage *message; /**< The message which generated the method call */ const DBusGObjectInfo *object; /**< The object the method was called on */ const DBusGMethodInfo *method; /**< The method called */ gboolean send_reply; }; static DBusHandlerResult invoke_object_method (GObject *object, const DBusGObjectInfo *object_info, const DBusGMethodInfo *method, DBusConnection *connection, DBusMessage *message) { gboolean had_error, is_async, send_reply; GError *gerror; GValueArray *value_array; GValue return_value = {0,}; GClosure closure; char *in_signature; GArray *out_param_values = NULL; GValueArray *out_param_gvalues = NULL; int out_param_count; int out_param_pos, out_param_gvalue_pos; DBusMessage *reply = NULL; gboolean have_retval; gboolean retval_signals_error; gboolean retval_is_synthetic; gboolean retval_is_constant; const char *arg_metadata; gerror = NULL; /* This flag says whether invokee is handed a special DBusGMethodInvocation structure, * instead of being required to fill out all return values in the context of the function. * Some additional data is also exposed, such as the message sender. */ is_async = strcmp (string_table_lookup (get_method_data (object_info, method), 2), "A") == 0; /* Messages can be sent with a flag that says "I don't need a reply". This is an optimization * normally, but in the context of the system bus it's important to not send a reply * to these kinds of messages, because they will be unrequested replies, and thus subject * to denial and logging. We don't want to fill up logs. * http://bugs.freedesktop.org/show_bug.cgi?id=19441 */ send_reply = !dbus_message_get_no_reply (message); have_retval = FALSE; retval_signals_error = FALSE; retval_is_synthetic = FALSE; retval_is_constant = FALSE; /* This is evil. We do this to work around the fact that * the generated glib marshallers check a flag in the closure object * which we don't care about. We don't need/want to create * a new closure for each invocation. */ memset (&closure, 0, sizeof (closure)); in_signature = method_input_signature_from_object_info (object_info, method); /* Convert method IN parameters to GValueArray */ { GArray *types_array; guint n_params; const GType *types; DBusGValueMarshalCtx context; GError *error = NULL; context.recursion_depth = 0; context.gconnection = DBUS_G_CONNECTION_FROM_CONNECTION (connection); context.proxy = NULL; types_array = _dbus_gtypes_from_arg_signature (in_signature, FALSE); n_params = types_array->len; types = (const GType*) types_array->data; value_array = _dbus_gvalue_demarshal_message (&context, message, n_params, types, &error); if (value_array == NULL) { g_free (in_signature); g_array_free (types_array, TRUE); reply = error_or_die (message, "org.freedesktop.DBus.GLib.ErrorError", error->message); connection_send_or_die (connection, reply); dbus_message_unref (reply); g_error_free (error); return DBUS_HANDLER_RESULT_HANDLED; } g_array_free (types_array, TRUE); } /* Prepend object as first argument */ g_value_array_prepend (value_array, NULL); g_value_init (g_value_array_get_nth (value_array, 0), G_TYPE_OBJECT); g_value_set_object (g_value_array_get_nth (value_array, 0), object); if (is_async) { GValue context_value = {0,}; DBusGMethodInvocation *context; context = g_new (DBusGMethodInvocation, 1); context->connection = dbus_g_connection_ref (DBUS_G_CONNECTION_FROM_CONNECTION (connection)); context->message = dbus_g_message_ref (DBUS_G_MESSAGE_FROM_MESSAGE (message)); context->object = object_info; context->method = method; context->send_reply = send_reply; g_value_init (&context_value, G_TYPE_POINTER); g_value_set_pointer (&context_value, context); g_value_array_append (value_array, &context_value); } else { RetvalType retval; gboolean arg_in; gboolean arg_const; const char *argsig; arg_metadata = method_arg_info_from_object_info (object_info, method); /* Count number of output parameters, and look for a return value */ out_param_count = 0; while (*arg_metadata) { arg_metadata = arg_iterate (arg_metadata, NULL, &arg_in, &arg_const, &retval, &argsig); if (arg_in) continue; if (retval != RETVAL_NONE) { DBusSignatureIter tmp_sigiter; /* This is the function return value */ g_assert (!have_retval); have_retval = TRUE; retval_is_synthetic = FALSE; switch (retval) { case RETVAL_NONE: g_assert_not_reached (); break; case RETVAL_NOERROR: retval_signals_error = FALSE; break; case RETVAL_ERROR: retval_signals_error = TRUE; break; } retval_is_constant = arg_const; /* Initialize our return GValue with the specified type */ dbus_signature_iter_init (&tmp_sigiter, argsig); g_value_init (&return_value, _dbus_gtype_from_signature_iter (&tmp_sigiter, FALSE)); } else { /* It's a regular output value */ out_param_count++; } } /* For compatibility, if we haven't found a return value, we assume * the function returns a gboolean for signalling an error * (and therefore also takes a GError). We also note that it * is a "synthetic" return value; i.e. we aren't going to be * sending it over the bus, it's just to signal an error. */ if (!have_retval) { have_retval = TRUE; retval_is_synthetic = TRUE; retval_signals_error = TRUE; g_value_init (&return_value, G_TYPE_BOOLEAN); } /* Create an array to store the actual values of OUT parameters * (other than the real function return, if any). Then, create * a GValue boxed POINTER to each of those values, and append to * the invocation, so the method can return the OUT parameters. */ out_param_values = g_array_sized_new (FALSE, TRUE, sizeof (GTypeCValue), out_param_count); /* We have a special array of GValues for toplevel GValue return * types. */ out_param_gvalues = g_value_array_new (out_param_count); out_param_pos = 0; out_param_gvalue_pos = 0; /* Reset argument metadata pointer */ arg_metadata = method_arg_info_from_object_info (object_info, method); /* Iterate over output arguments again, this time allocating space for * them as appopriate. */ while (*arg_metadata) { GValue value = {0, }; GTypeCValue storage; DBusSignatureIter tmp_sigiter; GType current_gtype; arg_metadata = arg_iterate (arg_metadata, NULL, &arg_in, NULL, &retval, &argsig); /* Skip over input arguments and the return value, if any */ if (arg_in || retval != RETVAL_NONE) continue; dbus_signature_iter_init (&tmp_sigiter, argsig); current_gtype = _dbus_gtype_from_signature_iter (&tmp_sigiter, FALSE); g_value_init (&value, G_TYPE_POINTER); /* We special case variants to make method invocation a bit nicer */ if (current_gtype != G_TYPE_VALUE) { memset (&storage, 0, sizeof (storage)); g_array_append_val (out_param_values, storage); g_value_set_pointer (&value, &(g_array_index (out_param_values, GTypeCValue, out_param_pos))); out_param_pos++; } else { g_value_array_append (out_param_gvalues, NULL); g_value_set_pointer (&value, out_param_gvalues->values + out_param_gvalue_pos); out_param_gvalue_pos++; } g_value_array_append (value_array, &value); } } /* Append GError as final argument if necessary */ if (retval_signals_error) { g_assert (have_retval); g_value_array_append (value_array, NULL); g_value_init (g_value_array_get_nth (value_array, value_array->n_values - 1), G_TYPE_POINTER); g_value_set_pointer (g_value_array_get_nth (value_array, value_array->n_values - 1), &gerror); } /* Actually invoke method */ method->marshaller (&closure, have_retval ? &return_value : NULL, value_array->n_values, value_array->values, NULL, method->function); if (is_async) { goto done; } if (retval_signals_error) had_error = _dbus_gvalue_signals_error (&return_value); else had_error = FALSE; if (!had_error) { DBusMessageIter iter; /* Careful here - there are two major cases in this section of the code. * If send_reply is TRUE, we're constructing a dbus message and freeing * the return values. If it's FALSE, then we just need to free the * values. */ if (send_reply) { reply = reply_or_die (message); /* Append output arguments to reply */ dbus_message_iter_init_append (reply, &iter); } /* First, append the return value, unless it's synthetic */ if (have_retval && !retval_is_synthetic) { if (reply != NULL && !_dbus_gvalue_marshal (&iter, &return_value)) { gchar *desc = g_strdup_value_contents (&return_value); g_critical ("unable to append retval of type %s for %s: %s", G_VALUE_TYPE_NAME (&return_value), method_name_from_object_info (object_info, method), desc); g_free (desc); /* the reply is now unusable but we still need to free * everything */ dbus_message_unref (reply); reply = NULL; } if (!retval_is_constant) g_value_unset (&return_value); } /* Grab the argument metadata and iterate over it */ arg_metadata = method_arg_info_from_object_info (object_info, method); /* Now append any remaining return values */ out_param_pos = 0; out_param_gvalue_pos = 0; while (*arg_metadata) { GValue gvalue = {0, }; const char *arg_name; gboolean arg_in; gboolean constval; RetvalType retval; const char *arg_signature; DBusSignatureIter argsigiter; do { /* Iterate over only output values; skip over input arguments and the return value */ arg_metadata = arg_iterate (arg_metadata, &arg_name, &arg_in, &constval, &retval, &arg_signature); } while ((arg_in || retval != RETVAL_NONE) && *arg_metadata); /* If the last argument we saw was input or the return * value, we must be done iterating over output arguments. */ if (arg_in || retval != RETVAL_NONE) break; dbus_signature_iter_init (&argsigiter, arg_signature); g_value_init (&gvalue, _dbus_gtype_from_signature_iter (&argsigiter, FALSE)); if (G_VALUE_TYPE (&gvalue) != G_TYPE_VALUE) { if (!_dbus_gvalue_take (&gvalue, &(g_array_index (out_param_values, GTypeCValue, out_param_pos)))) g_assert_not_reached (); out_param_pos++; } else { g_value_set_static_boxed (&gvalue, out_param_gvalues->values + out_param_gvalue_pos); out_param_gvalue_pos++; } if (reply && !_dbus_gvalue_marshal (&iter, &gvalue)) { gchar *desc = g_strdup_value_contents (&gvalue); g_critical ("unable to append OUT arg of type %s for %s: %s", G_VALUE_TYPE_NAME (&gvalue), method_name_from_object_info (object_info, method), desc); g_free (desc); /* the reply is now unusable but we still need to free * everything */ dbus_message_unref (reply); reply = NULL; } /* Here we actually free the allocated value; we * took ownership of it with _dbus_gvalue_take, unless * an annotation has specified this value as constant. */ if (!constval) g_value_unset (&gvalue); } } else if (send_reply) reply = gerror_to_dbus_error_message (object_info, message, gerror); if (reply) { connection_send_or_die (connection, reply); dbus_message_unref (reply); } done: g_free (in_signature); if (!is_async) { g_array_free (out_param_values, TRUE); g_value_array_free (out_param_gvalues); } if (gerror != NULL) g_clear_error (&gerror); g_value_array_free (value_array); return DBUS_HANDLER_RESULT_HANDLED; } /* * @wincaps_propiface: the D-Bus interface name, conventionally WindowsCaps * @requested_propname: the D-Bus property name, conventionally WindowsCaps * @uscore_propname: the GObject property name, conventionally * words_with_underscores or words-with-dashes * @is_set: %TRUE if we're going to set the property, %FALSE if we're going * to get it * * Check that the requested property exists and the requested access is * allowed. If not, reply with a D-Bus AccessDenied error message. * * Returns: %TRUE if property access can continue, or %FALSE if an error * reply has been sent */ static gboolean check_property_access (DBusConnection *connection, DBusMessage *message, GObject *object, const char *wincaps_propiface, const char *requested_propname, const char *uscore_propname, gboolean is_set) { const DBusGObjectInfo *object_info; const char *access_type; DBusMessage *ret; gchar *error_message; if (!is_set && !disable_legacy_property_access) return TRUE; object_info = lookup_object_info_by_iface (object, wincaps_propiface, TRUE, NULL); if (!object_info) { error_message = g_strdup_printf ( "Interface \"%s\" isn't exported (or may not exist), can't access property \"%s\"", wincaps_propiface, requested_propname); goto error; } /* Try both forms of property names: "foo_bar" or "FooBar"; for historical * reasons we accept both. */ if (object_info && !(property_info_from_object_info (object_info, wincaps_propiface, requested_propname, &access_type) || property_info_from_object_info (object_info, wincaps_propiface, uscore_propname, &access_type))) { error_message = g_strdup_printf ( "Property \"%s\" of interface \"%s\" isn't exported (or may not exist)", requested_propname, wincaps_propiface); goto error; } if (strcmp (access_type, "readwrite") == 0) return TRUE; if (is_set ? strcmp (access_type, "read") == 0 : strcmp (access_type, "write") == 0) { error_message = g_strdup_printf ( "Property \"%s\" of interface \"%s\" is not %s", requested_propname, wincaps_propiface, is_set ? "settable" : "readable"); goto error; } return TRUE; error: ret = error_or_die (message, DBUS_ERROR_ACCESS_DENIED, error_message); g_free (error_message); connection_send_or_die (connection, ret); dbus_message_unref (ret); return FALSE; } static DBusHandlerResult object_registration_message (DBusConnection *connection, DBusMessage *message, void *user_data) { GParamSpec *pspec; GObject *object; gboolean setter; gboolean getter; gboolean getall; char *s; const char *requested_propname; const char *wincaps_propiface; DBusMessageIter iter; const DBusGMethodInfo *method; const DBusGObjectInfo *object_info; DBusMessage *ret; ObjectRegistration *o; o = user_data; /* export is always non-NULL. If the object has been disposed, the weak-ref * callback removes all registrations from the DBusConnection, so this * should never be reached with object = NULL. */ object = G_OBJECT (o->export->object); g_assert (object != NULL); if (dbus_message_is_method_call (message, DBUS_INTERFACE_INTROSPECTABLE, "Introspect")) return handle_introspect (connection, message, object); /* Try the metainfo, which lets us invoke methods */ object_info = NULL; if (lookup_object_and_method (object, message, &object_info, &method)) return invoke_object_method (object, object_info, method, connection, message); /* If no metainfo, we can still do properties and signals * via standard GLib introspection. Note we do now check * property access against the metainfo if available. */ getter = FALSE; setter = FALSE; getall = FALSE; if (dbus_message_is_method_call (message, DBUS_INTERFACE_PROPERTIES, "Get")) getter = TRUE; else if (dbus_message_is_method_call (message, DBUS_INTERFACE_PROPERTIES, "Set")) setter = TRUE; else if (dbus_message_is_method_call (message, DBUS_INTERFACE_PROPERTIES, "GetAll")) getall = TRUE; if (!(setter || getter || getall)) return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; ret = NULL; dbus_message_iter_init (message, &iter); if (dbus_message_iter_get_arg_type (&iter) != DBUS_TYPE_STRING) { ret = error_or_die (message, DBUS_ERROR_INVALID_ARGS, "First argument to Get(), GetAll() or Set() must be an interface string"); goto out; } dbus_message_iter_get_basic (&iter, &wincaps_propiface); dbus_message_iter_next (&iter); if (getall) { object_info = lookup_object_info_by_iface (object, wincaps_propiface, TRUE, NULL); if (object_info != NULL) ret = get_all_object_properties (connection, message, object_info, wincaps_propiface, object); else return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; } else { g_assert (getter || setter); if (dbus_message_iter_get_arg_type (&iter) != DBUS_TYPE_STRING) { ret = error_or_die (message, DBUS_ERROR_INVALID_ARGS, "Second argument to Get() or Set() must be a property name string"); goto out; } dbus_message_iter_get_basic (&iter, &requested_propname); dbus_message_iter_next (&iter); s = lookup_property_name (object, wincaps_propiface, requested_propname); if (!check_property_access (connection, message, object, wincaps_propiface, requested_propname, s, setter)) { g_free (s); return DBUS_HANDLER_RESULT_HANDLED; } pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (object), s); g_free (s); if (pspec != NULL) { if (setter) { if (dbus_message_iter_get_arg_type (&iter) != DBUS_TYPE_VARIANT) { ret = error_or_die (message, DBUS_ERROR_INVALID_ARGS, "Third argument to Set() must be a variant"); goto out; } ret = set_object_property (connection, message, &iter, object, pspec); dbus_message_iter_next (&iter); } else { g_assert (getter); ret = get_object_property (connection, message, object, pspec); } } else { gchar *error_message = g_strdup_printf ("No such property %s", requested_propname); ret = error_or_die (message, DBUS_ERROR_INVALID_ARGS, error_message); g_free (error_message); } } g_assert (ret != NULL); /* FIXME: this should be returned as a D-Bus error, not spammed out * as a warning. This is too late to do that, though - we've already * had any side-effects we were going to have - and it would break * anything that's relying on ability to give us too many arguments. */ if (dbus_message_iter_get_arg_type (&iter) != DBUS_TYPE_INVALID) g_warning ("Property get, set or set all had too many arguments\n"); out: connection_send_or_die (connection, ret); dbus_message_unref (ret); return DBUS_HANDLER_RESULT_HANDLED; } static const DBusObjectPathVTable gobject_dbus_vtable = { object_registration_unregistered, object_registration_message, NULL }; typedef struct { GClosure closure; DBusGConnection *connection; GObject *object; const char *signame; const char *sigiface; } DBusGSignalClosure; static GClosure * dbus_g_signal_closure_new (GObject *object, const char *signame, const char *sigiface) { DBusGSignalClosure *closure; closure = (DBusGSignalClosure*) g_closure_new_simple (sizeof (DBusGSignalClosure), NULL); closure->object = object; closure->signame = signame; closure->sigiface = sigiface; return (GClosure*) closure; } static void emit_signal_for_registration (ObjectRegistration *o, DBusGSignalClosure *sigclosure, GValue *retval, guint n_param_values, const GValue *param_values) { DBusMessage *signal; DBusMessageIter iter; guint i; g_assert (g_variant_is_object_path (o->object_path)); g_assert (g_dbus_is_interface_name (sigclosure->sigiface)); g_assert (g_dbus_is_member_name (sigclosure->signame)); signal = dbus_message_new_signal (o->object_path, sigclosure->sigiface, sigclosure->signame); if (!signal) oom (NULL); dbus_message_iter_init_append (signal, &iter); /* First argument is the object itself, and we can't marshall that */ for (i = 1; i < n_param_values; i++) { if (!_dbus_gvalue_marshal (&iter, (GValue *) (&(param_values[i])))) { g_warning ("failed to marshal parameter %d for signal %s", i, sigclosure->signame); goto out; } } connection_send_or_die (DBUS_CONNECTION_FROM_G_CONNECTION (o->connection), signal); out: dbus_message_unref (signal); } static void signal_emitter_marshaller (GClosure *closure, GValue *retval, guint n_param_values, const GValue *param_values, gpointer invocation_hint, gpointer marshal_data) { DBusGSignalClosure *sigclosure; const ObjectExport *oe; const GSList *iter; sigclosure = (DBusGSignalClosure *) closure; g_assert (retval == NULL); oe = g_object_get_data (sigclosure->object, "dbus_glib_object_registrations"); /* If the object has ever been exported, this should exist; it persists until * the object is actually freed. */ g_assert (oe != NULL); for (iter = oe->registrations; iter; iter = iter->next) { ObjectRegistration *o = iter->data; emit_signal_for_registration (o, sigclosure, retval, n_param_values, param_values); } } static void export_signals (const GList *info_list, GObject *object) { GType gtype; const char *sigdata; const char *iface; const char *signame; const DBusGObjectInfo *info; gtype = G_TYPE_FROM_INSTANCE (object); for (; info_list != NULL; info_list = g_list_next (info_list)) { info = (DBusGObjectInfo *) info_list->data; sigdata = info->exported_signals; while (*sigdata != '\0') { guint id; GSignalQuery query; GClosure *closure; char *s; sigdata = signal_iterate (sigdata, &iface, &signame); if (!g_dbus_is_interface_name (iface)) { g_critical ("invalid interface name found in %s: %s", g_type_name (gtype), iface); continue; } if (!g_dbus_is_member_name (signame)) { g_critical ("invalid signal name found in %s: %s", g_type_name (gtype), signame); continue; } s = _dbus_gutils_wincaps_to_uscore (signame); id = g_signal_lookup (s, gtype); if (id == 0) { g_warning ("signal \"%s\" (from \"%s\") exported but not found in object class \"%s\"", s, signame, g_type_name (gtype)); g_free (s); continue; } g_signal_query (id, &query); if (query.return_type != G_TYPE_NONE) { g_warning ("Not exporting signal \"%s\" for object class \"%s\" as it has a return type \"%s\"", s, g_type_name (gtype), g_type_name (query.return_type)); g_free (s); continue; /* FIXME: these could be listed as methods ? */ } closure = dbus_g_signal_closure_new (object, signame, (char*) iface); g_closure_set_marshal (closure, signal_emitter_marshaller); g_signal_connect_closure_by_id (object, id, 0, closure, FALSE); g_free (s); } } } static gint dbus_error_to_gerror_code (const char *derr) { if (0) ; else if (!strcmp (derr, DBUS_ERROR_FAILED )) return DBUS_GERROR_FAILED ; else if (!strcmp (derr, DBUS_ERROR_NO_MEMORY )) return DBUS_GERROR_NO_MEMORY ; else if (!strcmp (derr, DBUS_ERROR_SERVICE_UNKNOWN )) return DBUS_GERROR_SERVICE_UNKNOWN ; else if (!strcmp (derr, DBUS_ERROR_NAME_HAS_NO_OWNER )) return DBUS_GERROR_NAME_HAS_NO_OWNER ; else if (!strcmp (derr, DBUS_ERROR_NO_REPLY )) return DBUS_GERROR_NO_REPLY ; else if (!strcmp (derr, DBUS_ERROR_IO_ERROR )) return DBUS_GERROR_IO_ERROR ; else if (!strcmp (derr, DBUS_ERROR_BAD_ADDRESS )) return DBUS_GERROR_BAD_ADDRESS ; else if (!strcmp (derr, DBUS_ERROR_NOT_SUPPORTED )) return DBUS_GERROR_NOT_SUPPORTED ; else if (!strcmp (derr, DBUS_ERROR_LIMITS_EXCEEDED )) return DBUS_GERROR_LIMITS_EXCEEDED ; else if (!strcmp (derr, DBUS_ERROR_ACCESS_DENIED )) return DBUS_GERROR_ACCESS_DENIED ; else if (!strcmp (derr, DBUS_ERROR_AUTH_FAILED )) return DBUS_GERROR_AUTH_FAILED ; else if (!strcmp (derr, DBUS_ERROR_NO_SERVER )) return DBUS_GERROR_NO_SERVER ; else if (!strcmp (derr, DBUS_ERROR_TIMEOUT )) return DBUS_GERROR_TIMEOUT ; else if (!strcmp (derr, DBUS_ERROR_NO_NETWORK )) return DBUS_GERROR_NO_NETWORK ; else if (!strcmp (derr, DBUS_ERROR_ADDRESS_IN_USE )) return DBUS_GERROR_ADDRESS_IN_USE ; else if (!strcmp (derr, DBUS_ERROR_DISCONNECTED )) return DBUS_GERROR_DISCONNECTED ; else if (!strcmp (derr, DBUS_ERROR_INVALID_ARGS )) return DBUS_GERROR_INVALID_ARGS ; else if (!strcmp (derr, DBUS_ERROR_FILE_NOT_FOUND )) return DBUS_GERROR_FILE_NOT_FOUND ; else if (!strcmp (derr, DBUS_ERROR_FILE_EXISTS )) return DBUS_GERROR_FILE_EXISTS ; else if (!strcmp (derr, DBUS_ERROR_UNKNOWN_METHOD )) return DBUS_GERROR_UNKNOWN_METHOD ; else if (!strcmp (derr, DBUS_ERROR_TIMED_OUT )) return DBUS_GERROR_TIMED_OUT ; else if (!strcmp (derr, DBUS_ERROR_MATCH_RULE_NOT_FOUND )) return DBUS_GERROR_MATCH_RULE_NOT_FOUND ; else if (!strcmp (derr, DBUS_ERROR_MATCH_RULE_INVALID )) return DBUS_GERROR_MATCH_RULE_INVALID ; else if (!strcmp (derr, DBUS_ERROR_SPAWN_EXEC_FAILED )) return DBUS_GERROR_SPAWN_EXEC_FAILED ; else if (!strcmp (derr, DBUS_ERROR_SPAWN_FORK_FAILED )) return DBUS_GERROR_SPAWN_FORK_FAILED ; else if (!strcmp (derr, DBUS_ERROR_SPAWN_CHILD_EXITED )) return DBUS_GERROR_SPAWN_CHILD_EXITED ; else if (!strcmp (derr, DBUS_ERROR_SPAWN_CHILD_SIGNALED )) return DBUS_GERROR_SPAWN_CHILD_SIGNALED ; else if (!strcmp (derr, DBUS_ERROR_SPAWN_FAILED )) return DBUS_GERROR_SPAWN_FAILED ; else if (!strcmp (derr, DBUS_ERROR_UNIX_PROCESS_ID_UNKNOWN )) return DBUS_GERROR_UNIX_PROCESS_ID_UNKNOWN ; else if (!strcmp (derr, DBUS_ERROR_INVALID_SIGNATURE )) return DBUS_GERROR_INVALID_SIGNATURE ; else if (!strcmp (derr, DBUS_ERROR_INVALID_FILE_CONTENT )) return DBUS_GERROR_INVALID_FILE_CONTENT ; else if (!strcmp (derr, DBUS_ERROR_SELINUX_SECURITY_CONTEXT_UNKNOWN )) return DBUS_GERROR_SELINUX_SECURITY_CONTEXT_UNKNOWN ; else return DBUS_GERROR_REMOTE_EXCEPTION; } /** * dbus_set_g_error: * @gerror: an error * @derror: a #DBusError * * Store the information from a DBus method error return into a * GError. For the normal case of an arbitrary remote process, * the error code will be DBUS_GERROR_REMOTE_EXCEPTION. Now, * DBus errors have two components; a message and a "name". * The former is an arbitrary (normally American English) string. * The second is a string like com.example.FooFailure which * programs can use as a conditional source. Because a GError * only has one string, we use a hack to encode both values: * * <human readable string><null><error name><null> * * You can use the following code to retrieve both values: * * |[const char *msg = error->message; * size_t len = strlen(msg); * const char *error_name = msg+len+1;]| */ void dbus_set_g_error (GError **gerror, DBusError *derror) { int code; g_return_if_fail (derror != NULL); g_return_if_fail (dbus_error_is_set (derror)); g_return_if_fail (gerror == NULL || *gerror == NULL); code = dbus_error_to_gerror_code (derror->name); if (code != DBUS_GERROR_REMOTE_EXCEPTION) g_set_error (gerror, DBUS_GERROR, code, "%s", derror->message); else g_set_error (gerror, DBUS_GERROR, code, "%s%c%s", derror->message ? derror->message : "", '\0', derror->name); } static void dbus_g_error_info_free (gpointer p) { DBusGErrorInfo *info; info = p; g_free (info->default_iface); g_free (info); } /** * SECTION:dbus-gobject * @short_description: Exporting a #GObject remotely * @see_also: #GObject * @stability: Stable * * FIXME */ /** * dbus_glib_global_set_disable_legacy_property_access: * * For historical reasons, DBus-GLib will allow read-only * access to every GObject property of an object exported * to the bus, regardless of whether or not the property * is listed in the type info installed with * dbus_g_object_type_install_info(). (Write access is * denied however). * * If you wish to restrict even read-only access, you * can call this method to globally change the behavior * for the entire process. * * Since: 0.88 */ void dbus_glib_global_set_disable_legacy_property_access (void) { disable_legacy_property_access = TRUE; } /** * dbus_g_object_type_install_info: * @object_type: #GType for the object * @info: introspection data generated by #dbus-glib-tool * * Install introspection information about the given object #GType * sufficient to allow methods on the object to be invoked by name. * The introspection information is normally generated by * dbus-glib-tool, then this function is called in the * class_init() for the object class. * * Once introspection information has been installed, instances of the * object registered with dbus_g_connection_register_g_object() can have * their methods invoked remotely. */ void dbus_g_object_type_install_info (GType object_type, const DBusGObjectInfo *info) { g_return_if_fail (G_TYPE_IS_CLASSED (object_type) || G_TYPE_IS_INTERFACE (object_type)); _dbus_g_value_types_init (); g_type_set_qdata (object_type, dbus_g_object_type_dbus_metadata_quark (), (gpointer) info); } /** * dbus_g_error_domain_register: * @domain: the #GError domain * @default_iface: the prefix used for error values, or %NULL * @code_enum: a #GType for a #GEnum of the error codes * * Register a #GError domain and set of codes with D-Bus. When an object * raises a #GError in the domain @domain from one of its D-Bus methods, * the D-Bus error name used will be @default_iface, followed by a dot, * followed by the #GEnumValue.value_nick corresponding to the #GError.code. * For D-Bus, it's conventional to use an error name (value_nick) that is * in CamelCase. * * (For instance, if a D-Bus method com.example.MyObject.GetThings * can raise a #GError with domain MY_ERROR and code * MY_ERROR_NOT_HAPPY, you could call * dbus_g_error_domain_register (MY_ERROR, "com.example.MyError", * MY_TYPE_ERROR), and set up the value_nick for * MY_ERROR_NOT_HAPPY to be NotHappy, * resulting in the D-Bus error string * com.example.MyError.NotHappy.) * * If @default_iface is %NULL, the D-Bus interface of the method that failed * will be used. * * (For instance, if the above example had called * dbus_g_error_domain_register (MY_ERROR, NULL, MY_TYPE_ERROR) * instead, then the D-Bus error string would be * com.example.MyObject.NotHappy.) */ void dbus_g_error_domain_register (GQuark domain, const char *default_iface, GType code_enum) { DBusGErrorInfo *info; g_return_if_fail (g_quark_to_string (domain) != NULL); g_return_if_fail (code_enum != G_TYPE_INVALID); g_return_if_fail (G_TYPE_FUNDAMENTAL (code_enum) == G_TYPE_ENUM); g_static_rw_lock_writer_lock (&globals_lock); if (error_metadata == NULL) g_datalist_init (&error_metadata); info = g_datalist_id_get_data (&error_metadata, domain); if (info != NULL) { g_warning ("Metadata for error domain \"%s\" already registered\n", g_quark_to_string (domain)); } else { info = g_new0 (DBusGErrorInfo, 1); info->default_iface = g_strdup (default_iface); info->code_enum = code_enum; g_datalist_id_set_data_full (&error_metadata, domain, info, dbus_g_error_info_free); } g_static_rw_lock_writer_unlock (&globals_lock); } /* Called when the object is destroyed */ static void object_export_object_died (gpointer user_data, GObject *dead) { ObjectExport *oe = user_data; g_assert (dead == oe->object); /* this prevents the weak unref from taking place, which would cause an * assertion failure since the object has already gone... */ oe->object = NULL; /* ... while this results in a call to object_registration_unregistered * for each contained registration */ object_export_unregister_all (oe); /* We deliberately don't remove the ObjectExport yet, in case the object is * resurrected and re-registered: if that happens, we wouldn't want to call * export_signals() again. */ } /** * dbus_g_connection_unregister_g_object: * @connection: the D-BUS connection * @object: the object * * Removes @object from any object paths at which it is exported on * @connection. Properties, methods, and signals * of the object can no longer be accessed remotely. */ void dbus_g_connection_unregister_g_object (DBusGConnection *connection, GObject *object) { ObjectExport *oe; GSList *registrations; g_return_if_fail (connection != NULL); g_return_if_fail (G_IS_OBJECT (object)); oe = g_object_get_data (object, "dbus_glib_object_registrations"); g_return_if_fail (oe != NULL); g_return_if_fail (oe->registrations != NULL); /* Copy the list before iterating it: it will be modified in * object_registration_free() each time an object path is unregistered. */ for (registrations = g_slist_copy (oe->registrations); registrations != NULL; registrations = g_slist_delete_link (registrations, registrations)) { ObjectRegistration *o = registrations->data; if (o->connection != connection) continue; dbus_connection_unregister_object_path (DBUS_CONNECTION_FROM_G_CONNECTION (o->connection), o->object_path); } } /** * dbus_g_connection_register_g_object: * @connection: the D-BUS connection * @at_path: the path where the object will live (the object's name) * @object: the object * * Registers a #GObject at the given path. Properties, methods, and signals * of the object can then be accessed remotely. Methods are only available * if method introspection data has been added to the object's class * with dbus_g_object_type_install_info(). * * The registration will be cancelled if either the #DBusConnection or * the #GObject gets finalized, or if dbus_g_connection_unregister_g_object() * is used. * * Note: If an object is registered multiple times, the first registration * takes priority for cases such as turning an object into an object path. */ void dbus_g_connection_register_g_object (DBusGConnection *connection, const char *at_path, GObject *object) { ObjectExport *oe; GSList *iter; ObjectRegistration *o; DBusError error; g_return_if_fail (connection != NULL); g_return_if_fail (g_variant_is_object_path (at_path)); g_return_if_fail (G_IS_OBJECT (object)); oe = g_object_get_data (object, "dbus_glib_object_registrations"); if (oe == NULL) { GList *info_list = lookup_object_info (object); if (info_list == NULL) { g_warning ("No introspection data registered for object class \"%s\"", g_type_name (G_TYPE_FROM_INSTANCE (object))); return; } /* This adds a hook into every signal for the object. Only do this * on the first registration, because inside the signal marshaller * we emit a signal for each registration. */ export_signals (info_list, object); g_list_free (info_list); oe = object_export_new (); g_object_set_data_full (object, "dbus_glib_object_registrations", oe, (GDestroyNotify) object_export_free); } if (oe->object == NULL) { /* Either the ObjectExport is newly-created, or it already existed but * the object was disposed and resurrected, causing the weak ref to * fall off */ oe->object = object; g_object_weak_ref (object, object_export_object_died, oe); } for (iter = oe->registrations; iter; iter = iter->next) { o = iter->data; /* Silently ignore duplicate registrations */ if (strcmp (o->object_path, at_path) == 0 && o->connection == connection) return; } o = object_registration_new (connection, at_path, oe); dbus_error_init (&error); if (!dbus_connection_try_register_object_path (DBUS_CONNECTION_FROM_G_CONNECTION (connection), at_path, &gobject_dbus_vtable, o, &error)) { g_error ("Failed to register GObject with DBusConnection: %s %s", error.name, error.message); dbus_error_free (&error); object_registration_free (o); return; } oe->registrations = g_slist_append (oe->registrations, o); } /** * dbus_g_connection_lookup_g_object: * @connection: a #DBusGConnection * @at_path: path * * FIXME * * Returns: the object at path @at_path */ GObject * dbus_g_connection_lookup_g_object (DBusGConnection *connection, const char *at_path) { gpointer p; ObjectRegistration *o; g_return_val_if_fail (connection != NULL, NULL); g_return_val_if_fail (g_variant_is_object_path (at_path), NULL); if (!dbus_connection_get_object_path_data (DBUS_CONNECTION_FROM_G_CONNECTION (connection), at_path, &p)) return NULL; if (p == NULL) return NULL; o = p; if (o->export->object == NULL) return NULL; return G_OBJECT (o->export->object); } typedef struct { GType rettype; guint n_params; GType *params; } DBusGFuncSignature; static guint funcsig_hash (gconstpointer key) { const DBusGFuncSignature *sig = key; GType *types; guint ret; guint i; ret = sig->rettype; types = sig->params; for (i = 0; i < sig->n_params; i++) { ret += (int) (*types); types++; } return ret; } static gboolean funcsig_equal (gconstpointer aval, gconstpointer bval) { const DBusGFuncSignature *a = aval; const DBusGFuncSignature *b = bval; const GType *atypes; const GType *btypes; guint i; if (a->rettype != b->rettype || a->n_params != b->n_params) return FALSE; atypes = a->params; btypes = b->params; for (i = 0; i < a->n_params; i++) { if (*btypes != *atypes) return FALSE; atypes++; btypes++; } return TRUE; } static void funcsig_free (DBusGFuncSignature *sig) { g_free (sig->params); g_free (sig); } GClosureMarshal _dbus_gobject_lookup_marshaller (GType rettype, guint n_params, const GType *param_types) { GClosureMarshal ret; DBusGFuncSignature sig; GType *params; guint i; /* Convert to fundamental types */ rettype = G_TYPE_FUNDAMENTAL (rettype); params = g_new (GType, n_params); for (i = 0; i < n_params; i++) params[i] = G_TYPE_FUNDAMENTAL (param_types[i]); sig.rettype = rettype; sig.n_params = n_params; sig.params = params; g_static_rw_lock_reader_lock (&globals_lock); if (marshal_table) ret = g_hash_table_lookup (marshal_table, &sig); else ret = NULL; g_static_rw_lock_reader_unlock (&globals_lock); if (ret == NULL) { if (rettype == G_TYPE_NONE) { if (n_params == 0) ret = g_cclosure_marshal_VOID__VOID; else if (n_params == 1) { switch (params[0]) { case G_TYPE_BOOLEAN: ret = g_cclosure_marshal_VOID__BOOLEAN; break; case G_TYPE_UCHAR: ret = g_cclosure_marshal_VOID__UCHAR; break; case G_TYPE_INT: ret = g_cclosure_marshal_VOID__INT; break; case G_TYPE_UINT: ret = g_cclosure_marshal_VOID__UINT; break; case G_TYPE_DOUBLE: ret = g_cclosure_marshal_VOID__DOUBLE; break; case G_TYPE_STRING: ret = g_cclosure_marshal_VOID__STRING; break; case G_TYPE_BOXED: ret = g_cclosure_marshal_VOID__BOXED; break; } } else if (n_params == 3 && params[0] == G_TYPE_STRING && params[1] == G_TYPE_STRING && params[2] == G_TYPE_STRING) { ret = _dbus_g_marshal_NONE__STRING_STRING_STRING; } } } g_free (params); return ret; } /** * dbus_g_object_register_marshaller: * @marshaller: a GClosureMarshal to be used for invocation * @rettype: a GType for the return type of the function * @...: The parameter #GTypes, followed by %G_TYPE_INVALID * * Register a #GClosureMarshal to be used for signal invocations, * giving its return type and a list of parameter types, * followed by %G_TYPE_INVALID. * * This function will not be needed once GLib includes libffi. */ void dbus_g_object_register_marshaller (GClosureMarshal marshaller, GType rettype, ...) { va_list args; GArray *types; GType gtype; va_start (args, rettype); types = g_array_new (TRUE, TRUE, sizeof (GType)); while ((gtype = va_arg (args, GType)) != G_TYPE_INVALID) g_array_append_val (types, gtype); dbus_g_object_register_marshaller_array (marshaller, rettype, types->len, (GType*) types->data); g_array_free (types, TRUE); va_end (args); } /** * dbus_g_object_register_marshaller_array: * @marshaller: a #GClosureMarshal to be used for invocation * @rettype: a #GType for the return type of the function * @n_types: number of function parameters * @types: a C array of GTypes values * * Register a #GClosureMarshal to be used for signal invocations. * @see_also dbus_g_object_register_marshaller() */ void dbus_g_object_register_marshaller_array (GClosureMarshal marshaller, GType rettype, guint n_types, const GType* types) { DBusGFuncSignature *sig; guint i; g_static_rw_lock_writer_lock (&globals_lock); if (marshal_table == NULL) marshal_table = g_hash_table_new_full (funcsig_hash, funcsig_equal, (GDestroyNotify) funcsig_free, NULL); sig = g_new0 (DBusGFuncSignature, 1); sig->rettype = G_TYPE_FUNDAMENTAL (rettype); sig->n_params = n_types; sig->params = g_new (GType, n_types); for (i = 0; i < n_types; i++) sig->params[i] = G_TYPE_FUNDAMENTAL (types[i]); g_hash_table_insert (marshal_table, sig, marshaller); g_static_rw_lock_writer_unlock (&globals_lock); } /** * dbus_g_method_get_sender: * @context: the method context * * Get the sender of a message so we can send a * "reply" later (i.e. send a message directly * to a service which invoked the method at a * later time). * * Returns: the unique name of the sender. It * is up to the caller to free the returned string. */ gchar * dbus_g_method_get_sender (DBusGMethodInvocation *context) { const gchar *sender; g_return_val_if_fail (context != NULL, NULL); sender = dbus_message_get_sender (dbus_g_message_get_message (context->message)); return g_strdup (sender); } /** * dbus_g_method_get_reply: * @context: the method context * * Get the reply message to append reply values * Used as a sidedoor when you can't generate dbus values * of the correct type due to glib binding limitations * * Returns: a #DBusMessage with the reply */ DBusMessage * dbus_g_method_get_reply (DBusGMethodInvocation *context) { g_return_val_if_fail (context != NULL, NULL); return reply_or_die (dbus_g_message_get_message (context->message)); } /** * dbus_g_method_send_reply: * @context: the method context * @reply: the reply message, will be unreffed * * Send a manually created reply message. * * Used as a sidedoor when you can't generate dbus values * of the correct type due to glib binding limitations */ void dbus_g_method_send_reply (DBusGMethodInvocation *context, DBusMessage *reply) { g_return_if_fail (context != NULL); g_return_if_fail (reply != NULL); connection_send_or_die (dbus_g_connection_get_connection (context->connection), reply); dbus_message_unref (reply); dbus_g_connection_unref (context->connection); dbus_g_message_unref (context->message); g_free (context); } /** * dbus_g_method_return: * @context: the method context * @...: zero or more values to return from the method, with their number * and types given by its #DBusGObjectInfo * * Send a return message for a given method invocation, with arguments. * This function also frees the sending context. */ void dbus_g_method_return (DBusGMethodInvocation *context, ...) { DBusMessage *reply; DBusMessageIter iter; va_list args; char *out_sig; GArray *argsig; guint i; g_return_if_fail (context != NULL); /* This field was initialized inside invoke_object_method; we * carry it over through the async invocation to here. */ if (!context->send_reply) goto out; reply = dbus_g_method_get_reply (context); out_sig = method_output_signature_from_object_info (context->object, context->method); argsig = _dbus_gtypes_from_arg_signature (out_sig, FALSE); dbus_message_iter_init_append (reply, &iter); va_start (args, context); for (i = 0; i < argsig->len; i++) { GValue value = {0,}; char *error; g_value_init (&value, g_array_index (argsig, GType, i)); error = NULL; G_VALUE_COLLECT (&value, args, G_VALUE_NOCOPY_CONTENTS, &error); if (error) { g_warning("%s", error); g_free (error); } else { if (!_dbus_gvalue_marshal (&iter, &value)) g_warning ("failed to marshal parameter %d for method %s", i, dbus_message_get_member ( dbus_g_message_get_message (context->message))); } } va_end (args); connection_send_or_die (dbus_g_connection_get_connection (context->connection), reply); dbus_message_unref (reply); g_free (out_sig); g_array_free (argsig, TRUE); out: dbus_g_connection_unref (context->connection); dbus_g_message_unref (context->message); g_free (context); } /** * dbus_g_method_return_error: * @context: the method context * @error: the error to send * * Send a error message for a given method invocation. * This function also frees the sending context. */ void dbus_g_method_return_error (DBusGMethodInvocation *context, const GError *error) { DBusMessage *reply; g_return_if_fail (context != NULL); g_return_if_fail (error != NULL); /* See comment in dbus_g_method_return */ if (!context->send_reply) goto out; reply = gerror_to_dbus_error_message (context->object, dbus_g_message_get_message (context->message), error); connection_send_or_die ( dbus_g_connection_get_connection (context->connection), reply); dbus_message_unref (reply); out: dbus_g_connection_unref (context->connection); dbus_g_message_unref (context->message); g_free (context); } const char * _dbus_gobject_get_path (GObject *obj) { ObjectExport *oe; ObjectRegistration *o; oe = g_object_get_data (obj, "dbus_glib_object_registrations"); if (oe == NULL || oe->registrations == NULL) return NULL; /* First one to have been registered wins */ o = oe->registrations->data; return o->object_path; } #ifdef DBUS_BUILD_TESTS #include static void _dummy_function (void) { } /* Data structures copied from one generated by current dbus-binding-tool; * we need to support this layout forever */ static const DBusGMethodInfo dbus_glib_internal_test_methods[] = { { (GCallback) _dummy_function, g_cclosure_marshal_VOID__VOID, 0 }, { (GCallback) _dummy_function, g_cclosure_marshal_VOID__VOID, 49 }, { (GCallback) _dummy_function, g_cclosure_marshal_VOID__VOID, 117 }, { (GCallback) _dummy_function, g_cclosure_marshal_VOID__VOID, 191 }, { (GCallback) _dummy_function, g_cclosure_marshal_VOID__VOID, 270 }, { (GCallback) _dummy_function, g_cclosure_marshal_VOID__VOID, 320 }, { (GCallback) _dummy_function, g_cclosure_marshal_VOID__VOID, 391 }, { (GCallback) _dummy_function, g_cclosure_marshal_VOID__VOID, 495 }, { (GCallback) _dummy_function, g_cclosure_marshal_VOID__VOID, 623 }, { (GCallback) _dummy_function, g_cclosure_marshal_VOID__VOID, 693 }, { (GCallback) _dummy_function, g_cclosure_marshal_VOID__VOID, 765 }, { (GCallback) _dummy_function, g_cclosure_marshal_VOID__VOID, 838 }, { (GCallback) _dummy_function, g_cclosure_marshal_VOID__VOID, 911 }, { (GCallback) _dummy_function, g_cclosure_marshal_VOID__VOID, 988 }, { (GCallback) _dummy_function, g_cclosure_marshal_VOID__VOID, 1064 }, { (GCallback) _dummy_function, g_cclosure_marshal_VOID__VOID, 1140 }, { (GCallback) _dummy_function, g_cclosure_marshal_VOID__VOID, 1204 }, { (GCallback) _dummy_function, g_cclosure_marshal_VOID__VOID, 1278 }, { (GCallback) _dummy_function, g_cclosure_marshal_VOID__VOID, 1347 }, { (GCallback) _dummy_function, g_cclosure_marshal_VOID__VOID, 1408 }, { (GCallback) _dummy_function, g_cclosure_marshal_VOID__VOID, 1460 }, { (GCallback) _dummy_function, g_cclosure_marshal_VOID__VOID, 1533 }, { (GCallback) _dummy_function, g_cclosure_marshal_VOID__VOID, 1588 }, { (GCallback) _dummy_function, g_cclosure_marshal_VOID__VOID, 1647 }, { (GCallback) _dummy_function, g_cclosure_marshal_VOID__VOID, 1730 }, { (GCallback) _dummy_function, g_cclosure_marshal_VOID__VOID, 1784 }, { (GCallback) _dummy_function, g_cclosure_marshal_VOID__VOID, 1833 }, { (GCallback) _dummy_function, g_cclosure_marshal_VOID__VOID, 1895 }, { (GCallback) _dummy_function, g_cclosure_marshal_VOID__VOID, 1947 }, { (GCallback) _dummy_function, g_cclosure_marshal_VOID__VOID, 1999 }, }; const DBusGObjectInfo dbus_glib_internal_test_object_info = { 0, dbus_glib_internal_test_methods, 30, "org.freedesktop.DBus.Tests.MyObject\0DoNothing\0S\0\0org.freedesktop.DBus.Tests.MyObject\0Increment\0S\0x\0I\0u\0arg1\0O\0F\0N\0u\0\0org.freedesktop.DBus.Tests.MyObject\0IncrementRetval\0S\0x\0I\0u\0arg1\0O\0F\0R\0u\0\0org.freedesktop.DBus.Tests.MyObject\0IncrementRetvalError\0S\0x\0I\0u\0arg1\0O\0F\0E\0u\0\0org.freedesktop.DBus.Tests.MyObject\0ThrowError\0S\0\0org.freedesktop.DBus.Tests.MyObject\0Uppercase\0S\0arg0\0I\0s\0arg1\0O\0F\0N\0s\0\0org.freedesktop.DBus.Tests.MyObject\0ManyArgs\0S\0x\0I\0u\0str\0I\0s\0trouble\0I\0d\0d_ret\0O\0F\0N\0d\0str_ret\0O\0F\0N\0s\0\0org.freedesktop.DBus.Tests.MyObject\0ManyReturn\0S\0arg0\0O\0F\0N\0u\0arg1\0O\0F\0N\0s\0arg2\0O\0F\0N\0i\0arg3\0O\0F\0N\0u\0arg4\0O\0F\0N\0u\0arg5\0O\0C\0N\0s\0\0org.freedesktop.DBus.Tests.MyObject\0Stringify\0S\0val\0I\0v\0arg1\0O\0F\0N\0s\0\0org.freedesktop.DBus.Tests.MyObject\0Unstringify\0S\0val\0I\0s\0arg1\0O\0F\0N\0v\0\0org.freedesktop.DBus.Tests.MyObject\0Recursive1\0S\0arg0\0I\0au\0arg1\0O\0F\0N\0u\0\0org.freedesktop.DBus.Tests.MyObject\0Recursive2\0S\0arg0\0I\0u\0arg1\0O\0F\0N\0au\0\0org.freedesktop.DBus.Tests.MyObject\0ManyUppercase\0S\0arg0\0I\0as\0arg1\0O\0F\0N\0as\0\0org.freedesktop.DBus.Tests.MyObject\0StrHashLen\0S\0arg0\0I\0a{ss}\0arg1\0O\0F\0N\0u\0\0org.freedesktop.DBus.Tests.MyObject\0SendCar\0S\0arg0\0I\0(suv)\0arg1\0O\0F\0N\0(uo)\0\0org.freedesktop.DBus.Tests.MyObject\0GetHash\0S\0arg0\0O\0F\0N\0a{ss}\0\0org.freedesktop.DBus.Tests.MyObject\0RecArrays\0S\0val\0I\0aas\0arg1\0O\0F\0N\0aau\0\0org.freedesktop.DBus.Tests.MyObject\0Objpath\0S\0arg0\0I\0o\0arg1\0O\0C\0N\0o\0\0org.freedesktop.DBus.Tests.MyObject\0GetObjs\0S\0arg0\0O\0F\0N\0ao\0\0org.freedesktop.DBus.Tests.MyObject\0IncrementVal\0S\0\0org.freedesktop.DBus.Tests.MyObject\0AsyncIncrement\0A\0x\0I\0u\0arg1\0O\0F\0N\0u\0\0org.freedesktop.DBus.Tests.MyObject\0AsyncThrowError\0A\0\0org.freedesktop.DBus.Tests.MyObject\0GetVal\0S\0arg0\0O\0F\0N\0u\0\0org.freedesktop.DBus.Tests.MyObject\0ManyStringify\0S\0arg0\0I\0a{sv}\0arg1\0O\0F\0N\0a{sv}\0\0org.freedesktop.DBus.Tests.MyObject\0EmitFrobnicate\0S\0\0org.freedesktop.DBus.Tests.MyObject\0Terminate\0S\0\0org.freedesktop.DBus.Tests.FooObject\0GetValue\0S\0arg0\0O\0F\0N\0u\0\0org.freedesktop.DBus.Tests.FooObject\0EmitSignals\0S\0\0org.freedesktop.DBus.Tests.FooObject\0EmitSignal2\0S\0\0org.freedesktop.DBus.Tests.FooObject\0Terminate\0S\0\0\0", "org.freedesktop.DBus.Tests.MyObject\0Frobnicate\0org.freedesktop.DBus.Tests.FooObject\0Sig0\0org.freedesktop.DBus.Tests.FooObject\0Sig1\0org.freedesktop.DBus.Tests.FooObject\0Sig2\0\0", "\0" }; /* * Unit test for GLib GObject integration ("skeletons") * Returns: %TRUE on success. */ gboolean _dbus_gobject_test (const char *test_data_dir) { int i; const char *arg; const char *arg_name; gboolean arg_in; gboolean constval; RetvalType retval; const char *arg_signature; const char *sigdata; const char *iface; const char *signame; static struct { const char *wincaps; const char *uscore; } name_pairs[] = { { "SetFoo", "set_foo" }, { "Foo", "foo" }, { "GetFooBar", "get_foo_bar" }, { "Hello", "hello" } /* Impossible-to-handle cases */ /* { "FrobateUIHandler", "frobate_ui_handler" } */ }; /* Test lookup in our hardcoded object info; if these tests fail * then it likely means you changed the generated object info in an * incompatible way and broke the lookup functions. In that case * you need to bump the version and use a new structure instead. */ /* DoNothing */ arg = method_arg_info_from_object_info (&dbus_glib_internal_test_object_info, &(dbus_glib_internal_test_methods[0])); g_assert (*arg == '\0'); /* Increment */ arg = method_arg_info_from_object_info (&dbus_glib_internal_test_object_info, &(dbus_glib_internal_test_methods[1])); g_assert (*arg != '\0'); arg = arg_iterate (arg, &arg_name, &arg_in, &constval, &retval, &arg_signature); g_assert (!strcmp (arg_name, "x")); g_assert (arg_in == TRUE); g_assert (!strcmp (arg_signature, "u")); g_assert (*arg != '\0'); arg = arg_iterate (arg, &arg_name, &arg_in, &constval, &retval, &arg_signature); g_assert (arg_in == FALSE); g_assert (retval == RETVAL_NONE); g_assert (!strcmp (arg_signature, "u")); g_assert (*arg == '\0'); /* IncrementRetval */ arg = method_arg_info_from_object_info (&dbus_glib_internal_test_object_info, &(dbus_glib_internal_test_methods[2])); g_assert (*arg != '\0'); arg = arg_iterate (arg, &arg_name, &arg_in, &constval, &retval, &arg_signature); g_assert (!strcmp (arg_name, "x")); g_assert (arg_in == TRUE); g_assert (!strcmp (arg_signature, "u")); g_assert (*arg != '\0'); arg = arg_iterate (arg, &arg_name, &arg_in, &constval, &retval, &arg_signature); g_assert (retval == RETVAL_NOERROR); g_assert (arg_in == FALSE); g_assert (!strcmp (arg_signature, "u")); g_assert (*arg == '\0'); /* IncrementRetvalError */ arg = method_arg_info_from_object_info (&dbus_glib_internal_test_object_info, &(dbus_glib_internal_test_methods[3])); g_assert (*arg != '\0'); arg = arg_iterate (arg, &arg_name, &arg_in, &constval, &retval, &arg_signature); g_assert (!strcmp (arg_name, "x")); g_assert (arg_in == TRUE); g_assert (!strcmp (arg_signature, "u")); g_assert (*arg != '\0'); arg = arg_iterate (arg, &arg_name, &arg_in, &constval, &retval, &arg_signature); g_assert (retval == RETVAL_ERROR); g_assert (arg_in == FALSE); g_assert (!strcmp (arg_signature, "u")); g_assert (*arg == '\0'); /* Stringify */ arg = method_arg_info_from_object_info (&dbus_glib_internal_test_object_info, &(dbus_glib_internal_test_methods[8])); g_assert (*arg != '\0'); arg = arg_iterate (arg, &arg_name, &arg_in, &constval, &retval, &arg_signature); g_assert (!strcmp (arg_name, "val")); g_assert (arg_in == TRUE); g_assert (!strcmp (arg_signature, "v")); g_assert (*arg != '\0'); arg = arg_iterate (arg, &arg_name, &arg_in, &constval, &retval, &arg_signature); g_assert (retval == RETVAL_NONE); g_assert (arg_in == FALSE); g_assert (!strcmp (arg_signature, "s")); g_assert (*arg == '\0'); sigdata = dbus_glib_internal_test_object_info.exported_signals; g_assert (*sigdata != '\0'); sigdata = signal_iterate (sigdata, &iface, &signame); g_assert (!strcmp (iface, "org.freedesktop.DBus.Tests.MyObject")); g_assert (!strcmp (signame, "Frobnicate")); g_assert (*sigdata != '\0'); sigdata = signal_iterate (sigdata, &iface, &signame); g_assert (!strcmp (iface, "org.freedesktop.DBus.Tests.FooObject")); g_assert (!strcmp (signame, "Sig0")); g_assert (*sigdata != '\0'); sigdata = signal_iterate (sigdata, &iface, &signame); g_assert (!strcmp (iface, "org.freedesktop.DBus.Tests.FooObject")); g_assert (!strcmp (signame, "Sig1")); g_assert (*sigdata != '\0'); sigdata = signal_iterate (sigdata, &iface, &signame); g_assert (!strcmp (iface, "org.freedesktop.DBus.Tests.FooObject")); g_assert (!strcmp (signame, "Sig2")); g_assert (*sigdata == '\0'); i = 0; while (i < (int) G_N_ELEMENTS (name_pairs)) { char *uscore; char *wincaps; uscore = _dbus_gutils_wincaps_to_uscore (name_pairs[i].wincaps); wincaps = uscore_to_wincaps (name_pairs[i].uscore); if (strcmp (uscore, name_pairs[i].uscore) != 0) { g_printerr ("\"%s\" should have been converted to \"%s\" not \"%s\"\n", name_pairs[i].wincaps, name_pairs[i].uscore, uscore); exit (1); } if (strcmp (wincaps, name_pairs[i].wincaps) != 0) { g_printerr ("\"%s\" should have been converted to \"%s\" not \"%s\"\n", name_pairs[i].uscore, name_pairs[i].wincaps, wincaps); exit (1); } g_free (uscore); g_free (wincaps); ++i; } return TRUE; } #endif /* DBUS_BUILD_TESTS */ dbus-glib-0.100.2/dbus/dbus-glib.h0000644000175000017500000003407512112652540013430 00000000000000/* -*- mode: C; c-file-style: "gnu" -*- */ /* dbus-glib.h GLib integration * * Copyright (C) 2002, 2003 CodeFactory AB * Copyright (C) 2003, 2004 Red Hat, Inc. * * Licensed under the Academic Free License version 2.1 * * 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 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * */ #ifndef DBUS_GLIB_H #define DBUS_GLIB_H #include #include G_BEGIN_DECLS #define DBUS_INSIDE_DBUS_GLIB_H 1 /* * Convert to DBusConnection with dbus_g_connection_get_connection() in dbus-glib-lowlevel.h */ typedef struct _DBusGConnection DBusGConnection; /* * Convert to DBusMessage with dbus_g_message_get_message() in dbus-glib-lowlevel.h */ typedef struct _DBusGMessage DBusGMessage; #define DBUS_TYPE_G_CONNECTION (dbus_g_connection_get_g_type ()) #define DBUS_TYPE_G_MESSAGE (dbus_g_message_get_g_type ()) GType dbus_g_connection_get_g_type (void) G_GNUC_CONST; GType dbus_g_message_get_g_type (void) G_GNUC_CONST; DBusGConnection* dbus_g_connection_ref (DBusGConnection *connection); void dbus_g_connection_unref (DBusGConnection *connection); DBusGMessage* dbus_g_message_ref (DBusGMessage *message); void dbus_g_message_unref (DBusGMessage *message); void dbus_g_connection_flush (DBusGConnection *connection); GQuark dbus_g_error_quark (void); #define DBUS_GERROR dbus_g_error_quark () typedef enum { DBUS_GERROR_FAILED, DBUS_GERROR_NO_MEMORY, DBUS_GERROR_SERVICE_UNKNOWN, DBUS_GERROR_NAME_HAS_NO_OWNER, DBUS_GERROR_NO_REPLY, DBUS_GERROR_IO_ERROR, DBUS_GERROR_BAD_ADDRESS, DBUS_GERROR_NOT_SUPPORTED, DBUS_GERROR_LIMITS_EXCEEDED, DBUS_GERROR_ACCESS_DENIED, DBUS_GERROR_AUTH_FAILED, DBUS_GERROR_NO_SERVER, DBUS_GERROR_TIMEOUT, DBUS_GERROR_NO_NETWORK, DBUS_GERROR_ADDRESS_IN_USE, DBUS_GERROR_DISCONNECTED, DBUS_GERROR_INVALID_ARGS, DBUS_GERROR_FILE_NOT_FOUND, DBUS_GERROR_FILE_EXISTS, DBUS_GERROR_UNKNOWN_METHOD, DBUS_GERROR_TIMED_OUT, DBUS_GERROR_MATCH_RULE_NOT_FOUND, DBUS_GERROR_MATCH_RULE_INVALID, DBUS_GERROR_SPAWN_EXEC_FAILED, DBUS_GERROR_SPAWN_FORK_FAILED, DBUS_GERROR_SPAWN_CHILD_EXITED, DBUS_GERROR_SPAWN_CHILD_SIGNALED, DBUS_GERROR_SPAWN_FAILED, DBUS_GERROR_UNIX_PROCESS_ID_UNKNOWN, DBUS_GERROR_INVALID_SIGNATURE, DBUS_GERROR_INVALID_FILE_CONTENT, DBUS_GERROR_SELINUX_SECURITY_CONTEXT_UNKNOWN, DBUS_GERROR_REMOTE_EXCEPTION } DBusGError; gboolean dbus_g_error_has_name (GError *error, const char *name); const char * dbus_g_error_get_name (GError *error); void dbus_g_thread_init (void); DBusGConnection* dbus_g_connection_open (const gchar *address, GError **error); DBusGConnection* dbus_g_bus_get (DBusBusType type, GError **error); DBusGConnection* dbus_g_bus_get_private (DBusBusType type, GMainContext *context, GError **error); typedef struct _DBusGObjectInfo DBusGObjectInfo; typedef struct _DBusGMethodInfo DBusGMethodInfo; /** * DBusGMethodInfo: * @function: C method to invoke * @marshaller: Marshaller to invoke method * @data_offset: Offset into the introspection data * * Object typically generated by #dbus-binding-tool that * stores a mapping from introspection data to a * function pointer for a C method to be invoked. */ struct _DBusGMethodInfo { GCallback function; GClosureMarshal marshaller; int data_offset; }; /** * DBusGObjectInfo: * @format_version: Allows us to change the rest of this struct * by adding DBusGObjectInfo2, DBusGObjectInfo3, etc. * @method_infos: Array of method pointers * @n_method_infos: Length of the infos array * @data: Introspection data * @exported_signals: Exported signals * @exported_properties: Exported properties * * Introspection data for a #GObject, normally autogenerated by * a tool such as #dbus-binding-tool. */ struct _DBusGObjectInfo { int format_version; const DBusGMethodInfo *method_infos; int n_method_infos; const char *data; const char *exported_signals; const char *exported_properties; }; void dbus_glib_global_set_disable_legacy_property_access (void); void dbus_g_object_type_install_info (GType object_type, const DBusGObjectInfo *info); void dbus_g_object_type_register_shadow_property (GType iface_type, const char *dbus_prop_name, const char *shadow_prop_name); void dbus_g_error_domain_register (GQuark domain, const char * default_iface, GType code_enum); void dbus_g_connection_register_g_object (DBusGConnection *connection, const char *at_path, GObject *object); void dbus_g_connection_unregister_g_object (DBusGConnection *connection, GObject *object); GObject * dbus_g_connection_lookup_g_object (DBusGConnection *connection, const char *at_path); #ifdef DBUS_COMPILATION #include "dbus/dbus-gtype-specialized.h" #else #include #endif /* definitions for some basic array types */ #define DBUS_TYPE_G_BOOLEAN_ARRAY (dbus_g_type_get_collection ("GArray", G_TYPE_BOOLEAN)) #define DBUS_TYPE_G_UCHAR_ARRAY (dbus_g_type_get_collection ("GArray", G_TYPE_UCHAR)) #define DBUS_TYPE_G_UINT_ARRAY (dbus_g_type_get_collection ("GArray", G_TYPE_UINT)) #define DBUS_TYPE_G_INT_ARRAY (dbus_g_type_get_collection ("GArray", G_TYPE_INT)) #define DBUS_TYPE_G_UINT64_ARRAY (dbus_g_type_get_collection ("GArray", G_TYPE_UINT64)) #define DBUS_TYPE_G_INT64_ARRAY (dbus_g_type_get_collection ("GArray", G_TYPE_INT64)) #define DBUS_TYPE_G_OBJECT_ARRAY (dbus_g_type_get_collection ("GPtrArray", G_TYPE_OBJECT)) #define DBUS_TYPE_G_STRING_STRING_HASHTABLE (dbus_g_type_get_map ("GHashTable", G_TYPE_STRING, G_TYPE_STRING)) typedef gchar DBusGObjectPath; GType dbus_g_object_path_get_g_type (void) G_GNUC_CONST; #define DBUS_TYPE_G_OBJECT_PATH (dbus_g_object_path_get_g_type ()) typedef gchar DBusGSignature; GType dbus_g_signature_get_g_type (void) G_GNUC_CONST; #define DBUS_TYPE_G_SIGNATURE (dbus_g_signature_get_g_type ()) void dbus_g_object_register_marshaller (GClosureMarshal marshaller, GType rettype, ...); void dbus_g_object_register_marshaller_array(GClosureMarshal marshaller, GType rettype, guint n_types, const GType* types); typedef struct _DBusGProxy DBusGProxy; typedef struct _DBusGProxyClass DBusGProxyClass; #define DBUS_TYPE_G_PROXY (dbus_g_proxy_get_type ()) #define DBUS_G_PROXY(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), DBUS_TYPE_G_PROXY, DBusGProxy)) #define DBUS_G_PROXY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DBUS_TYPE_G_PROXY, DBusGProxyClass)) #define DBUS_IS_G_PROXY(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), DBUS_TYPE_G_PROXY)) #define DBUS_IS_G_PROXY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DBUS_TYPE_G_PROXY)) #define DBUS_G_PROXY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DBUS_TYPE_G_PROXY, DBusGProxyClass)) struct _DBusGProxy { /*< private >*/ GObject parent; }; struct _DBusGProxyClass { /*< private >*/ GObjectClass parent_class; /**< Parent class */ }; typedef struct _DBusGProxyCall DBusGProxyCall; typedef void (* DBusGProxyCallNotify) (DBusGProxy *proxy, DBusGProxyCall *call_id, void *user_data); GType dbus_g_proxy_get_type (void) G_GNUC_CONST; DBusGProxy* dbus_g_proxy_new_for_name (DBusGConnection *connection, const char *name, const char *path, const char *iface); DBusGProxy* dbus_g_proxy_new_for_name_owner (DBusGConnection *connection, const char *name, const char *path, const char *iface, GError **error); DBusGProxy* dbus_g_proxy_new_from_proxy (DBusGProxy *proxy, const char *iface, const char *path); DBusGProxy* dbus_g_proxy_new_for_peer (DBusGConnection *connection, const char *path, const char *iface); void dbus_g_proxy_set_interface (DBusGProxy *proxy, const char *interface_name); void dbus_g_proxy_add_signal (DBusGProxy *proxy, const char *signal_name, GType first_type, ...); void dbus_g_proxy_connect_signal (DBusGProxy *proxy, const char *signal_name, GCallback handler, void *data, GClosureNotify free_data_func); void dbus_g_proxy_disconnect_signal (DBusGProxy *proxy, const char *signal_name, GCallback handler, void *data); gboolean dbus_g_proxy_call (DBusGProxy *proxy, const char *method, GError **error, GType first_arg_type, ...); gboolean dbus_g_proxy_call_with_timeout (DBusGProxy *proxy, const char *method, int timeout, GError **error, GType first_arg_type, ...); void dbus_g_proxy_call_no_reply (DBusGProxy *proxy, const char *method, GType first_arg_type, ...); DBusGProxyCall * dbus_g_proxy_begin_call (DBusGProxy *proxy, const char *method, DBusGProxyCallNotify notify, gpointer user_data, GDestroyNotify destroy, GType first_arg_type, ...); DBusGProxyCall * dbus_g_proxy_begin_call_with_timeout (DBusGProxy *proxy, const char *method, DBusGProxyCallNotify notify, gpointer user_data, GDestroyNotify destroy, int timeout, GType first_arg_type, ...); void dbus_g_proxy_set_default_timeout (DBusGProxy *proxy, int timeout); gboolean dbus_g_proxy_end_call (DBusGProxy *proxy, DBusGProxyCall *call, GError **error, GType first_arg_type, ...); void dbus_g_proxy_cancel_call (DBusGProxy *proxy, DBusGProxyCall *call); const char* dbus_g_proxy_get_path (DBusGProxy *proxy); const char* dbus_g_proxy_get_bus_name (DBusGProxy *proxy); const char* dbus_g_proxy_get_interface (DBusGProxy *proxy); typedef struct _DBusGMethodInvocation DBusGMethodInvocation; void dbus_g_method_return (DBusGMethodInvocation *context, ...); void dbus_g_method_return_error (DBusGMethodInvocation *context, const GError *error); /* Probably possible to replace this with a closure */ typedef struct { GCallback cb; gpointer userdata; } DBusGAsyncData; #undef DBUS_INSIDE_DBUS_GLIB_H #include G_END_DECLS #endif /* DBUS_GLIB_H */ dbus-glib-0.100.2/dbus/dbus-gvalue.h0000644000175000017500000000262712107524563014003 00000000000000#ifndef DBUS_GOBJECT_VALUE_H #define DBUS_GOBJECT_VALUE_H #include #include #include #include #include "dbus/dbus-glib.h" G_BEGIN_DECLS typedef struct { DBusGConnection *gconnection; DBusGProxy *proxy; guint recursion_depth; } DBusGValueMarshalCtx; void _dbus_g_value_types_init (void); char * _dbus_gtype_to_signature (GType type); char * _dbus_gvalue_to_signature (const GValue *val); gboolean _dbus_gvalue_demarshal (DBusGValueMarshalCtx *context, DBusMessageIter *iter, GValue *value, GError **error); gboolean _dbus_gvalue_demarshal_variant (DBusGValueMarshalCtx *context, DBusMessageIter *iter, GValue *value, GError **error); GValueArray * _dbus_gvalue_demarshal_message (DBusGValueMarshalCtx *context, DBusMessage *message, guint n_params, const GType *types, GError **error); gboolean _dbus_gvalue_marshal (DBusMessageIter *iter, const GValue *value); G_END_DECLS #endif /* DBUS_GOBJECT_VALUE_H */ dbus-glib-0.100.2/dbus/dbus-glib.c0000644000175000017500000002333212112652540013415 00000000000000/* -*- mode: C; c-file-style: "gnu" -*- */ /* dbus-glib.c General GLib binding stuff * * Copyright (C) 2004 Red Hat, Inc. * * Licensed under the Academic Free License version 2.1 * * 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 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * */ #include #include "dbus-glib.h" #include "dbus-glib-lowlevel.h" #include "dbus-gtest.h" #include "dbus-gutils.h" #include "dbus-gobject.h" #include /** * SECTION:dbus-gconnection * @short_description: DBus Connection * @see_also: #DBusConnection * @stability: Stable * * A #DBusGConnection is a boxed type abstracting a DBusConnection. */ /** * DBusGConnection: * * A #DBusGConnection is a boxed type abstracting a DBusConnection from * libdbus. */ /** * dbus_g_connection_flush: * @connection: the #DBusGConnection to flush * * Blocks until outgoing calls and signal emissions have been sent. */ void dbus_g_connection_flush (DBusGConnection *connection) { dbus_connection_flush (DBUS_CONNECTION_FROM_G_CONNECTION (connection)); } /** * dbus_g_connection_ref: * @connection: the #DBusGConnection to ref * * Increment refcount on a #DBusGConnection * * Returns: the connection that was ref'd */ DBusGConnection* dbus_g_connection_ref (DBusGConnection *connection) { DBusConnection *c; c = DBUS_CONNECTION_FROM_G_CONNECTION (connection); dbus_connection_ref (c); return connection; } /** * dbus_g_connection_unref: * @connection: the connection to unref * * Decrement refcount on a #DBusGConnection */ void dbus_g_connection_unref (DBusGConnection *connection) { DBusConnection *c; c = DBUS_CONNECTION_FROM_G_CONNECTION (connection); dbus_connection_unref (c); } /** * SECTION:dbus-gmessage * @short_description: DBus Message * @see_also: #DBusMessage * @stability: Stable * * A #DBusGMessage is a boxed type abstracting a DBusMessage. */ /** * DBusGMessage: * * A #DBusGMessage is a boxed type abstracting a DBusMessage from * libdbus. */ /** * dbus_g_message_ref: * @message: the message to ref * * Increment refcount on a #DBusGMessage * * Returns: the message that was ref'd */ DBusGMessage* dbus_g_message_ref (DBusGMessage *message) { DBusMessage *c; c = DBUS_MESSAGE_FROM_G_MESSAGE (message); dbus_message_ref (c); return message; } /** * dbus_g_message_unref: * @message: the message to unref * * Decrement refcount on a #DBusGMessage */ void dbus_g_message_unref (DBusGMessage *message) { DBusMessage *c; c = DBUS_MESSAGE_FROM_G_MESSAGE (message); dbus_message_unref (c); } /** * SECTION:dbus-gerror * @short_description: DBus GError * @see_also: #GError * @stability: Stable * * #DBusGError is the #GError used by DBus. */ /** * DBusGError: * * A #GError enumeration for the domain %DBUS_GERROR. The values' meanings * can be found by looking at the comments for the corresponding constants * in dbus-protocol.h. */ /** * DBUS_GERROR: * * Expands to a function call returning the error domain quark for #DBusGError, * for use with #GError. */ GQuark dbus_g_error_quark (void) { static GQuark quark = 0; if (quark == 0) quark = g_quark_from_static_string ("dbus-glib-error-quark"); return quark; } /** * dbus_g_error_has_name: * @error: the GError given from the remote method * @name: the D-BUS error name * * Determine whether D-BUS error name for a remote exception matches * the given name. This function is intended to be invoked on a * #GError returned from an invocation of a remote method, e.g. via * dbus_g_proxy_end_call(). It will silently return %FALSE for errors * which are not remote D-BUS exceptions (i.e. with a domain other * than %DBUS_GERROR or a code other than * %DBUS_GERROR_REMOTE_EXCEPTION). * * Returns: %TRUE if and only if the remote error has the given name */ gboolean dbus_g_error_has_name (GError *error, const char *name) { g_return_val_if_fail (error != NULL, FALSE); if (error->domain != DBUS_GERROR || error->code != DBUS_GERROR_REMOTE_EXCEPTION) return FALSE; return !strcmp (dbus_g_error_get_name (error), name); } /** * dbus_g_error_get_name: * @error: the #GError given from the remote method * * This function may only be invoked on a #GError returned from an * invocation of a remote method, e.g. via dbus_g_proxy_end_call(). * Moreover, you must ensure that the error's domain is %DBUS_GERROR, * and the code is %DBUS_GERROR_REMOTE_EXCEPTION. * * Returns: the D-BUS name for a remote exception. */ const char * dbus_g_error_get_name (GError *error) { g_return_val_if_fail (error != NULL, NULL); g_return_val_if_fail (error->domain == DBUS_GERROR, NULL); g_return_val_if_fail (error->code == DBUS_GERROR_REMOTE_EXCEPTION, NULL); return error->message + strlen (error->message) + 1; } /** * DBUS_TYPE_CONNECTION: * * Expands to a function call returning a boxed #GType representing a * #DBusConnection pointer from libdbus. Not to be confused with * %DBUS_TYPE_G_CONNECTION, which you should usually use instead. * * Returns: the GLib type */ GType dbus_connection_get_g_type (void) { static GType our_type = 0; if (our_type == 0) our_type = g_boxed_type_register_static ("DBusConnection", (GBoxedCopyFunc) dbus_connection_ref, (GBoxedFreeFunc) dbus_connection_unref); return our_type; } /** * DBUS_TYPE_MESSAGE: * * Expands to a function call returning a boxed #GType representing a * #DBusMessage pointer from libdbus. Not to be confused with * %DBUS_TYPE_G_MESSAGE, which you should usually use instead. * * * Returns: the GLib type */ GType dbus_message_get_g_type (void) { static GType our_type = 0; if (our_type == 0) our_type = g_boxed_type_register_static ("DBusMessage", (GBoxedCopyFunc) dbus_message_ref, (GBoxedFreeFunc) dbus_message_unref); return our_type; } /** * DBUS_TYPE_G_CONNECTION: * * Expands to a function call returning the boxed #GType of a #DBusGConnection. * * Returns: the GLib type */ GType dbus_g_connection_get_g_type (void) { static GType our_type = 0; if (our_type == 0) our_type = g_boxed_type_register_static ("DBusGConnection", (GBoxedCopyFunc) dbus_g_connection_ref, (GBoxedFreeFunc) dbus_g_connection_unref); return our_type; } /** * DBUS_TYPE_G_MESSAGE: * * Expands to a function call returning the boxed #GType of a #DBusGConnection. * * Returns: the GLib type */ GType dbus_g_message_get_g_type (void) { static GType our_type = 0; if (our_type == 0) our_type = g_boxed_type_register_static ("DBusGMessage", (GBoxedCopyFunc) dbus_g_message_ref, (GBoxedFreeFunc) dbus_g_message_unref); return our_type; } /** * SECTION:dbus-glib-lowlevel * @short_description: DBus lower level functions * @stability: Unstable * * These functions can be used to access lower level of DBus. */ /** * dbus_g_connection_get_connection: * @gconnection: a #DBusGConnection * * Get the #DBusConnection corresponding to this #DBusGConnection. * The return value does not have its refcount incremented. * * Returns: #DBusConnection */ DBusConnection* dbus_g_connection_get_connection (DBusGConnection *gconnection) { g_return_val_if_fail (gconnection, NULL); return DBUS_CONNECTION_FROM_G_CONNECTION (gconnection); } extern dbus_int32_t _dbus_gmain_connection_slot; /** * dbus_connection_get_g_connection: * @connection: a #DBusConnection * * Get the #DBusGConnection corresponding to this #DBusConnection. This only * makes sense if the #DBusConnection was originally a #DBusGConnection that was * registered with the GLib main loop. The return value does not have its * refcount incremented. * * Returns: #DBusGConnection */ DBusGConnection* dbus_connection_get_g_connection (DBusConnection *connection) { g_return_val_if_fail (connection, NULL); g_return_val_if_fail (dbus_connection_get_data (connection, _dbus_gmain_connection_slot), NULL); return DBUS_G_CONNECTION_FROM_CONNECTION (connection); } /** * dbus_g_message_get_message: * @gmessage: a #DBusGMessage * * Get the #DBusMessage corresponding to this #DBusGMessage. * The return value does not have its refcount incremented. * * Returns: #DBusMessage */ DBusMessage* dbus_g_message_get_message (DBusGMessage *gmessage) { return DBUS_MESSAGE_FROM_G_MESSAGE (gmessage); } #ifdef DBUS_BUILD_TESTS /* * Unit test for general glib stuff * Returns: %TRUE on success. */ gboolean _dbus_glib_test (const char *test_data_dir) { DBusError err; GError *gerror = NULL; dbus_error_init (&err); dbus_set_error_const (&err, DBUS_ERROR_NO_MEMORY, "Out of memory!"); dbus_set_g_error (&gerror, &err); g_assert (gerror != NULL); g_assert (gerror->domain == DBUS_GERROR); g_assert (gerror->code == DBUS_GERROR_NO_MEMORY); g_assert (!strcmp (gerror->message, "Out of memory!")); dbus_error_init (&err); g_clear_error (&gerror); return TRUE; } #endif /* DBUS_BUILD_TESTS */ dbus-glib-0.100.2/dbus/dbus-gvalue-parse-variant.h0000644000175000017500000000255012107524614016545 00000000000000/* GVariant to dbus-glib escape hatch * * Copyright © 2010 Collabora Ltd. * * Licensed under the Academic Free License version 2.1 * * 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 of the License, or * (at your option) any later version. * * Alternatively, at your option, you can redistribute and/or modify * this single file under the terms of the GNU Lesser General Public License * as published by the Free Software Foundation; either version 2.1 of * that 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * */ #ifndef __DBUS_GVALUE_PARSE_VARIANT_H__ #define __DBUS_GVALUE_PARSE_VARIANT_H__ #include G_BEGIN_DECLS void dbus_g_value_parse_g_variant (GVariant *variant, GValue *value); G_END_DECLS #endif dbus-glib-0.100.2/dbus/dbus-gobject.h0000644000175000017500000000251512107524563014131 00000000000000/* -*- mode: C; c-file-style: "gnu" -*- */ /* dbus-gobject.h: common functions used to map between D-BUS and GObject * * Copyright (C) 2005 Red Hat, Inc. * * Licensed under the Academic Free License version 2.1 * * 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 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * */ #ifndef DBUS_GLIB_OBJECT_H #define DBUS_GLIB_OBJECT_H #include #include #include #include "dbus/dbus-glib.h" G_BEGIN_DECLS const char * _dbus_gobject_get_path (GObject *obj); GClosureMarshal _dbus_gobject_lookup_marshaller (GType rettype, guint n_params, const GType *param_types); G_END_DECLS #endif dbus-glib-0.100.2/dbus/Makefile.in0000644000175000017500000012612512112653376013462 00000000000000# 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 = dbus-binding-tool$(EXEEXT) @DBUS_BASH_COMPLETION_TRUE@libexec_PROGRAMS = dbus-bash-completion-helper$(EXEEXT) @DBUS_BUILD_TESTS_TRUE@noinst_PROGRAMS = $(am__EXEEXT_1) @DBUS_BUILD_TESTS_TRUE@TESTS = dbus-glib-test$(EXEEXT) subdir = dbus DIST_COMMON = $(libdbus_glib_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)/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)$(bindir)" \ "$(DESTDIR)$(libexecdir)" "$(DESTDIR)$(completiondir)" \ "$(DESTDIR)$(libdbus_glibdir)" LTLIBRARIES = $(lib_LTLIBRARIES) $(noinst_LTLIBRARIES) am__DEPENDENCIES_1 = libdbus_glib_1_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) am__objects_1 = dbus-gtype-specialized.lo dbus-gutils.lo \ dbus-gsignature.lo dbus-gvalue-utils.lo am_libdbus_glib_1_la_OBJECTS = dbus-glib.lo dbus-gmain.lo \ dbus-gmarshal.lo dbus-gobject.lo dbus-gproxy.lo dbus-gtest.lo \ dbus-gvalue.lo dbus-gvalue-parse-variant.lo dbus-gthread.lo \ $(am__objects_1) libdbus_glib_1_la_OBJECTS = $(am_libdbus_glib_1_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent libdbus_glib_1_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(AM_CFLAGS) $(CFLAGS) $(libdbus_glib_1_la_LDFLAGS) $(LDFLAGS) \ -o $@ libdbus_gtool_la_DEPENDENCIES = $(am__DEPENDENCIES_1) am_libdbus_gtool_la_OBJECTS = $(am__objects_1) dbus-gidl.lo \ dbus-gloader-expat.lo dbus-gparser.lo libdbus_gtool_la_OBJECTS = $(am_libdbus_gtool_la_OBJECTS) @DBUS_BUILD_TESTS_TRUE@am__EXEEXT_1 = dbus-glib-test$(EXEEXT) PROGRAMS = $(bin_PROGRAMS) $(libexec_PROGRAMS) $(noinst_PROGRAMS) am_dbus_bash_completion_helper_OBJECTS = \ dbus-bash-completion-helper.$(OBJEXT) dbus_bash_completion_helper_OBJECTS = \ $(am_dbus_bash_completion_helper_OBJECTS) dbus_bash_completion_helper_DEPENDENCIES = \ $(builddir)/libdbus-gtool.la $(builddir)/libdbus-glib-1.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am_dbus_binding_tool_OBJECTS = dbus-binding-tool-glib.$(OBJEXT) \ dbus-glib-tool.$(OBJEXT) dbus_binding_tool_OBJECTS = $(am_dbus_binding_tool_OBJECTS) dbus_binding_tool_DEPENDENCIES = $(builddir)/libdbus-gtool.la \ $(builddir)/libdbus-glib-1.la $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) am__dbus_glib_test_SOURCES_DIST = dbus-gtest-main.c @DBUS_BUILD_TESTS_TRUE@am_dbus_glib_test_OBJECTS = \ @DBUS_BUILD_TESTS_TRUE@ dbus-gtest-main.$(OBJEXT) dbus_glib_test_OBJECTS = $(am_dbus_glib_test_OBJECTS) @DBUS_BUILD_TESTS_TRUE@dbus_glib_test_DEPENDENCIES = \ @DBUS_BUILD_TESTS_TRUE@ $(builddir)/libdbus-glib-1.la SCRIPTS = $(completion_SCRIPTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/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 = $(libdbus_glib_1_la_SOURCES) $(libdbus_gtool_la_SOURCES) \ $(dbus_bash_completion_helper_SOURCES) \ $(dbus_binding_tool_SOURCES) $(dbus_glib_test_SOURCES) DIST_SOURCES = $(libdbus_glib_1_la_SOURCES) \ $(libdbus_gtool_la_SOURCES) \ $(dbus_bash_completion_helper_SOURCES) \ $(dbus_binding_tool_SOURCES) \ $(am__dbus_glib_test_SOURCES_DIST) 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 HEADERS = $(libdbus_glib_HEADERS) 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" ABSOLUTE_TOP_BUILDDIR = @ABSOLUTE_TOP_BUILDDIR@ ACLOCAL = @ACLOCAL@ 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@ CYGPATH_W = @CYGPATH_W@ DBUS_BINDING_TOOL = @DBUS_BINDING_TOOL@ DBUS_CFLAGS = @DBUS_CFLAGS@ DBUS_GLIB_CFLAGS = @DBUS_GLIB_CFLAGS@ DBUS_GLIB_LIBS = @DBUS_GLIB_LIBS@ DBUS_GLIB_THREADS_CFLAGS = @DBUS_GLIB_THREADS_CFLAGS@ DBUS_GLIB_THREADS_LIBS = @DBUS_GLIB_THREADS_LIBS@ DBUS_GLIB_TOOL_CFLAGS = @DBUS_GLIB_TOOL_CFLAGS@ DBUS_GLIB_TOOL_LIBS = @DBUS_GLIB_TOOL_LIBS@ DBUS_LIBS = @DBUS_LIBS@ DBUS_PATH_OR_ABSTRACT = @DBUS_PATH_OR_ABSTRACT@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ EXPANDED_BINDIR = @EXPANDED_BINDIR@ EXPANDED_DATADIR = @EXPANDED_DATADIR@ EXPANDED_LIBDIR = @EXPANDED_LIBDIR@ EXPANDED_LOCALSTATEDIR = @EXPANDED_LOCALSTATEDIR@ EXPANDED_SYSCONFDIR = @EXPANDED_SYSCONFDIR@ FGREP = @FGREP@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GREP = @GREP@ GTKDOC_CHECK = @GTKDOC_CHECK@ 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@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_REVISION = @LT_REVISION@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ 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@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TEST_CORE_SERVICE_BINARY = @TEST_CORE_SERVICE_BINARY@ TEST_EXIT_BINARY = @TEST_EXIT_BINARY@ TEST_INTERFACES_SERVICE_BINARY = @TEST_INTERFACES_SERVICE_BINARY@ TEST_SEGFAULT_BINARY = @TEST_SEGFAULT_BINARY@ TEST_SERVICE_BINARY = @TEST_SERVICE_BINARY@ TEST_SERVICE_DIR = @TEST_SERVICE_DIR@ TEST_SHELL_SERVICE_BINARY = @TEST_SHELL_SERVICE_BINARY@ TEST_SLEEP_FOREVER_BINARY = @TEST_SLEEP_FOREVER_BINARY@ TEST_SOCKET_DIR = @TEST_SOCKET_DIR@ VERSION = @VERSION@ 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_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@ 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@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ 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 = . examples INCLUDES = \ -I$(top_srcdir) \ -I$(top_builddir) \ $(DBUS_CFLAGS) \ $(DBUS_GLIB_CFLAGS) \ $(DBUS_GLIB_TOOL_CFLAGS) \ -DDBUS_COMPILATION=1 \ -DDBUS_LOCALEDIR=\"$(prefix)/@DATADIRNAME@/locale\" lib_LTLIBRARIES = libdbus-glib-1.la CLEANFILES = $(BUILT_SOURCES) dbus-bash-completion.sh DBUS_GLIB_INTERNALS = \ dbus-gtype-specialized.c \ dbus-gtype-specialized-priv.h \ dbus-gutils.c \ dbus-gutils.h \ dbus-gsignature.c \ dbus-gsignature.h \ dbus-gvalue.h \ dbus-gvalue-utils.c \ dbus-gvalue-utils.h libdbus_glib_1_la_SOURCES = \ dbus-glib.c \ dbus-gmain.c \ dbus-gmarshal.c \ dbus-gmarshal.h \ dbus-gobject.c \ dbus-gobject.h \ dbus-gproxy.c \ dbus-gtest.c \ dbus-gtest.h \ dbus-gvalue.c \ dbus-gvalue.h \ dbus-gvalue-parse-variant.c \ dbus-gthread.c \ $(DBUS_GLIB_INTERNALS) libdbus_glib_HEADERS = \ dbus-gtype-specialized.h \ dbus-gvalue-parse-variant.h \ dbus-glib.h \ dbus-glib-lowlevel.h libdbus_glibdir = $(includedir)/dbus-1.0/dbus libdbus_glib_1_la_LIBADD = $(DBUS_LIBS) $(DBUS_GLIB_LIBS) libdbus_glib_1_la_LDFLAGS = -export-symbols-regex "^[^_].*" -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) -no-undefined # convenience lib used here and by dbus-viewer noinst_LTLIBRARIES = libdbus-gtool.la libdbus_gtool_la_SOURCES = $(DBUS_GLIB_INTERNALS) \ dbus-gidl.c \ dbus-gidl.h \ dbus-gloader-expat.c \ dbus-gparser.c \ dbus-gparser.h libdbus_gtool_la_LIBADD = $(DBUS_LIBS) -lexpat dbus_binding_tool_SOURCES = \ dbus-binding-tool-glib.h \ dbus-binding-tool-glib.c \ dbus-glib-tool.h \ dbus-glib-tool.c dbus_binding_tool_LDADD = $(builddir)/libdbus-gtool.la $(builddir)/libdbus-glib-1.la $(DBUS_LIBS) $(DBUS_GLIB_LIBS) -lexpat completiondir = $(sysconfdir)/bash_completion.d @DBUS_BASH_COMPLETION_TRUE@completion_SCRIPTS = dbus-bash-completion.sh dbus_bash_completion_helper_SOURCES = \ dbus-bash-completion-helper.c dbus_bash_completion_helper_LDADD = $(builddir)/libdbus-gtool.la -lexpat $(builddir)/libdbus-glib-1.la $(DBUS_LIBS) $(DBUS_GLIB_LIBS) EXTRA_DIST = dbus-gmarshal.list dbus-bash-completion.sh.in @DBUS_BUILD_TESTS_TRUE@TESTS_ENVIRONMENT = DBUS_TEST_DATA=$(top_builddir)/test/data DBUS_TEST_HOMEDIR=$(top_builddir)/dbus @DBUS_BUILD_TESTS_TRUE@dbus_glib_test_SOURCES = \ @DBUS_BUILD_TESTS_TRUE@ dbus-gtest-main.c @DBUS_BUILD_TESTS_TRUE@dbus_glib_test_LDADD = $(builddir)/libdbus-glib-1.la all: all-recursive .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(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 dbus/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu dbus/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: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(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 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 libdbus-glib-1.la: $(libdbus_glib_1_la_OBJECTS) $(libdbus_glib_1_la_DEPENDENCIES) $(EXTRA_libdbus_glib_1_la_DEPENDENCIES) $(AM_V_CCLD)$(libdbus_glib_1_la_LINK) -rpath $(libdir) $(libdbus_glib_1_la_OBJECTS) $(libdbus_glib_1_la_LIBADD) $(LIBS) libdbus-gtool.la: $(libdbus_gtool_la_OBJECTS) $(libdbus_gtool_la_DEPENDENCIES) $(EXTRA_libdbus_gtool_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(libdbus_gtool_la_OBJECTS) $(libdbus_gtool_la_LIBADD) $(LIBS) 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 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 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 dbus-bash-completion-helper$(EXEEXT): $(dbus_bash_completion_helper_OBJECTS) $(dbus_bash_completion_helper_DEPENDENCIES) $(EXTRA_dbus_bash_completion_helper_DEPENDENCIES) @rm -f dbus-bash-completion-helper$(EXEEXT) $(AM_V_CCLD)$(LINK) $(dbus_bash_completion_helper_OBJECTS) $(dbus_bash_completion_helper_LDADD) $(LIBS) dbus-binding-tool$(EXEEXT): $(dbus_binding_tool_OBJECTS) $(dbus_binding_tool_DEPENDENCIES) $(EXTRA_dbus_binding_tool_DEPENDENCIES) @rm -f dbus-binding-tool$(EXEEXT) $(AM_V_CCLD)$(LINK) $(dbus_binding_tool_OBJECTS) $(dbus_binding_tool_LDADD) $(LIBS) dbus-glib-test$(EXEEXT): $(dbus_glib_test_OBJECTS) $(dbus_glib_test_DEPENDENCIES) $(EXTRA_dbus_glib_test_DEPENDENCIES) @rm -f dbus-glib-test$(EXEEXT) $(AM_V_CCLD)$(LINK) $(dbus_glib_test_OBJECTS) $(dbus_glib_test_LDADD) $(LIBS) install-completionSCRIPTS: $(completion_SCRIPTS) @$(NORMAL_INSTALL) @list='$(completion_SCRIPTS)'; test -n "$(completiondir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(completiondir)'"; \ $(MKDIR_P) "$(DESTDIR)$(completiondir)" || exit 1; \ fi; \ 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 'h;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 \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(completiondir)$$dir'"; \ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(completiondir)$$dir" || exit $$?; \ } \ ; done uninstall-completionSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(completion_SCRIPTS)'; test -n "$(completiondir)" || exit 0; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 's,.*/,,;$(transform)'`; \ dir='$(DESTDIR)$(completiondir)'; $(am__uninstall_files_from_dir) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbus-bash-completion-helper.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbus-binding-tool-glib.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbus-gidl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbus-glib-tool.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbus-glib.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbus-gloader-expat.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbus-gmain.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbus-gmarshal.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbus-gobject.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbus-gparser.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbus-gproxy.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbus-gsignature.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbus-gtest-main.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbus-gtest.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbus-gthread.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbus-gtype-specialized.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbus-gutils.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbus-gvalue-parse-variant.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbus-gvalue-utils.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbus-gvalue.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-libdbus_glibHEADERS: $(libdbus_glib_HEADERS) @$(NORMAL_INSTALL) @list='$(libdbus_glib_HEADERS)'; test -n "$(libdbus_glibdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(libdbus_glibdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(libdbus_glibdir)" || 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)$(libdbus_glibdir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(libdbus_glibdir)" || exit $$?; \ done uninstall-libdbus_glibHEADERS: @$(NORMAL_UNINSTALL) @list='$(libdbus_glib_HEADERS)'; test -n "$(libdbus_glibdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(libdbus_glibdir)'; $(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 check-am: all-am $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: check-recursive all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(SCRIPTS) $(HEADERS) install-binPROGRAMS: install-libLTLIBRARIES installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(libexecdir)" "$(DESTDIR)$(completiondir)" "$(DESTDIR)$(libdbus_glibdir)"; 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: -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-recursive clean-am: clean-binPROGRAMS clean-generic clean-libLTLIBRARIES \ clean-libexecPROGRAMS clean-libtool clean-noinstLTLIBRARIES \ 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-completionSCRIPTS install-libdbus_glibHEADERS install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-binPROGRAMS install-libLTLIBRARIES \ install-libexecPROGRAMS 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: uninstall-binPROGRAMS uninstall-completionSCRIPTS \ uninstall-libLTLIBRARIES uninstall-libdbus_glibHEADERS \ uninstall-libexecPROGRAMS .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-binPROGRAMS \ clean-generic clean-libLTLIBRARIES clean-libexecPROGRAMS \ clean-libtool clean-noinstLTLIBRARIES 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-binPROGRAMS install-completionSCRIPTS 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-libdbus_glibHEADERS install-libexecPROGRAMS \ 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 \ uninstall-binPROGRAMS uninstall-completionSCRIPTS \ uninstall-libLTLIBRARIES uninstall-libdbus_glibHEADERS \ uninstall-libexecPROGRAMS regenerate-built-sources: @GLIB_GENMARSHAL@ --prefix=_dbus_g_marshal dbus-gmarshal.list --header > dbus-gmarshal.h && \ echo '#include ' > dbus-gmarshal.c && \ echo '#include "dbus-gmarshal.h"' >> dbus-gmarshal.c && \ @GLIB_GENMARSHAL@ --prefix=_dbus_g_marshal dbus-gmarshal.list --body >> dbus-gmarshal.c dbus-bash-completion.sh : dbus-bash-completion.sh.in @sed -e "s|\@libexecdir\@|$(libexecdir)|" $< > $@ Android.mk: Makefile.am androgenizer -:PROJECT dbus-glib -:SHARED libdbus-glib-1 -:TAGS eng debug \ -:REL_TOP $(top_srcdir) -:ABS_TOP $(abs_top_srcdir) \ -:SOURCES $(libdbus_glib_1_la_SOURCES) \ -:CFLAGS $(DEFS) $(CFLAGS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CFLAGS) \ -:CPPFLAGS $(CPPFLAGS) $(AM_CPPFLAGS) \ -:LDFLAGS $(libdbus_glib_1_la_LIBADD) $(libdbus_glib_1_la_LDFLAGS) \ > $@ # 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: dbus-glib-0.100.2/dbus/dbus-gvalue.c0000644000175000017500000015420012112652540013762 00000000000000/* -*- mode: C; c-file-style: "gnu" -*- */ /* dbus-gvalue.c GValue to-from DBusMessageIter * * Copyright (C) 2004 Ximian, Inc. * Copyright (C) 2005 Red Hat, Inc. * * Licensed under the Academic Free License version 2.1 * * 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 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * */ #include "config.h" #include "dbus-gtest.h" #include "dbus-gvalue.h" #include "dbus-gsignature.h" #include "dbus-gobject.h" #include "dbus-gvalue-utils.h" #include "dbus/dbus-glib.h" #include #include #include "dbus/dbus-signature.h" /* Seems reasonable, but this should probably be part of the standard protocol */ #define DBUS_GLIB_MAX_VARIANT_RECURSION 32 static gboolean demarshal_static_variant (DBusGValueMarshalCtx *context, DBusMessageIter *iter, GValue *value, GError **error); static gboolean marshal_basic (DBusMessageIter *iter, const GValue *value); static gboolean demarshal_basic (DBusGValueMarshalCtx *context, DBusMessageIter *iter, GValue *value, GError **error); static gboolean marshal_strv (DBusMessageIter *iter, const GValue *value); static gboolean demarshal_strv (DBusGValueMarshalCtx *context, DBusMessageIter *iter, GValue *value, GError **error); static gboolean marshal_valuearray (DBusMessageIter *iter, const GValue *value); static gboolean demarshal_valuearray (DBusGValueMarshalCtx *context, DBusMessageIter *iter, GValue *value, GError **error); static gboolean marshal_variant (DBusMessageIter *iter, const GValue *value); static gboolean demarshal_variant (DBusGValueMarshalCtx *context, DBusMessageIter *iter, GValue *value, GError **error); static gboolean marshal_proxy (DBusMessageIter *iter, const GValue *value); static gboolean demarshal_proxy (DBusGValueMarshalCtx *context, DBusMessageIter *iter, GValue *value, GError **error); static gboolean marshal_object_path (DBusMessageIter *iter, const GValue *value); static gboolean demarshal_object_path (DBusGValueMarshalCtx *context, DBusMessageIter *iter, GValue *value, GError **error); static gboolean marshal_object (DBusMessageIter *iter, const GValue *value); static gboolean demarshal_object (DBusGValueMarshalCtx *context, DBusMessageIter *iter, GValue *value, GError **error); static gboolean marshal_signature (DBusMessageIter *iter, const GValue *value); static gboolean demarshal_signature (DBusGValueMarshalCtx *context, DBusMessageIter *iter, GValue *value, GError **error); static gboolean marshal_map (DBusMessageIter *iter, const GValue *value); static gboolean demarshal_map (DBusGValueMarshalCtx *context, DBusMessageIter *iter, GValue *value, GError **error); static gboolean marshal_collection (DBusMessageIter *iter, const GValue *value); static gboolean marshal_collection_ptrarray (DBusMessageIter *iter, const GValue *value); static gboolean marshal_collection_array (DBusMessageIter *iter, const GValue *value); static gboolean demarshal_collection (DBusGValueMarshalCtx *context, DBusMessageIter *iter, GValue *value, GError **error); static gboolean demarshal_collection_ptrarray (DBusGValueMarshalCtx *context, DBusMessageIter *iter, GValue *value, GError **error); static gboolean demarshal_collection_array (DBusGValueMarshalCtx *context, DBusMessageIter *iter, GValue *value, GError **error); static gboolean marshal_struct (DBusMessageIter *iter, const GValue *value); static gboolean demarshal_struct (DBusGValueMarshalCtx *context, DBusMessageIter *iter, GValue *value, GError **error); typedef gboolean (*DBusGValueMarshalFunc) (DBusMessageIter *iter, const GValue *value); typedef gboolean (*DBusGValueDemarshalFunc) (DBusGValueMarshalCtx *context, DBusMessageIter *iter, GValue *value, GError **error); typedef struct { DBusGValueMarshalFunc marshaller; DBusGValueDemarshalFunc demarshaller; } DBusGTypeMarshalVtable; typedef struct { const char *sig; const DBusGTypeMarshalVtable *vtable; } DBusGTypeMarshalData; static GQuark dbus_g_type_metadata_data_quark () { static GQuark quark; if (!quark) quark = g_quark_from_static_string ("DBusGTypeMetaData"); return quark; } static void set_type_metadata (GType type, const DBusGTypeMarshalData *data) { g_type_set_qdata (type, dbus_g_type_metadata_data_quark (), (gpointer) data); } static void register_basic (int typecode, const DBusGTypeMarshalData *typedata) { set_type_metadata (_dbus_gtype_from_basic_typecode (typecode), typedata); } void _dbus_g_value_types_init (void) { static gboolean types_initialized; static const DBusGTypeMarshalVtable basic_vtable = { marshal_basic, demarshal_basic }; if (types_initialized) return; dbus_g_type_specialized_init (); /* Register basic types */ { static const DBusGTypeMarshalData typedata = { DBUS_TYPE_BOOLEAN_AS_STRING, &basic_vtable, }; register_basic (DBUS_TYPE_BOOLEAN, &typedata); } { static const DBusGTypeMarshalData typedata = { DBUS_TYPE_BYTE_AS_STRING, &basic_vtable, }; register_basic (DBUS_TYPE_BYTE, &typedata); } { static const DBusGTypeMarshalData typedata = { DBUS_TYPE_INT16_AS_STRING, &basic_vtable, }; register_basic (DBUS_TYPE_INT16, &typedata); } { static const DBusGTypeMarshalData typedata = { DBUS_TYPE_UINT16_AS_STRING, &basic_vtable, }; register_basic (DBUS_TYPE_UINT16, &typedata); } { static const DBusGTypeMarshalData typedata = { DBUS_TYPE_UINT32_AS_STRING, &basic_vtable, }; register_basic (DBUS_TYPE_UINT32, &typedata); } { static const DBusGTypeMarshalData typedata = { DBUS_TYPE_INT32_AS_STRING, &basic_vtable, }; register_basic (DBUS_TYPE_INT32, &typedata); } { static const DBusGTypeMarshalData typedata = { DBUS_TYPE_UINT64_AS_STRING, &basic_vtable, }; register_basic (DBUS_TYPE_UINT64, &typedata); } { static const DBusGTypeMarshalData typedata = { DBUS_TYPE_INT64_AS_STRING, &basic_vtable, }; register_basic (DBUS_TYPE_INT64, &typedata); } { static const DBusGTypeMarshalData typedata = { DBUS_TYPE_DOUBLE_AS_STRING, &basic_vtable, }; register_basic (DBUS_TYPE_DOUBLE, &typedata); } { static const DBusGTypeMarshalData typedata = { DBUS_TYPE_STRING_AS_STRING, &basic_vtable, }; register_basic (DBUS_TYPE_STRING, &typedata); } /* fundamental GTypes that don't map 1:1 with D-BUS types */ { static const DBusGTypeMarshalData typedata = { DBUS_TYPE_BYTE_AS_STRING, &basic_vtable, }; set_type_metadata (G_TYPE_CHAR, &typedata); } { static const DBusGTypeMarshalData typedata = { DBUS_TYPE_INT32_AS_STRING, &basic_vtable, }; set_type_metadata (G_TYPE_LONG, &typedata); } { static const DBusGTypeMarshalData typedata = { DBUS_TYPE_UINT32_AS_STRING, &basic_vtable, }; set_type_metadata (G_TYPE_ULONG, &typedata); } { static const DBusGTypeMarshalData typedata = { DBUS_TYPE_DOUBLE_AS_STRING, &basic_vtable, }; set_type_metadata (G_TYPE_FLOAT, &typedata); } /* Register complex types with builtin GType mappings */ { static const DBusGTypeMarshalVtable vtable = { marshal_variant, demarshal_variant }; static const DBusGTypeMarshalData typedata = { DBUS_TYPE_VARIANT_AS_STRING, &vtable }; set_type_metadata (G_TYPE_VALUE, &typedata); }; { static const DBusGTypeMarshalVtable vtable = { marshal_strv, demarshal_strv }; static const DBusGTypeMarshalData typedata = { DBUS_TYPE_ARRAY_AS_STRING DBUS_TYPE_STRING_AS_STRING, &vtable }; set_type_metadata (G_TYPE_STRV, &typedata); }; /* Register some types specific to the D-BUS GLib bindings */ { static const DBusGTypeMarshalVtable vtable = { marshal_proxy, demarshal_proxy }; static const DBusGTypeMarshalData typedata = { DBUS_TYPE_OBJECT_PATH_AS_STRING, &vtable }; set_type_metadata (DBUS_TYPE_G_PROXY, &typedata); } { static const DBusGTypeMarshalVtable vtable = { marshal_object_path, demarshal_object_path }; static const DBusGTypeMarshalData typedata = { DBUS_TYPE_OBJECT_PATH_AS_STRING, &vtable }; set_type_metadata (DBUS_TYPE_G_OBJECT_PATH, &typedata); } { static const DBusGTypeMarshalVtable vtable = { marshal_object, demarshal_object }; static const DBusGTypeMarshalData typedata = { DBUS_TYPE_OBJECT_PATH_AS_STRING, &vtable }; set_type_metadata (G_TYPE_OBJECT, &typedata); } { static const DBusGTypeMarshalVtable vtable = { marshal_signature, demarshal_signature }; static const DBusGTypeMarshalData typedata = { DBUS_TYPE_SIGNATURE_AS_STRING, &vtable }; set_type_metadata (DBUS_TYPE_G_SIGNATURE, &typedata); } types_initialized = TRUE; } /** * DBusGObjectPath: * * A typedef for a string used to represent D-Bus object paths. * Its GType is %DBUS_TYPE_G_OBJECT_PATH, derived from %G_TYPE_BOXED. * * Prior to version 0.FIXME this was used as the type name of * %DBUS_TYPE_G_OBJECT_PATH, but did not actually exist as a typedef. * * Since: 0.FIXME */ /** * DBUS_TYPE_G_OBJECT_PATH: * * The #GType of a #DBusGObjectPath, which is a boxed type containing a * D-Bus object path as a zero-terminated string. Object paths can be * copied with g_strdup() and freed with g_free(), just like %G_TYPE_STRING, * but have a distinct boxed type to allow them to be distinguished when * stored in a #GValue. * * Returns: a type derived from %G_TYPE_BOXED */ GType dbus_g_object_path_get_g_type (void) { static GType type_id = 0; if (!type_id) type_id = g_boxed_type_register_static ("DBusGObjectPath", (GBoxedCopyFunc) g_strdup, (GBoxedFreeFunc) g_free); return type_id; } /** * DBusGSignature: * * A typedef for a string used to represent D-Bus signatures. * Its GType is %DBUS_TYPE_G_SIGNATURE, derived from %G_TYPE_BOXED. * * Prior to version 0.FIXME this was used as the type name of * %DBUS_TYPE_G_SIGNATURE, but did not actually exist as a typedef. * * Since: 0.FIXME */ /** * DBUS_TYPE_G_SIGNATURE: * * The #GType of a #DBusGSignature, which is a boxed type containing a * D-Bus signature as a zero-terminated string. Signatures can be * copied with g_strdup() and freed with g_free(), just like %G_TYPE_STRING, * but have a distinct boxed type to allow them to be distinguished when * stored in a #GValue. * * Returns: a type derived from %G_TYPE_BOXED */ GType dbus_g_signature_get_g_type (void) { static GType type_id = 0; if (G_UNLIKELY (type_id == 0)) type_id = g_boxed_type_register_static ("DBusGSignature", (GBoxedCopyFunc) g_strdup, (GBoxedFreeFunc) g_free); return type_id; } char * _dbus_gtype_to_signature (GType gtype) { char *ret; DBusGTypeMarshalData *typedata; if (dbus_g_type_is_collection (gtype)) { GType elt_gtype; char *subsig; elt_gtype = dbus_g_type_get_collection_specialization (gtype); subsig = _dbus_gtype_to_signature (elt_gtype); ret = g_strconcat (DBUS_TYPE_ARRAY_AS_STRING, subsig, NULL); g_free (subsig); } else if (dbus_g_type_is_map (gtype)) { GType key_gtype; GType val_gtype; char *key_subsig; char *val_subsig; key_gtype = dbus_g_type_get_map_key_specialization (gtype); val_gtype = dbus_g_type_get_map_value_specialization (gtype); key_subsig = _dbus_gtype_to_signature (key_gtype); val_subsig = _dbus_gtype_to_signature (val_gtype); ret = g_strconcat (DBUS_TYPE_ARRAY_AS_STRING DBUS_DICT_ENTRY_BEGIN_CHAR_AS_STRING, key_subsig, val_subsig, DBUS_DICT_ENTRY_END_CHAR_AS_STRING, NULL); g_free (key_subsig); g_free (val_subsig); } else if (dbus_g_type_is_struct (gtype)) { guint i, size; GString *sig; size = dbus_g_type_get_struct_size (gtype); sig = g_string_sized_new (size+2); /*some sensible starting size*/ g_string_assign (sig, DBUS_STRUCT_BEGIN_CHAR_AS_STRING); for (i = 0; i < size; i++) { gchar *subsig; subsig = _dbus_gtype_to_signature ( dbus_g_type_get_struct_member_type (gtype, i)); g_string_append (sig, subsig); g_free (subsig); } g_string_append (sig, DBUS_STRUCT_END_CHAR_AS_STRING); ret = g_string_free (sig, FALSE); } else { typedata = g_type_get_qdata (gtype, dbus_g_type_metadata_data_quark ()); if (typedata == NULL) return NULL; ret = g_strdup (typedata->sig); } return ret; } char * _dbus_gvalue_to_signature (const GValue *val) { GType gtype; gtype = G_VALUE_TYPE (val); if (g_type_is_a (gtype, G_TYPE_VALUE_ARRAY)) { GString *str; guint i; GValueArray *array; array = g_value_get_boxed (val); str = g_string_new (DBUS_STRUCT_BEGIN_CHAR_AS_STRING); for (i = 0; i < array->n_values; i++) { char *sig; sig = _dbus_gvalue_to_signature (g_value_array_get_nth (array, i)); g_string_append (str, sig); g_free (sig); } g_string_append (str, DBUS_STRUCT_END_CHAR_AS_STRING); return g_string_free (str, FALSE); } else return _dbus_gtype_to_signature (gtype); } static gboolean demarshal_basic (DBusGValueMarshalCtx *context, DBusMessageIter *iter, GValue *value, GError **error) { int current_type; current_type = dbus_message_iter_get_arg_type (iter); g_assert (dbus_type_is_basic (current_type)); switch (current_type) { case DBUS_TYPE_BOOLEAN: { dbus_bool_t bool; if (!G_VALUE_HOLDS (value, G_TYPE_BOOLEAN)) goto invalid_type; dbus_message_iter_get_basic (iter, &bool); g_value_set_boolean (value, bool); return TRUE; } case DBUS_TYPE_BYTE: { unsigned char byte; if (!G_VALUE_HOLDS (value, G_TYPE_UCHAR)) goto invalid_type; dbus_message_iter_get_basic (iter, &byte); g_value_set_uchar (value, byte); return TRUE; } case DBUS_TYPE_INT32: { dbus_int32_t intval; if (!G_VALUE_HOLDS (value, G_TYPE_INT)) goto invalid_type; dbus_message_iter_get_basic (iter, &intval); g_value_set_int (value, intval); return TRUE; } case DBUS_TYPE_UINT32: { dbus_uint32_t intval; if (!G_VALUE_HOLDS (value, G_TYPE_UINT)) goto invalid_type; dbus_message_iter_get_basic (iter, &intval); g_value_set_uint (value, intval); return TRUE; } case DBUS_TYPE_INT64: { dbus_int64_t intval; if (!G_VALUE_HOLDS (value, G_TYPE_INT64)) goto invalid_type; dbus_message_iter_get_basic (iter, &intval); g_value_set_int64 (value, intval); return TRUE; } case DBUS_TYPE_UINT64: { dbus_uint64_t intval; if (!G_VALUE_HOLDS (value, G_TYPE_UINT64)) goto invalid_type; dbus_message_iter_get_basic (iter, &intval); g_value_set_uint64 (value, intval); return TRUE; } case DBUS_TYPE_DOUBLE: { double dval; if (!G_VALUE_HOLDS (value, G_TYPE_DOUBLE)) goto invalid_type; dbus_message_iter_get_basic (iter, &dval); g_value_set_double (value, dval); return TRUE; } case DBUS_TYPE_INT16: { dbus_int16_t v; if (!G_VALUE_HOLDS (value, G_TYPE_INT)) goto invalid_type; dbus_message_iter_get_basic (iter, &v); g_value_set_int (value, v); return TRUE; } case DBUS_TYPE_UINT16: { dbus_uint16_t v; if (!G_VALUE_HOLDS (value, G_TYPE_UINT)) goto invalid_type; dbus_message_iter_get_basic (iter, &v); g_value_set_uint (value, v); return TRUE; } case DBUS_TYPE_STRING: { const char *s; if (!G_VALUE_HOLDS (value, G_TYPE_STRING)) goto invalid_type; dbus_message_iter_get_basic (iter, &s); g_value_set_string (value, s); return TRUE; } default: /* fall through to invalid_type */ break; } invalid_type: g_set_error (error, DBUS_GERROR, DBUS_GERROR_INVALID_ARGS, "Expected type %s, got type code \'%c\'", g_type_name (G_VALUE_TYPE (value)), (guchar) current_type); return FALSE; } static gboolean demarshal_static_variant (DBusGValueMarshalCtx *context, DBusMessageIter *iter, GValue *value, GError **error) { char *sig; DBusMessageIter subiter; GType variant_type; dbus_message_iter_recurse (iter, &subiter); sig = dbus_message_iter_get_signature (&subiter); variant_type = _dbus_gtype_from_signature (sig, context->proxy != NULL); if (variant_type != G_TYPE_INVALID) { g_value_init (value, variant_type); if (!_dbus_gvalue_demarshal (context, &subiter, value, error)) { dbus_free (sig); return FALSE; } } dbus_free (sig); return TRUE; } static gboolean demarshal_variant (DBusGValueMarshalCtx *context, DBusMessageIter *iter, GValue *value, GError **error) { GValue *variant_val; variant_val = g_new0 (GValue, 1); if (!demarshal_static_variant (context, iter, variant_val, error)) return FALSE; g_value_take_boxed (value, variant_val); return TRUE; } static gboolean demarshal_proxy (DBusGValueMarshalCtx *context, DBusMessageIter *iter, GValue *value, GError **error) { DBusGProxy *new_proxy; const char *objpath; int current_type; current_type = dbus_message_iter_get_arg_type (iter); if (current_type != DBUS_TYPE_OBJECT_PATH) { g_set_error (error, DBUS_GERROR, DBUS_GERROR_INVALID_ARGS, "Expected D-BUS object path, got type code \'%c\'", (guchar) current_type); return FALSE; } g_assert (context->proxy != NULL); dbus_message_iter_get_basic (iter, &objpath); new_proxy = dbus_g_proxy_new_from_proxy (context->proxy, NULL, objpath); g_value_take_object (value, new_proxy); return TRUE; } static gboolean demarshal_object_path (DBusGValueMarshalCtx *context, DBusMessageIter *iter, GValue *value, GError **error) { const char *objpath; int current_type; current_type = dbus_message_iter_get_arg_type (iter); if (current_type != DBUS_TYPE_OBJECT_PATH) { g_set_error (error, DBUS_GERROR, DBUS_GERROR_INVALID_ARGS, "Expected D-BUS object path, got type code \'%c\'", (guchar) current_type); return FALSE; } dbus_message_iter_get_basic (iter, &objpath); g_value_set_boxed (value, objpath); return TRUE; } static gboolean demarshal_object (DBusGValueMarshalCtx *context, DBusMessageIter *iter, GValue *value, GError **error) { const char *objpath; int current_type; GObject *obj; current_type = dbus_message_iter_get_arg_type (iter); if (current_type != DBUS_TYPE_OBJECT_PATH) { g_set_error (error, DBUS_GERROR, DBUS_GERROR_INVALID_ARGS, "Expected D-BUS object path, got type code \'%c\'", (guchar) current_type); return FALSE; } g_assert (context->proxy == NULL); dbus_message_iter_get_basic (iter, &objpath); obj = dbus_g_connection_lookup_g_object (context->gconnection, objpath); if (obj == NULL) { g_set_error (error, DBUS_GERROR, DBUS_GERROR_INVALID_ARGS, "Unregistered object at path '%s'", objpath); return FALSE; } g_value_set_object (value, obj); return TRUE; } static gboolean demarshal_signature (DBusGValueMarshalCtx *context, DBusMessageIter *iter, GValue *value, GError **error) { const char *sig; int current_type; current_type = dbus_message_iter_get_arg_type (iter); if (current_type != DBUS_TYPE_SIGNATURE) { g_set_error (error, DBUS_GERROR, DBUS_GERROR_INVALID_ARGS, "Expected D-BUS signature, got type code \'%c\'", (guchar) current_type); return FALSE; } dbus_message_iter_get_basic (iter, &sig); g_value_set_boxed (value, sig); return TRUE; } static gboolean demarshal_strv (DBusGValueMarshalCtx *context, DBusMessageIter *iter, GValue *value, GError **error) { DBusMessageIter subiter; int current_type; GArray *arr; current_type = dbus_message_iter_get_arg_type (iter); if (current_type != DBUS_TYPE_ARRAY) { g_set_error (error, DBUS_GERROR, DBUS_GERROR_INVALID_ARGS, "Expected D-BUS array, got type code \'%c\'", (guchar) current_type); return FALSE; } dbus_message_iter_recurse (iter, &subiter); current_type = dbus_message_iter_get_arg_type (&subiter); if (current_type != DBUS_TYPE_INVALID && current_type != DBUS_TYPE_STRING) { g_set_error (error, DBUS_GERROR, DBUS_GERROR_INVALID_ARGS, "Expected D-BUS string, got type code \'%c\'", (guchar) current_type); return FALSE; } arr = g_array_new (TRUE, FALSE, sizeof (char *)); while ((current_type = dbus_message_iter_get_arg_type (&subiter)) != DBUS_TYPE_INVALID) { g_assert (current_type == DBUS_TYPE_STRING); const char *str; char *copy; dbus_message_iter_get_basic (&subiter, &str); copy = g_strdup (str); g_array_append_val (arr, copy); dbus_message_iter_next (&subiter); } g_value_take_boxed (value, arr->data); g_array_free (arr, FALSE); return TRUE; } static gboolean demarshal_valuearray (DBusGValueMarshalCtx *context, DBusMessageIter *iter, GValue *value, GError **error) { int current_type; GValueArray *ret; DBusMessageIter subiter; current_type = dbus_message_iter_get_arg_type (iter); if (current_type != DBUS_TYPE_STRUCT) { g_set_error (error, DBUS_GERROR, DBUS_GERROR_INVALID_ARGS, "Expected D-BUS struct, got type code \'%c\'", (guchar) current_type); return FALSE; } dbus_message_iter_recurse (iter, &subiter); ret = g_value_array_new (12); while ((current_type = dbus_message_iter_get_arg_type (&subiter)) != DBUS_TYPE_INVALID) { GValue *val; GType elt_type; char *current_sig; g_value_array_append (ret, NULL); val = g_value_array_get_nth (ret, ret->n_values - 1); current_sig = dbus_message_iter_get_signature (&subiter); elt_type = _dbus_gtype_from_signature (current_sig, TRUE); if (elt_type == G_TYPE_INVALID) { g_value_array_free (ret); g_set_error (error, DBUS_GERROR, DBUS_GERROR_INVALID_ARGS, "Couldn't demarshal argument with signature \"%s\"", current_sig); dbus_free (current_sig); return FALSE; } dbus_free (current_sig); g_value_init (val, elt_type); if (!_dbus_gvalue_demarshal (context, &subiter, val, error)) { g_value_array_free (ret); return FALSE; } dbus_message_iter_next (&subiter); } g_value_take_boxed (value, ret); return TRUE; } static gboolean demarshal_map (DBusGValueMarshalCtx *context, DBusMessageIter *iter, GValue *value, GError **error) { GType gtype; DBusMessageIter subiter; int current_type; gpointer ret; GType key_gtype; GType value_gtype; DBusGTypeSpecializedAppendContext appendctx; current_type = dbus_message_iter_get_arg_type (iter); if (current_type != DBUS_TYPE_ARRAY) { g_set_error (error, DBUS_GERROR, DBUS_GERROR_INVALID_ARGS, "Expected D-BUS array, got type code \'%c\'", (guchar) current_type); return FALSE; } gtype = G_VALUE_TYPE (value); dbus_message_iter_recurse (iter, &subiter); current_type = dbus_message_iter_get_arg_type (&subiter); if (current_type != DBUS_TYPE_INVALID && current_type != DBUS_TYPE_DICT_ENTRY) { g_set_error (error, DBUS_GERROR, DBUS_GERROR_INVALID_ARGS, "Expected D-BUS dict entry, got type code \'%c\'", (guchar) current_type); return FALSE; } key_gtype = dbus_g_type_get_map_key_specialization (gtype); value_gtype = dbus_g_type_get_map_value_specialization (gtype); ret = dbus_g_type_specialized_construct (gtype); g_value_take_boxed (value, ret); dbus_g_type_specialized_init_append (value, &appendctx); while ((current_type = dbus_message_iter_get_arg_type (&subiter)) != DBUS_TYPE_INVALID) { DBusMessageIter entry_iter; GValue key_value = {0,}; GValue value_value = {0,}; current_type = dbus_message_iter_get_arg_type (&subiter); g_assert (current_type == DBUS_TYPE_DICT_ENTRY); dbus_message_iter_recurse (&subiter, &entry_iter); g_value_init (&key_value, key_gtype); if (!_dbus_gvalue_demarshal (context, &entry_iter, &key_value, error)) return FALSE; dbus_message_iter_next (&entry_iter); g_value_init (&value_value, value_gtype); if (!_dbus_gvalue_demarshal (context, &entry_iter, &value_value, error)) return FALSE; dbus_g_type_specialized_map_append (&appendctx, &key_value, &value_value); /* Ownership of values passes to map, don't unset */ dbus_message_iter_next (&subiter); } return TRUE; } static gboolean demarshal_struct (DBusGValueMarshalCtx *context, DBusMessageIter *iter, GValue *value, GError **error) { int current_type; DBusMessageIter subiter; guint i, size; GValue val = {0,}; GType elt_type; current_type = dbus_message_iter_get_arg_type (iter); if (current_type != DBUS_TYPE_STRUCT) { g_set_error (error, DBUS_GERROR, DBUS_GERROR_INVALID_ARGS, "Expected D-BUS struct, got type code \'%c\'", (guchar) current_type); return FALSE; } dbus_message_iter_recurse (iter, &subiter); g_value_take_boxed (value, dbus_g_type_specialized_construct (G_VALUE_TYPE (value))); size = dbus_g_type_get_struct_size (G_VALUE_TYPE (value)); for (i=0; i < size; i++) { elt_type = dbus_g_type_get_struct_member_type (G_VALUE_TYPE(value), i); if (elt_type == G_TYPE_INVALID) { g_value_unset (value); g_set_error (error, DBUS_GERROR, DBUS_GERROR_INVALID_ARGS, "Couldn't demarshal argument, " "struct type %s has no member %d", g_type_name (G_VALUE_TYPE(value)), i); return FALSE; } g_value_init (&val, elt_type); if (!_dbus_gvalue_demarshal (context, &subiter, &val, error)) { g_value_unset (&val); g_value_unset (value); return FALSE; } if (!dbus_g_type_struct_set_member (value, i, &val)) { g_value_unset (&val); g_value_unset (value); return FALSE; } dbus_message_iter_next (&subiter); g_value_unset (&val); } g_assert (dbus_message_iter_get_arg_type (&subiter) == DBUS_TYPE_INVALID); return TRUE; } static DBusGValueDemarshalFunc get_type_demarshaller (GType type) { DBusGTypeMarshalData *typedata; typedata = g_type_get_qdata (type, dbus_g_type_metadata_data_quark ()); if (typedata == NULL) { if (g_type_is_a (type, G_TYPE_VALUE_ARRAY)) return demarshal_valuearray; if (dbus_g_type_is_collection (type)) return demarshal_collection; if (dbus_g_type_is_map (type)) return demarshal_map; if (dbus_g_type_is_struct (type)) return demarshal_struct; g_warning ("No demarshaller registered for type \"%s\"", g_type_name (type)); return NULL; } g_assert (typedata->vtable); return typedata->vtable->demarshaller; } static gboolean demarshal_collection (DBusGValueMarshalCtx *context, DBusMessageIter *iter, GValue *value, GError **error) { GType coltype; GType subtype; coltype = G_VALUE_TYPE (value); subtype = dbus_g_type_get_collection_specialization (coltype); if (_dbus_g_type_is_fixed (subtype)) return demarshal_collection_array (context, iter, value, error); else return demarshal_collection_ptrarray (context, iter, value, error); } static gboolean demarshal_collection_ptrarray (DBusGValueMarshalCtx *context, DBusMessageIter *iter, GValue *value, GError **error) { GType coltype; GType subtype; gpointer instance; DBusGTypeSpecializedAppendContext ctx; DBusGValueDemarshalFunc demarshaller; DBusMessageIter subiter; int current_type; current_type = dbus_message_iter_get_arg_type (iter); if (current_type != DBUS_TYPE_ARRAY) { g_set_error (error, DBUS_GERROR, DBUS_GERROR_INVALID_ARGS, "Expected D-BUS array, got type code \'%c\'", (guchar) current_type); return FALSE; } dbus_message_iter_recurse (iter, &subiter); coltype = G_VALUE_TYPE (value); subtype = dbus_g_type_get_collection_specialization (coltype); demarshaller = get_type_demarshaller (subtype); if (!demarshaller) { g_set_error (error, DBUS_GERROR, DBUS_GERROR_INVALID_ARGS, "No demarshaller registered for type \"%s\" of collection \"%s\"", g_type_name (coltype), g_type_name (subtype)); return FALSE; } instance = dbus_g_type_specialized_construct (coltype); g_value_take_boxed (value, instance); dbus_g_type_specialized_init_append (value, &ctx); while ((current_type = dbus_message_iter_get_arg_type (&subiter)) != DBUS_TYPE_INVALID) { GValue eltval = {0, }; g_value_init (&eltval, subtype); if (!demarshaller (context, &subiter, &eltval, error)) { dbus_g_type_specialized_collection_end_append (&ctx); g_value_unset (value); return FALSE; } dbus_g_type_specialized_collection_append (&ctx, &eltval); dbus_message_iter_next (&subiter); } dbus_g_type_specialized_collection_end_append (&ctx); return TRUE; } static gboolean demarshal_collection_array (DBusGValueMarshalCtx *context, DBusMessageIter *iter, GValue *value, GError **error) { DBusMessageIter subiter; GArray *ret; GType elt_gtype; int elt_size; void *msgarray; int msgarray_len; dbus_message_iter_recurse (iter, &subiter); elt_gtype = dbus_g_type_get_collection_specialization (G_VALUE_TYPE (value)); g_assert (elt_gtype != G_TYPE_INVALID); g_assert (_dbus_g_type_is_fixed (elt_gtype)); elt_size = _dbus_g_type_fixed_get_size (elt_gtype); ret = g_array_new (FALSE, TRUE, elt_size); msgarray = NULL; dbus_message_iter_get_fixed_array (&subiter, &msgarray, &msgarray_len); g_assert (msgarray != NULL || msgarray_len == 0); if (msgarray_len) g_array_append_vals (ret, msgarray, (guint) msgarray_len); g_value_take_boxed (value, ret); return TRUE; } gboolean _dbus_gvalue_demarshal (DBusGValueMarshalCtx *context, DBusMessageIter *iter, GValue *value, GError **error) { GType gtype; DBusGValueDemarshalFunc demarshaller; gboolean retcode = FALSE; if (context->recursion_depth > DBUS_GLIB_MAX_VARIANT_RECURSION) { g_set_error (error, DBUS_GERROR, DBUS_GERROR_NO_MEMORY, "Variant recursion limit exceeded"); return FALSE; } context->recursion_depth++; gtype = G_VALUE_TYPE (value); demarshaller = get_type_demarshaller (gtype); if (demarshaller == NULL) { g_set_error (error, DBUS_GERROR, DBUS_GERROR_INVALID_ARGS, "No demarshaller registered for type \"%s\"", g_type_name (gtype)); goto out; } retcode = demarshaller (context, iter, value, error); out: context->recursion_depth--; return retcode; } gboolean _dbus_gvalue_demarshal_variant (DBusGValueMarshalCtx *context, DBusMessageIter *iter, GValue *value, GError **error) { return demarshal_static_variant (context, iter, value, error); } GValueArray * _dbus_gvalue_demarshal_message (DBusGValueMarshalCtx *context, DBusMessage *message, guint n_types, const GType *types, GError **error) { GValueArray *ret; DBusMessageIter iter; int current_type; guint index_; ret = g_value_array_new (6); /* 6 is a typical maximum for arguments */ dbus_message_iter_init (message, &iter); index_ = 0; while ((current_type = dbus_message_iter_get_arg_type (&iter)) != DBUS_TYPE_INVALID) { GValue *value; GType gtype; if (index_ >= n_types) { g_set_error (error, DBUS_GERROR, DBUS_GERROR_INVALID_ARGS, "Too many arguments in message"); goto lose; } g_value_array_append (ret, NULL); value = g_value_array_get_nth (ret, index_); gtype = types[index_]; g_value_init (value, gtype); if (!_dbus_gvalue_demarshal (context, &iter, value, error)) goto lose; dbus_message_iter_next (&iter); index_++; } if (index_ < n_types) { g_set_error (error, DBUS_GERROR, DBUS_GERROR_INVALID_ARGS, "Too few arguments in message"); goto lose; } return ret; lose: g_value_array_free (ret); return NULL; } static void oom (void) G_GNUC_NORETURN; static void oom (void) { g_error ("no memory"); } static gboolean marshal_basic (DBusMessageIter *iter, const GValue *value) { GType value_type; value_type = G_VALUE_TYPE (value); switch (value_type) { case G_TYPE_CHAR: { char b = g_value_get_char (value); if (!dbus_message_iter_append_basic (iter, DBUS_TYPE_BYTE, &b)) oom (); } return TRUE; case G_TYPE_UCHAR: { unsigned char b = g_value_get_uchar (value); if (!dbus_message_iter_append_basic (iter, DBUS_TYPE_BYTE, &b)) oom (); } return TRUE; case G_TYPE_BOOLEAN: { dbus_bool_t b = g_value_get_boolean (value); g_return_val_if_fail (b == TRUE || b == FALSE, FALSE); if (!dbus_message_iter_append_basic (iter, DBUS_TYPE_BOOLEAN, &b)) oom (); } return TRUE; case G_TYPE_INT: { dbus_int32_t v = g_value_get_int (value); if (!dbus_message_iter_append_basic (iter, DBUS_TYPE_INT32, &v)) oom (); } return TRUE; case G_TYPE_UINT: { dbus_uint32_t v = g_value_get_uint (value); if (!dbus_message_iter_append_basic (iter, DBUS_TYPE_UINT32, &v)) oom (); } return TRUE; case G_TYPE_LONG: { dbus_int32_t v = g_value_get_long (value); if (!dbus_message_iter_append_basic (iter, DBUS_TYPE_INT32, &v)) oom (); } return TRUE; case G_TYPE_ULONG: { dbus_uint32_t v = g_value_get_ulong (value); if (!dbus_message_iter_append_basic (iter, DBUS_TYPE_UINT32, &v)) oom (); } return TRUE; case G_TYPE_INT64: { gint64 v = g_value_get_int64 (value); if (!dbus_message_iter_append_basic (iter, DBUS_TYPE_INT64, &v)) oom (); } return TRUE; case G_TYPE_UINT64: { guint64 v = g_value_get_uint64 (value); if (!dbus_message_iter_append_basic (iter, DBUS_TYPE_UINT64, &v)) oom (); } return TRUE; case G_TYPE_FLOAT: { double v = g_value_get_float (value); if (!dbus_message_iter_append_basic (iter, DBUS_TYPE_DOUBLE, &v)) oom (); } return TRUE; case G_TYPE_DOUBLE: { double v = g_value_get_double (value); if (!dbus_message_iter_append_basic (iter, DBUS_TYPE_DOUBLE, &v)) oom (); } return TRUE; case G_TYPE_STRING: { const char *v = g_value_get_string (value); if (!v) v = ""; /* FIXME: fd.o #16320: consider using g_return_if_fail to check UTF-8 * validity */ if (!dbus_message_iter_append_basic (iter, DBUS_TYPE_STRING, &v)) { gchar *s = g_strdup_value_contents (value); g_critical ("Unable to marshal string (not UTF-8 or OOM?): %s", s); g_free (s); return FALSE; } } return TRUE; default: { g_assert_not_reached (); return FALSE; } } } static gboolean marshal_strv (DBusMessageIter *iter, const GValue *value) { DBusMessageIter subiter; char **array; char **elt; gboolean ret = FALSE; g_assert (G_VALUE_TYPE (value) == g_strv_get_type ()); array = g_value_get_boxed (value); if (!dbus_message_iter_open_container (iter, DBUS_TYPE_ARRAY, "s", &subiter)) goto out; if (array) { for (elt = array; *elt; elt++) { if (!dbus_message_iter_append_basic (&subiter, DBUS_TYPE_STRING, elt)) goto out; } } if (!dbus_message_iter_close_container (iter, &subiter)) goto out; ret = TRUE; out: return ret; } static gboolean marshal_valuearray (DBusMessageIter *iter, const GValue *value) { GValueArray *array; guint i; DBusMessageIter subiter; g_assert (G_VALUE_TYPE (value) == G_TYPE_VALUE_ARRAY); array = g_value_get_boxed (value); if (!dbus_message_iter_open_container (iter, DBUS_TYPE_STRUCT, NULL, &subiter)) oom (); if (array) { for (i = 0; i < array->n_values; i++) { if (!_dbus_gvalue_marshal (&subiter, g_value_array_get_nth (array, i))) { dbus_message_iter_abandon_container (iter, &subiter); return FALSE; } } } return dbus_message_iter_close_container (iter, &subiter); } static gboolean marshal_proxy (DBusMessageIter *iter, const GValue *value) { const char *path; DBusGProxy *proxy; g_assert (G_VALUE_TYPE (value) == dbus_g_proxy_get_type ()); proxy = g_value_get_object (value); g_return_val_if_fail (DBUS_IS_G_PROXY (proxy), FALSE); path = dbus_g_proxy_get_path (proxy); g_return_val_if_fail (g_variant_is_object_path (path), FALSE); if (!dbus_message_iter_append_basic (iter, DBUS_TYPE_OBJECT_PATH, &path)) oom (); return TRUE; } static gboolean marshal_object_path (DBusMessageIter *iter, const GValue *value) { const char *path; g_assert (G_VALUE_TYPE (value) == DBUS_TYPE_G_OBJECT_PATH); path = g_value_get_boxed (value); g_return_val_if_fail (g_variant_is_object_path (path), FALSE); if (!dbus_message_iter_append_basic (iter, DBUS_TYPE_OBJECT_PATH, &path)) oom (); return TRUE; } static gboolean marshal_object (DBusMessageIter *iter, const GValue *value) { const char *path; GObject *obj; obj = g_value_get_object (value); g_return_val_if_fail (G_IS_OBJECT (obj), FALSE); path = _dbus_gobject_get_path (obj); g_return_val_if_fail (g_variant_is_object_path (path), FALSE); if (!dbus_message_iter_append_basic (iter, DBUS_TYPE_OBJECT_PATH, &path)) oom (); return TRUE; } static gboolean marshal_signature (DBusMessageIter *iter, const GValue *value) { const char *sig; g_assert (G_VALUE_TYPE (value) == DBUS_TYPE_G_SIGNATURE); sig = g_value_get_boxed (value); g_return_val_if_fail (g_variant_is_signature (sig), FALSE); /* failure here isn't strictly *guaranteed* to be OOM, since GDBus might * understand more type-codes than our libdbus */ if (!dbus_message_iter_append_basic (iter, DBUS_TYPE_SIGNATURE, &sig)) return FALSE; return TRUE; } struct DBusGLibHashMarshalData { const char *entry_sig; DBusMessageIter *iter; gboolean err; }; static void marshal_map_entry (const GValue *key, const GValue *value, gpointer data) { struct DBusGLibHashMarshalData *hashdata = data; DBusMessageIter subiter; if (hashdata->err) return; if (!dbus_message_iter_open_container (hashdata->iter, DBUS_TYPE_DICT_ENTRY, NULL, &subiter)) goto lose; if (!_dbus_gvalue_marshal (&subiter, key)) goto lose; if (!_dbus_gvalue_marshal (&subiter, value)) goto lose; if (!dbus_message_iter_close_container (hashdata->iter, &subiter)) goto lose; return; lose: hashdata->err = TRUE; } static gboolean marshal_map (DBusMessageIter *iter, const GValue *value) { GType gtype; DBusMessageIter arr_iter; struct DBusGLibHashMarshalData hashdata; char *key_sig; char *value_sig; GType key_type; GType value_type; char *entry_sig; char *array_sig; gtype = G_VALUE_TYPE (value); key_type = dbus_g_type_get_map_key_specialization (gtype); g_assert (_dbus_gtype_is_valid_hash_key (key_type)); value_type = dbus_g_type_get_map_value_specialization (gtype); g_assert (_dbus_gtype_is_valid_hash_value (value_type)); key_sig = _dbus_gtype_to_signature (key_type); if (!key_sig) { g_warning ("Cannot marshal type \"%s\" in map\n", g_type_name (key_type)); return FALSE; } value_sig = _dbus_gtype_to_signature (value_type); if (!value_sig) { g_free (key_sig); g_warning ("Cannot marshal type \"%s\" in map\n", g_type_name (value_type)); return FALSE; } entry_sig = g_strdup_printf ("%s%s", key_sig, value_sig); g_free (key_sig); g_free (value_sig); array_sig = g_strdup_printf ("%c%s%c", DBUS_DICT_ENTRY_BEGIN_CHAR, entry_sig, DBUS_DICT_ENTRY_END_CHAR); if (!dbus_message_iter_open_container (iter, DBUS_TYPE_ARRAY, array_sig, &arr_iter)) goto lose; hashdata.iter = &arr_iter; hashdata.err = FALSE; hashdata.entry_sig = entry_sig; dbus_g_type_map_value_iterate (value, marshal_map_entry, &hashdata); if (hashdata.err) { dbus_message_iter_abandon_container (iter, &arr_iter); goto lose; } else if (!dbus_message_iter_close_container (iter, &arr_iter)) { goto lose; } out: g_free (entry_sig); g_free (array_sig); return !hashdata.err; lose: hashdata.err = TRUE; goto out; } static gboolean marshal_struct (DBusMessageIter *iter, const GValue *value) { GType gtype; DBusMessageIter subiter; guint size, i; GValue val = {0,}; gtype = G_VALUE_TYPE (value); size = dbus_g_type_get_struct_size (gtype); if (!dbus_message_iter_open_container (iter, DBUS_TYPE_STRUCT, NULL, &subiter)) oom (); for (i = 0; i < size; i++) { g_value_init (&val, dbus_g_type_get_struct_member_type (G_VALUE_TYPE(value), i)); if (!dbus_g_type_struct_get_member (value, i, &val)) goto abandon; if (!_dbus_gvalue_marshal (&subiter, &val)) goto abandon; g_value_unset(&val); } return dbus_message_iter_close_container (iter, &subiter); abandon: dbus_message_iter_abandon_container (iter, &subiter); return FALSE; } static gboolean marshal_variant (DBusMessageIter *iter, const GValue *value) { GType value_gtype; DBusMessageIter subiter; char *variant_sig; GValue *real_value; gboolean ret = FALSE; real_value = g_value_get_boxed (value); value_gtype = G_VALUE_TYPE (real_value); variant_sig = _dbus_gvalue_to_signature (real_value); if (variant_sig == NULL) { g_warning ("Cannot marshal type \"%s\" in variant", g_type_name (value_gtype)); return FALSE; } if (!dbus_message_iter_open_container (iter, DBUS_TYPE_VARIANT, variant_sig, &subiter)) goto out; if (!_dbus_gvalue_marshal (&subiter, real_value)) { dbus_message_iter_abandon_container (iter, &subiter); goto out; } if (!dbus_message_iter_close_container (iter, &subiter)) goto out; ret = TRUE; out: g_free (variant_sig); return ret; } static DBusGValueMarshalFunc get_type_marshaller (GType type) { DBusGTypeMarshalData *typedata; typedata = g_type_get_qdata (type, dbus_g_type_metadata_data_quark ()); if (typedata == NULL) { if (g_type_is_a (type, G_TYPE_VALUE_ARRAY)) return marshal_valuearray; if (dbus_g_type_is_collection (type)) return marshal_collection; if (dbus_g_type_is_map (type)) return marshal_map; if (dbus_g_type_is_struct (type)) return marshal_struct; g_warning ("No marshaller registered for type \"%s\"", g_type_name (type)); return NULL; } g_assert (typedata->vtable); return typedata->vtable->marshaller; } typedef struct { DBusMessageIter *iter; DBusGValueMarshalFunc marshaller; gboolean err; } DBusGValueCollectionMarshalData; static void collection_marshal_iterator (const GValue *eltval, gpointer user_data) { DBusGValueCollectionMarshalData *data = user_data; if (data->err) return; if (!data->marshaller (data->iter, eltval)) data->err = TRUE; } static gboolean marshal_collection (DBusMessageIter *iter, const GValue *value) { GType coltype; GType subtype; coltype = G_VALUE_TYPE (value); subtype = dbus_g_type_get_collection_specialization (coltype); if (_dbus_g_type_is_fixed (subtype)) return marshal_collection_array (iter, value); else return marshal_collection_ptrarray (iter, value); } static gboolean marshal_collection_ptrarray (DBusMessageIter *iter, const GValue *value) { GType coltype; GType elt_gtype; DBusGValueCollectionMarshalData data; DBusMessageIter subiter; char *elt_sig; coltype = G_VALUE_TYPE (value); elt_gtype = dbus_g_type_get_collection_specialization (coltype); data.marshaller = get_type_marshaller (elt_gtype); if (!data.marshaller) return FALSE; elt_sig = _dbus_gtype_to_signature (elt_gtype); if (!elt_sig) { g_warning ("Cannot marshal type \"%s\" in collection\n", g_type_name (elt_gtype)); return FALSE; } g_assert (g_variant_is_signature (elt_sig)); if (!dbus_message_iter_open_container (iter, DBUS_TYPE_ARRAY, elt_sig, &subiter)) oom (); g_free (elt_sig); data.iter = &subiter; data.err = FALSE; dbus_g_type_collection_value_iterate (value, collection_marshal_iterator, &data); if (data.err) { dbus_message_iter_abandon_container (iter, &subiter); return FALSE; } return dbus_message_iter_close_container (iter, &subiter); } /* If any of these assertions are violated, then marshal_collection_array * is buggy for that type. dbus_g_value_basic_array_parse_variant() has * general size-conversion code, if needed. */ G_STATIC_ASSERT (sizeof (dbus_bool_t) == sizeof (gboolean)); G_STATIC_ASSERT (sizeof (dbus_int32_t) == sizeof (gint)); G_STATIC_ASSERT (sizeof (dbus_uint32_t) == sizeof (guint)); /* These should be true regardless, but just for completeness... */ G_STATIC_ASSERT (sizeof (dbus_int64_t) == sizeof (gint64)); G_STATIC_ASSERT (sizeof (dbus_uint64_t) == sizeof (guint64)); G_STATIC_ASSERT (sizeof (double) == sizeof (gdouble)); static gboolean marshal_collection_array (DBusMessageIter *iter, const GValue *value) { GType elt_gtype; DBusMessageIter subiter; GArray *array; char *subsignature_str; array = g_value_get_boxed (value); g_return_val_if_fail (array != NULL, FALSE); elt_gtype = dbus_g_type_get_collection_specialization (G_VALUE_TYPE (value)); g_assert (_dbus_g_type_is_fixed (elt_gtype)); subsignature_str = _dbus_gtype_to_signature (elt_gtype); if (!subsignature_str) { g_warning ("Cannot marshal type \"%s\" in collection\n", g_type_name (elt_gtype)); return FALSE; } g_assert (g_variant_is_signature (subsignature_str)); if (!dbus_message_iter_open_container (iter, DBUS_TYPE_ARRAY, subsignature_str, &subiter)) oom (); /* TODO - This assumes that basic values are the same size * is this always true? If it is we can probably avoid * a lot of the overhead in _marshal_basic_instance... */ if (!dbus_message_iter_append_fixed_array (&subiter, subsignature_str[0], &(array->data), array->len)) { g_critical ("Unable to serialize %u GArray members as signature %s " "(OOM or invalid boolean value?)", array->len, subsignature_str); g_free (subsignature_str); dbus_message_iter_abandon_container (iter, &subiter); return FALSE; } g_free (subsignature_str); return dbus_message_iter_close_container (iter, &subiter); } gboolean _dbus_gvalue_marshal (DBusMessageIter *iter, const GValue *value) { GType gtype; DBusGValueMarshalFunc marshaller; gtype = G_VALUE_TYPE (value); marshaller = get_type_marshaller (gtype); if (marshaller == NULL) return FALSE; return marshaller (iter, value); } #ifdef DBUS_BUILD_TESTS static void assert_type_maps_to (GType gtype, const char *expected_sig) { char *sig; sig = _dbus_gtype_to_signature (gtype); g_assert (sig != NULL); g_assert (!strcmp (expected_sig, sig)); g_free (sig); } static void assert_signature_maps_to (const char *sig, GType expected_gtype) { g_assert (_dbus_gtype_from_signature (sig, TRUE) == expected_gtype); } static void assert_bidirectional_mapping (GType gtype, const char *expected_sig) { assert_type_maps_to (gtype, expected_sig); assert_signature_maps_to (expected_sig, gtype); } /* * Unit test for general glib stuff * Returns: %TRUE on success. */ gboolean _dbus_gvalue_test (const char *test_data_dir) { _dbus_g_value_types_init (); assert_bidirectional_mapping (G_TYPE_STRING, DBUS_TYPE_STRING_AS_STRING); assert_bidirectional_mapping (G_TYPE_UCHAR, DBUS_TYPE_BYTE_AS_STRING); assert_bidirectional_mapping (G_TYPE_UINT, DBUS_TYPE_UINT32_AS_STRING); assert_bidirectional_mapping (dbus_g_type_get_map ("GHashTable", G_TYPE_STRING, G_TYPE_VALUE), DBUS_TYPE_ARRAY_AS_STRING DBUS_DICT_ENTRY_BEGIN_CHAR_AS_STRING DBUS_TYPE_STRING_AS_STRING DBUS_TYPE_VARIANT_AS_STRING DBUS_DICT_ENTRY_END_CHAR_AS_STRING); assert_bidirectional_mapping (dbus_g_type_get_collection ("GPtrArray", DBUS_TYPE_G_OBJECT_PATH), DBUS_TYPE_ARRAY_AS_STRING DBUS_TYPE_OBJECT_PATH_AS_STRING); assert_bidirectional_mapping (dbus_g_type_get_collection ("GArray", G_TYPE_INT), DBUS_TYPE_ARRAY_AS_STRING DBUS_TYPE_INT32_AS_STRING); assert_bidirectional_mapping (dbus_g_type_get_struct ("GValueArray", G_TYPE_INT, G_TYPE_STRING, DBUS_TYPE_G_OBJECT_PATH, G_TYPE_INVALID), DBUS_STRUCT_BEGIN_CHAR_AS_STRING DBUS_TYPE_INT32_AS_STRING DBUS_TYPE_STRING_AS_STRING DBUS_TYPE_OBJECT_PATH_AS_STRING DBUS_STRUCT_END_CHAR_AS_STRING ); return TRUE; } #endif /* DBUS_BUILD_TESTS */ dbus-glib-0.100.2/dbus/dbus-gproxy.c0000644000175000017500000026141312107524614014040 00000000000000/* -*- mode: C; c-file-style: "gnu" -*- */ /* dbus-gproxy.c Proxy for remote objects * * Copyright (C) 2003, 2004, 2005 Red Hat, Inc. * Copyright (C) 2005 Nokia * * Licensed under the Academic Free License version 2.1 * * 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 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * */ #include #include #include #include #include "dbus-gutils.h" #include "dbus-gsignature.h" #include "dbus-gvalue.h" #include "dbus-gvalue-utils.h" #include "dbus-gobject.h" #include #include #include #define DBUS_G_PROXY_CALL_TO_ID(x) (GPOINTER_TO_UINT(x)) #define DBUS_G_PROXY_ID_TO_CALL(x) (GUINT_TO_POINTER(x)) #define DBUS_G_PROXY_GET_PRIVATE(o) \ (G_TYPE_INSTANCE_GET_PRIVATE ((o), DBUS_TYPE_G_PROXY, DBusGProxyPrivate)) static void oom (void) G_GNUC_NORETURN; static void oom (void) { g_error ("no memory"); } typedef struct _DBusGProxyManager DBusGProxyManager; typedef struct _DBusGProxyPrivate DBusGProxyPrivate; struct _DBusGProxyPrivate { DBusGProxyManager *manager; /**< Proxy manager */ char *name; /**< Name messages go to or NULL */ char *path; /**< Path messages go to or NULL */ char *interface; /**< Interface messages go to or NULL */ DBusGProxyCall *name_call; /**< Pending call id to retrieve name owner */ guint for_owner : 1; /**< Whether or not this proxy is for a name owner */ guint associated : 1; /**< Whether or not this proxy is associated (for name proxies) */ /* FIXME: make threadsafe? */ guint call_id_counter; /**< Integer counter for pending calls */ GData *signal_signatures; /**< D-BUS signatures for each signal */ GHashTable *pending_calls; /**< Calls made on this proxy which have not yet returned */ int default_timeout; /**< Default timeout to use, see dbus_g_proxy_set_default_timeout */ }; static void dbus_g_proxy_init (DBusGProxy *proxy); static void dbus_g_proxy_class_init (DBusGProxyClass *klass); static GObject *dbus_g_proxy_constructor (GType type, guint n_construct_properties, GObjectConstructParam *construct_properties); static void dbus_g_proxy_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec); static void dbus_g_proxy_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec); static void dbus_g_proxy_finalize (GObject *object); static void dbus_g_proxy_dispose (GObject *object); static void dbus_g_proxy_destroy (DBusGProxy *proxy); static void dbus_g_proxy_emit_remote_signal (DBusGProxy *proxy, DBusMessage *message); static DBusGProxyCall *manager_begin_bus_call (DBusGProxyManager *manager, const char *method, DBusGProxyCallNotify notify, gpointer data, GDestroyNotify destroy, GType first_arg_type, ...); static guint dbus_g_proxy_begin_call_internal (DBusGProxy *proxy, const char *method, DBusGProxyCallNotify notify, gpointer data, GDestroyNotify destroy, GValueArray *args, int timeout ); static gboolean dbus_g_proxy_end_call_internal (DBusGProxy *proxy, guint call_id, GError **error, GType first_arg_type, va_list args); /* * A list of proxies with a given name+path+interface, used to * route incoming signals. */ typedef struct { GSList *proxies; /**< The list of proxies */ char name[4]; /**< name (empty string for none), nul byte, * path, nul byte, * interface, nul byte */ } DBusGProxyList; /* * DBusGProxyManager's primary task is to route signals to the proxies * those signals are emitted on. In order to do this it also has to * track the owners of the names proxies are bound to. */ struct _DBusGProxyManager { GStaticMutex lock; /**< Thread lock */ int refcount; /**< Reference count */ DBusConnection *connection; /**< Connection we're associated with. */ DBusGProxy *bus_proxy; /**< Special internal proxy used to talk to the bus */ GHashTable *proxy_lists; /**< Hash used to route incoming signals * and iterate over proxies * tristring -> DBusGProxyList */ GHashTable *owner_match_rules; /**< Hash to keep track of match rules of * NameOwnerChanged. * gchar *name -> guint *refcount */ GHashTable *owner_names; /**< Hash to keep track of mapping from * char * -> GSList of DBusGProxyNameOwnerInfo * base name -> [name,name,...] for proxies which * are for names. */ GSList *unassociated_proxies; /**< List of name proxies for which * there was no result for * GetNameOwner */ }; static DBusGProxyManager *dbus_g_proxy_manager_ref (DBusGProxyManager *manager); static DBusHandlerResult dbus_g_proxy_manager_filter (DBusConnection *connection, DBusMessage *message, void *user_data); /** Lock the DBusGProxyManager */ #define LOCK_MANAGER(mgr) (g_static_mutex_lock (&(mgr)->lock)) /** Unlock the DBusGProxyManager */ #define UNLOCK_MANAGER(mgr) (g_static_mutex_unlock (&(mgr)->lock)) static int g_proxy_manager_slot = -1; /* Lock controlling get/set manager as data on each connection */ static GStaticMutex connection_g_proxy_lock = G_STATIC_MUTEX_INIT; static DBusGProxyManager* dbus_g_proxy_manager_get (DBusConnection *connection) { DBusGProxyManager *manager; dbus_connection_allocate_data_slot (&g_proxy_manager_slot); if (g_proxy_manager_slot < 0) g_error ("out of memory"); g_static_mutex_lock (&connection_g_proxy_lock); manager = dbus_connection_get_data (connection, g_proxy_manager_slot); if (manager != NULL) { dbus_connection_free_data_slot (&g_proxy_manager_slot); dbus_g_proxy_manager_ref (manager); g_static_mutex_unlock (&connection_g_proxy_lock); return manager; } manager = g_new0 (DBusGProxyManager, 1); manager->refcount = 1; manager->connection = connection; g_static_mutex_init (&manager->lock); /* Proxy managers keep the connection alive, which means that * DBusGProxy indirectly does. To free a connection you have to free * all the proxies referring to it. */ dbus_connection_ref (manager->connection); dbus_connection_set_data (connection, g_proxy_manager_slot, manager, NULL); dbus_connection_add_filter (connection, dbus_g_proxy_manager_filter, manager, NULL); g_static_mutex_unlock (&connection_g_proxy_lock); return manager; } static DBusGProxyManager * dbus_g_proxy_manager_ref (DBusGProxyManager *manager) { g_assert (manager != NULL); g_assert (manager->refcount > 0); LOCK_MANAGER (manager); manager->refcount += 1; UNLOCK_MANAGER (manager); return manager; } static void dbus_g_proxy_manager_unref (DBusGProxyManager *manager) { g_assert (manager != NULL); g_assert (manager->refcount > 0); LOCK_MANAGER (manager); manager->refcount -= 1; if (manager->refcount == 0) { UNLOCK_MANAGER (manager); if (manager->bus_proxy) g_object_unref (manager->bus_proxy); if (manager->proxy_lists) { /* can't have any proxies left since they hold * a reference to the proxy manager. */ g_assert (g_hash_table_size (manager->proxy_lists) == 0); g_hash_table_destroy (manager->proxy_lists); manager->proxy_lists = NULL; } if (manager->owner_match_rules) { /* Since we destroyed all proxies, none can be tracking * name owners */ g_assert (g_hash_table_size (manager->owner_match_rules) == 0); g_hash_table_destroy (manager->owner_match_rules); manager->owner_match_rules = NULL; } if (manager->owner_names) { /* Since we destroyed all proxies, none can be tracking * name owners */ g_assert (g_hash_table_size (manager->owner_names) == 0); g_hash_table_destroy (manager->owner_names); manager->owner_names = NULL; } g_assert (manager->unassociated_proxies == NULL); g_static_mutex_free (&manager->lock); g_static_mutex_lock (&connection_g_proxy_lock); dbus_connection_remove_filter (manager->connection, dbus_g_proxy_manager_filter, manager); dbus_connection_set_data (manager->connection, g_proxy_manager_slot, NULL, NULL); g_static_mutex_unlock (&connection_g_proxy_lock); dbus_connection_unref (manager->connection); g_free (manager); dbus_connection_free_data_slot (&g_proxy_manager_slot); } else { UNLOCK_MANAGER (manager); } } static guint tristring_hash (gconstpointer key) { const char *p = key; guint h = *p; if (h) { for (p += 1; *p != '\0'; p++) h = (h << 5) - h + *p; } /* skip nul and do the next substring */ for (p += 1; *p != '\0'; p++) h = (h << 5) - h + *p; /* skip nul again and another substring */ for (p += 1; *p != '\0'; p++) h = (h << 5) - h + *p; return h; } static gboolean strequal_len (const char *a, const char *b, size_t *lenp) { size_t a_len; size_t b_len; a_len = strlen (a); b_len = strlen (b); if (a_len != b_len) return FALSE; if (memcmp (a, b, a_len) != 0) return FALSE; *lenp = a_len; return TRUE; } static gboolean tristring_equal (gconstpointer a, gconstpointer b) { const char *ap = a; const char *bp = b; size_t len; if (!strequal_len (ap, bp, &len)) return FALSE; ap += len + 1; bp += len + 1; if (!strequal_len (ap, bp, &len)) return FALSE; ap += len + 1; bp += len + 1; if (strcmp (ap, bp) != 0) return FALSE; return TRUE; } static char* tristring_alloc_from_strings (size_t padding_before, const char *name, const char *path, const char *interface) { size_t name_len, iface_len, path_len, len; char *tri; if (name) name_len = strlen (name); else name_len = 0; path_len = strlen (path); iface_len = strlen (interface); tri = g_malloc (padding_before + name_len + path_len + iface_len + 3); len = padding_before; if (name) memcpy (&tri[len], name, name_len); len += name_len; tri[len] = '\0'; len += 1; g_assert (len == (padding_before + name_len + 1)); memcpy (&tri[len], path, path_len); len += path_len; tri[len] = '\0'; len += 1; g_assert (len == (padding_before + name_len + path_len + 2)); memcpy (&tri[len], interface, iface_len); len += iface_len; tri[len] = '\0'; len += 1; g_assert (len == (padding_before + name_len + path_len + iface_len + 3)); return tri; } static char* tristring_from_proxy (DBusGProxy *proxy) { DBusGProxyPrivate *priv = DBUS_G_PROXY_GET_PRIVATE(proxy); return tristring_alloc_from_strings (0, priv->name, priv->path, priv->interface); } static char* tristring_from_message (DBusMessage *message) { const char *path; const char *interface; path = dbus_message_get_path (message); interface = dbus_message_get_interface (message); g_assert (path); g_assert (interface); return tristring_alloc_from_strings (0, dbus_message_get_sender (message), path, interface); } static DBusGProxyList* g_proxy_list_new (DBusGProxy *first_proxy) { DBusGProxyList *list; DBusGProxyPrivate *priv = DBUS_G_PROXY_GET_PRIVATE(first_proxy); list = (void*) tristring_alloc_from_strings (G_STRUCT_OFFSET (DBusGProxyList, name), priv->name, priv->path, priv->interface); list->proxies = NULL; return list; } static void g_proxy_list_free (DBusGProxyList *list) { /* we don't hold a reference to the proxies in the list, * as they ref the GProxyManager */ g_slist_free (list->proxies); g_free (list); } static char* g_proxy_get_signal_match_rule (DBusGProxy *proxy) { DBusGProxyPrivate *priv = DBUS_G_PROXY_GET_PRIVATE(proxy); /* FIXME Escaping is required here */ if (priv->name) return g_strdup_printf ("type='signal',sender='%s',path='%s',interface='%s'", priv->name, priv->path, priv->interface); else return g_strdup_printf ("type='signal',path='%s',interface='%s'", priv->path, priv->interface); } static char * get_owner_match_rule (const gchar *name) { return g_strdup_printf ("type='signal',sender='" DBUS_SERVICE_DBUS "',path='" DBUS_PATH_DBUS "',interface='" DBUS_INTERFACE_DBUS "',member='NameOwnerChanged'" ",arg0='%s'", name); } typedef struct { char *name; guint refcount; } DBusGProxyNameOwnerInfo; static gint find_name_in_info (gconstpointer a, gconstpointer b) { const DBusGProxyNameOwnerInfo *info = a; const char *name = b; return strcmp (info->name, name); } typedef struct { const char *name; const char *owner; DBusGProxyNameOwnerInfo *info; } DBusGProxyNameOwnerForeachData; static void name_owner_foreach (gpointer key, gpointer val, gpointer data) { const char *owner; DBusGProxyNameOwnerForeachData *foreach_data; GSList *names; GSList *link; owner = key; names = val; foreach_data = data; if (foreach_data->owner != NULL) return; g_assert (foreach_data->info == NULL); link = g_slist_find_custom (names, foreach_data->name, find_name_in_info); if (link) { foreach_data->owner = owner; foreach_data->info = link->data; } } static gboolean dbus_g_proxy_manager_lookup_name_owner (DBusGProxyManager *manager, const char *name, DBusGProxyNameOwnerInfo **info, const char **owner) { DBusGProxyNameOwnerForeachData foreach_data; foreach_data.name = name; foreach_data.owner = NULL; foreach_data.info = NULL; g_hash_table_foreach (manager->owner_names, name_owner_foreach, &foreach_data); *info = foreach_data.info; *owner = foreach_data.owner; return *info != NULL; } static void insert_nameinfo (DBusGProxyManager *manager, const char *owner, DBusGProxyNameOwnerInfo *info) { GSList *names; gboolean insert; names = g_hash_table_lookup (manager->owner_names, owner); /* Only need to g_hash_table_insert the first time */ insert = (names == NULL); names = g_slist_append (names, info); if (insert) g_hash_table_insert (manager->owner_names, g_strdup (owner), names); } static void dbus_g_proxy_manager_monitor_name_owner (DBusGProxyManager *manager, const char *owner, const char *name) { GSList *names; GSList *link; DBusGProxyNameOwnerInfo *nameinfo; names = g_hash_table_lookup (manager->owner_names, owner); link = g_slist_find_custom (names, name, find_name_in_info); if (!link) { nameinfo = g_new0 (DBusGProxyNameOwnerInfo, 1); nameinfo->name = g_strdup (name); nameinfo->refcount = 1; insert_nameinfo (manager, owner, nameinfo); } else { nameinfo = link->data; nameinfo->refcount++; } } static void dbus_g_proxy_manager_unmonitor_name_owner (DBusGProxyManager *manager, const char *name) { DBusGProxyNameOwnerInfo *info; const char *owner; gboolean ret; ret = dbus_g_proxy_manager_lookup_name_owner (manager, name, &info, &owner); g_assert (ret); g_assert (info != NULL); g_assert (owner != NULL); info->refcount--; if (info->refcount == 0) { GSList *names; GSList *link; names = g_hash_table_lookup (manager->owner_names, owner); link = g_slist_find_custom (names, name, find_name_in_info); names = g_slist_delete_link (names, link); if (names != NULL) g_hash_table_insert (manager->owner_names, g_strdup (owner), names); else g_hash_table_remove (manager->owner_names, owner); g_free (info->name); g_free (info); } } typedef struct { const char *name; GSList *destroyed; } DBusGProxyUnassociateData; static void unassociate_proxies (gpointer key, gpointer val, gpointer user_data) { DBusGProxyList *list; const char *name; GSList *tmp; DBusGProxyUnassociateData *data; list = val; data = user_data; name = data->name; for (tmp = list->proxies; tmp; tmp = tmp->next) { DBusGProxy *proxy = DBUS_G_PROXY (tmp->data); DBusGProxyPrivate *priv = DBUS_G_PROXY_GET_PRIVATE(proxy); DBusGProxyManager *manager; manager = priv->manager; if (priv->name != NULL && !strcmp (priv->name, name)) { if (!priv->for_owner) { /* If a service appeared and then vanished very quickly, * it's conceivable we have an inflight request for * GetNameOwner here. Cancel it. * https://bugs.freedesktop.org/show_bug.cgi?id=18573 */ if (priv->name_call) dbus_g_proxy_cancel_call (manager->bus_proxy, priv->name_call); priv->name_call = NULL; priv->associated = FALSE; manager->unassociated_proxies = g_slist_prepend (manager->unassociated_proxies, proxy); } else { data->destroyed = g_slist_prepend (data->destroyed, proxy); /* make contents of list into weak pointers in case the objects * unref each other when disposing */ g_object_add_weak_pointer (G_OBJECT (proxy), &(data->destroyed->data)); } } } } static void dbus_g_proxy_manager_replace_name_owner (DBusGProxyManager *manager, const char *name, const char *prev_owner, const char *new_owner) { GSList *names; if (prev_owner[0] == '\0') { GSList *tmp; GSList *removed; /* We have a new service, look at unassociated proxies */ removed = NULL; for (tmp = manager->unassociated_proxies; tmp ; tmp = tmp->next) { DBusGProxy *proxy = tmp->data; DBusGProxyPrivate *priv = DBUS_G_PROXY_GET_PRIVATE(proxy); if (!strcmp (priv->name, name)) { removed = g_slist_prepend (removed, tmp); dbus_g_proxy_manager_monitor_name_owner (manager, new_owner, name); priv->associated = TRUE; } } for (tmp = removed; tmp; tmp = tmp->next) manager->unassociated_proxies = g_slist_delete_link (manager->unassociated_proxies, tmp->data); g_slist_free (removed); } else { DBusGProxyNameOwnerInfo *info; GSList *link; /* Name owner changed or deleted */ names = g_hash_table_lookup (manager->owner_names, prev_owner); info = NULL; if (names != NULL) { link = g_slist_find_custom (names, name, find_name_in_info); if (link != NULL) { info = link->data; names = g_slist_delete_link (names, link); if (names == NULL) { g_hash_table_remove (manager->owner_names, prev_owner); } else { g_hash_table_insert (manager->owner_names, g_strdup (prev_owner), names); } } } if (new_owner[0] == '\0') { DBusGProxyUnassociateData data; GSList *tmp; data.name = name; data.destroyed = NULL; /* A service went away, we need to unassociate proxies */ g_hash_table_foreach (manager->proxy_lists, unassociate_proxies, &data); UNLOCK_MANAGER (manager); /* the destroyed list's data pointers are weak pointers, so that we * don't end up calling destroy on proxies which have already been * freed up as a result of other ones being destroyed */ for (tmp = data.destroyed; tmp; tmp = tmp->next) if (tmp->data != NULL) { g_object_remove_weak_pointer (G_OBJECT (tmp->data), &(tmp->data)); dbus_g_proxy_destroy (tmp->data); } g_slist_free (data.destroyed); LOCK_MANAGER (manager); if (info) { g_free (info->name); g_free (info); } } else if (info) { insert_nameinfo (manager, new_owner, info); } } } static void got_name_owner_cb (DBusGProxy *bus_proxy, DBusGProxyCall *call, void *user_data) { DBusGProxy *proxy = user_data; DBusGProxyPrivate *priv = DBUS_G_PROXY_GET_PRIVATE(proxy); GError *error; char *owner; error = NULL; owner = NULL; LOCK_MANAGER (priv->manager); if (!dbus_g_proxy_end_call (bus_proxy, call, &error, G_TYPE_STRING, &owner, G_TYPE_INVALID)) { if (error->domain == DBUS_GERROR && error->code == DBUS_GERROR_NAME_HAS_NO_OWNER) { priv->manager->unassociated_proxies = g_slist_prepend (priv->manager->unassociated_proxies, proxy); } else if (error->domain == DBUS_GERROR && error->code == DBUS_GERROR_REMOTE_EXCEPTION) g_warning ("Couldn't get name owner (%s): %s", dbus_g_error_get_name (error), error->message); else g_warning ("Couldn't get name owner (code %d): %s", error->code, error->message); g_clear_error (&error); goto out; } else { dbus_g_proxy_manager_monitor_name_owner (priv->manager, owner, priv->name); priv->associated = TRUE; } out: priv->name_call = NULL; UNLOCK_MANAGER (priv->manager); g_free (owner); } static char * get_name_owner (DBusConnection *connection, const char *name, GError **error) { DBusError derror; DBusMessage *request, *reply; char *base_name; dbus_error_init (&derror); base_name = NULL; reply = NULL; request = dbus_message_new_method_call (DBUS_SERVICE_DBUS, DBUS_PATH_DBUS, DBUS_INTERFACE_DBUS, "GetNameOwner"); if (request == NULL) g_error ("Out of memory"); if (!dbus_message_append_args (request, DBUS_TYPE_STRING, &name, DBUS_TYPE_INVALID)) g_error ("Out of memory"); reply = dbus_connection_send_with_reply_and_block (connection, request, 2000, &derror); if (reply == NULL) goto error; if (dbus_set_error_from_message (&derror, reply)) goto error; if (!dbus_message_get_args (reply, &derror, DBUS_TYPE_STRING, &base_name, DBUS_TYPE_INVALID)) goto error; base_name = g_strdup (base_name); goto out; error: g_assert (dbus_error_is_set (&derror)); dbus_set_g_error (error, &derror); dbus_error_free (&derror); out: if (request) dbus_message_unref (request); if (reply) dbus_message_unref (reply); return base_name; } static void guint_slice_free (gpointer data) { g_slice_free (guint, data); } static void dbus_g_proxy_manager_register (DBusGProxyManager *manager, DBusGProxy *proxy) { DBusGProxyList *list; DBusGProxyPrivate *priv = DBUS_G_PROXY_GET_PRIVATE(proxy); LOCK_MANAGER (manager); if (manager->proxy_lists == NULL) { g_assert (manager->owner_names == NULL); g_assert (manager->owner_match_rules == NULL); list = NULL; manager->proxy_lists = g_hash_table_new_full (tristring_hash, tristring_equal, NULL, (GFreeFunc) g_proxy_list_free); manager->owner_names = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL); manager->owner_match_rules = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, guint_slice_free); } else { char *tri; tri = tristring_from_proxy (proxy); list = g_hash_table_lookup (manager->proxy_lists, tri); g_free (tri); } if (list == NULL) { list = g_proxy_list_new (proxy); g_hash_table_replace (manager->proxy_lists, list->name, list); } if (list->proxies == NULL && priv->name) { /* We have to add match rules to the server, * but only if the server is a message bus, * not if it's a peer. */ char *rule; guint *refcount; rule = g_proxy_get_signal_match_rule (proxy); /* We don't check for errors; it's not like anyone would handle them, and * we don't want a round trip here. */ dbus_bus_add_match (manager->connection, rule, NULL); g_free (rule); refcount = g_hash_table_lookup (manager->owner_match_rules, priv->name); if (refcount != NULL) { g_assert (*refcount != 0); g_assert (*refcount < G_MAXUINT); (*refcount)++; } else { char *rule; rule = get_owner_match_rule (priv->name); dbus_bus_add_match (manager->connection, rule, NULL); g_free (rule); refcount = g_slice_new (guint); *refcount = 1; g_hash_table_insert (manager->owner_match_rules, g_strdup (priv->name), refcount); } } g_assert (g_slist_find (list->proxies, proxy) == NULL); list->proxies = g_slist_prepend (list->proxies, proxy); if (!priv->for_owner) { const char *owner; DBusGProxyNameOwnerInfo *info; if (!dbus_g_proxy_manager_lookup_name_owner (manager, priv->name, &info, &owner)) { priv->name_call = manager_begin_bus_call (manager, "GetNameOwner", got_name_owner_cb, proxy, NULL, G_TYPE_STRING, priv->name, G_TYPE_INVALID); priv->associated = FALSE; } else { info->refcount++; priv->associated = TRUE; } } UNLOCK_MANAGER (manager); } static void dbus_g_proxy_manager_unregister (DBusGProxyManager *manager, DBusGProxy *proxy) { DBusGProxyList *list; DBusGProxyPrivate *priv = DBUS_G_PROXY_GET_PRIVATE(proxy); char *tri; LOCK_MANAGER (manager); #ifndef G_DISABLE_CHECKS if (manager->proxy_lists == NULL) { g_warning ("Trying to unregister a proxy but there aren't any registered"); return; } #endif tri = tristring_from_proxy (proxy); list = g_hash_table_lookup (manager->proxy_lists, tri); #ifndef G_DISABLE_CHECKS if (list == NULL) { g_warning ("Trying to unregister a proxy but it isn't registered"); return; } #endif g_assert (g_slist_find (list->proxies, proxy) != NULL); list->proxies = g_slist_remove (list->proxies, proxy); g_assert (g_slist_find (list->proxies, proxy) == NULL); if (!priv->for_owner) { if (!priv->associated) { GSList *link; if (priv->name_call != 0) { dbus_g_proxy_cancel_call (manager->bus_proxy, priv->name_call); priv->name_call = 0; } else { link = g_slist_find (manager->unassociated_proxies, proxy); if (link != NULL) { manager->unassociated_proxies = g_slist_delete_link ( manager->unassociated_proxies, link); } } } else { g_assert (priv->name_call == 0); dbus_g_proxy_manager_unmonitor_name_owner (manager, priv->name); } } if (list->proxies == NULL) { char *rule; g_hash_table_remove (manager->proxy_lists, tri); rule = g_proxy_get_signal_match_rule (proxy); dbus_bus_remove_match (manager->connection, rule, NULL); g_free (rule); if (priv->name) { guint *refcount; refcount = g_hash_table_lookup (manager->owner_match_rules, priv->name); (*refcount)--; if (*refcount == 0) { rule = get_owner_match_rule (priv->name); dbus_bus_remove_match (manager->connection, rule, NULL); g_free (rule); g_hash_table_remove (manager->owner_match_rules, priv->name); } } } if (g_hash_table_size (manager->proxy_lists) == 0) { g_hash_table_destroy (manager->proxy_lists); manager->proxy_lists = NULL; } if (manager->owner_match_rules != NULL && g_hash_table_size (manager->owner_match_rules) == 0) { g_hash_table_destroy (manager->owner_match_rules); manager->owner_match_rules = NULL; } g_free (tri); UNLOCK_MANAGER (manager); } static void list_proxies_foreach (gpointer key, gpointer value, gpointer user_data) { DBusGProxyList *list; GSList **ret; GSList *tmp; list = value; ret = user_data; tmp = list->proxies; while (tmp != NULL) { DBusGProxy *proxy = DBUS_G_PROXY (tmp->data); g_object_ref (proxy); *ret = g_slist_prepend (*ret, proxy); tmp = tmp->next; } } static GSList* dbus_g_proxy_manager_list_all (DBusGProxyManager *manager) { GSList *ret; ret = NULL; if (manager->proxy_lists) { g_hash_table_foreach (manager->proxy_lists, list_proxies_foreach, &ret); } return ret; } static DBusHandlerResult dbus_g_proxy_manager_filter (DBusConnection *connection, DBusMessage *message, void *user_data) { DBusGProxyManager *manager; if (dbus_message_get_type (message) != DBUS_MESSAGE_TYPE_SIGNAL) return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; manager = user_data; dbus_g_proxy_manager_ref (manager); LOCK_MANAGER (manager); if (dbus_message_is_signal (message, DBUS_INTERFACE_LOCAL, "Disconnected")) { /* Destroy all the proxies, quite possibly resulting in unreferencing * the proxy manager and the connection as well. */ GSList *all; GSList *tmp; all = dbus_g_proxy_manager_list_all (manager); tmp = all; while (tmp != NULL) { DBusGProxy *proxy; proxy = DBUS_G_PROXY (tmp->data); UNLOCK_MANAGER (manager); dbus_g_proxy_destroy (proxy); g_object_unref (G_OBJECT (proxy)); LOCK_MANAGER (manager); tmp = tmp->next; } g_slist_free (all); #ifndef G_DISABLE_CHECKS if (manager->proxy_lists != NULL) g_warning ("Disconnection emitted \"destroy\" on all DBusGProxy, but somehow new proxies were created in response to one of those destroy signals. This will cause a memory leak."); #endif } else { char *tri; GSList *full_list; GSList *owned_names; GSList *tmp; const char *sender; sender = dbus_message_get_sender (message); /* First we handle NameOwnerChanged internally */ if (g_strcmp0 (sender, DBUS_SERVICE_DBUS) == 0 && dbus_message_is_signal (message, DBUS_INTERFACE_DBUS, "NameOwnerChanged")) { const char *name; const char *prev_owner; const char *new_owner; DBusError derr; dbus_error_init (&derr); if (!dbus_message_get_args (message, &derr, DBUS_TYPE_STRING, &name, DBUS_TYPE_STRING, &prev_owner, DBUS_TYPE_STRING, &new_owner, DBUS_TYPE_INVALID)) { /* Ignore this error */ dbus_error_free (&derr); } else if (manager->owner_names != NULL) { dbus_g_proxy_manager_replace_name_owner (manager, name, prev_owner, new_owner); } } /* dbus spec requires these, libdbus validates */ g_assert (dbus_message_get_path (message) != NULL); g_assert (dbus_message_get_interface (message) != NULL); g_assert (dbus_message_get_member (message) != NULL); tri = tristring_from_message (message); if (manager->proxy_lists) { DBusGProxyList *owner_list; owner_list = g_hash_table_lookup (manager->proxy_lists, tri); if (owner_list) full_list = g_slist_copy (owner_list->proxies); else full_list = NULL; } else full_list = NULL; g_free (tri); if (manager->owner_names && sender) { owned_names = g_hash_table_lookup (manager->owner_names, sender); for (tmp = owned_names; tmp; tmp = tmp->next) { DBusGProxyList *owner_list; DBusGProxyNameOwnerInfo *nameinfo; nameinfo = tmp->data; g_assert (nameinfo->refcount > 0); tri = tristring_alloc_from_strings (0, nameinfo->name, dbus_message_get_path (message), dbus_message_get_interface (message)); owner_list = g_hash_table_lookup (manager->proxy_lists, tri); if (owner_list != NULL) { GSList *elt; /* Ignore duplicates when adding to full_list */ for (elt = owner_list->proxies; elt; elt = g_slist_next (elt)) { if (!g_slist_find (full_list, elt->data)) full_list = g_slist_append (full_list, elt->data); } } g_free (tri); } } #if 0 g_print ("proxy got %s,%s,%s = list %p\n", tri, tri + strlen (tri) + 1, tri + strlen (tri) + 1 + strlen (tri + strlen (tri) + 1) + 1, list); #endif /* Emit the signal */ g_slist_foreach (full_list, (GFunc) g_object_ref, NULL); for (tmp = full_list; tmp; tmp = tmp->next) { DBusGProxy *proxy; proxy = DBUS_G_PROXY (tmp->data); UNLOCK_MANAGER (manager); dbus_g_proxy_emit_remote_signal (proxy, message); g_object_unref (G_OBJECT (proxy)); LOCK_MANAGER (manager); } g_slist_free (full_list); } UNLOCK_MANAGER (manager); dbus_g_proxy_manager_unref (manager); /* "Handling" signals doesn't make sense, they are for everyone * who cares */ return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; } /* ---------- DBusGProxy -------------- */ #define DBUS_G_PROXY_DESTROYED(proxy) (DBUS_G_PROXY_GET_PRIVATE(proxy)->manager == NULL) static void marshal_dbus_message_to_g_marshaller (GClosure *closure, GValue *return_value, guint n_param_values, const GValue *param_values, gpointer invocation_hint, gpointer marshal_data); enum { PROP_0, PROP_NAME, PROP_PATH, PROP_INTERFACE, PROP_CONNECTION }; enum { DESTROY, RECEIVED, LAST_SIGNAL }; static void *parent_class; static guint signals[LAST_SIGNAL] = { 0 }; static void dbus_g_proxy_init (DBusGProxy *proxy) { DBusGProxyPrivate *priv = DBUS_G_PROXY_GET_PRIVATE(proxy); g_datalist_init (&priv->signal_signatures); priv->pending_calls = g_hash_table_new_full (NULL, NULL, NULL, (GDestroyNotify) dbus_pending_call_unref); priv->name_call = 0; priv->associated = FALSE; priv->default_timeout = -1; } static GObject * dbus_g_proxy_constructor (GType type, guint n_construct_properties, GObjectConstructParam *construct_properties) { DBusGProxy *proxy; DBusGProxyClass *klass; GObjectClass *parent_class; DBusGProxyPrivate *priv; klass = DBUS_G_PROXY_CLASS (g_type_class_peek (DBUS_TYPE_G_PROXY)); parent_class = G_OBJECT_CLASS (g_type_class_peek_parent (klass)); proxy = DBUS_G_PROXY (parent_class->constructor (type, n_construct_properties, construct_properties)); priv = DBUS_G_PROXY_GET_PRIVATE (proxy); /* if these assertions fail, a deriving class has not set our required * parameters - our own public constructors do return_if_fail checks * on these parameters being provided. unfortunately we can't assert * for manager because it's allowed to be NULL when tha mangager is * setting up a bus proxy for its own calls */ g_assert (priv->path != NULL); g_assert (priv->interface != NULL); if (priv->manager != NULL) { dbus_g_proxy_manager_register (priv->manager, proxy); } return G_OBJECT (proxy); } static void dbus_g_proxy_class_init (DBusGProxyClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); parent_class = g_type_class_peek_parent (klass); g_type_class_add_private (klass, sizeof (DBusGProxyPrivate)); object_class->set_property = dbus_g_proxy_set_property; object_class->get_property = dbus_g_proxy_get_property; g_object_class_install_property (object_class, PROP_NAME, g_param_spec_string ("name", "name", "name", NULL, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); g_object_class_install_property (object_class, PROP_PATH, g_param_spec_string ("path", "path", "path", NULL, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); g_object_class_install_property (object_class, PROP_INTERFACE, g_param_spec_string ("interface", "interface", "interface", NULL, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); g_object_class_install_property (object_class, PROP_CONNECTION, g_param_spec_boxed ("connection", "connection", "connection", DBUS_TYPE_G_CONNECTION, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); object_class->finalize = dbus_g_proxy_finalize; object_class->dispose = dbus_g_proxy_dispose; object_class->constructor = dbus_g_proxy_constructor; signals[DESTROY] = g_signal_new ("destroy", G_OBJECT_CLASS_TYPE (object_class), G_SIGNAL_RUN_CLEANUP | G_SIGNAL_NO_RECURSE | G_SIGNAL_NO_HOOKS, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0); signals[RECEIVED] = g_signal_new ("received", G_OBJECT_CLASS_TYPE (object_class), G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED, 0, NULL, NULL, marshal_dbus_message_to_g_marshaller, G_TYPE_NONE, 2, DBUS_TYPE_MESSAGE, G_TYPE_POINTER); } static gboolean cancel_pending_call (gpointer key, gpointer val, gpointer data) { DBusPendingCall *pending = val; dbus_pending_call_cancel (pending); return TRUE; } static void dbus_g_proxy_dispose (GObject *object) { DBusGProxy *proxy = DBUS_G_PROXY (object); DBusGProxyPrivate *priv = DBUS_G_PROXY_GET_PRIVATE(proxy); if (priv->pending_calls == NULL) { return; } /* Cancel outgoing pending calls */ g_hash_table_foreach_remove (priv->pending_calls, cancel_pending_call, NULL); g_hash_table_destroy (priv->pending_calls); priv->pending_calls = NULL; if (priv->manager && proxy != priv->manager->bus_proxy) { dbus_g_proxy_manager_unregister (priv->manager, proxy); dbus_g_proxy_manager_unref (priv->manager); } priv->manager = NULL; g_datalist_clear (&priv->signal_signatures); g_signal_emit (object, signals[DESTROY], 0); G_OBJECT_CLASS (parent_class)->dispose (object); } static void dbus_g_proxy_finalize (GObject *object) { DBusGProxy *proxy = DBUS_G_PROXY (object); DBusGProxyPrivate *priv = DBUS_G_PROXY_GET_PRIVATE(proxy); g_return_if_fail (DBUS_G_PROXY_DESTROYED (proxy)); g_free (priv->name); g_free (priv->path); g_free (priv->interface); G_OBJECT_CLASS (parent_class)->finalize (object); } static void dbus_g_proxy_destroy (DBusGProxy *proxy) { /* FIXME do we need the GTK_IN_DESTRUCTION style flag * from GtkObject? */ g_object_run_dispose (G_OBJECT (proxy)); } static void dbus_g_proxy_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) { DBusGProxy *proxy = DBUS_G_PROXY (object); DBusGProxyPrivate *priv = DBUS_G_PROXY_GET_PRIVATE(proxy); DBusGConnection *connection; switch (prop_id) { case PROP_NAME: priv->name = g_strdup (g_value_get_string (value)); if (priv->name) priv->for_owner = (priv->name[0] == ':'); else priv->for_owner = TRUE; break; case PROP_PATH: priv->path = g_strdup (g_value_get_string (value)); break; case PROP_INTERFACE: priv->interface = g_strdup (g_value_get_string (value)); break; case PROP_CONNECTION: connection = g_value_get_boxed (value); if (connection != NULL) { priv->manager = dbus_g_proxy_manager_get (DBUS_CONNECTION_FROM_G_CONNECTION (connection)); } break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } } static void dbus_g_proxy_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) { DBusGProxy *proxy = DBUS_G_PROXY (object); DBusGProxyPrivate *priv = DBUS_G_PROXY_GET_PRIVATE(proxy); switch (prop_id) { case PROP_NAME: g_value_set_string (value, priv->name); break; case PROP_PATH: g_value_set_string (value, priv->path); break; case PROP_INTERFACE: g_value_set_string (value, priv->interface); break; case PROP_CONNECTION: g_value_set_boxed (value, DBUS_G_CONNECTION_FROM_CONNECTION(priv->manager->connection)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } } /* this is to avoid people using g_signal_connect() directly, * to avoid confusion with local signal names, and because * of the horribly broken current setup (signals are added * globally to all proxies) */ static char* create_signal_name (const char *interface, const char *signal) { GString *str; char *p; str = g_string_new (interface); g_string_append (str, "-"); g_string_append (str, signal); /* GLib will silently barf on '.' in signal names */ p = str->str; while (*p) { if (*p == '.') *p = '-'; ++p; } return g_string_free (str, FALSE); } static void marshal_dbus_message_to_g_marshaller (GClosure *closure, GValue *return_value, guint n_param_values, const GValue *param_values, gpointer invocation_hint, gpointer marshal_data) { /* Incoming here we have three params, the instance (Proxy), the * DBusMessage, the signature. We want to convert that to an * expanded GValue array, then call an appropriate normal GLib * marshaller. */ #define MAX_SIGNATURE_ARGS 20 GValueArray *value_array; GSignalCMarshaller c_marshaller; DBusGProxy *proxy; DBusMessage *message; GArray *gsignature; const GType *types; DBusGProxyPrivate *priv; g_assert (n_param_values == 3); proxy = g_value_get_object (¶m_values[0]); message = g_value_get_boxed (¶m_values[1]); gsignature = g_value_get_pointer (¶m_values[2]); g_return_if_fail (DBUS_IS_G_PROXY (proxy)); g_return_if_fail (message != NULL); g_return_if_fail (gsignature != NULL); priv = DBUS_G_PROXY_GET_PRIVATE(proxy); c_marshaller = _dbus_gobject_lookup_marshaller (G_TYPE_NONE, gsignature->len, (GType*) gsignature->data); g_return_if_fail (c_marshaller != NULL); { DBusGValueMarshalCtx context; context.recursion_depth = 0; context.gconnection = DBUS_G_CONNECTION_FROM_CONNECTION (priv->manager->connection); context.proxy = proxy; types = (const GType*) gsignature->data; value_array = _dbus_gvalue_demarshal_message (&context, message, gsignature->len, types, NULL); } if (value_array == NULL) return; g_value_array_prepend (value_array, NULL); g_value_init (g_value_array_get_nth (value_array, 0), G_TYPE_FROM_INSTANCE (proxy)); g_value_set_instance (g_value_array_get_nth (value_array, 0), proxy); (* c_marshaller) (closure, return_value, value_array->n_values, value_array->values, invocation_hint, marshal_data); g_value_array_free (value_array); } static void dbus_g_proxy_emit_remote_signal (DBusGProxy *proxy, DBusMessage *message) { const char *interface; const char *signal; char *name; GQuark q; DBusGProxyPrivate *priv = DBUS_G_PROXY_GET_PRIVATE(proxy); GArray *msg_gsignature = NULL; g_return_if_fail (!DBUS_G_PROXY_DESTROYED (proxy)); interface = dbus_message_get_interface (message); signal = dbus_message_get_member (message); g_assert (interface != NULL); g_assert (signal != NULL); name = create_signal_name (interface, signal); /* If the quark isn't preexisting, there's no way there * are any handlers connected. We don't want to create * extra quarks for every possible signal. */ q = g_quark_try_string (name); if (q != 0) { GArray *gsignature; guint i; gsignature = g_datalist_id_get_data (&priv->signal_signatures, q); if (gsignature == NULL) goto out; msg_gsignature = _dbus_gtypes_from_arg_signature (dbus_message_get_signature (message), TRUE); for (i = 0; i < gsignature->len; i++) { if (msg_gsignature->len == i || g_array_index (gsignature, GType, i) != g_array_index (msg_gsignature, GType, i)) goto mismatch; } if (msg_gsignature->len != i) goto mismatch; g_signal_emit (proxy, signals[RECEIVED], q, message, msg_gsignature); } out: g_free (name); if (msg_gsignature) g_array_free (msg_gsignature, TRUE); return; mismatch: #if 0 /* Don't spew on remote errors */ g_warning ("Unexpected message signature '%s' for signal '%s'\n", dbus_message_get_signature (message), name); #endif goto out; } /** * DBusGProxyCallNotify: * @proxy: the proxy on which the method was called * @call_id: the call in progress * @user_data: data passed to dbus_g_proxy_begin_call() or similar * * Called when a reply to the call represented by @call_id arrives. * Use dbus_g_proxy_end_call() to see whether @call_id succeeded or * failed, and get the arguments returned (if any) on success. */ typedef struct { DBusGProxy *proxy; guint call_id; DBusGProxyCallNotify func; void *data; GDestroyNotify free_data_func; } GPendingNotifyClosure; static void d_pending_call_notify (DBusPendingCall *dcall, void *data) { GPendingNotifyClosure *closure = data; (* closure->func) (closure->proxy, DBUS_G_PROXY_ID_TO_CALL (closure->call_id), closure->data); } static void d_pending_call_free (void *data) { GPendingNotifyClosure *closure = data; if (closure->free_data_func) (* closure->free_data_func) (closure->data); g_free (closure); } #define DBUS_G_VALUE_ARRAY_COLLECT_ALL(VALARRAY, FIRST_ARG_TYPE, ARGS) \ G_STMT_START { \ GType valtype; \ guint i = 0; \ \ VALARRAY = g_value_array_new (6); \ valtype = FIRST_ARG_TYPE; \ \ while (valtype != G_TYPE_INVALID) \ { \ gchar *collect_err; \ GValue *val; \ \ g_value_array_append (VALARRAY, NULL); \ val = g_value_array_get_nth (VALARRAY, i); \ g_value_init (val, valtype); \ collect_err = NULL; \ G_VALUE_COLLECT (val, ARGS, G_VALUE_NOCOPY_CONTENTS, &collect_err); \ \ if (collect_err) \ { \ g_critical ("%s: unable to collect argument %u: %s", \ G_STRFUNC, i, collect_err); \ g_free (collect_err); \ g_value_array_free (VALARRAY); \ VALARRAY = NULL; \ break; \ } \ \ valtype = va_arg (ARGS, GType); \ i++; \ } \ } G_STMT_END DBusGProxyCall * manager_begin_bus_call (DBusGProxyManager *manager, const char *method, DBusGProxyCallNotify notify, gpointer user_data, GDestroyNotify destroy, GType first_arg_type, ...) { guint call_id = 0; DBusGProxyPrivate *priv; va_list args; GValueArray *arg_values; va_start (args, first_arg_type); if (!manager->bus_proxy) { manager->bus_proxy = g_object_new (DBUS_TYPE_G_PROXY, "name", DBUS_SERVICE_DBUS, "path", DBUS_PATH_DBUS, "interface", DBUS_INTERFACE_DBUS, NULL); priv = DBUS_G_PROXY_GET_PRIVATE(manager->bus_proxy); priv->manager = manager; } DBUS_G_VALUE_ARRAY_COLLECT_ALL (arg_values, first_arg_type, args); if (arg_values != NULL) { call_id = dbus_g_proxy_begin_call_internal (manager->bus_proxy, method, notify, user_data, destroy, arg_values, -1); g_value_array_free (arg_values); } va_end (args); return DBUS_G_PROXY_ID_TO_CALL (call_id); } /** * SECTION:dbus-gproxy * @short_description: DBus Proxy * @see_also: #DBusGProxy * @stability: Stable * * A #DBusGProxy is a #GObject representing a remote object in a D-Bus * service. */ /** * DBusGProxy: * * A #GObject representing a remote object in a D-Bus service. */ /** * DBusGProxyCall: * * An opaque pointer representing an asynchronous call in progress. */ /* * dbus_g_proxy_get_type: * Standard GObject get_type() function for DBusGProxy. * * Returns: type ID for DBusGProxy class */ GType dbus_g_proxy_get_type (void) { static GType object_type = 0; if (!object_type) { static const GTypeInfo object_info = { sizeof (DBusGProxyClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dbus_g_proxy_class_init, NULL, /* class_finalize */ NULL, /* class_data */ sizeof (DBusGProxy), 0, /* n_preallocs */ (GInstanceInitFunc) dbus_g_proxy_init, }; object_type = g_type_register_static (G_TYPE_OBJECT, "DBusGProxy", &object_info, 0); } return object_type; } static DBusGProxy* dbus_g_proxy_new (DBusGConnection *connection, const char *name, const char *path_name, const char *interface_name) { DBusGProxy *proxy; g_assert (connection != NULL); proxy = g_object_new (DBUS_TYPE_G_PROXY, "name", name, "path", path_name, "interface", interface_name, "connection", connection, NULL); return proxy; } /** * dbus_g_proxy_new_for_name: * @connection: the connection to the remote bus * @name: any name on the message bus * @path: name of the object instance to call methods on * @iface: name of the interface to call methods on * * Creates a new proxy for a remote interface exported by a connection * on a message bus. Method calls and signal connections over this * proxy will go to the name owner; the name's owner is expected to * support the given interface name. THE NAME OWNER MAY CHANGE OVER * TIME, for example between two different method calls, unless the * name is a unique name. If you need a fixed owner, you need to * request the current owner and bind a proxy to its unique name * rather than to the generic name; see * dbus_g_proxy_new_for_name_owner(). * * A name-associated proxy only makes sense with a message bus, not * for app-to-app direct dbus connections. * * This proxy will only emit the "destroy" signal if the * #DBusConnection is disconnected, the proxy has no remaining * references, or the name is a unique name and its owner * disappears. If a well-known name changes owner, the proxy will * still be alive. * * Returns: new proxy object */ DBusGProxy* dbus_g_proxy_new_for_name (DBusGConnection *connection, const char *name, const char *path, const char *iface) { g_return_val_if_fail (connection != NULL, NULL); g_return_val_if_fail (g_dbus_is_name (name), NULL); g_return_val_if_fail (g_variant_is_object_path (path), NULL); g_return_val_if_fail (g_dbus_is_interface_name (iface), NULL); return dbus_g_proxy_new (connection, name, path, iface); } /** * dbus_g_proxy_new_for_name_owner: * @connection: the connection to the remote bus * @name: any name on the message bus * @path: name of the object inside the service to call methods on * @iface: name of the interface to call methods on * @error: return location for an error * * Similar to dbus_g_proxy_new_for_name(), but makes a round-trip * request to the message bus to get the current name owner, then * binds the proxy to the unique name of the current owner, rather * than to the well-known name. As a result, the name owner will * not change over time, and the proxy will emit the "destroy" signal * when the owner disappears from the message bus. * * An example of the difference between dbus_g_proxy_new_for_name() * and dbus_g_proxy_new_for_name_owner(): if you provide the well-known name * "org.freedesktop.Database" dbus_g_proxy_new_for_name() remains bound * to that name as it changes owner. dbus_g_proxy_new_for_name_owner() * will fail if the name has no owner. If the name has an owner, * dbus_g_proxy_new_for_name_owner() will bind to the unique name * of that owner rather than the generic name. * * Returns: new proxy object, or %NULL on error */ DBusGProxy* dbus_g_proxy_new_for_name_owner (DBusGConnection *connection, const char *name, const char *path, const char *iface, GError **error) { DBusGProxy *proxy; char *unique_name; g_return_val_if_fail (connection != NULL, NULL); g_return_val_if_fail (g_dbus_is_name (name), NULL); g_return_val_if_fail (g_variant_is_object_path (path), NULL); g_return_val_if_fail (g_dbus_is_interface_name (iface), NULL); if (!(unique_name = get_name_owner (DBUS_CONNECTION_FROM_G_CONNECTION (connection), name, error))) return NULL; proxy = dbus_g_proxy_new (connection, unique_name, path, iface); g_free (unique_name); return proxy; } /** * dbus_g_proxy_new_from_proxy: * @proxy: the proxy to use as a template * @iface: name of the interface to call methods on * @path: of the object inside the peer to call methods on * * Creates a proxy using an existing proxy as a template, substituting * the specified interface and path. Either or both may be NULL. * * Returns: new proxy object */ DBusGProxy* dbus_g_proxy_new_from_proxy (DBusGProxy *proxy, const char *iface, const char *path) { DBusGProxyPrivate *priv; g_return_val_if_fail (DBUS_IS_G_PROXY (proxy), NULL); g_return_val_if_fail (path == NULL || g_variant_is_object_path (path), NULL); g_return_val_if_fail (iface == NULL || g_dbus_is_interface_name (iface), NULL); priv = DBUS_G_PROXY_GET_PRIVATE(proxy); if (iface == NULL) iface = priv->interface; if (path == NULL) path = priv->path; return dbus_g_proxy_new (DBUS_G_CONNECTION_FROM_CONNECTION (priv->manager->connection), priv->name, path, iface); } /** * dbus_g_proxy_new_for_peer: * @connection: the connection to the peer * @path: name of the object inside the peer to call methods on * @iface: name of the interface to call methods on * * Creates a proxy for an object in peer application (one * we're directly connected to). That is, this function is * intended for use when there's no message bus involved, * we're doing a simple 1-to-1 communication between two * applications. * * Returns: new proxy object */ DBusGProxy* dbus_g_proxy_new_for_peer (DBusGConnection *connection, const char *path, const char *iface) { DBusGProxy *proxy; g_return_val_if_fail (connection != NULL, NULL); g_return_val_if_fail (g_variant_is_object_path (path), NULL); g_return_val_if_fail (g_dbus_is_interface_name (iface), NULL); proxy = dbus_g_proxy_new (connection, NULL, path, iface); return proxy; } /** * dbus_g_proxy_get_bus_name: * @proxy: the proxy * * Gets the bus name a proxy is bound to (may be %NULL in some cases). * If you created the proxy with dbus_g_proxy_new_for_name(), then * the name you passed to that will be returned. * If you created it with dbus_g_proxy_new_for_name_owner(), then the * unique connection name will be returned. If you created it * with dbus_g_proxy_new_for_peer() then %NULL will be returned. * * It is an error to call this method on a proxy that has emitted * the #DBusGProxy::destroy signal. * * Returns: the bus name the proxy sends messages to */ const char* dbus_g_proxy_get_bus_name (DBusGProxy *proxy) { DBusGProxyPrivate *priv; g_return_val_if_fail (DBUS_IS_G_PROXY (proxy), NULL); g_return_val_if_fail (!DBUS_G_PROXY_DESTROYED (proxy), NULL); priv = DBUS_G_PROXY_GET_PRIVATE(proxy); return priv->name; } /** * dbus_g_proxy_get_interface: * @proxy: the proxy * * Gets the object interface proxy is bound to (may be %NULL in some cases). * * It is an error to call this method on a proxy that has emitted * the #DBusGProxy::destroy signal. * * Returns: an object interface */ const char* dbus_g_proxy_get_interface (DBusGProxy *proxy) { DBusGProxyPrivate *priv; g_return_val_if_fail (DBUS_IS_G_PROXY (proxy), NULL); g_return_val_if_fail (!DBUS_G_PROXY_DESTROYED (proxy), NULL); priv = DBUS_G_PROXY_GET_PRIVATE(proxy); return priv->interface; } /** * dbus_g_proxy_set_interface: * @proxy: the proxy * @interface_name: an object interface * * Sets the object interface proxy is bound to * * It is an error to call this method on a proxy that has emitted * the #DBusGProxy::destroy signal. */ void dbus_g_proxy_set_interface (DBusGProxy *proxy, const char *interface_name) { DBusGProxyPrivate *priv = DBUS_G_PROXY_GET_PRIVATE(proxy); g_return_if_fail (DBUS_IS_G_PROXY (proxy)); g_return_if_fail (!DBUS_G_PROXY_DESTROYED (proxy)); g_return_if_fail (g_dbus_is_interface_name (interface_name)); /* FIXME - need to unregister when we switch interface for now * later should support idea of unset interface */ dbus_g_proxy_manager_unregister (priv->manager, proxy); g_free (priv->interface); priv->interface = g_strdup (interface_name); dbus_g_proxy_manager_register (priv->manager, proxy); } /** * dbus_g_proxy_get_path: * @proxy: the proxy * * Gets the path this proxy is bound to * * It is an error to call this method on a proxy that has emitted * the #DBusGProxy::destroy signal. * * Returns: an object path */ const char* dbus_g_proxy_get_path (DBusGProxy *proxy) { DBusGProxyPrivate *priv; g_return_val_if_fail (DBUS_IS_G_PROXY (proxy), NULL); g_return_val_if_fail (!DBUS_G_PROXY_DESTROYED (proxy), NULL); priv = DBUS_G_PROXY_GET_PRIVATE(proxy); return priv->path; } static DBusMessage * dbus_g_proxy_marshal_args_to_message (DBusGProxy *proxy, const char *method, GValueArray *args) { DBusMessage *message; DBusMessageIter msgiter; guint i; DBusGProxyPrivate *priv = DBUS_G_PROXY_GET_PRIVATE(proxy); message = dbus_message_new_method_call (priv->name, priv->path, priv->interface, method); if (message == NULL) return NULL; dbus_message_iter_init_append (message, &msgiter); for (i = 0; i < args->n_values; i++) { GValue *gvalue; gvalue = g_value_array_get_nth (args, i); if (!_dbus_gvalue_marshal (&msgiter, gvalue)) { /* This is a programming error by the caller, most likely */ gchar *contents = g_strdup_value_contents (gvalue); g_critical ("Could not marshal argument %u for %s: type %s, value %s", i, method, G_VALUE_TYPE_NAME (gvalue), contents); g_free (contents); dbus_message_unref (message); return NULL; } } return message; } static guint dbus_g_proxy_begin_call_internal (DBusGProxy *proxy, const char *method, DBusGProxyCallNotify notify, gpointer user_data, GDestroyNotify destroy, GValueArray *args, int timeout) { DBusMessage *message; DBusPendingCall *pending; GPendingNotifyClosure *closure; guint call_id; DBusGProxyPrivate *priv = DBUS_G_PROXY_GET_PRIVATE(proxy); pending = NULL; message = dbus_g_proxy_marshal_args_to_message (proxy, method, args); /* can only happen on a programming error or OOM; we already critical'd */ if (!message) return 0; if (!dbus_connection_send_with_reply (priv->manager->connection, message, &pending, timeout)) oom (); dbus_message_unref (message); /* If we got a NULL pending, that means the connection was disconnected, * and we need to abort this call. * https://bugs.freedesktop.org/show_bug.cgi?id=12675 */ if (pending == NULL) return 0; call_id = ++priv->call_id_counter; if (notify != NULL) { closure = g_new (GPendingNotifyClosure, 1); closure->proxy = proxy; /* No need to ref as the lifecycle is tied to proxy */ closure->call_id = call_id; closure->func = notify; closure->data = user_data; closure->free_data_func = destroy; dbus_pending_call_set_notify (pending, d_pending_call_notify, closure, d_pending_call_free); } g_hash_table_insert (priv->pending_calls, GUINT_TO_POINTER (call_id), pending); return call_id; } static gboolean dbus_g_proxy_end_call_internal (DBusGProxy *proxy, guint call_id, GError **error, GType first_arg_type, va_list args) { DBusMessage *reply; DBusMessageIter msgiter; DBusError derror; va_list args_unwind; guint over; int n_retvals_processed; gboolean ret; GType valtype; DBusPendingCall *pending; DBusGProxyPrivate *priv = DBUS_G_PROXY_GET_PRIVATE(proxy); if (call_id == 0) { /* Being disconnected is the only reason this can happen, except * for programmer error; if it was programmer error, we already * emitted a critical warning. */ g_set_error (error, DBUS_GERROR, DBUS_GERROR_DISCONNECTED, "Disconnected from D-Bus (or argument error during call)"); return FALSE; } reply = NULL; ret = FALSE; n_retvals_processed = 0; over = 0; /* Keep around a copy of output arguments so we can free on error. */ G_VA_COPY(args_unwind, args); pending = g_hash_table_lookup (priv->pending_calls, GUINT_TO_POINTER (call_id)); dbus_pending_call_block (pending); reply = dbus_pending_call_steal_reply (pending); g_assert (reply != NULL); dbus_error_init (&derror); switch (dbus_message_get_type (reply)) { case DBUS_MESSAGE_TYPE_METHOD_RETURN: dbus_message_iter_init (reply, &msgiter); valtype = first_arg_type; while (valtype != G_TYPE_INVALID) { int arg_type; gpointer return_storage; GValue gvalue = { 0, }; DBusGValueMarshalCtx context; context.recursion_depth = 0; context.gconnection = DBUS_G_CONNECTION_FROM_CONNECTION (priv->manager->connection); context.proxy = proxy; arg_type = dbus_message_iter_get_arg_type (&msgiter); if (arg_type == DBUS_TYPE_INVALID) { g_set_error (error, DBUS_GERROR, DBUS_GERROR_INVALID_ARGS, "Too few arguments in reply"); goto out; } return_storage = va_arg (args, gpointer); if (return_storage == NULL) goto next; /* We handle variants specially; the caller is expected * to have already allocated storage for them. */ if (arg_type == DBUS_TYPE_VARIANT && g_type_is_a (valtype, G_TYPE_VALUE)) { if (!_dbus_gvalue_demarshal_variant (&context, &msgiter, (GValue*) return_storage, NULL)) { g_set_error (error, DBUS_GERROR, DBUS_GERROR_INVALID_ARGS, "Couldn't convert argument, expected \"%s\"", g_type_name (valtype)); goto out; } } else { g_value_init (&gvalue, valtype); if (!_dbus_gvalue_demarshal (&context, &msgiter, &gvalue, error)) goto out; /* Anything that can be demarshaled must be storable */ if (!_dbus_gvalue_store (&gvalue, return_storage)) g_assert_not_reached (); /* Ownership of the value passes to the client, don't unset */ } next: n_retvals_processed++; dbus_message_iter_next (&msgiter); valtype = va_arg (args, GType); } while (dbus_message_iter_get_arg_type (&msgiter) != DBUS_TYPE_INVALID) { over++; dbus_message_iter_next (&msgiter); } if (over > 0) { g_set_error (error, DBUS_GERROR, DBUS_GERROR_INVALID_ARGS, "Too many arguments in reply; expected %d, got %d", n_retvals_processed, over); goto out; } break; case DBUS_MESSAGE_TYPE_ERROR: dbus_set_error_from_message (&derror, reply); dbus_set_g_error (error, &derror); dbus_error_free (&derror); goto out; break; default: dbus_set_error (&derror, DBUS_ERROR_FAILED, "Reply was neither a method return nor an exception"); dbus_set_g_error (error, &derror); dbus_error_free (&derror); goto out; break; } ret = TRUE; out: if (ret == FALSE) { int i; valtype = first_arg_type; for (i = 0; i < n_retvals_processed; i++) { GValue value = {0,}; gpointer retval; g_value_init (&value, valtype); retval = va_arg (args_unwind, gpointer); if (retval == NULL) { i--; continue; } _dbus_gvalue_take (&value, retval); g_value_unset (&value); valtype = va_arg (args_unwind, GType); } } va_end (args_unwind); va_end (args); g_hash_table_remove (priv->pending_calls, GUINT_TO_POINTER (call_id)); if (reply) dbus_message_unref (reply); return ret; } /** * dbus_g_proxy_begin_call: * @proxy: a proxy for a remote interface * @method: the name of the method to invoke * @notify: callback to be invoked when method returns * @user_data: user data passed to callback * @destroy: function called to destroy user_data * @first_arg_type: type of the first argument, or %G_TYPE_INVALID if there * are no arguments * @...: first argument, followed by any further type/value pairs, followed * by %G_TYPE_INVALID * * Asynchronously invokes a method on a remote interface. The method * call will not be sent over the wire until the application returns * to the main loop, or blocks in dbus_g_connection_flush() to write out * pending data. The call will be completed after a timeout, or when * a reply is received. When the call returns, the callback specified * will be invoked; you can then collect the results of the call * (which may be an error, or a reply), use dbus_g_proxy_end_call(). * * It is an error to call this method on a proxy that has emitted * the #DBusGProxy::destroy signal. * * TODO this particular function shouldn't die on out of memory, * since you should be able to do a call with large arguments. * * Returns: call identifier. */ DBusGProxyCall * dbus_g_proxy_begin_call (DBusGProxy *proxy, const char *method, DBusGProxyCallNotify notify, gpointer user_data, GDestroyNotify destroy, GType first_arg_type, ...) { guint call_id = 0; va_list args; GValueArray *arg_values; DBusGProxyPrivate *priv = DBUS_G_PROXY_GET_PRIVATE(proxy); g_return_val_if_fail (DBUS_IS_G_PROXY (proxy), NULL); g_return_val_if_fail (!DBUS_G_PROXY_DESTROYED (proxy), NULL); g_return_val_if_fail (g_dbus_is_member_name (method), NULL); va_start (args, first_arg_type); DBUS_G_VALUE_ARRAY_COLLECT_ALL (arg_values, first_arg_type, args); if (arg_values != NULL) { call_id = dbus_g_proxy_begin_call_internal (proxy, method, notify, user_data, destroy, arg_values, priv->default_timeout); g_value_array_free (arg_values); } va_end (args); return DBUS_G_PROXY_ID_TO_CALL (call_id); } /** * dbus_g_proxy_begin_call_with_timeout: * @proxy: a proxy for a remote interface * @method: the name of the method to invoke * @notify: callback to be invoked when method returns * @user_data: user data passed to callback * @destroy: function called to destroy user_data * @timeout: the timeout in milliseconds, or -1 to use a default * @first_arg_type: type of the first argument, or %G_TYPE_INVALID if there * are no arguments * @...: first argument, followed by any further type/value pairs, followed * by %G_TYPE_INVALID * * Asynchronously invokes a method on a remote interface. The method * call will not be sent over the wire until the application returns * to the main loop, or blocks in dbus_g_connection_flush() to write out * pending data. The call will be completed after a timeout, or when * a reply is received. When the call returns, the callback specified * will be invoked; you can then collect the results of the call * (which may be an error, or a reply), use dbus_g_proxy_end_call(). * * It is an error to call this method on a proxy that has emitted * the #DBusGProxy::destroy signal. * * TODO this particular function shouldn't die on out of memory, * since you should be able to do a call with large arguments. * * Returns: call identifier. */ DBusGProxyCall * dbus_g_proxy_begin_call_with_timeout (DBusGProxy *proxy, const char *method, DBusGProxyCallNotify notify, gpointer user_data, GDestroyNotify destroy, int timeout, GType first_arg_type, ...) { guint call_id = 0; va_list args; GValueArray *arg_values; g_return_val_if_fail (DBUS_IS_G_PROXY (proxy), NULL); g_return_val_if_fail (!DBUS_G_PROXY_DESTROYED (proxy), NULL); g_return_val_if_fail (g_dbus_is_member_name (method), NULL); g_return_val_if_fail (timeout >= 0 || timeout == -1, NULL); va_start (args, first_arg_type); DBUS_G_VALUE_ARRAY_COLLECT_ALL (arg_values, first_arg_type, args); if (arg_values != NULL) { call_id = dbus_g_proxy_begin_call_internal (proxy, method, notify, user_data, destroy, arg_values, timeout); g_value_array_free (arg_values); } va_end (args); return DBUS_G_PROXY_ID_TO_CALL (call_id); } /** * dbus_g_proxy_end_call: * @proxy: a proxy for a remote interface * @call: the pending call ID from dbus_g_proxy_begin_call() * @error: return location for an error * @first_arg_type: type of first "out" argument, or %G_TYPE_INVALID if * there are no "out" arguments * @...: return location for first "out" argument, followed by any further * type/location pairs, followed by %G_TYPE_INVALID * * Collects the results of a method call. The method call was normally * initiated with dbus_g_proxy_end_call(). You may use this function * outside of the callback given to dbus_g_proxy_begin_call; in that * case this function will block if the results haven't yet been * received. * * All D-Bus method calls can fail with a remote error. If this occurs, * the @error will be set and this function will return %FALSE. * * Otherwise, the "out" parameters and return value of the * method are stored in the provided varargs list. * The list should be terminated with G_TYPE_INVALID. * * Returns: %TRUE on success */ gboolean dbus_g_proxy_end_call (DBusGProxy *proxy, DBusGProxyCall *call, GError **error, GType first_arg_type, ...) { gboolean ret; va_list args; g_return_val_if_fail (DBUS_IS_G_PROXY (proxy), FALSE); va_start (args, first_arg_type); ret = dbus_g_proxy_end_call_internal (proxy, GPOINTER_TO_UINT (call), error, first_arg_type, args); va_end (args); return ret; } /** * dbus_g_proxy_call: * @proxy: a proxy for a remote interface * @method: method to invoke * @error: return location for an error * @first_arg_type: type of first "in" argument, or %G_TYPE_INVALID if none * @...: value of first "in" argument, any further type/value pairs, * %G_TYPE_INVALID, type/location pairs for "out" arguments, * and %G_TYPE_INVALID again * * Function for synchronously invoking a method and receiving reply * values. This function is equivalent to dbus_g_proxy_begin_call * followed by dbus_g_proxy_end_call. All of the input arguments are * specified first, followed by G_TYPE_INVALID, followed by all of the * output values, followed by a second G_TYPE_INVALID. Note that * this means you must always specify G_TYPE_INVALID twice. * * It is an error to call this method on a proxy that has emitted * the #DBusGProxy::destroy signal. * * Returns: %TRUE if the method succeeds, %FALSE if it fails */ gboolean dbus_g_proxy_call (DBusGProxy *proxy, const char *method, GError **error, GType first_arg_type, ...) { gboolean ret; guint call_id = 0; va_list args; GValueArray *in_args; DBusGProxyPrivate *priv; g_return_val_if_fail (DBUS_IS_G_PROXY (proxy), FALSE); g_return_val_if_fail (!DBUS_G_PROXY_DESTROYED (proxy), FALSE); priv = DBUS_G_PROXY_GET_PRIVATE(proxy); va_start (args, first_arg_type); DBUS_G_VALUE_ARRAY_COLLECT_ALL (in_args, first_arg_type, args); if (in_args != NULL) { call_id = dbus_g_proxy_begin_call_internal (proxy, method, NULL, NULL, NULL, in_args, priv->default_timeout); g_value_array_free (in_args); } first_arg_type = va_arg (args, GType); ret = dbus_g_proxy_end_call_internal (proxy, call_id, error, first_arg_type, args); va_end (args); return ret; } /** * dbus_g_proxy_call_with_timeout: * @proxy: a proxy for a remote interface * @method: method to invoke * @timeout: the timeout in milliseconds, or -1 to use a default * @error: return location for an error * @first_arg_type: type of first "in" argument * @...: as for dbus_g_proxy_call() * * Function for synchronously invoking a method and receiving reply * values. This function is equivalent to dbus_g_proxy_begin_call * followed by dbus_g_proxy_end_call. All of the input arguments are * specified first, followed by G_TYPE_INVALID, followed by all of the * output values, followed by a second G_TYPE_INVALID. Note that * this means you must always specify G_TYPE_INVALID twice. * * It is an error to call this method on a proxy that has emitted * the #DBusGProxy::destroy signal. * * Returns: %TRUE if the method succeeds, %FALSE if it fails */ gboolean dbus_g_proxy_call_with_timeout (DBusGProxy *proxy, const char *method, int timeout, GError **error, GType first_arg_type, ...) { gboolean ret; guint call_id = 0; va_list args; GValueArray *in_args; g_return_val_if_fail (DBUS_IS_G_PROXY (proxy), FALSE); g_return_val_if_fail (!DBUS_G_PROXY_DESTROYED (proxy), FALSE); g_return_val_if_fail (g_dbus_is_member_name (method), FALSE); g_return_val_if_fail (timeout >= 0 || timeout == -1, FALSE); va_start (args, first_arg_type); DBUS_G_VALUE_ARRAY_COLLECT_ALL (in_args, first_arg_type, args); if (in_args != NULL) { call_id = dbus_g_proxy_begin_call_internal (proxy, method, NULL, NULL, NULL, in_args, timeout); g_value_array_free (in_args); } first_arg_type = va_arg (args, GType); ret = dbus_g_proxy_end_call_internal (proxy, call_id, error, first_arg_type, args); va_end (args); return ret; } /** * dbus_g_proxy_call_no_reply: * @proxy: a proxy for a remote interface * @method: the name of the method to invoke * @first_arg_type: type of the first argument, or %G_TYPE_INVALID to call * the method without arguments * @...: the first argument and any remaining type/argument pairs, followed by * %G_TYPE_INVALID to terminate the list * * Sends a method call message as with dbus_g_proxy_begin_call(), but * does not ask for a reply or allow you to receive one. * * It is an error to call this method on a proxy that has emitted * the #DBusGProxy::destroy signal. * * TODO: this particular function shouldn't die on out of memory, * since you should be able to do a call with large arguments. */ void dbus_g_proxy_call_no_reply (DBusGProxy *proxy, const char *method, GType first_arg_type, ...) { DBusMessage *message = NULL; va_list args; GValueArray *in_args; DBusGProxyPrivate *priv; g_return_if_fail (DBUS_IS_G_PROXY (proxy)); g_return_if_fail (g_dbus_is_member_name (method)); g_return_if_fail (!DBUS_G_PROXY_DESTROYED (proxy)); priv = DBUS_G_PROXY_GET_PRIVATE(proxy); va_start (args, first_arg_type); DBUS_G_VALUE_ARRAY_COLLECT_ALL (in_args, first_arg_type, args); if (in_args != NULL) { message = dbus_g_proxy_marshal_args_to_message (proxy, method, in_args); g_value_array_free (in_args); } va_end (args); /* can only happen on a programming error or OOM; we already critical'd */ if (!message) return; dbus_message_set_no_reply (message, TRUE); if (!dbus_connection_send (priv->manager->connection, message, NULL)) oom (); dbus_message_unref (message); } /** * dbus_g_proxy_cancel_call * @proxy: a proxy for a remote interface * @call: the pending call ID from dbus_g_proxy_begin_call() * * Cancels a pending method call. The method call was normally * initiated with dbus_g_proxy_begin_call(). This function * may not be used on pending calls that have already been * ended with dbus_g_proxy_end_call. * * It is an error to call this method on a proxy that has emitted * the #DBusGProxy::destroy signal. */ void dbus_g_proxy_cancel_call (DBusGProxy *proxy, DBusGProxyCall *call) { guint call_id; DBusPendingCall *pending; DBusGProxyPrivate *priv; g_return_if_fail (DBUS_IS_G_PROXY (proxy)); g_return_if_fail (!DBUS_G_PROXY_DESTROYED (proxy)); priv = DBUS_G_PROXY_GET_PRIVATE(proxy); call_id = DBUS_G_PROXY_CALL_TO_ID (call); if (call_id == 0) { /* nothing to cancel */ return; } pending = g_hash_table_lookup (priv->pending_calls, GUINT_TO_POINTER (call_id)); g_hash_table_remove (priv->pending_calls, GUINT_TO_POINTER (call_id)); g_return_if_fail (pending != NULL); dbus_pending_call_cancel (pending); } /** * dbus_g_proxy_send: * @proxy: a proxy for a remote interface * @message: the message to address and send * @client_serial: return location for message's serial, or %NULL * * Sends a message to the interface we're proxying for. Does not * block or wait for a reply. The message is only actually written out * when you return to the main loop or block in * dbus_g_connection_flush(). * * The message is modified to be addressed to the target interface. * That is, a destination name field or whatever is needed will be * added to the message. The basic point of this function is to add * the necessary header fields, otherwise it's equivalent to * dbus_connection_send(). * * This function adds a reference to the message, so the caller * still owns its original reference. * * It is an error to call this method on a proxy that has emitted * the #DBusGProxy::destroy signal. */ void dbus_g_proxy_send (DBusGProxy *proxy, DBusMessage *message, dbus_uint32_t *client_serial) { DBusGProxyPrivate *priv; g_return_if_fail (DBUS_IS_G_PROXY (proxy)); g_return_if_fail (!DBUS_G_PROXY_DESTROYED (proxy)); priv = DBUS_G_PROXY_GET_PRIVATE(proxy); if (priv->name) { if (!dbus_message_set_destination (message, priv->name)) g_error ("Out of memory"); } if (priv->path) { if (!dbus_message_set_path (message, priv->path)) g_error ("Out of memory"); } if (priv->interface) { if (!dbus_message_set_interface (message, priv->interface)) g_error ("Out of memory"); } if (!dbus_connection_send (priv->manager->connection, message, client_serial)) g_error ("Out of memory\n"); } static void array_free_all (gpointer array) { g_array_free (array, TRUE); } /** * dbus_g_proxy_add_signal: * @proxy: the proxy for a remote interface * @signal_name: the name of the signal * @first_type: the first argument type, or %G_TYPE_INVALID if none * @...: any subsequent argument types, followed by %G_TYPE_INVALID * * Specifies the argument signature of a D-Bus signal. When the signal is * emitted by the remote object, if the GTypes corresponding to its arguments' * types do not match the types given here, the signal will be ignored. * * It is an error to add the same @signal_name to the same @proxy more than * once, even if the argument types given are the same. * * It is also an error to call this method on a proxy that has emitted * the #DBusGProxy::destroy signal. */ void dbus_g_proxy_add_signal (DBusGProxy *proxy, const char *signal_name, GType first_type, ...) { GQuark q; char *name; GArray *gtypesig; GType gtype; va_list args; DBusGProxyPrivate *priv; g_return_if_fail (DBUS_IS_G_PROXY (proxy)); g_return_if_fail (!DBUS_G_PROXY_DESTROYED (proxy)); g_return_if_fail (g_dbus_is_member_name (signal_name)); priv = DBUS_G_PROXY_GET_PRIVATE(proxy); name = create_signal_name (priv->interface, signal_name); q = g_quark_from_string (name); g_return_if_fail (g_datalist_id_get_data (&priv->signal_signatures, q) == NULL); gtypesig = g_array_new (FALSE, TRUE, sizeof (GType)); va_start (args, first_type); gtype = first_type; while (gtype != G_TYPE_INVALID) { g_array_append_val (gtypesig, gtype); gtype = va_arg (args, GType); } va_end (args); #ifndef G_DISABLE_CHECKS if (_dbus_gobject_lookup_marshaller (G_TYPE_NONE, gtypesig->len, (const GType*) gtypesig->data) == NULL) g_warning ("No marshaller for signature of signal '%s'", signal_name); #endif g_datalist_id_set_data_full (&priv->signal_signatures, q, gtypesig, array_free_all); g_free (name); } /** * dbus_g_proxy_connect_signal: * @proxy: a proxy for a remote interface * @signal_name: the DBus signal name to listen for * @handler: the handler to connect * @data: data to pass to handler * @free_data_func: callback function to destroy data * * Connect a signal handler to a proxy for a remote interface. When * the remote interface emits the specified signal, the proxy will * emit a corresponding GLib signal. * * It is an error to call this method on a proxy that has emitted * the #DBusGProxy::destroy signal. */ void dbus_g_proxy_connect_signal (DBusGProxy *proxy, const char *signal_name, GCallback handler, void *data, GClosureNotify free_data_func) { char *name; GClosure *closure; GQuark q; DBusGProxyPrivate *priv; g_return_if_fail (DBUS_IS_G_PROXY (proxy)); g_return_if_fail (!DBUS_G_PROXY_DESTROYED (proxy)); g_return_if_fail (g_dbus_is_member_name (signal_name)); g_return_if_fail (handler != NULL); priv = DBUS_G_PROXY_GET_PRIVATE(proxy); name = create_signal_name (priv->interface, signal_name); q = g_quark_try_string (name); #ifndef G_DISABLE_CHECKS if (q == 0 || g_datalist_id_get_data (&priv->signal_signatures, q) == NULL) { g_warning ("Must add the signal '%s' with dbus_g_proxy_add_signal() prior to connecting to it\n", name); g_free (name); return; } #endif closure = g_cclosure_new (G_CALLBACK (handler), data, free_data_func); g_signal_connect_closure_by_id (G_OBJECT (proxy), signals[RECEIVED], q, closure, FALSE); g_free (name); } /** * dbus_g_proxy_disconnect_signal: * @proxy: a proxy for a remote interface * @signal_name: the DBus signal name to disconnect * @handler: the handler to disconnect * @data: the data that was registered with handler * * Disconnect all signal handlers from a proxy that match the given * criteria. * * It is an error to call this method on a proxy that has emitted * the #DBusGProxy::destroy signal. */ void dbus_g_proxy_disconnect_signal (DBusGProxy *proxy, const char *signal_name, GCallback handler, void *data) { char *name; GQuark q; DBusGProxyPrivate *priv; g_return_if_fail (DBUS_IS_G_PROXY (proxy)); g_return_if_fail (!DBUS_G_PROXY_DESTROYED (proxy)); g_return_if_fail (g_dbus_is_member_name (signal_name)); g_return_if_fail (handler != NULL); priv = DBUS_G_PROXY_GET_PRIVATE(proxy); name = create_signal_name (priv->interface, signal_name); q = g_quark_try_string (name); if (q != 0) { g_signal_handlers_disconnect_matched (G_OBJECT (proxy), G_SIGNAL_MATCH_DETAIL | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, signals[RECEIVED], q, NULL, G_CALLBACK (handler), data); } else { g_warning ("Attempt to disconnect from signal '%s' which is not registered\n", name); } g_free (name); } /** * dbus_g_proxy_set_default_timeout: * @proxy: a proxy for a remote interface * @timeout: the timeout in milliseconds, or -1 to reset to the libdbus default * * Sets the default timeout to use for a proxy. This timeout will be * used in calls where the timeout is not specified, or is specified to be -1. * If this timeout is also set to -1, libdbus will use a reasonable default * value. * * This is useful for long-running operations that takes longer than * the default timeout (which is a on the order of magnitude of tens * of seconds). For some applications, consider using a pattern where * the method returns once the operation is underway * (e.g. immediately) and emits a signal when the operation terminates * (though beware of leaking information with/in the signal return value). * * It is an error to call this method on a proxy that has emitted * the #DBusGProxy::destroy signal. * * Since: 0.75 */ void dbus_g_proxy_set_default_timeout (DBusGProxy *proxy, int timeout) { DBusGProxyPrivate *priv; g_return_if_fail (DBUS_IS_G_PROXY (proxy)); g_return_if_fail (!DBUS_G_PROXY_DESTROYED (proxy)); g_return_if_fail (timeout >= 0 || timeout == -1); priv = DBUS_G_PROXY_GET_PRIVATE(proxy); priv->default_timeout = timeout; } dbus-glib-0.100.2/dbus/dbus-binding-tool-glib.h0000644000175000017500000000333312107524563016013 00000000000000/* -*- mode: C; c-file-style: "gnu" -*- */ /* dbus-binding-tool-output-glib.h prototypes for glib output * * Copyright (C) 2005 Red Hat, Inc. * * Licensed under the Academic Free License version 2.1 * * 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 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it bwill 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * */ #ifndef DBUS_BINDING_TOOL_OUTPUT_GLIB_H #define DBUS_BINDING_TOOL_OUTPUT_GLIB_H G_BEGIN_DECLS #define DBUS_GLIB_ANNOTATION_C_SYMBOL "org.freedesktop.DBus.GLib.CSymbol" #define DBUS_GLIB_ANNOTATION_CLIENT_C_SYMBOL "org.freedesktop.DBus.GLib.ClientCSymbol" #define DBUS_GLIB_ANNOTATION_ASYNC "org.freedesktop.DBus.GLib.Async" #define DBUS_GLIB_ANNOTATION_CONST "org.freedesktop.DBus.GLib.Const" #define DBUS_GLIB_ANNOTATION_RETURNVAL "org.freedesktop.DBus.GLib.ReturnVal" #define DBUS_GLIB_ANNOTATION_NOREPLY "org.freedesktop.DBus.Method.NoReply" gboolean dbus_binding_tool_output_glib_client (BaseInfo *info, GIOChannel *channel, gboolean ignore_unsupported, GError **error); gboolean dbus_binding_tool_output_glib_server (BaseInfo *info, GIOChannel *channel, const char *prefix, GError **error); G_END_DECLS #endif dbus-glib-0.100.2/dbus/dbus-gidl.h0000644000175000017500000001731312107524614013432 00000000000000/* -*- mode: C; c-file-style: "gnu" -*- */ /* dbus-gidl.h data structure describing an interface, to be generated from IDL * or something * * Copyright (C) 2003 Red Hat, Inc. * * Licensed under the Academic Free License version 2.1 * * 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 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * */ #ifndef DBUS_GLIB_IDL_H #define DBUS_GLIB_IDL_H #include #include G_BEGIN_DECLS typedef struct BaseInfo BaseInfo; typedef struct NodeInfo NodeInfo; typedef struct InterfaceInfo InterfaceInfo; typedef struct MethodInfo MethodInfo; typedef struct SignalInfo SignalInfo; typedef struct PropertyInfo PropertyInfo; typedef struct ArgInfo ArgInfo; typedef enum { ARG_INVALID = -1, ARG_IN, ARG_OUT } ArgDirection; typedef enum { PROPERTY_READ = 1 << 0, PROPERTY_WRITE = 1 << 1 } PropertyAccessFlags; typedef enum { INFO_TYPE_NODE, INFO_TYPE_INTERFACE, INFO_TYPE_METHOD, INFO_TYPE_SIGNAL, INFO_TYPE_ARG, INFO_TYPE_PROPERTY } InfoType; BaseInfo* base_info_ref (BaseInfo *info); void base_info_unref (BaseInfo *info); InfoType base_info_get_type (BaseInfo *info); const char* base_info_get_name (BaseInfo *info); void base_info_set_name (BaseInfo *info, const char *name); GType base_info_get_gtype (void); #define BASE_INFO_TYPE (base_info_get_gtype ()) NodeInfo* node_info_new (const char *name); NodeInfo* node_info_ref (NodeInfo *info); void node_info_unref (NodeInfo *info); const char* node_info_get_name (NodeInfo *info); GSList* node_info_get_interfaces (NodeInfo *info); GSList* node_info_get_nodes (NodeInfo *info); void node_info_add_interface (NodeInfo *info, InterfaceInfo *iface); void node_info_add_node (NodeInfo *info, NodeInfo *child); void node_info_replace_node (NodeInfo *info, NodeInfo *old_child, NodeInfo *new_child); InterfaceInfo* interface_info_new (const char *name); InterfaceInfo* interface_info_ref (InterfaceInfo *info); void interface_info_unref (InterfaceInfo *info); const char* interface_info_get_name (InterfaceInfo *info); GSList* interface_info_get_annotations(InterfaceInfo *info); const char* interface_info_get_annotation (InterfaceInfo*info, const char *annotation); GSList* interface_info_get_methods (InterfaceInfo *info); GSList* interface_info_get_signals (InterfaceInfo *info); GSList* interface_info_get_properties (InterfaceInfo *info); void interface_info_add_annotation (InterfaceInfo *info, const char *name, const char *value); void interface_info_add_method (InterfaceInfo *info, MethodInfo *method); void interface_info_add_signal (InterfaceInfo *info, SignalInfo *signal); void interface_info_add_property (InterfaceInfo *info, PropertyInfo *property); MethodInfo* method_info_new (const char *name); MethodInfo* method_info_ref (MethodInfo *info); void method_info_unref (MethodInfo *info); const char* method_info_get_name (MethodInfo *info); GSList* method_info_get_annotations (MethodInfo *info); const char* method_info_get_annotation (MethodInfo *info, const char *annotation); void method_info_add_annotation (MethodInfo *info, const char *name, const char *value); GSList* method_info_get_args (MethodInfo *info); void method_info_add_arg (MethodInfo *info, ArgInfo *arg); int method_info_get_n_args (MethodInfo *info); SignalInfo* signal_info_new (const char *name); SignalInfo* signal_info_ref (SignalInfo *info); void signal_info_unref (SignalInfo *info); const char* signal_info_get_name (SignalInfo *info); GSList* signal_info_get_args (SignalInfo *info); void signal_info_add_arg (SignalInfo *info, ArgInfo *arg); int signal_info_get_n_args (SignalInfo *info); PropertyInfo* property_info_new (const char *name, const char *type, PropertyAccessFlags access); PropertyInfo* property_info_ref (PropertyInfo *info); void property_info_unref (PropertyInfo *info); const char* property_info_get_name (PropertyInfo *info); const char* property_info_get_type (PropertyInfo *info); PropertyAccessFlags property_info_get_access (PropertyInfo *info); ArgInfo* arg_info_new (const char *name, ArgDirection direction, const char *type); ArgInfo* arg_info_ref (ArgInfo *info); void arg_info_unref (ArgInfo *info); const char* arg_info_get_name (ArgInfo *info); const char* arg_info_get_type (ArgInfo *info); ArgDirection arg_info_get_direction (ArgInfo *info); GSList* arg_info_get_annotations (ArgInfo *info); const char* arg_info_get_annotation (ArgInfo *info, const char *annotation); void arg_info_add_annotation (ArgInfo *info, const char *name, const char *value); G_END_DECLS #endif /* DBUS_GLIB_IDL_H */ dbus-glib-0.100.2/dbus/dbus-binding-tool-glib.c0000644000175000017500000014030712107524614016006 00000000000000/* -*- mode: C; c-file-style: "gnu" -*- */ /* dbus-binding-tool-glib.c: Output C glue * * Copyright (C) 2003, 2004, 2005 Red Hat, Inc. * Copyright (C) 2005 Nokia * * Licensed under the Academic Free License version 2.1 * * 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 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * */ #include #include "dbus/dbus-glib.h" #include "dbus-gidl.h" #include "dbus-gparser.h" #include "dbus-gutils.h" #include "dbus-gtype-specialized.h" #include "dbus-gsignature.h" #include "dbus-gvalue-utils.h" #include "dbus-glib-tool.h" #include "dbus-binding-tool-glib.h" #include #include #include #include /* Remember to grep for ->format_version in the code if you change this, * most changes should be in dbus-gobject.c. */ #define FORMAT_VERSION 1 #define MARSHAL_PREFIX "dbus_glib_marshal_" typedef struct { gboolean ignore_unsupported; const char* prefix; GIOChannel *channel; GError **error; GHashTable *generated; GString *blob; GString *signal_blob; GString *property_blob; guint count; } DBusBindingToolCData; static gboolean gather_marshallers (BaseInfo *base, DBusBindingToolCData *data, GError **error); static gboolean generate_glue_toplevel (BaseInfo *base, DBusBindingToolCData *data, GError **error); static gboolean generate_glue (BaseInfo *base, DBusBindingToolCData *data, GError **error); static gboolean generate_client_glue (BaseInfo *base, DBusBindingToolCData *data, GError **error); static const char * dbus_g_type_get_marshal_name (GType gtype) { switch (G_TYPE_FUNDAMENTAL (gtype)) { case G_TYPE_NONE: return "NONE"; case G_TYPE_BOOLEAN: return "BOOLEAN"; case G_TYPE_UCHAR: return "UCHAR"; case G_TYPE_INT: return "INT"; case G_TYPE_UINT: return "UINT"; case G_TYPE_INT64: return "INT64"; case G_TYPE_UINT64: return "UINT64"; case G_TYPE_DOUBLE: return "DOUBLE"; case G_TYPE_STRING: return "STRING"; case G_TYPE_POINTER: return "POINTER"; case G_TYPE_BOXED: return "BOXED"; case G_TYPE_OBJECT: return "OBJECT"; default: return NULL; } } /* This entire function is kind of...ugh. */ static const char * dbus_g_type_get_c_name (GType gtype) { GType subtype; if (dbus_g_type_is_struct (gtype)) { return "GValueArray"; } if (dbus_g_type_is_collection (gtype)) { subtype = dbus_g_type_get_collection_specialization(gtype); if (_dbus_g_type_is_fixed (subtype)) return "GArray"; else return "GPtrArray"; } if (dbus_g_type_is_map (gtype)) return "GHashTable"; if (g_type_is_a (gtype, G_TYPE_STRING)) return "char *"; /* This one is even more hacky...we get an extra * * because G_TYPE_STRV is a G_TYPE_BOXED */ if (g_type_is_a (gtype, G_TYPE_STRV)) return "char *"; if (g_type_is_a (gtype, DBUS_TYPE_G_OBJECT_PATH)) return "char"; if (g_type_is_a (gtype, DBUS_TYPE_G_SIGNATURE)) return "char"; return g_type_name (gtype); } static gboolean compute_gsignature (MethodInfo *method, GType *rettype, GArray **params, GError **error) { GSList *elt; GType retval_type; GArray *ret; gboolean is_async; const char *arg_type; gboolean retval_signals_error; is_async = method_info_get_annotation (method, DBUS_GLIB_ANNOTATION_ASYNC) != NULL; retval_signals_error = FALSE; ret = g_array_new (TRUE, TRUE, sizeof (GType)); if (is_async) retval_type = G_TYPE_NONE; else { gboolean found_retval; /* Look for return value */ found_retval = FALSE; for (elt = method_info_get_args (method); elt; elt = elt->next) { ArgInfo *arg = elt->data; const char *returnval_annotation; returnval_annotation = arg_info_get_annotation (arg, DBUS_GLIB_ANNOTATION_RETURNVAL); if (returnval_annotation != NULL) { arg_type = arg_info_get_type (arg); retval_type = _dbus_gtype_from_signature (arg_type, FALSE); if (retval_type == G_TYPE_INVALID) goto invalid_type; found_retval = TRUE; if (!strcmp (returnval_annotation, "error")) retval_signals_error = TRUE; break; } } if (!found_retval) { retval_type = G_TYPE_BOOLEAN; retval_signals_error = TRUE; } } *rettype = retval_type; /* Handle all input arguments */ for (elt = method_info_get_args (method); elt; elt = elt->next) { ArgInfo *arg = elt->data; if (arg_info_get_direction (arg) == ARG_IN) { GType gtype; arg_type = arg_info_get_type (arg); gtype = _dbus_gtype_from_signature (arg_type, FALSE); if (gtype == G_TYPE_INVALID) goto invalid_type; g_array_append_val (ret, gtype); } } if (!is_async) { /* Append pointer for each out arg storage */ for (elt = method_info_get_args (method); elt; elt = elt->next) { ArgInfo *arg = elt->data; /* Skip return value */ if (arg_info_get_annotation (arg, DBUS_GLIB_ANNOTATION_RETURNVAL) != NULL) continue; if (arg_info_get_direction (arg) == ARG_OUT) { GType gtype; arg_type = arg_info_get_type (arg); gtype = _dbus_gtype_from_signature (arg_type, FALSE); if (gtype == G_TYPE_INVALID) goto invalid_type; /* We actually just need a pointer for the return value storage */ gtype = G_TYPE_POINTER; g_array_append_val (ret, gtype); } } if (retval_signals_error) { /* Final GError parameter */ GType gtype = G_TYPE_POINTER; g_array_append_val (ret, gtype); } } else { /* Context pointer */ GType gtype = G_TYPE_POINTER; g_array_append_val (ret, gtype); } *params = ret; return TRUE; invalid_type: g_set_error (error, DBUS_BINDING_TOOL_ERROR, DBUS_BINDING_TOOL_ERROR_UNSUPPORTED_CONVERSION, "Unsupported conversion from D-BUS type %s to glib-genmarshal type", arg_type); return FALSE; } static char * compute_marshaller (MethodInfo *method, GError **error) { GArray *signature; GType rettype; const char *marshal_name; GString *ret; guint i; if (!compute_gsignature (method, &rettype, &signature, error)) return NULL; ret = g_string_new (""); marshal_name = dbus_g_type_get_marshal_name (rettype); g_assert (marshal_name != NULL); g_string_append (ret, marshal_name); g_string_append_c (ret, ':'); for (i = 0; i < signature->len; i++) { marshal_name = dbus_g_type_get_marshal_name (g_array_index (signature, GType, i)); g_assert (marshal_name != NULL); g_string_append (ret, marshal_name); if (i < signature->len - 1) g_string_append_c (ret, ','); } if (signature->len == 0) { marshal_name = dbus_g_type_get_marshal_name (G_TYPE_NONE); g_assert (marshal_name != NULL); g_string_append (ret, marshal_name); } g_array_free (signature, TRUE); return g_string_free (ret, FALSE); } static char * compute_marshaller_name (MethodInfo *method, const char *prefix, GError **error) { GString *ret; GArray *signature; GType rettype; const char *marshal_name; guint i; if (!compute_gsignature (method, &rettype, &signature, error)) return NULL; ret = g_string_new (MARSHAL_PREFIX); g_string_append (ret, prefix); g_string_append_c (ret, '_'); marshal_name = dbus_g_type_get_marshal_name (rettype); g_assert (marshal_name != NULL); g_string_append (ret, marshal_name); g_string_append (ret, "__"); for (i = 0; i < signature->len; i++) { marshal_name = dbus_g_type_get_marshal_name (g_array_index (signature, GType, i)); g_assert (marshal_name != NULL); g_string_append (ret, marshal_name); if (i < signature->len - 1) g_string_append_c (ret, '_'); } if (signature->len == 0) { marshal_name = dbus_g_type_get_marshal_name (G_TYPE_NONE); g_assert (marshal_name != NULL); g_string_append (ret, marshal_name); } g_array_free (signature, TRUE); return g_string_free (ret, FALSE); } static gboolean gather_marshallers_list (GSList *list, DBusBindingToolCData *data, GError **error) { GSList *tmp; tmp = list; while (tmp != NULL) { if (!gather_marshallers (tmp->data, data, error)) return FALSE; tmp = tmp->next; } return TRUE; } static gboolean gather_marshallers (BaseInfo *base, DBusBindingToolCData *data, GError **error) { if (base_info_get_type (base) == INFO_TYPE_NODE) { if (!gather_marshallers_list (node_info_get_nodes ((NodeInfo *) base), data, error)) return FALSE; if (!gather_marshallers_list (node_info_get_interfaces ((NodeInfo *) base), data, error)) return FALSE; } else { InterfaceInfo *interface; GSList *methods; GSList *tmp; const char *interface_c_name; interface = (InterfaceInfo *) base; interface_c_name = interface_info_get_annotation (interface, DBUS_GLIB_ANNOTATION_C_SYMBOL); if (interface_c_name == NULL) { if (!data->prefix) return TRUE; } methods = interface_info_get_methods (interface); /* Generate the necessary marshallers for the methods. */ for (tmp = methods; tmp != NULL; tmp = g_slist_next (tmp)) { MethodInfo *method; char *marshaller_name; method = (MethodInfo *) tmp->data; marshaller_name = compute_marshaller (method, error); if (!marshaller_name) return FALSE; if (g_hash_table_lookup (data->generated, marshaller_name)) { g_free (marshaller_name); continue; } g_hash_table_insert (data->generated, marshaller_name, NULL); } } return TRUE; } static gboolean generate_glue_list (GSList *list, DBusBindingToolCData *data, GError **error) { GSList *tmp; tmp = list; while (tmp != NULL) { if (!generate_glue (tmp->data, data, error)) return FALSE; tmp = tmp->next; } return TRUE; } #define WRITE_OR_LOSE(x) do { gsize bytes_written; if (!g_io_channel_write_chars (channel, x, -1, &bytes_written, error)) goto io_lose; } while (0) static gboolean write_printf_to_iochannel (const char *fmt, GIOChannel *channel, GError **error, ...) { char *str; va_list args; GIOStatus status; gsize written; gboolean ret; va_start (args, error); str = g_strdup_vprintf (fmt, args); if ((status = g_io_channel_write_chars (channel, str, -1, &written, error)) == G_IO_STATUS_NORMAL) ret = TRUE; else ret = FALSE; g_free (str); va_end (args); return ret; } static gboolean write_quoted_string (GIOChannel *channel, GString *string, GError **error) { guint i; WRITE_OR_LOSE ("\""); for (i = 0; i < string->len; i++) { if (string->str[i] != '\0') { if (!g_io_channel_write_chars (channel, string->str + i, 1, NULL, error)) return FALSE; } else { if (!g_io_channel_write_chars (channel, "\\0", -1, NULL, error)) return FALSE; } } WRITE_OR_LOSE ("\\0\""); return TRUE; io_lose: return FALSE; } static gboolean generate_glue_toplevel (BaseInfo *base, DBusBindingToolCData *data, GError **error) { GString *object_introspection_data_blob; GIOChannel *channel; channel = data->channel; object_introspection_data_blob = g_string_new_len ("", 0); data->blob = object_introspection_data_blob; data->count = 0; data->signal_blob = g_string_new_len ("", 0); data->property_blob = g_string_new_len ("", 0); if (!write_printf_to_iochannel ("static const DBusGMethodInfo dbus_glib_%s_methods[] = {\n", channel, error, data->prefix)) goto io_lose; if (!generate_glue_list (node_info_get_nodes ((NodeInfo *) base), data, error)) return FALSE; if (!generate_glue_list (node_info_get_interfaces ((NodeInfo *) base), data, error)) return FALSE; WRITE_OR_LOSE ("};\n\n"); /* Information about the object. */ if (!write_printf_to_iochannel ("const DBusGObjectInfo dbus_glib_%s_object_info = { %d,\n", channel, error, data->prefix, FORMAT_VERSION)) goto io_lose; if (!write_printf_to_iochannel (" dbus_glib_%s_methods,\n", channel, error, data->prefix)) goto io_lose; if (!write_printf_to_iochannel (" %d,\n", channel, error, data->count)) goto io_lose; if (!write_quoted_string (channel, object_introspection_data_blob, error)) goto io_lose; WRITE_OR_LOSE (",\n"); if (!write_quoted_string (channel, data->signal_blob, error)) goto io_lose; WRITE_OR_LOSE (",\n"); if (!write_quoted_string (channel, data->property_blob, error)) goto io_lose; WRITE_OR_LOSE ("\n};\n\n"); g_string_free (object_introspection_data_blob, TRUE); g_string_free (data->signal_blob, TRUE); g_string_free (data->property_blob, TRUE); data->signal_blob = NULL; data->property_blob = NULL; return TRUE; io_lose: return FALSE; } static gboolean generate_glue (BaseInfo *base, DBusBindingToolCData *data, GError **error) { if (base_info_get_type (base) == INFO_TYPE_NODE) { if (!generate_glue_list (node_info_get_nodes ((NodeInfo *) base), data, error)) return FALSE; if (!generate_glue_list (node_info_get_interfaces ((NodeInfo *) base), data, error)) return FALSE; } else { GIOChannel *channel; InterfaceInfo *interface; GSList *methods; GSList *signals; GSList *properties; GSList *tmp; const char *interface_c_name; GString *object_introspection_data_blob; channel = data->channel; object_introspection_data_blob = data->blob; interface = (InterfaceInfo *) base; interface_c_name = interface_info_get_annotation (interface, DBUS_GLIB_ANNOTATION_C_SYMBOL); if (interface_c_name == NULL) { if (data->prefix == NULL) return TRUE; interface_c_name = data->prefix; } methods = interface_info_get_methods (interface); /* Table of marshalled methods. */ for (tmp = methods; tmp != NULL; tmp = g_slist_next (tmp)) { MethodInfo *method; char *marshaller_name; char *method_c_name; gboolean async = FALSE; GSList *args; gboolean found_retval = FALSE; guint found_out_args = 0; method = (MethodInfo *) tmp->data; method_c_name = g_strdup (method_info_get_annotation (method, DBUS_GLIB_ANNOTATION_C_SYMBOL)); if (method_c_name == NULL) { char *method_name_uscored; method_name_uscored = _dbus_gutils_wincaps_to_uscore (method_info_get_name (method)); method_c_name = g_strdup_printf ("%s_%s", interface_c_name, method_name_uscored); g_free (method_name_uscored); } if (!write_printf_to_iochannel (" { (GCallback) %s, ", channel, error, method_c_name)) { g_free (method_c_name); goto io_lose; } g_free (method_c_name); marshaller_name = compute_marshaller_name (method, data->prefix, error); if (!marshaller_name) goto io_lose; if (!write_printf_to_iochannel ("%s, %d },\n", channel, error, marshaller_name, object_introspection_data_blob->len)) { g_free (marshaller_name); goto io_lose; } if (method_info_get_annotation (method, DBUS_GLIB_ANNOTATION_ASYNC) != NULL) async = TRUE; /* Object method data blob format: * \0\0(\0\0\0)*\0 */ g_string_append (object_introspection_data_blob, interface_info_get_name (interface)); g_string_append_c (object_introspection_data_blob, '\0'); g_string_append (object_introspection_data_blob, method_info_get_name (method)); g_string_append_c (object_introspection_data_blob, '\0'); g_string_append_c (object_introspection_data_blob, async ? 'A' : 'S'); g_string_append_c (object_introspection_data_blob, '\0'); for (args = method_info_get_args (method); args; args = args->next) { ArgInfo *arg; char direction; const char *returnval_annotation; arg = args->data; g_string_append (object_introspection_data_blob, arg_info_get_name (arg)); g_string_append_c (object_introspection_data_blob, '\0'); switch (arg_info_get_direction (arg)) { case ARG_IN: direction = 'I'; break; case ARG_OUT: direction = 'O'; found_out_args++; break; case ARG_INVALID: default: g_assert_not_reached (); direction = 0; /* silence gcc */ break; } g_string_append_c (object_introspection_data_blob, direction); g_string_append_c (object_introspection_data_blob, '\0'); if (arg_info_get_annotation (arg, DBUS_GLIB_ANNOTATION_CONST) != NULL) { if (arg_info_get_direction (arg) == ARG_IN) { g_set_error (error, DBUS_BINDING_TOOL_ERROR, DBUS_BINDING_TOOL_ERROR_INVALID_ANNOTATION, "Input argument \"%s\" cannot have const annotation in method \"%s\" of interface \"%s\"\n", arg_info_get_name (arg), method_info_get_name (method), interface_info_get_name (interface)); return FALSE; } g_string_append_c (object_introspection_data_blob, 'C'); g_string_append_c (object_introspection_data_blob, '\0'); } else if (arg_info_get_direction (arg) == ARG_OUT) { g_string_append_c (object_introspection_data_blob, 'F'); g_string_append_c (object_introspection_data_blob, '\0'); } returnval_annotation = arg_info_get_annotation (arg, DBUS_GLIB_ANNOTATION_RETURNVAL); if (returnval_annotation != NULL) { GType gtype; if (found_retval) { g_set_error (error, DBUS_BINDING_TOOL_ERROR, DBUS_BINDING_TOOL_ERROR_INVALID_ANNOTATION, "Multiple arguments with return value annotation in method \"%s\" of interface \"%s\"\n", method_info_get_name (method), interface_info_get_name (interface)); return FALSE; } found_retval = TRUE; if (arg_info_get_direction (arg) == ARG_IN) { g_set_error (error, DBUS_BINDING_TOOL_ERROR, DBUS_BINDING_TOOL_ERROR_INVALID_ANNOTATION, "Input argument \"%s\" cannot have return value annotation in method \"%s\" of interface \"%s\"\n", arg_info_get_name (arg), method_info_get_name (method), interface_info_get_name (interface)); return FALSE; } if (found_out_args != 1) { g_set_error (error, DBUS_BINDING_TOOL_ERROR, DBUS_BINDING_TOOL_ERROR_INVALID_ANNOTATION, "An output after the first cannot have the ReturnVal annotation, in argument \"%s\" of method \"%s\" of interface \"%s\"\n", arg_info_get_name (arg), method_info_get_name (method), interface_info_get_name (interface)); return FALSE; } if (!strcmp ("", returnval_annotation)) g_string_append_c (object_introspection_data_blob, 'R'); else if (!strcmp ("error", returnval_annotation)) { gtype = _dbus_gtype_from_signature (arg_info_get_type (arg), TRUE); if (!_dbus_gtype_can_signal_error (gtype)) { g_set_error (error, DBUS_BINDING_TOOL_ERROR, DBUS_BINDING_TOOL_ERROR_INVALID_ANNOTATION, "Output argument \"%s\" cannot signal error with type \"%s\" in method \"%s\" of interface \"%s\"\n", arg_info_get_name (arg), g_type_name (gtype), method_info_get_name (method), interface_info_get_name (interface)); return FALSE; } g_string_append_c (object_introspection_data_blob, 'E'); } else { g_set_error (error, DBUS_BINDING_TOOL_ERROR, DBUS_BINDING_TOOL_ERROR_INVALID_ANNOTATION, "Invalid ReturnVal annotation for argument \"%s\" in method \"%s\" of interface \"%s\"\n", arg_info_get_name (arg), method_info_get_name (method), interface_info_get_name (interface)); return FALSE; } g_string_append_c (object_introspection_data_blob, '\0'); } else if (arg_info_get_direction (arg) == ARG_OUT) { g_string_append_c (object_introspection_data_blob, 'N'); g_string_append_c (object_introspection_data_blob, '\0'); } g_string_append (object_introspection_data_blob, arg_info_get_type (arg)); g_string_append_c (object_introspection_data_blob, '\0'); } g_string_append_c (object_introspection_data_blob, '\0'); data->count++; } signals = interface_info_get_signals (interface); for (tmp = signals; tmp != NULL; tmp = g_slist_next (tmp)) { SignalInfo *sig; sig = tmp->data; g_string_append (data->signal_blob, interface_info_get_name (interface)); g_string_append_c (data->signal_blob, '\0'); g_string_append (data->signal_blob, signal_info_get_name (sig)); g_string_append_c (data->signal_blob, '\0'); } properties = interface_info_get_properties (interface); for (tmp = properties; tmp != NULL; tmp = g_slist_next (tmp)) { PropertyInfo *prop; PropertyAccessFlags access_flags; const char *access_string; char *uscored; prop = tmp->data; access_flags = property_info_get_access (prop); if ((access_flags & PROPERTY_READ) && (access_flags & PROPERTY_WRITE)) access_string = "readwrite"; else if (access_flags & PROPERTY_READ) access_string = "read"; else if (access_flags & PROPERTY_WRITE) access_string = "write"; else continue; /* We append both in the blob so we have to malloc() less when processing * properties */ uscored = _dbus_gutils_wincaps_to_uscore (property_info_get_name (prop)); g_string_append (data->property_blob, interface_info_get_name (interface)); g_string_append_c (data->property_blob, '\0'); g_string_append (data->property_blob, property_info_get_name (prop)); g_string_append_c (data->property_blob, '\0'); g_string_append (data->property_blob, uscored); g_string_append_c (data->property_blob, '\0'); g_string_append (data->property_blob, access_string); g_string_append_c (data->property_blob, '\0'); g_free (uscored); } } return TRUE; io_lose: return FALSE; } static void write_marshaller (gpointer key, gpointer value, gpointer user_data) { DBusBindingToolCData *data; const char *marshaller; gsize bytes_written; data = user_data; marshaller = key; if (data->error && *data->error) return; if (g_io_channel_write_chars (data->channel, marshaller, -1, &bytes_written, data->error) == G_IO_STATUS_NORMAL) g_io_channel_write_chars (data->channel, "\n", -1, &bytes_written, data->error); } gboolean dbus_binding_tool_output_glib_server (BaseInfo *info, GIOChannel *channel, const char *prefix, GError **error) { gboolean ret; GPtrArray *argv; gint child_stdout; GIOChannel *genmarshal_stdout; GPid child_pid; DBusBindingToolCData data; char *tempfile_name; gint tempfile_fd; GIOStatus iostatus; char buf[4096]; gsize bytes_read, bytes_written; memset (&data, 0, sizeof (data)); dbus_g_type_specialized_init (); _dbus_g_type_specialized_builtins_init (); data.prefix = prefix; data.generated = g_hash_table_new_full (g_str_hash, g_str_equal, (GDestroyNotify) g_free, NULL); data.error = error; genmarshal_stdout = NULL; tempfile_name = NULL; if (!gather_marshallers (info, &data, error)) goto io_lose; tempfile_fd = g_file_open_tmp ("dbus-binding-tool-c-marshallers.XXXXXX", &tempfile_name, error); if (tempfile_fd < 0) goto io_lose; data.channel = g_io_channel_unix_new (tempfile_fd); if (!g_io_channel_set_encoding (data.channel, NULL, error)) goto io_lose; g_hash_table_foreach (data.generated, write_marshaller, &data); if (error && *error != NULL) { ret = FALSE; g_io_channel_shutdown (data.channel, TRUE, error); g_io_channel_unref (data.channel); goto io_lose; } g_io_channel_shutdown (data.channel, TRUE, error); g_io_channel_unref (data.channel); /* Now spawn glib-genmarshal to insert all our required marshallers */ argv = g_ptr_array_new (); g_ptr_array_add (argv, "glib-genmarshal"); g_ptr_array_add (argv, "--header"); g_ptr_array_add (argv, "--body"); g_ptr_array_add (argv, "--skip-source"); g_ptr_array_add (argv, g_strdup_printf ("--prefix=%s%s", MARSHAL_PREFIX, prefix)); g_ptr_array_add (argv, tempfile_name); g_ptr_array_add (argv, NULL); if (!g_spawn_async_with_pipes (NULL, (char**)argv->pdata, NULL, G_SPAWN_SEARCH_PATH, NULL, NULL, &child_pid, NULL, &child_stdout, NULL, error)) { g_ptr_array_free (argv, TRUE); goto io_lose; } g_ptr_array_free (argv, TRUE); genmarshal_stdout = g_io_channel_unix_new (child_stdout); if (!g_io_channel_set_encoding (genmarshal_stdout, NULL, error)) goto io_lose; WRITE_OR_LOSE ("/* Generated by dbus-binding-tool; do not edit! */\n\n"); while ((iostatus = g_io_channel_read_chars (genmarshal_stdout, buf, sizeof (buf), &bytes_read, error)) == G_IO_STATUS_NORMAL) if (g_io_channel_write_chars (channel, buf, bytes_read, &bytes_written, error) != G_IO_STATUS_NORMAL) goto io_lose; if (iostatus != G_IO_STATUS_EOF) goto io_lose; g_io_channel_shutdown (genmarshal_stdout, TRUE, error); WRITE_OR_LOSE ("#include \n"); data.channel = channel; g_io_channel_ref (data.channel); if (!generate_glue_toplevel (info, &data, error)) goto io_lose; ret = TRUE; cleanup: if (tempfile_name) unlink (tempfile_name); g_free (tempfile_name); if (genmarshal_stdout) g_io_channel_unref (genmarshal_stdout); if (data.channel) g_io_channel_unref (data.channel); g_hash_table_destroy (data.generated); return ret; io_lose: ret = FALSE; goto cleanup; } static char * iface_to_c_prefix (const char *iface) { char **components; char **component; GString *ret; gboolean first; components = g_strsplit (iface, ".", 0); first = TRUE; ret = g_string_new (""); for (component = components; *component; component++) { if (!first) g_string_append_c (ret, '_'); else first = FALSE; g_string_append (ret, *component); } g_strfreev (components); return g_string_free (ret, FALSE); } static char * compute_client_method_name (const char *iface_prefix, MethodInfo *method) { char *method_name_uscored, *ret; method_name_uscored = _dbus_gutils_wincaps_to_uscore (method_info_get_name (method)); ret = g_strdup_printf ("%s_%s", iface_prefix, method_name_uscored); g_free (method_name_uscored); return ret; } static gboolean write_formal_parameters (InterfaceInfo *iface, MethodInfo *method, GIOChannel *channel, GError **error) { GSList *args; for (args = method_info_get_args (method); args; args = args->next) { ArgInfo *arg; const char *type_str; const char *type_suffix; GType gtype; int direction; arg = args->data; WRITE_OR_LOSE (", "); direction = arg_info_get_direction (arg); gtype = _dbus_gtype_from_signature (arg_info_get_type (arg), TRUE); if (gtype == G_TYPE_INVALID) { g_set_error (error, DBUS_BINDING_TOOL_ERROR, DBUS_BINDING_TOOL_ERROR_UNSUPPORTED_CONVERSION, "Unsupported conversion from D-BUS type signature \"%s\" to glib C type in method \"%s\" of interface \"%s\"", arg_info_get_type (arg), method_info_get_name (method), interface_info_get_name (iface)); return FALSE; } type_str = dbus_g_type_get_c_name (gtype); g_assert (type_str); /* Variants are special...*/ if (gtype == G_TYPE_VALUE) { if (direction == ARG_IN) type_suffix = "*"; else type_suffix = ""; } else if ((g_type_is_a (gtype, G_TYPE_BOXED) || g_type_is_a (gtype, G_TYPE_OBJECT) || g_type_is_a (gtype, G_TYPE_POINTER))) type_suffix = "*"; else type_suffix = ""; switch (direction) { case ARG_IN: if (!write_printf_to_iochannel ("const %s%s IN_%s", channel, error, type_str, type_suffix, arg_info_get_name (arg))) goto io_lose; break; case ARG_OUT: if (!write_printf_to_iochannel ("%s%s* OUT_%s", channel, error, type_str, type_suffix, arg_info_get_name (arg))) goto io_lose; break; case ARG_INVALID: break; } } return TRUE; io_lose: return FALSE; } #define MAP_FUNDAMENTAL(NAME) \ case G_TYPE_ ## NAME: \ return g_strdup ("G_TYPE_" #NAME); #define MAP_KNOWN(NAME) \ if (gtype == NAME) \ return g_strdup (#NAME) static char * dbus_g_type_get_lookup_function (GType gtype) { char *type_lookup; switch (gtype) { MAP_FUNDAMENTAL(CHAR); MAP_FUNDAMENTAL(UCHAR); MAP_FUNDAMENTAL(BOOLEAN); MAP_FUNDAMENTAL(LONG); MAP_FUNDAMENTAL(ULONG); MAP_FUNDAMENTAL(INT); MAP_FUNDAMENTAL(UINT); MAP_FUNDAMENTAL(INT64); MAP_FUNDAMENTAL(UINT64); MAP_FUNDAMENTAL(FLOAT); MAP_FUNDAMENTAL(DOUBLE); MAP_FUNDAMENTAL(STRING); } if (dbus_g_type_is_collection (gtype)) { GType elt_gtype; char *sublookup; elt_gtype = dbus_g_type_get_collection_specialization (gtype); sublookup = dbus_g_type_get_lookup_function (elt_gtype); g_assert (sublookup); if (_dbus_g_type_is_fixed (elt_gtype)) { type_lookup = g_strdup_printf ("dbus_g_type_get_collection " "(\"GArray\", %s)", sublookup); } else { type_lookup = g_strdup_printf ("dbus_g_type_get_collection " "(\"GPtrArray\", %s)", sublookup); } g_free (sublookup); return type_lookup; } else if (dbus_g_type_is_map (gtype)) { GType key_gtype; char *key_lookup; GType value_gtype; char *value_lookup; key_gtype = dbus_g_type_get_map_key_specialization (gtype); value_gtype = dbus_g_type_get_map_value_specialization (gtype); key_lookup = dbus_g_type_get_lookup_function (key_gtype); g_assert (key_lookup); value_lookup = dbus_g_type_get_lookup_function (value_gtype); g_assert (value_lookup); type_lookup = g_strdup_printf ("dbus_g_type_get_map (\"GHashTable\", %s, %s)", key_lookup, value_lookup); g_free (key_lookup); g_free (value_lookup); return type_lookup; } else if (dbus_g_type_is_struct (gtype)) { GType value_gtype; GString *string; char *value_lookup = NULL; guint size, i; string = g_string_new ("dbus_g_type_get_struct (\"GValueArray\""); size = dbus_g_type_get_struct_size (gtype); for (i=0; i < size; i++) { value_gtype = dbus_g_type_get_struct_member_type(gtype, i); value_lookup = dbus_g_type_get_lookup_function (value_gtype); g_assert (value_lookup); g_string_append_printf (string, ", %s", value_lookup); g_free (value_lookup); } g_string_append (string, ", G_TYPE_INVALID)"); return g_string_free (string, FALSE); } MAP_KNOWN(G_TYPE_VALUE); MAP_KNOWN(G_TYPE_STRV); MAP_KNOWN(G_TYPE_VALUE_ARRAY); MAP_KNOWN(DBUS_TYPE_G_PROXY); MAP_KNOWN(DBUS_TYPE_G_OBJECT_PATH); MAP_KNOWN(DBUS_TYPE_G_SIGNATURE); return NULL; } #undef MAP_FUNDAMENTAL #undef MAP_KNOWN static gboolean write_args_for_direction (InterfaceInfo *iface, MethodInfo *method, GIOChannel *channel, int direction, GError **error) { GSList *args; char *type_lookup = NULL; for (args = method_info_get_args (method); args; args = args->next) { ArgInfo *arg; GType gtype; arg = args->data; if (direction != arg_info_get_direction (arg)) continue; gtype = _dbus_gtype_from_signature (arg_info_get_type (arg), TRUE); g_assert (gtype != G_TYPE_INVALID); type_lookup = dbus_g_type_get_lookup_function (gtype); g_assert (type_lookup != NULL); switch (direction) { case ARG_IN: if (!write_printf_to_iochannel ("%s, IN_%s, ", channel, error, type_lookup, arg_info_get_name (arg))) goto io_lose; break; case ARG_OUT: if (!write_printf_to_iochannel ("%s, OUT_%s, ", channel, error, type_lookup, arg_info_get_name (arg))) goto io_lose; break; case ARG_INVALID: break; } g_free (type_lookup); } return TRUE; io_lose: g_free (type_lookup); return FALSE; } static gboolean check_supported_parameters (MethodInfo *method) { GSList *args; for (args = method_info_get_args (method); args; args = args->next) { ArgInfo *arg; GType gtype; arg = args->data; gtype = _dbus_gtype_from_signature (arg_info_get_type (arg), TRUE); if (gtype == G_TYPE_INVALID) return FALSE; } return TRUE; } static gboolean write_untyped_out_args (InterfaceInfo *iface, MethodInfo *method, GIOChannel *channel, GError **error) { GSList *args; for (args = method_info_get_args (method); args; args = args->next) { ArgInfo *arg; arg = args->data; if (arg_info_get_direction (arg) != ARG_OUT) continue; if (!write_printf_to_iochannel ("OUT_%s, ", channel, error, arg_info_get_name (arg))) goto io_lose; } return TRUE; io_lose: return FALSE; } static gboolean write_formal_declarations_for_direction (InterfaceInfo *iface, MethodInfo *method, GIOChannel *channel, const int direction, GError **error) { GSList *args; for (args = method_info_get_args (method); args; args = args->next) { ArgInfo *arg; GType gtype; const char *type_str, *type_suffix, *type_initializer = ""; int dir; arg = args->data; dir = arg_info_get_direction (arg); gtype = _dbus_gtype_from_signature (arg_info_get_type (arg), TRUE); type_str = dbus_g_type_get_c_name (gtype); if (!type_str) { g_set_error (error, DBUS_BINDING_TOOL_ERROR, DBUS_BINDING_TOOL_ERROR_UNSUPPORTED_CONVERSION, "Unsupported conversion from D-BUS type signature \"%s\" to glib C type in method \"%s\" of interface \"%s\"", arg_info_get_type (arg), method_info_get_name (method), interface_info_get_name (iface)); return FALSE; } /* Variants are special...*/ if (gtype == G_TYPE_VALUE) { if (direction == ARG_IN) type_suffix = "*"; else { type_suffix = ""; type_initializer = " = { 0, }"; } } else if ((g_type_is_a (gtype, G_TYPE_BOXED) || g_type_is_a (gtype, G_TYPE_OBJECT) || g_type_is_a (gtype, G_TYPE_POINTER))) type_suffix = "*"; else type_suffix = ""; if (direction != dir) continue; switch (dir) { case ARG_IN: if (!write_printf_to_iochannel (" %s%s IN_%s;\n", channel, error, type_str, type_suffix, arg_info_get_name (arg))) goto io_lose; break; case ARG_OUT: if (!write_printf_to_iochannel (" %s%s OUT_%s%s;\n", channel, error, type_str, type_suffix, arg_info_get_name (arg), type_initializer)) goto io_lose; break; case ARG_INVALID: break; } } return TRUE; io_lose: return FALSE; } static gboolean write_formal_parameters_for_direction (InterfaceInfo *iface, MethodInfo *method, int dir, GIOChannel *channel, GError **error) { GSList *args; for (args = method_info_get_args (method); args; args = args->next) { ArgInfo *arg; const char *type_str; const char *type_suffix; GType gtype; int direction; arg = args->data; direction = arg_info_get_direction (arg); if (dir != direction) continue; WRITE_OR_LOSE (", "); gtype = _dbus_gtype_from_signature (arg_info_get_type (arg), TRUE); type_str = dbus_g_type_get_c_name (gtype); /* Variants are special...*/ if (gtype == G_TYPE_VALUE) { if (direction == ARG_IN) type_suffix = "*"; else type_suffix = ""; } else if ((g_type_is_a (gtype, G_TYPE_BOXED) || g_type_is_a (gtype, G_TYPE_OBJECT) || g_type_is_a (gtype, G_TYPE_POINTER))) type_suffix = "*"; else type_suffix = ""; if (!type_str) { g_set_error (error, DBUS_BINDING_TOOL_ERROR, DBUS_BINDING_TOOL_ERROR_UNSUPPORTED_CONVERSION, "Unsupported conversion from D-BUS type signature \"%s\" to glib C type in method \"%s\" of interface \"%s\"", arg_info_get_type (arg), method_info_get_name (method), interface_info_get_name (iface)); return FALSE; } switch (direction) { case ARG_IN: if (!write_printf_to_iochannel ("const %s%s IN_%s", channel, error, type_str, type_suffix, arg_info_get_name (arg))) goto io_lose; break; case ARG_OUT: if (!write_printf_to_iochannel ("%s%s* OUT_%s", channel, error, type_str, type_suffix, arg_info_get_name (arg))) goto io_lose; break; case ARG_INVALID: break; } } return TRUE; io_lose: return FALSE; } static gboolean write_typed_args_for_direction (InterfaceInfo *iface, MethodInfo *method, GIOChannel *channel, const int direction, GError **error) { GSList *args; char *type_lookup = NULL; for (args = method_info_get_args (method); args; args = args->next) { ArgInfo *arg; int dir; GType gtype; arg = args->data; dir = arg_info_get_direction (arg); if (dir != direction) continue; gtype = _dbus_gtype_from_signature (arg_info_get_type (arg), TRUE); type_lookup = dbus_g_type_get_lookup_function (gtype); if (!write_printf_to_iochannel ("%s, &%s_%s, ", channel, error, type_lookup, direction == ARG_IN ? "IN" : "OUT", arg_info_get_name (arg))) goto io_lose; g_free (type_lookup); } return TRUE; io_lose: g_free (type_lookup); return FALSE; } static gboolean write_async_method_client (GIOChannel *channel, InterfaceInfo *interface, MethodInfo *method, GError **error) { char *method_name, *iface_prefix; const char *interface_c_name; iface_prefix = iface_to_c_prefix (interface_info_get_name (interface)); interface_c_name = interface_info_get_annotation (interface, DBUS_GLIB_ANNOTATION_CLIENT_C_SYMBOL); if (interface_c_name == NULL) { interface_c_name = (const char *) iface_prefix; } method_name = g_strdup (method_info_get_annotation (method, DBUS_GLIB_ANNOTATION_CLIENT_C_SYMBOL)); if (method_name == NULL) { method_name = compute_client_method_name (interface_c_name, method); } g_free(iface_prefix); /* Write the typedef for the client callback */ if (!write_printf_to_iochannel ("typedef void (*%s_reply) (DBusGProxy *proxy, ", channel, error, method_name)) goto io_lose; { GSList *args; for (args = method_info_get_args (method); args; args = args->next) { ArgInfo *arg; const char *type_suffix, *type_str; GType gtype; arg = args->data; if (arg_info_get_direction (arg) != ARG_OUT) continue; gtype = _dbus_gtype_from_signature (arg_info_get_type (arg), TRUE); if (gtype != G_TYPE_VALUE && (g_type_is_a (gtype, G_TYPE_BOXED) || g_type_is_a (gtype, G_TYPE_OBJECT) || g_type_is_a (gtype, G_TYPE_POINTER))) type_suffix = "*"; else type_suffix = ""; type_str = dbus_g_type_get_c_name (_dbus_gtype_from_signature (arg_info_get_type (arg), TRUE)); if (!write_printf_to_iochannel ("%s %sOUT_%s, ", channel, error, type_str, type_suffix, arg_info_get_name (arg))) goto io_lose; } } WRITE_OR_LOSE ("GError *error, gpointer userdata);\n\n"); /* Write the callback when the call returns */ WRITE_OR_LOSE ("static void\n"); if (!write_printf_to_iochannel ("%s_async_callback (DBusGProxy *proxy, DBusGProxyCall *call, void *user_data)\n", channel, error, method_name)) goto io_lose; WRITE_OR_LOSE ("{\n"); WRITE_OR_LOSE (" DBusGAsyncData *data = (DBusGAsyncData*) user_data;\n GError *error = NULL;\n"); if (!write_formal_declarations_for_direction (interface, method, channel, ARG_OUT, error)) goto io_lose; /* TODO: handle return boolean of end_call */ WRITE_OR_LOSE (" dbus_g_proxy_end_call (proxy, call, &error, "); if (!write_typed_args_for_direction (interface, method, channel, ARG_OUT, error)) goto io_lose; WRITE_OR_LOSE("G_TYPE_INVALID);\n"); if (!write_printf_to_iochannel (" (*(%s_reply)data->cb) (proxy, ", channel, error, method_name)) goto io_lose; if (!write_untyped_out_args (interface, method, channel, error)) goto io_lose; WRITE_OR_LOSE ("error, data->userdata);\n"); WRITE_OR_LOSE (" return;\n}\n\n"); /* Write the main wrapper function */ WRITE_OR_LOSE ("static\n#ifdef G_HAVE_INLINE\ninline\n#endif\nDBusGProxyCall*\n"); if (!write_printf_to_iochannel ("%s_async (DBusGProxy *proxy", channel, error, method_name)) goto io_lose; if (!write_formal_parameters_for_direction (interface, method, ARG_IN, channel, error)) goto io_lose; if (!write_printf_to_iochannel (", %s_reply callback, gpointer userdata)\n\n", channel, error, method_name)) goto io_lose; WRITE_OR_LOSE ("{\n"); WRITE_OR_LOSE (" DBusGAsyncData *stuff;\n stuff = g_slice_new (DBusGAsyncData);\n stuff->cb = G_CALLBACK (callback);\n stuff->userdata = userdata;\n"); if (!write_printf_to_iochannel (" return dbus_g_proxy_begin_call (proxy, \"%s\", %s_async_callback, stuff, _dbus_glib_async_data_free, ", channel, error, method_info_get_name (method), method_name)) goto io_lose; if (!write_args_for_direction (interface, method, channel, ARG_IN, error)) goto io_lose; WRITE_OR_LOSE ("G_TYPE_INVALID);\n}\n"); g_free (method_name); return TRUE; io_lose: g_free (method_name); return FALSE; } static gboolean generate_client_glue_list (GSList *list, DBusBindingToolCData *data, GError **error) { GSList *tmp; tmp = list; while (tmp != NULL) { if (!generate_client_glue (tmp->data, data, error)) return FALSE; tmp = tmp->next; } return TRUE; } static gboolean generate_client_glue (BaseInfo *base, DBusBindingToolCData *data, GError **error) { char *iface_prefix; char *method_c_name; iface_prefix = NULL; method_c_name = NULL; if (base_info_get_type (base) == INFO_TYPE_NODE) { if (!generate_client_glue_list (node_info_get_nodes ((NodeInfo *) base), data, error)) return FALSE; if (!generate_client_glue_list (node_info_get_interfaces ((NodeInfo *) base), data, error)) return FALSE; } else { GIOChannel *channel; InterfaceInfo *interface; GSList *methods; GSList *tmp; const char *interface_c_name; channel = data->channel; interface = (InterfaceInfo *) base; methods = interface_info_get_methods (interface); iface_prefix = iface_to_c_prefix (interface_info_get_name (interface)); interface_c_name = interface_info_get_annotation (interface, DBUS_GLIB_ANNOTATION_CLIENT_C_SYMBOL); if (interface_c_name == NULL) { interface_c_name = (const char *) iface_prefix; } if (!write_printf_to_iochannel ("#ifndef DBUS_GLIB_CLIENT_WRAPPERS_%s\n" "#define DBUS_GLIB_CLIENT_WRAPPERS_%s\n\n", channel, error, iface_prefix, iface_prefix)) goto io_lose; for (tmp = methods; tmp != NULL; tmp = g_slist_next (tmp)) { MethodInfo *method; gboolean is_noreply; method = (MethodInfo *) tmp->data; method_c_name = g_strdup (method_info_get_annotation (method, DBUS_GLIB_ANNOTATION_CLIENT_C_SYMBOL)); if (method_c_name == NULL) { method_c_name = compute_client_method_name (interface_c_name, method); } is_noreply = method_info_get_annotation (method, DBUS_GLIB_ANNOTATION_NOREPLY) != NULL; if (data->ignore_unsupported && !check_supported_parameters (method)) { g_warning ("Ignoring unsupported signature in method \"%s\" of interface \"%s\"\n", method_info_get_name (method), interface_info_get_name (interface)); g_free (method_c_name); method_c_name = NULL; continue; } WRITE_OR_LOSE ("static\n#ifdef G_HAVE_INLINE\ninline\n#endif\ngboolean\n"); if (!write_printf_to_iochannel ("%s (DBusGProxy *proxy", channel, error, method_c_name)) goto io_lose; g_free (method_c_name); method_c_name = NULL; if (!write_formal_parameters (interface, method, channel, error)) goto io_lose; WRITE_OR_LOSE (", GError **error)\n\n"); WRITE_OR_LOSE ("{\n"); if (is_noreply) { if (!write_printf_to_iochannel (" dbus_g_proxy_call_no_reply (proxy, \"%s\", ", channel, error, method_info_get_name (method))) goto io_lose; if (!write_args_for_direction (interface, method, channel, ARG_IN, error)) goto io_lose; WRITE_OR_LOSE ("G_TYPE_INVALID, "); if (!write_args_for_direction (interface, method, channel, ARG_OUT, error)) goto io_lose; WRITE_OR_LOSE ("G_TYPE_INVALID);\n"); WRITE_OR_LOSE (" return TRUE;\n}\n\n"); } else { if (!write_printf_to_iochannel (" return dbus_g_proxy_call (proxy, \"%s\", ", channel, error, method_info_get_name (method))) goto io_lose; WRITE_OR_LOSE ("error, "); if (!write_args_for_direction (interface, method, channel, ARG_IN, error)) goto io_lose; WRITE_OR_LOSE ("G_TYPE_INVALID, "); if (!write_args_for_direction (interface, method, channel, ARG_OUT, error)) goto io_lose; WRITE_OR_LOSE ("G_TYPE_INVALID);\n}\n\n"); } write_async_method_client (channel, interface, method, error); } if (!write_printf_to_iochannel ("#endif /* defined DBUS_GLIB_CLIENT_WRAPPERS_%s */\n\n", channel, error, iface_prefix)) goto io_lose; g_free (iface_prefix); } return TRUE; io_lose: g_free (method_c_name); g_free (iface_prefix); return FALSE; } gboolean dbus_binding_tool_output_glib_client (BaseInfo *info, GIOChannel *channel, gboolean ignore_unsupported, GError **error) { DBusBindingToolCData data; gboolean ret; memset (&data, 0, sizeof (data)); data.channel = channel; data.ignore_unsupported = ignore_unsupported; dbus_g_type_specialized_init (); _dbus_g_type_specialized_builtins_init (); WRITE_OR_LOSE ("/* Generated by dbus-binding-tool; do not edit! */\n\n"); WRITE_OR_LOSE ("#include \n"); WRITE_OR_LOSE ("#include \n\n"); WRITE_OR_LOSE ("G_BEGIN_DECLS\n\n"); WRITE_OR_LOSE ("#ifndef _DBUS_GLIB_ASYNC_DATA_FREE\n"); WRITE_OR_LOSE ("#define _DBUS_GLIB_ASYNC_DATA_FREE\n"); WRITE_OR_LOSE ("static\n#ifdef G_HAVE_INLINE\ninline\n#endif\nvoid\n"); WRITE_OR_LOSE ("_dbus_glib_async_data_free (gpointer stuff)\n{\n\tg_slice_free (DBusGAsyncData, stuff);\n}\n"); WRITE_OR_LOSE ("#endif\n\n"); ret = generate_client_glue (info, &data, error); if (!ret) goto io_lose; WRITE_OR_LOSE ("G_END_DECLS\n"); return ret; io_lose: return FALSE; } dbus-glib-0.100.2/dbus/dbus-gparser.c0000644000175000017500000005554012107524614014155 00000000000000/* -*- mode: C; c-file-style: "gnu" -*- */ /* dbus-gparser.c parse DBus description files * * Copyright (C) 2003, 2005 Red Hat, Inc. * * Licensed under the Academic Free License version 2.1 * * 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 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * */ #include #include "dbus-gparser.h" #include "dbus/dbus-glib-lowlevel.h" #include "dbus-gidl.h" #include "dbus-gobject.h" #include "dbus/dbus-signature.h" #include #define ELEMENT_IS(name) (strcmp (element_name, (name)) == 0) typedef struct { const char *name; const char **retloc; } LocateAttr; static gboolean locate_attributes (const char *element_name, const char **attribute_names, const char **attribute_values, GError **error, const char *first_attribute_name, const char **first_attribute_retloc, ...) { va_list args; const char *name; const char **retloc; int n_attrs; #define MAX_ATTRS 24 LocateAttr attrs[MAX_ATTRS]; gboolean retval; int i; g_return_val_if_fail (first_attribute_name != NULL, FALSE); g_return_val_if_fail (first_attribute_retloc != NULL, FALSE); retval = TRUE; n_attrs = 1; attrs[0].name = first_attribute_name; attrs[0].retloc = first_attribute_retloc; *first_attribute_retloc = NULL; va_start (args, first_attribute_retloc); name = va_arg (args, const char*); retloc = va_arg (args, const char**); while (name != NULL) { if (retloc == NULL) { va_end (args); return FALSE; } g_assert (n_attrs < MAX_ATTRS); attrs[n_attrs].name = name; attrs[n_attrs].retloc = retloc; n_attrs += 1; *retloc = NULL; name = va_arg (args, const char*); retloc = va_arg (args, const char**); } va_end (args); i = 0; while (attribute_names[i]) { int j; gboolean found; found = FALSE; j = 0; while (j < n_attrs) { if (strcmp (attrs[j].name, attribute_names[i]) == 0) { retloc = attrs[j].retloc; if (*retloc != NULL) { g_set_error (error, G_MARKUP_ERROR, G_MARKUP_ERROR_PARSE, "Attribute \"%s\" repeated twice on the same <%s> element", attrs[j].name, element_name); retval = FALSE; goto out; } *retloc = attribute_values[i]; found = TRUE; } ++j; } if (!found) { /* We want to passthrough namespaced XML nodes that we don't know anything about. */ if (strchr (attribute_names[i], ':') == NULL) { g_set_error (error, G_MARKUP_ERROR, G_MARKUP_ERROR_PARSE, "Attribute \"%s\" is invalid on <%s> element in this context", attribute_names[i], element_name); retval = FALSE; goto out; } } ++i; } out: return retval; } #if 0 static gboolean check_no_attributes (const char *element_name, const char **attribute_names, const char **attribute_values, GError **error) { if (attribute_names[0] != NULL) { g_set_error (error, G_MARKUP_ERROR, G_MARKUP_ERROR_PARSE, "Attribute \"%s\" is invalid on <%s> element in this context", attribute_names[0], element_name); return FALSE; } return TRUE; } #endif struct Parser { int refcount; NodeInfo *result; /* Filled in when we pop the last node */ GSList *node_stack; InterfaceInfo *interface; MethodInfo *method; SignalInfo *signal; PropertyInfo *property; ArgInfo *arg; gboolean in_annotation; guint unknown_namespaced_depth; }; Parser* parser_new (void) { Parser *parser; parser = g_new0 (Parser, 1); parser->refcount = 1; return parser; } Parser * parser_ref (Parser *parser) { parser->refcount += 1; return parser; } void parser_unref (Parser *parser) { parser->refcount -= 1; if (parser->refcount == 0) { if (parser->result) node_info_unref (parser->result); g_free (parser); } } gboolean parser_check_doctype (Parser *parser, const char *doctype, GError **error) { g_return_val_if_fail (error == NULL || *error == NULL, FALSE); if (strcmp (doctype, "node") != 0) { g_set_error (error, G_MARKUP_ERROR, G_MARKUP_ERROR_PARSE, "D-BUS description file has the wrong document type %s, use node or interface", doctype); return FALSE; } else return TRUE; } static gboolean parse_node (Parser *parser, const char *element_name, const char **attribute_names, const char **attribute_values, GError **error) { const char *name; NodeInfo *node; if (parser->interface || parser->method || parser->signal || parser->property || parser->arg || parser->in_annotation) { g_set_error (error, G_MARKUP_ERROR, G_MARKUP_ERROR_PARSE, "Can't put <%s> element here", element_name); return FALSE; } name = NULL; if (!locate_attributes (element_name, attribute_names, attribute_values, error, "name", &name, NULL)) return FALSE; /* Only the root node can have no name */ if (parser->node_stack != NULL && name == NULL) { g_set_error (error, G_MARKUP_ERROR, G_MARKUP_ERROR_PARSE, "\"%s\" attribute required on <%s> element ", "name", element_name); return FALSE; } /* Root element name must be absolute */ if (parser->node_stack == NULL && name && *name != '/') { g_set_error (error, G_MARKUP_ERROR, G_MARKUP_ERROR_PARSE, "\"%s\" attribute on <%s> element must be an absolute object path, \"%s\" not OK", "name", element_name, name); return FALSE; } /* Other element names must not be absolute */ if (parser->node_stack != NULL && name && *name == '/') { g_set_error (error, G_MARKUP_ERROR, G_MARKUP_ERROR_PARSE, "\"%s\" attribute on <%s> element must not be an absolute object path, \"%s\" starts with /", "name", element_name, name); return FALSE; } node = node_info_new (name); if (parser->node_stack != NULL) { node_info_add_node (parser->node_stack->data, node); } parser->node_stack = g_slist_prepend (parser->node_stack, node); return TRUE; } static gboolean parse_interface (Parser *parser, const char *element_name, const char **attribute_names, const char **attribute_values, GError **error) { const char *name; InterfaceInfo *iface; NodeInfo *top; if (parser->interface || parser->method || parser->signal || parser->property || parser->arg || parser->in_annotation || (parser->node_stack == NULL)) { g_set_error (error, G_MARKUP_ERROR, G_MARKUP_ERROR_PARSE, "Can't put <%s> element here", element_name); return FALSE; } name = NULL; if (!locate_attributes (element_name, attribute_names, attribute_values, error, "name", &name, NULL)) return FALSE; if (name == NULL) { g_set_error (error, G_MARKUP_ERROR, G_MARKUP_ERROR_PARSE, "\"%s\" attribute required on <%s> element ", "name", element_name); return FALSE; } top = parser->node_stack->data; iface = interface_info_new (name); node_info_add_interface (top, iface); interface_info_unref (iface); parser->interface = iface; return TRUE; } static gboolean parse_method (Parser *parser, const char *element_name, const char **attribute_names, const char **attribute_values, GError **error) { const char *name; MethodInfo *method; if (parser->interface == NULL || parser->node_stack == NULL || parser->method || parser->signal || parser->property || parser->in_annotation || parser->arg) { g_set_error (error, G_MARKUP_ERROR, G_MARKUP_ERROR_PARSE, "Can't put <%s> element here", element_name); return FALSE; } name = NULL; if (!locate_attributes (element_name, attribute_names, attribute_values, error, "name", &name, NULL)) return FALSE; if (name == NULL) { g_set_error (error, G_MARKUP_ERROR, G_MARKUP_ERROR_PARSE, "\"%s\" attribute required on <%s> element ", "name", element_name); return FALSE; } method = method_info_new (name); interface_info_add_method (parser->interface, method); method_info_unref (method); parser->method = method; return TRUE; } static gboolean parse_signal (Parser *parser, const char *element_name, const char **attribute_names, const char **attribute_values, GError **error) { const char *name; SignalInfo *signal; if (parser->interface == NULL || parser->node_stack == NULL || parser->signal || parser->method || parser->property || parser->in_annotation || parser->arg) { g_set_error (error, G_MARKUP_ERROR, G_MARKUP_ERROR_PARSE, "Can't put <%s> element here", element_name); return FALSE; } name = NULL; if (!locate_attributes (element_name, attribute_names, attribute_values, error, "name", &name, NULL)) return FALSE; if (name == NULL) { g_set_error (error, G_MARKUP_ERROR, G_MARKUP_ERROR_PARSE, "\"%s\" attribute required on <%s> element ", "name", element_name); return FALSE; } signal = signal_info_new (name); interface_info_add_signal (parser->interface, signal); signal_info_unref (signal); parser->signal = signal; return TRUE; } static gboolean validate_signature (const char *str, const char *element_name, GError **error) { DBusError derror; dbus_error_init (&derror); if (!dbus_signature_validate (str, &derror)) { dbus_set_g_error (error, &derror); return FALSE; } return TRUE; } static gboolean parse_property (Parser *parser, const char *element_name, const char **attribute_names, const char **attribute_values, GError **error) { const char *name; const char *access; const char *type; PropertyInfo *property; PropertyAccessFlags access_flags; if (parser->interface == NULL || parser->node_stack == NULL || parser->signal || parser->method || parser->property || parser->in_annotation || parser->arg) { g_set_error (error, G_MARKUP_ERROR, G_MARKUP_ERROR_PARSE, "Can't put <%s> element here", element_name); return FALSE; } name = NULL; if (!locate_attributes (element_name, attribute_names, attribute_values, error, "name", &name, "access", &access, "type", &type, NULL)) return FALSE; if (name == NULL) { g_set_error (error, G_MARKUP_ERROR, G_MARKUP_ERROR_PARSE, "\"%s\" attribute required on <%s> element ", "name", element_name); return FALSE; } if (access == NULL) { g_set_error (error, G_MARKUP_ERROR, G_MARKUP_ERROR_PARSE, "\"%s\" attribute required on <%s> element ", "access", element_name); return FALSE; } if (type == NULL) { g_set_error (error, G_MARKUP_ERROR, G_MARKUP_ERROR_PARSE, "\"%s\" attribute required on <%s> element ", "type", element_name); return FALSE; } if (!validate_signature (type, element_name, error)) return FALSE; access_flags = 0; if (strcmp (access, "readwrite") == 0) access_flags = PROPERTY_READ | PROPERTY_WRITE; else if (strcmp (access, "read") == 0) access_flags = PROPERTY_READ; else if (strcmp (access, "write") == 0) access_flags = PROPERTY_WRITE; else { g_set_error (error, G_MARKUP_ERROR, G_MARKUP_ERROR_PARSE, "access=\"%s\" must have value readwrite, read, or write on %s\n", access, element_name); return FALSE; } property = property_info_new (name, type, access_flags); interface_info_add_property (parser->interface, property); property_info_unref (property); parser->property = property; return TRUE; } static gboolean parse_arg (Parser *parser, const char *element_name, const char **attribute_names, const char **attribute_values, GError **error) { const char *name; const char *type; const char *direction; ArgDirection dir; ArgInfo *arg; char *generated_name; if (!(parser->method || parser->signal) || parser->node_stack == NULL || parser->property || parser->in_annotation || parser->arg) { g_set_error (error, G_MARKUP_ERROR, G_MARKUP_ERROR_PARSE, "Can't put <%s> element here", element_name); return FALSE; } name = NULL; if (!locate_attributes (element_name, attribute_names, attribute_values, error, "name", &name, "type", &type, "direction", &direction, NULL)) return FALSE; /* name can be null for args */ if (type == NULL) { g_set_error (error, G_MARKUP_ERROR, G_MARKUP_ERROR_PARSE, "\"%s\" attribute required on <%s> element ", "type", element_name); return FALSE; } if (direction == NULL) { /* methods default to in, signal to out */ if (parser->method) direction = "in"; else if (parser->signal) direction = "out"; else g_assert_not_reached (); } dir = ARG_INVALID; if (strcmp (direction, "in") == 0) dir = ARG_IN; else if (strcmp (direction, "out") == 0) dir = ARG_OUT; if (dir == ARG_INVALID || (parser->signal && dir == ARG_IN)) { if (parser->signal) g_set_error (error, G_MARKUP_ERROR, G_MARKUP_ERROR_PARSE, "Signals must have direction=\"out\" (just omit the direction attribute)"); else g_set_error (error, G_MARKUP_ERROR, G_MARKUP_ERROR_PARSE, "\"%s\" attribute on <%s> has value \"in\" or \"out\"", "direction", element_name); return FALSE; } if (!validate_signature (type, element_name, error)) return FALSE; generated_name = NULL; if (name == NULL) generated_name = g_strdup_printf ("arg%d", parser->method ? method_info_get_n_args (parser->method) : signal_info_get_n_args (parser->signal)); arg = arg_info_new (name ? name : generated_name, dir, type); if (parser->method) method_info_add_arg (parser->method, arg); else if (parser->signal) signal_info_add_arg (parser->signal, arg); else g_assert_not_reached (); g_free (generated_name); arg_info_unref (arg); parser->arg = arg; return TRUE; } static gboolean parse_annotation (Parser *parser, const char *element_name, const char **attribute_names, const char **attribute_values, GError **error) { const char *name; const char *value; if (!(parser->method || parser->interface || parser->arg || parser->property || parser->signal) || parser->node_stack == NULL || parser->in_annotation) { g_set_error (error, G_MARKUP_ERROR, G_MARKUP_ERROR_PARSE, "Can't put <%s> element here", element_name); return FALSE; } name = NULL; if (!locate_attributes (element_name, attribute_names, attribute_values, error, "name", &name, "value", &value, NULL)) return FALSE; if (name == NULL) { g_set_error (error, G_MARKUP_ERROR, G_MARKUP_ERROR_PARSE, "\"%s\" attribute required on <%s> element ", "name", element_name); return FALSE; } if (value == NULL) { g_set_error (error, G_MARKUP_ERROR, G_MARKUP_ERROR_PARSE, "\"%s\" attribute required on <%s> element ", "value", element_name); return FALSE; } if (parser->arg) arg_info_add_annotation (parser->arg, name, value); else if (parser->method) method_info_add_annotation (parser->method, name, value); else if (parser->interface) interface_info_add_annotation (parser->interface, name, value); else g_assert_not_reached (); parser->in_annotation = TRUE; return TRUE; } gboolean parser_start_element (Parser *parser, const char *element_name, const char **attribute_names, const char **attribute_values, GError **error) { g_return_val_if_fail (error == NULL || *error == NULL, FALSE); if (ELEMENT_IS ("node")) { if (!parse_node (parser, element_name, attribute_names, attribute_values, error)) return FALSE; } else if (ELEMENT_IS ("interface")) { if (!parse_interface (parser, element_name, attribute_names, attribute_values, error)) return FALSE; } else if (ELEMENT_IS ("method")) { if (!parse_method (parser, element_name, attribute_names, attribute_values, error)) return FALSE; } else if (ELEMENT_IS ("signal")) { if (!parse_signal (parser, element_name, attribute_names, attribute_values, error)) return FALSE; } else if (ELEMENT_IS ("property")) { if (!parse_property (parser, element_name, attribute_names, attribute_values, error)) return FALSE; } else if (ELEMENT_IS ("arg")) { if (!parse_arg (parser, element_name, attribute_names, attribute_values, error)) return FALSE; } else if (ELEMENT_IS ("annotation")) { if (!parse_annotation (parser, element_name, attribute_names, attribute_values, error)) return FALSE; } else { if (strchr (element_name, ':') != NULL) /* Passthrough XML-namespaced nodes */ parser->unknown_namespaced_depth += 1; else if (parser->unknown_namespaced_depth == 0) { g_set_error (error, G_MARKUP_ERROR, G_MARKUP_ERROR_PARSE, "Element <%s> not recognized", element_name); return FALSE; } } return TRUE; } gboolean parser_end_element (Parser *parser, const char *element_name, GError **error) { g_return_val_if_fail (error == NULL || *error == NULL, FALSE); if (ELEMENT_IS ("interface")) { parser->interface = NULL; } else if (ELEMENT_IS ("method")) { parser->method = NULL; } else if (ELEMENT_IS ("signal")) { parser->signal = NULL; } else if (ELEMENT_IS ("property")) { parser->property = NULL; } else if (ELEMENT_IS ("arg")) { parser->arg = NULL; } else if (ELEMENT_IS ("annotation")) { parser->in_annotation = FALSE; } else if (ELEMENT_IS ("node")) { NodeInfo *top; g_assert (parser->node_stack != NULL); top = parser->node_stack->data; parser->node_stack = g_slist_remove (parser->node_stack, top); if (parser->node_stack == NULL) parser->result = top; /* We are done, store the result */ } else if (strchr (element_name, ':') != NULL) { /* Passthrough XML-namespaced nodes */ parser->unknown_namespaced_depth -= 1; } else if (parser->unknown_namespaced_depth > 0) { /* pass through unknown elements underneath a namespace */ } else g_assert_not_reached (); /* should have had an error on start_element */ return TRUE; } gboolean parser_content (Parser *parser, const char *content, int len, GError **error) { g_return_val_if_fail (error == NULL || *error == NULL, FALSE); /* FIXME check that it's all whitespace */ return TRUE; } gboolean parser_finished (Parser *parser, GError **error) { g_return_val_if_fail (error == NULL || *error == NULL, FALSE); return TRUE; } NodeInfo* parser_get_nodes (Parser *parser) { return parser->result; } dbus-glib-0.100.2/dbus/dbus-gvalue-utils.c0000644000175000017500000013212712112652540015124 00000000000000/* -*- mode: C; c-file-style: "gnu" -*- */ /* dbus-gvalue-utils.c: Non-DBus-specific functions related to GType/GValue * * Copyright (C) 2005 Red Hat, Inc. * * Licensed under the Academic Free License version 2.1 * * 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 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * */ #include #include "dbus/dbus-glib.h" #include "dbus-gtype-specialized-priv.h" #include "dbus-gvalue-utils.h" #include "dbus-gtest.h" #include #include #include static guint fixed_type_get_size (GType type) { switch (type) { case G_TYPE_CHAR: case G_TYPE_UCHAR: return sizeof (gchar); case G_TYPE_BOOLEAN: return sizeof (gboolean); case G_TYPE_LONG: case G_TYPE_ULONG: return sizeof (glong); case G_TYPE_INT: case G_TYPE_UINT: return sizeof (gint); case G_TYPE_INT64: case G_TYPE_UINT64: return sizeof (gint64); case G_TYPE_FLOAT: return sizeof (gfloat); case G_TYPE_DOUBLE: return sizeof (gdouble); default: return 0; } } gboolean _dbus_g_type_is_fixed (GType type) { return fixed_type_get_size (type) > 0; } guint _dbus_g_type_fixed_get_size (GType type) { g_assert (_dbus_g_type_is_fixed (type)); return fixed_type_get_size (type); } gboolean _dbus_gvalue_store (GValue *value, gpointer storage) { /* FIXME - can we use the GValue lcopy_value method * to do this in a cleaner way? */ switch (g_type_fundamental (G_VALUE_TYPE (value))) { case G_TYPE_CHAR: *((gchar *) storage) = g_value_get_char (value); return TRUE; case G_TYPE_UCHAR: *((guchar *) storage) = g_value_get_uchar (value); return TRUE; case G_TYPE_BOOLEAN: *((gboolean *) storage) = g_value_get_boolean (value); return TRUE; case G_TYPE_LONG: *((glong *) storage) = g_value_get_long (value); return TRUE; case G_TYPE_ULONG: *((gulong *) storage) = g_value_get_ulong (value); return TRUE; case G_TYPE_INT: *((gint *) storage) = g_value_get_int (value); return TRUE; case G_TYPE_UINT: *((guint *) storage) = g_value_get_uint (value); return TRUE; case G_TYPE_INT64: *((gint64 *) storage) = g_value_get_int64 (value); return TRUE; case G_TYPE_UINT64: *((guint64 *) storage) = g_value_get_uint64 (value); return TRUE; case G_TYPE_DOUBLE: *((gdouble *) storage) = g_value_get_double (value); return TRUE; case G_TYPE_STRING: *((gchar **) storage) = (char*) g_value_get_string (value); return TRUE; case G_TYPE_OBJECT: *((gpointer *) storage) = g_value_get_object (value); return TRUE; case G_TYPE_BOXED: *((gpointer *) storage) = g_value_get_boxed (value); return TRUE; default: return FALSE; } } gboolean _dbus_gvalue_set_from_pointer (GValue *value, gconstpointer storage) { /* FIXME - is there a better way to do this? */ switch (g_type_fundamental (G_VALUE_TYPE (value))) { case G_TYPE_CHAR: g_value_set_char (value, *((gchar *) storage)); return TRUE; case G_TYPE_UCHAR: g_value_set_uchar (value, *((guchar *) storage)); return TRUE; case G_TYPE_BOOLEAN: g_value_set_boolean (value, *((gboolean *) storage)); return TRUE; case G_TYPE_LONG: g_value_set_long (value, *((glong *) storage)); return TRUE; case G_TYPE_ULONG: g_value_set_ulong (value, *((gulong *) storage)); return TRUE; case G_TYPE_INT: g_value_set_int (value, *((gint *) storage)); return TRUE; case G_TYPE_UINT: g_value_set_uint (value, *((guint *) storage)); return TRUE; case G_TYPE_INT64: g_value_set_int64 (value, *((gint64 *) storage)); return TRUE; case G_TYPE_UINT64: g_value_set_uint64 (value, *((guint64 *) storage)); return TRUE; case G_TYPE_DOUBLE: g_value_set_double (value, *((gdouble *) storage)); return TRUE; case G_TYPE_STRING: g_value_set_string (value, *((gchar **) storage)); return TRUE; case G_TYPE_OBJECT: g_value_set_object (value, *((gpointer *) storage)); return TRUE; case G_TYPE_BOXED: g_value_set_boxed (value, *((gpointer *) storage)); return TRUE; default: return FALSE; } } gboolean _dbus_gvalue_take (GValue *value, GTypeCValue *cvalue) { GType g_type; GTypeValueTable *value_table; char *error_msg; g_type = G_VALUE_TYPE (value); value_table = g_type_value_table_peek (g_type); error_msg = value_table->collect_value (value, 1, cvalue, G_VALUE_NOCOPY_CONTENTS); if (error_msg) { g_warning ("%s: %s", G_STRLOC, error_msg); g_free (error_msg); return FALSE; } /* Clear the NOCOPY_CONTENTS flag; we want to take ownership * of the value. */ value->data[1].v_uint &= ~(G_VALUE_NOCOPY_CONTENTS); return TRUE; } gboolean _dbus_gtype_can_signal_error (GType gtype) { switch (gtype) { case G_TYPE_BOOLEAN: case G_TYPE_INT: case G_TYPE_UINT: case G_TYPE_STRING: case G_TYPE_BOXED: case G_TYPE_OBJECT: return TRUE; default: return FALSE; } } gboolean _dbus_gvalue_signals_error (const GValue *value) { /* Hardcoded rules for return value semantics for certain * types. Perhaps in the future we'd want an annotation * specifying which return values are errors, but in * reality people will probably just use boolean and * boxed, and there the semantics are pretty standard. */ switch (G_TYPE_FUNDAMENTAL (G_VALUE_TYPE (value))) { case G_TYPE_BOOLEAN: return (g_value_get_boolean (value) == FALSE); break; case G_TYPE_INT: return (g_value_get_int (value) < 0); break; case G_TYPE_UINT: return (g_value_get_uint (value) == 0); break; case G_TYPE_STRING: return (g_value_get_string (value) == NULL); break; case G_TYPE_BOXED: return (g_value_get_boxed (value) == NULL); break; case G_TYPE_OBJECT: return (g_value_get_object (value) == NULL); break; default: g_assert_not_reached (); return FALSE; } } static gboolean hash_func_from_gtype (GType gtype, GHashFunc *func) { switch (gtype) { case G_TYPE_CHAR: case G_TYPE_UCHAR: case G_TYPE_BOOLEAN: case G_TYPE_INT: case G_TYPE_UINT: *func = NULL; return TRUE; case G_TYPE_STRING: *func = g_str_hash; return TRUE; default: if (gtype == DBUS_TYPE_G_OBJECT_PATH) { *func = g_str_hash; return TRUE; } else if (gtype == DBUS_TYPE_G_SIGNATURE) { *func = g_str_hash; return TRUE; } return FALSE; } } static void unset_and_free_g_value (gpointer val) { GValue *value = val; g_value_unset (value); g_free (value); } static gboolean gtype_can_simple_free (GType type); static gboolean hash_simple_free_from_gtype (GType gtype, GDestroyNotify *func) { switch (gtype) { case G_TYPE_CHAR: case G_TYPE_UCHAR: case G_TYPE_BOOLEAN: case G_TYPE_INT: case G_TYPE_UINT: *func = NULL; return TRUE; case G_TYPE_DOUBLE: case G_TYPE_STRING: *func = g_free; return TRUE; default: if (gtype == G_TYPE_VALUE) { *func = unset_and_free_g_value; return TRUE; } else if (gtype == G_TYPE_VALUE_ARRAY) { *func = (GDestroyNotify) g_value_array_free; return TRUE; } else if (gtype == G_TYPE_STRV) { *func = (GDestroyNotify) g_strfreev; return TRUE; } else if (gtype == DBUS_TYPE_G_OBJECT_PATH) { *func = g_free; return TRUE; } else if (gtype == DBUS_TYPE_G_SIGNATURE) { *func = g_free; return TRUE; } else if (dbus_g_type_is_collection (gtype)) { const DBusGTypeSpecializedCollectionVtable* vtable; vtable = dbus_g_type_collection_peek_vtable (gtype); if (vtable->base_vtable.simple_free_func) { *func = vtable->base_vtable.simple_free_func; return TRUE; } } else if (dbus_g_type_is_map (gtype)) { const DBusGTypeSpecializedMapVtable* vtable; GType key_gtype, value_gtype; key_gtype = dbus_g_type_get_map_key_specialization (gtype); value_gtype = dbus_g_type_get_map_value_specialization (gtype); /* if either the key or the value don't have "simple" (without a * GType) free functions, then the hashtable's contents must be freed * with hashtable_free, so the hashtable itself can't have a simple * free function. */ if (!gtype_can_simple_free (key_gtype) || !gtype_can_simple_free (value_gtype)) return FALSE; vtable = dbus_g_type_map_peek_vtable (gtype); if (vtable->base_vtable.simple_free_func) { *func = vtable->base_vtable.simple_free_func; return TRUE; } } else if (dbus_g_type_is_struct (gtype)) { const DBusGTypeSpecializedStructVtable *vtable; vtable = dbus_g_type_struct_peek_vtable (gtype); if (vtable->base_vtable.simple_free_func) { *func = vtable->base_vtable.simple_free_func; return TRUE; } } return FALSE; } } static gboolean gtype_can_simple_free (GType type) { GDestroyNotify func; return hash_simple_free_from_gtype (type, &func); } gboolean _dbus_gtype_is_valid_hash_key (GType type) { GHashFunc func; return hash_func_from_gtype (type, &func); } gboolean _dbus_gtype_is_valid_hash_value (GType gtype) { /* anything we can take into a GValue using gvalue_take_hash_value is fine */ switch (g_type_fundamental (gtype)) { case G_TYPE_CHAR: case G_TYPE_UCHAR: case G_TYPE_BOOLEAN: case G_TYPE_INT: case G_TYPE_UINT: case G_TYPE_DOUBLE: case G_TYPE_STRING: case G_TYPE_BOXED: case G_TYPE_OBJECT: return TRUE; } return FALSE; } GHashFunc _dbus_g_hash_func_from_gtype (GType gtype) { GHashFunc func; gboolean ret; ret = hash_func_from_gtype (gtype, &func); g_assert (ret != FALSE); return func; } GEqualFunc _dbus_g_hash_equal_from_gtype (GType gtype) { g_assert (_dbus_gtype_is_valid_hash_key (gtype)); switch (gtype) { case G_TYPE_CHAR: case G_TYPE_UCHAR: case G_TYPE_BOOLEAN: case G_TYPE_INT: case G_TYPE_UINT: return NULL; case G_TYPE_STRING: return g_str_equal; default: if (gtype == DBUS_TYPE_G_OBJECT_PATH) return g_str_equal; else if (gtype == DBUS_TYPE_G_SIGNATURE) return g_str_equal; g_assert_not_reached (); return NULL; } } static void hash_fake_simple_free_func (gpointer val) { /* Havoc would be proud... :P */ g_critical ("If you see this message then the author of this application or " "one of its libraries has tried to remove or replace the value %p in a " "hash table which was constructed by the D-Bus Glib bindings.\n\n" "However, it was not possible for the bindings to provide a destroy " "function to g_hash_table_new_full which is able to free this value, as " "its GType must be known in order to free it. This means the memory " "allocated to store the value has most likely just been leaked.\n\n" "To avoid this error, the GHashTable (or keys/values \"stolen\" from " "it) should be freed by using g_boxed_free as follows:\n" " g_boxed_free (dbus_g_type_get_map (\"GHashTable\", key_gtype, " "value_gtype), hash_table);\n", val); } GDestroyNotify _dbus_g_hash_free_from_gtype (GType gtype) { GDestroyNotify func; gboolean ret; ret = hash_simple_free_from_gtype (gtype, &func); /* if the value doesn't have a simple free function, we cannot define a * meaningful free function here. instead, this hash table must be freed * using g_boxed_free so that the hash_free function gets invoked. if the * user does not do so, we provide a fake free function to provide a warning * in this case. */ if (ret == FALSE) { g_assert (_dbus_gtype_is_valid_hash_value (gtype)); func = hash_fake_simple_free_func; } return func; } static void gvalue_take_ptrarray_value (GValue *value, gpointer instance); static void gvalue_take_hash_value (GValue *value, gpointer instance) { switch (g_type_fundamental (G_VALUE_TYPE (value))) { case G_TYPE_CHAR: g_value_set_char (value, (gchar) GPOINTER_TO_INT (instance)); break; case G_TYPE_UCHAR: g_value_set_uchar (value, (guchar) GPOINTER_TO_UINT (instance)); break; case G_TYPE_BOOLEAN: g_value_set_boolean (value, (gboolean) GPOINTER_TO_UINT (instance)); break; case G_TYPE_INT: g_value_set_int (value, GPOINTER_TO_INT (instance)); break; case G_TYPE_UINT: g_value_set_uint (value, GPOINTER_TO_UINT (instance)); break; case G_TYPE_DOUBLE: g_value_set_double (value, *(gdouble *) instance); break; default: gvalue_take_ptrarray_value (value, instance); break; } } static gpointer ptrarray_value_from_gvalue (const GValue *value); static gpointer hash_value_from_gvalue (GValue *value) { switch (g_type_fundamental (G_VALUE_TYPE (value))) { case G_TYPE_CHAR: return GINT_TO_POINTER ((int) g_value_get_char (value)); break; case G_TYPE_UCHAR: return GUINT_TO_POINTER ((guint) g_value_get_uchar (value)); break; case G_TYPE_BOOLEAN: return GUINT_TO_POINTER ((guint) g_value_get_boolean (value)); break; case G_TYPE_INT: return GINT_TO_POINTER (g_value_get_int (value)); break; case G_TYPE_UINT: return GUINT_TO_POINTER (g_value_get_uint (value)); break; case G_TYPE_DOUBLE: { gdouble *p = (gdouble *) g_malloc0 (sizeof (gdouble)); *p = g_value_get_double (value); return (gpointer) p; } break; default: return ptrarray_value_from_gvalue (value); break; } } struct DBusGHashTableValueForeachData { DBusGTypeSpecializedMapIterator func; GType key_type; GType value_type; gpointer data; }; static void hashtable_foreach_with_values (gpointer key, gpointer value, gpointer user_data) { GValue key_val = {0, }; GValue value_val = {0, }; struct DBusGHashTableValueForeachData *data = user_data; g_value_init (&key_val, data->key_type); g_value_init (&value_val, data->value_type); gvalue_take_hash_value (&key_val, key); gvalue_take_hash_value (&value_val, value); data->func (&key_val, &value_val, data->data); } static void hashtable_iterator (GType hash_type, gpointer instance, DBusGTypeSpecializedMapIterator iterator, gpointer user_data) { struct DBusGHashTableValueForeachData data; GType key_gtype; GType value_gtype; key_gtype = dbus_g_type_get_map_key_specialization (hash_type); value_gtype = dbus_g_type_get_map_value_specialization (hash_type); data.func = iterator; data.key_type = key_gtype; data.value_type = value_gtype; data.data = user_data; g_hash_table_foreach (instance, hashtable_foreach_with_values, &data); } void _dbus_g_hash_table_insert_steal_values (GHashTable *table, GValue *key_val, GValue *value_val) { gpointer key, val; key = hash_value_from_gvalue (key_val); val = hash_value_from_gvalue (value_val); g_hash_table_insert (table, key, val); } static void hashtable_append (DBusGTypeSpecializedAppendContext *ctx, GValue *key, GValue *val) { GHashTable *table; table = g_value_get_boxed (ctx->val); _dbus_g_hash_table_insert_steal_values (table, key, val); } static gpointer hashtable_constructor (GType type) { GHashTable *ret; GType key_gtype; GType value_gtype; key_gtype = dbus_g_type_get_map_key_specialization (type); value_gtype = dbus_g_type_get_map_value_specialization (type); ret = g_hash_table_new_full (_dbus_g_hash_func_from_gtype (key_gtype), _dbus_g_hash_equal_from_gtype (key_gtype), _dbus_g_hash_free_from_gtype (key_gtype), _dbus_g_hash_free_from_gtype (value_gtype)); return ret; } static void hashtable_insert_values (GHashTable *table, const GValue *key_val, const GValue *value_val) { GValue key_copy = {0, }; GValue value_copy = {0, }; g_value_init (&key_copy, G_VALUE_TYPE (key_val)); g_value_copy (key_val, &key_copy); g_value_init (&value_copy, G_VALUE_TYPE (value_val)); g_value_copy (value_val, &value_copy); _dbus_g_hash_table_insert_steal_values (table, &key_copy, &value_copy); } static void hashtable_foreach_copy (const GValue *key, const GValue *val, gpointer data) { hashtable_insert_values ((GHashTable *) data, key, val); } static gpointer hashtable_copy (GType type, gpointer src) { GHashTable *ghash; GHashTable *ret; GValue hashval = {0,}; ghash = src; ret = hashtable_constructor (type); g_value_init (&hashval, type); g_value_set_static_boxed (&hashval, ghash); dbus_g_type_map_value_iterate (&hashval, hashtable_foreach_copy, ret); return ret; } /* we leave this here for backwards compatibility - any hash tables nested * inside hash tables will use this as their free function if users were * already relying on it, but dbus-glib itself will never use it directly as * hashtable_free is also defined. */ static void hashtable_simple_free (gpointer val) { g_hash_table_unref (val); } struct DBusGHashTableFreeData { GType key_gtype; GType value_gtype; }; static gboolean hashtable_free_foreach_steal (gpointer key, gpointer value, gpointer user_data) { struct DBusGHashTableFreeData *data = user_data; GValue val = { 0, }; g_value_init (&val, data->key_gtype); gvalue_take_hash_value (&val, key); g_value_unset (&val); g_value_init (&val, data->value_gtype); gvalue_take_hash_value (&val, value); g_value_unset (&val); return TRUE; } static void hashtable_free (GType type, gpointer val) { struct DBusGHashTableFreeData data = { 0, }; GHashTable *hash = val; data.key_gtype = dbus_g_type_get_map_key_specialization (type); data.value_gtype = dbus_g_type_get_map_value_specialization (type); /* wheee, fun. two cases here. either: * * a) the keys and value types both have simple (ie, no * GType parameter is * needed to know how to free them) free functions, in which case they were * set as the hash free functions when the hash table was constructed. in * this case, it's sufficient for us to unref the hash table as before. we * have to keep doing this in order to maintain compatibility with the ABI * which was around before hash tables could contain types which don't have * simple free functions (such as GPtrArrays of other stuff). for these * tables, users were able to ref the hash tables and add/remove values, and * rely on meaningful free functions. * * b) for any other key or value types where /do/ need to know the GType in * order to free it, this function is the only "right" way to free the hash * table. both the key and value free functions were set to print a big nasty * warning, and we free the contents of the hashtable with foreach_steal. */ if (gtype_can_simple_free (data.key_gtype) && gtype_can_simple_free (data.value_gtype)) { g_hash_table_unref (hash); } else { g_hash_table_foreach_steal (hash, hashtable_free_foreach_steal, &data); g_hash_table_unref (hash); } } static gpointer valuearray_constructor (GType type) { GValueArray *ret; guint size = dbus_g_type_get_struct_size (type); guint i; ret = g_value_array_new (size); for (i=0; i < size; i++) { GValue val = {0,}; g_value_init (&val, dbus_g_type_get_struct_member_type (type, i)); g_value_array_append(ret, &val); } return (gpointer)ret; } static gpointer valuearray_copy (GType type, gpointer src) { return g_value_array_copy ((GValueArray*) src); } static void valuearray_simple_free (gpointer val) { g_value_array_free (val); } static gboolean valuearray_get_member (GType type, gpointer instance, guint member, GValue *ret) { GValueArray *va = (GValueArray*) instance; const GValue *val; if (member < dbus_g_type_get_struct_size (type)) { val = g_value_array_get_nth (va, member); g_value_copy (val, ret); return TRUE; } else return FALSE; } static gboolean valuearray_set_member (GType type, gpointer instance, guint member, const GValue *member_type) { GValueArray *va = (GValueArray*) instance; GValue *vp; if (member < dbus_g_type_get_struct_size (type)) { vp = g_value_array_get_nth (va, member); g_value_copy (member_type, vp); return TRUE; } else return FALSE; } static gpointer array_constructor (GType type) { GArray *array; guint elt_size; GType elt_type; gboolean zero_terminated; gboolean clear; elt_type = dbus_g_type_get_collection_specialization (type); g_assert (elt_type != G_TYPE_INVALID); elt_size = _dbus_g_type_fixed_get_size (elt_type); /* These are "safe" defaults */ zero_terminated = TRUE; /* ((struct _DBusGRealArray*) garray)->zero_terminated; */ clear = TRUE; /* ((struct _DBusGRealArray*) garray)->clear; */ array = g_array_new (zero_terminated, clear, elt_size); return array; } static void array_iterator (GType garray_type, gpointer instance, DBusGTypeSpecializedCollectionIterator iterator, gpointer user_data) { GArray *array; GType elt_gtype; guint i; array = instance; elt_gtype = dbus_g_type_get_collection_specialization (garray_type); for (i = 0; i < array->len; i++) { GValue val = {0, }; g_value_init (&val, elt_gtype); switch (elt_gtype) { case G_TYPE_BOOLEAN: g_value_set_boolean (&val, !!g_array_index (array, gboolean, i)); break; case G_TYPE_FLOAT: g_value_set_float (&val, g_array_index (array, gfloat, i)); break; case G_TYPE_DOUBLE: g_value_set_double (&val, g_array_index (array, gdouble, i)); break; case G_TYPE_CHAR: g_value_set_char (&val, g_array_index (array, gchar, i)); break; case G_TYPE_UCHAR: g_value_set_uchar (&val, g_array_index (array, guchar, i)); break; case G_TYPE_INT: g_value_set_int (&val, g_array_index (array, gint, i)); break; case G_TYPE_UINT: g_value_set_uint (&val, g_array_index (array, guint, i)); break; case G_TYPE_LONG: g_value_set_long (&val, g_array_index (array, glong, i)); break; case G_TYPE_ULONG: g_value_set_ulong (&val, g_array_index (array, gulong, i)); break; case G_TYPE_INT64: g_value_set_int64 (&val, g_array_index (array, gint64, i)); break; case G_TYPE_UINT64: g_value_set_uint64 (&val, g_array_index (array, guint64, i)); break; default: g_assert_not_reached (); } iterator (&val, user_data); } } static void array_append (DBusGTypeSpecializedAppendContext *ctx, GValue *value) { GArray *array = g_value_get_boxed (ctx->val); GType elt_gtype; union { guint64 u64; gint64 i64; gulong ul; glong l; guint u; gint i; guchar uc; gchar c; gboolean b; gfloat f; gdouble d; } tmp; elt_gtype = dbus_g_type_get_collection_specialization ( G_VALUE_TYPE (ctx->val)); switch (elt_gtype) { case G_TYPE_BOOLEAN: tmp.b = g_value_get_boolean (value); g_array_append_val (array, tmp.b); break; case G_TYPE_FLOAT: tmp.f = g_value_get_float (value); g_array_append_val (array, tmp.f); break; case G_TYPE_DOUBLE: tmp.d = g_value_get_double (value); g_array_append_val (array, tmp.d); break; case G_TYPE_CHAR: tmp.c = g_value_get_char (value); g_array_append_val (array, tmp.c); break; case G_TYPE_UCHAR: tmp.uc = g_value_get_uchar (value); g_array_append_val (array, tmp.uc); break; case G_TYPE_INT: tmp.i = g_value_get_int (value); g_array_append_val (array, tmp.i); break; case G_TYPE_UINT: tmp.u = g_value_get_uint (value); g_array_append_val (array, tmp.u); break; case G_TYPE_LONG: tmp.l = g_value_get_long (value); g_array_append_val (array, tmp.l); break; case G_TYPE_ULONG: tmp.ul = g_value_get_ulong (value); g_array_append_val (array, tmp.ul); break; case G_TYPE_INT64: tmp.i64 = g_value_get_int64 (value); g_array_append_val (array, tmp.i64); break; case G_TYPE_UINT64: tmp.u64 = g_value_get_uint64 (value); g_array_append_val (array, tmp.u64); break; default: g_assert_not_reached (); } } static gpointer array_copy (GType type, gpointer src) { GArray *garray; GArray *new; garray = src; new = array_constructor (type); g_array_append_vals (new, garray->data, garray->len); return new; } static void array_simple_free (gpointer val) { GArray *array; array = val; g_array_free (array, TRUE); } static gboolean array_fixed_accessor (GType type, gpointer instance, gpointer *values, guint *len) { GType elt_type; GArray *array = instance; elt_type = dbus_g_type_get_collection_specialization (type); if (!_dbus_g_type_is_fixed (elt_type)) return FALSE; *values = array->data; *len = array->len; return TRUE; } static gpointer ptrarray_constructor (GType type) { /* Later we should determine a destructor, need g_ptr_array_destroy */ return g_ptr_array_new (); } static void gvalue_take_ptrarray_value (GValue *value, gpointer instance) { switch (g_type_fundamental (G_VALUE_TYPE (value))) { case G_TYPE_STRING: g_value_take_string (value, instance); break; case G_TYPE_BOXED: g_value_take_boxed (value, instance); break; case G_TYPE_OBJECT: g_value_take_object (value, instance); break; default: g_assert_not_reached (); break; } } static gpointer ptrarray_value_from_gvalue (const GValue *value) { GValue tmp = {0, }; /* if the NOCOPY flag is set, then value was created via set_static and hence * is not owned by us. in order to preserve the "take" semantics that the API * has in general (which avoids copying in the common case), we must copy any * static values so that we can indiscriminately free the entire collection * later. */ if (value->data[1].v_uint & G_VALUE_NOCOPY_CONTENTS) { g_value_init (&tmp, G_VALUE_TYPE (value)); g_value_copy (value, &tmp); value = &tmp; } switch (g_type_fundamental (G_VALUE_TYPE (value))) { case G_TYPE_STRING: return (gpointer) g_value_get_string (value); break; case G_TYPE_BOXED: return g_value_get_boxed (value); break; case G_TYPE_OBJECT: return g_value_get_object (value); break; default: g_assert_not_reached (); return NULL; } } static void ptrarray_iterator (GType ptrarray_type, gpointer instance, DBusGTypeSpecializedCollectionIterator iterator, gpointer user_data) { GPtrArray *ptrarray; GType elt_gtype; guint i; ptrarray = instance; elt_gtype = dbus_g_type_get_collection_specialization (ptrarray_type); for (i = 0; i < ptrarray->len; i++) { GValue val = {0, }; g_value_init (&val, elt_gtype); gvalue_take_ptrarray_value (&val, g_ptr_array_index (ptrarray, i)); iterator (&val, user_data); } } static void ptrarray_copy_elt (const GValue *val, gpointer user_data) { GPtrArray *dest = user_data; GValue val_copy = {0, }; g_value_init (&val_copy, G_VALUE_TYPE (val)); g_value_copy (val, &val_copy); g_ptr_array_add (dest, ptrarray_value_from_gvalue (&val_copy)); } static gpointer ptrarray_copy (GType type, gpointer src) { GPtrArray *new; GValue array_val = {0, }; g_value_init (&array_val, type); g_value_set_static_boxed (&array_val, src); new = ptrarray_constructor (type); dbus_g_type_collection_value_iterate (&array_val, ptrarray_copy_elt, new); return new; } static void ptrarray_append (DBusGTypeSpecializedAppendContext *ctx, GValue *value) { GPtrArray *array; array = g_value_get_boxed (ctx->val); g_ptr_array_add (array, ptrarray_value_from_gvalue (value)); } static void ptrarray_free (GType type, gpointer val) { GPtrArray *array; GValue elt_val = {0, }; GType elt_gtype; unsigned int i; array = val; elt_gtype = dbus_g_type_get_collection_specialization (type); for (i = 0; i < array->len; i++) { g_value_init (&elt_val, elt_gtype); gvalue_take_ptrarray_value (&elt_val, g_ptr_array_index (array, i)); g_value_unset (&elt_val); } g_ptr_array_free (array, TRUE); } static gpointer slist_constructor (GType type) { return NULL; } static void slist_iterator (GType list_type, gpointer instance, DBusGTypeSpecializedCollectionIterator iterator, gpointer user_data) { GSList *slist; GType elt_gtype; slist = instance; elt_gtype = dbus_g_type_get_collection_specialization (list_type); for (slist = instance; slist != NULL; slist = slist->next) { GValue val = {0, }; g_value_init (&val, elt_gtype); gvalue_take_ptrarray_value (&val, slist->data); iterator (&val, user_data); } } static void slist_copy_elt (const GValue *val, gpointer user_data) { GSList **dest = user_data; GValue val_copy = {0, }; g_value_init (&val_copy, G_VALUE_TYPE (val)); g_value_copy (val, &val_copy); *dest = g_slist_append (*dest, ptrarray_value_from_gvalue (&val_copy)); } static gpointer slist_copy (GType type, gpointer src) { GSList *new; GValue slist_val = {0, }; g_value_init (&slist_val, type); g_value_set_static_boxed (&slist_val, src); new = slist_constructor (type); dbus_g_type_collection_value_iterate (&slist_val, slist_copy_elt, &new); return new; } static void slist_append (DBusGTypeSpecializedAppendContext *ctx, GValue *value) { GSList *list; list = g_value_get_boxed (ctx->val); list = g_slist_prepend (list, ptrarray_value_from_gvalue (value)); g_value_set_static_boxed (ctx->val, list); } static void slist_end_append (DBusGTypeSpecializedAppendContext *ctx) { GSList *list; /* if you append multiple times to the slist, this will reverse the existing * elements... we need an init_append function */ list = g_value_get_boxed (ctx->val); list = g_slist_reverse (list); g_value_take_boxed (ctx->val, list); } static void slist_free (GType type, gpointer val) { GSList *list; GType elt_gtype; list = val; elt_gtype = dbus_g_type_get_collection_specialization (type); while (list != NULL) { GValue elt_val = {0, }; g_value_init (&elt_val, elt_gtype); gvalue_take_ptrarray_value (&elt_val, list->data); g_value_unset (&elt_val); list = g_slist_next(list); } list=val; g_slist_free (list); } void _dbus_g_type_specialized_builtins_init (void) { /* types with a simple_free function can be freed at run-time without * the destroy function needing to know the type, so they can be * stored in hash tables */ static const DBusGTypeSpecializedCollectionVtable array_vtable = { { array_constructor, NULL, array_copy, array_simple_free, NULL, NULL, }, array_fixed_accessor, array_iterator, array_append, NULL }; static const DBusGTypeSpecializedCollectionVtable ptrarray_vtable = { { ptrarray_constructor, ptrarray_free, ptrarray_copy, NULL, NULL, NULL, }, NULL, ptrarray_iterator, ptrarray_append, NULL, }; static const DBusGTypeSpecializedCollectionVtable slist_vtable = { { slist_constructor, slist_free, slist_copy, NULL, NULL, NULL, }, NULL, slist_iterator, slist_append, slist_end_append, }; static const DBusGTypeSpecializedMapVtable hashtable_vtable = { { hashtable_constructor, hashtable_free, hashtable_copy, hashtable_simple_free, NULL, NULL }, hashtable_iterator, hashtable_append }; static const DBusGTypeSpecializedStructVtable valuearray_vtable = { { valuearray_constructor, NULL, valuearray_copy, valuearray_simple_free, NULL, NULL }, valuearray_get_member, valuearray_set_member }; _dbus_g_type_register_collection ("GSList", &slist_vtable, 0); _dbus_g_type_register_collection ("GArray", &array_vtable, 0); _dbus_g_type_register_collection ("GPtrArray", &ptrarray_vtable, 0); _dbus_g_type_register_map ("GHashTable", &hashtable_vtable, 0); _dbus_g_type_register_struct ("GValueArray", &valuearray_vtable, 0); } #ifdef DBUS_BUILD_TESTS typedef struct { gboolean seen_foo; gboolean seen_baz; } TestSpecializedHashData; static void test_specialized_hash (const GValue *key, const GValue *val, gpointer user_data) { TestSpecializedHashData *data = user_data; g_assert (G_VALUE_HOLDS_STRING (key)); g_assert (G_VALUE_HOLDS_STRING (val)); if (!strcmp (g_value_get_string (key), "foo")) { data->seen_foo = TRUE; g_assert (!strcmp (g_value_get_string (val), "bar")); } else if (!strcmp (g_value_get_string (key), "baz")) { data->seen_baz = TRUE; g_assert (!strcmp (g_value_get_string (val), "moo")); } else { g_assert_not_reached (); } } static void test_specialized_hash_2 (const GValue *key, const GValue *val, gpointer user_data) { TestSpecializedHashData *data = user_data; const GValue *realval; g_assert (G_VALUE_HOLDS_STRING (key)); g_assert (G_VALUE_TYPE (val) == G_TYPE_VALUE); realval = g_value_get_boxed (val); if (!strcmp (g_value_get_string (key), "foo")) { data->seen_foo = TRUE; g_assert (G_VALUE_HOLDS_UINT (realval)); g_assert (g_value_get_uint (realval) == 20); } else if (!strcmp (g_value_get_string (key), "baz")) { data->seen_baz = TRUE; g_assert (G_VALUE_HOLDS_STRING (realval)); g_assert (!strcmp ("bar", g_value_get_string (realval))); } else { g_assert_not_reached (); } } gboolean _dbus_gvalue_utils_test (const char *datadir) { GType type; dbus_g_type_specialized_init (); _dbus_g_type_specialized_builtins_init (); type = dbus_g_type_get_collection ("GArray", G_TYPE_UINT); g_assert (dbus_g_type_is_collection (type)); g_assert (dbus_g_type_get_collection_specialization (type) == G_TYPE_UINT); { GArray *instance; instance = dbus_g_type_specialized_construct (type); g_assert (instance->len == 0); g_array_free (instance, TRUE); } type = dbus_g_type_get_map ("GHashTable", G_TYPE_STRING, G_TYPE_STRING); g_assert (dbus_g_type_is_map (type)); g_assert (dbus_g_type_get_map_key_specialization (type) == G_TYPE_STRING); g_assert (dbus_g_type_get_map_value_specialization (type) == G_TYPE_STRING); { GHashTable *instance; GValue val = { 0, }; TestSpecializedHashData hashdata; instance = dbus_g_type_specialized_construct (type); g_assert (g_hash_table_size (instance) == 0); g_hash_table_insert (instance, g_strdup ("foo"), g_strdup ("bar")); g_hash_table_insert (instance, g_strdup ("baz"), g_strdup ("moo")); g_assert (g_hash_table_size (instance) == 2); g_value_init (&val, type); g_value_take_boxed (&val, instance); hashdata.seen_foo = FALSE; hashdata.seen_baz = FALSE; dbus_g_type_map_value_iterate (&val, test_specialized_hash, &hashdata); g_assert (hashdata.seen_foo); g_assert (hashdata.seen_baz); g_value_unset (&val); } type = dbus_g_type_get_map ("GHashTable", G_TYPE_STRING, G_TYPE_VALUE); g_assert (dbus_g_type_is_map (type)); g_assert (dbus_g_type_get_map_key_specialization (type) == G_TYPE_STRING); g_assert (dbus_g_type_get_map_value_specialization (type) == G_TYPE_VALUE); { GHashTable *instance; GValue val = { 0, }; TestSpecializedHashData hashdata; DBusGTypeSpecializedAppendContext ctx; GValue *eltval; instance = dbus_g_type_specialized_construct (type); g_value_init (&val, type); g_value_take_boxed (&val, instance); dbus_g_type_specialized_init_append (&val, &ctx); { GValue keyval = { 0, }; GValue valval = { 0, }; g_value_init (&keyval, G_TYPE_STRING); g_value_set_string (&keyval, "foo"); g_value_init (&valval, G_TYPE_VALUE); eltval = g_new0 (GValue, 1); g_value_init (eltval, G_TYPE_UINT); g_value_set_uint (eltval, 20); g_value_take_boxed (&valval, eltval); dbus_g_type_specialized_map_append (&ctx, &keyval, &valval); } { GValue keyval = { 0, }; GValue valval = { 0, }; g_value_init (&keyval, G_TYPE_STRING); g_value_set_string (&keyval, "baz"); g_value_init (&valval, G_TYPE_VALUE); eltval = g_new0 (GValue, 1); g_value_init (eltval, G_TYPE_STRING); g_value_set_string (eltval, "bar"); g_value_take_boxed (&valval, eltval); dbus_g_type_specialized_map_append (&ctx, &keyval, &valval); } hashdata.seen_foo = FALSE; hashdata.seen_baz = FALSE; dbus_g_type_map_value_iterate (&val, test_specialized_hash_2, &hashdata); g_assert (hashdata.seen_foo); g_assert (hashdata.seen_baz); g_value_unset (&val); } type = dbus_g_type_get_collection ("GSList", G_TYPE_OBJECT); g_assert (dbus_g_type_is_collection (type)); g_assert (dbus_g_type_get_collection_specialization (type) == G_TYPE_OBJECT); { GSList *instance, *tmp, *copy; GValue val = {0, }; GValue copyval = {0, }; DBusGTypeSpecializedAppendContext ctx; GObject *objects[3]; int i; instance = dbus_g_type_specialized_construct (type); g_assert (instance == NULL); g_value_init (&val, type); g_value_take_boxed (&val, instance); dbus_g_type_specialized_init_append (&val, &ctx); for (i = 0; i < 3; i++) { GValue eltval = { 0, }; GObject *obj = g_object_new (G_TYPE_OBJECT, NULL); g_assert (obj != NULL); objects[i] = obj; g_object_add_weak_pointer (obj, (gpointer) (objects + i)); g_value_init (&eltval, G_TYPE_OBJECT); g_value_take_object (&eltval, obj); dbus_g_type_specialized_collection_append (&ctx, &eltval); } dbus_g_type_specialized_collection_end_append (&ctx); instance = g_value_get_boxed (&val); g_assert (g_slist_length (instance) == 3); for (tmp = instance; tmp; tmp = tmp->next) { GObject *obj = tmp->data; g_assert (G_IS_OBJECT (obj)); g_assert (obj->ref_count == 1); } g_value_init (©val, type); g_value_copy (&val, ©val); copy = g_value_get_boxed (©val); g_assert (g_slist_length (copy) == 3); for (tmp = copy; tmp; tmp = tmp->next) { GObject *obj = tmp->data; g_assert (G_IS_OBJECT (obj)); g_assert (obj->ref_count == 2); } g_value_unset (©val); for (i = 0; i < 3; i++) { g_assert (objects[i] != NULL); } for (tmp = instance; tmp; tmp = tmp->next) { GObject *obj = tmp->data; g_assert (G_IS_OBJECT (obj)); g_assert (obj->ref_count == 1); } g_value_unset (&val); for (i = 0; i < 3; i++) { g_assert (objects[i] == NULL); } } type = dbus_g_type_get_collection ("GPtrArray", G_TYPE_STRING); g_assert (dbus_g_type_is_collection (type)); g_assert (dbus_g_type_get_collection_specialization (type) == G_TYPE_STRING); { GPtrArray *instance; DBusGTypeSpecializedAppendContext ctx; GValue val = {0, }; GValue eltval = {0, }; instance = dbus_g_type_specialized_construct (type); g_assert (instance->len == 0); g_value_init (&val, type); g_value_take_boxed (&val, instance); dbus_g_type_specialized_init_append (&val, &ctx); g_value_init (&eltval, G_TYPE_STRING); g_value_set_static_string (&eltval, "foo"); dbus_g_type_specialized_collection_append (&ctx, &eltval); g_value_reset (&eltval); g_value_set_static_string (&eltval, "bar"); dbus_g_type_specialized_collection_append (&ctx, &eltval); g_value_reset (&eltval); g_value_set_static_string (&eltval, "baz"); dbus_g_type_specialized_collection_append (&ctx, &eltval); dbus_g_type_specialized_collection_end_append (&ctx); g_assert (instance->len == 3); g_assert (!strcmp ("foo", g_ptr_array_index (instance, 0))); g_assert (!strcmp ("bar", g_ptr_array_index (instance, 1))); g_assert (!strcmp ("baz", g_ptr_array_index (instance, 2))); g_value_unset (&val); } type = dbus_g_type_get_struct ("GValueArray", G_TYPE_STRING, G_TYPE_UINT, DBUS_TYPE_G_OBJECT_PATH, G_TYPE_INVALID); g_assert (dbus_g_type_is_struct (type)); g_assert (dbus_g_type_get_struct_size (type) == 3); g_assert (dbus_g_type_get_struct_member_type (type, 0) == G_TYPE_STRING); g_assert (dbus_g_type_get_struct_member_type (type, 1) == G_TYPE_UINT); g_assert (dbus_g_type_get_struct_member_type (type, 2) == DBUS_TYPE_G_OBJECT_PATH); { GValueArray *instance; GValue val = {0, }; GValue memval = {0, }; instance = dbus_g_type_specialized_construct (type); g_assert (instance->n_values == 3); g_value_init (&val, type); g_value_take_boxed (&val, instance); g_value_init (&memval, G_TYPE_STRING); g_value_set_static_string (&memval, "foo"); dbus_g_type_struct_set_member (&val, 0, &memval); g_value_unset (&memval); g_value_init (&memval, G_TYPE_UINT); g_value_set_uint (&memval, 42); dbus_g_type_struct_set_member (&val, 1, &memval); g_value_unset (&memval); g_value_init (&memval, DBUS_TYPE_G_OBJECT_PATH); g_value_set_static_boxed (&memval, "/bar/moo/foo/baz"); dbus_g_type_struct_set_member (&val, 2, &memval); g_value_unset (&memval); g_assert (instance->n_values == 3); g_value_init (&memval, G_TYPE_STRING); dbus_g_type_struct_get_member (&val, 0, &memval); g_assert (0 == strcmp (g_value_get_string (&memval), "foo")); g_value_unset (&memval); g_value_init (&memval, G_TYPE_UINT); dbus_g_type_struct_get_member (&val, 1, &memval); g_assert (g_value_get_uint (&memval) == 42); g_value_unset (&memval); g_value_init (&memval, DBUS_TYPE_G_OBJECT_PATH); dbus_g_type_struct_get_member (&val, 2, &memval); g_assert (0 == strcmp ((gchar*) g_value_get_boxed (&memval), "/bar/moo/foo/baz")); g_value_unset (&memval); g_value_unset (&val); } type = dbus_g_type_get_struct ("GValueArray", G_TYPE_STRING, G_TYPE_UINT, DBUS_TYPE_G_OBJECT_PATH, G_TYPE_INVALID); g_assert (dbus_g_type_is_struct (type)); g_assert (dbus_g_type_get_struct_size (type) == 3); g_assert (dbus_g_type_get_struct_member_type (type, 0) == G_TYPE_STRING); g_assert (dbus_g_type_get_struct_member_type (type, 1) == G_TYPE_UINT); g_assert (dbus_g_type_get_struct_member_type (type, 2) == DBUS_TYPE_G_OBJECT_PATH); { GValueArray *instance; GValue val = {0, }; instance = dbus_g_type_specialized_construct (type); g_assert (instance->n_values == 3); g_value_init (&val, type); g_value_take_boxed (&val, instance); dbus_g_type_struct_set (&val, 0,"foo", 1, 42, 2, "/bar/moo/foo/baz", G_MAXUINT); g_assert (instance->n_values == 3); { gchar *string; guint intval; gchar *path; dbus_g_type_struct_get (&val, 0, &string, 1, &intval, 2, &path, G_MAXUINT); g_assert (0 == strcmp (string, "foo")); g_assert (intval == 42); g_assert (0 == strcmp (path, "/bar/moo/foo/baz")); } g_value_unset (&val); } return TRUE; } #endif /* DBUS_BUILD_TESTS */ dbus-glib-0.100.2/dbus/dbus-gtype-specialized-priv.h0000644000175000017500000000352312107524563017114 00000000000000/* -*- mode: C; c-file-style: "gnu" -*- */ /* dbus-gtype-specialized-priv.h: internals of specialized GTypes * * Copyright (C) 2009 Collabora Ltd. * * Licensed under the Academic Free License version 2.1 * * 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 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * */ #ifndef DBUS_GOBJECT_TYPE_SPECIALIZED_PRIV_H #define DBUS_GOBJECT_TYPE_SPECIALIZED_PRIV_H #include "dbus-gtype-specialized.h" G_BEGIN_DECLS G_GNUC_INTERNAL void _dbus_g_type_register_collection (const char *name, const DBusGTypeSpecializedCollectionVtable *vtable, guint flags); G_GNUC_INTERNAL void _dbus_g_type_register_map (const char *name, const DBusGTypeSpecializedMapVtable *vtable, guint flags); G_GNUC_INTERNAL void _dbus_g_type_register_struct (const char *name, const DBusGTypeSpecializedStructVtable *vtable, guint flags); G_END_DECLS #endif dbus-glib-0.100.2/dbus/dbus-glib-lowlevel.h0000644000175000017500000000472412107524614015261 00000000000000/* -*- mode: C; c-file-style: "gnu" -*- */ /* dbus-glib-lowlevel.h GLib integration details that require dbus/dbus.h * * Copyright (C) 2002, 2003 CodeFactory AB * Copyright (C) 2003, 2004 Red Hat, Inc. * * Licensed under the Academic Free License version 2.1 * * 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 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * */ #ifndef DBUS_GLIB_LOWLEVEL_H #define DBUS_GLIB_LOWLEVEL_H #include #include G_BEGIN_DECLS void dbus_set_g_error (GError **gerror, DBusError *derror); #define DBUS_TYPE_CONNECTION (dbus_connection_get_g_type ()) #define DBUS_TYPE_MESSAGE (dbus_message_get_g_type ()) GType dbus_connection_get_g_type (void) G_GNUC_CONST; GType dbus_message_get_g_type (void) G_GNUC_CONST; void dbus_connection_setup_with_g_main (DBusConnection *connection, GMainContext *context); void dbus_server_setup_with_g_main (DBusServer *server, GMainContext *context); void dbus_g_proxy_send (DBusGProxy *proxy, DBusMessage *message, dbus_uint32_t *client_serial); DBusConnection* dbus_g_connection_get_connection (DBusGConnection *gconnection); DBusGConnection* dbus_connection_get_g_connection (DBusConnection *connection); DBusMessage* dbus_g_message_get_message (DBusGMessage *gmessage); gchar* dbus_g_method_get_sender (DBusGMethodInvocation *context); DBusMessage* dbus_g_method_get_reply (DBusGMethodInvocation *context); void dbus_g_method_send_reply (DBusGMethodInvocation *context, DBusMessage *reply); G_END_DECLS #endif /* DBUS_GLIB_LOWLEVEL_H */ dbus-glib-0.100.2/dbus/dbus-gtest.c0000644000175000017500000000502512112652540013625 00000000000000/* -*- mode: C; c-file-style: "gnu" -*- */ /* dbus-test.c Program to run all tests * * Copyright (C) 2002, 2003 Red Hat Inc. * * Licensed under the Academic Free License version 2.1 * * 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 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * */ #include #include "dbus-gtest.h" #include #include #include #ifdef DBUS_BUILD_TESTS static void die (const char *failure) { fprintf (stderr, "Unit test failed: %s\n", failure); exit (1); } #endif /* DBUS_BUILD_TESTS */ /* * An exported symbol to be run in order to execute * unit tests. Should not be used by * any app other than our test app, this symbol * won't exist in some builds of the library. * (with --enable-tests=no) * * @param test_data_dir the directory with test data (test/data normally) */ void dbus_glib_internal_do_not_use_run_tests (const char *test_data_dir) { #ifdef DBUS_BUILD_TESTS if (test_data_dir == NULL) test_data_dir = g_getenv ("DBUS_TEST_DATA"); if (test_data_dir != NULL) printf ("Test data in %s\n", test_data_dir); else printf ("No test data!\n"); g_type_init (); printf ("%s: running GValue util tests\n", "dbus-glib-test"); if (!_dbus_gvalue_utils_test (test_data_dir)) die ("gvalue utils"); printf ("%s: running GValue tests\n", "dbus-glib-test"); if (!_dbus_gvalue_test (test_data_dir)) die ("gvalue utils"); printf ("%s: running glib tests\n", "dbus-glib-test"); if (!_dbus_glib_test (test_data_dir)) die ("glib"); printf ("%s: running mainloop integration tests\n", "dbus-glib-test"); if (!_dbus_gmain_test (test_data_dir)) die ("gmain"); printf ("%s: running GObject tests\n", "dbus-glib-test"); if (!_dbus_gobject_test (test_data_dir)) die ("gobject"); printf ("%s: completed successfully\n", "dbus-glib-test"); #else printf ("Not compiled with unit tests, not running any\n"); #endif } dbus-glib-0.100.2/dbus/dbus-gmarshal.c0000644000175000017500000001046512107524614014305 00000000000000#include #include "dbus-gmarshal.h" #include #ifdef G_ENABLE_DEBUG #define g_marshal_value_peek_boolean(v) g_value_get_boolean (v) #define g_marshal_value_peek_char(v) g_value_get_char (v) #define g_marshal_value_peek_uchar(v) g_value_get_uchar (v) #define g_marshal_value_peek_int(v) g_value_get_int (v) #define g_marshal_value_peek_uint(v) g_value_get_uint (v) #define g_marshal_value_peek_long(v) g_value_get_long (v) #define g_marshal_value_peek_ulong(v) g_value_get_ulong (v) #define g_marshal_value_peek_int64(v) g_value_get_int64 (v) #define g_marshal_value_peek_uint64(v) g_value_get_uint64 (v) #define g_marshal_value_peek_enum(v) g_value_get_enum (v) #define g_marshal_value_peek_flags(v) g_value_get_flags (v) #define g_marshal_value_peek_float(v) g_value_get_float (v) #define g_marshal_value_peek_double(v) g_value_get_double (v) #define g_marshal_value_peek_string(v) (char*) g_value_get_string (v) #define g_marshal_value_peek_param(v) g_value_get_param (v) #define g_marshal_value_peek_boxed(v) g_value_get_boxed (v) #define g_marshal_value_peek_pointer(v) g_value_get_pointer (v) #define g_marshal_value_peek_object(v) g_value_get_object (v) #define g_marshal_value_peek_variant(v) g_value_get_variant (v) #else /* !G_ENABLE_DEBUG */ /* WARNING: This code accesses GValues directly, which is UNSUPPORTED API. * Do not access GValues directly in your code. Instead, use the * g_value_get_*() functions */ #define g_marshal_value_peek_boolean(v) (v)->data[0].v_int #define g_marshal_value_peek_char(v) (v)->data[0].v_int #define g_marshal_value_peek_uchar(v) (v)->data[0].v_uint #define g_marshal_value_peek_int(v) (v)->data[0].v_int #define g_marshal_value_peek_uint(v) (v)->data[0].v_uint #define g_marshal_value_peek_long(v) (v)->data[0].v_long #define g_marshal_value_peek_ulong(v) (v)->data[0].v_ulong #define g_marshal_value_peek_int64(v) (v)->data[0].v_int64 #define g_marshal_value_peek_uint64(v) (v)->data[0].v_uint64 #define g_marshal_value_peek_enum(v) (v)->data[0].v_long #define g_marshal_value_peek_flags(v) (v)->data[0].v_ulong #define g_marshal_value_peek_float(v) (v)->data[0].v_float #define g_marshal_value_peek_double(v) (v)->data[0].v_double #define g_marshal_value_peek_string(v) (v)->data[0].v_pointer #define g_marshal_value_peek_param(v) (v)->data[0].v_pointer #define g_marshal_value_peek_boxed(v) (v)->data[0].v_pointer #define g_marshal_value_peek_pointer(v) (v)->data[0].v_pointer #define g_marshal_value_peek_object(v) (v)->data[0].v_pointer #define g_marshal_value_peek_variant(v) (v)->data[0].v_pointer #endif /* !G_ENABLE_DEBUG */ /* NONE:STRING,STRING,STRING (dbus-gmarshal.list:1) */ void _dbus_g_marshal_VOID__STRING_STRING_STRING (GClosure *closure, GValue *return_value G_GNUC_UNUSED, guint n_param_values, const GValue *param_values, gpointer invocation_hint G_GNUC_UNUSED, gpointer marshal_data) { typedef void (*GMarshalFunc_VOID__STRING_STRING_STRING) (gpointer data1, gpointer arg_1, gpointer arg_2, gpointer arg_3, gpointer data2); register GMarshalFunc_VOID__STRING_STRING_STRING callback; register GCClosure *cc = (GCClosure*) closure; register gpointer data1, data2; g_return_if_fail (n_param_values == 4); if (G_CCLOSURE_SWAP_DATA (closure)) { data1 = closure->data; data2 = g_value_peek_pointer (param_values + 0); } else { data1 = g_value_peek_pointer (param_values + 0); data2 = closure->data; } callback = (GMarshalFunc_VOID__STRING_STRING_STRING) (marshal_data ? marshal_data : cc->callback); callback (data1, g_marshal_value_peek_string (param_values + 1), g_marshal_value_peek_string (param_values + 2), g_marshal_value_peek_string (param_values + 3), data2); } dbus-glib-0.100.2/dbus/dbus-gsignature.h0000644000175000017500000000113711634152371014661 00000000000000#ifndef DBUS_GOBJECT_SIGNATURE_H #define DBUS_GOBJECT_SIGNATURE_H #include #include #include GType _dbus_gtype_from_basic_typecode (int typecode); GType _dbus_gtype_from_signature (const char *signature, gboolean is_client); GType _dbus_gtype_from_signature_iter (DBusSignatureIter *sigiter, gboolean is_client); GArray * _dbus_gtypes_from_arg_signature (const char *signature, gboolean is_client); #endif dbus-glib-0.100.2/dbus/dbus-gtest.h0000644000175000017500000000266112112652540013635 00000000000000/* -*- mode: C; c-file-style: "gnu" -*- */ /* dbus-gtest.h Declarations of test functions. * * Copyright (C) 2003 Red Hat Inc. * * Licensed under the Academic Free License version 2.1 * * 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 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * */ #ifndef DBUS_GLIB_TEST_H #define DBUS_GLIB_TEST_H #include gboolean _dbus_gmain_test (const char *test_data_dir); gboolean _dbus_gobject_test (const char *test_data_dir); gboolean _dbus_gutils_test (const char *test_data_dir); gboolean _dbus_glib_test (const char *test_data_dir); gboolean _dbus_gvalue_test (const char *test_data_dir); gboolean _dbus_gvalue_utils_test (const char *test_data_dir); void dbus_glib_internal_do_not_use_run_tests (const char *test_data_dir); #endif /* DBUS_GLIB_TEST_H */ dbus-glib-0.100.2/dbus/dbus-gvalue-parse-variant.c0000644000175000017500000003624412107524614016547 00000000000000/* GVariant to dbus-glib escape hatch * * Copyright © 2010 Collabora Ltd. * * Licensed under the Academic Free License version 2.1 * * 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 of the License, or * (at your option) any later version. * * Alternatively, at your option, you can redistribute and/or modify * this single file under the terms of the GNU Lesser General Public License * as published by the Free Software Foundation; either version 2.1 of * that 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * */ #include #include #include #include /* Static functions in this file are a bit weird: they take a GVariant as first * argument, but it can be NULL. If it is, @value will be initialized with the * right type for that GVariant, but not filled in, so it'll contain 0 or NULL * or whatever. */ static void dbus_g_value_parse_variant_by_type (GVariant *variant, const GVariantType *variant_type, GValue *value); static void dbus_g_value_dict_parse_variant (GVariant *variant, const GVariantType *member_type, GValue *value) { const GVariantType *key_type, *value_type; GValue key_parsed = { 0 }, value_parsed = { 0 }; g_assert (g_variant_type_is_dict_entry (member_type)); key_type = g_variant_type_key (member_type); value_type = g_variant_type_value (member_type); /* first get the GTypes, without getting actual values */ dbus_g_value_parse_variant_by_type (NULL, key_type, &key_parsed); dbus_g_value_parse_variant_by_type (NULL, value_type, &value_parsed); g_value_init (value, dbus_g_type_get_map ("GHashTable", G_VALUE_TYPE (&key_parsed), G_VALUE_TYPE (&value_parsed))); g_value_unset (&key_parsed); g_value_unset (&value_parsed); if (variant != NULL) { GVariantIter iter; GVariant *child; DBusGTypeSpecializedAppendContext ctx; g_value_take_boxed (value, dbus_g_type_specialized_construct ( G_VALUE_TYPE (value))); dbus_g_type_specialized_init_append (value, &ctx); g_variant_iter_init (&iter, variant); for (child = g_variant_iter_next_value (&iter); child != NULL; child = g_variant_iter_next_value (&iter)) { GVariant *grandchild; grandchild = g_variant_get_child_value (child, 0); dbus_g_value_parse_variant_by_type (grandchild, key_type, &key_parsed); g_variant_unref (grandchild); grandchild = g_variant_get_child_value (child, 1); dbus_g_value_parse_variant_by_type (grandchild, value_type, &value_parsed); g_variant_unref (grandchild); /* Here be dragons: this steals the *contents of* key_parsed and * value_parsed, so we can't g_value_unset() them. */ dbus_g_type_specialized_map_append (&ctx, &key_parsed, &value_parsed); memset (&key_parsed, '\0', sizeof (key_parsed)); memset (&value_parsed, '\0', sizeof (value_parsed)); g_variant_unref (child); } } } static void dbus_g_value_basic_array_parse_variant (GVariant *variant, gchar type_char, GValue *value) { GType gtype = G_TYPE_INVALID; guint dg_size = 0, gv_size = 0; switch ((GVariantClass) type_char) { case G_VARIANT_CLASS_STRING: g_value_init (value, G_TYPE_STRV); if (variant != NULL) g_value_take_boxed (value, g_variant_dup_strv (variant, NULL)); return; case G_VARIANT_CLASS_OBJECT_PATH: case G_VARIANT_CLASS_SIGNATURE: { if (type_char == G_VARIANT_CLASS_OBJECT_PATH) gtype = DBUS_TYPE_G_OBJECT_PATH; else gtype = DBUS_TYPE_G_SIGNATURE; g_value_init (value, dbus_g_type_get_collection ("GPtrArray", gtype)); if (variant != NULL) { gsize n = g_variant_n_children (variant); gsize i; GPtrArray *pa = g_ptr_array_sized_new (n); for (i = 0; i < n; i++) { GVariant *child = g_variant_get_child_value (variant, i); gchar *s = g_variant_dup_string (child, NULL); g_ptr_array_add (pa, s); g_variant_unref (child); } g_value_take_boxed (value, pa); } } return; /* From here down handles fixed-size types. */ case G_VARIANT_CLASS_BYTE: gtype = G_TYPE_UCHAR; gv_size = dg_size = sizeof (guchar); break; case G_VARIANT_CLASS_BOOLEAN: gtype = G_TYPE_BOOLEAN; dg_size = sizeof (gboolean); gv_size = sizeof (guchar); break; case G_VARIANT_CLASS_INT16: gtype = G_TYPE_INT; dg_size = sizeof (gint); gv_size = sizeof (gint16); break; case G_VARIANT_CLASS_INT32: gtype = G_TYPE_INT; dg_size = sizeof (gint); gv_size = sizeof (gint32); break; case G_VARIANT_CLASS_UINT16: gtype = G_TYPE_UINT; dg_size = sizeof (guint); gv_size = sizeof (guint16); break; case G_VARIANT_CLASS_UINT32: gtype = G_TYPE_UINT; dg_size = sizeof (guint); gv_size = sizeof (guint32); break; case G_VARIANT_CLASS_INT64: gtype = G_TYPE_INT64; dg_size = gv_size = sizeof (gint64); break; case G_VARIANT_CLASS_UINT64: gtype = G_TYPE_UINT64; dg_size = gv_size = sizeof (guint64); break; case G_VARIANT_CLASS_DOUBLE: gtype = G_TYPE_DOUBLE; dg_size = gv_size = sizeof (gdouble); break; case G_VARIANT_CLASS_HANDLE: case G_VARIANT_CLASS_VARIANT: case G_VARIANT_CLASS_MAYBE: case G_VARIANT_CLASS_ARRAY: case G_VARIANT_CLASS_TUPLE: case G_VARIANT_CLASS_DICT_ENTRY: g_return_if_reached (); } g_assert (gtype != G_TYPE_INVALID); g_assert (dg_size != 0); g_assert (gv_size != 0); g_value_init (value, dbus_g_type_get_collection ("GArray", gtype)); if (variant != NULL) { GArray *arr; gsize n, i; gconstpointer blob = g_variant_get_fixed_array (variant, &n, gv_size); arr = g_array_sized_new (FALSE, FALSE, dg_size, n); g_value_take_boxed (value, arr); if (dg_size == gv_size) { /* fast path: we can just memcpy them in */ g_array_append_vals (arr, blob, n); } else { DBusGTypeSpecializedAppendContext ctx; dbus_g_type_specialized_init_append (value, &ctx); for (i = 0; i < n; i++) { GVariant *child; GValue v = { 0 }; child = g_variant_get_child_value (variant, i); dbus_g_value_parse_g_variant (child, &v); g_variant_unref (child); dbus_g_type_specialized_collection_append (&ctx, &v); } dbus_g_type_specialized_collection_end_append (&ctx); } } } static void dbus_g_value_tuple_parse_variant (GVariant *variant, const GVariantType *variant_type, GValue *value) { gsize n = g_variant_type_n_items (variant_type); GType *types; gsize i; GValueArray *va = g_value_array_new (n); const GVariantType *inner_type; types = g_new0 (GType, n); for (i = 0, inner_type = g_variant_type_first (variant_type); i < n; i++, inner_type = g_variant_type_next (inner_type)) { GVariant *inner_variant; if (variant == NULL) inner_variant = NULL; else inner_variant = g_variant_get_child_value (variant, i); g_value_array_append (va, NULL); dbus_g_value_parse_variant_by_type (inner_variant, inner_type, &va->values[i]); types[i] = G_VALUE_TYPE (&va->values[i]); if (inner_variant != NULL) g_variant_unref (inner_variant); } g_value_init (value, dbus_g_type_get_structv ("GValueArray", n, types)); if (variant == NULL) g_value_array_free (va); else g_value_take_boxed (value, va); g_free (types); } static void dbus_g_value_array_parse_variant (GVariant *variant, const GVariantType *variant_type, GValue *value) { const GVariantType *member_type; gchar type_char; GPtrArray *pa = NULL; gsize n = 0, i; g_assert (g_variant_type_is_array (variant_type)); member_type = g_variant_type_element (variant_type); type_char = g_variant_type_peek_string (member_type)[0]; if (g_variant_type_is_dict_entry (member_type)) { dbus_g_value_dict_parse_variant (variant, member_type, value); return; } if (g_variant_type_is_basic (member_type)) { dbus_g_value_basic_array_parse_variant (variant, type_char, value); return; } /* all the non-basic types end up as a GPtrArray of boxed */ if (variant != NULL) { n = g_variant_n_children (variant); pa = g_ptr_array_sized_new (n); } switch ((GVariantClass) type_char) { case G_VARIANT_CLASS_VARIANT: { g_value_init (value, dbus_g_type_get_collection ("GPtrArray", G_TYPE_VALUE)); } break; case G_VARIANT_CLASS_ARRAY: { GValue v = { 0 }; dbus_g_value_array_parse_variant (NULL, member_type, &v); g_value_init (value, dbus_g_type_get_collection ("GPtrArray", G_VALUE_TYPE (&v))); } break; case G_VARIANT_CLASS_TUPLE: { GValue v = { 0 }; dbus_g_value_tuple_parse_variant (NULL, member_type, &v); g_value_init (value, dbus_g_type_get_collection ("GPtrArray", G_VALUE_TYPE (&v))); } break; case G_VARIANT_CLASS_DICT_ENTRY: case G_VARIANT_CLASS_MAYBE: default: g_critical ("unhandled GVariantClass array<%d>", type_char); g_return_if_reached (); } if (variant != NULL) { for (i = 0; i < n; i++) { GVariant *child = g_variant_get_child_value (variant, i); GValue tmp = { 0 }; dbus_g_value_parse_g_variant (child, &tmp); g_ptr_array_add (pa, g_value_dup_boxed (&tmp)); g_variant_unref (child); g_value_unset (&tmp); } g_value_take_boxed (value, pa); } } static void dbus_g_value_parse_variant_by_type (GVariant *variant, const GVariantType *variant_type, GValue *value) { gchar type_char = g_variant_type_peek_string (variant_type)[0]; switch ((GVariantClass) type_char) { case G_VARIANT_CLASS_BOOLEAN: g_value_init (value, G_TYPE_BOOLEAN); if (variant != NULL) g_value_set_boolean (value, !!g_variant_get_boolean (variant)); break; case G_VARIANT_CLASS_BYTE: g_value_init (value, G_TYPE_UCHAR); if (variant != NULL) g_value_set_uchar (value, g_variant_get_byte (variant)); break; case G_VARIANT_CLASS_UINT16: /* there is no G_TYPE_UINT16 */ g_value_init (value, G_TYPE_UINT); if (variant != NULL) g_value_set_uint (value, g_variant_get_uint16 (variant)); break; case G_VARIANT_CLASS_UINT32: g_value_init (value, G_TYPE_UINT); if (variant != NULL) g_value_set_uint (value, g_variant_get_uint32 (variant)); break; case G_VARIANT_CLASS_UINT64: g_value_init (value, G_TYPE_UINT64); if (variant != NULL) g_value_set_uint64 (value, g_variant_get_uint64 (variant)); break; case G_VARIANT_CLASS_INT16: /* there is no G_TYPE_INT16 */ g_value_init (value, G_TYPE_INT); if (variant != NULL) g_value_set_int (value, g_variant_get_int16 (variant)); break; case G_VARIANT_CLASS_INT32: g_value_init (value, G_TYPE_INT); if (variant != NULL) g_value_set_int (value, g_variant_get_int32 (variant)); break; case G_VARIANT_CLASS_INT64: g_value_init (value, G_TYPE_INT64); if (variant != NULL) g_value_set_int64 (value, g_variant_get_int64 (variant)); break; case G_VARIANT_CLASS_DOUBLE: g_value_init (value, G_TYPE_DOUBLE); if (variant != NULL) g_value_set_double (value, g_variant_get_double (variant)); break; case G_VARIANT_CLASS_STRING: g_value_init (value, G_TYPE_STRING); if (variant != NULL) g_value_set_string (value, g_variant_get_string (variant, NULL)); break; case G_VARIANT_CLASS_OBJECT_PATH: g_value_init (value, DBUS_TYPE_G_OBJECT_PATH); if (variant != NULL) g_value_set_boxed (value, g_variant_get_string (variant, NULL)); break; case G_VARIANT_CLASS_SIGNATURE: g_value_init (value, DBUS_TYPE_G_SIGNATURE); if (variant != NULL) g_value_set_boxed (value, g_variant_get_string (variant, NULL)); break; case G_VARIANT_CLASS_VARIANT: g_value_init (value, G_TYPE_VALUE); if (variant != NULL) { GVariant *inner_variant = g_variant_get_variant (variant); GValue *inner_value = g_new0 (GValue, 1); dbus_g_value_parse_g_variant (inner_variant, inner_value); g_value_take_boxed (value, inner_value); g_variant_unref (inner_variant); } break; case G_VARIANT_CLASS_ARRAY: dbus_g_value_array_parse_variant (variant, variant_type, value); break; case G_VARIANT_CLASS_TUPLE: dbus_g_value_tuple_parse_variant (variant, variant_type, value); break; case G_VARIANT_CLASS_DICT_ENTRY: g_critical ("found a dict entry not in a dict"); break; case G_VARIANT_CLASS_HANDLE: case G_VARIANT_CLASS_MAYBE: g_critical ("unhandled GVariantClass '%c' (%d)", CLAMP (type_char, ' ', '~'), type_char); break; } } /** * dbus_g_value_parse_g_variant: * @variant: a #GVariant * @value: a zero-filled #GValue * * Deserialize @variant and put an equivalent dbus-glib data structure in * @value. * * It is an error if @variant contains any #GVariant extensions not supported * by dbus-glib, including handles (file descriptor passing) and 'maybe' types. */ void dbus_g_value_parse_g_variant (GVariant *variant, GValue *value) { g_return_if_fail (variant != NULL); dbus_g_value_parse_variant_by_type (variant, g_variant_get_type (variant), value); } dbus-glib-0.100.2/dbus/dbus-gthread.c0000644000175000017500000000256512107524614014127 00000000000000/* -*- mode: C; c-file-style: "gnu" -*- */ /* dbus-gthread.c GThread integration * * Copyright (C) 2002 CodeFactory AB * * Licensed under the Academic Free License version 2.1 * * 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 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * */ #include /* #define G_DEBUG_LOCKS 1 */ #include #include #include "dbus-glib.h" /** * dbus_g_thread_init: * * Initializes the D-BUS thread system. * This function may only be called * once and must be called prior to calling any * other function in the D-BUS API. */ void dbus_g_thread_init (void) { if (!g_thread_supported ()) g_error ("g_thread_init() must be called before dbus_threads_init()"); dbus_threads_init_default (); } dbus-glib-0.100.2/dbus/dbus-gmarshal.h0000644000175000017500000000147711742774700014324 00000000000000 #ifndef ___dbus_g_marshal_MARSHAL_H__ #define ___dbus_g_marshal_MARSHAL_H__ #include G_BEGIN_DECLS /* NONE:STRING,STRING,STRING (dbus-gmarshal.list:1) */ extern void _dbus_g_marshal_VOID__STRING_STRING_STRING (GClosure *closure, GValue *return_value, guint n_param_values, const GValue *param_values, gpointer invocation_hint, gpointer marshal_data); #define _dbus_g_marshal_NONE__STRING_STRING_STRING _dbus_g_marshal_VOID__STRING_STRING_STRING G_END_DECLS #endif /* ___dbus_g_marshal_MARSHAL_H__ */ dbus-glib-0.100.2/dbus/dbus-gutils.c0000644000175000017500000000464012107524614014014 00000000000000/* -*- mode: C; c-file-style: "gnu" -*- */ /* dbus-gutils.c Utils shared between convenience lib and installed lib * * Copyright (C) 2003 Red Hat, Inc. * * Licensed under the Academic Free License version 2.1 * * 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 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * */ #include #include "dbus-gutils.h" #include "dbus-gtest.h" #include char** _dbus_gutils_split_path (const char *path) { int len; char **split; int n_components; int i, j, comp; len = strlen (path); n_components = 0; if (path[1] != '\0') /* if not "/" */ { i = 0; while (i < len) { if (path[i] == '/') n_components += 1; ++i; } } split = g_new0 (char*, n_components + 1); comp = 0; if (n_components == 0) i = 1; else i = 0; while (comp < n_components) { if (path[i] == '/') ++i; j = i; while (j < len && path[j] != '/') ++j; /* Now [i, j) is the path component */ g_assert (i < j); g_assert (path[i] != '/'); g_assert (j == len || path[j] == '/'); split[comp] = g_strndup (&path[i], j - i + 1); split[comp][j-i] = '\0'; ++comp; i = j; } g_assert (i == len); return split; } char* _dbus_gutils_wincaps_to_uscore (const char *caps) { const char *p; GString *str; str = g_string_new (NULL); p = caps; while (*p) { if (g_ascii_isupper (*p)) { if (str->len > 0 && (str->len < 2 || str->str[str->len-2] != '_')) g_string_append_c (str, '_'); g_string_append_c (str, g_ascii_tolower (*p)); } else { g_string_append_c (str, *p); } ++p; } return g_string_free (str, FALSE); } dbus-glib-0.100.2/dbus/dbus-gmarshal.list0000644000175000017500000000003211634152371015024 00000000000000NONE:STRING,STRING,STRING dbus-glib-0.100.2/dbus/dbus-gmain.c0000644000175000017500000005052012112652540013572 00000000000000/* -*- mode: C; c-file-style: "gnu" -*- */ /* dbus-gmain.c GLib main loop integration * * Copyright (C) 2002, 2003 CodeFactory AB * Copyright (C) 2005 Red Hat, Inc. * * Licensed under the Academic Free License version 2.1 * * 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 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * */ #include #include #include #include "dbus-gtest.h" #include "dbus-gutils.h" #include "dbus-gvalue.h" #include "dbus-gobject.h" #include "dbus-gvalue-utils.h" #include "dbus-gsignature.h" #include /* * DBusGMessageQueue: * * A GSource subclass for dispatching DBusConnection messages. * We need this on top of the IO handlers, because sometimes * there are messages to dispatch queued up but no IO pending. */ typedef struct { GSource source; /**< the parent GSource */ DBusConnection *connection; /**< the connection to dispatch */ } DBusGMessageQueue; static gboolean message_queue_prepare (GSource *source, gint *timeout); static gboolean message_queue_check (GSource *source); static gboolean message_queue_dispatch (GSource *source, GSourceFunc callback, gpointer user_data); static const GSourceFuncs message_queue_funcs = { message_queue_prepare, message_queue_check, message_queue_dispatch, NULL }; static gboolean message_queue_prepare (GSource *source, gint *timeout) { DBusConnection *connection = ((DBusGMessageQueue *)source)->connection; *timeout = -1; return (dbus_connection_get_dispatch_status (connection) == DBUS_DISPATCH_DATA_REMAINS); } static gboolean message_queue_check (GSource *source) { return FALSE; } static gboolean message_queue_dispatch (GSource *source, GSourceFunc callback, gpointer user_data) { DBusConnection *connection = ((DBusGMessageQueue *)source)->connection; dbus_connection_ref (connection); /* Only dispatch once - we don't want to starve other GSource */ dbus_connection_dispatch (connection); dbus_connection_unref (connection); return TRUE; } typedef struct { GMainContext *context; /**< the main context */ GSList *ios; /**< all IOHandler */ GSList *timeouts; /**< all TimeoutHandler */ DBusConnection *connection; /**< NULL if this is really for a server not a connection */ GSource *message_queue_source; /**< DBusGMessageQueue */ } ConnectionSetup; typedef struct { ConnectionSetup *cs; GSource *source; DBusWatch *watch; } IOHandler; typedef struct { ConnectionSetup *cs; GSource *source; DBusTimeout *timeout; } TimeoutHandler; dbus_int32_t _dbus_gmain_connection_slot = -1; static dbus_int32_t server_slot = -1; static ConnectionSetup* connection_setup_new (GMainContext *context, DBusConnection *connection) { ConnectionSetup *cs; cs = g_new0 (ConnectionSetup, 1); g_assert (context != NULL); cs->context = context; g_main_context_ref (cs->context); if (connection) { cs->connection = connection; cs->message_queue_source = g_source_new ((GSourceFuncs *) &message_queue_funcs, sizeof (DBusGMessageQueue)); ((DBusGMessageQueue*)cs->message_queue_source)->connection = connection; g_source_attach (cs->message_queue_source, cs->context); } return cs; } static void io_handler_source_finalized (gpointer data) { IOHandler *handler; handler = data; if (handler->watch) dbus_watch_set_data (handler->watch, NULL, NULL); g_free (handler); } static void io_handler_destroy_source (void *data) { IOHandler *handler; handler = data; if (handler->source) { GSource *source = handler->source; handler->source = NULL; handler->cs->ios = g_slist_remove (handler->cs->ios, handler); g_source_destroy (source); g_source_unref (source); } } static void io_handler_watch_freed (void *data) { IOHandler *handler; handler = data; handler->watch = NULL; io_handler_destroy_source (handler); } static gboolean io_handler_dispatch (GIOChannel *source, GIOCondition condition, gpointer data) { IOHandler *handler; guint dbus_condition = 0; DBusConnection *connection; handler = data; connection = handler->cs->connection; if (connection) dbus_connection_ref (connection); if (condition & G_IO_IN) dbus_condition |= DBUS_WATCH_READABLE; if (condition & G_IO_OUT) dbus_condition |= DBUS_WATCH_WRITABLE; if (condition & G_IO_ERR) dbus_condition |= DBUS_WATCH_ERROR; if (condition & G_IO_HUP) dbus_condition |= DBUS_WATCH_HANGUP; /* Note that we don't touch the handler after this, because * dbus may have disabled the watch and thus killed the * handler. */ dbus_watch_handle (handler->watch, dbus_condition); handler = NULL; if (connection) dbus_connection_unref (connection); return TRUE; } /* Attach the connection setup to the given watch, removing any * previously-attached connection setup. */ static void connection_setup_add_watch (ConnectionSetup *cs, DBusWatch *watch) { guint flags; GIOCondition condition; GIOChannel *channel; IOHandler *handler; if (!dbus_watch_get_enabled (watch)) return; flags = dbus_watch_get_flags (watch); condition = G_IO_ERR | G_IO_HUP; if (flags & DBUS_WATCH_READABLE) condition |= G_IO_IN; if (flags & DBUS_WATCH_WRITABLE) condition |= G_IO_OUT; handler = g_new0 (IOHandler, 1); handler->cs = cs; handler->watch = watch; channel = g_io_channel_unix_new (dbus_watch_get_unix_fd (watch)); handler->source = g_io_create_watch (channel, condition); g_source_set_callback (handler->source, (GSourceFunc) io_handler_dispatch, handler, io_handler_source_finalized); g_source_attach (handler->source, cs->context); cs->ios = g_slist_prepend (cs->ios, handler); dbus_watch_set_data (watch, handler, io_handler_watch_freed); g_io_channel_unref (channel); } static void connection_setup_remove_watch (ConnectionSetup *cs, DBusWatch *watch) { IOHandler *handler; handler = dbus_watch_get_data (watch); if (handler == NULL || handler->cs != cs) return; io_handler_destroy_source (handler); } static void timeout_handler_source_finalized (gpointer data) { TimeoutHandler *handler; handler = data; if (handler->timeout) dbus_timeout_set_data (handler->timeout, NULL, NULL); g_free (handler); } static void timeout_handler_destroy_source (void *data) { TimeoutHandler *handler; handler = data; if (handler->source) { GSource *source = handler->source; handler->source = NULL; handler->cs->timeouts = g_slist_remove (handler->cs->timeouts, handler); g_source_destroy (source); g_source_unref (source); } } static void timeout_handler_timeout_freed (void *data) { TimeoutHandler *handler; handler = data; handler->timeout = NULL; timeout_handler_destroy_source (handler); } static gboolean timeout_handler_dispatch (gpointer data) { TimeoutHandler *handler; handler = data; dbus_timeout_handle (handler->timeout); return TRUE; } static void connection_setup_add_timeout (ConnectionSetup *cs, DBusTimeout *timeout) { TimeoutHandler *handler; if (!dbus_timeout_get_enabled (timeout)) return; g_assert (dbus_timeout_get_data (timeout) == NULL); handler = g_new0 (TimeoutHandler, 1); handler->cs = cs; handler->timeout = timeout; handler->source = g_timeout_source_new (dbus_timeout_get_interval (timeout)); g_source_set_callback (handler->source, timeout_handler_dispatch, handler, timeout_handler_source_finalized); g_source_attach (handler->source, handler->cs->context); cs->timeouts = g_slist_prepend (cs->timeouts, handler); dbus_timeout_set_data (timeout, handler, timeout_handler_timeout_freed); } static void connection_setup_remove_timeout (ConnectionSetup *cs, DBusTimeout *timeout) { TimeoutHandler *handler; handler = dbus_timeout_get_data (timeout); if (handler == NULL) return; timeout_handler_destroy_source (handler); } static void connection_setup_free (ConnectionSetup *cs) { while (cs->ios) io_handler_destroy_source (cs->ios->data); while (cs->timeouts) timeout_handler_destroy_source (cs->timeouts->data); if (cs->message_queue_source) { GSource *source; source = cs->message_queue_source; cs->message_queue_source = NULL; g_source_destroy (source); g_source_unref (source); } g_main_context_unref (cs->context); g_free (cs); } static dbus_bool_t add_watch (DBusWatch *watch, gpointer data) { ConnectionSetup *cs; cs = data; connection_setup_add_watch (cs, watch); return TRUE; } static void remove_watch (DBusWatch *watch, gpointer data) { ConnectionSetup *cs; cs = data; connection_setup_remove_watch (cs, watch); } static void watch_toggled (DBusWatch *watch, void *data) { /* Because we just exit on OOM, enable/disable is * no different from add/remove */ if (dbus_watch_get_enabled (watch)) add_watch (watch, data); else remove_watch (watch, data); } static dbus_bool_t add_timeout (DBusTimeout *timeout, void *data) { ConnectionSetup *cs; cs = data; if (!dbus_timeout_get_enabled (timeout)) return TRUE; connection_setup_add_timeout (cs, timeout); return TRUE; } static void remove_timeout (DBusTimeout *timeout, void *data) { ConnectionSetup *cs; cs = data; connection_setup_remove_timeout (cs, timeout); } static void timeout_toggled (DBusTimeout *timeout, void *data) { /* Because we just exit on OOM, enable/disable is * no different from add/remove */ if (dbus_timeout_get_enabled (timeout)) add_timeout (timeout, data); else remove_timeout (timeout, data); } static void wakeup_main (void *data) { ConnectionSetup *cs = data; g_main_context_wakeup (cs->context); } /* Move to a new context */ static ConnectionSetup* connection_setup_new_from_old (GMainContext *context, ConnectionSetup *old) { ConnectionSetup *cs; g_assert (old->context != context); cs = connection_setup_new (context, old->connection); while (old->ios != NULL) { IOHandler *handler = old->ios->data; connection_setup_add_watch (cs, handler->watch); /* The old handler will be removed from old->ios as a side-effect */ } while (old->timeouts != NULL) { TimeoutHandler *handler = old->timeouts->data; connection_setup_add_timeout (cs, handler->timeout); } return cs; } /** * dbus_connection_setup_with_g_main: * @connection: the connection * @context: the #GMainContext or %NULL for default context * * Sets the watch and timeout functions of a #DBusConnection * to integrate the connection with the GLib main loop. * Pass in %NULL for the #GMainContext unless you're * doing something specialized. * * If called twice for the same context, does nothing the second * time. If called once with context A and once with context B, * context B replaces context A as the context monitoring the * connection. */ void dbus_connection_setup_with_g_main (DBusConnection *connection, GMainContext *context) { ConnectionSetup *old_setup; ConnectionSetup *cs; /* FIXME we never free the slot, so its refcount just keeps growing, * which is kind of broken. */ dbus_connection_allocate_data_slot (&_dbus_gmain_connection_slot); if (_dbus_gmain_connection_slot < 0) goto nomem; if (context == NULL) context = g_main_context_default (); cs = NULL; old_setup = dbus_connection_get_data (connection, _dbus_gmain_connection_slot); if (old_setup != NULL) { if (old_setup->context == context) return; /* nothing to do */ cs = connection_setup_new_from_old (context, old_setup); /* Nuke the old setup */ dbus_connection_set_data (connection, _dbus_gmain_connection_slot, NULL, NULL); old_setup = NULL; } if (cs == NULL) cs = connection_setup_new (context, connection); if (!dbus_connection_set_data (connection, _dbus_gmain_connection_slot, cs, (DBusFreeFunction)connection_setup_free)) goto nomem; if (!dbus_connection_set_watch_functions (connection, add_watch, remove_watch, watch_toggled, cs, NULL)) goto nomem; if (!dbus_connection_set_timeout_functions (connection, add_timeout, remove_timeout, timeout_toggled, cs, NULL)) goto nomem; dbus_connection_set_wakeup_main_function (connection, wakeup_main, cs, NULL); return; nomem: g_error ("Not enough memory to set up DBusConnection for use with GLib"); } /** * dbus_server_setup_with_g_main: * @server: the server * @context: the #GMainContext or %NULL for default * * Sets the watch and timeout functions of a #DBusServer * to integrate the server with the GLib main loop. * In most cases the context argument should be %NULL. * * If called twice for the same context, does nothing the second * time. If called once with context A and once with context B, * context B replaces context A as the context monitoring the * connection. */ void dbus_server_setup_with_g_main (DBusServer *server, GMainContext *context) { ConnectionSetup *old_setup; ConnectionSetup *cs; /* FIXME we never free the slot, so its refcount just keeps growing, * which is kind of broken. */ dbus_server_allocate_data_slot (&server_slot); if (server_slot < 0) goto nomem; if (context == NULL) context = g_main_context_default (); cs = NULL; old_setup = dbus_server_get_data (server, server_slot); if (old_setup != NULL) { if (old_setup->context == context) return; /* nothing to do */ cs = connection_setup_new_from_old (context, old_setup); /* Nuke the old setup */ if (!dbus_server_set_data (server, server_slot, NULL, NULL)) goto nomem; old_setup = NULL; } if (cs == NULL) cs = connection_setup_new (context, NULL); if (!dbus_server_set_data (server, server_slot, cs, (DBusFreeFunction)connection_setup_free)) goto nomem; if (!dbus_server_set_watch_functions (server, add_watch, remove_watch, watch_toggled, cs, NULL)) goto nomem; if (!dbus_server_set_timeout_functions (server, add_timeout, remove_timeout, timeout_toggled, cs, NULL)) goto nomem; return; nomem: g_error ("Not enough memory to set up DBusServer for use with GLib"); } /** * dbus_g_connection_open: * @address: address of the connection to open * @error: address where an error can be returned. * * Returns a connection to the given address. * * (Internally, calls dbus_connection_open() then calls * dbus_connection_setup_with_g_main() on the result.) * * Returns: a DBusConnection */ DBusGConnection* dbus_g_connection_open (const gchar *address, GError **error) { DBusConnection *connection; DBusError derror; g_return_val_if_fail (error == NULL || *error == NULL, NULL); _dbus_g_value_types_init (); dbus_error_init (&derror); connection = dbus_connection_open (address, &derror); if (connection == NULL) { dbus_set_g_error (error, &derror); dbus_error_free (&derror); return NULL; } /* does nothing if it's already been done */ dbus_connection_setup_with_g_main (connection, NULL); return DBUS_G_CONNECTION_FROM_CONNECTION (connection); } /** * dbus_g_bus_get: * @type: bus type * @error: address where an error can be returned. * * Returns a connection to the given bus. The connection is a global variable * shared with other callers of this function. * * (Internally, calls dbus_bus_get() then calls * dbus_connection_setup_with_g_main() on the result.) * * Returns: a DBusConnection */ DBusGConnection* dbus_g_bus_get (DBusBusType type, GError **error) { DBusConnection *connection; DBusError derror; g_return_val_if_fail (error == NULL || *error == NULL, NULL); _dbus_g_value_types_init (); dbus_error_init (&derror); connection = dbus_bus_get (type, &derror); if (connection == NULL) { dbus_set_g_error (error, &derror); dbus_error_free (&derror); return NULL; } /* does nothing if it's already been done */ dbus_connection_setup_with_g_main (connection, NULL); return DBUS_G_CONNECTION_FROM_CONNECTION (connection); } /** * dbus_g_bus_get_private: * @type: bus type * @context: Mainloop context to attach to * @error: address where an error can be returned. * * Returns a connection to the given bus. The connection will be a private * non-shared connection and should be closed when usage is complete. * * Internally this function calls dbus_bus_get_private() then calls * dbus_connection_setup_with_g_main() on the result; see the documentation * of the former function for more information on private connections. * * Returns: a DBusConnection */ DBusGConnection* dbus_g_bus_get_private (DBusBusType type, GMainContext *context, GError **error) { DBusConnection *connection; DBusError derror; g_return_val_if_fail (error == NULL || *error == NULL, NULL); _dbus_g_value_types_init (); dbus_error_init (&derror); connection = dbus_bus_get_private (type, &derror); if (connection == NULL) { dbus_set_g_error (error, &derror); dbus_error_free (&derror); return NULL; } /* does nothing if it's already been done */ dbus_connection_setup_with_g_main (connection, context); return DBUS_G_CONNECTION_FROM_CONNECTION (connection); } #ifdef DBUS_BUILD_TESTS /* * Unit test for GLib main loop integration * Returns: %TRUE on success. */ gboolean _dbus_gmain_test (const char *test_data_dir) { GType type; GType rectype; g_type_init (); _dbus_g_value_types_init (); rectype = dbus_g_type_get_collection ("GArray", G_TYPE_UINT); g_assert (rectype != G_TYPE_INVALID); g_assert (!strcmp (g_type_name (rectype), "GArray_guint_")); type = _dbus_gtype_from_signature ("au", TRUE); g_assert (type == rectype); rectype = dbus_g_type_get_map ("GHashTable", G_TYPE_STRING, G_TYPE_STRING); g_assert (rectype != G_TYPE_INVALID); g_assert (!strcmp (g_type_name (rectype), "GHashTable_gchararray+gchararray_")); type = _dbus_gtype_from_signature ("a{ss}", TRUE); g_assert (type == rectype); type = _dbus_gtype_from_signature ("o", FALSE); g_assert (type == DBUS_TYPE_G_OBJECT_PATH); type = _dbus_gtype_from_signature ("o", TRUE); g_assert (type == DBUS_TYPE_G_OBJECT_PATH); type = _dbus_gtype_from_signature ("g", TRUE); g_assert (type == DBUS_TYPE_G_SIGNATURE); return TRUE; } #endif /* DBUS_BUILD_TESTS */ dbus-glib-0.100.2/dbus/dbus-bash-completion.sh.in0000644000175000017500000000105112107524563016362 00000000000000 # Check for bash [ -z "$BASH_VERSION" ] && return ################################################################################ __dbus_send() { local IFS=$'\n' local cur="${COMP_WORDS[COMP_CWORD]}" # --name=value style option if [[ "$cur" == *=* ]] ; then cur=${cur/*=/} fi COMPREPLY=($(compgen -W "$(@libexecdir@/dbus-bash-completion-helper dbus-send ${COMP_WORDS[@]:0})" -- $cur)) } ################################################################################ complete -o nospace -F __dbus_send dbus-send dbus-glib-0.100.2/dbus/dbus-gidl.c0000644000175000017500000003437212107524614013431 00000000000000/* -*- mode: C; c-file-style: "gnu" -*- */ /* dbus-gidl.c data structure describing an interface, to be generated from IDL * or something * * Copyright (C) 2003, 2005 Red Hat, Inc. * * Licensed under the Academic Free License version 2.1 * * 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 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * */ #include #include "dbus-gidl.h" struct BaseInfo { unsigned int refcount : 28; unsigned int type : 4; char *name; }; struct NodeInfo { BaseInfo base; GSList *interfaces; GSList *nodes; }; struct InterfaceInfo { BaseInfo base; GHashTable *annotations; /* Since we have BaseInfo now these could be one list */ GSList *methods; GSList *signals; GSList *properties; }; struct MethodInfo { BaseInfo base; GHashTable *annotations; GSList *args; }; struct SignalInfo { BaseInfo base; GSList *args; }; struct PropertyInfo { BaseInfo base; char *type; PropertyAccessFlags access; }; struct ArgInfo { BaseInfo base; char *type; ArgDirection direction; GHashTable *annotations; }; static void get_hash_key (gpointer key, gpointer value, gpointer data) { GSList **list = data; *list = g_slist_prepend (*list, key); } static GSList * get_hash_keys (GHashTable *table) { GSList *ret = NULL; g_hash_table_foreach (table, get_hash_key, &ret); return ret; } BaseInfo * base_info_ref (BaseInfo *info) { g_return_val_if_fail (info != NULL, NULL); g_return_val_if_fail (info->refcount > 0, NULL); info->refcount += 1; return info; } static void base_info_free (void *ptr) { BaseInfo *info; info = ptr; g_free (info->name); g_free (info); } void base_info_unref (BaseInfo *info) { g_return_if_fail (info != NULL); g_return_if_fail (info->refcount > 0); /* This is sort of bizarre, BaseInfo was tacked on later */ switch (info->type) { case INFO_TYPE_NODE: node_info_unref ((NodeInfo*) info); break; case INFO_TYPE_INTERFACE: interface_info_unref ((InterfaceInfo*) info); break; case INFO_TYPE_SIGNAL: signal_info_unref ((SignalInfo*) info); break; case INFO_TYPE_METHOD: method_info_unref ((MethodInfo*) info); break; case INFO_TYPE_PROPERTY: property_info_unref ((PropertyInfo*) info); break; case INFO_TYPE_ARG: arg_info_unref ((ArgInfo*) info); break; } } InfoType base_info_get_type (BaseInfo *info) { return info->type; } const char* base_info_get_name (BaseInfo *info) { return info->name; } void base_info_set_name (BaseInfo *info, const char *name) { char *old; old = info->name; info->name = g_strdup (name); g_free (old); } GType base_info_get_gtype (void) { static GType our_type = 0; if (our_type == 0) our_type = g_boxed_type_register_static ("BaseInfo", (GBoxedCopyFunc) base_info_ref, (GBoxedFreeFunc) base_info_unref); return our_type; } static void free_interface_list (GSList **interfaces_p) { GSList *tmp; tmp = *interfaces_p; while (tmp != NULL) { interface_info_unref (tmp->data); tmp = tmp->next; } g_slist_free (*interfaces_p); *interfaces_p = NULL; } static void free_node_list (GSList **nodes_p) { GSList *tmp; tmp = *nodes_p; while (tmp != NULL) { node_info_unref (tmp->data); tmp = tmp->next; } g_slist_free (*nodes_p); *nodes_p = NULL; } static void free_method_list (GSList **methods_p) { GSList *tmp; tmp = *methods_p; while (tmp != NULL) { method_info_unref (tmp->data); tmp = tmp->next; } g_slist_free (*methods_p); *methods_p = NULL; } static void free_signal_list (GSList **signals_p) { GSList *tmp; tmp = *signals_p; while (tmp != NULL) { signal_info_unref (tmp->data); tmp = tmp->next; } g_slist_free (*signals_p); *signals_p = NULL; } static void free_property_list (GSList **props_p) { GSList *tmp; tmp = *props_p; while (tmp != NULL) { property_info_unref (tmp->data); tmp = tmp->next; } g_slist_free (*props_p); *props_p = NULL; } NodeInfo* node_info_new (const char *name) { NodeInfo *info; /* name can be NULL */ info = g_new0 (NodeInfo, 1); info->base.refcount = 1; info->base.name = g_strdup (name); info->base.type = INFO_TYPE_NODE; return info; } NodeInfo * node_info_ref (NodeInfo *info) { info->base.refcount += 1; return info; } void node_info_unref (NodeInfo *info) { info->base.refcount -= 1; if (info->base.refcount == 0) { free_interface_list (&info->interfaces); free_node_list (&info->nodes); base_info_free (info); } } const char* node_info_get_name (NodeInfo *info) { return info->base.name; } GSList* node_info_get_interfaces (NodeInfo *info) { return info->interfaces; } void node_info_add_interface (NodeInfo *info, InterfaceInfo *interface) { interface_info_ref (interface); info->interfaces = g_slist_append (info->interfaces, interface); } GSList* node_info_get_nodes (NodeInfo *info) { return info->nodes; } void node_info_add_node (NodeInfo *info, NodeInfo *node) { node_info_ref (node); info->nodes = g_slist_append (info->nodes, node); } void node_info_replace_node (NodeInfo *info, NodeInfo *old_child, NodeInfo *new_child) { GSList *link; node_info_ref (new_child); /* before unref old_child in case they are the same */ link = g_slist_find (info->nodes, old_child); g_assert (link != NULL); node_info_unref (old_child); link->data = new_child; } InterfaceInfo* interface_info_new (const char *name) { InterfaceInfo *info; info = g_new0 (InterfaceInfo, 1); info->base.refcount = 1; info->base.name = g_strdup (name); info->base.type = INFO_TYPE_INTERFACE; info->annotations = g_hash_table_new_full (g_str_hash, g_str_equal, (GDestroyNotify) g_free, (GDestroyNotify) g_free); return info; } InterfaceInfo * interface_info_ref (InterfaceInfo *info) { info->base.refcount += 1; return info; } void interface_info_unref (InterfaceInfo *info) { info->base.refcount -= 1; if (info->base.refcount == 0) { g_hash_table_destroy (info->annotations); free_method_list (&info->methods); free_signal_list (&info->signals); free_property_list (&info->properties); base_info_free (info); } } const char* interface_info_get_name (InterfaceInfo *info) { return info->base.name; } GSList * interface_info_get_annotations (InterfaceInfo *info) { return get_hash_keys (info->annotations); } const char* interface_info_get_annotation (InterfaceInfo *info, const char *name) { return g_hash_table_lookup (info->annotations, name); } GSList* interface_info_get_methods (InterfaceInfo *info) { return info->methods; } GSList* interface_info_get_signals (InterfaceInfo *info) { return info->signals; } GSList* interface_info_get_properties (InterfaceInfo *info) { return info->properties; } void interface_info_add_annotation (InterfaceInfo *info, const char *name, const char *value) { g_hash_table_insert (info->annotations, g_strdup (name), g_strdup (value)); } void interface_info_add_method (InterfaceInfo *info, MethodInfo *method) { method_info_ref (method); info->methods = g_slist_append (info->methods, method); } void interface_info_add_signal (InterfaceInfo *info, SignalInfo *signal) { signal_info_ref (signal); info->signals = g_slist_append (info->signals, signal); } void interface_info_add_property (InterfaceInfo *info, PropertyInfo *property) { property_info_ref (property); info->properties = g_slist_append (info->properties, property); } static void free_arg_list (GSList **args_p) { GSList *tmp; tmp = *args_p; while (tmp != NULL) { ArgInfo *ai = tmp->data; g_assert (ai->base.type == INFO_TYPE_ARG); arg_info_unref (tmp->data); tmp = tmp->next; } g_slist_free (*args_p); *args_p = NULL; } MethodInfo* method_info_new (const char *name) { MethodInfo *info; info = g_new0 (MethodInfo, 1); info->base.refcount = 1; info->base.name = g_strdup (name); info->base.type = INFO_TYPE_METHOD; info->annotations = g_hash_table_new_full (g_str_hash, g_str_equal, (GDestroyNotify) g_free, (GDestroyNotify) g_free); return info; } MethodInfo * method_info_ref (MethodInfo *info) { info->base.refcount += 1; return info; } void method_info_unref (MethodInfo *info) { info->base.refcount -= 1; if (info->base.refcount == 0) { g_hash_table_destroy (info->annotations); free_arg_list (&info->args); base_info_free (info); } } const char* method_info_get_name (MethodInfo *info) { return info->base.name; } GSList * method_info_get_annotations (MethodInfo *info) { return get_hash_keys (info->annotations); } const char* method_info_get_annotation (MethodInfo *info, const char *name) { return g_hash_table_lookup (info->annotations, name); } GSList* method_info_get_args (MethodInfo *info) { return info->args; } int method_info_get_n_args (MethodInfo *info) { return g_slist_length (info->args); } static int args_sort_by_direction (const void *a, const void *b) { const ArgInfo *arg_a = a; const ArgInfo *arg_b = b; if (arg_a->direction == arg_b->direction) return 0; else if (arg_a->direction == ARG_IN) return -1; /* in is less than out */ else return 1; } void method_info_add_annotation (MethodInfo *info, const char *name, const char *value) { g_hash_table_insert (info->annotations, g_strdup (name), g_strdup (value)); } void method_info_add_arg (MethodInfo *info, ArgInfo *arg) { arg_info_ref (arg); info->args = g_slist_append (info->args, arg); /* Keep "in" args sorted before "out" and otherwise maintain * stable order (g_slist_sort is stable, at least in sufficiently * new glib) */ info->args = g_slist_sort (info->args, args_sort_by_direction); } SignalInfo* signal_info_new (const char *name) { SignalInfo *info; info = g_new0 (SignalInfo, 1); info->base.refcount = 1; info->base.name = g_strdup (name); info->base.type = INFO_TYPE_SIGNAL; return info; } SignalInfo * signal_info_ref (SignalInfo *info) { info->base.refcount += 1; return info; } void signal_info_unref (SignalInfo *info) { info->base.refcount -= 1; if (info->base.refcount == 0) { free_arg_list (&info->args); base_info_free (info); } } const char* signal_info_get_name (SignalInfo *info) { return info->base.name; } GSList* signal_info_get_args (SignalInfo *info) { return info->args; } int signal_info_get_n_args (SignalInfo *info) { return g_slist_length (info->args); } void signal_info_add_arg (SignalInfo *info, ArgInfo *arg) { g_assert (arg->direction == ARG_OUT); arg_info_ref (arg); info->args = g_slist_append (info->args, arg); /* signal args don't need sorting since only "out" is allowed */ } PropertyInfo* property_info_new (const char *name, const char *type, PropertyAccessFlags access) { PropertyInfo *info; info = g_new0 (PropertyInfo, 1); info->base.refcount = 1; info->base.name = g_strdup (name); info->base.type = INFO_TYPE_PROPERTY; info->type = g_strdup (type); info->access = access; return info; } PropertyInfo* property_info_ref (PropertyInfo *info) { info->base.refcount += 1; return info; } void property_info_unref (PropertyInfo *info) { info->base.refcount -= 1; if (info->base.refcount == 0) { g_free (info->type); base_info_free (info); } } const char* property_info_get_name (PropertyInfo *info) { return info->base.name; } const char * property_info_get_type (PropertyInfo *info) { return info->type; } PropertyAccessFlags property_info_get_access (PropertyInfo *info) { return info->access; } ArgInfo* arg_info_new (const char *name, ArgDirection direction, const char *type) { ArgInfo *info; info = g_new0 (ArgInfo, 1); info->base.refcount = 1; info->base.type = INFO_TYPE_ARG; /* name can be NULL */ info->base.name = g_strdup (name); info->direction = direction; info->type = g_strdup (type); info->annotations = g_hash_table_new_full (g_str_hash, g_str_equal, (GDestroyNotify) g_free, (GDestroyNotify) g_free); return info; } ArgInfo * arg_info_ref (ArgInfo *info) { info->base.refcount += 1; return info; } void arg_info_unref (ArgInfo *info) { info->base.refcount -= 1; if (info->base.refcount == 0) { g_hash_table_destroy (info->annotations); g_free (info->type); base_info_free (info); } } const char* arg_info_get_name (ArgInfo *info) { return info->base.name; } const char * arg_info_get_type (ArgInfo *info) { return info->type; } ArgDirection arg_info_get_direction (ArgInfo *info) { return info->direction; } GSList* arg_info_get_annotations (ArgInfo *info) { return get_hash_keys (info->annotations); } const char* arg_info_get_annotation (ArgInfo *info, const char *annotation) { return g_hash_table_lookup (info->annotations, annotation); } void arg_info_add_annotation (ArgInfo *info, const char *name, const char *value) { g_hash_table_insert (info->annotations, g_strdup (name), g_strdup (value)); } dbus-glib-0.100.2/dbus/Makefile.am0000644000175000017500000000766112107524614013450 00000000000000SUBDIRS = . examples INCLUDES = \ -I$(top_srcdir) \ -I$(top_builddir) \ $(DBUS_CFLAGS) \ $(DBUS_GLIB_CFLAGS) \ $(DBUS_GLIB_TOOL_CFLAGS) \ -DDBUS_COMPILATION=1 \ -DDBUS_LOCALEDIR=\"$(prefix)/@DATADIRNAME@/locale\" lib_LTLIBRARIES=libdbus-glib-1.la CLEANFILES = $(BUILT_SOURCES) DBUS_GLIB_INTERNALS = \ dbus-gtype-specialized.c \ dbus-gtype-specialized-priv.h \ dbus-gutils.c \ dbus-gutils.h \ dbus-gsignature.c \ dbus-gsignature.h \ dbus-gvalue.h \ dbus-gvalue-utils.c \ dbus-gvalue-utils.h libdbus_glib_1_la_SOURCES = \ dbus-glib.c \ dbus-gmain.c \ dbus-gmarshal.c \ dbus-gmarshal.h \ dbus-gobject.c \ dbus-gobject.h \ dbus-gproxy.c \ dbus-gtest.c \ dbus-gtest.h \ dbus-gvalue.c \ dbus-gvalue.h \ dbus-gvalue-parse-variant.c \ dbus-gthread.c \ $(DBUS_GLIB_INTERNALS) libdbus_glib_HEADERS = \ dbus-gtype-specialized.h \ dbus-gvalue-parse-variant.h \ dbus-glib.h \ dbus-glib-lowlevel.h libdbus_glibdir = $(includedir)/dbus-1.0/dbus libdbus_glib_1_la_LIBADD= $(DBUS_LIBS) $(DBUS_GLIB_LIBS) ## don't export symbols that start with "_" (we use this ## convention for internal symbols) libdbus_glib_1_la_LDFLAGS= -export-symbols-regex "^[^_].*" -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) -no-undefined # convenience lib used here and by dbus-viewer noinst_LTLIBRARIES=libdbus-gtool.la libdbus_gtool_la_SOURCES = $(DBUS_GLIB_INTERNALS) \ dbus-gidl.c \ dbus-gidl.h \ dbus-gloader-expat.c \ dbus-gparser.c \ dbus-gparser.h libdbus_gtool_la_LIBADD = $(DBUS_LIBS) -lexpat bin_PROGRAMS=dbus-binding-tool dbus_binding_tool_SOURCES = \ dbus-binding-tool-glib.h \ dbus-binding-tool-glib.c \ dbus-glib-tool.h \ dbus-glib-tool.c dbus_binding_tool_LDADD= $(builddir)/libdbus-gtool.la $(builddir)/libdbus-glib-1.la $(DBUS_LIBS) $(DBUS_GLIB_LIBS) -lexpat ## we just rebuilt these manually and check them into cvs; easier than ## convincing automake/make to do this properly regenerate-built-sources: @GLIB_GENMARSHAL@ --prefix=_dbus_g_marshal dbus-gmarshal.list --header > dbus-gmarshal.h && \ echo '#include ' > dbus-gmarshal.c && \ echo '#include "dbus-gmarshal.h"' >> dbus-gmarshal.c && \ @GLIB_GENMARSHAL@ --prefix=_dbus_g_marshal dbus-gmarshal.list --body >> dbus-gmarshal.c completiondir = $(sysconfdir)/bash_completion.d if DBUS_BASH_COMPLETION libexec_PROGRAMS=dbus-bash-completion-helper completion_SCRIPTS=dbus-bash-completion.sh endif dbus-bash-completion.sh : dbus-bash-completion.sh.in @sed -e "s|\@libexecdir\@|$(libexecdir)|" $< > $@ CLEANFILES += dbus-bash-completion.sh dbus_bash_completion_helper_SOURCES = \ dbus-bash-completion-helper.c dbus_bash_completion_helper_LDADD=$(builddir)/libdbus-gtool.la -lexpat $(builddir)/libdbus-glib-1.la $(DBUS_LIBS) $(DBUS_GLIB_LIBS) EXTRA_DIST=dbus-gmarshal.list dbus-bash-completion.sh.in Android.mk: Makefile.am androgenizer -:PROJECT dbus-glib -:SHARED libdbus-glib-1 -:TAGS eng debug \ -:REL_TOP $(top_srcdir) -:ABS_TOP $(abs_top_srcdir) \ -:SOURCES $(libdbus_glib_1_la_SOURCES) \ -:CFLAGS $(DEFS) $(CFLAGS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CFLAGS) \ -:CPPFLAGS $(CPPFLAGS) $(AM_CPPFLAGS) \ -:LDFLAGS $(libdbus_glib_1_la_LIBADD) $(libdbus_glib_1_la_LDFLAGS) \ > $@ if DBUS_BUILD_TESTS ## we use noinst_PROGRAMS not check_PROGRAMS for TESTS so that we ## build even when not doing "make check" noinst_PROGRAMS= $(TESTS) ## note that TESTS has special meaning (stuff to use in make check) ## so if adding tests not to be run in make check, don't add them to ## TESTS TESTS_ENVIRONMENT=DBUS_TEST_DATA=$(top_builddir)/test/data DBUS_TEST_HOMEDIR=$(top_builddir)/dbus TESTS=dbus-glib-test ## FIXME we aren't running dbus-glib-tool --self-test dbus_glib_test_SOURCES= \ dbus-gtest-main.c dbus_glib_test_LDADD= $(builddir)/libdbus-glib-1.la else ### not building tests TESTS= endif dbus-glib-0.100.2/dbus/dbus-glib-tool.h0000644000175000017500000000240012107524563014375 00000000000000/* -*- mode: C; c-file-style: "gnu" -*- */ /* dbus-glib-tool.h: Definitions used internally by binding tool * * Copyright (C) 2005 Red Hat, Inc. * * Licensed under the Academic Free License version 2.1 * * 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 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * */ #ifndef DBUS_BINDING_TOOL_H #define DBUS_BINDING_TOOL_H #include typedef enum { DBUS_BINDING_TOOL_ERROR_UNSUPPORTED_CONVERSION, DBUS_BINDING_TOOL_ERROR_INVALID_ANNOTATION } DBusBindingToolError; #define DBUS_BINDING_TOOL_ERROR dbus_binding_tool_error_quark () GQuark dbus_binding_tool_error_quark (void); #endif dbus-glib-0.100.2/dbus/dbus-gvalue-utils.h0000644000175000017500000000540112107524563015132 00000000000000/* -*- mode: C; c-file-style: "gnu" -*- */ /* dbus-gvalue-utils.h: Non-DBus-specific functions related to GType/GValue * * Copyright (C) 2005 Red Hat, Inc. * * Licensed under the Academic Free License version 2.1 * * 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 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * */ #ifndef DBUS_GOBJECT_VALUE_UTILS_H #define DBUS_GOBJECT_VALUE_UTILS_H #include #include G_BEGIN_DECLS void _dbus_g_type_specialized_builtins_init (void); gboolean _dbus_g_type_is_fixed (GType gtype); guint _dbus_g_type_fixed_get_size (GType gtype); gboolean _dbus_gvalue_set_from_pointer (GValue *value, gconstpointer storage); typedef void (*DBusGHashValueForeachFunc) (GValue * key, GValue *val, gpointer data); void _dbus_g_hash_table_value_foreach (GHashTable *table, GType hash_type, DBusGHashValueForeachFunc func, gpointer data); void _dbus_g_hash_table_insert_values (GHashTable *table, GValue *key_val, GValue *value_val); void _dbus_g_hash_table_insert_steal_values (GHashTable *table, GValue *key_val, GValue *value_val); gboolean _dbus_gtype_is_valid_hash_key (GType type); gboolean _dbus_gtype_is_valid_hash_value (GType type); GHashFunc _dbus_g_hash_func_from_gtype (GType gtype); GEqualFunc _dbus_g_hash_equal_from_gtype (GType gtype); GDestroyNotify _dbus_g_hash_free_from_gtype (GType gtype); gboolean _dbus_gvalue_store (GValue *value, gpointer storage); gboolean _dbus_gvalue_take (GValue *value, GTypeCValue *cvalue); gboolean _dbus_gtype_can_signal_error (GType gtype); gboolean _dbus_gvalue_signals_error (const GValue *value); G_END_DECLS #endif dbus-glib-0.100.2/dbus/dbus-gtype-specialized.c0000644000175000017500000014420112107524614016125 00000000000000/* -*- mode: C; c-file-style: "gnu" -*- */ /* dbus-gtype-specialized.c: Non-DBus-specific functions for specialized GTypes * * Copyright (C) 2005 Red Hat, Inc. * Copyright (C) 2007 Codethink Ltd. * * Licensed under the Academic Free License version 2.1 * * 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 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * */ #include #include "dbus-glib.h" #include "dbus-gtype-specialized-priv.h" #include "dbus-gvalue-utils.h" #include #include #include /** * SECTION:dbus-gtype-specialized * @short_description: Specialized GTypes * @stability: Unstable * * Specialized gtypes are basically a way to allow the definition of * recursive #GTypes. It allows the definition of 'containers' which is * basically a user defined structure capable of holding other data, and a * set of functions defining how to access that structure. Containers come in * 3 flavors: collections, maps and structs. * * A collection is a container that holds an ordered set of items, all * of which must be the same type. (This is an array * in standard D-Bus terminology.) dbus-glib specialized collections can be * #GArray (for numeric elements), #GPtrArray (for string, object or * boxed elements), #GSList (for boxed elements, not recommended), or a * user-defined type. * * A map is a container that holds a set of key/value pairs. * The keys have one type, and the values another; the type of the keys * must be a numeric or string-like type. (This is a dict * (dictionary) or array of dict entry in standard D-Bus * terminology.) dbus-glib specialized maps can be #GHashTable or a * user-defined type. * * A struct is a container that holds a fixed number of members, each member * having a predefined type. (This is a struct in * standard D-Bus terminology.) It is analogous to the C @struct keyword, but * dbus-glib does not generally represent D-Bus structs in C structs. * dbus-glib specialized structs can be #GValueArray or a user-defined type. * * A specialization is a GType detailing a particular container with * particular types (a type specialization). * * Functions are provided for constructing and manipulating specializations. * * This documentation needs splitting into two pages, one for defining new * containers and using existing containers. I expect most users to only do * the latter. I also need to add some examples. */ /** * DBUS_TYPE_G_BOOLEAN_ARRAY: * * Expands to a function call returning the #GType of a #GArray of #gboolean * (corresponding to the D-Bus signature "ab"). */ /** * DBUS_TYPE_G_INT_ARRAY: * * Expands to a function call returning the #GType of a #GArray of #gint * (corresponding to the D-Bus signature "ai"). */ /** * DBUS_TYPE_G_UINT_ARRAY: * * Expands to a function call returning the #GType of a #GArray of #guint * (corresponding to the D-Bus signature "au"). */ /** * DBUS_TYPE_G_INT64_ARRAY: * * Expands to a function call returning the #GType of a #GArray of #gint64 * (corresponding to the D-Bus signature "ax"). */ /** * DBUS_TYPE_G_UINT64_ARRAY: * * Expands to a function call returning the #GType of a #GArray of #guint64 * (corresponding to the D-Bus signature "at"). */ /** * DBUS_TYPE_G_UCHAR_ARRAY: * * Expands to a function call returning the #GType of a #GArray of #guchar * (corresponding to the D-Bus signature "ay"). * * Note that this is not the same thing as a #GByteArray! dbus-glib does not * know about the #GByteArray type. */ /** * DBUS_TYPE_G_OBJECT_ARRAY: * * Expands to a function call returning the #GType of a #GPtrArray of #GObject. * * Use this type with caution: it can sometimes be used as a representation * of arrays whose D-Bus signature is "ao" (transferred as an array of object * paths), but the conventional type for such arrays is * (dbus_g_type_get_collection ("GPtrArray", * DBUS_TYPE_G_OBJECT_PATH)). */ /** * DBUS_TYPE_G_STRING_STRING_HASHTABLE: * * Expands to a function call returning the #GType of a #GHashTable where the * keys are strings and the values are also strings (corresponding to the * D-Bus signature "a{ss}"). */ /** * DBusGTypeSpecializedVtable: * @constructor: returns a new, blank instance of the @type * @free_func: if not %NULL, frees the @type instance @val * @copy_func: returns a "deep copy" of the @type instance @val * @simple_free_func: if not %NULL, frees its argument * * A table of methods used to implement specialized container behaviour on * user-defined collections, maps and structs. Exactly one of @free_func and * @simple_free_func must be implemented; the other must be %NULL. * @constructor and @copy_func must always be implemented. * * There are additional members, which are reserved for future expansion and * must be %NULL. */ /** * DBusGTypeSpecializedConstructor: * @type: a specialized boxed type * * * * Returns: a new instance of @type */ /** * DBusGTypeSpecializedFreeFunc: * @type: a specialized boxed type * @val: an instance of @type * * Frees @val according to @type. This is analogous to #GBoxedFreeFunc, but * can use information from @type (for instance to free the contents of a * container before freeing the actual container). */ /** * DBusGTypeSpecializedCopyFunc: * @type: a specialized boxed type * @src: an instance of @type * * Copies @src according to @type. This is analogous to #GBoxedCopyFunc, but * can use information from @type (for instance to copy each element of a * collection). * * Returns: a deep copy of @src */ /** * DBusGTypeSpecializedCollectionFixedAccessorFunc: * @type: a specialized collection boxed type * @instance: an instance of @type * @values: used to return a pointer to the contents of @instance * @len: used to return the number of elements in @instance * * Implements dbus_g_type_collection_get_fixed() for a #GValue with type * @type, containing @instance. * * Returns: %TRUE on success */ /** * DBusGTypeSpecializedCollectionIterator: * @value: an element of the collection * @user_data: the data supplied when calling * dbus_g_type_collection_value_iterate() * * A library-user-supplied function, called for each element in the * collection when dbus_g_type_collection_value_iterate() is called. */ /** * DBusGTypeSpecializedCollectionIteratorFunc: * @type: a specialized collection boxed type * @instance: an instance of @type * @iterator: the function to call for each element * @user_data: data to pass to @iterator * * Implements dbus_g_type_collection_value_iterate() for a #GValue with * type @type, containing @instance. */ /** * DBusGTypeSpecializedCollectionAppendFunc: * @ctx: an appending context returned by dbus_g_type_specialized_init_append() * @val: a value to copy into the collection * * Implements dbus_g_type_specialized_collection_append(). * * This function should use the @val and @specialization_type members of @ctx. */ /** * DBusGTypeSpecializedCollectionEndAppendFunc: * @ctx: an appending context returned by dbus_g_type_specialized_init_append() * * Implements dbus_g_type_specialized_collection_end_append(). * * This function should use the @val and @specialization_type members of @ctx. */ /** * DBusGTypeSpecializedCollectionVtable: * @base_vtable: base methods shared between collections and other types * @fixed_accessor: if not %NULL, provides access to the contents of this * collection, as documented for dbus_g_type_collection_get_fixed() * @iterator: iterates through the members of @instance * @append_func: appends a new member to @instance * @end_append_func: if not %NULL, called after each group of calls to * the @append_func * * A table of methods used to implement specialized collection behaviour * on user-defined types. At least @iterator and @append_func must be * implemented. */ /** * DBusGTypeSpecializedMapIterator: * @key_val: a key from the map * @value_val: a value from the map * @user_data: the data supplied when calling * dbus_g_type_map_value_iterate() * * A library-user-supplied function, called for each key/value pair in the * collection when dbus_g_type_map_value_iterate() is called. */ /** * DBusGTypeSpecializedMapIteratorFunc: * @type: a specialized map boxed type * @instance: an instance of @type * @iterator: the function to call for each key/value pair * @user_data: data to pass to @iterator * * Implements dbus_g_type_map_value_iterate() for a #GValue with * type @type, containing @instance. */ /** * DBusGTypeSpecializedMapAppendFunc: * @ctx: an appending context returned by dbus_g_type_specialized_init_append() * @key: a key to add to the collection * @val: a value to add to the collection * * Implements dbus_g_type_specialized_map_append(). * * This function should use the @val and @specialization_type members of @ctx, * and replace any existing value with key equal to @key. */ /** * DBusGTypeSpecializedMapVtable: * @base_vtable: base methods shared between maps and other types * @iterator: iterates through the members of @instance * @append_func: adds a new key/value pair to @instance * * A table of methods used to implement specialized collection behaviour * on user-defined types. Both methods must be implemented. */ /** * DBusGTypeSpecializedStructGetMember: * @type: a specialized struct boxed type * @instance: an instance of @type * @member: the index of the member, starting from 0 * @ret_value: an initialized #GValue of the appropriate type for the given * member of @type * * Implements dbus_g_type_struct_get_member() for a #GValue with type @type, * containing @instance. * * Returns: %TRUE on success */ /** * DBusGTypeSpecializedStructSetMember: * @type: a specialized struct boxed type * @instance: an instance of @type * @member: the index of the member, starting from 0 * @new_value: an initialized #GValue of the appropriate type for the given * member of @type * * Implements dbus_g_type_struct_set_member() for a #GValue with type @type, * containing @instance. * * Returns: %TRUE on success */ /** * DBusGTypeSpecializedStructVtable: * @base_vtable: base methods shared between maps and other types * @get_member: returns a member by its index * @set_member: sets a member by its index * * A table of methods used to implement specialized collection behaviour * on user-defined types. Both methods must be implemented. */ typedef enum { DBUS_G_SPECTYPE_COLLECTION, DBUS_G_SPECTYPE_MAP, DBUS_G_SPECTYPE_STRUCT } DBusGTypeSpecializedType; typedef struct { DBusGTypeSpecializedType type; const DBusGTypeSpecializedVtable *vtable; } DBusGTypeSpecializedContainer; typedef struct { guint num_types; GType *types; const DBusGTypeSpecializedContainer *klass; } DBusGTypeSpecializedData; static GHashTable /* char * -> data* */ *specialized_containers; static GQuark specialized_type_data_quark () { static GQuark quark; if (!quark) quark = g_quark_from_static_string ("DBusGTypeSpecializedData"); return quark; } static gpointer specialized_init (gpointer arg G_GNUC_UNUSED) { g_assert (specialized_containers == NULL); specialized_containers = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL); _dbus_g_type_specialized_builtins_init (); return NULL; } /** * dbus_g_type_specialized_init: * * Initialize dbus-glib specialized #GTypes. * * In older versions of dbus-glib, it was necessary to do this before * instantiating or registering any specialized type. It is now done * automatically whenever necessary. */ void dbus_g_type_specialized_init (void) { static GOnce once = G_ONCE_INIT; g_once (&once, specialized_init, NULL); } static DBusGTypeSpecializedData * lookup_specialization_data (GType type) { return g_type_get_qdata (type, specialized_type_data_quark ()); } /* Copied from gboxed.c */ static void proxy_value_init (GValue *value) { value->data[0].v_pointer = NULL; } /* Adapted from gboxed.c */ static void proxy_value_free (GValue *value) { if (value->data[0].v_pointer && !(value->data[1].v_uint & G_VALUE_NOCOPY_CONTENTS)) { DBusGTypeSpecializedData *data; GType type; type = G_VALUE_TYPE (value); data = lookup_specialization_data (type); g_assert (data != NULL); if (data->klass->vtable->free_func) { data->klass->vtable->free_func (type, value->data[0].v_pointer); } else { g_assert (data->klass->vtable->simple_free_func != NULL); data->klass->vtable->simple_free_func (value->data[0].v_pointer); } } } /* Adapted from gboxed.c */ static void proxy_value_copy (const GValue *src_value, GValue *dest_value) { if (src_value->data[0].v_pointer) { DBusGTypeSpecializedData *data; GType type; type = G_VALUE_TYPE (src_value); data = lookup_specialization_data (type); g_assert (data != NULL); dest_value->data[0].v_pointer = data->klass->vtable->copy_func (type, src_value->data[0].v_pointer); } else dest_value->data[0].v_pointer = src_value->data[0].v_pointer; } /* Copied from gboxed.c */ static gpointer proxy_value_peek_pointer (const GValue *value) { return value->data[0].v_pointer; } /* Adapted from gboxed.c */ static gchar* proxy_collect_value (GValue *value, guint n_collect_values, GTypeCValue *collect_values, guint collect_flags) { DBusGTypeSpecializedData *data; GType type; type = G_VALUE_TYPE (value); data = lookup_specialization_data (type); if (!collect_values[0].v_pointer) value->data[0].v_pointer = NULL; else { if (collect_flags & G_VALUE_NOCOPY_CONTENTS) { value->data[0].v_pointer = collect_values[0].v_pointer; value->data[1].v_uint = G_VALUE_NOCOPY_CONTENTS; } else { value->data[0].v_pointer = data->klass->vtable->copy_func (type, collect_values[0].v_pointer); } } return NULL; } /* Adapted from gboxed.c */ static gchar* proxy_lcopy_value (const GValue *value, guint n_collect_values, GTypeCValue *collect_values, guint collect_flags) { gpointer *boxed_p = collect_values[0].v_pointer; if (!boxed_p) return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value)); if (!value->data[0].v_pointer) *boxed_p = NULL; else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) *boxed_p = value->data[0].v_pointer; else { DBusGTypeSpecializedData *data; GType type; type = G_VALUE_TYPE (value); data = lookup_specialization_data (type); *boxed_p = data->klass->vtable->copy_func (type, value->data[0].v_pointer); } return NULL; } static char * build_specialization_name (const char *prefix, guint num_types, const GType *types) { GString *fullname; guint i; fullname = g_string_new (prefix); g_string_append_c (fullname, '_'); for (i=0; i < num_types; i++) { if (i!=0) g_string_append_c (fullname, '+'); g_string_append (fullname, g_type_name (types[i])); } g_string_append_c (fullname, '_'); return g_string_free (fullname, FALSE); } static void register_container (const char *name, DBusGTypeSpecializedType type, const DBusGTypeSpecializedVtable *vtable) { DBusGTypeSpecializedContainer *klass; g_warn_if_fail (vtable->constructor != NULL); /* must have either free_func or simple_free_func */ g_warn_if_fail (vtable->free_func != NULL || vtable->simple_free_func != NULL); g_warn_if_fail (vtable->copy_func != NULL); klass = g_new0 (DBusGTypeSpecializedContainer, 1); klass->type = type; klass->vtable = vtable; g_hash_table_insert (specialized_containers, g_strdup (name), klass); } /** * dbus_g_type_register_collection: * @name: The name of a new collection container * @vtable: the vtable defining the new container * @flags: As yet unused. * * Defines a new collection container. */ void dbus_g_type_register_collection (const char *name, const DBusGTypeSpecializedCollectionVtable *vtable, guint flags) { dbus_g_type_specialized_init(); _dbus_g_type_register_collection (name, vtable, flags); } void _dbus_g_type_register_collection (const char *name, const DBusGTypeSpecializedCollectionVtable *vtable, guint flags) { /* fixed_accessor is optional */ g_warn_if_fail (vtable->iterator != NULL); g_warn_if_fail (vtable->append_func != NULL); /* end_append_func is optional */ register_container (name, DBUS_G_SPECTYPE_COLLECTION, (const DBusGTypeSpecializedVtable*) vtable); } /** * dbus_g_type_register_map: * @name: The name of a new map container * @vtable: the vtable defining the new container * @flags: As yet unused. * * Defines a new map container. */ void dbus_g_type_register_map (const char *name, const DBusGTypeSpecializedMapVtable *vtable, guint flags) { dbus_g_type_specialized_init(); _dbus_g_type_register_map (name, vtable, flags); } void _dbus_g_type_register_map (const char *name, const DBusGTypeSpecializedMapVtable *vtable, guint flags) { g_warn_if_fail (vtable->iterator != NULL); g_warn_if_fail (vtable->append_func != NULL); register_container (name, DBUS_G_SPECTYPE_MAP, (const DBusGTypeSpecializedVtable*) vtable); } /** * dbus_g_type_register_struct: * @name: The name of a new struct container * @vtable: the vtable defining the new container * @flags: As yet unused. * * Defines a new struct container. */ void dbus_g_type_register_struct (const char *name, const DBusGTypeSpecializedStructVtable *vtable, guint flags) { dbus_g_type_specialized_init(); _dbus_g_type_register_struct (name, vtable, flags); } void _dbus_g_type_register_struct (const char *name, const DBusGTypeSpecializedStructVtable *vtable, guint flags) { g_warn_if_fail (vtable->get_member != NULL); g_warn_if_fail (vtable->set_member != NULL); register_container (name, DBUS_G_SPECTYPE_STRUCT, (const DBusGTypeSpecializedVtable*) vtable); } /** * dbus_g_type_map_peek_vtable: * @map_type: a gtype of a map specialization * * Peek the vtable for a given map specialization * * Returns: the vtable */ const DBusGTypeSpecializedMapVtable* dbus_g_type_map_peek_vtable (GType map_type) { DBusGTypeSpecializedData *data; g_return_val_if_fail (dbus_g_type_is_map(map_type), NULL); data = lookup_specialization_data (map_type); g_assert (data != NULL); return (DBusGTypeSpecializedMapVtable *)(data->klass->vtable); } /** * dbus_g_type_collection_peek_vtable: * @collection_type: a gtype of a collection specialization * * Peek the vtable for a given collection specialization * * Returns: the vtable */ const DBusGTypeSpecializedCollectionVtable* dbus_g_type_collection_peek_vtable (GType collection_type) { DBusGTypeSpecializedData *data; g_return_val_if_fail (dbus_g_type_is_collection(collection_type), NULL); data = lookup_specialization_data (collection_type); g_assert (data != NULL); return (DBusGTypeSpecializedCollectionVtable *)(data->klass->vtable); } /** * dbus_g_type_struct_peek_vtable: * @struct_type: a gtype of a struct specialization * * Peek the vtable for a given struct specialization * * Returns: the vtable */ const DBusGTypeSpecializedStructVtable* dbus_g_type_struct_peek_vtable (GType struct_type) { DBusGTypeSpecializedData *data; g_return_val_if_fail (dbus_g_type_is_struct (struct_type), NULL); data = lookup_specialization_data (struct_type); g_assert (data != NULL); return (DBusGTypeSpecializedStructVtable *)(data->klass->vtable); } static GType register_specialized_instance (const DBusGTypeSpecializedContainer *klass, const char *name, guint num_types, const GType *types) { GType ret; static const GTypeValueTable vtable = { proxy_value_init, proxy_value_free, proxy_value_copy, proxy_value_peek_pointer, "p", proxy_collect_value, "p", proxy_lcopy_value, }; static const GTypeInfo derived_info = { 0, /* class_size */ NULL, /* base_init */ NULL, /* base_finalize */ NULL, /* class_init */ NULL, /* class_finalize */ NULL, /* class_data */ 0, /* instance_size */ 0, /* n_preallocs */ NULL, /* instance_init */ &vtable, /* value_table */ }; ret = g_type_register_static (G_TYPE_BOXED, name, &derived_info, 0); /* install proxy functions upon successfull registration */ if (ret != G_TYPE_INVALID) { DBusGTypeSpecializedData *data; data = g_new0 (DBusGTypeSpecializedData, 1); data->num_types = num_types; data->types = g_memdup (types, sizeof (GType) * num_types); data->klass = klass; g_type_set_qdata (ret, specialized_type_data_quark (), data); } return ret; } static GType lookup_or_register_specialized (const char *container, guint num_types, const GType *types) { GType ret; char *name; const DBusGTypeSpecializedContainer *klass; dbus_g_type_specialized_init(); klass = g_hash_table_lookup (specialized_containers, container); g_return_val_if_fail (klass != NULL, G_TYPE_INVALID); name = build_specialization_name (container, num_types, types); ret = g_type_from_name (name); if (ret == G_TYPE_INVALID) { /* Take ownership of name */ ret = register_specialized_instance (klass, name, num_types, types); } g_free (name); return ret; } /** * dbus_g_type_get_collection: * @container: a string specifying a registered collection type * @specialization: #GType of collection elements * * Gets a #GType for a particular collection instance, * creating the type if not already created. * * Returns: the #GType of that instance */ GType dbus_g_type_get_collection (const char *container, GType specialization) { return lookup_or_register_specialized (container, 1, &specialization); } /** * dbus_g_type_get_map: * @container: a string specifying a registered map type * @key_specialization: #GType of keys * @value_specialization: #GType of values * * Gets a #GType for a particular map instance, * creating the type if not already created. * * Returns: the #GType of that instance */ GType dbus_g_type_get_map (const char *container, GType key_specialization, GType value_specialization) { GType types[2]; types[0] = key_specialization; types[1] = value_specialization; return lookup_or_register_specialized (container, 2, types); } /** * dbus_g_type_get_structv: * @container: a string specifying a registered struct type * @num_members: number of members in the struct * @types: an array specufying a GType for each struct element * * Gets a #GType for a particular struct instance, * creating the type if not already created. * * Returns: the #GType of that instance */ GType dbus_g_type_get_structv (const char *container, guint num_members, GType *types) { return lookup_or_register_specialized (container, num_members, types); } /** * dbus_g_type_get_struct: * @container: a string specifying a registered struct type * @first_type: #GType for the struct's first member * @...: more GTypes for the struct's members, terminated by G_TYPE_INVALID * * Varags methsod to get a #GType for a particular struct instance, * creating the type if not already created. * * Returns: the #GType of that instance */ GType dbus_g_type_get_struct (const char *container, GType first_type, ...) { GArray *types; GType curtype, ret; va_list args; va_start (args, first_type); types = g_array_new (FALSE, FALSE, sizeof (GType)); curtype = first_type; while (curtype != G_TYPE_INVALID) { g_array_append_val (types, curtype); curtype = va_arg (args, GType); } va_end (args); ret = lookup_or_register_specialized (container, types->len, (GType *) types->data); g_array_free (types, TRUE); return ret; } /** * dbus_g_type_is_collection: * @gtype: a GType to test * * Tests if a given GType is a collection. * * Returns: true if the given GType is a collection */ gboolean dbus_g_type_is_collection (GType gtype) { DBusGTypeSpecializedData *data; data = lookup_specialization_data (gtype); if (data == NULL) return FALSE; return data->klass->type == DBUS_G_SPECTYPE_COLLECTION; } /** * dbus_g_type_is_map: * @gtype: a GType to test * * Tests if a given GType is a map, * i.e. it was created with dbus_g_type_get_map(). * * Returns: true if the given GType is a map */ gboolean dbus_g_type_is_map (GType gtype) { DBusGTypeSpecializedData *data; data = lookup_specialization_data (gtype); if (data == NULL) return FALSE; return data->klass->type == DBUS_G_SPECTYPE_MAP; } /** * dbus_g_type_is_struct: * @gtype: a GType to test * * Tests if a given GType is a struct, * i.e. it was created with dbus_g_type_get_struct() * * Returns: true if the given GType is a struct */ gboolean dbus_g_type_is_struct (GType gtype) { DBusGTypeSpecializedData *data; data = lookup_specialization_data (gtype); if (data == NULL) return FALSE; return data->klass->type == DBUS_G_SPECTYPE_STRUCT; } static GType get_specialization_index (GType gtype, guint i) { DBusGTypeSpecializedData *data; data = lookup_specialization_data (gtype); if (i < data->num_types) return data->types[i]; else return G_TYPE_INVALID; } /** * dbus_g_type_get_collection_specialization: * @gtype: a collection #GType, as created by dbus_g_type_get_collection() * * Return the type of each element in collections of type @gtype. * It is an error to call this function on a non-collection type. * * Returns: the element type for a given collection GType. */ GType dbus_g_type_get_collection_specialization (GType gtype) { g_return_val_if_fail (dbus_g_type_is_collection (gtype), G_TYPE_INVALID); return get_specialization_index (gtype, 0); } /** * dbus_g_type_get_map_key_specialization: * @gtype: a map #GType, as created by dbus_g_type_get_map() * * Return the type of the keys in maps of type @gtype. * It is an error to call this function on a non-map type. * * Returns: the key type for a given map #GType. */ GType dbus_g_type_get_map_key_specialization (GType gtype) { g_return_val_if_fail (dbus_g_type_is_map (gtype), G_TYPE_INVALID); return get_specialization_index (gtype, 0); } /** * dbus_g_type_get_map_value_specialization: * @gtype: a map GType, as created by dbus_g_type_get_map(). * * Return the type of the values in maps of type @gtype. * It is an error to call this function on a non-map type. * * Returns: the value type for a given map GType. */ GType dbus_g_type_get_map_value_specialization (GType gtype) { g_return_val_if_fail (dbus_g_type_is_map (gtype), G_TYPE_INVALID); return get_specialization_index (gtype, 1); } /** * dbus_g_type_get_struct_member_type * @gtype: a struct GType, as created with dbus_g_type_get_struct() * @member: the index of a struct member * * Get the type of a member of a specialized struct. * It is an error to call this function on a non-struct type. * * Returns: the type for a given member of a struct #GType, * or %G_TYPE_INVALID if @member >= dbus_g_type_get_struct_size() */ GType dbus_g_type_get_struct_member_type (GType gtype, guint member) { g_return_val_if_fail (dbus_g_type_is_struct (gtype), G_TYPE_INVALID); return get_specialization_index (gtype, member); } /** * dbus_g_type_get_struct_size * @gtype: a struct GType, as created with dbus_g_type_get_struct(). * * Get the number of members in a specialized struct. * It is an error to call this function on a non-struct type. * * Returns: the number of members in a given struct #GType. */ guint dbus_g_type_get_struct_size (GType gtype) { DBusGTypeSpecializedData *data; g_return_val_if_fail (dbus_g_type_is_struct (gtype), G_TYPE_INVALID); data = lookup_specialization_data (gtype); return data->num_types; } /** * dbus_g_type_specialized_construct: * @gtype: a specialized #GType, as created by dbus_g_type_get_collection(), * dbus_g_type_get_map() or dbus_g_type_get_struct() * * Create an instance of a given specialized type. * The structure created and returned will depend on the container type of the * GType. E.g. If the given type was created by * dbus_g_type_get_collection("GArray", G_TYPE_INT), * then this will return a GArray with element_size of sizeof(int) * * Returns: a pointer to a newly constructed instance of the given type. */ gpointer dbus_g_type_specialized_construct (GType gtype) { DBusGTypeSpecializedData *data; dbus_g_type_specialized_init(); data = lookup_specialization_data (gtype); g_return_val_if_fail (data != NULL, FALSE); return data->klass->vtable->constructor (gtype); } /** * dbus_g_type_collection_get_fixed: * @value: a GValue containing a boxed specialized collection * that has a @fixed_accessor in its vtable * @data_ret: used to return a pointer to the fixed data, which must not be * modified (for instance, for a #GArray of #gint, this would point * to an array of #gint) * @len_ret: used to return the length (counting collection elements, not * bytes: in a #GArray containing one #gint, this would be 1) * * Calling this function is likely to be a bad idea. Consider using * dbus_g_type_collection_value_iterate() instead. * * On success, @data_ret is a pointer to the underlying data in a collection * of fixed-length fundamental types. Knowledge of the underlying data model * of the collection is needed in order to use @data_ret correctly. * * It is an error to call this function on a specialized type that is not a * collection, or on a collection that does not have a @fixed_accessor in its * #DBusGTypeSpecializedCollectionVtable. * * Specialized #GArrays are the only types provided by dbus-glib that * can be used with this function; user-defined types might also work. * * Returns: %TRUE on success */ gboolean dbus_g_type_collection_get_fixed (GValue *value, gpointer *data_ret, guint *len_ret) { DBusGTypeSpecializedData *data; DBusGTypeSpecializedCollectionVtable *vtable; GType gtype; dbus_g_type_specialized_init(); g_return_val_if_fail (G_VALUE_HOLDS_BOXED (value), FALSE); gtype = G_VALUE_TYPE (value); g_return_val_if_fail (dbus_g_type_is_collection (gtype), FALSE); data = lookup_specialization_data (gtype); /* dbus_g_type_is_collection() already checked this */ g_assert (data != NULL); vtable = (DBusGTypeSpecializedCollectionVtable *) (data->klass->vtable); g_return_val_if_fail (vtable->fixed_accessor != NULL, FALSE); return vtable->fixed_accessor (gtype, g_value_get_boxed (value), data_ret, len_ret); } /** * dbus_g_type_collection_value_iterate: * @value: a #GValue holding a collection type. * @iterator: a function to call for each element * @user_data: user data to pass to the @iterator * * Calls the given function for each element of the collection. * The function is passed a #GValue containing the element and the given * @user_data parameter. The collection may not be modified while iterating over * it. */ void dbus_g_type_collection_value_iterate (const GValue *value, DBusGTypeSpecializedCollectionIterator iterator, gpointer user_data) { DBusGTypeSpecializedData *data; GType gtype; dbus_g_type_specialized_init(); g_return_if_fail (G_VALUE_HOLDS_BOXED (value)); gtype = G_VALUE_TYPE (value); g_return_if_fail (dbus_g_type_is_collection (gtype)); data = lookup_specialization_data (gtype); /* dbus_g_type_is_collection() already checked this */ g_assert (data != NULL); ((DBusGTypeSpecializedCollectionVtable *) data->klass->vtable)->iterator (gtype, g_value_get_boxed (value), iterator, user_data); } /** * DBusGTypeSpecializedAppendContext: * @val: the #GValue containing the array to which you're appending * @specialization_type: the #GType of the array's elements * * A context for appending. There are more fields, which are private. */ typedef struct { GValue *val; GType specialization_type; DBusGTypeSpecializedData *specdata; guint c; gpointer d; } DBusGTypeSpecializedAppendContextReal; G_STATIC_ASSERT (sizeof (DBusGTypeSpecializedAppendContextReal) == sizeof (DBusGTypeSpecializedAppendContext)); /** * dbus_g_type_specialized_init_append: * @value: a #GValue containing an instance of specialized type * @ctx: a #DBusGTypeSpecializedAppendContext in which to return a new appending context. * * Create a new context for adding elements to a collection or key/value pairs * to a map. You generally don't need or want to use this.. */ void dbus_g_type_specialized_init_append (GValue *value, DBusGTypeSpecializedAppendContext *ctx) { DBusGTypeSpecializedAppendContextReal *realctx = (DBusGTypeSpecializedAppendContextReal *) ctx; GType gtype; DBusGTypeSpecializedData *specdata; dbus_g_type_specialized_init(); g_return_if_fail (G_VALUE_HOLDS_BOXED (value)); gtype = G_VALUE_TYPE (value); specdata = lookup_specialization_data (gtype); g_return_if_fail (specdata != NULL); g_return_if_fail (specdata->num_types != 0); realctx->val = value; realctx->specialization_type = specdata->types[0]; realctx->specdata = specdata; } /** * dbus_g_type_specialized_collection_append: * @ctx: a context created by dbus_g_type_specialized_init_append() * for a #GValue containing a collection * @elt: a #GValue containing an element to append to the collection * * Appends a given element to the end of a collection. */ void dbus_g_type_specialized_collection_append (DBusGTypeSpecializedAppendContext *ctx, GValue *elt) { DBusGTypeSpecializedAppendContextReal *realctx = (DBusGTypeSpecializedAppendContextReal *) ctx; g_return_if_fail (dbus_g_type_is_collection (G_VALUE_TYPE (ctx->val))); ((DBusGTypeSpecializedCollectionVtable *) realctx->specdata->klass->vtable)->append_func (ctx, elt); } /** * dbus_g_type_specialized_collection_end_append: * @ctx: a context created by dbus_g_type_specialized_init_append() * for a #GValue containing a collection * * Finish appending elements to a given collection */ void dbus_g_type_specialized_collection_end_append (DBusGTypeSpecializedAppendContext *ctx) { DBusGTypeSpecializedAppendContextReal *realctx = (DBusGTypeSpecializedAppendContextReal *) ctx; g_return_if_fail (dbus_g_type_is_collection (G_VALUE_TYPE (ctx->val))); if (((DBusGTypeSpecializedCollectionVtable *) realctx->specdata->klass->vtable)->end_append_func != NULL) ((DBusGTypeSpecializedCollectionVtable *) realctx->specdata->klass->vtable)->end_append_func (ctx); } /** * dbus_g_type_specialized_map_append: * @ctx: a context created by dbus_g_type_specialized_init_append() * for a #GValue containing a map * @key: a GValue containing a key, whose contents will be stolen by @ctx * @val: a GValue containing a value, whose contents will be stolen by @ctx * * Inserts the given key/value pair into the map instance. */ void dbus_g_type_specialized_map_append (DBusGTypeSpecializedAppendContext *ctx, GValue *key, GValue *val) { DBusGTypeSpecializedAppendContextReal *realctx = (DBusGTypeSpecializedAppendContextReal *) ctx; g_return_if_fail (dbus_g_type_is_map (G_VALUE_TYPE (ctx->val))); ((DBusGTypeSpecializedMapVtable *) realctx->specdata->klass->vtable)->append_func (ctx, key, val); } /** * dbus_g_type_map_value_iterate: * @value: a #GValue holding a specialized map * @iterator: a function to call for each element * @user_data: user data to pass to the @iterator * * Calls the given function for each key/value pair of the map. * The function is passed two GValues containing the key/value pair and the given * @user_data parameter. The map may not be modified while iterating over * it. */ void dbus_g_type_map_value_iterate (const GValue *value, DBusGTypeSpecializedMapIterator iterator, gpointer user_data) { DBusGTypeSpecializedData *data; GType gtype; dbus_g_type_specialized_init(); g_return_if_fail (G_VALUE_HOLDS_BOXED (value)); gtype = G_VALUE_TYPE (value); g_return_if_fail (dbus_g_type_is_map (gtype)); data = lookup_specialization_data (gtype); /* already checked by dbus_g_type_is_map() */ g_assert (data != NULL); ((DBusGTypeSpecializedMapVtable *) data->klass->vtable)->iterator (gtype, g_value_get_boxed (value), iterator, user_data); } /** * dbus_g_type_struct_get_member: * @value: a #GValue containing a struct instance * @member: the index of a given member * @dest: an initialised #GValue in which to return the struct member * * Fetches a given member of a given struct instance. @dest must be initialised * was the correct type for that member, e.g. as returned by * @dbus_g_type_get_struct_member_type * * Returns: %TRUE if successful */ gboolean dbus_g_type_struct_get_member (const GValue *value, guint member, GValue *dest) { DBusGTypeSpecializedData *data; GType gtype; dbus_g_type_specialized_init(); g_return_val_if_fail (G_VALUE_HOLDS_BOXED (value), FALSE); gtype = G_VALUE_TYPE (value); g_return_val_if_fail (dbus_g_type_is_struct (gtype), FALSE); data = lookup_specialization_data (gtype); /* already checked by dbus_g_type_is_struct() */ g_assert (data != NULL); return ((DBusGTypeSpecializedStructVtable *) (data->klass->vtable))->get_member(gtype, g_value_get_boxed (value), member, dest); } /** * dbus_g_type_struct_set_member: * @value: a #GValue containing a struct instance * @member: the index of a given member * @src: an #GValue containing the new value for that struct member * * Sets a given member of a struct to a new value. The type of @src must match * the existing type of @member member of the struct. * * Returns: %TRUE if successful */ gboolean dbus_g_type_struct_set_member (GValue *value, guint member, const GValue *src) { DBusGTypeSpecializedData *data; GType gtype; dbus_g_type_specialized_init(); g_return_val_if_fail (G_VALUE_HOLDS_BOXED (value), FALSE); gtype = G_VALUE_TYPE (value); g_return_val_if_fail (dbus_g_type_is_struct (gtype), FALSE); data = lookup_specialization_data (gtype); /* already checked by dbus_g_type_is_struct() */ g_assert (data != NULL); return ((DBusGTypeSpecializedStructVtable *) (data->klass->vtable))->set_member(gtype, g_value_get_boxed (value), member, src); } /** * dbus_g_type_struct_get: * @value: a #GValue containing a struct instance * @member: struct member to get * @...: location in which to return the value of this member, * followed optionally by more member/return locations pairs, followed by * by %G_MAXUINT * * Collects the selected values of this struct into the return locations * provided. * * Returns: %FALSE on failure */ gboolean dbus_g_type_struct_get (const GValue *value, guint first_member, ...) { va_list var_args; GType type; guint size,i; gchar *error; GValue val = {0,}; g_return_val_if_fail (dbus_g_type_is_struct (G_VALUE_TYPE (value)), FALSE); va_start (var_args, first_member); size = dbus_g_type_get_struct_size (G_VALUE_TYPE (value)); i = first_member; while (i != G_MAXUINT) { if (i >= size) goto error; type = dbus_g_type_get_struct_member_type (G_VALUE_TYPE (value),i); g_value_init (&val, type); dbus_g_type_struct_get_member (value, i, &val); G_VALUE_LCOPY (&val, var_args, 0, &error); if (error) { g_warning ("%s, %s", G_STRFUNC, error); g_free (error); g_value_unset (&val); goto error; } g_value_unset (&val); i = va_arg (var_args, guint); } va_end (var_args); return TRUE; error: va_end (var_args); return FALSE; } /** * dbus_g_type_struct_set: * @value: a #GValue containing a struct instance * @member: struct member to set * @...: value for the first member, followed optionally by * more member/value pairs, followed by %G_MAXUINT * * Sets the selected members of the struct in @value. * * Returns: %FALSE on failure */ gboolean dbus_g_type_struct_set (GValue *value, guint first_member, ...) { va_list var_args; GType type; guint size,i; gchar *error; GValue val = {0,}; g_return_val_if_fail (dbus_g_type_is_struct (G_VALUE_TYPE (value)), FALSE); va_start (var_args, first_member); size = dbus_g_type_get_struct_size (G_VALUE_TYPE (value)); i = first_member; while (i != G_MAXUINT) { if (i >= size) goto error; type = dbus_g_type_get_struct_member_type (G_VALUE_TYPE (value),i); g_value_init (&val, type); G_VALUE_COLLECT (&val, var_args, 0, &error); if (error) { g_warning ("%s, %s", G_STRFUNC, error); g_free (error); g_value_unset (&val); goto error; } dbus_g_type_struct_set_member (value, i, &val); g_value_unset (&val); i = va_arg (var_args, guint); } va_end (var_args); return TRUE; error: va_end (var_args); return FALSE; } static void _collection_iterator (const GValue *value, gpointer user_data) { GPtrArray *children = user_data; g_ptr_array_add (children, dbus_g_value_build_g_variant (value)); } static void _map_iterator (const GValue *kvalue, const GValue *vvalue, gpointer user_data) { GPtrArray *children = user_data; g_ptr_array_add (children, g_variant_new_dict_entry ( dbus_g_value_build_g_variant (kvalue), dbus_g_value_build_g_variant (vvalue))); } static GVariantType * dbus_g_value_type_build_g_variant_type (GType type) { if (dbus_g_type_is_collection (type)) { GType element_type = dbus_g_type_get_collection_specialization (type); GVariantType *element_sig = dbus_g_value_type_build_g_variant_type ( element_type); GVariantType *ret = g_variant_type_new_array (element_sig); g_variant_type_free (element_sig); return ret; } else if (dbus_g_type_is_map (type)) { GType key_type = dbus_g_type_get_map_key_specialization (type); GType value_type = dbus_g_type_get_map_value_specialization (type); GVariantType *key_sig = dbus_g_value_type_build_g_variant_type ( key_type); GVariantType *value_sig = dbus_g_value_type_build_g_variant_type ( value_type); GVariantType *entry_sig = g_variant_type_new_dict_entry (key_sig, value_sig); GVariantType *ret = g_variant_type_new_array (entry_sig); g_variant_type_free (key_sig); g_variant_type_free (value_sig); g_variant_type_free (entry_sig); return ret; } else if (dbus_g_type_is_struct (type)) { guint size = dbus_g_type_get_struct_size (type); guint i; GVariantType **sigs = g_new0 (GVariantType *, size); GVariantType *ret; for (i = 0; i < size; i++) { GType t = dbus_g_type_get_struct_member_type (type, i); sigs[i] = dbus_g_value_type_build_g_variant_type (t); } ret = g_variant_type_new_tuple ((const GVariantType * const *) sigs, size); for (i = 0; i < size; i++) g_variant_type_free (sigs[i]); g_free (sigs); return ret; } else if (type == G_TYPE_BOOLEAN) return g_variant_type_copy (G_VARIANT_TYPE_BOOLEAN); else if (type == G_TYPE_UCHAR) return g_variant_type_copy (G_VARIANT_TYPE_BYTE); else if (type == G_TYPE_INT) return g_variant_type_copy (G_VARIANT_TYPE_INT32); else if (type == G_TYPE_UINT) return g_variant_type_copy (G_VARIANT_TYPE_UINT32); else if (type == G_TYPE_INT64) return g_variant_type_copy (G_VARIANT_TYPE_INT64); else if (type == G_TYPE_UINT64) return g_variant_type_copy (G_VARIANT_TYPE_UINT64); else if (type == G_TYPE_DOUBLE) return g_variant_type_copy (G_VARIANT_TYPE_DOUBLE); else if (type == G_TYPE_STRING) return g_variant_type_copy (G_VARIANT_TYPE_STRING); else if (type == G_TYPE_STRV) return g_variant_type_copy (G_VARIANT_TYPE_STRING_ARRAY); else if (type == DBUS_TYPE_G_OBJECT_PATH) return g_variant_type_copy (G_VARIANT_TYPE_OBJECT_PATH); else if (type == DBUS_TYPE_G_SIGNATURE) return g_variant_type_copy (G_VARIANT_TYPE_SIGNATURE); else if (type == G_TYPE_VALUE) return g_variant_type_copy (G_VARIANT_TYPE_VARIANT); else g_error ("%s: Unknown type: %s", G_STRFUNC, g_type_name (type)); } /** * dbus_g_value_build_g_variant: * @value: a simple or specialized #GValue to convert to a #GVariant * * Recurses @value and converts its contents to a #GVariant. * * The value must either be a simple value (integer, string, boolean, * object path etc.) or a specialized container registered with * dbus_g_type_get_collection(), dbus_g_type_get_map() or * dbus_g_type_get_struct(). Providing any other type is a programming error * (including as a child type). * * Returns: a new #GVariant containing @value with a floating reference */ GVariant * dbus_g_value_build_g_variant (const GValue *value) { GType type; g_return_val_if_fail (G_IS_VALUE (value), NULL); type = G_VALUE_TYPE (value); if (dbus_g_type_is_collection (type)) { GVariant *variant; GPtrArray *children; GVariantType *signature = NULL; children = g_ptr_array_new (); dbus_g_type_collection_value_iterate (value, _collection_iterator, children); if (children->len == 0) { /* we can't cheat by saying "the type of the children? that!" */ GType element_type = dbus_g_type_get_collection_specialization ( type); signature = dbus_g_value_type_build_g_variant_type (element_type); } variant = g_variant_new_array (signature, (GVariant **) children->pdata, children->len); g_ptr_array_free (children, TRUE); g_variant_type_free (signature); return variant; } else if (dbus_g_type_is_map (type)) { GVariant *variant; GPtrArray *children; GVariantType *signature = NULL; children = g_ptr_array_new (); dbus_g_type_map_value_iterate (value, _map_iterator, children); if (children->len == 0) { /* we can't cheat by saying "the type of the children? that!" */ GType key_type = dbus_g_type_get_map_key_specialization ( type); GType value_type = dbus_g_type_get_map_value_specialization ( type); GVariantType *k = dbus_g_value_type_build_g_variant_type (key_type); GVariantType *v = dbus_g_value_type_build_g_variant_type ( value_type); signature = g_variant_type_new_dict_entry (k, v); g_variant_type_free (k); g_variant_type_free (v); } variant = g_variant_new_array (signature, (GVariant **) children->pdata, children->len); g_ptr_array_free (children, TRUE); g_variant_type_free (signature); return variant; } else if (dbus_g_type_is_struct (type)) { GVariant *variant, **children; guint size, i; size = dbus_g_type_get_struct_size (type); children = g_new0 (GVariant *, size); for (i = 0; i < size; i++) { GValue cvalue = { 0, }; g_value_init (&cvalue, dbus_g_type_get_struct_member_type (type, i)); dbus_g_type_struct_get_member (value, i, &cvalue); children[i] = dbus_g_value_build_g_variant (&cvalue); g_value_unset (&cvalue); } variant = g_variant_new_tuple (children, size); g_free (children); return variant; } else if (type == G_TYPE_BOOLEAN) return g_variant_new_boolean (g_value_get_boolean (value)); else if (type == G_TYPE_UCHAR) return g_variant_new_byte (g_value_get_uchar (value)); else if (type == G_TYPE_INT) return g_variant_new_int32 (g_value_get_int (value)); else if (type == G_TYPE_UINT) return g_variant_new_uint32 (g_value_get_uint (value)); else if (type == G_TYPE_INT64) return g_variant_new_int64 (g_value_get_int64 (value)); else if (type == G_TYPE_UINT64) return g_variant_new_uint64 (g_value_get_uint64 (value)); else if (type == G_TYPE_DOUBLE) return g_variant_new_double (g_value_get_double (value)); else if (type == G_TYPE_STRING) return g_variant_new_string (g_value_get_string (value)); else if (type == G_TYPE_STRV) return g_variant_new_strv (g_value_get_boxed (value), -1); else if (type == DBUS_TYPE_G_OBJECT_PATH) return g_variant_new_object_path (g_value_get_boxed (value)); else if (type == DBUS_TYPE_G_SIGNATURE) return g_variant_new_signature (g_value_get_boxed (value)); else if (type == G_TYPE_VALUE) return g_variant_new_variant ( dbus_g_value_build_g_variant (g_value_get_boxed (value))); else { g_error ("%s: Unknown type: %s", G_STRFUNC, g_type_name (type)); } } dbus-glib-0.100.2/dbus/examples/0000755000175000017500000000000012112654010013266 500000000000000dbus-glib-0.100.2/dbus/examples/example-signal-emitter.xml0000644000175000017500000000040111634152371020313 00000000000000 dbus-glib-0.100.2/dbus/examples/Makefile.in0000644000175000017500000006322012112653377015275 00000000000000# 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 = example-client$(EXEEXT) example-service$(EXEEXT) \ example-signal-recipient$(EXEEXT) \ example-signal-emitter$(EXEEXT) subdir = dbus/examples 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)/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 = PROGRAMS = $(noinst_PROGRAMS) am_example_client_OBJECTS = example-client.$(OBJEXT) example_client_OBJECTS = $(am_example_client_OBJECTS) example_client_LDADD = $(LDADD) am__DEPENDENCIES_1 = example_client_DEPENDENCIES = $(am__DEPENDENCIES_1) \ $(top_builddir)/dbus/libdbus-glib-1.la AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am_example_service_OBJECTS = example-service.$(OBJEXT) example_service_OBJECTS = $(am_example_service_OBJECTS) example_service_LDADD = $(LDADD) example_service_DEPENDENCIES = $(am__DEPENDENCIES_1) \ $(top_builddir)/dbus/libdbus-glib-1.la am_example_signal_emitter_OBJECTS = example-signal-emitter.$(OBJEXT) example_signal_emitter_OBJECTS = $(am_example_signal_emitter_OBJECTS) example_signal_emitter_LDADD = $(LDADD) example_signal_emitter_DEPENDENCIES = $(am__DEPENDENCIES_1) \ $(top_builddir)/dbus/libdbus-glib-1.la am_example_signal_recipient_OBJECTS = \ example-signal-recipient.$(OBJEXT) example_signal_recipient_OBJECTS = \ $(am_example_signal_recipient_OBJECTS) example_signal_recipient_LDADD = $(LDADD) example_signal_recipient_DEPENDENCIES = $(am__DEPENDENCIES_1) \ $(top_builddir)/dbus/libdbus-glib-1.la DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/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 = $(example_client_SOURCES) $(example_service_SOURCES) \ $(example_signal_emitter_SOURCES) \ $(example_signal_recipient_SOURCES) DIST_SOURCES = $(example_client_SOURCES) $(example_service_SOURCES) \ $(example_signal_emitter_SOURCES) \ $(example_signal_recipient_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" ABSOLUTE_TOP_BUILDDIR = @ABSOLUTE_TOP_BUILDDIR@ ACLOCAL = @ACLOCAL@ 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@ CYGPATH_W = @CYGPATH_W@ DBUS_BINDING_TOOL = @DBUS_BINDING_TOOL@ DBUS_CFLAGS = @DBUS_CFLAGS@ DBUS_GLIB_CFLAGS = @DBUS_GLIB_CFLAGS@ DBUS_GLIB_LIBS = @DBUS_GLIB_LIBS@ DBUS_GLIB_THREADS_CFLAGS = @DBUS_GLIB_THREADS_CFLAGS@ DBUS_GLIB_THREADS_LIBS = @DBUS_GLIB_THREADS_LIBS@ DBUS_GLIB_TOOL_CFLAGS = @DBUS_GLIB_TOOL_CFLAGS@ DBUS_GLIB_TOOL_LIBS = @DBUS_GLIB_TOOL_LIBS@ DBUS_LIBS = @DBUS_LIBS@ DBUS_PATH_OR_ABSTRACT = @DBUS_PATH_OR_ABSTRACT@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ EXPANDED_BINDIR = @EXPANDED_BINDIR@ EXPANDED_DATADIR = @EXPANDED_DATADIR@ EXPANDED_LIBDIR = @EXPANDED_LIBDIR@ EXPANDED_LOCALSTATEDIR = @EXPANDED_LOCALSTATEDIR@ EXPANDED_SYSCONFDIR = @EXPANDED_SYSCONFDIR@ FGREP = @FGREP@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GREP = @GREP@ GTKDOC_CHECK = @GTKDOC_CHECK@ 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@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_REVISION = @LT_REVISION@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ 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@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TEST_CORE_SERVICE_BINARY = @TEST_CORE_SERVICE_BINARY@ TEST_EXIT_BINARY = @TEST_EXIT_BINARY@ TEST_INTERFACES_SERVICE_BINARY = @TEST_INTERFACES_SERVICE_BINARY@ TEST_SEGFAULT_BINARY = @TEST_SEGFAULT_BINARY@ TEST_SERVICE_BINARY = @TEST_SERVICE_BINARY@ TEST_SERVICE_DIR = @TEST_SERVICE_DIR@ TEST_SHELL_SERVICE_BINARY = @TEST_SHELL_SERVICE_BINARY@ TEST_SLEEP_FOREVER_BINARY = @TEST_SLEEP_FOREVER_BINARY@ TEST_SOCKET_DIR = @TEST_SOCKET_DIR@ VERSION = @VERSION@ 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_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@ 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@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ 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 = . statemachine INCLUDES = \ -I$(top_srcdir) \ -I$(top_builddir) \ -I$(top_builddir)/dbus \ $(DBUS_CFLAGS) \ $(DBUS_GLIB_CFLAGS) \ -DDBUS_COMPILATION LDADD = \ $(DBUS_GLIB_LIBS) \ $(top_builddir)/dbus/libdbus-glib-1.la example_client_SOURCES = example-client.c example_service_SOURCES = example-service.c BUILT_SOURCES = example-service-glue.h example-signal-emitter-glue.h example_signal_recipient_SOURCES = example-signal-recipient.c example_signal_emitter_SOURCES = example-signal-emitter.c CLEANFILES = $(BUILT_SOURCES) EXTRA_DIST = example-service.xml example-signal-emitter.xml all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(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 dbus/examples/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu dbus/examples/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: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(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 example-client$(EXEEXT): $(example_client_OBJECTS) $(example_client_DEPENDENCIES) $(EXTRA_example_client_DEPENDENCIES) @rm -f example-client$(EXEEXT) $(AM_V_CCLD)$(LINK) $(example_client_OBJECTS) $(example_client_LDADD) $(LIBS) example-service$(EXEEXT): $(example_service_OBJECTS) $(example_service_DEPENDENCIES) $(EXTRA_example_service_DEPENDENCIES) @rm -f example-service$(EXEEXT) $(AM_V_CCLD)$(LINK) $(example_service_OBJECTS) $(example_service_LDADD) $(LIBS) example-signal-emitter$(EXEEXT): $(example_signal_emitter_OBJECTS) $(example_signal_emitter_DEPENDENCIES) $(EXTRA_example_signal_emitter_DEPENDENCIES) @rm -f example-signal-emitter$(EXEEXT) $(AM_V_CCLD)$(LINK) $(example_signal_emitter_OBJECTS) $(example_signal_emitter_LDADD) $(LIBS) example-signal-recipient$(EXEEXT): $(example_signal_recipient_OBJECTS) $(example_signal_recipient_DEPENDENCIES) $(EXTRA_example_signal_recipient_DEPENDENCIES) @rm -f example-signal-recipient$(EXEEXT) $(AM_V_CCLD)$(LINK) $(example_signal_recipient_OBJECTS) $(example_signal_recipient_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/example-client.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/example-service.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/example-signal-emitter.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/example-signal-recipient.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 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: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-recursive all-am: Makefile $(PROGRAMS) installdirs: installdirs-recursive installdirs-am: 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) 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) all check \ ctags-recursive install 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 \ 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 example-service-glue.h: example-service.xml $(LIBTOOL) --mode=execute $(DBUS_BINDING_TOOL) --prefix=some_object --mode=glib-server --output=example-service-glue.h $(srcdir)/example-service.xml example-signal-emitter-glue.h: example-signal-emitter.xml $(LIBTOOL) --mode=execute $(DBUS_BINDING_TOOL) --prefix=test_object --mode=glib-server --output=example-signal-emitter-glue.h $(srcdir)/example-signal-emitter.xml # 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: dbus-glib-0.100.2/dbus/examples/statemachine/0000755000175000017500000000000012112654010015733 500000000000000dbus-glib-0.100.2/dbus/examples/statemachine/statemachine-server.xml0000644000175000017500000000053711634152371022366 00000000000000 dbus-glib-0.100.2/dbus/examples/statemachine/Makefile.in0000644000175000017500000004560412112653377017750 00000000000000# 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 = statemachine-server$(EXEEXT) subdir = dbus/examples/statemachine 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)/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 = PROGRAMS = $(noinst_PROGRAMS) am_statemachine_server_OBJECTS = statemachine-server.$(OBJEXT) \ sm-marshal.$(OBJEXT) statemachine.$(OBJEXT) statemachine_server_OBJECTS = $(am_statemachine_server_OBJECTS) statemachine_server_LDADD = $(LDADD) am__DEPENDENCIES_1 = statemachine_server_DEPENDENCIES = \ $(top_builddir)/dbus/libdbus-glib-1.la $(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 DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/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 = $(statemachine_server_SOURCES) DIST_SOURCES = $(statemachine_server_SOURCES) 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) ABSOLUTE_TOP_BUILDDIR = @ABSOLUTE_TOP_BUILDDIR@ ACLOCAL = @ACLOCAL@ 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@ CYGPATH_W = @CYGPATH_W@ DBUS_BINDING_TOOL = @DBUS_BINDING_TOOL@ DBUS_CFLAGS = @DBUS_CFLAGS@ DBUS_GLIB_CFLAGS = @DBUS_GLIB_CFLAGS@ DBUS_GLIB_LIBS = @DBUS_GLIB_LIBS@ DBUS_GLIB_THREADS_CFLAGS = @DBUS_GLIB_THREADS_CFLAGS@ DBUS_GLIB_THREADS_LIBS = @DBUS_GLIB_THREADS_LIBS@ DBUS_GLIB_TOOL_CFLAGS = @DBUS_GLIB_TOOL_CFLAGS@ DBUS_GLIB_TOOL_LIBS = @DBUS_GLIB_TOOL_LIBS@ DBUS_LIBS = @DBUS_LIBS@ DBUS_PATH_OR_ABSTRACT = @DBUS_PATH_OR_ABSTRACT@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ EXPANDED_BINDIR = @EXPANDED_BINDIR@ EXPANDED_DATADIR = @EXPANDED_DATADIR@ EXPANDED_LIBDIR = @EXPANDED_LIBDIR@ EXPANDED_LOCALSTATEDIR = @EXPANDED_LOCALSTATEDIR@ EXPANDED_SYSCONFDIR = @EXPANDED_SYSCONFDIR@ FGREP = @FGREP@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GREP = @GREP@ GTKDOC_CHECK = @GTKDOC_CHECK@ 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@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_REVISION = @LT_REVISION@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ 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@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TEST_CORE_SERVICE_BINARY = @TEST_CORE_SERVICE_BINARY@ TEST_EXIT_BINARY = @TEST_EXIT_BINARY@ TEST_INTERFACES_SERVICE_BINARY = @TEST_INTERFACES_SERVICE_BINARY@ TEST_SEGFAULT_BINARY = @TEST_SEGFAULT_BINARY@ TEST_SERVICE_BINARY = @TEST_SERVICE_BINARY@ TEST_SERVICE_DIR = @TEST_SERVICE_DIR@ TEST_SHELL_SERVICE_BINARY = @TEST_SHELL_SERVICE_BINARY@ TEST_SLEEP_FOREVER_BINARY = @TEST_SLEEP_FOREVER_BINARY@ TEST_SOCKET_DIR = @TEST_SOCKET_DIR@ VERSION = @VERSION@ 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_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@ 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@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ 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 = \ -I$(top_srcdir) \ -I$(top_builddir) \ -I$(top_builddir)/dbus \ $(DBUS_CFLAGS) \ $(DBUS_GLIB_CFLAGS) \ $(DBUS_GTK_THREADS_CFLAGS) \ -DDBUS_COMPILATION LDADD = $(top_builddir)/dbus/libdbus-glib-1.la \ $(DBUS_GLIB_LIBS) #if HAVE_GTK #noinst_PROGRAMS += statemachine-client #endif EXTRA_DIST = statemachine.h statemachine-server.h sm-marshal.list statemachine-server.xml statemachine.xml statemachine_server_SOURCES = statemachine-server.c sm-marshal.c statemachine.c #statemachine_client_SOURCES= statemachine-client.c sm-marshal.c statemachine.h #statemachine_client_LDADD= $(LDADD) $(DBUS_GTK_THREADS_LIBS) BUILT_SOURCES = statemachine-server-glue.h statemachine-glue.h \ sm-marshal.c sm-marshal.h CLEANFILES = $(BUILT_SOURCES) all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(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 dbus/examples/statemachine/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu dbus/examples/statemachine/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: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(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 statemachine-server$(EXEEXT): $(statemachine_server_OBJECTS) $(statemachine_server_DEPENDENCIES) $(EXTRA_statemachine_server_DEPENDENCIES) @rm -f statemachine-server$(EXEEXT) $(AM_V_CCLD)$(LINK) $(statemachine_server_OBJECTS) $(statemachine_server_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sm-marshal.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/statemachine-server.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/statemachine.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 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 $(PROGRAMS) 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-noinstPROGRAMS \ 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 install install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstPROGRAMS 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 statemachine-server-glue.h: statemachine-server.xml $(LIBTOOL) --mode=execute $(DBUS_BINDING_TOOL) --prefix=sm_server --mode=glib-server --output=$@ $< statemachine-glue.h: statemachine.xml $(LIBTOOL) --mode=execute $(DBUS_BINDING_TOOL) --prefix=sm_object --mode=glib-server --output=$@ $< sm-marshal.c: Makefile sm-marshal.list echo "#include " > $@.tmp @GLIB_GENMARSHAL@ --prefix=sm_marshal $(srcdir)/sm-marshal.list --header --body >> $@.tmp mv $@.tmp $@ sm-marshal.h: Makefile sm-marshal.list @GLIB_GENMARSHAL@ --prefix=sm_marshal $(srcdir)/sm-marshal.list --header > $@.tmp && mv $@.tmp $@ # 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: dbus-glib-0.100.2/dbus/examples/statemachine/statemachine.c0000644000175000017500000001773212107524614020510 00000000000000#include #include #include #include "statemachine.h" static void clear_pending_tasks (SMObject *object); static void state_change (SMObject *object, SMObjectState new_state); static void sm_object_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec); static void sm_object_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec); enum { PROP_0, PROP_NAME }; enum { STATE_CHANGED, ACQUISITION_FAILED, ACQUISITION_PROGRESS, LAST_SIGNAL }; static guint sm_object_signals[LAST_SIGNAL] = { 0 }; G_DEFINE_TYPE(SMObject, sm_object, G_TYPE_OBJECT) static void sm_object_init (SMObject *obj) { obj->state = SM_OBJECT_STATE_SHUTDOWN; } static void sm_object_class_init (SMObjectClass *klass) { GObjectClass *object_class; object_class = G_OBJECT_CLASS (klass); object_class->set_property = sm_object_set_property; object_class->get_property = sm_object_get_property; g_object_class_install_property (object_class, PROP_NAME, g_param_spec_string ("name", "name", "name", NULL, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); sm_object_signals[STATE_CHANGED] = g_signal_new ("state-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); sm_object_signals[ACQUISITION_PROGRESS] = g_signal_new ("acquisition-progress", G_OBJECT_CLASS_TYPE (klass), G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED, 0, NULL, NULL, g_cclosure_marshal_VOID__DOUBLE, G_TYPE_NONE, 1, G_TYPE_DOUBLE); sm_object_signals[ACQUISITION_FAILED] = g_signal_new ("acquisition-failed", G_OBJECT_CLASS_TYPE (klass), G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0); } /* This should really be standard. */ #define ENUM_ENTRY(NAME, DESC) { NAME, "" #NAME "", DESC } GQuark sm_error_quark (void) { static GQuark ret = 0; if (!ret) ret = g_quark_from_static_string ("SMObjectErrorQuark"); return ret; } GType sm_object_state_get_type (void) { static GType etype = 0; if (etype == 0) { static const GEnumValue values[] = { ENUM_ENTRY (SM_OBJECT_STATE_SHUTDOWN, "Shutdown"), ENUM_ENTRY (SM_OBJECT_STATE_INITIALIZED, "Loading"), ENUM_ENTRY (SM_OBJECT_STATE_ACQUIRED, "Acquired"), ENUM_ENTRY (SM_OBJECT_STATE_OPERATING, "Operating"), { 0, 0, 0 } }; etype = g_enum_register_static ("SMObjectState", values); } return etype; } GType sm_error_get_type (void) { static GType etype = 0; if (etype == 0) { static const GEnumValue values[] = { ENUM_ENTRY (SM_ERROR_INVALID_STATE, "InvalidState"), ENUM_ENTRY (SM_ERROR_NAME_IN_USE, "NameInUse"), { 0, 0, 0 } }; g_assert (SM_NUM_ERRORS == G_N_ELEMENTS (values) - 1); etype = g_enum_register_static ("SMError", values); } return etype; } static void sm_object_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) { SMObject *sm = SM_OBJECT (object); switch (prop_id) { case PROP_NAME: sm->name = g_strdup (g_value_get_string (value)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } } static void sm_object_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) { SMObject *sm= SM_OBJECT (object); switch (prop_id) { case PROP_NAME: g_value_set_string (value, sm->name); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } } static const char * state_to_string (SMObjectState state) { GEnumValue *value; GEnumClass *prop_class; const char *ret; prop_class = g_type_class_ref (SM_TYPE_OBJECT_STATE); value = g_enum_get_value (prop_class, state); ret = value->value_nick; g_type_class_unref (prop_class); return ret; } static void queue_task (SMObject *object, guint delay, GSourceFunc func) { guint id; id = g_timeout_add (delay, func, object); object->pending_tasks = g_slist_prepend (object->pending_tasks, GUINT_TO_POINTER (id)); } static gboolean idle_state_change (gpointer data) { SMObject *object = data; g_print ("doing idle state change for %s to %s\n", object->name, state_to_string (object->requested_state)); state_change (object, object->requested_state); return FALSE; } static gboolean idle_further_acquire (gpointer data) { SMObject *object = data; g_print ("doing idle acquisition for machine %s\n", object->name); object->acquisition_progress += g_random_double_range (0.20, 0.7); if (object->acquisition_progress > 1.0) { object->acquisition_progress = 1.0; return FALSE; } else { g_signal_emit (object, sm_object_signals[ACQUISITION_PROGRESS], 0, object->acquisition_progress); return TRUE; } } static void clear_pending_tasks (SMObject *object) { GSList *tmp; for (tmp = object->pending_tasks; tmp; tmp = tmp->next) g_source_remove (GPOINTER_TO_UINT (tmp->data)); g_slist_free (object->pending_tasks); object->pending_tasks = NULL; } static void state_change (SMObject *object, SMObjectState new_state) { g_signal_emit (object, sm_object_signals[STATE_CHANGED], 0, state_to_string (new_state)); clear_pending_tasks (object); if (new_state == SM_OBJECT_STATE_ACQUIRED) { object->acquisition_progress = 0.0; queue_task (object, 1000, idle_further_acquire); } else if (new_state == SM_OBJECT_STATE_INITIALIZED) { if (g_random_int_range (0, 2) == 0) { object->requested_state = SM_OBJECT_STATE_ACQUIRED; queue_task (object, 3000, idle_state_change); } } object->state = new_state; } gboolean sm_object_get_info (SMObject *object, char **name, char **state, GError **error) { *name= g_strdup (object->name); *state = g_strdup (state_to_string (object->state)); return TRUE; } gboolean sm_object_start (SMObject *object, GError **error) { if (object->state != SM_OBJECT_STATE_SHUTDOWN) { g_set_error (error, SM_ERROR, SM_ERROR_INVALID_STATE, "%s", "Can't start from non-shutdown state"); return FALSE; } state_change (object, SM_OBJECT_STATE_INITIALIZED); return TRUE; } gboolean sm_object_shutdown (SMObject *object, GError **error) { if (object->state == SM_OBJECT_STATE_SHUTDOWN) { g_set_error (error, SM_ERROR, SM_ERROR_INVALID_STATE, "%s", "Can't shutdown from shutdown state"); return FALSE; } state_change (object, SM_OBJECT_STATE_SHUTDOWN); return TRUE; } gboolean sm_object_reinitialize (SMObject *object, GError **error) { if (object->state != SM_OBJECT_STATE_ACQUIRED && object->state != SM_OBJECT_STATE_OPERATING) { g_set_error (error, SM_ERROR, SM_ERROR_INVALID_STATE, "Can't reinitialize from state %d", object->state); return FALSE; } state_change (object, SM_OBJECT_STATE_INITIALIZED); return TRUE; } gboolean sm_object_reacquire (SMObject *object, GError **error) { if (object->state == SM_OBJECT_STATE_ACQUIRED) { g_set_error (error, SM_ERROR, SM_ERROR_INVALID_STATE, "Can't reacquire from state %d", object->state); return FALSE; } state_change (object, SM_OBJECT_STATE_ACQUIRED); return TRUE; } gboolean sm_object_get_acquiring_progress (SMObject *object, gdouble *out, GError **error) { if (object->state != SM_OBJECT_STATE_ACQUIRED) { g_set_error (error, SM_ERROR, SM_ERROR_INVALID_STATE, "Can't get progress from state %d", object->state); return FALSE; } *out = object->acquisition_progress; return TRUE; } dbus-glib-0.100.2/dbus/examples/statemachine/statemachine-server.c0000644000175000017500000001331412107524614022004 00000000000000#include #include #include #include #include "statemachine.h" #include "sm-marshal.h" #include "statemachine-server.h" enum { PROP_O, PROP_BUS }; enum { MACHINE_CREATED, LAST_SIGNAL }; static guint sm_server_signals[LAST_SIGNAL] = { 0 }; static void sm_server_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec); static void sm_server_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec); G_DEFINE_TYPE(SMServer, sm_server, G_TYPE_OBJECT) #include "statemachine-server-glue.h" #include "statemachine-glue.h" static void sm_server_init (SMServer *obj) { obj->machines = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_object_unref); } static void sm_server_class_init (SMServerClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); object_class->set_property = sm_server_set_property; object_class->get_property = sm_server_get_property; g_object_class_install_property (object_class, PROP_BUS, g_param_spec_boxed ("bus", "bus", "bus", DBUS_TYPE_G_CONNECTION, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); sm_server_signals[MACHINE_CREATED] = g_signal_new ("machine-created", G_OBJECT_CLASS_TYPE (klass), G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED, 0, NULL, NULL, sm_marshal_VOID__STRING_BOXED, G_TYPE_NONE, 2, G_TYPE_STRING, DBUS_TYPE_G_OBJECT_PATH); } static void sm_server_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) { SMServer *server = SM_SERVER (object); switch (prop_id) { case PROP_BUS: server->bus = g_value_get_boxed (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } } static void sm_server_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) { SMServer *server = SM_SERVER (object); switch (prop_id) { case PROP_BUS: g_value_set_boxed (value, server->bus); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } } static void machine_state_changed_cb (SMObject *obj, const char *state, gpointer data) { char *name; g_object_get (obj, "name", &name, NULL); g_print ("Machine %s switching to state %s\n", name, state); g_free (name); } static void machine_acquisition_changed_cb (SMObject *obj, gdouble progress, gpointer data) { char *name; g_object_get (obj, "name", &name, NULL); g_print ("Machine %s got progress %f\n", name, progress); g_free (name); } gboolean sm_server_create_machine (SMServer *server, const char *name, GError **error) { SMObject *machine; char *path; machine = g_hash_table_lookup (server->machines, name); if (machine != NULL) { g_set_error (error, SM_ERROR, SM_ERROR_NAME_IN_USE, "Statemachine name \"%s\" is already in use", name); return FALSE; } machine = g_object_new (SM_TYPE_OBJECT, "name", name, NULL); path = g_strdup_printf ("/com/example/StateMachines/%s", name); dbus_g_connection_register_g_object (server->bus, path, G_OBJECT (machine)); g_hash_table_insert (server->machines, g_strdup (name), machine); g_print ("Created state machine with name %s at %s\n", name, path); g_signal_connect_object (machine, "state-changed", G_CALLBACK (machine_state_changed_cb), NULL, 0); g_signal_connect_object (machine, "acquisition-progress", G_CALLBACK (machine_acquisition_changed_cb), NULL, 0); g_signal_emit (server, sm_server_signals[MACHINE_CREATED], 0, name, path); g_free (path); return TRUE; } static void add_machine_to_ptr_array (gpointer key, gpointer val, gpointer data) { const char *name = key; /* SMObject *sm = val; */ GPtrArray *ptrarray = data; g_ptr_array_add (ptrarray, g_strdup_printf ("/com/example/StateMachines/%s", name)); } gboolean sm_server_get_machines (SMServer *server, GPtrArray **machines, GError **error) { *machines = g_ptr_array_new (); g_hash_table_foreach (server->machines, add_machine_to_ptr_array, *machines); return TRUE; } int main (int argc, char **argv) { DBusGConnection *bus; DBusGProxy *bus_proxy; GError *error = NULL; SMServer *server; GMainLoop *mainloop; guint request_name_result; g_type_init (); dbus_g_object_type_install_info (SM_TYPE_SERVER, &dbus_glib_sm_server_object_info); dbus_g_object_type_install_info (SM_TYPE_OBJECT, &dbus_glib_sm_object_object_info); dbus_g_error_domain_register (SM_ERROR, NULL, SM_TYPE_ERROR); mainloop = g_main_loop_new (NULL, FALSE); bus = dbus_g_bus_get (DBUS_BUS_SESSION, &error); if (!bus) g_critical ("Couldn't connect to session bus: %s\n", error->message); bus_proxy = dbus_g_proxy_new_for_name (bus, "org.freedesktop.DBus", "/org/freedesktop/DBus", "org.freedesktop.DBus"); if (!dbus_g_proxy_call (bus_proxy, "RequestName", &error, G_TYPE_STRING, "com.example.StateServer", G_TYPE_UINT, 0, G_TYPE_INVALID, G_TYPE_UINT, &request_name_result, G_TYPE_INVALID)) g_critical ("Couldn't acquire com.example.StateServer: %s\n", error->message); server = g_object_new (SM_TYPE_SERVER, "bus", bus, NULL); dbus_g_connection_register_g_object (bus, "/com/example/StateServer", G_OBJECT (server)); g_print ("StateMachine server initialized\n"); g_main_loop_run (mainloop); exit (0); } dbus-glib-0.100.2/dbus/examples/statemachine/statemachine.h0000644000175000017500000000365211634152371020512 00000000000000#ifndef _SM_OBJECT_H #define _SM_OBJECT_H #include #include GQuark sm_error_quark (void); #define SM_ERROR (sm_error_quark ()) typedef enum { SM_ERROR_INVALID_STATE = 0, SM_ERROR_NAME_IN_USE, SM_NUM_ERRORS } SMError; GType sm_error_get_type (void); #define SM_TYPE_ERROR (sm_error_get_type ()) typedef enum { SM_OBJECT_STATE_SHUTDOWN = 0, SM_OBJECT_STATE_INITIALIZED, SM_OBJECT_STATE_ACQUIRED, SM_OBJECT_STATE_OPERATING, SM_OBJECT_NUM_STATES } SMObjectState; GType sm_object_state_get_type (void); #define SM_TYPE_OBJECT_STATE (sm_object_state_get_type ()) typedef struct SMObject SMObject; typedef struct SMObjectClass SMObjectClass; struct SMObject { GObject parent; /* Private */ char *name; SMObjectState state; double acquisition_progress; GSList /* guint */ *pending_tasks; SMObjectState requested_state; }; struct SMObjectClass { GObjectClass parent; }; #define SM_TYPE_OBJECT (sm_object_get_type ()) #define SM_OBJECT(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), SM_TYPE_OBJECT, SMObject)) #define SM_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SM_TYPE_OBJECT, SMObjectClass)) #define SM_IS_OBJECT(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), SM_TYPE_OBJECT)) #define SM_IS_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SM_TYPE_OBJECT)) #define SM_OBJECT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SM_TYPE_OBJECT, SMObjectClass)) GType sm_object_get_type (void); gboolean sm_object_get_info (SMObject *object, char **name, char **state, GError **error); gboolean sm_object_start (SMObject *object, GError **error); gboolean sm_object_shutdown (SMObject *object, GError **error); gboolean sm_object_reinitialize (SMObject *object, GError **error); gboolean sm_object_reacquire (SMObject *object, GError **error); gboolean sm_object_get_acquiring_progress (SMObject *object, gdouble *out, GError **error); #endif dbus-glib-0.100.2/dbus/examples/statemachine/sm-marshal.list0000644000175000017500000000002211634152371020621 00000000000000VOID:STRING,BOXED dbus-glib-0.100.2/dbus/examples/statemachine/sm-marshal.c0000644000175000017500000001115612112653616020102 00000000000000#include #ifndef __sm_marshal_MARSHAL_H__ #define __sm_marshal_MARSHAL_H__ #include G_BEGIN_DECLS #ifdef G_ENABLE_DEBUG #define g_marshal_value_peek_boolean(v) g_value_get_boolean (v) #define g_marshal_value_peek_char(v) g_value_get_schar (v) #define g_marshal_value_peek_uchar(v) g_value_get_uchar (v) #define g_marshal_value_peek_int(v) g_value_get_int (v) #define g_marshal_value_peek_uint(v) g_value_get_uint (v) #define g_marshal_value_peek_long(v) g_value_get_long (v) #define g_marshal_value_peek_ulong(v) g_value_get_ulong (v) #define g_marshal_value_peek_int64(v) g_value_get_int64 (v) #define g_marshal_value_peek_uint64(v) g_value_get_uint64 (v) #define g_marshal_value_peek_enum(v) g_value_get_enum (v) #define g_marshal_value_peek_flags(v) g_value_get_flags (v) #define g_marshal_value_peek_float(v) g_value_get_float (v) #define g_marshal_value_peek_double(v) g_value_get_double (v) #define g_marshal_value_peek_string(v) (char*) g_value_get_string (v) #define g_marshal_value_peek_param(v) g_value_get_param (v) #define g_marshal_value_peek_boxed(v) g_value_get_boxed (v) #define g_marshal_value_peek_pointer(v) g_value_get_pointer (v) #define g_marshal_value_peek_object(v) g_value_get_object (v) #define g_marshal_value_peek_variant(v) g_value_get_variant (v) #else /* !G_ENABLE_DEBUG */ /* WARNING: This code accesses GValues directly, which is UNSUPPORTED API. * Do not access GValues directly in your code. Instead, use the * g_value_get_*() functions */ #define g_marshal_value_peek_boolean(v) (v)->data[0].v_int #define g_marshal_value_peek_char(v) (v)->data[0].v_int #define g_marshal_value_peek_uchar(v) (v)->data[0].v_uint #define g_marshal_value_peek_int(v) (v)->data[0].v_int #define g_marshal_value_peek_uint(v) (v)->data[0].v_uint #define g_marshal_value_peek_long(v) (v)->data[0].v_long #define g_marshal_value_peek_ulong(v) (v)->data[0].v_ulong #define g_marshal_value_peek_int64(v) (v)->data[0].v_int64 #define g_marshal_value_peek_uint64(v) (v)->data[0].v_uint64 #define g_marshal_value_peek_enum(v) (v)->data[0].v_long #define g_marshal_value_peek_flags(v) (v)->data[0].v_ulong #define g_marshal_value_peek_float(v) (v)->data[0].v_float #define g_marshal_value_peek_double(v) (v)->data[0].v_double #define g_marshal_value_peek_string(v) (v)->data[0].v_pointer #define g_marshal_value_peek_param(v) (v)->data[0].v_pointer #define g_marshal_value_peek_boxed(v) (v)->data[0].v_pointer #define g_marshal_value_peek_pointer(v) (v)->data[0].v_pointer #define g_marshal_value_peek_object(v) (v)->data[0].v_pointer #define g_marshal_value_peek_variant(v) (v)->data[0].v_pointer #endif /* !G_ENABLE_DEBUG */ /* VOID:STRING,BOXED (/home/smcv/src/fdo/dbus-glib/dbus/examples/statemachine/sm-marshal.list:1) */ extern void sm_marshal_VOID__STRING_BOXED (GClosure *closure, GValue *return_value, guint n_param_values, const GValue *param_values, gpointer invocation_hint, gpointer marshal_data); void sm_marshal_VOID__STRING_BOXED (GClosure *closure, GValue *return_value G_GNUC_UNUSED, guint n_param_values, const GValue *param_values, gpointer invocation_hint G_GNUC_UNUSED, gpointer marshal_data) { typedef void (*GMarshalFunc_VOID__STRING_BOXED) (gpointer data1, gpointer arg_1, gpointer arg_2, gpointer data2); register GMarshalFunc_VOID__STRING_BOXED callback; register GCClosure *cc = (GCClosure*) closure; register gpointer data1, data2; g_return_if_fail (n_param_values == 3); if (G_CCLOSURE_SWAP_DATA (closure)) { data1 = closure->data; data2 = g_value_peek_pointer (param_values + 0); } else { data1 = g_value_peek_pointer (param_values + 0); data2 = closure->data; } callback = (GMarshalFunc_VOID__STRING_BOXED) (marshal_data ? marshal_data : cc->callback); callback (data1, g_marshal_value_peek_string (param_values + 1), g_marshal_value_peek_boxed (param_values + 2), data2); } G_END_DECLS #endif /* __sm_marshal_MARSHAL_H__ */ dbus-glib-0.100.2/dbus/examples/statemachine/statemachine.xml0000644000175000017500000000127411634152371021061 00000000000000 dbus-glib-0.100.2/dbus/examples/statemachine/Makefile.am0000644000175000017500000000271712107524614017730 00000000000000INCLUDES = \ -I$(top_srcdir) \ -I$(top_builddir) \ -I$(top_builddir)/dbus \ $(DBUS_CFLAGS) \ $(DBUS_GLIB_CFLAGS) \ $(DBUS_GTK_THREADS_CFLAGS) \ -DDBUS_COMPILATION LDADD = $(top_builddir)/dbus/libdbus-glib-1.la \ $(DBUS_GLIB_LIBS) ## Makefile.am bits for sample client/server pair noinst_PROGRAMS= statemachine-server #if HAVE_GTK #noinst_PROGRAMS += statemachine-client #endif EXTRA_DIST = statemachine.h statemachine-server.h sm-marshal.list statemachine-server.xml statemachine.xml statemachine_server_SOURCES= statemachine-server.c sm-marshal.c statemachine.c #statemachine_client_SOURCES= statemachine-client.c sm-marshal.c statemachine.h #statemachine_client_LDADD= $(LDADD) $(DBUS_GTK_THREADS_LIBS) BUILT_SOURCES = statemachine-server-glue.h statemachine-glue.h statemachine-server-glue.h: statemachine-server.xml $(LIBTOOL) --mode=execute $(DBUS_BINDING_TOOL) --prefix=sm_server --mode=glib-server --output=$@ $< statemachine-glue.h: statemachine.xml $(LIBTOOL) --mode=execute $(DBUS_BINDING_TOOL) --prefix=sm_object --mode=glib-server --output=$@ $< sm-marshal.c: Makefile sm-marshal.list echo "#include " > $@.tmp @GLIB_GENMARSHAL@ --prefix=sm_marshal $(srcdir)/sm-marshal.list --header --body >> $@.tmp mv $@.tmp $@ sm-marshal.h: Makefile sm-marshal.list @GLIB_GENMARSHAL@ --prefix=sm_marshal $(srcdir)/sm-marshal.list --header > $@.tmp && mv $@.tmp $@ BUILT_SOURCES += sm-marshal.c sm-marshal.h CLEANFILES = $(BUILT_SOURCES) dbus-glib-0.100.2/dbus/examples/statemachine/statemachine-server.h0000644000175000017500000000211611634152371022010 00000000000000#ifndef _SM_SERVER_H #define _SM_SERVER_H #include "statemachine.h" #include typedef struct SMServer SMServer; typedef struct SMServerClass SMServerClass; struct SMServer { GObject parent; /* Private */ DBusGConnection *bus; GHashTable *machines; }; struct SMServerClass { GObjectClass parent; }; #define SM_TYPE_SERVER (sm_server_get_type ()) #define SM_SERVER(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), SM_TYPE_SERVER, SMServer)) #define SM_SERVER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SM_TYPE_SERVER, SMServerClass)) #define SM_IS_SERVER(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), SM_TYPE_SERVER)) #define SM_IS_SERVER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SM_TYPE_SERVER)) #define SM_SERVER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SM_TYPE_SERVER, SMServerClass)) GType sm_server_get_type (void); gboolean sm_server_create_machine (SMServer *server, const char *name, GError **error); gboolean sm_server_get_machines (SMServer *server, GPtrArray **machines, GError **error); #endif dbus-glib-0.100.2/dbus/examples/example-client.c0000644000175000017500000000663712107524614016307 00000000000000#include #include #include #include static void lose (const char *fmt, ...) G_GNUC_NORETURN G_GNUC_PRINTF (1, 2); static void lose_gerror (const char *prefix, GError *error) G_GNUC_NORETURN; static void lose (const char *str, ...) { va_list args; va_start (args, str); vfprintf (stderr, str, args); fputc ('\n', stderr); va_end (args); exit (1); } static void lose_gerror (const char *prefix, GError *error) { lose ("%s: %s", prefix, error->message); } static void print_hash_value (gpointer key, gpointer val, gpointer data) { printf ("%s -> %s\n", (char *) key, (char *) val); } int main (int argc, char **argv) { DBusGConnection *bus; DBusGProxy *remote_object; DBusGProxy *remote_object_introspectable; GError *error = NULL; char **reply_list; char **reply_ptr; GValueArray *hello_reply_struct; GHashTable *hello_reply_dict; char *introspect_data; guint i; g_type_init (); { GLogLevelFlags fatal_mask; fatal_mask = g_log_set_always_fatal (G_LOG_FATAL_MASK); fatal_mask |= G_LOG_LEVEL_WARNING | G_LOG_LEVEL_CRITICAL; g_log_set_always_fatal (fatal_mask); } bus = dbus_g_bus_get (DBUS_BUS_SESSION, &error); if (!bus) lose_gerror ("Couldn't connect to session bus", error); remote_object = dbus_g_proxy_new_for_name (bus, "org.designfu.SampleService", "/SomeObject", "org.designfu.SampleInterface"); if (!dbus_g_proxy_call (remote_object, "HelloWorld", &error, G_TYPE_STRING, "Hello from example-client.c!", G_TYPE_INVALID, G_TYPE_STRV, &reply_list, G_TYPE_INVALID)) lose_gerror ("Failed to complete HelloWorld", error); if (!dbus_g_proxy_call (remote_object, "GetTuple", &error, G_TYPE_INVALID, G_TYPE_VALUE_ARRAY, &hello_reply_struct, G_TYPE_INVALID)) lose_gerror ("Failed to complete GetTuple", error); if (!dbus_g_proxy_call (remote_object, "GetDict", &error, G_TYPE_INVALID, DBUS_TYPE_G_STRING_STRING_HASHTABLE, &hello_reply_dict, G_TYPE_INVALID)) lose_gerror ("Failed to complete GetDict", error); printf ("reply_list: "); for (reply_ptr = reply_list; *reply_ptr; reply_ptr++) printf ("\"%s\" ", *reply_ptr); printf ("\n"); g_strfreev (reply_list); for (i = 0; i < hello_reply_struct->n_values; i++) { GValue strval = { 0, }; g_value_init (&strval, G_TYPE_STRING); if (!g_value_transform (g_value_array_get_nth (hello_reply_struct, i), &strval)) g_value_set_static_string (&strval, "(couldn't transform to string)"); g_print ("%s: %s\n", g_type_name (G_VALUE_TYPE (g_value_array_get_nth (hello_reply_struct, i))), g_value_get_string (&strval)); } g_value_array_free (hello_reply_struct); printf ("\n"); g_hash_table_foreach (hello_reply_dict, print_hash_value, NULL); g_hash_table_destroy (hello_reply_dict); remote_object_introspectable = dbus_g_proxy_new_for_name (bus, "org.designfu.SampleService", "/SomeObject", "org.freedesktop.DBus.Introspectable"); if (!dbus_g_proxy_call (remote_object_introspectable, "Introspect", &error, G_TYPE_INVALID, G_TYPE_STRING, &introspect_data, G_TYPE_INVALID)) lose_gerror ("Failed to complete Introspect", error); printf ("%s", introspect_data); g_free (introspect_data); g_object_unref (G_OBJECT (remote_object_introspectable)); g_object_unref (G_OBJECT (remote_object)); exit(0); } dbus-glib-0.100.2/dbus/examples/example-signal-recipient.c0000644000175000017500000000526312107524614020260 00000000000000#include #include #include #include static void lose (const char *fmt, ...) G_GNUC_NORETURN G_GNUC_PRINTF (1, 2); static void lose_gerror (const char *prefix, GError *error) G_GNUC_NORETURN; static void lose (const char *str, ...) { va_list args; va_start (args, str); vfprintf (stderr, str, args); fputc ('\n', stderr); va_end (args); exit (1); } static void lose_gerror (const char *prefix, GError *error) { lose ("%s: %s", prefix, error->message); } static gboolean emit_signal (gpointer arg) { DBusGProxy *proxy = arg; dbus_g_proxy_call_no_reply (proxy, "emitHelloSignal", G_TYPE_INVALID); return TRUE; } static void hello_signal_handler (DBusGProxy *proxy, const char *hello_string, gpointer user_data) { printf ("Received signal and it says: %s\n", hello_string); } int main (int argc, char **argv) { DBusGConnection *bus; DBusGProxy *remote_object; GError *error = NULL; GMainLoop *mainloop; g_type_init (); mainloop = g_main_loop_new (NULL, FALSE); bus = dbus_g_bus_get (DBUS_BUS_SESSION, &error); if (!bus) lose_gerror ("Couldn't connect to session bus", error); /* We use _for_name_owner in order to track this particular service * instance, which lets us receive signals. */ remote_object = dbus_g_proxy_new_for_name (bus, "org.designfu.TestService", "/org/designfu/TestService/object", "org.designfu.TestService"); if (!remote_object) lose_gerror ("Failed to get name owner", error); /* IMPORTANT: * * Note because this signal's signature is VOID__STRING, we do not * need to register a marshaller, since there is a builtin one. * However for other signatures, you must generate a marshaller, * then call dbus_g_object_register_marshaller. It would look like * this: * * dbus_g_object_register_marshaller (g_cclosure_marshal_VOID__STRING, G_TYPE_NONE, G_TYPE_STRING, G_TYPE_INVALID); * */ /* Tell DBus what the type signature of the signal callback is; this * allows us to sanity-check incoming messages before invoking the * callback. You need to do this once for each proxy you create, * not every time you want to connect to the signal. */ dbus_g_proxy_add_signal (remote_object, "HelloSignal", G_TYPE_STRING, G_TYPE_INVALID); /* Actually connect to the signal. Note you can call * dbus_g_proxy_connect_signal multiple times for one invocation of * dbus_g_proxy_add_signal. */ dbus_g_proxy_connect_signal (remote_object, "HelloSignal", G_CALLBACK (hello_signal_handler), NULL, NULL); g_timeout_add (2000, emit_signal, remote_object); g_main_loop_run (mainloop); exit (0); } dbus-glib-0.100.2/dbus/examples/example-signal-emitter.c0000644000175000017500000000627312107524614017751 00000000000000#include #include #include #include static void lose (const char *fmt, ...) G_GNUC_NORETURN G_GNUC_PRINTF (1, 2); static void lose_gerror (const char *prefix, GError *error) G_GNUC_NORETURN; static void lose (const char *str, ...) { va_list args; va_start (args, str); vfprintf (stderr, str, args); fputc ('\n', stderr); va_end (args); exit (1); } static void lose_gerror (const char *prefix, GError *error) { lose ("%s: %s", prefix, error->message); } typedef struct TestObject TestObject; typedef struct TestObjectClass TestObjectClass; GType test_object_get_type (void); struct TestObject { GObject parent; }; struct TestObjectClass { GObjectClass parent; }; enum { HELLO_SIGNAL, LAST_SIGNAL }; static guint signals[LAST_SIGNAL] = { 0 }; #define TEST_TYPE_OBJECT (test_object_get_type ()) #define TEST_OBJECT(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), TEST_TYPE_OBJECT, TestObject)) #define TEST_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TEST_TYPE_OBJECT, TestObjectClass)) #define TEST_IS_OBJECT(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), TEST_TYPE_OBJECT)) #define TEST_IS_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TEST_TYPE_OBJECT)) #define TEST_OBJECT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TEST_TYPE_OBJECT, TestObjectClass)) G_DEFINE_TYPE(TestObject, test_object, G_TYPE_OBJECT) gboolean test_object_emit_hello_signal (TestObject *obj, GError **error); #include "example-signal-emitter-glue.h" static void test_object_init (TestObject *obj) { } static void test_object_class_init (TestObjectClass *klass) { signals[HELLO_SIGNAL] = g_signal_new ("hello_signal", 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); } gboolean test_object_emit_hello_signal (TestObject *obj, GError **error) { g_signal_emit (obj, signals[HELLO_SIGNAL], 0, "Hello"); return TRUE; } int main (int argc, char **argv) { DBusGConnection *bus; DBusGProxy *bus_proxy; GError *error = NULL; TestObject *obj; GMainLoop *mainloop; guint request_name_result; g_type_init (); dbus_g_object_type_install_info (TEST_TYPE_OBJECT, &dbus_glib_test_object_object_info); mainloop = g_main_loop_new (NULL, FALSE); bus = dbus_g_bus_get (DBUS_BUS_SESSION, &error); if (!bus) lose_gerror ("Couldn't connect to session bus", error); bus_proxy = dbus_g_proxy_new_for_name (bus, "org.freedesktop.DBus", "/org/freedesktop/DBus", "org.freedesktop.DBus"); if (!dbus_g_proxy_call (bus_proxy, "RequestName", &error, G_TYPE_STRING, "org.designfu.TestService", G_TYPE_UINT, 0, G_TYPE_INVALID, G_TYPE_UINT, &request_name_result, G_TYPE_INVALID)) lose_gerror ("Failed to acquire org.designfu.TestService", error); obj = g_object_new (TEST_TYPE_OBJECT, NULL); dbus_g_connection_register_g_object (bus, "/org/designfu/TestService/object", G_OBJECT (obj)); printf ("test service running\n"); g_main_loop_run (mainloop); exit (0); } dbus-glib-0.100.2/dbus/examples/example-service.xml0000644000175000017500000000063011634152371017033 00000000000000 dbus-glib-0.100.2/dbus/examples/Makefile.am0000644000175000017500000000237512107524563015266 00000000000000SUBDIRS = . statemachine INCLUDES = \ -I$(top_srcdir) \ -I$(top_builddir) \ -I$(top_builddir)/dbus \ $(DBUS_CFLAGS) \ $(DBUS_GLIB_CFLAGS) \ -DDBUS_COMPILATION LDADD = \ $(DBUS_GLIB_LIBS) \ $(top_builddir)/dbus/libdbus-glib-1.la ## Makefile.am bits for sample client/server pair noinst_PROGRAMS= example-client example-service example_client_SOURCES= example-client.c example_service_SOURCES= example-service.c BUILT_SOURCES = example-service-glue.h example-service-glue.h: example-service.xml $(LIBTOOL) --mode=execute $(DBUS_BINDING_TOOL) --prefix=some_object --mode=glib-server --output=example-service-glue.h $(srcdir)/example-service.xml ## Makefile.am bits for another client/server pair noinst_PROGRAMS += example-signal-recipient example-signal-emitter example_signal_recipient_SOURCES= example-signal-recipient.c example_signal_emitter_SOURCES= example-signal-emitter.c BUILT_SOURCES += example-signal-emitter-glue.h example-signal-emitter-glue.h: example-signal-emitter.xml $(LIBTOOL) --mode=execute $(DBUS_BINDING_TOOL) --prefix=test_object --mode=glib-server --output=example-signal-emitter-glue.h $(srcdir)/example-signal-emitter.xml CLEANFILES = $(BUILT_SOURCES) EXTRA_DIST = example-service.xml example-signal-emitter.xml dbus-glib-0.100.2/dbus/examples/example-service.c0000644000175000017500000001005212107524614016453 00000000000000#include #include #include #include static void lose (const char *fmt, ...) G_GNUC_NORETURN G_GNUC_PRINTF (1, 2); static void lose_gerror (const char *prefix, GError *error) G_GNUC_NORETURN; static void lose (const char *str, ...) { va_list args; va_start (args, str); vfprintf (stderr, str, args); fputc ('\n', stderr); va_end (args); exit (1); } static void lose_gerror (const char *prefix, GError *error) { lose ("%s: %s", prefix, error->message); } typedef struct SomeObject SomeObject; typedef struct SomeObjectClass SomeObjectClass; GType some_object_get_type (void); struct SomeObject { GObject parent; }; struct SomeObjectClass { GObjectClass parent; }; #define SOME_TYPE_OBJECT (some_object_get_type ()) #define SOME_OBJECT(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), SOME_TYPE_OBJECT, SomeObject)) #define SOME_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SOME_TYPE_OBJECT, SomeObjectClass)) #define SOME_IS_OBJECT(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), SOME_TYPE_OBJECT)) #define SOME_IS_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SOME_TYPE_OBJECT)) #define SOME_OBJECT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SOME_TYPE_OBJECT, SomeObjectClass)) G_DEFINE_TYPE(SomeObject, some_object, G_TYPE_OBJECT) gboolean some_object_hello_world (SomeObject *obj, const char *hello_message, char ***ret, GError **error); gboolean some_object_get_tuple (SomeObject *obj, GValueArray **ret, GError **error); gboolean some_object_get_dict (SomeObject *obj, GHashTable **ret, GError **error); #include "example-service-glue.h" static void some_object_init (SomeObject *obj) { } static void some_object_class_init (SomeObjectClass *klass) { } gboolean some_object_hello_world (SomeObject *obj, const char *hello_message, char ***ret, GError **error) { printf ("%s\n", hello_message); *ret = g_new (char *, 3); (*ret)[0] = g_strdup ("Hello"); (*ret)[1] = g_strdup (" from example-service.c"); (*ret)[2] = NULL; return TRUE; } gboolean some_object_get_tuple (SomeObject *obj, GValueArray **ret, GError **error) { *ret = g_value_array_new (6); g_value_array_prepend (*ret, NULL); g_value_init (g_value_array_get_nth (*ret, 0), G_TYPE_STRING); g_value_set_string (g_value_array_get_nth (*ret, 0), "hello"); g_value_array_prepend (*ret, NULL); g_value_init (g_value_array_get_nth (*ret, 0), G_TYPE_UINT); g_value_set_uint (g_value_array_get_nth (*ret, 0), 42); return TRUE; } gboolean some_object_get_dict (SomeObject *obj, GHashTable **ret, GError **error) { *ret = g_hash_table_new (g_str_hash, g_str_equal); g_hash_table_insert (*ret, "first", "Hello Dict"); g_hash_table_insert (*ret, "second", " from example-service.c"); return TRUE; } int main (int argc, char **argv) { DBusGConnection *bus; DBusGProxy *bus_proxy; GError *error = NULL; SomeObject *obj; GMainLoop *mainloop; guint request_name_result; g_type_init (); { GLogLevelFlags fatal_mask; fatal_mask = g_log_set_always_fatal (G_LOG_FATAL_MASK); fatal_mask |= G_LOG_LEVEL_WARNING | G_LOG_LEVEL_CRITICAL; g_log_set_always_fatal (fatal_mask); } dbus_g_object_type_install_info (SOME_TYPE_OBJECT, &dbus_glib_some_object_object_info); mainloop = g_main_loop_new (NULL, FALSE); bus = dbus_g_bus_get (DBUS_BUS_SESSION, &error); if (!bus) lose_gerror ("Couldn't connect to session bus", error); bus_proxy = dbus_g_proxy_new_for_name (bus, "org.freedesktop.DBus", "/org/freedesktop/DBus", "org.freedesktop.DBus"); if (!dbus_g_proxy_call (bus_proxy, "RequestName", &error, G_TYPE_STRING, "org.designfu.SampleService", G_TYPE_UINT, 0, G_TYPE_INVALID, G_TYPE_UINT, &request_name_result, G_TYPE_INVALID)) lose_gerror ("Failed to acquire org.designfu.SampleService", error); obj = g_object_new (SOME_TYPE_OBJECT, NULL); dbus_g_connection_register_g_object (bus, "/SomeObject", G_OBJECT (obj)); printf ("service running\n"); g_main_loop_run (mainloop); exit (0); } dbus-glib-0.100.2/dbus/dbus-gloader-expat.c0000644000175000017500000001511312107524614015236 00000000000000/* -*- mode: C; c-file-style: "gnu" -*- */ /* dbus-gloader-expat.c expat XML loader * * Copyright (C) 2003 Red Hat, Inc. * * Licensed under the Academic Free License version 2.1 * * 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 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * */ #include #include "dbus-gparser.h" #include #include static void* expat_g_malloc (size_t sz) { return g_malloc (sz); } static void* expat_g_realloc (void *mem, size_t sz) { return g_realloc (mem, sz); } static XML_Memory_Handling_Suite memsuite = { expat_g_malloc, expat_g_realloc, g_free }; /* * Context for Expat parser for introspection data. */ typedef struct { Parser *parser; /**< The parser for the introspection data */ const char *filename; /**< The filename being loaded */ GString *content; /**< The content of the current element */ GError **error; /**< Error return location */ gboolean failed; /**< True if parse has failed */ } ExpatParseContext; static dbus_bool_t process_content (ExpatParseContext *context) { if (context->failed) return FALSE; if (context->content->len > 0) { if (!parser_content (context->parser, context->content->str, context->content->len, context->error)) { context->failed = TRUE; return FALSE; } g_string_set_size (context->content, 0); } return TRUE; } static void expat_StartElementHandler (void *userData, const XML_Char *name, const XML_Char **atts) { ExpatParseContext *context = userData; int i; char **names; char **values; /* Expat seems to suck and can't abort the parse if we * throw an error. Expat 2.0 is supposed to fix this. */ if (context->failed) return; if (!process_content (context)) return; /* "atts" is key, value, key, value, NULL */ for (i = 0; atts[i] != NULL; ++i) ; /* nothing */ g_assert (i % 2 == 0); names = g_new0 (char *, i / 2 + 1); values = g_new0 (char *, i / 2 + 1); i = 0; while (atts[i] != NULL) { g_assert (i % 2 == 0); names [i / 2] = (char*) atts[i]; values[i / 2] = (char*) atts[i+1]; i += 2; } if (!parser_start_element (context->parser, name, (const char **) names, (const char **) values, context->error)) { g_free (names); g_free (values); context->failed = TRUE; return; } g_free (names); g_free (values); } static void expat_EndElementHandler (void *userData, const XML_Char *name) { ExpatParseContext *context = userData; if (!process_content (context)) return; if (!parser_end_element (context->parser, name, context->error)) { context->failed = TRUE; return; } } /* s is not 0 terminated. */ static void expat_CharacterDataHandler (void *userData, const XML_Char *s, int len) { ExpatParseContext *context = userData; if (context->failed) return; g_string_append_len (context->content, s, len); } NodeInfo* description_load_from_file (const char *filename, GError **error) { char *contents; gsize len; NodeInfo *nodes; contents = NULL; if (!g_file_get_contents (filename, &contents, &len, error)) return NULL; nodes = description_load_from_string (contents, len, error); g_free (contents); return nodes; } NodeInfo* description_load_from_string (const char *str, int len, GError **error) { XML_Parser expat; ExpatParseContext context; NodeInfo *nodes; g_return_val_if_fail (error == NULL || *error == NULL, NULL); if (len < 0) len = strlen (str); expat = NULL; context.parser = NULL; context.error = error; context.failed = FALSE; expat = XML_ParserCreate_MM ("UTF-8", &memsuite, NULL); if (expat == NULL) g_error ("No memory to create XML parser\n"); context.parser = parser_new (); context.content = g_string_new (NULL); XML_SetUserData (expat, &context); XML_SetElementHandler (expat, expat_StartElementHandler, expat_EndElementHandler); XML_SetCharacterDataHandler (expat, expat_CharacterDataHandler); if (!XML_Parse (expat, str, len, TRUE)) { if (context.error != NULL && *context.error == NULL) { enum XML_Error e; e = XML_GetErrorCode (expat); if (e == XML_ERROR_NO_MEMORY) g_error ("Not enough memory to parse XML document"); else g_set_error (error, G_MARKUP_ERROR, G_MARKUP_ERROR_PARSE, "Error in D-BUS description XML, line %ld, column %ld: %s\n", (gulong)XML_GetCurrentLineNumber (expat), (gulong)XML_GetCurrentColumnNumber (expat), XML_ErrorString (e)); } goto failed; } if (context.failed) goto failed; if (!parser_finished (context.parser, error)) goto failed; XML_ParserFree (expat); g_string_free (context.content, TRUE); g_return_val_if_fail (error == NULL || *error == NULL, NULL); nodes = parser_get_nodes (context.parser); node_info_ref (nodes); parser_unref (context.parser); return nodes; failed: g_return_val_if_fail (error == NULL || *error != NULL, NULL); g_string_free (context.content, TRUE); if (expat) XML_ParserFree (expat); if (context.parser) parser_unref (context.parser); return NULL; } dbus-glib-0.100.2/dbus/dbus-gutils.h0000644000175000017500000000406312107524614014020 00000000000000/* -*- mode: C; c-file-style: "gnu" -*- */ /* dbus-gutils.h Utils shared between convenience lib and installed lib * * Copyright (C) 2003 Red Hat, Inc. * * Licensed under the Academic Free License version 2.1 * * 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 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * */ #ifndef DBUS_GLIB_UTILS_H #define DBUS_GLIB_UTILS_H #include #include G_BEGIN_DECLS char **_dbus_gutils_split_path (const char *path); char *_dbus_gutils_wincaps_to_uscore (const char *uscore); /* These munge the pointer to enforce that a plain cast won't work, * accessor functions must be used; i.e. to ensure the ABI * reflects our encapsulation. */ #define _DBUS_POINTER_SHIFT(p) ((void*) (((char*)p) + sizeof (void*))) #define _DBUS_POINTER_UNSHIFT(p) ((void*) (((char*)p) - sizeof (void*))) #define DBUS_CONNECTION_FROM_G_CONNECTION(x) ((DBusConnection*) _DBUS_POINTER_UNSHIFT(x)) #define DBUS_MESSAGE_FROM_G_MESSAGE(x) ((DBusMessage*) _DBUS_POINTER_UNSHIFT(x)) #define DBUS_PENDING_CALL_FROM_G_PENDING_CALL(x) ((DBusPendingCall*) _DBUS_POINTER_UNSHIFT(x)) #define DBUS_G_CONNECTION_FROM_CONNECTION(x) ((DBusGConnection*) _DBUS_POINTER_SHIFT(x)) #define DBUS_G_MESSAGE_FROM_MESSAGE(x) ((DBusGMessage*) _DBUS_POINTER_SHIFT(x)) #define DBUS_G_PENDING_CALL_FROM_PENDING_CALL(x) ((DBusGPendingCall*) _DBUS_POINTER_SHIFT(x)) G_END_DECLS #endif /* DBUS_GLIB_UTILS_H */ dbus-glib-0.100.2/dbus/dbus-gtest-main.c0000644000175000017500000000246112107524563014557 00000000000000/* -*- mode: C; c-file-style: "gnu" -*- */ /* dbus-gtest-main.c Program to run all libdbus-glib tests * * Copyright (C) 2003 Red Hat Inc. * * Licensed under the Academic Free License version 2.1 * * 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 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * */ #include #ifdef DBUS_BUILD_TESTS #include "dbus-gtest.h" #include #include #include int main (int argc, char **argv) { const char *test_data_dir; setlocale(LC_ALL, ""); if (argc > 1) test_data_dir = argv[1]; else test_data_dir = NULL; dbus_glib_internal_do_not_use_run_tests (test_data_dir); return 0; } #endif dbus-glib-0.100.2/dbus/dbus-gtype-specialized.h0000644000175000017500000002131612107524614016133 00000000000000/* -*- mode: C; c-file-style: "gnu" -*- */ /* dbus-gtype-specialized.h: Non-DBus-specific functions for specialized GTypes * * Copyright (C) 2005 Red Hat, Inc. * * Licensed under the Academic Free License version 2.1 * * 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 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * */ #ifndef DBUS_GOBJECT_TYPE_SPECIALIZED_H #define DBUS_GOBJECT_TYPE_SPECIALIZED_H #include #include G_BEGIN_DECLS GType dbus_g_type_get_collection (const char *container, GType specialization); GType dbus_g_type_get_map (const char *container, GType key_specialization, GType value_specialization); GType dbus_g_type_get_structv (const char *container, guint num_members, GType *types); GType dbus_g_type_get_struct (const char *container, GType first_type, ...); gboolean dbus_g_type_is_collection (GType gtype); gboolean dbus_g_type_is_map (GType gtype); gboolean dbus_g_type_is_struct (GType gtype); GType dbus_g_type_get_collection_specialization (GType gtype); GType dbus_g_type_get_map_key_specialization (GType gtype); GType dbus_g_type_get_map_value_specialization (GType gtype); GType dbus_g_type_get_struct_member_type (GType gtype, guint member); guint dbus_g_type_get_struct_size (GType gtype); typedef void (*DBusGTypeSpecializedCollectionIterator) (const GValue *value, gpointer user_data); typedef void (*DBusGTypeSpecializedMapIterator) (const GValue *key_val, const GValue *value_val, gpointer user_data); gpointer dbus_g_type_specialized_construct (GType gtype); typedef struct { /* public */ GValue *val; GType specialization_type; /*< private >*/ /* padding */ gpointer b; guint c; gpointer d; } DBusGTypeSpecializedAppendContext; void dbus_g_type_specialized_init_append (GValue *value, DBusGTypeSpecializedAppendContext *ctx); void dbus_g_type_specialized_collection_append (DBusGTypeSpecializedAppendContext *ctx, GValue *elt); void dbus_g_type_specialized_collection_end_append (DBusGTypeSpecializedAppendContext *ctx); void dbus_g_type_specialized_map_append (DBusGTypeSpecializedAppendContext *ctx, GValue *key, GValue *val); gboolean dbus_g_type_collection_get_fixed (GValue *value, gpointer *data_ret, guint *len_ret); void dbus_g_type_collection_value_iterate (const GValue *value, DBusGTypeSpecializedCollectionIterator iterator, gpointer user_data); void dbus_g_type_map_value_iterate (const GValue *value, DBusGTypeSpecializedMapIterator iterator, gpointer user_data); gboolean dbus_g_type_struct_get_member (const GValue *value, guint member, GValue *dest); gboolean dbus_g_type_struct_set_member (GValue *value, guint member, const GValue *src); gboolean dbus_g_type_struct_get (const GValue *value, guint member, ...); gboolean dbus_g_type_struct_set (GValue *value, guint member, ...); typedef gpointer (*DBusGTypeSpecializedConstructor) (GType type); typedef void (*DBusGTypeSpecializedFreeFunc) (GType type, gpointer val); typedef gpointer (*DBusGTypeSpecializedCopyFunc) (GType type, gpointer src); typedef struct { DBusGTypeSpecializedConstructor constructor; DBusGTypeSpecializedFreeFunc free_func; DBusGTypeSpecializedCopyFunc copy_func; GDestroyNotify simple_free_func; /* for type-independent freeing if possible */ /**/ gpointer padding2; gpointer padding3; } DBusGTypeSpecializedVtable; typedef gboolean (*DBusGTypeSpecializedCollectionFixedAccessorFunc) (GType type, gpointer instance, gpointer *values, guint *len); typedef void (*DBusGTypeSpecializedCollectionIteratorFunc) (GType type, gpointer instance, DBusGTypeSpecializedCollectionIterator iterator, gpointer user_data); typedef void (*DBusGTypeSpecializedCollectionAppendFunc) (DBusGTypeSpecializedAppendContext *ctx, GValue *val); typedef void (*DBusGTypeSpecializedCollectionEndAppendFunc) (DBusGTypeSpecializedAppendContext *ctx); typedef struct { DBusGTypeSpecializedVtable base_vtable; DBusGTypeSpecializedCollectionFixedAccessorFunc fixed_accessor; DBusGTypeSpecializedCollectionIteratorFunc iterator; DBusGTypeSpecializedCollectionAppendFunc append_func; DBusGTypeSpecializedCollectionEndAppendFunc end_append_func; } DBusGTypeSpecializedCollectionVtable; typedef void (*DBusGTypeSpecializedMapIteratorFunc) (GType type, gpointer instance, DBusGTypeSpecializedMapIterator iterator, gpointer user_data); typedef void (*DBusGTypeSpecializedMapAppendFunc) (DBusGTypeSpecializedAppendContext *ctx, GValue *key, GValue *val); typedef struct { DBusGTypeSpecializedVtable base_vtable; DBusGTypeSpecializedMapIteratorFunc iterator; DBusGTypeSpecializedMapAppendFunc append_func; } DBusGTypeSpecializedMapVtable; typedef gboolean (*DBusGTypeSpecializedStructGetMember) (GType type, gpointer instance, guint member, GValue *ret_value); typedef gboolean (*DBusGTypeSpecializedStructSetMember) (GType type, gpointer instance, guint member, const GValue *new_value); typedef struct { DBusGTypeSpecializedVtable base_vtable; DBusGTypeSpecializedStructGetMember get_member; DBusGTypeSpecializedStructSetMember set_member; } DBusGTypeSpecializedStructVtable; void dbus_g_type_specialized_init (void); void dbus_g_type_register_collection (const char *name, const DBusGTypeSpecializedCollectionVtable *vtable, guint flags); void dbus_g_type_register_map (const char *name, const DBusGTypeSpecializedMapVtable *vtable, guint flags); void dbus_g_type_register_struct (const char *name, const DBusGTypeSpecializedStructVtable *vtable, guint flags); const DBusGTypeSpecializedMapVtable* dbus_g_type_map_peek_vtable (GType map_type); const DBusGTypeSpecializedCollectionVtable* dbus_g_type_collection_peek_vtable (GType collection_type); const DBusGTypeSpecializedStructVtable* dbus_g_type_struct_peek_vtable (GType struct_type); GVariant *dbus_g_value_build_g_variant (const GValue *value); G_END_DECLS #endif dbus-glib-0.100.2/dbus/dbus-glib-tool.c0000644000175000017500000002702612107524614014400 00000000000000/* -*- mode: C; c-file-style: "gnu" -*- */ /* dbus-glib-tool.c Tool used by apps using glib bindings * * Copyright (C) 2003, 2004 Red Hat, Inc. * * Licensed under the Academic Free License version 2.1 * * 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 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * */ #include #include "dbus-gidl.h" #include "dbus-gparser.h" #include "dbus-gutils.h" #include "dbus-glib-tool.h" #include "dbus-binding-tool-glib.h" #include #include #include #include #include #include #include typedef enum { DBUS_BINDING_OUTPUT_NONE, DBUS_BINDING_OUTPUT_PRETTY, DBUS_BINDING_OUTPUT_GLIB_SERVER, DBUS_BINDING_OUTPUT_GLIB_CLIENT } DBusBindingOutputMode; static void indent (int depth) { depth *= 2; /* 2-space indent */ while (depth > 0) { putc (' ', stdout); --depth; } } static void pretty_print (BaseInfo *base, int depth); static void pretty_print_list (GSList *list, int depth) { GSList *tmp; tmp = list; while (tmp != NULL) { pretty_print (tmp->data, depth); tmp = tmp->next; } } static void pretty_print (BaseInfo *base, int depth) { InfoType t; const char *name; t = base_info_get_type (base); name = base_info_get_name (base); indent (depth); switch (t) { case INFO_TYPE_NODE: { NodeInfo *n = (NodeInfo*) base; if (name == NULL) printf (" {\n"); else printf ("node \"%s\" {\n", name); pretty_print_list (node_info_get_interfaces (n), depth + 1); pretty_print_list (node_info_get_nodes (n), depth + 1); indent (depth); printf ("}\n"); } break; case INFO_TYPE_INTERFACE: { InterfaceInfo *i = (InterfaceInfo*) base; GSList *annotations, *elt; g_assert (name != NULL); printf ("interface \"%s\" {\n", name); annotations = interface_info_get_annotations (i); for (elt = annotations; elt; elt = elt->next) { const char *name = elt->data; const char *value = interface_info_get_annotation (i, name); printf (" (binding \"%s\": \"%s\") ", name, value); } g_slist_free (annotations); pretty_print_list (interface_info_get_methods (i), depth + 1); pretty_print_list (interface_info_get_signals (i), depth + 1); pretty_print_list (interface_info_get_properties (i), depth + 1); indent (depth); printf ("}\n"); } break; case INFO_TYPE_METHOD: { MethodInfo *m = (MethodInfo*) base; GSList *annotations, *elt; g_assert (name != NULL); annotations = method_info_get_annotations (m); printf ("method \"%s\" (\n", name); for (elt = annotations; elt; elt = elt->next) { const char *name = elt->data; const char *value = method_info_get_annotation (m, name); printf (" (annotation \"%s\": \"%s\") ", name, value); } g_slist_free (annotations); pretty_print_list (method_info_get_args (m), depth + 1); indent (depth); printf (")\n"); } break; case INFO_TYPE_SIGNAL: { SignalInfo *s = (SignalInfo*) base; g_assert (name != NULL); printf ("signal \"%s\" (\n", name); pretty_print_list (signal_info_get_args (s), depth + 1); indent (depth); printf (")\n"); } break; case INFO_TYPE_PROPERTY: { PropertyInfo *a = (PropertyInfo*) base; const char *pt = property_info_get_type (a); PropertyAccessFlags acc = property_info_get_access (a); printf ("%s%s %s", acc & PROPERTY_READ ? "read" : "", acc & PROPERTY_WRITE ? "write" : "", pt); if (name) printf (" %s\n", name); else printf ("\n"); } break; case INFO_TYPE_ARG: { ArgInfo *a = (ArgInfo*) base; const char *at = arg_info_get_type (a); ArgDirection d = arg_info_get_direction (a); printf ("%s %s", d == ARG_IN ? "in" : "out", at); if (name) printf (" %s\n", name); else printf ("\n"); } break; } } GQuark dbus_binding_tool_error_quark (void) { static GQuark quark = 0; if (!quark) quark = g_quark_from_static_string ("dbus_binding_tool_error"); return quark; } static void warn (const char *fmt, ...) G_GNUC_PRINTF (1, 2); static void warn_gerror (const char *prefix, GError *error); static void warn (const char *str, ...) { va_list args; va_start (args, str); vfprintf (stderr, str, args); fputc ('\n', stderr); va_end (args); } static void warn_gerror (const char *prefix, GError *error) { warn ("%s: %s", prefix, error->message); } static void usage (int ecode) { fprintf (stderr, "dbus-binding-tool [--version] [--help]\n"); fprintf (stderr, "dbus-binding-tool --mode=[pretty|glib-server|glib-client] [--prefix=SYMBOL_PREFIX] [--ignore-unsupported] [--force] [--output=FILE]\n"); fprintf (stderr, "dbus-binding-tool --mode=glib-server --prefix=SYMBOL_PREFIX [--ignore-unsupported] [--force] [--output=FILE]\n"); exit (ecode); } static void version (void) { printf ("D-BUS Binding Tool %s\n" "Copyright (C) 2003-2005 Red Hat, Inc.\n" "This is free software; see the source for copying conditions.\n" "There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n", VERSION); exit (0); } int main (int argc, char **argv) { const char *output_file; const char *prefix; char *output_file_tmp = NULL; int i; GSList *files; DBusBindingOutputMode outputmode; gboolean end_of_args; GSList *tmp; GIOChannel *channel = NULL; GError *error; time_t newest_src; struct stat srcbuf; struct stat targetbuf; gboolean force; gboolean ignore_unsupported; gboolean has_prefix = FALSE; g_type_init (); outputmode = DBUS_BINDING_OUTPUT_NONE; end_of_args = FALSE; files = NULL; output_file = NULL; prefix = ""; ignore_unsupported = FALSE; force = FALSE; i = 1; while (i < argc) { const char *arg = argv[i]; if (!end_of_args) { if (strcmp (arg, "--help") == 0 || strcmp (arg, "-h") == 0 || strcmp (arg, "-?") == 0) usage (0); else if (strcmp (arg, "--version") == 0) version (); else if (strcmp (arg, "--force") == 0) force = TRUE; else if (strncmp (arg, "--mode=", 7) == 0) { const char *mode = arg + 7; if (!strcmp (mode, "pretty")) outputmode = DBUS_BINDING_OUTPUT_PRETTY; else if (!strcmp (mode, "glib-server")) outputmode = DBUS_BINDING_OUTPUT_GLIB_SERVER; else if (!strcmp (mode, "glib-client")) outputmode = DBUS_BINDING_OUTPUT_GLIB_CLIENT; else usage (1); } else if (strcmp (arg, "--ignore-unsupported") == 0) ignore_unsupported = TRUE; else if (strncmp (arg, "--output=", 9) == 0) { output_file = arg + 9; } else if (strncmp (arg, "--prefix=", 9) == 0) { has_prefix = TRUE; prefix = arg + 9; } else if (arg[0] == '-' && arg[1] == '-' && arg[2] == '\0') end_of_args = TRUE; else if (arg[0] == '-') { usage (1); } else { files = g_slist_prepend (files, (char*) arg); } } else files = g_slist_prepend (files, (char*) arg); ++i; } if (outputmode == DBUS_BINDING_OUTPUT_GLIB_SERVER && !has_prefix) usage (1); error = NULL; files = g_slist_reverse (files); if (output_file && !force) { newest_src = 0; for (tmp = files; tmp != NULL; tmp = tmp->next) { const char *filename; filename = tmp->data; if (stat (filename, &srcbuf) < 0) { warn ("Couldn't stat %s: %s", filename, g_strerror (errno)); goto lose; } if (srcbuf.st_mtime > newest_src) newest_src = srcbuf.st_mtime; } if (stat (output_file, &targetbuf) > 0 && targetbuf.st_mtime >= newest_src) exit (0); } if (output_file) { output_file_tmp = g_strconcat (output_file, ".tmp", NULL); if (!(channel = g_io_channel_new_file (output_file_tmp, "w", &error))) { warn_gerror ("Couldn't open temporary file", error); goto lose; } } else { channel = g_io_channel_unix_new (fileno (stdout)); } if (!g_io_channel_set_encoding (channel, NULL, &error)) { warn_gerror ("Couldn't set channel encoding to NULL", error); goto lose; } for (tmp = files; tmp != NULL; tmp = tmp->next) { NodeInfo *node; GError *error; const char *filename; filename = tmp->data; error = NULL; node = description_load_from_file (filename, &error); if (node == NULL) { warn ("Unable to load \"%s\": %s", filename, error->message); goto lose; } else { switch (outputmode) { case DBUS_BINDING_OUTPUT_PRETTY: pretty_print ((BaseInfo*) node, 0); break; case DBUS_BINDING_OUTPUT_GLIB_SERVER: if (!dbus_binding_tool_output_glib_server ((BaseInfo *) node, channel, prefix, &error)) { warn_gerror ("Compilation failed", error); node_info_unref (node); goto lose; } break; case DBUS_BINDING_OUTPUT_GLIB_CLIENT: if (!dbus_binding_tool_output_glib_client ((BaseInfo *) node, channel, ignore_unsupported, &error)) { warn_gerror ("Compilation failed", error); node_info_unref (node); goto lose; } break; case DBUS_BINDING_OUTPUT_NONE: break; } } if (node) node_info_unref (node); } if (g_io_channel_shutdown (channel, TRUE, &error) != G_IO_STATUS_NORMAL) { warn_gerror ("Failed to shutdown IO channel", error); goto lose; } g_io_channel_unref (channel); channel = NULL; if (output_file) { if (rename (output_file_tmp, output_file) < 0) { warn ("Failed to rename %s to %s: %s", output_file_tmp, output_file, g_strerror (errno)); goto lose; } g_free (output_file_tmp); } return 0; lose: /* ignore errors, we're already handling an error */ if (channel != NULL) { (void) g_io_channel_shutdown (channel, FALSE, NULL); g_io_channel_unref (channel); } if (output_file_tmp != NULL) (void) g_remove (output_file_tmp); g_free (output_file_tmp); return 1; } dbus-glib-0.100.2/dbus/dbus-bash-completion-helper.c0000644000175000017500000003553212107524614017052 00000000000000/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ /* dbus-bash-completion-helper.c Bash Completion helper routines * * Copyright (C) 2008 David Zeuthen * * 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 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * */ #include #include #include #include #include #include #include #include "dbus-gparser.h" static void print_services (DBusConnection *connection) { DBusMessage *message; DBusMessage *reply; DBusError error; DBusMessageIter iter; DBusMessageIter iter_array; const char *name; /* list both active and activatable names (the shell will sort and * uniquify them) - also avoid names that are not well-known * (e.g. :1.42). */ message = dbus_message_new_method_call (DBUS_SERVICE_DBUS, DBUS_PATH_DBUS, DBUS_INTERFACE_DBUS, "ListNames"); dbus_error_init (&error); reply = dbus_connection_send_with_reply_and_block (connection, message, -1, &error); dbus_message_unref (message); dbus_message_iter_init (reply, &iter); dbus_message_iter_recurse (&iter, &iter_array); while (dbus_message_iter_get_arg_type (&iter_array) != DBUS_TYPE_INVALID) { dbus_message_iter_get_basic (&iter_array, &name); if (name[0] != ':') printf ("%s \n", name); dbus_message_iter_next (&iter_array); } dbus_message_unref (reply); message = dbus_message_new_method_call (DBUS_SERVICE_DBUS, DBUS_PATH_DBUS, DBUS_INTERFACE_DBUS, "ListActivatableNames"); dbus_error_init (&error); reply = dbus_connection_send_with_reply_and_block (connection, message, -1, &error); dbus_message_unref (message); dbus_message_iter_init (reply, &iter); dbus_message_iter_recurse (&iter, &iter_array); while (dbus_message_iter_get_arg_type (&iter_array) != DBUS_TYPE_INVALID) { dbus_message_iter_get_basic (&iter_array, &name); printf ("%s \n", name); dbus_message_iter_next (&iter_array); } dbus_message_unref (reply); } static gboolean have_option (char **tokens, const char *option) { int n; for (n = 0; tokens[n] != NULL; n++) if (strcmp (tokens[n], option) == 0) return TRUE; return FALSE; } static gboolean have_option_with_value (char **tokens, const char *option, const char **value) { int n; for (n = 0; tokens[n] != NULL; n++) { if (g_str_has_prefix (tokens[n], option)) { if (strlen (tokens[n]) > strlen (option)) *value = tokens[n] + strlen (option); return TRUE; } } return FALSE; } static void print_objects (DBusConnection *connection, const char *service_name, const char *cur) { DBusMessage *message; DBusMessage *reply; DBusError error; DBusMessageIter iter; const char *introspection_xml; NodeInfo *root; GSList *nodes; GSList *l; if (cur == NULL) cur = "/"; message = dbus_message_new_method_call (service_name, cur, DBUS_INTERFACE_INTROSPECTABLE, "Introspect"); dbus_error_init (&error); reply = dbus_connection_send_with_reply_and_block (connection, message, -1, &error); dbus_message_unref (message); dbus_message_iter_init (reply, &iter); dbus_message_iter_get_basic (&iter, &introspection_xml); root = description_load_from_string (introspection_xml, strlen (introspection_xml), NULL); nodes = node_info_get_nodes (root); if (g_slist_length (node_info_get_interfaces (root)) > 0) printf ("%s \n", cur); for (l = nodes; l != NULL; l = l->next) { NodeInfo *node = (NodeInfo *) l->data; const char *name; char *new_path; name = node_info_get_name (node); if (strcmp (cur, "/") == 0) new_path = g_strdup_printf ("/%s", name); else new_path = g_strdup_printf ("%s/%s", cur, name); print_objects (connection, service_name, new_path); g_free (new_path); } node_info_unref (root); dbus_message_unref (reply); } static gboolean is_object_path_with_interfaces (DBusConnection *connection, const char *service_name, const char *object_path) { DBusMessage *message; DBusMessage *reply; DBusError error; DBusMessageIter iter; const char *introspection_xml; NodeInfo *root; gboolean ret; ret = FALSE; message = dbus_message_new_method_call (service_name, object_path, DBUS_INTERFACE_INTROSPECTABLE, "Introspect"); dbus_error_init (&error); reply = dbus_connection_send_with_reply_and_block (connection, message, -1, &error); dbus_message_unref (message); dbus_message_iter_init (reply, &iter); dbus_message_iter_get_basic (&iter, &introspection_xml); root = description_load_from_string (introspection_xml, strlen (introspection_xml), NULL); if (g_slist_length (node_info_get_interfaces (root)) > 0) ret = TRUE; node_info_unref (root); dbus_message_unref (reply); return ret; } static void print_methods (DBusConnection *connection, const char *service_name, const char *object_path) { DBusMessage *message; DBusMessage *reply; DBusError error; DBusMessageIter iter; const char *introspection_xml; NodeInfo *root; GSList *interfaces; GSList *l; message = dbus_message_new_method_call (service_name, object_path, DBUS_INTERFACE_INTROSPECTABLE, "Introspect"); dbus_error_init (&error); reply = dbus_connection_send_with_reply_and_block (connection, message, -1, &error); dbus_message_unref (message); dbus_message_iter_init (reply, &iter); dbus_message_iter_get_basic (&iter, &introspection_xml); root = description_load_from_string (introspection_xml, strlen (introspection_xml), NULL); interfaces = node_info_get_interfaces (root); for (l = interfaces; l != NULL; l = l->next) { InterfaceInfo *interface = (InterfaceInfo *) l->data; GSList *methods; GSList *ll; methods = interface_info_get_methods (interface); for (ll = methods; ll != NULL; ll = ll->next) { MethodInfo *method = (MethodInfo *) ll->data; printf ("%s.%s \n", interface_info_get_name (interface), method_info_get_name (method)); } } node_info_unref (root); dbus_message_unref (reply); } static void print_signature (DBusConnection *connection, const char *service_name, const char *object_path, const char *method) { DBusMessage *message; DBusMessage *reply; DBusError error; DBusMessageIter iter; const char *introspection_xml; NodeInfo *root; GSList *interfaces; GSList *l; char *s; char *method_name; char *interface_name; int n; method_name = NULL; interface_name = NULL; s = strrchr (method, '.'); if (s == NULL || strlen (s) < 2 || s - method < 1) goto fail; method_name = g_strdup (s + 1); interface_name = g_strndup (method, s - method); printf (" \n"); message = dbus_message_new_method_call (service_name, object_path, DBUS_INTERFACE_INTROSPECTABLE, "Introspect"); dbus_error_init (&error); reply = dbus_connection_send_with_reply_and_block (connection, message, -1, &error); dbus_message_unref (message); dbus_message_iter_init (reply, &iter); dbus_message_iter_get_basic (&iter, &introspection_xml); root = description_load_from_string (introspection_xml, strlen (introspection_xml), NULL); interfaces = node_info_get_interfaces (root); for (l = interfaces; l != NULL; l = l->next) { InterfaceInfo *interface = (InterfaceInfo *) l->data; if (strcmp (interface_name, interface_info_get_name (interface)) == 0) { GSList *methods; GSList *ll; methods = interface_info_get_methods (interface); for (ll = methods; ll != NULL; ll = ll->next) { MethodInfo *method = (MethodInfo *) ll->data; if (strcmp (method_name, method_info_get_name (method)) == 0) { GSList *args; GSList *lll; args = method_info_get_args (method); for (lll = args, n = 0; lll != NULL; lll = lll->next, n++) { ArgInfo *arg = (ArgInfo *) lll->data; printf ("# %s: arg %d: %s (%s) \n", arg_info_get_direction (arg) == ARG_IN ? " IN" : "OUT", n, arg_info_get_name (arg), arg_info_get_type (arg)); } break; } } } } node_info_unref (root); dbus_message_unref (reply); fail: g_free (method_name); g_free (interface_name); } static int complete_dbus_send (char *str) { int ret; char **tokens; int num_tokens; const char *cur; gboolean have_system; gboolean have_session; gboolean have_print_reply; gboolean have_dest; DBusConnection *connection; DBusBusType bus_type; DBusError error; const char *target_service; const char *object_path; const char *method; int n; int object_path_index; ret = 1; connection = NULL; target_service = NULL; tokens = g_strsplit (str, " ", 0); num_tokens = g_strv_length (tokens); if (num_tokens >= 1) { cur = tokens[num_tokens - 1]; } else { cur = ""; } have_system = have_option (tokens, "--system"); have_session = have_option (tokens, "--session"); have_print_reply = have_option (tokens, "--print-reply"); have_dest = have_option_with_value (tokens, "--dest=", &target_service); if (!have_print_reply) printf ("--print-reply \n"); if (!have_system && !have_session) { printf ("--system \n"); printf ("--session \n"); goto done; } if (!have_dest && !g_str_has_prefix (cur, "--dest=")) { printf ("--dest=\n"); goto done; } if (have_system || have_session) { bus_type = have_system ? DBUS_BUS_SYSTEM : DBUS_BUS_SESSION; dbus_error_init (&error); connection = dbus_bus_get (bus_type, &error); if (connection == NULL) { fprintf (stderr, "Failed to open connection to %s message bus: %s: %s\n", (bus_type == DBUS_BUS_SYSTEM) ? "system" : "session", error.name, error.message); dbus_error_free (&error); goto fail; } } if (connection != NULL && g_str_has_prefix (cur, "--dest=")) { print_services (connection); goto done; } /* see if we have an object path */ object_path = NULL; object_path_index = 0; if (connection != NULL && target_service != NULL) { for (n = 0; tokens[n] != NULL; n++) { if (tokens[n] == cur) continue; if (*(tokens[n]) == '/') { if (is_object_path_with_interfaces (connection, target_service, tokens[n])) { object_path = tokens[n]; object_path_index = n; } } } } /* if we have a connection and a destination but no object path, go ahead and list the object paths */ if (connection != NULL && target_service != NULL && object_path == NULL) { print_objects (connection, target_service, NULL); goto done; } /* see if we have a method; it's directly after the object_path */ method = NULL; if (connection != NULL && target_service != NULL && object_path != NULL) { if ((object_path_index + 1 < num_tokens - 1) && (strlen (tokens[object_path_index + 1]) > 0) && !(strcmp (cur, tokens[object_path_index + 1]) == 0)) method = tokens[object_path_index + 1]; } /* if we have connection, destination and object path but no method yet, list the methods */ if (connection != NULL && target_service != NULL && object_path != NULL && method == NULL) { print_methods (connection, target_service, object_path); goto done; } /* print signature as comment */ if (connection != NULL && target_service != NULL && object_path != NULL && method != NULL) { print_signature (connection, target_service, object_path, method); } done: ret = 0; fail: g_strfreev (tokens); if (connection != NULL) dbus_connection_unref (connection); return ret; } int main (int argc, char *argv[]) { int ret; char *cur; gboolean dbus_send; ret = 1; dbus_send = FALSE; if (argc != 3) { fprintf (stderr, "invalid use\n"); goto out; } if (strcmp (argv[1], "dbus-send") == 0) { dbus_send = TRUE; } else { fprintf (stderr, "unknown program '%s'\n", argv[1]); goto out; } if (strlen (argv[2]) < strlen (argv[1]) + 1) { fprintf (stderr, "error"); goto out; } cur = argv[2] + strlen (argv[1]) + 1; if (dbus_send) ret = complete_dbus_send (cur); out: return ret; } dbus-glib-0.100.2/configure0000755000175000017500000160150112112653376012364 00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69 for dbus-glib 0.100.2. # # Report bugs to . # # # 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 \$(( 1 + 1 )) = 2 || 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" 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 and $0: https://bugs.freedesktop.org/enter_bug.cgi?product=dbus&component=GLib $0: about your system, including any error possibly output $0: before this message. Then install a modern shell, or $0: manually run the script under such a shell if you do $0: 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='dbus-glib' PACKAGE_TARNAME='dbus-glib' PACKAGE_VERSION='0.100.2' PACKAGE_STRING='dbus-glib 0.100.2' PACKAGE_BUGREPORT='https://bugs.freedesktop.org/enter_bug.cgi?product=dbus&component=GLib' PACKAGE_URL='' # 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 TEST_SOCKET_DIR ABSOLUTE_TOP_BUILDDIR TEST_SLEEP_FOREVER_BINARY TEST_SEGFAULT_BINARY TEST_EXIT_BINARY TEST_INTERFACES_SERVICE_BINARY TEST_CORE_SERVICE_BINARY TEST_SHELL_SERVICE_BINARY TEST_SERVICE_BINARY TEST_SERVICE_DIR EXPANDED_DATADIR EXPANDED_LIBDIR EXPANDED_BINDIR EXPANDED_SYSCONFDIR EXPANDED_LOCALSTATEDIR 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 GTKDOC_DEPS_LIBS GTKDOC_DEPS_CFLAGS HTML_DIR GTKDOC_MKPDF GTKDOC_REBASE GTKDOC_CHECK DBUS_GLIB_TOOL_LIBS DBUS_GLIB_TOOL_CFLAGS GLIB_GENMARSHAL HAVE_GLIB_THREADS_FALSE HAVE_GLIB_THREADS_TRUE DBUS_GLIB_THREADS_LIBS DBUS_GLIB_THREADS_CFLAGS DBUS_GLIB_LIBS DBUS_GLIB_CFLAGS DBUS_LIBS DBUS_CFLAGS PKG_CONFIG_LIBDIR PKG_CONFIG_PATH PKG_CONFIG DBUS_PATH_OR_ABSTRACT OTOOL64 OTOOL LIPO NMEDIT DSYMUTIL MANIFEST_TOOL RANLIB ac_ct_AR AR DLLTOOL OBJDUMP LN_S NM ac_ct_DUMPBIN DUMPBIN LD FGREP SED LIBTOOL DBUS_BUILD_TESTS_FALSE DBUS_BUILD_TESTS_TRUE DBUS_BINDING_TOOL DBUS_BASH_COMPLETION_FALSE DBUS_BASH_COMPLETION_TRUE EGREP GREP 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 LT_AGE LT_REVISION LT_CURRENT AM_BACKSLASH AM_DEFAULT_VERBOSITY AM_DEFAULT_V AM_V MAINT MAINTAINER_MODE_FALSE MAINTAINER_MODE_TRUE 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 host_os host_vendor host_cpu host build_os build_vendor build_cpu build 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_maintainer_mode enable_silent_rules enable_dependency_tracking enable_tests enable_ansi enable_verbose_mode enable_asserts enable_checks enable_gcov enable_bash_completion with_test_socket_dir with_introspect_xml with_dbus_binding_tool enable_shared enable_static with_pic enable_fast_install with_gnu_ld with_sysroot enable_libtool_lock with_html_dir enable_gtk_doc enable_gtk_doc_html enable_gtk_doc_pdf ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP PKG_CONFIG PKG_CONFIG_PATH PKG_CONFIG_LIBDIR DBUS_CFLAGS DBUS_LIBS DBUS_GLIB_CFLAGS DBUS_GLIB_LIBS DBUS_GLIB_THREADS_CFLAGS DBUS_GLIB_THREADS_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 dbus-glib 0.100.2 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/dbus-glib] --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 dbus-glib 0.100.2:";; 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-maintainer-mode enable make rules and dependencies not useful (and sometimes confusing) to the casual installer --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-tests enable unit test code --enable-ansi enable -ansi -pedantic gcc flags --enable-verbose-mode support verbose debug mode --enable-asserts include assertion checks --enable-checks include sanity checks on public API --enable-gcov compile with coverage profiling instrumentation (gcc only) --enable-bash-completion install bash completion scripts --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) --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]] Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-test-socket-dir=dirname Where to put sockets for make check --with-introspect-xml=filename Pass in a pregenerated dbus daemon introspection xml file (as generated by 'dbus-daemon --introspect') to use instead of querying the installed dbus daemon --with-dbus-binding-tool=filename Use external dbus-binding-tool program --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use both] --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-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 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 DBUS_CFLAGS C compiler flags for DBUS, overriding pkg-config DBUS_LIBS linker flags for DBUS, overriding pkg-config DBUS_GLIB_CFLAGS C compiler flags for DBUS_GLIB, overriding pkg-config DBUS_GLIB_LIBS linker flags for DBUS_GLIB, overriding pkg-config DBUS_GLIB_THREADS_CFLAGS C compiler flags for DBUS_GLIB_THREADS, overriding pkg-config DBUS_GLIB_THREADS_LIBS linker flags for DBUS_GLIB_THREADS, 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 . _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 dbus-glib configure 0.100.2 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_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_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_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_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_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_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;} ( $as_echo "## ------------------------------------------------------------------------------------- ## ## Report this to https://bugs.freedesktop.org/enter_bug.cgi?product=dbus&component=GLib ## ## ------------------------------------------------------------------------------------- ##" ) | sed "s/^/$as_me: WARNING: /" >&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 dbus-glib $as_me 0.100.2, 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 "$srcdir" "$srcdir/.." "$srcdir/../.."; 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 \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$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. # 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 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='dbus-glib' VERSION='0.100.2' 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}' am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' ac_config_headers="$ac_config_headers config.h" # Honor aclocal flags ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS" ## must come before we use the $USE_MAINTAINER_MODE variable later { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5 $as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; } # Check whether --enable-maintainer-mode was given. if test "${enable_maintainer_mode+set}" = set; then : enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval else USE_MAINTAINER_MODE=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5 $as_echo "$USE_MAINTAINER_MODE" >&6; } if test $USE_MAINTAINER_MODE = yes; then MAINTAINER_MODE_TRUE= MAINTAINER_MODE_FALSE='#' else MAINTAINER_MODE_TRUE='#' MAINTAINER_MODE_FALSE= fi MAINT=$MAINTAINER_MODE_TRUE # 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=0;; 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='\' # libtool versioning - this applies to libdbus # # See http://sources.redhat.com/autobook/autobook/autobook_91.html#SEC91 for details # ## increment if the interface has additions, changes, removals. LT_CURRENT=4 ## increment any time the source changes; set to ## 0 if you increment CURRENT LT_REVISION=2 ## increment if any interfaces have been added; set to 0 ## if any interfaces have been changed or removed. removal has ## precedence over adding, so set to 0 if both happened. LT_AGE=2 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing strerror" >&5 $as_echo_n "checking for library containing strerror... " >&6; } if ${ac_cv_search_strerror+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$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 strerror (); int main () { return strerror (); ; return 0; } _ACEOF for ac_lib in '' cposix; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_strerror=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_strerror+:} false; then : break fi done if ${ac_cv_search_strerror+:} false; then : else ac_cv_search_strerror=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_strerror" >&5 $as_echo "$ac_cv_search_strerror" >&6; } ac_res=$ac_cv_search_strerror if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" 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 { $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 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 # Check whether --enable-tests was given. if test "${enable_tests+set}" = set; then : enableval=$enable_tests; enable_tests=$enableval else enable_tests=$USE_MAINTAINER_MODE fi # Check whether --enable-ansi was given. if test "${enable_ansi+set}" = set; then : enableval=$enable_ansi; enable_ansi=$enableval else enable_ansi=no fi # Check whether --enable-verbose-mode was given. if test "${enable_verbose_mode+set}" = set; then : enableval=$enable_verbose_mode; enable_verbose_mode=$enableval else enable_verbose_mode=$USE_MAINTAINER_MODE fi # Check whether --enable-asserts was given. if test "${enable_asserts+set}" = set; then : enableval=$enable_asserts; enable_asserts=$enableval else enable_asserts=$USE_MAINTAINER_MODE fi # Check whether --enable-checks was given. if test "${enable_checks+set}" = set; then : enableval=$enable_checks; enable_checks=$enableval else enable_checks=yes fi # Check whether --enable-gcov was given. if test "${enable_gcov+set}" = set; then : enableval=$enable_gcov; enable_gcov=$enableval else enable_gcov=no fi # Check whether --enable-bash-completion was given. if test "${enable_bash_completion+set}" = set; then : enableval=$enable_bash_completion; enable_bash_completion=$enableval else enable_bash_completion=yes fi # Check whether --with-test-socket-dir was given. if test "${with_test_socket_dir+set}" = set; then : withval=$with_test_socket_dir; fi # Check whether --with-introspect-xml was given. if test "${with_introspect_xml+set}" = set; then : withval=$with_introspect_xml; fi if test x$enable_bash_completion = xyes; then DBUS_BASH_COMPLETION_TRUE= DBUS_BASH_COMPLETION_FALSE='#' else DBUS_BASH_COMPLETION_TRUE='#' DBUS_BASH_COMPLETION_FALSE= fi if test x$enable_bash_completion = xyes; then $as_echo "#define DBUS_BASH_COMPLETION 1" >>confdefs.h fi if test x$enable_verbose_mode = xyes; then $as_echo "#define DBUS_ENABLE_VERBOSE_MODE 1" >>confdefs.h fi # Check whether --with-dbus-binding-tool was given. if test "${with_dbus_binding_tool+set}" = set; then : withval=$with_dbus_binding_tool; DBUS_BINDING_TOOL=$withval else DBUS_BINDING_TOOL=\$\(top_builddir\)/dbus/dbus-binding-tool fi if test x$enable_tests = xyes; then DBUS_BUILD_TESTS_TRUE= DBUS_BUILD_TESTS_FALSE='#' else DBUS_BUILD_TESTS_TRUE='#' DBUS_BUILD_TESTS_FALSE= fi if test x$enable_tests = xyes; then $as_echo "#define DBUS_BUILD_TESTS 1" >>confdefs.h fi if test x$enable_verbose_mode = xyes; then $as_echo "#define DBUS_ENABLE_VERBOSE_MODE 1" >>confdefs.h fi if test x$enable_asserts = xno; then $as_echo "#define DBUS_DISABLE_ASSERT 1" >>confdefs.h $as_echo "#define G_DISABLE_ASSERT 1" >>confdefs.h fi if test x$enable_checks = xno; then $as_echo "#define DBUS_DISABLE_CHECKS 1" >>confdefs.h $as_echo "#define G_DISABLE_CHECKS 1" >>confdefs.h fi #### gcc warning flags if test "x$GCC" = "xyes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether gcc understands -Wfloat-equal" >&5 $as_echo_n "checking whether gcc understands -Wfloat-equal... " >&6; } ac_save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -Wfloat-equal" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cc_flag=yes else ac_cc_flag=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CFLAGS="$ac_save_CFLAGS" if test "x$ac_cc_flag" = "xyes"; then ac_flag_float_equal=yes else ac_flag_float_equal=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cc_flag" >&5 $as_echo "$ac_cc_flag" >&6; } case " $CFLAGS " in *[\ \ ]-Wall[\ \ ]*) ;; *) CFLAGS="$CFLAGS -Wall" ;; esac case " $CFLAGS " in *[\ \ ]-Wchar-subscripts[\ \ ]*) ;; *) CFLAGS="$CFLAGS -Wchar-subscripts" ;; esac case " $CFLAGS " in *[\ \ ]-Wmissing-declarations[\ \ ]*) ;; *) CFLAGS="$CFLAGS -Wmissing-declarations" ;; esac case " $CFLAGS " in *[\ \ ]-Wmissing-prototypes[\ \ ]*) ;; *) CFLAGS="$CFLAGS -Wmissing-prototypes" ;; esac case " $CFLAGS " in *[\ \ ]-Wnested-externs[\ \ ]*) ;; *) CFLAGS="$CFLAGS -Wnested-externs" ;; esac case " $CFLAGS " in *[\ \ ]-Wpointer-arith[\ \ ]*) ;; *) CFLAGS="$CFLAGS -Wpointer-arith" ;; esac case " $CFLAGS " in *[\ \ ]-Wcast-align[\ \ ]*) ;; *) CFLAGS="$CFLAGS -Wcast-align" ;; esac if test "x$ac_flag_float_equal" = "xyes"; then case " $CFLAGS " in *[\ \ ]-Wfloat-equal[\ \ ]*) ;; *) CFLAGS="$CFLAGS -Wfloat-equal" ;; esac fi case " $CFLAGS " in *[\ \ ]-Wsign-compare[\ \ ]*) ;; *) CFLAGS="$CFLAGS -Wsign-compare" ;; esac # This one is special - it's not a warning override. # http://bugs.freedesktop.org/show_bug.cgi?id=10599 # is the bug for DBus core. case " $CFLAGS " in *[\ \ ]-fno-strict-aliasing[\ \ ]*) ;; *) CFLAGS="$CFLAGS -fno-strict-aliasing" ;; esac if test "x$enable_ansi" = "xyes"; then case " $CFLAGS " in *[\ \ ]-ansi[\ \ ]*) ;; *) CFLAGS="$CFLAGS -ansi" ;; esac case " $CFLAGS " in *[\ \ ]-D_POSIX_C_SOURCE*) ;; *) CFLAGS="$CFLAGS -D_POSIX_C_SOURCE=199309L" ;; esac case " $CFLAGS " in *[\ \ ]-D_BSD_SOURCE[\ \ ]*) ;; *) CFLAGS="$CFLAGS -D_BSD_SOURCE" ;; esac case " $CFLAGS " in *[\ \ ]-pedantic[\ \ ]*) ;; *) CFLAGS="$CFLAGS -pedantic" ;; esac fi if test x$enable_gcov = xyes; then case " $CFLAGS " in *[\ \ ]-fprofile-arcs[\ \ ]*) ;; *) CFLAGS="$CFLAGS -fprofile-arcs" ;; esac case " $CFLAGS " in *[\ \ ]-ftest-coverage[\ \ ]*) ;; *) CFLAGS="$CFLAGS -ftest-coverage" ;; esac ## remove optimization CFLAGS=`echo "$CFLAGS" | sed -e 's/-O[0-9]*//g'` fi else if test x$enable_gcov = xyes; then as_fn_error $? "--enable-gcov can only be used with gcc" "$LINENO" 5 fi 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.2' macro_revision='1.3337' 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 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 "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no fi ac_prog=ld if test "$GCC" = yes; 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 "$with_gnu_ld" = yes; 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 case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in */dev/null* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break ;; *) 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 "$lt_cv_path_NM" != "no"; 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 /dev/null 2>&1 | sed '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols" ;; *) 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; ;; netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) # 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 $i != 17 # 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"} { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5 $as_echo_n "checking whether the shell understands some XSI constructs... " >&6; } # Try some XSI features xsi_shell=no ( _lt_dummy="a/b/c" test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ = c,a/b,b/c, \ && eval 'test $(( 1 + 1 )) -eq 2 \ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ && xsi_shell=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsi_shell" >&5 $as_echo "$xsi_shell" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5 $as_echo_n "checking whether the shell understands \"+=\"... " >&6; } lt_shell_append=no ( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \ >/dev/null 2>&1 \ && lt_shell_append=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5 $as_echo "$lt_shell_append" >&6; } 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 "$GCC" != yes; then reload_cmds=false fi ;; darwin*) if test "$GCC" = yes; 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 # which 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. # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin. if ( test "$lt_cv_nm_interface" = "BSD nm" && 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* | netbsdelf*-gnu) 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*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; 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 ;; 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 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 "$ac_status" -eq 0; 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 "$ac_status" -ne 0; 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 "x$lt_cv_ar_at_file" = xno; 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 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 "$host_cpu" = ia64; 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 # 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 -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$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 -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'" lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/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 # and D for any global 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};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ " {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ " s[1]~/^[@?]/{print s[1], s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print 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 con'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* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$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 "$pipe_works" = yes; 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 "$GCC" = yes; 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; } # Check whether --enable-libtool-lock was given. if test "${enable_libtool_lock+set}" = set; then : enableval=$enable_libtool_lock; fi test "x$enable_libtool_lock" != xno && 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 which ABI we are using. 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 which ABI we are using. 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 "$lt_cv_prog_gnu_ld" = yes; 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* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out which ABI we are using. 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 ;; ppc64-*linux*|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" ;; ppc*-*linux*|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 x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; *-*solaris*) # Find out which ABI we are using. 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*) 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 "x$lt_cv_path_mainfest_tool" != xyes; 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 $_lt_result -eq 0; 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 $_lt_result -eq 0 && $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 "$lt_cv_apple_cc_single_mod" = "yes"; then _lt_dar_single_mod='$single_module' fi if test "$lt_cv_ld_exported_symbols_list" = "yes"; 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 "$lt_cv_ld_force_load" = "no"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac # 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 # 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 test -z "$pic_mode" && pic_mode=default # 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 # 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 "X${COLLECT_NAMES+set}" != Xset; 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 for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` # 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 "$GCC" = yes; 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" # 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 x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; 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 "$GCC" = yes; then lt_prog_compiler_wl='-Wl,' lt_prog_compiler_static='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' fi ;; 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' ;; 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 "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' else lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' fi ;; 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' ;; 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' ;; 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 which 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" # 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 x"$lt_cv_prog_compiler_pic_works" = xyes; 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 x"$lt_cv_prog_compiler_static_works" = xyes; 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 "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; 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 "$hard_links" = no; 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 "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; linux* | k*bsd*-gnu | gnu*) link_all_deplibs=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 "$with_gnu_ld" = yes; 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 "$lt_use_gnu_ld_interface" = yes; 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 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 "$host_cpu" != ia64; 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 (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; 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 ;; 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 "$host_os" = linux-dietlibc; 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 "$tmp_diet" = no 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' ;; 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 "x$supports_anon_versioning" = xyes; 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 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 "x$supports_anon_versioning" = xyes; 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* | netbsdelf*-gnu) 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 can not *** 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 "$ld_shlibs" = no; 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 "$GCC" = yes && 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 "$host_cpu" = ia64; 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 AIX nm, but means don't demangle with GNU nm # Also, AIX nm treats weak defined symbols like other global # defined symbols, whereas GNU nm marks them as "W". 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) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | 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 # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; 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,' if test "$GCC" = yes; 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 "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi link_all_deplibs=no else # not using gcc if test "$host_cpu" = ia64; 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 "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi 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_use_runtimelinking" = yes; 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 "${lt_cv_aix_libpath+set}" = 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 "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; 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 "${lt_cv_aix_libpath+set}" = 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 "$with_gnu_ld" = yes; 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 # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' 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~linknames=' archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; else sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $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 "$lt_cv_ld_force_load" = "yes"; 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*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; 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 "$GCC" = yes; 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 $output_objdir/$soname = $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 $output_objdir/$soname = $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 "$GCC" = yes && test "$with_gnu_ld" = no; 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 "$with_gnu_ld" = no; 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 "$GCC" = yes && test "$with_gnu_ld" = no; 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 x"$lt_cv_prog_compiler__b" = xyes; 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 "$with_gnu_ld" = no; 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 "$GCC" = yes; 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 "$lt_cv_irix_exported_symbol" = yes; 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 ;; netbsd* | netbsdelf*-gnu) 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*) 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__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; 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 case $host_os in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-R$libdir' ;; *) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' ;; esac fi else ld_shlibs=no fi ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; 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 "$GCC" = yes; 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 "$GCC" = yes; 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 "$GCC" = yes; 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 "x$host_vendor" = xsequent; 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 "$GCC" = yes; 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 can NOT 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 "$GCC" = yes; 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 x$host_vendor = xsni; 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 "$ld_shlibs" = no && 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 "$enable_shared" = yes && test "$GCC" = yes; 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 "$GCC" = yes; 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` 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" else 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 "$host_cpu" = ia64; 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 # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # 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}' else # 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' fi 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%'\''`; test $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 version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; 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=yes 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 "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; 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 "$lt_cv_prog_gnu_ld" = yes; 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 ;; # 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 # Append ld.so.conf contents 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' ;; netbsdelf*-gnu) version_type=linux 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='NetBSD ld.elf_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*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac 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 if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; 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 "$with_gnu_ld" = yes; 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=freebsd-elf 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 "$with_gnu_ld" = yes; 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 "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" fi if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" fi { $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 "X$hardcode_automatic" = "Xyes" ; then # We can hardcode non-existent directories. if test "$hardcode_direct" != no && # 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 "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no && test "$hardcode_minus_L" != no; 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 "$hardcode_action" = relink || test "$inherit_rpath" = yes; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi if test "x$enable_dlopen" != xyes; 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 ;; *) 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 "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && 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 "$cross_compiling" = yes; 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 -fvisbility=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 "x$lt_cv_dlopen_self" = xyes; 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 "$cross_compiling" = yes; 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 -fvisbility=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 which 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 "$can_build_shared" = "no" && 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 "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[4-9]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no 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 "$enable_shared" = yes || 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" ac_config_commands="$ac_config_commands libtool" # Only expand once: # compress spaces in flags CFLAGS=`echo "$CFLAGS" | sed -e 's/ +/ /g'` CPPFLAGS=`echo "$CPPFLAGS" | sed -e 's/ +/ /g'` if test x$enable_gcov = xyes; then # so that config.h changes when you toggle gcov support cat >>confdefs.h <<_ACEOF #define DBUS_GCOV_ENABLED __GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__ _ACEOF fi #### Various functions { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing socket" >&5 $as_echo_n "checking for library containing socket... " >&6; } if ${ac_cv_search_socket+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$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 socket (); int main () { return socket (); ; return 0; } _ACEOF for ac_lib in '' socket; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_socket=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_socket+:} false; then : break fi done if ${ac_cv_search_socket+:} false; then : else ac_cv_search_socket=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_socket" >&5 $as_echo "$ac_cv_search_socket" >&6; } ac_res=$ac_cv_search_socket if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether socklen_t is defined" >&5 $as_echo_n "checking whether socklen_t is defined... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include int main () { socklen_t foo; foo = 1; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : dbus_have_socklen_t=yes else dbus_have_socklen_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $dbus_have_socklen_t" >&5 $as_echo "$dbus_have_socklen_t" >&6; } if test "x$dbus_have_socklen_t" = "xyes"; then $as_echo "#define HAVE_SOCKLEN_T 1" >>confdefs.h fi #### Abstract sockets 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 abstract socket namespace" >&5 $as_echo_n "checking abstract socket namespace... " >&6; } if ${ac_cv_have_abstract_sockets+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : { { $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 test program while cross compiling See \`config.log' for more details" "$LINENO" 5; } else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include #include #include #include int main () { int listen_fd; struct sockaddr_un addr; listen_fd = socket (PF_UNIX, SOCK_STREAM, 0); if (listen_fd < 0) { fprintf (stderr, "socket() failed: %s\n", strerror (errno)); exit (1); } memset (&addr, '\0', sizeof (addr)); addr.sun_family = AF_UNIX; strcpy (addr.sun_path, "X/tmp/dbus-fake-socket-path-used-in-configure-test"); addr.sun_path[0] = '\0'; /* this is what makes it abstract */ if (bind (listen_fd, (struct sockaddr*) &addr, SUN_LEN (&addr)) < 0) { fprintf (stderr, "Abstract socket namespace bind() failed: %s\n", strerror (errno)); exit (1); } else exit (0); ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_have_abstract_sockets=yes else ac_cv_have_abstract_sockets=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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_abstract_sockets" >&5 $as_echo "$ac_cv_have_abstract_sockets" >&6; } 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 x$enable_abstract_sockets = xyes; then if test x$ac_cv_have_abstract_sockets = xno; then as_fn_error $? "Abstract sockets explicitly required, and support not detected." "$LINENO" 5 fi fi if test x$enable_abstract_sockets = xno; then ac_cv_have_abstract_sockets=no; fi if test x$ac_cv_have_abstract_sockets = xyes ; then DBUS_PATH_OR_ABSTRACT=abstract $as_echo "#define HAVE_ABSTRACT_SOCKETS 1" >>confdefs.h else DBUS_PATH_OR_ABSTRACT=path fi # this is used in addresses to prefer abstract, e.g. # unix:path=/foo or unix:abstract=/foo #### Sort out XML library # see what we have { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XML_ParserCreate_MM in -lexpat" >&5 $as_echo_n "checking for XML_ParserCreate_MM in -lexpat... " >&6; } if ${ac_cv_lib_expat_XML_ParserCreate_MM+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lexpat $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 XML_ParserCreate_MM (); int main () { return XML_ParserCreate_MM (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_expat_XML_ParserCreate_MM=yes else ac_cv_lib_expat_XML_ParserCreate_MM=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_expat_XML_ParserCreate_MM" >&5 $as_echo "$ac_cv_lib_expat_XML_ParserCreate_MM" >&6; } if test "x$ac_cv_lib_expat_XML_ParserCreate_MM" = xyes; then : for ac_header in expat.h do : ac_fn_c_check_header_mongrel "$LINENO" "expat.h" "ac_cv_header_expat_h" "$ac_includes_default" if test "x$ac_cv_header_expat_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_EXPAT_H 1 _ACEOF have_expat=true else have_expat=false fi done else have_expat=false fi if ! $have_expat ; then as_fn_error $? "expat library not found, check config.log for failed attempts" "$LINENO" 5 fi XML_LIBS=-lexpat XML_CFLAGS= #### Set up final flags 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 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 >= 1.2.16\""; } >&5 ($PKG_CONFIG --exists --print-errors "dbus-1 >= 1.2.16") 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 >= 1.2.16" 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 >= 1.2.16\""; } >&5 ($PKG_CONFIG --exists --print-errors "dbus-1 >= 1.2.16") 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 >= 1.2.16" 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 >= 1.2.16" 2>&1` else DBUS_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "dbus-1 >= 1.2.16" 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 >= 1.2.16) 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 # Glib detection pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DBUS_GLIB" >&5 $as_echo_n "checking for DBUS_GLIB... " >&6; } if test -n "$DBUS_GLIB_CFLAGS"; then pkg_cv_DBUS_GLIB_CFLAGS="$DBUS_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 \"gobject-2.0 >= 2.26, gio-2.0 >= 2.26\""; } >&5 ($PKG_CONFIG --exists --print-errors "gobject-2.0 >= 2.26, gio-2.0 >= 2.26") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_DBUS_GLIB_CFLAGS=`$PKG_CONFIG --cflags "gobject-2.0 >= 2.26, gio-2.0 >= 2.26" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$DBUS_GLIB_LIBS"; then pkg_cv_DBUS_GLIB_LIBS="$DBUS_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 \"gobject-2.0 >= 2.26, gio-2.0 >= 2.26\""; } >&5 ($PKG_CONFIG --exists --print-errors "gobject-2.0 >= 2.26, gio-2.0 >= 2.26") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_DBUS_GLIB_LIBS=`$PKG_CONFIG --libs "gobject-2.0 >= 2.26, gio-2.0 >= 2.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 DBUS_GLIB_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "gobject-2.0 >= 2.26, gio-2.0 >= 2.26" 2>&1` else DBUS_GLIB_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "gobject-2.0 >= 2.26, gio-2.0 >= 2.26" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$DBUS_GLIB_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (gobject-2.0 >= 2.26, gio-2.0 >= 2.26) were not met: $DBUS_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 DBUS_GLIB_CFLAGS and DBUS_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 DBUS_GLIB_CFLAGS and DBUS_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 DBUS_GLIB_CFLAGS=$pkg_cv_DBUS_GLIB_CFLAGS DBUS_GLIB_LIBS=$pkg_cv_DBUS_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 DBUS_GLIB_THREADS" >&5 $as_echo_n "checking for DBUS_GLIB_THREADS... " >&6; } if test -n "$DBUS_GLIB_THREADS_CFLAGS"; then pkg_cv_DBUS_GLIB_THREADS_CFLAGS="$DBUS_GLIB_THREADS_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gthread-2.0 >= 2.6\""; } >&5 ($PKG_CONFIG --exists --print-errors "gthread-2.0 >= 2.6") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_DBUS_GLIB_THREADS_CFLAGS=`$PKG_CONFIG --cflags "gthread-2.0 >= 2.6" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$DBUS_GLIB_THREADS_LIBS"; then pkg_cv_DBUS_GLIB_THREADS_LIBS="$DBUS_GLIB_THREADS_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gthread-2.0 >= 2.6\""; } >&5 ($PKG_CONFIG --exists --print-errors "gthread-2.0 >= 2.6") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_DBUS_GLIB_THREADS_LIBS=`$PKG_CONFIG --libs "gthread-2.0 >= 2.6" 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_GLIB_THREADS_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "gthread-2.0 >= 2.6" 2>&1` else DBUS_GLIB_THREADS_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "gthread-2.0 >= 2.6" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$DBUS_GLIB_THREADS_PKG_ERRORS" >&5 have_glib_threads=no elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } have_glib_threads=no else DBUS_GLIB_THREADS_CFLAGS=$pkg_cv_DBUS_GLIB_THREADS_CFLAGS DBUS_GLIB_THREADS_LIBS=$pkg_cv_DBUS_GLIB_THREADS_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } have_glib_threads=yes fi if test x$have_glib_threads = xyes; then HAVE_GLIB_THREADS_TRUE= HAVE_GLIB_THREADS_FALSE='#' else HAVE_GLIB_THREADS_TRUE='#' HAVE_GLIB_THREADS_FALSE= fi GLIB_GENMARSHAL=`$PKG_CONFIG --variable=glib_genmarshal glib-2.0` DBUS_GLIB_TOOL_CFLAGS=$XML_CFLAGS DBUS_GLIB_TOOL_LIBS="$XML_LIBS" ### gtk-doc Documentation # 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+:} false; then : $as_echo_n "(cached) " >&6 else case $GTKDOC_CHECK in [\\/]* | ?:[\\/]*) ac_cv_path_GTKDOC_CHECK="$GTKDOC_CHECK" # 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="$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=$ac_cv_path_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 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 if test x$enable_gtk_doc = xyes; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gtk-doc >= 1.4\""; } >&5 ($PKG_CONFIG --exists --print-errors "gtk-doc >= 1.4") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : else as_fn_error $? "You need to have gtk-doc >= 1.4 installed to build $PACKAGE_NAME" "$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 as_fn_error $? "Package requirements (glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0) were not met: $GTKDOC_DEPS_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 GTKDOC_DEPS_CFLAGS and GTKDOC_DEPS_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 GTKDOC_DEPS_CFLAGS and GTKDOC_DEPS_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 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 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; } # 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 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 #### Have to go $localstatedir->$prefix/var->/usr/local/var #### someone please fix this a better way... #### find the actual value for $prefix that we'll end up with ## (I know this is broken and should be done in the Makefile, but ## that's a major pain and almost nobody actually seems to care) REAL_PREFIX= if test "x$prefix" = "xNONE"; then REAL_PREFIX=$ac_default_prefix else REAL_PREFIX=$prefix fi ## temporarily change prefix and exec_prefix old_prefix=$prefix prefix=$REAL_PREFIX if test "x$exec_prefix" = xNONE ; then REAL_EXEC_PREFIX=$REAL_PREFIX else REAL_EXEC_PREFIX=$exec_prefix fi old_exec_prefix=$exec_prefix exec_prefix=$REAL_EXEC_PREFIX ## eval everything LOCALSTATEDIR_TMP="$localstatedir" EXPANDED_LOCALSTATEDIR=`eval echo $LOCALSTATEDIR_TMP` SYSCONFDIR_TMP="$sysconfdir" EXPANDED_SYSCONFDIR=`eval echo $SYSCONFDIR_TMP` BINDIR_TMP="$bindir" EXPANDED_BINDIR=`eval echo $BINDIR_TMP` LIBDIR_TMP="$libdir" EXPANDED_LIBDIR=`eval echo $LIBDIR_TMP` DATADIR_TMP="$datadir" EXPANDED_DATADIR=`eval echo $DATADIR_TMP` ## put prefix and exec_prefix back prefix=$old_prefix exec_prefix=$old_exec_prefix #### Tell tests where to find certain stuff in builddir ABSOLUTE_TOP_BUILDDIR=`cd ${ac_top_builddir}. && pwd` TEST_SERVICE_DIR=${ABSOLUTE_TOP_BUILDDIR}/test/data/valid-service-files cat >>confdefs.h <<_ACEOF #define TEST_SERVICE_DIR "$TEST_SERVICE_DIR" _ACEOF TEST_SERVICE_BINARY=${ABSOLUTE_TOP_BUILDDIR}/test/test-service cat >>confdefs.h <<_ACEOF #define TEST_SERVICE_BINARY "$TEST_SERVICE_BINARY" _ACEOF TEST_SHELL_SERVICE_BINARY=${ABSOLUTE_TOP_BUILDDIR}/test/test-shell-service cat >>confdefs.h <<_ACEOF #define TEST_SHELL_SERVICE_BINARY "$TEST_SHELL_SERVICE_BINARY" _ACEOF TEST_CORE_SERVICE_BINARY=${ABSOLUTE_TOP_BUILDDIR}/test/core/test-service-glib cat >>confdefs.h <<_ACEOF #define TEST_CORE_SERVICE_BINARY "$TEST_CORE_SERVICE_BINARY" _ACEOF TEST_INTERFACES_SERVICE_BINARY=${ABSOLUTE_TOP_BUILDDIR}/test/interfaces/test-service cat >>confdefs.h <<_ACEOF #define TEST_INTERFACES_SERVICE_BINARY "$TEST_INTERFACES_SERVICE_BINARY" _ACEOF TEST_EXIT_BINARY=${ABSOLUTE_TOP_BUILDDIR}/test/test-exit cat >>confdefs.h <<_ACEOF #define TEST_EXIT_BINARY "$TEST_EXIT_BINARY" _ACEOF TEST_SEGFAULT_BINARY=${ABSOLUTE_TOP_BUILDDIR}/test/test-segfault cat >>confdefs.h <<_ACEOF #define TEST_SEGFAULT_BINARY "$TEST_SEGFAULT_BINARY" _ACEOF TEST_SLEEP_FOREVER_BINARY=${ABSOLUTE_TOP_BUILDDIR}/test/test-sleep-forever cat >>confdefs.h <<_ACEOF #define TEST_SLEEP_FOREVER_BINARY "$TEST_SLEEP_FOREVER_BINARY" _ACEOF if ! test -z "$with_test_socket_dir" ; then TEST_SOCKET_DIR="$with_test_socket_dir" else TEST_SOCKET_DIR=$DEFAULT_SOCKET_DIR fi cat >>confdefs.h <<_ACEOF #define DBUS_TEST_SOCKET_DIR "$TEST_SOCKET_DIR" _ACEOF ac_config_files="$ac_config_files Makefile m4/Makefile doc/Makefile doc/reference/Makefile doc/reference/version.xml dbus/Makefile dbus/examples/Makefile dbus/examples/statemachine/Makefile test/Makefile test/core/Makefile test/interfaces/Makefile test/data/valid-service-files/debug-glib.service test/data/valid-service-files/debug-echo.service test/data/valid-service-files/interfaces-test.service test/lib/Makefile test/manual/Makefile tools/Makefile dbus-glib-1.pc dbus-glib-1-uninstalled.pc" 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 "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 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 "${DBUS_BASH_COMPLETION_TRUE}" && test -z "${DBUS_BASH_COMPLETION_FALSE}"; then as_fn_error $? "conditional \"DBUS_BASH_COMPLETION\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${DBUS_BUILD_TESTS_TRUE}" && test -z "${DBUS_BUILD_TESTS_FALSE}"; then as_fn_error $? "conditional \"DBUS_BUILD_TESTS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_GLIB_THREADS_TRUE}" && test -z "${HAVE_GLIB_THREADS_FALSE}"; then as_fn_error $? "conditional \"HAVE_GLIB_THREADS\" 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 dbus-glib $as_me 0.100.2, 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 ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ dbus-glib config.status 0.100.2 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"`' 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_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"`' nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' lt_sysroot='`$ECHO "$lt_sysroot" | $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"`' sys_lib_dlsearch_path_spec='`$ECHO "$sys_lib_dlsearch_path_spec" | $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"`' 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_c_name_address \ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ nm_file_list_spec \ 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; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ;; *) 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 \ sys_lib_dlsearch_path_spec; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done ac_aux_dir='$ac_aux_dir' xsi_shell='$xsi_shell' lt_shell_append='$lt_shell_append' # See if we are running on zsh, and set the options which 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' TIMESTAMP='$TIMESTAMP' 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" ;; "m4/Makefile") CONFIG_FILES="$CONFIG_FILES m4/Makefile" ;; "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; "doc/reference/Makefile") CONFIG_FILES="$CONFIG_FILES doc/reference/Makefile" ;; "doc/reference/version.xml") CONFIG_FILES="$CONFIG_FILES doc/reference/version.xml" ;; "dbus/Makefile") CONFIG_FILES="$CONFIG_FILES dbus/Makefile" ;; "dbus/examples/Makefile") CONFIG_FILES="$CONFIG_FILES dbus/examples/Makefile" ;; "dbus/examples/statemachine/Makefile") CONFIG_FILES="$CONFIG_FILES dbus/examples/statemachine/Makefile" ;; "test/Makefile") CONFIG_FILES="$CONFIG_FILES test/Makefile" ;; "test/core/Makefile") CONFIG_FILES="$CONFIG_FILES test/core/Makefile" ;; "test/interfaces/Makefile") CONFIG_FILES="$CONFIG_FILES test/interfaces/Makefile" ;; "test/data/valid-service-files/debug-glib.service") CONFIG_FILES="$CONFIG_FILES test/data/valid-service-files/debug-glib.service" ;; "test/data/valid-service-files/debug-echo.service") CONFIG_FILES="$CONFIG_FILES test/data/valid-service-files/debug-echo.service" ;; "test/data/valid-service-files/interfaces-test.service") CONFIG_FILES="$CONFIG_FILES test/data/valid-service-files/interfaces-test.service" ;; "test/lib/Makefile") CONFIG_FILES="$CONFIG_FILES test/lib/Makefile" ;; "test/manual/Makefile") CONFIG_FILES="$CONFIG_FILES test/manual/Makefile" ;; "tools/Makefile") CONFIG_FILES="$CONFIG_FILES tools/Makefile" ;; "dbus-glib-1.pc") CONFIG_FILES="$CONFIG_FILES dbus-glib-1.pc" ;; "dbus-glib-1-uninstalled.pc") CONFIG_FILES="$CONFIG_FILES dbus-glib-1-uninstalled.pc" ;; *) 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 which 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 # `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $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. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is part of GNU Libtool. # # 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 GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, or # obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # The names of the tagged configurations supported by this script. available_tags="" # ### 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 # 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 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 # 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 in which our libraries should be installed. lt_sysroot=$lt_sysroot # 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 # Run-time system search path for libraries. sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # 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 # ### END LIBTOOL CONFIG _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 "X${COLLECT_NAMES+set}" != Xset; 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) if test x"$xsi_shell" = xyes; then sed -e '/^func_dirname ()$/,/^} # func_dirname /c\ func_dirname ()\ {\ \ case ${1} in\ \ */*) func_dirname_result="${1%/*}${2}" ;;\ \ * ) func_dirname_result="${3}" ;;\ \ esac\ } # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_basename ()$/,/^} # func_basename /c\ func_basename ()\ {\ \ func_basename_result="${1##*/}"\ } # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\ func_dirname_and_basename ()\ {\ \ case ${1} in\ \ */*) func_dirname_result="${1%/*}${2}" ;;\ \ * ) func_dirname_result="${3}" ;;\ \ esac\ \ func_basename_result="${1##*/}"\ } # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_stripname ()$/,/^} # func_stripname /c\ func_stripname ()\ {\ \ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\ \ # positional parameters, so assign one to ordinary parameter first.\ \ func_stripname_result=${3}\ \ func_stripname_result=${func_stripname_result#"${1}"}\ \ func_stripname_result=${func_stripname_result%"${2}"}\ } # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\ func_split_long_opt ()\ {\ \ func_split_long_opt_name=${1%%=*}\ \ func_split_long_opt_arg=${1#*=}\ } # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\ func_split_short_opt ()\ {\ \ func_split_short_opt_arg=${1#??}\ \ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\ } # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\ func_lo2o ()\ {\ \ case ${1} in\ \ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\ \ *) func_lo2o_result=${1} ;;\ \ esac\ } # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_xform ()$/,/^} # func_xform /c\ func_xform ()\ {\ func_xform_result=${1%.*}.lo\ } # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_arith ()$/,/^} # func_arith /c\ func_arith ()\ {\ func_arith_result=$(( $* ))\ } # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_len ()$/,/^} # func_len /c\ func_len ()\ {\ func_len_result=${#1}\ } # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: fi if test x"$lt_shell_append" = xyes; then sed -e '/^func_append ()$/,/^} # func_append /c\ func_append ()\ {\ eval "${1}+=\\${2}"\ } # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\ func_append_quoted ()\ {\ \ func_quote_for_eval "${2}"\ \ eval "${1}+=\\\\ \\$func_quote_for_eval_result"\ } # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: # Save a `func_append' function call where possible by direct use of '+=' sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: else # Save a `func_append' function call even when '+=' is not available sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: fi if test x"$_lt_function_replace_fail" = x":"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5 $as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;} fi mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ;; 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 " D-BUS GLIB BINDINGS $VERSION ============== prefix: ${prefix} exec_prefix: ${exec_prefix} libdir: ${EXPANDED_LIBDIR} bindir: ${EXPANDED_BINDIR} sysconfdir: ${EXPANDED_SYSCONFDIR} localstatedir: ${EXPANDED_LOCALSTATEDIR} datadir: ${EXPANDED_DATADIR} source code location: ${srcdir} compiler: ${CC} cflags: ${CFLAGS} cppflags: ${CPPFLAGS} " echo " Maintainer mode: ${USE_MAINTAINER_MODE} gcc coverage profiling: ${enable_gcov} Building unit tests: ${enable_tests} Building verbose mode: ${enable_verbose_mode} Building assertions: ${enable_asserts} Building checks: ${enable_checks} Building Gtk-doc docs: ${enable_gtk_doc} Bash Completion: ${enable_bash_completion} Using XML parser: ${with_xml} 'make check' socket dir: ${TEST_SOCKET_DIR} " if test x$enable_tests = xyes; then echo "NOTE: building with unit tests increases the size of the installed library and renders it insecure." fi if test x$enable_tests = xyes -a x$enable_asserts = xno; then echo "NOTE: building with unit tests but without assertions means tests may not properly report failures (this configuration is only useful when doing something like profiling the tests)" fi if test x$enable_gcov = xyes; then echo "NOTE: building with coverage profiling is definitely for developers only." fi if test x$enable_verbose_mode = xyes; then echo "NOTE: building with verbose mode increases library size, may slightly increase security risk, and decreases performance." fi if test x$enable_asserts = xyes; then echo "NOTE: building with assertions increases library size and decreases performance." fi if test x$enable_checks = xno; then echo "NOTE: building without checks for arguments passed to public API makes it harder to debug apps using D-BUS, but will slightly decrease D-BUS library size and _very_ slightly improve performance." fi dbus-glib-0.100.2/gtk-doc.make0000644000175000017500000002061311731550205012633 00000000000000# -*- 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) \ $(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 tmpl-build.stamp sgml-build.stamp \ html-build.stamp pdf-build.stamp \ tmpl.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) if ENABLE_GTK_DOC 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-local: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP) else all-local: endif docs: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP) $(REPORT_FILES): sgml-build.stamp #### setup #### setup-build.stamp: -@if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \ echo ' DOC Preparing build'; \ files=`echo $(SETUP_FILES) $(expand_content_files) $(DOC_MODULE).types`; \ if test "x$$files" != "x" ; then \ for file in $$files ; do \ test -f $(abs_srcdir)/$$file && \ cp -pu $(abs_srcdir)/$$file $(abs_builddir)/ || true; \ done; \ fi; \ test -d $(abs_srcdir)/tmpl && \ { cp -rp $(abs_srcdir)/tmpl $(abs_builddir)/; \ chmod -R u+w $(abs_builddir)/tmpl; } \ fi @touch setup-build.stamp #### scan #### scan-build.stamp: $(HFILE_GLOB) $(CFILE_GLOB) @echo ' DOC Scanning header files' @_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) @if grep -l '^..*$$' $(DOC_MODULE).types > /dev/null 2>&1 ; then \ echo " DOC Introspecting gobjects"; \ 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 @touch scan-build.stamp $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt: scan-build.stamp @true #### templates #### tmpl-build.stamp: setup-build.stamp $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt @echo ' DOC Rebuilding template files' @gtkdoc-mktmpl --module=$(DOC_MODULE) $(MKTMPL_OPTIONS) @if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \ if test -w $(abs_srcdir) ; then \ cp -rp $(abs_builddir)/tmpl $(abs_srcdir)/; \ fi \ fi @touch tmpl-build.stamp tmpl.stamp: tmpl-build.stamp @true $(srcdir)/tmpl/*.sgml: @true #### xml #### sgml-build.stamp: tmpl.stamp $(DOC_MODULE)-sections.txt $(srcdir)/tmpl/*.sgml $(expand_content_files) @echo ' DOC Building XML' @-chmod -R u+w $(srcdir) @_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) @touch sgml-build.stamp sgml.stamp: sgml-build.stamp @true #### html #### html-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files) @echo ' DOC Building 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; @echo ' DOC Fixing cross-references' @gtkdoc-fixxref --module=$(DOC_MODULE) --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS) @touch html-build.stamp #### pdf #### pdf-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files) @echo ' DOC Building 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) @touch pdf-build.stamp ############## clean-local: @rm -f *~ *.bak @rm -rf .libs 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) $(expand_content_files) $(DOC_MODULE).types; \ rm -rf tmpl; \ fi maintainer-clean-local: clean @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 ENABLE_GTK_DOC dist-check-gtkdoc: else dist-check-gtkdoc: @echo "*** gtk-doc must be installed and enabled in order to make dist" @false endif dist-hook: dist-check-gtkdoc dist-hook-local @mkdir $(distdir)/tmpl @mkdir $(distdir)/html @-cp ./tmpl/*.sgml $(distdir)/tmpl @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 dbus-glib-0.100.2/depcomp0000755000175000017500000005064311777117217012043 00000000000000#! /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: dbus-glib-0.100.2/COPYING0000644000175000017500000007057512107524563011521 00000000000000The D-Bus glib bindings are licensed to you under your choice of the Academic Free License version 2.1, or the GNU General Public License version 2. Both licenses are included here. Some of the standalone binaries are under the GPL only; in particular, but not limted to, tests/decode-gcov.c. Each source code file is marked with the proper copyright information. The Academic Free License v. 2.1 This Academic Free License (the "License") applies to any original work of authorship (the "Original Work") whose owner (the "Licensor") has placed the following notice immediately following the copyright notice for the Original Work: Licensed under the Academic Free License version 2.1 1) Grant of Copyright License. Licensor hereby grants You a world-wide, royalty-free, non-exclusive, perpetual, sublicenseable license to do the following: a) to reproduce the Original Work in copies; b) to prepare derivative works ("Derivative Works") based upon the Original Work; c) to distribute copies of the Original Work and Derivative Works to the public; d) to perform the Original Work publicly; and e) to display the Original Work publicly. 2) Grant of Patent License. Licensor hereby grants You a world-wide, royalty-free, non-exclusive, perpetual, sublicenseable license, under patent claims owned or controlled by the Licensor that are embodied in the Original Work as furnished by the Licensor, to make, use, sell and offer for sale the Original Work and Derivative Works. 3) Grant of Source Code License. The term "Source Code" means the preferred form of the Original Work for making modifications to it and all available documentation describing how to modify the Original Work. Licensor hereby agrees to provide a machine-readable copy of the Source Code of the Original Work along with each copy of the Original Work that Licensor distributes. Licensor reserves the right to satisfy this obligation by placing a machine-readable copy of the Source Code in an information repository reasonably calculated to permit inexpensive and convenient access by You for as long as Licensor continues to distribute the Original Work, and by publishing the address of that information repository in a notice immediately following the copyright notice that applies to the Original Work. 4) Exclusions From License Grant. Neither the names of Licensor, nor the names of any contributors to the Original Work, nor any of their trademarks or service marks, may be used to endorse or promote products derived from this Original Work without express prior written permission of the Licensor. Nothing in this License shall be deemed to grant any rights to trademarks, copyrights, patents, trade secrets or any other intellectual property of Licensor except as expressly stated herein. No patent license is granted to make, use, sell or offer to sell embodiments of any patent claims other than the licensed claims defined in Section 2. No right is granted to the trademarks of Licensor even if such marks are included in the Original Work. Nothing in this License shall be interpreted to prohibit Licensor from licensing under different terms from this License any Original Work that Licensor otherwise would have a right to license. 5) This section intentionally omitted. 6) Attribution Rights. You must retain, in the Source Code of any Derivative Works that You create, all copyright, patent or trademark notices from the Source Code of the Original Work, as well as any notices of licensing and any descriptive text identified therein as an "Attribution Notice." You must cause the Source Code for any Derivative Works that You create to carry a prominent Attribution Notice reasonably calculated to inform recipients that You have modified the Original Work. 7) Warranty of Provenance and Disclaimer of Warranty. Licensor warrants that the copyright in and to the Original Work and the patent rights granted herein by Licensor are owned by the Licensor or are sublicensed to You under the terms of this License with the permission of the contributor(s) of those copyrights and patent rights. Except as expressly stated in the immediately proceeding sentence, the Original Work is provided under this License on an "AS IS" BASIS and WITHOUT WARRANTY, either express or implied, including, without limitation, the warranties of NON-INFRINGEMENT, MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY OF THE ORIGINAL WORK IS WITH YOU. This DISCLAIMER OF WARRANTY constitutes an essential part of this License. No license to Original Work is granted hereunder except under this disclaimer. 8) Limitation of Liability. Under no circumstances and under no legal theory, whether in tort (including negligence), contract, or otherwise, shall the Licensor be liable to any person for any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or the use of the Original Work including, without limitation, damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses. This limitation of liability shall not apply to liability for death or personal injury resulting from Licensor's negligence to the extent applicable law prohibits such limitation. Some jurisdictions do not allow the exclusion or limitation of incidental or consequential damages, so this exclusion and limitation may not apply to You. 9) Acceptance and Termination. If You distribute copies of the Original Work or a Derivative Work, You must make a reasonable effort under the circumstances to obtain the express assent of recipients to the terms of this License. Nothing else but this License (or another written agreement between Licensor and You) grants You permission to create Derivative Works based upon the Original Work or to exercise any of the rights granted in Section 1 herein, and any attempt to do so except under the terms of this License (or another written agreement between Licensor and You) is expressly prohibited by U.S. copyright law, the equivalent laws of other countries, and by international treaty. Therefore, by exercising any of the rights granted to You in Section 1 herein, You indicate Your acceptance of this License and all of its terms and conditions. 10) Termination for Patent Action. This License shall terminate automatically and You may no longer exercise any of the rights granted to You by this License as of the date You commence an action, including a cross-claim or counterclaim, against Licensor or any licensee alleging that the Original Work infringes a patent. This termination provision shall not apply for an action alleging patent infringement by combinations of the Original Work with other software or hardware. 11) Jurisdiction, Venue and Governing Law. Any action or suit relating to this License may be brought only in the courts of a jurisdiction wherein the Licensor resides or in which Licensor conducts its primary business, and under the laws of that jurisdiction excluding its conflict-of-law provisions. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded. Any use of the Original Work outside the scope of this License or after its termination shall be subject to the requirements and penalties of the U.S. Copyright Act, 17 U.S.C. § 101 et seq., the equivalent laws of other countries, and international treaty. This section shall survive the termination of this License. 12) Attorneys Fees. In any action to enforce the terms of this License or seeking damages relating thereto, the prevailing party shall be entitled to recover its costs and expenses, including, without limitation, reasonable attorneys' fees and costs incurred in connection with such action, including any appeal of such action. This section shall survive the termination of this License. 13) Miscellaneous. This License represents the complete agreement concerning the subject matter hereof. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable. 14) Definition of "You" in This License. "You" throughout this License, whether in upper or lower case, means an individual or a legal entity exercising rights under, and complying with all of the terms of, this License. For legal entities, "You" includes any entity that controls, is controlled by, or is under common control with you. For purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. 15) Right to Use. You may use the Original Work in all ways not otherwise restricted or conditioned by this License or by law, and Licensor promises not to interfere with or be responsible for such uses by You. This license is Copyright (C) 2003-2004 Lawrence E. Rosen. All rights reserved. Permission is hereby granted to copy and distribute this license without modification. This license may not be modified without the express written permission of its copyright owner. -- END OF ACADEMIC FREE LICENSE. The following is intended to describe the essential differences between the Academic Free License (AFL) version 1.0 and other open source licenses: The Academic Free License is similar to the BSD, MIT, UoI/NCSA and Apache licenses in many respects but it is intended to solve a few problems with those licenses. * The AFL is written so as to make it clear what software is being licensed (by the inclusion of a statement following the copyright notice in the software). This way, the license functions better than a template license. The BSD, MIT and UoI/NCSA licenses apply to unidentified software. * The AFL contains a complete copyright grant to the software. The BSD and Apache licenses are vague and incomplete in that respect. * The AFL contains a complete patent grant to the software. The BSD, MIT, UoI/NCSA and Apache licenses rely on an implied patent license and contain no explicit patent grant. * The AFL makes it clear that no trademark rights are granted to the licensor's trademarks. The Apache license contains such a provision, but the BSD, MIT and UoI/NCSA licenses do not. * The AFL includes the warranty by the licensor that it either owns the copyright or that it is distributing the software under a license. None of the other licenses contain that warranty. All other warranties are disclaimed, as is the case for the other licenses. * The AFL is itself copyrighted (with the right granted to copy and distribute without modification). This ensures that the owner of the copyright to the license will control changes. The Apache license contains a copyright notice, but the BSD, MIT and UoI/NCSA licenses do not. -- START OF GNU GENERAL PUBLIC LICENSE -- GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, 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 or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's 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 give any other recipients of the Program a copy of this License along with the Program. 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 Program or any portion of it, thus forming a work based on the Program, 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) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, 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 Program, 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 Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) 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; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, 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 executable. However, as a special exception, the source code 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. If distribution of executable or 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 counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program 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. 5. 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 Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program 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 to this License. 7. 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 Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program 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 Program. 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. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program 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. 9. The Free Software Foundation may publish revised and/or new versions of the 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 Program 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 Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, 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 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "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 PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. 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 PROGRAM 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 PROGRAM (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 PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. 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 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 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, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. dbus-glib-0.100.2/Makefile.in0000644000175000017500000010034512112653462012515 00000000000000# 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@ # Copyright © 2010 Collabora Ltd. # # Licensed under the Academic Free License version 2.1 # # 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 of the License, or # (at your option) any later version. # # Alternatively, at your option, you can redistribute and/or modify # this single file under the terms of the GNU Lesser General Public License # as published by the Free Software Foundation; either version 2.1 of # that 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 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)/dbus-glib-1-uninstalled.pc.in \ $(srcdir)/dbus-glib-1.pc.in $(srcdir)/tools/lcov.am \ $(top_srcdir)/configure \ $(top_srcdir)/test/data/valid-service-files/debug-echo.service.in \ $(top_srcdir)/test/data/valid-service-files/debug-glib.service.in \ $(top_srcdir)/test/data/valid-service-files/interfaces-test.service.in \ AUTHORS COPYING ChangeLog INSTALL NEWS config.guess config.sub \ depcomp install-sh ltmain.sh 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)/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 = test/data/valid-service-files/debug-glib.service \ test/data/valid-service-files/debug-echo.service \ test/data/valid-service-files/interfaces-test.service \ dbus-glib-1.pc dbus-glib-1-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 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 ABSOLUTE_TOP_BUILDDIR = @ABSOLUTE_TOP_BUILDDIR@ ACLOCAL = @ACLOCAL@ 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@ CYGPATH_W = @CYGPATH_W@ DBUS_BINDING_TOOL = @DBUS_BINDING_TOOL@ DBUS_CFLAGS = @DBUS_CFLAGS@ DBUS_GLIB_CFLAGS = @DBUS_GLIB_CFLAGS@ DBUS_GLIB_LIBS = @DBUS_GLIB_LIBS@ DBUS_GLIB_THREADS_CFLAGS = @DBUS_GLIB_THREADS_CFLAGS@ DBUS_GLIB_THREADS_LIBS = @DBUS_GLIB_THREADS_LIBS@ DBUS_GLIB_TOOL_CFLAGS = @DBUS_GLIB_TOOL_CFLAGS@ DBUS_GLIB_TOOL_LIBS = @DBUS_GLIB_TOOL_LIBS@ DBUS_LIBS = @DBUS_LIBS@ DBUS_PATH_OR_ABSTRACT = @DBUS_PATH_OR_ABSTRACT@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ EXPANDED_BINDIR = @EXPANDED_BINDIR@ EXPANDED_DATADIR = @EXPANDED_DATADIR@ EXPANDED_LIBDIR = @EXPANDED_LIBDIR@ EXPANDED_LOCALSTATEDIR = @EXPANDED_LOCALSTATEDIR@ EXPANDED_SYSCONFDIR = @EXPANDED_SYSCONFDIR@ FGREP = @FGREP@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GREP = @GREP@ GTKDOC_CHECK = @GTKDOC_CHECK@ 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@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_REVISION = @LT_REVISION@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ 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@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TEST_CORE_SERVICE_BINARY = @TEST_CORE_SERVICE_BINARY@ TEST_EXIT_BINARY = @TEST_EXIT_BINARY@ TEST_INTERFACES_SERVICE_BINARY = @TEST_INTERFACES_SERVICE_BINARY@ TEST_SEGFAULT_BINARY = @TEST_SEGFAULT_BINARY@ TEST_SERVICE_BINARY = @TEST_SERVICE_BINARY@ TEST_SERVICE_DIR = @TEST_SERVICE_DIR@ TEST_SHELL_SERVICE_BINARY = @TEST_SHELL_SERVICE_BINARY@ TEST_SLEEP_FOREVER_BINARY = @TEST_SLEEP_FOREVER_BINARY@ TEST_SOCKET_DIR = @TEST_SOCKET_DIR@ VERSION = @VERSION@ 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_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@ 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@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ 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 GLIB_PC = dbus-glib-1.pc SUBDIRS = dbus tools test doc DIST_SUBDIRS = dbus tools test doc m4 pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = $(GLIB_PC) DISTCLEANFILES = \ $(GLIB_PC) EXTRA_DIST = HACKING NEWS dbus-bus-introspect.xml dbus-glib-1.pc.in \ ChangeLog # Creating ChangeLog from git log: MAINTAINERCLEANFILES = ChangeLog DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc --enable-checks --enable-tests all: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: am--refresh: Makefile @: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(srcdir)/tools/lcov.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: $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) $(am__cd) $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(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: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f stamp-h1 touch $@ distclean-hdr: -rm -f config.h stamp-h1 test/data/valid-service-files/debug-glib.service: $(top_builddir)/config.status $(top_srcdir)/test/data/valid-service-files/debug-glib.service.in cd $(top_builddir) && $(SHELL) ./config.status $@ test/data/valid-service-files/debug-echo.service: $(top_builddir)/config.status $(top_srcdir)/test/data/valid-service-files/debug-echo.service.in cd $(top_builddir) && $(SHELL) ./config.status $@ test/data/valid-service-files/interfaces-test.service: $(top_builddir)/config.status $(top_srcdir)/test/data/valid-service-files/interfaces-test.service.in cd $(top_builddir) && $(SHELL) ./config.status $@ dbus-glib-1.pc: $(top_builddir)/config.status $(srcdir)/dbus-glib-1.pc.in cd $(top_builddir) && $(SHELL) ./config.status $@ dbus-glib-1-uninstalled.pc: $(top_builddir)/config.status $(srcdir)/dbus-glib-1-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 -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-$$$$/" \ && 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) -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) 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 "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) 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-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 ChangeLog: $(srcdir)/ChangeLog: @if test -d "$(srcdir)/.git"; then \ (cd "$(srcdir)" && \ ./missing --run git log --stat) | fmt --split-only > $@.tmp \ && mv -f $@.tmp $@ \ || ($(RM) $@.tmp; \ echo Failed to generate ChangeLog, your ChangeLog may be outdated >&2; \ (test -f $@ || echo git-log is required to generate this file >> $@)); \ else \ test -f $@ || \ (echo A git checkout and git log are required to generate ChangeLog >&2 && \ echo A git checkout and git-log are required to generate this file >> $@); \ fi %.tar.gz.asc: %.tar.gz $(AM_V_GEN)gpg --detach-sign --armor $@ maintainer-upload-release: test -f @PACKAGE@-@VERSION@.tar.gz test -f @PACKAGE@-@VERSION@.tar.gz.asc gpg --verify @PACKAGE@-@VERSION@.tar.gz.asc rsync -vzP @PACKAGE@-@VERSION@.tar.gz dbus.freedesktop.org:/srv/dbus.freedesktop.org/www/releases/@PACKAGE@/@PACKAGE@-@VERSION@.tar.gz rsync -vzP @PACKAGE@-@VERSION@.tar.gz.asc dbus.freedesktop.org:/srv/dbus.freedesktop.org/www/releases/@PACKAGE@/@PACKAGE@-@VERSION@.tar.gz.asc rsync -rvzPp --chmod=Dg+s,ug+rwX,o=rX $(srcdir)/docs/reference/html/ \ dbus.freedesktop.org:/srv/dbus.freedesktop.org/www/doc/@PACKAGE@/ 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 '*-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 $(LCOV_CHECK_ARGS) $(MAKE) lcov-report # 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: dbus-glib-0.100.2/config.guess0000755000175000017500000012743211764422452013003 00000000000000#! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, # 2011, 2012 Free Software Foundation, Inc. timestamp='2012-02-10' # 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 2 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. # Originally written by Per Bothner. Please send patches (context # diff format) to and include a ChangeLog # entry. # # This script attempts to guess a canonical system name similar to # config.sub. If it succeeds, it prints the system name on stdout, and # exits with 0. Otherwise, it exits with 1. # # 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;hb=HEAD 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 (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 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 # 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=`(/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 ;; *) 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*|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 # 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/[-_].*/\./'` ;; 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}" exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${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 ;; 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/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` 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 ;; *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; i*: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-gnu`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 '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; aarch64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be echo ${UNAME_MACHINE}-unknown-linux-gnu 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="libc1" ; else LIBC="" ; fi echo ${UNAME_MACHINE}-unknown-linux-gnu${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-gnu else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then echo ${UNAME_MACHINE}-unknown-linux-gnueabi else echo ${UNAME_MACHINE}-unknown-linux-gnueabihf fi fi exit ;; avr32*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; cris:Linux:*:*) echo ${UNAME_MACHINE}-axis-linux-gnu exit ;; crisv32:Linux:*:*) echo ${UNAME_MACHINE}-axis-linux-gnu exit ;; frv:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; hexagon:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; i*86:Linux:*:*) LIBC=gnu eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __dietlibc__ LIBC=dietlibc #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` echo "${UNAME_MACHINE}-pc-linux-${LIBC}" exit ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu 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-gnu"; exit; } ;; or32:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; padre:Linux:*:*) echo sparc-unknown-linux-gnu exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-gnu 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-gnu ;; PA8*) echo hppa2.0-unknown-linux-gnu ;; *) echo hppa-unknown-linux-gnu ;; esac exit ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-gnu exit ;; ppc:Linux:*:*) echo powerpc-unknown-linux-gnu exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux exit ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; tile*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-gnu exit ;; x86_64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; xtensa*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu 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 configury 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 ;; 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 ;; 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 case $UNAME_PROCESSOR in i386) eval $set_cc_for_build 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 UNAME_PROCESSOR="x86_64" fi fi ;; unknown) UNAME_PROCESSOR=powerpc ;; esac 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 ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 eval $set_cc_for_build cat >$dummy.c < # include #endif main () { #if defined (sony) #if defined (MIPSEB) /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, I don't know.... */ printf ("mips-sony-bsd\n"); exit (0); #else #include printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 "4" #else "" #endif ); exit (0); #endif #endif #if defined (__arm) && defined (__acorn) && defined (__unix) printf ("arm-acorn-riscix\n"); exit (0); #endif #if defined (hp300) && !defined (hpux) printf ("m68k-hp-bsd\n"); exit (0); #endif #if defined (NeXT) #if !defined (__ARCHITECTURE__) #define __ARCHITECTURE__ "m68k" #endif int version; version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; if (version < 4) printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); else printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); exit (0); #endif #if defined (MULTIMAX) || defined (n16) #if defined (UMAXV) printf ("ns32k-encore-sysv\n"); exit (0); #else #if defined (CMU) printf ("ns32k-encore-mach\n"); exit (0); #else printf ("ns32k-encore-bsd\n"); exit (0); #endif #endif #endif #if defined (__386BSD__) printf ("i386-pc-bsd\n"); exit (0); #endif #if defined (sequent) #if defined (i386) printf ("i386-sequent-dynix\n"); exit (0); #endif #if defined (ns32000) printf ("ns32k-sequent-dynix\n"); exit (0); #endif #endif #if defined (_SEQUENT_) struct utsname un; uname(&un); if (strncmp(un.version, "V2", 2) == 0) { printf ("i386-sequent-ptx2\n"); exit (0); } if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ printf ("i386-sequent-ptx1\n"); exit (0); } printf ("i386-sequent-ptx\n"); exit (0); #endif #if defined (vax) # if !defined (ultrix) # include # if defined (BSD) # if BSD == 43 printf ("vax-dec-bsd4.3\n"); exit (0); # else # if BSD == 199006 printf ("vax-dec-bsd4.3reno\n"); exit (0); # else printf ("vax-dec-bsd\n"); exit (0); # endif # endif # else printf ("vax-dec-bsd\n"); exit (0); # endif # else printf ("vax-dec-ultrix\n"); exit (0); # endif #endif #if defined (alliant) && defined (i860) printf ("i860-alliant-bsd\n"); exit (0); #endif exit (1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } # Apollos put the system type in the environment. test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } # Convex versions that predate uname can use getsysinfo(1) if [ -x /usr/convex/getsysinfo ] then case `getsysinfo -f cpu_type` in c1*) echo c1-convex-bsd exit ;; c2*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; c34*) echo c34-convex-bsd exit ;; c38*) echo c38-convex-bsd exit ;; c4*) echo c4-convex-bsd exit ;; esac fi 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: dbus-glib-0.100.2/HACKING0000644000175000017500000000436612112652540011441 00000000000000The mainline git tree for this code is at git://anongit.freedesktop.org/git/dbus/dbus-glib. = Creating changes = Be sure to match the existing code style (Emacs: "gnu"). If you are making major changes which you wish to be incorporated upstream, please do as small commits to your local git tree, so there is a good history of your changes. When you consider changes ready for merging to mainline, use "git-format-patch" or otherwise generate diffs. Post those diffs to a new bug at http://bugs.freedesktop.org, project DBus, component GLib. For nontrivial changes *please* try to extend the test suite to cover it. The test infrastructure is in test/core/, and currently there are a lot of tests in the single file test/core/test-dbus-glib.c. Extending this file is suggested (in the future we would like to break this file up). Run "make check" to run the test suite. = Committing = If applying a patch from someone else that created them via "git-format-patch", you can use "git-am -s" to apply. Otherwise apply the patch and then use "git commit --author ..." Regardless: == Nontrivial changes == Nontrivial patches should always go through Bugzilla for peer review, so you should have a bug number. The commit should be of the form: Bug XXXXXX: Single line summary here * dbus/filename.c: Why I changed this. * dbus/otherfile.c: Why I changed this. == Trivial changes == Just use a single line summary, like: Fix typo in NEWS = Making a release = DBus-Glib now uses an even-stable odd-development release numbering system. The current number in configure.ac should be odd. To make a release (please replace use of 0.76 with the new version) * make * make distcheck * edit configure.ac, change version to even (e.g. 0.75 -> 0.76) * also in configure.ac, update LT_CURRENT, LT_REVISION and LT_AGE * ./autogen.sh * make * make distcheck * sign the tarball (or use: make dbus-glib-0.76.tar.gz.asc) * make maintainer-upload-release * git commit -m "Release" * git tag -a dbus-glib_0.76 * edit configure.ac, change version to odd (e.g. 0.76 -> 0.77) * git commit -m "Bump version for development" * Update the wiki: http://www.freedesktop.org/wiki/Software/DBusBindings * Announce the release on the mailing list, summarizing notable changes. NEWS is unmaintained. dbus-glib-0.100.2/aclocal.m40000644000175000017500000012727312112653375012324 00000000000000# 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'.])]) # pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- # serial 1 (pkg-config-0.24) # # Copyright © 2004 Scott James Remnant . # # 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 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, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # 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. # PKG_PROG_PKG_CONFIG([MIN-VERSION]) # ---------------------------------- 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 ])# PKG_PROG_PKG_CONFIG # PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) # # Check to see whether a particular set of modules exists. Similar # to PKG_CHECK_MODULES(), but does not set variables or print errors. # # Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) # only at the first occurence in configure.ac, so if the first place # it's called might be skipped (such as if it is within an "if", you # 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]) # _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) # --------------------------------------------- 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 ])# _PKG_CONFIG # _PKG_SHORT_ERRORS_SUPPORTED # ----------------------------- 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 ])# _PKG_SHORT_ERRORS_SUPPORTED # PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], # [ACTION-IF-NOT-FOUND]) # # # Note that if there is a possibility the first call to # PKG_CHECK_MODULES might not happen, you should be sure to include an # 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 ])# PKG_CHECK_MODULES # 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"]) ]) # Copyright (C) 1996, 1997, 2000, 2001, 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 8 # AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS. AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)]) # 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])]) # Add --enable-maintainer-mode option to configure. -*- Autoconf -*- # From Jim Meyering # Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 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 5 # AM_MAINTAINER_MODE([DEFAULT-MODE]) # ---------------------------------- # Control maintainer-specific portions of Makefiles. # Default is to disable them, unless `enable' is passed literally. # For symmetry, `disable' may be passed as well. Anyway, the user # can override the default with the --enable/--disable switch. AC_DEFUN([AM_MAINTAINER_MODE], [m4_case(m4_default([$1], [disable]), [enable], [m4_define([am_maintainer_other], [disable])], [disable], [m4_define([am_maintainer_other], [enable])], [m4_define([am_maintainer_other], [enable]) m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])]) AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) dnl maintainer-mode's default is 'disable' unless 'enable' is passed AC_ARG_ENABLE([maintainer-mode], [ --][am_maintainer_other][-maintainer-mode am_maintainer_other make rules and dependencies not useful (and sometimes confusing) to the casual installer], [USE_MAINTAINER_MODE=$enableval], [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes])) AC_MSG_RESULT([$USE_MAINTAINER_MODE]) AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes]) MAINT=$MAINTAINER_MODE_TRUE AC_SUBST([MAINT])dnl ] ) AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE]) # 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])]) # 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]) dbus-glib-0.100.2/missing0000755000175000017500000002415211777117217012061 00000000000000#! /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: dbus-glib-0.100.2/AUTHORS0000644000175000017500000000143311634152371011517 00000000000000Ross Burton S. Nallammai Luiz Augusto von Dentz Steve Frécinaux Marc-Andre Lureau Rob Taylor Olivier Andrieu Philip Blundell Anders Carlsson Kristian Hogsberg Alex Larsson Robert McQueen Michael Meeks Seth Nickell John (J5) Palmieri Havoc Pennington Harri Porten Matthew Rickard Zack Rusin Joe Shaw Colin Walters David Zeuthen dbus-glib-0.100.2/doc/0000755000175000017500000000000012112654010011260 500000000000000dbus-glib-0.100.2/doc/reference/0000755000175000017500000000000012112654011013217 500000000000000dbus-glib-0.100.2/doc/reference/dbus-glib.types0000644000175000017500000000000012112654011016063 00000000000000dbus-glib-0.100.2/doc/reference/dbus-glib-sections.txt0000644000175000017500000001173712112654011017406 00000000000000
dbus-gconnection DBusGConnection dbus/dbus-glib.h DBusGConnection DBUS_TYPE_G_CONNECTION dbus_g_bus_get dbus_g_bus_get_private dbus_g_thread_init dbus_g_connection_open dbus_g_connection_ref dbus_g_connection_unref dbus_g_connection_flush dbus_g_connection_get_connection dbus_g_connection_register_g_object dbus_g_connection_unregister_g_object dbus_g_connection_lookup_g_object dbus_g_connection_get_g_type
dbus-gobject DBus GObject related functions dbus/dbus-glib.h DBusGObjectInfo dbus_g_object_type_install_info dbus_g_object_type_register_shadow_property dbus_g_object_path_get_g_type dbus_g_object_register_marshaller dbus_g_object_register_marshaller_array dbus_glib_global_set_disable_legacy_property_access
dbus-gmessage DBusGMessage dbus/dbus-glib.h DBusGMessage DBUS_TYPE_G_MESSAGE dbus_g_message_ref dbus_g_message_unref dbus_g_message_get_message dbus_g_message_get_g_type
dbus-gmethod DBusGMethod dbus/dbus-glib.h DBusGMethodInfo DBusGMethodInvocation dbus_g_method_get_sender dbus_g_method_get_reply dbus_g_method_send_reply dbus_g_method_return dbus_g_method_return_error
dbus-gerror DBusGError dbus/dbus-glib.h DBusGError dbus_g_error_has_name dbus_g_error_get_name dbus_g_error_domain_register DBUS_GERROR dbus_g_error_quark
dbus-gproxy DBusGProxy dbus/dbus-glib.h DBusGProxy DBusGProxyCall DBusGProxyCallNotify dbus_g_proxy_new_for_name dbus_g_proxy_new_for_name_owner dbus_g_proxy_new_from_proxy dbus_g_proxy_new_for_peer dbus_g_proxy_set_interface dbus_g_proxy_get_path dbus_g_proxy_get_bus_name dbus_g_proxy_get_interface dbus_g_proxy_add_signal dbus_g_proxy_connect_signal dbus_g_proxy_disconnect_signal dbus_g_proxy_send dbus_g_proxy_call dbus_g_proxy_call_with_timeout dbus_g_proxy_call_no_reply dbus_g_proxy_begin_call dbus_g_proxy_begin_call_with_timeout dbus_g_proxy_end_call dbus_g_proxy_cancel_call dbus_g_proxy_set_default_timeout DBUS_G_PROXY DBUS_IS_G_PROXY DBUS_TYPE_G_PROXY dbus_g_proxy_get_type DBUS_G_PROXY_CLASS DBUS_IS_G_PROXY_CLASS DBUS_G_PROXY_GET_CLASS DBusGAsyncData
dbus-glib-lowlevel DBus GLib low level dbus/dbus-glib-lowlevel.h dbus_set_g_error dbus_connection_setup_with_g_main dbus_connection_get_g_connection dbus_server_setup_with_g_main DBUS_TYPE_CONNECTION DBUS_TYPE_MESSAGE dbus_connection_get_g_type dbus_message_get_g_type DBUS_INSIDE_DBUS_GLIB_H
dbus-gtype-specialized Specializable GType System dbus/dbus-glib.h DBusGTypeSpecializedCollectionIterator DBusGTypeSpecializedMapIterator DBusGTypeSpecializedAppendContext DBusGTypeSpecializedConstructor DBusGTypeSpecializedFreeFunc DBusGTypeSpecializedCopyFunc DBusGTypeSpecializedVtable DBusGTypeSpecializedCollectionFixedAccessorFunc DBusGTypeSpecializedCollectionIteratorFunc DBusGTypeSpecializedCollectionAppendFunc DBusGTypeSpecializedCollectionEndAppendFunc DBusGTypeSpecializedCollectionVtable DBusGTypeSpecializedMapIteratorFunc DBusGTypeSpecializedMapAppendFunc DBusGTypeSpecializedMapVtable DBusGTypeSpecializedStructGetMember DBusGTypeSpecializedStructSetMember DBusGTypeSpecializedStructVtable dbus_g_type_get_collection dbus_g_type_get_map dbus_g_type_get_structv dbus_g_type_get_struct dbus_g_type_is_collection dbus_g_type_is_map dbus_g_type_is_struct dbus_g_type_get_collection_specialization dbus_g_type_get_map_key_specialization dbus_g_type_get_map_value_specialization dbus_g_type_get_struct_member_type dbus_g_type_get_struct_size dbus_g_type_specialized_construct dbus_g_type_specialized_init_append dbus_g_type_specialized_collection_append dbus_g_type_specialized_collection_end_append dbus_g_type_specialized_map_append dbus_g_type_collection_get_fixed dbus_g_type_collection_value_iterate dbus_g_type_map_value_iterate dbus_g_type_struct_get_member dbus_g_type_struct_set_member dbus_g_type_struct_get dbus_g_type_struct_set dbus_g_type_specialized_init dbus_g_type_register_collection dbus_g_type_register_map dbus_g_type_map_peek_vtable dbus_g_type_collection_peek_vtable dbus_g_type_struct_peek_vtable dbus_g_type_register_struct dbus_g_value_build_g_variant dbus_g_value_parse_g_variant DBUS_TYPE_G_BOOLEAN_ARRAY DBUS_TYPE_G_UCHAR_ARRAY DBUS_TYPE_G_UINT_ARRAY DBUS_TYPE_G_INT_ARRAY DBUS_TYPE_G_UINT64_ARRAY DBUS_TYPE_G_INT64_ARRAY DBUS_TYPE_G_OBJECT_ARRAY DBUS_TYPE_G_STRING_STRING_HASHTABLE DBusGSignature DBUS_TYPE_G_SIGNATURE DBusGObjectPath DBUS_TYPE_G_OBJECT_PATH dbus_g_object_path_get_g_type dbus_g_signature_get_g_type
dbus-glib-0.100.2/doc/reference/version.xml.in0000644000175000017500000000001111634152371015755 00000000000000@VERSION@dbus-glib-0.100.2/doc/reference/html/0000755000175000017500000000000012112654011014163 500000000000000dbus-glib-0.100.2/doc/reference/html/home.png0000644000175000017500000000121612112654010015540 00000000000000PNG  IHDRw=bKGD pHYs  ~tIME1KvIDATxՕkq?rCp ~CnpCAAJ .B-\'G]:ܠC -(8 Ԁ!fDғklbRoyxwpðIJ<of_-@RHf֟t^ښ$Q|pgv;X^^&s(bwwZF9&3඙ ^IRZUE.0Z]]U PYM8HGIekqqҀ! $۬3n e{-/seeeÌXOͷ$8==USQRR'9-s+B^ Cەs+%<7W :2IENDB`dbus-glib-0.100.2/doc/reference/html/ch02.html0000644000175000017500000000733412112654011015534 00000000000000 API Reference

API Reference

API for using D-BUS with GLib
DBusGConnection — DBus Connection
DBus GObject related functions — Exporting a GObject remotely
DBusGMessage — DBus Message
DBusGMethod — GMethod Info & Invocation
DBusGError — DBus GError
DBusGProxy — DBus Proxy
Specializable GType System — Specialized GTypes
DBus GLib low level — DBus lower level functions

API for using D-BUS with GLib

libdbus proper is a low-level API, these GLib bindings wrap libdbus with a much higher-level approach. The higher level approach is possible because GLib defines a main loop, an object/type system, and an out-of-memory handling policy (it exits the program). See http://www.gtk.org for GLib information.

To manipulate remote objects, use DBusGProxy.

dbus-glib-0.100.2/doc/reference/html/index.sgml0000644000175000017500000005312112112654010016077 00000000000000 dbus-glib-0.100.2/doc/reference/html/dbus-binding-tool.html0000644000175000017500000000547112112654011020320 00000000000000 dbus-binding-tool

dbus-binding-tool

dbus-binding-tool — C language GLib bindings generation utility

Synopsis

[options...] [files...]

Description

dbus-binding-tool bla bla bla

Invocation

dbus-binding-tool bla bla bla

Options

--modepretty|glib-server|glib-client

bla bla

--help

Print brief help and exit.

--version

Print version and exit.

See also

glib-genmarshal(1)

dbus-glib-0.100.2/doc/reference/html/dbus-glib-DBusGMessage.html0000644000175000017500000002070212112654011021111 00000000000000 DBusGMessage

DBusGMessage

DBusGMessage — DBus Message

Stability Level

Stable, unless otherwise indicated

Synopsis

#include <dbus/dbus-glib.h>

                    DBusGMessage;
#define             DBUS_TYPE_G_MESSAGE
DBusGMessage *      dbus_g_message_ref                  (DBusGMessage *message);
void                dbus_g_message_unref                (DBusGMessage *message);
DBusMessage *       dbus_g_message_get_message          (DBusGMessage *gmessage);

Description

A DBusGMessage is a boxed type abstracting a DBusMessage.

Details

DBusGMessage

typedef struct _DBusGMessage DBusGMessage;

A DBusGMessage is a boxed type abstracting a DBusMessage from libdbus.


DBUS_TYPE_G_MESSAGE

#define DBUS_TYPE_G_MESSAGE      (dbus_g_message_get_g_type ())

Expands to a function call returning the boxed GType of a DBusGConnection.

Returns :

the GLib type

dbus_g_message_ref ()

DBusGMessage *      dbus_g_message_ref                  (DBusGMessage *message);

Increment refcount on a DBusGMessage

message :

the message to ref

Returns :

the message that was ref'd

dbus_g_message_unref ()

void                dbus_g_message_unref                (DBusGMessage *message);

Decrement refcount on a DBusGMessage

message :

the message to unref

dbus_g_message_get_message ()

DBusMessage *       dbus_g_message_get_message          (DBusGMessage *gmessage);

Get the DBusMessage corresponding to this DBusGMessage. The return value does not have its refcount incremented.

gmessage :

a DBusGMessage

Returns :

DBusMessage

See Also

DBusMessage
dbus-glib-0.100.2/doc/reference/html/dbus-glib-Specializable-GType-System.html0000644000175000017500000045051712112654011023732 00000000000000 Specializable GType System

Specializable GType System

Specializable GType System — Specialized GTypes

Stability Level

Unstable, unless otherwise indicated

Synopsis

#include <dbus/dbus-glib.h>

void                (*DBusGTypeSpecializedCollectionIterator)
                                                        (const GValue *value,
                                                         gpointer user_data);
void                (*DBusGTypeSpecializedMapIterator)  (const GValue *key_val,
                                                         const GValue *value_val,
                                                         gpointer user_data);
                    DBusGTypeSpecializedAppendContext;
gpointer            (*DBusGTypeSpecializedConstructor)  (GType type);
void                (*DBusGTypeSpecializedFreeFunc)     (GType type,
                                                         gpointer val);
gpointer            (*DBusGTypeSpecializedCopyFunc)     (GType type,
                                                         gpointer src);
                    DBusGTypeSpecializedVtable;
gboolean            (*DBusGTypeSpecializedCollectionFixedAccessorFunc)
                                                        (GType type,
                                                         gpointer instance,
                                                         gpointer *values,
                                                         guint *len);
void                (*DBusGTypeSpecializedCollectionIteratorFunc)
                                                        (GType type,
                                                         gpointer instance,
                                                         DBusGTypeSpecializedCollectionIterator iterator,
                                                         gpointer user_data);
void                (*DBusGTypeSpecializedCollectionAppendFunc)
                                                        (DBusGTypeSpecializedAppendContext *ctx,
                                                         GValue *val);
void                (*DBusGTypeSpecializedCollectionEndAppendFunc)
                                                        (DBusGTypeSpecializedAppendContext *ctx);
                    DBusGTypeSpecializedCollectionVtable;
void                (*DBusGTypeSpecializedMapIteratorFunc)
                                                        (GType type,
                                                         gpointer instance,
                                                         DBusGTypeSpecializedMapIterator iterator,
                                                         gpointer user_data);
void                (*DBusGTypeSpecializedMapAppendFunc)
                                                        (DBusGTypeSpecializedAppendContext *ctx,
                                                         GValue *key,
                                                         GValue *val);
                    DBusGTypeSpecializedMapVtable;
gboolean            (*DBusGTypeSpecializedStructGetMember)
                                                        (GType type,
                                                         gpointer instance,
                                                         guint member,
                                                         GValue *ret_value);
gboolean            (*DBusGTypeSpecializedStructSetMember)
                                                        (GType type,
                                                         gpointer instance,
                                                         guint member,
                                                         const GValue *new_value);
                    DBusGTypeSpecializedStructVtable;
GType               dbus_g_type_get_collection          (const char *container,
                                                         GType specialization);
GType               dbus_g_type_get_map                 (const char *container,
                                                         GType key_specialization,
                                                         GType value_specialization);
GType               dbus_g_type_get_structv             (const char *container,
                                                         guint num_members,
                                                         GType *types);
GType               dbus_g_type_get_struct              (const char *container,
                                                         GType first_type,
                                                         ...);
gboolean            dbus_g_type_is_collection           (GType gtype);
gboolean            dbus_g_type_is_map                  (GType gtype);
gboolean            dbus_g_type_is_struct               (GType gtype);
GType               dbus_g_type_get_collection_specialization
                                                        (GType gtype);
GType               dbus_g_type_get_map_key_specialization
                                                        (GType gtype);
GType               dbus_g_type_get_map_value_specialization
                                                        (GType gtype);
GType               dbus_g_type_get_struct_member_type  (GType gtype,
                                                         guint member);
guint               dbus_g_type_get_struct_size         (GType gtype);
gpointer            dbus_g_type_specialized_construct   (GType gtype);
void                dbus_g_type_specialized_init_append (GValue *value,
                                                         DBusGTypeSpecializedAppendContext *ctx);
void                dbus_g_type_specialized_collection_append
                                                        (DBusGTypeSpecializedAppendContext *ctx,
                                                         GValue *elt);
void                dbus_g_type_specialized_collection_end_append
                                                        (DBusGTypeSpecializedAppendContext *ctx);
void                dbus_g_type_specialized_map_append  (DBusGTypeSpecializedAppendContext *ctx,
                                                         GValue *key,
                                                         GValue *val);
gboolean            dbus_g_type_collection_get_fixed    (GValue *value,
                                                         gpointer *data_ret,
                                                         guint *len_ret);
void                dbus_g_type_collection_value_iterate
                                                        (const GValue *value,
                                                         DBusGTypeSpecializedCollectionIterator iterator,
                                                         gpointer user_data);
void                dbus_g_type_map_value_iterate       (const GValue *value,
                                                         DBusGTypeSpecializedMapIterator iterator,
                                                         gpointer user_data);
gboolean            dbus_g_type_struct_get_member       (const GValue *value,
                                                         guint member,
                                                         GValue *dest);
gboolean            dbus_g_type_struct_set_member       (GValue *value,
                                                         guint member,
                                                         const GValue *src);
gboolean            dbus_g_type_struct_get              (const GValue *value,
                                                         guint member,
                                                         ...);
gboolean            dbus_g_type_struct_set              (GValue *value,
                                                         guint member,
                                                         ...);
void                dbus_g_type_specialized_init        (void);
void                dbus_g_type_register_collection     (const char *name,
                                                         const DBusGTypeSpecializedCollectionVtable *vtable,
                                                         guint flags);
void                dbus_g_type_register_map            (const char *name,
                                                         const DBusGTypeSpecializedMapVtable *vtable,
                                                         guint flags);
const DBusGTypeSpecializedMapVtable * dbus_g_type_map_peek_vtable
                                                        (GType map_type);
const DBusGTypeSpecializedCollectionVtable * dbus_g_type_collection_peek_vtable
                                                        (GType collection_type);
const DBusGTypeSpecializedStructVtable * dbus_g_type_struct_peek_vtable
                                                        (GType struct_type);
void                dbus_g_type_register_struct         (const char *name,
                                                         const DBusGTypeSpecializedStructVtable *vtable,
                                                         guint flags);
GVariant *          dbus_g_value_build_g_variant        (const GValue *value);
void                dbus_g_value_parse_g_variant        (GVariant *variant,
                                                         GValue *value);
#define             DBUS_TYPE_G_BOOLEAN_ARRAY
#define             DBUS_TYPE_G_UCHAR_ARRAY
#define             DBUS_TYPE_G_UINT_ARRAY
#define             DBUS_TYPE_G_INT_ARRAY
#define             DBUS_TYPE_G_UINT64_ARRAY
#define             DBUS_TYPE_G_INT64_ARRAY
#define             DBUS_TYPE_G_OBJECT_ARRAY
#define             DBUS_TYPE_G_STRING_STRING_HASHTABLE
typedef             DBusGSignature;
#define             DBUS_TYPE_G_SIGNATURE
typedef             DBusGObjectPath;
#define             DBUS_TYPE_G_OBJECT_PATH

Description

Specialized gtypes are basically a way to allow the definition of recursive GTypes. It allows the definition of 'containers' which is basically a user defined structure capable of holding other data, and a set of functions defining how to access that structure. Containers come in 3 flavors: collections, maps and structs.

A collection is a container that holds an ordered set of items, all of which must be the same type. (This is an array in standard D-Bus terminology.) dbus-glib specialized collections can be GArray (for numeric elements), GPtrArray (for string, object or boxed elements), GSList (for boxed elements, not recommended), or a user-defined type.

A map is a container that holds a set of key/value pairs. The keys have one type, and the values another; the type of the keys must be a numeric or string-like type. (This is a dict (dictionary) or array of dict entry in standard D-Bus terminology.) dbus-glib specialized maps can be GHashTable or a user-defined type.

A struct is a container that holds a fixed number of members, each member having a predefined type. (This is a struct in standard D-Bus terminology.) It is analogous to the C struct keyword, but dbus-glib does not generally represent D-Bus structs in C structs. dbus-glib specialized structs can be GValueArray or a user-defined type.

A specialization is a GType detailing a particular container with particular types (a type specialization).

Functions are provided for constructing and manipulating specializations.

This documentation needs splitting into two pages, one for defining new containers and using existing containers. I expect most users to only do the latter. I also need to add some examples.

Details

DBusGTypeSpecializedCollectionIterator ()

void                (*DBusGTypeSpecializedCollectionIterator)
                                                        (const GValue *value,
                                                         gpointer user_data);

A library-user-supplied function, called for each element in the collection when dbus_g_type_collection_value_iterate() is called.

value :

an element of the collection

user_data :

the data supplied when calling dbus_g_type_collection_value_iterate()

DBusGTypeSpecializedMapIterator ()

void                (*DBusGTypeSpecializedMapIterator)  (const GValue *key_val,
                                                         const GValue *value_val,
                                                         gpointer user_data);

A library-user-supplied function, called for each key/value pair in the collection when dbus_g_type_map_value_iterate() is called.

key_val :

a key from the map

value_val :

a value from the map

user_data :

the data supplied when calling dbus_g_type_map_value_iterate()

DBusGTypeSpecializedAppendContext

typedef struct {
  /* public */
  GValue *val;
  GType specialization_type;
} DBusGTypeSpecializedAppendContext;

A context for appending. There are more fields, which are private.

GValue *val;

the GValue containing the array to which you're appending

GType specialization_type;

the GType of the array's elements

DBusGTypeSpecializedConstructor ()

gpointer            (*DBusGTypeSpecializedConstructor)  (GType type);

type :

a specialized boxed type

Returns :

a new instance of type

DBusGTypeSpecializedFreeFunc ()

void                (*DBusGTypeSpecializedFreeFunc)     (GType type,
                                                         gpointer val);

Frees val according to type. This is analogous to GBoxedFreeFunc, but can use information from type (for instance to free the contents of a container before freeing the actual container).

type :

a specialized boxed type

val :

an instance of type

DBusGTypeSpecializedCopyFunc ()

gpointer            (*DBusGTypeSpecializedCopyFunc)     (GType type,
                                                         gpointer src);

Copies src according to type. This is analogous to GBoxedCopyFunc, but can use information from type (for instance to copy each element of a collection).

type :

a specialized boxed type

src :

an instance of type

Returns :

a deep copy of src

DBusGTypeSpecializedVtable

typedef struct {
  DBusGTypeSpecializedConstructor    constructor;
  DBusGTypeSpecializedFreeFunc       free_func;
  DBusGTypeSpecializedCopyFunc       copy_func;
  GDestroyNotify                     simple_free_func; /* for type-independent freeing if possible */
} DBusGTypeSpecializedVtable;

A table of methods used to implement specialized container behaviour on user-defined collections, maps and structs. Exactly one of free_func and simple_free_func must be implemented; the other must be NULL. constructor and copy_func must always be implemented.

There are additional members, which are reserved for future expansion and must be NULL.

DBusGTypeSpecializedConstructor constructor;

returns a new, blank instance of the type

DBusGTypeSpecializedFreeFunc free_func;

if not NULL, frees the type instance val

DBusGTypeSpecializedCopyFunc copy_func;

returns a "deep copy" of the type instance val

GDestroyNotify simple_free_func;

if not NULL, frees its argument

DBusGTypeSpecializedCollectionFixedAccessorFunc ()

gboolean            (*DBusGTypeSpecializedCollectionFixedAccessorFunc)
                                                        (GType type,
                                                         gpointer instance,
                                                         gpointer *values,
                                                         guint *len);

Implements dbus_g_type_collection_get_fixed() for a GValue with type type, containing instance.

type :

a specialized collection boxed type

instance :

an instance of type

values :

used to return a pointer to the contents of instance

len :

used to return the number of elements in instance

Returns :

TRUE on success

DBusGTypeSpecializedCollectionIteratorFunc ()

void                (*DBusGTypeSpecializedCollectionIteratorFunc)
                                                        (GType type,
                                                         gpointer instance,
                                                         DBusGTypeSpecializedCollectionIterator iterator,
                                                         gpointer user_data);

Implements dbus_g_type_collection_value_iterate() for a GValue with type type, containing instance.

type :

a specialized collection boxed type

instance :

an instance of type

iterator :

the function to call for each element

user_data :

data to pass to iterator

DBusGTypeSpecializedCollectionAppendFunc ()

void                (*DBusGTypeSpecializedCollectionAppendFunc)
                                                        (DBusGTypeSpecializedAppendContext *ctx,
                                                         GValue *val);

Implements dbus_g_type_specialized_collection_append().

This function should use the val and specialization_type members of ctx.

ctx :

an appending context returned by dbus_g_type_specialized_init_append()

val :

a value to copy into the collection

DBusGTypeSpecializedCollectionEndAppendFunc ()

void                (*DBusGTypeSpecializedCollectionEndAppendFunc)
                                                        (DBusGTypeSpecializedAppendContext *ctx);

Implements dbus_g_type_specialized_collection_end_append().

This function should use the val and specialization_type members of ctx.

ctx :

an appending context returned by dbus_g_type_specialized_init_append()

DBusGTypeSpecializedCollectionVtable

typedef struct {
  DBusGTypeSpecializedVtable                        base_vtable;
  DBusGTypeSpecializedCollectionFixedAccessorFunc   fixed_accessor;
  DBusGTypeSpecializedCollectionIteratorFunc        iterator;
  DBusGTypeSpecializedCollectionAppendFunc          append_func;
  DBusGTypeSpecializedCollectionEndAppendFunc       end_append_func;
} DBusGTypeSpecializedCollectionVtable;

A table of methods used to implement specialized collection behaviour on user-defined types. At least iterator and append_func must be implemented.

DBusGTypeSpecializedVtable base_vtable;

base methods shared between collections and other types

DBusGTypeSpecializedCollectionFixedAccessorFunc fixed_accessor;

if not NULL, provides access to the contents of this collection, as documented for dbus_g_type_collection_get_fixed()

DBusGTypeSpecializedCollectionIteratorFunc iterator;

iterates through the members of instance

DBusGTypeSpecializedCollectionAppendFunc append_func;

appends a new member to instance

DBusGTypeSpecializedCollectionEndAppendFunc end_append_func;

if not NULL, called after each group of calls to the append_func

DBusGTypeSpecializedMapIteratorFunc ()

void                (*DBusGTypeSpecializedMapIteratorFunc)
                                                        (GType type,
                                                         gpointer instance,
                                                         DBusGTypeSpecializedMapIterator iterator,
                                                         gpointer user_data);

Implements dbus_g_type_map_value_iterate() for a GValue with type type, containing instance.

type :

a specialized map boxed type

instance :

an instance of type

iterator :

the function to call for each key/value pair

user_data :

data to pass to iterator

DBusGTypeSpecializedMapAppendFunc ()

void                (*DBusGTypeSpecializedMapAppendFunc)
                                                        (DBusGTypeSpecializedAppendContext *ctx,
                                                         GValue *key,
                                                         GValue *val);

Implements dbus_g_type_specialized_map_append().

This function should use the val and specialization_type members of ctx, and replace any existing value with key equal to key.

ctx :

an appending context returned by dbus_g_type_specialized_init_append()

key :

a key to add to the collection

val :

a value to add to the collection

DBusGTypeSpecializedMapVtable

typedef struct {
  DBusGTypeSpecializedVtable                        base_vtable;
  DBusGTypeSpecializedMapIteratorFunc               iterator;
  DBusGTypeSpecializedMapAppendFunc                 append_func;
} DBusGTypeSpecializedMapVtable;

A table of methods used to implement specialized collection behaviour on user-defined types. Both methods must be implemented.

DBusGTypeSpecializedVtable base_vtable;

base methods shared between maps and other types

DBusGTypeSpecializedMapIteratorFunc iterator;

iterates through the members of instance

DBusGTypeSpecializedMapAppendFunc append_func;

adds a new key/value pair to instance

DBusGTypeSpecializedStructGetMember ()

gboolean            (*DBusGTypeSpecializedStructGetMember)
                                                        (GType type,
                                                         gpointer instance,
                                                         guint member,
                                                         GValue *ret_value);

Implements dbus_g_type_struct_get_member() for a GValue with type type, containing instance.

type :

a specialized struct boxed type

instance :

an instance of type

member :

the index of the member, starting from 0

ret_value :

an initialized GValue of the appropriate type for the given member of type

Returns :

TRUE on success

DBusGTypeSpecializedStructSetMember ()

gboolean            (*DBusGTypeSpecializedStructSetMember)
                                                        (GType type,
                                                         gpointer instance,
                                                         guint member,
                                                         const GValue *new_value);

Implements dbus_g_type_struct_set_member() for a GValue with type type, containing instance.

type :

a specialized struct boxed type

instance :

an instance of type

member :

the index of the member, starting from 0

new_value :

an initialized GValue of the appropriate type for the given member of type

Returns :

TRUE on success

DBusGTypeSpecializedStructVtable

typedef struct {
  DBusGTypeSpecializedVtable                        base_vtable;
  DBusGTypeSpecializedStructGetMember               get_member;
  DBusGTypeSpecializedStructSetMember               set_member;
} DBusGTypeSpecializedStructVtable;

A table of methods used to implement specialized collection behaviour on user-defined types. Both methods must be implemented.

DBusGTypeSpecializedVtable base_vtable;

base methods shared between maps and other types

DBusGTypeSpecializedStructGetMember get_member;

returns a member by its index

DBusGTypeSpecializedStructSetMember set_member;

sets a member by its index

dbus_g_type_get_collection ()

GType               dbus_g_type_get_collection          (const char *container,
                                                         GType specialization);

Gets a GType for a particular collection instance, creating the type if not already created.

container :

a string specifying a registered collection type

specialization :

GType of collection elements

Returns :

the GType of that instance

dbus_g_type_get_map ()

GType               dbus_g_type_get_map                 (const char *container,
                                                         GType key_specialization,
                                                         GType value_specialization);

Gets a GType for a particular map instance, creating the type if not already created.

container :

a string specifying a registered map type

key_specialization :

GType of keys

value_specialization :

GType of values

Returns :

the GType of that instance

dbus_g_type_get_structv ()

GType               dbus_g_type_get_structv             (const char *container,
                                                         guint num_members,
                                                         GType *types);

Gets a GType for a particular struct instance, creating the type if not already created.

container :

a string specifying a registered struct type

num_members :

number of members in the struct

types :

an array specufying a GType for each struct element

Returns :

the GType of that instance

dbus_g_type_get_struct ()

GType               dbus_g_type_get_struct              (const char *container,
                                                         GType first_type,
                                                         ...);

Varags methsod to get a GType for a particular struct instance, creating the type if not already created.

container :

a string specifying a registered struct type

first_type :

GType for the struct's first member

... :

more GTypes for the struct's members, terminated by G_TYPE_INVALID

Returns :

the GType of that instance

dbus_g_type_is_collection ()

gboolean            dbus_g_type_is_collection           (GType gtype);

Tests if a given GType is a collection.

gtype :

a GType to test

Returns :

true if the given GType is a collection

dbus_g_type_is_map ()

gboolean            dbus_g_type_is_map                  (GType gtype);

Tests if a given GType is a map, i.e. it was created with dbus_g_type_get_map().

gtype :

a GType to test

Returns :

true if the given GType is a map

dbus_g_type_is_struct ()

gboolean            dbus_g_type_is_struct               (GType gtype);

Tests if a given GType is a struct, i.e. it was created with dbus_g_type_get_struct()

gtype :

a GType to test

Returns :

true if the given GType is a struct

dbus_g_type_get_collection_specialization ()

GType               dbus_g_type_get_collection_specialization
                                                        (GType gtype);

Return the type of each element in collections of type gtype. It is an error to call this function on a non-collection type.

gtype :

a collection GType, as created by dbus_g_type_get_collection()

Returns :

the element type for a given collection GType.

dbus_g_type_get_map_key_specialization ()

GType               dbus_g_type_get_map_key_specialization
                                                        (GType gtype);

Return the type of the keys in maps of type gtype. It is an error to call this function on a non-map type.

gtype :

a map GType, as created by dbus_g_type_get_map()

Returns :

the key type for a given map GType.

dbus_g_type_get_map_value_specialization ()

GType               dbus_g_type_get_map_value_specialization
                                                        (GType gtype);

Return the type of the values in maps of type gtype. It is an error to call this function on a non-map type.

gtype :

a map GType, as created by dbus_g_type_get_map().

Returns :

the value type for a given map GType.

dbus_g_type_get_struct_member_type ()

GType               dbus_g_type_get_struct_member_type  (GType gtype,
                                                         guint member);

Get the type of a member of a specialized struct. It is an error to call this function on a non-struct type.

gtype :

a struct GType, as created with dbus_g_type_get_struct()

member :

the index of a struct member

Returns :

the type for a given member of a struct GType, or G_TYPE_INVALID if member >= dbus_g_type_get_struct_size()

dbus_g_type_get_struct_size ()

guint               dbus_g_type_get_struct_size         (GType gtype);

Get the number of members in a specialized struct. It is an error to call this function on a non-struct type.

gtype :

a struct GType, as created with dbus_g_type_get_struct().

Returns :

the number of members in a given struct GType.

dbus_g_type_specialized_construct ()

gpointer            dbus_g_type_specialized_construct   (GType gtype);

Create an instance of a given specialized type. The structure created and returned will depend on the container type of the GType. E.g. If the given type was created by dbus_g_type_get_collection("GArray", G_TYPE_INT), then this will return a GArray with element_size of sizeof(int)

gtype :

a specialized GType, as created by dbus_g_type_get_collection(), dbus_g_type_get_map() or dbus_g_type_get_struct()

Returns :

a pointer to a newly constructed instance of the given type.

dbus_g_type_specialized_init_append ()

void                dbus_g_type_specialized_init_append (GValue *value,
                                                         DBusGTypeSpecializedAppendContext *ctx);

Create a new context for adding elements to a collection or key/value pairs to a map. You generally don't need or want to use this..

value :

a GValue containing an instance of specialized type

ctx :

a DBusGTypeSpecializedAppendContext in which to return a new appending context.

dbus_g_type_specialized_collection_append ()

void                dbus_g_type_specialized_collection_append
                                                        (DBusGTypeSpecializedAppendContext *ctx,
                                                         GValue *elt);

Appends a given element to the end of a collection.

ctx :

a context created by dbus_g_type_specialized_init_append() for a GValue containing a collection

elt :

a GValue containing an element to append to the collection

dbus_g_type_specialized_collection_end_append ()

void                dbus_g_type_specialized_collection_end_append
                                                        (DBusGTypeSpecializedAppendContext *ctx);

Finish appending elements to a given collection

ctx :

a context created by dbus_g_type_specialized_init_append() for a GValue containing a collection

dbus_g_type_specialized_map_append ()

void                dbus_g_type_specialized_map_append  (DBusGTypeSpecializedAppendContext *ctx,
                                                         GValue *key,
                                                         GValue *val);

Inserts the given key/value pair into the map instance.

ctx :

a context created by dbus_g_type_specialized_init_append() for a GValue containing a map

key :

a GValue containing a key, whose contents will be stolen by ctx

val :

a GValue containing a value, whose contents will be stolen by ctx

dbus_g_type_collection_get_fixed ()

gboolean            dbus_g_type_collection_get_fixed    (GValue *value,
                                                         gpointer *data_ret,
                                                         guint *len_ret);

Calling this function is likely to be a bad idea. Consider using dbus_g_type_collection_value_iterate() instead.

On success, data_ret is a pointer to the underlying data in a collection of fixed-length fundamental types. Knowledge of the underlying data model of the collection is needed in order to use data_ret correctly.

It is an error to call this function on a specialized type that is not a collection, or on a collection that does not have a fixed_accessor in its DBusGTypeSpecializedCollectionVtable.

Specialized GArrays are the only types provided by dbus-glib that can be used with this function; user-defined types might also work.

value :

a GValue containing a boxed specialized collection that has a fixed_accessor in its vtable

data_ret :

used to return a pointer to the fixed data, which must not be modified (for instance, for a GArray of gint, this would point to an array of gint)

len_ret :

used to return the length (counting collection elements, not bytes: in a GArray containing one gint, this would be 1)

Returns :

TRUE on success

dbus_g_type_collection_value_iterate ()

void                dbus_g_type_collection_value_iterate
                                                        (const GValue *value,
                                                         DBusGTypeSpecializedCollectionIterator iterator,
                                                         gpointer user_data);

Calls the given function for each element of the collection. The function is passed a GValue containing the element and the given user_data parameter. The collection may not be modified while iterating over it.

value :

a GValue holding a collection type.

iterator :

a function to call for each element

user_data :

user data to pass to the iterator

dbus_g_type_map_value_iterate ()

void                dbus_g_type_map_value_iterate       (const GValue *value,
                                                         DBusGTypeSpecializedMapIterator iterator,
                                                         gpointer user_data);

Calls the given function for each key/value pair of the map. The function is passed two GValues containing the key/value pair and the given user_data parameter. The map may not be modified while iterating over it.

value :

a GValue holding a specialized map

iterator :

a function to call for each element

user_data :

user data to pass to the iterator

dbus_g_type_struct_get_member ()

gboolean            dbus_g_type_struct_get_member       (const GValue *value,
                                                         guint member,
                                                         GValue *dest);

Fetches a given member of a given struct instance. dest must be initialised was the correct type for that member, e.g. as returned by dbus_g_type_get_struct_member_type

value :

a GValue containing a struct instance

member :

the index of a given member

dest :

an initialised GValue in which to return the struct member

Returns :

TRUE if successful

dbus_g_type_struct_set_member ()

gboolean            dbus_g_type_struct_set_member       (GValue *value,
                                                         guint member,
                                                         const GValue *src);

Sets a given member of a struct to a new value. The type of src must match the existing type of member member of the struct.

value :

a GValue containing a struct instance

member :

the index of a given member

src :

an GValue containing the new value for that struct member

Returns :

TRUE if successful

dbus_g_type_struct_get ()

gboolean            dbus_g_type_struct_get              (const GValue *value,
                                                         guint member,
                                                         ...);

Collects the selected values of this struct into the return locations provided.

value :

a GValue containing a struct instance

member :

struct member to get

... :

location in which to return the value of this member, followed optionally by more member/return locations pairs, followed by by G_MAXUINT

Returns :

FALSE on failure

dbus_g_type_struct_set ()

gboolean            dbus_g_type_struct_set              (GValue *value,
                                                         guint member,
                                                         ...);

Sets the selected members of the struct in value.

value :

a GValue containing a struct instance

member :

struct member to set

... :

value for the first member, followed optionally by more member/value pairs, followed by G_MAXUINT

Returns :

FALSE on failure

dbus_g_type_specialized_init ()

void                dbus_g_type_specialized_init        (void);

Initialize dbus-glib specialized GTypes.

In older versions of dbus-glib, it was necessary to do this before instantiating or registering any specialized type. It is now done automatically whenever necessary.


dbus_g_type_register_collection ()

void                dbus_g_type_register_collection     (const char *name,
                                                         const DBusGTypeSpecializedCollectionVtable *vtable,
                                                         guint flags);

Defines a new collection container.

name :

The name of a new collection container

vtable :

the vtable defining the new container

flags :

As yet unused.

dbus_g_type_register_map ()

void                dbus_g_type_register_map            (const char *name,
                                                         const DBusGTypeSpecializedMapVtable *vtable,
                                                         guint flags);

Defines a new map container.

name :

The name of a new map container

vtable :

the vtable defining the new container

flags :

As yet unused.

dbus_g_type_map_peek_vtable ()

const DBusGTypeSpecializedMapVtable * dbus_g_type_map_peek_vtable
                                                        (GType map_type);

Peek the vtable for a given map specialization

map_type :

a gtype of a map specialization

Returns :

the vtable

dbus_g_type_collection_peek_vtable ()

const DBusGTypeSpecializedCollectionVtable * dbus_g_type_collection_peek_vtable
                                                        (GType collection_type);

Peek the vtable for a given collection specialization

collection_type :

a gtype of a collection specialization

Returns :

the vtable

dbus_g_type_struct_peek_vtable ()

const DBusGTypeSpecializedStructVtable * dbus_g_type_struct_peek_vtable
                                                        (GType struct_type);

Peek the vtable for a given struct specialization

struct_type :

a gtype of a struct specialization

Returns :

the vtable

dbus_g_type_register_struct ()

void                dbus_g_type_register_struct         (const char *name,
                                                         const DBusGTypeSpecializedStructVtable *vtable,
                                                         guint flags);

Defines a new struct container.

name :

The name of a new struct container

vtable :

the vtable defining the new container

flags :

As yet unused.

dbus_g_value_build_g_variant ()

GVariant *          dbus_g_value_build_g_variant        (const GValue *value);

Recurses value and converts its contents to a GVariant.

The value must either be a simple value (integer, string, boolean, object path etc.) or a specialized container registered with dbus_g_type_get_collection(), dbus_g_type_get_map() or dbus_g_type_get_struct(). Providing any other type is a programming error (including as a child type).

value :

a simple or specialized GValue to convert to a GVariant

Returns :

a new GVariant containing value with a floating reference

dbus_g_value_parse_g_variant ()

void                dbus_g_value_parse_g_variant        (GVariant *variant,
                                                         GValue *value);

Deserialize variant and put an equivalent dbus-glib data structure in value.

It is an error if variant contains any GVariant extensions not supported by dbus-glib, including handles (file descriptor passing) and 'maybe' types.

variant :

a GVariant

value :

a zero-filled GValue

DBUS_TYPE_G_BOOLEAN_ARRAY

#define DBUS_TYPE_G_BOOLEAN_ARRAY  (dbus_g_type_get_collection ("GArray", G_TYPE_BOOLEAN))

Expands to a function call returning the GType of a GArray of gboolean (corresponding to the D-Bus signature "ab").


DBUS_TYPE_G_UCHAR_ARRAY

#define DBUS_TYPE_G_UCHAR_ARRAY    (dbus_g_type_get_collection ("GArray", G_TYPE_UCHAR))

Expands to a function call returning the GType of a GArray of guchar (corresponding to the D-Bus signature "ay").

Note that this is not the same thing as a GByteArray! dbus-glib does not know about the GByteArray type.


DBUS_TYPE_G_UINT_ARRAY

#define DBUS_TYPE_G_UINT_ARRAY     (dbus_g_type_get_collection ("GArray", G_TYPE_UINT))

Expands to a function call returning the GType of a GArray of guint (corresponding to the D-Bus signature "au").


DBUS_TYPE_G_INT_ARRAY

#define DBUS_TYPE_G_INT_ARRAY      (dbus_g_type_get_collection ("GArray", G_TYPE_INT))

Expands to a function call returning the GType of a GArray of gint (corresponding to the D-Bus signature "ai").


DBUS_TYPE_G_UINT64_ARRAY

#define DBUS_TYPE_G_UINT64_ARRAY   (dbus_g_type_get_collection ("GArray", G_TYPE_UINT64))

Expands to a function call returning the GType of a GArray of guint64 (corresponding to the D-Bus signature "at").


DBUS_TYPE_G_INT64_ARRAY

#define DBUS_TYPE_G_INT64_ARRAY    (dbus_g_type_get_collection ("GArray", G_TYPE_INT64))

Expands to a function call returning the GType of a GArray of gint64 (corresponding to the D-Bus signature "ax").


DBUS_TYPE_G_OBJECT_ARRAY

#define DBUS_TYPE_G_OBJECT_ARRAY   (dbus_g_type_get_collection ("GPtrArray", G_TYPE_OBJECT))

Expands to a function call returning the GType of a GPtrArray of GObject.

Use this type with caution: it can sometimes be used as a representation of arrays whose D-Bus signature is "ao" (transferred as an array of object paths), but the conventional type for such arrays is (dbus_g_type_get_collection ("GPtrArray", DBUS_TYPE_G_OBJECT_PATH)).


DBUS_TYPE_G_STRING_STRING_HASHTABLE

#define DBUS_TYPE_G_STRING_STRING_HASHTABLE (dbus_g_type_get_map ("GHashTable", G_TYPE_STRING, G_TYPE_STRING))

Expands to a function call returning the GType of a GHashTable where the keys are strings and the values are also strings (corresponding to the D-Bus signature "a{ss}").


DBusGSignature

typedef gchar DBusGSignature;

A typedef for a string used to represent D-Bus signatures. Its GType is DBUS_TYPE_G_SIGNATURE, derived from G_TYPE_BOXED.

Prior to version 0.FIXME this was used as the type name of DBUS_TYPE_G_SIGNATURE, but did not actually exist as a typedef.

Since 0.FIXME


DBUS_TYPE_G_SIGNATURE

#define DBUS_TYPE_G_SIGNATURE (dbus_g_signature_get_g_type ())

The GType of a DBusGSignature, which is a boxed type containing a D-Bus signature as a zero-terminated string. Signatures can be copied with g_strdup() and freed with g_free(), just like G_TYPE_STRING, but have a distinct boxed type to allow them to be distinguished when stored in a GValue.

Returns :

a type derived from G_TYPE_BOXED

DBusGObjectPath

typedef gchar DBusGObjectPath;

A typedef for a string used to represent D-Bus object paths. Its GType is DBUS_TYPE_G_OBJECT_PATH, derived from G_TYPE_BOXED.

Prior to version 0.FIXME this was used as the type name of DBUS_TYPE_G_OBJECT_PATH, but did not actually exist as a typedef.

Since 0.FIXME


DBUS_TYPE_G_OBJECT_PATH

#define DBUS_TYPE_G_OBJECT_PATH (dbus_g_object_path_get_g_type ())

The GType of a DBusGObjectPath, which is a boxed type containing a D-Bus object path as a zero-terminated string. Object paths can be copied with g_strdup() and freed with g_free(), just like G_TYPE_STRING, but have a distinct boxed type to allow them to be distinguished when stored in a GValue.

Returns :

a type derived from G_TYPE_BOXED
dbus-glib-0.100.2/doc/reference/html/dbus-glib-DBusGMethod.html0000644000175000017500000003276012112654011020754 00000000000000 DBusGMethod

DBusGMethod

DBusGMethod — GMethod Info & Invocation

Stability Level

Stable, unless otherwise indicated

Synopsis

#include <dbus/dbus-glib.h>

struct              DBusGMethodInfo;
                    DBusGMethodInvocation;
gchar *             dbus_g_method_get_sender            (DBusGMethodInvocation *context);
DBusMessage *       dbus_g_method_get_reply             (DBusGMethodInvocation *context);
void                dbus_g_method_send_reply            (DBusGMethodInvocation *context,
                                                         DBusMessage *reply);
void                dbus_g_method_return                (DBusGMethodInvocation *context,
                                                         ...);
void                dbus_g_method_return_error          (DBusGMethodInvocation *context,
                                                         const GError *error);

Description

These types are used to call methods on GObject objects.

Details

struct DBusGMethodInfo

struct DBusGMethodInfo {
  GCallback                 function;    
  GClosureMarshal           marshaller;  
  int                       data_offset; 
};

Object typically generated by dbus-binding-tool that stores a mapping from introspection data to a function pointer for a C method to be invoked.

GCallback function;

C method to invoke

GClosureMarshal marshaller;

Marshaller to invoke method

int data_offset;

Offset into the introspection data

DBusGMethodInvocation

typedef struct _DBusGMethodInvocation DBusGMethodInvocation;

The context of an asynchronous method call. See dbus_g_method_return() and dbus_g_method_return_error().


dbus_g_method_get_sender ()

gchar *             dbus_g_method_get_sender            (DBusGMethodInvocation *context);

Get the sender of a message so we can send a "reply" later (i.e. send a message directly to a service which invoked the method at a later time).

context :

the method context

Returns :

the unique name of the sender. It is up to the caller to free the returned string.

dbus_g_method_get_reply ()

DBusMessage *       dbus_g_method_get_reply             (DBusGMethodInvocation *context);

Get the reply message to append reply values Used as a sidedoor when you can't generate dbus values of the correct type due to glib binding limitations

context :

the method context

Returns :

a DBusMessage with the reply

dbus_g_method_send_reply ()

void                dbus_g_method_send_reply            (DBusGMethodInvocation *context,
                                                         DBusMessage *reply);

Send a manually created reply message.

Used as a sidedoor when you can't generate dbus values of the correct type due to glib binding limitations

context :

the method context

reply :

the reply message, will be unreffed

dbus_g_method_return ()

void                dbus_g_method_return                (DBusGMethodInvocation *context,
                                                         ...);

Send a return message for a given method invocation, with arguments. This function also frees the sending context.

context :

the method context

... :

zero or more values to return from the method, with their number and types given by its DBusGObjectInfo

dbus_g_method_return_error ()

void                dbus_g_method_return_error          (DBusGMethodInvocation *context,
                                                         const GError *error);

Send a error message for a given method invocation. This function also frees the sending context.

context :

the method context

error :

the error to send

See Also

DBusGMessage
dbus-glib-0.100.2/doc/reference/html/dbus-glib-DBus-GObject-related-functions.html0000644000175000017500000005213112112654011024435 00000000000000 DBus GObject related functions

DBus GObject related functions

DBus GObject related functions — Exporting a GObject remotely

Stability Level

Stable, unless otherwise indicated

Synopsis

#include <dbus/dbus-glib.h>

struct              DBusGObjectInfo;
void                dbus_g_object_type_install_info     (GType object_type,
                                                         const DBusGObjectInfo *info);
void                dbus_g_object_type_register_shadow_property
                                                        (GType iface_type,
                                                         const char *dbus_prop_name,
                                                         const char *shadow_prop_name);
GType               dbus_g_object_path_get_g_type       (void);
void                dbus_g_object_register_marshaller   (GClosureMarshal marshaller,
                                                         GType rettype,
                                                         ...);
void                dbus_g_object_register_marshaller_array
                                                        (GClosureMarshal marshaller,
                                                         GType rettype,
                                                         guint n_types,
                                                         const GType *types);
void                dbus_glib_global_set_disable_legacy_property_access
                                                        (void);

Description

FIXME

Details

struct DBusGObjectInfo

struct DBusGObjectInfo {
  int   format_version;
                       
  const DBusGMethodInfo *method_infos;
  int   n_method_infos;                
  const char *data; 
  const char *exported_signals;  
  const char *exported_properties; 
};

Introspection data for a GObject, normally autogenerated by a tool such as dbus-binding-tool.

int format_version;

Allows us to change the rest of this struct by adding DBusGObjectInfo2, DBusGObjectInfo3, etc.

const DBusGMethodInfo *method_infos;

Array of method pointers

int n_method_infos;

Length of the infos array

const char *data;

Introspection data

const char *exported_signals;

Exported signals

const char *exported_properties;

Exported properties

dbus_g_object_type_install_info ()

void                dbus_g_object_type_install_info     (GType object_type,
                                                         const DBusGObjectInfo *info);

Install introspection information about the given object GType sufficient to allow methods on the object to be invoked by name. The introspection information is normally generated by dbus-glib-tool, then this function is called in the class_init() for the object class.

Once introspection information has been installed, instances of the object registered with dbus_g_connection_register_g_object() can have their methods invoked remotely.

object_type :

GType for the object

info :

introspection data generated by dbus-glib-tool

dbus_g_object_type_register_shadow_property ()

void                dbus_g_object_type_register_shadow_property
                                                        (GType iface_type,
                                                         const char *dbus_prop_name,
                                                         const char *shadow_prop_name);

Registers a new property name shadow_prop_name that overrides the dbus_prop_name in D-Bus property get/set requests. Since all properties for all interfaces implemented by a GObject exist in the same namespace, this allows implementations to use the same property name in two or more D-Bus interfaces implemented by the same GObject, as long as one of those D-Bus interface properties is registered with a shadow property name.

For example, if both org.foobar.Baz.InterfaceA and org.foobar.Baz.InterfaceB have a D-Bus property called "Bork", the developer assigns a shadow property name to the conflicting property name in one or both of these GInterfaces to resolve the conflict. Assume the GInterface implementing org.foobar.Baz.InterfaceA registers a shadow property called "a-bork", while the GInterface implementing org.foobar.Baz.InterfaceB registers a shadow property called "b-bork". The GObject implementing both these GInterfaces would then use #g_object_class_override_property() to implement both "a-bork" and "b-bork" and D-Bus requests for "Bork" on either D-Bus interface will not conflict.

iface_type :

GType for the GInterface

dbus_prop_name :

D-Bus property name (as specified in the introspection data) to override with the shadow property name (as specified in the GType's initialization function, ie glib-style)

shadow_prop_name :

property name which should override the shadow property

dbus_g_object_path_get_g_type ()

GType               dbus_g_object_path_get_g_type       (void);


dbus_g_object_register_marshaller ()

void                dbus_g_object_register_marshaller   (GClosureMarshal marshaller,
                                                         GType rettype,
                                                         ...);

Register a GClosureMarshal to be used for signal invocations, giving its return type and a list of parameter types, followed by G_TYPE_INVALID.

This function will not be needed once GLib includes libffi.

marshaller :

a GClosureMarshal to be used for invocation

rettype :

a GType for the return type of the function

... :

The parameter GTypes, followed by G_TYPE_INVALID

dbus_g_object_register_marshaller_array ()

void                dbus_g_object_register_marshaller_array
                                                        (GClosureMarshal marshaller,
                                                         GType rettype,
                                                         guint n_types,
                                                         const GType *types);

Register a GClosureMarshal to be used for signal invocations. see_also dbus_g_object_register_marshaller()

marshaller :

a GClosureMarshal to be used for invocation

rettype :

a GType for the return type of the function

n_types :

number of function parameters

types :

a C array of GTypes values

dbus_glib_global_set_disable_legacy_property_access ()

void                dbus_glib_global_set_disable_legacy_property_access
                                                        (void);

For historical reasons, DBus-GLib will allow read-only access to every GObject property of an object exported to the bus, regardless of whether or not the property is listed in the type info installed with dbus_g_object_type_install_info(). (Write access is denied however).

If you wish to restrict even read-only access, you can call this method to globally change the behavior for the entire process.

Since 0.88

See Also

GObject
dbus-glib-0.100.2/doc/reference/html/ch03.html0000644000175000017500000000344412112654011015533 00000000000000 Tools Reference

Tools Reference

dbus-binding-tool — C language GLib bindings generation utility
dbus-glib-0.100.2/doc/reference/html/right.png0000644000175000017500000000073012112654010015725 00000000000000PNG  IHDRw=bKGD pHYs  ~tIME2 I%=eIDATx!o@.'**M0$$?1~vIeEuLl&4䝠Bݛ|>$ݶoc DBusGError

DBusGError

DBusGError — DBus GError

Stability Level

Stable, unless otherwise indicated

Synopsis

#include <dbus/dbus-glib.h>

enum                DBusGError;
gboolean            dbus_g_error_has_name               (GError *error,
                                                         const char *name);
const char *        dbus_g_error_get_name               (GError *error);
void                dbus_g_error_domain_register        (GQuark domain,
                                                         const char *default_iface,
                                                         GType code_enum);
#define             DBUS_GERROR

Description

DBusGError is the GError used by DBus.

Details

enum DBusGError

typedef enum {
DBUS_GERROR_FAILED,
DBUS_GERROR_NO_MEMORY,
DBUS_GERROR_SERVICE_UNKNOWN,
DBUS_GERROR_NAME_HAS_NO_OWNER,
DBUS_GERROR_NO_REPLY,
DBUS_GERROR_IO_ERROR,
DBUS_GERROR_BAD_ADDRESS,
DBUS_GERROR_NOT_SUPPORTED,
DBUS_GERROR_LIMITS_EXCEEDED,
DBUS_GERROR_ACCESS_DENIED,
DBUS_GERROR_AUTH_FAILED,
DBUS_GERROR_NO_SERVER,
DBUS_GERROR_TIMEOUT,
DBUS_GERROR_NO_NETWORK,
DBUS_GERROR_ADDRESS_IN_USE,
DBUS_GERROR_DISCONNECTED,
DBUS_GERROR_INVALID_ARGS,
DBUS_GERROR_FILE_NOT_FOUND,
DBUS_GERROR_FILE_EXISTS,
DBUS_GERROR_UNKNOWN_METHOD,
DBUS_GERROR_TIMED_OUT,
DBUS_GERROR_MATCH_RULE_NOT_FOUND,
DBUS_GERROR_MATCH_RULE_INVALID,
DBUS_GERROR_SPAWN_EXEC_FAILED,
DBUS_GERROR_SPAWN_FORK_FAILED,
DBUS_GERROR_SPAWN_CHILD_EXITED,
DBUS_GERROR_SPAWN_CHILD_SIGNALED,
DBUS_GERROR_SPAWN_FAILED,
DBUS_GERROR_UNIX_PROCESS_ID_UNKNOWN,
DBUS_GERROR_INVALID_SIGNATURE,
DBUS_GERROR_INVALID_FILE_CONTENT,
DBUS_GERROR_SELINUX_SECURITY_CONTEXT_UNKNOWN,
DBUS_GERROR_REMOTE_EXCEPTION
} DBusGError;

A GError enumeration for the domain DBUS_GERROR. The values' meanings can be found by looking at the comments for the corresponding constants in dbus-protocol.h.


dbus_g_error_has_name ()

gboolean            dbus_g_error_has_name               (GError *error,
                                                         const char *name);

Determine whether D-BUS error name for a remote exception matches the given name. This function is intended to be invoked on a GError returned from an invocation of a remote method, e.g. via dbus_g_proxy_end_call(). It will silently return FALSE for errors which are not remote D-BUS exceptions (i.e. with a domain other than DBUS_GERROR or a code other than DBUS_GERROR_REMOTE_EXCEPTION).

error :

the GError given from the remote method

name :

the D-BUS error name

Returns :

TRUE if and only if the remote error has the given name

dbus_g_error_get_name ()

const char *        dbus_g_error_get_name               (GError *error);

This function may only be invoked on a GError returned from an invocation of a remote method, e.g. via dbus_g_proxy_end_call(). Moreover, you must ensure that the error's domain is DBUS_GERROR, and the code is DBUS_GERROR_REMOTE_EXCEPTION.

error :

the GError given from the remote method

Returns :

the D-BUS name for a remote exception.

dbus_g_error_domain_register ()

void                dbus_g_error_domain_register        (GQuark domain,
                                                         const char *default_iface,
                                                         GType code_enum);

Register a GError domain and set of codes with D-Bus. When an object raises a GError in the domain domain from one of its D-Bus methods, the D-Bus error name used will be default_iface, followed by a dot, followed by the GEnumValue.value_nick corresponding to the GError.code. For D-Bus, it's conventional to use an error name (value_nick) that is in CamelCase.

(For instance, if a D-Bus method com.example.MyObject.GetThings can raise a GError with domain MY_ERROR and code MY_ERROR_NOT_HAPPY, you could call dbus_g_error_domain_register (MY_ERROR, "com.example.MyError", MY_TYPE_ERROR), and set up the value_nick for MY_ERROR_NOT_HAPPY to be NotHappy, resulting in the D-Bus error string com.example.MyError.NotHappy.)

If default_iface is NULL, the D-Bus interface of the method that failed will be used.

(For instance, if the above example had called dbus_g_error_domain_register (MY_ERROR, NULL, MY_TYPE_ERROR) instead, then the D-Bus error string would be com.example.MyObject.NotHappy.)

domain :

the GError domain

default_iface :

the prefix used for error values, or NULL

code_enum :

a GType for a GEnum of the error codes

DBUS_GERROR

#define DBUS_GERROR dbus_g_error_quark ()

Expands to a function call returning the error domain quark for DBusGError, for use with GError.

See Also

GError
dbus-glib-0.100.2/doc/reference/html/dbus-glib-DBus-GLib-low-level.html0000644000175000017500000003457412112654011022230 00000000000000 DBus GLib low level

DBus GLib low level

DBus GLib low level — DBus lower level functions

Stability Level

Unstable, unless otherwise indicated

Synopsis

#include <dbus/dbus-glib-lowlevel.h>

void                dbus_set_g_error                    (GError **gerror,
                                                         DBusError *derror);
void                dbus_connection_setup_with_g_main   (DBusConnection *connection,
                                                         GMainContext *context);
DBusGConnection *   dbus_connection_get_g_connection    (DBusConnection *connection);
void                dbus_server_setup_with_g_main       (DBusServer *server,
                                                         GMainContext *context);
#define             DBUS_TYPE_CONNECTION
#define             DBUS_TYPE_MESSAGE

Description

These functions can be used to access lower level of DBus.

Details

dbus_set_g_error ()

void                dbus_set_g_error                    (GError **gerror,
                                                         DBusError *derror);

Store the information from a DBus method error return into a GError. For the normal case of an arbitrary remote process, the error code will be DBUS_GERROR_REMOTE_EXCEPTION. Now, DBus errors have two components; a message and a "name". The former is an arbitrary (normally American English) string. The second is a string like com.example.FooFailure which programs can use as a conditional source. Because a GError only has one string, we use a hack to encode both values:

<human readable string><null><error name><null>

You can use the following code to retrieve both values:

1
2
3
const char *msg = error->message;
size_t len = strlen(msg);
const char *error_name = msg+len+1;

gerror :

an error

derror :

a DBusError

dbus_connection_setup_with_g_main ()

void                dbus_connection_setup_with_g_main   (DBusConnection *connection,
                                                         GMainContext *context);

Sets the watch and timeout functions of a DBusConnection to integrate the connection with the GLib main loop. Pass in NULL for the GMainContext unless you're doing something specialized.

If called twice for the same context, does nothing the second time. If called once with context A and once with context B, context B replaces context A as the context monitoring the connection.

connection :

the connection

context :

the GMainContext or NULL for default context

dbus_connection_get_g_connection ()

DBusGConnection *   dbus_connection_get_g_connection    (DBusConnection *connection);

Get the DBusGConnection corresponding to this DBusConnection. This only makes sense if the DBusConnection was originally a DBusGConnection that was registered with the GLib main loop. The return value does not have its refcount incremented.

connection :

a DBusConnection

Returns :

DBusGConnection

dbus_server_setup_with_g_main ()

void                dbus_server_setup_with_g_main       (DBusServer *server,
                                                         GMainContext *context);

Sets the watch and timeout functions of a DBusServer to integrate the server with the GLib main loop. In most cases the context argument should be NULL.

If called twice for the same context, does nothing the second time. If called once with context A and once with context B, context B replaces context A as the context monitoring the connection.

server :

the server

context :

the GMainContext or NULL for default

DBUS_TYPE_CONNECTION

#define DBUS_TYPE_CONNECTION      (dbus_connection_get_g_type ())

Expands to a function call returning a boxed GType representing a DBusConnection pointer from libdbus. Not to be confused with DBUS_TYPE_G_CONNECTION, which you should usually use instead.

Returns :

the GLib type

DBUS_TYPE_MESSAGE

#define DBUS_TYPE_MESSAGE         (dbus_message_get_g_type ())

Expands to a function call returning a boxed GType representing a DBusMessage pointer from libdbus. Not to be confused with DBUS_TYPE_G_MESSAGE, which you should usually use instead.

Returns :

the GLib type
dbus-glib-0.100.2/doc/reference/html/ch01.html0000644000175000017500000000635212112654011015532 00000000000000 Introduction

Introduction

D-Bus is a message bus system, a simple way for applications to talk to one another.

D-Bus supplies both a system daemon (for events such as "new hardware device added" or "printer queue changed") and a per-user-login-session daemon (for general IPC needs among user applications). Also, the message bus is built on top of a general one-to-one message passing framework, which can be used by any two apps to communicate directly (without going through the message bus daemon). Currently the communicating applications are on one computer, but TCP/IP option is available and remote support planned.

The D-Bus API isn't finished yet, and the design is by no means set in stone. One of our main goals is for lots of projects to use it, so if you wouldn't use it, by all means mail us and say why - design, licensing, indentation style, we would rather know than not know.

D-Bus' only required dependency is an XML parser (either libxml or expat). D-Bus includes many language bindings to the D-Bus system, if you want to build those. The list of projects using D-Bus is growing and they provide a wealth of examples of using the various APIs to learn from.

Trying out D-Bus in sample applications is encouraged - we want to get it widely used and tested. It should be working pretty well these days, and when it isn't bug reports are very welcome.

For more information on D-Bus, see http://www.freedesktop.org/wiki/Software/dbus.

dbus-glib-0.100.2/doc/reference/html/up.png0000644000175000017500000000062612112654010015240 00000000000000PNG  IHDRw=bKGD pHYs  ~tIME2.E#IDATx=J@Fo] !+2[Z<@/9|t$D9nnBjBRIsI:H8UPN1fcsN95M㧖ɵ 束1~pEe$I 7nrDf!;`'ykI䲤sI_]y^^I>O>?YBIENDB`dbus-glib-0.100.2/doc/reference/html/dbus-glib-DBusGConnection.html0000644000175000017500000006303712112654011021634 00000000000000 DBusGConnection

DBusGConnection

DBusGConnection — DBus Connection

Stability Level

Stable, unless otherwise indicated

Synopsis

#include <dbus/dbus-glib.h>

                    DBusGConnection;
#define             DBUS_TYPE_G_CONNECTION
DBusGConnection *   dbus_g_bus_get                      (DBusBusType type,
                                                         GError **error);
DBusGConnection *   dbus_g_bus_get_private              (DBusBusType type,
                                                         GMainContext *context,
                                                         GError **error);
void                dbus_g_thread_init                  (void);
DBusGConnection *   dbus_g_connection_open              (const gchar *address,
                                                         GError **error);
DBusGConnection *   dbus_g_connection_ref               (DBusGConnection *connection);
void                dbus_g_connection_unref             (DBusGConnection *connection);
void                dbus_g_connection_flush             (DBusGConnection *connection);
DBusConnection *    dbus_g_connection_get_connection    (DBusGConnection *gconnection);
void                dbus_g_connection_register_g_object (DBusGConnection *connection,
                                                         const char *at_path,
                                                         GObject *object);
void                dbus_g_connection_unregister_g_object
                                                        (DBusGConnection *connection,
                                                         GObject *object);
GObject *           dbus_g_connection_lookup_g_object   (DBusGConnection *connection,
                                                         const char *at_path);

Description

A DBusGConnection is a boxed type abstracting a DBusConnection.

Details

DBusGConnection

typedef struct _DBusGConnection DBusGConnection;

A DBusGConnection is a boxed type abstracting a DBusConnection from libdbus.


DBUS_TYPE_G_CONNECTION

#define DBUS_TYPE_G_CONNECTION   (dbus_g_connection_get_g_type ())

Expands to a function call returning the boxed GType of a DBusGConnection.

Returns :

the GLib type

dbus_g_bus_get ()

DBusGConnection *   dbus_g_bus_get                      (DBusBusType type,
                                                         GError **error);

Returns a connection to the given bus. The connection is a global variable shared with other callers of this function.

(Internally, calls dbus_bus_get() then calls dbus_connection_setup_with_g_main() on the result.)

type :

bus type

error :

address where an error can be returned.

Returns :

a DBusConnection

dbus_g_bus_get_private ()

DBusGConnection *   dbus_g_bus_get_private              (DBusBusType type,
                                                         GMainContext *context,
                                                         GError **error);

Returns a connection to the given bus. The connection will be a private non-shared connection and should be closed when usage is complete.

Internally this function calls dbus_bus_get_private() then calls dbus_connection_setup_with_g_main() on the result; see the documentation of the former function for more information on private connections.

type :

bus type

context :

Mainloop context to attach to

error :

address where an error can be returned.

Returns :

a DBusConnection

dbus_g_thread_init ()

void                dbus_g_thread_init                  (void);

Initializes the D-BUS thread system. This function may only be called once and must be called prior to calling any other function in the D-BUS API.


dbus_g_connection_open ()

DBusGConnection *   dbus_g_connection_open              (const gchar *address,
                                                         GError **error);

Returns a connection to the given address.

(Internally, calls dbus_connection_open() then calls dbus_connection_setup_with_g_main() on the result.)

address :

address of the connection to open

error :

address where an error can be returned.

Returns :

a DBusConnection

dbus_g_connection_ref ()

DBusGConnection *   dbus_g_connection_ref               (DBusGConnection *connection);

Increment refcount on a DBusGConnection

connection :

the DBusGConnection to ref

Returns :

the connection that was ref'd

dbus_g_connection_unref ()

void                dbus_g_connection_unref             (DBusGConnection *connection);

Decrement refcount on a DBusGConnection

connection :

the connection to unref

dbus_g_connection_flush ()

void                dbus_g_connection_flush             (DBusGConnection *connection);

Blocks until outgoing calls and signal emissions have been sent.

connection :

the DBusGConnection to flush

dbus_g_connection_get_connection ()

DBusConnection *    dbus_g_connection_get_connection    (DBusGConnection *gconnection);

Get the DBusConnection corresponding to this DBusGConnection. The return value does not have its refcount incremented.

gconnection :

a DBusGConnection

Returns :

DBusConnection

dbus_g_connection_register_g_object ()

void                dbus_g_connection_register_g_object (DBusGConnection *connection,
                                                         const char *at_path,
                                                         GObject *object);

Registers a GObject at the given path. Properties, methods, and signals of the object can then be accessed remotely. Methods are only available if method introspection data has been added to the object's class with dbus_g_object_type_install_info().

The registration will be cancelled if either the DBusConnection or the GObject gets finalized, or if dbus_g_connection_unregister_g_object() is used.

Note: If an object is registered multiple times, the first registration takes priority for cases such as turning an object into an object path.

connection :

the D-BUS connection

at_path :

the path where the object will live (the object's name)

object :

the object

dbus_g_connection_unregister_g_object ()

void                dbus_g_connection_unregister_g_object
                                                        (DBusGConnection *connection,
                                                         GObject *object);

Removes object from any object paths at which it is exported on connection. Properties, methods, and signals of the object can no longer be accessed remotely.

connection :

the D-BUS connection

object :

the object

dbus_g_connection_lookup_g_object ()

GObject *           dbus_g_connection_lookup_g_object   (DBusGConnection *connection,
                                                         const char *at_path);

FIXME

connection :

a DBusGConnection

at_path :

path

Returns :

the object at path at_path

See Also

DBusConnection
dbus-glib-0.100.2/doc/reference/html/dbus-glib.devhelp20000644000175000017500000004566512112654010017425 00000000000000 dbus-glib-0.100.2/doc/reference/html/left.png0000644000175000017500000000071312112654010015543 00000000000000PNG  IHDRw=bKGD pHYs  ~tIME1&[(XIDATx!OPE*ID%~ꊯ"p'ŏ`sܖrKf hmiIz}ܯI.p\`x l?l[,Hk<#c%\AUx[S7n6rzEs1j@NL$ݤi0 5/}\EKIo͓$a0jdFbkIAh>WlC'?tk;|/t*INZ^`y4Nr]׮ J<ڐt`X1@p䀸dZ')hK $V?%]+LsgUK"w53OIENDB`dbus-glib-0.100.2/doc/reference/html/style.css0000644000175000017500000001210012112654010015746 00000000000000.synopsis, .classsynopsis { /* tango:aluminium 1/2 */ background: #eeeeec; border: solid 1px #d3d7cf; padding: 0.5em; } .programlisting { /* tango:sky blue 0/1 */ background: #e6f3ff; border: solid 1px #729fcf; padding: 0.5em; } .variablelist { padding: 4px; margin-left: 3em; } .variablelist td:first-child { vertical-align: top; } @media screen { sup 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: 3.2em; padding-bottom: 20em; } /* style and size the navigation bar */ table.navigation#top { position: fixed; /* tango:scarlet red 0/1 */ background: #ffe6e6; border: solid 1px #ef2929; margin-top: 0; margin-bottom: 0; top: 0; left: 0; height: 3em; z-index: 10; } .navigation a, .navigation a:visited { /* tango:scarlet red 3 */ color: #a40000; } .navigation a:hover { /* tango:scarlet red 1 */ color: #ef2929; } td.shortcuts { /* tango:scarlet red 1 */ color: #ef2929; font-size: 80%; white-space: nowrap; } } @media print { table.navigation { visibility: collapse; display: none; } div.titlepage table.navigation { visibility: visible; display: table; /* tango:scarlet red 0/1 */ background: #ffe6e6; border: solid 1px #ef2929; margin-top: 0; margin-bottom: 0; top: 0; left: 0; height: 3em; } } .navigation .title { font-size: 200%; } 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.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; } hr { /* tango:aluminium 3 */ color: #babdb6; background: #babdb6; border: none 0px; height: 1px; clear: both; } .footer { padding-top: 3.5em; /* tango:aluminium 3 */ color: #babdb6; text-align: center; font-size: 80%; } .warning { /* tango:orange 0/1 */ background: #ffeed9; border-color: #ffb04f; } .note { /* tango:chameleon 0/0.5 */ background: #d8ffb2; border-color: #abf562; } .note, .warning { padding: 0.5em; border-width: 1px; border-style: solid; } .note h3, .warning h3 { margin-top: 0.0em } .note p, .warning p { margin-bottom: 0.0em } /* blob links */ h2 .extralinks, h3 .extralinks { float: right; /* tango:aluminium 3 */ color: #babdb6; font-size: 80%; font-weight: normal; } .annotation { /* tango:aluminium 5 */ color: #555753; font-size: 80%; font-weight: normal; } /* code listings */ .listing_code .programlisting .cbracket { color: #a40000; } /* tango: scarlet red 3 */ .listing_code .programlisting .comment { color: #a1a39d; } /* tango: aluminium 4 */ .listing_code .programlisting .function { color: #000000; font-weight: bold; } .listing_code .programlisting .function a { color: #11326b; font-weight: bold; } /* tango: sky blue 4 */ .listing_code .programlisting .keyword { color: #4e9a06; } /* tango: chameleon 3 */ .listing_code .programlisting .linenum { color: #babdb6; } /* tango: aluminium 3 */ .listing_code .programlisting .normal { color: #000000; } .listing_code .programlisting .number { color: #75507b; } /* tango: plum 2 */ .listing_code .programlisting .preproc { color: #204a87; } /* tango: sky blue 3 */ .listing_code .programlisting .string { color: #c17d11; } /* tango: chocolate 2 */ .listing_code .programlisting .type { color: #000000; } .listing_code .programlisting .type a { color: #11326b; } /* tango: sky blue 4 */ .listing_code .programlisting .symbol { color: #ce5c00; } /* tango: orange 3 */ .listing_frame { /* tango:sky blue 1 */ border: solid 1px #729fcf; padding: 0px; } .listing_lines, .listing_code { margin-top: 0px; margin-bottom: 0px; padding: 0.5em; } .listing_lines { /* tango:sky blue 0.5 */ background: #a6c5e3; /* tango:aluminium 6 */ color: #2e3436; } .listing_code { /* tango:sky blue 0 */ background: #e6f3ff; } .listing_code .programlisting { /* override from previous */ border: none 0px; padding: 0px; } .listing_lines pre, .listing_code pre { margin: 0px; } dbus-glib-0.100.2/doc/reference/html/index.html0000644000175000017500000000577112112654011016112 00000000000000 D-Bus GLib bindings - Reference Manual

for version 0.100.2


Introduction
API Reference
API for using D-BUS with GLib
DBusGConnection — DBus Connection
DBus GObject related functions — Exporting a GObject remotely
DBusGMessage — DBus Message
DBusGMethod — GMethod Info & Invocation
DBusGError — DBus GError
DBusGProxy — DBus Proxy
Specializable GType System — Specialized GTypes
DBus GLib low level — DBus lower level functions
Tools Reference
dbus-binding-tool — C language GLib bindings generation utility
dbus-glib-0.100.2/doc/reference/html/dbus-glib-DBusGProxy.html0000644000175000017500000022353212112654011020654 00000000000000 DBusGProxy

DBusGProxy

DBusGProxy — DBus Proxy

Stability Level

Stable, unless otherwise indicated

Synopsis

#include <dbus/dbus-glib.h>

struct              DBusGProxy;
                    DBusGProxyCall;
void                (*DBusGProxyCallNotify)             (DBusGProxy *proxy,
                                                         DBusGProxyCall *call_id,
                                                         void *user_data);
DBusGProxy *        dbus_g_proxy_new_for_name           (DBusGConnection *connection,
                                                         const char *name,
                                                         const char *path,
                                                         const char *iface);
DBusGProxy *        dbus_g_proxy_new_for_name_owner     (DBusGConnection *connection,
                                                         const char *name,
                                                         const char *path,
                                                         const char *iface,
                                                         GError **error);
DBusGProxy *        dbus_g_proxy_new_from_proxy         (DBusGProxy *proxy,
                                                         const char *iface,
                                                         const char *path);
DBusGProxy *        dbus_g_proxy_new_for_peer           (DBusGConnection *connection,
                                                         const char *path,
                                                         const char *iface);
void                dbus_g_proxy_set_interface          (DBusGProxy *proxy,
                                                         const char *interface_name);
const char *        dbus_g_proxy_get_path               (DBusGProxy *proxy);
const char *        dbus_g_proxy_get_bus_name           (DBusGProxy *proxy);
const char *        dbus_g_proxy_get_interface          (DBusGProxy *proxy);
void                dbus_g_proxy_add_signal             (DBusGProxy *proxy,
                                                         const char *signal_name,
                                                         GType first_type,
                                                         ...);
void                dbus_g_proxy_connect_signal         (DBusGProxy *proxy,
                                                         const char *signal_name,
                                                         GCallback handler,
                                                         void *data,
                                                         GClosureNotify free_data_func);
void                dbus_g_proxy_disconnect_signal      (DBusGProxy *proxy,
                                                         const char *signal_name,
                                                         GCallback handler,
                                                         void *data);
void                dbus_g_proxy_send                   (DBusGProxy *proxy,
                                                         DBusMessage *message,
                                                         dbus_uint32_t *client_serial);
gboolean            dbus_g_proxy_call                   (DBusGProxy *proxy,
                                                         const char *method,
                                                         GError **error,
                                                         GType first_arg_type,
                                                         ...);
gboolean            dbus_g_proxy_call_with_timeout      (DBusGProxy *proxy,
                                                         const char *method,
                                                         int timeout,
                                                         GError **error,
                                                         GType first_arg_type,
                                                         ...);
void                dbus_g_proxy_call_no_reply          (DBusGProxy *proxy,
                                                         const char *method,
                                                         GType first_arg_type,
                                                         ...);
DBusGProxyCall *    dbus_g_proxy_begin_call             (DBusGProxy *proxy,
                                                         const char *method,
                                                         DBusGProxyCallNotify notify,
                                                         gpointer user_data,
                                                         GDestroyNotify destroy,
                                                         GType first_arg_type,
                                                         ...);
DBusGProxyCall *    dbus_g_proxy_begin_call_with_timeout
                                                        (DBusGProxy *proxy,
                                                         const char *method,
                                                         DBusGProxyCallNotify notify,
                                                         gpointer user_data,
                                                         GDestroyNotify destroy,
                                                         int timeout,
                                                         GType first_arg_type,
                                                         ...);
gboolean            dbus_g_proxy_end_call               (DBusGProxy *proxy,
                                                         DBusGProxyCall *call,
                                                         GError **error,
                                                         GType first_arg_type,
                                                         ...);
void                dbus_g_proxy_cancel_call            (DBusGProxy *proxy,
                                                         DBusGProxyCall *call);
void                dbus_g_proxy_set_default_timeout    (DBusGProxy *proxy,
                                                         int timeout);

Description

A DBusGProxy is a GObject representing a remote object in a D-Bus service.

Details

struct DBusGProxy

struct DBusGProxy {
};

A GObject representing a remote object in a D-Bus service.


DBusGProxyCall

typedef struct _DBusGProxyCall DBusGProxyCall;

An opaque pointer representing an asynchronous call in progress.


DBusGProxyCallNotify ()

void                (*DBusGProxyCallNotify)             (DBusGProxy *proxy,
                                                         DBusGProxyCall *call_id,
                                                         void *user_data);

Called when a reply to the call represented by call_id arrives. Use dbus_g_proxy_end_call() to see whether call_id succeeded or failed, and get the arguments returned (if any) on success.

proxy :

the proxy on which the method was called

call_id :

the call in progress

user_data :

data passed to dbus_g_proxy_begin_call() or similar

dbus_g_proxy_new_for_name ()

DBusGProxy *        dbus_g_proxy_new_for_name           (DBusGConnection *connection,
                                                         const char *name,
                                                         const char *path,
                                                         const char *iface);

Creates a new proxy for a remote interface exported by a connection on a message bus. Method calls and signal connections over this proxy will go to the name owner; the name's owner is expected to support the given interface name. THE NAME OWNER MAY CHANGE OVER TIME, for example between two different method calls, unless the name is a unique name. If you need a fixed owner, you need to request the current owner and bind a proxy to its unique name rather than to the generic name; see dbus_g_proxy_new_for_name_owner().

A name-associated proxy only makes sense with a message bus, not for app-to-app direct dbus connections.

This proxy will only emit the "destroy" signal if the DBusConnection is disconnected, the proxy has no remaining references, or the name is a unique name and its owner disappears. If a well-known name changes owner, the proxy will still be alive.

connection :

the connection to the remote bus

name :

any name on the message bus

path :

name of the object instance to call methods on

iface :

name of the interface to call methods on

Returns :

new proxy object

dbus_g_proxy_new_for_name_owner ()

DBusGProxy *        dbus_g_proxy_new_for_name_owner     (DBusGConnection *connection,
                                                         const char *name,
                                                         const char *path,
                                                         const char *iface,
                                                         GError **error);

Similar to dbus_g_proxy_new_for_name(), but makes a round-trip request to the message bus to get the current name owner, then binds the proxy to the unique name of the current owner, rather than to the well-known name. As a result, the name owner will not change over time, and the proxy will emit the "destroy" signal when the owner disappears from the message bus.

An example of the difference between dbus_g_proxy_new_for_name() and dbus_g_proxy_new_for_name_owner(): if you provide the well-known name "org.freedesktop.Database" dbus_g_proxy_new_for_name() remains bound to that name as it changes owner. dbus_g_proxy_new_for_name_owner() will fail if the name has no owner. If the name has an owner, dbus_g_proxy_new_for_name_owner() will bind to the unique name of that owner rather than the generic name.

connection :

the connection to the remote bus

name :

any name on the message bus

path :

name of the object inside the service to call methods on

iface :

name of the interface to call methods on

error :

return location for an error

Returns :

new proxy object, or NULL on error

dbus_g_proxy_new_from_proxy ()

DBusGProxy *        dbus_g_proxy_new_from_proxy         (DBusGProxy *proxy,
                                                         const char *iface,
                                                         const char *path);

Creates a proxy using an existing proxy as a template, substituting the specified interface and path. Either or both may be NULL.

proxy :

the proxy to use as a template

iface :

name of the interface to call methods on

path :

of the object inside the peer to call methods on

Returns :

new proxy object

dbus_g_proxy_new_for_peer ()

DBusGProxy *        dbus_g_proxy_new_for_peer           (DBusGConnection *connection,
                                                         const char *path,
                                                         const char *iface);

Creates a proxy for an object in peer application (one we're directly connected to). That is, this function is intended for use when there's no message bus involved, we're doing a simple 1-to-1 communication between two applications.

connection :

the connection to the peer

path :

name of the object inside the peer to call methods on

iface :

name of the interface to call methods on

Returns :

new proxy object

dbus_g_proxy_set_interface ()

void                dbus_g_proxy_set_interface          (DBusGProxy *proxy,
                                                         const char *interface_name);

Sets the object interface proxy is bound to

It is an error to call this method on a proxy that has emitted the "destroy" signal.

proxy :

the proxy

interface_name :

an object interface

dbus_g_proxy_get_path ()

const char *        dbus_g_proxy_get_path               (DBusGProxy *proxy);

Gets the path this proxy is bound to

It is an error to call this method on a proxy that has emitted the "destroy" signal.

proxy :

the proxy

Returns :

an object path

dbus_g_proxy_get_bus_name ()

const char *        dbus_g_proxy_get_bus_name           (DBusGProxy *proxy);

Gets the bus name a proxy is bound to (may be NULL in some cases). If you created the proxy with dbus_g_proxy_new_for_name(), then the name you passed to that will be returned. If you created it with dbus_g_proxy_new_for_name_owner(), then the unique connection name will be returned. If you created it with dbus_g_proxy_new_for_peer() then NULL will be returned.

It is an error to call this method on a proxy that has emitted the "destroy" signal.

proxy :

the proxy

Returns :

the bus name the proxy sends messages to

dbus_g_proxy_get_interface ()

const char *        dbus_g_proxy_get_interface          (DBusGProxy *proxy);

Gets the object interface proxy is bound to (may be NULL in some cases).

It is an error to call this method on a proxy that has emitted the "destroy" signal.

proxy :

the proxy

Returns :

an object interface

dbus_g_proxy_add_signal ()

void                dbus_g_proxy_add_signal             (DBusGProxy *proxy,
                                                         const char *signal_name,
                                                         GType first_type,
                                                         ...);

Specifies the argument signature of a D-Bus signal. When the signal is emitted by the remote object, if the GTypes corresponding to its arguments' types do not match the types given here, the signal will be ignored.

It is an error to add the same signal_name to the same proxy more than once, even if the argument types given are the same.

It is also an error to call this method on a proxy that has emitted the "destroy" signal.

proxy :

the proxy for a remote interface

signal_name :

the name of the signal

first_type :

the first argument type, or G_TYPE_INVALID if none

... :

any subsequent argument types, followed by G_TYPE_INVALID

dbus_g_proxy_connect_signal ()

void                dbus_g_proxy_connect_signal         (DBusGProxy *proxy,
                                                         const char *signal_name,
                                                         GCallback handler,
                                                         void *data,
                                                         GClosureNotify free_data_func);

Connect a signal handler to a proxy for a remote interface. When the remote interface emits the specified signal, the proxy will emit a corresponding GLib signal.

It is an error to call this method on a proxy that has emitted the "destroy" signal.

proxy :

a proxy for a remote interface

signal_name :

the DBus signal name to listen for

handler :

the handler to connect

data :

data to pass to handler

free_data_func :

callback function to destroy data

dbus_g_proxy_disconnect_signal ()

void                dbus_g_proxy_disconnect_signal      (DBusGProxy *proxy,
                                                         const char *signal_name,
                                                         GCallback handler,
                                                         void *data);

Disconnect all signal handlers from a proxy that match the given criteria.

It is an error to call this method on a proxy that has emitted the "destroy" signal.

proxy :

a proxy for a remote interface

signal_name :

the DBus signal name to disconnect

handler :

the handler to disconnect

data :

the data that was registered with handler

dbus_g_proxy_send ()

void                dbus_g_proxy_send                   (DBusGProxy *proxy,
                                                         DBusMessage *message,
                                                         dbus_uint32_t *client_serial);

Sends a message to the interface we're proxying for. Does not block or wait for a reply. The message is only actually written out when you return to the main loop or block in dbus_g_connection_flush().

The message is modified to be addressed to the target interface. That is, a destination name field or whatever is needed will be added to the message. The basic point of this function is to add the necessary header fields, otherwise it's equivalent to dbus_connection_send().

This function adds a reference to the message, so the caller still owns its original reference.

It is an error to call this method on a proxy that has emitted the "destroy" signal.

proxy :

a proxy for a remote interface

message :

the message to address and send

client_serial :

return location for message's serial, or NULL

dbus_g_proxy_call ()

gboolean            dbus_g_proxy_call                   (DBusGProxy *proxy,
                                                         const char *method,
                                                         GError **error,
                                                         GType first_arg_type,
                                                         ...);

Function for synchronously invoking a method and receiving reply values. This function is equivalent to dbus_g_proxy_begin_call followed by dbus_g_proxy_end_call. All of the input arguments are specified first, followed by G_TYPE_INVALID, followed by all of the output values, followed by a second G_TYPE_INVALID. Note that this means you must always specify G_TYPE_INVALID twice.

It is an error to call this method on a proxy that has emitted the "destroy" signal.

proxy :

a proxy for a remote interface

method :

method to invoke

error :

return location for an error

first_arg_type :

type of first "in" argument, or G_TYPE_INVALID if none

... :

value of first "in" argument, any further type/value pairs, G_TYPE_INVALID, type/location pairs for "out" arguments, and G_TYPE_INVALID again

Returns :

TRUE if the method succeeds, FALSE if it fails

dbus_g_proxy_call_with_timeout ()

gboolean            dbus_g_proxy_call_with_timeout      (DBusGProxy *proxy,
                                                         const char *method,
                                                         int timeout,
                                                         GError **error,
                                                         GType first_arg_type,
                                                         ...);

Function for synchronously invoking a method and receiving reply values. This function is equivalent to dbus_g_proxy_begin_call followed by dbus_g_proxy_end_call. All of the input arguments are specified first, followed by G_TYPE_INVALID, followed by all of the output values, followed by a second G_TYPE_INVALID. Note that this means you must always specify G_TYPE_INVALID twice.

It is an error to call this method on a proxy that has emitted the "destroy" signal.

proxy :

a proxy for a remote interface

method :

method to invoke

timeout :

the timeout in milliseconds, or -1 to use a default

error :

return location for an error

first_arg_type :

type of first "in" argument

... :

as for dbus_g_proxy_call()

Returns :

TRUE if the method succeeds, FALSE if it fails

dbus_g_proxy_call_no_reply ()

void                dbus_g_proxy_call_no_reply          (DBusGProxy *proxy,
                                                         const char *method,
                                                         GType first_arg_type,
                                                         ...);

Sends a method call message as with dbus_g_proxy_begin_call(), but does not ask for a reply or allow you to receive one.

It is an error to call this method on a proxy that has emitted the "destroy" signal.

TODO: this particular function shouldn't die on out of memory, since you should be able to do a call with large arguments.

proxy :

a proxy for a remote interface

method :

the name of the method to invoke

first_arg_type :

type of the first argument, or G_TYPE_INVALID to call the method without arguments

... :

the first argument and any remaining type/argument pairs, followed by G_TYPE_INVALID to terminate the list

dbus_g_proxy_begin_call ()

DBusGProxyCall *    dbus_g_proxy_begin_call             (DBusGProxy *proxy,
                                                         const char *method,
                                                         DBusGProxyCallNotify notify,
                                                         gpointer user_data,
                                                         GDestroyNotify destroy,
                                                         GType first_arg_type,
                                                         ...);

Asynchronously invokes a method on a remote interface. The method call will not be sent over the wire until the application returns to the main loop, or blocks in dbus_g_connection_flush() to write out pending data. The call will be completed after a timeout, or when a reply is received. When the call returns, the callback specified will be invoked; you can then collect the results of the call (which may be an error, or a reply), use dbus_g_proxy_end_call().

It is an error to call this method on a proxy that has emitted the "destroy" signal.

TODO this particular function shouldn't die on out of memory, since you should be able to do a call with large arguments.

proxy :

a proxy for a remote interface

method :

the name of the method to invoke

notify :

callback to be invoked when method returns

user_data :

user data passed to callback

destroy :

function called to destroy user_data

first_arg_type :

type of the first argument, or G_TYPE_INVALID if there are no arguments

... :

first argument, followed by any further type/value pairs, followed by G_TYPE_INVALID

Returns :

call identifier.

dbus_g_proxy_begin_call_with_timeout ()

DBusGProxyCall *    dbus_g_proxy_begin_call_with_timeout
                                                        (DBusGProxy *proxy,
                                                         const char *method,
                                                         DBusGProxyCallNotify notify,
                                                         gpointer user_data,
                                                         GDestroyNotify destroy,
                                                         int timeout,
                                                         GType first_arg_type,
                                                         ...);

Asynchronously invokes a method on a remote interface. The method call will not be sent over the wire until the application returns to the main loop, or blocks in dbus_g_connection_flush() to write out pending data. The call will be completed after a timeout, or when a reply is received. When the call returns, the callback specified will be invoked; you can then collect the results of the call (which may be an error, or a reply), use dbus_g_proxy_end_call().

It is an error to call this method on a proxy that has emitted the "destroy" signal.

TODO this particular function shouldn't die on out of memory, since you should be able to do a call with large arguments.

proxy :

a proxy for a remote interface

method :

the name of the method to invoke

notify :

callback to be invoked when method returns

user_data :

user data passed to callback

destroy :

function called to destroy user_data

timeout :

the timeout in milliseconds, or -1 to use a default

first_arg_type :

type of the first argument, or G_TYPE_INVALID if there are no arguments

... :

first argument, followed by any further type/value pairs, followed by G_TYPE_INVALID

Returns :

call identifier.

dbus_g_proxy_end_call ()

gboolean            dbus_g_proxy_end_call               (DBusGProxy *proxy,
                                                         DBusGProxyCall *call,
                                                         GError **error,
                                                         GType first_arg_type,
                                                         ...);

Collects the results of a method call. The method call was normally initiated with dbus_g_proxy_end_call(). You may use this function outside of the callback given to dbus_g_proxy_begin_call; in that case this function will block if the results haven't yet been received.

All D-Bus method calls can fail with a remote error. If this occurs, the error will be set and this function will return FALSE.

Otherwise, the "out" parameters and return value of the method are stored in the provided varargs list. The list should be terminated with G_TYPE_INVALID.

proxy :

a proxy for a remote interface

call :

the pending call ID from dbus_g_proxy_begin_call()

error :

return location for an error

first_arg_type :

type of first "out" argument, or G_TYPE_INVALID if there are no "out" arguments

... :

return location for first "out" argument, followed by any further type/location pairs, followed by G_TYPE_INVALID

Returns :

TRUE on success

dbus_g_proxy_cancel_call ()

void                dbus_g_proxy_cancel_call            (DBusGProxy *proxy,
                                                         DBusGProxyCall *call);

Cancels a pending method call. The method call was normally initiated with dbus_g_proxy_begin_call(). This function may not be used on pending calls that have already been ended with dbus_g_proxy_end_call.

It is an error to call this method on a proxy that has emitted the "destroy" signal.

proxy :

a proxy for a remote interface

call :

the pending call ID from dbus_g_proxy_begin_call()

dbus_g_proxy_set_default_timeout ()

void                dbus_g_proxy_set_default_timeout    (DBusGProxy *proxy,
                                                         int timeout);

Sets the default timeout to use for a proxy. This timeout will be used in calls where the timeout is not specified, or is specified to be -1. If this timeout is also set to -1, libdbus will use a reasonable default value.

This is useful for long-running operations that takes longer than the default timeout (which is a on the order of magnitude of tens of seconds). For some applications, consider using a pattern where the method returns once the operation is underway (e.g. immediately) and emits a signal when the operation terminates (though beware of leaking information with/in the signal return value).

It is an error to call this method on a proxy that has emitted the "destroy" signal.

proxy :

a proxy for a remote interface

timeout :

the timeout in milliseconds, or -1 to reset to the libdbus default

Since 0.75

See Also

DBusGProxy
dbus-glib-0.100.2/doc/reference/dbus-glib-overrides.txt0000644000175000017500000000000011634152371017550 00000000000000dbus-glib-0.100.2/doc/reference/Makefile.in0000644000175000017500000006215212112653462015223 00000000000000# 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 \ $(srcdir)/version.xml.in $(top_srcdir)/gtk-doc.make subdir = doc/reference 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)/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 = version.xml 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) ABSOLUTE_TOP_BUILDDIR = @ABSOLUTE_TOP_BUILDDIR@ ACLOCAL = @ACLOCAL@ 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@ CYGPATH_W = @CYGPATH_W@ DBUS_BINDING_TOOL = @DBUS_BINDING_TOOL@ DBUS_CFLAGS = @DBUS_CFLAGS@ DBUS_GLIB_CFLAGS = @DBUS_GLIB_CFLAGS@ DBUS_GLIB_LIBS = @DBUS_GLIB_LIBS@ DBUS_GLIB_THREADS_CFLAGS = @DBUS_GLIB_THREADS_CFLAGS@ DBUS_GLIB_THREADS_LIBS = @DBUS_GLIB_THREADS_LIBS@ DBUS_GLIB_TOOL_CFLAGS = @DBUS_GLIB_TOOL_CFLAGS@ DBUS_GLIB_TOOL_LIBS = @DBUS_GLIB_TOOL_LIBS@ DBUS_LIBS = @DBUS_LIBS@ DBUS_PATH_OR_ABSTRACT = @DBUS_PATH_OR_ABSTRACT@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ EXPANDED_BINDIR = @EXPANDED_BINDIR@ EXPANDED_DATADIR = @EXPANDED_DATADIR@ EXPANDED_LIBDIR = @EXPANDED_LIBDIR@ EXPANDED_LOCALSTATEDIR = @EXPANDED_LOCALSTATEDIR@ EXPANDED_SYSCONFDIR = @EXPANDED_SYSCONFDIR@ FGREP = @FGREP@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GREP = @GREP@ GTKDOC_CHECK = @GTKDOC_CHECK@ 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@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_REVISION = @LT_REVISION@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ 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@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TEST_CORE_SERVICE_BINARY = @TEST_CORE_SERVICE_BINARY@ TEST_EXIT_BINARY = @TEST_EXIT_BINARY@ TEST_INTERFACES_SERVICE_BINARY = @TEST_INTERFACES_SERVICE_BINARY@ TEST_SEGFAULT_BINARY = @TEST_SEGFAULT_BINARY@ TEST_SERVICE_BINARY = @TEST_SERVICE_BINARY@ TEST_SERVICE_DIR = @TEST_SERVICE_DIR@ TEST_SHELL_SERVICE_BINARY = @TEST_SHELL_SERVICE_BINARY@ TEST_SLEEP_FOREVER_BINARY = @TEST_SLEEP_FOREVER_BINARY@ TEST_SOCKET_DIR = @TEST_SOCKET_DIR@ VERSION = @VERSION@ 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_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@ 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@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ 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.6 at least. AUTOMAKE_OPTIONS = 1.6 # 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 = dbus-glib # 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. # gtk-doc will search all .c and .h files beneath these paths # for inline comments documenting functions and macros. # e.g. DOC_SOURCE_DIR=$(top_srcdir)/gtk $(top_srcdir)/gdk DOC_SOURCE_DIR = @abs_top_srcdir@/dbus # 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 = # Extra options to supply to gtkdoc-mkdb. # e.g. MKDB_OPTIONS=--xml-mode --output-format=xml MKDB_OPTIONS = --xml-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)/dbus/*.h CFILE_GLOB = $(top_srcdir)/dbus/*.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 = \ dbus-binding-tool-glib.h \ dbus-gidl.h \ dbus-glib-tool.h \ dbus-gparser.h \ dbus-gutils.h \ dbus-gsignature.h \ dbus-gtest.h \ dbus-gvalue.h \ dbus-gvalue-utils.h \ dbus-gmarshal.h \ example-service-glue.h \ example-signal-emitter-glue.h \ sm-marshal.h \ statemachine-glue.h \ statemachine.h \ statemachine-server-glue.h \ statemachine-server.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 = version.xml \ dbus-binding-tool.xml # 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) $(DBUS_CFLAGS) $(DBUS_GLIB_CFLAGS) $(DBUS_GLIB_TOOL_CFLAGS) GTKDOC_LIBS = $(top_builddir)/dbus/libdbus-glib-1.la @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) \ $(DOC_MAIN_SGML_FILE) \ $(DOC_MODULE)-sections.txt \ $(DOC_MODULE)-overrides.txt # This includes the standard gtk-doc make rules, copied by gtkdocize. # Other files to distribute # e.g. EXTRA_DIST += version.xml.in EXTRA_DIST = $(HTML_IMAGES) $(SETUP_FILES) version.xml.in DOC_STAMPS = setup-build.stamp scan-build.stamp tmpl-build.stamp sgml-build.stamp \ html-build.stamp pdf-build.stamp \ tmpl.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) @ENABLE_GTK_DOC_TRUE@@GTK_DOC_BUILD_HTML_FALSE@HTML_BUILD_STAMP = @ENABLE_GTK_DOC_TRUE@@GTK_DOC_BUILD_HTML_TRUE@HTML_BUILD_STAMP = html-build.stamp @ENABLE_GTK_DOC_TRUE@@GTK_DOC_BUILD_PDF_FALSE@PDF_BUILD_STAMP = @ENABLE_GTK_DOC_TRUE@@GTK_DOC_BUILD_PDF_TRUE@PDF_BUILD_STAMP = pdf-build.stamp # 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 += # Comment this out if you want 'make check' to test you doc status # and run some sanity checks @ENABLE_GTK_DOC_TRUE@TESTS_ENVIRONMENT = cd $(srcdir) && \ @ENABLE_GTK_DOC_TRUE@ DOC_MODULE=$(DOC_MODULE) DOC_MAIN_SGML_FILE=$(DOC_MAIN_SGML_FILE) \ @ENABLE_GTK_DOC_TRUE@ SRCDIR=$(abs_srcdir) BUILDDIR=$(abs_builddir) all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(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/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_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: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): version.xml: $(top_builddir)/config.status $(srcdir)/version.xml.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ 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 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: -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: install-am install-strip .PHONY: all all-am all-local check check-am 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 @ENABLE_GTK_DOC_TRUE@all-local: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP) @ENABLE_GTK_DOC_FALSE@all-local: docs: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP) $(REPORT_FILES): sgml-build.stamp #### setup #### setup-build.stamp: -@if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \ echo ' DOC Preparing build'; \ files=`echo $(SETUP_FILES) $(expand_content_files) $(DOC_MODULE).types`; \ if test "x$$files" != "x" ; then \ for file in $$files ; do \ test -f $(abs_srcdir)/$$file && \ cp -pu $(abs_srcdir)/$$file $(abs_builddir)/ || true; \ done; \ fi; \ test -d $(abs_srcdir)/tmpl && \ { cp -rp $(abs_srcdir)/tmpl $(abs_builddir)/; \ chmod -R u+w $(abs_builddir)/tmpl; } \ fi @touch setup-build.stamp #### scan #### scan-build.stamp: $(HFILE_GLOB) $(CFILE_GLOB) @echo ' DOC Scanning header files' @_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) @if grep -l '^..*$$' $(DOC_MODULE).types > /dev/null 2>&1 ; then \ echo " DOC Introspecting gobjects"; \ 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 @touch scan-build.stamp $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt: scan-build.stamp @true #### templates #### tmpl-build.stamp: setup-build.stamp $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt @echo ' DOC Rebuilding template files' @gtkdoc-mktmpl --module=$(DOC_MODULE) $(MKTMPL_OPTIONS) @if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \ if test -w $(abs_srcdir) ; then \ cp -rp $(abs_builddir)/tmpl $(abs_srcdir)/; \ fi \ fi @touch tmpl-build.stamp tmpl.stamp: tmpl-build.stamp @true $(srcdir)/tmpl/*.sgml: @true #### xml #### sgml-build.stamp: tmpl.stamp $(DOC_MODULE)-sections.txt $(srcdir)/tmpl/*.sgml $(expand_content_files) @echo ' DOC Building XML' @-chmod -R u+w $(srcdir) @_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) @touch sgml-build.stamp sgml.stamp: sgml-build.stamp @true #### html #### html-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files) @echo ' DOC Building 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; @echo ' DOC Fixing cross-references' @gtkdoc-fixxref --module=$(DOC_MODULE) --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS) @touch html-build.stamp #### pdf #### pdf-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files) @echo ' DOC Building 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) @touch pdf-build.stamp ############## clean-local: @rm -f *~ *.bak @rm -rf .libs 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) $(expand_content_files) $(DOC_MODULE).types; \ rm -rf tmpl; \ fi maintainer-clean-local: clean @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 # @ENABLE_GTK_DOC_TRUE@dist-check-gtkdoc: @ENABLE_GTK_DOC_FALSE@dist-check-gtkdoc: @ENABLE_GTK_DOC_FALSE@ @echo "*** gtk-doc must be installed and enabled in order to make dist" @ENABLE_GTK_DOC_FALSE@ @false dist-hook: dist-check-gtkdoc dist-hook-local @mkdir $(distdir)/tmpl @mkdir $(distdir)/html @-cp ./tmpl/*.sgml $(distdir)/tmpl @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 #TESTS = $(GTKDOC_CHECK) -include $(top_srcdir)/git.mk # 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: dbus-glib-0.100.2/doc/reference/version.xml0000644000175000017500000000001012112653465015351 000000000000000.100.2 dbus-glib-0.100.2/doc/reference/dbus-binding-tool.xml0000644000175000017500000000236211634152371017216 00000000000000 dbus-binding-tool 1 dbus-binding-tool C language GLib bindings generation utility options files Description dbus-binding-tool bla bla bla Invocation dbus-binding-tool bla bla bla Options pretty|glib-server|glib-client bla bla Print brief help and exit. Print version and exit. See also glib-genmarshal(1) dbus-glib-0.100.2/doc/reference/Makefile.am0000644000175000017500000001002112107524614015176 00000000000000## Process this file with automake to produce Makefile.in # We require automake 1.6 at least. AUTOMAKE_OPTIONS = 1.6 # 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=dbus-glib # 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. # gtk-doc will search all .c and .h files beneath these paths # for inline comments documenting functions and macros. # e.g. DOC_SOURCE_DIR=$(top_srcdir)/gtk $(top_srcdir)/gdk DOC_SOURCE_DIR=@abs_top_srcdir@/dbus # 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= # Extra options to supply to gtkdoc-mkdb. # e.g. MKDB_OPTIONS=--xml-mode --output-format=xml MKDB_OPTIONS=--xml-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)/dbus/*.h CFILE_GLOB=$(top_srcdir)/dbus/*.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= \ dbus-binding-tool-glib.h \ dbus-gidl.h \ dbus-glib-tool.h \ dbus-gparser.h \ dbus-gutils.h \ dbus-gsignature.h \ dbus-gtest.h \ dbus-gvalue.h \ dbus-gvalue-utils.h \ dbus-gmarshal.h \ example-service-glue.h \ example-signal-emitter-glue.h \ sm-marshal.h \ statemachine-glue.h \ statemachine.h \ statemachine-server-glue.h \ statemachine-server.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=version.xml \ dbus-binding-tool.xml # 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) $(DBUS_CFLAGS) $(DBUS_GLIB_CFLAGS) $(DBUS_GLIB_TOOL_CFLAGS) GTKDOC_LIBS=$(top_builddir)/dbus/libdbus-glib-1.la # 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 += version.xml.in # 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 += # Comment this out if you want 'make check' to test you doc status # and run some sanity checks if ENABLE_GTK_DOC TESTS_ENVIRONMENT = cd $(srcdir) && \ DOC_MODULE=$(DOC_MODULE) DOC_MAIN_SGML_FILE=$(DOC_MAIN_SGML_FILE) \ SRCDIR=$(abs_srcdir) BUILDDIR=$(abs_builddir) #TESTS = $(GTKDOC_CHECK) endif -include $(top_srcdir)/git.mk dbus-glib-0.100.2/doc/reference/tmpl/0000755000175000017500000000000012112654010014172 500000000000000dbus-glib-0.100.2/doc/reference/tmpl/dbus-gmessage.sgml0000644000175000017500000000127112112654010017525 00000000000000 DBusGMessage @message: @Returns: @message: @gmessage: @Returns: dbus-glib-0.100.2/doc/reference/tmpl/dbus-gmethod.sgml0000644000175000017500000000165512112654010017367 00000000000000 DBusGMethod @function: @marshaller: @data_offset: @context: @Returns: @context: @Returns: @context: @reply: @context: @...: @context: @error: dbus-glib-0.100.2/doc/reference/tmpl/dbus-gproxy.sgml0000644000175000017500000000563212112654010017267 00000000000000 DBusGProxy @proxy: @call_id: @user_data: @connection: @name: @path: @iface: @Returns: @connection: @name: @path: @iface: @error: @Returns: @proxy: @iface: @path: @Returns: @connection: @path: @iface: @Returns: @proxy: @interface_name: @proxy: @Returns: @proxy: @Returns: @proxy: @Returns: @proxy: @signal_name: @first_type: @...: @proxy: @signal_name: @handler: @data: @free_data_func: @proxy: @signal_name: @handler: @data: @proxy: @message: @client_serial: @proxy: @method: @error: @first_arg_type: @...: @Returns: @proxy: @method: @timeout: @error: @first_arg_type: @...: @Returns: @proxy: @method: @first_arg_type: @...: @proxy: @method: @notify: @user_data: @destroy: @first_arg_type: @...: @Returns: @proxy: @method: @notify: @user_data: @destroy: @timeout: @first_arg_type: @...: @Returns: @proxy: @call: @error: @first_arg_type: @...: @Returns: @proxy: @call: @proxy: @timeout: dbus-glib-0.100.2/doc/reference/tmpl/dbus-glib-lowlevel.sgml0000644000175000017500000000151112112654010020473 00000000000000 DBus GLib low level @gerror: @derror: @connection: @context: @connection: @Returns: @server: @context: dbus-glib-0.100.2/doc/reference/tmpl/dbus-gerror.sgml0000644000175000017500000000326512112654010017237 00000000000000 DBusGError @DBUS_GERROR_FAILED: @DBUS_GERROR_NO_MEMORY: @DBUS_GERROR_SERVICE_UNKNOWN: @DBUS_GERROR_NAME_HAS_NO_OWNER: @DBUS_GERROR_NO_REPLY: @DBUS_GERROR_IO_ERROR: @DBUS_GERROR_BAD_ADDRESS: @DBUS_GERROR_NOT_SUPPORTED: @DBUS_GERROR_LIMITS_EXCEEDED: @DBUS_GERROR_ACCESS_DENIED: @DBUS_GERROR_AUTH_FAILED: @DBUS_GERROR_NO_SERVER: @DBUS_GERROR_TIMEOUT: @DBUS_GERROR_NO_NETWORK: @DBUS_GERROR_ADDRESS_IN_USE: @DBUS_GERROR_DISCONNECTED: @DBUS_GERROR_INVALID_ARGS: @DBUS_GERROR_FILE_NOT_FOUND: @DBUS_GERROR_FILE_EXISTS: @DBUS_GERROR_UNKNOWN_METHOD: @DBUS_GERROR_TIMED_OUT: @DBUS_GERROR_MATCH_RULE_NOT_FOUND: @DBUS_GERROR_MATCH_RULE_INVALID: @DBUS_GERROR_SPAWN_EXEC_FAILED: @DBUS_GERROR_SPAWN_FORK_FAILED: @DBUS_GERROR_SPAWN_CHILD_EXITED: @DBUS_GERROR_SPAWN_CHILD_SIGNALED: @DBUS_GERROR_SPAWN_FAILED: @DBUS_GERROR_UNIX_PROCESS_ID_UNKNOWN: @DBUS_GERROR_INVALID_SIGNATURE: @DBUS_GERROR_INVALID_FILE_CONTENT: @DBUS_GERROR_SELINUX_SECURITY_CONTEXT_UNKNOWN: @DBUS_GERROR_REMOTE_EXCEPTION: @error: @name: @Returns: @error: @Returns: @domain: @default_iface: @code_enum: dbus-glib-0.100.2/doc/reference/tmpl/dbus-gconnection.sgml0000644000175000017500000000301212112654010020233 00000000000000 DBusGConnection @type: @error: @Returns: @type: @context: @error: @Returns: @void: @address: @error: @Returns: @connection: @Returns: @connection: @connection: @gconnection: @Returns: @connection: @at_path: @object: @connection: @object: @connection: @at_path: @Returns: dbus-glib-0.100.2/doc/reference/tmpl/dbus-glib-unused.sgml0000644000175000017500000000000012112654010020135 00000000000000dbus-glib-0.100.2/doc/reference/tmpl/dbus-gobject.sgml0000644000175000017500000000224612112654010017352 00000000000000 DBus GObject related functions @format_version: @method_infos: @n_method_infos: @data: @exported_signals: @exported_properties: @object_type: @info: @iface_type: @dbus_prop_name: @shadow_prop_name: @void: @Returns: @marshaller: @rettype: @...: @marshaller: @rettype: @n_types: @types: @void: dbus-glib-0.100.2/doc/reference/tmpl/dbus-gtype-specialized.sgml0000644000175000017500000001542712112654010021364 00000000000000 Specializable GType System @value: @user_data: @key_val: @value_val: @user_data: @val: @specialization_type: @type: @Returns: @type: @val: @type: @src: @Returns: @constructor: @free_func: @copy_func: @simple_free_func: @type: @instance: @values: @len: @Returns: @type: @instance: @iterator: @user_data: @ctx: @val: @ctx: @base_vtable: @fixed_accessor: @iterator: @append_func: @end_append_func: @type: @instance: @iterator: @user_data: @ctx: @key: @val: @base_vtable: @iterator: @append_func: @type: @instance: @member: @ret_value: @Returns: @type: @instance: @member: @new_value: @Returns: @base_vtable: @get_member: @set_member: @container: @specialization: @Returns: @container: @key_specialization: @value_specialization: @Returns: @container: @num_members: @types: @Returns: @container: @first_type: @...: @Returns: @gtype: @Returns: @gtype: @Returns: @gtype: @Returns: @gtype: @Returns: @gtype: @Returns: @gtype: @Returns: @gtype: @member: @Returns: @gtype: @Returns: @gtype: @Returns: @value: @ctx: @ctx: @elt: @ctx: @ctx: @key: @val: @value: @data_ret: @len_ret: @Returns: @value: @iterator: @user_data: @value: @iterator: @user_data: @value: @member: @dest: @Returns: @value: @member: @src: @Returns: @value: @member: @...: @Returns: @value: @member: @...: @Returns: @void: @name: @vtable: @flags: @name: @vtable: @flags: @map_type: @Returns: @collection_type: @Returns: @struct_type: @Returns: @name: @vtable: @flags: @value: @Returns: @variant: @value: dbus-glib-0.100.2/doc/reference/dbus-glib-docs.sgml0000644000175000017500000000651712107524614016643 00000000000000 ]> D-Bus GLib bindings - Reference Manual for version &version; Introduction D-Bus is a message bus system, a simple way for applications to talk to one another. D-Bus supplies both a system daemon (for events such as "new hardware device added" or "printer queue changed") and a per-user-login-session daemon (for general IPC needs among user applications). Also, the message bus is built on top of a general one-to-one message passing framework, which can be used by any two apps to communicate directly (without going through the message bus daemon). Currently the communicating applications are on one computer, but TCP/IP option is available and remote support planned. The D-Bus API isn't finished yet, and the design is by no means set in stone. One of our main goals is for lots of projects to use it, so if you wouldn't use it, by all means mail us and say why - design, licensing, indentation style, we would rather know than not know. D-Bus' only required dependency is an XML parser (either libxml or expat). D-Bus includes many language bindings to the D-Bus system, if you want to build those. The list of projects using D-Bus is growing and they provide a wealth of examples of using the various APIs to learn from. Trying out D-Bus in sample applications is encouraged - we want to get it widely used and tested. It should be working pretty well these days, and when it isn't bug reports are very welcome. For more information on D-Bus, see http://www.freedesktop.org/wiki/Software/dbus. API Reference API for using D-BUS with GLib libdbus proper is a low-level API, these GLib bindings wrap libdbus with a much higher-level approach. The higher level approach is possible because GLib defines a main loop, an object/type system, and an out-of-memory handling policy (it exits the program). See http://www.gtk.org for GLib information. To manipulate remote objects, use DBusGProxy. Tools Reference &dbus-binding-tool; dbus-glib-0.100.2/doc/Makefile.in0000644000175000017500000005520312112653377013271 00000000000000# 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)/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 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 am__installdirs = "$(DESTDIR)$(man1dir)" NROFF = nroff MANS = $(man_MANS) 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" ABSOLUTE_TOP_BUILDDIR = @ABSOLUTE_TOP_BUILDDIR@ ACLOCAL = @ACLOCAL@ 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@ CYGPATH_W = @CYGPATH_W@ DBUS_BINDING_TOOL = @DBUS_BINDING_TOOL@ DBUS_CFLAGS = @DBUS_CFLAGS@ DBUS_GLIB_CFLAGS = @DBUS_GLIB_CFLAGS@ DBUS_GLIB_LIBS = @DBUS_GLIB_LIBS@ DBUS_GLIB_THREADS_CFLAGS = @DBUS_GLIB_THREADS_CFLAGS@ DBUS_GLIB_THREADS_LIBS = @DBUS_GLIB_THREADS_LIBS@ DBUS_GLIB_TOOL_CFLAGS = @DBUS_GLIB_TOOL_CFLAGS@ DBUS_GLIB_TOOL_LIBS = @DBUS_GLIB_TOOL_LIBS@ DBUS_LIBS = @DBUS_LIBS@ DBUS_PATH_OR_ABSTRACT = @DBUS_PATH_OR_ABSTRACT@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ EXPANDED_BINDIR = @EXPANDED_BINDIR@ EXPANDED_DATADIR = @EXPANDED_DATADIR@ EXPANDED_LIBDIR = @EXPANDED_LIBDIR@ EXPANDED_LOCALSTATEDIR = @EXPANDED_LOCALSTATEDIR@ EXPANDED_SYSCONFDIR = @EXPANDED_SYSCONFDIR@ FGREP = @FGREP@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GREP = @GREP@ GTKDOC_CHECK = @GTKDOC_CHECK@ 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@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_REVISION = @LT_REVISION@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ 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@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TEST_CORE_SERVICE_BINARY = @TEST_CORE_SERVICE_BINARY@ TEST_EXIT_BINARY = @TEST_EXIT_BINARY@ TEST_INTERFACES_SERVICE_BINARY = @TEST_INTERFACES_SERVICE_BINARY@ TEST_SEGFAULT_BINARY = @TEST_SEGFAULT_BINARY@ TEST_SERVICE_BINARY = @TEST_SERVICE_BINARY@ TEST_SERVICE_DIR = @TEST_SERVICE_DIR@ TEST_SHELL_SERVICE_BINARY = @TEST_SHELL_SERVICE_BINARY@ TEST_SLEEP_FOREVER_BINARY = @TEST_SLEEP_FOREVER_BINARY@ TEST_SOCKET_DIR = @TEST_SOCKET_DIR@ VERSION = @VERSION@ 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_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@ 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@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ 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 man_MANS = dbus-binding-tool.1 EXTRA_DIST = $(man_MANS) all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(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: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(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 install-man1: $(man_MANS) @$(NORMAL_INSTALL) @list1=''; \ list2='$(man_MANS)'; \ 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=''; test -n "$(man1dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.1[a-z]*$$/p'; \ } | 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) # 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) @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 @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 $(MANS) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(man1dir)"; 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 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-man 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-man1 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: uninstall-man uninstall-man: uninstall-man1 .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-man1 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 uninstall-man \ uninstall-man1 # 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: dbus-glib-0.100.2/doc/dbus-binding-tool.10000644000175000017500000001734612107524563014632 00000000000000'\" te .TH dbus-binding-tool 1 "26 Feb 2009" "SunOS 5.11" "User Commands" .SH "NAME" dbus-binding-tool \- C language GLib bindings generation utility\&. .SH "SYNOPSIS" .PP \fBdbus-binding-tool\fR [-\fB-force\fR] [-\fB-help\fR] [-\fB-ignore-unsupported\fR] [-\fB-mode=\fIpretty|glib-client|glib-server\fR\fR] [-\fB-output=\fIfile\fR\fR] [-\fB-prefix=\fIsymbol-prefix\fR\fR] [-\fB-version\fR] [\fB\fIfile\fR\fR\&...] .SH "DESCRIPTION" .PP \fBdbus-binding-tool\fR is used to expose a GObject via D\-Bus\&. As input, \fBdbus-binding-tool\fR uses a D\-Bus Introspection XML file\&. As output, the client-side or server-side bindings is generated\&. This output is a header file which eases the use of a remote D\-Bus object\&. Output is sent to standard out or to the filename specified with the -\fB-output\fR argument\&. .SH "EXTENDED DESCRIPTION" .SS "" .PP The following is a sample D\-Bus Introspection XML file which describes an object that exposes one method, named ManyArgs: .PP .nf .fi .PP \fBdbus-binding-tool\fR supports annotations in the XML format to further control how the bindings are generated\&. .SS "client-side bindings" .PP When building client-side bindings, the -\fB-mode=glib-client\fR argument is used\&. The client-side bindings support the "org\&.freedesktop\&.DBus\&.Glib\&.NoReply" annotation\&. This is specified within the tag to indicate that the client is not expecting a reply to the method call, so a reply should not be sent\&. This is often used to speed up rapid method calls where there are no "out" arguments, and not knowing if the method succeeded is an acceptable compromise to halve the traffic on the bus\&. For example: .PP .nf [\&.\&.\&.] [\&.\&.\&.] .fi .SS "server-side bindings" .PP When building server-side bindings, the -\fB-mode=glib-server\fR argument is used\&. Also the -\fB-prefix\fR argument must be used when building server-side bindings so that functions in the generated output are prefexed with the specified value\&. The server-side bindings support the following annotations: .PP "org\&.freedesktop\&.DBus\&.GLib\&.CSymbol" .PP This annotation is used to specify the C symbol names for the various types (interface, method, etc\&.), if it differs from the name D\-Bus generates\&. .PP .PP .nf [\&.\&.\&.] [\&.\&.\&.] .fi .PP "org\&.freedesktop\&.DBus\&.GLib\&.Async" .PP This annotation marks the method implementation as an asynchronous function, which does not return a response straight away but will send the response at some later point to complete the call\&. This is used to implement non-blocking services where method calls can take time\&. .PP When a method is asynchronous, the function prototype is different\&. It is required that the function conform to the following rules: .sp .in +2 \(bu .mk .in +3 .rt The function must return a value of type gboolean; TRUE on success, and FALSE otherwise\&. .in -3 \(bu .mk .in +3 .rt The first parameter is a pointer to an instance of the object\&. .in -3 \(bu .mk .in +3 .rt Following the object instance pointer are the method input values\&. .in -3 \(bu .mk .in +3 .rt The final parameter must be a (DBusGMethodInvocation *)\&. This is used when sending the response message back to the client, by calling dbus_g_method_return or dbus_g_method_return_error\&. .in -3 .in -2 .PP For example: .PP .nf [\&.\&.\&.] [\&.\&.\&.] .fi .PP "org\&.freedesktop\&.DBus\&.GLib\&.Const" .PP This attribute can only be applied to "out" nodes, and specifies that the parameter is not being copied when returned\&. For example, this turns a \&'s\&' argument from a (char **) to a (const char **), and results in the argument not being freed by D\-Bus after the message is sent\&. For example: .PP .nf .fi .PP "org\&.freedesktop\&.DBus\&.GLib\&.ReturnVal" .PP This attribute can only be applied to "out" nodes, and alters the expected function signature\&. It currently can be set to two values: "" or "error"\&. The argument marked with this attribute is not returned via a pointer argument, but by the function\&'s return value\&. If the attribute\&'s value is the empty string, the (GError *) argument is also omitted so there is no standard way to return an error value\&. This is very useful for interfacing with existing code, as it is possible to match existing APIs\&. If the attribute\&'s value is "error", then the final argument is a (GError *) as usual\&. For example: .PP .nf .fi .SH "OPTIONS" .PP The following options are supported: .sp .ne 2 .mk \fB-\fB-force\fR\fR .sp .6 .in +4 Overwrite the output file if it already exists with a newer timestamp than the source files\&. .sp .sp 1 .in -4 .sp .ne 2 .mk \fB-\fB-help\fR\fR .sp .6 .in +4 Display usage information\&. .sp .sp 1 .in -4 .sp .ne 2 .mk \fB-\fB-ignore-unsupported\fR\fR .sp .6 .in +4 If set, then unsupported signatures for parameters are ignored\&. .sp .sp 1 .in -4 .sp .ne 2 .mk \fB-\fB-mode=\fIpretty|glib-client|glib-server\fR\fR\fR .sp .6 .in +4 If the value is "glib-client", then client bindings are generated\&. If the value is "glib-server", then server bindings are generated\&. If the value is "pretty", then the output is in a more human readable format\&. .sp .sp 1 .in -4 .sp .ne 2 .mk \fB-\fB-output=\fIfile\fR\fR\fR .sp .6 .in +4 Specify the output \fIfile\fR\&. .sp .sp 1 .in -4 .sp .ne 2 .mk \fB-\fB-prefix=\fIsymbol-prefix\fR\fR\fR .sp .6 .in +4 Functions in the generated output are prefixed with the \fIsymbol-prefix\fR value\&. .sp .sp 1 .in -4 .sp .ne 2 .mk \fB-\fB-version\fR\fR .sp .6 .in +4 Display the version number of the \fBdbus-binding-tool\fR command\&. .sp .sp 1 .in -4 .SH "OPERANDS" .PP The following operands are supported: .sp .ne 2 .mk \fB\fB\fIfile\fR\fR\fR .in +16n .rt A list of one or more input D\-Bus Introspection XML files to include in the generated output\&. .sp .sp 1 .in -16n .SH "FILES" .PP The following files are used by this application: .sp .ne 2 .mk \fB\fB/usr/bin/dbus-binding-tool\fR \fR .in +32n .rt Executable for the D\-Bus Binding Tool application\&. .sp .sp 1 .in -32n .SH "ATTRIBUTES" .PP See \fBattributes\fR(5) for descriptions of the following attributes: .sp .TS tab() allbox; cw(2.750000i)| cw(2.750000i) lw(2.750000i)| lw(2.750000i). ATTRIBUTE TYPEATTRIBUTE VALUE AvailabilitySUNWdbus-bindings Interface stabilityVolatile .TE .sp .SH "SEE ALSO" .PP \fBdbus-cleanup-sockets\fR(1), \fBdbus-daemon\fR(1), \fBdbus-monitor\fR(1), \fBdbus-send\fR(1), \fBdbus-uuidgen\fR(1), \fBlibdbus-glib-1\fR(3), \fBattributes\fR(5) .SH "NOTES" .PP Written by Brian Cameron, Sun Microsystems Inc\&., 2009\&. ...\" created by instant / solbook-to-man, Thu 26 Feb 2009, 19:15 ...\" LSARC 2006/368 D-BUS Message Bus System dbus-glib-0.100.2/doc/Makefile.am0000644000175000017500000000011312107524563013244 00000000000000SUBDIRS=reference man_MANS = dbus-binding-tool.1 EXTRA_DIST = $(man_MANS)dbus-glib-0.100.2/configure.ac0000644000175000017500000003560112112652643012740 00000000000000dnl -*- mode: m4 -*- AC_PREREQ(2.52) AC_INIT([dbus-glib], [0.100.2], [https://bugs.freedesktop.org/enter_bug.cgi?product=dbus&component=GLib]) AC_CANONICAL_HOST AM_INIT_AUTOMAKE([1.9]) AM_CONFIG_HEADER(config.h) # Honor aclocal flags ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS" AC_CONFIG_MACRO_DIR(m4) ## must come before we use the $USE_MAINTAINER_MODE variable later AM_MAINTAINER_MODE m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])]) # libtool versioning - this applies to libdbus # # See http://sources.redhat.com/autobook/autobook/autobook_91.html#SEC91 for details # ## increment if the interface has additions, changes, removals. LT_CURRENT=4 ## increment any time the source changes; set to ## 0 if you increment CURRENT LT_REVISION=2 ## increment if any interfaces have been added; set to 0 ## if any interfaces have been changed or removed. removal has ## precedence over adding, so set to 0 if both happened. LT_AGE=2 AC_SUBST(LT_CURRENT) AC_SUBST(LT_REVISION) AC_SUBST(LT_AGE) AC_PROG_CC AC_ISC_POSIX AC_HEADER_STDC AC_ARG_ENABLE(tests, AS_HELP_STRING([--enable-tests],[enable unit test code]),enable_tests=$enableval,enable_tests=$USE_MAINTAINER_MODE) AC_ARG_ENABLE(ansi, AS_HELP_STRING([--enable-ansi],[enable -ansi -pedantic gcc flags]),enable_ansi=$enableval,enable_ansi=no) AC_ARG_ENABLE(verbose-mode, AS_HELP_STRING([--enable-verbose-mode],[support verbose debug mode]),enable_verbose_mode=$enableval,enable_verbose_mode=$USE_MAINTAINER_MODE) AC_ARG_ENABLE(asserts, AS_HELP_STRING([--enable-asserts],[include assertion checks]),enable_asserts=$enableval,enable_asserts=$USE_MAINTAINER_MODE) AC_ARG_ENABLE(checks, AS_HELP_STRING([--enable-checks],[include sanity checks on public API]),enable_checks=$enableval,enable_checks=yes) AC_ARG_ENABLE(gcov, AS_HELP_STRING([--enable-gcov],[compile with coverage profiling instrumentation (gcc only)]),enable_gcov=$enableval,enable_gcov=no) AC_ARG_ENABLE(bash-completion, AS_HELP_STRING([--enable-bash-completion],[install bash completion scripts]),enable_bash_completion=$enableval,enable_bash_completion=yes) AC_ARG_WITH(test-socket-dir, AS_HELP_STRING([--with-test-socket-dir=[dirname]],[Where to put sockets for make check])) AC_ARG_WITH(introspect-xml, AS_HELP_STRING([--with-introspect-xml=[filename]],[Pass in a pregenerated dbus daemon introspection xml file (as generated by 'dbus-daemon --introspect') to use instead of querying the installed dbus daemon])) AM_CONDITIONAL(DBUS_BASH_COMPLETION, test x$enable_bash_completion = xyes) if test x$enable_bash_completion = xyes; then AC_DEFINE(DBUS_BASH_COMPLETION,1,[Enable bash completion]) fi if test x$enable_verbose_mode = xyes; then AC_DEFINE(DBUS_ENABLE_VERBOSE_MODE,1,[Support a verbose mode]) fi AC_ARG_WITH(dbus-binding-tool, AS_HELP_STRING([--with-dbus-binding-tool=[filename]],[Use external dbus-binding-tool program]), [DBUS_BINDING_TOOL=$withval],[DBUS_BINDING_TOOL=\$\(top_builddir\)/dbus/dbus-binding-tool]) AC_SUBST(DBUS_BINDING_TOOL) dnl DBUS_BUILD_TESTS controls unit tests built in to .c files dnl and also some stuff in the test/ subdir AM_CONDITIONAL(DBUS_BUILD_TESTS, test x$enable_tests = xyes) if test x$enable_tests = xyes; then AC_DEFINE(DBUS_BUILD_TESTS,1,[Build test code]) fi if test x$enable_verbose_mode = xyes; then AC_DEFINE(DBUS_ENABLE_VERBOSE_MODE,1,[Support a verbose mode]) fi if test x$enable_asserts = xno; then AC_DEFINE(DBUS_DISABLE_ASSERT,1,[Disable assertion checking]) AC_DEFINE(G_DISABLE_ASSERT,1,[Disable GLib assertion macros]) fi if test x$enable_checks = xno; then AC_DEFINE(DBUS_DISABLE_CHECKS,1,[Disable public API sanity checking]) AC_DEFINE(G_DISABLE_CHECKS,1,[Disable GLib public API sanity checking]) fi #### gcc warning flags AC_DEFUN([AC_CC_TRY_FLAG], [ AC_MSG_CHECKING([whether gcc understands $1]) ac_save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $1" AC_COMPILE_IFELSE([ ], [ac_cc_flag=yes], [ac_cc_flag=no]) CFLAGS="$ac_save_CFLAGS" if test "x$ac_cc_flag" = "xyes"; then ifelse([$2], , :, [$2]) else ifelse([$3], , :, [$3]) fi AC_MSG_RESULT([$ac_cc_flag]) ]) if test "x$GCC" = "xyes"; then AC_CC_TRY_FLAG([-Wfloat-equal], [ac_flag_float_equal=yes], [ac_flag_float_equal=no]) changequote(,)dnl case " $CFLAGS " in *[\ \ ]-Wall[\ \ ]*) ;; *) CFLAGS="$CFLAGS -Wall" ;; esac case " $CFLAGS " in *[\ \ ]-Wchar-subscripts[\ \ ]*) ;; *) CFLAGS="$CFLAGS -Wchar-subscripts" ;; esac case " $CFLAGS " in *[\ \ ]-Wmissing-declarations[\ \ ]*) ;; *) CFLAGS="$CFLAGS -Wmissing-declarations" ;; esac case " $CFLAGS " in *[\ \ ]-Wmissing-prototypes[\ \ ]*) ;; *) CFLAGS="$CFLAGS -Wmissing-prototypes" ;; esac case " $CFLAGS " in *[\ \ ]-Wnested-externs[\ \ ]*) ;; *) CFLAGS="$CFLAGS -Wnested-externs" ;; esac case " $CFLAGS " in *[\ \ ]-Wpointer-arith[\ \ ]*) ;; *) CFLAGS="$CFLAGS -Wpointer-arith" ;; esac case " $CFLAGS " in *[\ \ ]-Wcast-align[\ \ ]*) ;; *) CFLAGS="$CFLAGS -Wcast-align" ;; esac if test "x$ac_flag_float_equal" = "xyes"; then case " $CFLAGS " in *[\ \ ]-Wfloat-equal[\ \ ]*) ;; *) CFLAGS="$CFLAGS -Wfloat-equal" ;; esac fi case " $CFLAGS " in *[\ \ ]-Wsign-compare[\ \ ]*) ;; *) CFLAGS="$CFLAGS -Wsign-compare" ;; esac # This one is special - it's not a warning override. # http://bugs.freedesktop.org/show_bug.cgi?id=10599 # is the bug for DBus core. case " $CFLAGS " in *[\ \ ]-fno-strict-aliasing[\ \ ]*) ;; *) CFLAGS="$CFLAGS -fno-strict-aliasing" ;; esac if test "x$enable_ansi" = "xyes"; then case " $CFLAGS " in *[\ \ ]-ansi[\ \ ]*) ;; *) CFLAGS="$CFLAGS -ansi" ;; esac case " $CFLAGS " in *[\ \ ]-D_POSIX_C_SOURCE*) ;; *) CFLAGS="$CFLAGS -D_POSIX_C_SOURCE=199309L" ;; esac case " $CFLAGS " in *[\ \ ]-D_BSD_SOURCE[\ \ ]*) ;; *) CFLAGS="$CFLAGS -D_BSD_SOURCE" ;; esac case " $CFLAGS " in *[\ \ ]-pedantic[\ \ ]*) ;; *) CFLAGS="$CFLAGS -pedantic" ;; esac fi if test x$enable_gcov = xyes; then case " $CFLAGS " in *[\ \ ]-fprofile-arcs[\ \ ]*) ;; *) CFLAGS="$CFLAGS -fprofile-arcs" ;; esac case " $CFLAGS " in *[\ \ ]-ftest-coverage[\ \ ]*) ;; *) CFLAGS="$CFLAGS -ftest-coverage" ;; esac ## remove optimization CFLAGS=`echo "$CFLAGS" | sed -e 's/-O[0-9]*//g'` fi changequote([,])dnl else if test x$enable_gcov = xyes; then AC_MSG_ERROR([--enable-gcov can only be used with gcc]) fi fi AM_PROG_LIBTOOL changequote(,)dnl # compress spaces in flags CFLAGS=`echo "$CFLAGS" | sed -e 's/ +/ /g'` CPPFLAGS=`echo "$CPPFLAGS" | sed -e 's/ +/ /g'` changequote([,])dnl if test x$enable_gcov = xyes; then # so that config.h changes when you toggle gcov support AC_DEFINE_UNQUOTED([DBUS_GCOV_ENABLED], [__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__], [Defined to the gcc version if gcov is enabled, to force a rebuild due to config.h changing]) fi #### Various functions AC_SEARCH_LIBS([socket], [socket]) dnl check for socklen_t AC_MSG_CHECKING(whether socklen_t is defined) AC_TRY_COMPILE([ #include #include #include ],[ socklen_t foo; foo = 1; ],dbus_have_socklen_t=yes,dbus_have_socklen_t=no) AC_MSG_RESULT($dbus_have_socklen_t) if test "x$dbus_have_socklen_t" = "xyes"; then AC_DEFINE(HAVE_SOCKLEN_T,1,[Have socklen_t type]) fi #### Abstract sockets AC_LANG_PUSH(C) AC_CACHE_CHECK([abstract socket namespace], ac_cv_have_abstract_sockets, [AC_RUN_IFELSE([AC_LANG_PROGRAM( [[ #include #include #include #include #include #include #include ]], [[ int listen_fd; struct sockaddr_un addr; listen_fd = socket (PF_UNIX, SOCK_STREAM, 0); if (listen_fd < 0) { fprintf (stderr, "socket() failed: %s\n", strerror (errno)); exit (1); } memset (&addr, '\0', sizeof (addr)); addr.sun_family = AF_UNIX; strcpy (addr.sun_path, "X/tmp/dbus-fake-socket-path-used-in-configure-test"); addr.sun_path[0] = '\0'; /* this is what makes it abstract */ if (bind (listen_fd, (struct sockaddr*) &addr, SUN_LEN (&addr)) < 0) { fprintf (stderr, "Abstract socket namespace bind() failed: %s\n", strerror (errno)); exit (1); } else exit (0); ]])], [ac_cv_have_abstract_sockets=yes], [ac_cv_have_abstract_sockets=no] )]) AC_LANG_POP(C) if test x$enable_abstract_sockets = xyes; then if test x$ac_cv_have_abstract_sockets = xno; then AC_MSG_ERROR([Abstract sockets explicitly required, and support not detected.]) fi fi if test x$enable_abstract_sockets = xno; then ac_cv_have_abstract_sockets=no; fi if test x$ac_cv_have_abstract_sockets = xyes ; then DBUS_PATH_OR_ABSTRACT=abstract AC_DEFINE(HAVE_ABSTRACT_SOCKETS,1,[Have abstract socket namespace]) else DBUS_PATH_OR_ABSTRACT=path fi # this is used in addresses to prefer abstract, e.g. # unix:path=/foo or unix:abstract=/foo AC_SUBST(DBUS_PATH_OR_ABSTRACT) #### Sort out XML library # see what we have AC_CHECK_LIB(expat, XML_ParserCreate_MM, [ AC_CHECK_HEADERS(expat.h, have_expat=true, have_expat=false) ], have_expat=false) if ! $have_expat ; then AC_MSG_ERROR([expat library not found, check config.log for failed attempts]) fi XML_LIBS=-lexpat XML_CFLAGS= #### Set up final flags PKG_CHECK_MODULES([DBUS], [dbus-1 >= 1.2.16]) AC_SUBST([DBUS_CFLAGS]) AC_SUBST([DBUS_LIBS]) # Glib detection PKG_CHECK_MODULES([DBUS_GLIB], [gobject-2.0 >= 2.26, gio-2.0 >= 2.26]) PKG_CHECK_MODULES(DBUS_GLIB_THREADS, gthread-2.0 >= 2.6, have_glib_threads=yes, have_glib_threads=no) AM_CONDITIONAL(HAVE_GLIB_THREADS, test x$have_glib_threads = xyes) GLIB_GENMARSHAL=`$PKG_CONFIG --variable=glib_genmarshal glib-2.0` AC_SUBST(GLIB_GENMARSHAL) dnl GLib flags AC_SUBST(DBUS_GLIB_CFLAGS) AC_SUBST(DBUS_GLIB_LIBS) AC_SUBST(DBUS_GLIB_THREADS_LIBS) DBUS_GLIB_TOOL_CFLAGS=$XML_CFLAGS DBUS_GLIB_TOOL_LIBS="$XML_LIBS" AC_SUBST(DBUS_GLIB_TOOL_CFLAGS) AC_SUBST(DBUS_GLIB_TOOL_LIBS) ### gtk-doc Documentation GTK_DOC_CHECK(1.4) #### Have to go $localstatedir->$prefix/var->/usr/local/var #### someone please fix this a better way... #### find the actual value for $prefix that we'll end up with ## (I know this is broken and should be done in the Makefile, but ## that's a major pain and almost nobody actually seems to care) REAL_PREFIX= if test "x$prefix" = "xNONE"; then REAL_PREFIX=$ac_default_prefix else REAL_PREFIX=$prefix fi ## temporarily change prefix and exec_prefix old_prefix=$prefix prefix=$REAL_PREFIX if test "x$exec_prefix" = xNONE ; then REAL_EXEC_PREFIX=$REAL_PREFIX else REAL_EXEC_PREFIX=$exec_prefix fi old_exec_prefix=$exec_prefix exec_prefix=$REAL_EXEC_PREFIX ## eval everything LOCALSTATEDIR_TMP="$localstatedir" EXPANDED_LOCALSTATEDIR=`eval echo $LOCALSTATEDIR_TMP` AC_SUBST(EXPANDED_LOCALSTATEDIR) SYSCONFDIR_TMP="$sysconfdir" EXPANDED_SYSCONFDIR=`eval echo $SYSCONFDIR_TMP` AC_SUBST(EXPANDED_SYSCONFDIR) BINDIR_TMP="$bindir" EXPANDED_BINDIR=`eval echo $BINDIR_TMP` AC_SUBST(EXPANDED_BINDIR) LIBDIR_TMP="$libdir" EXPANDED_LIBDIR=`eval echo $LIBDIR_TMP` AC_SUBST(EXPANDED_LIBDIR) DATADIR_TMP="$datadir" EXPANDED_DATADIR=`eval echo $DATADIR_TMP` AC_SUBST(EXPANDED_DATADIR) ## put prefix and exec_prefix back prefix=$old_prefix exec_prefix=$old_exec_prefix #### Tell tests where to find certain stuff in builddir ABSOLUTE_TOP_BUILDDIR=`cd ${ac_top_builddir}. && pwd` AC_DEFUN([TEST_PATH], [ TEST_$1=${ABSOLUTE_TOP_BUILDDIR}/test/$2 AC_DEFINE_UNQUOTED(TEST_$1, "$TEST_$1", [Full path to test file test/$2 in builddir]) AC_SUBST(TEST_$1) ]) TEST_PATH(SERVICE_DIR, data/valid-service-files) TEST_PATH(SERVICE_BINARY, test-service) TEST_PATH(SHELL_SERVICE_BINARY, test-shell-service) TEST_PATH(CORE_SERVICE_BINARY, core/test-service-glib) TEST_PATH(INTERFACES_SERVICE_BINARY, interfaces/test-service) TEST_PATH(EXIT_BINARY, test-exit) TEST_PATH(SEGFAULT_BINARY, test-segfault) TEST_PATH(SLEEP_FOREVER_BINARY, test-sleep-forever) AC_SUBST(ABSOLUTE_TOP_BUILDDIR) if ! test -z "$with_test_socket_dir" ; then TEST_SOCKET_DIR="$with_test_socket_dir" else TEST_SOCKET_DIR=$DEFAULT_SOCKET_DIR fi AC_SUBST(TEST_SOCKET_DIR) AC_DEFINE_UNQUOTED(DBUS_TEST_SOCKET_DIR, "$TEST_SOCKET_DIR", [Where to put test sockets]) AC_OUTPUT([ Makefile m4/Makefile doc/Makefile doc/reference/Makefile doc/reference/version.xml dbus/Makefile dbus/examples/Makefile dbus/examples/statemachine/Makefile test/Makefile test/core/Makefile test/interfaces/Makefile test/data/valid-service-files/debug-glib.service test/data/valid-service-files/debug-echo.service test/data/valid-service-files/interfaces-test.service test/lib/Makefile test/manual/Makefile tools/Makefile dbus-glib-1.pc dbus-glib-1-uninstalled.pc ]) dnl ========================================================================== echo " D-BUS GLIB BINDINGS $VERSION ============== prefix: ${prefix} exec_prefix: ${exec_prefix} libdir: ${EXPANDED_LIBDIR} bindir: ${EXPANDED_BINDIR} sysconfdir: ${EXPANDED_SYSCONFDIR} localstatedir: ${EXPANDED_LOCALSTATEDIR} datadir: ${EXPANDED_DATADIR} source code location: ${srcdir} compiler: ${CC} cflags: ${CFLAGS} cppflags: ${CPPFLAGS} " echo " Maintainer mode: ${USE_MAINTAINER_MODE} gcc coverage profiling: ${enable_gcov} Building unit tests: ${enable_tests} Building verbose mode: ${enable_verbose_mode} Building assertions: ${enable_asserts} Building checks: ${enable_checks} Building Gtk-doc docs: ${enable_gtk_doc} Bash Completion: ${enable_bash_completion} Using XML parser: ${with_xml} 'make check' socket dir: ${TEST_SOCKET_DIR} " if test x$enable_tests = xyes; then echo "NOTE: building with unit tests increases the size of the installed library and renders it insecure." fi if test x$enable_tests = xyes -a x$enable_asserts = xno; then echo "NOTE: building with unit tests but without assertions means tests may not properly report failures (this configuration is only useful when doing something like profiling the tests)" fi if test x$enable_gcov = xyes; then echo "NOTE: building with coverage profiling is definitely for developers only." fi if test x$enable_verbose_mode = xyes; then echo "NOTE: building with verbose mode increases library size, may slightly increase security risk, and decreases performance." fi if test x$enable_asserts = xyes; then echo "NOTE: building with assertions increases library size and decreases performance." fi if test x$enable_checks = xno; then echo "NOTE: building without checks for arguments passed to public API makes it harder to debug apps using D-BUS, but will slightly decrease D-BUS library size and _very_ slightly improve performance." fi dbus-glib-0.100.2/dbus-bus-introspect.xml0000644000175000017500000000443512107524563015114 00000000000000 dbus-glib-0.100.2/ltmain.sh0000644000175000017500000105202612054010453012263 00000000000000 # libtool (GNU libtool) 2.4.2 # Written by Gordon Matzigkeit , 1996 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, # 2007, 2008, 2009, 2010, 2011 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 GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, # or obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # Usage: $progname [OPTION]... [MODE-ARG]... # # Provide generalized library-building support services. # # --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 # --preserve-dup-deps don't remove duplicate dependency libraries # --quiet, --silent don't print informational messages # --no-quiet, --no-silent # print informational messages (default) # --no-warn don't display warning messages # --tag=TAG use configuration variables from tag TAG # -v, --verbose print more informational messages than default # --no-verbose don't print the extra informational messages # --version print version information # -h, --help, --help-all print short, long, or detailed 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) # $progname: (GNU libtool) 2.4.2 Debian-2.4.2-1.2 # automake: $automake_version # autoconf: $autoconf_version # # Report bugs to . # GNU libtool home page: . # General help using GNU software: . PROGRAM=libtool PACKAGE=libtool VERSION="2.4.2 Debian-2.4.2-1.2" TIMESTAMP="" package_revision=1.3337 # 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 # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } # NLS nuisances: We save the old values to restore during execute mode. lt_user_locale= lt_safe_locale= for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test \"\${$lt_var+set}\" = set; then save_$lt_var=\$$lt_var $lt_var=C export $lt_var lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\" lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\" fi" done LC_ALL=C LANGUAGE=C export LANGUAGE LC_ALL $lt_unset CDPATH # 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" : ${CP="cp -f"} test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'} : ${MAKE="make"} : ${MKDIR="mkdir"} : ${MV="mv -f"} : ${RM="rm -f"} : ${SHELL="${CONFIG_SHELL-/bin/sh}"} : ${Xsed="$SED -e 1s/^X//"} # Global variables: 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. exit_status=$EXIT_SUCCESS # Make sure IFS has a sensible default lt_nl=' ' IFS=" $lt_nl" dirname="s,/[^/]*$,," basename="s,^.*/,," # func_dirname file append nondir_replacement # Compute the dirname of FILE. If nonempty, add APPEND to the result, # otherwise set result to NONDIR_REPLACEMENT. func_dirname () { func_dirname_result=`$ECHO "${1}" | $SED "$dirname"` if test "X$func_dirname_result" = "X${1}"; then func_dirname_result="${3}" else func_dirname_result="$func_dirname_result${2}" fi } # func_dirname may be replaced by extended shell implementation # func_basename file func_basename () { func_basename_result=`$ECHO "${1}" | $SED "$basename"` } # func_basename may be replaced by extended shell implementation # 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" # Implementation must be kept synchronized with func_dirname # and func_basename. For efficiency, we do not delegate to # those functions but instead duplicate the functionality here. func_dirname_and_basename () { # Extract subdirectory from the argument. func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"` if test "X$func_dirname_result" = "X${1}"; then func_dirname_result="${3}" else func_dirname_result="$func_dirname_result${2}" fi func_basename_result=`$ECHO "${1}" | $SED -e "$basename"` } # func_dirname_and_basename may be replaced by extended shell implementation # func_stripname 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). # func_strip_suffix prefix name func_stripname () { 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 may be replaced by extended shell implementation # These SED scripts presuppose an absolute path with a trailing slash. pathcar='s,^/\([^/]*\).*$,\1,' pathcdr='s,^/[^/]*,,' removedotparts=':dotsl s@/\./@/@g t dotsl s,/\.$,/,' collapseslashes='s@/\{1,\}@/@g' finalslash='s,/*$,/,' # 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. # value returned in "$func_normal_abspath_result" func_normal_abspath () { # 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 "$removedotparts" -e "$collapseslashes" -e "$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 "$pathcar"` func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$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_normal_abspath_result=$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_relative_path SRCDIR DSTDIR # generates a relative path from SRCDIR to DSTDIR, with a trailing # slash if non-empty, suitable for immediately appending a filename # without needing to append a separator. # value returned in "$func_relative_path_result" func_relative_path () { 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 "x$func_relative_path_tlibdir" = x ; 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 "x$func_stripname_result" != x ; then func_relative_path_result=${func_relative_path_result}/${func_stripname_result} fi # Normalisation. If bindir is libdir, return empty string, # else relative path ending with a slash; either way, target # file name can be directly appended. if test ! -z "$func_relative_path_result"; then func_stripname './' '' "$func_relative_path_result/" func_relative_path_result=$func_stripname_result fi } # The name of this program: func_dirname_and_basename "$progpath" progname=$func_basename_result # Make sure we have an absolute path for reexecution: case $progpath in [\\/]*|[A-Za-z]:\\*) ;; *[\\/]*) progdir=$func_dirname_result progdir=`cd "$progdir" && pwd` progpath="$progdir/$progname" ;; *) save_IFS="$IFS" IFS=${PATH_SEPARATOR-:} for progdir in $PATH; do IFS="$save_IFS" test -x "$progdir/$progname" && break done IFS="$save_IFS" test -n "$progdir" || progdir=`pwd` progpath="$progdir/$progname" ;; esac # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed="${SED}"' -e 1s/^X//' sed_quote_subst='s/\([`"$\\]\)/\\\1/g' # Same as above, but do not quote variable references. 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 # which contains forward slashes, into one that contains # (escaped) backslashes. A very naive implementation. lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' # Re-`\' parameter expansions in output of double_quote_subst that were # `\'-ed in input to the same. If an odd number of `\' preceded a '$' # in input to 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 '$'. bs='\\' bs2='\\\\' bs4='\\\\\\\\' dollar='\$' sed_double_backslash="\ s/$bs4/&\\ /g s/^$bs2$dollar/$bs&/ s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g s/\n//g" # Standard options: opt_dry_run=false opt_help=false opt_quiet=false opt_verbose=false opt_warning=: # func_echo arg... # Echo program name prefixed message, along with the current mode # name if it has been set yet. func_echo () { $ECHO "$progname: ${opt_mode+$opt_mode: }$*" } # func_verbose arg... # Echo program name prefixed message in verbose mode only. func_verbose () { $opt_verbose && 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_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "$*" } # func_error arg... # Echo program name prefixed message to standard error. func_error () { $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2 } # func_warning arg... # Echo program name prefixed warning message to standard error. func_warning () { $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2 # bash bug again: : } # func_fatal_error arg... # Echo program name prefixed message to standard error, and exit. func_fatal_error () { func_error ${1+"$@"} exit $EXIT_FAILURE } # func_fatal_help arg... # Echo program name prefixed message to standard error, followed by # a help hint, and exit. func_fatal_help () { func_error ${1+"$@"} func_fatal_error "$help" } help="Try \`$progname --help' for more information." ## default # func_grep expression filename # Check whether EXPRESSION matches any line of FILENAME, without output. func_grep () { $GREP "$1" "$2" >/dev/null 2>&1 } # func_mkdir_p directory-path # Make sure the entire path to DIRECTORY-PATH is available. func_mkdir_p () { my_directory_path="$1" my_dir_list= if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then # Protect directory names starting with `-' case $my_directory_path in -*) my_directory_path="./$my_directory_path" ;; esac # While some portion of DIR does not yet exist... while test ! -d "$my_directory_path"; do # ...make a list in topmost first order. Use a colon delimited # list incase some portion of path contains whitespace. my_dir_list="$my_directory_path:$my_dir_list" # If the last portion added has no slash in it, the list is done case $my_directory_path in */*) ;; *) break ;; esac # ...otherwise throw away the child directory and loop my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"` done my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'` save_mkdir_p_IFS="$IFS"; IFS=':' for my_dir in $my_dir_list; do IFS="$save_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 "$my_dir" 2>/dev/null || : done IFS="$save_mkdir_p_IFS" # Bail out if we (or some other process) failed to create a directory. test -d "$my_directory_path" || \ func_fatal_error "Failed to create \`$1'" fi } # func_mktempdir [string] # Make a temporary directory that won't clash with other running # libtool processes, and avoids race conditions if possible. If # given, STRING is the basename for that directory. func_mktempdir () { my_template="${TMPDIR-/tmp}/${1-$progname}" if test "$opt_dry_run" = ":"; then # Return a directory name, but don't create it in dry-run mode my_tmpdir="${my_template}-$$" else # If mktemp works, use that first and foremost my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` if test ! -d "$my_tmpdir"; then # Failing that, at least try and use $RANDOM to avoid a race my_tmpdir="${my_template}-${RANDOM-0}$$" save_mktempdir_umask=`umask` umask 0077 $MKDIR "$my_tmpdir" umask $save_mktempdir_umask fi # If we're not in dry-run mode, bomb out on failure test -d "$my_tmpdir" || \ func_fatal_error "cannot create temporary directory \`$my_tmpdir'" fi $ECHO "$my_tmpdir" } # func_quote_for_eval arg # Aesthetically quote ARG to be evaled later. # This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT # is double-quoted, suitable for a subsequent eval, whereas # FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters # which are still active within double quotes backslashified. func_quote_for_eval () { case $1 in *[\\\`\"\$]*) func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;; *) func_quote_for_eval_unquoted_result="$1" ;; esac case $func_quote_for_eval_unquoted_result in # Double-quote args containing shell metacharacters to delay # word splitting, command substitution and and variable # expansion for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\"" ;; *) func_quote_for_eval_result="$func_quote_for_eval_unquoted_result" esac } # 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 () { case $1 in *[\\\`\"]*) my_arg=`$ECHO "$1" | $SED \ -e "$double_quote_subst" -e "$sed_double_backslash"` ;; *) my_arg="$1" ;; esac case $my_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. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") my_arg="\"$my_arg\"" ;; esac func_quote_for_expand_result="$my_arg" } # func_show_eval cmd [fail_exp] # Unless opt_silent 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 () { my_cmd="$1" my_fail_exp="${2-:}" ${opt_silent-false} || { func_quote_for_expand "$my_cmd" eval "func_echo $func_quote_for_expand_result" } if ${opt_dry_run-false}; then :; else eval "$my_cmd" my_status=$? if test "$my_status" -eq 0; then :; else eval "(exit $my_status); $my_fail_exp" fi fi } # func_show_eval_locale cmd [fail_exp] # Unless opt_silent 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 () { my_cmd="$1" my_fail_exp="${2-:}" ${opt_silent-false} || { func_quote_for_expand "$my_cmd" eval "func_echo $func_quote_for_expand_result" } if ${opt_dry_run-false}; then :; else eval "$lt_user_locale $my_cmd" my_status=$? eval "$lt_safe_locale" if test "$my_status" -eq 0; then :; else eval "(exit $my_status); $my_fail_exp" fi 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 () { case $1 in [0-9]* | *[!a-zA-Z0-9_]*) func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'` ;; * ) func_tr_sh_result=$1 ;; esac } # func_version # Echo version message to standard output and exit. func_version () { $opt_debug $SED -n '/(C)/!b go :more /\./!{ N s/\n# / / b more } :go /^# '$PROGRAM' (GNU /,/# warranty; / { s/^# // s/^# *$// s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/ p }' < "$progpath" exit $? } # func_usage # Echo short help message to standard output and exit. func_usage () { $opt_debug $SED -n '/^# Usage:/,/^# *.*--help/ { s/^# // s/^# *$// s/\$progname/'$progname'/ p }' < "$progpath" echo $ECHO "run \`$progname --help | more' for full usage" exit $? } # func_help [NOEXIT] # Echo long help message to standard output and exit, # unless 'noexit' is passed as argument. func_help () { $opt_debug $SED -n '/^# Usage:/,/# Report bugs to/ { :print s/^# // s/^# *$// s*\$progname*'$progname'* s*\$host*'"$host"'* s*\$SHELL*'"$SHELL"'* s*\$LTCC*'"$LTCC"'* s*\$LTCFLAGS*'"$LTCFLAGS"'* s*\$LD*'"$LD"'* s/\$with_gnu_ld/'"$with_gnu_ld"'/ s/\$automake_version/'"`(${AUTOMAKE-automake} --version) 2>/dev/null |$SED 1q`"'/ s/\$autoconf_version/'"`(${AUTOCONF-autoconf} --version) 2>/dev/null |$SED 1q`"'/ p d } /^# .* home page:/b print /^# General help using/b print ' < "$progpath" ret=$? if test -z "$1"; then exit $ret fi } # func_missing_arg argname # Echo program name prefixed message to standard error and set global # exit_cmd. func_missing_arg () { $opt_debug func_error "missing argument for $1." exit_cmd=exit } # 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. func_split_short_opt () { my_sed_short_opt='1s/^\(..\).*$/\1/;q' my_sed_short_rest='1s/^..\(.*\)$/\1/;q' func_split_short_opt_name=`$ECHO "$1" | $SED "$my_sed_short_opt"` func_split_short_opt_arg=`$ECHO "$1" | $SED "$my_sed_short_rest"` } # func_split_short_opt may be replaced by extended shell implementation # func_split_long_opt longopt # Set func_split_long_opt_name and func_split_long_opt_arg shell # variables after splitting LONGOPT at the `=' sign. func_split_long_opt () { my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q' my_sed_long_arg='1s/^--[^=]*=//' func_split_long_opt_name=`$ECHO "$1" | $SED "$my_sed_long_opt"` func_split_long_opt_arg=`$ECHO "$1" | $SED "$my_sed_long_arg"` } # func_split_long_opt may be replaced by extended shell implementation exit_cmd=: magic="%%%MAGIC variable%%%" magic_exe="%%%MAGIC EXE variable%%%" # Global variables. nonopt= preserve_args= lo2o="s/\\.lo\$/.${objext}/" o2lo="s/\\.${objext}\$/.lo/" 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= # func_append var value # Append VALUE to the end of shell variable VAR. func_append () { eval "${1}=\$${1}\${2}" } # func_append may be replaced by extended shell implementation # func_append_quoted var value # Quote VALUE and append to the end of shell variable VAR, separated # by a space. func_append_quoted () { func_quote_for_eval "${2}" eval "${1}=\$${1}\\ \$func_quote_for_eval_result" } # func_append_quoted may be replaced by extended shell implementation # func_arith arithmetic-term... func_arith () { func_arith_result=`expr "${@}"` } # func_arith may be replaced by extended shell implementation # func_len string # STRING may not start with a hyphen. func_len () { func_len_result=`expr "${1}" : ".*" 2>/dev/null || echo $max_cmd_len` } # func_len may be replaced by extended shell implementation # func_lo2o object func_lo2o () { func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"` } # func_lo2o may be replaced by extended shell implementation # func_xform libobj-or-source func_xform () { func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'` } # func_xform may be replaced by extended shell implementation # func_fatal_configuration arg... # Echo program name prefixed message to standard error, followed by # a configuration failure hint, and exit. func_fatal_configuration () { func_error ${1+"$@"} func_error "See the $PACKAGE documentation for more information." func_fatal_error "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 "$build_libtool_libs" = yes; then echo "enable shared libraries" else echo "disable shared libraries" fi if test "$build_old_libs" = yes; 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 } # 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 # Option defaults: opt_debug=: opt_dry_run=false opt_config=false opt_preserve_dup_deps=false opt_features=false opt_finish=false opt_help=false opt_help_all=false opt_silent=: opt_warning=: opt_verbose=: opt_silent=false opt_verbose=false # Parse options once, thoroughly. This comes as soon as possible in the # script to make things like `--version' happen as quickly as we can. { # this just eases exit handling while test $# -gt 0; do opt="$1" shift case $opt in --debug|-x) opt_debug='set -x' func_echo "enabling shell trace mode" $opt_debug ;; --dry-run|--dryrun|-n) opt_dry_run=: ;; --config) opt_config=: func_config ;; --dlopen|-dlopen) optarg="$1" opt_dlopen="${opt_dlopen+$opt_dlopen }$optarg" shift ;; --preserve-dup-deps) opt_preserve_dup_deps=: ;; --features) opt_features=: func_features ;; --finish) opt_finish=: set dummy --mode finish ${1+"$@"}; shift ;; --help) opt_help=: ;; --help-all) opt_help_all=: opt_help=': help-all' ;; --mode) test $# = 0 && func_missing_arg $opt && break optarg="$1" opt_mode="$optarg" case $optarg in # Valid mode arguments: clean|compile|execute|finish|install|link|relink|uninstall) ;; # Catch anything else as an error *) func_error "invalid argument for $opt" exit_cmd=exit break ;; esac shift ;; --no-silent|--no-quiet) opt_silent=false func_append preserve_args " $opt" ;; --no-warning|--no-warn) opt_warning=false func_append preserve_args " $opt" ;; --no-verbose) opt_verbose=false func_append preserve_args " $opt" ;; --silent|--quiet) opt_silent=: func_append preserve_args " $opt" opt_verbose=false ;; --verbose|-v) opt_verbose=: func_append preserve_args " $opt" opt_silent=false ;; --tag) test $# = 0 && func_missing_arg $opt && break optarg="$1" opt_tag="$optarg" func_append preserve_args " $opt $optarg" func_enable_tag "$optarg" shift ;; -\?|-h) func_usage ;; --help) func_help ;; --version) func_version ;; # Separate optargs to long options: --*=*) func_split_long_opt "$opt" set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"} shift ;; # Separate non-argument short options: -\?*|-h*|-n*|-v*) func_split_short_opt "$opt" set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"} shift ;; --) break ;; -*) func_fatal_help "unrecognized option \`$opt'" ;; *) set dummy "$opt" ${1+"$@"}; shift; break ;; esac done # Validate options: # save first non-option argument if test "$#" -gt 0; then nonopt="$opt" shift fi # preserve --debug test "$opt_debug" = : || func_append preserve_args " --debug" case $host in *cygwin* | *mingw* | *pw32* | *cegcc*) # 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 if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then func_fatal_configuration "not configured to build any kind of library" fi # Darwin sucks eval std_shrext=\"$shrext_cmds\" # Only execute mode is allowed to have -dlopen flags. if test -n "$opt_dlopen" && test "$opt_mode" != execute; 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." } # Bail if the options were screwed $exit_cmd $EXIT_FAILURE } ## ----------- ## ## Main. ## ## ----------- ## # 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 \ | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 } # 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 "$lalib_p" = yes } # 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 () { func_lalib_p "$1" } # 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 () { $opt_debug save_ifs=$IFS; IFS='~' for cmd in $1; do IFS=$save_ifs eval cmd=\"$cmd\" 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 () { $opt_debug 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 () { $opt_debug 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 "$build_libtool_libs" = yes; then write_lobj=\'${2}\' else write_lobj=none fi if test "$build_old_libs" = yes; 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 "$lt_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 () { $opt_debug # 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 () { $opt_debug 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 () { $opt_debug # awkward: cmd appends spaces to result func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null | $SED -e 's/[ ]*$//' -e "$lt_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 () { $opt_debug 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 () { $opt_debug 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 () { $opt_debug 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 () { $opt_debug $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 () { $opt_debug 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 () { $opt_debug 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 () { $opt_debug 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 () { $opt_debug 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 () { $opt_debug 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 () { $opt_debug 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 () { $opt_debug 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 () { $opt_debug 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 () { $opt_debug 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 () { $opt_debug 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 () { $opt_debug 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 () { $opt_debug 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 () { $opt_debug 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_mode_compile arg... func_mode_compile () { $opt_debug # 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 "$build_libtool_libs" != yes && \ func_fatal_configuration "can not 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 "$build_old_libs" = yes; 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 "$pic_mode" = no && test "$deplibs_check_method" != pass_all; 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 "$compiler_c_o" = no; 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 "$need_locks" = yes; 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 "$need_locks" = warn; 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 "$build_libtool_libs" = yes; then # Without this assignment, base_compile gets emptied. fbsd_hideous_sh_bug=$base_compile if test "$pic_mode" != no; 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 "$need_locks" = warn && 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 "$suppress_opt" = yes; then suppress_output=' >/dev/null 2>&1' fi fi # Only build a position-dependent object if we build old libraries. if test "$build_old_libs" = yes; then if test "$pic_mode" != yes; then # Don't build PIC code command="$base_compile $qsrcfile$pie_flag" else command="$base_compile $qsrcfile $pic_flag" fi if test "$compiler_c_o" = yes; 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 "$need_locks" = warn && 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 "$need_locks" != no; then removelist=$lockfile $RM "$lockfile" fi } exit $EXIT_SUCCESS } $opt_help || { test "$opt_mode" = compile && 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 -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 () { $opt_debug # 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 test "X$opt_dry_run" = Xfalse; then 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" else # 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 fi } test "$opt_mode" = execute && func_mode_execute ${1+"$@"} # func_mode_finish arg... func_mode_finish () { $opt_debug 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_silent && 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 "$opt_mode" = finish && func_mode_finish ${1+"$@"} # func_mode_install arg... func_mode_install () { $opt_debug # There may be an optional sh(1) argument at the beginning of # install_prog (especially on Windows NT). if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || # 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=no 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=yes ;; -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$prev" = x-m && 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=yes if test "$isdir" = yes; 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 ;; 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 "$build_old_libs" = yes; 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=yes 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'` ### testsuite: skip nested quoting test if test -n "$libdir" && test ! -f "$libfile"; then func_warning "\`$lib' has not been installed in \`$libdir'" finalize=no fi done relink_command= func_source "$wrapper" outputname= if test "$fast_install" = no && test -n "$relink_command"; then $opt_dry_run || { if test "$finalize" = yes; 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_silent || { 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 "$opt_mode" = install && 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 () { $opt_debug my_outputname="$1" my_originator="$2" my_pic_p="${3-no}" my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'` my_dlsyms= if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; 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$TIMESTAMP) $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 con'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 /* External symbol declarations for the compiler. */\ " if test "$dlself" = yes; 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 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[]; LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[] = {\ { \"$my_originator\", (void *) 0 }," 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" ;; *) if test "X$my_pic_p" != Xno; then pic_flag_for_symtable=" $pic_flag" fi ;; 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"' # 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_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 () { $opt_debug 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 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 } }'` 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 () { $opt_debug 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 () { $opt_debug 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 which possess that section. Heuristic: eliminate # all those which 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_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 () { $opt_debug 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 () { $opt_debug 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_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 () { $opt_debug 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 () { $opt_debug f_ex_an_ar_dir="$1"; shift f_ex_an_ar_oldlib="$1" if test "$lock_old_archive_extraction" = yes; 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 "$lock_old_archive_extraction" = yes; 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 () { $opt_debug 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` darwin_base_archive=`basename "$darwin_archive"` 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 "$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 in which 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$TIMESTAMP) $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\"" qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"` $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/ which is used only on # windows platforms, and (c) all begin with the string "--lt-" # (application programs are unlikely to have options which 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$TIMESTAMP) $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 "$fast_install" = yes; 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 "$shlibpath_overrides_runpath" = yes && 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 /* 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 platforms) ... */ #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 # ifndef _INTPTR_T_DEFINED # define _INTPTR_T_DEFINED # define intptr_t int # endif #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 ((void *) 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]; int 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 = 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 (strcmp (str, pat) == 0) *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 int 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) { int orig_value_len = strlen (orig_value); int 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 #' */ int len = strlen (new_value); while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1])) { new_value[len-1] = '\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 () { $opt_debug case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in *import*) : ;; *) false ;; esac } # func_mode_link arg... func_mode_link () { $opt_debug 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 # which 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 which 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= non_pic_objects= precious_files_regex= prefer_static_libs=no preload=no 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 "$build_libtool_libs" != yes && \ func_fatal_configuration "can not build a shared library" build_old_libs=no break ;; -all-static | -static | -static-libtool-libs) case $arg in -all-static) if test "$build_libtool_libs" = yes && 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) if test "$preload" = no; then # Add the symbol object into the linking commands. func_append compile_command " @SYMFILE@" func_append finalize_command " @SYMFILE@" preload=yes fi case $arg in *.la | *.lo) ;; # We handle these cases below. force) if test "$dlself" = no; then dlself=needless export_dynamic=yes fi prev= continue ;; self) if test "$prev" = dlprefiles; then dlself=yes elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then dlself=yes else dlself=needless export_dynamic=yes fi prev= continue ;; *) if test "$prev" = dlfiles; 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 ;; 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 "$pic_object" = none && test "$non_pic_object" = none; 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 "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; 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 "$prev" = dlprefiles; 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 "$non_pic_object" != none; 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 "$pic_object" = none ; 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 ;; 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 "$prev" = rpath; 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$arg" = "X-export-symbols"; 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$arg" = "X-lc" || test "X$arg" = "X-lm"; 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$arg" = "X-lc" && continue ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. test "X$arg" = "X-lc" && 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$arg" = "X-lc" && continue ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work test "X$arg" = "X-lc" && continue ;; esac elif test "X$arg" = "X-lc_r"; then case $host in *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc_r directly, use -pthread flag. continue ;; esac fi func_append deplibs " $arg" 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 ;; -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 # @file GCC response files # -tp=* Portland pgcc target processor selection # --sysroot=* for sysroot support # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization -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*|-flto*|-fwhopr*|-fuse-linker-plugin) 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 ;; # 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 "$pic_object" = none && test "$non_pic_object" = none; 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 "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; 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 "$prev" = dlprefiles; 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 "$non_pic_object" != none; 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 "$pic_object" = none ; 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 "$prev" = dlfiles; then # This library was specified with -dlopen. func_append dlfiles " $func_resolve_sysroot_result" prev= elif test "$prev" = dlprefiles; 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 "$export_dynamic" = yes && 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\" 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 "$linkmode" = lib; 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=no 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 "$linkmode,$pass" = "lib,link"; 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 "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan"; then libs="$deplibs" deplibs= fi if test "$linkmode" = prog; then case $pass in dlopen) libs="$dlfiles" ;; dlpreopen) libs="$dlprefiles" ;; link) libs="$deplibs %DEPLIBS%" test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs" ;; esac fi if test "$linkmode,$pass" = "lib,dlpreopen"; 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 "$pass" = dlopen; then # Collect dlpreopened libraries save_deplibs="$deplibs" deplibs= fi for deplib in $libs; do lib= found=no case $deplib in -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append compiler_flags " $deplib" if test "$linkmode" = lib ; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi continue ;; -l*) if test "$linkmode" != lib && test "$linkmode" != prog; then func_warning "\`-l' is ignored for archives/objects" continue fi func_stripname '-l' '' "$deplib" name=$func_stripname_result if test "$linkmode" = lib; 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 "$search_ext" = ".la"; then found=yes else found=no fi break 2 fi done done if test "$found" != yes; then # deplib doesn't seem to be a libtool library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue else # 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 "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; 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=no func_dirname "$lib" "" "." ladir="$func_dirname_result" lib=$ladir/$old_library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue fi fi ;; *) ;; esac fi fi ;; # -l *.ltframework) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" if test "$linkmode" = lib ; 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 "$pass" = conv && 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 "$pass" = conv; then deplibs="$deplib $deplibs" continue fi if test "$pass" = scan; 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 "$pass" = link; 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 "$pass" = conv; 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=no 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=yes fi ;; pass_all) valid_a_lib=yes ;; esac if test "$valid_a_lib" != yes; then 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." else echo $ECHO "*** Warning: Linking the shared library $output against the" $ECHO "*** static library $deplib is not portable!" deplibs="$deplib $deplibs" fi ;; esac continue ;; prog) if test "$pass" != link; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi continue ;; esac # linkmode ;; # *.$libext *.lo | *.$objext) if test "$pass" = conv; then deplibs="$deplib $deplibs" elif test "$linkmode" = prog; then if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; 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=yes continue ;; esac # case $deplib if test "$found" = yes || test -f "$lib"; then : else func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'" fi # 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 "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan" || { test "$linkmode" != prog && test "$linkmode" != lib; }; then test -n "$dlopen" && func_append dlfiles " $dlopen" test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen" fi if test "$pass" = conv; 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" 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 elif test "$linkmode" != prog && test "$linkmode" != lib; then func_fatal_error "\`$lib' is not a convenience library" fi continue fi # $pass = conv # Get the name of the library we link against. linklib= if test -n "$old_library" && { test "$prefer_static_libs" = yes || test "$prefer_static_libs,$installed" = "built,no"; }; 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 "$pass" = dlopen; then if test -z "$libdir"; then func_fatal_error "cannot -dlopen a convenience library: \`$lib'" fi if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; 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 "X$installed" = Xyes; 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 "X$hardcode_automatic" = Xyes && 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 "$pass" = dlpreopen; then if test -z "$libdir" && test "$linkmode" = prog; 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 "$linkmode" = lib; then deplibs="$dir/$old_library $deplibs" elif test "$linkmode,$pass" = "prog,link"; 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 "$linkmode" = prog && test "$pass" != link; then func_append newlib_search_path " $ladir" deplibs="$lib $deplibs" linkalldeplibs=no if test "$link_all_deplibs" != no || test -z "$library_names" || test "$build_libtool_libs" = no; then linkalldeplibs=yes 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 test "$linkalldeplibs" = yes; 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 "$linkmode,$pass" = "prog,link"; then if test -n "$library_names" && { { test "$prefer_static_libs" = no || test "$prefer_static_libs,$installed" = "built,yes"; } || 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 test "$alldeplibs" = yes && { test "$deplibs_check_method" = pass_all || { test "$build_libtool_libs" = yes && 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 "$use_static_libs" = built && test "$installed" = yes; then use_static_libs=no fi if test -n "$library_names" && { test "$use_static_libs" = no || test -z "$old_library"; }; then case $host in *cygwin* | *mingw* | *cegcc*) # No point in relinking DLLs because paths are not encoded func_append notinst_deplibs " $lib" need_relink=no ;; *) if test "$installed" = no; 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 "$shouldnotlink" = yes && test "$pass" = link; then echo if test "$linkmode" = prog; 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 "$linkmode" = lib && test "$hardcode_into_libs" = yes; 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*) 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 "$linkmode" = prog || test "$opt_mode" != relink; then add_shlibpath= add_dir= add= lib_linked=yes case $hardcode_action in immediate | unsupported) if test "$hardcode_direct" = no; 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 can not # 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 "$hardcode_minus_L" = no; then case $host in *-*-sunos*) add_shlibpath="$dir" ;; esac add_dir="-L$dir" add="-l$name" elif test "$hardcode_shlibpath_var" = no; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; relink) if test "$hardcode_direct" = yes && test "$hardcode_direct_absolute" = no; then add="$dir/$linklib" elif test "$hardcode_minus_L" = yes; 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 "$hardcode_shlibpath_var" = yes; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; *) lib_linked=no ;; esac if test "$lib_linked" != yes; 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 "$linkmode" = prog; 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 "$hardcode_direct" != yes && test "$hardcode_minus_L" != yes && test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac fi fi fi if test "$linkmode" = prog || test "$opt_mode" = relink; then add_shlibpath= add_dir= add= # Finalize command for both is simple: just hardcode it. if test "$hardcode_direct" = yes && test "$hardcode_direct_absolute" = no; then add="$libdir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$libdir" add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac add="-l$name" elif test "$hardcode_automatic" = yes; 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 "$linkmode" = prog; 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 "$linkmode" = prog; 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 "$hardcode_direct" != unsupported; 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 "$build_libtool_libs" = yes; then # Not a shared library if test "$deplibs_check_method" != pass_all; 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 can not 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 "$module" = yes; 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 "$build_old_libs" = no; 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 "$linkmode" = lib; then if test -n "$dependency_libs" && { test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes || test "$link_static" = yes; }; 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 "$link_static" = no && 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 "$link_all_deplibs" != no; 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 "$pass" = link; then if test "$linkmode" = "prog"; 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 "$pass" = dlpreopen; then # Link the dlpreopened libraries before other libraries for deplib in $save_deplibs; do deplibs="$deplib $deplibs" done fi if test "$pass" != dlopen; then if test "$pass" != conv; then # 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= fi if test "$linkmode,$pass" != "prog,link"; then vars="deplibs" else vars="compile_deplibs finalize_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 # 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 "$linkmode" = prog; then dlfiles="$newdlfiles" fi if test "$linkmode" = prog || test "$linkmode" = lib; then dlprefiles="$newdlprefiles" fi case $linkmode in oldlib) if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; 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 "$module" = no && \ func_fatal_help "libtool library \`$output' must begin with \`lib'" if test "$need_lib_prefix" != no; 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 "$deplibs_check_method" != pass_all; 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 "$dlself" != no && \ func_warning "\`-dlopen self' is ignored for libtool libraries" set dummy $rpath shift test "$#" -gt 1 && \ func_warning "ignoring multiple \`-rpath's for a libtool library" install_libdir="$1" oldlibs= if test -z "$rpath"; then if test "$build_libtool_libs" = yes; 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 # which has an extra 1 added just for fun # case $version_type in # correct linux to gnu/linux during the next big refactor darwin|linux|osf|windows|none) func_arith $number_major + $number_minor current=$func_arith_result age="$number_minor" revision="$number_revision" ;; freebsd-aout|freebsd-elf|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 ;; *) func_fatal_configuration "$modename: unknown library version type \`$version_type'" ;; 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" ;; freebsd-aout) major=".$current" versuffix=".$current.$revision"; ;; freebsd-elf) major=".$current" versuffix=".$current" ;; irix | nonstopux) if test "X$lt_irix_increment" = "Xno"; 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 "$loop" -ne 0; 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 "$loop" -ne 0; 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" ;; sunos) major=".$current" versuffix=".$current.$revision" ;; windows) # Use '-' rather than '.', since we only want one # extension on DOS 8.3 filesystems. 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 "$need_version" = no; then versuffix= else versuffix=".0.0" fi fi # Remove version info from name if versioning should be avoided if test "$avoid_version" = yes && test "$need_version" = no; then major= versuffix= verstring="" fi # Check to see if the archive will have undefined symbols. if test "$allow_undefined" = yes; then if test "$allow_undefined_flag" = unsupported; then func_warning "undefined symbols not allowed in $host shared libraries" build_libtool_libs=no build_old_libs=yes fi else # Don't allow undefined symbols. allow_undefined_flag="$no_undefined_flag" fi fi func_generate_dlsyms "$libname" "$libname" "yes" func_append libobjs " $symfileobj" test "X$libobjs" = "X " && libobjs= if test "$opt_mode" != relink; 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 "X$precious_files_regex" != "X"; 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 "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; 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 "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; 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 "$build_libtool_libs" = yes; 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 "$build_libtool_need_lc" = "yes"; 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 "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; 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 "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; 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 "X$deplibs_check_method" = "Xnone"; 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 "$droppeddeps" = yes; then if test "$module" = yes; 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 "$build_old_libs" = no; 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 "$allow_undefined" = no; 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 "$build_old_libs" = no; 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 "$build_libtool_libs" = yes; then # Remove ${wl} instances when linking with ld. # FIXME: should test the right _cmds variable. case $archive_cmds in *\$LD\ *) wl= ;; esac if test "$hardcode_into_libs" = yes; then # Hardcode the library paths hardcode_libdirs= dep_rpath= rpath="$finalize_rpath" test "$opt_mode" != relink && 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 "$opt_mode" != relink && 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 if test "x`$SED 1q $export_symbols`" != xEXPORTS; then # 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 fi ;; esac # Prepare the list of exported symbols if test -z "$export_symbols"; then if test "$always_export_symbols" = yes || 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 "$try_normal_branch" = yes \ && { 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 "X$skipped_export" != "X:"; 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 "X$skipped_export" != "X:" && 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 "$compiler_needs_object" = yes && 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 "$thread_safe" = yes && 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 "$opt_mode" = relink; 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 "$module" = yes && 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 "X$skipped_export" != "X:" && 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 "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; 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 "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then output=${output_objdir}/${output_la}.lnk func_verbose "creating linker input file list: $output" : > $output set x $save_libobjs shift firstobj= if test "$compiler_needs_object" = yes; 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 "X$objlist" = X || 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 "$k" -eq 1 ; 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 if ${skipped_export-false}; then 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 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_silent || { 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 "$opt_mode" = relink; 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 if ${skipped_export-false}; then 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 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 "$module" = yes && 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="$save_ifs" eval cmd=\"$cmd\" $opt_silent || { 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 "$opt_mode" = relink; 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 "$opt_mode" = relink; 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 "$module" = yes || test "$export_dynamic" = yes; then # On all known operating systems, these are identical. dlname="$soname" fi fi ;; obj) if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; 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= # reload_cmds runs $LD directly, so let us get rid of # -Wl from whole_archive_flag_spec and hope we can get by with # turning comma into space.. wl= if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'` 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 "$build_libtool_libs" != yes && 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" ### testsuite: skip nested quoting test 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 if test "$build_libtool_libs" != yes; then 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 fi if test -n "$pic_flag" || test "$pic_mode" != default; 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" test "$preload" = yes \ && test "$dlopen_support" = unknown \ && test "$dlopen_self" = unknown \ && test "$dlopen_self_static" = unknown && \ 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 "$tagname" = CXX ; 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 "$build_old_libs" = yes; 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@" "no" # template prelinking step if test -n "$prelink_cmds"; then func_execute_cmds "$prelink_cmds" 'exit $?' fi wrappers_required=yes case $host in *cegcc* | *mingw32ce*) # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway. wrappers_required=no ;; *cygwin* | *mingw* ) if test "$build_libtool_libs" != yes; then wrappers_required=no fi ;; *) if test "$need_relink" = no || test "$build_libtool_libs" != yes; then wrappers_required=no fi ;; esac if test "$wrappers_required" = no; then # 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 fi 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 "$no_install" = yes; 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 if test "$hardcode_action" = relink; then # 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" else if test "$fast_install" != no; then link_command="$finalize_var$compile_command$finalize_rpath" if test "$fast_install" = yes; then relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'` else # fast_install is set to needless relink_command= fi else link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" fi fi # 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 relink_command="(cd `pwd`; $relink_command)" relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` 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 if test "$build_libtool_libs" = convenience; then oldobjs="$libobjs_save $symfileobj" addlibs="$convenience" build_libtool_libs=no else if test "$build_libtool_libs" = module; then oldobjs="$libobjs_save" build_libtool_libs=no else oldobjs="$old_deplibs $non_pic_objects" if test "$preload" = yes && test -f "$symfileobj"; then func_append oldobjs " $symfileobj" fi fi addlibs="$old_convenience" fi 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 "$build_libtool_libs" = yes; 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 "X$oldobjs" = "X" ; 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 "$build_old_libs" = yes && 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@)" relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` if test "$hardcode_automatic" = yes ; then relink_command= fi # Only create the output if not a dry run. $opt_dry_run || { for installed in no yes; do if test "$installed" = yes; 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 "x$bindir" != x ; 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$TIMESTAMP) $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 can not 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 "$installed" = no && test "$need_relink" = yes; 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 } { test "$opt_mode" = link || test "$opt_mode" = relink; } && func_mode_link ${1+"$@"} # func_mode_uninstall arg... func_mode_uninstall () { $opt_debug RM="$nonopt" files= rmforce= 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=yes ;; -*) 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 "X$dir" = X.; then odir="$objdir" else odir="$dir/$objdir" fi func_basename "$file" name="$func_basename_result" test "$opt_mode" = uninstall && odir="$dir" # Remember odir for removal later, being careful to avoid duplicates if test "$opt_mode" = clean; 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 test "$rmforce" = yes; 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" 'test "$rmforce" = yes || exit_status=1' fi if test -n "$old_library"; then # Do each command in the old_postuninstall commands. func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || 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 "$pic_object" != none; 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 "$non_pic_object" != none; then func_append rmfiles " $dir/$non_pic_object" fi fi ;; *) if test "$opt_mode" = clean ; 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 "$fast_install" = yes && 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 } { test "$opt_mode" = uninstall || test "$opt_mode" = clean; } && func_mode_uninstall ${1+"$@"} 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 # in which 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: # vi:sw=2 dbus-glib-0.100.2/m4/0000755000175000017500000000000012112654011011034 500000000000000dbus-glib-0.100.2/m4/ltversion.m40000644000175000017500000000126212054010453013245 00000000000000# ltversion.m4 -- version numbers -*- Autoconf -*- # # Copyright (C) 2004 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 3337 ltversion.m4 # This file is part of GNU Libtool m4_define([LT_PACKAGE_VERSION], [2.4.2]) m4_define([LT_PACKAGE_REVISION], [1.3337]) AC_DEFUN([LTVERSION_VERSION], [macro_version='2.4.2' macro_revision='1.3337' _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) _LT_DECL(, macro_revision, 0) ]) dbus-glib-0.100.2/m4/Makefile.in0000644000175000017500000002751612112653462013045 00000000000000# 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)/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) ABSOLUTE_TOP_BUILDDIR = @ABSOLUTE_TOP_BUILDDIR@ ACLOCAL = @ACLOCAL@ 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@ CYGPATH_W = @CYGPATH_W@ DBUS_BINDING_TOOL = @DBUS_BINDING_TOOL@ DBUS_CFLAGS = @DBUS_CFLAGS@ DBUS_GLIB_CFLAGS = @DBUS_GLIB_CFLAGS@ DBUS_GLIB_LIBS = @DBUS_GLIB_LIBS@ DBUS_GLIB_THREADS_CFLAGS = @DBUS_GLIB_THREADS_CFLAGS@ DBUS_GLIB_THREADS_LIBS = @DBUS_GLIB_THREADS_LIBS@ DBUS_GLIB_TOOL_CFLAGS = @DBUS_GLIB_TOOL_CFLAGS@ DBUS_GLIB_TOOL_LIBS = @DBUS_GLIB_TOOL_LIBS@ DBUS_LIBS = @DBUS_LIBS@ DBUS_PATH_OR_ABSTRACT = @DBUS_PATH_OR_ABSTRACT@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ EXPANDED_BINDIR = @EXPANDED_BINDIR@ EXPANDED_DATADIR = @EXPANDED_DATADIR@ EXPANDED_LIBDIR = @EXPANDED_LIBDIR@ EXPANDED_LOCALSTATEDIR = @EXPANDED_LOCALSTATEDIR@ EXPANDED_SYSCONFDIR = @EXPANDED_SYSCONFDIR@ FGREP = @FGREP@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GREP = @GREP@ GTKDOC_CHECK = @GTKDOC_CHECK@ 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@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_REVISION = @LT_REVISION@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ 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@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TEST_CORE_SERVICE_BINARY = @TEST_CORE_SERVICE_BINARY@ TEST_EXIT_BINARY = @TEST_EXIT_BINARY@ TEST_INTERFACES_SERVICE_BINARY = @TEST_INTERFACES_SERVICE_BINARY@ TEST_SEGFAULT_BINARY = @TEST_SEGFAULT_BINARY@ TEST_SERVICE_BINARY = @TEST_SERVICE_BINARY@ TEST_SERVICE_DIR = @TEST_SERVICE_DIR@ TEST_SHELL_SERVICE_BINARY = @TEST_SHELL_SERVICE_BINARY@ TEST_SLEEP_FOREVER_BINARY = @TEST_SLEEP_FOREVER_BINARY@ TEST_SOCKET_DIR = @TEST_SOCKET_DIR@ VERSION = @VERSION@ 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_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@ 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@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ 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 = gtk-doc.m4 all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(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: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(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: dbus-glib-0.100.2/m4/lt~obsolete.m40000644000175000017500000001375612054010453013605 00000000000000# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- # # Copyright (C) 2004, 2005, 2007, 2009 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])]) dbus-glib-0.100.2/m4/ltoptions.m40000644000175000017500000003007312054010453013255 00000000000000# Helper functions for option handling. -*- Autoconf -*- # # Copyright (C) 2004, 2005, 2007, 2008, 2009 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 7 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_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_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=default]) test -z "$pic_mode" && 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])]) dbus-glib-0.100.2/m4/libtool.m40000644000175000017500000106000712054010453012667 00000000000000# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008, 2009, 2010, 2011 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) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is part of GNU Libtool. # # 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 GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, or # obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ]) # serial 57 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.58])dnl We use AC_INCLUDES_DEFAULT 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_CC_BASENAME(CC) # ------------------- # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. m4_defun([_LT_CC_BASENAME], [for cc_temp in $1""; do case $cc_temp in compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` ]) # _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 _LT_CONFIG_LIBTOOL_INIT([ # See if we are running on zsh, and set the options which 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 "X${COLLECT_NAMES+set}" != Xset; 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\\"\\\`\\\\\\"" ;; *) 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\\"\\\`\\\\\\"" ;; *) 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 $lt_write_fail = 0 && 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 "$silent" = yes && 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 which 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 # `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $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. # _LT_COPYING _LT_LIBTOOL_TAGS # ### BEGIN LIBTOOL CONFIG _LT_LIBTOOL_CONFIG_VARS _LT_LIBTOOL_TAG_VARS # ### END LIBTOOL CONFIG _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 "X${COLLECT_NAMES+set}" != Xset; 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) _LT_PROG_REPLACE_SHELLFNS 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' TIMESTAMP='$TIMESTAMP' 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 $_lt_result -eq 0; 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 $_lt_result -eq 0 && $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 "$lt_cv_apple_cc_single_mod" = "yes"; then _lt_dar_single_mod='$single_module' fi if test "$lt_cv_ld_exported_symbols_list" = "yes"; 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 "$lt_cv_ld_force_load" = "no"; 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 "$lt_cv_ld_force_load" = "yes"; 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*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; 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 "$lt_cv_apple_cc_single_mod" != "yes"; 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 "${lt_cv_aix_libpath+set}" = 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 which will find a shell with a builtin # printf (which 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], [ --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 "$GCC" = yes; 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 in which 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 "x$enable_libtool_lock" != xno && 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 which ABI we are using. 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 which ABI we are using. echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then if test "$lt_cv_prog_gnu_ld" = yes; 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* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out which ABI we are using. 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 ;; ppc64-*linux*|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" ;; ppc*-*linux*|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 x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; *-*solaris*) # Find out which ABI we are using. 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*) 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 "$ac_status" -eq 0; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a AC_TRY_EVAL([lt_ar_try]) if test "$ac_status" -ne 0; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a ]) ]) if test "x$lt_cv_ar_at_file" = xno; 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 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" # 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 x"[$]$2" = xyes; 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 x"[$]$2" = xyes; 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; ;; netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) # 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 $i != 17 # 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 "$cross_compiling" = yes; 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 -fvisbility=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 "x$enable_dlopen" != xyes; 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 ]) ;; *) 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 "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && 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 "x$lt_cv_dlopen_self" = xyes; 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 "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; 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 "$hard_links" = no; 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 in which 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 "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then # We can hardcode non-existent directories. if test "$_LT_TAGVAR(hardcode_direct, $1)" != no && # 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 "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no && test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; 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 "$_LT_TAGVAR(hardcode_action, $1)" = relink || test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; 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_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 AC_MSG_CHECKING([dynamic linker characteristics]) m4_if([$1], [], [ if test "$GCC" = yes; 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` 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" else 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 "$host_cpu" = ia64; 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 # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # 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}' else # 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' fi 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%'\''`; test $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 version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; 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=yes 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 "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; 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 "$lt_cv_prog_gnu_ld" = yes; 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 ;; # 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 # Append ld.so.conf contents 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' ;; netbsdelf*-gnu) version_type=linux 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='NetBSD ld.elf_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*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac 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 if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[[89]] | openbsd2.[[89]].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; 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 "$with_gnu_ld" = yes; 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=freebsd-elf 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 "$with_gnu_ld" = yes; 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 "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" fi if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" fi _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], [2], [Run-time system search path for libraries]) ])# _LT_SYS_DYNAMIC_LINKER # _LT_PATH_TOOL_PREFIX(TOOL) # -------------------------- # find a file program which 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 which 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 "$withval" = no || with_gnu_ld=yes], [with_gnu_ld=no])dnl ac_prog=ld if test "$GCC" = yes; 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 "$with_gnu_ld" = yes; 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 /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* | netbsdelf*-gnu) 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*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; 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 ;; 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 case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in */dev/null* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break ;; *) 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 "$lt_cv_path_NM" != "no"; 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 /dev/null 2>&1 | sed '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols" ;; *) 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 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 "x$lt_cv_path_mainfest_tool" != xyes; then MANIFEST_TOOL=: fi _LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl ])# _LT_PATH_MANIFEST_TOOL # 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 "$GCC" = yes; 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 "$host_cpu" = ia64; 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 # 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 -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$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 -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'" lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/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 # and D for any global 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};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ " {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ " s[1]~/^[@?]/{print s[1], s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print 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 con'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* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$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 "$pipe_works" = yes; 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_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_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 "$GXX" = yes; 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 "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; 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']) ;; 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 "$host_cpu" = ia64; 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 "$host_cpu" != ia64; 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* | netbsdelf*-gnu) ;; *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 "$GCC" = yes; 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 "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; 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']) ;; 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 "$host_cpu" = ia64; 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 ;; 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']) ;; 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' ;; 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 which 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 AIX nm, but means don't demangle with GNU nm # Also, AIX nm treats weak defined symbols like other global defined # symbols, whereas GNU nm marks them as "W". 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) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | 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 ;; linux* | k*bsd*-gnu | gnu*) _LT_TAGVAR(link_all_deplibs, $1)=no ;; *) _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 "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; linux* | k*bsd*-gnu | gnu*) _LT_TAGVAR(link_all_deplibs, $1)=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 "$with_gnu_ld" = yes; 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 "$lt_use_gnu_ld_interface" = yes; 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 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 "$host_cpu" != ia64; 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 (1st line # is EXPORTS), use it as is; otherwise, prepend... _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; 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 ;; 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 "$host_os" = linux-dietlibc; 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 "$tmp_diet" = no 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' ;; 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 "x$supports_anon_versioning" = xyes; 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 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 "x$supports_anon_versioning" = xyes; 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* | netbsdelf*-gnu) 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 can not *** 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 "$_LT_TAGVAR(ld_shlibs, $1)" = no; 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 "$GCC" = yes && 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 "$host_cpu" = ia64; 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 AIX nm, but means don't demangle with GNU nm # Also, AIX nm treats weak defined symbols like other global # defined symbols, whereas GNU nm marks them as "W". 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) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | 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 # need to do runtime linking. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; 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,' if test "$GCC" = yes; 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 "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi _LT_TAGVAR(link_all_deplibs, $1)=no else # not using gcc if test "$host_cpu" = ia64; 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 "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi 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_use_runtimelinking" = yes; 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 "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; 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 "$with_gnu_ld" = yes; 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 # This is similar to how AIX traditionally builds its shared libraries. _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' 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~linknames=' _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; else sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $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 "$GCC" = yes; 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 $output_objdir/$soname = $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 $output_objdir/$soname = $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 "$GCC" = yes && test "$with_gnu_ld" = no; 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 "$with_gnu_ld" = no; 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 "$GCC" = yes && test "$with_gnu_ld" = no; 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 "$with_gnu_ld" = no; 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 "$GCC" = yes; 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 "$lt_cv_irix_exported_symbol" = yes; 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 ;; netbsd* | netbsdelf*-gnu) 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*) 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__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; 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 case $host_os in openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' ;; *) _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' ;; esac 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 _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; 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 "$GCC" = yes; 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 "$GCC" = yes; 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 "$GCC" = yes; 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 "x$host_vendor" = xsequent; 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 "$GCC" = yes; 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 can NOT 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 "$GCC" = yes; 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 x$host_vendor = xsni; 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 "$_LT_TAGVAR(ld_shlibs, $1)" = no && 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 "$enable_shared" = yes && test "$GCC" = yes; 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 which 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 "$can_build_shared" = "no" && 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 "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no 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 "$enable_shared" = yes || 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 "X$CXX" != "Xno" && ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || (test "X$CXX" != "Xg++"))) ; 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 "$_lt_caught_CXX_error" != yes; 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 "$GXX" = yes; 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 "$GXX" = yes; 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 "$with_gnu_ld" = yes; 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 "$host_cpu" = ia64; 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 # need to do runtime linking. 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 ;; 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,' if test "$GXX" = yes; 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 "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; 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 "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi 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_use_runtimelinking" = yes; 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 "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; 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 "$with_gnu_ld" = yes; 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 # This is similar to how AIX traditionally builds its shared # libraries. _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' 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~linknames=' _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; else $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $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 (1st line # is EXPORTS), use it as is; otherwise, prepend... _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; 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) ;; 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 $output_objdir/$soname = $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 "$GXX" = yes; 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 $output_objdir/$soname = $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 $with_gnu_ld = no; 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 "$GXX" = yes; then if test $with_gnu_ld = no; 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 "$GXX" = yes; then if test "$with_gnu_ld" = no; 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 "x$supports_anon_versioning" = xyes; 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 ;; openbsd2*) # C++ shared libraries are fairly broken _LT_TAGVAR(ld_shlibs, $1)=no ;; openbsd*) 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__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; 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 "$GXX" = yes && test "$with_gnu_ld" = no; 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 "$GXX" = yes && test "$with_gnu_ld" = no; 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 $LDFLAGS $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 -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 $LDFLAGS $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 -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 can NOT 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 "$_LT_TAGVAR(ld_shlibs, $1)" = no && 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 "$_lt_caught_CXX_error" != yes 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 ${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 ])# _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 $p = "-L" || test $p = "-R"; 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 "$pre_test_object_deps_done" = no; 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 "$pre_test_object_deps_done" = no; 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)= ;; linux*) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac if test "$solaris_use_stlport4" != yes; then _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' fi ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac # Adding this requires a known-good setup of shared libraries for # Sun compiler versions before 5.6, else PIC objects from an old # archive will be linked into the output, leading to subtle bugs. if test "$solaris_use_stlport4" != yes; then _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' fi ;; esac ;; 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 "X$F77" = "Xno"; 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 "$_lt_disable_F77" != yes; 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 "$can_build_shared" = "no" && 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 "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no 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 "$enable_shared" = yes || 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 "$_lt_disable_F77" != yes 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 "X$FC" = "Xno"; 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 "$_lt_disable_FC" != yes; 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 "$can_build_shared" = "no" && 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 "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no 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 "$enable_shared" = yes || 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 "$_lt_disable_FC" != yes 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 "x${GCJFLAGS+set}" = xset || 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 $lt_ac_count -gt 10 && 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], [AC_MSG_CHECKING([whether the shell understands some XSI constructs]) # Try some XSI features xsi_shell=no ( _lt_dummy="a/b/c" test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ = c,a/b,b/c, \ && eval 'test $(( 1 + 1 )) -eq 2 \ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ && xsi_shell=yes AC_MSG_RESULT([$xsi_shell]) _LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell']) AC_MSG_CHECKING([whether the shell understands "+="]) lt_shell_append=no ( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \ >/dev/null 2>&1 \ && lt_shell_append=yes AC_MSG_RESULT([$lt_shell_append]) _LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append']) 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_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY) # ------------------------------------------------------ # In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and # '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY. m4_defun([_LT_PROG_FUNCTION_REPLACE], [dnl { sed -e '/^$1 ()$/,/^} # $1 /c\ $1 ()\ {\ m4_bpatsubsts([$2], [$], [\\], [^\([ ]\)], [\\\1]) } # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: ]) # _LT_PROG_REPLACE_SHELLFNS # ------------------------- # Replace existing portable implementations of several shell functions with # equivalent extended shell implementations where those features are available.. m4_defun([_LT_PROG_REPLACE_SHELLFNS], [if test x"$xsi_shell" = xyes; then _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl case ${1} in */*) func_dirname_result="${1%/*}${2}" ;; * ) func_dirname_result="${3}" ;; esac]) _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl func_basename_result="${1##*/}"]) _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl case ${1} in */*) func_dirname_result="${1%/*}${2}" ;; * ) func_dirname_result="${3}" ;; esac func_basename_result="${1##*/}"]) _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are # positional parameters, so assign one to ordinary parameter first. func_stripname_result=${3} func_stripname_result=${func_stripname_result#"${1}"} func_stripname_result=${func_stripname_result%"${2}"}]) _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl func_split_long_opt_name=${1%%=*} func_split_long_opt_arg=${1#*=}]) _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl func_split_short_opt_arg=${1#??} func_split_short_opt_name=${1%"$func_split_short_opt_arg"}]) _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl case ${1} in *.lo) func_lo2o_result=${1%.lo}.${objext} ;; *) func_lo2o_result=${1} ;; esac]) _LT_PROG_FUNCTION_REPLACE([func_xform], [ func_xform_result=${1%.*}.lo]) _LT_PROG_FUNCTION_REPLACE([func_arith], [ func_arith_result=$(( $[*] ))]) _LT_PROG_FUNCTION_REPLACE([func_len], [ func_len_result=${#1}]) fi if test x"$lt_shell_append" = xyes; then _LT_PROG_FUNCTION_REPLACE([func_append], [ eval "${1}+=\\${2}"]) _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl func_quote_for_eval "${2}" dnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \ eval "${1}+=\\\\ \\$func_quote_for_eval_result"]) # Save a `func_append' function call where possible by direct use of '+=' sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: else # Save a `func_append' function call even when '+=' is not available sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: fi if test x"$_lt_function_replace_fail" = x":"; then AC_MSG_WARN([Unable to substitute extended shell functions in $ofile]) fi ]) # _LT_PATH_CONVERSION_FUNCTIONS # ----------------------------- # Determine which 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 dbus-glib-0.100.2/m4/ltsugar.m40000644000175000017500000001042412054010453012701 00000000000000# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- # # Copyright (C) 2004, 2005, 2007, 2008 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 ]) dbus-glib-0.100.2/m4/Makefile.am0000644000175000017500000000003011634152371013013 00000000000000EXTRA_DIST = gtk-doc.m4 dbus-glib-0.100.2/m4/gtk-doc.m40000644000175000017500000000461111731550205012556 00000000000000dnl -*- mode: autoconf -*- # serial 1 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 dnl check for tools we added during development AC_PATH_PROG([GTKDOC_CHECK],[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]) if test x$enable_gtk_doc = xyes; then ifelse([$1],[], [PKG_CHECK_EXISTS([gtk-doc],, AC_MSG_ERROR([gtk-doc not installed and --enable-gtk-doc requested]))], [PKG_CHECK_EXISTS([gtk-doc >= $1],, AC_MSG_ERROR([You need to have gtk-doc >= $1 installed to build $PACKAGE_NAME]))]) 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 fi AC_MSG_CHECKING([whether to build gtk-doc documentation]) AC_MSG_RESULT($enable_gtk_doc) 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 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"]) ]) dbus-glib-0.100.2/INSTALL0000644000175000017500000002134511634152371011504 00000000000000 DBus GLib Installation ================= Quick start =========== DBus uses GNU AutoTools for its build system, thus the basic install procedure can be summarized as: ./configure --prefix=/usr make su make install The configure script will automatically determine whether to try and build bindings for GLib, Qt, Qt3, Python and Mono based on what tools are installed on the host system. The default build behaviour can be overridden using the --enable-XXX/--disable-XXX arguments to configure. A typical scenario in which it is desirable to override automatic detection, is during packaging of binary builds, where a predictable dependancy chain is required. For more details on GNU AutoTools installation, consult the generic instructions later in this document External software dependancies ============================== Requisite: - GLib >= 2.6 Optional: - gtk-doc (for API documentation) ==================================================================== The rest of this document contains the generic GNU AutoTools install insructions.... Basic Installation ================== These are generic installation instructions. 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, a file `config.cache' that saves the results of its tests to speed up reconfiguring, and a file `config.log' containing compiler output (useful mainly for debugging `configure'). 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 at some point `config.cache' contains results you don't want to keep, you may remove or edit it. The file `configure.in' is used to create `configure' by a program called `autoconf'. You only need `configure.in' 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. If you're using `csh' on an old version of System V, you might need to type `sh ./configure' instead to prevent `csh' from trying to execute `configure' itself. Running `configure' takes awhile. 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. 4. Type `make install' to install the programs and any data files and documentation. 5. 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. Compilers and Options ===================== Some systems require unusual options for compilation or linking that the `configure' script does not know about. You can give `configure' initial values for variables by setting them in the environment. Using a Bourne-compatible shell, you can do that on the command line like this: CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure Or on systems that have the `env' program, you can do it like this: env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure 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 must use a version of `make' that supports the `VPATH' variable, such as 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 `..'. If you have to use a `make' that does not supports the `VPATH' variable, you have 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. Installation Names ================== By default, `make install' will install the package's files in `/usr/local/bin', `/usr/local/man', etc. You can specify an installation prefix other than `/usr/local' by giving `configure' the option `--prefix=PATH'. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you give `configure' the option `--exec-prefix=PATH', the package will use PATH as the prefix for installing programs and libraries. Documentation and other data files will still use the regular prefix. In addition, if you use an unusual directory layout you can give options like `--bindir=PATH' 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. 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'. Optional Features ================= 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. Specifying the System Type ========================== There may be some features `configure' can not figure out automatically, but needs to determine by the type of host the package will run on. Usually `configure' can figure that out, but if it prints a message saying it can not guess the host type, give it the `--host=TYPE' option. TYPE can either be a short name for the system type, such as `sun4', or a canonical name with three fields: CPU-COMPANY-SYSTEM 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 host type. If you are building compiler tools for cross-compiling, you can also use the `--target=TYPE' option to select the type of system they will produce code for and the `--build=TYPE' option to select the type of system on which you are compiling the package. 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. Operation Controls ================== `configure' recognizes the following options to control how it operates. `--cache-file=FILE' Use and save the results of the tests in FILE instead of `./config.cache'. Set FILE to `/dev/null' to disable caching, for debugging `configure'. `--help' Print a summary of the options to `configure', and exit. `--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. `--version' Print the version of Autoconf used to generate the `configure' script, and exit. `configure' also accepts some other, not widely useful, options. dbus-glib-0.100.2/config.sub0000755000175000017500000010532711764422452012445 00000000000000#! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, # 2011, 2012 Free Software Foundation, Inc. timestamp='2012-04-18' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software # can handle that machine. It does not imply ALL GNU software can. # # 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 2 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. # Please send patches to . Submit a context # diff and a properly formatted GNU ChangeLog entry. # # 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;hb=HEAD # 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 $0 [OPTION] 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 (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 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-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ knetbsd*-gnu* | netbsd*-gnu* | \ 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 | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ | be32 | be64 \ | bfin \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ | epiphany \ | fido | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | hexagon \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | le32 | le64 \ | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | 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 \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | moxie \ | mt \ | msp430 \ | nds32 | nds32le | nds32be \ | nios | nios2 \ | ns16k | ns32k \ | open8 \ | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle \ | pyramid \ | rl78 | rx \ | score \ | 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 \ | spu \ | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ | ubicom32 \ | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ | 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 ;; m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | 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-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | be32-* | be64-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* \ | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | 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-* \ | le32-* | le64-* \ | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \ | 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-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nds32-* | nds32le-* | nds32be-* \ | nios-* | nios2-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | open8-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ | pyramid-* \ | 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-* \ | 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 ;; 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 ;; 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 ;; mingw32) basic_machine=i386-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 ;; 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 ;; msdos) basic_machine=i386-pc os=-msdos ;; ms1-*) basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; msys) basic_machine=i386-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) 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* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* | -aros* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ | -openbsd* | -solidbsd* \ | -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* | -linux-gnu* | -linux-android* \ | -linux-newlib* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*) # 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 ;; -kaos*) os=-kaos ;; -zvmoe) os=-zvmoe ;; -dicos*) os=-dicos ;; -nacl*) ;; -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 ;; 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: dbus-glib-0.100.2/tools/0000755000175000017500000000000012112654010011653 500000000000000dbus-glib-0.100.2/tools/lcov.am0000644000175000017500000000351212107524614013070 00000000000000# Copyright © 2010 Collabora Ltd. # # Licensed under the Academic Free License version 2.1 # # 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 of the License, or # (at your option) any later version. # # Alternatively, at your option, you can redistribute and/or modify # this single file under the terms of the GNU Lesser General Public License # as published by the Free Software Foundation; either version 2.1 of # that 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, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 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 '*-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 $(LCOV_CHECK_ARGS) $(MAKE) lcov-report ## vim:set ft=automake: dbus-glib-0.100.2/tools/Makefile.in0000644000175000017500000004146612112653462013665 00000000000000# 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)/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 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)$(libdbus_glibdir)" HEADERS = $(nodist_libdbus_glib_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ABSOLUTE_TOP_BUILDDIR = @ABSOLUTE_TOP_BUILDDIR@ ACLOCAL = @ACLOCAL@ 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@ CYGPATH_W = @CYGPATH_W@ DBUS_BINDING_TOOL = @DBUS_BINDING_TOOL@ DBUS_CFLAGS = @DBUS_CFLAGS@ DBUS_GLIB_CFLAGS = @DBUS_GLIB_CFLAGS@ DBUS_GLIB_LIBS = @DBUS_GLIB_LIBS@ DBUS_GLIB_THREADS_CFLAGS = @DBUS_GLIB_THREADS_CFLAGS@ DBUS_GLIB_THREADS_LIBS = @DBUS_GLIB_THREADS_LIBS@ DBUS_GLIB_TOOL_CFLAGS = @DBUS_GLIB_TOOL_CFLAGS@ DBUS_GLIB_TOOL_LIBS = @DBUS_GLIB_TOOL_LIBS@ DBUS_LIBS = @DBUS_LIBS@ DBUS_PATH_OR_ABSTRACT = @DBUS_PATH_OR_ABSTRACT@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ EXPANDED_BINDIR = @EXPANDED_BINDIR@ EXPANDED_DATADIR = @EXPANDED_DATADIR@ EXPANDED_LIBDIR = @EXPANDED_LIBDIR@ EXPANDED_LOCALSTATEDIR = @EXPANDED_LOCALSTATEDIR@ EXPANDED_SYSCONFDIR = @EXPANDED_SYSCONFDIR@ FGREP = @FGREP@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GREP = @GREP@ GTKDOC_CHECK = @GTKDOC_CHECK@ 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@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_REVISION = @LT_REVISION@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ 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@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TEST_CORE_SERVICE_BINARY = @TEST_CORE_SERVICE_BINARY@ TEST_EXIT_BINARY = @TEST_EXIT_BINARY@ TEST_INTERFACES_SERVICE_BINARY = @TEST_INTERFACES_SERVICE_BINARY@ TEST_SEGFAULT_BINARY = @TEST_SEGFAULT_BINARY@ TEST_SERVICE_BINARY = @TEST_SERVICE_BINARY@ TEST_SERVICE_DIR = @TEST_SERVICE_DIR@ TEST_SHELL_SERVICE_BINARY = @TEST_SHELL_SERVICE_BINARY@ TEST_SLEEP_FOREVER_BINARY = @TEST_SLEEP_FOREVER_BINARY@ TEST_SOCKET_DIR = @TEST_SOCKET_DIR@ VERSION = @VERSION@ 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_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@ 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@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ 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 = -I$(top_srcdir) $(DBUS_CFLAGS) $(DBUS_GLIB_CFLAGS) $(DBUS_X_CFLAGS) $(DBUS_GTK_THREADS_CFLAGS) -DDBUS_COMPILATION nodist_libdbus_glib_HEADERS = dbus-glib-bindings.h libdbus_glibdir = $(includedir)/dbus-1.0/dbus BUILT_SOURCES = dbus-glib-bindings.h EXTRA_DIST = run-with-tmp-session-bus.sh session.conf CLEANFILES = \ run-with-tmp-session-bus.conf \ dbus-glib-bindings.h all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(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: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(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 install-nodist_libdbus_glibHEADERS: $(nodist_libdbus_glib_HEADERS) @$(NORMAL_INSTALL) @list='$(nodist_libdbus_glib_HEADERS)'; test -n "$(libdbus_glibdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(libdbus_glibdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(libdbus_glibdir)" || 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)$(libdbus_glibdir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(libdbus_glibdir)" || exit $$?; \ done uninstall-nodist_libdbus_glibHEADERS: @$(NORMAL_UNINSTALL) @list='$(nodist_libdbus_glib_HEADERS)'; test -n "$(libdbus_glibdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(libdbus_glibdir)'; $(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 $(HEADERS) installdirs: for dir in "$(DESTDIR)$(libdbus_glibdir)"; 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 distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-nodist_libdbus_glibHEADERS 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-nodist_libdbus_glibHEADERS .MAKE: all check install install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool ctags 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-nodist_libdbus_glibHEADERS \ 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 \ tags uninstall uninstall-am \ uninstall-nodist_libdbus_glibHEADERS dbus-glib-bindings.h: $(top_srcdir)/dbus-bus-introspect.xml $(top_builddir)/dbus/dbus-binding-tool$(EXEEXT) $(DBUS_BINDING_TOOL) --mode=glib-client --prefix=dbus_bus --output=dbus-glib-bindings.h $(top_srcdir)/dbus-bus-introspect.xml # 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: dbus-glib-0.100.2/tools/session.conf0000644000175000017500000000134511634152371014143 00000000000000 session unix:tmpdir=./ dbus-glib-0.100.2/tools/run-with-tmp-session-bus.sh0000755000175000017500000000374511634152371017001 00000000000000#! /bin/sh SCRIPTNAME=$0 WRAPPED_SCRIPT=$1 shift die() { if ! test -z "$DBUS_SESSION_BUS_PID" ; then echo "killing message bus "$DBUS_SESSION_BUS_PID >&2 kill -9 $DBUS_SESSION_BUS_PID fi echo $SCRIPTNAME: $* >&2 exit 1 } if test -z "$DBUS_TOP_BUILDDIR" ; then die "Must set DBUS_TOP_BUILDDIR" fi if test -z "$DBUS_TOP_SRCDIR" ; then die "Must set DBUS_TOP_SRCDIR" fi ## convenient to be able to ctrl+C without leaking the message bus process trap 'die "Received SIGINT"' SIGINT CONFIG_FILE=./run-with-tmp-session-bus.conf SERVICE_DIR="$DBUS_TOP_BUILDDIR/test/data/valid-service-files" ESCAPED_SERVICE_DIR=`echo $SERVICE_DIR | sed -e 's/\//\\\\\\//g'` echo "escaped service dir is: $ESCAPED_SERVICE_DIR" >&2 ## create a configuration file based on the standard session.conf cat $DBUS_TOP_SRCDIR/tools/session.conf | \ sed -e 's/.*$/'$ESCAPED_SERVICE_DIR'<\/servicedir>/g' | \ sed -e 's/ $CONFIG_FILE echo "Created configuration file $CONFIG_FILE" >&2 PATH=$DBUS_TOP_BUILDDIR/bus:$PATH export PATH ## the libtool script found by the path search should already do this, but LD_LIBRARY_PATH=$DBUS_TOP_BUILDDIR/dbus/.libs:$LD_LIBRARY_PATH export PATH unset DBUS_SESSION_BUS_ADDRESS unset DBUS_SESSION_BUS_PID echo "Running dbus-launch --sh-syntax --config-file=$CONFIG_FILE" >&2 eval `dbus-launch --sh-syntax --config-file=$CONFIG_FILE` if test -z "$DBUS_SESSION_BUS_PID" ; then die "Failed to launch message bus for introspection generation to run" fi echo "Started bus pid $DBUS_SESSION_BUS_PID at $DBUS_SESSION_BUS_ADDRESS" >&2 # Execute wrapped script echo "Running $WRAPPED_SCRIPT $@" >&2 $WRAPPED_SCRIPT "$@" || die "script \"$WRAPPED_SCRIPT\" failed" kill -TERM $DBUS_SESSION_BUS_PID || die "Message bus vanished! should not have happened" && echo "Killed daemon $DBUS_SESSION_BUS_PID" >&2 sleep 2 ## be sure it really died kill -9 $DBUS_SESSION_BUS_PID > /dev/null 2>&1 || true exit 0 dbus-glib-0.100.2/tools/Makefile.am0000644000175000017500000000117212107524563013645 00000000000000INCLUDES=-I$(top_srcdir) $(DBUS_CFLAGS) $(DBUS_GLIB_CFLAGS) $(DBUS_X_CFLAGS) $(DBUS_GTK_THREADS_CFLAGS) -DDBUS_COMPILATION nodist_libdbus_glib_HEADERS = dbus-glib-bindings.h libdbus_glibdir = $(includedir)/dbus-1.0/dbus dbus-glib-bindings.h: $(top_srcdir)/dbus-bus-introspect.xml $(top_builddir)/dbus/dbus-binding-tool$(EXEEXT) $(DBUS_BINDING_TOOL) --mode=glib-client --prefix=dbus_bus --output=dbus-glib-bindings.h $(top_srcdir)/dbus-bus-introspect.xml BUILT_SOURCES = dbus-glib-bindings.h EXTRA_DIST = run-with-tmp-session-bus.sh session.conf CLEANFILES = \ run-with-tmp-session-bus.conf \ dbus-glib-bindings.h dbus-glib-0.100.2/install-sh0000755000175000017500000003325611777117217012473 00000000000000#!/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: dbus-glib-0.100.2/Makefile.am0000644000175000017500000000322012112652540012472 00000000000000ACLOCAL_AMFLAGS = -I m4 GLIB_PC=dbus-glib-1.pc SUBDIRS=dbus tools test doc DIST_SUBDIRS=dbus tools test doc m4 pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = $(GLIB_PC) DISTCLEANFILES = \ $(GLIB_PC) EXTRA_DIST = \ HACKING \ NEWS \ dbus-bus-introspect.xml \ dbus-glib-1.pc.in # Creating ChangeLog from git log: MAINTAINERCLEANFILES = ChangeLog DISTCHECK_CONFIGURE_FLAGS=--enable-gtk-doc --enable-checks --enable-tests EXTRA_DIST += ChangeLog ChangeLog: $(srcdir)/ChangeLog: @if test -d "$(srcdir)/.git"; then \ (cd "$(srcdir)" && \ ./missing --run git log --stat) | fmt --split-only > $@.tmp \ && mv -f $@.tmp $@ \ || ($(RM) $@.tmp; \ echo Failed to generate ChangeLog, your ChangeLog may be outdated >&2; \ (test -f $@ || echo git-log is required to generate this file >> $@)); \ else \ test -f $@ || \ (echo A git checkout and git log are required to generate ChangeLog >&2 && \ echo A git checkout and git-log are required to generate this file >> $@); \ fi %.tar.gz.asc: %.tar.gz $(AM_V_GEN)gpg --detach-sign --armor $@ maintainer-upload-release: test -f @PACKAGE@-@VERSION@.tar.gz test -f @PACKAGE@-@VERSION@.tar.gz.asc gpg --verify @PACKAGE@-@VERSION@.tar.gz.asc rsync -vzP @PACKAGE@-@VERSION@.tar.gz dbus.freedesktop.org:/srv/dbus.freedesktop.org/www/releases/@PACKAGE@/@PACKAGE@-@VERSION@.tar.gz rsync -vzP @PACKAGE@-@VERSION@.tar.gz.asc dbus.freedesktop.org:/srv/dbus.freedesktop.org/www/releases/@PACKAGE@/@PACKAGE@-@VERSION@.tar.gz.asc rsync -rvzPp --chmod=Dg+s,ug+rwX,o=rX $(srcdir)/docs/reference/html/ \ dbus.freedesktop.org:/srv/dbus.freedesktop.org/www/doc/@PACKAGE@/ include tools/lcov.am dbus-glib-0.100.2/ChangeLog0000644000175000017500000151723412112654010012222 00000000000000commit 02b44f8427ea48463d7b9f2a9f7099be7643b60d Author: Simon McVittie Date: 2013-02-25 12:24:35 +0000 0.102: respin tarball configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 78f3e953e4a05a1126874dd2ca6cec5777a15b3b Author: Simon McVittie Date: 2013-02-15 12:37:04 +0000 0.100.1 point release configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 166978a09cf5edff4028e670b6074215a4c75eca Author: Colin Walters Date: 2013-02-14 10:19:34 -0500 CVE-2013-0292: dbus-gproxy: Verify sender of NameOwnerChanged signals to be o.f.DBus Anyone can hop on the bus and emit a signal whose interface is o.f.DBus; it's expected at the moments that clients (and notably DBus libraries) check the sender. This could previously be used to trick a system service using dbus-glib into thinking a malicious signal came from a privileged source, by claiming that ownership of the privileged source's well-known name had changed from the privileged source's real unique name to the attacker's unique name. [altered to be NULL-safe so it won't crash on peer connections -smcv] Signed-off-by: Simon McVittie Reviewed-by: Simon McVittie dbus/dbus-gproxy.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) commit c6cbdf9ed99f82983dd529319475dd02c53ad2aa Author: Simon McVittie Date: 2012-06-25 18:23:30 +0100 Fix builds without tests test/manual/Makefile.am | 5 +++++ 1 file changed, 5 insertions(+) commit a0dd0c8c240896a5dd205c1dbc51924b9d41f833 Author: Simon McVittie Date: 2012-06-25 17:26:48 +0100 Prepare version 0.100 configure.ac | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 8b7e4a1c4ae055864e26db4addbcc2dc38ee6963 Author: Simon McVittie Date: 2012-04-16 12:11:38 +0100 Fix two crashes when dbus_g_proxy_new_for_peer is used on a bus The first part of the bug is that when NameOwnerChanged is received with a dbus_g_proxy_new_for_peer (which has no name) alive, checking whether it was affected by the NameOwnerChanged caused a NULL dereference and segfault. The second part of the bug is that if the last proxy in existence is for a peer, when it was unregistered there would be no owner_match_rules, causing a crash. Both are exercised in the new test added here. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=41126 Signed-off-by: Simon McVittie Reviewed-by: Will Thompson .gitignore | 1 + dbus/dbus-gproxy.c | 5 +- test/core/Makefile.am | 3 + test/core/peer-on-bus.c | 148 +++++++++++++++++++++++++++++++++++++++++++++++ test/core/run-test.sh | 1 + 5 files changed, 156 insertions(+), 2 deletions(-) commit 82d45d15088d206f1e1f024215e95301fa04e92c Author: Simon McVittie Date: 2012-04-16 12:10:37 +0100 Add a utility function to tear down a private connection in tests Bug: https://bugs.freedesktop.org/show_bug.cgi?id=41126 Reviewed-by: Will Thompson configure.ac | 1 + test/Makefile.am | 4 +-- test/core/Makefile.am | 4 ++- test/interfaces/Makefile.am | 4 ++- test/lib/Makefile.am | 19 ++++++++++++ test/lib/util.c | 69 +++++++++++++++++++++++++++++++++++++++++++ test/lib/util.h | 32 ++++++++++++++++++++ 7 files changed, 129 insertions(+), 4 deletions(-) commit 403c5bf4d98fcba83caa94aee96da27128bbf9c8 Author: Matthias Klose Date: 2012-06-25 17:11:45 +0100 Fix build error with -Werror=format-security Origin: vendor, Ubuntu Reviewed-by: Simon McVittie dbus/dbus-gobject.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit ae0ed3e435c550c3fae1a86a1c3cb42da319dff2 Author: Simon McVittie Date: 2011-09-28 17:42:44 +0100 Move use of 0 as an error domain into the invalid-usage test I think this is invalid, although others might disagree. Signed-off-by: Simon McVittie Bug: https://bugs.freedesktop.org/show_bug.cgi?id=40151 Reviewed-by: Will Thompson test/core/error-mapping.c | 26 -------------------------- test/manual/invalid-usage.c | 25 +++++++++++++++++++++++++ 2 files changed, 25 insertions(+), 26 deletions(-) commit 92c613b8f429a4fe6c762805f1a4f3588511e6a7 Author: Simon McVittie Date: 2011-09-28 17:35:42 +0100 Add a manual test for various invalid behaviour Most of this has been sitting in a branch since fd.o #30171; fixing fd.o #40151, another case of library-user error leading to undefined behaviour and a hard-to-diagnose crash, seems a good time to get this merged. Signed-off-by: Simon McVittie Bug: https://bugs.freedesktop.org/show_bug.cgi?id=40151 Reviewed-by: Will Thompson .gitignore | 1 + configure.ac | 1 + test/Makefile.am | 4 +- test/manual/Makefile.am | 27 ++++ test/manual/invalid-usage.c | 295 +++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 326 insertions(+), 2 deletions(-) commit 539bd92b8703134057c039f965ff7a5b5434c3a7 Author: Simon McVittie Date: 2011-09-28 17:41:35 +0100 Remove tests in test-dbus-glib which basically just test error mapping Also remove the methods on MyObject that only existed to support these tests; ThrowError is now versatile enough to implement them all. Leave ThrowUnregisteredError as it is, since it violates GError expectations (see GNOME#660371), but stop using it in test-dbus-glib - it's enough to use it in test-error-mapping. Signed-off-by: Simon McVittie Bug: https://bugs.freedesktop.org/show_bug.cgi?id=40151 Reviewed-by: Will Thompson test/core/my-object.c | 36 ------------------------------- test/core/test-dbus-glib.c | 45 --------------------------------------- test/core/test-service-glib.xml | 9 -------- 3 files changed, 90 deletions(-) commit b0dc0f419b641f4ab8fdd8eaf69f4ed4c2d61159 Author: Simon McVittie Date: 2011-09-28 14:56:45 +0100 Add a new test for error mapping Signed-off-by: Simon McVittie Bug: https://bugs.freedesktop.org/show_bug.cgi?id=40151 Reviewed-by: Will Thompson .gitignore | 1 + test/core/Makefile.am | 7 + test/core/error-mapping.c | 327 +++++++++++++++++++++++++++++++++++++++++++++ test/core/run-test.sh | 1 + 4 files changed, 336 insertions(+) commit 5aa25d4f3c44e7f46e95b8d8de64bf63f2c7c42e Author: Simon McVittie Date: 2011-09-28 17:23:18 +0100 MyObject: make ThrowError, AsyncThrowError throw a caller-specified error This can be used to test arbitrary errors, but only in-process; in tests with the service out-of-process, like test-dbus-glib, the initial error (matching the error they previously threw) will always be used. This obsoletes ThrowErrorUnderscore, ThrowErrorMultiWord and ThrowNotSupported, but not ThrowUnregisteredError due to some strange assumptions about the validity of GError domains in that method (see GNOME#660731). Signed-off-by: Simon McVittie Bug: https://bugs.freedesktop.org/show_bug.cgi?id=40151 Reviewed-by: Will Thompson test/core/my-object.c | 49 +++++++++++++++++++++++++++++++++++-------------- test/core/my-object.h | 5 +++++ 2 files changed, 40 insertions(+), 14 deletions(-) commit df3949806818ba0eab495fcaad2c7f3ad38007c7 Author: Simon McVittie Date: 2011-09-28 16:14:52 +0100 test-dbus-glib.c isn't GTest yet, but add bug numbers anyway Signed-off-by: Simon McVittie Bug: https://bugs.freedesktop.org/show_bug.cgi?id=40151 Reviewed-by: Will Thompson test/core/test-dbus-glib.c | 4 ++++ 1 file changed, 4 insertions(+) commit ead4ef065f700a4b586e78400789a7a18c856cc4 Author: Simon McVittie Date: 2011-09-28 14:57:02 +0100 Add copyright/licensing information to test-dbus-glib I've tried to dig up the copyright holders from git history; possibly incomplete, but none of them cared enough to add their own copyright notices, so this is the best we'll get. Signed-off-by: Simon McVittie Bug: https://bugs.freedesktop.org/show_bug.cgi?id=40151 Reviewed-by: Will Thompson test/core/test-dbus-glib.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) commit 309bce6d7965037bc6f1827715d2372ae19c98d5 Author: Simon McVittie Date: 2011-09-28 13:23:29 +0100 Form a valid D-Bus error name if an unmapped error has a negative code Signed-off-by: Simon McVittie Bug: https://bugs.freedesktop.org/show_bug.cgi?id=40151 Reviewed-by: Will Thompson dbus/dbus-gobject.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit ffd32e448a76045696d81a82fec9aeac7dd5e64b Author: Simon McVittie Date: 2011-09-28 12:20:16 +0100 If an error code is out of range for its domain, warn about it Signed-off-by: Simon McVittie Bug: https://bugs.freedesktop.org/show_bug.cgi?id=40151 Reviewed-by: Will Thompson dbus/dbus-gobject.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) commit a31371cb5852c485b85926125988c0a170a640ca Author: David Woodhouse Date: 2011-09-28 12:16:01 +0100 Don't crash in gerror_domaincode_to_dbus_error_name if code is out of range Bug: https://bugs.freedesktop.org/show_bug.cgi?id=40151 Reviewed-by: Simon McVittie dbus/dbus-gobject.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit 86ba4b0b8591b882803be1a064df4c213349fba0 Author: Simon McVittie Date: 2011-09-22 18:25:02 +0100 dbus_g_value_parse_variant: fix several GVariant ref leaks g_variant_get_child_value() (and hence g_variant_get_variant(), which is a simple wrapper) returns a ref to the child; we were assuming it didn't. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=41125 Reviewed-by: Jonny Lamb dbus/dbus-gvalue-parse-variant.c | 56 ++++++++++++++++++++++++++------------ 1 file changed, 38 insertions(+), 18 deletions(-) commit 51222609f1af2eda0c223881dda3985435c3ad3f Author: Colin Walters Date: 2012-01-08 11:29:33 -0500 test-service-glib: Fix build with GLib 2.30 Only can be included directly. test/core/test-service-glib.c | 1 - 1 file changed, 1 deletion(-) commit 0215b0af4c95c9b9fc79ada5b99882f1261e2644 Author: Colin Walters Date: 2012-01-08 11:28:10 -0500 autogen.sh: Honor NOCONFIGURE=1 environment variable http://people.gnome.org/~walters/docs/build-api.txt autogen.sh | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) commit 6a8daa9569a4a6c2610758b122f46f181ce52448 Author: Derek Foreman Date: 2011-04-20 12:14:23 -0400 Support building on Android Reviewed-by: Simon McVittie Bug: https://bugs.freedesktop.org/show_bug.cgi?id=42532 .gitignore | 1 + Android.mk | 35 +++++++++++++++++++++++++++++++++++ dbus/Makefile.am | 9 +++++++++ 3 files changed, 45 insertions(+) commit dfdb0de78563a01c3d722e1de83d85e90163feaa Author: Simon McVittie Date: 2011-09-30 16:12:29 +0100 Micro version configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit f669a4aa6c7caaf6cbf9395ed14a1a357c4f6004 Author: Simon McVittie Date: 2011-09-30 12:06:50 +0100 Prepare 0.98 configure.ac | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 1803b6cf35876247bb3e577bec9be8eed8b1b825 Author: Simon McVittie Date: 2011-08-17 19:28:04 +0100 invoke_object_method: simplify how we return Based on review feedback from Cosimo. Signed-off-by: Simon McVittie Reviewed-by: Cosimo Alfarano Bug: https://bugs.freedesktop.org/show_bug.cgi?id=35767 dbus/dbus-gobject.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) commit 83bdd09f6124289dd19556da9334906f28064838 Author: Simon McVittie Date: 2011-08-17 19:26:46 +0100 dbus-gobject: centralize death-by-OOM and use oom() instead of goto You can't recover from OOM (in GLib-land) so there's no point in complicating the code for the reader. Signed-off-by: Simon McVittie Reviewed-by: Cosimo Alfarano Bug: https://bugs.freedesktop.org/show_bug.cgi?id=35767 dbus/dbus-gobject.c | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) commit 705761ad983392c311c3e66c3ddf7e44e0efbc6f Author: Simon McVittie Date: 2011-09-27 18:42:33 +0100 Fix various minor documentation bugs Signed-off-by: Simon McVittie Reviewed-by: Cosimo Alfarano Bug: https://bugs.freedesktop.org/show_bug.cgi?id=37793 Bug-NB: related to NB#218973 dbus/dbus-glib.c | 2 +- dbus/dbus-glib.h | 2 +- dbus/dbus-gmain.c | 10 +++++----- dbus/dbus-gobject.c | 33 +++++++++++++++++++-------------- dbus/dbus-gproxy.c | 33 ++++++++++++++++++++++++++++----- dbus/dbus-gvalue.c | 2 +- doc/reference/dbus-glib-sections.txt | 6 +++++- 7 files changed, 60 insertions(+), 28 deletions(-) commit 0d058307cb914fa61e809b9e0500ac139e286ec6 Author: Simon McVittie Date: 2011-09-27 17:47:03 +0100 specialized types: improve documentation and document more things Signed-off-by: Simon McVittie Reviewed-by: Cosimo Alfarano Bug: https://bugs.freedesktop.org/show_bug.cgi?id=37793 Bug-NB: related to NB#218973 dbus/dbus-gtype-specialized.c | 436 +++++++++++++++++++++++++++++----- dbus/dbus-gtype-specialized.h | 6 +- doc/reference/dbus-glib-sections.txt | 1 + 3 files changed, 388 insertions(+), 55 deletions(-) commit b3af6fdb643f9293d156c95860270a997b9f6843 Author: Simon McVittie Date: 2011-09-27 17:50:07 +0100 dbus_g_type_collection_value_iterate, etc.: check that the type is suitable Otherwise we'd probably crash when we cast the vtable to an inappropriate type, and call its methods with inappropriate arguments as a result. Signed-off-by: Simon McVittie Reviewed-by: Cosimo Alfarano Bug: https://bugs.freedesktop.org/show_bug.cgi?id=37793 Bug-NB: related to NB#218973 dbus/dbus-gtype-specialized.c | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) commit 3183d79b119d0296924602f19d9fc2a58a7bd597 Author: Simon McVittie Date: 2011-09-27 17:47:46 +0100 dbus_g_type_collection_get_fixed: check preconditions on the type and vtable Previously, if it wasn't a collection or didn't have the fixed_accessor, we'd just segfault. Not ideal. Signed-off-by: Simon McVittie Reviewed-by: Cosimo Alfarano Bug: https://bugs.freedesktop.org/show_bug.cgi?id=37793 Bug-NB: related to NB#218973 dbus/dbus-gtype-specialized.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) commit 7fcaf6c8c6d0e6ade0e8d5460b5311b564a24d3f Author: Simon McVittie Date: 2011-09-27 17:41:36 +0100 dbus-gtype-specialized: warn if vtables have missing callbacks It's just about conceivable that they wouldn't segfault, if application authors carefully avoided the unimplemented functionality... but still. Signed-off-by: Simon McVittie Reviewed-by: Cosimo Alfarano Bug: https://bugs.freedesktop.org/show_bug.cgi?id=37793 Bug-NB: related to NB#218973 dbus/dbus-gtype-specialized.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) commit 58ed26382bf23fe9fb592d38b5be2c2c7b2e77e2 Author: Simon McVittie Date: 2011-05-31 16:17:10 +0100 Tidy up docs for DBusGError and its pseudo-methods * attach the introductory doc-comments to the enum and macro names, not the internal function * remove docs for method parameters which didn't actually exist * more cross-references * make the domain macro visible in the documentation index Signed-off-by: Simon McVittie Reviewed-by: Cosimo Alfarano Bug: https://bugs.freedesktop.org/show_bug.cgi?id=37793 Bug-NB: related to NB#218973 dbus/dbus-glib.c | 33 ++++++++++++++++++--------------- doc/reference/dbus-glib-sections.txt | 1 - 2 files changed, 18 insertions(+), 16 deletions(-) commit 4b6482d5987095b474c9582e7415bf94a154d9b4 Author: Simon McVittie Date: 2011-09-27 16:25:21 +0100 Make gtk-doc DOC_SOURCE_DIR absolute, fixing out-of-tree docs I used an absolute path to avoid differing behaviour with older versions of gtk-doc, where DOC_SOURCE_DIR was relative to the *source* directory. Also resync doc/reference/Makefile.am with gtk-doc's example. Signed-off-by: Simon McVittie Reviewed-by: Will Thompson doc/reference/Makefile.am | 51 +++++++++++++++++++++++++++++++++------------ 1 file changed, 38 insertions(+), 13 deletions(-) commit 83471e869e464c63063e9e254bc8c40b25de03b7 Author: Simon McVittie Date: 2011-05-31 16:04:29 +0100 DBusGProxy: be more pedantic about boolean returns Returning false doesn't strictly imply that the error is set; if you're being pedantic enough, it's really a tri-state where TRUE indicates success, FALSE indicates failure, and calling the function incorrectly results in undefined behaviour (currently a critical warning and returning FALSE). Signed-off-by: Simon McVittie Reviewed-by: Cosimo Alfarano Bug: https://bugs.freedesktop.org/show_bug.cgi?id=37793 Bug-NB: NB#218973 dbus/dbus-gproxy.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) commit c6aa1d7dbdf04501495e4a3b4cfe6e7d808af6dd Author: Simon McVittie Date: 2011-05-31 15:57:44 +0100 DBusGProxy: misc documentation tidying Signed-off-by: Simon McVittie Reviewed-by: Cosimo Alfarano Bug: https://bugs.freedesktop.org/show_bug.cgi?id=37793 Bug-NB: related to NB#218973 dbus/dbus-gproxy.c | 37 +++++++++++++++++++++++++--------- doc/reference/dbus-glib-sections.txt | 4 ++++ 2 files changed, 32 insertions(+), 9 deletions(-) commit c568ace5ee6a9c13f748d876d69ad50234b2bc78 Author: Simon McVittie Date: 2011-05-31 15:57:15 +0100 DBusGProxy: make argument names in declaration, definition and docs consistent Signed-off-by: Simon McVittie Reviewed-by: Cosimo Alfarano Bug: https://bugs.freedesktop.org/show_bug.cgi?id=37793 Bug-NB: related to NB#218973 dbus/dbus-glib.h | 8 +++---- dbus/dbus-gproxy.c | 59 +++++++++++++++++++++++++--------------------------- 2 files changed, 32 insertions(+), 35 deletions(-) commit dc766e475f3a42872edbd9c3bcc98714dde8bff7 Author: Simon McVittie Date: 2011-05-31 15:55:47 +0100 DBusGProxy: mark struct contents as private Signed-off-by: Simon McVittie Reviewed-by: Cosimo Alfarano Bug: https://bugs.freedesktop.org/show_bug.cgi?id=37793 Bug-NB: related to NB#218973 dbus/dbus-glib.h | 2 ++ 1 file changed, 2 insertions(+) commit 9d1cce7c64662733f0b48e52e4d5a1e805a3e246 Author: Simon McVittie Date: 2011-05-31 15:40:40 +0100 Remove declaration of dbus_pending_call_get_g_type, which doesn't exist Signed-off-by: Simon McVittie Reviewed-by: Cosimo Alfarano Bug: https://bugs.freedesktop.org/show_bug.cgi?id=37793 Bug-NB: related to NB#218973 dbus/dbus-glib-lowlevel.h | 8 -------- doc/reference/dbus-glib-sections.txt | 2 -- 2 files changed, 10 deletions(-) commit 35e049459945a22b87cc61c05bd903790f05cf40 Author: Simon McVittie Date: 2011-05-31 16:17:34 +0100 Add DBUS_TYPE_CONNECTION, DBUS_TYPE_MESSAGE to the docs, and document them better Signed-off-by: Simon McVittie Reviewed-by: Cosimo Alfarano Bug: https://bugs.freedesktop.org/show_bug.cgi?id=37793 Bug-NB: related to NB#218973 dbus/dbus-glib.c | 15 +++++++++++---- doc/reference/dbus-glib-sections.txt | 2 +- 2 files changed, 12 insertions(+), 5 deletions(-) commit 43a4bf8b038c08d6b8c565495cbf69433bc2dcc6 Author: Simon McVittie Date: 2011-05-31 16:15:43 +0100 Tidy up docs for DBusGMessage * document the instance struct * make argument names match the headers * document the GType macro, not the function it calls, and mention it in the documentation (since this is a boxed type, so it's non-obvious) Signed-off-by: Simon McVittie Reviewed-by: Cosimo Alfarano Bug: https://bugs.freedesktop.org/show_bug.cgi?id=37793 Bug-NB: related to NB#218973 dbus/dbus-glib.c | 28 ++++++++++++++++++---------- doc/reference/dbus-glib-sections.txt | 2 +- 2 files changed, 19 insertions(+), 11 deletions(-) commit 53ac9ee390e173f8e63f276d8c7e211e4fadca4b Author: Simon McVittie Date: 2011-03-29 16:34:38 +0100 Clean up docs for DBusGConnection * introductory doc-comment for the (pseudo-)class * attach the doc-comment for the GType to the macro, not the internal function * rename function parameters to match what the header file says Signed-off-by: Simon McVittie Reviewed-by: Cosimo Alfarano Bug: https://bugs.freedesktop.org/show_bug.cgi?id=37793 Bug-NB: related to NB#218973 dbus/dbus-glib.c | 26 +++++++++++++++++--------- doc/reference/dbus-glib-sections.txt | 2 +- 2 files changed, 18 insertions(+), 10 deletions(-) commit be937e037a6c076cf650bb79aba9c1138da39511 Author: Simon McVittie Date: 2011-03-29 16:42:19 +0100 Ignore non-API source files correctly gtk-doc only cares about the basename of the files. Signed-off-by: Simon McVittie Reviewed-by: Cosimo Alfarano Bug: https://bugs.freedesktop.org/show_bug.cgi?id=37793 Bug-NB: related to NB#218973 doc/reference/Makefile.am | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) commit 053d41e56050706b512562f13b9ebde7dac3c60b Author: Simon McVittie Date: 2011-03-29 16:42:44 +0100 Remove stray empty subsection Signed-off-by: Simon McVittie Reviewed-by: Cosimo Alfarano Bug: https://bugs.freedesktop.org/show_bug.cgi?id=37793 Bug-NB: related to NB#218973 doc/reference/dbus-glib-sections.txt | 3 --- 1 file changed, 3 deletions(-) commit 3d02f22d475286db8160604755ee85d24b133005 Author: Simon McVittie Date: 2011-05-31 16:13:24 +0100 Mention which header to include in the gtk-doc Signed-off-by: Simon McVittie Reviewed-by: Cosimo Alfarano Bug: https://bugs.freedesktop.org/show_bug.cgi?id=37793 Bug-NB: related to NB#218973 doc/reference/dbus-glib-sections.txt | 8 ++++++++ 1 file changed, 8 insertions(+) commit 30b6a106ed590c0fd97a783998a19779002e65d8 Author: Simon McVittie Date: 2011-05-31 16:13:07 +0100 Add some missing symbols to the docs Signed-off-by: Simon McVittie Reviewed-by: Cosimo Alfarano Bug: https://bugs.freedesktop.org/show_bug.cgi?id=37793 Bug-NB: related to NB#218973 doc/reference/dbus-glib-sections.txt | 6 ++++++ 1 file changed, 6 insertions(+) commit a4bc263721fc5a80a78c6b551f35d281c22694ff Author: Simon McVittie Date: 2011-09-21 18:14:46 +0100 Micro version configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 80e37faeac62a4694514410ec17c2ab4a75d50e6 Author: Simon McVittie Date: 2011-09-21 17:36:11 +0100 dbus-glib 0.96 configure.ac | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 4bc172fd5f31123ee883c4027e729b38c2777d7d Author: Simon McVittie Date: 2011-04-05 17:43:15 +0100 test-dbus-glib: make lose() abort, and make lose_gerror() more informative Bug: https://bugs.freedesktop.org/show_bug.cgi?id=35766 Reviewed-by: Cosimo Alfarano test/core/test-dbus-glib.c | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) commit 9e97f9744e7ffeb04a105087da6143931195ce77 Author: Simon McVittie Date: 2011-04-05 16:25:15 +0100 get_all_object_properties: if _dbus_gvalue_marshal fails, bail out This isn't necessarily OOM: _dbus_gvalue_marshal can fail due to programming errors. If so, raise a critical warning, then (if that wasn't fatal) return a D-Bus error to be sent to the caller. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=35766 Reviewed-by: Cosimo Alfarano dbus/dbus-gobject.c | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) commit bfd1c05174b86c9dfcf1b22a4fa0b2c552dfc902 Author: Simon McVittie Date: 2011-04-05 18:02:47 +0100 get_all_object_properties: note which operations can only fail via OOM Bug: https://bugs.freedesktop.org/show_bug.cgi?id=35766 Reviewed-by: Cosimo Alfarano dbus/dbus-gobject.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) commit 30198a2368c9cd19db4b8f595bfad7a719ada7e9 Author: Simon McVittie Date: 2011-04-05 16:21:12 +0100 get_all_object_properties: skip invalidly-named properties, with a critical Bug: https://bugs.freedesktop.org/show_bug.cgi?id=35766 Reviewed-by: Cosimo Alfarano dbus/dbus-gobject.c | 9 +++++++++ 1 file changed, 9 insertions(+) commit a2a3315ac9747dcc7dda860ceb1d1f94ab56d29b Author: Simon McVittie Date: 2011-08-17 19:15:05 +0100 dbus-gobject: add and use connection_send_or_die to check for OOM Bug: https://bugs.freedesktop.org/show_bug.cgi?id=35766 Reviewed-by: Cosimo Alfarano Conflicts: dbus/dbus-gobject.c dbus/dbus-gobject.c | 40 +++++++++++++++++++++++++--------------- 1 file changed, 25 insertions(+), 15 deletions(-) commit 22262581b0956f69f321b9e2eb702e3f15b49823 Author: Simon McVittie Date: 2011-04-05 15:50:38 +0100 emit_signal_for_registration: assert that signal headers are all valid This is an assertion, not a return_if_fail, because we already checked the object path in dbus_g_connection_register_g_object and the others in export_signals. After these checks, dbus_message_new_signal can really only fail on OOM. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=35766 Reviewed-by: Cosimo Alfarano dbus/dbus-gobject.c | 4 ++++ 1 file changed, 4 insertions(+) commit cccf1e6672fba6b649fe02082c2f087cdf022dcd Author: Simon McVittie Date: 2011-04-05 15:49:18 +0100 export_signals: check interface, signal names for validity Bug: https://bugs.freedesktop.org/show_bug.cgi?id=35766 Reviewed-by: Cosimo Alfarano dbus/dbus-gobject.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) commit d09dfcb130be0a17f337bd198a9fb43aab7dfa28 Author: Simon McVittie Date: 2011-04-05 15:43:30 +0100 object_registration_message: check for OOM when a property is absent Bug: https://bugs.freedesktop.org/show_bug.cgi?id=35766 Reviewed-by: Cosimo Alfarano dbus/dbus-gobject.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) commit 7b92ac1bfd1e50e842549dbb14b845478d114652 Author: Simon McVittie Date: 2011-04-05 15:42:49 +0100 object_registration_message: make logic/assertions slightly clearer Bug: https://bugs.freedesktop.org/show_bug.cgi?id=35766 Reviewed-by: Cosimo Alfarano dbus/dbus-gobject.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) commit b5b27e4ca0d8ca250fa7649bcf2613e8d889a722 Author: Simon McVittie Date: 2011-04-05 15:42:29 +0100 object_registration_message: handle remote caller errors better If the remote process sends us a wrong message, that's its fault, not ours; we should send back a comprehensible D-Bus error, and not spam to stderr. Previously, in each of these cases libdbus would have sent back NoReply, because we declined to handle the method call. One case that's still wrong is passing extra arguments to Get, GetAll or Set, like so: Get("com.example.Iface", "MyProperty", "extra") Set("com.example.Iface", "MyProperty", Variant("foo"), "extra") GetAll("com.example.Iface", "extra") dbus-glib has historically warned, ignored the extra argument(s) and sent back a reply as if they hadn't been there, whereas a stricter implementation (like telepathy-glib's TpDBusPropertiesMixin) would have sent back an error reply and done nothing. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=35766 Reviewed-by: Cosimo Alfarano dbus/dbus-gobject.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) commit e5cf2be0e03af4df19618076015cc2a6556ca5d4 Author: Simon McVittie Date: 2011-04-05 15:36:09 +0100 get_object_property: add brief documentation Bug: https://bugs.freedesktop.org/show_bug.cgi?id=35766 Reviewed-by: Cosimo Alfarano dbus/dbus-gobject.c | 5 +++++ 1 file changed, 5 insertions(+) commit d3aa6c7942cce0cf7b602c6b0854488938f0548e Author: Simon McVittie Date: 2011-04-05 15:25:55 +0100 get_object_property: unwind on errors, and avoid returning NULL Also treat all errors here as programming errors (because this method should never fail), upgrading them from warning to critical; return a D-Bus error reply anyway, to be nicer to our callers. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=35766 Reviewed-by: Cosimo Alfarano dbus/dbus-gobject.c | 33 +++++++++++++++++++++++---------- 1 file changed, 23 insertions(+), 10 deletions(-) commit 98b3b3f323fd4001be0630c3e0a1dc4fb83cdeab Author: Simon McVittie Date: 2011-04-05 15:21:56 +0100 check_property_access: centralize error handling (and check for OOM) Bug: https://bugs.freedesktop.org/show_bug.cgi?id=35766 Reviewed-by: Cosimo Alfarano dbus/dbus-gobject.c | 69 ++++++++++++++++++++++++++++++++------------------- 1 file changed, 43 insertions(+), 26 deletions(-) commit 6293849bf0469ce8d6d122b38db5091c21304a30 Author: Simon McVittie Date: 2011-08-17 19:11:14 +0100 dbus-gobject: check for NULL when producing messages Bug: https://bugs.freedesktop.org/show_bug.cgi?id=35766 Reviewed-by: Cosimo Alfarano Conflicts: dbus/dbus-gobject.c dbus/dbus-gobject.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) commit 8ec3166b6a40508a91144efedc10dcb32964498e Author: Simon McVittie Date: 2011-04-05 14:56:16 +0100 dbus-gobject: factor out reply_or_die, error_or_die and add error-checking Bug: https://bugs.freedesktop.org/show_bug.cgi?id=35766 Reviewed-by: Cosimo Alfarano dbus/dbus-gobject.c | 83 +++++++++++++++++++++++++++++++-------------------- 1 file changed, 50 insertions(+), 33 deletions(-) commit 7a1abf5243fe5b7adf7211fd7d8c82851f448192 Author: Simon McVittie Date: 2011-04-04 16:52:58 +0100 invoke_object_method: if marshalling an out argument fails, discard message We shouldn't report this as OOM, because it probably wasn't (it's much more likely to be programming error); we should also continue through the arguments, so that we don't leak them. By abandoning the message as soon as we detect a programming error, we can use reply == NULL as an indicator of whether to keep appending. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=35767 Reviewed-by: Cosimo Alfarano dbus/dbus-gobject.c | 47 ++++++++++++++++++++++++++++++++++++----------- 1 file changed, 36 insertions(+), 11 deletions(-) commit 4ba637e2ae32b2daf224265c22cc8b43cf0a0bbf Author: Simon McVittie Date: 2011-04-04 15:45:07 +0100 invoke_object_method, dbus_g_method_return_error: handle sending failure I just made it fatal, since it's either programming error or OOM. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=35767 Reviewed-by: Cosimo Alfarano dbus/dbus-gobject.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) commit cd7e9a1c6dd0eef6e867cac80339a38758d0cd6f Author: Simon McVittie Date: 2011-04-04 15:44:28 +0100 gerror_to_dbus_error_message: guarantee to return non-NULL Bug: https://bugs.freedesktop.org/show_bug.cgi?id=35767 Reviewed-by: Cosimo Alfarano dbus/dbus-gobject.c | 6 ++++++ 1 file changed, 6 insertions(+) commit c239a810543bde85dd458012612874cdc81a4151 Author: Simon McVittie Date: 2011-04-04 15:41:32 +0100 invoke_object_method: if dbus_message_new_method_return fails, fail hard There's no point in doing graceful unwinding here, since it really shouldn't happen. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=35767 Reviewed-by: Cosimo Alfarano dbus/dbus-gobject.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) commit 480c480b024a77dd8f4efecdb6639d45de9767ce Author: Simon McVittie Date: 2011-04-04 15:40:40 +0100 arg_iterate: document Bug: https://bugs.freedesktop.org/show_bug.cgi?id=35767 Reviewed-by: Cosimo Alfarano dbus/dbus-gobject.c | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) commit 36b55c3aac5de873a69c9bd0fbe003200a03ba32 Author: Simon McVittie Date: 2011-06-16 15:33:01 +0100 dbus_g_proxy_manager_unregister: if GetNameOwner failed, don't assert got_name_owner_cb never adds the proxy to the unassociated_proxies list if there is a D-Bus error other than NameHasNoOwner. Based on a patch from Janne Karhunen, for Maemo. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=38408 Bug-NB: NB#116862 Reviewed-by: Cosimo Alfarano dbus/dbus-gproxy.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) commit 18705c42ca6b6a583b64451055eec4dad3aaa3b4 Author: Simon McVittie Date: 2011-06-17 14:40:28 +0100 Add a regression test for fd.o #38406 Bug: https://bugs.freedesktop.org/show_bug.cgi?id=38406 Reviewed-by: Cosimo Alfarano .gitignore | 1 + test/core/Makefile.am | 7 ++ test/core/proxy-peer.c | 274 ++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 282 insertions(+) commit 5d800ca9352b40354a0f4a905c1c0b111b81f030 Author: Simon McVittie Date: 2011-06-17 14:53:09 +0100 MyObject: register marshallers so individual tests don't have to These marshallers are actually dual-use: they're used to call certain methods on MyObject, and also to bind to its signals. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=38406 Reviewed-by: Cosimo Alfarano test/core/Makefile.am | 4 +++- test/core/my-object.c | 12 ++++++++++++ test/core/my-object.h | 1 + test/core/test-dbus-glib.c | 11 ++++------- 4 files changed, 20 insertions(+), 8 deletions(-) commit 70e09208ab13812037b3cf133df312aacd24d036 Author: Simon McVittie Date: 2011-06-17 12:18:57 +0100 DBusGProxy: deal with errors in DBUS_G_VALUE_ARRAY_COLLECT_ALL G_VALUE_COLLECT can fail (admittedly, it's a programming error if it does). Previously, we leaked the resulting g_malloc'd string; now we emit a critical warning, free it, and abort the call. Based on patches from Kimmo Hämäläinen and Christian Dywan in Maemo's dbus-glib. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=38406 Bug-NB: NB#86280 Bug-NB: NB#180486 (CID-34419 to CID-34424 inclusive) Reviewed-by: Cosimo Alfarano dbus/dbus-gproxy.c | 93 +++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 66 insertions(+), 27 deletions(-) commit 2731a2f7f824f9c1cd11dd14e88ff1e0875f280b Author: Simon McVittie Date: 2011-06-17 12:15:20 +0100 dbus_g_proxy_call: simplify error handling now that call_id may be 0 There's no need to special-case it any more - we can just use dbus_g_proxy_end_call_internal and rely on it to cope. This reverts the fix for fd.o #12675, since the commit before this one is more general. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=38406 Reviewed-by: Cosimo Alfarano dbus/dbus-gproxy.c | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) commit 1b38cecf7bbdb8a99ef13616b8c661dfb0bc060f Author: Simon McVittie Date: 2011-06-17 12:06:11 +0100 DBusGProxy: cope gracefully with call_id == 0 As well as happening on a programming error or OOM (which both provoke critical warnings), dbus_g_proxy_begin_call_internal() can legitimately fail if we got disconnected from D-Bus (so can't send any more), but are still working through our backlog of incoming messages (so we haven't got round to the Disconnected message yet, so the DBusGProxy hasn't emitted ::destroy). fd.o #12675 fixed dbus_g_proxy_call(), but dbus_g_proxy_call_with_timeout() and the asynchronous API still need similar treatment. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=38406 Reviewed-by: Cosimo Alfarano dbus/dbus-gproxy.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) commit af31c9c21efeec8a38c73de24d82a2038d80f74e Author: Simon McVittie Date: 2011-08-03 18:38:49 +0100 registrations test: fix race condition in adding match rules If you don't block waiting for the reply to AddMatch, and you're using two connections to the bus, then messages sent from connection 2 might not be matched by connection 1, because they arrive before the AddMatch call from connection 1. This manifests itself as the /registrations/twice test *sometimes* failing (dependent on timing). Only tests with two parallel bus connections need this, but to be safe, I've added it throughout this test. Reviewed-by: Vivek Dasmohapatra test/core/registrations.c | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) commit 6d06dd358b22057dca1808c1432e620998202c41 Author: Tim Waugh Date: 2011-07-22 15:13:42 +0100 dbus-binding-tool: fixed "pretty" mode output for methods. Reviewed-by: Simon McVittie Bug: https://bugs.freedesktop.org/show_bug.cgi?id=39475 dbus/dbus-glib-tool.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit e294ba3e579db1c12158ce95ad6ff34391cf571a Author: Simon McVittie Date: 2011-06-16 18:12:27 +0100 Show warning if marshalling in dbus_g_method_return fails Based on a patch from Christian Dywan . Bug: https://bugs.freedesktop.org/show_bug.cgi?id=29884 Bug-NB: NB#180486 Reviewed-by: Cosimo Alfarano dbus/dbus-gobject.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) commit cce0887278ae105f010d35636fc5f6d654c2d41f Author: Christian Dywan Date: 2010-12-14 15:07:27 +0100 remove minor dead code in dbus-gparser There's no way retval can be false at this location. Bug-NB: NB#180486 CID-643 Reviewed-by: Simon McVittie dbus/dbus-gparser.c | 3 --- 1 file changed, 3 deletions(-) commit f446cb80f91b4cf584883b47477295d07dd32eac Author: Derek Foreman Date: 2011-06-02 17:16:42 +0100 remove remaining inclusions of from library Bug: https://bugs.freedesktop.org/show_bug.cgi?id=36428 Reviewed-by: Simon McVittie dbus/dbus-binding-tool-glib.c | 1 - dbus/dbus-gproxy.c | 1 - 2 files changed, 2 deletions(-) commit 2a85bd434e6d8dba9615a53d288a0a72d6b5e0cf Author: Simon McVittie Date: 2011-06-02 13:50:20 +0100 Regression test for fd.o #37852 Bug: https://bugs.freedesktop.org/show_bug.cgi?id=37852 Reviewed-by: Colin Walters test/core/my-object.c | 17 ++++++++++ test/core/my-object.h | 2 ++ test/core/registrations.c | 68 +++++++++++++++++++++++++++++++++++++++ test/core/test-service-glib.xml | 4 +++ 4 files changed, 91 insertions(+) commit 3e0828f57c3925ea9b63d22ab82d991a0fea0536 Author: Simon McVittie Date: 2011-06-02 13:49:51 +0100 Fix regression in marshalling objects as object paths This regressed while fixing fd.o #36811. NetworkManager apparently uses this idiom. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=37852 Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=628890 Tested-by: Michael Biebl Reviewed-by: Colin Walters dbus/dbus-gobject.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) commit f534276eb20d8035566a206d1e38fd651a1eeab9 Author: Simon McVittie Date: 2011-05-31 17:03:59 +0100 registrations test: only listen for signals, not all messages Otherwise, we'd reply with an error to messages not intended for us. Reviewed-by: Colin Walters test/core/registrations.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 867d670daad983f8b4416528e69d3ad2e0596e88 Author: Simon McVittie Date: 2011-06-01 19:44:42 +0100 0.95 configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 469df67525a9e5363644ac730ac8ec7580a8ebe0 Author: Simon McVittie Date: 2011-06-01 19:07:30 +0100 Prepare 0.94 release configure.ac | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) commit 5a780af947f0141f4e0524aaf62fdd06abe6cd5f Author: Simon McVittie Date: 2011-04-04 13:46:11 +0100 dbus-binding-tool: forbid ReturnVal annotation after the first OUT It has never actually worked correctly (invoke_object_method would always treat the ReturnVal as if it had been the first OUT argument), so let's only allow the situation that worked in practice. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=35952 Reviewed-by: Will Thompson dbus/dbus-binding-tool-glib.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) commit a8605cf4c6c9dbc4a933dd744d339744e0102765 Author: Simon McVittie Date: 2011-06-01 17:33:48 +0100 Fix compiler warnings in dbus-binding-tool Reviewed-by: Will Thompson dbus/dbus-glib-tool.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit 0c162cc63b073a9f50dd11ea99db72fe95a16064 Author: Simon McVittie Date: 2011-06-01 17:33:07 +0100 Remove all support for Doxygen Reviewed-by: Will Thompson Bug: https://bugs.freedesktop.org/show_bug.cgi?id=10890 Doxyfile.in | 180 -------------------------------------------------------- Makefile.am | 2 - README | 1 - configure.ac | 34 +---------- doc/api/README | 3 - 5 files changed, 1 insertion(+), 219 deletions(-) commit 6e20efb5c4c094915d2b6e86c3cab486a0562a95 Author: Simon McVittie Date: 2011-06-01 17:32:58 +0100 Use single star in doc-comments not intended for gtk-doc Reviewed-by: Will Thompson Bug: https://bugs.freedesktop.org/show_bug.cgi?id=10890 dbus/dbus-glib.h | 4 ++-- dbus/dbus-gloader-expat.c | 2 +- dbus/dbus-gproxy.c | 2 +- dbus/dbus-gtest.c | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) commit 1472d195bd201d219aab5bc4b31d80d8340cee5c Author: Simon McVittie Date: 2011-06-01 17:32:06 +0100 Remove Doxygen droppings from source code Reviewed-by: Will Thompson Bug: https://bugs.freedesktop.org/show_bug.cgi?id=10890 dbus/dbus-gidl.c | 4 ---- dbus/dbus-gidl.h | 4 ---- dbus/dbus-glib.c | 3 +-- dbus/dbus-gmain.c | 22 +++------------------- dbus/dbus-gobject.c | 3 +-- dbus/dbus-gparser.c | 4 ---- dbus/dbus-gproxy.c | 26 ++------------------------ dbus/dbus-gthread.c | 6 ------ dbus/dbus-gutils.c | 4 ---- dbus/dbus-gutils.h | 4 ---- dbus/dbus-gvalue.c | 5 +---- 11 files changed, 8 insertions(+), 77 deletions(-) commit 4c3a346d296789cf3a81f6cc98f64d84ea892247 Author: Simon McVittie Date: 2011-06-01 17:24:36 +0100 Remove _dbus_g_proxy_test, which isn't called and doesn't do anything Reviewed-by: Will Thompson Bug: https://bugs.freedesktop.org/show_bug.cgi?id=37790 dbus/dbus-gproxy.c | 17 ----------------- 1 file changed, 17 deletions(-) commit cded5996b02ff937a73654788d1f3a7ca46ca0a9 Author: Simon McVittie Date: 2011-06-01 17:24:29 +0100 Remove _dbus_gutils_test, which didn't test anything Reviewed-by: Will Thompson Bug: https://bugs.freedesktop.org/show_bug.cgi?id=37790 dbus/dbus-gtest.c | 6 +----- dbus/dbus-gutils.c | 17 ----------------- 2 files changed, 1 insertion(+), 22 deletions(-) commit d81722def291666a3c557a18d66be061f8f55e31 Author: Simon McVittie Date: 2011-06-01 17:24:22 +0100 _dbus_gidl_test: remove unused function which does nothing Reviewed-by: Will Thompson Bug: https://bugs.freedesktop.org/show_bug.cgi?id=37790 dbus/dbus-gidl.c | 17 ----------------- 1 file changed, 17 deletions(-) commit 1f371d3c75a5c2e9979350380e4243e3c445e093 Author: Simon McVittie Date: 2011-06-01 17:23:45 +0100 dbus-glib-tool: remove regression-test boilerplate which does nothing Bug: https://bugs.freedesktop.org/show_bug.cgi?id=37790 Reviewed-by: Will Thompson dbus/dbus-glib-tool.c | 48 ------------------------------------------------ 1 file changed, 48 deletions(-) commit 8abfa07b8acd2d8527785db3711d8a88a213a60e Author: Simon McVittie Date: 2011-06-01 17:18:52 +0100 dbus-binding-tool: clean up temporary file on error This fixes distcheck, which otherwise fails because temporary files are left over after distclean. We could delete them with the build system, but leaving them behind is a bug, so... Bug: https://bugs.freedesktop.org/show_bug.cgi?id=37812 Reviewed-by: Will Thompson dbus/dbus-glib-tool.c | 78 ++++++++++++++++++++++++++++++++++++------------- 1 file changed, 58 insertions(+), 20 deletions(-) commit d5b9aa101d61bcd2321f0266fa638b644e4cba96 Author: Simon McVittie Date: 2011-05-31 14:35:01 +0100 Remove useless HAVE_GLIB conditional - GLib is mandatory Reviewed-by: Will Thompson Bug: https://bugs.freedesktop.org/show_bug.cgi?id=37789 configure.ac | 1 - 1 file changed, 1 deletion(-) commit 601b51279e7fbb08ff6ce8c98eaf4bcee21d46a5 Author: Simon McVittie Date: 2011-03-28 14:40:12 +0100 Remove unused DBUS_DAEMONDIR Reviewed-by: Will Thompson Bug: https://bugs.freedesktop.org/show_bug.cgi?id=37789 configure.ac | 10 ---------- 1 file changed, 10 deletions(-) commit 1a966d070e71378590fb0b64c5ec7a2e250d397b Author: Simon McVittie Date: 2011-03-28 14:39:57 +0100 Remove vestigial dbus-glib-error-*.h and the machinery to generate them This was the only use of DBUS_INCLUDEDIR, so remove that too. Reviewed-by: Will Thompson Bug: https://bugs.freedesktop.org/show_bug.cgi?id=37789 .gitignore | 4 ---- configure.ac | 2 -- dbus/Makefile.am | 16 ++-------------- dbus/make-dbus-glib-error-enum.sh | 2 -- dbus/make-dbus-glib-error-switch.sh | 2 -- 5 files changed, 2 insertions(+), 24 deletions(-) commit 98d7cb8c869b53686a742fb48d1f189c74ff1484 Author: Simon McVittie Date: 2011-05-31 14:33:18 +0100 Simplify the check for dbus-1 As in commit 0f782b4, omitting the action-if-found and action-if-not-found results in much better error messages if this mandatory dependency isn't found. Nothing checks HAVE_DBUS (as they shouldn't - it's mandatory!), so there's no point in keeping that either. Reviewed-by: Will Thompson Bug: https://bugs.freedesktop.org/show_bug.cgi?id=37789 configure.ac | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) commit b00d53dd647cf456ddb67c1dfdf44a8d56be90b4 Author: Simon McVittie Date: 2011-01-04 18:35:41 +0000 Add more auto-generated gtkdoc droppings to .gitignore Reviewed-by: Will Thompson Bug: https://bugs.freedesktop.org/show_bug.cgi?id=37789 .gitignore | 2 ++ 1 file changed, 2 insertions(+) commit bd92f266609fef162b6028fd249250b0ab9ae689 Author: Simon McVittie Date: 2011-05-31 14:46:33 +0100 Remove support for i18n completely As far as I can tell, dbus-glib has never actually been translated into another language, or even had the necessary infrastructure so people could do that. The translated strings are all low-level errors in "programmer English" anyway, and most of them only make sense to D-Bus experts. Reviewed-by: Will Thompson Bug: https://bugs.freedesktop.org/show_bug.cgi?id=36428 configure.ac | 25 +----------------- dbus/dbus-binding-tool-glib.c | 8 +++--- dbus/dbus-glib-tool.c | 35 ++++++++++---------------- dbus/dbus-gparser.c | 56 +++++++++++++++++++---------------------- dbus/dbus-gproxy.c | 8 +++--- dbus/dbus-gvalue.c | 41 +++++++++++++++--------------- 6 files changed, 68 insertions(+), 105 deletions(-) commit c37bd4357d50d1cd683ef04f05ee427c9a0f7e9f Author: Simon McVittie Date: 2011-03-28 14:43:15 +0100 Remove i18n macros from files where they're unused dbus-glib-tool (dbus-binding-tool) and dbus-gparser are theoretically localizable, but the library doesn't make any use of gettext. Reviewed-by: Will Thompson Bug: https://bugs.freedesktop.org/show_bug.cgi?id=36428 dbus/dbus-glib.c | 5 ----- dbus/dbus-gmain.c | 4 ---- 2 files changed, 9 deletions(-) commit e8a4f0496d0eec10fc9c76e0ef20e761bb2256c6 Author: Dan Williams Date: 2011-05-31 11:25:59 -0500 Log error message from failed object registration See https://bugzilla.redhat.com/show_bug.cgi?id=708686 for a case of this; it would be extremely helpful to figure out what the error actually was since it appears not to be a double-registration or other such issues after inspection of nm-applet and libnm-glib. Reviewed-by: Colin Walters Reviewed-by: Simon McVittie Bug: https://bugs.freedesktop.org/show_bug.cgi?id=37795 dbus/dbus-gobject.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) commit eeb1c50aa03a95c39487e9331107142f27412958 Author: Simon McVittie Date: 2011-04-20 16:41:28 +0100 Remind maintainers to update the libtool versioning Bug: https://bugs.freedesktop.org/show_bug.cgi?id=22854 Reviewed-by: Guillaume Desmottes HACKING | 1 + 1 file changed, 1 insertion(+) commit 9e2031148fd0ee114ec67c681d2b9bcfd84cdaa4 Author: Simon McVittie Date: 2011-04-20 16:41:00 +0100 add a Makefile rule to upload a tarball and up-to-date docs Simplified from telepathy-glib, which has more elaborate machinery to automate releases. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=26952 Reviewed-by: Guillaume Desmottes HACKING | 3 ++- Makefile.am | 12 ++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) commit 61f48c290176c007ff0aef6ca4d752491763e4b0 Author: Simon McVittie Date: 2011-05-30 15:41:27 +0100 Force a full rebuild for new gcc versions if gcov is enabled This avoids a lot of "Version mismatch - expected 406p got 405*". Because we're changing the content of each file after preprocessing, it even defeats ccache, which is desirable here - otherwise we'd get old versions of the profiling code being resurrected from the cache. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=37060 Reviewed-by: Guillaume Desmottes configure.ac | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) commit 0f320c5224fe39df44648ac75ecce9e0a01079d0 Author: Simon McVittie Date: 2011-05-30 15:41:01 +0100 Include config.h in generated C files, and regenerate dbus-gmarshal.c Bug: https://bugs.freedesktop.org/show_bug.cgi?id=37060 Reviewed-by: Guillaume Desmottes dbus/Makefile.am | 3 ++- dbus/dbus-gmarshal.c | 7 +++++-- dbus/examples/statemachine/Makefile.am | 4 +++- test/core/Makefile.am | 4 +++- 4 files changed, 13 insertions(+), 5 deletions(-) commit f91828abb160e44b53a32823516d55d8a5d634bc Author: Simon McVittie Date: 2011-05-30 15:39:28 +0100 Consistently include config.h in all non-generated .c files Bug: https://bugs.freedesktop.org/show_bug.cgi?id=37060 Reviewed-by: Guillaume Desmottes dbus/dbus-gidl.c | 2 ++ dbus/dbus-gloader-expat.c | 2 ++ dbus/dbus-gparser.c | 3 +++ dbus/dbus-gproxy.c | 3 +++ dbus/dbus-gthread.c | 2 ++ dbus/dbus-gtype-specialized.c | 2 ++ dbus/dbus-gvalue-parse-variant.c | 2 ++ dbus/examples/example-client.c | 2 ++ dbus/examples/example-service.c | 2 ++ dbus/examples/example-signal-emitter.c | 2 ++ dbus/examples/example-signal-recipient.c | 2 ++ dbus/examples/statemachine/statemachine-client.c | 2 ++ dbus/examples/statemachine/statemachine-server.c | 2 ++ dbus/examples/statemachine/statemachine.c | 2 ++ test/core/30574.c | 2 ++ test/core/peer-client.c | 2 ++ test/core/peer-server.c | 2 ++ test/core/test-dbus-glib.c | 2 ++ test/core/test-gvariant.c | 2 ++ test/core/test-service-glib.c | 2 ++ test/core/test-thread-client.c | 2 ++ test/core/test-thread-server.c | 2 ++ test/core/test-types.c | 2 ++ test/core/test-variant-recursion.c | 2 ++ test/interfaces/test-client.c | 2 ++ test/interfaces/test-objects.c | 2 ++ test/interfaces/test-server.c | 2 ++ test/test-service.c | 2 ++ 28 files changed, 58 insertions(+) commit 6d6d9a61e47f5bc28b5d61ae0d6cb072a81b5569 Author: Simon McVittie Date: 2011-04-13 19:00:41 +0100 dbus_g_proxy_add_signal: document error cases Bug: https://bugs.freedesktop.org/show_bug.cgi?id=36216 Reviewed-by: Guillaume Desmottes dbus/dbus-gproxy.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) commit 52f4e09d49551f3a8ece6578a6cb6e016c03a9d8 Author: Simon McVittie Date: 2011-05-10 12:00:15 +0100 dbus-gobject: check various preconditions for methods Reviewed-by: Cosimo Alfarano Bug: https://bugs.freedesktop.org/show_bug.cgi?id=36811 dbus/dbus-gobject.c | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) commit 6a61c922cedad9f5af5c32a0d783e9fbd53f3487 Author: Simon McVittie Date: 2011-05-04 12:52:25 +0100 dbus-gobject: move weakref to ObjectExport, with ObjectRegistration pointing there This has the following results: * each exported object only needs one weak ref to itself, however many times it is registered * because the ObjectRegistration now points to the ObjectExport, it can always remove itself from the list of registrations even if the actual object has been disposed, avoiding a leak (fd.o #36811) Reviewed-by: Cosimo Alfarano Bug: https://bugs.freedesktop.org/show_bug.cgi?id=36811 dbus/dbus-gobject.c | 89 ++++++++++++++++++++++++++++++++++----------------- 1 file changed, 59 insertions(+), 30 deletions(-) commit f07cf89fd36aebe5bd32f9e7cff13b5697365917 Author: Simon McVittie Date: 2011-05-04 12:25:18 +0100 Add a regression test for removing all registrations and starting again This has been confirmed to fail when the previous commit is reverted. Reviewed-by: Cosimo Alfarano Bug: https://bugs.freedesktop.org/show_bug.cgi?id=36811 test/core/registrations.c | 64 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) commit c3c6f8365f5074f3f59b66c5b4ece1feb214be23 Author: Simon McVittie Date: 2011-05-04 12:24:35 +0100 dbus_g_connection_register_g_object: only hook onto signals on first use This fixes a bug in which an empty list of registrations was considered to be synonymous with the object never having been exported, resulting in this failure mode: * register object at n locations - the first time, export_signals() is called * unregister all of those locations * register object at a new location - export_signals() is wrongly called again * emit a signal - the D-Bus signal gets emitted twice Reviewed-by: Cosimo Alfarano Bug: https://bugs.freedesktop.org/show_bug.cgi?id=36811 dbus/dbus-gobject.c | 48 ++++++++++++++++-------------------------------- 1 file changed, 16 insertions(+), 32 deletions(-) commit 323d5adb48f8630024f2b22172f10684508bd2a8 Author: Simon McVittie Date: 2011-05-04 10:47:56 +0100 dbus_g_connection_register_g_object: attach ObjectExport first This means we no longer need the unnecessarily subtle "steal and put back" pattern. Reviewed-by: Cosimo Alfarano Bug: https://bugs.freedesktop.org/show_bug.cgi?id=36811 dbus/dbus-gobject.c | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) commit c9961279c5ac667d4ddca98cbd3a3dfb4f1d8705 Author: Simon McVittie Date: 2011-05-04 10:45:58 +0100 dbus-gobject: wrap the GSList of registrations in a simple struct For simplicity, the ObjectExport struct isn't freed until the object is actually destroyed, even if there are no more registrations. Reviewed-by: Cosimo Alfarano Bug: https://bugs.freedesktop.org/show_bug.cgi?id=36811 dbus/dbus-gobject.c | 77 ++++++++++++++++++++++++++++++++++----------------- 1 file changed, 51 insertions(+), 26 deletions(-) commit 357fef2267d4243435e0d26ae659d21bd6bcde96 Author: Simon McVittie Date: 2011-01-04 16:12:03 +0000 test/interfaces: test annotated arguments The D-Bus Specification doesn't actually allow this, but dbus-glib has always supported it, and indeed understands a couple of annotations itself - org.freedesktop.DBus.GLib.ReturnVal and ….DBus.GLib.Const. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=27598 Reviewed-by: Robert Ancell test/interfaces/valid-annotations.xml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) commit b04f6b33224973cefec959a9fe0f7de655b93d0e Author: Simon McVittie Date: 2011-01-04 16:07:39 +0000 test/interfaces: check that some invalid annotations aren't allowed Bug: https://bugs.freedesktop.org/show_bug.cgi?id=27598 Reviewed-by: Robert Ancell .gitignore | 2 ++ test/interfaces/Makefile.am | 7 ++++++- test/interfaces/invalid-annotated-node.xml | 8 ++++++++ test/interfaces/invalid-nested-annotation.xml | 8 ++++++++ test/interfaces/run-test.sh | 20 +++++++++++++++++++- 5 files changed, 43 insertions(+), 2 deletions(-) commit e4a25a148703ef7ff13e5d87276b5d6fc395a57d Author: Simon McVittie Date: 2011-01-04 16:01:39 +0000 Test that interfaces, methods, properties, signals can be annotated Bug: https://bugs.freedesktop.org/show_bug.cgi?id=27598 Reviewed-by: Robert Ancell test/interfaces/Makefile.am | 20 ++++++++++++++++++-- test/interfaces/valid-annotations.xml | 21 +++++++++++++++++++++ 2 files changed, 39 insertions(+), 2 deletions(-) commit ac53fc025df08f12532fa7e3e69208db16151935 Author: Simon McVittie Date: 2011-01-04 15:51:05 +0000 Don't .gitignore everything in test/interfaces, and remove some duplication Bug: https://bugs.freedesktop.org/show_bug.cgi?id=27598 Reviewed-by: Robert Ancell .gitignore | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) commit b1338486f0ce5df460e9af67f3738f6a0f829840 Author: Simon McVittie Date: 2011-01-04 15:45:57 +0000 Allow inside too Bug: https://bugs.freedesktop.org/show_bug.cgi?id=27598 Reviewed-by: Robert Ancell dbus/dbus-gparser.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 160842c85f808a4815d005dd39a0d9419aa06788 Author: Christian Dywan Date: 2011-01-04 15:43:05 +0000 Allow signal annotations in dbus-binding-tool Bug: https://bugs.freedesktop.org/show_bug.cgi?id=27598 Bug-NB: NB#163566 Reviewed-by: Simon McVittie Reviewed-by: Robert Ancell dbus/dbus-gparser.c | 1 - 1 file changed, 1 deletion(-) commit dcbebd2ee2941136a2e04868da08777c985e0117 Author: Simon McVittie Date: 2011-05-03 18:49:19 +0100 Add a regression test for removing an object from only one connection Reviewed-by: Cosimo Alfarano Bug: https://bugs.freedesktop.org/show_bug.cgi?id=32087 test/core/registrations.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) commit 818b90092102e4fe6d2addfe77ee5a86d50e31c5 Author: Simon McVittie Date: 2011-05-03 18:49:06 +0100 dbus_g_connection_unregister_g_object: only unregister from @connection Previously, we unregistered the object from all connections, if it was present on more than one. Reviewed-by: Cosimo Alfarano Bug: https://bugs.freedesktop.org/show_bug.cgi?id=32087 dbus/dbus-gobject.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) commit 6b29f7f317df7d96a94ac910306508452be9130c Author: Simon McVittie Date: 2011-05-03 18:43:29 +0100 Add a regression test for registering an object on two connections Reviewed-by: Cosimo Alfarano Bug: https://bugs.freedesktop.org/show_bug.cgi?id=32087 test/core/registrations.c | 101 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 101 insertions(+) commit 17d5dcf86c766075400aff5d2aa3fe8e599fb715 Author: Simon McVittie Date: 2011-05-03 18:19:44 +0100 fd.o #32087: emit signals on the appropriate connections Reviewed-by: Cosimo Alfarano Bug: https://bugs.freedesktop.org/show_bug.cgi?id=32087 dbus/dbus-gobject.c | 23 +++++------------------ 1 file changed, 5 insertions(+), 18 deletions(-) commit 7f041871c3e5d023ee9cb77609bf0b69ebdbde34 Author: Simon McVittie Date: 2011-05-03 16:06:25 +0100 Add a regression test for re-registering an object at the same path Reviewed-by: Cosimo Alfarano Bug: https://bugs.freedesktop.org/show_bug.cgi?id=36793 test/core/registrations.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) commit 43f9dda46e9279b4489b6bd1efa0e5f9eb825a48 Author: Simon McVittie Date: 2011-05-03 16:04:30 +0100 dbus_g_connection_register_g_object: don't destroy state on early return At the beginning of the function we steal the object's state so we can add to the list. After doing that, we must make sure we give it back! Bug: https://bugs.freedesktop.org/show_bug.cgi?id=36793 Reviewed-by: Cosimo Alfarano Reviewed-by: Sjoerd Simons dbus/dbus-gobject.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) commit 4da28a6c49cecb902544d9152a693105d320cdac Author: Simon McVittie Date: 2011-05-03 11:59:44 +0100 dbus_g_connection_unregister_g_object: fix out-of-bounds reading The list of registrations is singly linked; we only avoid a crash here by luck. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=36793 Reviewed-by: Cosimo Alfarano Reviewed-by: Sjoerd Simons dbus/dbus-gobject.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) commit da740bfd88850c858d1cee079c8d261a79e2c75e Author: Simon McVittie Date: 2011-05-03 15:25:08 +0100 Subsume the test for #5688 into the more general registrations test Also test that the object is unregistered by the last unref or by forced disposal, without crashing. Reviewed-by: Cosimo Alfarano Bug: https://bugs.freedesktop.org/show_bug.cgi?id=36793 test/core/5688.c | 81 --------------------------------------------- test/core/Makefile.am | 9 ----- test/core/registrations.c | 73 ++++++++++++++++++++++++++++++++++++---- test/core/run-test.sh | 1 - 4 files changed, 67 insertions(+), 97 deletions(-) commit 0692c5995ea4a7013b4ab605cd76aca49239168d Author: Simon McVittie Date: 2011-05-03 15:08:27 +0100 Convert registrations test to use GTest Also use a private bus connection, for potentially better leak-detection. Reviewed-by: Cosimo Alfarano Bug: https://bugs.freedesktop.org/show_bug.cgi?id=36793 test/core/registrations.c | 74 ++++++++++++++++++++++++++++++++------------- 1 file changed, 53 insertions(+), 21 deletions(-) commit 002feb57cfcfeb439be1ace875a67ad540fed950 Author: Simon McVittie Date: 2011-05-03 14:49:29 +0100 Rename test/core/unregister to registrations (no source changes) Reviewed-by: Cosimo Alfarano Bug: https://bugs.freedesktop.org/show_bug.cgi?id=36793 .gitignore | 2 +- test/core/Makefile.am | 6 ++-- test/core/registrations.c | 71 +++++++++++++++++++++++++++++++++++++++++++++ test/core/run-test.sh | 2 +- test/core/unregister.c | 71 --------------------------------------------- 5 files changed, 76 insertions(+), 76 deletions(-) commit 15d9f31812b07439558e615d4d9bdfccaa33dbd5 Author: Mike Gorse Date: 2011-03-11 09:26:01 -0600 Fix removal of old io and timeout handlers when switching GMainContexts Bug: http://bugs.freedesktop.org/show_bug.cgi?id=35115 Reviewed-by: Simon McVittie dbus/dbus-gmain.c | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) commit a1a9a6f973f64e543c3d43b01bd6ef0963f8bf16 Author: Simon McVittie Date: 2011-05-10 11:17:53 +0100 test-service: ignore result of dbus_bus_request_name since we look at the error instead gcc 4.6 warns for this usage. Reviewed-by: Colin Walters Bug: https://bugs.freedesktop.org/show_bug.cgi?id=37062 test/test-service.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) commit 6c1e9559094be37bf66731b9f09fffcb1a19e8e5 Author: Simon McVittie Date: 2011-05-10 11:16:45 +0100 marshal_collection_array: statically assert that size conversion is not needed Previously, the function blindly assumed this without a check. Reviewed-by: Colin Walters Bug: https://bugs.freedesktop.org/show_bug.cgi?id=37062 dbus/dbus-gvalue.c | 10 ++++++++++ 1 file changed, 10 insertions(+) commit 324122a9f0bc859bb424d9026019e9077cda4015 Author: Simon McVittie Date: 2011-05-10 11:15:32 +0100 marshal_collection_array: remove set-but-unused variable elt_size gcc 4.6 warns about these. Reviewed-by: Colin Walters Bug: https://bugs.freedesktop.org/show_bug.cgi?id=37062 dbus/dbus-gvalue.c | 3 --- 1 file changed, 3 deletions(-) commit 341043e2d776cbd6faaf5b8d6a54a46920bb094c Author: Simon McVittie Date: 2011-05-04 15:18:48 +0100 marshal_map, marshal_struct: remove unused variable ret gcc 4.6 warns about these. Reviewed-by: Colin Walters Bug: https://bugs.freedesktop.org/show_bug.cgi?id=37062 dbus/dbus-gvalue.c | 6 ------ 1 file changed, 6 deletions(-) commit 1ea2eee4623cace2e852f1c16b1b1ce23035d037 Author: Simon McVittie Date: 2011-05-04 15:18:18 +0100 demarshal_static_variant: remove useless call to dbus_message_iter_get_arg_type gcc 4.6 warns about this. Reviewed-by: Colin Walters Bug: https://bugs.freedesktop.org/show_bug.cgi?id=37062 dbus/dbus-gvalue.c | 2 -- 1 file changed, 2 deletions(-) commit f8a7ccf024a19caa54d6f79cd9d62a63a9b36c5b Author: Simon McVittie Date: 2011-05-04 15:17:51 +0100 bash completion helper: remove unused variable 'prev', and simplify gcc 4.6 warns about this. Reviewed-by: Colin Walters Bug: https://bugs.freedesktop.org/show_bug.cgi?id=37062 dbus/dbus-bash-completion-helper.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) commit 09d85a945760d06447aea09a38ea99d0dc54de2a Author: Simon McVittie Date: 2011-03-29 17:05:04 +0100 DBusGProxy: link against GIO and use GDBus to check names' syntax Reviewed-by: Will Thompson Bug: https://bugs.freedesktop.org/show_bug.cgi?id=23616 configure.ac | 2 +- dbus/dbus-gproxy.c | 29 ++++++++++++++++++++--------- 2 files changed, 21 insertions(+), 10 deletions(-) commit f2b445d0d931f3f680cefe0141e62abeafda9742 Author: Simon McVittie Date: 2011-03-29 15:08:36 +0100 dbus_g_proxy_end_call: check that it's a proxy Reviewed-by: Will Thompson Bug: https://bugs.freedesktop.org/show_bug.cgi?id=23616 dbus/dbus-gproxy.c | 2 ++ 1 file changed, 2 insertions(+) commit 811089dae49c2f47d0f15fd7e9c180674f484391 Author: Simon McVittie Date: 2011-03-29 15:08:05 +0100 dbus_g_proxy_set_interface: check that it's a proxy and not destroyed If it has emitted destroy, our use of priv->manager will be a NULL pointer dereference. Reviewed-by: Will Thompson Bug: https://bugs.freedesktop.org/show_bug.cgi?id=23616 dbus/dbus-gproxy.c | 5 +++++ 1 file changed, 5 insertions(+) commit af3d48b10042616ac7ecceed5af8ddaeecc093f5 Author: Simon McVittie Date: 2011-03-29 15:07:23 +0100 Document that most DBusGProxy methods stop working on ::destroy Reviewed-by: Will Thompson Bug: https://bugs.freedesktop.org/show_bug.cgi?id=23616 dbus/dbus-gproxy.c | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) commit 63bd85823fd3039e88176105434c7bbdeae71e84 Author: Simon McVittie Date: 2011-03-29 15:06:18 +0100 dbus_g_proxy_new_from_proxy: check that the old proxy is in fact a proxy Reviewed-by: Will Thompson Bug: https://bugs.freedesktop.org/show_bug.cgi?id=23616 dbus/dbus-gproxy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 97de5501c2ebb29e4e32822bae0e45c88140bffd Author: Alban Crequy Date: 2011-04-14 14:48:56 +0100 DBusGProxy: remove duplicate owner match rules. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=33646 Reviewed-by: Simon McVittie dbus/dbus-gproxy.c | 109 +++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 82 insertions(+), 27 deletions(-) commit bc0497ea0c5ac65abc3658a31c95f9b0e15680f3 Author: Simon McVittie Date: 2011-04-13 19:00:23 +0100 dbus_g_proxy_add_signal: stop falsely claiming that we read introspection If we believed the introspection, services could change their introspection and remote-crash us, so it's good that we don't. We shouldn't claim that we do, though. The second sentence is subtle: for D-Bus types that dbus-glib can map into more than one GLib type, you must currently use the one that dbus-glib would "naturally" produce. The only example I can find is that object paths must be DBUS_TYPE_G_OBJECT_PATH, even though dbus-glib can also (in principle) unmarshal object-paths as DBUS_TYPE_G_PROXY. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=36216 dbus/dbus-gproxy.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) commit f5008cc76e0b466c4730e331857bc041aced5e94 Author: Simon McVittie Date: 2011-03-28 18:52:27 +0100 improve documentation of proxy timeouts to mention that -1 is special Reviewed-by: Will Thompson Bug: https://bugs.freedesktop.org/show_bug.cgi?id=30171 dbus/dbus-gproxy.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) commit 25c4b24a0d8490a7ba667b9944ce9b1c0808878a Author: Simon McVittie Date: 2011-03-28 18:52:02 +0100 Don't allow proxy timeouts to be set negative, except for -1 libdbus checks this as a precondition, but to avoid astonishing error behaviour (interpreted as OOM), so should we. Reviewed-by: Will Thompson Bug: https://bugs.freedesktop.org/show_bug.cgi?id=30171 dbus/dbus-gproxy.c | 3 +++ 1 file changed, 3 insertions(+) commit 35d1d8479031393f86fe668d2a1f64325b5dd1be Author: Simon McVittie Date: 2011-03-28 17:35:51 +0100 DBusGProxy: share OOM handler Reviewed-by: Will Thompson Bug: https://bugs.freedesktop.org/show_bug.cgi?id=30171 dbus/dbus-gproxy.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) commit 3a0e477ed6648bcb99711976fd51f4c0394000c6 Author: Simon McVittie Date: 2011-03-28 17:32:11 +0100 dbus_g_proxy_call_no_reply: don't assume NULL message means OOM It might either be OOM or bad arguments, probably the latter. That's programming error, but we already raised a critical warning, so be silent. Reviewed-by: Will Thompson Bug: https://bugs.freedesktop.org/show_bug.cgi?id=30171 dbus/dbus-gproxy.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit d0332f9862c3af18161f58444f35c7d03d9fb067 Author: Simon McVittie Date: 2011-03-28 17:32:00 +0100 dbus_g_proxy_begin_call_internal: don't assume NULL message means OOM It might either be OOM or bad arguments, probably the latter. That's programming error, but we already raised a critical warning, so be silent. Reviewed-by: Will Thompson Bug: https://bugs.freedesktop.org/show_bug.cgi?id=30171 dbus/dbus-gproxy.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) commit cd0da3f56873c5399b6247791df16acd3f4a73b1 Author: Simon McVittie Date: 2011-03-28 17:30:29 +0100 dbus_g_proxy_marshal_args_to_message: diagnose inability to marshal args Failure to marshal arguments is entirely reachable, albeit only via programming error. Reviewed-by: Will Thompson Bug: https://bugs.freedesktop.org/show_bug.cgi?id=30171 dbus/dbus-gproxy.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) commit 8b75efc7941ac789605128d48f82168da18bb9fd Author: Simon McVittie Date: 2011-03-28 17:27:18 +0100 marshal_collection_array: simplify exit path Also don't assume that failure of dbus_message_iter_close_container is always OOM. Reviewed-by: Will Thompson Bug: https://bugs.freedesktop.org/show_bug.cgi?id=30171 dbus/dbus-gvalue.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) commit 7729c5a4ee9c1bba0fe3f35d840c542303e26a1a Author: Simon McVittie Date: 2011-03-28 17:26:56 +0100 marshal_collection_array: if appending fails, don't assume OOM Appending can also fail by appending ((gboolean) 23) or something; admittedly, that's a programming error. Reviewed-by: Will Thompson Bug: https://bugs.freedesktop.org/show_bug.cgi?id=30171 dbus/dbus-gvalue.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) commit 73c1dc8031df7c9de0ab321f02cc5bedc49be7c1 Author: Simon McVittie Date: 2011-03-28 17:25:50 +0100 marshal_collection_array: assert validity of signature This means we can recognise OOM reliably; do so. Reviewed-by: Will Thompson Bug: https://bugs.freedesktop.org/show_bug.cgi?id=30171 dbus/dbus-gvalue.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit ca88a4f4adffccc1be8ddc0835d640f36d42f9fc Author: Simon McVittie Date: 2011-03-28 17:25:25 +0100 marshal_collection_array: fail early if the array is NULL Reviewed-by: Will Thompson Bug: https://bugs.freedesktop.org/show_bug.cgi?id=30171 dbus/dbus-gvalue.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) commit 7228321ddafc88e12406ca49406dfaa80240be9d Author: Simon McVittie Date: 2011-03-28 17:24:53 +0100 marshal_collection_ptrarray: abandon broken containers, simplify exit path Reviewed-by: Will Thompson Bug: https://bugs.freedesktop.org/show_bug.cgi?id=30171 dbus/dbus-gvalue.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) commit 9e8bed2ec229e48df0b1c63560b183f46d33bffd Author: Simon McVittie Date: 2011-03-28 17:24:18 +0100 marshal_collection_ptrarray: assert that the signature is valid This means that dbus_message_iter_open_container can't fail except by OOM, so use the shared handler. Reviewed-by: Will Thompson Bug: https://bugs.freedesktop.org/show_bug.cgi?id=30171 dbus/dbus-gvalue.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) commit 385180d3b1975afce823d4aa9aa5daf82fa09b5a Author: Simon McVittie Date: 2011-03-28 17:23:46 +0100 marshal_variant: abandon broken containers rather than closing them Reviewed-by: Will Thompson Bug: https://bugs.freedesktop.org/show_bug.cgi?id=30171 dbus/dbus-gvalue.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) commit 72c21e4e4cac8092c1dcf8348fdf3955cb01229c Author: Simon McVittie Date: 2011-03-28 17:23:34 +0100 marshal_struct: simplify teardown, and abandon broken containers Reviewed-by: Will Thompson Bug: https://bugs.freedesktop.org/show_bug.cgi?id=30171 dbus/dbus-gvalue.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) commit 48cf1b8b147d80265e2ab23b257d5c96ca260db9 Author: Simon McVittie Date: 2011-03-28 17:23:08 +0100 marshal_map: on error, abandon the container instead of closing it libdbus considers it to be a programming error if you close a container gracefully when its contents are incomplete. Reviewed-by: Will Thompson Bug: https://bugs.freedesktop.org/show_bug.cgi?id=30171 dbus/dbus-gvalue.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) commit c827cd5b160b59246305526eac6154006f8bb8d5 Author: Simon McVittie Date: 2011-03-28 17:21:18 +0100 marshal_signature: check validity of the signature Also remove a spurious cast, and comment why we're *not* assuming that failure here is necessarily OOM. Reviewed-by: Will Thompson Bug: https://bugs.freedesktop.org/show_bug.cgi?id=30171 dbus/dbus-gvalue.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) commit 98e5da6a6363b68042503e8e01819dc86ec7781e Author: Simon McVittie Date: 2011-03-28 17:20:51 +0100 marshal_object: check that it's really an object and its path is valid Again, we can now assume that failure is OOM. Reviewed-by: Will Thompson Bug: https://bugs.freedesktop.org/show_bug.cgi?id=30171 dbus/dbus-gvalue.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) commit 5d90b996ad4e9ee927d25fc692c8b08baa2a36b4 Author: Simon McVittie Date: 2011-03-28 17:20:23 +0100 marshal_object_path: check that it's really a valid object path Again, this means failure can only be OOM, so use the shared handler. Also remove an unnecessary cast. Reviewed-by: Will Thompson Bug: https://bugs.freedesktop.org/show_bug.cgi?id=30171 dbus/dbus-gvalue.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) commit f57e4e33838062e98d39764202fdcd60b709362d Author: Simon McVittie Date: 2011-03-28 17:19:45 +0100 marshal_proxy: check that it's really a proxy and its path is valid This means that dbus_message_iter_append_basic can't fail other than by OOM, so use the shared OOM handler. Reviewed-by: Will Thompson Bug: https://bugs.freedesktop.org/show_bug.cgi?id=30171 dbus/dbus-gvalue.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) commit 15bf1a2ef4d8b3e37b056cc893a844706fc714dc Author: Simon McVittie Date: 2011-03-28 17:18:43 +0100 marshal_valuearray: simplify teardown If close_container fails, it might be an assertion failure in libdbus, so don't assume it's OOM. We have to handle programming errors somewhat gracefully during marshalling anyway, so there's no point in asserting. Reviewed-by: Will Thompson Bug: https://bugs.freedesktop.org/show_bug.cgi?id=30171 dbus/dbus-gvalue.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) commit d1093f2c3413285c839cdbbca0c848b0d071cb62 Author: Simon McVittie Date: 2011-03-28 17:16:29 +0100 marshal_valuearray: abandon the container if we fail Reviewed-by: Will Thompson Bug: https://bugs.freedesktop.org/show_bug.cgi?id=30171 dbus/dbus-gvalue.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) commit 782412b65a1364f8736e15217aa853083c962935 Author: Simon McVittie Date: 2011-03-28 17:15:27 +0100 marshal_basic: if marshalling a string fails, critical and return FALSE This could be OOM, but it could also be non-UTF-8. Reviewed-by: Will Thompson Bug: https://bugs.freedesktop.org/show_bug.cgi?id=30171 dbus/dbus-gvalue.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) commit a2c276a49fa9efb8336db74db60dc1bcd2f0e8d6 Author: Simon McVittie Date: 2011-03-28 17:14:25 +0100 marshal_basic: if a boolean has a non-boolean value, diagnose the error Reviewed-by: Will Thompson Bug: https://bugs.freedesktop.org/show_bug.cgi?id=30171 dbus/dbus-gvalue.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) commit 94a501e0e69cf912c7f6a5250fdea0ec5fe673c7 Author: Simon McVittie Date: 2011-03-28 17:13:50 +0100 dbus-gvalue: replace trivial cases of OOM with a call to a noreturn function In these cases there's no invalid value we could be supplying to libdbus, so it's definitely OOM, not a programming error (e.g. non-UTF-8) masquerading as OOM. Reviewed-by: Will Thompson Bug: https://bugs.freedesktop.org/show_bug.cgi?id=30171 dbus/dbus-gvalue.c | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) commit 41b2fd28a833995c8ccab1a690c0e3925572488b Author: Simon McVittie Date: 2011-03-28 17:54:12 +0100 When given an object path, use GVariant to check syntactic validity Reviewed-by: Will Thompson Bug: https://bugs.freedesktop.org/show_bug.cgi?id=30171 dbus/dbus-gobject.c | 2 +- dbus/dbus-gproxy.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) commit 367a58bc081d451ff90262ae96b7d78ea74f3d11 Author: Simon McVittie Date: 2011-03-28 19:05:44 +0100 Depend on dbus 1.2.16 for dbus_message_iter_abandon_container Reviewed-by: Will Thompson Bug: https://bugs.freedesktop.org/show_bug.cgi?id=30171 configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 0f782b478a784ac890741e5d84fd741a26d49510 Author: Simon McVittie Date: 2011-03-29 14:45:34 +0100 Stop overriding pkg-config's nice informative message if GLib is too old This means that instead of this rather ambiguous text: checking for DBUS_GLIB... no checking for DBUS_GLIB_THREADS... yes configure: error: GLib development libraries not found platforms whose GLib is too old will get the conventional output: checking for DBUS_GLIB... no configure: error: Package requirements (gobject-2.0 >= 2.26) were not met: Requested 'gobject-2.0 >= 2.26' but version of GObject is 2.24.0 Bug: https://bugs.freedesktop.org/show_bug.cgi?id=33145 Reviewed-by: Colin Walters configure.ac | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) commit ab2a98bd3ae0c59f198e82cba2c81095a47fa58d Author: Robert Ancell Date: 2011-02-15 14:10:34 +1100 Fix linking order Reviewed-by: Simon McVittie Bug: https://bugs.freedesktop.org/show_bug.cgi?id=34282 dbus/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit af0c64037673d598a6842fb344b5f3dad80ab821 Author: Will Thompson Date: 2010-06-02 16:31:54 +0100 docs: correct links in introduction Fixes https://bugs.freedesktop.org/show_bug.cgi?id=22667 — thanks to Daniel Macks for the bug report! doc/reference/dbus-glib-docs.sgml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) commit 04e11da48a6c2a75bebb5ece31cf86508203dd02 Author: Simon McVittie Date: 2011-01-04 16:33:27 +0000 Add a regression test for errors containing underscores Bug: https://bugs.freedesktop.org/show_bug.cgi?id=30274 Reviewed-by: Will Thompson test/core/my-object.c | 15 +++++++++++++++ test/core/my-object.h | 3 ++- test/core/test-dbus-glib.c | 11 +++++++++++ test/core/test-service-glib.xml | 3 +++ 4 files changed, 31 insertions(+), 1 deletion(-) commit 2d987890c3ba2fd8efc92f8b75da88904ce425f9 Author: Simon McVittie Date: 2011-01-04 18:04:11 +0000 Run run-with-tmp-session-bus.sh directly rather than via ${SHELL} It has a correct #!/bin/sh line and is executable, so just running it is fine. This avoids running it under a user's chosen interactive shell, which might be non-POSIX (zsh, csh). Gentoo Portage apparently sets SHELL to /bin/false, presumably to trap this sort of thing. (I've tested this on Debian unstable with /bin/sh -> /bin/dash, to check that weren't accidentally relying on $SHELL being bash or similar.) Based on a workaround from Myckel Habets on the Gentoo bug. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=27193 Bug-Gentoo: https://bugs.gentoo.org/show_bug.cgi?id=254192 Reviewed-by: Colin Walters test/core/run-test.sh | 2 +- test/interfaces/run-test.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) commit 6708c68cc9c312ffea600d0020425412ba242ddb Author: Christian Dywan Date: 2011-01-04 18:48:31 +0000 Cleanup indentation in dbus-glib-binding-tool Bug: https://bugs.freedesktop.org/show_bug.cgi?id=32351 Bug-NB: NB#180486 Reviewed-by: Simon McVittie dbus/dbus-binding-tool-glib.c | 134 ++++++++++++++++++++--------------------- 1 file changed, 67 insertions(+), 67 deletions(-) commit f1b8944a93a22d342f744526f5c47e80e394579f Author: Christian Dywan Date: 2011-01-04 18:48:27 +0000 Plug leaks in dbus-glib-binding-tool Bug: https://bugs.freedesktop.org/show_bug.cgi?id=32351 Bug-NB: NB#180486 Reviewed-by: Simon McVittie dbus/dbus-binding-tool-glib.c | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) commit 4cd1f54f4db5759db3781da4645cebcd4143e9a4 Author: Christian Dywan Date: 2010-09-20 11:57:08 +0200 Do not squash underscores in error names Underscores are used and valid according to the specification. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=30274 Reviewed-by: Simon McVittie dbus/dbus-gobject.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) commit d4780b527f5112acf015c0e57c9911e939b16f99 Author: Christian Dywan Date: 2010-07-21 16:32:22 +0200 Watch server_set_data failure in dbus__server_setup_with_g_main Bug: https://bugs.freedesktop.org/show_bug.cgi?id=29884 Reviewed-by: Simon McVittie dbus/dbus-gmain.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit c7b83e5b3bf7291b75399eed3f01ecea0c98702f Author: Christian Dywan Date: 2010-12-13 10:14:57 -0800 Verify Increment call in dbus-glib-test Bug: https://bugs.freedesktop.org/show_bug.cgi?id=29884 Origin: vendor, Maemo Reviewed-by: Simon McVittie test/core/test-dbus-glib.c | 3 +++ 1 file changed, 3 insertions(+) commit 7e157ee379de430fce9874291701c0c6666d2c2d Author: Will Thompson Date: 2010-11-10 10:44:38 +0000 Bump version to 0.93 for development configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit a12d06317591f954542d5ddbe1a1d3cad10a8156 Author: Will Thompson Date: 2010-11-10 10:25:19 +0000 Release version 0.92 configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit cb7a627ea838ae453d1401679a2b97acd95ba327 Author: Will Thompson Date: 2010-11-10 10:22:40 +0000 Bump GLib dependency to 2.26. G_VARIANT_TYPE_STRING_ARRAY, as used by the GVariant<->GValue conversion functions, was added in 2.26. The previous release should have had this dependency, but I didn't notice. configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit c12efeeb7d9eb76eeae049528cee09c331551a5e Author: Will Thompson Date: 2010-11-08 00:20:20 -0500 Bump version to 0.91 for development configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 4d4a1e266727de9ed1cba2707006435a389cac90 Author: Will Thompson Date: 2010-11-08 00:16:46 -0500 HACKING: Fix release URL; be honest about NEWS HACKING | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) commit b3c18c486dbb1fd2c6221d26fd64719d73ff4200 Author: Will Thompson Date: 2010-11-08 00:12:00 -0500 Makefile.am: Remove ChangeLog's spurious FORCE dependency This seems to be some kind of leftover from the now-deleted lcov stuff. Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit ccd31bb39e496ba511e888d793b15bfaa22894f0 Author: Will Thompson Date: 2010-11-08 00:08:15 -0500 Release version 0.90 configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 65fb5802295ff28970ac1e3f0d5adaa6927a5773 Author: Will Thompson Date: 2010-11-08 00:04:31 -0500 Build test/ before its subdirs. This fixes running `make check` without first running `make`, since subdirs of test/ depend on the binaries in that directory. test/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 22df79e0c1373b696adbbaf2791195f0a8b5fb0f Author: Mike Gorse Date: 2010-10-22 04:33:53 -0400 Fix switching a connection's GMainContext dbus_connection_setup_with_g_main and dbus_server_setup_with_g_main are intended to switch the setup to a new main loop context if they are called with a context other than the one with which they were initially called. However, this does not work in practice. The problem has to do with libdbus maintaining a list of watches associated with the connection. When dbus_connection_set_watch_functions is called, it first adds the existing watches using the new function and data, then removes the watches using the old function and data. Remove_watch calls connection_setup_remove_watch, and the latter does not check that the watch's connection setup matches the connection setup passed to it, so it winds up removing the watch from the new connection setup. (The watch has already been removed from the old setup at this point, as a side effect of dbus_watch_set_data). Fixes: Signed-off-by: Will Thompson .gitignore | 1 + dbus/dbus-gmain.c | 7 ++-- test/core/30574.c | 96 +++++++++++++++++++++++++++++++++++++++++++++++++ test/core/Makefile.am | 4 +++ test/core/run-test.sh | 1 + 5 files changed, 106 insertions(+), 3 deletions(-) commit 8f0936de52b62b025385182406e5ea5795503d76 Merge: 8aca055 afd0987 Author: Simon McVittie Date: 2010-10-14 13:06:47 +0100 Merge branch 'type-names' Reviewed-by: Will Thompson Bug: https://bugs.freedesktop.org/show_bug.cgi?id=30431 commit 8aca05563f86bd24fedb4322363ae844affc3c61 Merge: 0ab27bb ad4b66d Author: Simon McVittie Date: 2010-10-14 12:37:58 +0100 Merge branch 'gvariant' Reviewed-by: Danielle Madeley Bug: https://bugs.freedesktop.org/show_bug.cgi?id=30428 commit ad4b66db0e3a6ecab31bed214f341c4b07691224 Author: Simon McVittie Date: 2010-10-14 12:15:08 +0100 copy arrays of 'o', 'g' from GVariant without constructing a format string programmatically dbus/dbus-gvalue-parse-variant.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) commit 869c180e12c68ed06fe973c58f26cffbf4a3cec9 Author: Simon McVittie Date: 2010-10-14 12:13:19 +0100 output unhandled GVariantClass as ASCII if possible dbus/dbus-gvalue-parse-variant.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) commit 42192c5bc0517d747aa83e9ce82e0208c3426aab Author: Simon McVittie Date: 2010-10-14 12:06:36 +0100 Add dbus_g_value_parse_g_variant to gtkdoc doc/reference/dbus-glib-sections.txt | 1 + 1 file changed, 1 insertion(+) commit f3b4a2d82994f0013f14fffbd3fedd8cd45cf7da Author: Simon McVittie Date: 2010-10-14 12:06:07 +0100 dbus_g_value_parse_variant_by_type: talk about GVariant, not GDBus, in docs dbus/dbus-gvalue-parse-variant.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit bc207d10cace8051ff7b2ddf51176030c0d40d17 Author: Simon McVittie Date: 2010-10-14 12:05:48 +0100 Adjust syntax to avoid relying on array/pointer duality dbus/dbus-gvalue-parse-variant.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit a66176ecd5eab86d62e23c393c90dfda4d9ca354 Author: Simon McVittie Date: 2010-10-14 12:04:29 +0100 dbus_g_value_basic_array_parse_variant: allow the fast path to be taken dbus/dbus-gvalue-parse-variant.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit b9c4c4bf00321ab1fb092514c6b1312d82a098c3 Author: Simon McVittie Date: 2010-10-13 13:27:33 +0100 Test dbus_g_value_parse_g_variant Also test dbus_g_value_build_g_variant more thoroughly, by carrying out various round-trip conversions. test/core/test-gvariant.c | 283 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 283 insertions(+) commit 817e1fc7c50ccde3643c20ed837dce00bc16a885 Author: Simon McVittie Date: 2010-10-13 12:57:35 +0100 dbus_g_value_build_g_variant: cope with empty arrays, maps We can't just derive the type from the first entry if there's no first entry, so for the empty case we need a function whose structure mirrors dbus_g_value_build_g_variant itself, which just returns the type. dbus/dbus-gtype-specialized.c | 114 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 112 insertions(+), 2 deletions(-) commit 53d4457fb5bd71467acb1fbca7ecd80d8e39e189 Author: Simon McVittie Date: 2010-10-13 12:52:39 +0100 dbus_g_type_specialized_map_append: document that the value contents are stolen This is highly non-obvious, and tripped me up while writing dbus_g_value_parse_g_variant. dbus/dbus-gtype-specialized.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 26e1c1d86b6e583ac326674ab8b886673f7c1f90 Author: Simon McVittie Date: 2010-10-13 12:52:07 +0100 fd.o #30428: add dbus_g_value_parse_g_variant This is the inverse of dbus_g_value_build_g_variant, and can be used to present an API with GVariant 'in' arguments to library users, then translate them into GValue for transmission over dbus-glib, as a transition mechanism. dbus/Makefile.am | 2 + dbus/dbus-glib.h | 2 + dbus/dbus-gvalue-parse-variant.c | 525 ++++++++++++++++++++++++++++++++++++++ dbus/dbus-gvalue-parse-variant.h | 39 +++ 4 files changed, 568 insertions(+) commit abe6ee06e30f71187aeaed2c8804cbcc6692d8cc Author: Simon McVittie Date: 2010-10-13 12:48:51 +0100 replace remnants of gcov support with lcov.am from telepathy-glib .gitignore | 4 ++++ Makefile.am | 27 +-------------------------- tools/lcov.am | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 52 insertions(+), 26 deletions(-) commit b4362df4d4b9ccd3246f102f7990dbda426f1b8c Author: Simon McVittie Date: 2010-10-12 15:27:52 +0100 Remove gcov decoder, which hasn't worked since dbus-glib left libdbus Makefile.am | 16 +- test/Makefile.am | 12 +- test/decode-gcov.c | 2652 ---------------------------------------------------- 3 files changed, 2 insertions(+), 2678 deletions(-) commit c42b86fecc793edaf82055a3552f1490be8ad29c Author: Simon McVittie Date: 2010-10-12 15:19:24 +0100 Test dbus_g_value_build_g_variant for various fixed arrays test/core/test-gvariant.c | 217 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 217 insertions(+) commit 75161c695e8d9729ead8543b1297202eee1894f9 Author: Simon McVittie Date: 2010-10-12 15:19:05 +0100 Actually run test/core/test-gvariant test/core/run-test.sh | 1 + 1 file changed, 1 insertion(+) commit 48b2b580c4d6fdcd9db83db7acebb0ea4be6fff9 Author: Simon McVittie Date: 2010-10-12 14:41:35 +0100 Give specialized GArrays iteration/appending support This is necessary to have dbus_g_value_build_g_variant work on them. dbus/dbus-gvalue-utils.c | 162 +++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 160 insertions(+), 2 deletions(-) commit 0ab27bb2b7c3f944348e6368069ffbfcfc2bcb5a Author: Christian Dywan Date: 2010-07-21 17:28:09 +0200 Free looked up function name in dbus binding tool dbus/dbus-binding-tool-glib.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) commit 5784ee8f24334e634e91b8761dfa956f97a0d2ba Author: Christian Dywan Date: 2010-07-21 17:18:18 +0200 Always free method_c_name in dbus binding tool dbus/dbus-binding-tool-glib.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) commit 4acce76d97825721c1792417994e592542f4d3d9 Author: Christian Dywan Date: 2010-07-21 17:12:34 +0200 Free path string after emission in in statemachine server example dbus/examples/statemachine/statemachine-server.c | 1 + 1 file changed, 1 insertion(+) commit ddb48ae24e40c8636b85555e8d288e2a33cadd44 Author: Christian Dywan Date: 2010-07-21 17:10:26 +0200 Plug leak of expected_str in threaded server test test/core/test-thread-server.c | 1 + 1 file changed, 1 insertion(+) commit a07afee00e091a11dc9eefd775288a32f0e49e2d Author: Christian Dywan Date: 2010-07-21 18:41:06 +0200 Dereference main loop once variant recursion test is done test/core/test-variant-recursion.c | 2 ++ 1 file changed, 2 insertions(+) commit ffe66eb93737eb5ac699b8acba7781a5f77bdab6 Author: Christian Dywan Date: 2010-07-22 16:26:15 +0200 Remove unused method attribute variables in introspect_interfaces dbus/dbus-gobject.c | 4 ---- 1 file changed, 4 deletions(-) commit afd098718e36b8ce51f565447f429d807bab3785 Author: Simon McVittie Date: 2010-09-28 17:19:19 +0100 Add DBusGObjectPath, DBusGSignature typedefs dbus/dbus-glib.h | 2 ++ dbus/dbus-gvalue.c | 44 ++++++++++++++++++++++++++++++---- doc/reference/dbus-glib-sections.txt | 4 +++- 3 files changed, 45 insertions(+), 5 deletions(-) commit 8318613e6b186bd9e5c8a844c58beebf47426116 Author: Colin Walters Date: 2010-08-12 10:19:35 -0400 configure: Release 0.88 configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 510bdcd63ae4e588a5cb72727696d5ad7fd5298b Author: Colin Walters Date: 2010-04-19 16:47:11 -0400 Respect property access flags for writing, allow disabling for reads Because DBus-GLib originally was designed as a generic "object mapping" binding, the handler for org.freedesktop.DBus.Properties simply allowed access (read or write) to any GObject property that was exported. Later, the (compile time) introspection XML was added, and while we only listed "exported" properties in the dynamic introspection XML, we still allowed Get or Set calls to any property that was valid. With this patch, we deny writes to properties which aren't listed in the XML, or are listed as read-only. For backwards compatibility however, we still allow reads. A service may disable this by calling dbus_glib_global_set_disable_legacy_property_access(). dbus/dbus-binding-tool-glib.c | 53 +++++-- dbus/dbus-glib.h | 2 + dbus/dbus-gobject.c | 293 +++++++++++++++++++++++++++++++++------ test/core/my-object.c | 63 ++++++++- test/core/my-object.h | 5 + test/core/test-dbus-glib.c | 252 +++++++++++++++++++++++++++++++-- test/core/test-service-glib.xml | 5 + 7 files changed, 601 insertions(+), 72 deletions(-) commit f0668d71d63f97c1c429dad165a30d3aadbdfa0f Author: Simon McVittie Date: 2010-08-09 11:25:19 +0100 Consolidate LDADD variables in tests/examples and make them more complete This fixes compilation with LDFLAGS=-Wl,--no-add-needed, which is the default behaviour of GNU gold, and of Fedora's patched GNU ld. See: http://fedoraproject.org/wiki/Features/ChangeInImplicitDSOLinking Bug: https://bugs.freedesktop.org/show_bug.cgi?id=29274 Reviewed-by: Colin Walters dbus/examples/Makefile.am | 8 ++++---- dbus/examples/statemachine/Makefile.am | 6 ++++-- test/core/Makefile.am | 32 +++++++++++++------------------- test/interfaces/Makefile.am | 8 ++++---- 4 files changed, 25 insertions(+), 29 deletions(-) commit ccf4a4d8c82b7309af7f3fb23144690acbf8e38c Author: Simon McVittie Date: 2010-08-09 11:25:55 +0100 Add various tests etc. to .gitignore .gitignore | 7 +++++++ 1 file changed, 7 insertions(+) commit dcc9c8f2dede482614b885eace06f2dedaf2a736 Author: Simon McVittie Date: 2010-07-27 17:16:33 +0100 Add Libtool m4 to .gitignore .gitignore | 5 +++++ 1 file changed, 5 insertions(+) commit 9440209e203cccef158904800ea623568637a71e Merge: 0eec114 077d445 Author: Will Thompson Date: 2010-08-05 10:09:08 +0100 Merge remote branch 'danni/gvalue-to-gvariant' Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=28715 commit 0eec114bb510a3bb30888b0020ca0dc11dc3497d Author: Christian Dywan Date: 2010-07-22 13:38:01 +0200 Refer to dbus_g_connection_flush rather than the plain dbus call Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=29214 dbus/dbus-gproxy.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) commit 077d445078663e3ee6f93beacc14d866504148bf Author: Danielle Madeley Date: 2010-07-14 15:43:11 +1000 Support DBUS_TYPE_G_SIGNATURE dbus/dbus-gtype-specialized.c | 2 ++ test/core/test-gvariant.c | 21 +++++++++++++++++++++ 2 files changed, 23 insertions(+) commit 13f7c51344111ca5266e790d2f4863fab770bfd8 Author: Danielle Madeley Date: 2010-06-25 14:35:17 +1000 Test test_g_variant_equivalent itself test/core/test-gvariant.c | 144 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 144 insertions(+) commit 90b5e06797f2c9c5ed8918d22de35d5093bc3bd1 Author: Danielle Madeley Date: 2010-06-25 14:11:40 +1000 Write a recursive equivalence function for testing the equivalence of GVariants Makes up for the limitations of g_variant_equal() test/core/test-gvariant.c | 114 +++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 106 insertions(+), 8 deletions(-) commit 5456dc1f10544505a61f2608f646256e28b0047a Author: Danielle Madeley Date: 2010-06-24 22:10:48 +1000 Tests for GValue-to-GVariant test/core/Makefile.am | 7 +- test/core/test-gvariant.c | 191 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 197 insertions(+), 1 deletion(-) commit 5cc0676c83ee678069886daad5fc5487f098686e Author: Danielle Madeley Date: 2010-06-24 20:52:26 +1000 fd.o #28715: Add dbus_g_value_build_g_variant() dbus/dbus-gtype-specialized.c | 127 ++++++++++++++++++++++++++++++++++ dbus/dbus-gtype-specialized.h | 2 + doc/reference/dbus-glib-sections.txt | 1 + 3 files changed, 130 insertions(+) commit 5ed147db0808e5f4ef50dfd6011419c44255ea6c Author: Danielle Madeley Date: 2010-06-24 20:59:05 +1000 Bumping required GLib to 2.24 for GVariant configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 7f054d7bce4b2ea74e5268f2cf65c467773ee14f Author: Dan Williams Date: 2010-06-29 21:19:25 -0700 Fix lookup of regular properties when shadow properties are used Only free the uscore converted name if there's actually a shadow property registered for this property; otherwise if there is no shadow property we free the uscore converted one and then return it immediately after. dbus/dbus-gobject.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit e6b6e27dc2d6e3abae88d9a773a1e4c016e58aa3 Author: Simon McVittie Date: 2010-05-04 12:39:51 +0100 fd.o #27958: dbus_g_error_domain_register: rewrite the documentation Reviewed-by: Will Thompson dbus/dbus-gobject.c | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) commit 451183c140f7d6b42fdff3a6c190ef93d860c5fc Merge: 7db074f 499beb6 Author: Simon McVittie Date: 2010-05-04 12:18:31 +0100 Merge branch '14579-remove-before-cancel' Reviewed-by: Will Thompson Bug: https://bugs.freedesktop.org/show_bug.cgi?id=14579 commit 7db074fead497c31041ebf417db26ae9a7ab565c Author: Fridrich Štrba Date: 2010-04-26 18:51:49 +0200 Put the G_OS_WIN32 check where it can be defined. test/core/test-profile.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) commit fb7cb9f10e08eaf3887b2a63a7fa59510e40b5d2 Author: Fridrich Štrba Date: 2010-04-26 18:50:31 +0200 Fix linking of tests. On windows, undefined symbols are not allowed and symbol lookup is sequencial test/core/Makefile.am | 2 +- test/interfaces/Makefile.am | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) commit fadbedfbbf512d69611a80a0cd4698e3b5d579ea Author: Fridrich Štrba Date: 2010-04-26 18:44:21 +0200 Use EXEEXT so that we satisfy dependencies when cross-compiling test/core/Makefile.am | 6 +++--- test/interfaces/Makefile.am | 20 ++++++++++---------- 2 files changed, 13 insertions(+), 13 deletions(-) commit f0abb1f78d4e4764119b57d2b6f3b5fa57d8fdfb Author: Dan Williams Date: 2010-04-22 13:26:44 -0700 core: don't pass malformed error interface to dbus (rh#581794) While clients should really register their errors, dbus-glib shouldn't be passing a malformed error interface to dbus either. It's just not nice and libdbus will call abort(). See https://bugzilla.redhat.com/show_bug.cgi?id=581794 Signed-off-by: Colin Walters dbus/dbus-gobject.c | 17 +++++++++++------ test/core/my-object.c | 12 ++++++++++++ test/core/my-object.h | 1 + test/core/test-dbus-glib.c | 8 ++++++++ test/core/test-service-glib.xml | 3 +++ 5 files changed, 35 insertions(+), 6 deletions(-) commit 47adc3b17f20a78230c5c34e635fc30bb7afbde2 Author: Colin Walters Date: 2010-04-26 10:51:39 -0400 Disable test-profile on win32 for now It uses Unix sockets, and overall isn't very interesting anyways. test/core/test-profile.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) commit 16deb341b52421695b81ebe8c91c81f47eb173f3 Author: Fridrich Strba Date: 2010-04-26 10:31:23 -0400 Don't use the identifier "interface" in public headers This causes problems on Windows. dbus/dbus-gidl.h | 2 +- dbus/dbus-glib.h | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) commit 354ed0897ae0e815e95a7eb931de6ba35325121c Author: Fridrich Strba Date: 2010-04-26 10:29:41 -0400 Use AC_CANONICAL_HOST, not _TARGET This is what GLib uses; see the Autoconf manual for the full explanation of the train wreck. configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit af0ec6795ea64d6498b83f30ecd94adc4e935e7e Author: Astone Lin Date: 2010-04-19 06:56:43 -0400 Allow duplicate object path registrations for different connections We clearly need to respect the connection when comparing registrations, since it's perfectly valid to have the same one on two different connections. dbus/dbus-gobject.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit fc7114a536571688d48ede025f1357c0e467c879 Author: Guillaume Desmottes Date: 2010-04-07 12:08:59 +0200 add mising DBUS_TYPE_G_* to the doc Reviewed-by: Will Thompson Reviewed-by: Simon McVittie doc/reference/dbus-glib-sections.txt | 9 +++++++++ 1 file changed, 9 insertions(+) commit 8df3281e536557cfd6b4056a9c95102d57596179 Author: Colin Walters Date: 2010-03-24 20:17:54 -0400 [configure] Release 0.86 configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 551d86f7fe0e7f2304f57baa7a406c935182b06a Author: Dan Williams Date: 2010-03-24 14:40:09 -0700 core: performance optimization for object info lookup dbus/dbus-gobject.c | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) commit ed73cb2f32c411a3306c6dfe2ae541aea249f200 Author: Dan Williams Date: 2010-03-24 12:20:13 -0700 core: allow duplicate property names on GInterfaces Allows dbus-glib clients to handle objects that implement more than one interface with the properties of the same name. Normally this would not be allowed since with GObject all properties are in the same namespace. This patch allows the interface to register "shadow" properties on a per-interface basis which redirect the lookup of the property name. dbus/dbus-glib.h | 4 + dbus/dbus-gobject.c | 160 +++++++++++++++++++++++++---- test/interfaces/Makefile.am | 24 ++++- test/interfaces/test-client.c | 186 +++++++++++++++++++++++++++++++++ test/interfaces/test-dup-prop-a.xml | 6 ++ test/interfaces/test-dup-prop-b.xml | 6 ++ test/interfaces/test-dup-prop.c | 192 +++++++++++++++++++++++++++++++++++ test/interfaces/test-dup-prop.h | 60 +++++++++++ test/interfaces/test-server.c | 8 ++ 9 files changed, 627 insertions(+), 19 deletions(-) commit c1bbf6fb1b7c6e2a743c8a7353cddea52d42fa2d Author: Colin Walters Date: 2010-03-18 21:39:24 -0400 [dbus-gobject.c] Trivial compiler warning fixes dbus/dbus-gobject.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) commit b52c16b495632bd945328ca858533d5660106bdf Author: Colin Walters Date: 2010-03-18 21:37:38 -0400 Remove dbus-glib-undeclared.txt from git; it's a generated file 0 files changed commit 7b029451dac1fdd14da4e558cc995fb7f5263d04 Author: Colin Walters Date: 2010-03-18 21:37:05 -0400 [configure.ac] Use AM_SILENT_RULES if available configure.ac | 2 ++ 1 file changed, 2 insertions(+) commit db026859406ce768d71d4ccf850e8be56b52998c Author: Will Thompson Date: 2010-03-09 17:18:10 +0000 Free errors returned by method implementations https://bugs.freedesktop.org/show_bug.cgi?id=26981 dbus/dbus-gobject.c | 4 ++++ 1 file changed, 4 insertions(+) commit 3902ac5a13a7510b8411b1147d0cce5711cf4168 Author: Sven Herzberg Date: 2010-03-08 16:50:28 +0100 turn the gtk-doc documentation into buildable shape * dbus/dbus-gobject.c: the < and > symbols broke the sgml generation in gtk-doc dbus/dbus-gobject.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) commit 3d69cfeab177e79b4ecfe1b4284a5bd840fd11e7 Author: Colin Walters Date: 2009-04-02 14:01:05 +0100 Fix hyphenated error codes correctly The error code names generated my glib-mkenums separate the words by hyphens which are invalid D-BUS error names. This patch converts them back to wincaps, but we can't uppercase the first letter. Based on an original patch from Neil Roberts dbus/dbus-gobject.c | 21 ++++++++++++++++++--- test/core/my-object.c | 13 +++++++++++++ test/core/my-object.h | 4 +++- test/core/test-dbus-glib.c | 7 +++++++ test/core/test-service-glib.xml | 3 +++ 5 files changed, 44 insertions(+), 4 deletions(-) commit 4538adc1fe903d1ce71ca24590df9bdac7c4a50e Author: Colin Walters Date: 2010-03-02 12:12:18 -0500 Revert "Squash underscores and dashes in errors when converting to DBus errors" This reverts commit 9637ed9f0c66982a06048b18ccf983881643e456. This incorrectly uppercased the first character in error names: https://bugzilla.redhat.com/show_bug.cgi?id=569631 dbus/dbus-gobject.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) commit 2d85761286e96df3490426af1e20e7b553448092 Author: Colin Walters Date: 2010-03-02 13:52:36 -0500 Remove dbus-glib-undocumented.txt from git It's autogenerated by gtk-doc, so shouldn't be in git. doc/reference/dbus-glib-undocumented.txt | 60 ------------------------------ 1 file changed, 60 deletions(-) commit 9637ed9f0c66982a06048b18ccf983881643e456 Author: Colin Walters Date: 2010-02-01 10:09:53 -0500 Squash underscores and dashes in errors when converting to DBus errors We were just taking the enumeration nick and appending to the DBus error name, but since these can contain '-' we need to squash. dbus/dbus-gobject.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) commit d039ca66f85955788e2d58294c249579bed9cc03 Author: Colin Walters Date: 2010-01-27 13:56:48 -0500 Release 0.84 configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit f1c3f7bf585d6010c84491372b0a6f0ae3b1432a Author: Colin Walters Date: 2010-01-27 13:01:29 -0500 Add GMainContext to dbus_g_bus_get_private, add a test case To even sort of work with threads right now, a common workaround is to open a private connection. This patch more explicitly supports creating a private connection, associating it with the GMainContext which will be used for a thread. Also, add a (very simple) test case which just uses a private connection for the default main context. dbus/dbus-glib.h | 1 + dbus/dbus-gmain.c | 4 +++- test/core/test-dbus-glib.c | 21 +++++++++++++++++++++ 3 files changed, 25 insertions(+), 1 deletion(-) commit 87c645ed17d6fef350e8c26e322ecde566a27d42 Author: Colin Walters Date: 2010-01-27 13:06:34 -0500 Fix compilation of dbus-gvalue.c commit c4a5653e0402f876a1824c33a19e69991ee46a27 was missing a "break;" dbus/dbus-gvalue.c | 1 + 1 file changed, 1 insertion(+) commit e6cd65545ee5cd2eeb5ccc21d5bfe8e8ac286d95 Author: Colin Walters Date: 2010-01-27 11:40:07 -0500 Add note about non-maintenance of NEWS NEWS | 7 +++++++ 1 file changed, 7 insertions(+) commit c4a5653e0402f876a1824c33a19e69991ee46a27 Author: Andres Salomon Date: 2009-08-19 08:57:21 -0400 dbus-gvalue: set an error when demarshal_basic doesn't recognize type By passing dbus_g_proxy_call an incorrect signature, we can cause the function to fail but not provide any error message (if G_DISABLE_ASSERT is defined). As smvc pointed out, this can also become a runtime error when a telepathy CM changes signature, but the client hasn't been updated. As such, g_assert isn't an appropriate action. See http://bugs.debian.org/541632 for more information. This patch causes it to set an error when demarshalling a type that it's not expecting. Instead of a NULL error, one instead sees something like the following when the method returns a path object but the client expected a string: "modem Create() failed: Expected type gchararray, got type code 'o'" Signed-off-by: Andres Salomon dbus/dbus-gvalue.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) commit b976413f896f2d5a0be9449fc77a716f2e67cc96 Author: Jiří Klimeš Date: 2010-01-27 10:36:57 -0500 Fix bad NAME in dbus-binding-tool man page doc/dbus-binding-tool.1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 34636b12c62523b9db789b0fbeb3a86782debf10 Author: Colin Walters Date: 2010-01-15 12:23:30 -0500 Import dbus-bus-introspect.xml upstream Rather than having consumers pass an externally-generated XML file, just include one here. In practice our target audience is OS builders, who if they have the capability to update dbus, also have the capability to update dbus-glib. Makefile.am | 1 + configure.ac | 12 -------- dbus-bus-introspect.xml | 77 +++++++++++++++++++++++++++++++++++++++++++++++ tools/Makefile.am | 15 ++------- 4 files changed, 81 insertions(+), 24 deletions(-) commit 9cefa4bae8d20beddf695380af00945790da0206 Merge: 5e5a1c1 15f4533 Author: Simon McVittie Date: 2009-11-25 14:55:32 +0000 Merge remote branch 'upstream/master' commit 15f4533742ad6aeab85ebb723ac8fca99c00e939 Author: Will Thompson Date: 2009-11-16 13:32:40 +0000 Don't leak DBusGMethodInvocation for no-reply calls https://bugs.freedesktop.org/show_bug.cgi?id=25119 dbus/dbus-gobject.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) commit 5e5a1c1930173dac0e331c2cb78a164c3565b0eb Merge: 2a4396b 90e2199 Author: Simon McVittie Date: 2009-09-29 14:22:07 +0100 Merge remote branch 'wjt/duplicate-registrations' Signed-off-by: Simon McVittie commit 2a4396b523912c3bf4d2a1ef6d6fa930c0871c67 Merge: 980b468 e2007cf Author: Simon McVittie Date: 2009-09-29 14:07:11 +0100 Merge branch '20936-fsf-address' Reviewed-by: Colin Walters commit 980b46870aa0e44a04ad1191d7af1d0601577501 Author: Stian Skjelstad Date: 2009-09-18 14:01:00 -0400 Bug 19623 - Add dbus_g_bus_get_private Useful for cases where you have to get a private connection, among them to work around threading issues. Signed-off-by: Colin Walters dbus/dbus-glib.h | 3 +++ dbus/dbus-gmain.c | 41 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+) commit 90e2199ac99f5b8ab0cd5f45dcb398ecf9af03d9 Author: Will Thompson Date: 2009-09-12 11:58:22 +0100 Copy object registration list when unregistering. Since the list of registrations on the object is modified when each path is removed, iterating it directly is wrong: after the first pass of the loop, 'iter' would point to a link which has been freed. dbus/dbus-gobject.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) commit 39e2642e41b2293de7556fa15c57872f78ffcdc8 Author: Will Thompson Date: 2009-09-12 11:28:25 +0100 Only re-set registration list if it's non-empty dbus/dbus-gobject.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) commit 0263b72669de710e0adda419a520ae9f123a1be9 Author: Colin Walters Date: 2009-08-19 13:27:53 -0400 Support duplicate object registrations Before commit e869fda4, we semi-supported registering the same object multiple times. We'd accept messages for both paths, however when signals were emitted, they'd both use the first object path. That commit simply disallowed multiple registrations, which broke backwards compatibility with some projects like PolicyKit which had the same object registered with different paths. With this commit, explicitly allow and support multiple registrations. The primary change is that signals are now emitted once for each registration path of an object, using the correct path. dbus/dbus-gobject.c | 159 ++++++++++++++++++++++++++++------------- test/core/test-dbus-glib.c | 41 +++++++++++ test/core/test-service-glib.c | 4 ++ 3 files changed, 154 insertions(+), 50 deletions(-) commit c993494ad463ffe55b8603e58aa5ecb6dd731144 Author: Colin Walters Date: 2009-07-16 14:09:18 -0400 Release 0.82 configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 65e03ccf0f2417a83fd187035b80d680e376fd32 Author: Colin Walters Date: 2009-07-16 13:51:57 -0400 Test for git-log in Makefile.am should just be for git now The combined tools are no longer in $PATH for modern git. Makefile.am | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) commit f5edb761202d3aff8f8bd0bc68dd57d3d32d2bd1 Author: Alban Crequy Date: 2009-07-16 13:39:08 -0400 Bug 18294 - Be defensive about a possibly NULL property string As far as I can tell we should always be writing one, but it doesn't hurt to guard against NULL here. Signed-off-by: Colin Walters dbus/dbus-gobject.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 2508e687e7d7792a656c7af0aad1be851faa33bb Author: Brian Cameron Date: 2009-07-16 13:15:38 -0400 Bug 20343 - Add a man page for dbus-binding-tool Signed-off-by: Colin Walters doc/Makefile.am | 6 +- doc/dbus-binding-tool.1 | 294 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 299 insertions(+), 1 deletion(-) commit 29513843b22dbd2aba1d3ba2930bb38e2c6631e5 Author: Marc-André Lureau Date: 2009-05-09 18:13:49 +0300 build: fix undefined macro: AM_PROG_LIBTOOL with recent libtool Without this patch, I get: configure.ac:206: warning: macro `AM_PROG_LIBTOOL' not found in library configure.ac:213: error: possibly undefined macro: AM_PROG_LIBTOOL If this token and others are legitimate, please use m4_pattern_allow. See the Autoconf documentation. autoreconf2.50: /usr/bin/autoconf failed with exit status: 1 (I am using libltdl-dev 2.2.6a-4 from Debian) Makefile.am | 1 + autogen.sh | 1 + 2 files changed, 2 insertions(+) commit d66337bdf9fc8f5372d84b05ae68c818bb9c881b Author: Luis Menina Date: 2009-07-16 10:55:39 -0400 Bugg 22244 - Only include , not individual headers Signed-off-by: Colin Walters dbus/dbus-glib-tool.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 67c289a60a4ac2ee9660f38a7168a238c1b3cffb Author: Colin Walters Date: 2009-07-15 15:33:31 -0400 Clean up some compilation warnings dbus/dbus-gloader-expat.c | 6 +++--- dbus/dbus-gobject.c | 4 ++-- test/core/test-dbus-glib.c | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) commit 5eea6af0d24780109dbbc15b8bfa4078df3a80a2 Author: Colin Walters Date: 2009-07-15 15:28:06 -0400 Add missing prototype for dbus_g_connection_unregister_g_object The function was introduced in commit b4911558384de and intended to be public, make it so. dbus/dbus-glib.h | 2 ++ 1 file changed, 2 insertions(+) commit de68d2b2fc3012ae733212a704aa29a748f22f80 Author: Brian Tarricone Date: 2009-07-15 15:03:36 -0400 Bug 21753 - Correctly initialize GValues in dbus-binding-tool generated code GValues should have their type set to 0. Signed-off-by: Colin Walters dbus/dbus-binding-tool-glib.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) commit af07e13e6afe09456588ddba4b72cba215bc7c93 Author: Jason Leach Date: 2009-07-01 15:41:04 -0400 Bug 21362 - Remove use of deprecated symbols The _set*_take_ownership are replaced by _take, and use g_main_loop_run. dbus/dbus-binding-tool-glib.c | 6 +++--- dbus/dbus-gvalue-utils.c | 14 +++++++------- dbus/dbus-gvalue.c | 16 ++++++++-------- m4/gtk-doc.m4 | 2 +- test/core/test-dbus-glib.c | 2 +- test/core/test-thread-client.c | 2 +- test/core/test-thread-server.c | 2 +- 7 files changed, 22 insertions(+), 22 deletions(-) commit e2007cfc5822f057b975660bd369fee56a7f2eb6 Author: Simon McVittie Date: 2009-06-09 16:22:46 +0100 fd.o #20936: Fix another couple of instances of the old FSF address `git grep 'Temple Place'` now returns nothing. dbus/dbus-bash-completion-helper.c | 2 +- dbus/dbus-gtool-test.h | 2 +- dbus/dbus-gtype-specialized-priv.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) commit cbe5250e553112221e1230301767ad1052790b0a Author: Tobias Mueller Date: 2009-04-15 21:37:05 +0100 fd.o #20936: Update FSF address The glib bindings contain an outdated address of the FSF: Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 The new address is: http://www.fsf.org/about/contact.html writes: > Free Software Foundation > 51 Franklin Street, Fifth Floor > Boston, MA 02110-1301 > USA Signed-off-by: Simon McVittie COPYING | 4 ++-- dbus/dbus-binding-tool-glib.c | 2 +- dbus/dbus-binding-tool-glib.h | 2 +- dbus/dbus-gidl.c | 2 +- dbus/dbus-gidl.h | 2 +- dbus/dbus-glib-lowlevel.h | 2 +- dbus/dbus-glib-tool.c | 2 +- dbus/dbus-glib-tool.h | 2 +- dbus/dbus-glib.c | 2 +- dbus/dbus-glib.h | 2 +- dbus/dbus-gloader-expat.c | 2 +- dbus/dbus-gmain.c | 2 +- dbus/dbus-gobject.c | 2 +- dbus/dbus-gobject.h | 2 +- dbus/dbus-gparser.c | 2 +- dbus/dbus-gparser.h | 2 +- dbus/dbus-gproxy.c | 2 +- dbus/dbus-gsignature.c | 2 +- dbus/dbus-gtest-main.c | 2 +- dbus/dbus-gtest.c | 2 +- dbus/dbus-gtest.h | 2 +- dbus/dbus-gthread.c | 2 +- dbus/dbus-gtype-specialized.c | 2 +- dbus/dbus-gtype-specialized.h | 2 +- dbus/dbus-gutils.c | 2 +- dbus/dbus-gutils.h | 2 +- dbus/dbus-gvalue-utils.c | 2 +- dbus/dbus-gvalue-utils.h | 2 +- dbus/dbus-gvalue.c | 2 +- test/core/test-profile.c | 2 +- test/decode-gcov.c | 2 +- 31 files changed, 32 insertions(+), 32 deletions(-) commit 499beb64a12cead99ccb09d7de01890aaa800ef2 Author: Simon McVittie Date: 2008-11-28 16:04:57 +0000 Bug 14579: remove pending call from hash table before cancelling it Previously, the code implicitly assumed that cancelling the pending call would not cause the DBusGProxy to be freed. This can fail if user_data for the pending call holds the last reference to the DBusGProxy - in this case, it is unsafe to be manipulating the contents of "priv" after the call is cancelled. dbus/dbus-gproxy.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) commit b615918eef9723c00f03d30903181d9989dfd261 Merge: cb8a113 f550c49 Author: Simon McVittie Date: 2009-06-09 16:15:49 +0100 Merge branch '13908-autoinit' Signed-off-by: Simon McVittie Reviewed-by: Colin Walters Bug: http://bugs.freedesktop.org/show_bug.cgi?id=13908 commit f550c492a10922795099166db34d8ccf5dbe63a7 Author: Simon McVittie Date: 2009-05-28 18:21:27 +0100 fd.o #13908: silently initialize specialized types whenever required Colin Walters asks: "Is there a reason not to just do the initialization at the time someone calls one of the public API entry points that depends on it?". This turns out to be non-trivial because those public API entry points are themselves used inside the initialization. dbus/Makefile.am | 1 + dbus/dbus-gtype-specialized-priv.h | 48 +++++++++++++++++++++++++++ dbus/dbus-gtype-specialized.c | 64 ++++++++++++++++++++++++++---------- dbus/dbus-gvalue-utils.c | 11 ++++--- 4 files changed, 101 insertions(+), 23 deletions(-) commit cb8a113be8808fe2c88d3e7851e79115235f9e8c Merge: 0d64d31 725e98f Author: Simon McVittie Date: 2009-05-28 18:04:20 +0100 Merge branch '20716-with-dbus-binding-tool' Signed-off-by: Simon McVittie Bug: https://bugs.freedesktop.org/show_bug.cgi?id=20716 Reviewed-by: Colin Walters commit 0d64d318397da26f224abd2d7ef1f27d14a544fa Merge: 48abffb b93c2a1 Author: Simon McVittie Date: 2009-05-28 18:02:44 +0100 Merge branch '5688-survive-disconnection' This is unsuitable for cherry-picking by distros, since it adds API. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=21219 Reviewed-by: Colin Walters commit 48abffba4cd81c182901dd7c80987251ba05348e Merge: 9a0c188 e869fda Author: Simon McVittie Date: 2009-05-28 18:01:54 +0100 Merge part of branch '5688-survive-disconnection' Bug: https://bugs.freedesktop.org/show_bug.cgi?id=5688 Reviewed-by: Colin Walters commit 9a0c188e2662809950738e92b963e5602dfbd8eb Merge: 03de444 98087a3 Author: Simon McVittie Date: 2009-05-07 15:33:15 +0100 Merge branch '16776-make-dbus-errors-throwable' Reviewed-by: Colin Walters commit 03de44461132ed610c3d52133d4b4760f20e4cb2 Merge: b6b3787 f363811 Author: Simon McVittie Date: 2009-04-27 10:47:58 +0100 Merge branch '20884-proxy-manager-replace-name-owner' Reviewed-by: Colin Walters commit b6b37871960ee06d9cc589e031ec3d5d6a4a6b92 Merge: e11c0ac d275c2e Author: Simon McVittie Date: 2009-04-16 19:25:02 +0100 Merge branch '20886-configure-cleanup' Reviewed by Colin Walters, fd.o #20886. commit e11c0aced3b00733766207f15876fb300d63d442 Author: Colin Walters Date: 2009-02-25 11:27:57 -0500 Bug 19927 - Use const for GError * param we're not modifying This makes it clearer we're not taking ownership of the error, and interoperates more nicely with functions which provide const GError *. dbus/dbus-glib.h | 2 +- dbus/dbus-gobject.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) commit a809ea3016a0eae166df13c757f3e917dea0c0f9 Author: Vincent Untz Date: 2009-04-16 12:35:42 -0400 Bug 20879 - Use --skip-source argument for glib-genmarshal This avoids adding debug information for the temporary file. Signed-off-by: Colin Walters dbus/dbus-binding-tool-glib.c | 1 + 1 file changed, 1 insertion(+) commit b93c2a19f468930c6badf054f79597d99d86e76c Author: Simon McVittie Date: 2009-04-16 12:59:10 +0100 fd.o #21219: regression test test/core/Makefile.am | 22 ++++++++++++++- test/core/run-test.sh | 1 + test/core/unregister.c | 71 ++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 93 insertions(+), 1 deletion(-) commit e869fda44331e6f590f974ad779115a22f5af22e Author: Simon McVittie Date: 2009-04-16 12:57:43 +0100 dbus-gobject: save the ObjectRegistration on each object, not just the path dbus/dbus-gobject.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) commit b4911558384de9919a231c29d75d9560f81fad0a Author: Simon McVittie Date: 2009-04-16 12:58:32 +0100 fd.o #21219: implement unregistration of objects dbus/dbus-gobject.c | 25 ++++++++++++++++++++++++- doc/reference/dbus-glib-sections.txt | 1 + 2 files changed, 25 insertions(+), 1 deletion(-) commit e42535c3c0dace3ede96c50f5a9b3cc315c80190 Author: Simon McVittie Date: 2009-04-16 12:11:15 +0100 fd.o #5688: Add a regression test Also assert that dbus_g_connection_lookup_g_object works (my previous attempt to fix #5688 broke this). test/core/5688.c | 81 +++++++++++++++++++++++++++++++++++++++++++++++++ test/core/Makefile.am | 13 +++++++- test/core/run-test.sh | 1 + 3 files changed, 94 insertions(+), 1 deletion(-) commit 6de1441865da2816c6bcd8cae842be93a8a96304 Author: Simon McVittie Date: 2009-04-16 12:06:26 +0100 fd.o #5688: don't assert when exported object is destroyed *after* D-Bus connection closes My solution was to introduce an ObjectRegistration struct which encapsulates the D-Bus <-> GObject glue. Also, warn and keep the first object path if the library user registers an object at two object paths (previously, this would fail silently, use the second object path, and leak memory). dbus/dbus-gobject.c | 111 ++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 88 insertions(+), 23 deletions(-) commit 725e98ffa810d04baf38e5d5d3f62091334b0888 Author: Peter Korsgaard Date: 2009-04-15 21:29:09 +0100 add --with-dbus-binding-tool option to use an external dbus-binding-tool Cross compilation fix. dbus-binding-tool needs to run on the host, but gets compiled for the target. Add an option to use an external program (host version) instead, similar to the --with-introspect-xml option. Signed-off-by: Peter Korsgaard Signed-off-by: Robert Schwebel configure.ac | 5 +++++ dbus/examples/Makefile.am | 4 ++-- dbus/examples/statemachine/Makefile.am | 4 ++-- test/core/Makefile.am | 6 +++--- test/interfaces/Makefile.am | 12 ++++++------ tools/Makefile.am | 2 +- 6 files changed, 19 insertions(+), 14 deletions(-) commit a0124a5ecc829b73e2293cd7b23bf0cf0eb0a87c Author: Simon McVittie Date: 2009-03-26 18:06:53 +0000 dbus_g_type_specialized_init: make some effort at being thread-safe dbus-glib isn't really thread-safe and needs a systematic audit, but let's at least be preemptively thread-safe in new code. Signed-off-by: Simon McVittie dbus/dbus-gtype-specialized.c | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) commit f36381131b6f410333a9a823a4fc131ac799394f Author: Simon McVittie Date: 2009-03-26 18:00:16 +0000 fd.o#20884: dbus_g_proxy_manager_replace_name_owner: don't leave freed memory in the hash table if the name was the owner's first Here's a situation where this code would fail: * an owner :1.42 owns a name com.Example and a name org.Example * the owner_names hash table contains { :1.42 => c }, where c is a GSList link with data = "com.Example", next = o and o is a GSList link with data = "org.Example", next = NULL * the name owner for com.Example changes so :1.42 no longer owns the name * initially, names == c * g_slist_delete_link unlinks and frees c, and sets names = o * but c is still in the hash table, so next time we look in the hash table, we crash The fix is to replace c with o in the owner_names hash table. dbus/dbus-gproxy.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) commit d275c2e646f67a3929d9290c6bdb270d6346b83c Author: Simon McVittie Date: 2008-11-28 17:14:47 +0000 Remove all sorts of libdbus cruft from configure.ac configure.ac | 102 ------------------------------------------------------ test/Makefile.am | 1 - 2 files changed, 103 deletions(-) commit 6791d09f72a63dcb72d57a187210bc133f463fcf Author: Simon McVittie Date: 2008-11-28 17:07:06 +0000 Don't check for atomic integer ops GLib has perfectly good ones, and `git grep ATOMIC` confirms that we no longer use the result of the check configure.ac | 26 -------------------------- 1 file changed, 26 deletions(-) commit 6de33eb0a3e53d92e47a717849f144a0a313e923 Author: Simon McVittie Date: 2008-11-28 17:06:29 +0000 Don't check whether va_copy works `git grep DBUS_VA_COPY` confirms that we no longer care configure.ac | 75 ---------------------------------------------------------- 1 file changed, 75 deletions(-) commit 7bf91463598fc1e6ad44096f33aa4b61bf58443f Author: Simon McVittie Date: 2008-11-28 17:04:09 +0000 configure.ac: Don't check endianness `git grep ENDIAN` confirms that we no longer need it. configure.ac | 3 --- 1 file changed, 3 deletions(-) commit dc93d2a6eaf75bd783d16d90f62d8abefd4e26a4 Author: Simon McVittie Date: 2008-11-28 17:01:32 +0000 Don't define DBUS_API_SUBJECT_TO_CHANGE It isn't, and we need libdbus >= 1.1 in any case configure.ac | 2 -- 1 file changed, 2 deletions(-) commit 094f45d0097679e8d458431231bcb3c999568d60 Author: Simon McVittie Date: 2008-11-28 17:00:06 +0000 configure.ac: don't check the sizes of integers This is presumably a relic of libdbus. configure.ac | 105 ---------------------------------------------------------- 1 file changed, 105 deletions(-) commit d30b06afd0a8bb6dddeefd7ac4d978799df03a52 Author: Simon McVittie Date: 2008-11-28 16:58:37 +0000 Remove CXX cruft from configure.ac There is no C++ in this package, so why are we checking for a C++ compiler? configure.ac | 3 --- 1 file changed, 3 deletions(-) commit 98087a3d62523b621a1bd2359661ffe24553c34e Author: Simon McVittie Date: 2008-11-28 17:22:59 +0000 Bug #16776: add a regression test test/core/my-object.c | 11 +++++++++++ test/core/my-object.h | 1 + test/core/test-dbus-glib.c | 13 +++++++++++++ test/core/test-service-glib.xml | 3 +++ 4 files changed, 28 insertions(+) commit 20c474b8b8b356836e50af0e9bf3b32584d83ac4 Author: Simon McVittie Date: 2008-11-28 16:23:43 +0000 Bug 16776: teach dbus_g_method_return_error about DBUS_GERROR Code called by dbus_g_method_return_error assumes that errors in the domain DBUS_GERROR always have the code DBUS_GERROR_REMOTE_EXCEPTION. This is clearly not true, and it would be nice to be able to raise the "well-known" D-Bus errors from library user code. dbus/dbus-gobject.c | 69 ++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 66 insertions(+), 3 deletions(-) commit e18f5dd13c562333bc580f3b5bdf3ecd8d7555ce Author: Mikkel Kamstrup Erlandsen Date: 2008-11-28 15:58:43 +0000 Bug 13908: make dbus_g_type_specialized_init() safe for library users to call dbus/dbus-gtype-specialized.c | 6 ++++++ dbus/dbus-gvalue.c | 1 - 2 files changed, 6 insertions(+), 1 deletion(-) commit bc474819fa638a0daf3c89e6d041949b73e9228e Author: Sjoerd Simons Date: 2009-03-17 11:21:56 +0000 Use g_strdup instead of strdup in dbus_g_method_get_sender dbus/dbus-gobject.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) commit dfef72c61c050e7f57e1d2eb601701e0a27827cc Author: Colin Walters Date: 2009-02-05 11:17:15 -0500 Bug 14183 - Listen to NameOwnerChanged using arg0 matching This is more efficient - we avoid waking up every dbus-glib using process when a process joins or leaves the bus. dbus/dbus-gproxy.c | 57 ++++++++++++++++++++++++++-------------------------- 1 file changed, 29 insertions(+), 28 deletions(-) commit 42b17678dec6d0100bcbc433441f6a75df747e5c Author: Colin Walters Date: 2009-02-05 10:59:15 -0500 Use -fno-strict-aliasing by default We're unlikely to be strict-aliasing safe anytime soon. This change corresponds with http://bugs.freedesktop.org/show_bug.cgi?id=10599 configure.ac | 8 ++++++++ 1 file changed, 8 insertions(+) commit 56b9773dc5dd589638e22f48ec4222ae491c2bc1 Author: Frederic Crozat Date: 2009-02-03 14:00:50 +0100 Fix format-security warning dbus/dbus-gobject.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 300b4fd822b8f57802ca35f4c867464b881632e3 Author: Colin Walters Date: 2009-02-02 19:40:51 -0500 Bump configure for unstable cycle configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 49cad2ca523de6a85f12d22ade23046c548ea601 Author: Colin Walters Date: 2009-02-02 19:40:29 -0500 Release 0.80 configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit b161082148a51f2a2d8a4ee85f5736791dedc276 Author: Colin Walters Date: 2009-02-02 15:07:51 -0500 Bug 19065 - handle nested nodes in dbus-binding-tool Patch modified from one provided by Stian Skelstad . Split the generate_glue function explicitly into a toplevel function and one for processing recursive nodes. dbus/dbus-binding-tool-glib.c | 108 ++++++++++++++++++++++----------------- m4/gtk-doc.m4 | 2 +- test/Makefile.am | 5 ++ test/core/Makefile.am | 6 +-- test/data/nested-introspect.xml | 10 ++++ test/test-compile-nested.sh | 5 ++ 6 files changed, 85 insertions(+), 51 deletions(-) commit 64ec55f59a9ebe699e240c2a3b4d82e85f2db4a0 Author: Doug Goldstein Date: 2009-01-30 17:38:19 -0500 Bug 19325 - parallel build fix Signed-off-by: Colin Walters dbus/Makefile.am | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) commit 299460549e92665e5ea09d459d3985fc85d8d73c Author: Colin Walters Date: 2009-01-30 16:03:11 -0500 Bug 19259: Always use /etc/bash_completion.d This looks like what bash upstream has standardized on. dbus/Makefile.am | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 78eb504bd9954918c363f357d0ab71ca85e3fc23 Author: Colin Walters Date: 2009-01-27 18:59:01 -0500 Bug 19647: Move test-types inside run-test to avoid dep on existing session bus All tests that use DBUS_BUS_SESSION should be in run-test.sh to avoid introducing a dependency on an existing session bus. test/core/Makefile.am | 2 +- test/core/run-test.sh | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) commit 3d25c1640d59e9770c33fafb1a12766feb6494e8 Merge: d92a441 8868486 Author: Colin Walters Date: 2009-01-27 18:43:50 -0500 Merge branch 'master' of ssh://walters@git.freedesktop.org/git/dbus/dbus-glib commit d92a44109e3fdc766e34b53f7ec5329e98e13909 Author: Colin Walters Date: 2009-01-27 17:00:37 -0500 Bug 19441: Don't send replies for messages explicitly not requesting one In sending a reply when a message has the dbus_message_set_no_reply flag set, we can cause spurious denials logged on the system bus, aside from being inefficient. dbus/dbus-gobject.c | 67 ++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 47 insertions(+), 20 deletions(-) commit 88684866d06df99f89b30a07e4809369b4cb0453 Author: Colin Walters Date: 2008-12-19 11:18:26 -0500 Add new files missed from last commit test/core/my-object-subclass.c | 115 ++++++++++++++++++++++++++++++ test/core/my-object-subclass.h | 33 +++++++++ test/core/test-service-glib-subclass.xml | 8 +++ 3 files changed, 156 insertions(+) commit d55ffa5bbccd027caf7f2e7376b555e397a7ac3c Author: Dan Williams Date: 2008-12-18 13:09:33 -0500 Bug 19145: test cases for GetAll Add test cases for GetAll. Signed-off-by: Colin Walters test/core/Makefile.am | 11 ++- test/core/test-dbus-glib.c | 187 +++++++++++++++++++++++++++++++++++++++ test/core/test-service-glib.c | 7 ++ test/core/test-service-glib.xml | 2 + 4 files changed, 205 insertions(+), 2 deletions(-) commit 94d68f00d9d244de3b1d66d3cf78bb5171552311 Author: Tambet Ingo Date: 2008-12-18 12:09:43 +0200 Use the provided interface for org.freedesktop.DBus.Properties.GetAll call. dbus/dbus-gobject.c | 82 ++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 68 insertions(+), 14 deletions(-) commit 1b150c32aa574b421161b63bb01eeeb5ad23bf3a Author: Frederic Crozat Date: 2008-12-05 11:16:46 -0500 Fix linking order so -Wl,--as-needed works Signed-off-by: Colin Walters dbus/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit f4a6c4755d7a82bb7ec0a8bf472bfe091c310ef0 Author: Colin Walters Date: 2008-12-04 16:12:18 -0500 Do NEWS for 0.78 Should have been in earlier commit, oops. NEWS | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) commit 3a713710a34d75d174eb632a6444e87dbf3923f4 Author: Colin Walters Date: 2008-12-04 16:02:12 -0500 Bump configure for unstable cycle configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit beaff4e7c8e6ef601a00c03a4bed533becd273be Author: Colin Walters Date: 2008-12-04 15:58:30 -0500 Release 0.78. configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit d77506652b555b147e79889d6163208535e1cd74 Author: Colin Walters Date: 2008-12-04 15:58:12 -0500 Clean bash completion file dbus/Makefile.am | 1 + 1 file changed, 1 insertion(+) commit 6ba71576f4417bab46ca666fa44dda52dee95e88 Author: David Zeuthen Date: 2008-07-31 12:28:07 -0400 add bash completion for dbus-send(1) For now, it's in dbus-glib since dbus doesn't have an introspection XML parser (yet). Signed-off-by: Colin Walters configure.ac | 13 + dbus/Makefile.am | 17 +- dbus/dbus-bash-completion-helper.c | 513 ++++++++++++++++++++++++++++++++++++ dbus/dbus-bash-completion.sh.in | 21 ++ 4 files changed, 563 insertions(+), 1 deletion(-) commit 48738e529dc7a0f27d185f2e79174b0e369fd0af Author: Tomas Pelka Date: 2008-12-04 15:46:31 -0500 Bug 18497 - Correct type in test case Changing to INT32 matches the sending side. Signed-off-by: Colin Walters test/core/test-thread-server.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit aebec4bd82c023502600786793ba0ce0c7323fbe Author: Colin Walters Date: 2008-12-04 15:42:08 -0500 Bug 18698 - Use AC_SEARCH_LIBS to avoid unneeded dep on nsl Also changed the socket search to be the same way. configure.ac | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit f10ee141185f9501c852acaf557b100abafc60fb Author: Nick Welch Date: 2008-12-04 15:28:45 -0500 Typo fix in docs Signed-off-by: Colin Walters dbus/dbus-gobject.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit c0bba240c4beb6ecfd71aefa184011e8adc27f5f Author: Robert McQueen Date: 2008-09-23 23:42:02 +0300 Bug #17329: allow hash tables to contain complex types Previously, dbus-glib has provided destroy functions for the keys and values when constructing hash tables, so that any hash tables it constructed could be entirely freed (along with their contents) by destroying/unreffing. Unfortunately this meant that any "complex" types, where you need to know the GType in order to free them, were not allowed in hash tables. In real terms, this was anything which dbus-glib marshalled to a GPtrArray, so any array of arrays, variants, structures, object paths, or other boxed types were not allowed as hash values. This patch allows a broader range of types to be used as the values in hash tables, including those where no simple free function is available. Instead of relying on the key/value destroy functions, the new hash_free function uses g_hash_table_foreach_steal to remove the keys and values pairwise and free them when the type is known. Unfortunately, it's part of the API assumptions that hash tables which were produced through the current API had valid free functions, and particularly that if the hash table was reffed by the application, that the keys/values would persist beyond when dbus-glib had unreffed it, and be freed when the hash table was later destroyed. So it's not sufficient to use only this new freeing method on all hash tables from now on - we have to behave in the old way for all of the previously allowable types (including any hash tables which contain any hash tables which were freeable in the old way). However, as these new hash tables contain values which will not be freed if you manipulate the hash table directly (removing or replacing keys, or destroying or unreffing it directly), and g_boxed_free should be used instead, a false free function is provided to print a critical warning for the developer in the case that memory would be leaked. dbus/dbus-gvalue-utils.c | 151 +++++++++++++++++++++++++++++++++++++-- test/core/test-dbus-glib.c | 37 ++++++---- test/core/test-service-glib.xml | 4 +- 3 files changed, 168 insertions(+), 24 deletions(-) commit 143b09b42d73451dcc3b835f76f8d43da786342a Author: Robert McQueen Date: 2008-09-22 21:40:48 +0100 Bug #17798: add support for 'o', 'g' and 'as' in dictionaries This teaches the parameterised hash table about how to hash, compare and free object paths and signatures, allowing them to be used as hash keys and values, and also how to free strvs, so they can be used as values. Adds some simple test methods which echo a{gas} and a{oas} dictionaries back immediately and compare the results. dbus/dbus-gvalue-utils.c | 29 ++++++++++++ test/core/my-object.c | 16 +++++++ test/core/my-object.h | 4 ++ test/core/test-dbus-glib.c | 96 +++++++++++++++++++++++++++++++++++++++ test/core/test-service-glib.xml | 12 +++++ 5 files changed, 157 insertions(+) commit e4c917189dc9478c261c94703b311e1579292f22 Author: Robert McQueen Date: 2008-09-14 21:16:10 +0100 Bug #17797: add support for 'g' type, as a boxed char * Adds DBUS_G_TYPE_SIGNATURE, which is a boxed type just like DBUS_G_TYPE_OBJECT_PATH. dbus/dbus-binding-tool-glib.c | 4 ++ dbus/dbus-glib.h | 3 ++ dbus/dbus-gmain.c | 5 ++- dbus/dbus-gsignature.c | 2 + dbus/dbus-gvalue.c | 82 ++++++++++++++++++++++++++++++++++++++- test/core/my-object.c | 7 ++++ test/core/my-object.h | 1 + test/core/test-dbus-glib.c | 19 +++++++++ test/core/test-service-glib.xml | 5 +++ 9 files changed, 126 insertions(+), 2 deletions(-) commit f89b8de02f21891f430a2e370c391238b575403a Author: Robert McQueen Date: 2008-09-23 23:45:14 +0300 Bug #17795: depend on Glib 2.10 for hash unref consistency Commit a8bf32 (for bug #11396) introduced a compile-time version check for Glib 2.10 which changed whether hash_simple_free called g_hash_table_unref or g_hash_table_destroy. This is at best useless for people who actually wanted to rely on _unref being used instead of _destroy, because dbus-glib can legitimately be built against older versions of Glib than that in use by the application itself, and at worst harmful as applications relying on the _unref semantics would have their assumptions violated on platforms where this was the case. Given in /most/ cases now, Glib 2.10 is readily available, and we were in this kinda vague state where people could've used _unref and gotten away with it, I'm going to say thats what our ABI is now, and stick to it. People can depend on the next version of dbus-glib if they rely on _unref. configure.ac | 2 +- dbus/dbus-gvalue-utils.c | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) commit 24b94fb83c0d22cf2803af692dd8ccbc485d890c Author: Robert McQueen Date: 2008-09-22 21:25:03 +0100 Bug #17794: make run-test.sh fail when die is called Missing die() function meant this wasn't returning non-zero even when tests were failing. Oops. test/core/run-test.sh | 6 ++++++ 1 file changed, 6 insertions(+) commit 3ca014ea6b55cd843f1c80b04a4e0ec41af6210e Author: Colin Walters Date: 2008-11-17 18:30:32 -0500 Bug 18573 - Fix race when service appears and disappears quickly We can't assert that a for_name_owner proxy is associated when we disassociate; if a service appears and disappears quickly, we won't be associated yet. So remove the assertion. Correspondingly we need to cancel any inflight GetNameOwner call when disassociating proxies to avoid leaking. dbus/dbus-gproxy.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) commit 0a883a523f8d133f71271276b755162c56480021 Author: Philip Van Hoof Date: 2008-09-18 18:22:59 -0400 Bug 17614: Use g_slice for allocating temporary async call data Using g_slice is going to be faster. Signed-off-by: Colin Walters dbus/dbus-binding-tool-glib.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) commit 4c7e60e3ff4148a181a496f85b491e8cb39d7e46 Author: Colin Walters Date: 2008-06-20 14:08:47 -0400 Bug 10373: Use of deprecated API (was used incorrectly) * dbus/dbus-gvalue.c: The use of dbus_message_iter_get_array_len here is incorrect; we don't want to allocate a number of pointers based on the length of the strings. Instead, we now use the regular GArray type which handles reallocating as size increases appropriately. dbus/dbus-gvalue.c | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) commit 2514b84b3644223653018cd75d0d6e1459a7ab70 Author: Colin Walters Date: 2008-06-19 12:47:16 -0400 Bug 16419: stack overflow demarshaling recursive variants * dbus/dbus-gvalue.h: Add a recursion_depth member. * dbus/dbus-gvalue.c: Keep track of recursion depth in _dbus_gvalue_demarshal, cut it off at a default (right now 32). * dbus/dbus-gobject.c: Initialize recursion depth. * dbus/dbus-gproxy.c: Ditto. * test/core/test-variant-recursion.c: Test the variant recursion case, make sure the remote site will throw an error. * test/core/Makefile.am: Add test-variant-recursion. dbus/dbus-gobject.c | 2 + dbus/dbus-gproxy.c | 2 + dbus/dbus-gvalue.c | 21 ++++++++- dbus/dbus-gvalue.h | 1 + test/core/Makefile.am | 6 ++- test/core/run-test.sh | 1 + test/core/test-variant-recursion.c | 89 ++++++++++++++++++++++++++++++++++++ 7 files changed, 119 insertions(+), 3 deletions(-) commit d1b80d803a0268bd4b3dd5b9a9522230461f2947 Author: Dan Williams Date: 2008-06-05 17:57:53 -0400 Bug 16114 [patch] wincaps-to-uscore property names for GetAll() * dbus/dbus-gobject.c: We need to uscore property names so that we actually find the right properties. dbus/dbus-gobject.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) commit 8054025ae498cc586676fd0ed6573828dd0de4a0 Author: Colin Walters Date: 2008-06-05 16:05:39 -0400 One final large HACKING update HACKING | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) commit d80bc7686a0e5cc7d45d940e8404ac4c8742b8f5 Author: Colin Walters Date: 2008-06-05 15:40:35 -0400 Pacify gtk-doc by adding new files * doc/reference/dbus-glib-undeclared.txt: * doc/reference/dbus-glib.types: New files without which gtk-doc complains. 0 files changed commit d91cf40b83f7900899fe89cc83a75c82cd4bf833 Author: Colin Walters Date: 2008-06-05 15:37:16 -0400 Another HACKING tweak HACKING | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) commit e4b73986d1b2d6f9badda4656e57023b2c921ff7 Author: Colin Walters Date: 2008-06-05 15:37:02 -0400 Bump for development configure.ac | 2 +- doc/reference/dbus-glib-undocumented.txt | 20 +++----------------- 2 files changed, 4 insertions(+), 18 deletions(-) commit 96f144d25c7f3d573684bd50f87d912990f3c589 Author: Colin Walters Date: 2008-06-05 15:09:02 -0400 Release 0.76 configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 1517f7f395527519402f8b37988de9d4ea24dbc5 Author: Colin Walters Date: 2008-06-05 15:08:40 -0400 Document release process HACKING | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) commit e0dcd92e33e566f9852df94036e74f48af795ea3 Author: Colin Walters Date: 2008-06-05 14:55:15 -0400 Update HACKING HACKING | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) commit 4f776e9db9f299dab96a12a00a6279b6977f6c32 Author: Colin Walters Date: 2008-06-05 14:48:18 -0400 Update gtk-doc doc/reference/dbus-glib-undocumented.txt | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) commit fa46dc8d35de877b8bdcb53f9508252249138bd6 Author: Colin Walters Date: 2008-06-05 14:40:09 -0400 Update NEWS NEWS | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) commit acd44d2ae3069667dbbb8b9c9c8b9c2afcad96d9 Author: Christian Persch Date: 2008-06-03 18:01:54 -0400 Bug 16217: generated bindings don't build with -DG_DISABLE_SINGLE_INCLUDES * dbus/dbus-binding-tool-glib.c: Only include glib.h because individual includes are disallowed. Signed-off-by: Colin Walters dbus/dbus-binding-tool-glib.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) commit 1744bf88024756d17f867ab9b86aca25e2b77e64 Author: Colin Walters Date: 2008-05-28 14:11:01 -0400 Remove GConnection tests that assert, since we abort on those test/core/test-types.c | 26 -------------------------- 1 file changed, 26 deletions(-) commit a94e11973467e1b2cc43ba1e77b7413655b1dff7 Author: Colin Walters Date: 2008-05-28 00:25:57 -0400 Bug 11671: Don't use well known name in /tmp This as a side effect fixes the test suite on Solaris. test/core/peer-client.c | 13 ++++++++++++- test/core/peer-server.c | 26 ++++++++++++++------------ test/core/run-peer-test.sh | 9 +++------ 3 files changed, 29 insertions(+), 19 deletions(-) commit dceee795d0cdc5889701064ac38d3c64451b02ec Author: Colin Walters Date: 2008-05-27 23:19:52 -0400 From OpenSUSE: Add return statement in case assertions not enabled dbus/dbus-gvalue-utils.c | 1 + 1 file changed, 1 insertion(+) commit 681f3ae573b2e00dad5c1193a044a994fc50cf38 Author: Colin Walters Date: 2008-05-27 23:08:59 -0400 Bug 13060: Remove NameOwnerChange matches on unref (Kimmo Hämäläinen) dbus/dbus-gproxy.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) commit eef148bdc0f602b0fba09a851c1ca6b55b8bb71c Author: Colin Walters Date: 2008-05-27 23:01:39 -0400 Bug 15733: Cosmetic fix for removing redundant declarations dbus/dbus-gtype-specialized.h | 2 -- 1 file changed, 2 deletions(-) commit d043342c41535e610268b9bb2a45143bad0b597d Author: Colin Walters Date: 2008-05-27 22:56:00 -0400 Bug 12505: Avoid receiving duplicate NameOwnerChanged (Dan Williams) dbus/dbus-gproxy.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) commit 43db9baa4cd0921d2ee830185ab46b4646b4e73b Author: Colin Walters Date: 2008-05-27 16:49:26 -0400 Bug 10834: Fix error handling path for dbus_g_proxy_end_call_internal This patch was based initial work by Peter Kjellerstedt. This patch made obvious the need to correctly handle type mismatches in demarshal_basic, similarly to what the other demarshalers are doing. Also add some tests for error handling. dbus/dbus-gproxy.c | 25 ++++++++++++++++++++----- dbus/dbus-gvalue.c | 28 ++++++++++++++++++++++++++++ test/core/test-dbus-glib.c | 29 +++++++++++++++++++++++++++++ 3 files changed, 77 insertions(+), 5 deletions(-) commit dc3bfd517a3bd0e28f4fc2d030ac38bdc848eb86 Author: Colin Walters Date: 2008-05-27 16:36:58 -0400 Fix some test suite memory leaks test/core/test-dbus-glib.c | 3 +++ 1 file changed, 3 insertions(+) commit 167ea555cf3a763d148a69d0af9453b83d70d107 Author: Julien Danjou Date: 2008-04-24 14:03:42 +0200 Fix typo in --help print strings Signed-off-by: Julien Danjou Signed-off-by: Colin Walters dbus/dbus-glib-tool.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit c057283a86230904552d5c51623bbce5ab0c9770 Author: Colin Walters Date: 2008-05-27 15:15:35 -0400 Bug 10244: Fix error handling case in parser (William Jon McCann) We need to return FALSE when handling an error. dbus/dbus-gparser.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) commit 361dc90eaa269325ddc5dae0003ca11e1d7b811e Author: Colin Walters Date: 2008-05-27 14:57:20 -0400 Bug 9867: Respect ACLOCAL_FLAGS (Kalle Vahlman) autogen.sh | 1 + 1 file changed, 1 insertion(+) commit a8bf32ab8b0e30e0c74e07c58e9bc79a448683b2 Author: Colin Walters Date: 2008-05-27 14:31:58 -0400 Bug 11396: Use g_hash_table_unref if available (Marco Barisione) This lets users ref hashes with g_hash_table_ref. dbus/dbus-gvalue-utils.c | 4 ++++ 1 file changed, 4 insertions(+) commit ad35bf13f93d18b0b0e8f930ff79af9dcc1c8508 Author: Colin Walters Date: 2008-05-27 14:18:49 -0400 Bug 12675: Handle disconnected connections in calls (Kimmo Hämäläinen) dbus/dbus-gproxy.c | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) commit f110cd3aa0532ab6cdfb1ee9a19f839700fe32e6 Author: Colin Walters Date: 2008-05-27 13:57:40 -0400 Bug 12857: Balance va_start/va_end in error case (Kimmo Hämäläinen) dbus/dbus-gparser.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) commit d20c90aab3b0eca8715deaa59877f35a7d4e345e Author: Colin Walters Date: 2008-05-27 13:54:11 -0400 Bug 12849: Fix use after free (Kimmo Hämäläinen) dbus/dbus-gvalue.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit fde77bff42fac9ed95869a69acff4f9daab23e04 Author: Colin Walters Date: 2008-05-27 13:35:20 -0400 Bug 16079: Return an error on unknown property https://bugs.freedesktop.org/show_bug.cgi?id=16079 Previously we just asserted, not very useful. dbus/dbus-gobject.c | 6 +++++ test/core/test-dbus-glib.c | 62 +++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 67 insertions(+), 1 deletion(-) commit b26f1887f6907d4c9a1dac013649f28950c6b2d3 Author: Colin Walters Date: 2008-05-27 13:34:55 -0400 Support for monitoring conversation during tests test/core/run-test.sh | 3 +++ 1 file changed, 3 insertions(+) commit b783ce802db01a5370ce70514755e1885f6e6eb1 Author: Colin Walters Date: 2008-05-27 12:39:44 -0400 Also make CRITICAL messages fatal in tests. test/core/test-dbus-glib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 8fe656de630e851bc512bbd7e7a6c18c53aecb61 Author: Simon McVittie Date: 2008-04-14 12:56:43 +0100 Freeze error ABI at the ABI used in Fedora 8 and Ubuntu gutsy. This avoids getting a different ABI depending on the version of libdbus we're compiled against. fd.o #15430, Debian #476080. dbus/dbus-glib.h | 34 ++++++++++++++++- dbus/dbus-gobject.c | 72 ++++++++++++++++++++++++++++++++++- dbus/make-dbus-glib-error-enum.sh | 25 +----------- dbus/make-dbus-glib-error-switch.sh | 29 +------------- 4 files changed, 106 insertions(+), 54 deletions(-) commit 7fccdc8386d97d8c7e963800b1fbedd47f72b66b Author: Colin Walters Date: 2008-03-31 11:23:29 -0400 Add some docs to dbus_set_g_error. dbus/dbus-gobject.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) commit 34042c4cf2fcf18e101d07e495f9fa5dda99aa58 Merge: df7c2b7 bd53ac9 Author: David Zeuthen Date: 2008-03-17 13:11:45 -0400 Merge branch 'master' of ssh://david@git.freedesktop.org/git/dbus/dbus-glib commit df7c2b783ed92f33a1bedcba12a9c30fc34ba8d5 Author: David Zeuthen Date: 2008-03-17 13:10:47 -0400 add some design advice to dbus_g_proxy_set_default_timeout() ... as requested on the mailing list. dbus/dbus-gproxy.c | 7 +++++++ 1 file changed, 7 insertions(+) commit bd53ac9f7ef9a6c2c9d1d12af382b1a8a10e9dba Author: Rob Taylor Date: 2008-03-17 15:10:43 +0100 allow namespaced extentions to introspection XML This allows us to stick namespaced documentation stuff into the introspection XML and have dbus-glib not puke on it. Patch credit goes to Colin Walters. dbus/dbus-glib-tool.c | 2 +- dbus/dbus-gparser.c | 40 +++++++++++++++++++++++++++++----------- 2 files changed, 30 insertions(+), 12 deletions(-) commit cb732d38f78dfb7c1ef73179e798fa4f42fd962e Author: Rob Taylor Date: 2008-03-17 14:26:50 +0100 bump version and dbus dependancy Bumps version to 0.75. Bumps dbus dependany to 1.1. configure.ac | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 09b0fc5818812d0167243bae9fd52cdaf67f0af0 Author: David Zeuthen Date: 2008-03-15 16:51:48 -0400 Export the recently added GetAll() method on org.fd.DBus.Properties Because round-trip city is a bad place. dbus/dbus-gobject.c | 220 +++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 177 insertions(+), 43 deletions(-) commit bf0c9b3d6adc95863d5b5a4ce6ca994fd7fdc137 Author: David Zeuthen Date: 2008-03-15 15:32:56 -0400 Add new function to specify the default timeout for a proxy Without a function like this the generated client glue code is unusable for D-Bus methods that take a long time to complete (such as disk operations like mkfs and partitioning). Also add some missing _with_timeout functions on DBusGProxy to the gtk docs. dbus/dbus-glib.h | 3 +++ dbus/dbus-gproxy.c | 35 ++++++++++++++++++++++++++++-- doc/reference/dbus-glib-sections.txt | 3 +++ doc/reference/dbus-glib-undocumented.txt | 15 +++++++++---- 4 files changed, 50 insertions(+), 6 deletions(-) commit 1fa4129f67208e24f6ae5f9ab38a3ee26c521f87 Author: David Zeuthen Date: 2008-03-15 15:21:06 -0400 Bump version to 0.75 configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 1124256e1a87291101a6c287c1248c2f7276b993 Author: Ross Burton Date: 2008-02-27 14:27:49 +0000 Fix incorrect assign in test suite We were assigning a DBusConnection* to a DBusGConnection*, which is bad. test/core/test-types.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit eea8f7247e1cbeb8c00fe316a37520b98acd55dc Author: Ross Burton Date: 2008-02-27 14:22:16 +0000 Use dbus_watch_get_unix_fd not dbus_watch_get_fd The latter is deprecated, so don't use it. dbus/dbus-gmain.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 2cf62d7ff7d3a7bc450d0b60bb81a8365ffd310b Author: Ross Burton Date: 2008-02-27 14:19:48 +0000 Fix pending call cancelling in proxy dispose The dispose treated the hash values as DBusGProxyCall objects, but they are DBusPendingCall (thanks Dafyd Harries). dbus/dbus-gproxy.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) commit 8e024ae2252e6e948c28203f07aa416df3dac0b8 Author: Ross Burton Date: 2008-02-27 14:02:36 +0000 Unref the connection and message on dbus_g_return_error dbus/dbus-gobject.c | 3 +++ 1 file changed, 3 insertions(+) commit 98423ae4e6b85741ce15f097652620886a49c375 Author: Ross Burton Date: 2007-11-13 17:56:37 +0000 Allow daemondir to be configured (#10668) The daemon can be at any location, and may not be on the path. Fetch the path from the pkg-config file and use it if it is set. Thanks to Brian Cameron for this patch. configure.ac | 9 +++++++++ tools/Makefile.am | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) commit 33b7a7f05372baaaf95d0e1c2c3b758321e4b0c5 Author: Ross Burton Date: 2007-09-11 10:52:07 +0100 Update ignores Add the new tests and *~ to the ignore list. .gitignore | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) commit 4b2cf9d75f6c315071adc925ec56e3bac3423730 Author: Ross Burton Date: 2007-09-11 10:49:49 +0100 Fix bashism "function" is a bashism, so don't use it. tools/run-with-tmp-session-bus.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 3f6e2c0c76d3643a1823b5ea7c8f5486a6b448de Author: Ross Burton Date: 2007-09-11 10:37:47 +0100 Fix broken introspection XML When writing XML for properties a duplicate closing tag was written. (#8607, thanks William Jon McCann). dbus/dbus-gobject.c | 2 -- 1 file changed, 2 deletions(-) commit c08a7f910c4c746ba790375be2d0f0682471cf06 Author: Ross Burton Date: 2007-09-11 10:34:07 +0100 Fix build with non-gcc compilers AIX's compiler and some non-c99 compilers are braindead, massage the code to work with them (#11675, thanks Peter O'Gorman). dbus/dbus-gtype-specialized.c | 4 +++- dbus/examples/statemachine/statemachine.c | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) commit b2bcb0f3fdf8eaec9257f48dd0a0e2ca03220775 Author: Ross Burton Date: 2007-09-11 10:17:12 +0100 Fix bashisms The test suite used /bin/bash for no good reason, remove all bashisms. (#11672, thanks Peter O'Gorman). test/core/run-peer-test.sh | 4 ++-- test/core/run-test.sh | 18 +++++++++--------- test/interfaces/run-test.sh | 14 +++++++------- tools/run-with-tmp-session-bus.sh | 9 +++++---- 4 files changed, 23 insertions(+), 22 deletions(-) commit 377831cc8496bf2b3f96e96a44ff4dfc1a6c690e Author: Ross Burton Date: 2007-09-11 10:11:12 +0100 Fix build with Glib 2.6 configure.ac checks for glib 2.6, but the test suite used g_intern_static_string which was added in 2.10. This removes the use of that function because it isn't required (#11674, thanks Peter O'Gorman). test/interfaces/test-interfaces.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 2929a9d676b9961abff6c6acb1b67431f7d62ab1 Author: Rob Taylor Date: 2007-06-27 11:49:02 +0100 Update version in configure.ac Update version to 0.74 in configure.ac configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit de33a575aa58867642bcfd8bb8cb2efc631d9f1d Author: Rob Taylor Date: 2007-06-27 11:39:08 +0100 Update NEWS Update NEWS from git history. NEWS | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) commit a732cbc211b562660c5a17c898ad032fb8c041fd Author: Ross Burton Date: 2007-06-27 11:05:03 +0100 Sleep after starting the peer server, before starting the peer client. This fixes random failures due to the race. test/core/run-peer-test.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 4335b1204a483ffa5c5a72d58b585f77827d852d Author: Ross Burton Date: 2007-06-27 10:58:03 +0100 Update NEWS for pending release. NEWS | 12 ++++++++++++ 1 file changed, 12 insertions(+) commit 0d77d83b7afd5837d4427b7cdc5940f54625b65c Author: Rob Taylor Date: 2007-06-22 17:15:34 +0100 make test/core/run-peer-test.sh executable 0 files changed commit 0ba73bf7cf1a2770b7aac8d57e61e755aca45b4d Author: Ross Burton Date: 2007-06-22 15:46:37 +0100 Add missing include. test/core/Makefile.am | 1 + 1 file changed, 1 insertion(+) commit bf647c411b42064fe48877c30803cbe10d751204 Author: Ross Burton Date: 2007-06-22 15:45:57 +0100 Install the type info before creating signals This fixes the type system warnings from peer-server, because the types where used (when creating signals) before they were created. Installing type info initialises the types. test/core/my-object.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) commit a3a6efda1117633cc8a5525811f6a3ba41f2d31b Author: Ross Burton Date: 2007-06-22 15:28:48 +0100 Init threading first to stop a warning from new GLib. test/core/peer-client.c | 2 +- test/core/peer-server.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) commit 36ed523539074a84cd990a8513b5d02a6223c44c Author: Ross Burton Date: 2007-06-22 15:27:18 +0100 Make test script executable 0 files changed commit 514fd82183c214e3afd4cca630a20ff24b62e482 Author: Ross Burton Date: 2007-06-22 15:25:14 +0100 Remove unused variable. test/core/run-peer-test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit d428aa4edf426f662e89f2b08a377b0dd481f3ac Author: Ross Burton Date: 2007-06-22 15:15:37 +0100 Remove the XML documentation support in configure It isn't used and is legacy from when this was part of dbus itself. configure.ac | 34 +--------------------------------- 1 file changed, 1 insertion(+), 33 deletions(-) commit 1f385f6b10799cdd0bf57d69d5212ac16ac17266 Author: Ross Burton Date: 2007-06-22 15:02:24 +0100 Fix typo in _dbus_gvalue_signals_error (#10837) It was using g_value_get_boxed() when looking at a object-holding value. Thanks to Peter Kjellerstedt for noticing this. dbus/dbus-gvalue-utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 68f03928aaac849dd12e38c01e448b569f578976 Author: Ross Burton Date: 2007-06-22 14:41:36 +0100 Update GLib requirement (#10889). INSTALL | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 58cacc6872e1b8cf365ac056775498b9dede71b4 Author: Rob Taylor Date: 2007-04-16 08:23:17 -0700 Document dbus-gtype-specialized Documents all the functions in dbus-gtype-specialized.c and adds an overview of the functionality. dbus/dbus-gtype-specialized.c | 312 +++++++++++++++++++++++++++--- dbus/dbus-gtype-specialized.h | 14 +- doc/reference/dbus-glib-sections.txt | 2 +- doc/reference/dbus-glib-undocumented.txt | 38 +--- 4 files changed, 304 insertions(+), 62 deletions(-) commit 26d8584c04c05be29ae35acc3a2e8f573cc79206 Author: Ross Burton Date: 2007-03-30 18:12:11 +0100 Add simple test suite for peer objects. Add a simple test suite for peer proxies. This involved refactoring the MyObject class into its own file so that it can be used by multiple tools. Also added is a test suite for dbus_connection_get_g_connection. test/core/Makefile.am | 26 +- test/core/my-object.c | 737 ++++++++++++++++++++++++++++++++++++ test/core/my-object.h | 104 ++++++ test/core/peer-client.c | 127 +++++++ test/core/peer-server.c | 55 +++ test/core/run-peer-test.sh | 9 + test/core/test-service-glib.c | 832 +---------------------------------------- test/core/test-types.c | 74 ++++ 8 files changed, 1129 insertions(+), 835 deletions(-) commit af91f5e0e2b5a20adf124707356b12da0c2f1e00 Author: Ross Burton Date: 2007-03-30 18:05:40 +0100 Support peer-to-peer proxies. Previously DBus-GLib didn't support peer proxies despite having API for them. This patch stops dbus-glib from crashing when you use a peer signal (#10233). dbus/dbus-gproxy.c | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) commit 25f056826336d4385b5488706f0f1ecc0843bf2f Author: Ross Burton Date: 2007-03-30 17:54:58 +0100 Add dbus_connection_get_g_connection. Add dbus_connection_get_g_connection, which is useful when you have a DBusConnection which was originally a DBusGConnection, and want it back again. dbus/dbus-glib-lowlevel.h | 1 + dbus/dbus-glib.c | 24 ++++++++++++++++++++++++ dbus/dbus-gmain.c | 12 ++++++------ 3 files changed, 31 insertions(+), 6 deletions(-) commit 0c46ca1a20eb8ba676ea2f1e829d039d5e3c383d Author: Ross Burton Date: 2007-03-22 15:04:14 +0000 Stop compiler warnings (#10374). dbus/dbus-gthread.c | 1 + test/interfaces/test-server.c | 2 ++ 2 files changed, 3 insertions(+) commit 72e9f061668a28cbbeae2400290e1993c5d60d3c Author: Ross Burton Date: 2007-03-28 16:32:00 +0100 Fix error handling dbus/dbus-gproxy.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) commit 9ca04c94ed6ddc2ff7459ce2031740704ec67ff2 Author: Ross Burton Date: 2007-03-22 15:38:03 +0000 Handle dbus errors which are not name has no owner dbus/dbus-gproxy.c | 3 +++ 1 file changed, 3 insertions(+) commit 85b269cc7ca221ee4fe0235154e783b3640ee62d Author: Ross Burton Date: 2007-03-22 15:05:02 +0000 Update abstract socket test from dbus The abstract socket test doesn't cross compile at all, updating the test from the original copy in DBus. configure.ac | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) commit a64b26cdde04e624b2bb42ccadd3fc252bf05667 Author: Ross Burton Date: 2007-03-22 15:10:47 +0000 Rename the error quark. The error quark was copied from GLib, renaming it to be unique. dbus/dbus-glib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 5ca3418e8e00f62e3e60578e3951b51cd158f8dc Author: Rob Taylor Date: 2007-03-29 12:44:01 +0100 Update AUTHORS Correct spelling of S.Nallammai, add Ross Burton, who's been missing here for quite some time. AUTHORS | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit 7fbd3a1c49614e71a9ff2b3d6e43bf380527301b Author: Rob Taylor Date: 2007-03-29 12:32:46 +0100 Update AUTHORS I had failed to update AUTHORS in the last couple of releases, this commit makesit current. AUTHORS | 6 ++++++ 1 file changed, 6 insertions(+) commit f78b90659f32474b7ca56925ddebd88af7f06c86 Author: Rob Taylor Date: 2007-03-29 12:20:30 +0100 Update .gitignore Ignore autoconf errors, autom4te.cache, some new generated files. .gitignore | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) commit 138e4ce76ae53b86488e12c43db511a838be4fc9 Author: Rob Taylor Date: 2007-02-13 14:16:22 +0000 Do libtool versioning. As we're going to start behaving like a proper library, update libtool versionsing appropriately for our added api. configure.ac | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit d19c5c0eac749704af70edffaa1fa0ac70eb9373 Author: Rob Taylor Date: 2007-02-13 13:58:38 +0000 Update NEWS Releasing today.. NEWS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit e368483363fc920cf2978180f3a9fe6687465807 Author: Rob Taylor Date: 2007-02-12 04:23:42 +0000 Update NEWS Update NEWS, adding fix for bug #9769. NEWS | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) commit 814b029d9291199bc9fdd2998c429ee15f243a93 Author: Rob Taylor Date: 2007-02-12 04:21:50 +0000 Add pkg-config support for uninstalled use. Adds dbus-glib-1-uninstalled.pc for use in build environments where dbus-glib is used as an uninstalled build dependancy. Fix due to Damien Carbery . Fixes bug #9769. configure.ac | 1 + dbus-glib-1-uninstalled.pc.in | 12 ++++++++++++ 2 files changed, 13 insertions(+) commit 6bcb544eb6bc164e367a0e849b6c41274809401e Author: Rob Taylor Date: 2007-02-09 02:49:57 +0000 Update version in configure.ac Updates version 0.73 in configure.ac configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit dba710006cb0b25454989f41babc53c12d3fc901 Author: Rob Taylor Date: 2007-02-09 02:46:57 +0000 Update NEWS ready for 0.73 release Updates NEWS with all the changes for 0.73 NEWS | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) commit 133bc8003657169f622d4340360a0e5b15a455de Author: Rob Taylor Date: 2007-02-09 02:21:20 +0000 Allow passing of NULL to strv out arguments. A nicety for the user, allows passing NULL to strv out arguments as shorthand for an empty array. Patch due to Luiz Augusto von Dentz Fixes bug #8795. dbus/dbus-gvalue.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) commit 5f70d7b59445b634f94469a8c12cf31f8f81fdae Author: Rob Taylor Date: 2007-02-09 02:13:40 +0000 Make uscore_to_wincaps return NULL when passed NULL. A null pointer dereference occured when uscore_to_wincaps was passed NULL, which could happen in some cases. Fixes bug #8318. dbus/dbus-gobject.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 678f8e5fdaf5c587547a96b173a5532f14337988 Author: Rob Taylor Date: 2007-02-09 02:08:57 +0000 Only respond to NameOwnerChanged if its one of our names. This fixes a crash due to code in dbus_g_proxy_manager_replace_name_owner that was dereferencing a null pointer when the process received a nameownerchanged for an object not registered with dbus-glib. Patch by Kimmo Hämäläinen . Fixes bug #8235. dbus/dbus-gproxy.c | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) commit 1ce4d3e7324d92d797b7e41e869b1d0ff51f129a Author: Rob Taylor Date: 2007-02-09 01:51:55 +0000 Fix dbus-binding-tool to generate headers usable from C++ Adds a cast that isn't needed in C, but is needed in C++ Thanks to Christian Persch , though his patch had a typo :) Fixes bug #6358. dbus/dbus-binding-tool-glib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 6d61bad839512dedb62318fd82e2c0b20906d62f Author: Rob Taylor Date: 2007-02-09 01:26:48 +0000 Only require --prefix for server side binding generation In dbus-binding-tool, only require --prefix for server side binding generation, as client-side defaults to the useful org_foo_bar_baz. Also fixes up the help string. Closes bug #4185 dbus/dbus-glib-tool.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) commit cb866d68e733e48bd6a6cea21fa4b5ca648d861e Author: Rob Taylor Date: 2007-02-09 00:04:13 +0000 Clarify documentation for dbus_g_method_get_sender. Adds a note that the caller is responsible for freeing the returned value. dbus/dbus-gobject.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) commit 22bd9971b4ac95f926b577e416f54ec57bb16d2d Author: Rob Taylor Date: 2007-02-08 23:54:33 +0000 Add new API for specifying the timeout in DBusGProxy calls. This applies the patch from S. Nalliami to provide new glib API's to allow the user to specify the timeout parameter for the method calls. Currently, in the dbus-glib APIs,the timeout value for synchronous and asynchronous method calls is hard coded as -1(ie.25seconds) which inhibits the user from specifying shorter or longer timeout values.The new APIs take the timeout value as an argument and processes the method calls. Fixes bug #9832. dbus/dbus-glib.h | 16 +++++++ dbus/dbus-gproxy.c | 121 ++++++++++++++++++++++++++++++++++++++++++++++++---- 2 files changed, 128 insertions(+), 9 deletions(-) commit b226873fdc2e7b98740afb93a7bae675952a29f0 Author: Rob Taylor Date: 2007-02-08 23:17:40 +0000 Dont check for libxml2 when expat not found. There isn't a version of dbus-gloader that works with libxml2, so this changes configure.ac to not check for libxml2, and error out if expat isn't found. configure.ac | 47 ++++++----------------------------------------- 1 file changed, 6 insertions(+), 41 deletions(-) commit c51ff16bc93b4741061c362de638ab5e8cace000 Author: Rob Taylor Date: 2007-02-08 15:06:08 +0000 Add configure flags --with-introspect-xml Adds the configure flags --with-introspect-xml, which allows dbus-glib to be built with pre-generated bus daemons introspection xml (such as can be gained with dbus-daemon --introspect). This allows dbus-glib to be built without a running dbus-daemon, useful for embedded systems. configure.ac | 15 +++++++++++++++ tools/Makefile.am | 5 +++++ 2 files changed, 20 insertions(+) commit c5c0bed2166767162f599958270e92122da3ff2a Author: Rob Taylor Date: 2007-02-08 15:00:17 +0000 update doc/reference/dbus-glib-undocumented.txt dbus_g_thread_init is now documented. doc/reference/dbus-glib-undocumented.txt | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) commit c807d408924e9a9bcc7b2eb67b411c25888090ee Author: Rob Taylor Date: 2007-01-08 08:41:11 +0000 Use dbus_threads_init_default() rather than using own threading primitives. Modifies dbus_g_threads_init() to just call dbus_threads_init_default(), which with current dbus gives us full thread primitives with recursive locking. Fixes #9259. dbus/dbus-gthread.c | 143 +++------------------------------------------------ 1 file changed, 7 insertions(+), 136 deletions(-) commit 9bb928331e2ad602728320598698de90c9a246d6 Author: Rob Taylor Date: 2007-01-08 08:39:22 +0000 Reduce dependancy to dbus version 0.93, error out if correct version not found. In configure.ac, add code to error out if correct version of dbus-1 not found. Also use correct dependancy of 0.93, as this is when the --introspect flag was introduced to dbus-daemon. Pacth due to Luiz Augusto von Dentz . Fixes #8793. configure.ac | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) commit 79d115030d45fefd96d5ffc7853f80fc454c13b1 Author: Rob Taylor Date: 2007-01-07 13:34:26 +0000 Allow dbus and dbus-glib to live in different prefixes Adds Cflags: -I${includedir}/dbus-1.0 to dbus-glib-1.pc.in. Fixes #9384. dbus-glib-1.pc.in | 1 + 1 file changed, 1 insertion(+) commit 6de547af3bd7d2c8b77464435c45d22bba702cc7 Author: Rob Taylor Date: 2006-10-26 10:22:26 +0100 Correct spellings in NEWS NEWS | 37 +++++++++++++++++++++++-------------- 1 file changed, 23 insertions(+), 14 deletions(-) commit 83f8ed0935c37b3b5668d1a512370a51f73ccc27 Author: Rob Taylor Date: 2006-10-25 22:14:02 +0100 Update NEWS for release. NEWS | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) commit c449668fd2b8b92fde03a83ba76a0eb8bb2a9326 Author: Rob Taylor Date: 2006-10-25 21:12:03 +0100 only use -Wfloat-equal if compiler supports it Closes #7658. Thanks to Jens Granseuer for the patch. configure.ac | 31 +++++++++++++++++++++++++++---- 1 file changed, 27 insertions(+), 4 deletions(-) commit 505e48a851e38664c45e482b8f75ebbfd27fe278 Author: Rob Taylor Date: 2006-10-25 21:00:18 +0100 return NULL from g_return_val_if_fail in dbus_g_proxy_begin_call Closes #4159. dbus/dbus-gproxy.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 62acdb49360dfbf994ef38c8e97d9190d30149f3 Author: Rob Taylor Date: 2006-10-25 20:26:04 +0100 Add dbus-gidl.h to IGNORE_HFILES for doxygen docs doc/reference/Makefile.am | 1 + 1 file changed, 1 insertion(+) commit 0d9889a99241aebc863237faf8126663c97ae059 Author: Rob Taylor Date: 2006-10-25 20:17:55 +0100 Update tools/Makefile.am for new dbus-binding-tool behaviour tools/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 0aa2db3f6f18bff7d5c62a00f052ca89e21b269f Author: Rob Taylor Date: 2006-10-25 20:03:31 +0100 Remove bashism in make-dbus-glib-error-enum.sh Closes #6700. dbus/make-dbus-glib-error-enum.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 74bcfcfbc242325ca470d483817ae37fa8d41f25 Author: Rob Taylor Date: 2006-10-25 19:37:12 +0100 Fix introspection when object has exported properties. dbus-gobject:write_interface was completely broken Fix thanks to mccann@jhu.edu. Closes #8607. dbus/dbus-gobject.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) commit 3647d0df5780967dd505d3c046ab37ada70529bf Author: Rob Taylor Date: 2006-10-25 19:14:50 +0100 Require --prefix in dbus-binding-tool Closes #4185. dbus/dbus-glib-tool.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) commit 054c6476495a6f85ae708ed81b9053bf666897b7 Author: Rob Taylor Date: 2006-10-25 18:34:49 +0100 Dont shadow index. Rename useage of index to index_. Thanks stdlib... Closes #8353. dbus/dbus-gtype-specialized.c | 12 ++++++------ dbus/dbus-gvalue.c | 14 +++++++------- 2 files changed, 13 insertions(+), 13 deletions(-) commit d3a494dced8e3f2de111f23ae3fbab6e32f4051a Author: Rob Taylor Date: 2006-10-25 18:27:20 +0100 Fix small leak when marshal_table is destroyed Closes #6870 with patch from Richard Hult dbus/dbus-gobject.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) commit 9bfec032a72e7af5945336fecbb9b6e0b6f2de9e Author: Rob Taylor Date: 2006-10-25 18:24:53 +0100 Fixes crash if disposing one DBusGProxy causes another for the same service to be unrefed in a destoyed callback. dbus/dbus-gproxy.c | 14 ++++++++- test/core/test-dbus-glib.c | 67 ++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 78 insertions(+), 3 deletions(-) commit 53bf71bd852810a271d13a73ba445622616c711c Author: Rob Taylor Date: 2006-10-25 16:41:38 +0100 Bump version to 0.72 and use modern AC_INIT, AM_INIT_AUTOMAKE configure.ac | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 28a54df202f089a3e00930e36a787c175501be41 Author: Rob Taylor Date: 2006-10-25 14:36:25 +0100 Clean generated run-with-tmp-session-bus.conf on make clean test/core/Makefile.am | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) commit bcf15d72892582c28755563ca63182c198ef8f64 Author: Rob Taylor Date: 2006-10-25 14:35:25 +0100 Actually run unit tests and checks when doing make distcheck Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 7c21166ef7ce9b370448a39c6c6744813933abee Author: Rob Taylor Date: 2006-10-25 14:33:53 +0100 Use TEST_CORE_SERVICE_BINARY path for core test service file test/data/valid-service-files/debug-glib.service.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit d6980d9d59edcf14cc1ab5af3945bd740a3f2495 Author: Rob Taylor Date: 2006-10-25 14:32:14 +0100 Use dbus-daemon --introspect to generate DBus service introspect xml tools/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 505f5486f055558934718672f1328b52fab6cd6e Author: Rob Taylor Date: 2006-10-25 14:30:23 +0100 Actually make interfaces tests work Working interfaces/Makefile.am Make service file for interfaces test service Fix up configure.ac appropriately. Sanitise service/object namespace for interfaces tests Remove accidentally added test/interfaces/.Makefile.am.sw configure.ac | 6 ++- test/interfaces/Makefile.am | 81 +++++++++++++++++-------------------- test/interfaces/run-test.sh | 23 +---------- test/interfaces/test-client.c | 22 +++++----- test/interfaces/test-goodbye.xml | 4 +- test/interfaces/test-hello.xml | 4 +- test/interfaces/test-interfaces.c | 4 +- test/interfaces/test-objects.c | 8 ++-- test/interfaces/test-server.c | 8 ++-- test/interfaces/test-song.xml | 4 +- 10 files changed, 69 insertions(+), 95 deletions(-) commit 4a479fe9516b141d94e57489f7e624ea6b94cb94 Author: Rob Taylor Date: 2006-10-24 19:51:12 +0100 Make interfaces tests work Working interfaces/Makefile.am Make service file for interfaces test service Fix up configure.ac appropriately. Sanitise service/object namespace for interfaces tests Remove accidentally added test/interfaces/.Makefile.am.swp test/data/valid-service-files/interfaces-test.service.in | 3 +++ test/interfaces/.Makefile.am.swp | Bin 12288 -> 0 bytes 2 files changed, 3 insertions(+) commit 4db00a26f0c67db96ff6185286658278678e23bd Author: Rob Taylor Date: 2006-10-24 18:07:26 +0100 Changes for test/interfaces Changed configure.ac and test/Makefile.am configure.ac | 1 + test/Makefile.am | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) commit 4f6a75760f55eeb79113d09baa46ecdd09e100e6 Author: Rob Taylor Date: 2006-10-24 16:36:08 +0100 Add tests for new interfaces functionaility From bug #5173 test/interfaces/.Makefile.am.swp | Bin 0 -> 12288 bytes test/interfaces/.gitignore | 4 ++ test/interfaces/Makefile.am | 86 +++++++++++++++++++++++++ test/interfaces/run-test.sh | 38 +++++++++++ test/interfaces/test-client.c | 85 +++++++++++++++++++++++++ test/interfaces/test-goodbye.xml | 9 +++ test/interfaces/test-hello.xml | 10 +++ test/interfaces/test-interfaces.c | 126 +++++++++++++++++++++++++++++++++++++ test/interfaces/test-interfaces.h | 48 ++++++++++++++ test/interfaces/test-objects.c | 73 +++++++++++++++++++++ test/interfaces/test-objects.h | 31 +++++++++ test/interfaces/test-server.c | 56 +++++++++++++++++ test/interfaces/test-song.xml | 9 +++ 13 files changed, 575 insertions(+) commit 4467ffca15e4783b7e90f1349be18fca3807b6cb Author: Rob Taylor Date: 2006-10-24 15:42:42 +0100 Bump GLib dependancy to 2.6 Closes #4390. configure.ac | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 6ac144ff50d6c87795b470fb74cc1c0dd3e549a7 Author: Rob Taylor Date: 2006-10-17 17:06:48 +0100 Add gobject-2.0 to dbus-glib-1.pc.in glib bindings depend on gobject. Its amazing we've got this far with noone noticiing this bug... dbus-glib-1.pc.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 03e629cabe1100527c467fc5bf2a8aa4f7d3a6f5 Author: Rob Taylor Date: 2006-10-04 19:30:46 -0400 Remove accidentally added test/interfaces stuff in the autotools configure.ac | 1 - test/Makefile.am | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) commit 8e2c2ba5f8f0a25708bac86cafa46be02a1bdb78 Author: Rob Taylor Date: 2006-10-04 19:16:35 -0400 Fix up tests Puts all exposed servies in the org.freedesktop.DBus.GLib namespace Make tests run again! test/core/run-test.sh | 6 +- test/core/test-dbus-glib.c | 142 ++++++++++---------- test/core/test-profile.c | 6 +- test/core/test-service-glib.c | 16 +-- test/core/test-service-glib.xml | 6 +- test/core/test-thread-client.c | 4 +- test/core/test-thread-server.c | 2 +- .../data/valid-service-files/debug-echo.service.in | 2 +- .../data/valid-service-files/debug-glib.service.in | 2 +- test/test-service.c | 28 ++-- 10 files changed, 107 insertions(+), 107 deletions(-) commit c0bb50ca11675274464d91ed5651676449ce360d Author: Rob Taylor Date: 2006-10-04 19:13:34 -0400 Update autofoo for new tests layout configure.ac | 1 + test/Makefile.am | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) commit 33412cde926a9fc6ce86618835661bbc48475177 Author: Rob Taylor Date: 2006-10-04 23:43:29 +0100 Make autogen a bit more useful for maintainers Adds default configure parameters - the ones you usually want ;) autogen.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) commit b47e9bca585b1104f6d7309b02da27b123015611 Author: Rob Taylor Date: 2006-09-27 14:12:26 +0100 Update COPYING and HACKING to be correct for dbus-glib COPYING | 9 ++++----- HACKING | 11 +++++++++++ 2 files changed, 15 insertions(+), 5 deletions(-) commit 50541a23757d59d93918db52c9e9c65596d943c5 Author: Rob Taylor Date: 2006-09-27 14:04:19 +0100 Autoconf changes from test/glib -> test/core move configure.ac | 4 ++-- test/Makefile.am | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) commit 01024785e818e72c06ba44e8feea926e8aa8f7a8 Author: Rob Taylor Date: 2006-09-27 14:02:42 +0100 add an .gitignore .gitignore | 205 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 205 insertions(+) commit 003840bd5f08802fb2a63b3c49f9d0685f6f292b Author: Rob Taylor Date: 2006-09-27 13:56:39 +0100 Move tests/glib to test/core Move tests/glib to test/core in preparation for seperate functionality tests test/core/Makefile.am | 86 ++ test/core/my-object-marshal.list | 2 + test/core/run-test.sh | 38 + test/core/test-dbus-glib.c | 1614 ++++++++++++++++++++++++++++++++++++++ test/core/test-profile.c | 1150 +++++++++++++++++++++++++++ test/core/test-service-glib.c | 928 ++++++++++++++++++++++ test/core/test-service-glib.xml | 179 +++++ test/core/test-thread-client.c | 98 +++ test/core/test-thread-server.c | 209 +++++ test/core/test-thread.h | 1 + test/glib/Makefile.am | 86 -- test/glib/my-object-marshal.list | 2 - test/glib/run-test.sh | 38 - test/glib/test-dbus-glib.c | 1614 -------------------------------------- test/glib/test-profile.c | 1150 --------------------------- test/glib/test-service-glib.c | 928 ---------------------- test/glib/test-service-glib.xml | 179 ----- test/glib/test-thread-client.c | 98 --- test/glib/test-thread-server.c | 209 ----- test/glib/test-thread.h | 1 - 20 files changed, 4305 insertions(+), 4305 deletions(-) commit de74dd48194f9aa3629d7b65dd89e0b1339f8654 Author: Rob Taylor Date: 2006-09-27 13:39:24 +0100 Rename configure.in to configure.ac for modernity configure.ac | 902 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ configure.in | 902 ---------------------------------------------------------- 2 files changed, 902 insertions(+), 902 deletions(-) commit b17fc759d2d5422ce287706d276443fa338cbf5a Author: Rob Taylor Date: 2006-09-24 14:34:19 +0100 Fix memleak in lookup_or_register_specialized. Applies fix from Daniel d'Andrada Tenório de Carvalho, closing bug #7352. dbus/dbus-gtype-specialized.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) commit 4d6aa726814295cfabab95a51d2e320d02b72dde Author: Rob Taylor Date: 2006-09-24 14:32:52 +0100 Add m4 directory Add missing changes from last commit. Makefile.am | 9 +++++---- autogen.sh | 6 +++++- configure.in | 1 + 3 files changed, 11 insertions(+), 5 deletions(-) commit 1571d556aa5f087e52074e5fd7c5e5c29667c551 Author: Rob Taylor Date: 2006-09-24 14:07:50 +0100 Add m4 directory Add an m4 directory and add gtk-doc.m4, which is installed in the tree by gtkdocize. m4/Makefile.am | 1 + 1 file changed, 1 insertion(+) commit fcc2ccdb19bfa25db005494271dbd91a3205c3a6 Merge: 99e1085 3f978cf Author: Rob Taylor Date: 2006-09-21 03:44:22 +0100 Merge branch 'master' of git+ssh://git.freedesktop.org/git/dbus/dbus-glib commit 3f978cf34b91e5404dc3ea559995a9648734a2da Author: John (J5) Palmieri Date: 2006-09-08 10:56:06 -0400 * tools/Makefile.am: Add tools/session.conf to EXTRA_DIST so make check works from tarballs tools/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 99e10857c50a025fb37613c4dae720b5afc890f5 Merge: b193f2b 22ea91b Author: Rob Taylor Date: 2006-08-24 23:27:58 +0100 Merge http://ms800.montefiore.ulg.ac.be/~frecinau/dbus-glib commit 22ea91b33bff95cf480a4c992e4774b671f1534b Author: Steve Frécinaux Date: 2006-08-22 22:57:44 +0200 Fix compilation with -Werror dbus/dbus-gmain.c | 2 +- test/glib/test-dbus-glib.c | 9 +-------- 2 files changed, 2 insertions(+), 9 deletions(-) commit 368aaee38049dc599fb8d06d7096bcdbd04befab Author: Steve Frécinaux Date: 2006-08-22 22:26:24 +0200 Make test scripts run during out-of-tree compilation test/glib/run-test.sh | 4 +++- tools/run-with-tmp-session-bus.sh | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) commit b193f2b28472790ff66fc575d55d4e6d5a9d3e78 Author: Steve Frécinaux Date: 2006-08-22 19:36:44 +0200 Fix out-of-tree compilation (cherry picked from 4b85a9e92bcf21356f25c535b3550a330cb018a4 commit) dbus/Makefile.am | 13 +++++++++++-- dbus/examples/Makefile.am | 8 +++++++- dbus/examples/statemachine/Makefile.am | 9 ++++++++- test/Makefile.am | 7 ++++++- test/glib/Makefile.am | 8 +++++++- 5 files changed, 39 insertions(+), 6 deletions(-) commit 4b85a9e92bcf21356f25c535b3550a330cb018a4 Author: Steve Frécinaux Date: 2006-08-22 19:36:44 +0200 Fix out-of-tree compilation dbus/Makefile.am | 13 +++++++++++-- dbus/examples/Makefile.am | 8 +++++++- dbus/examples/statemachine/Makefile.am | 9 ++++++++- test/Makefile.am | 7 ++++++- test/glib/Makefile.am | 8 +++++++- 5 files changed, 39 insertions(+), 6 deletions(-) commit 46e7e573203e354b676e031067b8607b4f2640df Merge: 355ef78 3be8161 Author: Steve Frécinaux Date: 2006-08-22 19:07:59 +0200 Merge branch 'master' of git://anongit.freedesktop.org/git/dbus/dbus-glib commit 3be816118dfc560955e5cd8e85203129087959ce Author: Rob Taylor Date: 2006-08-22 12:25:39 +0100 replace doxygen with gtk-doc in INSTALL INSTALL | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 27e76bb78db2b467ce93fa0088c6c2407836e4ff Author: Rob Taylor Date: 2006-08-22 12:25:13 +0100 Combine .PHONY rules in toplevel Makefile.am A .PHONY rule was added by the gtk-doc patch, this combines it with the existsing .PHONY rule Makefile.am | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) commit d49a2a2486cd60e22b360dda8ae5a50d25486667 Author: Rob Taylor Date: 2006-08-22 12:24:00 +0100 Modifed autogen.sh to check for autotools an gtkdocize versions autogen.sh now does a full check for all the correct versions of autotools. It uses autoreconf to do the various steps. It also checks for correct gtkdocize version and pretty prints a bit, a-la gnome-autogen.sh. autogen.sh | 143 ++++++++++++++++++++++++++++++++++++++++++------------------ 1 file changed, 101 insertions(+), 42 deletions(-) commit 62419419257d6353c5f35001e1f538fca300f3c4 Author: Rob Taylor Date: 2006-08-22 11:44:42 +0100 add missing doc/Makefile.am from gtk-doc update. doc/Makefile.am | 1 + 1 file changed, 1 insertion(+) commit f812d9044aa73b0c86f92dc0dcae03d26e23193a Author: Rob Taylor Date: 2006-08-22 11:43:43 +0100 Add missing m4/gtk-doc.m4 from gtk-doc patch. m4/gtk-doc.m4 | 1 + 1 file changed, 1 insertion(+) commit 2effafca679d6331201e7637b18888a70b958eb8 Author: Rob Taylor Date: 2006-08-18 20:55:17 +0100 Commit patch to switch to gtk-doc with gtype-specialized doc and updates from Marc-Andre Lureau , with minor cleanup. Closes #7726. Makefile.am | 5 +- autogen.sh | 4 + configure.in | 8 ++ dbus/dbus-gidl.c | 2 +- dbus/dbus-glib-tool.c | 2 +- dbus/dbus-glib.c | 134 ++++++++++++++------- dbus/dbus-glib.h | 41 ++++--- dbus/dbus-gmain.c | 46 ++++--- dbus/dbus-gobject.c | 140 +++++++++++++--------- dbus/dbus-gproxy.c | 193 +++++++++++++++++------------- dbus/dbus-gtype-specialized.c | 20 +++- dbus/dbus-gutils.c | 2 +- dbus/dbus-gvalue.c | 6 +- doc/reference/Makefile.am | 94 +++++++++++++++ doc/reference/dbus-binding-tool.xml | 62 ++++++++++ doc/reference/dbus-glib-docs.sgml | 83 +++++++++++++ doc/reference/dbus-glib-sections.txt | 166 +++++++++++++++++++++++++ doc/reference/dbus-glib-undocumented.txt | 78 ++++++++++++ doc/reference/version.xml.in | 1 + 19 files changed, 858 insertions(+), 229 deletions(-) commit 355ef78d98d6fc65715845d56232199162cab12a Author: Steve Frécinaux Date: 2006-08-17 11:48:20 +0200 Interface support for bindings. dbus/dbus-gobject.c | 286 +++++++++++++++++++++++++++++---------------------- 1 file changed, 161 insertions(+), 125 deletions(-) commit e6c7815f9457757d7364463759766c85981ce207 Author: John (J5) Palmieri Date: 2006-07-24 14:44:36 -0400 * Released 0.71 NEWS | 7 ++++++- configure.in | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) commit 3f720d5a5028d2b4075b474ba17fb9b7508093ac Author: John (J5) Palmieri Date: 2006-07-21 16:25:35 -0400 * Various Makefile cleanups Makefile.am | 26 ++++++++++++++++++++++++-- dbus/Makefile.am | 8 ++++---- test/Makefile.am | 2 -- 3 files changed, 28 insertions(+), 8 deletions(-) commit 05cb3fd6e2c139e61d1461443660badfbdf94a83 Author: John (J5) Palmieri Date: 2006-07-17 16:36:02 -0400 * Released 0.70 * Add NEWS to the dist Makefile.am | 1 + 1 file changed, 1 insertion(+) commit d59c4a541397033b69d575c8cc495d0f3ba13ee3 Author: John (J5) Palmieri Date: 2006-07-17 16:28:45 -0400 * Added a NEWS entry for this release NEWS | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) commit 990802d9f01a7c5aa1ae582aad21963fe20b601e Author: John (J5) Palmieri Date: 2006-07-17 16:06:52 -0400 * remove ChangeLog because this will now be generated during dist 0 files changed commit 6a68e96e69cb17a981c801d8e7480c5bb4d51a6c Author: John (J5) Palmieri Date: 2006-07-17 15:52:26 -0400 * add the Doxyfile.in file Doxyfile.in | 180 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 180 insertions(+) commit 89a2a3b5b5795434900f1ca41fc73162b7bb09f2 Author: John (J5) Palmieri Date: 2006-07-06 19:16:07 -0400 - distcheck cleanups dbus/Makefile.am | 2 +- tools/Makefile.am | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) commit 46ea5dc1aa64ca906d28119e2d9eed3a48e6adfc Author: John (J5) Palmieri Date: 2006-07-06 19:05:44 -0400 - Renabled another test dbus/Makefile.am | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) commit ae743d6feca5e24541124148a53a475f6f27e2a9 Author: John (J5) Palmieri Date: 2006-07-06 18:52:50 -0400 - add gcov source test/decode-gcov.c | 2652 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 2652 insertions(+) commit ae90f4bab7a98d89a85e8e6c11b4af72bb9a2525 Author: John (J5) Palmieri Date: 2006-07-06 18:52:16 -0400 - Adding placeholder HACKING file 0 files changed commit 5f47ecc191cae12930652b708d3c52d293eba4da Author: John (J5) Palmieri Date: 2006-07-06 18:05:37 -0400 - Add back the Doxygen doc generation Makefile.am | 2 +- configure.in | 1 + doc/api/README | 3 +++ 3 files changed, 5 insertions(+), 1 deletion(-) commit fdb8aaaab032ab4eb63aa80dbef7de91a3de346a Author: John (J5) Palmieri Date: 2006-07-06 17:40:30 -0400 - Add back tests to the glib bindings Makefile.am | 5 +- configure.in | 17 +- test/Makefile.am | 29 + .../data/valid-service-files/debug-echo.service.in | 3 + .../data/valid-service-files/debug-glib.service.in | 3 + test/glib/Makefile.am | 80 + test/glib/my-object-marshal.list | 2 + test/glib/run-test.sh | 36 + test/glib/test-dbus-glib.c | 1621 ++++++++++++++++++++ test/glib/test-profile.c | 1150 ++++++++++++++ test/glib/test-service-glib.c | 928 +++++++++++ test/glib/test-service-glib.xml | 179 +++ test/glib/test-thread-client.c | 98 ++ test/glib/test-thread-server.c | 209 +++ test/glib/test-thread.h | 1 + test/test-service.c | 374 +++++ tools/Makefile.am | 13 + tools/run-with-tmp-session-bus.sh | 65 + tools/session.conf | 24 + 19 files changed, 4833 insertions(+), 4 deletions(-) commit 24e982d596036202850c679aa0460b729840e45d Author: John (J5) Palmieri Date: 2006-07-06 14:40:14 -0400 - Fix up docs INSTALL | 78 ++------------------------------------------------------------- README | 71 --------------------------------------------------------- 2 files changed, 2 insertions(+), 147 deletions(-) commit 6aa2aba0a64ea19e504118dc56a1f9e559568f90 Author: John (J5) Palmieri Date: 2006-06-29 12:05:05 -0400 - Really commit the glib to dbus move and build fixes Makefile.am | 10 +++++----- configure.in | 18 +++++++++++++----- dbus/dbus-glib.h | 2 +- dbus/examples/Makefile.am | 14 +++++++------- dbus/examples/statemachine/Makefile.am | 10 +++++----- 5 files changed, 31 insertions(+), 23 deletions(-) commit 6a9ac47cc9143ee899455c576f557818dab1f7d2 Author: John (J5) Palmieri Date: 2006-06-29 11:26:07 -0400 - Created empty NEWS file - renamed glib dir to dbus so include paths stay the same in the examples - build now works dbus/.cvsignore | 13 + dbus/Makefile.am | 111 + dbus/dbus-binding-tool-glib.c | 1625 ++++++++++++ dbus/dbus-binding-tool-glib.h | 40 + dbus/dbus-gidl.c | 788 ++++++ dbus/dbus-gidl.h | 158 ++ dbus/dbus-glib-lowlevel.h | 72 + dbus/dbus-glib-tool.c | 489 ++++ dbus/dbus-glib-tool.h | 38 + dbus/dbus-glib.c | 304 +++ dbus/dbus-glib.h | 256 ++ dbus/dbus-gloader-expat.c | 266 ++ dbus/dbus-gmain.c | 814 ++++++ dbus/dbus-gmarshal.c | 89 + dbus/dbus-gmarshal.h | 21 + dbus/dbus-gmarshal.list | 1 + dbus/dbus-gobject.c | 2217 ++++++++++++++++ dbus/dbus-gobject.h | 43 + dbus/dbus-gparser.c | 881 +++++++ dbus/dbus-gparser.h | 65 + dbus/dbus-gproxy.c | 2748 ++++++++++++++++++++ dbus/dbus-gsignature.c | 210 ++ dbus/dbus-gsignature.h | 19 + dbus/dbus-gtest-main.c | 51 + dbus/dbus-gtest.c | 92 + dbus/dbus-gtest.h | 38 + dbus/dbus-gthread.c | 179 ++ dbus/dbus-gtool-test.h | 31 + dbus/dbus-gtype-specialized.c | 778 ++++++ dbus/dbus-gtype-specialized.h | 176 ++ dbus/dbus-gutils.c | 130 + dbus/dbus-gutils.h | 57 + dbus/dbus-gvalue-utils.c | 1439 ++++++++++ dbus/dbus-gvalue-utils.h | 73 + dbus/dbus-gvalue.c | 1854 +++++++++++++ dbus/dbus-gvalue.h | 43 + dbus/examples/.cvsignore | 17 + dbus/examples/Makefile.am | 38 + dbus/examples/example-client.c | 121 + dbus/examples/example-service.c | 153 ++ dbus/examples/example-service.xml | 19 + dbus/examples/example-signal-emitter.c | 132 + dbus/examples/example-signal-emitter.xml | 13 + dbus/examples/example-signal-recipient.c | 102 + dbus/examples/statemachine/.cvsignore | 16 + dbus/examples/statemachine/Makefile.am | 35 + dbus/examples/statemachine/sm-marshal.list | 1 + dbus/examples/statemachine/statemachine-client.c | 662 +++++ dbus/examples/statemachine/statemachine-server.c | 229 ++ dbus/examples/statemachine/statemachine-server.h | 37 + dbus/examples/statemachine/statemachine-server.xml | 14 + dbus/examples/statemachine/statemachine.c | 353 +++ dbus/examples/statemachine/statemachine.h | 77 + dbus/examples/statemachine/statemachine.xml | 33 + dbus/make-dbus-glib-error-enum.sh | 25 + dbus/make-dbus-glib-error-switch.sh | 29 + glib/.cvsignore | 13 - glib/Makefile.am | 105 - glib/dbus-binding-tool-glib.c | 1625 ------------ glib/dbus-binding-tool-glib.h | 40 - glib/dbus-gidl.c | 788 ------ glib/dbus-gidl.h | 158 -- glib/dbus-glib-lowlevel.h | 72 - glib/dbus-glib-tool.c | 489 ---- glib/dbus-glib-tool.h | 38 - glib/dbus-glib.c | 304 --- glib/dbus-glib.h | 256 -- glib/dbus-gloader-expat.c | 266 -- glib/dbus-gmain.c | 814 ------ glib/dbus-gmarshal.c | 89 - glib/dbus-gmarshal.h | 21 - glib/dbus-gmarshal.list | 1 - glib/dbus-gobject.c | 2217 ---------------- glib/dbus-gobject.h | 43 - glib/dbus-gparser.c | 881 ------- glib/dbus-gparser.h | 65 - glib/dbus-gproxy.c | 2748 -------------------- glib/dbus-gsignature.c | 210 -- glib/dbus-gsignature.h | 19 - glib/dbus-gtest-main.c | 51 - glib/dbus-gtest.c | 92 - glib/dbus-gtest.h | 38 - glib/dbus-gthread.c | 179 -- glib/dbus-gtool-test.h | 31 - glib/dbus-gtype-specialized.c | 778 ------ glib/dbus-gtype-specialized.h | 176 -- glib/dbus-gutils.c | 130 - glib/dbus-gutils.h | 57 - glib/dbus-gvalue-utils.c | 1439 ---------- glib/dbus-gvalue-utils.h | 73 - glib/dbus-gvalue.c | 1854 ------------- glib/dbus-gvalue.h | 43 - glib/examples/.cvsignore | 17 - glib/examples/Makefile.am | 38 - glib/examples/example-client.c | 121 - glib/examples/example-service.c | 153 -- glib/examples/example-service.xml | 19 - glib/examples/example-signal-emitter.c | 132 - glib/examples/example-signal-emitter.xml | 13 - glib/examples/example-signal-recipient.c | 102 - glib/examples/statemachine/.cvsignore | 16 - glib/examples/statemachine/Makefile.am | 35 - glib/examples/statemachine/sm-marshal.list | 1 - glib/examples/statemachine/statemachine-client.c | 662 ----- glib/examples/statemachine/statemachine-server.c | 229 -- glib/examples/statemachine/statemachine-server.h | 37 - glib/examples/statemachine/statemachine-server.xml | 14 - glib/examples/statemachine/statemachine.c | 353 --- glib/examples/statemachine/statemachine.h | 77 - glib/examples/statemachine/statemachine.xml | 33 - glib/make-dbus-glib-error-enum.sh | 25 - glib/make-dbus-glib-error-switch.sh | 29 - 112 files changed, 18315 insertions(+), 18309 deletions(-) commit 7fa1f1471e5b878253695da46a89a3186fb2a0d1 Author: John (J5) Palmieri Date: 2006-06-28 14:39:18 -0400 - Take out comment in a literal configure.in | 1 - 1 file changed, 1 deletion(-) commit 1a7d56d33f83dde917871f8b2d5af19f25786449 Author: John (J5) Palmieri Date: 2006-06-28 14:24:40 -0400 - Have autogen.sh point to dbus-glib autogen.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 24ec6aba3281c460f64bbe9d5bb2dd265d453cce Author: John (J5) Palmieri Date: 2006-06-28 14:22:25 -0400 - Add files missed in the split glib/dbus-glib-lowlevel.h | 72 +++++++++++ glib/dbus-glib.h | 256 +++++++++++++++++++++++++++++++++++++ glib/make-dbus-glib-error-enum.sh | 25 ++++ 3 files changed, 353 insertions(+) commit b8b86555280694d85d64b68d0f9131868598161a Author: John (J5) Palmieri Date: 2006-06-28 14:21:26 -0400 - Add boilerplate build files AUTHORS | 16 + COPYING | 551 +++++++++++++++++++++++++++++++++ INSTALL | 294 ++++++++++++++++++ Makefile.am | 57 ++++ README | 101 +++++++ autogen.sh | 93 ++++++ configure.in | 870 +++++++++++++++++++++++++++++++++++++++++++++++++++++ dbus-glib-1.pc.in | 12 + 8 files changed, 1994 insertions(+) commit 698177269a46c2cb80fbb2c471f5ad6314bd106b Author: Ross Burton Date: 2006-06-14 16:49:37 +0000 2006-06-14 Ross Burton * glib/dbus-gobject.c: Free a leaking GArray (surely not!) in dbus_g_method_return. glib/dbus-gobject.c | 1 + 1 file changed, 1 insertion(+) commit 0b305ffe12e7273640226e323074f2cb7d7387cc Author: Ross Burton Date: 2006-06-12 14:22:48 +0000 2006-06-12 Ross Burton * glib/dbus-gproxy.c: Don't leak a GArray when firing signals (thank Rob Taylor for review). glib/dbus-gproxy.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) commit 66e5632e14760bbd396afbc4d474cbbed22f37f7 Author: Robert McQueen Date: 2006-06-07 00:31:01 +0000 2005-05-06 Robert McQueen * glib/dbus-gtype-specialized.c: Fix obvious leak of GArray in every call to dbus_g_type_get_struct. glib/dbus-gtype-specialized.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) commit 9b151fd7a396463aa3f7c6ac0a14df444c78a6b1 Author: Robert McQueen Date: 2006-06-07 00:03:57 +0000 2005-05-06 Robert McQueen * glib/dbus-gvalue-utils.c: Fix the failing test where static string pointers were put into a GPtrArray-based specialised collection, and then freed along with the array. GValues which you add into collections or maps which have the NOCOPY flag set are assumed to not belong to the caller, so rather than the existing pointer-stealing semantics, they are copied instead. Given that the main consumers of this abstraction are the bindings themselves, I don't think this is too bad, but others should watch their choice of take vs set_static. glib/dbus-gvalue-utils.c | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) commit 5559e67b90b3c186bf0002253587013264ce9dc0 Author: Robert McQueen Date: 2006-06-06 23:07:04 +0000 2005-05-06 Robert McQueen * glib/dbus-gvalue-utils.c: Spotted a warning about the return value of g_slist_prepend not being used. Fixed copying of slist-based specialised collections, then wrote a test case and found that it was all broken. Went on to fix iterating and appending too. Good thing nobody uses this code yet. glib/dbus-gvalue-utils.c | 101 ++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 89 insertions(+), 12 deletions(-) commit 7ca236d43bc91778e90ac59500aeb1d68c8acd6f Author: Robert McQueen Date: 2006-06-06 19:45:39 +0000 2005-05-06 Robert McQueen * glib/dbus-gvalue-utils.c: Remove duplicated code by having all of the iterators use gvalue_take_ptrarray_value (the GValues themselves are discarded without unsetting, so it makes no difference whether we take or set_static). Remove cases for G_TYPE_POINTER because there really is nothing useful we can do with them in our specialised types - we *need* boxed copy/free functions at the very least. glib/dbus-gvalue-utils.c | 91 ++++++++-------------------------------------- 1 file changed, 16 insertions(+), 75 deletions(-) commit 8896d43457634c4c10d9909907d0d9082b520a07 Author: Havoc Pennington Date: 2006-05-21 05:33:52 +0000 2006-05-21 Havoc Pennington * glib/dbus-gproxy.c: Put in a pile of assertions that the proxy name is not NULL when it shouldn't be. Also a couple of possible fixes for #4637 though I don't understand why the bug happens, to be honest... also the object constructor has an assert name != NULL and the name is only currently NULL for peer-to-peer proxies that I don't think anyone uses? So it should be asserting. Anyway, for now at least see if we get an earlier assertion failure. * glib/dbus-gvalue-utils.c: Put in a couple of assertions for apparently broken code to be sure the tests fail and someone will fix them... glib/dbus-gvalue-utils.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) commit 4da76dd7d5845f05efd553037750ddeffd7d1962 Author: Robert McQueen Date: 2006-04-28 21:11:28 +0000 2005-04-28 Robert McQueen * glib/dbus-gproxy.c: Fix properties so that they can be given in any order, making it easier for people who inherit from this object. glib/dbus-gproxy.c | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) commit 08cd19641ff8c6fcb1f8e5821e6c9dc81f11cd6f Author: Robert McQueen Date: 2006-04-28 21:02:16 +0000 2005-04-28 Robert McQueen * glib/dbus-gvalue-utils.c: Patch from Jakub Stachowski to fix leaking of memory from within pointer arrays and lists. Fixes bug #6300. glib/dbus-gvalue-utils.c | 62 +++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 56 insertions(+), 6 deletions(-) commit 96fb792c6a5661afeef76ece3cd7defc9ffc8db8 Author: Robert McQueen Date: 2006-04-28 20:36:56 +0000 2005-04-28 Robert McQueen * glib/dbus-gvalue.c: Patch from Jakub Stachowski to fix a leak in generating struct signatures. Fixes bug #6083. glib/dbus-gvalue.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) commit 636fe6ed1b321cd05b72ca39d414ecd1c2cb4b4f Author: Havoc Pennington Date: 2006-02-26 01:06:33 +0000 2006-02-25 Havoc Pennington * glib/dbus-glib-tool.c (usage): fix up the usage message, someone should make this thing use the new glib options parser glib/dbus-glib-tool.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 844b4184483ac979eff27319f144e8f330858062 Author: Robert McQueen Date: 2006-02-16 00:43:41 +0000 2006-02-16 Robert McQueen * dbus/dbus-message.c (dbus_message_iter_get_fixed_array): Patch from Rob Taylor to correct a bogus assertion that the next element to read from the iter is fixed in size. This is not the case when you are at the end of the iter, because the next element type is INVALID. * dbus/dbus-string.c (_dbus_string_init_const_len): Correct a a bogus assert which means that you may not initialise a 0-length string unless you provide a non-NULL pointer. This prevented you from marshalling messages containing zero-length arrays in some cases. * glib/dbus-gvalue.c (demarshal_collection_array): Another patch from Rob to correct bogus asserts when trying to demarshal an array and get_fixed_array got you 0 elements. Append nothing to the GArray in this case. * test/glib/test-dbus-glib.c: Add a test case for round-tripping an empty array via the glib bindings. Without all of the above patches, this new test fails. glib/dbus-gvalue.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) commit 7b33862bac766c00c12f5cb400af06200ae004c4 Author: Robert McQueen Date: 2006-02-15 23:45:48 +0000 2006-02-16 Robert McQueen * glib/dbus-gmain.c: Make the previous commit compile. * python/_dbus.py, python/matchrules.py: Patch from Ole Andre Ravnaas to allow you to specify sender_keyword="foo", path_keyword="bar" when adding a signal listener, so that you can bind to signals generically but still do something useful in your callback. * python/dbus_bindings.pyx: Demarshal the byte type as unsigned chars so that they're not cast to chars and made negative. Thanks to Jakub Stachowski for reporting this and testing the fix. glib/dbus-gmain.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) commit 8d98ce884210745d7070e4438167ece2be0e357b Author: John (J5) Palmieri Date: 2006-02-15 21:42:54 +0000 2006-02-15 John (J5) Palmieri * dbus/dbus-glib.h: * glib/dbus-gmain.h: (dbus_g_connection_open): new method for openning a connection to an arbitrary address in the glib bindings * ChangeLog: checkin last entry which doesn't seem to be commited glib/dbus-gmain.c | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) commit 6fd3dffe4561b37bc75c13f6296e91b65224ce4d Author: Robert McQueen Date: 2006-02-13 22:30:11 +0000 2006-02-13 Robert McQueen * glib/dbus-binding-tool-glib.c, glib/dbus-gmain.c, glib/dbus-gsignature.c, glib/dbus-gtype-specialized.c, glib/dbus-gtype-specialized.h, glib/dbus-gvalue-utils.c, glib/dbus-gvalue-utils.h, glib/dbus-gvalue.c: Patch from Rob Taylor to add a big missing piece of the glib bindings jigsaw puzzle. This modifies the existing specialised types to have N type parameters (rather than the current 1 or 2 for arrays and dictionaries respectively). You can then use this to get a glib type to represent any arbitrary D-Bus struct type using dbus_g_type_get_struct. The only implementation of these types is with GValueArrays as before, but it's now possible to store these in arrays, emit them in signals, etc. glib/dbus-binding-tool-glib.c | 26 ++++ glib/dbus-gmain.c | 4 +- glib/dbus-gsignature.c | 25 +++- glib/dbus-gtype-specialized.c | 296 ++++++++++++++++++++++++++++++++++++++--- glib/dbus-gtype-specialized.h | 43 ++++++ glib/dbus-gvalue-utils.c | 184 +++++++++++++++++++++++++ glib/dbus-gvalue-utils.h | 2 +- glib/dbus-gvalue.c | 148 ++++++++++++++++++++- 8 files changed, 695 insertions(+), 33 deletions(-) commit eef27dfbd6dc73baa13c78220f98297881071368 Author: Robert McQueen Date: 2006-01-27 16:40:53 +0000 2006-01-27 Robert McQueen * glib/dbus-binding-tool-glib.[ch]: Patch based on Ricardo Kekki's patch to use an annotation org.freedesktop.DBus.GLib.ClientCSymbol when generating the client-side methods, instead of overloading CSymbol which broke everything horribly. My apologies. glib/dbus-binding-tool-glib.c | 45 +++++++++++++++++------------------------ glib/dbus-binding-tool-glib.h | 1 + 2 files changed, 19 insertions(+), 27 deletions(-) commit 879e2b697e2a0fd439a38ea4d4422cd8c01fefb5 Author: Robert McQueen Date: 2006-01-27 15:40:36 +0000 2006-01-27 Robert McQueen * glib/dbus-gtype-specialized.[ch], glib/dbus-gvalue-utils.c: Patch by me and Rob Taylor to add a simple_free function to D-Bus map and collection types, which allows those types which can be freed with a GDestroyNotify (such as GHashTables and GArrays, but not GPtrArrays) to be stored as the values in hashtables. * test/glib/test-dbus-glib.c, test/glib/test-service-glib.{c,xml}: Patch by Rob Taylor to add nested dicts to the glib tests to check the above code works, and appears not to leak when called repeatedly. glib/dbus-gtype-specialized.c | 33 ++++++++++++++++++++++++++- glib/dbus-gtype-specialized.h | 4 +++- glib/dbus-gvalue-utils.c | 50 ++++++++++++++++++++++++++++++++++------- 3 files changed, 77 insertions(+), 10 deletions(-) commit f467138770f3b5b771e772e7f59780a502540cb6 Author: Robert McQueen Date: 2006-01-27 15:15:16 +0000 2006-01-27 Robert McQueen * glib/dbus-gvalue.c (demarshal_valuearray): Patch from Rob Taylor to free a D-Bus allocated string with dbus_free () instead of g_free (). glib/dbus-gvalue.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 0c87b127b878d41d8a134fd5dee5d41a2434ef41 Author: Robert McQueen Date: 2006-01-27 15:06:54 +0000 2006-01-27 Iain Holmes * glib/dbus-gproxy.c (dbus_g_proxy_dispose): Protect the dispose method from being called multiple times. glib/dbus-gproxy.c | 5 +++++ 1 file changed, 5 insertions(+) commit 5ad59f0f48a27d35d58e86c2cf2aa8c7d025248b Author: Robert McQueen Date: 2006-01-19 02:54:07 +0000 2006-01-19 Robert McQueen * glib/dbus-binding-tool-glib.c: Patch from Rob Taylor to add support for generating bindings to arrays that are represented as GPtrArrays rather than GArrays (ie size-variable things, such as strings, objects, structs, etc). glib/dbus-binding-tool-glib.c | 32 ++++++++++++++++++++++++++------ 1 file changed, 26 insertions(+), 6 deletions(-) commit 0dffd5ab28874cc6453e8907f1f4cb95785748cb Author: Robert McQueen Date: 2006-01-05 20:22:06 +0000 2006-01-05 Robert McQueen * dbus/dbus-glib.h, glib/dbus-gproxy.c: Patch from Ricardo Kekki to make it possible to inherit from DBusGProxy, by splitting the DBusGProxy struct into a public part and a private part, and moving the setting of the DBusGProxyManager into a connection property, allowing proper GObject construction. glib/dbus-gproxy.c | 327 +++++++++++++++++++++++++++++++--------------------- 1 file changed, 196 insertions(+), 131 deletions(-) commit b356f998530ffe9762b4b0f5fd7f236eceb044db Author: Robert McQueen Date: 2006-01-05 20:03:38 +0000 2006-01-05 Robert McQueen * glib/dbus-binding-tool-glib.c: Patch from Ricardo Kekki to make dbus-binding-tool heed C symbol name annotations when generating glib client bindings. glib/dbus-binding-tool-glib.c | 42 ++++++++++++++++++++++++++++++++++++----- 1 file changed, 37 insertions(+), 5 deletions(-) commit 8029bd07868baa11810b0b3ee56a8daefc0588da Author: John (J5) Palmieri Date: 2005-11-30 19:32:25 +0000 * dbus/dbus-auth.c, dbus/dbus-connection.c, dbus/dbus-keyring.c, dbus/dbus-server-debug-pipe.c, glib/dbus-binding-tool-glib.c glib/dbus-glib-tool.c, glib/dbus-gparser.c, glib/dbus-gproxy.c test/test-segfault.c, test/test-utils.c, test/glib/test-dbus-glib.c, tools/dbus-cleanup-sockets.c tools/dbus-launch.c, tools/dbus-tree-view.c, tools/dbus-viewer.c: Various cleanup of dead code and compiler warnings (patch from Kjartan Maraas ) glib/dbus-binding-tool-glib.c | 2 -- glib/dbus-glib-tool.c | 4 ---- glib/dbus-gparser.c | 11 ++--------- glib/dbus-gproxy.c | 2 -- 4 files changed, 2 insertions(+), 17 deletions(-) commit c5753442aaccba39a3e0948aa77e523eb3fe866b Author: John (J5) Palmieri Date: 2005-11-30 18:48:09 +0000 * glib/dbus-gmain.c (connection_setup_add_watch): plugged a leak (patch from Carlos Garnacho Parro glib/dbus-gmain.c | 1 + 1 file changed, 1 insertion(+) commit 5d3c9bd0cd7e98df0be8351e3c210a38a978f52a Author: Robert McQueen Date: 2005-11-27 16:55:09 +0000 2005-11-27 Carlos Garcia Campos * glib/dbus-gobject.c: Append a GValue instead of a basic type in method return message for property getters glib/dbus-gobject.c | 41 +++++++++++++++++++++++++++++++---------- glib/dbus-gvalue.c | 8 ++++---- glib/dbus-gvalue.h | 1 + 3 files changed, 36 insertions(+), 14 deletions(-) commit 9f2aae9a744e45c0646b36396e846031ec4ffe7f Author: John (J5) Palmieri Date: 2005-11-22 20:37:00 +0000 * configure.in: Add test/name-test/Makefile to the generated Makefile list * dbus/dbus-shared.h (#define DBUS_NAME_FLAG_ALLOW_REPLACEMENT): New flag which replaces DBUS_NAME_FLAG_PROHIBIT_REPLACEMENT (#define DBUS_NAME_FLAG_DO_NOT_QUEUE): New flag for specifying not to queue an ower if it can't be the primary owner * bus/bus.h: Add new internal BusOwner struct * bus/driver.c (bus_driver_handle_hello): Send flags (0 for default) to bus_registry_ensure and don't set the prohibit_replacement flag since they are now set per BusOwner and not per name. (bus_driver_handle_list_queued_owners): bus method (ListQueuedOwners) that returns the list of connections in a name's connection queue * bus/services.c (struct BusService): remove prohibit_replacement field (struct BusOwner): new struct for keeping track of queued connections and their associated flags for the queue (struct BusRegistry): add a BusOwner memory pool (bus_registry_new): initialize the BusOwner memory pool (bus_registry_unref): free the BusOwner memory pool (_bus_service_find_owner_link): new internal method for searching the queue for a specific connection (bus_owner_set_flags): new method for adding setting the flags on a bus owner (bus_owner_new): new method that creates a BusOwner object from the pool and sets its flags (bus_owner_ref, bus_owner_unref): ref counting for BusOwner objects (bus_registry_ensure): Add the flags parameter (bus_registry_acquire_service): Switch from using raw connections to using the BusOwner struct Add new state machine for dealing with the new set of flags (bus_registry_set_service_context_table, struct OwnershipCancelData, cancel_ownership, free_ownership_cancel_data, add_cancel_ownership_to_transaction, struct OwnershipRestoreData, restore_ownership, free_ownership_restore_data, add_restore_ownership_to_transaction): Switch to using BusOwner instead of raw connections (bus_service_add_owner): Add flags parameter Switch to using BusOwner instead of raw connections Add state machine for dealing with the new set of flags (bus_service_swap_owner): Swaps the first and second owners in the queue. Used to make sure proper signals are sent when a service looses or gains primary ownership. We never insert an owner at the top of the queue. Instead we insert it in the second position and then swap. (bus_service_remove_owner): Remove the owner from the queue sending out the NameLost and NameOwnerChanged signals if the we were the primary owner (bus_service_get_primary_owners_connection): New method that extracts the connection from the primary owner (bus_service_get_primary_owner): Returns the BusOwner instead of the connection (bus_service_get_allow_replacement): Changed from the old bus_service_get_prohibit_replacement method. Checks the flags of the primary owner and returns if it can be replaced or not (bus_service_set_prohibit_replacement): removed (bus_service_has_owner): returns TRUE if and owner with the specified connection exists in the queue * dbus/dbus-bus.c (dbus_bus_connection_get_unique_name): New helper method that only compiles if tests are enabled. Allows us to get the unique name of a connection so we can check it against the queue when doing regression tests * bus/activation.c (bus_activation_send_pending_auto_activate), bus/dispatch.c (bus_dispatch), bus/driver.c (bus_driver_handle_get_service_owner, bus_driver_handle_get_connection_unix_user, bus_driver_handle_get_connection_unix_process_id, bus_driver_handle_get_connection_selinux_security_context), bus/signals.c (connection_is_primary_owner): use bus_service_get_primary_owners_connection instead of bus_service_get_primary_owner * dbus/dbus-sysdeps.c (_dbus_connect_unix_socket, _dbus_listen_unix_socket): Calculate the length of the socket path and use that instead of using a fixed length which was causing socket names to contain many trailing Nul bytes. * dbus/dbus-glib-lowlevel.h, glib/dbus-gobject.c (dbus_g_method_get_sender): New method for extracting the sender from a DBusGMethodInvocation (dbus_g_method_return_get_reply): changed name to dbus_g_method_get_reply (dbus_g_method_return_send_reply): changed name to dbus_g_method_send reply * doc/dbus-specification.xml: New docs that describe how the new queueing system works and talks about the changes to the how we specify socket names * glib/examples/example-service.c, glib/examples/example-signal-emitter.c, glib/examples/statemachine/statemachine-server.c: Changed the RequestName flags to the new system * test/name-test/ (test-names.c, run-test.sh, Makefile.am): New regression test suite for testing various states of the new queueing system glib/dbus-gobject.c | 28 +++++++++++++++++++--- glib/examples/example-service.c | 2 +- glib/examples/example-signal-emitter.c | 2 +- glib/examples/statemachine/statemachine-server.c | 2 +- 4 files changed, 28 insertions(+), 6 deletions(-) commit 57b6ef4e8648c0c7f9b059690c4a35e73932669f Author: Robert McQueen Date: 2005-11-15 19:34:32 +0000 2005-11-15 Robert McQueen * dbus/dbus-glib-lowlevel.h, glib/dbus-gobject.c: Patch from Rob Taylor to add two methods, dbus_g_method_return_get_reply and dbus_g_method_return_send_reply, to allow you to get the reply message from a DBusGMethodInvocation, append arbitrary stuff to it, and send it. The GLib bindings can't marshal a return value of something like a(s) if the array is empty - ultimately they should be made to heed the signature of the out arguments as the Python bindings now can, but this is a workable interim solution which might have other applications. glib/dbus-gobject.c | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) commit cf87837198ac181b16965dcc8fb3f65bc2efa8bd Author: Robert McQueen Date: 2005-10-29 17:02:58 +0000 2005-10-29 Robert McQueen * glib/Makefile.am, glib/examples/Makefile.am, glib/examples/statemachine/Makefile.am: Merge patch from Ubuntu by Daniel Stone to replace explicit calls to libtool with $(LIBTOOL). * test/python/.cvsignore: Add run-with-tmp-session-bus.conf. * tools/dbus-monitor.1, tools/dbus-monitor.c: Merge dbus-monitor patch from Ubuntu by Daniel Silverstone to allow specifying match rules on the command line. glib/Makefile.am | 2 +- glib/examples/Makefile.am | 4 ++-- glib/examples/statemachine/Makefile.am | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) commit 3a8319b792df4ce260f8cf1e0f95fadd76942d75 Author: Ross Burton Date: 2005-10-27 16:35:43 +0000 Cleanups glib/dbus-gobject.c | 1 + 1 file changed, 1 insertion(+) commit 29f0ea31b256784b4e75cdedcb822f30fe804dd3 Author: Ross Burton Date: 2005-10-25 15:57:13 +0000 Add const keywords glib/dbus-gmain.c | 2 +- glib/dbus-gobject.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) commit f4b2bdf28c5e589d9161e27bf89e636c8226169f Author: Ross Burton Date: 2005-10-25 08:54:57 +0000 Add a NoReply annotation glib/dbus-binding-tool-glib.c | 53 ++++++++++++++++++++++++++++------------- glib/dbus-binding-tool-glib.h | 3 ++- 2 files changed, 39 insertions(+), 17 deletions(-) commit adc1cd1de84b057cc858b1226522d2fde96871a0 Author: John (J5) Palmieri Date: 2005-10-18 04:38:04 +0000 * glib/dbus-gvalue-utils.c (hash_free_from_gtype): handle gdouble and G_TYPE_VALUE_ARRAY (DBUS_TYPE_STRUCT) (gvalue_from_hash_value, hash_value_from_gvalue): handle gdouble * glib/dbus-gvalue.c (dbus_gvalue_to_signature): add missing DBUS_STRUCT_BEGIN_CHAR and DBUS_STRUCT_END_CHAR charaters when constructing struct signatures * python/_dbus.py (Bus): handle private connections using the private keyword in the constructor. defaults to private=False (Bus::close): new method to close a connection to the bus * python/dbus_bindings.pyx (Connection::close): renamed method was previously called disconnect (bus_get): now supports getting a private connection * python/proxies.py (ProxyMethod::__call__): check if ignore_reply keyword is set to True. if it is, execute the method without waiting for a reply (ProxyObject::_introspect_execute_queue): new method for executing all the pending methods that were waiting for the introspect to finish. this is called when introspect either succeeds or fails (ProxyObject::_introspect_error_handler): call queued methods glib/dbus-gvalue-utils.c | 17 +++++++++++++++++ glib/dbus-gvalue.c | 4 +++- 2 files changed, 20 insertions(+), 1 deletion(-) commit 8c16af02c159982b451289945835a86ff56805c2 Author: John (J5) Palmieri Date: 2005-10-05 20:43:46 +0000 * glib/dbus-gvalue.c (marshal_variant): call _dbus_gvalue_marshal instead of marshal basic so we can handle recursive types in a variant * test/glib/test-dbus-glib.c: Add test for marshaling recurive types in variants * test/glib/test-service-glib.c, test-service-glib.xml (my_object_echo_variant [EchoVariant], my_object_process_variant_of_array_of_ints123 [ProcessVariantOfArrayOfInts123]): Add two test methods * python/introspect_parser.py: New module for parsing introspect data. * python/dbus_bindings.pyx: (various places): when throwing errors fix to use errormsg instead of message local variable because Pyrex can get confused with other message variables (initial patch by Robert McQueen ) (MessageIter::parse_signature_block): new method for getting the next block in a signiture. (MessageIter::append_strict): new method for appending values strictly using the passed in signature instead of guessing at the type (MessageItter:: append_dict, append_struct, append_array): use signatures to marshal children if the signature is available * python/exceptions.py (IntrospectionParserException): new exception * python/proxies.py (ProxyMethod::__call__): Marshal args with introspected signatures if available, else we fall back to the old way of doing things. (ProxyObject::_introspect_reply_handler ): parse introspection data * python/service.py (ObjectType::_reflect_on_method): Properly terminate if there are no args in the reflection data * test/python/test-client.py: add tests for talking with the GLib test server. This gives us better coverage for introspection since python to python will always generate arguments as variants. It also allows us to test the robustness of the GLib bindings and interlanguage communications. glib/dbus-gvalue.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit b489f57506320ba3e29088dc612e27112c6a1854 Author: John (J5) Palmieri Date: 2005-09-26 22:26:38 +0000 * glib/dbus-glib-tool.c: removed extra comma at the end of the DBusBindingOutputMode enum which was causing a warning. #include so using time_t is explicitly defined glib/dbus-glib-tool.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit a32ca0058020e7e23d72d9ad69fe881ba8b98e93 Author: John (J5) Palmieri Date: 2005-09-06 22:38:54 +0000 * Released 0.50 * Patch from Steve Grubb: - bus/activation.c (bus_activation_service_reload_test): clean up some indentation - dbus/dbus-keyring.c (_dbus_keyring_reload): fix conditional - dbus/dbus-message-factory.c (generate_special): fix a couple of buffer overflows in the test suite. This is non critical because it can not be exploited and this code is only run when doing a make check. * Patch from Yaakov Selkowitz: Build fixes for Cygwin - configure.in: Don't check and link against kdecore, only qt headers - dbus/Makefile.am: Add -no-undefined to libdbus_1_la_LDFLAGS - gcj/org/freedesktop/dbus/Makefile.am: add libdbus_gcj_1_la_LDFLAGS = -no-undefined - glib/Makefile.am: Add -no-undefined to libdbus_glib_1_la_LDFLAGS and $(DBUS_GLIB_LIBS) to dbus_binding_tool_LDADD - qt/Makefile.am: Add -no-undefined to libdbus_qt_1_la_LDFLAGS - tools/Makefile.am: Add platform extentions to binaries (i.e. .exe on windows) * configure.in: - Make it so if no suitable version of python is found we only disable building python instead of exiting the configure script - Require version 2.4 of glib for glib bindings - Up version to 0.50 * python/__init__.py: Sync version with libdbus to (0,50,0) glib/Makefile.am | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) commit 23fb630c1e907187c8d7aa5539b30a34e7cc9632 Author: Colin Walters Date: 2005-08-26 02:00:37 +0000 2005-08-25 Colin Walters * glib/dbus-gproxy.c (dbus_g_proxy_call): Doc update, thanks to Ryan Lortie for the suggestion. glib/dbus-gproxy.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit 8e13d06500c5b4df219891fc4b5b8242cb9f5cae Author: Ross Burton Date: 2005-08-17 17:30:45 +0000 Unref message and protect against NULL glib/dbus-gproxy.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) commit 03dc49be2e41245f107e71194ebef428d4d4ccf7 Author: Colin Walters Date: 2005-08-16 21:26:12 +0000 2005-08-16 Colin Walters * glib/dbus-gobject.c (dbus_set_g_error): Don't lose if the DBusError message is NULL. glib/dbus-gobject.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 20ab99c264aa730de304f637a7e4eacec3e1686d Author: Colin Walters Date: 2005-08-04 15:49:30 +0000 2005-08-04 Colin Walters * glib/dbus-gvalue-utils.h (_dbus_g_type_specialized_builtins_init) (dbus_g_type_is_fixed, dbus_g_type_fixed_get_size) (dbus_gvalue_set_from_pointer, dbus_g_hash_table_value_foreach) (dbus_g_hash_table_insert_values, dbus_g_hash_table_insert_steal_values) (dbus_gtype_is_valid_hash_key, dbus_gtype_is_valid_hash_value) (dbus_g_hash_func_from_gtype, dbus_g_hash_free_from_gtype) (dbus_g_hash_equal_from_gtype, dbus_gvalue_stor, dbus_gvalue_take): * glib/dbus-gvalue.h (dbus_g_value_types_init) (dbus_gvalue_demarshal, dbus_gvalue_demarshal_variant) (dbus_gvalue_demarshal_message, dbus_gvalue_marshal): Prefix name with _ to ensure they're not exported. All callers updated. * glib/dbus-gvalue.c (typecode_to_gtype) (dbus_typecode_maps_to_basic, basic_typecode_to_gtype) (signature_iter_to_g_type_dict) (signature_iter_to_g_type_array) (dbus_gtype_from_signature_iter, dbus_gtype_from_signature) (dbus_gtypes_from_arg_signature): Move to dbus-gsignature.c. * glib/dbus-binding-tool-glib.c (dbus_binding_tool_output_glib_server): Call dbus_g_type_specialized_builtins_init instead of dbus_g_value_types_init. (dbus_binding_tool_output_glib_client): Ditto. * glib/Makefile.am (DBUS_GLIB_INTERNALS): Add dbus-gsignature.c and dbus-gsignature.h * test/glib/test-service-glib.c (my_object_rec_arrays): Delete unused variable. glib/Makefile.am | 5 +- glib/dbus-binding-tool-glib.c | 36 ++++--- glib/dbus-gmain.c | 23 ++-- glib/dbus-gobject.c | 35 +++--- glib/dbus-gproxy.c | 13 +-- glib/dbus-gsignature.c | 189 ++++++++++++++++++++++++++++++++ glib/dbus-gsignature.h | 19 ++++ glib/dbus-gvalue-utils.c | 46 ++++---- glib/dbus-gvalue-utils.h | 28 ++--- glib/dbus-gvalue.c | 237 +++++++---------------------------------- glib/dbus-gvalue.h | 21 ++-- 11 files changed, 350 insertions(+), 302 deletions(-) commit f19bb3b8b599f006e51a1ff81447ac6470c249fc Author: Colin Walters Date: 2005-08-03 23:21:49 +0000 2005-08-03 Colin Walters * glib/dbus-gobject.c: Add tests on hardcoded object info; this should catch any incompatible changes accidentally made. glib/dbus-gobject.c | 150 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 150 insertions(+) commit f902eead6b209181f7a26b4cb1a967661ac86117 Author: Colin Walters Date: 2005-08-01 16:12:53 +0000 2005-08-01 Colin Walters Patch from Joe Markus Clarke: * glib/dbus-gidl.c (property_info_unref, arg_info_unref): Fix use-after-free. glib/dbus-gidl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit db1be2d67b4239496940080f44c7e05eed42a610 Author: Colin Walters Date: 2005-08-01 16:07:19 +0000 2005-08-01 Colin Walters Patch from Joe Markus Clarke: * glib/dbus-gvalue.c (dbus_g_value_types_init): * glib/dbus-gvalue-utils.c (dbus_g_type_specialized_builtins_init) * glib/dbus-gobject.c (write_interface): Don't use C99 style initializers (bug #3933). glib/dbus-gobject.c | 2 +- glib/dbus-gvalue-utils.c | 7 +++---- glib/dbus-gvalue.c | 8 ++++---- 3 files changed, 8 insertions(+), 9 deletions(-) commit 04045b587a62e4b5cafbad0b81e18761c28a41e5 Author: Havoc Pennington Date: 2005-07-31 02:09:15 +0000 2005-07-30 Havoc Pennington * fix a bunch of Doxygen warnings and mistakes glib/dbus-glib.c | 4 ++-- glib/dbus-gobject.c | 2 +- glib/dbus-gproxy.c | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) commit f91e8613d913ee943afa5bbb6cdafb2ce062c6ef Author: Ross Burton Date: 2005-07-25 19:16:22 +0000 Remove matchers when all proxies are removed glib/dbus-gproxy.c | 6 ++++++ 1 file changed, 6 insertions(+) commit 2c755e157a9b41451efd5fd88e74c37501e21127 Author: Colin Walters Date: 2005-07-24 18:04:23 +0000 2005-07-24 Colin Walters * glib/dbus-gvalue.c (signature_iter_to_g_type_array): Don't require typedata; recursive arrays won't have it. * test/glib/test-dbus-glib.c: * test/glib/test-service-glib.c: * test/glib/test-service-glib.xml: Add recursive arrays tests. glib/dbus-gvalue.c | 5 ----- 1 file changed, 5 deletions(-) commit 6bf40ec5a63f7703070f951130d8e78cb044ec66 Author: John (J5) Palmieri Date: 2005-07-15 20:28:05 +0000 * glib/Makefile.am: Add make-dbus-glib-error-switch.sh to EXTRA_DIST so distcheck doesn't fail * glib/examples/Makefile.am: Add example-service.xml and example-signal-emitter.xml to EXTRA_DIST so distcheck doesn't fail * glib/examples/statemachine/Makefile.am: Add statemachine.xml and statemachine-server.xml to EXTRA_DIST so distcheck doesn't fail * python/Makefile.am: Preprend $(srcdir)/ to source files so the compiler looks in the right places during distcheck glib/Makefile.am | 2 +- glib/examples/Makefile.am | 2 ++ glib/examples/statemachine/Makefile.am | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) commit a447f257bd0b557b661be74f2d63ba0d31366a46 Author: John (J5) Palmieri Date: 2005-07-15 19:15:05 +0000 * glib/example/Makefile.am: Fix a typo which cause make distcheck to fail glib/examples/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit ce277d89860aaf05064d11eb24878cbf41326ff2 Author: Ross Burton Date: 2005-07-15 13:25:48 +0000 Don't leak messages when calling methods glib/dbus-gproxy.c | 1 + 1 file changed, 1 insertion(+) commit 877add82e329e1de4ab7b4d99084362e250fa34c Author: Colin Walters Date: 2005-07-12 17:57:04 +0000 2005-07-12 Colin Walters * glib/examples/statemachine/Makefile.am (statemachine-server-glue.h) (statemachine-glue.h): * glib/examples/Makefile.am (example-service-glue.h) (example-signal-emitter-glue.h): * glib/Makefile.am (dbus-glib-error-switch.h): Add libtool --mode=execute so we use the built library instead of any installed one. glib/Makefile.am | 2 +- glib/examples/Makefile.am | 4 ++-- glib/examples/statemachine/Makefile.am | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) commit 31ca9e74c599c17f802698ad8184f9ae654983c5 Author: Colin Walters Date: 2005-07-11 16:12:49 +0000 2005-07-11 Colin Walters * glib/dbus-gvalue.c (struct _DBusGValue): Delete. (dbus_g_value_types_init): Remove assertion. (dbus_g_value_get_g_type, dbus_g_value_open) (dbus_g_value_iterator_get_values, dbus_g_value_get_signature) (dbus_g_value_copy, dbus_g_value_free): Delete unimplemented functions related to DBusGValue. Now we marshal/demarshal structures as GValueArray. (dbus_gtype_from_signature_iter): Return G_TYPE_VALUE_ARRAY for structures. (signature_iter_to_g_type_array): Don't call signature_iter_to_g_type_struct. (signature_iter_to_g_type_struct): Delete. (dbus_gvalue_to_signature): Delete. (dbus_gvalue_to_signature): New function with same name as other one; we can convert structures to signatures. (demarshal_valuearray): New function. (get_type_demarshaller): Use it. (demarshal_recurse): Delete. (marshal_proxy): New function. (marshal_map): Warn if we can't determine signature from type. (marshal_collection_ptrarray): Ditto. (marshal_collection_array): Ditto. (get_type_marshaller): Use marshal_valuearray. (marshal_recurse): Delete. (_dbus_gvalue_test): Add some tests. * dbus/dbus-glib.h (struct _DBusGValueIterator): (dbus_g_value_get_g_type, DBUS_TYPE_G_VALUE) (dbus_g_value_open, dbus_g_value_iterator_get_value) (dbus_g_value_iterator_get_values, dbus_g_value_iterator_recurse) (dbus_g_value_free): Remove prototypes. * glib/dbus-binding-tool-glib.c (dbus_g_type_get_lookup_function): Handle G_TYPE_VALUE_ARRAY. * glib/examples/example-service.c: * glib/examples/example-client.c: Implement GetTuple. * test/glib/test-dbus-glib.c: * test/glib/test-service-glib.c: * test/glib/test-service-glib.xml: Add structure tests. glib/dbus-binding-tool-glib.c | 1 + glib/dbus-gvalue.c | 358 ++++++++++++++++++--------------------- glib/examples/example-client.c | 32 +++- glib/examples/example-service.c | 21 ++- 4 files changed, 209 insertions(+), 203 deletions(-) commit 5c39fa43d8eb87284abe7d009349523ad5398db0 Author: Colin Walters Date: 2005-07-10 22:54:18 +0000 2005-07-10 Colin Walters * doc/TODO: Knock off some GLib items with this patch. * glib/dbus-gvalue-utils.c (_dbus_gtype_can_signal_error) (_dbus_gvalue_signals_error): New functions. * glib/dbus-gvalue-utils.h: Prototype them. * glib/dbus-gobject.c (arg_iterate): Update to handle return vals and change to not output const/retval flags for input args. All callers updated. (invoke_object_method): Refactor to handle return values. Add some more comments in various places. Remove debug g_print. * glib/dbus-binding-tool-glib.h (DBUS_GLIB_ANNOTATION_RETURNVAL): New. * glib/dbus-binding-tool-glib.c (dbus_g_type_get_marshal_name): Handle G_TYPE_NONE. (compute_gsignature): New function; refactored from code from compute_marshaller and compute_marshaller_name. Enhance to handle return values and async ops more cleanly. Update for async ops returning NONE instead of BOOLEAN. (compute_marshaller, compute_marshaller_name): Call compute_gsignature and output appropriate string. (generate_glue): Handle return value annotation. Also don't dump constness flag for input arguments. * glib/Makefile.am (DBUS_GLIB_INTERNALS): New variable; contains files shared between installed library and utilities. (libdbus_glib_1_la_SOURCES): Move some stuf into DBUS_GLIB_INTERNALS. (libdbus_gtool_la_SOURCES): Suck in DBUS_GLIB_INTERNALS so the binding tool can access gtype utility functions. * test/glib/test-service-glib.c: * test/glib/test-service-glib.xml: * test/glib/test-dbus-glib.c: Add some tests for return values. glib/Makefile.am | 19 +- glib/dbus-binding-tool-glib.c | 324 ++++++++++++++++++++++----------- glib/dbus-binding-tool-glib.h | 1 + glib/dbus-gobject.c | 242 ++++++++++++++++++------ glib/dbus-gvalue-utils.c | 54 ++++++ glib/dbus-gvalue-utils.h | 4 + glib/examples/statemachine/.cvsignore | 1 + 7 files changed, 479 insertions(+), 166 deletions(-) commit 00de44640de45aa6068ca9d1b42deb801b430320 Author: Colin Walters Date: 2005-07-09 18:54:45 +0000 2005-07-09 Colin Walters * glib/dbus-gparser.c (parse_annotation): Add annotations to argument if available, not method. * glib/dbus-gobject.c (arg_iterate): More verbose warnings. (invoke_object_method): First, remove some redundant GValues (object_value, error_value) in favor of working on array directly. Second, rework constness to be less buggy. Now we iterate directly over the argument metadata instead of parallel iterating over output signature and metadata. * glib/dbus-glib-tool.h: Add INVALID_ANNOTATION error. * glib/dbus-binding-tool-glib.c (generate_glue): Barf on const annotation on input args. glib/dbus-binding-tool-glib.c | 17 +++++++++++-- glib/dbus-glib-tool.h | 3 ++- glib/dbus-gobject.c | 54 ++++++++++++++++++++++++----------------- glib/dbus-gparser.c | 7 +++--- 4 files changed, 52 insertions(+), 29 deletions(-) commit 91dc6d18c4ccc69fef3c12e6f628f7458c1d4511 Author: Colin Walters Date: 2005-07-09 17:52:51 +0000 2005-07-09 Colin Walters * glib/dbus-binding-tool-glib.h (DBUS_GLIB_ANNOTATION_CONST): Define. * glib/dbus-binding-tool-glib.c (generate_glue): Handle Const annotation. * glib/dbus-gobject.c (arg_iterate): Update to parse constval too. (method_dir_signature_from_object_info): Handle arg_iterate change. (write_interface): Ditto. (lookup_object_info): Don't barf if format_version is > 0. (invoke_object_method): Handle arg constness. * glib/dbus-gidl.c (struct ArgInfo): Add annotations. (arg_info_new): Create. (arg_info_unref): Destroy. (arg_info_get_annotations, arg_info_get_annotation) (arg_info_add_annotation): New functions. * glib/dbus-gidl.h: Prototype them. * glib/dbus-gparser.c (parse_annotation): Allow annotations in args, disallow them in properties. (parse_annotation): Handle arg annotations. * test/glib/test-service-glib.xml: * test/glib/test-service-glib.c: Update to make some methods const. glib/dbus-binding-tool-glib.c | 6 ++++++ glib/dbus-binding-tool-glib.h | 1 + glib/dbus-gidl.c | 30 ++++++++++++++++++++++++++ glib/dbus-gidl.h | 7 ++++++ glib/dbus-gobject.c | 48 +++++++++++++++++++++++++++++++++++------ glib/dbus-gparser.c | 5 ++++- 6 files changed, 89 insertions(+), 8 deletions(-) commit 52438e8f3f67fa96ffd9607bad34968875d90226 Author: Colin Walters Date: 2005-07-09 01:46:51 +0000 2005-07-08 Colin Walters * test/glib/test-service-glib.xml: * test/glib/test-service-glib.c: * test/glib/test-dbus-glib.c: Test a{sv}. * glib/examples/statemachine/statemachine.c: * glib/examples/statemachine/statemachine-server.c: * glib/examples/statemachine/statemachine-client.c: Fix some bugs, add progress bar, etc. * glib/dbus-gvalue.c (register_array, register_dict): Delete; not needed anymore due to generic array/map marshalling. (dbus_g_value_types_init): Don't register basic arrays or the string/string hash. (dbus_gtype_from_signature_iter): Don't try to recurse into variants. (dbus_gtype_to_signature): Check collection/map before type metadata. (demarshal_garray_basic): Renamed to demarshal_collection_array. (demarshal_ghashtable): Renamed to demarshal_map; fix to use new generic map creation/append functions instead of hash table specifically. (get_type_demarshaller): Handle maps. (demarshal_collection): Dispatch on collection type to either demarshal_collection_ptrarray or demarshal_collection_array. (get_type_marshaller): Handle maps. (marshal_collection): Dispatch collection type to either marshal_collection_ptrarray or marshal_collection_array. (_dbus_gvalue_test): New test. * glib/dbus-gvalue-utils.c (unset_and_free_g_value): New function. (hash_free_from_gtype): Use it to free GValues. (hashtable_append): New function. (ptrarray_append): Fix prototype. (slist_append): Ditto. (_dbus_gvalue_utils_test): Extend tests. * glib/dbus-gtype-specialized.c (dbus_g_type_specialized_init_append): Renamed from dbus_g_type_specialized_collection_init_append. Remove const from value, since we steal it. (dbus_g_type_specialized_map_append): New function. * glib/dbus-gtype-specialized.h: Update prototypes. Add DBusGTypeSpecializedMapAppendFunc. * glib/dbus-gtest.c (dbus_glib_internal_do_not_use_run_tests): Run _dbus_gvalue_test. * glib/dbus-gtest.h: Prototype it. glib/dbus-gtest.c | 4 + glib/dbus-gtest.h | 1 + glib/dbus-gtype-specialized.c | 13 +- glib/dbus-gtype-specialized.h | 15 +- glib/dbus-gvalue-utils.c | 116 ++++++- glib/dbus-gvalue.c | 402 +++++++++++----------- glib/examples/statemachine/statemachine-client.c | 192 +++++++++-- glib/examples/statemachine/statemachine-server.c | 27 ++ glib/examples/statemachine/statemachine.c | 44 +-- 9 files changed, 555 insertions(+), 259 deletions(-) commit 6758d07f4dd3bee533488381c8cf236d9d99a5f0 Author: Ross Burton Date: 2005-07-08 17:02:42 +0000 Make async bindings work again glib/dbus-binding-tool-glib.c | 31 +++++++++++++------------------ 1 file changed, 13 insertions(+), 18 deletions(-) commit 8068477b92f2ee5ca19623e033e335d4b16d8de5 Author: Colin Walters Date: 2005-07-08 16:25:28 +0000 2005-07-08 Colin Walters * tools/Makefile.am: Kill of print-introspect in favor of using dbus-send --print-reply=literal. * tools/print-introspect.c: Deleted. * test/glib/test-service-glib.xml: * test/glib/test-service-glib.c (my_object_get_objs): New test for "ao". * test/glib/test-dbus-glib.c (echo_received_cb): Free echo data. (main): Test GetObjs. * glib/examples/statemachine/Makefile.am: * glib/examples/statemachine/sm-marshal.list: * glib/examples/statemachine/statemachine-client.c: * glib/examples/statemachine/statemachine-server.c: * glib/examples/statemachine/statemachine-server.xml: * glib/examples/statemachine/statemachine.c: * glib/examples/statemachine/statemachine.h: * glib/examples/statemachine/statemachine.xml: New example. * glib/examples/example-service.c (main): Move invocation of dbus_g_object_type_install_info earlier, to emphasize it should only be done once. * glib/examples/example-signal-emitter.c (main): Ditto. * glib/examples/Makefile.am (SUBDIRS): Include statemachine. * glib/dbus-gvalue.h (dbus_gtype_to_signature) (dbus_gvalue_marshal): Update prototypes. * glib/dbus-gvalue.c: Update all marshalling functions to take const GValue instead of GValue. (signature_iter_to_g_type_array): Return a GPtrArray for nonfixed types. (dbus_gvalue_to_signature): Update for dbus_gtype_to_signature change. (dbus_gtype_to_signature): Handle generic collecitons and maps. Return a newly-allocated string. (demarshal_proxy, demarshal_object_path, demarshal_object) (demarshal_strv, demarshal_ghashtable): Set error, don't assert if we get the wrong types from message. (get_type_demarshaller): New function, extracted from dbus_gvalue_demarshal. (demarshal_collection): New function, demarshals generic collection. (dbus_gvalue_demarshal): Just invoke result of get_type_demarshaller. Throw error if we don't have one. (marshal_garray_basic): Abort on OOM. (get_type_marshaller): New function, extracted from dbus_gvalue_marshal. (collection_marshal_iterator, marshal_collection): New functions; implements generic marshalling for an iteratable specialized collection. (dbus_gvalue_marshal): Just invoke result of get_type_marshaller. * glib/dbus-gvalue-utils.c (gvalue_from_ptrarray_value): Handle G_TYPE_STRING. (ptrarray_value_from_gvalue): Ditto. (ptrarray_append, ptrarray_free): New functions. (slist_constructor, slist_iterator, slist_copy_elt, slist_copy) (slist_append, slist_end_append, slist_free): New functions. (dbus_g_type_specialized_builtins_init): Add append fuctions for GPtrArray and GSList. Register GSList. (test_specialized_hash, _dbus_gvalue_utils_test): New functions. * glib/dbus-gtype-specialized.h (DBusGTypeSpecializedAppendContext): New. (dbus_g_type_specialized_collection_init_append) (dbus_g_type_specialized_collection_append) (dbus_g_type_specialized_collection_end_append): Prototype. (DBusGTypeSpecializedCollectionVtable): Add append_func and end_append_func. * glib/dbus-gtype-specialized.c (dbus_g_type_specialized_collection_init_append) (dbus_g_type_specialized_collection_append) (dbus_g_type_specialized_collection_end_append): New functions. (dbus_g_type_map_value_iterate): Take const GValue. (dbus_g_type_collection_value_iterate): Ditto. * glib/dbus-gtest.c (dbus_glib_internal_do_not_use_run_tests): Run _dbus_gvalue_utils_test. * glib/dbus-gtest.h: Prototype it. * glib/dbus-gproxy.c (dbus_g_proxy_manager_filter): Avoid using uninitialized owner_list. (dbus_g_proxy_begin_call_internal): Move return_if_fail to public API. (dbus_g_proxy_end_call_internal): Update to use error set from dbus_gvalue_demarshal instead of setting it here. (dbus_g_proxy_begin_call): Move return_if_fail here. * glib/dbus-gobject.c (write_interface): Update for dbus_gtype_to_signature returning new string. * configure.in: Add glib/examples/statemachine. glib/dbus-gobject.c | 6 +- glib/dbus-gproxy.c | 31 +- glib/dbus-gtest.c | 7 + glib/dbus-gtest.h | 1 + glib/dbus-gtype-specialized.c | 44 +- glib/dbus-gtype-specialized.h | 32 +- glib/dbus-gvalue-utils.c | 261 +++++++++- glib/dbus-gvalue-utils.h | 1 - glib/dbus-gvalue.c | 388 +++++++++++--- glib/dbus-gvalue.h | 4 +- glib/examples/Makefile.am | 2 + glib/examples/example-service.c | 4 +- glib/examples/example-signal-emitter.c | 4 +- glib/examples/statemachine/.cvsignore | 15 + glib/examples/statemachine/Makefile.am | 35 ++ glib/examples/statemachine/sm-marshal.list | 1 + glib/examples/statemachine/statemachine-client.c | 540 ++++++++++++++++++++ glib/examples/statemachine/statemachine-server.c | 202 ++++++++ glib/examples/statemachine/statemachine-server.h | 37 ++ glib/examples/statemachine/statemachine-server.xml | 14 + glib/examples/statemachine/statemachine.c | 351 +++++++++++++ glib/examples/statemachine/statemachine.h | 77 +++ glib/examples/statemachine/statemachine.xml | 33 ++ 23 files changed, 1983 insertions(+), 107 deletions(-) commit 8b39e9d32cb505d4f9550ca24627020e5edd9681 Author: Colin Walters Date: 2005-07-06 21:27:45 +0000 2005-07-06 Colin Walters * dbus/dbus-glib.h (DBusGPendingCall, DBusGPendingCallNotify) (DBUS_TYPE_G_PENDING_CALL, dbus_g_pending_call_get_g_type) (dbus_g_pending_call_ref, dbus_g_pending_call_unref): Delete. (dbus_g_pending_call_set_notify, dbus_g_pending_call_cancel): Delete in favor of dbus_g_proxy_begin_call and dbus_g_proxy_cancel_call. (DBusGProxyCall, DBusGProxyCallNotify): New. (dbus_g_proxy_begin_call): Change prototype to take callback, user data, and destroy function. This replaces dbus_g_pending_call_set_notify. (dbus_g_proxy_cancel_call): Prototype. (DBusGAsyncData): Delete, shouldn't be needed anymore. * glib/dbus-gproxy.c (struct _DBusGProxy): Add call_id_counter and pending_calls map. (struct _DBusGProxyManager): Add bus_proxy member, which is an internal proxy for calls to the bus. Remove pending_nameowner_calls, now the internal proxy keeps track. (dbus_g_proxy_manager_unref): Unref bus proxy, remove reference to pending_nameowner_calls. (got_name_owner_cb): Update prototype, and use dbus_g_proxy_end_call. (got_name_owner_cb): Remove reference to pending_nameowner_calls. (dbus_g_proxy_manager_register): Delete directly libdbus code in favor of using internal proxy. (dbus_g_proxy_manager_unregister): Update to use dbus_g_proxy_cancel_call for any pending GetNameOwner call. (dbus_g_proxy_init): Initialize pending calls map. (dbus_g_proxy_constructor): New. (dbus_g_proxy_class_init): Add get/set property functions, constructor, and add NAME, PATH, and INTERFACE properties. (cancel_pending_call): New function. (dbus_g_proxy_dispose): Iterate over any outstanding calls and cancel them. (dbus_g_proxy_set_property, dbus_g_proxy_get_property): New. (GPendingNotifyClosure): New structure. (d_pending_call_notify, d_pending_call_free): Moved here from dbus-glib.c. (DBUS_G_VALUE_ARRAY_COLLECT_ALL): Moved around to satisfy function ordering. (manager_begin_bus_call): New internal function for talking to internal bus proxy. (dbus_g_proxy_new): Construct object using GObjet properties. (dbus_g_proxy_begin_call_internal): Update to take user data, etc. Create closure of same, and insert call into map of pending calls. (dbus_g_proxy_end_call_internal): Take call id instead of pending call. Look up pending call in current set. Remove it when we've completed. (dbus_g_pending_call_end, dbus_g_proxy_end_call_internal): Delete. (dbus_g_proxy_begin_call): Change API to take callback, user data, and destroy function directly. (dbus_g_proxy_end_call): Update to take DBusGProxyCall. (dbus_g_proxy_call): Invoke with NULL callback. (dbus_g_proxy_cancel_call): New function, replaces dbus_g_pending_call_cancel. * glib/dbus-gparser.c (validate_signature): Fix call to dbus_set_g_error. * glib/dbus-gobject.c (dbus_g_object_type_dbus_metadata_quark): New quark for attaching metadata to GType. (info_hash): Delete. (lookup_object_info): Look up using quark. (dbus_g_object_type_install_info): Check that a type is classed, not that it's an object. Also just install type data using quark instead of using global hash. * glib/dbus-glib.c (dbus_g_pending_call_ref) (dbus_g_pending_call_unref, dbus_pending_call_get_g_type) (GPendingNotifyClosure): Delete. (d_pending_call_notify, d_pending_call_free): Move to dbus-gproxy.c. (dbus_g_pending_call_set_notify, dbus_g_pending_call_cancel): Delete. * glib/dbus-binding-tool-glib.c (generate_client_glue): Disable async client method generation until we can fix it... * tools/dbus-viewer.c (load_child_nodes): Use dbus_g_proxy_call. (load_from_service_thread_func): Ditto. * tools/dbus-names-model.c (struct NamesModel): Hold DBusGProxyCall. (have_names_notify): Update prototype, use dbus_g_proxy_cancel_call. (names_model_reload): Update for new dbus_g_proxy_begin_call API. * tools/dbus-monitor.c (filter_func): Update for print_message API change. * test/glib/test-dbus-glib.c: Add more tests for async invocations. Update many begin_call/end_call pairs to just use dbus_g_proxy_call. * tools/dbus-send.c (main): Add --print-reply=literal mode. This allows us to dump print-introspect.c. * tools/dbus-print-message.h (print_message): Add literal argument to print_message which is intended to allow printing arguments without metadata like "string=". * tools/dbus-print-message.c (print_iter): Add literal argument. (print_message): Allow printing string messages literally. glib/dbus-binding-tool-glib.c | 2 + glib/dbus-glib.c | 140 ----------- glib/dbus-gobject.c | 44 ++-- glib/dbus-gparser.c | 2 +- glib/dbus-gproxy.c | 555 +++++++++++++++++++++++++++-------------- 5 files changed, 390 insertions(+), 353 deletions(-) commit 462a36e4898da053ba749857511f2d634dbea665 Author: Colin Walters Date: 2005-07-05 16:39:56 +0000 2005-07-05 Colin Walters * glib/dbus-gproxy.c (marshal_dbus_message_to_g_marshaller): Remove value refcount leak, original patch from Jorn Baayen . Also remove useless extra value in favor of prepending to value array directly. glib/dbus-gproxy.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) commit d80b7960d7d189d7c33e6d230fdbbf8b69546f60 Author: Colin Walters Date: 2005-07-02 06:05:23 +0000 2005-07-02 Colin Walters * glib/dbus-gmain.c (_dbus_gmain_test): Fix test. glib/dbus-gmain.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit c7f14e3c337601053b08dc07a186be81063fc005 Author: Colin Walters Date: 2005-07-01 15:44:12 +0000 2005-07-01 Colin Walters Patch from Jonathan Matthew * glib/dbus-gvalue.c (basic_typecode_to_gtype): Fix return type. (dbus_g_value_types_init): Marshal G_TYPE_CHAR as DBUS_TYPE_BYTE, G_TYPE_LONG as DBUS_TYPE_INT32, G_TYPE_ULONG as DBUS_TYPE_UINT32, and G_TYPE_FLOAT as DBUS_TYPE_DOUBLE. glib/dbus-gvalue.c | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) commit 5c82c5ce0eba4ec3bbb0454f3987f56de968bf95 Author: Colin Walters Date: 2005-06-30 18:22:09 +0000 2005-06-30 Colin Walters * test/glib/test-dbus-glib.c: * test/glib/test-service-glib.c: * test/glib/test-service-glib.xml: Update tests for new error setting bits, also add async tests (patch from Ross Burton). * test/glib/Makefile.am (test_service_glib_LDADD): Add DBUS_GLIB_THREADS_LIBS. * glib/dbus-gproxy.c (get_name_owner) (dbus_g_pending_call_end_valist): Ditto. * glib/dbus-gobject.c (error_metadata): New mapping from GError domain (GQuark) to DBusGErrorInfo. (gerror_domaincode_to_dbus_error_name): Attempt to look up error quark in error_metadata. Take message interface as default error message interface. (gerror_to_dbus_error_message): Pass message interface. (dbus_set_g_error): Resurrected. (dbus_g_error_info_free): New function. (dbus_g_object_type_install_info): Use g_type_class_ref instead of _peek to actually create the object class if it hasn't been created yet. (dbus_g_error_domain_register): New function. * glib/dbus-gmain.c (dbus_g_bus_get): Switch to dbus_set_g_error. * glib/dbus-gparser.c (validate_signature): Ditto. * dbus/dbus-glib.h (dbus_g_error_set): Delete. (dbus_g_error_domain_register): Prototype. * glib/dbus-glib.c (dbus_g_error_set): Delete. Update tests. glib/dbus-glib.c | 45 +----------------- glib/dbus-gmain.c | 3 +- glib/dbus-gobject.c | 127 ++++++++++++++++++++++++++++++++++++++++++++++++++- glib/dbus-gparser.c | 3 +- glib/dbus-gproxy.c | 6 +-- 5 files changed, 134 insertions(+), 50 deletions(-) commit f879e3e832d76a7b3b02cc7d25a3e5b9ef195f42 Author: Colin Walters Date: 2005-06-29 23:52:35 +0000 2005-06-29 Colin Walters * dbus/dbus-glib.h: Delete DBUS_TYPE_G_PROXY_ARRAY. Add DBUS_TYPE_G_OBJECT_PATH. * glib/dbus-gvalue.c (dbus_g_value_types_init): Remove marshallers for G_TYPE_OBJECT and DBUS_TYPE_G_PROXY_ARRAY (the latter should be handled more generically). Add DBUS_TYPE_G_OBJECT_PATH. (dbus_g_object_path_get_g_type): New function. (dbus_gtype_from_signature_iter): Map DBUS_TYPE_OBJECT_PATH to DBUS_TYPE_G_OBJECT_PATH by default. (demarshal_proxy): Remove unused name variable. (demarshal_object_path, marshal_object_path): New functions. (demarshal_proxy_array, marshal_proxy_array): Delete. * glib/dbus-binding-tool-glib.c (dbus_g_type_get_c_name): Map DBUS_TYPE_G_OBJECT_PATH to char *. (dbus_g_type_get_lookup_function): Map builtin DBUS_TYPE_G_OBJECT_PATH. * test/glib/test-dbus-glib.c * test/glib/test-service-glib.c (my_object_objpath): Adapt tests to new object path marshalling. glib/dbus-binding-tool-glib.c | 5 +- glib/dbus-gvalue.c | 164 ++++++++++++++++------------------------- 2 files changed, 68 insertions(+), 101 deletions(-) commit 1f87d5d3363d1e23208c993eabb3cb1f0341b4d9 Author: Colin Walters Date: 2005-06-29 17:02:33 +0000 2005-06-29 Colin Walters Patch from Ross Burton * glib/dbus-gobject.c (invoke_object_method): Unset object value in all cases, not only in async case. glib/dbus-gobject.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 49fce903db4124277de6aba92f7c03f24d84e598 Author: Colin Walters Date: 2005-06-29 16:58:59 +0000 2005-06-29 Colin Walters * glib/dbus-gproxy.c (struct _DBusGProxy): Add new member name_call for keeping track of any outgoing GetNameOwner call. Also add for_owner and associated. (struct _DBusGProxyManager): Add owner_names, which is hash table that maps a base name to a list of names it owns (that we're interested in). Add pending_nameowner_calls which is a list of all outstanding GetNameOwner; avoids us having to iterate over every proxy. Add unassociated_proxies which keeps track of name proxies with no associated name owner. (dbus_g_proxy_manager_unref): Destroy owner_names. (struct DBusGProxyNameOwnerInfo): New struct for keeping track of name refcounts. (find_name_in_info, name_owner_foreach) (dbus_g_proxy_manager_lookup_name_owner, insert_nameinfo) (dbus_g_proxy_manager_monitor_name_owner) (dbus_g_proxy_manager_unmonitor_name_owner) (unassociate_proxies, dbus_g_proxy_manager_replace_name_owner): New functions; they manipulate the owner_names mapping. (got_name_owner_cb): New function. (get_name_owner): New function, extracted from dbus_g_proxy_new_for_name_owner. (dbus_g_proxy_manager_register): For now we need to keep track of all NameOwnerChanged. Also if the proxy is for a name, if we don't already know the name owner, queue a new GetNameOwner request and add it to our list of unassociated proxies. Otherwise inc the refcount. (dbus_g_proxy_manager_unregister): If this proxy is for a name, cancel any pending GetNameOwner call, etc. (dbus_g_proxy_manager_filter): Handle NameOwnerChanged. Also use the owner_names mapping to look up the current names for the signal source, and dispatch to any proxies for that name. (dbus_g_proxy_new): Initialize new members. (dbus_g_proxy_new_for_name): Delete unused proxy variable. (dbus_g_proxy_new_for_name_owner): Use get_name_owner. (dbus_g_pending_call_end_valist): New function, extracted from dbus_g_proxy_end_call_internal. Useful when we don't have a proxy but want to use the GLib infrastructure. Also note how many arguments in reply were over. (dbus_g_pending_call_end): New function, just call dbus_g_pending_call_end_valist. (dbus_g_proxy_end_call_internal): Just call dbus_g_pending_call_end_valist. * glib/dbus-gobject.c (_dbus_gobject_lookup_marshaller): Fix lookup of builtin marshaller for STRING_STRING_STRING. * test/glib/test-dbus-glib.c: * test/glib/test-service-glib.c: * test/glib/test-service-glib.xml: Extend tests to cover name proxies, destruction of owner proxies, etc. * glib/examples/example-signal-recipient.c (dbus_g_proxy_new_for_name_owner): Create a name proxy. * tools/dbus-send.c (main): Print D-BUS error name in addition to message. glib/dbus-gobject.c | 14 +- glib/dbus-gproxy.c | 780 ++++++++++++++++++++++++++---- glib/examples/example-signal-recipient.c | 9 +- 3 files changed, 689 insertions(+), 114 deletions(-) commit f2f505e8027bd4ef84b051ad9cd84ab86524b530 Author: Colin Walters Date: 2005-06-27 18:20:20 +0000 2005-06-27 Colin Walters * test/glib/test-dbus-glib.c: * test/glib/test-service-glib.c: * test/glib/test-service-glib.xml: Test hash table signal emitting. * glib/dbus-gobject.c (_dbus_gobject_lookup_marshaller): Convert types to their fundamental basis types, since this is what marshallers operate on. Also add an entry for VOID__BOXED. (dbus_g_object_register_marshaller_array): Convert to fundamental. glib/dbus-gobject.c | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) commit f0480850590afa233d7e1ad2b0c8250621c2bb9f Author: Colin Walters Date: 2005-06-26 17:02:09 +0000 2005-06-26 Colin Walters * glib/dbus-glib.c (dbus_set_g_error): Delete. (dbus_g_error_set): New public function from its ashes; used by both service-side method implementation and GLib bindings internals. (dbus_g_error_has_name, dbus_g_error_get_name): New function. (_dbus_glib_test): Add some tests. * test/glib/test-dbus-glib.c (main): Test dbus_g_error_has_name. * test/glib/test-service-glib.c (my_object_throw_error): Use dbus_g_error_set. * glib/dbus-gobject.c (gerror_to_dbus_error_message): Handle errors thrown by dbus_g_error_set. * glib/dbus-gmain.c (dbus_g_bus_get): Change to dbus_g_error_set. * glib/dbus-gparser.c (validate_signature): Ditto. * glib/dbus-gproxy.c (dbus_g_proxy_new_for_name_owner) (dbus_g_proxy_end_call_internal): Ditto. * glib/Makefile.am: Generate dbus-glib-error-switch.h, which converts DBUS_ERROR_x to DBUS_GERROR_x. (libdbus_glib_1_la_SOURCES, BUILT_SOURCES, CLEANFILES): Add it. * doc/TODO: Remove error TODO. * doc/dbus-tutorial.xml: Update with documentation about error handling. * dbus/make-dbus-glib-error-enum.sh: Tighten up regexp to make sure we only change DBUS_ERROR to DBUS_GERROR, not all ERROR to GERROR. Also add DBUS_GERROR_REMOTE_EXCEPTION. glib/.cvsignore | 1 + glib/Makefile.am | 8 +++ glib/dbus-glib.c | 109 ++++++++++++++++++++++++++++++----- glib/dbus-gmain.c | 2 +- glib/dbus-gobject.c | 15 +++-- glib/dbus-gparser.c | 2 +- glib/dbus-gproxy.c | 6 +- glib/make-dbus-glib-error-switch.sh | 29 ++++++++++ 8 files changed, 150 insertions(+), 22 deletions(-) commit ce03d4c9e9be4724a3255085b5ab5e51d9b9c196 Author: Colin Walters Date: 2005-06-22 23:35:32 +0000 2005-06-22 Colin Walters Patch from Ross Burton * glib/dbus-gobject.c (dbus_g_method_return): Free out_sig. glib/dbus-gobject.c | 1 + 1 file changed, 1 insertion(+) commit 6d152f08fa90bdc14d75b9091cccd5422faf3f11 Author: Colin Walters Date: 2005-06-21 01:18:25 +0000 2005-06-20 Colin Walters * configure.in: Add glib/examples. * glib/Makefile.am: Add examples/ * glib/examples/.cvsignore * glib/examples/Makefile.am * glib/examples/example-client.c * glib/examples/example-service.c * glib/examples/example-service.xml * glib/examples/example-signal-emitter.c * glib/examples/example-signal-emitter.xml * glib/examples/example-signal-recipient.c: New files; GLib binding examples, ported from python/examples. glib/Makefile.am | 2 + glib/examples/.cvsignore | 17 ++++ glib/examples/Makefile.am | 34 ++++++++ glib/examples/example-client.c | 107 +++++++++++++++++++++++ glib/examples/example-service.c | 138 ++++++++++++++++++++++++++++++ glib/examples/example-service.xml | 19 ++++ glib/examples/example-signal-emitter.c | 132 ++++++++++++++++++++++++++++ glib/examples/example-signal-emitter.xml | 13 +++ glib/examples/example-signal-recipient.c | 103 ++++++++++++++++++++++ 9 files changed, 565 insertions(+) commit ad05d7aa3b298fdc6c214550944e9aa1464a1e43 Author: Colin Walters Date: 2005-06-21 00:30:20 +0000 2005-06-20 Colin Walters * dbus/dbus-glib.h: * glib/dbus-gproxy.c: Rename dbus_g_proxy_invoke to dbus_g_proxy_call. * glib/dbus-binding-tool-glib.c: * doc/dbus-tutorial.xml: * test/glib/test-dbus-glib.c: Update for rename. glib/dbus-binding-tool-glib.c | 2 +- glib/dbus-gproxy.c | 18 ++++++++++-------- 2 files changed, 11 insertions(+), 9 deletions(-) commit 17ba4df65fdf4a7b65eedd2a4f10e616dd1b186c Author: Colin Walters Date: 2005-06-20 19:54:21 +0000 2005-06-20 Colin Walters Patch suggested by Ross Burton * glib/dbus-gobject.c (export_signals): Free signal name. (g_value_init): Use G_VALUE_NOCOPY_CONTENTS to plug memory leak. Add a bit of documentation. (dbus_g_method_return_error): Free context, and note we do so. glib/dbus-gobject.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) commit 01b89e61b5b98ad983babb506c9856aeadef2562 Author: Murray Cumming Date: 2005-06-19 15:31:25 +0000 2005-06-18 Murray Cumming * dbus/dbus-glib.h: * glib/dbus-gobject.c: * glib/dbus-gproxy.c: * glib/dbus-gvalue.c: Predeclare structs as typedef struct _Something Something instead of typedef struct Something Something, so we can redeclare the prototypes. Other GNOME libraries do this already. glib/dbus-gobject.c | 2 +- glib/dbus-gproxy.c | 8 ++++---- glib/dbus-gvalue.c | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) commit da18702f63a9f33d4f929113b6361062a86443a6 Author: Colin Walters Date: 2005-06-17 14:29:48 +0000 2005-06-17 Colin Walters * glib/dbus-gproxy.c (dbus_g_proxy_emit_remote_signal): Don't spew warnings if we get malformed remote signals. * glib/dbus-gobject.c (propsig_iterate): New function. (lookup_object_info): New function, extracted from lookup_object_and_method. (introspect_properties, introspect_signals): Delete; these are merged into write_interface. (write_interface): Write out signals and properties here; dump the org.gtk.object stuff and use the interface given in the introspection data blob. Also fix up property XML. (lookup_values): New function. (introspect_interfaces): Gather a mapping from interface to a list of its methods, signals, and properties, then write out each interface. (lookup_object_and_method): Use lookup_object_info. (struct DBusGSignalClosure): Add interface. (dbus_g_signal_closure_new): Add interface. Don't dup signame; we can just use the constant data. (dbus_g_signal_closure_finalize): Don't free signal name. (signal_emitter_marshaller): Use interface from signal closure. (export_signals): Only export signals mentioned in introspection blob. (dbus_g_connection_register_g_object): Warn if we have no introspection data for an object. (funcsig_equal): Remove unused variable. (dbus_g_object_register_marshaller): Take varargs instead of list. (dbus_g_object_register_marshaller_array): New function, extracted from old dbus_g_object_register_marshaller. * glib/dbus-binding-tool-glib.c (struct DBusBindingToolCData): Add signals and property data. (write_quoted_string): New function, extracted from generate_glue. (generate_glue): Write signals and properties to introspection blob. * dbus/dbus-glib.h (struct DBusGObjectInfo): Include exported_signals and exported_properties. (dbus_g_object_register_marshaller): Update prototype. (dbus_g_object_register_marshaller_array): Prototype. * test/glib/test-dbus-glib.c: Extend testing to cover new signals. * test/glib/test-service-glib.c: Add new test signals and method to emit them. * test/glib/test-service-glib.xml: Add some test signals. * test/glib/Makefile.am (BUILT_SOURCES): Add my-object-marshal.c and my-object-marshal.h (test_service_glib_SOURCES, test_dbus_glib_SOURCES): Add my-object-marshal.c. (my-object-marshal.c, my-object-marshal.h): Implement. * test/glib/.cvsignore: Update. * doc/TODO: Remove two GLib TODO items fixed by this patch. glib/dbus-binding-tool-glib.c | 88 +++++-- glib/dbus-gobject.c | 547 ++++++++++++++++++++++++----------------- glib/dbus-gproxy.c | 3 + 3 files changed, 394 insertions(+), 244 deletions(-) commit 5c64ac1e7abcb7013c640d8aa6621319341f228d Author: Colin Walters Date: 2005-06-16 19:50:24 +0000 2005-06-16 Colin Walters * glib/dbus-binding-tool-glib.c: * glib/dbus-gobject.c: * glib/dbus-gproxy.c: Add Nokia copyright; Patch from Ross Burton, for his GLib bindings work. glib/dbus-binding-tool-glib.c | 1 + glib/dbus-gobject.c | 1 + glib/dbus-gproxy.c | 1 + 3 files changed, 3 insertions(+) commit 87556105e7b984f8e56fc75d5c5ede8a69d63d12 Author: Colin Walters Date: 2005-06-16 19:45:49 +0000 2005-06-16 Colin Walters * glib/dbus-gobject.c (funcsig_hash, funcsig_equal): Use n_params to iterate instead of walking to G_TYPE_INVALID. Patch based on a patch from Ryan Gammon. glib/dbus-gobject.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) commit b274594d1f15e23be62d3ae2693524652ff58752 Author: Colin Walters Date: 2005-06-16 04:38:11 +0000 2005-06-16 Colin Walters * glib/dbus-gvalue.c (marshal_basic): Marshal NULL string values as the empty string (#2948). glib/dbus-gvalue.c | 2 ++ 1 file changed, 2 insertions(+) commit 702f09f4f45225f603a6d17ae77c3360c428855a Author: Colin Walters Date: 2005-06-14 15:55:10 +0000 2005-06-14 Colin Walters * glib/dbus-binding-tool-glib.c: * glib/dbus-gobject.c: * glib/dbus-gvalue.c: Fix indentation and brace style. glib/dbus-binding-tool-glib.c | 74 ++++++++-------- glib/dbus-gobject.c | 190 +++++++++++++++++++++-------------------- glib/dbus-gvalue.c | 11 +-- 3 files changed, 145 insertions(+), 130 deletions(-) commit ceb44c57e8ebc78ef420597bae484f7713c2e8bf Author: Colin Walters Date: 2005-06-14 15:49:43 +0000 2005-06-14 Ross Burton . * glib/dbus-glib.h: Make DBusGMethodInvocation a private structure. Rearrange prototypes a bit. * glib/dbus-gproxy.c (dbus_g_proxy_invoke): Add documentation for first_arg_type. * glib/dbus-gobject.c: Move DBusGMethodInvocation here, add documentation. Move dbus_g_method_return and dbus_g_method_return_error into public API section. glib/dbus-gobject.c | 119 ++++++++++++++++++++++++++++++--------------------- glib/dbus-gproxy.c | 1 + 2 files changed, 71 insertions(+), 49 deletions(-) commit 72b52186a73aac9f4d0ae1868fe1dedcedf3a6e6 Author: Colin Walters Date: 2005-06-14 14:23:56 +0000 2005-06-14 Colin Walters * glib/dbus-gobject.c (_dbus_gobject_lookup_marshaller): Add missing return statements, noticed by Ross Burton. glib/dbus-gobject.c | 6 ++++++ 1 file changed, 6 insertions(+) commit 40617899dc08750ab5a8cd0fb176dc2111a95420 Author: Colin Walters Date: 2005-06-13 15:36:31 +0000 2005-06-13 Ross Burton . * glib/dbus-gobject.c: Handle errors on message demarshalling by sending error message back. * glib/dbus-gvalue.c: Initialize return variables. glib/dbus-gobject.c | 11 ++++++++--- glib/dbus-gvalue.c | 8 ++++---- 2 files changed, 12 insertions(+), 7 deletions(-) commit fc23d39a292cee7d4f9ee9a1df0c0141c69d0942 Author: Colin Walters Date: 2005-06-13 15:34:05 +0000 2005-06-13 Colin Walters * glib/Makefile.am: Fix thinko in last patch. glib/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 7c42065c67e99716130a5dec4e493bce3ccc9aaa Author: Colin Walters Date: 2005-06-13 14:56:51 +0000 2005-06-13 Colin Walters * glib/Makefile.am: Move dbus-gtype-specialized.c and dbus-gtype-specialized.h into a _HEADERS variable, install them. glib/Makefile.am | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) commit 8bcbafe775d6bc63290c5c73f138c1511b104c70 Author: Colin Walters Date: 2005-06-13 03:01:17 +0000 2005-06-12 Colin Walters Async signals and various bugfixes and testing by Ross Burton . * glib/dbus-gvalue.h: (struct DBusBasicGValue): Delete. (dbus_gvalue_genmarshal_name_from_type) (dbus_gvalue_ctype_from_type): Moved to dbus-binding-tool-glib.c. (dbus_gtype_to_dbus_type): Renamed to dbus_gtype_from_signature. (dbus_g_value_types_init, dbus_gtype_from_signature) (dbus_gtype_from_signature_iter, dbus_gtype_to_signature) (dbus_gtypes_from_arg_signature): New function prototypes. (dbus_gvalue_demarshal): Take context and error arguments. (dbus_gvalue_demarshal_variant): New function. (dbus_gvalue_demarshal_message): New function. (dbus_gvalue_store): Delete. * glib/dbus-gvalue.c: File has been almost entirely rewritten; now we special-case more types such as DBUS_TYPE_SIGNATURE, handle arrays and hash tables correctly, etc. Full support for recursive values is not yet complete. * glib/dbus-gproxy.c (dbus_g_proxy_class_init): Change last argument of signal to G_TYPE_POINTER since we now pass a structure. (lookup_g_marshaller): Delete in favor of _dbus_gobject_lookup_marshaller. (marshal_dbus_message_to_g_marshaller): Use _dbus_gobject_lookup_marshaller and dbus_gvalue_demarshal_message to handle remote signal callbacks. (dbus_g_proxy_new_from_proxy): New function; creates a new DBusGProxy by copying an existing one. (dbus_g_proxy_get_interface, dbus_g_proxy_set_interface) (dbus_g_proxy_get_path): New functions. (dbus_g_proxy_marshal_args_to_message): New function; factored out of existing code. (DBUS_G_VALUE_ARRAY_COLLECT_ALL): Collect all arguments from a varargs array. (dbus_g_proxy_begin_call_internal): New function. (dbus_g_proxy_end_call_internal): New function. (dbus_g_proxy_begin_call): Take GTypes instead of DBus types as arguments; simply invoke dbus_g_proxy_begin_call_internal after collecting args into value array. (dbus_g_proxy_end_call): Take GTypes instead of DBus types; invoke dbus_g_proxy_end_call_internal. (dbus_g_proxy_invoke): Simply invoke begin_call_interanl and end_call_internal. (dbus_g_proxy_call_no_reply): Take GTypes instead of DBus types. (array_free_all): New function. (dbus_g_proxy_add_signal): Take GTypes. * glib/dbus-gobject.h: (_dbus_glib_marshal_dbus_message_to_gvalue_array): Delete. (_dbus_gobject_get_path, _dbus_gobject_lookup_marshaller): Prototype. * glib/dbus-gobject.c: Add a global marshal_table hash which stores mappings from type signatures to marshallers. Change lots of invocations of dbus_gtype_to_dbus_type to dbus_gtype_to_signature. (_dbus_glib_marshal_dbus_message_to_gvalue_array): Delete. (introspect_signals): Fix test for query.return_type. (set_object_property): Update invocation of dbus_gvalue_demarshal. (invoke_object_method): Many changes. Handle asynchronous invocations. Convert arguments with dbus_gvalue_demarshal_message. Handle errors. Use DBusSignatureIter instead of strlen on args. Handle all arguments generically. Special-case variants. (dbus_g_method_return, dbus_g_method_return_error): New function. (DBusGSignalClosure): New structure, closes over signal information. (dbus_g_signal_closure_new): New function. (dbus_g_signal_closure_finalize): New function. (signal_emitter_marshaller): New function; is special marshaller which emits signals on bus. (export_signals): New function; introspects object signals and connects to them. (dbus_g_object_type_install_info): Take GType instead of GObjectClass. (dbus_g_connection_register_g_object): Invoke export_signals. (dbus_g_connection_lookup_g_object): New function. (DBusGFuncSignature) New structure; used for mapping type signatures to marshallers. (funcsig_hash): New function; hashes DBusGFuncSignature. (funcsig_equal): New function; compares DBusGFuncSignature. (_dbus_gobject_lookup_marshaller): New function. (dbus_g_object_register_marshaller): New function; used to register a marshaller at runtime for a particular signature. * glib/dbus-gmain.c (_dbus_gmain_test): Add various tests. * glib/dbus-binding-tool-glib.h: Add DBUS_GLIB_ANNOTATION_ASYNC which notes a server method implementation should be asynchronous. * glib/dbus-binding-tool-glib.c (dbus_binding_tool_output_glib_server): Call dbus_g_value_types_init. (write_formal_parameters): Use dbus_gtype_from_signature. Handle variants specially. (dbus_g_type_get_lookup_function): Turn GType into an invocation of a lookup function. (write_args_for_direction): Use dbus_g_type_get_lookup_function. (write_untyped_out_args): New method; write output arguments. (write_formal_declarations_for_direction): Function for writing prototypes. (write_formal_parameters_for_direction): Function for writing implementations. (write_typed_args_for_direction): Function for writing arguments prefixed with GTypes. (write_async_method_client): Write out async version of method. * glib/dbus-binding-tool-glib.c: Include dbus-gvalue-utils.h. (dbus_g_type_get_marshal_name): Move mapping from GType to marshal name into here. (dbus_g_type_get_c_name): Move into here. (compute_marshaller): Convert signature to type with dbus_gtype_from_signature, use dbus_g_type_get_marshal_name. (compute_marshaller_name): Ditto. (compute_marshaller): Handle async signal annotations. (gather_marshallers): Return if we don't have a known prefix. (generate_glue): Collect introspection blob here, and write all of the blob at the end. This allows an object with multiple interfaces to work. Mark async methods in introspection blob. * glib/Makefile.am (libdbus_glib_1_la_SOURCES): Add dbus-gtype-specialized.c, dbus-gtype-specialized.h, dbus-gvalue-utils.h, dbus-gvalue-utils.c. * dbus/dbus-glib.h: Don't include dbus-protocol.h; this avoids people accidentally using DBUS_TYPE_* which should not be necessary anymore. Do include dbus-gtype-specialized.h, which are utilities for GLib container types. Add various #defines for types such as DBUS_TYPE_G_BOOLEAN_ARRAY. (DBusGValueIterator, DBusGValue): Define, not fully used yet. (dbus_g_value_get_g_type): Type for recursive value. (dbus_g_value_open, dbus_g_value_iterator_get_value) (dbus_g_value_iterator_get_values, dbus_g_value_iterator_recurse) (dbus_g_value_free): Prototypes. (dbus_g_object_register_marshaller, dbus_g_proxy_new_from_proxy): Prototype. (dbus_g_proxy_set_interface): Prototype. (dbus_g_proxy_begin_call, dbus_g_proxy_end_call) (dbus_g_proxy_call_no_reply): Take GLib types instead of DBus types. (dbus_g_proxy_get_path, dbus_g_proxy_get_interface): Accessors. (DBusGAsyncData, DBusGMethodInvocation): Structures for doing async invocations. (dbus_g_method_return, dbus_g_method_return_error): Prototypes. * doc/dbus-tutorial.xml: Update GLib section. * tools/dbus-viewer.c (load_child_nodes): Update for new invocation type of dbus_g_proxy_end_call. (load_from_service_thread_func): Ditto. * tools/print-introspect.c (main): Ditto. * tools/dbus-names-model.c (have_names_notify) (names_model_reload, names_model_set_connection) Use GTypes. * python/Makefile.am (INCLUDES): Define DBUS_COMPILATION, needed since Python bindings use GLib bindings. * test/glib/Makefile.am (INCLUDES): Define DBUS_COMPILATION. Add --prefix argument. * tools/Makefile.am: Define DBUS_COMPILATION. Remove unneeded --ignore-unsupported arg. * test/glib/test-service-glib.c: * test/glib/test-service-glib.xml: * test/glib/test-dbus-glib.c: Add many more tests. glib/Makefile.am | 6 +- glib/dbus-binding-tool-glib.c | 642 +++++++++++++++--- glib/dbus-binding-tool-glib.h | 1 + glib/dbus-gmain.c | 29 + glib/dbus-gobject.c | 599 +++++++++++++--- glib/dbus-gobject.h | 10 +- glib/dbus-gproxy.c | 789 +++++++++++---------- glib/dbus-gtype-specialized.c | 441 ++++++++++++ glib/dbus-gtype-specialized.h | 104 +++ glib/dbus-gvalue-utils.c | 715 +++++++++++++++++++ glib/dbus-gvalue-utils.h | 70 ++ glib/dbus-gvalue.c | 1508 +++++++++++++++++++++++++++++++++++------ glib/dbus-gvalue.h | 55 +- 13 files changed, 4185 insertions(+), 784 deletions(-) commit 4bc350fedd536bc187768a7bfa2455aae7474f74 Author: John (J5) Palmieri Date: 2005-05-16 21:27:03 +0000 * glib/dbus-gmain.c (io_handler_dispatch): fix deadlock when using recursive g_main_loops * python/_dbus.py (class Bus): add the ProxyObjectClass alias for ProxyObject to make it easier for the Twisted networking framework to integrate dbus. * python/proxies.py (class ProxyObject): add the ProxyMethodClass alias for ProxyMethod to make it easier for the Twisted networking framework to integrate dbus. glib/dbus-gmain.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) commit 3c7dcbf8f47d3061fccdc315716c90a0b69a470f Author: Colin Walters Date: 2005-05-11 19:02:31 +0000 2005-05-11 Ross Burton * glib/dbus-glib-tool.c: Add --prefix argument. * glib/dbus-binding-tool-glib.h: Add prefix argument. * glib/dbus-binding-tool-glib.c (compute_marshaller_name): Add prefix argument. (generate_glue): Pass prefix argument down. (dbus_binding_tool_output_glib_server): Pass prefix to glib-genmarshal. glib/dbus-binding-tool-glib.c | 16 ++++++++++------ glib/dbus-binding-tool-glib.h | 2 +- glib/dbus-glib-tool.c | 8 +++++++- 3 files changed, 18 insertions(+), 8 deletions(-) commit 55263b490f4dba73b1590939be2b087856487054 Author: Colin Walters Date: 2005-05-03 17:45:29 +0000 2005-05-03 Ross Burton * glib/dbus-gobject.c (dbus_g_connection_register_g_object): Return if we get an error during registration. Set up a weak reference on object to unregister if object is destroyed. (unregister_gobject): New function. glib/dbus-gobject.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) commit 260e1fecf1690bb12c5bf7d5ddf793d79a1efed5 Author: David Zeuthen Date: 2005-04-19 03:35:19 +0000 2005-04-18 David Zeuthen * glib/dbus-gmain.c (io_handler_destroy_source): (timeout_handler_destroy_source, connection_setup_free): Also unref the source to avoid memory leaks. glib/dbus-gmain.c | 3 +++ 1 file changed, 3 insertions(+) commit 56288b6e3a9e5f8bd8920c5f7dac2a2b64842b15 Author: Havoc Pennington Date: 2005-04-13 14:10:21 +0000 2005-04-13 Havoc Pennington * glib/dbus-gmain.c (message_queue_dispatch): only dispatch one message at a time to avoid monopolizing the main loop, bug #2953 from Benjamin Otte glib/dbus-gmain.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) commit ca2ab9616ed7c6e936e495e64303f77956cb6b82 Author: Havoc Pennington Date: 2005-04-09 23:50:58 +0000 2005-04-09 Havoc Pennington * dbus/dbus-message-util.c (_dbus_message_test): fix signedness warning * glib/dbus-glib-tool.c (main): fix warning * glib/dbus-binding-tool-glib.c (generate_glue): fix warning * dbus/dbus-connection.c (dbus_connection_read_write_dispatch): add a new function that can be used in simple applications that don't have a main loop and are willing to block glib/dbus-binding-tool-glib.c | 3 +++ glib/dbus-glib-tool.c | 1 + 2 files changed, 4 insertions(+) commit b34961c0e5a75ff9f70e0ba439a96d993456ef92 Author: David Zeuthen Date: 2005-04-06 17:36:47 +0000 2005-04-05 David Zeuthen Fix https://bugs.freedesktop.org/show_bug.cgi?id=2889 * glib/dbus-gmain.c: (io_handler_destroy_source): Remove from list of IO handlers of the ConnectionSetup object (timeout_handler_destroy_source): -do- for timeout handlers (io_handler_source_finalized): Don't remove from list since we now do that in io_handler_destroy_source(). Renamed from io_handler_source_destroyed (timeout_handler_source_destroyed): -do- for timeout handlers (connection_setup_free): It is now safe to iterate over all IO and timeout handlers as the _destroy_source removes them from the list synchronously glib/dbus-gmain.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) commit 681e7deee9a01c1f315b0066b87204e0da207d99 Author: Colin Walters Date: 2005-03-17 17:48:29 +0000 2005-03-17 Colin Walters * bus/print-introspect.c: Move to tools/. * bus/run-with-tmp-session-bus.sh: Ditto. * glib/Makefile.am (dbus-glib-bindings.h): Move generation to tools/Makefile.am. * test/glib/run-test.sh: Update to handle move of run-with-tmp-session-bus.sh. * test/glib/test-service-glib.c: Update to handle move of dbus-glib-bindings.h. * tools/print-introspect.c: Moved here from bus/, and ported to GLib bindings. * tools/run-with-tmp-session-bus.sh: Moved here from bus/. * tools/Makefile.am: Generate dbus-glib-bindings.h and dbus-bus-introspect.xml here. * tools/.cvsignore, glib/.cvsignore, bus/.cvsignore: Update. glib/.cvsignore | 1 - glib/Makefile.am | 8 -------- 2 files changed, 9 deletions(-) commit 1cc2659deb9f108f449ad3ca8f18bff743a4cd81 Author: Colin Walters Date: 2005-03-12 20:07:21 +0000 2005-03-12 Colin Walters * bus/driver.c (write_args_for_direction): New function, parses a type signature into arguments and outputs to XML. (bus_driver_handle_introspect): Use it instead of hardcoding XML for certain signatures. * bus/Makefile.am (dbus-bus-introspect.xml): Add dependency on dbus-daemon. * glib/dbus-glib-tool.c (main): Parse ignore_unsupported argument, pass it to dbus_binding_tool_output_glib_client. * glib/dbus-binding-tool-glib.c (generate_client_glue): Protect against multiple inclusion. (dbus_binding_tool_output_glib_client): Add G_BEGIN_DECLS/G_END_DECLS. * glib/dbus-binding-tool-glib.c (compute_client_method_name): Change to just take iface prefix directly. (write_formal_parameters): Clarify error message. (check_supported_parameters): New function; checks to see type signatures of method parameters are supported. (generate_client_glue): Handle ignore_unsupported flag. (dbus_binding_tool_output_glib_client): Handle ignore_unsupported parameter. * glib/Makefile.am (dbus-glib-bindings.h): Pass --ignore-unsupported by default until glib bindings support arrays. glib/Makefile.am | 2 +- glib/dbus-binding-tool-glib.c | 64 +++++++++++++++++++++++++++++++++++------ glib/dbus-binding-tool-glib.h | 2 +- glib/dbus-glib-tool.c | 6 +++- 4 files changed, 63 insertions(+), 11 deletions(-) commit c5247484ea45ef9b6b3449a71e3ea80b86de03ad Author: Colin Walters Date: 2005-03-12 16:33:00 +0000 2005-03-11 Colin Walters * glib/Makefile.am: Generate dbus-glib-bindings.h and install it. * bus/print-introspect.c: New file; prints introspection data for a given name and object path. * bus/run-with-tmp-session-bus.sh: New file, refactored from test/glib/run-test.sh. Creates a temporary session bus and runs another program. * test/glib/run-test.sh: Refactor to invoke run-with-tmp-session-bus.sh. * bus/driver.c (bus_driver_handle_introspect): Fix to print new introspection format. Also change to use DBUS_TYPE_x_AS_STRING macros instead of hardcoding. * glib/.cvsignore, bus/.cvsignore, test/glib/.cvsignore: Update. glib/.cvsignore | 1 + glib/Makefile.am | 8 ++++++++ 2 files changed, 9 insertions(+) commit 10dc75239d071c49622972d061ff7546ed169bc5 Author: Colin Walters Date: 2005-03-09 17:09:11 +0000 2005-03-09 Colin Walters * glib/dbus-gproxy.c (dbus_g_proxy_invoke): New method; calls to this are generated for client-side wrappers. Invokes a D-BUS method and returns reply values. * glib/dbus-binding-tool-glib.c (write_args_sig_for_direction): New function; writes signature string for argument direction. (write_args_for_direction): Change to pass input values directly instead of via address, and fix indentation. (generate_client_glue): Change to invoke dbus_g_proxy_invoke. Also make generated wrappers inlineable. * dbus/dbus-message.c (dbus_message_iter_get_fixed_array): Add note about using dbus_type_is_fixed. * dbus/dbus-marshal-basic.c (_dbus_type_is_fixed): Moved to dbus/dbus-signature.c as dbus_type_is_fixed. All callers updated. * dbus/dbus-signature.c (dbus_type_is_fixed): Moved here from dbus/dbus-marshal-basic.c:_dbus_type_is_fixed. * dbus/dbus-signature.h: Prototype. * glib/dbus-binding-tool-glib.c (compute_marshaller_name): Fix error printf code. * test/glib/test-dbus-glib.c (main): Be sure to clear error as appropriate instead of just freeing it. (main): Free returned strings using g_free. * test/glib/Makefile.am (test-service-glib-glue.h) (test-service-glib-bindings.h): Add dependency on dbus-binding-tool. * glib/dbus-gvalue.c (MAP_BASIC): Refactored from MAP_BASIC_INIT; simply maps a simple D-BUS type to GType. (dbus_dbus_type_to_gtype): Function which maps D-BUS type to GType. (dbus_gvalue_init): Just invoke dbus_dbus_type_to_gtype and initialize the value with it. (dbus_gvalue_binding_type_from_type): Unused, delete. (dbus_gvalue_demarshal): Switch to hardcoding demarshalling for various types instead of unmarshalling to value data directly. Remove can_convert boolean. (dbus_gvalue_marshal): Remove duplicate initialization; switch to returning directly instead of using can_convert boolean. (dbus_gvalue_store): New function; not related to D-BUS per-se. Stores a GValue in a pointer to a value of its corresponding C type. * glib/dbus-gvalue.h: Remove dbus_gvalue_binding_type_from_type, add dbus_gvalue_store. glib/dbus-binding-tool-glib.c | 73 ++++++------ glib/dbus-gproxy.c | 205 +++++++++++++++++++++++++++++++++ glib/dbus-gvalue.c | 254 +++++++++++++++++++++++------------------ glib/dbus-gvalue.h | 4 +- 4 files changed, 392 insertions(+), 144 deletions(-) commit 61b05621beeb5a929bf68b95fdb9cb63516c1c7e Author: John (J5) Palmieri Date: 2005-03-07 21:10:46 +0000 * NEWS: Update for 0.31 * configure.in: Release 0.31 add LT_CURRENT, LT_REVISION, LT_AGE for easy soname bumping * qt/Makefile.am: fixed build * dbus/Makefile.am: soname bump for libdbus * glib/Makefile.am: soname bump for libdbus-glib glib/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit be6ef9488ddc1b9fd3fc303cccf6e6618450be89 Author: Colin Walters Date: 2005-02-27 17:38:12 +0000 2005-02-27 Colin Walters * glib/dbus-gidl.c (property_info_get_type, arg_info_get_type): Change return value to const char * instead of int so we can do full signatures. (struct PropertyInfo, struct ArgInfo): Store char *. (property_info_new, arg_info_new): Update parameters, strdup. (property_info_unref, arg_info_unref): Free. * glib/dbus-gidl.h: Update prototypes. * glib/dbus-gparser.c (basic_type_from_string): Delete. (validate_signature): New function, just validates signature and sets GError. (parse_property, parse_arg): Invoke validate_signature. Store signature instead of just type code. * glib/dbus-gvalue.c (base_type_from_signature): New utility function to return a primary type for a signature, dropping information about types in container types. (dbus_gvalue_genmarshal_name_from_type) (dbus_gvalue_binding_type_from_type) (dbus_gvalue_ctype_from_type): Update to take full signature instead of type code. (dbus_gtype_to_dbus_type): Moved here from glib/dbus-gobject.c. * glib/dbus-gvalue.h: Update prototypes for above. * glib/dbus-gobject.c (gtype_to_dbus_type): Moved to glib/dbus-gvalue.c as dbus_gtype_to_dbus_type. (introspect_properties, introspect_signals, write_interface): Update to handle signatures, and remove usage of _dbus_gutils_type_to_string. (handle_introspect): Print out type codes instead of e.g. "string" in hardcoded introspection XML; also use x_AS_STRING constants instead of hardcoding in string. * glib/dbus-glib-tool.c (pretty_print): Handle signature change to string. Remove usage of _dbus_gutils_type_to_string. * glib/dbus-gutils.c (_dbus_gutils_type_to_string): Delete. * glib/dbus-gutils.h (_dbus_gutils_type_to_string): Update for deletion. * glib/dbus-binding-tool-glib.c (compute_marshaller) (compute_marshaller_name, generate_glue): Handle signature change to string. (write_formal_parameters, write_args_for_direction): Ditto, and remove FIXME. * tools/dbus-tree-view.c (type_to_string): Delete. (info_set_func_text): Update to print full signatures. * test/glib/test-service-glib.xml: Change types to new introspection format. glib/dbus-binding-tool-glib.c | 20 ++++++------ glib/dbus-gidl.c | 18 ++++++----- glib/dbus-gidl.h | 8 ++--- glib/dbus-glib-tool.c | 8 ++--- glib/dbus-gobject.c | 69 ++++++++------------------------------- glib/dbus-gparser.c | 72 +++++++++-------------------------------- glib/dbus-gutils.c | 42 ------------------------ glib/dbus-gutils.h | 1 - glib/dbus-gvalue.c | 71 ++++++++++++++++++++++++++++++++++++++-- glib/dbus-gvalue.h | 8 +++-- 10 files changed, 131 insertions(+), 186 deletions(-) commit 662755210c931da87972398ded13d4651e3d3fec Author: John (J5) Palmieri Date: 2005-02-24 22:01:34 +0000 glib/Makefile.am: added dbus-gobject.h to sources list so distcheck doesn't fail glib/Makefile.am | 1 + 1 file changed, 1 insertion(+) commit 0573676ce932874b07780036eaeaa42a6f3e1628 Author: Colin Walters Date: 2005-02-19 23:25:41 +0000 2005-02-19 Colin Walters * glib/dbus-binding-tool-glib.c (dbus_binding_tool_output_glib_server): Fix iochannel refcounting. * glib/dbus-glib-tool.c: Include dbus-glib-tool.h, as well as errno.h and sys/stat.h. (lose): New function, prints error with newline and exits. (lose_gerror): Similar, but takes GError for message. (main): Add --output argument to specify output file to write to, instead of always printing to stdout. In this mode, determine timestamps on source files to see whether any are newer than the target file. If not, exit. Also convert a number of error messages to use lose (since it's shorter), and switch to using g_io_channel_shutdown. glib/dbus-binding-tool-glib.c | 2 +- glib/dbus-glib-tool.c | 119 +++++++++++++++++++++++++++++++---------- 2 files changed, 91 insertions(+), 30 deletions(-) commit 7ff788981218b324d0eeec16fa4b7bb9ec97d694 Author: Havoc Pennington Date: 2005-02-19 16:17:29 +0000 2005-02-19 Havoc Pennington * glib/dbus-gobject.c (_dbus_glib_marshal_dbus_message_to_gvalue_array): add docs * glib/dbus-glib.c: fix doxygen warnings * glib/dbus-gparser.c (parse_annotation): error if an annotation is found on an glib/dbus-glib.c | 8 ++++---- glib/dbus-gobject.c | 8 +++++++- glib/dbus-gparser.c | 4 +--- 3 files changed, 12 insertions(+), 8 deletions(-) commit 03186401718758948242881cf429bdbb48eb8474 Author: Colin Walters Date: 2005-02-18 03:14:33 +0000 2005-02-17 Colin Walters * glib/dbus-gobject.h: Don't export _dbus_glib_marshal_dbus_message_to_gvalue_array. * glib/dbus-gobject.c (_dbus_glib_marshal_dbus_message_to_gvalue_array): Do rename. (invoke_object_method): Handle it. * glib/dbus-gproxy.c (marshal_dbus_message_to_g_marshaller): Handle rename. glib/dbus-gobject.c | 4 ++-- glib/dbus-gobject.h | 2 +- glib/dbus-gproxy.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) commit a6e8deb82f6202628fcb3b9b3a616d0a98598474 Author: Colin Walters Date: 2005-02-17 21:19:48 +0000 2005-02-17 Colin Walters * dbus/dbus-protocol.h (DBUS_SERVICE_ORG_FREEDESKTOP_DBUS): Rename to DBUS_SERVICE_DBUS. (DBUS_PATH_ORG_FREEDESKTOP_DBUS): Rename to DBUS_PATH_DBUS. (DBUS_PATH_ORG_FREEDESKTOP_LOCAL): Rename to DBUS_PATH_LOCAL. (DBUS_INTERFACE_ORG_FREEDESKTOP_DBUS): Rename to DBUS_INTERFACE_DBUS. (DBUS_INTERFACE_ORG_FREEDESKTOP_INTROSPECTABLE): Rename to DBUS_INTERFACE_INTROSPECTABLE. (DBUS_INTERFACE_ORG_FREEDESKTOP_PROPERTIES): Rename to DBUS_INTERFACE_PROPERTIES. (DBUS_INTERFACE_ORG_FREEDESKTOP_PEER): Rename to DBUS_INTERFACE_PEER. (DBUS_INTERFACE_ORG_FREEDESKTOP_LOCAL): DBUS_INTERFACE_LOCAL. All other users of those constants have been changed. * bus/driver.c (bus_driver_handle_introspect): Use constants. * glib/dbus-gobject.c (handle_introspect): Use constants. * doc/dbus-faq.xml, doc/dbus-specification.xml: Update for rename. glib/dbus-gobject.c | 10 +++++----- glib/dbus-gproxy.c | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) commit b085dcd0556e82c8fe347cc4bedd2e5b9b876a95 Author: Colin Walters Date: 2005-02-17 21:11:18 +0000 2005-02-17 Colin Walters * glib/dbus-gparser.c (struct Parser): Add in_annotation boolean. (parse_node, parse_interface, parse_method, parse_signal) (parse_property, parse_annotation): Lose if we're currently in an annotation. (parse_annotation): New function. (parser_start_element, parser_end_element): Handle annotation. (parse_method, parse_interface): Remove support for c_name attribute, switch to annotations. * glib/dbus-gidl.h (interface_info_get_binding_names) (method_info_get_binding_names) (interface_info_get_binding_name, method_info_get_binding_name) (interface_info_set_binding_name, method_info_set_binding_name): Remove. (interface_info_get_annotations, method_info_get_annotations) (interface_info_get_annotation, method_info_get_annotation) (interface_info_add_annotation, method_info_add_annotation): Prototype. * glib/dbus-gidl.c (struct InterfaceInfo): Substitute "annotations" for "bindings". (struct MethodInfo): Ditto. Straightfoward conversion of binding methods into annotation methods as prototyped. * glib/dbus-glib-tool.c (pretty_print): Print annotations. * glib/dbus-binding-tool-glib.h (DBUS_GLIB_ANNOTATION_C_SYMBOL): Define. * glib/dbus-binding-tool-glib.c (gather_marshallers, generate_glue): Use new annotation API. * doc/introspect.dtd: Fix a number of DTD syntax errors. Add annotation element. * doc/dbus-specification.xml: Discuss introspection annotations, include list of well-known annotations. * test/glib/test-service-glib.xml: Make validate against new DTD. glib/dbus-binding-tool-glib.c | 10 ++--- glib/dbus-binding-tool-glib.h | 2 + glib/dbus-gidl.c | 60 ++++++++++++++-------------- glib/dbus-gidl.h | 24 +++++------ glib/dbus-glib-tool.c | 30 +++++++------- glib/dbus-gparser.c | 88 ++++++++++++++++++++++++++++++++++++----- 6 files changed, 143 insertions(+), 71 deletions(-) commit 87e81b87d7b443142302ecb48e46191a443ae02a Author: Colin Walters Date: 2005-02-17 17:41:24 +0000 2005-02-17 Colin Walters This patch is based on initial work from Paul Kuliniewicz . * glib/dbus-gvalue.c (dbus_gvalue_init): New function; move initialization of GValue from dbus type to here. (dbus_gvalue_genmarshal_name_from_type): New function; generates a string for the "glib-genmarshal" program from a DBus type. (dbus_gvalue_binding_type_from_type): New function; turns a DBus type into the C name for it we use in the glib bindings. (dbus_gvalue_ctype_from_type): New function; maps a DBus type into a glib C type (not GValue). (dbus_gvalue_demarshal): invoke dbus_gvalue_init. * glib/dbus-gutils.c (_dbus_gutils_wincaps_to_uscore): Moved here from dbus-gobject.c. * glib/dbus-gutils.h: Prototype it. * glib/dbus-gproxy.c: Include new dbus-gobject.h. (marshal_dbus_message_to_g_marshaller): Use new shared function dbus_glib_marshal_dbus_message_to_gvalue_array. * glib/dbus-gparser.c (parse_interface, parse_method): Handle c_name attribute. Will be changed once we have annotations. * glib/dbus-gobject.c: Change info_hash_mutex from GStaticMutex to GStaticRWLock. Callers updated. (wincaps_to_uscore): Move to dbus-gutils.c. Callers updated. (string_table_next): New function for iterating over zero-terminated string value array. (string_table_lookup): New function; retrieves specific entry in array. (get_method_data): New function; look up method data in object data chunk. (object_error_domain_prefix_from_object_info) (object_error_code_from_object_info): New functions, but not implemented yet. (method_interface_from_object_info): New function; retrieve interface name. (method_name_from_object_info): New function; retrieve method name. (method_arg_info_from_object_info): New function; retrieve argument data. (arg_iterate): New function; iterates over serialized argument data. (method_dir_signature_from_object_info): New function; returns a GString holding type signature for arguments for just one direction (input or output). (method_input_signature_from_object_info) (method_output_signature_from_object_info): New functions. (dbus_glib_marshal_dbus_message_to_gvalue_array): New shared function; converts dbus message arguments into a GValue array. Used for both signal handling and method invocation. (struct DBusGlibWriteIterfaceData): New utility structure. (write_interface): New function; generate introspection XML for an interface. (introspect_interfaces): New function; gathers all interface->methods, generates introspection XML for them. (handle_introspect): Invoke introspect_interfaces. (get_object_property): Be sure to zero-initalize stack-allocated GValue. (lookup_object_and_method): New function; examines an incoming message and attempts to match it up (via interface, method name, and argument signature) with a known object and method. (gerror_domaincode_to_dbus_error_name): New function; converts a GError domain and code into a DBus error name. Needs GError data added to object introspection to work well. (gerror_to_dbus_error_message): Creates a DBusMessage error return from GError. (invoke_object_method): New function to invoke an object method looked up via lookup_object_and_method. Parses the incoming message, turns it into a GValue array, then invokes the marshaller specified in the DBusGMethodInfo. Creates a new message with either return values or error message as appropriate. (gobject_message_function): Invoke lookup_object_and_method and invoke_object_method. * glib/dbus-glib-tool.c: Include dbus-binding-tool-glib.h. (enum DBusBindingOutputMode): New enum for binding output modes. (pretty_print): Print binding names. (dbus_binding_tool_error_quark): GError bits. (version): Fix typo. (main): Create GIOChannel for output. Parse new --mode argument, possible values are "pretty-print", "glib-server", "glib-client". Use mode to invoke appropriate function. * glib/dbus-gobject.h: Prototype dbus_glib_marshal_dbus_message_to_gvalue_array. * glib/dbus-glib-tool.h: New header, just includes GError bits for now. * glib/dbus-gidl.c (struct InterfaceInfo): Add bindings hashtable; maps binding style to name. (struct MethodInfo): Ditto. (get_hash_keys, get_hash_key): Utility function, returns keys for a GHashTable. (interface_info_new, method_info_new): Initialize bindings. (interface_info_unref, method_info_unref): Destroy bindings. (method_info_get_binding_names, method_info_get_binding_name) (interface_info_get_binding_names, interface_info_get_binding_name): Functions for retrieving binding names. (method_info_set_binding_name, interface_info_set_binding_name): Functions for setting binding names. * glib/dbus-binding-tool-glib.h: New file, has prototypes for glib binding generation. * glib/dbus-binding-tool-glib.c: New file, implements server-side and client-side glib glue generation. * glib/Makefile.am (dbus_binding_tool_SOURCES): Add dbus-binding-tool-glib.c, dbus-binding-tool-glib.h, dbus-glib-tool.h. * dbus/dbus-glib.h (struct DBusGMethodMarshaller): Remove in favor of using GClosureMarshal directly. (struct DBusGObjectInfo): Add n_infos member. * test/glib/test-service-glib.xml: New file; contains introspection data for MyTestObject used in test-service-glib.c. * test/glib/test-service-glib.c (enum MyObjectError): New GError enum. (my_object_do_nothing, my_object_increment, my_object_throw_error) (my_object_uppercase, my_object_many_args): New test methods. (main): Use dbus_g_object_class_install_info to include generated object info. * test/glib/Makefile.am: Generate server-side glue for test-service-glib.c, as well as client-side bindings. * test/glib/test-dbus-glib.c: Include test-service-glib-bindings.h. (main): Activate TestSuiteGLibService; test invoke a bunch of its methods using both the dbus_gproxy stuff directly as well as the generated bindings. glib/Makefile.am | 3 + glib/dbus-binding-tool-glib.c | 812 +++++++++++++++++++++++++++++++++++++++++ glib/dbus-binding-tool-glib.h | 33 ++ glib/dbus-gidl.c | 73 ++++ glib/dbus-gidl.h | 14 +- glib/dbus-glib-tool.c | 120 +++++- glib/dbus-glib-tool.h | 37 ++ glib/dbus-gobject.c | 596 +++++++++++++++++++++++++++--- glib/dbus-gobject.h | 35 ++ glib/dbus-gparser.c | 8 + glib/dbus-gproxy.c | 52 +-- glib/dbus-gutils.c | 28 ++ glib/dbus-gutils.h | 1 + glib/dbus-gvalue.c | 171 ++++++++- glib/dbus-gvalue.h | 28 +- 15 files changed, 1889 insertions(+), 122 deletions(-) commit dd22216537d98b06366ade81eb6f63621d4c6379 Author: Havoc Pennington Date: 2005-02-16 04:37:27 +0000 2005-02-15 Havoc Pennington * dbus/dbus-connection.c (dbus_connection_dispatch): always complete a pending call, don't run filters first. * glib/dbus-gproxy.c (dbus_g_proxy_end_call): change to use dbus_pending_call_steal_reply * dbus/dbus-pending-call.c (dbus_pending_call_block): just call _dbus_connection_block_pending_call (dbus_pending_call_get_reply): change to steal_reply and return a ref * dbus/dbus-connection.c (dbus_connection_send_with_reply_and_block): port to work in terms of DBusPendingCall (_dbus_connection_block_pending_call): replace block_for_reply with this glib/dbus-gproxy.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) commit 3ce5325735aae6b1d4e6a28b45465a586710d23e Author: Havoc Pennington Date: 2005-02-12 20:27:45 +0000 2005-02-12 Havoc Pennington * tools/dbus-tree-view.c (info_set_func_text): display more details on args * bus/driver.c (bus_driver_handle_list_services): list the bus driver * glib/dbus-gparser.c (parse_arg): generate an arg name if none is supplied * glib/dbus-gidl.c (signal_info_get_n_args): new function (method_info_get_n_args): new function glib/dbus-gidl.c | 12 ++++++++++++ glib/dbus-gidl.h | 2 ++ glib/dbus-gparser.c | 13 ++++++++++++- 3 files changed, 26 insertions(+), 1 deletion(-) commit 89113d257f1f75cea5d0f39bbca4785afc784bf2 Author: Havoc Pennington Date: 2005-02-10 23:47:54 +0000 2005-02-10 Havoc Pennington * dbus/dbus-object-tree.c (handle_default_introspect_and_unlock): change to be _and_unlock instead of _unlocked * dbus/dbus-connection.c (_dbus_connection_send_preallocated_unlocked_no_update): rename to have no_update so we can find this bug quickly in future glib/dbus-gthread.c | 2 ++ 1 file changed, 2 insertions(+) commit 116d931394d42412595e64185cd9cb97444cd653 Author: Havoc Pennington Date: 2005-02-05 04:15:57 +0000 2005-02-04 Havoc Pennington * glib/dbus-gproxy.c (dbus_g_proxy_disconnect_signal): use g_quark_try_string() so it actually can return 0 (dbus_g_proxy_connect_signal): ditto 2005-02-04 Havoc Pennington * glib/dbus-gproxy.c (dbus_g_proxy_emit_remote_signal): fix a bogus warning (tristring_from_message): assert cleanly on null path/interface (should not be possible though I decided later) (dbus_g_proxy_dispose): move proxy manager unregistration here (DBUS_G_PROXY_DESTROYED): add this macro, and use it in a bunch of g_return_if_fail() checks glib/dbus-gproxy.c | 59 ++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 46 insertions(+), 13 deletions(-) commit 1fdc099a4ed729871597c501a9015ec2855bebc2 Author: Havoc Pennington Date: 2005-01-31 23:17:18 +0000 2005-01-31 Havoc Pennington * glib/dbus-gproxy.c: rewrite how signals work again, this time I think it's sort of right glib/dbus-gproxy.c | 334 ++++++++++++++++++++++++++++++---------------------- 1 file changed, 194 insertions(+), 140 deletions(-) commit 463fb506e9661849d9838aedbdf4b7febe8e132e Author: Havoc Pennington Date: 2005-01-31 02:55:12 +0000 2005-01-30 Havoc Pennington * tools/dbus-names-model.c: dynamically watch NameOwnerChanged * autogen.sh: change to autotools 1.9 * glib/dbus-gproxy.c: completely change how signals work (dbus_g_proxy_add_signal): new function to specify signature of a signal (dbus_g_proxy_emit_received): marshal the dbus message to GValues, and g_warning if the incoming message has the wrong signature. glib/Makefile.am | 11 ++ glib/dbus-gmarshal.c | 89 ++++++++++++ glib/dbus-gmarshal.h | 21 +++ glib/dbus-gmarshal.list | 1 + glib/dbus-gproxy.c | 345 ++++++++++++++++++++++++++++++++++++----------- 5 files changed, 390 insertions(+), 77 deletions(-) commit c39a68d373c1f73a3bb7d0f45287cee1cd8eff55 Author: Havoc Pennington Date: 2005-01-30 23:06:32 +0000 2005-01-30 Havoc Pennington * glib/dbus-glib.c (dbus_g_pending_call_set_notify): new function (dbus_g_pending_call_cancel): new function * dbus/dbus-glib.h: move GType decls for connection/message here; * dbus/dbus-glib.c: move all the g_type and ref/unref stuff in here, just kind of rationalizing how we handle all that * tools/dbus-names-model.c: new file for a tree model listing the services on a bus * tools/dbus-tree-view.c (model_new): use proper typing on the model rows glib/dbus-glib.c | 335 ++++++++++++++++++++++++++++++++++++++++++++++++++++ glib/dbus-gmain.c | 172 --------------------------- glib/dbus-gproxy.c | 32 +---- 3 files changed, 338 insertions(+), 201 deletions(-) commit 967f6acd6c220b0be691edd18d9a636f4d16fbaf Author: Havoc Pennington Date: 2005-01-30 20:06:52 +0000 2005-01-30 Havoc Pennington * glib/dbus-gmain.c: add a custom GSource back that just checks whether the message queue has anything in it; otherwise, there are cases where we won't see messages in the queue since there was no IO visible to the glib main loop * dbus/dbus-connection-internal.h (_DBUS_DEFAULT_TIMEOUT_VALUE): increase default message timeout to 25 seconds glib/dbus-gmain.c | 93 +++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 86 insertions(+), 7 deletions(-) commit af3c2731c74f014c0713a52d66027a9428c1ddaf Author: Havoc Pennington Date: 2005-01-30 19:33:29 +0000 2005-01-30 Havoc Pennington * glib/dbus-gmain.c: rewrite the main loop stuff to avoid the custom source, seems to be a lot easier to understand and work better. glib/dbus-gmain.c | 653 +++++++++++++++++++++++++---------------------------- 1 file changed, 313 insertions(+), 340 deletions(-) commit 32587c38401f16a9477f7ea7868120645d072462 Author: Havoc Pennington Date: 2005-01-30 18:25:14 +0000 2005-01-30 Havoc Pennington I think this main loop thing is conceptually broken, but here are some band aids. I'll maybe rewrite it in a minute. * glib/dbus-gmain.c (add_timeout): timeout stuff doesn't use the custom GSource, so don't pass it in; confusing (gsource_server_finalize, gsource_connection_finalize): add finalize handlers that remove all the watches. glib/dbus-gmain.c | 90 +++++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 74 insertions(+), 16 deletions(-) commit 4b7acbbfacaa37ce399df1ce616920c09750ae60 Author: Havoc Pennington Date: 2005-01-30 07:44:08 +0000 2005-01-30 Havoc Pennington * glib/dbus-gobject.c (introspect_properties): fix the XML generated * dbus/dbus-message.c (dbus_message_unref): add an in_cache flag which effectively detects the use of freed messages * glib/dbus-gobject.c (handle_introspect): modify and return the reply message instead of the incoming message * dbus/dbus-object-tree.c (handle_default_introspect_unlocked): gee, maybe it should SEND THE XML instead of just making a string and freeing it again ;-) * tools/dbus-print-message.c (print_message): improve printing of messages * configure.in: add debug-glib.service to the output glib/dbus-gobject.c | 10 +++++----- glib/dbus-gparser.c | 2 ++ 2 files changed, 7 insertions(+), 5 deletions(-) commit 71181795196712bbb64d721464f42432997c7d0c Author: Havoc Pennington Date: 2005-01-30 05:18:44 +0000 2005-01-30 Havoc Pennington dbus-viewer introspected and displayed the bus driver * dbus/dbus-object-tree.c (object_tree_test_iteration): add tests for a handler registered on "/" * dbus/dbus-object-tree.c (_dbus_decompose_path): fix to handle path "/" properly (run_decompose_tests): add tests for path decomposition * glib/dbus-gutils.c (_dbus_gutils_split_path): fix to handle "/" properly * glib/dbus-gobject.c (handle_introspect): fix quotes * test/glib/run-test.sh: support launching the bus, then running dbus-viewer * test/glib/test-service-glib.c (main): put in a trivial gobject subclass and register it on the connection * bus/driver.c (bus_driver_handle_introspect): implement introspection of the bus driver service * dbus/dbus-protocol.h: add #defines for the XML namespace, identifiers, doctype decl * bus/driver.c (bus_driver_handle_get_service_owner): handle attempts to get owner of DBUS_SERVICE_ORG_FREEDESKTOP_DBUS by returning the service unchanged. (bus_driver_handle_message): remove old check for reply_serial in method calls, now the message type deals with that (bus_driver_handle_message): handle NULL interface * glib/dbus-gproxy.c (dbus_g_proxy_get_bus_name): new function * glib/dbus-gloader-expat.c (description_load_from_string): allow -1 for len * tools/dbus-viewer.c: add support for introspecting a service on a bus * glib/dbus-gproxy.c (dbus_g_pending_call_ref): add (dbus_g_pending_call_unref): add glib/dbus-gidl.c | 14 ++++++++++ glib/dbus-gidl.h | 3 +++ glib/dbus-gloader-expat.c | 4 +++ glib/dbus-gobject.c | 16 +++++++----- glib/dbus-gproxy.c | 62 ++++++++++++++++++++++++++++++++++++++++----- glib/dbus-gutils.c | 20 ++++++++++----- 6 files changed, 98 insertions(+), 21 deletions(-) commit 3593b814632b482b541ccf3adb2b31887028b234 Author: Havoc Pennington Date: 2005-01-29 20:12:21 +0000 2005-01-29 Havoc Pennington * tools/dbus-tree-view.c: add support for displaying properties. (run dbus-viewer with an introspect xml file as arg, then resize the window so the tree elements show up, not sure what that is) * glib/dbus-gobject.c (handle_introspect): return org.freedesktop.Properties and org.freedesktop.Introspectable interfaces when we are introspected. * doc/dbus-specification.xml: allow empty interface name when Get/Set a property glib/dbus-gobject.c | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) commit 426cf6b944282d16db0d88b230627793df52f1ad Author: Havoc Pennington Date: 2005-01-29 19:52:19 +0000 2005-01-29 Havoc Pennington * glib/Makefile.am: rename dbus-glib-tool to dbus-binding-tool; though it uses glib, it could be extended for any binding in principle * glib/dbus-gobject.c (gobject_message_function): change to the new way properties work * dbus/dbus-protocol.h: add the new interfaces * doc/dbus-specification.xml: document the introspection format, Introspectable interface, and add an org.freedesktop.Properties interface. * glib/dbus-gparser.c: add support for a element * glib/dbus-gidl.c: add PropertyInfo * glib/dbus-gobject.c (handle_introspect): put the outermost outside the signal and property descriptions. (introspect_properties): export properties as rather than as method calls glib/.cvsignore | 2 +- glib/Makefile.am | 6 +- glib/dbus-gidl.c | 100 +++++++++++++++++++++++++- glib/dbus-gidl.h | 112 ++++++++++++++++------------- glib/dbus-glib-tool.c | 31 ++++++-- glib/dbus-gobject.c | 104 ++++++++++++++++++--------- glib/dbus-gparser.c | 190 +++++++++++++++++++++++++++++++++++++++++++++---- 7 files changed, 434 insertions(+), 111 deletions(-) commit 54c56014a0d2dab88f1fa3bd17a7c1fd2768c4e9 Author: Havoc Pennington Date: 2005-01-28 03:06:55 +0000 2005-01-27 Havoc Pennington * dbus/dbus-arch-deps.h.in: add 16/32-bit types * configure.in: find the right type for 16 and 32 bit ints as well as 64 * dbus/dbus-protocol.h (DBUS_TYPE_INT16, DBUS_TYPE_UINT16): add the 16-bit types so people don't have to stuff them in 32-bit or byte arrays. glib/dbus-gparser.c | 4 ++++ glib/dbus-gutils.c | 4 ++++ glib/dbus-gvalue.c | 29 +++++++++++++++++++++++------ 3 files changed, 31 insertions(+), 6 deletions(-) commit 459e046b1ca4bdd06d85458fd4f213354833d1ed Author: Havoc Pennington Date: 2005-01-21 05:06:10 +0000 2005-01-21 Havoc Pennington * glib/dbus-gmain.c: don't put the GLib bindings in the same toplevel doxygen group as the low-level API stuff * dbus/dbus.h: note that libdbus is the low-level API glib/dbus-gmain.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) commit 8cecb5bad77434129fc751c2ace45c389f46ef0d Author: Havoc Pennington Date: 2005-01-18 20:42:15 +0000 2005-01-18 Havoc Pennington * Throughout, grand renaming to strip out the use of "service", just say "name" instead (or "bus name" when ambiguous). Did not change the internal code of the message bus itself, only the programmer-facing API and messages. * doc/dbus-specification.xml: further update the message bus section * bus/config-parser.c (all_are_equiv): fix bug using freed string in error case glib/dbus-gproxy.c | 171 +++++++++++++++++++++++++++------------------------- 1 file changed, 88 insertions(+), 83 deletions(-) commit 40c882bcb60faeee24e3e887f3503e9ecb878166 Author: Havoc Pennington Date: 2005-01-17 19:49:52 +0000 2005-01-17 Havoc Pennington * dbus/dbus-types.h: hardcode dbus_bool_t to 32 bits * Throughout: modify DBUS_TYPE_BOOLEAN to be a 32-bit type instead of an 8-bit type. Now dbus_bool_t is the type to use whenever you are marshaling/unmarshaling a boolean. glib/dbus-gvalue.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) commit c8c3d8a243f6b284b3aa46352afb9fb913f09f78 Author: Havoc Pennington Date: 2005-01-16 15:51:55 +0000 2005-01-16 Havoc Pennington * Add and fix docs according to Doxygen warnings throughout source. * dbus/dbus-marshal-recursive.c (_dbus_type_reader_array_is_empty): change this to just call array_reader_get_array_len() and make it static * dbus/dbus-message.c (dbus_message_iter_get_element_type): rename from get_array_type (dbus_message_iter_init_append): rename from append_iter_init * dbus/dbus-marshal-recursive.c (_dbus_type_reader_get_element_type): rename from _dbus_type_reader_get_array_type glib/dbus-glib.c | 2 +- glib/dbus-gobject.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) commit e116119209a507a5ba305e890f897d31e5b626e1 Author: Havoc Pennington Date: 2005-01-15 07:15:38 +0000 2005-01-15 Havoc Pennington * Land the new message args API and type system. This patch is huge, but the public API change is not really large. The set of D-BUS types has changed somewhat, and the arg "getters" are more geared toward language bindings; they don't make a copy, etc. There are also some known issues. See these emails for details on this huge patch: http://lists.freedesktop.org/archives/dbus/2004-December/001836.html http://lists.freedesktop.org/archives/dbus/2005-January/001922.html * dbus/dbus-marshal-*: all the new stuff * dbus/dbus-message.c: basically rewritten * dbus/dbus-memory.c (check_guards): with "guards" enabled, init freed blocks to be all non-nul bytes so using freed memory is less likely to work right * dbus/dbus-internals.c (_dbus_test_oom_handling): add DBUS_FAIL_MALLOC=N environment variable, so you can do DBUS_FAIL_MALLOC=0 to skip the out-of-memory checking, or DBUS_FAIL_MALLOC=10 to make it really, really, really slow and thorough. * qt/message.cpp: port to the new message args API (operator<<): use str.utf8() rather than str.unicode() (pretty sure this is right from the Qt docs?) * glib/dbus-gvalue.c: port to the new message args API * bus/dispatch.c, bus/driver.c: port to the new message args API * dbus/dbus-string.c (_dbus_string_init_const_len): initialize the "locked" flag to TRUE and align_offset to 0; I guess we never looked at these anyhow, but seems cleaner. * dbus/dbus-string.h (_DBUS_STRING_ALLOCATION_PADDING): move allocation padding macro to this header; use it to implement (_DBUS_STRING_STATIC): ability to declare a static string. * dbus/dbus-message.c (_dbus_message_has_type_interface_member): change to return TRUE if the interface is not set. * dbus/dbus-string.[hc]: move the D-BUS specific validation stuff to dbus-marshal-validate.[hc] * dbus/dbus-marshal-basic.c (_dbus_type_to_string): move here from dbus-internals.c * dbus/Makefile.am: cut over from dbus-marshal.[hc] to dbus-marshal-*.[hc] * dbus/dbus-object-tree.c (_dbus_decompose_path): move this function here from dbus-marshal.c glib/dbus-gobject.c | 2 +- glib/dbus-gproxy.c | 7 +- glib/dbus-gutils.c | 24 ++++--- glib/dbus-gvalue.c | 186 ++++++++++++++++++++++++++++++++++++++------------- 4 files changed, 156 insertions(+), 63 deletions(-) commit 62f29fd0fea8e1eaa3e61db44ddd1eeba765f153 Author: Havoc Pennington Date: 2004-11-13 07:07:46 +0000 2004-11-13 Havoc Pennington * test/glib/test-profile.c: fix this thing up a bit * dbus/dbus-message.c (dbus_message_new_empty_header): increase preallocation sizes by a fair bit; not sure if this will be an overall performance win or not, but it does reduce reallocs. * dbus/dbus-string.c (set_length, reallocate_for_length): ignore the test hack that forced constant realloc if asserts are disabled, so we can profile sanely. Sprinkle in some _DBUS_UNLIKELY() which are probably pointless, but before I noticed the real performance problem I put them in. (_dbus_string_validate_utf8): micro-optimize this thing a little bit, though callgrind says it didn't help; then special-case ascii, which did help a lot; then be sure we detect nul bytes as invalid, which is a bugfix. (align_length_then_lengthen): add some more _DBUS_UNLIKELY superstition; use memset to nul the padding instead of a manual loop. (_dbus_string_get_length): inline this as a macro; it showed up in the profile because it's used for loop tests and so forth glib/dbus-gmain.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 0ab857b2916731f92be856c6821d5c9950716f89 Author: Olivier Andrieu Date: 2004-10-07 09:56:01 +0000 * dbus/dbus-sysdeps.c (_dbus_file_get_contents): fix an incorrect format string. * glib/dbus-dbus-gmain.c (dbus_g_bus_get): do not mangle NULL pointer (bug #1540, Leonardo Boiko). glib/dbus-gmain.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) commit 4b50c510605d5dda629c9d493a61611bb382a55d Author: Havoc Pennington Date: 2004-08-10 03:06:59 +0000 2004-08-09 Havoc Pennington * COPYING: switch to Academic Free License version 2.1 instead of 2.0, to resolve complaints about patent termination clause. glib/dbus-gidl.c | 2 +- glib/dbus-gidl.h | 2 +- glib/dbus-glib-tool.c | 2 +- glib/dbus-glib.c | 2 +- glib/dbus-gloader-expat.c | 2 +- glib/dbus-gmain.c | 2 +- glib/dbus-gobject.c | 2 +- glib/dbus-gparser.c | 2 +- glib/dbus-gparser.h | 2 +- glib/dbus-gproxy.c | 4 ++-- glib/dbus-gtest-main.c | 2 +- glib/dbus-gtest.c | 2 +- glib/dbus-gtest.h | 2 +- glib/dbus-gthread.c | 2 +- glib/dbus-gtool-test.h | 2 +- glib/dbus-gutils.c | 2 +- glib/dbus-gutils.h | 2 +- 17 files changed, 18 insertions(+), 18 deletions(-) commit 301a3547a2efd9784fa3ab253373fa689c9bd1c3 Author: Olivier Andrieu Date: 2004-07-29 08:00:45 +0000 * bus/config-loader-libxml.c: complete the implementation of libxml backend for config file loader. Doesn't work with full OOM test yet. * configure.in: change error when selecting libxml into a warning. * test/data/invalid-config-files: add two non-well-formed XML files. * glib/Makefile.am: libdbus_gtool always uses expat, not libxml. * dbus/dbus-transport-unix.c (unix_handle_watch): do not disconnect in case of DBUS_WATCH_HANGUP, several do_reading() may be necessary to read all the buffer. (bug #894) * bus/activation.c (bus_activation_activate_service): fix a potential assertion failure (bug #896). Small optimization in the case of auto-activation messages. * dbus/dbus-message.c (verify_test_message, _dbus_message_test): add test case for byte-through-vararg bug (#901). patch by Kimmo Hmlinen. glib/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit ef7e145899ce58a5df564127783f014d8bed233f Author: Havoc Pennington Date: 2004-06-20 15:28:14 +0000 2004-06-20 Havoc Pennington * dbus/dbus-glib-error-enum.h: autogenerate the GError enum codes from the dbus error names * glib/dbus-glib.h: move to subdir dbus/ since it's included as dbus/dbus-glib.h and that breakage is now visible due to including dbus/dbus-glib.h in dbus-glib-lowlevel.h * glib/dbus-glib.h: s/gproxy/g_proxy/ * dbus/dbus-shared.h: new header to hold stuff shared with binding APIs * dbus/dbus-protocol.h (DBUS_ERROR_*): move errors here rather than dbus-errors.h * glib/dbus-glib.h (dbus_set_g_error): move to dbus-glib-lowlevel.h * glib/dbus-glib.h: remove dbus/dbus.h from here; change a bunch of stuff to enable this * dbus/dbus-glib-lowlevel.h: put dbus/dbus.h here * a bunch of other changes with the same basic "separate glib bindings from dbus.h" theme glib/Makefile.am | 6 +- glib/dbus-gidl.c | 2 +- glib/dbus-glib-tool.c | 2 +- glib/dbus-glib.c | 67 ++++++++++++++ glib/dbus-glib.h | 159 -------------------------------- glib/dbus-gmain.c | 121 ++++++++++++++++++++++-- glib/dbus-gobject.c | 17 ++-- glib/dbus-gproxy.c | 237 +++++++++++++++++++++++++----------------------- glib/dbus-gtest.c | 4 + glib/dbus-gtest.h | 9 +- glib/dbus-gthread.c | 3 +- glib/dbus-gtool-test.h | 4 +- glib/dbus-gutils.c | 2 +- glib/dbus-gutils.h | 15 +++ 14 files changed, 342 insertions(+), 306 deletions(-) commit 9426e419227a721a8b7b04661ec133cb93c389e5 Author: Olivier Andrieu Date: 2004-06-05 16:32:00 +0000 2004-06-05 Olivier Andrieu * dbus/dbus-connection.h, dbus/dbus-connection.c: have object path registration functions take the path argument as char* instead of char**. * dbus/dbus-marshal.h, dbus/dbus-marshal.c (_dbus_decompose_path): split off the path decompostion part of _dbus_demarshal_object_path. Some misc. fixes to silence compiler warnings. * glib/dbus-gobject.c, test/test-service.c: update accordingly. glib/dbus-gobject.c | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) commit b2a4e237f907acd5127f85d0e2110b32d8a7ea86 Author: Kristian Hogsberg Date: 2004-06-02 13:13:14 +0000 2004-06-02 Kristian Hgsberg * glib/dbus-gproxy.c, glib/dbus-gmain.c, dbus/dbus-string.c, dbus/dbus-object-tree.c, dbus/dbus-message.c: add comments to quiet doxygen. * Doxyfile.in: remove deprecated options. * dbus/dbus-message-handler.c, dbus/dbus-message-handler.h, glib/test-thread.h, glib/test-thread-client.c, glib/test-thread-server.c, glib/test-profile.c, glib/test-dbus-glib.c: remove these unused files. glib/dbus-gmain.c | 12 ++- glib/dbus-gproxy.c | 32 +++++- glib/test-dbus-glib.c | 50 --------- glib/test-profile.c | 223 ---------------------------------------- glib/test-thread-client.c | 95 ----------------- glib/test-thread-server.c | 248 --------------------------------------------- glib/test-thread.h | 1 - 7 files changed, 36 insertions(+), 625 deletions(-) commit 05a2332400f9e23d84e7376b9908f19a59868d5d Author: Havoc Pennington Date: 2004-06-01 03:02:26 +0000 2004-05-31 Havoc Pennington * glib/dbus-gidl.c (method_info_add_arg): keep args sorted with "in" before "out" * glib/dbus-gobject.c (dbus_type_to_string): move to dbus-gutils.c * glib/dbus-glib-tool.c (main): set up to have a --self-test option that runs the tests, and start filling in some code including for starters just dumping the interfaces to stdout * glib/Makefile.am (INCLUDES): define DBUS_LOCALEDIR * test/data/valid-introspection-files/lots-of-types.xml: test of an example introspection file * glib/dbus-gparser.c (parser_check_doctype): doctype should be "node" (I think...) glib/Makefile.am | 9 +- glib/dbus-gidl.c | 25 +++++ glib/dbus-glib-tool.c | 280 ++++++++++++++++++++++++++++++++++++++++++++++--- glib/dbus-glib.h | 5 +- glib/dbus-gobject.c | 36 +------ glib/dbus-gparser.c | 4 +- glib/dbus-gutils.c | 34 ++++++ glib/dbus-gutils.h | 4 +- 8 files changed, 338 insertions(+), 59 deletions(-) commit c02ba470d7a212d7c51777c467eae808dd954f2f Author: Havoc Pennington Date: 2004-05-28 22:30:04 +0000 2004-05-28 Havoc Pennington * test/glib/test-service-glib.c (main): remove unused variable * glib/dbus-gidl.c (base_info_ref): fix a silly compiler warning * dbus/dbus-auth.h (enum): remove AUTHENTICATED_WITH_UNUSED_BYTES from the enum, no longer in use. * dbus/dbus-sysdeps.h: include config.h so DBUS_VA_COPY actually works right. * dbus/dbus-message.c: add various _dbus_return_val_if_fail for whether error_name passed in is a valid error name. glib/dbus-gidl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 1400b16528f4d0d8f6a60b199e5799eadb0ff0ea Author: Michael Meeks Date: 2004-05-28 13:10:35 +0000 2004-05-28 Michael Meeks * glib/dbus-gvalue.c (dbus_gvalue_marshal, dbus_gvalue_demarshal): fix no int64 case. * dbus/dbus-string.c (_dbus_string_parse_basic_type): impl. * dbus/dbus-message.c (_dbus_message_iter_get_basic_type), (_dbus_message_iter_get_basic_type_array): impl. drastically simplify ~all relevant _get methods to use these. (_dbus_message_iter_append_basic_array), (dbus_message_iter_append_basic): impl drastically simplify ~all relevant _append methods to use these. * dbus/dbus-message-builder.c (parse_basic_type) (parse_basic_array, lookup_basic_type): impl. (_dbus_message_data_load): prune scads of duplicate / cut & paste coding. * dbus/dbus-marshal.c (_dbus_demarshal_basic_type_array) (_dbus_demarshal_basic_type): implement, (demarshal_and_validate_len/arg): beef up debug. (_dbus_marshal_basic_type, _dbus_marshal_basic_type_array): impl. glib/dbus-gvalue.c | 4 ++++ 1 file changed, 4 insertions(+) commit 7866137fa3b028e7a8e22f03998754c0967e1501 Author: Olivier Andrieu Date: 2004-04-15 22:08:04 +0000 2004-04-15 Olivier Andrieu * bus/driver.c (bus_driver_handle_get_service_owner): implement a GetServiceOwner method. * doc/dbus-specification.xml: document it. * dbus/dbus-errors.h: add a 'ServiceHasNoOwner' error. * glib/dbus-gproxy.c (dbus_gproxy_new_for_service_owner): implement, using the bus GetServiceOwner method. * test/glib/test-dbus-glib.c: use dbus_gproxy_new_for_service_owner so that we can receive the signal. glib/dbus-gproxy.c | 55 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) commit e03a715a21237d70233d40a393958ec7d3d4027d Author: Michael Meeks Date: 2004-04-13 11:47:17 +0000 2004-04-13 Michael Meeks * glib/dbus-gobject.c (handle_introspect): split out (introspect_properties): this. (handle_introspect): implement this. glib/dbus-gobject.c | 123 ++++++++++++++++++++++++++++++++++----------------- 1 file changed, 82 insertions(+), 41 deletions(-) commit e7e5d9377e54b9d26a59402197d26bb575c15976 Author: Michael Meeks Date: 2004-03-29 13:24:50 +0000 2004-03-29 Michael Meeks * glib/dbus-gobject.c (set_object_property): split out / re-work, use the property type, and not the message type(!) (get_object_property): ditto. * glib/dbus-gvalue.c (dbus_gvalue_demarshal), (dbus_gvalue_marshal): make this code re-usable, needed for signals too, also on both proxy and server side. Re-write for more efficiency / readability. glib/Makefile.am | 4 +- glib/dbus-gobject.c | 187 +++------------------------------------------------ glib/dbus-gvalue.c | 115 +++++++++++++++++++++++++++++++ glib/dbus-gvalue.h | 16 +++++ 4 files changed, 142 insertions(+), 180 deletions(-) commit 82d9c846687c428fde8e517ca38d69642de9a66a Author: Richard Hult Date: 2003-12-02 10:44:21 +0000 2003-12-02 Richard Hult * Update AFL version to 2.0 throughout the source files to reflect the update that was done a while ago. glib/dbus-gidl.c | 2 +- glib/dbus-gidl.h | 2 +- glib/dbus-glib-tool.c | 2 +- glib/dbus-glib.h | 2 +- glib/dbus-gloader-expat.c | 2 +- glib/dbus-gmain.c | 2 +- glib/dbus-gobject.c | 2 +- glib/dbus-gparser.c | 2 +- glib/dbus-gparser.h | 2 +- glib/dbus-gproxy.c | 2 +- glib/dbus-gtest-main.c | 2 +- glib/dbus-gtest.c | 2 +- glib/dbus-gtest.h | 2 +- glib/dbus-gthread.c | 2 +- glib/dbus-gtool-test.h | 2 +- glib/dbus-gutils.c | 2 +- glib/dbus-gutils.h | 2 +- glib/test-profile.c | 2 +- 18 files changed, 18 insertions(+), 18 deletions(-) commit 64858892747bea931226f39dad9e063475bf3c89 Author: Mikael Hallendal Date: 2003-11-27 01:25:49 +0000 2003-11-26 Mikael Hallendal * bus/*.[ch]: * dbus/*.[ch]: * glib/*.[ch]: Made ref functions return the pointer glib/dbus-gidl.c | 24 ++++++++++++++++++------ glib/dbus-gidl.h | 12 ++++++------ glib/dbus-gmain.c | 4 +++- glib/dbus-gparser.c | 4 +++- glib/dbus-gparser.h | 2 +- glib/dbus-gproxy.c | 6 ++++-- 6 files changed, 35 insertions(+), 17 deletions(-) commit f130073ef0a107d0b57695720f5a94d0e17ce38f Author: Havoc Pennington Date: 2003-10-21 05:46:51 +0000 2003-10-20 Havoc Pennington hmm, make check is currently not passing. * doc/dbus-specification.xml: add requirement that custom type names follow the same rules as interface names. * dbus/dbus-protocol.h: change some of the byte codes, to avoid duplication and allow 'c' to be 'custom'; dict is now 'm' for 'map' * doc/dbus-specification.xml: update type codes to match dbus-protocol.h, using the ASCII byte values. Rename type NAMED to CUSTOM. Add type OBJECT_PATH to the spec. 2003-10-17 Havoc Pennington * bus/driver.c (create_unique_client_name): use "." as separator in base service names instead of '-' * dbus/dbus-string.c (_dbus_string_get_byte): allow getting nul byte at the end of the string * dbus/dbus-internals.h (_DBUS_LIKELY, _DBUS_UNLIKELY): add optimization macros since string validation seems to be a slow point. * doc/dbus-specification.xml: restrict valid service/interface/member/error names. Add test suite code for the name validation. * dbus/dbus-string.c: limit service/interface/member/error names to [0-9][A-Z][a-z]_ * dbus/dbus-connection.c (dbus_connection_dispatch): add missing format arg to verbose spew * glib/dbus-gproxy.c (dbus_gproxy_call_no_reply): if not out of memory, return instead of g_error * test/test-service.c (path_message_func): support emitting a signal on request * dbus/dbus-bus.c (init_connections_unlocked): only fill in activation bus type if DBUS_BUS_ACTIVATION was set; default to assuming the activation bus was the session bus so that services started manually will still register. (init_connections_unlocked): fix so that in OOM situation we get the same semantics when retrying the function * test/test-service.c (main): change to use path registration, to test those codepaths; register with DBUS_BUS_ACTIVATION rather than DBUS_BUS_SESSION glib/dbus-gobject.c | 4 ++-- glib/dbus-gproxy.c | 12 +++++++++++- 2 files changed, 13 insertions(+), 3 deletions(-) commit 756f88a96232ae730faca81feeb30fcd07458df9 Author: Havoc Pennington Date: 2003-10-17 16:23:19 +0000 2003-10-16 Havoc Pennington * glib/dbus-gtest-main.c: bracket with #ifdef DBUS_BUILD_TESTS * Makefile.am (GCOV_DIRS): remove "test", we don't care about test coverage of the tests (coverage-report.txt): don't move the .da and .bbg files around glib/dbus-gtest-main.c | 5 +++++ 1 file changed, 5 insertions(+) commit aa0c367ff5214ddbb2578e5b290cfae6aa472a0d Author: Havoc Pennington Date: 2003-10-16 06:34:50 +0000 2003-10-16 Havoc Pennington * bus/connection.c (bus_pending_reply_expired): either cancel or execute, not both (bus_connections_check_reply): use unlink, not remove_link, as we don't want to free the link; fixes double free mess * dbus/dbus-pending-call.c (dbus_pending_call_block): fix in case where no reply was received * dbus/dbus-connection.c (_dbus_pending_call_complete_and_unlock): fix a refcount leak * bus/signals.c (match_rule_matches): add special cases for the bus driver, so you can match on sender/destination for it. * dbus/dbus-sysdeps.c (_dbus_abort): print backtrace if DBUS_PRINT_BACKTRACE is set * dbus/dbus-internals.c: add pid to assertion failure messages * dbus/dbus-connection.c: add message type code to the debug spew * glib/dbus-gproxy.c (gproxy_get_match_rule): match rules want sender=foo not service=foo * dbus/dbus-bus.c (dbus_bus_get): if the activation bus is the session bus but DBUS_SESSION_BUS_ADDRESS isn't set, use DBUS_ACTIVATION_ADDRESS instead * bus/activation.c: set DBUS_SESSION_BUS_ADDRESS, DBUS_SYSTEM_BUS_ADDRESS if appropriate * bus/bus.c (bus_context_new): handle OOM copying bus type into context struct * dbus/dbus-message.c (dbus_message_iter_get_object_path): new function (dbus_message_iter_get_object_path_array): new function (half finished, disabled for the moment) * glib/dbus-gproxy.c (dbus_gproxy_end_call): properly handle DBUS_MESSAGE_TYPE_ERROR * tools/dbus-launch.c (babysit): support DBUS_DEBUG_OUTPUT to avoid redirecting stderr to /dev/null (babysit): close stdin if not doing the "exit_with_session" thing * dbus/dbus-sysdeps.c (_dbus_become_daemon): delete some leftover debug code; change DBUS_DEBUG_OUTPUT to only enable stderr, not stdout/stdin, so things don't get confused * bus/system.conf.in: fix to allow replies, I modified .conf instead of .conf.in again. glib/dbus-gproxy.c | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) commit 33689cc9f76ff14f77ba9b9d6e17094991fc2ba1 Author: Havoc Pennington Date: 2003-10-12 05:59:39 +0000 2003-10-12 Havoc Pennington Added test code that 1) starts an actual bus daemon and 2) uses DBusGProxy; fixed bugs that were revealed by the test. Lots more testing possible, but this is the basic framework. * glib/dbus-gproxy.c (dbus_gproxy_manager_unregister): remove empty proxy lists from the proxy list hash * dbus/dbus-message.c (dbus_message_iter_get_args_valist): add a couple of return_if_fail checks * dbus/dbus-pending-call.c (_dbus_pending_call_new): use dbus_new0 to allocate, so everything is cleared to NULL as it should be. * glib/dbus-gmain.c (dbus_connection_setup_with_g_main): pass source as data to dbus_connection_set_timeout_functions() as the timeout functions expected * test/glib/run-test.sh: add a little script to start up a message bus and run tests using it * tools/dbus-launch.1: updates * tools/dbus-launch.c (main): add --config-file option * tools/dbus-launch.c (main): remove confusing else if (runprog) that could never be reached. * dbus/dbus-message.c (dbus_message_new_method_return) (dbus_message_new_error, dbus_message_new_signal): set the no-reply-expected flag on all these. Redundant, but may as well be consistent. glib/dbus-gmain.c | 2 +- glib/dbus-gproxy.c | 17 ++++++++++++----- 2 files changed, 13 insertions(+), 6 deletions(-) commit 6741526f3dedd835d9f0d7ae4beaa097016b0b9e Author: Havoc Pennington Date: 2003-10-03 03:55:35 +0000 2003-10-02 Havoc Pennington * glib/dbus-gproxy.c (dbus_gproxy_call_no_reply): rename from dbus_gproxy_oneway_call * glib/dbus-gmain.c (dbus_connection_setup_with_g_main) (dbus_server_setup_with_g_main): fix to allow calling them more than once on the same args (dbus_bus_get_with_g_main): new function glib/dbus-glib.h | 14 ++++---- glib/dbus-gmain.c | 99 ++++++++++++++++++++++++++++++++++++++++++++-------- glib/dbus-gproxy.c | 8 ++--- 3 files changed, 97 insertions(+), 24 deletions(-) commit b05fc993d8d813ca93fa2c49e4c8b7345613c8e0 Author: Havoc Pennington Date: 2003-09-30 02:32:48 +0000 2003-09-29 Havoc Pennington * Merge dbus-object-names branch. To see the entire patch do cvs diff -r DBUS_OBJECT_NAMES_BRANCHPOINT -r dbus-object-names, it's huuuuge though. To revert, I tagged DBUS_BEFORE_OBJECT_NAMES_MERGE. 2003-09-28 Havoc Pennington * HACKING: update to reflect new server 2003-09-26 Seth Nickell * python/dbus.py: * python/examples/example-signals.py: Start implementing some notions of signals. The API is really terrible, but they sort of work (with the exception of being able to filter by service, and to transmit signals *as* a particular service). Need to figure out how to make messages come from the service we registered :-( * python/dbus_bindings.pyx.in: Removed duplicate message_handler callbacks. 2003-09-25 Havoc Pennington * bus/session.conf.in: fix my mess 2003-09-25 Havoc Pennington * bus/session.conf.in: fix security policy, reported by Seth Nickell 2003-09-25 Seth Nickell * python/examples/example-service.py: Johan notices complete wrong code in example-service, but completely wrong in a way that works exactly the same (!). Johan is confused, how could this possibly work? Example code fails to serve purpose of making things clear. Seth fixes. 2003-09-25 Mark McLoughlin * doc/dbus-specification.sgml: don't require header fields to be 4-byte aligned and specify that fields should be distinguished from padding by the fact that zero is not a valid field name. * doc/TODO: remove re-alignment item and add item to doc the OBJECT_PATH type. * dbus/dbus-message.c: (HeaderField): rename the original member to value_offset and introduce a name_offset member to keep track of where the field actually begins. (adjust_field_offsets): remove. (append_int_field), (append_uint_field), (append_string_field): don't align the start of the header field to a 4-byte boundary. (get_next_field): impl finding the next marhsalled field after a given field. (re_align_field_recurse): impl re-aligning a number of already marshalled fields. (delete_field): impl deleting a field of any type and re-aligning any following fields. (delete_int_or_uint_field), (delete_string_field): remove. (set_int_field), (set_uint_field): no need to re-check that we have the correct type for the field. (set_string_field): ditto and impl re-aligning any following fields. (decode_header_data): update to take into account that the fields aren't 4-byte aligned any more and the new way to distinguish padding from header fields. Also, don't exit when there is too much header padding. (process_test_subdir): print the directory. (_dbus_message_test): add test to make sure a following field is re-aligned correctly after field deletion. * dbus/dbus-string.[ch]: (_dbus_string_insert_bytes): rename from insert_byte and allow the insert of multiple bytes. (_dbus_string_test): test inserting multiple bytes. * dbus/dbus-marshal.c: (_dbus_marshal_set_string): add warning note to docs about having to re-align any marshalled values following the string. * dbus/dbus-message-builder.c: (append_string_field), (_dbus_message_data_load): don't align the header field. * dbus/dbus-auth.c: (process_test_subdir): print the directory. * test/break-loader.c: (randomly_add_one_byte): upd. for insert_byte change. * test/data/invalid-messages/bad-header-field-alignment.message: new test case. * test/data/valid-messages/unknown-header-field.message: shove a dict in the unknown field. 2003-09-25 Seth Nickell * python/dbus.py: * python/dbus_bindings.pyx.in: Handle return values. * python/examples/example-client.py: * python/examples/example-service.py: Pass back return values from the service to the client. 2003-09-24 Seth Nickell * python/dbus.py: Connect Object methods (when you are sharing an object) up... pass in a list of methods to be shared. Sharing all the methods just worked out too weird. You can now create nice Services over the DBus in Python. :-) * python/dbus_bindings.pyx.in: Keep references to user_data tuples passed into C functions so Python doesn't garbage collect on us. Implement MethodReturn and Error subclasses of Message for creating DBusMessage's of those types. * python/examples/example-client.py: * python/examples/example-service.py: Simple example code showing both how create DBus services and objects, and how to use them. 2003-09-23 Havoc Pennington * glib/dbus-gproxy.c (dbus_gproxy_manager_filter): implement 2003-09-23 Havoc Pennington * glib/dbus-gproxy.c (dbus_gproxy_connect_signal): implement (dbus_gproxy_disconnect_signal): implement (dbus_gproxy_manager_remove_signal_match): implement (dbus_gproxy_manager_add_signal_match): implement (dbus_gproxy_oneway_call): implement 2003-09-23 Havoc Pennington * glib/dbus-gproxy.c (struct DBusGProxy): convert to a GObject subclass. This means dropping the transparent thread safety of the proxy; you now need a separate proxy per-thread, or your own locking on the proxy. Probably right anyway. (dbus_gproxy_ref, dbus_gproxy_unref): nuke, just use g_object_ref 2003-09-22 Havoc Pennington * glib/dbus-gproxy.c (dbus_gproxy_manager_get): implement 2003-09-21 Seth Nickell First checkin of the Python bindings. * python/.cvsignore: * python/Makefile.am: * python/dbus_bindings.pyx.in: * python/dbus_h_wrapper.h: Pieces for Pyrex to operate on, building a dbus_bindings.so python module for low-level access to the DBus APIs. * python/dbus.py: High-level Python module for accessing DBus objects. * configure.in: * Makefile.am: Build stuff for the python bindings. * acinclude.m4: Extra macro needed for finding the Python C header files. 2003-09-21 Havoc Pennington * glib/dbus-gproxy.c (dbus_gproxy_manager_new): start implementing the proxy manager, didn't get very far. * dbus/dbus-bus.c (dbus_bus_add_match): new (dbus_bus_remove_match): new * glib/dbus-gproxy.c (dbus_gproxy_new_for_service): add a path_name argument; adjust the other not-yet-implemented gproxy constructors to be what I think they should be. 2003-09-21 Havoc Pennington * dbus/dbus-bus.c (dbus_bus_get): set exit_on_disconnect to TRUE by default for message bus connections. * dbus/dbus-connection.c (dbus_connection_dispatch): exit if exit_on_disconnect flag is set and we process the disconnected signal. (dbus_connection_set_exit_on_disconnect): new function 2003-09-21 Havoc Pennington Get matching rules mostly working in the bus; only actually parsing the rule text remains. However, the client side of "signal connections" hasn't been started, this patch is only the bus side. * dbus/dispatch.c: fix for the matching rules changes * bus/driver.c (bus_driver_handle_remove_match) (bus_driver_handle_add_match): send an ack reply from these method calls * glib/dbus-gproxy.c (dbus_gproxy_begin_call): fix order of arguments, reported by Seth Nickell * bus/config-parser.c (append_rule_from_element): support eavesdrop=true|false attribute on policies so match rules can be prevented from snooping on the system bus. * bus/dbus-daemon-1.1.in: consistently use terminology "sender" and "destination" in attribute names; fix some docs bugs; add eavesdrop=true|false attribute * bus/driver.c (bus_driver_handle_add_match) (bus_driver_handle_remove_match): handle AddMatch, RemoveMatch messages * dbus/dbus-protocol.h (DBUS_SERVICE_ORG_FREEDESKTOP_BROADCAST): get rid of broadcast service concept, signals are just always broadcast * bus/signals.c, bus/dispatch.c, bus/connection.c, bus/bus.c: mostly implement matching rules stuff (currently only exposed as signal connections) 2003-09-21 Mark McLoughlin * doc/dbus-specification.sgml: Change the header field name to be an enum and update the rest of the spec to reference the fields using the conventinal name. * dbus/dbus-protocol.h: update to reflect the spec. * doc/TODO: add item to remove the 4 byte alignment requirement. * dbus/dbus-message.c: Remove the code to generalise the header/body length and serial number header fields as named header fields so we can reference field names using the protocol values. (append_int_field), (append_uint_field), (append_string_field): Append the field name as a byte rather than four chars. (delete_int_or_uint_field), (delete_string_field): reflect the fact that the field name and typecode now occupy 4 bytes instead of 8. (decode_string_field), (decode_header_data): update to reflect protocol changes and move the field specific encoding from decode_string_field() back into decode_header_data(). * dbus/dbus-internals.[ch]: (_dbus_header_field_to_string): Add utility to aid debugging. * dbus/dbus-message-builder.c: (append_string_field), (_dbus_message_data_load): Update to reflect protocol changes; Change the FIELD_NAME directive to HEADER_FIELD and allow it to take the field's conventional name rather than the actual value. * test/data/*/*.message: Update to use HEADER_FIELD instead of FIELD_NAME; Always align the header on an 8 byte boundary *before* updating the header length. 2003-09-15 Havoc Pennington * dbus/dbus-pending-call.c: add the get/set object data boilerplate as for DBusConnection, etc. Use generic object data for the notify callback. * glib/dbus-gparser.c (parse_node): parse child nodes * tools/dbus-viewer.c: more hacking on the dbus-viewer * glib/dbus-gutils.c (_dbus_gutils_split_path): add a file to contain functions shared between the convenience lib and the installed lib * glib/Makefile.am (libdbus_glib_1_la_LDFLAGS): add -export-symbols-regex to the GLib library * dbus/dbus-object-tree.c (_dbus_object_tree_dispatch_and_unlock): fix the locking in here, and add a default handler for Introspect() that just returns sub-nodes. 2003-09-14 Havoc Pennington * glib/dbus-gthread.c (dbus_g_thread_init): rename to make g_foo rather than gfoo consistent * glib/dbus-gproxy.h: delete for now, move contents to dbus-glib.h, because the include files don't work right since we aren't in the dbus/ subdir. * glib/dbus-gproxy.c (dbus_gproxy_send): finish implementing (dbus_gproxy_end_call): finish (dbus_gproxy_begin_call): finish * glib/dbus-gmain.c (dbus_set_g_error): new * glib/dbus-gobject.c (handle_introspect): include information about child nodes in the introspection * dbus/dbus-connection.c (dbus_connection_list_registered): new function to help in implementation of introspection * dbus/dbus-object-tree.c (_dbus_object_tree_list_registered_and_unlock): new function 2003-09-12 Havoc Pennington * glib/dbus-gidl.h: add common base class for all the foo_info types * tools/dbus-viewer.c: add GTK-based introspection UI thingy similar to kdcop * test/Makefile.am: try test srcdir -ef . in addition to test srcdir = ., one of them should work (yeah lame) * glib/Makefile.am: build the "idl" parser stuff as a convenience library * glib/dbus-gparser.h: make description_load routines return NodeInfo* not Parser* * Makefile.am (SUBDIRS): build test dir after all library dirs * configure.in: add GTK+ detection 2003-09-07 Havoc Pennington * Make Doxygen contented. 2003-09-07 Havoc Pennington * doc/dbus-specification.sgml: more updates 2003-09-06 Havoc Pennington * doc/dbus-specification.sgml: partial updates * bus/dbus-daemon-1.1.in: fix the config file docs for the zillionth time; hopefully I edited the right file this time. * bus/config-parser.c (append_rule_from_element): support send_type, send_path, receive_type, receive_path * bus/policy.c: add message type and path to the list of things that can be "firewalled" 2003-09-06 Havoc Pennington * dbus/dbus-connection.c (dbus_connection_register_fallback): add this (dbus_connection_register_object_path): make this not handle messages to paths below the given path 2003-09-03 Havoc Pennington * test/glib/Makefile.am: add this with random glib-linked test programs * glib/Makefile.am: remove the random test programs from here, leave only the unit tests * glib/dbus-gobject.c (_dbus_gobject_test): add test for uscore/javacaps conversion, and fix (get_object_property, set_object_property): change to .NET convention for mapping props to methods, set_FooBar/get_FooBar, since one language has such a convention we may as well copy it. Plus real methods in either getFooBar or get_foo_bar style won't collide with this convention. 2003-09-01 Havoc Pennington * glib/dbus-gparser.c: implement * glib/dbus-gobject.c: start implementing skeletons support * configure.in: when disabling checks/assert, also define G_DISABLE_ASSERT and G_DISABLE_CHECKS 2003-09-01 Havoc Pennington * glib/Makefile.am: rearrange a bunch of files and get "make check" framework set up 2003-08-31 Havoc Pennington * fix build with --disable-tests 2003-08-30 Havoc Pennington * dbus/dbus-connection.c: purge DBusMessageHandler * dbus/dbus-message-handler.c: remove DBusMessageHandler, just use callbacks everywhere 2003-08-30 Havoc Pennington * test/data/valid-config-files/system.d/test.conf: change to root for the user so warnings don't get printed * dbus/dbus-message.c: add dbus_message_get_path, dbus_message_set_path * dbus/dbus-object-tree.c (do_test_dispatch): add test of dispatching to a path * dbus/dbus-string.c (_dbus_string_validate_path): add * dbus/dbus-marshal.c (_dbus_demarshal_object_path): implement (_dbus_marshal_object_path): implement * dbus/dbus-protocol.h (DBUS_HEADER_FIELD_PATH): new header field to contain the path to the target object (DBUS_HEADER_FIELD_SENDER_SERVICE): rename DBUS_HEADER_FIELD_SENDER to explicitly say it's the sender service 2003-08-30 Havoc Pennington * dbus/dbus-object-tree.c: write tests and fix the discovered bugs 2003-08-29 Havoc Pennington * dbus/dbus-object-tree.c: modify to allow overlapping paths to be registered (struct DBusObjectSubtree): shrink this a lot, since we may have a lot of them (_dbus_object_tree_free_all_unlocked): implement (_dbus_object_tree_dispatch_and_unlock): implement 2003-08-29 Havoc Pennington * dbus/dbus-internals.h: fix _DBUS_N_GLOBAL_LOCKS 2003-08-28 Havoc Pennington purge DBusObjectID * dbus/dbus-connection.c: port to no ObjectID, create a DBusObjectTree, rename ObjectTree to ObjectPath in public API * dbus/dbus-connection.h (struct DBusObjectTreeVTable): delete everything except UnregisterFunction and MessageFunction * dbus/dbus-marshal.c: port away from DBusObjectID, add DBUS_TYPE_OBJECT_PATH * dbus/dbus-object-registry.[hc], dbus/dbus-object.[hc], dbus/dbus-objectid.[hc]: remove these, we are moving to path-based object IDs 2003-08-25 Havoc Pennington Just noticed that dbus_message_test is hosed, I wonder when I broke that. I thought make check was passing earlier... * dbus/dbus-object-tree.c: add new "object tree" to match DCOP container tree, will replace most of dbus-object-registry * dbus/dbus-string.c (_dbus_string_append_printf_valist): fix C99 screwup 2003-08-19 Havoc Pennington * dbus/dbus-message.c (decode_string_field): support FIELD_SENDER (dbus_message_is_error): fix this function * bus/dbus-daemon-1.1: clarify logic on when / rules match * bus/policy.c (bus_client_policy_check_can_receive): fix code to reflect clarified man page (bus_client_policy_check_can_send): ditto * bus/session.conf.in: fixup * bus/system.conf.in: fixup 2003-08-18 Havoc Pennington * dbus/dbus-hash.c (_dbus_hash_table_insert_two_strings): fix ... glib/.cvsignore | 6 +- glib/Makefile.am | 70 ++- glib/dbus-gidl.c | 524 +++++++++++++++++++ glib/dbus-gidl.h | 120 +++++ glib/dbus-glib-tool.c | 77 +++ glib/dbus-glib.h | 121 ++++- glib/dbus-gloader-expat.c | 262 ++++++++++ glib/dbus-gmain.c | 100 +++- glib/dbus-gobject.c | 790 ++++++++++++++++++++++++++++ glib/dbus-gparser.c | 670 ++++++++++++++++++++++++ glib/dbus-gparser.h | 65 +++ glib/dbus-gproxy.c | 1249 +++++++++++++++++++++++++++++++++++++++++++++ glib/dbus-gtest-main.c | 46 ++ glib/dbus-gtest.c | 77 +++ glib/dbus-gtest.h | 35 ++ glib/dbus-gthread.c | 2 +- glib/dbus-gtool-test.h | 31 ++ glib/dbus-gutils.c | 96 ++++ glib/dbus-gutils.h | 40 ++ 19 files changed, 4345 insertions(+), 36 deletions(-) commit c6510f49417e04522d9cc6a6c51331bef252aba0 Author: Anders Carlsson Date: 2003-08-05 13:57:20 +0000 2003-08-05 Anders Carlsson * glib/dbus-gmain.c: (watch_fd_new), (watch_fd_ref), (watch_fd_unref), (dbus_gsource_check), (dbus_gsource_dispatch), (add_watch), (remove_watch), (create_source): Refcount fds, fixes some reentrancy issues. glib/dbus-gmain.c | 116 +++++++++++++++++++++++++++++++++++------------------ 1 file changed, 78 insertions(+), 38 deletions(-) commit a3c695d62bcfc46bd12f4165610649a604ed6166 Author: Havoc Pennington Date: 2003-06-22 19:39:46 +0000 2003-06-22 Havoc Pennington * dbus/dbus-dataslot.c (_dbus_data_slot_allocator_unref) (_dbus_data_slot_allocator_alloc): rework these to keep a reference count on each slot and automatically manage a global slot ID variable passed in by address * bus/bus.c: convert to new dataslot API * dbus/dbus-bus.c: convert to new dataslot API * dbus/dbus-connection.c: convert to new dataslot API * dbus/dbus-server.c: convert to new dataslot API * glib/dbus-gmain.c: ditto * bus/test.c: ditto * bus/connection.c: ditto glib/dbus-gmain.c | 24 ++++++++++-------------- glib/test-thread-server.c | 5 +++-- 2 files changed, 13 insertions(+), 16 deletions(-) commit 1284fea96df990975632f0a5d8d982ec5c974161 Author: Anders Carlsson Date: 2003-06-19 22:19:56 +0000 2003-06-19 Anders Carlsson * glib/dbus-glib.h: Fix so that dbus-glib.h can be used from C++ (Patch by Miloslav Trmac). glib/dbus-glib.h | 4 ++++ 1 file changed, 4 insertions(+) commit 375ff8ffbed8683c1a46fab9c537ccb9e603e1d7 Author: Anders Carlsson Date: 2003-06-18 10:48:07 +0000 Add .cvsignore files glib/.cvsignore | 1 + 1 file changed, 1 insertion(+) commit b4dd1b2cb3e226ece5055bc2f24ef819db7d1b08 Author: Havoc Pennington Date: 2003-05-17 17:53:16 +0000 2003-05-17 Havoc Pennington * bus/config-parser.c (merge_included): merge in policies from child configuration file. * bus/policy.c (bus_policy_merge): function to merge two policies together glib/test-profile.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit ae655688473fc5e5d6a279b3e764a713fc73b8ca Author: Havoc Pennington Date: 2003-05-12 02:44:44 +0000 2003-05-11 Havoc Pennington * dbus/dbus-marshal.c (_dbus_marshal_validate_arg): fix to avoid calling _dbus_marshal_validate_arg() for every byte in a byte array, etc. * dbus/dbus-message-handler.c: use atomic reference counting to reduce number of locks slightly; the global lock in here sucks * dbus/dbus-connection.c (_dbus_connection_update_dispatch_status_and_unlock): variant of update_dispatch_status that can be called with lock held; then use in a couple places to reduce locking/unlocking (dbus_connection_send): hold the lock over the whole function instead of acquiring it twice. * dbus/dbus-timeout.c (_dbus_timeout_new): handle OOM * bus/connection.c (bus_connections_setup_connection): fix access to already-freed memory. * dbus/dbus-connection.c: keep a little cache of linked list nodes, to avoid using the global linked list alloc lock in the normal send-message case. Instead we just use the connection lock that we already have to take. * dbus/dbus-list.c (_dbus_list_find_last): new function * dbus/dbus-sysdeps.c (_dbus_atomic_inc, _dbus_atomic_dec): change to use a struct for the atomic type; fix docs, they return value before increment, not after increment. * dbus/dbus-string.c (_dbus_string_append_4_aligned) (_dbus_string_append_8_aligned): new functions to try to microoptimize this operation. (reallocate_for_length): break this out of set_length(), to improve profile info, and also so we can consider inlining the set_length() part. * dbus/dbus-message.c (dbus_message_new_empty_header): init data strings with some preallocation, cuts down on our calls to realloc a fair bit. Though if we can get the "move entire string to empty string" optimization below to kick in here, it would be better. * dbus/dbus-string.c (_dbus_string_move): just call _dbus_string_move_len (_dbus_string_move_len): add a special case for moving an entire string into an empty string; we can just swap the string data instead of doing any reallocs. (_dbus_string_init_preallocated): new function glib/test-profile.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) commit b36dd8b35d932d01407b88e948c5196b49e31aa0 Author: Havoc Pennington Date: 2003-05-11 07:59:08 +0000 2003-05-11 Havoc Pennington Write a "test-profile" that does echo client-server with threads; profile reveals lock contention, memcpy/realloc of buffers, and UTF-8 validation as hot spots. 20% of lock contention eliminated with dbus_atomic_inc/dec implementation on x86. Much remaining contention is global mempool locks for GList and DBusList. * dbus/dbus-sysdeps.c (_dbus_atomic_inc, _dbus_atomic_dec): add x86 implementation * dbus/dbus-connection.c (struct DBusConnection): use dbus_atomic_t for the reference count * dbus/dbus-message.c (struct DBusMessage): declare dbus_atomic_t values as volatile * configure.in: code to detect ability to use atomic integer operations in assembly, from GLib patch * dbus/dbus-internals.c (_dbus_verbose_real): call getpid every time, tired of it being wrong in threads and forked processes * glib/test-profile.c: a little program to bounce messages back and forth between threads and eat CPU * dbus/dbus-connection.c: add debug spew macros for debugging thread locks; include config.h at top; fix deadlock in dbus_connection_flush() glib/Makefile.am | 33 +++++--- glib/test-profile.c | 215 +++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 237 insertions(+), 11 deletions(-) commit 6f4b867ddd6cef070d65149a4d935b4a964987f1 Author: Havoc Pennington Date: 2003-04-29 22:57:13 +0000 2003-04-29 Havoc Pennington * glib/dbus-gmain.c: docs cleanups * dbus/dbus-types.h: add docs on int64 types * dbus/dbus-memory.c: fix docs to avoid putting private API in public API docs section glib/dbus-gmain.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) commit 7d22e9a86a21e337a31ee42ccdb851ada88c0b40 Author: Havoc Pennington Date: 2003-04-25 20:41:49 +0000 2003-04-25 Havoc Pennington * glib/dbus-gmain.c (remove_watch): fix for a crash when watches were toggled without add/remove, fix from Anders Gustafsson glib/dbus-gmain.c | 4 ++++ 1 file changed, 4 insertions(+) commit 36a6a6bc4edb1b3280e405b0addb9113dc09de5c Author: Havoc Pennington Date: 2003-04-24 19:18:22 +0000 2003-04-24 Havoc Pennington * configure.in: add --enable-checks * dbus/dbus-message.c (dbus_message_new): reverse name/service arguments * dbus/dbus-connection.c (dbus_connection_preallocate_send): fix to use thread locks. (_dbus_connection_handler_destroyed_locked): move some private functions into proper docs group * dbus/dbus-internals.h: add _dbus_return_if_fail, _dbus_return_val_if_fail Throughout: use dbus_return_if_fail glib/test-dbus-glib.c | 3 ++- glib/test-thread-client.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) commit eb553e370e7651a3104038cbba7ebb7a502118e7 Author: James Willcox Date: 2003-04-24 02:22:49 +0000 2003-04-23 James Willcox * glib/dbus-glib.h: * glib/dbus-gmain.c: (add_timeout), (wakeup_main), (create_source), (dbus_connection_setup_with_g_main), (dbus_server_setup_with_g_main): * glib/test-dbus-glib.c: (main): * glib/test-thread-client.c: (main): * glib/test-thread-server.c: (new_connection_callback), (main): * tools/dbus-monitor.c: (main): Added a GMainContext argument to dbus_connection_setup_with_g_main() and dbus_server_setup_with_g_main(). glib/dbus-glib.h | 6 ++++-- glib/dbus-gmain.c | 36 +++++++++++++++++++++++------------- glib/test-dbus-glib.c | 2 +- glib/test-thread-client.c | 2 +- glib/test-thread-server.c | 4 ++-- 5 files changed, 31 insertions(+), 19 deletions(-) commit 62cc9827dee1d9fa052a11ce259acc7d1d2dcb9d Author: Havoc Pennington Date: 2003-04-18 04:18:57 +0000 2003-04-18 Havoc Pennington * glib/dbus-gmain.c: adapt to watch changes * bus/bus.c, bus/activation.c, etc.: adjust to watch changes * dbus/dbus-server.h: remove dbus_server_handle_watch * dbus/dbus-connection.h: remove dbus_connection_handle_watch * dbus/dbus-watch.c (dbus_watch_handle): change DBusWatch to work like DBusTimeout, so we don't need dbus_connection_handle_watch etc. glib/dbus-gmain.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) commit 723f9251ee8892f05f4c94a9b0cfa864c5e56bae Author: Alex Larsson Date: 2003-04-10 12:09:00 +0000 2003-04-10 Alexander Larsson * bus/.cvsignore: * glib/.cvsignore: * test/.cvsignore: Added files to cvsignore * dbus/dbus-message.h: * dbus/dbus-message.c: (dbus_message_iter_get_named): Make get_named() take two out argument and return a boolean. (dbus_message_iter_get_args_valist): Update usage of get_named(). (dbus_message_iter_append_byte): Fix typo (dbus_message_iter_append_named) Fix typo (message_iter_test), (check_message_handling_type), (_dbus_message_test): More tests. glib/.cvsignore | 2 ++ 1 file changed, 2 insertions(+) commit f8c607ec8949388bd09136d0a6635190910a3e9a Author: Alex Larsson Date: 2003-04-08 15:52:50 +0000 2003-04-08 Alexander Larsson Implemented recursive types, named types and new-style iters * bus/driver.c: * glib/test-thread-client.c: (thread_func): * glib/test-thread-server.c: (handle_test_message): * test/test-service.c: (handle_echo): Update to new api * dbus/Makefile.am: * dbus/dbus-dict.c: * dbus/dbus-dict.h: * dbus/dbus.h Remove DBusDict * dbus/dbus-internals.c: (_dbus_type_to_string): Update for new types. * dbus/dbus-marshal.[ch]: Implement recursive types and the new marshalling format. Remove hardcoded dict marshalling. Marshal named types. * dbus/dbus-message-builder.c: Add BYTE_ARRAY. Remove references to old types * dbus/dbus-message.[ch]: New non-refcounted iter API that supports recursive iters. Use iters for appending, including support for recursive iters. Add byte and named type support. Update everything to new marshalling formats. Add tests for new API. * dbus/dbus-protocol.h: Remove old array types. Add types: BYTE, ARRAY, DICT, NAMED * dbus/dbus-string.c: * dbus/dbus-sysdeps.c: Make parse_double locale safe. * dbus/dbus-test-main.c: Call setlocale. * dbus/dbus-test.c: Kill dict test * doc/dbus-specification.sgml: Update spec * test/data/incomplete-messages/missing-body.message: * test/data/invalid-messages/bad-boolean.message: * test/data/invalid-messages/bad-boolean-array.message: * test/data/invalid-messages/boolean-array-length-too-long.message-raw: * test/data/invalid-messages/boolean-has-no-value.message-raw: * test/data/invalid-messages/too-short-dict.message: * test/data/valid-messages/dict-simple.message: * test/data/valid-messages/dict.message: * test/data/valid-messages/emptiness.message: * test/data/valid-messages/lots-of-arguments.message: * test/data/valid-messages/no-padding.message: * test/data/valid-messages/recursive-types.message: Add missing NAME fields Fix up dicts & arrays * test/data/invalid-messages/dict-with-nil-value.message: Removed, this is not invalid anymore. * test/data/valid-messages/recursive-types.message: Add new test for deeply recursive types. glib/test-thread-client.c | 9 ++++++--- glib/test-thread-server.c | 23 +++++++++++------------ 2 files changed, 17 insertions(+), 15 deletions(-) commit 4612ff9267417cf8860c233a59fe8ec249ee4a62 Author: Havoc Pennington Date: 2003-03-25 04:37:07 +0000 2003-03-24 Havoc Pennington * dbus/dbus-sysdeps.c (_dbus_set_fd_nonblocking): move to this file * dbus/dbus-errors.c (dbus_set_error, dbus_set_error_const): allow NULL argument for "message" if the error is a well-known one, fill in a generic message in this case. * dbus/dbus-errors.h (DBusResultCode): Kill DBusResultCode in favor of DBusError * bus/test.c (bus_test_flush_bus): add * bus/policy.c (bus_policy_test): test code stub glib/test-dbus-glib.c | 7 ++++--- glib/test-thread-client.c | 8 +++++--- glib/test-thread-server.c | 8 +++++--- 3 files changed, 14 insertions(+), 9 deletions(-) commit 9eb162678713477754e9d88eb68c156d336c80ab Author: Havoc Pennington Date: 2003-03-16 20:16:46 +0000 2003-03-16 Havoc Pennington * dbus/dbus-string.c (_dbus_string_validate_utf8): oops, unbreak this. always run the test suite before commit... * bus/*: adapt to DBusConnection API changes * glib/dbus-gmain.c: adapt to DBusConnection API changes, requires renaming stuff to avoid dbus_connection_dispatch name conflict. * dbus/dbus-transport.c (_dbus_transport_queue_messages): new function * dbus/dbus-message.c (_dbus_message_loader_queue_messages): separate from _dbus_message_loader_return_buffer() * dbus/dbus-connection.c (dbus_connection_get_n_messages): remove this, because it's now always broken to use; the number of messages in queue vs. the number still buffered by the message loader is undefined/meaningless. Should use dbus_connection_get_dispatch_state(). (dbus_connection_dispatch): rename from dbus_connection_dispatch_message glib/dbus-gmain.c | 64 ++++++++++++++++++++++++++--------------------------- 1 file changed, 32 insertions(+), 32 deletions(-) commit 457dd574d5eda1286571f7070860c6feb56f184e Author: Havoc Pennington Date: 2003-03-15 20:47:16 +0000 2003-03-15 Havoc Pennington Make it pass the Hello handling test including all OOM codepaths. Now to do other messages... * bus/services.c (bus_service_remove_owner): fix crash when removing owner from an empty list of owners (bus_registry_ensure): don't leave service in the list of a connection's owned services if we fail to put the service in the hash table. * bus/connection.c (bus_connection_preallocate_oom_error): set error flag on the OOM error. * dbus/dbus-connection.c (_dbus_connection_new_for_transport): handle _dbus_transport_set_connection failure * dbus/dbus-transport-unix.c (_dbus_transport_new_for_fd): modify to create watches up front and simply enable/disable them as needed. (unix_connection_set): this can now fail on OOM * dbus/dbus-timeout.c, dbus/dbus-watch.c: add concept of enabling/disabling a watch or timeout. * bus/loop.c (bus_loop_iterate): don't touch disabled watches/timeouts * glib/dbus-gmain.c: adapt to enable/disable watches and timeouts glib/dbus-gmain.c | 44 ++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 42 insertions(+), 2 deletions(-) commit 0f748f23b6fd40ab314bdc4d18e631cde958c1d2 Author: Havoc Pennington Date: 2003-03-15 02:19:01 +0000 2003-03-14 Havoc Pennington * dbus/dbus-memory.c: add a "detect buffer overwrites on free" cheesy hack * dbus/dbus-transport-debug.c: rework this a good bit to be less complicated. hopefully still works. * dbus/dbus-server-debug.c (handle_new_client): remove timeout manually * glib/dbus-gmain.c (timeout_handler): don't remove timeout after running it * dbus/dbus-message.c (dbus_message_copy): rename from dbus_message_new_from_message, fix it up to copy all the message fields, add test case * bus/dispatch.c (bus_dispatch_test): add some more test code, not quite passing yet glib/dbus-gmain.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit a15287bc97819cca7b61cc18d6d69232bb05117d Author: Havoc Pennington Date: 2003-03-14 01:27:58 +0000 2003-03-13 Havoc Pennington * dbus/dbus-timeout.c (_dbus_timeout_list_set_functions): handle out of memory * dbus/dbus-watch.c (_dbus_watch_list_set_functions): handle out of memory * dbus/dbus-connection.h: Make AddWatchFunction and AddTimeoutFunction return a bool so they can fail on out-of-memory * bus/bus.c (bus_context_new): set up timeout handlers * bus/connection.c (bus_connections_setup_connection): set up timeout handlers * glib/dbus-gmain.c: adapt to the fact that set_functions stuff can fail * bus/bus.c (bus_context_new): adapt to changes * bus/connection.c: adapt to changes * test/watch.c: adapt to DBusWatch changes * bus/dispatch.c (bus_dispatch_test): started adding this but didn't finish glib/dbus-gmain.c | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) commit e0a3fe2914f611ef4d74bbc1ca39794f0f7ae575 Author: Havoc Pennington Date: 2003-03-13 00:56:43 +0000 2003-03-12 Havoc Pennington Mega-patch that gets the message bus daemon initially handling out-of-memory. Work still needed. Also lots of random moving stuff to DBusError instead of ResultCode. * dbus/dbus-list.c (_dbus_list_length_is_one): new function * dbus/dbus-connection.c (dbus_connection_send_with_reply_and_block): use DBusError * dbus/dbus-bus.c: adapt to API changes, make it use DBusError not DBusResultCode * dbus/dbus-connection.c (dbus_connection_send): drop the result code here, as the only failure possible is OOM. * bus/connection.c (bus_connection_disconnect): rename bus_connection_disconnected as it's a notification only * bus/driver.c (bus_driver_handle_acquire_service): don't free "name" on get_args failure, should be done by get_args; don't disconnect client for bad args, just return an error. (bus_driver_handle_service_exists): ditto * bus/services.c (bus_services_list): NULL-terminate returned array * bus/driver.c (bus_driver_send_service_lost) (bus_driver_send_service_acquired): send messages from driver to a specific client to the client's unique name, not to the broadcast service. * dbus/dbus-message.c (decode_header_data): reject messages that contain no name field (_dbus_message_get_client_serial): rename to dbus_message_get_serial and make public (_dbus_message_set_serial): rename from set_client_serial (_dbus_message_set_reply_serial): make public (_dbus_message_get_reply_serial): make public * bus/connection.c (bus_connection_foreach): allow stopping iteration by returning FALSE from foreach function. * dbus/dbus-connection.c (dbus_connection_send_preallocated) (dbus_connection_free_preallocated_send) (dbus_connection_preallocate_send): new API for sending a message without possibility of malloc failure. (dbus_connection_send_message): rename to just dbus_connection_send (and same for whole function family) * dbus/dbus-errors.c (dbus_error_free): make this reinit the error * dbus/dbus-sysdeps.c (_dbus_exit): new function * bus/activation.c: handle/return errors * dbus/dbus-errors.h: add more DBUS_ERROR #define * dbus/dbus-sysdeps.c (_dbus_directory_open) (_dbus_file_get_contents) (_dbus_directory_get_next_file): use DBusError instead of DBusResultCode (_dbus_result_from_errno): move to this file glib/test-dbus-glib.c | 20 ++++++++++++++------ glib/test-thread-client.c | 9 +++++---- 2 files changed, 19 insertions(+), 10 deletions(-) commit 284daff1f103a303178243ca3e2dee960651fec0 Author: Alex Larsson Date: 2003-02-27 14:22:36 +0000 2003-02-27 Alexander Larsson * glib/Makefile.am: * configure.in: Make gthreads-2.0 dependency optional. Don't build thread test if its not found. glib/Makefile.am | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) commit b9589e9908d368cb064d1614e5c52239394414f4 Author: Alex Larsson Date: 2003-02-26 15:52:25 +0000 2003-02-26 Alexander Larsson * configure.in: Set DBUS_GLIB_THREADS_LIBS for apps using gthread-2.0 * dbus/dbus-connection.c: * dbus/dbus-connection.h: Fix _dbus_connection_acquire_io_path and _dbus_connection_acquire_dispatch. Add dbus_connection_set_wakeup_main_function and use it when queueing incoming and outgoing messages. * dbus/dbus-dataslot.c: Threadsafe usage of DBusDataSlotAllocator * dbus/dbus-message.c: (dbus_message_get_args_iter): dbus_new can fail. * dbus/dbus-server-unix.c: Add todo comment * glib/dbus-gmain.c: Implement the new wakeup functions for glib. * glib/Makefile.am: * glib/test-thread-client.c: * glib/test-thread-server.c: * glib/test-thread.h: Initial cut at some thread test code. Not really done yet. glib/Makefile.am | 16 ++- glib/dbus-gmain.c | 13 ++- glib/test-thread-client.c | 89 ++++++++++++++++ glib/test-thread-server.c | 246 +++++++++++++++++++++++++++++++++++++++++++++ glib/test-thread.h | 1 + 5 files changed, 362 insertions(+), 3 deletions(-) commit c79213c6d3b041ce00bb00f24d4824e4a77f63ef Author: Havoc Pennington Date: 2003-02-26 06:42:57 +0000 2003-02-26 Havoc Pennington * dbus/dbus-connection.c (dbus_connection_send_message_with_reply_and_block): fix crash where we ref'd the outgoing message instead of the returned reply * dbus/dbus-transport-unix.c (do_authentication): check read watch at the end of this function, so if we didn't need to read for authentication, we reinstall it for receiving messages * dbus/dbus-message.c (dbus_message_new_reply): allow replies to a NULL sender for peer-to-peer case * dbus/dbus-transport-unix.c (check_read_watch): handle !authenticated case correctly * glib/dbus-gmain.c: add support for DBusServer * dbus/dbus-server.c: add data slot support * glib/dbus-gmain.c (dbus_connection_setup_with_g_main): check return values and handle errors * dbus/dbus-dataslot.c: factor out the data slot stuff from DBusConnection * Doxyfile.in (INPUT): add glib subdir * glib/dbus-gmain.c (dbus_connection_setup_with_g_main): rename setup_with_g_main instead of hookup_with_g_main; write docs glib/dbus-glib.h | 5 +- glib/dbus-gmain.c | 257 +++++++++++++++++++++++++++++++++++++++++-------- glib/dbus-gthread.c | 16 +++ glib/test-dbus-glib.c | 2 +- 4 files changed, 238 insertions(+), 42 deletions(-) commit ebace7f90ea6b3d85a9140be3671ea527c3a5727 Author: Joe Shaw Date: 2003-02-18 22:51:35 +0000 2003-02-18 Joe Shaw * dbus/dbus-auth.c (handle_server_data_stupid_test_mech): Just get credentials from our currently running process. (get_word): Fix a buglet where we were copying the entire length instead of relative to our position. * dbus/dbus-hash.c (_dbus_hash_test): Don't try to allocate the keys on the stack... it's 640k of data. * dbus/dbus-sysdeps.c (_dbus_read_credentials_unix_socket): Always read the credentials byte off the socket, even if we don't have SO_PEERCRED. (_dbus_poll): Implement poll() using select() for systems which don't have it. * glib/test-dbus-glib.c (main): Print out an error if no parameters are given. * test/data/auth/fallback.auth-script: Added. Tests that a client can fallback to a secondary auth mechanism if the first fails. glib/test-dbus-glib.c | 7 +++++++ 1 file changed, 7 insertions(+) commit 2655a78cdf1114a686d3c2ee28025db133b287c3 Author: Anders Carlsson Date: 2003-02-16 12:57:26 +0000 2003-02-16 Anders Carlsson * dbus/dbus-auth.c: (client_try_next_mechanism): Plug a leak. * dbus/dbus-threads.c: (dbus_condvar_wait_timeout): Return TRUE if there's no thread implementation around. * glib/dbus-gmain.c: (free_source), (dbus_connection_hookup_with_g_main): Make sure to remove the GSource when the connection is finalized. glib/dbus-gmain.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) commit 4fbaec0ff143d92f96fb60c585282b5cb03bdc76 Author: Havoc Pennington Date: 2003-02-16 07:20:54 +0000 2003-02-16 Havoc Pennington * dbus/dbus-connection.c (dbus_connection_set_change_sigpipe): allow people to avoid setting SIGPIPE to SIG_IGN (_dbus_connection_new_for_transport): disable SIGPIPE unless we've been asked not to glib/.cvsignore | 4 ++++ 1 file changed, 4 insertions(+) commit 69a436d7913c1681eea397e768687fab736f9d7c Author: Alex Larsson Date: 2003-02-15 16:25:08 +0000 2003-02-15 Alexander Larsson * dbus/dbus-threads.c: * dbus/dbus-threads.h: Add condvars. Remove static mutext from API. Implement static mutexes by initializing them from threads_init. * glib/dbus-gthread.c: * qt/dbus-qthread.cpp: Update with the thread api changes. * dbus/dbus-list.c: * dbus/dbus-list.h: Turn StaticMutex into normal mutex + init function. Export new functions _dbus_list_alloc_link, _dbus_list_free_link, _dbus_list_append_link, _dbus_list_prepend_link * dbus/dbus-sysdeps.c: * dbus/dbus-sysdeps.h: New type dbus_atomic_t, and new functions _dbus_atomic_inc, _dbus_atomic_dec. Only slow fallback implementation at the moment. * dbus/dbus-protocol.h: Add DBUS_MESSAGE_LOCAL_DISCONNECT define * dbus/dbus-message.c: Make ref/unref atomic. Fix some docs. * dbus/dbus-connection-internal.h: * dbus/dbus-connection.c: * dbus/dbus-connection.h: Make threadsafe. Change _peek to _borrow,_return & _steal_borrowed. Change disconnect callback to event. Make dbus_connection_dispatch_messages reentrant. * dbus/dbus-transport.c: Don't ref the connection on calls to the transport implementation. * dbus/dbus-message-handler.c: Make threadsafe. * glib/dbus-gmain.c: Don't use peek_message anymore * test/Makefile.am: * test/debug-thread.c: * test/debug-thread.h: Simple thread implementation that asserts() on deadlocks in single-threaded code. * test/bus-test.c: (main) Call debug_threads_init. * test/watch.c: Use disconnect message instead of disconnect callback. * bus/connection.c: * bus/connection.h: Don't call dbus_connection_set_disconnect_function. Instead export bus_connection_disconnect. * bus/dispatch.c: Call bus_connection_disconnect when we get a disconnected message. glib/dbus-gmain.c | 2 +- glib/dbus-gthread.c | 94 ++++++++++++++++++++++++++++++++++++++++++++++----- 2 files changed, 86 insertions(+), 10 deletions(-) commit 530cf7689515707b5430b3207da225320cf244c4 Author: Anders Carlsson Date: 2003-02-13 21:37:58 +0000 2003-02-13 Anders Carlsson * bus/driver.c: (bus_driver_handle_hello): * bus/driver.h: * bus/services.c: (bus_service_lookup): Reorder message sending so we get a more sane order. * test/bus-test.c: (message_handler): Fix tyop. glib/test-dbus-glib.c | 3 --- 1 file changed, 3 deletions(-) commit 044f4c6ed2170170d833d402079b90277893cd05 Author: Anders Carlsson Date: 2003-02-13 20:37:07 +0000 2003-02-13 Anders Carlsson * glib/dbus-gmain.c: (timeout_handler), (add_timeout), (remove_timeout): Implement support for timeouts in dbus-glib. glib/dbus-gmain.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) commit 12d8e0d2d6aeb5f29ff8b51cdd4aae857d35d13f Author: Alex Larsson Date: 2003-02-01 22:02:27 +0000 2003-02-02 Alexander Larsson * dbus/dbus-watch.c (dbus_watch_get_flags): Add note in the docs that ERROR or HANGUP won't be returned and are assumed always on. * glib/dbus-gmain.c (add_watch): Always add IO_ERR | IO_HUP * dbus/dbus-message.h: Add semicolon after dbus_message_iter_get_string_array(). Makes qt code build again glib/dbus-gmain.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) commit bb581faf87398e807a828f2686474869cd23757d Author: Richard Hult Date: 2003-01-26 00:06:30 +0000 2003-01-26 Richard Hult * glib/dbus-gmain.c (dbus_connection_dispatch): Traverse a copy of the file descriptor list, since it can change under us. glib/dbus-gmain.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) commit 74cef08b5e2f2596cade4fc1027933d763cd13ae Author: Anders Carlsson Date: 2003-01-25 21:22:57 +0000 2003-01-25 Anders Carlsson * glib/dbus-gmain.c: (dbus_connection_prepare), (dbus_connection_check), (dbus_connection_dispatch), (add_watch), (remove_watch), (dbus_connection_hookup_with_g_main): Rewrite the glib handling to use its own GSource instead of a GIOChannel so we can catch messages put in the queue while waiting for a reply. glib/dbus-gmain.c | 193 +++++++++++++++++++++++++++++++++++------------------ 1 file changed, 128 insertions(+), 65 deletions(-) commit 6f062c93ca19a73b34688488e76ec055d2bab2a0 Author: Anders Carlsson Date: 2003-01-24 23:51:58 +0000 2003-01-25 Anders Carlsson * bus/connection.c: (bus_connection_foreach): * bus/connection.h: Add new bus_connection_foreach function. * bus/driver.c: (send_one_message), (bus_driver_broadcast_message): Add function that broadcasts a message to all clients. (bus_driver_send_service_created), (bus_driver_handle_hello), (bus_driver_send_welcome_message), (bus_driver_handle_list_services), (bus_driver_message_handler): Implement functions that take care of listing services, and notifying clients when new services are created. * bus/services.c: (bus_services_list): * bus/services.h: Add new function that returns an array of strings with the currently registered services. * glib/dbus-glib.h: * glib/dbus-gmain.c: Update copyright year. glib/dbus-glib.h | 2 +- glib/dbus-gmain.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) commit ea868ce1cd9328ffa31cd9419e23498771f8feb2 Author: Anders Carlsson Date: 2003-01-21 09:23:18 +0000 2003-01-21 Anders Carlsson * dbus/dbus-connection.c: (dbus_connection_send_message): Add a new client_serial parameter. (dbus_connection_send_message_with_reply): Remove a @todo since we've implemented the blocking function. (dbus_connection_send_message_with_reply_and_block): New function that sends a message and waits for a reply and then returns the reply. * dbus/dbus-connection.h: Add new functions. * dbus/dbus-errors.c: (dbus_result_to_string): * dbus/dbus-errors.h: Add new DBUS_RESULT. * dbus/dbus-message-internal.h: * dbus/dbus-message.c: (_dbus_message_get_reply_serial), (_dbus_message_set_sender), (dbus_message_write_header), (dbus_message_new_reply), (decode_header_data), (_dbus_message_loader_return_buffer), (_dbus_message_test): * dbus/dbus-message.h: Add new functions that set the reply serial and sender. Also marshal and demarshal them correctly and add test. * dbus/dbus-protocol.h: Add new DBUS_MESSAGE_TYPE_SENDER. * glib/dbus-glib.h: * glib/dbus-gmain.c: (watch_callback), (free_callback_data), (add_watch), (remove_watch), (add_timeout), (remove_timeout), (dbus_connection_hookup_with_g_main): * glib/test-dbus-glib.c: (main): Rewrite to use GIOChannel and remove the GSource crack. * test/echo-client.c: (main): * test/watch.c: (check_messages): Update for changed APIs glib/dbus-glib.h | 10 +-- glib/dbus-gmain.c | 219 +++++++++++++++++++------------------------------ glib/test-dbus-glib.c | 48 +++-------- 3 files changed, 99 insertions(+), 178 deletions(-) commit f8a3cb6d30e74be85b583ce9ff3482f91cd26b9a Author: Anders Carlsson Date: 2003-01-07 20:18:23 +0000 2003-01-07 Anders Carlsson * dbus/dbus-connection-internal.h: * dbus/dbus-connection.c: (_dbus_connection_new_for_transport), (_dbus_connection_get_next_client_serial), (dbus_connection_send_message): * dbus/dbus-internals.h: * dbus/dbus-marshal.c: (unpack_uint32), (dbus_unpack_int32), (dbus_pack_int32), (_dbus_marshal_double), (_dbus_marshal_int32), (_dbus_marshal_uint32), (_dbus_demarshal_double), (_dbus_demarshal_int32), (_dbus_demarshal_uint32), (_dbus_demarshal_string), (_dbus_marshal_get_field_end_pos), (_dbus_verbose_bytes), (_dbus_marshal_test): * dbus/dbus-marshal.h: * dbus/dbus-message-internal.h: * dbus/dbus-message.c: (_dbus_message_set_client_serial), (dbus_message_write_header), (_dbus_message_lock), (dbus_message_new), (dbus_message_ref), (dbus_message_unref), (dbus_message_get_name), (dbus_message_append_int32), (dbus_message_append_uint32), (dbus_message_append_double), (dbus_message_append_string), (dbus_message_append_byte_array), (dbus_message_get_fields_iter), (dbus_message_iter_ref), (dbus_message_iter_unref), (dbus_message_iter_has_next), (dbus_message_iter_next), (dbus_message_iter_get_field_type), (dbus_message_iter_get_string), (dbus_message_iter_get_int32), (dbus_message_iter_get_uint32), (dbus_message_iter_get_double), (decode_header_data), (_dbus_message_loader_return_buffer), (message_iter_test), (_dbus_message_test): * dbus/dbus-message.h: * dbus/dbus-protocol.h: * dbus/dbus-test.c: (main): * dbus/dbus-test.h: * glib/test-dbus-glib.c: (message_handler), (main): * test/echo-client.c: (main): * test/watch.c: (check_messages): Make messages sendable and receivable for real. glib/test-dbus-glib.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 9784f2653287c62f32a637f869ad0029412ebfae Author: Anders Carlsson Date: 2002-12-27 08:26:26 +0000 Ssh glib/.cvsignore | 7 +++++++ 1 file changed, 7 insertions(+) commit c27a1609f595a75be3910c5185f7312cb93575c7 Author: Havoc Pennington Date: 2002-12-24 06:37:32 +0000 2002-12-24 Havoc Pennington * glib/dbus-gthread.c: fix include * glib/dbus-glib.h: rename DBusMessageHandler for now. I think glib API needs to change, though, as you don't want to use DBusMessageFunction, you want to use the DBusMessageHandler object. Probably dbus_connection_open_with_g_main_loop() and dbus_connection_setup_g_main_loop() or something like that (but think of better names...) that just create a connection that has watch/timeout functions etc. already set up. * dbus/dbus-connection.c (dbus_connection_send_message_with_reply): new function just to show how the message handler helps us deal with replies. * dbus/dbus-list.c (_dbus_list_remove_last): new function * dbus/dbus-string.c (_dbus_string_test): free a string that wasn't * dbus/dbus-hash.c: use memory pools for the hash entries (rebuild_table): be more paranoid about overflow, and shrink table when we can (_dbus_hash_test): reduce number of sprintfs and write valid C89. Add tests for case where we grow and then shrink the hash table. * dbus/dbus-mempool.h, dbus/dbus-mempool.c: memory pools * dbus/dbus-connection.c (dbus_connection_register_handler) (dbus_connection_unregister_handler): new functions * dbus/dbus-message.c (dbus_message_get_name): new * dbus/dbus-list.c: fix docs typo * dbus/dbus-message-handler.h, dbus/dbus-message-handler.c: an object representing a handler for messages. glib/dbus-glib.h | 6 +++--- glib/dbus-gmain.c | 2 +- glib/dbus-gthread.c | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) commit 723dc26c4880ae66688ff707588797e7c83b4fe4 Author: Anders Carlsson Date: 2002-12-16 01:43:52 +0000 Doh glib/dbus-glib.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit a2c39755d2c9749d22f547e9b92125509e95aae6 Author: Anders Carlsson Date: 2002-12-16 00:56:23 +0000 2002-12-16 Anders Carlsson * glib/dbus-glib.h: * glib/dbus-gthread.c: (dbus_gthread_init): Don't use the gdbus prefix for public functions. glib/dbus-glib.h | 4 +--- glib/dbus-gthread.c | 4 ++-- 2 files changed, 3 insertions(+), 5 deletions(-) commit 03900e96a260048f23176319003671c17b6a0013 Author: Anders Carlsson Date: 2002-12-16 00:26:05 +0000 2002-12-16 Anders Carlsson * Makefile.am: * configure.in: Add GLib checks and fixup .pc files * glib/Makefile.am: * glib/dbus-glib.h: * glib/dbus-gmain.c: (gdbus_connection_prepare), (gdbus_connection_check), (gdbus_connection_dispatch), (gdbus_add_connection_watch), (gdbus_remove_connection_watch), (dbus_connection_gsource_new): * glib/dbus-gthread.c: (dbus_gmutex_new), (dbus_gmutex_free), (dbus_gmutex_lock), (dbus_gmutex_unlock), (dbus_gthread_init): * glib/test-dbus-glib.c: (message_handler), (main): Add GLib support. glib/Makefile.am | 26 +++++++ glib/dbus-glib.h | 40 ++++++++++ glib/dbus-gmain.c | 194 +++++++++++++++++++++++++++++++++++++++++++++++++ glib/dbus-gthread.c | 84 +++++++++++++++++++++ glib/test-dbus-glib.c | 60 +++++++++++++++ 5 files changed, 404 insertions(+) commit 7c0c11bfa019cd4be3f7a62fe936aaf2573fa51e Author: John (J5) Palmieri Date: 2006-06-28 08:14:04 -0400 Initial commit of module dbus-glib 0 files changed dbus-glib-0.100.2/config.h.in0000644000175000017500000000616512112653376012504 00000000000000/* config.h.in. Generated from configure.ac by autoheader. */ /* Enable bash completion */ #undef DBUS_BASH_COMPLETION /* Build test code */ #undef DBUS_BUILD_TESTS /* Disable assertion checking */ #undef DBUS_DISABLE_ASSERT /* Disable public API sanity checking */ #undef DBUS_DISABLE_CHECKS /* Support a verbose mode */ #undef DBUS_ENABLE_VERBOSE_MODE /* Defined to the gcc version if gcov is enabled, to force a rebuild due to config.h changing */ #undef DBUS_GCOV_ENABLED /* Where to put test sockets */ #undef DBUS_TEST_SOCKET_DIR /* Disable GLib assertion macros */ #undef G_DISABLE_ASSERT /* Disable GLib public API sanity checking */ #undef G_DISABLE_CHECKS /* Have abstract socket namespace */ #undef HAVE_ABSTRACT_SOCKETS /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H /* Define to 1 if you have the header file. */ #undef HAVE_EXPAT_H /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Have socklen_t type */ #undef HAVE_SOCKLEN_T /* 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_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to the sub-directory in which 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 /* Full path to test file test/core/test-service-glib in builddir */ #undef TEST_CORE_SERVICE_BINARY /* Full path to test file test/test-exit in builddir */ #undef TEST_EXIT_BINARY /* Full path to test file test/interfaces/test-service in builddir */ #undef TEST_INTERFACES_SERVICE_BINARY /* Full path to test file test/test-segfault in builddir */ #undef TEST_SEGFAULT_BINARY /* Full path to test file test/test-service in builddir */ #undef TEST_SERVICE_BINARY /* Full path to test file test/data/valid-service-files in builddir */ #undef TEST_SERVICE_DIR /* Full path to test file test/test-shell-service in builddir */ #undef TEST_SHELL_SERVICE_BINARY /* Full path to test file test/test-sleep-forever in builddir */ #undef TEST_SLEEP_FOREVER_BINARY /* Version number of package */ #undef VERSION dbus-glib-0.100.2/dbus-glib-1.pc.in0000644000175000017500000000043611772106534013413 00000000000000prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ Name: dbus-glib Description: GLib integration for the free desktop message bus Version: @VERSION@ Requires: dbus-1 glib-2.0 gobject-2.0 Libs: -L${libdir} -ldbus-glib-1 Cflags: -I${includedir}/dbus-1.0 dbus-glib-0.100.2/dbus-glib-1-uninstalled.pc.in0000644000175000017500000000050311772106534015726 00000000000000prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ Name: dbus-glib Description: GLib integration for the free desktop message bus Version: @VERSION@ Requires: dbus-1 glib-2.0 gobject-2.0 Libs: ${pc_top_builddir}/${pcfiledir}/dbus/libdbus-glib-1.la Cflags: -I${pc_top_builddir}/${pcfiledir} dbus-glib-0.100.2/README0000644000175000017500000000223612112652540011324 00000000000000D-BUS is a simple IPC library based on messages. See http://www.freedesktop.org/software/dbus/ for lots of documentation, mailing lists, etc. Note === A core concept of the D-BUS implementation is that "libdbus" is intended to be a low-level API, similar to Xlib. Most programmers are intended to use the bindings to GLib, Qt, Python, Mono, Java, or whatever. These bindings have varying levels of completeness. Configuration flags === These are the dbus-specific configuration flags that can be given to the ./configure program. --enable-tests enable unit test code --enable-ansi enable -ansi -pedantic gcc flags --enable-verbose-mode support verbose debug mode --enable-asserts include assertion checks --enable-checks include sanity checks on public API --enable-xml-docs build XML documentation (requires xmlto) --enable-gcov compile with coverage profiling instrumentation (gcc only) --with-xml=libxml/expat XML library to use --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-tags[=TAGS] include additional configurations [automatic] dbus-glib-0.100.2/test/0000755000175000017500000000000012112654010011472 500000000000000dbus-glib-0.100.2/test/Makefile.in0000644000175000017500000006275212112653462013505 00000000000000# 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) subdir = test 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)/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 = @DBUS_BUILD_TESTS_TRUE@am__EXEEXT_1 = test-service$(EXEEXT) PROGRAMS = $(noinst_PROGRAMS) am_test_service_OBJECTS = test-service.$(OBJEXT) test_service_OBJECTS = $(am_test_service_OBJECTS) am__DEPENDENCIES_1 = test_service_DEPENDENCIES = $(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 DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/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 = $(test_service_SOURCES) DIST_SOURCES = $(test_service_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= 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" ABSOLUTE_TOP_BUILDDIR = @ABSOLUTE_TOP_BUILDDIR@ ACLOCAL = @ACLOCAL@ 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@ CYGPATH_W = @CYGPATH_W@ DBUS_BINDING_TOOL = @DBUS_BINDING_TOOL@ DBUS_CFLAGS = @DBUS_CFLAGS@ DBUS_GLIB_CFLAGS = @DBUS_GLIB_CFLAGS@ DBUS_GLIB_LIBS = @DBUS_GLIB_LIBS@ DBUS_GLIB_THREADS_CFLAGS = @DBUS_GLIB_THREADS_CFLAGS@ DBUS_GLIB_THREADS_LIBS = @DBUS_GLIB_THREADS_LIBS@ DBUS_GLIB_TOOL_CFLAGS = @DBUS_GLIB_TOOL_CFLAGS@ DBUS_GLIB_TOOL_LIBS = @DBUS_GLIB_TOOL_LIBS@ DBUS_LIBS = @DBUS_LIBS@ DBUS_PATH_OR_ABSTRACT = @DBUS_PATH_OR_ABSTRACT@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ EXPANDED_BINDIR = @EXPANDED_BINDIR@ EXPANDED_DATADIR = @EXPANDED_DATADIR@ EXPANDED_LIBDIR = @EXPANDED_LIBDIR@ EXPANDED_LOCALSTATEDIR = @EXPANDED_LOCALSTATEDIR@ EXPANDED_SYSCONFDIR = @EXPANDED_SYSCONFDIR@ FGREP = @FGREP@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GREP = @GREP@ GTKDOC_CHECK = @GTKDOC_CHECK@ 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@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_REVISION = @LT_REVISION@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ 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@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TEST_CORE_SERVICE_BINARY = @TEST_CORE_SERVICE_BINARY@ TEST_EXIT_BINARY = @TEST_EXIT_BINARY@ TEST_INTERFACES_SERVICE_BINARY = @TEST_INTERFACES_SERVICE_BINARY@ TEST_SEGFAULT_BINARY = @TEST_SEGFAULT_BINARY@ TEST_SERVICE_BINARY = @TEST_SERVICE_BINARY@ TEST_SERVICE_DIR = @TEST_SERVICE_DIR@ TEST_SHELL_SERVICE_BINARY = @TEST_SHELL_SERVICE_BINARY@ TEST_SLEEP_FOREVER_BINARY = @TEST_SLEEP_FOREVER_BINARY@ TEST_SOCKET_DIR = @TEST_SOCKET_DIR@ VERSION = @VERSION@ 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_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@ 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@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ 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 = lib . core interfaces manual DIST_SUBDIRS = lib core interfaces manual INCLUDES = \ -I$(top_srcdir) \ -I$(top_builddir) \ -I$(top_builddir)/dbus \ $(DBUS_CFLAGS) @DBUS_BUILD_TESTS_FALSE@TEST_BINARIES = @DBUS_BUILD_TESTS_TRUE@TEST_BINARIES = test-service test_service_SOURCES = \ test-service.c test_service_LDADD = $(DBUS_LIBS) EXTRA_DIST = data/nested-introspect.xml test-compile-nested.sh TESTS_ENVIRONMENT = top_builddir=$(top_builddir) srcdir=$(srcdir) TESTS = test-compile-nested.sh all: all-recursive .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(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 test/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu test/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: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(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 test-service$(EXEEXT): $(test_service_OBJECTS) $(test_service_DEPENDENCIES) $(EXTRA_test_service_DEPENDENCIES) @rm -f test-service$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_service_OBJECTS) $(test_service_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-service.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: dbus-glib-0.100.2/test/test-service.c0000644000175000017500000002454212107524614014214 00000000000000#include #include #include #include #include static dbus_bool_t already_quit = FALSE; static dbus_bool_t hello_from_self_reply_recived = FALSE; static void quit (void) { if (!already_quit) already_quit = TRUE; } static void die (const char *message) { fprintf (stderr, "*** test-service: %s", message); exit (1); } static void check_hello_from_self_reply (DBusPendingCall *pcall, void *user_data) { DBusMessage *reply; DBusMessage *echo_message, *echo_reply; DBusError error; DBusConnection *connection; int type; dbus_error_init (&error); connection = dbus_bus_get (DBUS_BUS_STARTER, &error); if (connection == NULL) { fprintf (stderr, "*** Failed to open connection to activating message bus: %s\n", error.message); dbus_error_free (&error); die("no memory"); } echo_message = (DBusMessage *)user_data; reply = dbus_pending_call_steal_reply (pcall); type = dbus_message_get_type (reply); if (type == DBUS_MESSAGE_TYPE_METHOD_RETURN) { const char *s; printf ("Reply from HelloFromSelf recived\n"); if (!dbus_message_get_args (echo_message, &error, DBUS_TYPE_STRING, &s, DBUS_TYPE_INVALID)) { echo_reply = dbus_message_new_error (echo_message, error.name, error.message); if (echo_reply == NULL) die ("No memory\n"); } else { echo_reply = dbus_message_new_method_return (echo_message); if (echo_reply == NULL) die ("No memory\n"); if (!dbus_message_append_args (echo_reply, DBUS_TYPE_STRING, &s, DBUS_TYPE_INVALID)) die ("No memory"); } if (!dbus_connection_send (connection, echo_reply, NULL)) die ("No memory\n"); dbus_message_unref (echo_reply); } else if (type == DBUS_MESSAGE_TYPE_ERROR) { dbus_set_error_from_message (&error, reply); printf ("Error type in reply: %s\n", error.message); if (strcmp (error.name, DBUS_ERROR_NO_MEMORY) != 0) { echo_reply = dbus_message_new_error (echo_message, error.name, error.message); if (echo_reply == NULL) die ("No memory\n"); if (!dbus_connection_send (connection, echo_reply, NULL)) die ("No memory\n"); dbus_message_unref (echo_reply); } dbus_error_free (&error); } hello_from_self_reply_recived = TRUE; dbus_message_unref (reply); dbus_message_unref (echo_message); dbus_pending_call_unref (pcall); } static DBusHandlerResult handle_run_hello_from_self (DBusConnection *connection, DBusMessage *message) { DBusError error; DBusMessage *reply, *self_message; DBusPendingCall *pcall; char *s; dbus_error_init (&error); if (!dbus_message_get_args (message, &error, DBUS_TYPE_STRING, &s, DBUS_TYPE_INVALID)) { reply = dbus_message_new_error (message, error.name, error.message); if (reply == NULL) die ("No memory\n"); if (!dbus_connection_send (connection, reply, NULL)) die ("No memory\n"); dbus_message_unref (reply); return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; } printf ("Sending HelloFromSelf\n"); self_message = dbus_message_new_method_call ("org.freedesktop.DBus.GLib.TestEchoService", "/org/freedesktop/DBus/GLib/TestSuite", "org.freedesktop.DBus.GLib.TestSuite", "HelloFromSelf"); if (self_message == NULL) die ("No memory"); if (!dbus_connection_send_with_reply (connection, self_message, &pcall, -1)) die("No memory"); dbus_message_ref (message); if (!dbus_pending_call_set_notify (pcall, check_hello_from_self_reply, (void *)message, NULL)) die("No memory"); printf ("Sent HelloFromSelf\n"); return DBUS_HANDLER_RESULT_HANDLED; } static DBusHandlerResult handle_echo (DBusConnection *connection, DBusMessage *message) { DBusError error; DBusMessage *reply; char *s; dbus_error_init (&error); if (!dbus_message_get_args (message, &error, DBUS_TYPE_STRING, &s, DBUS_TYPE_INVALID)) { reply = dbus_message_new_error (message, error.name, error.message); if (reply == NULL) die ("No memory\n"); if (!dbus_connection_send (connection, reply, NULL)) die ("No memory\n"); dbus_message_unref (reply); return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; } reply = dbus_message_new_method_return (message); if (reply == NULL) die ("No memory\n"); if (!dbus_message_append_args (reply, DBUS_TYPE_STRING, &s, DBUS_TYPE_INVALID)) die ("No memory"); if (!dbus_connection_send (connection, reply, NULL)) die ("No memory\n"); fprintf (stderr, "Echo service echoed string: \"%s\"\n", s); dbus_message_unref (reply); return DBUS_HANDLER_RESULT_HANDLED; } static void path_unregistered_func (DBusConnection *connection, void *user_data) { /* connection was finalized */ } static DBusHandlerResult path_message_func (DBusConnection *connection, DBusMessage *message, void *user_data) { if (dbus_message_is_method_call (message, "org.freedesktop.DBus.GLib.TestSuite", "Echo")) return handle_echo (connection, message); else if (dbus_message_is_method_call (message, "org.freedesktop.DBus.GLib.TestSuite", "Exit")) { dbus_connection_close (connection); quit (); return DBUS_HANDLER_RESULT_HANDLED; } else if (dbus_message_is_method_call (message, "org.freedesktop.DBus.GLib.TestSuite", "EmitFoo")) { /* Emit the Foo signal */ DBusMessage *signal; double v_DOUBLE; signal = dbus_message_new_signal ("/org/freedesktop/DBus/GLib/TestSuite", "org.freedesktop.DBus.GLib.TestSuite", "Foo"); if (signal == NULL) die ("No memory\n"); v_DOUBLE = 42.6; if (!dbus_message_append_args (signal, DBUS_TYPE_DOUBLE, &v_DOUBLE, DBUS_TYPE_INVALID)) die ("No memory"); if (!dbus_connection_send (connection, signal, NULL)) die ("No memory\n"); return DBUS_HANDLER_RESULT_HANDLED; } else if (dbus_message_is_method_call (message, "org.freedesktop.DBus.GLib.TestSuite", "RunHelloFromSelf")) { return handle_run_hello_from_self (connection, message); } else if (dbus_message_is_method_call (message, "org.freedesktop.DBus.GLib.TestSuite", "HelloFromSelf")) { DBusMessage *reply; printf ("Recived the HelloFromSelf message\n"); reply = dbus_message_new_method_return (message); if (reply == NULL) die ("No memory"); if (!dbus_connection_send (connection, reply, NULL)) die ("No memory"); } return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; } static DBusObjectPathVTable echo_vtable = { path_unregistered_func, path_message_func, NULL, }; static const char* echo_path = "/org/freedesktop/DBus/GLib/TestSuite" ; static DBusHandlerResult filter_func (DBusConnection *connection, DBusMessage *message, void *user_data) { if (dbus_message_is_signal (message, DBUS_INTERFACE_LOCAL, "Disconnected")) { dbus_connection_close (connection); quit (); return DBUS_HANDLER_RESULT_HANDLED; } else { return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; } } int main (int argc, char **argv) { DBusError error; DBusConnection *connection; dbus_error_init (&error); connection = dbus_bus_get (DBUS_BUS_STARTER, &error); if (connection == NULL) { fprintf (stderr, "*** Failed to open connection to activating message bus: %s\n", error.message); dbus_error_free (&error); return 1; } if (!dbus_connection_add_filter (connection, filter_func, NULL, NULL)) die ("No memory"); if (!dbus_connection_register_object_path (connection, echo_path, &echo_vtable, (void*) 0xdeadbeef)) die ("No memory"); { void *d; if (!dbus_connection_get_object_path_data (connection, echo_path, &d)) die ("No memory"); if (d != (void*) 0xdeadbeef) die ("dbus_connection_get_object_path_data() doesn't seem to work right\n"); } dbus_bus_request_name (connection, "org.freedesktop.DBus.GLib.TestEchoService", 0, &error); if (dbus_error_is_set (&error)) { fprintf (stderr, "Error %s\n", error.message); dbus_error_free (&error); exit (1); } while (dbus_connection_read_write_dispatch (connection, -1) && !already_quit) ; dbus_connection_remove_filter (connection, filter_func, NULL); dbus_connection_unref (connection); dbus_shutdown (); return 0; } dbus-glib-0.100.2/test/lib/0000755000175000017500000000000012112654010012240 500000000000000dbus-glib-0.100.2/test/lib/util.h0000644000175000017500000000220312107524614013315 00000000000000/* Regression test utilities * * Copyright © 2009 Collabora Ltd. * Copyright © 2009-2011 Nokia Corporation * * Licensed under the Academic Free License version 2.1 * * 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 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * 02110-1301 USA */ #ifndef DBUS_GLIB_TEST_UTIL_H #include #include void test_run_until_disconnected (DBusGConnection *connection, GMainContext *context); #endif dbus-glib-0.100.2/test/lib/Makefile.in0000644000175000017500000004222012112653462014237 00000000000000# 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 = test/lib 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)/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 = libtest_la_DEPENDENCIES = $(top_builddir)/dbus/libdbus-glib-1.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am_libtest_la_OBJECTS = util.lo libtest_la_OBJECTS = $(am_libtest_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)/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 = $(libtest_la_SOURCES) DIST_SOURCES = $(libtest_la_SOURCES) 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) ABSOLUTE_TOP_BUILDDIR = @ABSOLUTE_TOP_BUILDDIR@ ACLOCAL = @ACLOCAL@ 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@ CYGPATH_W = @CYGPATH_W@ DBUS_BINDING_TOOL = @DBUS_BINDING_TOOL@ DBUS_CFLAGS = @DBUS_CFLAGS@ DBUS_GLIB_CFLAGS = @DBUS_GLIB_CFLAGS@ DBUS_GLIB_LIBS = @DBUS_GLIB_LIBS@ DBUS_GLIB_THREADS_CFLAGS = @DBUS_GLIB_THREADS_CFLAGS@ DBUS_GLIB_THREADS_LIBS = @DBUS_GLIB_THREADS_LIBS@ DBUS_GLIB_TOOL_CFLAGS = @DBUS_GLIB_TOOL_CFLAGS@ DBUS_GLIB_TOOL_LIBS = @DBUS_GLIB_TOOL_LIBS@ DBUS_LIBS = @DBUS_LIBS@ DBUS_PATH_OR_ABSTRACT = @DBUS_PATH_OR_ABSTRACT@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ EXPANDED_BINDIR = @EXPANDED_BINDIR@ EXPANDED_DATADIR = @EXPANDED_DATADIR@ EXPANDED_LIBDIR = @EXPANDED_LIBDIR@ EXPANDED_LOCALSTATEDIR = @EXPANDED_LOCALSTATEDIR@ EXPANDED_SYSCONFDIR = @EXPANDED_SYSCONFDIR@ FGREP = @FGREP@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GREP = @GREP@ GTKDOC_CHECK = @GTKDOC_CHECK@ 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@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_REVISION = @LT_REVISION@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ 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@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TEST_CORE_SERVICE_BINARY = @TEST_CORE_SERVICE_BINARY@ TEST_EXIT_BINARY = @TEST_EXIT_BINARY@ TEST_INTERFACES_SERVICE_BINARY = @TEST_INTERFACES_SERVICE_BINARY@ TEST_SEGFAULT_BINARY = @TEST_SEGFAULT_BINARY@ TEST_SERVICE_BINARY = @TEST_SERVICE_BINARY@ TEST_SERVICE_DIR = @TEST_SERVICE_DIR@ TEST_SHELL_SERVICE_BINARY = @TEST_SHELL_SERVICE_BINARY@ TEST_SLEEP_FOREVER_BINARY = @TEST_SLEEP_FOREVER_BINARY@ TEST_SOCKET_DIR = @TEST_SOCKET_DIR@ VERSION = @VERSION@ 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_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@ 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@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ 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_builddir) \ $(DBUS_CFLAGS) \ $(DBUS_GLIB_CFLAGS) \ $(NULL) noinst_LTLIBRARIES = libtest.la libtest_la_SOURCES = \ util.c \ util.h \ $(NULL) libtest_la_LIBADD = \ $(top_builddir)/dbus/libdbus-glib-1.la \ $(DBUS_LIBS) \ $(DBUS_GLIB_LIBS) \ $(NULL) all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(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 test/lib/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu test/lib/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: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(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 libtest.la: $(libtest_la_OBJECTS) $(libtest_la_DEPENDENCIES) $(EXTRA_libtest_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(libtest_la_OBJECTS) $(libtest_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/util.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: dbus-glib-0.100.2/test/lib/Makefile.am0000644000175000017500000000045712107524614014234 00000000000000AM_CPPFLAGS = \ -I$(top_srcdir) \ -I$(top_builddir) \ $(DBUS_CFLAGS) \ $(DBUS_GLIB_CFLAGS) \ $(NULL) noinst_LTLIBRARIES = libtest.la libtest_la_SOURCES = \ util.c \ util.h \ $(NULL) libtest_la_LIBADD = \ $(top_builddir)/dbus/libdbus-glib-1.la \ $(DBUS_LIBS) \ $(DBUS_GLIB_LIBS) \ $(NULL) dbus-glib-0.100.2/test/lib/util.c0000644000175000017500000000406612107524614013321 00000000000000/* Regression test utilities * * Copyright © 2009 Collabora Ltd. * Copyright © 2009-2011 Nokia Corporation * * Licensed under the Academic Free License version 2.1 * * 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 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * 02110-1301 USA */ #include #include "util.h" static void destroy_cb (DBusGProxy *proxy G_GNUC_UNUSED, gpointer user_data) { gboolean *disconnected = user_data; *disconnected = TRUE; } void test_run_until_disconnected (DBusGConnection *connection, GMainContext *context) { gboolean disconnected = FALSE; DBusGProxy *proxy; g_printerr ("Disconnecting... "); dbus_connection_set_exit_on_disconnect (dbus_g_connection_get_connection (connection), FALSE); /* low-level tests might not have called this yet */ g_type_init (); proxy = dbus_g_proxy_new_for_peer (connection, "/", "org.freedesktop.DBus.Peer"); g_signal_connect (G_OBJECT (proxy), "destroy", G_CALLBACK (destroy_cb), &disconnected); dbus_connection_close (dbus_g_connection_get_connection (connection)); while (!disconnected) { g_printerr ("."); g_main_context_iteration (context, TRUE); } g_signal_handlers_disconnect_by_func (proxy, destroy_cb, &disconnected); g_object_unref (proxy); g_printerr (" disconnected\n"); } dbus-glib-0.100.2/test/manual/0000755000175000017500000000000012112654010012747 500000000000000dbus-glib-0.100.2/test/manual/Makefile.in0000644000175000017500000005330112112653462014750 00000000000000# 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) @DBUS_BUILD_TESTS_TRUE@am__append_1 = \ @DBUS_BUILD_TESTS_TRUE@ test-invalid-usage \ @DBUS_BUILD_TESTS_TRUE@ $(NULL) subdir = test/manual 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)/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 = @DBUS_BUILD_TESTS_TRUE@am__EXEEXT_1 = test-invalid-usage$(EXEEXT) PROGRAMS = $(noinst_PROGRAMS) am_test_invalid_usage_OBJECTS = my-object-marshal.$(OBJEXT) \ my-object.$(OBJEXT) invalid-usage.$(OBJEXT) test_invalid_usage_OBJECTS = $(am_test_invalid_usage_OBJECTS) test_invalid_usage_LDADD = $(LDADD) am__DEPENDENCIES_1 = test_invalid_usage_DEPENDENCIES = \ $(top_builddir)/dbus/libdbus-glib-1.la $(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 DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/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 = $(test_invalid_usage_SOURCES) DIST_SOURCES = $(test_invalid_usage_SOURCES) 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) ABSOLUTE_TOP_BUILDDIR = @ABSOLUTE_TOP_BUILDDIR@ ACLOCAL = @ACLOCAL@ 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@ CYGPATH_W = @CYGPATH_W@ DBUS_BINDING_TOOL = @DBUS_BINDING_TOOL@ DBUS_CFLAGS = @DBUS_CFLAGS@ DBUS_GLIB_CFLAGS = @DBUS_GLIB_CFLAGS@ DBUS_GLIB_LIBS = @DBUS_GLIB_LIBS@ DBUS_GLIB_THREADS_CFLAGS = @DBUS_GLIB_THREADS_CFLAGS@ DBUS_GLIB_THREADS_LIBS = @DBUS_GLIB_THREADS_LIBS@ DBUS_GLIB_TOOL_CFLAGS = @DBUS_GLIB_TOOL_CFLAGS@ DBUS_GLIB_TOOL_LIBS = @DBUS_GLIB_TOOL_LIBS@ DBUS_LIBS = @DBUS_LIBS@ DBUS_PATH_OR_ABSTRACT = @DBUS_PATH_OR_ABSTRACT@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ EXPANDED_BINDIR = @EXPANDED_BINDIR@ EXPANDED_DATADIR = @EXPANDED_DATADIR@ EXPANDED_LIBDIR = @EXPANDED_LIBDIR@ EXPANDED_LOCALSTATEDIR = @EXPANDED_LOCALSTATEDIR@ EXPANDED_SYSCONFDIR = @EXPANDED_SYSCONFDIR@ FGREP = @FGREP@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GREP = @GREP@ GTKDOC_CHECK = @GTKDOC_CHECK@ 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@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_REVISION = @LT_REVISION@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ 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@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TEST_CORE_SERVICE_BINARY = @TEST_CORE_SERVICE_BINARY@ TEST_EXIT_BINARY = @TEST_EXIT_BINARY@ TEST_INTERFACES_SERVICE_BINARY = @TEST_INTERFACES_SERVICE_BINARY@ TEST_SEGFAULT_BINARY = @TEST_SEGFAULT_BINARY@ TEST_SERVICE_BINARY = @TEST_SERVICE_BINARY@ TEST_SERVICE_DIR = @TEST_SERVICE_DIR@ TEST_SHELL_SERVICE_BINARY = @TEST_SHELL_SERVICE_BINARY@ TEST_SLEEP_FOREVER_BINARY = @TEST_SLEEP_FOREVER_BINARY@ TEST_SOCKET_DIR = @TEST_SOCKET_DIR@ VERSION = @VERSION@ 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_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@ 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@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ 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_builddir) \ -I$(top_srcdir)/test/core \ -I$(top_builddir)/test/core \ $(DBUS_CFLAGS) \ $(DBUS_GLIB_CFLAGS) \ $(NULL) LDADD = \ $(top_builddir)/dbus/libdbus-glib-1.la \ $(DBUS_LIBS) \ $(DBUS_GLIB_LIBS) \ $(NULL) # This "test" exercises invalid usage. It is deliberately not run in # TESTS, because it's (by design) full of bugs. test_invalid_usage_SOURCES = \ ../core/my-object-marshal.c \ ../core/my-object-marshal.h \ ../core/my-object.c \ ../core/my-object.h \ invalid-usage.c all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(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 test/manual/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu test/manual/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: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(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 test-invalid-usage$(EXEEXT): $(test_invalid_usage_OBJECTS) $(test_invalid_usage_DEPENDENCIES) $(EXTRA_test_invalid_usage_DEPENDENCIES) @rm -f test-invalid-usage$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_invalid_usage_OBJECTS) $(test_invalid_usage_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/invalid-usage.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/my-object-marshal.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/my-object.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 $@ $< my-object-marshal.o: ../core/my-object-marshal.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT my-object-marshal.o -MD -MP -MF $(DEPDIR)/my-object-marshal.Tpo -c -o my-object-marshal.o `test -f '../core/my-object-marshal.c' || echo '$(srcdir)/'`../core/my-object-marshal.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/my-object-marshal.Tpo $(DEPDIR)/my-object-marshal.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../core/my-object-marshal.c' object='my-object-marshal.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o my-object-marshal.o `test -f '../core/my-object-marshal.c' || echo '$(srcdir)/'`../core/my-object-marshal.c my-object-marshal.obj: ../core/my-object-marshal.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT my-object-marshal.obj -MD -MP -MF $(DEPDIR)/my-object-marshal.Tpo -c -o my-object-marshal.obj `if test -f '../core/my-object-marshal.c'; then $(CYGPATH_W) '../core/my-object-marshal.c'; else $(CYGPATH_W) '$(srcdir)/../core/my-object-marshal.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/my-object-marshal.Tpo $(DEPDIR)/my-object-marshal.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../core/my-object-marshal.c' object='my-object-marshal.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o my-object-marshal.obj `if test -f '../core/my-object-marshal.c'; then $(CYGPATH_W) '../core/my-object-marshal.c'; else $(CYGPATH_W) '$(srcdir)/../core/my-object-marshal.c'; fi` my-object.o: ../core/my-object.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT my-object.o -MD -MP -MF $(DEPDIR)/my-object.Tpo -c -o my-object.o `test -f '../core/my-object.c' || echo '$(srcdir)/'`../core/my-object.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/my-object.Tpo $(DEPDIR)/my-object.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../core/my-object.c' object='my-object.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o my-object.o `test -f '../core/my-object.c' || echo '$(srcdir)/'`../core/my-object.c my-object.obj: ../core/my-object.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT my-object.obj -MD -MP -MF $(DEPDIR)/my-object.Tpo -c -o my-object.obj `if test -f '../core/my-object.c'; then $(CYGPATH_W) '../core/my-object.c'; else $(CYGPATH_W) '$(srcdir)/../core/my-object.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/my-object.Tpo $(DEPDIR)/my-object.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../core/my-object.c' object='my-object.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o my-object.obj `if test -f '../core/my-object.c'; then $(CYGPATH_W) '../core/my-object.c'; else $(CYGPATH_W) '$(srcdir)/../core/my-object.c'; fi` 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 $(PROGRAMS) 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-noinstPROGRAMS \ 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-noinstPROGRAMS 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: dbus-glib-0.100.2/test/manual/Makefile.am0000644000175000017500000000121012107524614014727 00000000000000AM_CPPFLAGS = \ -I$(top_srcdir) \ -I$(top_builddir) \ -I$(top_srcdir)/test/core \ -I$(top_builddir)/test/core \ $(DBUS_CFLAGS) \ $(DBUS_GLIB_CFLAGS) \ $(NULL) LDADD = \ $(top_builddir)/dbus/libdbus-glib-1.la \ $(DBUS_LIBS) \ $(DBUS_GLIB_LIBS) \ $(NULL) noinst_PROGRAMS = \ $(NULL) if DBUS_BUILD_TESTS noinst_PROGRAMS += \ test-invalid-usage \ $(NULL) endif # This "test" exercises invalid usage. It is deliberately not run in # TESTS, because it's (by design) full of bugs. test_invalid_usage_SOURCES = \ ../core/my-object-marshal.c \ ../core/my-object-marshal.h \ ../core/my-object.c \ ../core/my-object.h \ invalid-usage.c dbus-glib-0.100.2/test/manual/invalid-usage.c0000644000175000017500000002144112107524614015577 00000000000000/* Manual test for various invalid usages which should not crash us (in order * to be nice to fallible programmers), unless checks have been disabled (in * which case, you asked for it, you got it). * * Copyright © 2006-2010 Red Hat, Inc. * Copyright © 2006-2010 Collabora Ltd. * Copyright © 2006-2011 Nokia Corporation * Copyright © 2006 Steve Frécinaux * * Licensed under the Academic Free License version 2.1 * * 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 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include #include #include #include #include #include #include "my-object.h" #include "test-service-glib-bindings.h" /* my-object wants this to exist */ GMainLoop *loop = NULL; typedef struct { GError *error; DBusGConnection *conn; DBusGProxy *proxy; DBusGProxy *proxy_for_self; GObject *object; } Fixture; static void setup (Fixture *f, gconstpointer context) { /* this test is all about (mostly critical) warnings, so don't crash out on * programming errors */ g_setenv ("DBUS_FATAL_WARNINGS", "0", TRUE); g_log_set_always_fatal (G_LOG_LEVEL_ERROR); dbus_g_type_specialized_init (); /* This is a bug: you're not meant to register any domain more than * once. It shouldn't crash, though. */ dbus_g_error_domain_register (MY_OBJECT_ERROR, NULL, MY_TYPE_ERROR); f->conn = dbus_g_bus_get_private (DBUS_BUS_SESSION, NULL, &f->error); g_assert_no_error (f->error); g_assert (f->conn != NULL); f->proxy = dbus_g_proxy_new_for_name (f->conn, "com.example.Test", "/com/example/Test/Object", "com.example.Test.Fallible"); g_assert (f->proxy != NULL); f->object = g_object_new (MY_TYPE_OBJECT, NULL); g_assert (MY_IS_OBJECT (f->object)); dbus_g_connection_register_g_object (f->conn, "/com/example/Test/Object", f->object); f->proxy_for_self = dbus_g_proxy_new_for_name (f->conn, dbus_bus_get_unique_name (dbus_g_connection_get_connection (f->conn)), "/com/example/Test/Object", "org.freedesktop.DBus.GLib.Tests.MyObject"); g_assert (f->proxy_for_self != NULL); } static void test_invalid_gtype (Fixture *f, gconstpointer context) { /* G_TYPE_GTYPE is not handled by the dbus-glib type system (and would make * no sense anyway) */ dbus_g_proxy_call_no_reply (f->proxy, "Fail", G_TYPE_GTYPE, G_TYPE_STRING, G_TYPE_INVALID); } static void test_invalid_utf8 (Fixture *f, gconstpointer context) { g_test_bug ("30171"); /* This provokes a libdbus warning, which is fatal-by-default */ dbus_g_proxy_call_no_reply (f->proxy, "Fail", G_TYPE_STRING, "\xfe\xfe\xfe", G_TYPE_INVALID); } static void test_invalid_bool (Fixture *f, gconstpointer context) { g_test_bug ("30171"); /* This provokes a libdbus warning, which is fatal-by-default */ dbus_g_proxy_call_no_reply (f->proxy, "Fail", G_TYPE_BOOLEAN, (gboolean) (-42), G_TYPE_INVALID); } static void test_invalid_path (Fixture *f, gconstpointer context) { g_test_bug ("30171"); /* This provokes a libdbus warning, which is fatal-by-default */ dbus_g_proxy_call_no_reply (f->proxy, "Fail", DBUS_TYPE_G_OBJECT_PATH, "$%#*!", G_TYPE_INVALID); } static void test_invalid_utf8s (Fixture *f, gconstpointer context) { gchar *bad_strings[] = { "\xfe\xfe\xfe", NULL }; GStrv bad_strv = bad_strings; g_test_bug ("30171"); /* This provokes a libdbus warning, which is fatal-by-default */ dbus_g_proxy_call_no_reply (f->proxy, "Fail", G_TYPE_STRV, bad_strv, G_TYPE_INVALID); } static void test_invalid_bools (Fixture *f, gconstpointer context) { GArray *array; gboolean maybe = (gboolean) (-23); g_test_bug ("30171"); array = g_array_new (FALSE, FALSE, sizeof (gboolean)); g_array_append_val (array, maybe); /* This provokes a libdbus warning, which is fatal-by-default */ dbus_g_proxy_call_no_reply (f->proxy, "Fail", dbus_g_type_get_collection ("GArray", G_TYPE_BOOLEAN), array, G_TYPE_INVALID); g_array_free (array, TRUE); } static void test_invalid_paths (Fixture *f, gconstpointer context) { GPtrArray *array; g_test_bug ("30171"); array = g_ptr_array_new (); g_ptr_array_add (array, "bees"); /* This provokes a libdbus warning, which is fatal-by-default */ dbus_g_proxy_call_no_reply (f->proxy, "Fail", dbus_g_type_get_collection ("GPtrArray", DBUS_TYPE_G_OBJECT_PATH), array, G_TYPE_INVALID); g_ptr_array_free (array, TRUE); } static void throw_error_cb (DBusGProxy *proxy, GError *error, gpointer user_data) { GError **error_out = user_data; g_assert (error != NULL); *error_out = g_error_copy (error); } static void test_error_out_of_range (Fixture *f, gconstpointer context) { GError *error = NULL; g_test_bug ("40151"); /* This is a bug: -1 isn't a valid code for the domain. */ my_object_save_error ((MyObject *) f->object, MY_OBJECT_ERROR, -1, "stop being so negative"); if (!org_freedesktop_DBus_GLib_Tests_MyObject_throw_error_async ( f->proxy_for_self, throw_error_cb, &error)) g_error ("Failed to start async ThrowError call"); while (error == NULL) g_main_context_iteration (NULL, TRUE); g_assert_error (error, DBUS_GERROR, DBUS_GERROR_REMOTE_EXCEPTION); g_clear_error (&error); /* This is a bug: 666 isn't a valid code for the domain. */ my_object_save_error ((MyObject *) f->object, MY_OBJECT_ERROR, 666, "demonic possession detected"); if (!org_freedesktop_DBus_GLib_Tests_MyObject_throw_error_async ( f->proxy_for_self, throw_error_cb, &error)) g_error ("Failed to start async ThrowError call"); while (error == NULL) g_main_context_iteration (NULL, TRUE); g_assert_error (error, DBUS_GERROR, DBUS_GERROR_REMOTE_EXCEPTION); g_clear_error (&error); } static void test_error_domain_0 (Fixture *f, gconstpointer context) { /* This throws an error with domain 0 and code 0, which makes no sense. * It's programmer error, really: g_error_new() would critical if given * the same domain and code. See GNOME#660371. * * This was added for fd.o #27799, but there's a difference between * "this is an error domain, but not one registered with dbus-glib" and * "this isn't even an error domain". */ g_test_bug ("27799"); if (!org_freedesktop_DBus_GLib_Tests_MyObject_throw_unregistered_error_async ( f->proxy_for_self, throw_error_cb, f)) g_error ("Failed to start async ThrowUnregisteredError call"); while (f->error == NULL) g_main_context_iteration (NULL, TRUE); g_assert_error (f->error, DBUS_GERROR, DBUS_GERROR_REMOTE_EXCEPTION); } static void teardown (Fixture *f, gconstpointer context G_GNUC_UNUSED) { g_clear_error (&f->error); if (f->proxy != NULL) { g_object_unref (f->proxy); f->proxy = NULL; } if (f->object != NULL) { g_object_unref (f->object); f->object = NULL; } if (f->proxy_for_self != NULL) { g_object_unref (f->proxy_for_self); f->proxy_for_self = NULL; } if (f->conn != NULL) { dbus_connection_close (dbus_g_connection_get_connection (f->conn)); dbus_g_connection_unref (f->conn); f->conn = NULL; } } int main (int argc, char **argv) { g_test_init (&argc, &argv, NULL); g_test_bug_base ("https://bugs.freedesktop.org/show_bug.cgi?id="); g_type_init (); g_test_add ("/invalid/gtype", Fixture, NULL, setup, test_invalid_gtype, teardown); g_test_add ("/invalid/utf8", Fixture, NULL, setup, test_invalid_utf8, teardown); g_test_add ("/invalid/bool", Fixture, NULL, setup, test_invalid_bool, teardown); g_test_add ("/invalid/path", Fixture, NULL, setup, test_invalid_path, teardown); g_test_add ("/invalid/utf8s", Fixture, NULL, setup, test_invalid_utf8s, teardown); g_test_add ("/invalid/bools", Fixture, NULL, setup, test_invalid_bools, teardown); g_test_add ("/invalid/paths", Fixture, NULL, setup, test_invalid_paths, teardown); g_test_add ("/invalid/error/out-of-range", Fixture, NULL, setup, test_error_out_of_range, teardown); g_test_add ("/invalid/error/domain-0", Fixture, NULL, setup, test_error_domain_0, teardown); return g_test_run (); } dbus-glib-0.100.2/test/data/0000755000175000017500000000000012112654010012403 500000000000000dbus-glib-0.100.2/test/data/nested-introspect.xml0000644000175000017500000000035412107524563016536 00000000000000 dbus-glib-0.100.2/test/data/valid-service-files/0000755000175000017500000000000012112654010016240 500000000000000dbus-glib-0.100.2/test/data/valid-service-files/debug-echo.service.in0000644000175000017500000000013212112652540022153 00000000000000[D-BUS Service] Name=org.freedesktop.DBus.GLib.TestEchoService Exec=@TEST_SERVICE_BINARY@ dbus-glib-0.100.2/test/data/valid-service-files/debug-glib.service.in0000644000175000017500000000013312112652540022153 00000000000000[D-BUS Service] Name=org.freedesktop.DBus.GLib.TestService Exec=@TEST_CORE_SERVICE_BINARY@ dbus-glib-0.100.2/test/data/valid-service-files/interfaces-test.service.in0000644000175000017500000000014512112652540023255 00000000000000[D-BUS Service] Name=org.freedesktop.DBus.GLib.Test.Interfaces Exec=@TEST_INTERFACES_SERVICE_BINARY@ dbus-glib-0.100.2/test/test-compile-nested.sh0000755000175000017500000000047212107524563015656 00000000000000#!/bin/sh # http://bugs.freedesktop.org/show_bug.cgi?id=19065 echo ${DEBUG} ${top_builddir}/dbus/dbus-binding-tool --mode=glib-server --prefix=test ${srcdir}/data/nested-introspect.xml ${DEBUG} ${top_builddir}/dbus/dbus-binding-tool --mode=glib-server --prefix=test ${srcdir}/data/nested-introspect.xml >/dev/nulldbus-glib-0.100.2/test/interfaces/0000755000175000017500000000000012112654010013615 500000000000000dbus-glib-0.100.2/test/interfaces/test-interfaces.c0000644000175000017500000000507711634152371017025 00000000000000#ifdef HAVE_CONFIG_H # include #endif #include "test-interfaces.h" static gboolean test_hello_dbus_say_hello (TestHello *hello, gchar **message, GError **error) { *message = test_hello_say_hello (hello); return TRUE; } static gboolean test_goodbye_dbus_say_goodbye (TestGoodbye *goodbye, gchar **message, GError **error) { *message = test_goodbye_say_goodbye (goodbye); return TRUE; } #include "test-hello-glue.h" #include "test-goodbye-glue.h" enum { GREETINGS, LAST_SIGNAL }; static guint signals[LAST_SIGNAL]; static void test_hello_class_init (gpointer g_iface) { GType iface_type = G_TYPE_FROM_INTERFACE (g_iface); signals[GREETINGS] = g_signal_new ("greetings", iface_type, G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (TestHelloIface, greetings), NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0); dbus_g_object_type_install_info (iface_type, &dbus_glib_test_hello_object_info); } GType test_hello_get_type (void) { static GType the_type = 0; if (G_UNLIKELY (the_type == 0)) { static const GTypeInfo info = { sizeof (TestHelloIface), NULL, NULL, (GClassInitFunc) test_hello_class_init, NULL, NULL, 0, 0, NULL }; the_type = g_type_register_static (G_TYPE_INTERFACE, "TestHello", &info, 0); g_type_interface_add_prerequisite (the_type, G_TYPE_OBJECT); } return the_type; } gchar * test_hello_say_hello (TestHello *hello) { g_return_val_if_fail (TEST_IS_HELLO (hello), NULL); return (* TEST_HELLO_GET_IFACE (hello)->say_hello) (hello); } void test_hello_greetings (TestHello *hello) { g_return_if_fail (TEST_IS_HELLO (hello)); g_signal_emit (hello, signals[GREETINGS], 0); } static void test_goodbye_class_init (gpointer g_iface) { GType iface_type = G_TYPE_FROM_INTERFACE (g_iface); dbus_g_object_type_install_info (iface_type, &dbus_glib_test_goodbye_object_info); } GType test_goodbye_get_type (void) { static GType the_type = 0; if (G_UNLIKELY (the_type == 0)) { static const GTypeInfo info = { sizeof (TestGoodbyeIface), NULL, NULL, (GClassInitFunc) test_goodbye_class_init, NULL, NULL, 0, 0, NULL }; the_type = g_type_register_static (G_TYPE_INTERFACE, "TestGoodbye", &info, 0); g_type_interface_add_prerequisite (the_type, G_TYPE_OBJECT); } return the_type; } gchar * test_goodbye_say_goodbye (TestGoodbye *goodbye) { g_return_val_if_fail (TEST_IS_GOODBYE (goodbye), NULL); return (* TEST_GOODBYE_GET_IFACE (goodbye)->say_goodbye) (goodbye); } dbus-glib-0.100.2/test/interfaces/test-objects.h0000644000175000017500000000260411634152371016331 00000000000000#ifndef __TEST_OBJECTS_H__ #define __TEST_OBJECTS_H__ #include #define TEST_TYPE_SONG (test_song_get_type ()) #define TEST_SONG(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TEST_TYPE_SONG, TestSong)) #define TEST_SONG_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), TEST_TYPE_SONG, TestSongClass)) #define TEST_IS_SONG(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), TEST_TYPE_SONG)) #define TEST_IS_SONG_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), TEST_TYPE_SONG)) #define TEST_SONG_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), TEST_TYPE_SONG, TestSongClass)) #define TEST_TYPE_BEATLES_SONG (test_beatles_song_get_type ()) #define TEST_BEATLES_SONG(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TEST_TYPE_BEATLES_SONG, TestBeatlesSong)) #define TEST_BEATLES_SONG_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), TEST_TYPE_BEATLES_SONG, TestBeatlesSongClass)) #define TEST_IS_BEATLES_SONG(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), TEST_TYPE_BEATLES_SONG)) #define TEST_IS_BEATLES_SONG_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), TEST_TYPE_BEATLES_SONG)) #define TEST_BEATLES_SONG_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), TEST_TYPE_BEATLES_SONG, TestBeatlesSongClass)) typedef GObject TestSong; typedef GObjectClass TestSongClass; typedef TestSong TestBeatlesSong; typedef TestSongClass TestBeatlesSongClass; GType test_song_get_type (void); GType test_beatles_song_get_type (void); TestSong *test_beatles_song_new (void); #endif dbus-glib-0.100.2/test/interfaces/Makefile.in0000644000175000017500000006500212112653462015617 00000000000000# 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@ @DBUS_BUILD_TESTS_TRUE@TESTS = run-test.sh @DBUS_BUILD_TESTS_TRUE@noinst_PROGRAMS = test-service$(EXEEXT) \ @DBUS_BUILD_TESTS_TRUE@ test-client$(EXEEXT) subdir = test/interfaces 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)/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 = PROGRAMS = $(noinst_PROGRAMS) am__test_client_SOURCES_DIST = test-client.c @DBUS_BUILD_TESTS_TRUE@am_test_client_OBJECTS = test-client.$(OBJEXT) test_client_OBJECTS = $(am_test_client_OBJECTS) test_client_LDADD = $(LDADD) am__DEPENDENCIES_1 = test_client_DEPENDENCIES = $(am__DEPENDENCIES_1) \ $(top_builddir)/dbus/libdbus-glib-1.la \ $(top_builddir)/dbus/libdbus-gtool.la \ $(top_builddir)/test/lib/libtest.la AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__test_service_SOURCES_DIST = test-interfaces.c test-interfaces.h \ test-dup-prop.c test-dup-prop.h test-objects.c test-objects.h \ test-server.c @DBUS_BUILD_TESTS_TRUE@am_test_service_OBJECTS = \ @DBUS_BUILD_TESTS_TRUE@ test-interfaces.$(OBJEXT) \ @DBUS_BUILD_TESTS_TRUE@ test-dup-prop.$(OBJEXT) \ @DBUS_BUILD_TESTS_TRUE@ test-objects.$(OBJEXT) \ @DBUS_BUILD_TESTS_TRUE@ test-server.$(OBJEXT) test_service_OBJECTS = $(am_test_service_OBJECTS) test_service_LDADD = $(LDADD) test_service_DEPENDENCIES = $(am__DEPENDENCIES_1) \ $(top_builddir)/dbus/libdbus-glib-1.la \ $(top_builddir)/dbus/libdbus-gtool.la \ $(top_builddir)/test/lib/libtest.la DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/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 = $(test_client_SOURCES) $(test_service_SOURCES) DIST_SOURCES = $(am__test_client_SOURCES_DIST) \ $(am__test_service_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 am__tty_colors = \ red=; grn=; lgn=; blu=; std= DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ABSOLUTE_TOP_BUILDDIR = @ABSOLUTE_TOP_BUILDDIR@ ACLOCAL = @ACLOCAL@ 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@ CYGPATH_W = @CYGPATH_W@ DBUS_BINDING_TOOL = @DBUS_BINDING_TOOL@ DBUS_CFLAGS = @DBUS_CFLAGS@ DBUS_GLIB_CFLAGS = @DBUS_GLIB_CFLAGS@ DBUS_GLIB_LIBS = @DBUS_GLIB_LIBS@ DBUS_GLIB_THREADS_CFLAGS = @DBUS_GLIB_THREADS_CFLAGS@ DBUS_GLIB_THREADS_LIBS = @DBUS_GLIB_THREADS_LIBS@ DBUS_GLIB_TOOL_CFLAGS = @DBUS_GLIB_TOOL_CFLAGS@ DBUS_GLIB_TOOL_LIBS = @DBUS_GLIB_TOOL_LIBS@ DBUS_LIBS = @DBUS_LIBS@ DBUS_PATH_OR_ABSTRACT = @DBUS_PATH_OR_ABSTRACT@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ EXPANDED_BINDIR = @EXPANDED_BINDIR@ EXPANDED_DATADIR = @EXPANDED_DATADIR@ EXPANDED_LIBDIR = @EXPANDED_LIBDIR@ EXPANDED_LOCALSTATEDIR = @EXPANDED_LOCALSTATEDIR@ EXPANDED_SYSCONFDIR = @EXPANDED_SYSCONFDIR@ FGREP = @FGREP@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GREP = @GREP@ GTKDOC_CHECK = @GTKDOC_CHECK@ 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@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_REVISION = @LT_REVISION@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ 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@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TEST_CORE_SERVICE_BINARY = @TEST_CORE_SERVICE_BINARY@ TEST_EXIT_BINARY = @TEST_EXIT_BINARY@ TEST_INTERFACES_SERVICE_BINARY = @TEST_INTERFACES_SERVICE_BINARY@ TEST_SEGFAULT_BINARY = @TEST_SEGFAULT_BINARY@ TEST_SERVICE_BINARY = @TEST_SERVICE_BINARY@ TEST_SERVICE_DIR = @TEST_SERVICE_DIR@ TEST_SHELL_SERVICE_BINARY = @TEST_SHELL_SERVICE_BINARY@ TEST_SLEEP_FOREVER_BINARY = @TEST_SLEEP_FOREVER_BINARY@ TEST_SOCKET_DIR = @TEST_SOCKET_DIR@ VERSION = @VERSION@ 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_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@ 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@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ 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 = \ -I$(top_srcdir) \ -I$(top_builddir) \ -I$(top_builddir)/dbus \ $(DBUS_CFLAGS) \ $(DBUS_GLIB_CFLAGS) \ -DDBUS_COMPILATION LDADD = $(DBUS_GLIB_LIBS) \ $(top_builddir)/dbus/libdbus-glib-1.la \ $(top_builddir)/dbus/libdbus-gtool.la \ $(top_builddir)/test/lib/libtest.la \ $(NULL) @DBUS_BUILD_TESTS_TRUE@TESTS_ENVIRONMENT = \ @DBUS_BUILD_TESTS_TRUE@ DBUS_TOP_BUILDDIR=$(ABSOLUTE_TOP_BUILDDIR) \ @DBUS_BUILD_TESTS_TRUE@ DBUS_BINDING_TOOL=$(DBUS_BINDING_TOOL) \ @DBUS_BUILD_TESTS_TRUE@ $(NULL) EXTRA_DIST = \ invalid-annotated-node.xml \ invalid-nested-annotation.xml \ run-test.sh \ test-goodbye.xml \ test-hello.xml \ test-song.xml \ test-dup-prop-a.xml \ test-dup-prop-b.xml \ valid-annotations.xml \ $(NULL) @DBUS_BUILD_TESTS_TRUE@test_service_SOURCES = \ @DBUS_BUILD_TESTS_TRUE@ test-interfaces.c \ @DBUS_BUILD_TESTS_TRUE@ test-interfaces.h \ @DBUS_BUILD_TESTS_TRUE@ test-dup-prop.c \ @DBUS_BUILD_TESTS_TRUE@ test-dup-prop.h \ @DBUS_BUILD_TESTS_TRUE@ test-objects.c \ @DBUS_BUILD_TESTS_TRUE@ test-objects.h \ @DBUS_BUILD_TESTS_TRUE@ test-server.c @DBUS_BUILD_TESTS_TRUE@test_client_SOURCES = \ @DBUS_BUILD_TESTS_TRUE@ test-client.c @DBUS_BUILD_TESTS_TRUE@BUILT_SOURCES = \ @DBUS_BUILD_TESTS_TRUE@ test-song-glue.h \ @DBUS_BUILD_TESTS_TRUE@ test-hello-glue.h \ @DBUS_BUILD_TESTS_TRUE@ test-goodbye-glue.h \ @DBUS_BUILD_TESTS_TRUE@ test-dup-prop-a-glue.h \ @DBUS_BUILD_TESTS_TRUE@ test-dup-prop-b-glue.h \ @DBUS_BUILD_TESTS_TRUE@ test-song-bindings.h \ @DBUS_BUILD_TESTS_TRUE@ test-hello-bindings.h \ @DBUS_BUILD_TESTS_TRUE@ test-goodbye-bindings.h \ @DBUS_BUILD_TESTS_TRUE@ test-dup-prop-a-bindings.h \ @DBUS_BUILD_TESTS_TRUE@ test-dup-prop-a-bindings.h \ @DBUS_BUILD_TESTS_TRUE@ test-dup-prop-b-bindings.h \ @DBUS_BUILD_TESTS_TRUE@ test-dup-prop-b-bindings.h \ @DBUS_BUILD_TESTS_TRUE@ valid-annotations-glue.h \ @DBUS_BUILD_TESTS_TRUE@ valid-annotations-bindings.h \ @DBUS_BUILD_TESTS_TRUE@ $(NULL) @DBUS_BUILD_TESTS_TRUE@CLEANFILES = \ @DBUS_BUILD_TESTS_TRUE@ $(BUILT_SOURCES) \ @DBUS_BUILD_TESTS_TRUE@ run-with-tmp-session-bus.conf all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(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 test/interfaces/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu test/interfaces/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: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(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 test-client$(EXEEXT): $(test_client_OBJECTS) $(test_client_DEPENDENCIES) $(EXTRA_test_client_DEPENDENCIES) @rm -f test-client$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_client_OBJECTS) $(test_client_LDADD) $(LIBS) test-service$(EXEEXT): $(test_service_OBJECTS) $(test_service_DEPENDENCIES) $(EXTRA_test_service_DEPENDENCIES) @rm -f test-service$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_service_OBJECTS) $(test_service_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-client.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-dup-prop.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-interfaces.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-objects.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-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 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 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 check-am: all-am $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-am all-am: Makefile $(PROGRAMS) 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-noinstPROGRAMS \ 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-TESTS check-am clean \ clean-generic clean-libtool clean-noinstPROGRAMS 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 @DBUS_BUILD_TESTS_TRUE@test-song-glue.h: test-song.xml $(top_builddir)/dbus/dbus-binding-tool$(EXEEXT) @DBUS_BUILD_TESTS_TRUE@ $(DBUS_BINDING_TOOL) --prefix=test_song --mode=glib-server --output=test-song-glue.h $(srcdir)/test-song.xml @DBUS_BUILD_TESTS_TRUE@test-song-bindings.h: test-song.xml $(top_builddir)/dbus/dbus-binding-tool$(EXEEXT) @DBUS_BUILD_TESTS_TRUE@ $(DBUS_BINDING_TOOL) --prefix=test_song --mode=glib-client --output=test-song-bindings.h $(srcdir)/test-song.xml @DBUS_BUILD_TESTS_TRUE@test-hello-glue.h: test-hello.xml $(top_builddir)/dbus/dbus-binding-tool$(EXEEXT) @DBUS_BUILD_TESTS_TRUE@ $(DBUS_BINDING_TOOL) --prefix=test_hello --mode=glib-server --output=test-hello-glue.h $(srcdir)/test-hello.xml @DBUS_BUILD_TESTS_TRUE@test-hello-bindings.h: test-hello.xml $(top_builddir)/dbus/dbus-binding-tool$(EXEEXT) @DBUS_BUILD_TESTS_TRUE@ $(DBUS_BINDING_TOOL) --prefix=test_hello --mode=glib-client --output=test-hello-bindings.h $(srcdir)/test-hello.xml @DBUS_BUILD_TESTS_TRUE@test-goodbye-glue.h: test-goodbye.xml $(top_builddir)/dbus/dbus-binding-tool$(EXEEXT) @DBUS_BUILD_TESTS_TRUE@ $(DBUS_BINDING_TOOL) --prefix=test_goodbye --mode=glib-server --output=test-goodbye-glue.h $(srcdir)/test-goodbye.xml @DBUS_BUILD_TESTS_TRUE@test-goodbye-bindings.h: test-goodbye.xml $(top_builddir)/dbus/dbus-binding-tool$(EXEEXT) @DBUS_BUILD_TESTS_TRUE@ $(DBUS_BINDING_TOOL) --prefix=test_goodbye --mode=glib-client --output=test-goodbye-bindings.h $(srcdir)/test-goodbye.xml @DBUS_BUILD_TESTS_TRUE@test-dup-prop-a-glue.h: test-dup-prop-a.xml $(top_builddir)/dbus/dbus-binding-tool$(EXEEXT) @DBUS_BUILD_TESTS_TRUE@ $(DBUS_BINDING_TOOL) --prefix=test_dup_prop_a --mode=glib-server --output=test-dup-prop-a-glue.h $(srcdir)/test-dup-prop-a.xml @DBUS_BUILD_TESTS_TRUE@test-dup-prop-a-bindings.h: test-dup-prop-a.xml $(top_builddir)/dbus/dbus-binding-tool$(EXEEXT) @DBUS_BUILD_TESTS_TRUE@ $(DBUS_BINDING_TOOL) --prefix=test_dup_prop_a --mode=glib-client --output=test-dup-prop-a-bindings.h $(srcdir)/test-dup-prop-a.xml @DBUS_BUILD_TESTS_TRUE@test-dup-prop-b-glue.h: test-dup-prop-b.xml $(top_builddir)/dbus/dbus-binding-tool$(EXEEXT) @DBUS_BUILD_TESTS_TRUE@ $(DBUS_BINDING_TOOL) --prefix=test_dup_prop_b --mode=glib-server --output=test-dup-prop-b-glue.h $(srcdir)/test-dup-prop-b.xml @DBUS_BUILD_TESTS_TRUE@test-dup-prop-b-bindings.h: test-dup-prop-b.xml $(top_builddir)/dbus/dbus-binding-tool$(EXEEXT) @DBUS_BUILD_TESTS_TRUE@ $(DBUS_BINDING_TOOL) --prefix=test_dup_prop_b --mode=glib-client --output=test-dup-prop-b-bindings.h $(srcdir)/test-dup-prop-b.xml @DBUS_BUILD_TESTS_TRUE@valid-annotations-glue.h: valid-annotations.xml $(top_builddir)/dbus/dbus-binding-tool$(EXEEXT) @DBUS_BUILD_TESTS_TRUE@ $(DBUS_BINDING_TOOL) --prefix=test_annotated --mode=glib-server --output=$@ $< @DBUS_BUILD_TESTS_TRUE@valid-annotations-bindings.h: valid-annotations.xml $(top_builddir)/dbus/dbus-binding-tool$(EXEEXT) @DBUS_BUILD_TESTS_TRUE@ $(DBUS_BINDING_TOOL) --prefix=test_annotated --mode=glib-client --output=$@ $< ### not building tests # 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: dbus-glib-0.100.2/test/interfaces/test-interfaces.h0000644000175000017500000000331211634152371017020 00000000000000#ifndef __TEST_INTERFACES_H__ #define __TEST_INTERFACES_H__ #include #define TEST_TYPE_HELLO (test_hello_get_type ()) #define TEST_HELLO(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TEST_TYPE_HELLO, TestHello)) #define TEST_HELLO_IFACE(obj) (G_TYPE_CHECK_CLASS_CAST ((obj), TEST_TYPE_HELLO, TestHelloIface)) #define TEST_IS_HELLO(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TEST_TYPE_HELLO)) #define TEST_HELLO_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), TEST_TYPE_HELLO, TestHelloIface)) #define TEST_TYPE_GOODBYE (test_goodbye_get_type ()) #define TEST_GOODBYE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TEST_TYPE_GOODBYE, TestGoodbye)) #define TEST_GOODBYE_IFACE(obj) (G_TYPE_CHECK_CLASS_CAST ((obj), TEST_TYPE_GOODBYE, TestGoodbyeIface)) #define TEST_IS_GOODBYE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TEST_TYPE_GOODBYE)) #define TEST_GOODBYE_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), TEST_TYPE_GOODBYE, TestGoodbyeIface)) typedef struct _TestHello TestHello; /* dummy */ typedef struct _TestHelloIface TestHelloIface; typedef struct _TestGoodbye TestGoodbye; /* dummy */ typedef struct _TestGoodbyeIface TestGoodbyeIface; struct _TestHelloIface { GTypeInterface interface; /* VTable */ gchar *(* say_hello) (TestHello *hello); /* Signals */ void (* greetings) (TestHello *hello); }; struct _TestGoodbyeIface { GTypeInterface interface; /* VTable */ gchar *(* say_goodbye) (TestGoodbye *goodbye); }; GType test_hello_get_type (void) G_GNUC_CONST; gchar *test_hello_say_hello (TestHello *hello); void test_hello_greetings (TestHello *hello); GType test_goodbye_get_type (void) G_GNUC_CONST; gchar *test_goodbye_say_goodbye (TestGoodbye *goodbye); #endif dbus-glib-0.100.2/test/interfaces/test-dup-prop.h0000644000175000017500000000376012107524563016454 00000000000000#ifndef __TEST_DUP_PROP_H__ #define __TEST_DUP_PROP_H__ #include #define TEST_TYPE_A (test_a_get_type ()) #define TEST_A(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TEST_TYPE_A, TestA)) #define TEST_A_IFACE(obj) (G_TYPE_CHECK_CLASS_CAST ((obj), TEST_TYPE_A, TestAIface)) #define TEST_IS_IFACE_A(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TEST_TYPE_A)) #define TEST_A_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), TEST_TYPE_A, TestAIface)) #define TEST_TYPE_B (test_b_get_type ()) #define TEST_B(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TEST_TYPE_B, TestB)) #define TEST_B_IFACE(obj) (G_TYPE_CHECK_CLASS_CAST ((obj), TEST_TYPE_B, TestBIface)) #define TEST_IS_B(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TEST_TYPE_B)) #define TEST_B_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), TEST_TYPE_B, TestBIface)) #define TEST_TYPE_DP_OBJ (test_dp_obj_get_type ()) #define TEST_DP_OBJ(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TEST_TYPE_DP_OBJ, TestDpObj)) #define TEST_DP_OBJ_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TEST_TYPE_DP_OBJ, TestDpObjClass)) #define TEST_IS_DP_OBJ(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TEST_TYPE_DP_OBJ)) #define TEST_IS_DP_OBJ_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TEST_TYPE_DP_OBJ)) #define TEST_DP_OBJ_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TEST_TYPE_DP_OBJ, TestDpObjClass)) typedef struct _TestA TestA; /* dummy */ typedef struct _TestAIface TestAIface; typedef struct _TestB TestB; /* dummy */ typedef struct _TestBIface TestBIface; typedef struct _TestDpObj TestDpObj; typedef struct _TestDpObjClass TestDpObjClass; struct _TestAIface { GTypeInterface interface; }; struct _TestBIface { GTypeInterface interface; }; struct _TestDpObj { GObject parent; }; struct _TestDpObjClass { GObjectClass parent; }; GType test_a_get_type (void) G_GNUC_CONST; GType test_b_get_type (void) G_GNUC_CONST; GType test_dp_obj_get_type (void) G_GNUC_CONST; TestDpObj *test_dp_obj_new (void); #endif dbus-glib-0.100.2/test/interfaces/test-client.c0000644000175000017500000002154212107524614016152 00000000000000#include #include #include #include "dbus/dbus-gparser.h" #include "test-song-bindings.h" #include "test-hello-bindings.h" #include "test-goodbye-bindings.h" #include "test-dup-prop-a-bindings.h" #include "test-dup-prop-b-bindings.h" #define TEST_NAMESPACE "org.freedesktop.DBus.GLib.Test.Interfaces" #define TEST_OBJECT_PATH "/org/freedesktop/DBus/GLib/Test/Interfaces" #define TEST_DP_OBJECT_PATH "/org/freedesktop/DBus/GLib/Test/DupPropInterfaces" #define TEST_DP_IFACE_A "org.freedesktop.DBus.GLib.Test.Interfaces.A" #define TEST_DP_IFACE_B "org.freedesktop.DBus.GLib.Test.Interfaces.B" static void test_dp_property (DBusGProxy *proxy, const char *detail, const char *iface, guint expected, gboolean get_only) { GError *error = NULL; gboolean success; GValue get_value = {0,}; if (!get_only) { GValue set_value = {0,}; g_value_init (&set_value, G_TYPE_UINT); g_value_set_uint (&set_value, expected); success = dbus_g_proxy_call (proxy, "Set", &error, G_TYPE_STRING, iface, G_TYPE_STRING, "Foobar", G_TYPE_VALUE, &set_value, G_TYPE_INVALID, G_TYPE_INVALID); g_value_unset (&set_value); if (!success) { g_print ("Error while setting DupProp Interface %s property: %s\n", detail, error->message); g_error_free (error); exit(1); } else g_print ("Set DupProp Interface %s property with success\n", detail); } success = dbus_g_proxy_call (proxy, "Get", &error, G_TYPE_STRING, iface, G_TYPE_STRING, "Foobar", G_TYPE_INVALID, G_TYPE_VALUE, &get_value, G_TYPE_INVALID); if (!success) { g_print ("Error while getting DupProp Interface %s property: %s\n", detail, error->message); g_error_free (error); exit(1); } else g_print ("Got DupProp Interface %s property with success\n", detail); if (!G_VALUE_HOLDS_UINT (&get_value)) { g_print ("Error comparing DupProp %s Interface property: unexpected type %s\n", detail, G_VALUE_TYPE_NAME (&get_value)); g_error_free (error); exit(1); } else if (g_value_get_uint (&get_value) != expected) { g_print ("Error comparing DupProp %s Interface property: expected %d, got %d\n", detail, expected, g_value_get_uint (&get_value)); g_error_free (error); exit(1); } else g_print ("Got DupProp Interface %s property value matched expected\n", detail); } int main (int argc, char **argv) { DBusGConnection *connection; DBusGProxy *proxy; GError *error = NULL; gchar *str; gboolean success; DBusGProxy *dp_proxy; g_type_init (); connection = dbus_g_bus_get (DBUS_BUS_SESSION, &error); if (connection == NULL) { g_error ("Failed to make connection to session bus: %s", error->message); g_error_free (error); exit(1); } proxy = dbus_g_proxy_new_for_name (connection, TEST_NAMESPACE, TEST_OBJECT_PATH, "org.freedesktop.DBus.GLib.Test.Interfaces.Song"); success = org_freedesktop_DBus_GLib_Test_Interfaces_Song_get_title (proxy, &str, &error); g_object_unref (proxy); if (!success) { g_print ("Error while calling Parent object method: %s\n", error->message); g_error_free (error); exit(1); } else { g_free (str); g_print ("Called Parent object method with success\n"); } proxy = dbus_g_proxy_new_for_name (connection, TEST_NAMESPACE, TEST_OBJECT_PATH, "org.freedesktop.DBus.GLib.Test.Interfaces.Hello"); g_assert (proxy != NULL); success = org_freedesktop_DBus_GLib_Test_Interfaces_Hello_say_hello (proxy, &str, &error); g_object_unref (proxy); if (!success) { g_print ("Error while calling Parent Interface object method: %s\n", error->message); g_error_free (error); exit(1); } else { g_free (str); g_print ("Called Parent Interface object method with success\n"); } proxy = dbus_g_proxy_new_for_name (connection, TEST_NAMESPACE, TEST_OBJECT_PATH, "org.freedesktop.DBus.GLib.Test.Interfaces.Goodbye"); success = org_freedesktop_DBus_GLib_Test_Interfaces_Goodbye_say_goodbye (proxy, &str, &error); g_object_unref (proxy); if (!success) { g_print ("Error while calling Object Interface object method: %s\n", error->message); g_error_free (error); exit(1); } else { g_free (str); g_print ("Called Object Interface object method with success\n"); } /* Test interfaces with conflicting property names on the same GObject */ dp_proxy = dbus_g_proxy_new_for_name (connection, TEST_NAMESPACE, TEST_DP_OBJECT_PATH, "org.freedesktop.DBus.Properties"); /* test that setting the property and reading it back works */ test_dp_property (dp_proxy, "A", TEST_DP_IFACE_A, 235235, FALSE); test_dp_property (dp_proxy, "B", TEST_DP_IFACE_B, 11981241, FALSE); /* Test that setting A does not change B */ test_dp_property (dp_proxy, "B", TEST_DP_IFACE_B, 11981241, FALSE); test_dp_property (dp_proxy, "A", TEST_DP_IFACE_A, 235235, FALSE); test_dp_property (dp_proxy, "B", TEST_DP_IFACE_B, 11981241, TRUE); /* And test that setting B does not change A */ test_dp_property (dp_proxy, "A", TEST_DP_IFACE_A, 235235, FALSE); test_dp_property (dp_proxy, "B", TEST_DP_IFACE_B, 11981241, FALSE); test_dp_property (dp_proxy, "A", TEST_DP_IFACE_A, 235235, TRUE); g_object_unref (dp_proxy); /* Ensure the properties are introspectable */ dp_proxy = dbus_g_proxy_new_for_name (connection, TEST_NAMESPACE, TEST_DP_OBJECT_PATH, "org.freedesktop.DBus.Introspectable"); g_print ("Testing duplicate property name introspection\n"); if (!dbus_g_proxy_call (dp_proxy, "Introspect", &error, G_TYPE_INVALID, G_TYPE_STRING, &str, G_TYPE_INVALID)) { g_print ("Error while introspecting duplicate properties: %s\n", error->message); g_error_free (error); exit(1); } else g_print ("Introspected duplicate properties with success\n"); { NodeInfo *node; GSList *elt; gboolean found_introspectable = FALSE; gboolean found_properties = FALSE; gboolean found_iface_a = FALSE; gboolean found_iface_a_prop = FALSE; gboolean found_iface_b = FALSE; gboolean found_iface_b_prop = FALSE; node = description_load_from_string (str, strlen (str), &error); if (!node) { g_print ("Failed to parse introspection data: %s\n", error->message); g_error_free (error); exit(1); } for (elt = node_info_get_interfaces (node); elt ; elt = elt->next) { InterfaceInfo *iface = elt->data; if (!found_introspectable && strcmp (interface_info_get_name (iface), "org.freedesktop.DBus.Introspectable") == 0) found_introspectable = TRUE; else if (!found_properties && strcmp (interface_info_get_name (iface), "org.freedesktop.DBus.Properties") == 0) found_properties = TRUE; else if (!found_iface_a && strcmp (interface_info_get_name (iface), "org.freedesktop.DBus.GLib.Test.Interfaces.A") == 0) { GSList *elt; found_iface_a = TRUE; for (elt = interface_info_get_properties (iface); elt; elt = elt->next) { PropertyInfo *prop; prop = elt->data; if (strcmp (property_info_get_name (prop), "Foobar") == 0) { found_iface_a_prop = TRUE; break; } } } else if (!found_iface_b && strcmp (interface_info_get_name (iface), "org.freedesktop.DBus.GLib.Test.Interfaces.B") == 0) { GSList *elt; found_iface_b = TRUE; for (elt = interface_info_get_properties (iface); elt; elt = elt->next) { PropertyInfo *prop; prop = elt->data; if (strcmp (property_info_get_name (prop), "Foobar") == 0) { found_iface_b_prop = TRUE; break; } } } } g_free (str); if (!found_iface_a_prop || !found_iface_b_prop) { g_print ("Failed to find Foobar properties in introspection data\n"); g_error_free (error); exit(1); } } exit(0); } /* ex:ts=2:et: */ dbus-glib-0.100.2/test/interfaces/test-dup-prop-a.xml0000644000175000017500000000037112107524563017236 00000000000000 dbus-glib-0.100.2/test/interfaces/valid-annotations.xml0000644000175000017500000000206412107524614017725 00000000000000 dbus-glib-0.100.2/test/interfaces/test-hello.xml0000644000175000017500000000062711634152371016357 00000000000000 dbus-glib-0.100.2/test/interfaces/test-objects.c0000644000175000017500000000273612107524614016331 00000000000000#include #include "test-objects.h" #include "test-interfaces.h" static gboolean test_song_dbus_get_title (TestSong *song, gchar **title, GError **error) { *title = g_strdup ("Hello, Goodbye"); return TRUE; } #include "test-song-glue.h" static gchar * test_song_say_hello (TestHello *hello) { return g_strdup ("Hello, hello..."); } static void test_song_init (TestSong *song) { } static void test_song_hello_init (TestHelloIface *iface) { iface->say_hello = test_song_say_hello; } static void test_song_class_init (TestSongClass *klass) { dbus_g_object_type_install_info (G_TYPE_FROM_CLASS (klass), &dbus_glib_test_song_object_info); } G_DEFINE_TYPE_WITH_CODE (TestSong, test_song, G_TYPE_OBJECT, G_IMPLEMENT_INTERFACE (TEST_TYPE_HELLO, test_song_hello_init)) static gchar * test_beatles_song_say_goodbye (TestGoodbye *goodbye) { return g_strdup ("I don't know why you say goodbye, I say hello."); } static void test_beatles_song_init (TestBeatlesSong *song) { } static void test_beatles_song_goodbye_init (TestGoodbyeIface *iface) { iface->say_goodbye = test_beatles_song_say_goodbye; } static void test_beatles_song_class_init (TestBeatlesSongClass *klass) { } G_DEFINE_TYPE_WITH_CODE (TestBeatlesSong, test_beatles_song, TEST_TYPE_SONG, G_IMPLEMENT_INTERFACE (TEST_TYPE_GOODBYE, test_beatles_song_goodbye_init)) TestBeatlesSong * test_beatles_song_new (void) { return TEST_BEATLES_SONG (g_object_new (TEST_TYPE_BEATLES_SONG, NULL)); } dbus-glib-0.100.2/test/interfaces/invalid-annotated-node.xml0000644000175000017500000000053712107524614020622 00000000000000 dbus-glib-0.100.2/test/interfaces/test-goodbye.xml0000644000175000017500000000057511634152371016706 00000000000000 dbus-glib-0.100.2/test/interfaces/test-server.c0000644000175000017500000000327212107524614016202 00000000000000#include #include #include "dbus/dbus-glib.h" #include "tools/dbus-glib-bindings.h" #include "test-objects.h" #include "test-dup-prop.h" #define TEST_NAMESPACE "org.freedesktop.DBus.GLib.Test.Interfaces" #define TEST_OBJECT_PATH "/org/freedesktop/DBus/GLib/Test/Interfaces" #define TEST_DP_OBJECT_PATH "/org/freedesktop/DBus/GLib/Test/DupPropInterfaces" static GMainLoop *loop = NULL; int main (int argc, char **argv) { DBusGConnection *connection; DBusGProxy *proxy; GError *error = NULL; guint32 ret; TestBeatlesSong *song; TestDpObj *dp_obj; g_type_init (); /* Get the connection and ensure the name is not used yet */ connection = dbus_g_bus_get (DBUS_BUS_SESSION, &error); if (connection == NULL) { g_warning ("Failed to make connection to session bus: %s", error->message); g_error_free (error); exit(1); } proxy = dbus_g_proxy_new_for_name (connection, DBUS_SERVICE_DBUS, DBUS_PATH_DBUS, DBUS_INTERFACE_DBUS); if (!org_freedesktop_DBus_request_name (proxy, TEST_NAMESPACE, 0, &ret, &error)) { g_warning ("There was an error requesting the name: %s", error->message); g_error_free (error); exit(1); } if (ret != DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER) { /* Someone else registered the name before us */ exit(1); } song = test_beatles_song_new (); /* Register the app on the bus */ dbus_g_connection_register_g_object (connection, TEST_OBJECT_PATH, G_OBJECT (song)); dp_obj = test_dp_obj_new (); dbus_g_connection_register_g_object (connection, TEST_DP_OBJECT_PATH, G_OBJECT (dp_obj)); loop = g_main_loop_new (NULL, FALSE); g_main_loop_run (loop); return 0; } dbus-glib-0.100.2/test/interfaces/test-song.xml0000644000175000017500000000056311634152371016221 00000000000000 dbus-glib-0.100.2/test/interfaces/Makefile.am0000644000175000017500000001016112112652540015576 00000000000000INCLUDES = \ -I$(top_srcdir) \ -I$(top_builddir) \ -I$(top_builddir)/dbus \ $(DBUS_CFLAGS) \ $(DBUS_GLIB_CFLAGS) \ -DDBUS_COMPILATION LDADD = $(DBUS_GLIB_LIBS) \ $(top_builddir)/dbus/libdbus-glib-1.la \ $(top_builddir)/dbus/libdbus-gtool.la \ $(top_builddir)/test/lib/libtest.la \ $(NULL) ## note that TESTS has special meaning (stuff to use in make check) ## so if adding tests not to be run in make check, don't add them to ## TESTS if DBUS_BUILD_TESTS TESTS_ENVIRONMENT = \ DBUS_TOP_BUILDDIR=$(ABSOLUTE_TOP_BUILDDIR) \ DBUS_BINDING_TOOL=$(DBUS_BINDING_TOOL) \ $(NULL) TESTS=run-test.sh else TESTS= endif EXTRA_DIST = \ invalid-annotated-node.xml \ invalid-nested-annotation.xml \ run-test.sh \ test-goodbye.xml \ test-hello.xml \ test-song.xml \ test-dup-prop-a.xml \ test-dup-prop-b.xml \ valid-annotations.xml \ $(NULL) if DBUS_BUILD_TESTS ## we use noinst_PROGRAMS not check_PROGRAMS for TESTS so that we ## build even when not doing "make check" noinst_PROGRAMS = test-service test-client test_service_SOURCES = \ test-interfaces.c \ test-interfaces.h \ test-dup-prop.c \ test-dup-prop.h \ test-objects.c \ test-objects.h \ test-server.c test_client_SOURCES = \ test-client.c BUILT_SOURCES = \ test-song-glue.h \ test-hello-glue.h \ test-goodbye-glue.h \ test-dup-prop-a-glue.h \ test-dup-prop-b-glue.h \ test-song-bindings.h \ test-hello-bindings.h \ test-goodbye-bindings.h \ test-dup-prop-a-bindings.h \ test-dup-prop-a-bindings.h \ test-dup-prop-b-bindings.h \ test-dup-prop-b-bindings.h \ valid-annotations-glue.h \ valid-annotations-bindings.h \ $(NULL) test-song-glue.h: test-song.xml $(top_builddir)/dbus/dbus-binding-tool$(EXEEXT) $(DBUS_BINDING_TOOL) --prefix=test_song --mode=glib-server --output=test-song-glue.h $(srcdir)/test-song.xml test-song-bindings.h: test-song.xml $(top_builddir)/dbus/dbus-binding-tool$(EXEEXT) $(DBUS_BINDING_TOOL) --prefix=test_song --mode=glib-client --output=test-song-bindings.h $(srcdir)/test-song.xml test-hello-glue.h: test-hello.xml $(top_builddir)/dbus/dbus-binding-tool$(EXEEXT) $(DBUS_BINDING_TOOL) --prefix=test_hello --mode=glib-server --output=test-hello-glue.h $(srcdir)/test-hello.xml test-hello-bindings.h: test-hello.xml $(top_builddir)/dbus/dbus-binding-tool$(EXEEXT) $(DBUS_BINDING_TOOL) --prefix=test_hello --mode=glib-client --output=test-hello-bindings.h $(srcdir)/test-hello.xml test-goodbye-glue.h: test-goodbye.xml $(top_builddir)/dbus/dbus-binding-tool$(EXEEXT) $(DBUS_BINDING_TOOL) --prefix=test_goodbye --mode=glib-server --output=test-goodbye-glue.h $(srcdir)/test-goodbye.xml test-goodbye-bindings.h: test-goodbye.xml $(top_builddir)/dbus/dbus-binding-tool$(EXEEXT) $(DBUS_BINDING_TOOL) --prefix=test_goodbye --mode=glib-client --output=test-goodbye-bindings.h $(srcdir)/test-goodbye.xml test-dup-prop-a-glue.h: test-dup-prop-a.xml $(top_builddir)/dbus/dbus-binding-tool$(EXEEXT) $(DBUS_BINDING_TOOL) --prefix=test_dup_prop_a --mode=glib-server --output=test-dup-prop-a-glue.h $(srcdir)/test-dup-prop-a.xml test-dup-prop-a-bindings.h: test-dup-prop-a.xml $(top_builddir)/dbus/dbus-binding-tool$(EXEEXT) $(DBUS_BINDING_TOOL) --prefix=test_dup_prop_a --mode=glib-client --output=test-dup-prop-a-bindings.h $(srcdir)/test-dup-prop-a.xml test-dup-prop-b-glue.h: test-dup-prop-b.xml $(top_builddir)/dbus/dbus-binding-tool$(EXEEXT) $(DBUS_BINDING_TOOL) --prefix=test_dup_prop_b --mode=glib-server --output=test-dup-prop-b-glue.h $(srcdir)/test-dup-prop-b.xml test-dup-prop-b-bindings.h: test-dup-prop-b.xml $(top_builddir)/dbus/dbus-binding-tool$(EXEEXT) $(DBUS_BINDING_TOOL) --prefix=test_dup_prop_b --mode=glib-client --output=test-dup-prop-b-bindings.h $(srcdir)/test-dup-prop-b.xml valid-annotations-glue.h: valid-annotations.xml $(top_builddir)/dbus/dbus-binding-tool$(EXEEXT) $(DBUS_BINDING_TOOL) --prefix=test_annotated --mode=glib-server --output=$@ $< valid-annotations-bindings.h: valid-annotations.xml $(top_builddir)/dbus/dbus-binding-tool$(EXEEXT) $(DBUS_BINDING_TOOL) --prefix=test_annotated --mode=glib-client --output=$@ $< CLEANFILES = \ $(BUILT_SOURCES) \ run-with-tmp-session-bus.conf else ### not building tests endif dbus-glib-0.100.2/test/interfaces/test-dup-prop-b.xml0000644000175000017500000000037112107524563017237 00000000000000 dbus-glib-0.100.2/test/interfaces/invalid-nested-annotation.xml0000644000175000017500000000057012107524614021351 00000000000000 dbus-glib-0.100.2/test/interfaces/test-dup-prop.c0000644000175000017500000001075112107524563016445 00000000000000#ifdef HAVE_CONFIG_H # include #endif #include "test-dup-prop.h" #include "test-dup-prop-a-glue.h" #include "test-dup-prop-b-glue.h" #define TEST_A_FOOBAR "a-foobar" #define TEST_B_FOOBAR "b-foobar" static void test_a_class_init (gpointer g_iface) { GType iface_type = G_TYPE_FROM_INTERFACE (g_iface); g_object_interface_install_property (g_iface, g_param_spec_uint (TEST_A_FOOBAR, "A Foobar", "A description of something", 0, G_MAXUINT, 0, G_PARAM_READWRITE)); dbus_g_object_type_install_info (iface_type, &dbus_glib_test_dup_prop_a_object_info); dbus_g_object_type_register_shadow_property (iface_type, "Foobar", TEST_A_FOOBAR); } GType test_a_get_type (void) { static GType the_type = 0; if (G_UNLIKELY (the_type == 0)) { static const GTypeInfo info = { sizeof (TestAIface), NULL, NULL, (GClassInitFunc) test_a_class_init, NULL, NULL, 0, 0, NULL }; the_type = g_type_register_static (G_TYPE_INTERFACE, "TestA", &info, 0); g_type_interface_add_prerequisite (the_type, G_TYPE_OBJECT); } return the_type; } static void test_b_class_init (gpointer g_iface) { GType iface_type = G_TYPE_FROM_INTERFACE (g_iface); g_object_interface_install_property (g_iface, g_param_spec_uint (TEST_B_FOOBAR, "B Foobar", "A description of something", 0, G_MAXUINT, 0, G_PARAM_READWRITE)); dbus_g_object_type_install_info (iface_type, &dbus_glib_test_dup_prop_b_object_info); dbus_g_object_type_register_shadow_property (iface_type, "Foobar", TEST_B_FOOBAR); } GType test_b_get_type (void) { static GType the_type = 0; if (G_UNLIKELY (the_type == 0)) { static const GTypeInfo info = { sizeof (TestBIface), NULL, NULL, (GClassInitFunc) test_b_class_init, NULL, NULL, 0, 0, NULL }; the_type = g_type_register_static (G_TYPE_INTERFACE, "TestB", &info, 0); g_type_interface_add_prerequisite (the_type, G_TYPE_OBJECT); } return the_type; } static void test_a_init (TestAIface *a_class); static void test_b_init (TestBIface *b_class); G_DEFINE_TYPE_EXTENDED (TestDpObj, test_dp_obj, G_TYPE_OBJECT, 0, G_IMPLEMENT_INTERFACE (TEST_TYPE_A, test_a_init) G_IMPLEMENT_INTERFACE (TEST_TYPE_B, test_b_init)) #define TEST_DP_OBJ_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TEST_TYPE_DP_OBJ, TestDpObjPrivate)) enum { PROP_0, PROP_A_FOOBAR, PROP_B_FOOBAR }; typedef struct { guint32 a_foobar; guint32 b_foobar; } TestDpObjPrivate; TestDpObj * test_dp_obj_new (void) { return TEST_DP_OBJ (g_object_new (TEST_TYPE_DP_OBJ, NULL)); } static void test_a_init (TestAIface *a_class) { } static void test_b_init (TestBIface *b_class) { } static void test_dp_obj_init (TestDpObj *self) { } static void set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) { TestDpObjPrivate *priv = TEST_DP_OBJ_GET_PRIVATE (object); switch (prop_id) { case PROP_A_FOOBAR: priv->a_foobar = g_value_get_uint (value); break; case PROP_B_FOOBAR: priv->b_foobar = g_value_get_uint (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } } static void get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) { TestDpObjPrivate *priv = TEST_DP_OBJ_GET_PRIVATE (object); switch (prop_id) { case PROP_A_FOOBAR: g_value_set_uint (value, priv->a_foobar); break; case PROP_B_FOOBAR: g_value_set_uint (value, priv->b_foobar); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } } static void test_dp_obj_class_init (TestDpObjClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); g_type_class_add_private (object_class, sizeof (TestDpObjPrivate)); object_class->get_property = get_property; object_class->set_property = set_property; /* Properties */ g_object_class_override_property (object_class, PROP_A_FOOBAR, TEST_A_FOOBAR); g_object_class_override_property (object_class, PROP_B_FOOBAR, TEST_B_FOOBAR); } dbus-glib-0.100.2/test/interfaces/run-test.sh0000755000175000017500000000227612107524614015676 00000000000000#! /bin/sh SCRIPTNAME=$0 MODE=$1 ## so the tests can complain if you fail to use the script to launch them DBUS_TEST_GLIB_RUN_TEST_SCRIPT=1 export DBUS_TEST_GLIB_RUN_TEST_SCRIPT srcdir=`dirname "$0"` DBUS_TOP_SRCDIR="$srcdir/../.." export DBUS_TOP_SRCDIR # Rerun ourselves with tmp session bus if we're not already if test -z "$DBUS_TEST_GLIB_IN_RUN_TEST"; then DBUS_TEST_GLIB_IN_RUN_TEST=1 export DBUS_TEST_GLIB_IN_RUN_TEST exec $DBUS_TOP_SRCDIR/tools/run-with-tmp-session-bus.sh $SCRIPTNAME $MODE fi for x in annotated-node nested-annotation; do if ! test -f $srcdir/invalid-$x.xml; then echo "invalid-$x.xml missing">&2 exit 1 fi if $DBUS_BINDING_TOOL --prefix=test_invalid --mode=glib-server \ --output=invalid-glue.h $srcdir/invalid-$x.xml || $DBUS_BINDING_TOOL --prefix=test_invalid --mode=glib-client \ --output=invalid-bindings.h $srcdir/invalid-$x.xml; then echo "invalid-$x.xml should not have been processed successfully!">&2 exit 1 else echo "invalid-$x.xml failed, as expected">&2 fi done echo "running test-client" ${DBUS_TOP_BUILDDIR}/libtool --mode=execute $DEBUG $DBUS_TOP_BUILDDIR/test/interfaces/test-client || die "test-client failed" dbus-glib-0.100.2/test/Makefile.am0000644000175000017500000000102212112652540013447 00000000000000SUBDIRS = lib . core interfaces manual DIST_SUBDIRS = lib core interfaces manual INCLUDES = \ -I$(top_srcdir) \ -I$(top_builddir) \ -I$(top_builddir)/dbus \ $(DBUS_CFLAGS) if DBUS_BUILD_TESTS TEST_BINARIES=test-service else TEST_BINARIES= endif noinst_PROGRAMS= $(TEST_BINARIES) test_service_SOURCES= \ test-service.c test_service_LDADD=$(DBUS_LIBS) EXTRA_DIST = data/nested-introspect.xml test-compile-nested.sh TESTS_ENVIRONMENT=top_builddir=$(top_builddir) srcdir=$(srcdir) TESTS = test-compile-nested.sh dbus-glib-0.100.2/test/core/0000755000175000017500000000000012112654010012422 500000000000000dbus-glib-0.100.2/test/core/proxy-peer.c0000644000175000017500000001527312107524614014642 00000000000000/* Regression tests for using a DBusGProxy on a peer-to-peer connection. * * Author: Simon McVittie * Copyright © 2011 Nokia Corporation * * 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 AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #include #include #include #include #include #include "my-object.h" GMainLoop *loop; typedef struct { DBusError e; DBusServer *server; DBusConnection *server_conn; DBusGConnection *server_gconn; DBusConnection *client_conn; DBusGConnection *client_gconn; DBusGProxy *proxy; gboolean proxy_destroyed; GObject *object; GHashTable *in_flight; GHashTable *completed; } Fixture; static void assert_no_error (const DBusError *e) { if (G_UNLIKELY (dbus_error_is_set (e))) g_error ("expected success but got error: %s: %s", e->name, e->message); } static void new_conn_cb (DBusServer *server, DBusConnection *server_conn, void *data) { Fixture *f = data; g_assert (f->server_conn == NULL); f->server_conn = dbus_connection_ref (server_conn); dbus_connection_setup_with_g_main (server_conn, NULL); f->server_gconn = dbus_connection_get_g_connection (server_conn); } static void destroy_cb (DBusGProxy *proxy, gpointer user_data) { Fixture *f = user_data; g_assert (proxy == f->proxy); f->proxy_destroyed = TRUE; } static void setup (Fixture *f, gconstpointer addr) { dbus_error_init (&f->e); f->server = dbus_server_listen (addr, &f->e); assert_no_error (&f->e); g_assert (f->server != NULL); dbus_server_set_new_connection_function (f->server, new_conn_cb, f, NULL); dbus_server_setup_with_g_main (f->server, NULL); g_assert (f->server_conn == NULL); f->client_conn = dbus_connection_open_private ( dbus_server_get_address (f->server), &f->e); assert_no_error (&f->e); g_assert (f->client_conn != NULL); dbus_connection_setup_with_g_main (f->client_conn, NULL); f->client_gconn = dbus_connection_get_g_connection (f->client_conn); while (f->server_conn == NULL) { g_print ("."); g_main_context_iteration (NULL, TRUE); } f->object = g_object_new (MY_TYPE_OBJECT, NULL); dbus_g_connection_register_g_object (f->server_gconn, "/org/freedesktop/DBus/GLib/Tests/MyTestObject", f->object); f->proxy = dbus_g_proxy_new_for_peer (f->client_gconn, "/org/freedesktop/DBus/GLib/Tests/MyTestObject", "org.freedesktop.DBus.GLib.Tests.MyObject"); g_assert (f->proxy != NULL); g_assert (DBUS_IS_G_PROXY (f->proxy)); g_signal_connect (f->proxy, "destroy", G_CALLBACK (destroy_cb), f); f->in_flight = g_hash_table_new (NULL, NULL); f->completed = g_hash_table_new (NULL, NULL); } static void call_cb (DBusGProxy *proxy, DBusGProxyCall *call, gpointer data) { Fixture *f = data; gboolean found; found = g_hash_table_remove (f->in_flight, call); g_assert (found); g_hash_table_insert (f->completed, call, call); } static void test_method (Fixture *f, gconstpointer addr) { GError *error = NULL; gboolean ok; DBusGProxyCall *call; call = dbus_g_proxy_begin_call (f->proxy, "DoNothing", call_cb, f, NULL, G_TYPE_INVALID); g_assert (call != NULL); g_hash_table_insert (f->in_flight, call, call); while (g_hash_table_size (f->in_flight) > 0) { g_print ("."); g_main_context_iteration (NULL, TRUE); } ok = g_hash_table_remove (f->completed, call); g_assert (ok); ok = dbus_g_proxy_end_call (f->proxy, call, &error, G_TYPE_INVALID); g_assert_no_error (error); g_assert (ok); } static void test_disconnect (Fixture *f, gconstpointer addr) { GError *error = NULL; gboolean ok; DBusGProxyCall *fail; g_test_bug ("38406"); dbus_connection_close (f->client_conn); dbus_connection_close (f->server_conn); fail = dbus_g_proxy_begin_call (f->proxy, "DoNothing", call_cb, f, NULL, G_TYPE_INVALID); g_assert (fail == NULL); ok = dbus_g_proxy_end_call (f->proxy, fail, &error, G_TYPE_INVALID); g_assert_error (error, DBUS_GERROR, DBUS_GERROR_DISCONNECTED); g_assert (!ok); g_clear_error (&error); while (!f->proxy_destroyed) { g_print ("."); g_main_context_iteration (NULL, TRUE); } } static void teardown (Fixture *f, gconstpointer addr G_GNUC_UNUSED) { f->client_gconn = NULL; f->server_gconn = NULL; if (f->in_flight != NULL) { g_hash_table_unref (f->in_flight); f->in_flight = NULL; } if (f->completed != NULL) { g_hash_table_unref (f->completed); f->completed = NULL; } if (f->proxy != NULL) { g_signal_handlers_disconnect_by_func (f->proxy, destroy_cb, f); g_object_unref (f->proxy); f->proxy = NULL; } if (f->object != NULL) { g_object_unref (f->object); f->object = NULL; } if (f->client_conn != NULL) { dbus_connection_close (f->client_conn); dbus_connection_unref (f->client_conn); f->client_conn = NULL; } if (f->server_conn != NULL) { dbus_connection_close (f->server_conn); dbus_connection_unref (f->server_conn); f->server_conn = NULL; } if (f->server != NULL) { dbus_server_disconnect (f->server); dbus_server_unref (f->server); f->server = NULL; } } int main (int argc, char **argv) { g_test_init (&argc, &argv, NULL); g_type_init (); dbus_g_type_specialized_init (); g_test_bug_base ("https://bugs.freedesktop.org/show_bug.cgi?id="); g_test_add ("/proxy/method", Fixture, "unix:tmpdir=/tmp", setup, test_method, teardown); g_test_add ("/proxy/disconnect", Fixture, "unix:tmpdir=/tmp", setup, test_disconnect, teardown); return g_test_run (); } dbus-glib-0.100.2/test/core/my-object.h0000644000175000017500000001156212112652540014417 00000000000000#ifndef __MY_OBJECT_H__ #define __MY_OBJECT_H__ #include #include typedef struct MyObject MyObject; typedef struct MyObjectClass MyObjectClass; void my_object_register_marshallers (void); GType my_object_get_type (void); struct MyObject { GObject parent; GError *saved_error; char *this_is_a_string; guint notouching; guint val; gdouble super_studly; gboolean should_be_hidden; }; struct MyObjectClass { GObjectClass parent; }; #define MY_TYPE_OBJECT (my_object_get_type ()) #define MY_OBJECT(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), MY_TYPE_OBJECT, MyObject)) #define MY_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MY_TYPE_OBJECT, MyObjectClass)) #define MY_IS_OBJECT(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), MY_TYPE_OBJECT)) #define MY_IS_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MY_TYPE_OBJECT)) #define MY_OBJECT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MY_TYPE_OBJECT, MyObjectClass)) typedef enum { MY_OBJECT_ERROR_FOO, MY_OBJECT_ERROR_BAR, MY_OBJECT_ERROR_MULTI_WORD, MY_OBJECT_ERROR_UNDER_SCORE } MyObjectError; #define MY_OBJECT_ERROR (my_object_error_quark ()) #define MY_TYPE_ERROR (my_object_error_get_type ()) GQuark my_object_error_quark (void); GType my_object_error_get_type (void); gboolean my_object_do_nothing (MyObject *obj, GError **error); gboolean my_object_increment (MyObject *obj, gint32 x, gint32 *ret, GError **error); gint32 my_object_increment_retval (MyObject *obj, gint32 x); gint32 my_object_increment_retval_error (MyObject *obj, gint32 x, GError **error); gboolean my_object_throw_error (MyObject *obj, GError **error); gboolean my_object_throw_not_supported (MyObject *obj, GError **error); gboolean my_object_throw_error_multi_word (MyObject *obj, GError **error); gboolean my_object_throw_unregistered_error (MyObject *obj, GError **error); gboolean my_object_uppercase (MyObject *obj, const char *str, char **ret, GError **error); gboolean my_object_many_args (MyObject *obj, guint32 x, const char *str, double trouble, double *d_ret, char **str_ret, GError **error); gboolean my_object_many_return (MyObject *obj, guint32 *arg0, char **arg1, gint32 *arg2, guint32 *arg3, guint32 *arg4, const char **arg5, GError **error); gboolean my_object_recursive1 (MyObject *obj, GArray *array, guint32 *len_ret, GError **error); gboolean my_object_recursive2 (MyObject *obj, guint32 reqlen, GArray **array, GError **error); gboolean my_object_many_stringify (MyObject *obj, GHashTable *vals, GHashTable **ret, GError **error); gboolean my_object_rec_arrays (MyObject *obj, GPtrArray *in, GPtrArray **ret, GError **error); gboolean my_object_objpath (MyObject *obj, const char *in, const char **arg1, GError **error); gboolean my_object_get_objs (MyObject *obj, GPtrArray **objs, GError **error); gboolean my_object_stringify (MyObject *obj, GValue *value, char **ret, GError **error); gboolean my_object_unstringify (MyObject *obj, const char *str, GValue *value, GError **error); gboolean my_object_many_uppercase (MyObject *obj, const char * const *in, char ***out, GError **error); gboolean my_object_str_hash_len (MyObject *obj, GHashTable *table, guint *len, GError **error); gboolean my_object_send_car (MyObject *obj, GValueArray *invals, GValueArray **outvals, GError **error); gboolean my_object_get_hash (MyObject *obj, GHashTable **table, GError **error); gboolean my_object_increment_val (MyObject *obj, GError **error); gboolean my_object_get_val (MyObject *obj, guint *ret, GError **error); gboolean my_object_get_value (MyObject *obj, guint *ret, GError **error); gboolean my_object_emit_signals (MyObject *obj, GError **error); gboolean my_object_emit_signal2 (MyObject *obj, GError **error); gboolean my_object_emit_frobnicate (MyObject *obj, GError **error); gboolean my_object_echo_variant (MyObject *obj, GValue *variant, GValue *ret, GError **error); gboolean my_object_echo_signature (MyObject *obj, const gchar *in, gchar **out, GError **error); gboolean my_object_process_variant_of_array_of_ints123 (MyObject *obj, GValue *variant, GError **error); gboolean my_object_dict_of_dicts (MyObject *obj, GHashTable *dict, GHashTable **ret, GError **error); void my_object_dict_of_sigs (MyObject *obj, GHashTable *dict, DBusGMethodInvocation *ctx); void my_object_dict_of_objs (MyObject *obj, GHashTable *dict, DBusGMethodInvocation *ctx); gboolean my_object_terminate (MyObject *obj, GError **error); void my_object_async_increment (MyObject *obj, gint32 x, DBusGMethodInvocation *context); void my_object_async_throw_error (MyObject *obj, DBusGMethodInvocation *context); void my_object_unsafe_disable_legacy_property_access (MyObject *obj); void my_object_emit_objectified (MyObject *obj, GObject *other); /* Not a D-Bus method. */ void my_object_save_error (MyObject *obj, GQuark domain, gint code, const gchar *message); #endif dbus-glib-0.100.2/test/core/error-mapping.c0000644000175000017500000002105612107524614015306 00000000000000/* Feature test for exported object methods raising errors * * Copyright © 2006-2010 Red Hat, Inc. * Copyright © 2006-2010 Collabora Ltd. * Copyright © 2006-2011 Nokia Corporation * Copyright © 2006 Steve Frécinaux * * Licensed under the Academic Free License version 2.1 * * 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 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include #include #include #include #include #include #include #include "my-object.h" #include "test-service-glib-bindings.h" /* my-object wants this to exist */ GMainLoop *loop = NULL; typedef struct { GError *error; gchar *error_name; DBusGConnection *conn; DBusGProxy *proxy; GObject *object; } Fixture; #define assert_contains(haystack, needle) \ assert_contains_impl (__FILE__, __LINE__, G_STRINGIFY (haystack), haystack, \ G_STRINGIFY (needle), needle) static void assert_contains_impl (const gchar *file, gint line, const gchar *haystack_desc, const gchar *haystack, const gchar *needle_desc, const gchar *needle) { if (G_UNLIKELY (strstr (haystack, needle) == NULL)) { g_error ("%s:%d: assertion failed: (%s) contains (%s): " "values are \"%s\", \"%s\"", file, line, haystack_desc, needle_desc, haystack, needle); } } static void setup (Fixture *f, gconstpointer context) { static gsize once = 0; dbus_g_type_specialized_init (); if (g_once_init_enter (&once)) { /* this may only be called once */ dbus_g_error_domain_register (MY_OBJECT_ERROR, NULL, MY_TYPE_ERROR); g_once_init_leave (&once, 1); } f->conn = dbus_g_bus_get_private (DBUS_BUS_SESSION, NULL, &f->error); g_assert_no_error (f->error); g_assert (f->conn != NULL); f->object = g_object_new (MY_TYPE_OBJECT, NULL); g_assert (MY_IS_OBJECT (f->object)); dbus_g_connection_register_g_object (f->conn, "/com/example/Test/Object", f->object); f->proxy = dbus_g_proxy_new_for_name (f->conn, dbus_bus_get_unique_name (dbus_g_connection_get_connection (f->conn)), "/com/example/Test/Object", "org.freedesktop.DBus.GLib.Tests.MyObject"); g_assert (f->proxy != NULL); } static void throw_error_cb (DBusGProxy *proxy, GError *error, gpointer user_data) { Fixture *f = user_data; g_assert (error != NULL); g_clear_error (&f->error); g_free (f->error_name); f->error = g_error_copy (error); if (g_error_matches (error, DBUS_GERROR, DBUS_GERROR_REMOTE_EXCEPTION)) f->error_name = g_strdup (dbus_g_error_get_name (error)); else f->error_name = NULL; } static void test_async (Fixture *f, gconstpointer context) { /* This is equivalent to test_simple but uses a method that's implemented * async at the service side - it's a different calling convention for the * service, but is indistinguishable here. */ my_object_save_error ((MyObject *) f->object, MY_OBJECT_ERROR, MY_OBJECT_ERROR_FOO, ""); if (!org_freedesktop_DBus_GLib_Tests_MyObject_async_throw_error_async ( f->proxy, throw_error_cb, f)) g_error ("Failed to start async AsyncThrowError call"); while (f->error == NULL) g_main_context_iteration (NULL, TRUE); g_assert_error (f->error, DBUS_GERROR, DBUS_GERROR_REMOTE_EXCEPTION); g_assert_cmpstr (f->error_name, ==, "org.freedesktop.DBus.GLib.Tests.MyObject.Foo"); assert_contains (f->error->message, ""); } static void test_simple (Fixture *f, gconstpointer context) { my_object_save_error ((MyObject *) f->object, MY_OBJECT_ERROR, MY_OBJECT_ERROR_FOO, ""); if (!org_freedesktop_DBus_GLib_Tests_MyObject_throw_error_async ( f->proxy, throw_error_cb, f)) g_error ("Failed to start async ThrowError call"); while (f->error == NULL) g_main_context_iteration (NULL, TRUE); g_assert_error (f->error, DBUS_GERROR, DBUS_GERROR_REMOTE_EXCEPTION); g_assert_cmpstr (f->error_name, ==, "org.freedesktop.DBus.GLib.Tests.MyObject.Foo"); assert_contains (f->error->message, ""); } static void test_builtin (Fixture *f, gconstpointer context) { g_test_bug ("16776"); my_object_save_error ((MyObject *) f->object, DBUS_GERROR, DBUS_GERROR_NOT_SUPPORTED, ""); if (!org_freedesktop_DBus_GLib_Tests_MyObject_throw_error_async ( f->proxy, throw_error_cb, f)) g_error ("Failed to start async ThrowError call"); while (f->error == NULL) g_main_context_iteration (NULL, TRUE); g_assert_error (f->error, DBUS_GERROR, DBUS_GERROR_NOT_SUPPORTED); assert_contains (f->error->message, ""); } static void test_multi_word (Fixture *f, gconstpointer context) { /* no bug#, but this is a regression test for commit 3d69cfeab177e */ my_object_save_error ((MyObject *) f->object, MY_OBJECT_ERROR, MY_OBJECT_ERROR_MULTI_WORD, "this method's error has a hyphen"); if (!org_freedesktop_DBus_GLib_Tests_MyObject_throw_error_async ( f->proxy, throw_error_cb, f)) g_error ("Failed to start async ThrowError call"); while (f->error == NULL) g_main_context_iteration (NULL, TRUE); g_assert_error (f->error, DBUS_GERROR, DBUS_GERROR_REMOTE_EXCEPTION); g_assert_cmpstr (f->error_name, ==, "org.freedesktop.DBus.GLib.Tests.MyObject.MultiWord"); assert_contains (f->error->message, "this method's error has a hyphen"); } static void test_underscore (Fixture *f, gconstpointer context) { g_test_bug ("30274"); my_object_save_error ((MyObject *) f->object, MY_OBJECT_ERROR, MY_OBJECT_ERROR_UNDER_SCORE, "this method's error has an underscore"); if (!org_freedesktop_DBus_GLib_Tests_MyObject_throw_error_async ( f->proxy, throw_error_cb, f)) g_error ("Failed to start async ThrowError call"); while (f->error == NULL) g_main_context_iteration (NULL, TRUE); g_assert_error (f->error, DBUS_GERROR, DBUS_GERROR_REMOTE_EXCEPTION); g_assert_cmpstr (f->error_name, ==, "org.freedesktop.DBus.GLib.Tests.MyObject.Under_score"); assert_contains (f->error->message, "this method's error has an underscore"); } static void test_unregistered (Fixture *f, gconstpointer context) { g_test_bug ("27799"); my_object_save_error ((MyObject *) f->object, G_IO_ERROR, G_IO_ERROR_NOT_INITIALIZED, "dbus-glib does not know about this error domain"); if (!org_freedesktop_DBus_GLib_Tests_MyObject_throw_error_async ( f->proxy, throw_error_cb, f)) g_error ("Failed to start async ThrowError call"); while (f->error == NULL) g_main_context_iteration (NULL, TRUE); g_assert_error (f->error, DBUS_GERROR, DBUS_GERROR_REMOTE_EXCEPTION); assert_contains (f->error->message, "dbus-glib does not know about this error domain"); } static void teardown (Fixture *f, gconstpointer context G_GNUC_UNUSED) { g_free (f->error_name); g_clear_error (&f->error); if (f->proxy != NULL) { g_object_unref (f->proxy); f->proxy = NULL; } if (f->object != NULL) { g_object_unref (f->object); f->object = NULL; } if (f->conn != NULL) { dbus_connection_close (dbus_g_connection_get_connection (f->conn)); dbus_g_connection_unref (f->conn); f->conn = NULL; } } int main (int argc, char **argv) { g_test_init (&argc, &argv, NULL); g_test_bug_base ("https://bugs.freedesktop.org/show_bug.cgi?id="); g_type_init (); g_test_add ("/error-mapping/async", Fixture, NULL, setup, test_async, teardown); g_test_add ("/error-mapping/builtin", Fixture, NULL, setup, test_builtin, teardown); g_test_add ("/error-mapping/multi-word", Fixture, NULL, setup, test_multi_word, teardown); g_test_add ("/error-mapping/simple", Fixture, NULL, setup, test_simple, teardown); g_test_add ("/error-mapping/underscore", Fixture, NULL, setup, test_underscore, teardown); g_test_add ("/error-mapping/unregistered", Fixture, NULL, setup, test_unregistered, teardown); return g_test_run (); } dbus-glib-0.100.2/test/core/my-object.c0000644000175000017500000005274512112652540014422 00000000000000#include #include #include #include #include "my-object.h" #include "my-object-marshal.h" #include "test-service-glib-glue.h" void my_object_register_marshallers (void) { dbus_g_object_register_marshaller (my_object_marshal_VOID__STRING_INT_STRING, G_TYPE_NONE, G_TYPE_STRING, G_TYPE_INT, G_TYPE_STRING, G_TYPE_INVALID); dbus_g_object_register_marshaller (my_object_marshal_VOID__STRING_BOXED, G_TYPE_NONE, G_TYPE_STRING, G_TYPE_VALUE, G_TYPE_INVALID); } /* Properties */ enum { PROP_0, PROP_THIS_IS_A_STRING, PROP_NO_TOUCHING, PROP_SUPER_STUDLY, PROP_SHOULD_BE_HIDDEN }; enum { FROBNICATE, OBJECTIFIED, SIG0, SIG1, SIG2, LAST_SIGNAL }; static guint signals[LAST_SIGNAL] = { 0 }; G_DEFINE_TYPE(MyObject, my_object, G_TYPE_OBJECT) static void my_object_finalize (GObject *object) { MyObject *mobject = MY_OBJECT (object); g_free (mobject->this_is_a_string); g_clear_error (&mobject->saved_error); (G_OBJECT_CLASS (my_object_parent_class)->finalize) (object); } static void my_object_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) { MyObject *mobject; mobject = MY_OBJECT (object); switch (prop_id) { case PROP_THIS_IS_A_STRING: g_free (mobject->this_is_a_string); mobject->this_is_a_string = g_value_dup_string (value); break; case PROP_NO_TOUCHING: mobject->notouching = g_value_get_uint (value); break; case PROP_SUPER_STUDLY: mobject->super_studly = g_value_get_double (value); break; case PROP_SHOULD_BE_HIDDEN: mobject->should_be_hidden = g_value_get_boolean (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } } static void my_object_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) { MyObject *mobject; mobject = MY_OBJECT (object); switch (prop_id) { case PROP_THIS_IS_A_STRING: g_value_set_string (value, mobject->this_is_a_string); break; case PROP_NO_TOUCHING: g_value_set_uint (value, mobject->notouching); break; case PROP_SUPER_STUDLY: g_value_set_double (value, mobject->super_studly); break; case PROP_SHOULD_BE_HIDDEN: g_value_set_boolean (value, mobject->should_be_hidden); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } } static void my_object_init (MyObject *obj) { obj->val = 0; obj->notouching = 42; obj->saved_error = g_error_new_literal (MY_OBJECT_ERROR, MY_OBJECT_ERROR_FOO, "this method always loses"); } static void my_object_class_init (MyObjectClass *mobject_class) { GObjectClass *gobject_class = G_OBJECT_CLASS (mobject_class); my_object_register_marshallers (); dbus_g_object_type_install_info (MY_TYPE_OBJECT, &dbus_glib_my_object_object_info); gobject_class->finalize = my_object_finalize; gobject_class->set_property = my_object_set_property; gobject_class->get_property = my_object_get_property; g_object_class_install_property (gobject_class, PROP_THIS_IS_A_STRING, g_param_spec_string ("this_is_a_string", _("Sample string"), _("Example of a string property"), "default value", G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_NO_TOUCHING, g_param_spec_uint ("no_touching", _("Don't touch"), _("Example of a readonly property (for export)"), 0, 100, 42, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_SUPER_STUDLY, g_param_spec_double ("super-studly", _("In Studly Caps"), _("Example of a StudlyCaps property"), 0, 256, 128, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_SHOULD_BE_HIDDEN, g_param_spec_boolean ("should-be-hidden", _("A non-exported property"), _("Example of a property we don't want exported"), FALSE, G_PARAM_READWRITE)); signals[FROBNICATE] = g_signal_new ("frobnicate", G_OBJECT_CLASS_TYPE (mobject_class), G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED, 0, NULL, NULL, g_cclosure_marshal_VOID__INT, G_TYPE_NONE, 1, G_TYPE_INT); signals[OBJECTIFIED] = g_signal_new ("objectified", G_OBJECT_CLASS_TYPE (mobject_class), G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED, 0, NULL, NULL, g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1, G_TYPE_OBJECT); signals[SIG0] = g_signal_new ("sig0", G_OBJECT_CLASS_TYPE (mobject_class), G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED, 0, NULL, NULL, my_object_marshal_VOID__STRING_INT_STRING, G_TYPE_NONE, 3, G_TYPE_STRING, G_TYPE_INT, G_TYPE_STRING); signals[SIG1] = g_signal_new ("sig1", G_OBJECT_CLASS_TYPE (mobject_class), G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED, 0, NULL, NULL, my_object_marshal_VOID__STRING_BOXED, G_TYPE_NONE, 2, G_TYPE_STRING, G_TYPE_VALUE); signals[SIG2] = g_signal_new ("sig2", G_OBJECT_CLASS_TYPE (mobject_class), G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED, 0, NULL, NULL, g_cclosure_marshal_VOID__BOXED, G_TYPE_NONE, 1, DBUS_TYPE_G_STRING_STRING_HASHTABLE); } GQuark my_object_error_quark (void) { static GQuark quark = 0; if (!quark) quark = g_quark_from_static_string ("my_object_error"); return quark; } /* This should really be standard. */ #define ENUM_ENTRY(NAME, DESC) { NAME, "" #NAME "", DESC } GType my_object_error_get_type (void) { static GType etype = 0; if (etype == 0) { static const GEnumValue values[] = { ENUM_ENTRY (MY_OBJECT_ERROR_FOO, "Foo"), ENUM_ENTRY (MY_OBJECT_ERROR_BAR, "Bar"), ENUM_ENTRY (MY_OBJECT_ERROR_MULTI_WORD, "Multi-word"), ENUM_ENTRY (MY_OBJECT_ERROR_UNDER_SCORE, "Under_score"), { 0, 0, 0 } }; etype = g_enum_register_static ("MyObjectError", values); } return etype; } gboolean my_object_do_nothing (MyObject *obj, GError **error) { return TRUE; } gboolean my_object_increment (MyObject *obj, gint32 x, gint32 *ret, GError **error) { *ret = x +1; return TRUE; } gint32 my_object_increment_retval (MyObject *obj, gint32 x) { return x + 1; } gint32 my_object_increment_retval_error (MyObject *obj, gint32 x, GError **error) { if (x + 1 > 10) { g_set_error (error, MY_OBJECT_ERROR, MY_OBJECT_ERROR_FOO, "%s", "x is bigger than 9"); return FALSE; } return x + 1; } void my_object_save_error (MyObject *obj, GQuark domain, gint code, const gchar *message) { g_clear_error (&obj->saved_error); g_set_error_literal (&obj->saved_error, domain, code, message); } gboolean my_object_throw_error (MyObject *obj, GError **error) { g_set_error_literal (error, obj->saved_error->domain, obj->saved_error->code, obj->saved_error->message); return FALSE; } gboolean my_object_throw_unregistered_error (MyObject *obj, GError **error) { /* Unregistered errors shouldn't cause a dbus abort. See * https://bugzilla.redhat.com/show_bug.cgi?id=581794 * * This is arguably invalid usage - a domain of 0 (which stringifies * to NULL) is meaningless. (See GNOME#660731.) * * We can't just use my_object_save_error() and ThrowError() for * this, because g_error_new() is stricter about the domain than * g_error_new_valist(). Perhaps this method should be removed entirely, * though. */ g_set_error (error, 0, 0, "%s", "this method always loses more"); return FALSE; } gboolean my_object_uppercase (MyObject *obj, const char *str, char **ret, GError **error) { *ret = g_ascii_strup (str, -1); return TRUE; } gboolean my_object_many_args (MyObject *obj, guint32 x, const char *str, double trouble, double *d_ret, char **str_ret, GError **error) { *d_ret = trouble + (x * 2); *str_ret = g_ascii_strup (str, -1); return TRUE; } gboolean my_object_many_return (MyObject *obj, guint32 *arg0, char **arg1, gint32 *arg2, guint32 *arg3, guint32 *arg4, const char **arg5, GError **error) { *arg0 = 42; *arg1 = g_strdup ("42"); *arg2 = -67; *arg3 = 2; *arg4 = 26; *arg5 = "hello world"; /* Annotation specifies as const */ return TRUE; } gboolean my_object_stringify (MyObject *obj, GValue *value, char **ret, GError **error) { GValue valstr = {0, }; g_value_init (&valstr, G_TYPE_STRING); if (!g_value_transform (value, &valstr)) { g_set_error (error, MY_OBJECT_ERROR, MY_OBJECT_ERROR_FOO, "couldn't transform value"); return FALSE; } *ret = g_value_dup_string (&valstr); g_value_unset (&valstr); return TRUE; } gboolean my_object_unstringify (MyObject *obj, const char *str, GValue *value, GError **error) { if (str[0] == '\0' || !g_ascii_isdigit (str[0])) { g_value_init (value, G_TYPE_STRING); g_value_set_string (value, str); } else { g_value_init (value, G_TYPE_INT); g_value_set_int (value, (int) g_ascii_strtoull (str, NULL, 10)); } return TRUE; } gboolean my_object_recursive1 (MyObject *obj, GArray *array, guint32 *len_ret, GError **error) { *len_ret = array->len; return TRUE; } gboolean my_object_recursive2 (MyObject *obj, guint32 reqlen, GArray **ret, GError **error) { guint32 val; GArray *array; array = g_array_new (FALSE, TRUE, sizeof (guint32)); while (reqlen > 0) { val = 42; g_array_append_val (array, val); val = 26; g_array_append_val (array, val); reqlen--; } val = 2; g_array_append_val (array, val); *ret = array; return TRUE; } gboolean my_object_many_uppercase (MyObject *obj, const char * const *in, char ***out, GError **error) { int len; int i; len = g_strv_length ((char**) in); *out = g_new0 (char *, len + 1); for (i = 0; i < len; i++) { (*out)[i] = g_ascii_strup (in[i], -1); } (*out)[i] = NULL; return TRUE; } static void hash_foreach_stringify (gpointer key, gpointer val, gpointer user_data) { const char *keystr = key; const GValue *value = val; GValue *sval; GHashTable *ret = user_data; sval = g_new0 (GValue, 1); g_value_init (sval, G_TYPE_STRING); if (!g_value_transform (value, sval)) g_assert_not_reached (); g_hash_table_insert (ret, g_strdup (keystr), sval); } static void unset_and_free_gvalue (gpointer val) { g_value_unset (val); g_free (val); } gboolean my_object_many_stringify (MyObject *obj, GHashTable /* char * -> GValue * */ *vals, GHashTable /* char * -> GValue * */ **ret, GError **error) { *ret = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, unset_and_free_gvalue); g_hash_table_foreach (vals, hash_foreach_stringify, *ret); return TRUE; } gboolean my_object_rec_arrays (MyObject *obj, GPtrArray *in, GPtrArray **ret, GError **error) { char **strs; GArray *ints; guint v_UINT; if (in->len != 2) { g_set_error (error, MY_OBJECT_ERROR, MY_OBJECT_ERROR_FOO, "invalid array len"); return FALSE; } strs = g_ptr_array_index (in, 0); if (!*strs || strcmp (*strs, "foo")) { g_set_error (error, MY_OBJECT_ERROR, MY_OBJECT_ERROR_FOO, "invalid string 0"); return FALSE; } strs++; if (!*strs || strcmp (*strs, "bar")) { g_set_error (error, MY_OBJECT_ERROR, MY_OBJECT_ERROR_FOO, "invalid string 1"); return FALSE; } strs++; if (*strs) { g_set_error (error, MY_OBJECT_ERROR, MY_OBJECT_ERROR_FOO, "invalid string array len in pos 0"); return FALSE; } strs = g_ptr_array_index (in, 1); if (!*strs || strcmp (*strs, "baz")) { g_set_error (error, MY_OBJECT_ERROR, MY_OBJECT_ERROR_FOO, "invalid string 0"); return FALSE; } strs++; if (!*strs || strcmp (*strs, "whee")) { g_set_error (error, MY_OBJECT_ERROR, MY_OBJECT_ERROR_FOO, "invalid string 1"); return FALSE; } strs++; if (!*strs || strcmp (*strs, "moo")) { g_set_error (error, MY_OBJECT_ERROR, MY_OBJECT_ERROR_FOO, "invalid string 2"); return FALSE; } strs++; if (*strs) { g_set_error (error, MY_OBJECT_ERROR, MY_OBJECT_ERROR_FOO, "invalid string array len in pos 1"); return FALSE; } *ret = g_ptr_array_new (); ints = g_array_new (TRUE, TRUE, sizeof (guint)); v_UINT = 10; g_array_append_val (ints, v_UINT); v_UINT = 42; g_array_append_val (ints, v_UINT); v_UINT = 27; g_array_append_val (ints, v_UINT); g_ptr_array_add (*ret, ints); ints = g_array_new (TRUE, TRUE, sizeof (guint)); v_UINT = 30; g_array_append_val (ints, v_UINT); g_ptr_array_add (*ret, ints); return TRUE; } gboolean my_object_objpath (MyObject *obj, const char *incoming, const char **outgoing, GError **error) { if (strcmp (incoming, "/org/freedesktop/DBus/GLib/Tests/MyTestObject")) { g_set_error (error, MY_OBJECT_ERROR, MY_OBJECT_ERROR_FOO, "invalid incoming object"); return FALSE; } *outgoing = "/org/freedesktop/DBus/GLib/Tests/MyTestObject2"; return TRUE; } gboolean my_object_get_objs (MyObject *obj, GPtrArray **objs, GError **error) { *objs = g_ptr_array_new (); g_ptr_array_add (*objs, g_strdup ("/org/freedesktop/DBus/GLib/Tests/MyTestObject")); g_ptr_array_add (*objs, g_strdup ("/org/freedesktop/DBus/GLib/Tests/MyTestObject2")); return TRUE; } static void hash_foreach (gpointer key, gpointer val, gpointer user_data) { const char *keystr = key; const char *valstr = val; guint *count = user_data; *count += (strlen (keystr) + strlen (valstr)); g_print ("%s -> %s\n", keystr, valstr); } gboolean my_object_str_hash_len (MyObject *obj, GHashTable *table, guint *len, GError **error) { *len = 0; g_hash_table_foreach (table, hash_foreach, len); return TRUE; } gboolean my_object_send_car (MyObject *obj, GValueArray *invals, GValueArray **outvals, GError **error) { if (invals->n_values != 3 || G_VALUE_TYPE (g_value_array_get_nth (invals, 0)) != G_TYPE_STRING || G_VALUE_TYPE (g_value_array_get_nth (invals, 1)) != G_TYPE_UINT || G_VALUE_TYPE (g_value_array_get_nth (invals, 2)) != G_TYPE_VALUE) { g_set_error (error, MY_OBJECT_ERROR, MY_OBJECT_ERROR_FOO, "invalid incoming values"); return FALSE; } *outvals = g_value_array_new (2); g_value_array_append (*outvals, NULL); g_value_init (g_value_array_get_nth (*outvals, (*outvals)->n_values - 1), G_TYPE_UINT); g_value_set_uint (g_value_array_get_nth (*outvals, (*outvals)->n_values - 1), g_value_get_uint (g_value_array_get_nth (invals, 1)) + 1); g_value_array_append (*outvals, NULL); g_value_init (g_value_array_get_nth (*outvals, (*outvals)->n_values - 1), DBUS_TYPE_G_OBJECT_PATH); g_value_set_boxed (g_value_array_get_nth (*outvals, (*outvals)->n_values - 1), g_strdup ("/org/freedesktop/DBus/GLib/Tests/MyTestObject2")); return TRUE; } gboolean my_object_get_hash (MyObject *obj, GHashTable **ret, GError **error) { GHashTable *table; table = g_hash_table_new (g_str_hash, g_str_equal); g_hash_table_insert (table, "foo", "bar"); g_hash_table_insert (table, "baz", "whee"); g_hash_table_insert (table, "cow", "crack"); *ret = table; return TRUE; } gboolean my_object_increment_val (MyObject *obj, GError **error) { obj->val++; return TRUE; } gboolean my_object_get_val (MyObject *obj, guint *ret, GError **error) { *ret = obj->val; return TRUE; } gboolean my_object_get_value (MyObject *obj, guint *ret, GError **error) { *ret = obj->val; return TRUE; } gboolean my_object_echo_variant (MyObject *obj, GValue *variant, GValue *ret, GError **error) { GType t; t = G_VALUE_TYPE(variant); g_value_init (ret, t); g_value_copy (variant, ret); return TRUE; } gboolean my_object_echo_signature (MyObject *obj, const gchar *in, gchar **out, GError **error) { *out = g_strdup (in); return TRUE; } gboolean my_object_process_variant_of_array_of_ints123 (MyObject *obj, GValue *variant, GError **error) { GArray *array; int i; int j; j = 0; array = (GArray *)g_value_get_boxed (variant); for (i = 0; i <= 2; i++) { j = g_array_index (array, int, i); if (j != i + 1) goto error; } return TRUE; error: *error = g_error_new (MY_OBJECT_ERROR, MY_OBJECT_ERROR_FOO, "Error decoding a variant of type ai (i + 1 = %i, j = %i)", i, j + 1); return FALSE; } typedef struct _HashAndString HashAndString; struct _HashAndString { GHashTable *hash; gchar* string; }; static void hash_foreach_prepend_string (gpointer key, gpointer val, gpointer user_data) { HashAndString *data = (HashAndString*) user_data; gchar *in = (gchar*) val; g_hash_table_insert (data->hash, g_strdup ((gchar*) key), g_strjoin (" ", data->string, in, NULL)); } static void hash_foreach_mangle_dict_of_strings (gpointer key, gpointer val, gpointer user_data) { GHashTable *out = (GHashTable*) user_data; GHashTable *in_dict = (GHashTable *) val; HashAndString *data = g_new0 (HashAndString, 1); data->string = (gchar*) key; data->hash = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free); g_hash_table_foreach (in_dict, hash_foreach_prepend_string, data); g_hash_table_insert(out, g_strdup ((gchar*) key), data->hash); } gboolean my_object_dict_of_dicts (MyObject *obj, GHashTable *in, GHashTable **out, GError **error) { *out = g_hash_table_new_full (g_str_hash, g_str_equal, (GDestroyNotify) g_free, (GDestroyNotify) g_hash_table_destroy); g_hash_table_foreach (in, hash_foreach_mangle_dict_of_strings, *out); return TRUE; } void my_object_dict_of_sigs (MyObject *obj, GHashTable *dict, DBusGMethodInvocation *context) { dbus_g_method_return (context, dict); } void my_object_dict_of_objs (MyObject *obj, GHashTable *dict, DBusGMethodInvocation *context) { dbus_g_method_return (context, dict); } gboolean my_object_emit_frobnicate (MyObject *obj, GError **error) { g_signal_emit (obj, signals[FROBNICATE], 0, 42); return TRUE; } gboolean my_object_emit_signals (MyObject *obj, GError **error) { GValue val = {0, }; g_signal_emit (obj, signals[SIG0], 0, "foo", 22, "moo"); g_value_init (&val, G_TYPE_STRING); g_value_set_string (&val, "bar"); g_signal_emit (obj, signals[SIG1], 0, "baz", &val); g_value_unset (&val); return TRUE; } gboolean my_object_emit_signal2 (MyObject *obj, GError **error) { GHashTable *table; table = g_hash_table_new (g_str_hash, g_str_equal); g_hash_table_insert (table, "baz", "cow"); g_hash_table_insert (table, "bar", "foo"); g_signal_emit (obj, signals[SIG2], 0, table); g_hash_table_destroy (table); return TRUE; } typedef struct { gint32 x; DBusGMethodInvocation *context; } IncrementData; static gboolean do_async_increment (IncrementData *data) { gint32 newx = data->x + 1; dbus_g_method_return (data->context, newx); g_free (data); return FALSE; } void my_object_async_increment (MyObject *obj, gint32 x, DBusGMethodInvocation *context) { IncrementData *data = g_new0 (IncrementData, 1); data->x = x; data->context = context; g_idle_add ((GSourceFunc)do_async_increment, data); } typedef struct { GError *error; DBusGMethodInvocation *context; } ErrorData; static gboolean do_async_error (ErrorData *data) { dbus_g_method_return_error (data->context, data->error); g_error_free (data->error); g_free (data); return FALSE; } void my_object_async_throw_error (MyObject *obj, DBusGMethodInvocation *context) { ErrorData *data = g_new0 (ErrorData, 1); data->error = g_error_copy (obj->saved_error); data->context = context; g_idle_add ((GSourceFunc) do_async_error, data); } void my_object_unsafe_disable_legacy_property_access (MyObject *obj) { dbus_glib_global_set_disable_legacy_property_access (); } extern GMainLoop *loop; gboolean my_object_terminate (MyObject *obj, GError **error) { g_main_loop_quit (loop); return TRUE; } void my_object_emit_objectified (MyObject *obj, GObject *other) { g_signal_emit (obj, signals[OBJECTIFIED], 0, other); } dbus-glib-0.100.2/test/core/Makefile.in0000644000175000017500000011550112112653462014424 00000000000000# 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@ @DBUS_BUILD_TESTS_TRUE@TESTS = run-test.sh run-peer-test.sh @DBUS_BUILD_TESTS_FALSE@@HAVE_GLIB_THREADS_TRUE@noinst_PROGRAMS = test-profile$(EXEEXT) @DBUS_BUILD_TESTS_TRUE@noinst_PROGRAMS = test-dbus-glib$(EXEEXT) \ @DBUS_BUILD_TESTS_TRUE@ test-error-mapping$(EXEEXT) \ @DBUS_BUILD_TESTS_TRUE@ test-service-glib$(EXEEXT) \ @DBUS_BUILD_TESTS_TRUE@ $(am__EXEEXT_1) peer-server$(EXEEXT) \ @DBUS_BUILD_TESTS_TRUE@ peer-client$(EXEEXT) \ @DBUS_BUILD_TESTS_TRUE@ test-types$(EXEEXT) test-30574$(EXEEXT) \ @DBUS_BUILD_TESTS_TRUE@ test-peer-on-bus$(EXEEXT) \ @DBUS_BUILD_TESTS_TRUE@ test-proxy-peer$(EXEEXT) \ @DBUS_BUILD_TESTS_TRUE@ test-registrations$(EXEEXT) \ @DBUS_BUILD_TESTS_TRUE@ test-variant-recursion$(EXEEXT) \ @DBUS_BUILD_TESTS_TRUE@ test-gvariant$(EXEEXT) subdir = test/core 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)/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 = @DBUS_BUILD_TESTS_TRUE@@HAVE_GLIB_THREADS_TRUE@am__EXEEXT_1 = test-thread-server$(EXEEXT) \ @DBUS_BUILD_TESTS_TRUE@@HAVE_GLIB_THREADS_TRUE@ test-thread-client$(EXEEXT) \ @DBUS_BUILD_TESTS_TRUE@@HAVE_GLIB_THREADS_TRUE@ test-profile$(EXEEXT) PROGRAMS = $(noinst_PROGRAMS) am__peer_client_SOURCES_DIST = peer-client.c @DBUS_BUILD_TESTS_TRUE@am_peer_client_OBJECTS = peer-client.$(OBJEXT) peer_client_OBJECTS = $(am_peer_client_OBJECTS) peer_client_LDADD = $(LDADD) am__DEPENDENCIES_1 = peer_client_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(top_builddir)/dbus/libdbus-glib-1.la \ $(top_builddir)/test/lib/libtest.la AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__peer_server_SOURCES_DIST = my-object.c my-object.h \ my-object-subclass.c my-object-subclass.h my-object-marshal.c \ peer-server.c @DBUS_BUILD_TESTS_TRUE@am_peer_server_OBJECTS = my-object.$(OBJEXT) \ @DBUS_BUILD_TESTS_TRUE@ my-object-subclass.$(OBJEXT) \ @DBUS_BUILD_TESTS_TRUE@ my-object-marshal.$(OBJEXT) \ @DBUS_BUILD_TESTS_TRUE@ peer-server.$(OBJEXT) peer_server_OBJECTS = $(am_peer_server_OBJECTS) peer_server_LDADD = $(LDADD) peer_server_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(top_builddir)/dbus/libdbus-glib-1.la \ $(top_builddir)/test/lib/libtest.la am__test_30574_SOURCES_DIST = 30574.c @DBUS_BUILD_TESTS_TRUE@am_test_30574_OBJECTS = 30574.$(OBJEXT) test_30574_OBJECTS = $(am_test_30574_OBJECTS) test_30574_LDADD = $(LDADD) test_30574_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(top_builddir)/dbus/libdbus-glib-1.la \ $(top_builddir)/test/lib/libtest.la am__test_dbus_glib_SOURCES_DIST = my-object.c my-object.h \ my-object-marshal.c test-dbus-glib.c @DBUS_BUILD_TESTS_TRUE@am_test_dbus_glib_OBJECTS = \ @DBUS_BUILD_TESTS_TRUE@ my-object.$(OBJEXT) \ @DBUS_BUILD_TESTS_TRUE@ my-object-marshal.$(OBJEXT) \ @DBUS_BUILD_TESTS_TRUE@ test-dbus-glib.$(OBJEXT) test_dbus_glib_OBJECTS = $(am_test_dbus_glib_OBJECTS) am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(top_builddir)/dbus/libdbus-glib-1.la \ $(top_builddir)/test/lib/libtest.la am__DEPENDENCIES_3 = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) \ $(top_builddir)/dbus/libdbus-gtool.la @DBUS_BUILD_TESTS_TRUE@test_dbus_glib_DEPENDENCIES = \ @DBUS_BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_3) am__test_error_mapping_SOURCES_DIST = my-object.c my-object.h \ my-object-marshal.c error-mapping.c @DBUS_BUILD_TESTS_TRUE@am_test_error_mapping_OBJECTS = \ @DBUS_BUILD_TESTS_TRUE@ my-object.$(OBJEXT) \ @DBUS_BUILD_TESTS_TRUE@ my-object-marshal.$(OBJEXT) \ @DBUS_BUILD_TESTS_TRUE@ error-mapping.$(OBJEXT) test_error_mapping_OBJECTS = $(am_test_error_mapping_OBJECTS) test_error_mapping_LDADD = $(LDADD) test_error_mapping_DEPENDENCIES = $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(top_builddir)/dbus/libdbus-glib-1.la \ $(top_builddir)/test/lib/libtest.la am__test_gvariant_SOURCES_DIST = test-gvariant.c @DBUS_BUILD_TESTS_TRUE@am_test_gvariant_OBJECTS = \ @DBUS_BUILD_TESTS_TRUE@ test-gvariant.$(OBJEXT) test_gvariant_OBJECTS = $(am_test_gvariant_OBJECTS) test_gvariant_LDADD = $(LDADD) test_gvariant_DEPENDENCIES = $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(top_builddir)/dbus/libdbus-glib-1.la \ $(top_builddir)/test/lib/libtest.la am__test_peer_on_bus_SOURCES_DIST = peer-on-bus.c @DBUS_BUILD_TESTS_TRUE@am_test_peer_on_bus_OBJECTS = \ @DBUS_BUILD_TESTS_TRUE@ peer-on-bus.$(OBJEXT) test_peer_on_bus_OBJECTS = $(am_test_peer_on_bus_OBJECTS) test_peer_on_bus_LDADD = $(LDADD) test_peer_on_bus_DEPENDENCIES = $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(top_builddir)/dbus/libdbus-glib-1.la \ $(top_builddir)/test/lib/libtest.la am__test_profile_SOURCES_DIST = test-profile.c @HAVE_GLIB_THREADS_TRUE@am_test_profile_OBJECTS = \ @HAVE_GLIB_THREADS_TRUE@ test-profile.$(OBJEXT) test_profile_OBJECTS = $(am_test_profile_OBJECTS) test_profile_LDADD = $(LDADD) test_profile_DEPENDENCIES = $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(top_builddir)/dbus/libdbus-glib-1.la \ $(top_builddir)/test/lib/libtest.la am__test_proxy_peer_SOURCES_DIST = my-object-marshal.c my-object.c \ my-object.h proxy-peer.c @DBUS_BUILD_TESTS_TRUE@am_test_proxy_peer_OBJECTS = \ @DBUS_BUILD_TESTS_TRUE@ my-object-marshal.$(OBJEXT) \ @DBUS_BUILD_TESTS_TRUE@ my-object.$(OBJEXT) \ @DBUS_BUILD_TESTS_TRUE@ proxy-peer.$(OBJEXT) test_proxy_peer_OBJECTS = $(am_test_proxy_peer_OBJECTS) test_proxy_peer_LDADD = $(LDADD) test_proxy_peer_DEPENDENCIES = $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(top_builddir)/dbus/libdbus-glib-1.la \ $(top_builddir)/test/lib/libtest.la am__test_registrations_SOURCES_DIST = my-object.c my-object.h \ my-object-subclass.c my-object-subclass.h my-object-marshal.c \ registrations.c @DBUS_BUILD_TESTS_TRUE@am_test_registrations_OBJECTS = \ @DBUS_BUILD_TESTS_TRUE@ my-object.$(OBJEXT) \ @DBUS_BUILD_TESTS_TRUE@ my-object-subclass.$(OBJEXT) \ @DBUS_BUILD_TESTS_TRUE@ my-object-marshal.$(OBJEXT) \ @DBUS_BUILD_TESTS_TRUE@ registrations.$(OBJEXT) test_registrations_OBJECTS = $(am_test_registrations_OBJECTS) test_registrations_LDADD = $(LDADD) test_registrations_DEPENDENCIES = $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(top_builddir)/dbus/libdbus-glib-1.la \ $(top_builddir)/test/lib/libtest.la am__test_service_glib_SOURCES_DIST = my-object.c my-object.h \ my-object-subclass.c my-object-subclass.h my-object-marshal.c \ test-service-glib.c @DBUS_BUILD_TESTS_TRUE@am_test_service_glib_OBJECTS = \ @DBUS_BUILD_TESTS_TRUE@ my-object.$(OBJEXT) \ @DBUS_BUILD_TESTS_TRUE@ my-object-subclass.$(OBJEXT) \ @DBUS_BUILD_TESTS_TRUE@ my-object-marshal.$(OBJEXT) \ @DBUS_BUILD_TESTS_TRUE@ test-service-glib.$(OBJEXT) test_service_glib_OBJECTS = $(am_test_service_glib_OBJECTS) test_service_glib_LDADD = $(LDADD) test_service_glib_DEPENDENCIES = $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(top_builddir)/dbus/libdbus-glib-1.la \ $(top_builddir)/test/lib/libtest.la am__test_thread_client_SOURCES_DIST = test-thread-client.c \ test-thread.h @DBUS_BUILD_TESTS_TRUE@@HAVE_GLIB_THREADS_TRUE@am_test_thread_client_OBJECTS = test-thread-client.$(OBJEXT) test_thread_client_OBJECTS = $(am_test_thread_client_OBJECTS) test_thread_client_LDADD = $(LDADD) test_thread_client_DEPENDENCIES = $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(top_builddir)/dbus/libdbus-glib-1.la \ $(top_builddir)/test/lib/libtest.la am__test_thread_server_SOURCES_DIST = test-thread-server.c \ test-thread.h @DBUS_BUILD_TESTS_TRUE@@HAVE_GLIB_THREADS_TRUE@am_test_thread_server_OBJECTS = test-thread-server.$(OBJEXT) test_thread_server_OBJECTS = $(am_test_thread_server_OBJECTS) test_thread_server_LDADD = $(LDADD) test_thread_server_DEPENDENCIES = $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(top_builddir)/dbus/libdbus-glib-1.la \ $(top_builddir)/test/lib/libtest.la am__test_types_SOURCES_DIST = test-types.c @DBUS_BUILD_TESTS_TRUE@am_test_types_OBJECTS = test-types.$(OBJEXT) test_types_OBJECTS = $(am_test_types_OBJECTS) test_types_LDADD = $(LDADD) test_types_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(top_builddir)/dbus/libdbus-glib-1.la \ $(top_builddir)/test/lib/libtest.la am__test_variant_recursion_SOURCES_DIST = test-variant-recursion.c @DBUS_BUILD_TESTS_TRUE@am_test_variant_recursion_OBJECTS = \ @DBUS_BUILD_TESTS_TRUE@ test-variant-recursion.$(OBJEXT) test_variant_recursion_OBJECTS = $(am_test_variant_recursion_OBJECTS) @DBUS_BUILD_TESTS_TRUE@test_variant_recursion_DEPENDENCIES = \ @DBUS_BUILD_TESTS_TRUE@ $(am__DEPENDENCIES_3) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/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 = $(peer_client_SOURCES) $(peer_server_SOURCES) \ $(test_30574_SOURCES) $(test_dbus_glib_SOURCES) \ $(test_error_mapping_SOURCES) $(test_gvariant_SOURCES) \ $(test_peer_on_bus_SOURCES) $(test_profile_SOURCES) \ $(test_proxy_peer_SOURCES) $(test_registrations_SOURCES) \ $(test_service_glib_SOURCES) $(test_thread_client_SOURCES) \ $(test_thread_server_SOURCES) $(test_types_SOURCES) \ $(test_variant_recursion_SOURCES) DIST_SOURCES = $(am__peer_client_SOURCES_DIST) \ $(am__peer_server_SOURCES_DIST) $(am__test_30574_SOURCES_DIST) \ $(am__test_dbus_glib_SOURCES_DIST) \ $(am__test_error_mapping_SOURCES_DIST) \ $(am__test_gvariant_SOURCES_DIST) \ $(am__test_peer_on_bus_SOURCES_DIST) \ $(am__test_profile_SOURCES_DIST) \ $(am__test_proxy_peer_SOURCES_DIST) \ $(am__test_registrations_SOURCES_DIST) \ $(am__test_service_glib_SOURCES_DIST) \ $(am__test_thread_client_SOURCES_DIST) \ $(am__test_thread_server_SOURCES_DIST) \ $(am__test_types_SOURCES_DIST) \ $(am__test_variant_recursion_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 am__tty_colors = \ red=; grn=; lgn=; blu=; std= DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ABSOLUTE_TOP_BUILDDIR = @ABSOLUTE_TOP_BUILDDIR@ ACLOCAL = @ACLOCAL@ 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@ CYGPATH_W = @CYGPATH_W@ DBUS_BINDING_TOOL = @DBUS_BINDING_TOOL@ DBUS_CFLAGS = @DBUS_CFLAGS@ DBUS_GLIB_CFLAGS = @DBUS_GLIB_CFLAGS@ DBUS_GLIB_LIBS = @DBUS_GLIB_LIBS@ DBUS_GLIB_THREADS_CFLAGS = @DBUS_GLIB_THREADS_CFLAGS@ DBUS_GLIB_THREADS_LIBS = @DBUS_GLIB_THREADS_LIBS@ DBUS_GLIB_TOOL_CFLAGS = @DBUS_GLIB_TOOL_CFLAGS@ DBUS_GLIB_TOOL_LIBS = @DBUS_GLIB_TOOL_LIBS@ DBUS_LIBS = @DBUS_LIBS@ DBUS_PATH_OR_ABSTRACT = @DBUS_PATH_OR_ABSTRACT@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ EXPANDED_BINDIR = @EXPANDED_BINDIR@ EXPANDED_DATADIR = @EXPANDED_DATADIR@ EXPANDED_LIBDIR = @EXPANDED_LIBDIR@ EXPANDED_LOCALSTATEDIR = @EXPANDED_LOCALSTATEDIR@ EXPANDED_SYSCONFDIR = @EXPANDED_SYSCONFDIR@ FGREP = @FGREP@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GREP = @GREP@ GTKDOC_CHECK = @GTKDOC_CHECK@ 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@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_REVISION = @LT_REVISION@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ 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@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TEST_CORE_SERVICE_BINARY = @TEST_CORE_SERVICE_BINARY@ TEST_EXIT_BINARY = @TEST_EXIT_BINARY@ TEST_INTERFACES_SERVICE_BINARY = @TEST_INTERFACES_SERVICE_BINARY@ TEST_SEGFAULT_BINARY = @TEST_SEGFAULT_BINARY@ TEST_SERVICE_BINARY = @TEST_SERVICE_BINARY@ TEST_SERVICE_DIR = @TEST_SERVICE_DIR@ TEST_SHELL_SERVICE_BINARY = @TEST_SHELL_SERVICE_BINARY@ TEST_SLEEP_FOREVER_BINARY = @TEST_SLEEP_FOREVER_BINARY@ TEST_SOCKET_DIR = @TEST_SOCKET_DIR@ VERSION = @VERSION@ 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_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@ 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@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ 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 = \ -I$(top_srcdir) \ -I$(top_srcdir)/dbus \ -I$(top_builddir) \ -I$(top_builddir)/dbus \ $(DBUS_CFLAGS) \ $(DBUS_GLIB_CFLAGS) \ -DDBUS_COMPILATION LDADD = \ $(DBUS_GLIB_THREADS_LIBS) \ $(DBUS_GLIB_LIBS) \ $(DBUS_LIBS) \ $(top_builddir)/dbus/libdbus-glib-1.la \ $(top_builddir)/test/lib/libtest.la \ $(NULL) tool_ldadd = \ $(LDADD) \ $(DBUS_GLIB_TOOL_LIBS) \ $(top_builddir)/dbus/libdbus-gtool.la @DBUS_BUILD_TESTS_TRUE@TESTS_ENVIRONMENT = DBUS_TOP_BUILDDIR=$(ABSOLUTE_TOP_BUILDDIR) EXTRA_DIST = run-test.sh run-peer-test.sh test-service-glib.xml my-object-marshal.list test-service-glib-subclass.xml @DBUS_BUILD_TESTS_TRUE@@HAVE_GLIB_THREADS_TRUE@THREAD_APPS = test-thread-server test-thread-client test-profile @DBUS_BUILD_TESTS_TRUE@@HAVE_GLIB_THREADS_TRUE@test_thread_server_SOURCES = \ @DBUS_BUILD_TESTS_TRUE@@HAVE_GLIB_THREADS_TRUE@ test-thread-server.c \ @DBUS_BUILD_TESTS_TRUE@@HAVE_GLIB_THREADS_TRUE@ test-thread.h @DBUS_BUILD_TESTS_TRUE@@HAVE_GLIB_THREADS_TRUE@test_thread_client_SOURCES = \ @DBUS_BUILD_TESTS_TRUE@@HAVE_GLIB_THREADS_TRUE@ test-thread-client.c \ @DBUS_BUILD_TESTS_TRUE@@HAVE_GLIB_THREADS_TRUE@ test-thread.h @DBUS_BUILD_TESTS_TRUE@test_30574_SOURCES = \ @DBUS_BUILD_TESTS_TRUE@ 30574.c @DBUS_BUILD_TESTS_TRUE@test_proxy_peer_SOURCES = \ @DBUS_BUILD_TESTS_TRUE@ my-object-marshal.c \ @DBUS_BUILD_TESTS_TRUE@ my-object.c \ @DBUS_BUILD_TESTS_TRUE@ my-object.h \ @DBUS_BUILD_TESTS_TRUE@ proxy-peer.c @DBUS_BUILD_TESTS_TRUE@test_registrations_SOURCES = \ @DBUS_BUILD_TESTS_TRUE@ my-object.c \ @DBUS_BUILD_TESTS_TRUE@ my-object.h \ @DBUS_BUILD_TESTS_TRUE@ my-object-subclass.c \ @DBUS_BUILD_TESTS_TRUE@ my-object-subclass.h \ @DBUS_BUILD_TESTS_TRUE@ my-object-marshal.c \ @DBUS_BUILD_TESTS_TRUE@ registrations.c @DBUS_BUILD_TESTS_TRUE@test_dbus_glib_SOURCES = \ @DBUS_BUILD_TESTS_TRUE@ my-object.c \ @DBUS_BUILD_TESTS_TRUE@ my-object.h \ @DBUS_BUILD_TESTS_TRUE@ my-object-marshal.c \ @DBUS_BUILD_TESTS_TRUE@ test-dbus-glib.c @DBUS_BUILD_TESTS_TRUE@test_dbus_glib_LDADD = $(tool_ldadd) @DBUS_BUILD_TESTS_TRUE@test_error_mapping_SOURCES = \ @DBUS_BUILD_TESTS_TRUE@ my-object.c \ @DBUS_BUILD_TESTS_TRUE@ my-object.h \ @DBUS_BUILD_TESTS_TRUE@ my-object-marshal.c \ @DBUS_BUILD_TESTS_TRUE@ error-mapping.c @DBUS_BUILD_TESTS_TRUE@test_variant_recursion_SOURCES = test-variant-recursion.c @DBUS_BUILD_TESTS_TRUE@test_variant_recursion_LDADD = $(tool_ldadd) @DBUS_BUILD_TESTS_TRUE@BUILT_SOURCES = test-service-glib-glue.h test-service-glib-subclass-glue.h test-service-glib-bindings.h my-object-marshal.c my-object-marshal.h @DBUS_BUILD_TESTS_TRUE@test_service_glib_SOURCES = \ @DBUS_BUILD_TESTS_TRUE@ my-object.c \ @DBUS_BUILD_TESTS_TRUE@ my-object.h \ @DBUS_BUILD_TESTS_TRUE@ my-object-subclass.c \ @DBUS_BUILD_TESTS_TRUE@ my-object-subclass.h \ @DBUS_BUILD_TESTS_TRUE@ my-object-marshal.c \ @DBUS_BUILD_TESTS_TRUE@ test-service-glib.c @DBUS_BUILD_TESTS_TRUE@peer_server_SOURCES = \ @DBUS_BUILD_TESTS_TRUE@ my-object.c \ @DBUS_BUILD_TESTS_TRUE@ my-object.h \ @DBUS_BUILD_TESTS_TRUE@ my-object-subclass.c \ @DBUS_BUILD_TESTS_TRUE@ my-object-subclass.h \ @DBUS_BUILD_TESTS_TRUE@ my-object-marshal.c \ @DBUS_BUILD_TESTS_TRUE@ peer-server.c @DBUS_BUILD_TESTS_TRUE@peer_client_SOURCES = \ @DBUS_BUILD_TESTS_TRUE@ peer-client.c @DBUS_BUILD_TESTS_TRUE@test_types_SOURCES = \ @DBUS_BUILD_TESTS_TRUE@ test-types.c @DBUS_BUILD_TESTS_TRUE@test_gvariant_SOURCES = \ @DBUS_BUILD_TESTS_TRUE@ test-gvariant.c @DBUS_BUILD_TESTS_TRUE@test_peer_on_bus_SOURCES = peer-on-bus.c @DBUS_BUILD_TESTS_TRUE@CLEANFILES = \ @DBUS_BUILD_TESTS_TRUE@ $(BUILT_SOURCES) \ @DBUS_BUILD_TESTS_TRUE@ run-with-tmp-session-bus.conf @HAVE_GLIB_THREADS_TRUE@test_profile_SOURCES = \ @HAVE_GLIB_THREADS_TRUE@ test-profile.c all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(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 test/core/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu test/core/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: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(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 peer-client$(EXEEXT): $(peer_client_OBJECTS) $(peer_client_DEPENDENCIES) $(EXTRA_peer_client_DEPENDENCIES) @rm -f peer-client$(EXEEXT) $(AM_V_CCLD)$(LINK) $(peer_client_OBJECTS) $(peer_client_LDADD) $(LIBS) peer-server$(EXEEXT): $(peer_server_OBJECTS) $(peer_server_DEPENDENCIES) $(EXTRA_peer_server_DEPENDENCIES) @rm -f peer-server$(EXEEXT) $(AM_V_CCLD)$(LINK) $(peer_server_OBJECTS) $(peer_server_LDADD) $(LIBS) test-30574$(EXEEXT): $(test_30574_OBJECTS) $(test_30574_DEPENDENCIES) $(EXTRA_test_30574_DEPENDENCIES) @rm -f test-30574$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_30574_OBJECTS) $(test_30574_LDADD) $(LIBS) test-dbus-glib$(EXEEXT): $(test_dbus_glib_OBJECTS) $(test_dbus_glib_DEPENDENCIES) $(EXTRA_test_dbus_glib_DEPENDENCIES) @rm -f test-dbus-glib$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_dbus_glib_OBJECTS) $(test_dbus_glib_LDADD) $(LIBS) test-error-mapping$(EXEEXT): $(test_error_mapping_OBJECTS) $(test_error_mapping_DEPENDENCIES) $(EXTRA_test_error_mapping_DEPENDENCIES) @rm -f test-error-mapping$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_error_mapping_OBJECTS) $(test_error_mapping_LDADD) $(LIBS) test-gvariant$(EXEEXT): $(test_gvariant_OBJECTS) $(test_gvariant_DEPENDENCIES) $(EXTRA_test_gvariant_DEPENDENCIES) @rm -f test-gvariant$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_gvariant_OBJECTS) $(test_gvariant_LDADD) $(LIBS) test-peer-on-bus$(EXEEXT): $(test_peer_on_bus_OBJECTS) $(test_peer_on_bus_DEPENDENCIES) $(EXTRA_test_peer_on_bus_DEPENDENCIES) @rm -f test-peer-on-bus$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_peer_on_bus_OBJECTS) $(test_peer_on_bus_LDADD) $(LIBS) test-profile$(EXEEXT): $(test_profile_OBJECTS) $(test_profile_DEPENDENCIES) $(EXTRA_test_profile_DEPENDENCIES) @rm -f test-profile$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_profile_OBJECTS) $(test_profile_LDADD) $(LIBS) test-proxy-peer$(EXEEXT): $(test_proxy_peer_OBJECTS) $(test_proxy_peer_DEPENDENCIES) $(EXTRA_test_proxy_peer_DEPENDENCIES) @rm -f test-proxy-peer$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_proxy_peer_OBJECTS) $(test_proxy_peer_LDADD) $(LIBS) test-registrations$(EXEEXT): $(test_registrations_OBJECTS) $(test_registrations_DEPENDENCIES) $(EXTRA_test_registrations_DEPENDENCIES) @rm -f test-registrations$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_registrations_OBJECTS) $(test_registrations_LDADD) $(LIBS) test-service-glib$(EXEEXT): $(test_service_glib_OBJECTS) $(test_service_glib_DEPENDENCIES) $(EXTRA_test_service_glib_DEPENDENCIES) @rm -f test-service-glib$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_service_glib_OBJECTS) $(test_service_glib_LDADD) $(LIBS) test-thread-client$(EXEEXT): $(test_thread_client_OBJECTS) $(test_thread_client_DEPENDENCIES) $(EXTRA_test_thread_client_DEPENDENCIES) @rm -f test-thread-client$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_thread_client_OBJECTS) $(test_thread_client_LDADD) $(LIBS) test-thread-server$(EXEEXT): $(test_thread_server_OBJECTS) $(test_thread_server_DEPENDENCIES) $(EXTRA_test_thread_server_DEPENDENCIES) @rm -f test-thread-server$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_thread_server_OBJECTS) $(test_thread_server_LDADD) $(LIBS) test-types$(EXEEXT): $(test_types_OBJECTS) $(test_types_DEPENDENCIES) $(EXTRA_test_types_DEPENDENCIES) @rm -f test-types$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_types_OBJECTS) $(test_types_LDADD) $(LIBS) test-variant-recursion$(EXEEXT): $(test_variant_recursion_OBJECTS) $(test_variant_recursion_DEPENDENCIES) $(EXTRA_test_variant_recursion_DEPENDENCIES) @rm -f test-variant-recursion$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_variant_recursion_OBJECTS) $(test_variant_recursion_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/30574.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/error-mapping.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/my-object-marshal.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/my-object-subclass.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/my-object.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/peer-client.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/peer-on-bus.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/peer-server.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/proxy-peer.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/registrations.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-dbus-glib.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-gvariant.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-profile.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-service-glib.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-thread-client.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-thread-server.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-types.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-variant-recursion.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 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 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 check-am: all-am $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-am all-am: Makefile $(PROGRAMS) 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-noinstPROGRAMS \ 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-TESTS check-am clean \ clean-generic clean-libtool clean-noinstPROGRAMS 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 @DBUS_BUILD_TESTS_TRUE@test-service-glib-glue.h: test-service-glib.xml $(top_builddir)/dbus/dbus-binding-tool$(EXEEXT) @DBUS_BUILD_TESTS_TRUE@ $(DEBUG) $(DBUS_BINDING_TOOL) --prefix=my_object --mode=glib-server --output=test-service-glib-glue.h $(srcdir)/test-service-glib.xml @DBUS_BUILD_TESTS_TRUE@test-service-glib-subclass-glue.h: test-service-glib-subclass.xml $(top_builddir)/dbus/dbus-binding-tool$(EXEEXT) @DBUS_BUILD_TESTS_TRUE@ $(DEBUG) $(DBUS_BINDING_TOOL) --prefix=my_object_subclass --mode=glib-server --output=test-service-glib-subclass-glue.h $(srcdir)/test-service-glib-subclass.xml @DBUS_BUILD_TESTS_TRUE@test-service-glib-bindings.h: test-service-glib.xml $(top_builddir)/dbus/dbus-binding-tool$(EXEEXT) @DBUS_BUILD_TESTS_TRUE@ $(DEBUG) $(DBUS_BINDING_TOOL) --prefix=my_object --mode=glib-client --output=test-service-glib-bindings.h $(srcdir)/test-service-glib.xml @DBUS_BUILD_TESTS_TRUE@my-object-marshal.c: Makefile my-object-marshal.list @DBUS_BUILD_TESTS_TRUE@ echo "#include " > $@.tmp @DBUS_BUILD_TESTS_TRUE@ @GLIB_GENMARSHAL@ --prefix=my_object_marshal $(srcdir)/my-object-marshal.list --header --body >> $@.tmp @DBUS_BUILD_TESTS_TRUE@ mv $@.tmp $@ @DBUS_BUILD_TESTS_TRUE@my-object-marshal.h: Makefile my-object-marshal.list @DBUS_BUILD_TESTS_TRUE@ @GLIB_GENMARSHAL@ --prefix=my_object_marshal $(srcdir)/my-object-marshal.list --header > my-object-marshal.h # 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: dbus-glib-0.100.2/test/core/test-dbus-glib.c0000644000175000017500000024147612107524614015363 00000000000000/* General tests for dbus-glib. Please make new tests into a standalone * binary using GTest instead, where feasible. * * Copyright © 2006-2010 Red Hat, Inc. * Copyright © 2006-2010 Collabora Ltd. * Copyright © 2006-2011 Nokia Corporation * Copyright © 2006 Steve Frécinaux * * Licensed under the Academic Free License version 2.1 * * 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 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include /* -*- mode: C; c-file-style: "gnu" -*- */ #include #include #include #include #include "test-service-glib-bindings.h" #include #include #include #include #include "my-object.h" GMainLoop *loop = NULL; static const char *await_terminating_service = NULL; static int n_times_foo_received = 0; static int n_times_frobnicate_received = 0; static int n_times_frobnicate_received_2 = 0; static int n_times_compat_frobnicate_received = 0; static int n_times_sig0_received = 0; static int n_times_sig1_received = 0; static int n_times_sig2_received = 0; static guint exit_timeout = 0; static gboolean proxy_destroyed = FALSE; static gboolean proxy_destroy_and_nameowner = FALSE; static gboolean proxy_destroy_and_nameowner_complete = FALSE; static DBusGProxy *test_terminate_proxy1 = NULL; static DBusGProxy *test_terminate_proxy2 = NULL; #define lose(...) g_error (__VA_ARGS__) static void lose_gerror (const char *prefix, GError *error) G_GNUC_NORETURN; static void unset_and_free_gvalue (gpointer val) { g_value_unset (val); g_free (val); } static gboolean timed_exit (gpointer loop) { g_print ("timed exit!\n"); g_main_loop_quit (loop); return TRUE; } static void proxy_destroyed_cb (DBusGProxy *proxy, gpointer user_data) { proxy_destroyed = TRUE; if (proxy_destroy_and_nameowner && !proxy_destroy_and_nameowner_complete && await_terminating_service == NULL) { g_source_remove (exit_timeout); g_main_loop_quit (loop); proxy_destroy_and_nameowner_complete = TRUE; } } static void test_terminate_proxy1_destroyed_cb (DBusGProxy *proxy, gpointer user_data) { proxy_destroyed = TRUE; if (proxy_destroy_and_nameowner && !proxy_destroy_and_nameowner_complete && await_terminating_service == NULL) { g_object_unref(test_terminate_proxy2); test_terminate_proxy2 = NULL; g_source_remove (exit_timeout); g_main_loop_quit (loop); proxy_destroy_and_nameowner_complete = TRUE; } } static void name_owner_changed (DBusGProxy *proxy, const char *name, const char *prev_owner, const char *new_owner, gpointer user_data) { g_print ("(signal NameOwnerChanged) name owner changed for %s from %s to %s\n", name, prev_owner, new_owner); if (await_terminating_service && !strcmp (name, await_terminating_service) && !strcmp ("", new_owner)) { g_print ("Caught expected ownership loss for %s\n", name); await_terminating_service = NULL; if (proxy_destroy_and_nameowner && !proxy_destroy_and_nameowner_complete && proxy_destroyed) { g_source_remove (exit_timeout); g_main_loop_quit (loop); proxy_destroy_and_nameowner_complete = TRUE; } else if (!proxy_destroy_and_nameowner) { g_source_remove (exit_timeout); g_main_loop_quit (loop); } } } static void foo_signal_handler (DBusGProxy *proxy, double d, void *user_data) { n_times_foo_received += 1; g_print ("Got Foo signal\n"); g_main_loop_quit (loop); g_source_remove (exit_timeout); } static void frobnicate_signal_handler (DBusGProxy *proxy, int val, void *user_data) { n_times_frobnicate_received += 1; g_assert (val == 42); g_print ("Got Frobnicate signal\n"); g_main_loop_quit (loop); g_source_remove (exit_timeout); } static void frobnicate_signal_handler_2 (DBusGProxy *proxy, int val, void *user_data) { n_times_frobnicate_received_2 += 1; g_assert (val == 42); g_print ("Got Frobnicate signal (again)\n"); } static void frobnicate_signal_handler_compat (DBusGProxy *proxy, int val, void *user_data) { n_times_compat_frobnicate_received += 1; g_assert (val == 42); g_print ("Got Frobnicate signal (compat)\n"); g_main_loop_quit (loop); g_source_remove (exit_timeout); } static void sig0_signal_handler (DBusGProxy *proxy, const char *str0, int val, const char *str1, void *user_data) { n_times_sig0_received += 1; g_assert (!strcmp (str0, "foo")); g_assert (val == 22); g_assert (!strcmp (str1, "moo")); g_print ("Got Sig0 signal\n"); g_main_loop_quit (loop); g_source_remove (exit_timeout); } static void sig1_signal_handler (DBusGProxy *proxy, const char *str0, GValue *value, void *user_data) { n_times_sig1_received += 1; g_assert (!strcmp (str0, "baz")); g_assert (G_VALUE_HOLDS_STRING (value)); g_assert (!strcmp (g_value_get_string (value), "bar")); g_print ("Got Sig1 signal\n"); g_main_loop_quit (loop); g_source_remove (exit_timeout); } static void sig2_signal_handler (DBusGProxy *proxy, GHashTable *table, void *user_data) { n_times_sig2_received += 1; g_assert (g_hash_table_size (table) == 2); g_assert (g_hash_table_lookup (table, "baz") != NULL); g_assert (!strcmp (g_hash_table_lookup (table, "baz"), "cow")); g_assert (g_hash_table_lookup (table, "bar") != NULL); g_assert (!strcmp (g_hash_table_lookup (table, "bar"), "foo")); g_print ("Got Sig2 signal\n"); g_main_loop_quit (loop); g_source_remove (exit_timeout); } static DBusGProxyCall *echo_call; static guint n_times_echo_cb_entered; static void echo_received_cb (DBusGProxy *proxy, DBusGProxyCall *call, gpointer data) { GError *error; char *echo_data; g_assert (call == echo_call); g_assert (data == NULL); error = NULL; echo_data = NULL; n_times_echo_cb_entered++; if (!dbus_g_proxy_end_call (proxy, call, &error, G_TYPE_STRING, &echo_data, G_TYPE_INVALID)) lose_gerror ("Failed to complete async Echo", error); g_assert (echo_data != NULL); g_print ("Async echo gave \"%s\"\n", echo_data); g_free (echo_data); g_main_loop_quit (loop); g_source_remove (exit_timeout); } static void increment_received_cb (DBusGProxy *proxy, DBusGProxyCall *call, gpointer data) { GError *error; guint val; g_assert (!strcmp (data, "moo")); error = NULL; if (!dbus_g_proxy_end_call (proxy, call, &error, G_TYPE_UINT, &val, G_TYPE_INVALID)) lose_gerror ("Failed to complete (async) Increment call", error); if (val != 43) lose ("Increment call returned %d, should be 43", val); g_print ("Async increment gave \"%d\"\n", val); g_main_loop_quit (loop); g_source_remove (exit_timeout); } static void increment_async_cb (DBusGProxy *proxy, guint val, GError *error, gpointer data) { if (error) lose_gerror ("Failed to complete (wrapped async) Increment call", error); if (data != NULL) lose ("(wrapped async) Increment call gave unexpected data"); if (val != 43) lose ("(wrapped async) Increment call returned %d, should be 43", val); g_print ("(wrapped async) increment gave \"%d\"\n", val); g_main_loop_quit (loop); g_source_remove (exit_timeout); } #define DBUS_TYPE_G_MAP_OF_VARIANT (dbus_g_type_get_map ("GHashTable", G_TYPE_STRING, G_TYPE_VALUE)) static gboolean test_base_class_get_all (DBusGConnection *connection, const char *object_path, const char *expected_string_value) { DBusGProxy *proxy; GError *error = NULL; GHashTable *hash = NULL; /* g_test_bug (19145); */ g_assert (expected_string_value != NULL); g_assert (object_path != NULL); /* Test GetAll with interfaces on the base class */ proxy = dbus_g_proxy_new_for_name (connection, "org.freedesktop.DBus.GLib.TestService", object_path, DBUS_INTERFACE_PROPERTIES); g_assert (proxy != NULL); g_print ("%s: Calling GetAll for unknown interface\n", object_path); { if (dbus_g_proxy_call (proxy, "GetAll", &error, G_TYPE_STRING, "org.freedesktop.DBus.foobar.blahblah", G_TYPE_INVALID, DBUS_TYPE_G_MAP_OF_VARIANT, &hash, G_TYPE_INVALID)) lose ("Unexpected success for GetAll call of unknown interface\n"); g_clear_error (&error); hash = NULL; } g_print ("%s: Calling GetAll for base class interface\n", object_path); { GValue *value; const char *foo = NULL; if (!dbus_g_proxy_call (proxy, "GetAll", &error, G_TYPE_STRING, "org.freedesktop.DBus.GLib.Tests.MyObject", G_TYPE_INVALID, DBUS_TYPE_G_MAP_OF_VARIANT, &hash, G_TYPE_INVALID)) lose_gerror ("Unexpected error for GetProperty call of base class interface", error); g_clear_error (&error); if (!hash) { lose ("%s: Unexpected NULL hash table returned for GetAll call of base " "class interface", object_path); } if (g_hash_table_size (hash) != 3) { lose ("%s: Unexpected hash table size %d (expected 3) returned for GetAll " " call of base class interface", object_path, g_hash_table_size (hash)); } value = g_hash_table_lookup (hash, "this_is_a_string"); if (!value) { lose ("%s: Unexpected missing 'this_is_a_string' property for GetAll " "call of base class interface", object_path); } if (!G_VALUE_HOLDS_STRING (value)) { lose ("%s: Unexpected wrong type for 'this_is_a_string' property for " "GetAll call of base class interface", object_path); } foo = g_value_get_string (value); if (!foo || strcmp (foo, expected_string_value)) { lose ("%s: Unexpected value for 'this_is_a_string' property for GetAll " "call of base class interface", object_path); } value = g_hash_table_lookup (hash, "no-touching"); if (!value) lose ("%s: Unexpected missing 'no-touching' property for GetAll " "call of base class interface", object_path); if (!G_VALUE_HOLDS_UINT (value)) lose ("%s: Unexpected wrong type for 'no-touching' property for " "GetAll call of base class interface", object_path); if (g_value_get_uint (value) != 42) lose ("%s: Unexpected wrong value \"%d\" for 'no-touching' property for " "GetAll call of base class interface", object_path, g_value_get_uint (value)); g_hash_table_destroy (hash); hash = NULL; } g_object_unref (proxy); return TRUE; } static gboolean test_subclass_get_all (DBusGConnection *connection, const char *object_path) { DBusGProxy *proxy; GError *error = NULL; GHashTable *hash = NULL; /* g_test_bug (19145); */ g_assert (object_path != NULL); /* Test GetAll with interfaces on the subclass */ proxy = dbus_g_proxy_new_for_name (connection, "org.freedesktop.DBus.GLib.TestService", object_path, DBUS_INTERFACE_PROPERTIES); g_assert (proxy != NULL); g_print ("%s: Calling GetAll for subclass interface\n", object_path); { GValue *value; const char *string = NULL; guint num = 0; if (!dbus_g_proxy_call (proxy, "GetAll", &error, G_TYPE_STRING, "org.freedesktop.DBus.GLib.Tests.MyObjectSubclass", G_TYPE_INVALID, DBUS_TYPE_G_MAP_OF_VARIANT, &hash, G_TYPE_INVALID)) lose_gerror ("Unexpected error for GetProperty call of base subclass interface\n", error); g_clear_error (&error); if (!hash) { lose ("%s: Unexpected NULL hash table returned for GetAll call of " "subclass interface\n", object_path); } if (g_hash_table_size (hash) != 2) { lose ("%s: Unexpected hash table size %d (expected 2) returned for GetAll " " call of subclass interface\n", object_path, g_hash_table_size (hash)); } /* Test the string property */ value = g_hash_table_lookup (hash, "this_is_a_subclass_string"); if (!value) { lose ("%s: Unexpected missing 'this_is_a_subclass_string' property for " "GetAll call of subclass interface\n", object_path); } if (!G_VALUE_HOLDS_STRING (value)) { lose ("%s: Unexpected wrong type for 'this_is_a_subclass_string' " "property for GetAll call of subclass interface\n", object_path); } string = g_value_get_string (value); if (!string || strcmp (string, "default subclass value")) { lose ("%s: Unexpected value for 'this_is_a_subclass_string' property " "for GetAll call of subclass interface\n", object_path); } /* Test the uint property */ value = g_hash_table_lookup (hash, "this_is_a_subclass_uint"); if (!value) { lose ("%s: Unexpected missing 'this_is_a_subclass_uint' property for " "GetAll call of subclass interface\n", object_path); } if (!G_VALUE_HOLDS_UINT (value)) { lose ("%s: Unexpected wrong type for 'this_is_a_subclass_uint' " "property for GetAll call of subclass interface\n", object_path); } num = g_value_get_uint (value); if (num != 1234567) { lose ("%s: Unexpected value for 'this_is_a_subclass_uint' property " "for GetAll call of subclass interface\n", object_path); } g_hash_table_destroy (hash); hash = NULL; } g_object_unref (proxy); return TRUE; } static void lose_gerror (const char *prefix, GError *error) { if (error->domain == DBUS_GERROR && error->code == DBUS_GERROR_REMOTE_EXCEPTION) lose ("%s (%s): %s", prefix, dbus_g_error_get_name (error), error->message); else lose ("%s: %s#%d: %s", prefix, g_quark_to_string (error->domain), error->code, error->message); } static void run_mainloop (void) { GMainContext *ctx; ctx = g_main_loop_get_context (loop); while (g_main_context_pending (ctx)) g_main_context_iteration (ctx, FALSE); } int main (int argc, char **argv) { DBusGConnection *connection; GError *error; DBusGProxy *driver; DBusGProxy *proxy; DBusGProxy *proxy2; DBusGProxy *property_proxy; char **name_list; guint name_list_len; guint i; DBusGProxyCall *call; guint32 result; char *v_STRING_2; guint32 v_UINT32_2; double v_DOUBLE_2; g_type_init (); g_log_set_always_fatal (G_LOG_LEVEL_WARNING | G_LOG_LEVEL_CRITICAL); loop = g_main_loop_new (NULL, FALSE); error = NULL; connection = dbus_g_bus_get (DBUS_BUS_SESSION, &error); if (connection == NULL) lose_gerror ("Failed to open connection to bus", error); /* should always get the same one */ g_assert (connection == dbus_g_bus_get (DBUS_BUS_SESSION, NULL)); g_assert (connection == dbus_g_bus_get (DBUS_BUS_SESSION, NULL)); g_assert (connection == dbus_g_bus_get (DBUS_BUS_SESSION, NULL)); /* Create a proxy object for the "bus driver" */ driver = dbus_g_proxy_new_for_name (connection, DBUS_SERVICE_DBUS, DBUS_PATH_DBUS, DBUS_INTERFACE_DBUS); dbus_g_proxy_add_signal (driver, "NameOwnerChanged", G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INVALID); dbus_g_proxy_connect_signal (driver, "NameOwnerChanged", G_CALLBACK (name_owner_changed), NULL, NULL); /* Call ListNames method */ error = NULL; if (!dbus_g_proxy_call (driver, "ListNames", &error, G_TYPE_INVALID, G_TYPE_STRV, &name_list, G_TYPE_INVALID)) lose_gerror ("Failed to complete ListNames call", error); g_print ("Names on the message bus:\n"); i = 0; name_list_len = g_strv_length (name_list); while (i < name_list_len) { g_assert (name_list[i] != NULL); g_print (" %s\n", name_list[i]); ++i; } g_assert (name_list[i] == NULL); g_strfreev (name_list); g_print ("calling ThisMethodDoesNotExist\n"); /* Test handling of unknown method */ if (dbus_g_proxy_call (driver, "ThisMethodDoesNotExist", &error, G_TYPE_STRING, "blah blah blah blah blah", G_TYPE_INT, 10, G_TYPE_INVALID, G_TYPE_INVALID) != FALSE) lose ("Calling nonexistent method succeeded!"); g_print ("Got EXPECTED error from calling unknown method: %s\n", error->message); g_clear_error (&error); run_mainloop (); /* Activate a service */ g_print ("Activating echo service\n"); if (!dbus_g_proxy_call (driver, "StartServiceByName", &error, G_TYPE_STRING, "org.freedesktop.DBus.GLib.TestEchoService", G_TYPE_UINT, 0, G_TYPE_INVALID, G_TYPE_UINT, &result, G_TYPE_INVALID)) lose_gerror ("Failed to complete Activate call", error); g_print ("Starting echo service result = 0x%x\n", result); /* Activate a service again */ g_print ("Activating echo service again\n"); if (!dbus_g_proxy_call (driver, "StartServiceByName", &error, G_TYPE_STRING, "org.freedesktop.DBus.GLib.TestEchoService", G_TYPE_UINT, 0, G_TYPE_INVALID, G_TYPE_UINT, &result, G_TYPE_INVALID)) lose_gerror ("Failed to complete Activate call", error); g_print ("Duplicate start of echo service = 0x%x\n", result); /* Talk to the new service */ g_print ("Creating proxy for echo service\n"); proxy = dbus_g_proxy_new_for_name_owner (connection, "org.freedesktop.DBus.GLib.TestEchoService", "/org/freedesktop/DBus/GLib/TestSuite", "org.freedesktop.DBus.GLib.TestSuite", &error); if (proxy == NULL) lose_gerror ("Failed to create proxy for name owner", error); run_mainloop (); g_print ("Calling Echo\n"); if (!dbus_g_proxy_call (proxy, "Echo", &error, G_TYPE_STRING, "my string hello", G_TYPE_INVALID, G_TYPE_STRING, &v_STRING_2, G_TYPE_INVALID)) lose_gerror ("Failed to complete Echo call", error); g_print ("String echoed = \"%s\"\n", v_STRING_2); g_free (v_STRING_2); g_print ("Calling Echo (async)\n"); echo_call = dbus_g_proxy_begin_call (proxy, "Echo", echo_received_cb, NULL, NULL, G_TYPE_STRING, "my string hello", G_TYPE_INVALID); dbus_g_connection_flush (connection); exit_timeout = g_timeout_add (5000, timed_exit, loop); g_main_loop_run (loop); /* Exercise invalid number/type of return values */ g_print ("Invalid args; calling Echo\n"); if (dbus_g_proxy_call (proxy, "Echo", &error, G_TYPE_STRING, "my string hello", G_TYPE_INVALID, G_TYPE_INVALID)) lose ("Unexpected success for invalid Echo return values"); g_clear_error (&error); g_print ("Invalid args 2; calling Echo\n"); if (dbus_g_proxy_call (proxy, "Echo", &error, G_TYPE_STRING, "my string hello", G_TYPE_INVALID, G_TYPE_UINT, &v_UINT32_2, G_TYPE_INVALID)) lose ("Unexpected success for invalid Echo return values"); g_clear_error (&error); g_print ("Invalid args 3; calling Echo\n"); if (dbus_g_proxy_call (proxy, "Echo", &error, G_TYPE_STRING, "my string hello", G_TYPE_INVALID, G_TYPE_STRING, &v_STRING_2, G_TYPE_UINT, &v_UINT32_2, G_TYPE_INVALID)) lose ("Unexpected success for invalid Echo return values"); g_clear_error (&error); /* Test oneway call and signal handling */ g_print ("Testing Foo emission\n"); dbus_g_proxy_add_signal (proxy, "Foo", G_TYPE_DOUBLE, G_TYPE_INVALID); dbus_g_proxy_connect_signal (proxy, "Foo", G_CALLBACK (foo_signal_handler), NULL, NULL); dbus_g_proxy_call_no_reply (proxy, "EmitFoo", G_TYPE_INVALID); dbus_g_connection_flush (connection); exit_timeout = g_timeout_add (5000, timed_exit, loop); g_main_loop_run (loop); if (n_times_foo_received != 1) lose ("Foo signal received %d times, should have been 1", n_times_foo_received); /* Activate test servie */ g_print ("Activating GLib.TestService\n"); error = NULL; if (!dbus_g_proxy_call (driver, "StartServiceByName", &error, G_TYPE_STRING, "org.freedesktop.DBus.GLib.TestService", G_TYPE_UINT, 0, G_TYPE_INVALID, G_TYPE_UINT, &result, G_TYPE_INVALID)) { lose_gerror ("Failed to complete Activate call", error); } g_print ("GLib.TestService activated\n"); if (getenv ("DBUS_GLIB_TEST_SLEEP_AFTER_ACTIVATION")) g_usleep (8 * G_USEC_PER_SEC); g_object_unref (G_OBJECT (proxy)); run_mainloop (); proxy = dbus_g_proxy_new_for_name_owner (connection, "org.freedesktop.DBus.GLib.TestService", "/org/freedesktop/DBus/GLib/Tests/MyTestObject", "org.freedesktop.DBus.GLib.Tests.MyObject", &error); if (proxy == NULL) lose_gerror ("Failed to create proxy for name owner", error); g_print ("Calling DoNothing\n"); if (!dbus_g_proxy_call (proxy, "DoNothing", &error, G_TYPE_INVALID, G_TYPE_INVALID)) lose_gerror ("Failed to complete DoNothing call", error); g_print ("Calling Increment\n"); error = NULL; if (!dbus_g_proxy_call (proxy, "Increment", &error, G_TYPE_UINT, 42, G_TYPE_INVALID, G_TYPE_UINT, &v_UINT32_2, G_TYPE_INVALID)) lose_gerror ("Failed to complete Increment call", error); if (v_UINT32_2 != 43) lose ("Increment call returned %d, should be 43", v_UINT32_2); v_UINT32_2 = 0; g_print ("Calling Increment (async)\n"); call = dbus_g_proxy_begin_call (proxy, "Increment", increment_received_cb, g_strdup ("moo"), g_free, G_TYPE_UINT, 42, G_TYPE_INVALID); if (call == NULL) lose ("Failed to begin Increment call"); dbus_g_connection_flush (connection); exit_timeout = g_timeout_add (5000, timed_exit, loop); g_main_loop_run (loop); g_print ("Calling IncrementRetval\n"); error = NULL; v_UINT32_2 = 0; if (!dbus_g_proxy_call (proxy, "IncrementRetval", &error, G_TYPE_UINT, 42, G_TYPE_INVALID, G_TYPE_UINT, &v_UINT32_2, G_TYPE_INVALID)) lose_gerror ("Failed to complete Increment call", error); if (v_UINT32_2 != 43) lose ("IncrementRetval call returned %d, should be 43", v_UINT32_2); g_print ("Calling IncrementRetvalError\n"); error = NULL; v_UINT32_2 = 0; if (!dbus_g_proxy_call (proxy, "IncrementRetvalError", &error, G_TYPE_UINT, 5, G_TYPE_INVALID, G_TYPE_UINT, &v_UINT32_2, G_TYPE_INVALID)) lose_gerror ("Failed to complete Increment call", error); if (v_UINT32_2 != 6) lose ("IncrementRetval call returned %d, should be 6", v_UINT32_2); g_print ("Calling ThrowError\n"); if (dbus_g_proxy_call (proxy, "ThrowError", &error, G_TYPE_INVALID, G_TYPE_INVALID) != FALSE) lose ("ThrowError call unexpectedly succeeded!"); if (!dbus_g_error_has_name (error, "org.freedesktop.DBus.GLib.Tests.MyObject.Foo")) lose ("ThrowError call returned unexpected error \"%s\": %s", dbus_g_error_get_name (error), error->message); g_print ("ThrowError failed (as expected) returned error: %s\n", error->message); g_clear_error (&error); g_print ("Calling IncrementRetvalError (for error)\n"); error = NULL; v_UINT32_2 = 0; if (dbus_g_proxy_call (proxy, "IncrementRetvalError", &error, G_TYPE_UINT, 20, G_TYPE_INVALID, G_TYPE_UINT, &v_UINT32_2, G_TYPE_INVALID) != FALSE) lose ("IncrementRetvalError call unexpectedly succeeded!"); if (!dbus_g_error_has_name (error, "org.freedesktop.DBus.GLib.Tests.MyObject.Foo")) lose ("IncrementRetvalError call returned unexpected error \"%s\": %s", dbus_g_error_get_name (error), error->message); g_clear_error (&error); error = NULL; g_print ("Calling Uppercase\n"); if (!dbus_g_proxy_call (proxy, "Uppercase", &error, G_TYPE_STRING, "foobar", G_TYPE_INVALID, G_TYPE_STRING, &v_STRING_2, G_TYPE_INVALID)) lose_gerror ("Failed to complete Uppercase call", error); if (strcmp ("FOOBAR", v_STRING_2) != 0) lose ("Uppercase call returned unexpected string %s", v_STRING_2); g_free (v_STRING_2); run_mainloop (); g_print ("Calling ManyArgs\n"); if (!dbus_g_proxy_call (proxy, "ManyArgs", &error, G_TYPE_UINT, 26, G_TYPE_STRING, "bazwhee", G_TYPE_DOUBLE, G_PI, G_TYPE_INVALID, G_TYPE_DOUBLE, &v_DOUBLE_2, G_TYPE_STRING, &v_STRING_2, G_TYPE_INVALID)) lose_gerror ("Failed to complete ManyArgs call", error); if (v_DOUBLE_2 < 55 || v_DOUBLE_2 > 56) lose ("ManyArgs call returned unexpected double value %f", v_DOUBLE_2); if (strcmp ("BAZWHEE", v_STRING_2) != 0) lose ("ManyArgs call returned unexpected string %s", v_STRING_2); g_free (v_STRING_2); g_print ("Calling (wrapped) do_nothing\n"); if (!org_freedesktop_DBus_GLib_Tests_MyObject_do_nothing (proxy, &error)) lose_gerror ("Failed to complete (wrapped) DoNothing call", error); g_print ("Calling (wrapped) increment\n"); if (!org_freedesktop_DBus_GLib_Tests_MyObject_increment (proxy, 42, &v_UINT32_2, &error)) lose_gerror ("Failed to complete (wrapped) Increment call", error); if (v_UINT32_2 != 43) lose ("(wrapped) increment call returned %d, should be 43", v_UINT32_2); g_print ("Calling (wrapped async) increment\n"); if (!org_freedesktop_DBus_GLib_Tests_MyObject_increment_async (proxy, 42, increment_async_cb, NULL)) lose_gerror ("Failed to complete (wrapped) Increment call", error); dbus_g_connection_flush (connection); exit_timeout = g_timeout_add (5000, timed_exit, loop); g_main_loop_run (loop); v_UINT32_2 = 0; if (!org_freedesktop_DBus_GLib_Tests_MyObject_async_increment (proxy, 42, &v_UINT32_2, &error)) lose_gerror ("Failed to complete (wrapped) AsyncIncrement call", error); if (v_UINT32_2 != 43) lose ("(wrapped) async increment call returned %d, should be 43", v_UINT32_2); g_print ("Calling (wrapped) throw_error\n"); if (org_freedesktop_DBus_GLib_Tests_MyObject_throw_error (proxy, &error) != FALSE) lose ("(wrapped) ThrowError call unexpectedly succeeded!"); g_print ("(wrapped) ThrowError failed (as expected) returned error: %s\n", error->message); g_clear_error (&error); g_print ("Calling (wrapped) uppercase\n"); if (!org_freedesktop_DBus_GLib_Tests_MyObject_uppercase (proxy, "foobar", &v_STRING_2, &error)) lose_gerror ("Failed to complete (wrapped) Uppercase call", error); if (strcmp ("FOOBAR", v_STRING_2) != 0) lose ("(wrapped) Uppercase call returned unexpected string %s", v_STRING_2); g_free (v_STRING_2); g_print ("Calling (wrapped) many_args\n"); if (!org_freedesktop_DBus_GLib_Tests_MyObject_many_args (proxy, 26, "bazwhee", G_PI, &v_DOUBLE_2, &v_STRING_2, &error)) lose_gerror ("Failed to complete (wrapped) ManyArgs call", error); if (v_DOUBLE_2 < 55 || v_DOUBLE_2 > 56) lose ("(wrapped) ManyArgs call returned unexpected double value %f", v_DOUBLE_2); if (strcmp ("BAZWHEE", v_STRING_2) != 0) lose ("(wrapped) ManyArgs call returned unexpected string %s", v_STRING_2); g_free (v_STRING_2); { guint32 arg0; char *arg1; gint32 arg2; guint32 arg3; guint32 arg4; char *arg5; g_print ("Calling (wrapped) many_return\n"); if (!org_freedesktop_DBus_GLib_Tests_MyObject_many_return (proxy, &arg0, &arg1, &arg2, &arg3, &arg4, &arg5, &error)) lose_gerror ("Failed to complete (wrapped) ManyReturn call", error); if (arg0 != 42) lose ("(wrapped) ManyReturn call returned unexpected guint32 value %u", arg0); if (strcmp ("42", arg1) != 0) lose ("(wrapped) ManyReturn call returned unexpected string %s", arg1); g_free (arg1); if (arg2 != -67) lose ("(wrapped) ManyReturn call returned unexpected gint32 value %u", arg2); if (arg3 != 2) lose ("(wrapped) ManyReturn call returned unexpected guint32 value %u", arg3); if (arg4 != 26) lose ("(wrapped) ManyReturn call returned unexpected guint32 value %u", arg4); if (strcmp ("hello world", arg5)) lose ("(wrapped) ManyReturn call returned unexpected string %s", arg5); g_free (arg5); } run_mainloop (); { GValue value = {0, }; g_value_init (&value, G_TYPE_STRING); g_value_set_string (&value, "foo"); g_print ("Calling (wrapped) stringify, with string\n"); if (!org_freedesktop_DBus_GLib_Tests_MyObject_stringify (proxy, &value, &v_STRING_2, &error)) lose_gerror ("Failed to complete (wrapped) stringify call", error); if (strcmp ("foo", v_STRING_2) != 0) lose ("(wrapped) stringify call returned unexpected string %s", v_STRING_2); g_free (v_STRING_2); g_value_unset (&value); g_value_init (&value, G_TYPE_INT); g_value_set_int (&value, 42); g_print ("Calling (wrapped) stringify, with int\n"); if (!org_freedesktop_DBus_GLib_Tests_MyObject_stringify (proxy, &value, &v_STRING_2, &error)) lose_gerror ("Failed to complete (wrapped) stringify call 2", error); if (strcmp ("42", v_STRING_2) != 0) lose ("(wrapped) stringify call 2 returned unexpected string %s", v_STRING_2); g_value_unset (&value); g_free (v_STRING_2); g_value_init (&value, G_TYPE_INT); g_value_set_int (&value, 88); g_print ("Calling (wrapped) stringify, with another int\n"); if (!org_freedesktop_DBus_GLib_Tests_MyObject_stringify (proxy, &value, NULL, &error)) lose_gerror ("Failed to complete (wrapped) stringify call 3", error); g_value_unset (&value); g_print ("Calling (wrapped) unstringify, for string\n"); if (!org_freedesktop_DBus_GLib_Tests_MyObject_unstringify (proxy, "foo", &value, &error)) lose_gerror ("Failed to complete (wrapped) unstringify call", error); if (!G_VALUE_HOLDS_STRING (&value)) lose ("(wrapped) unstringify call returned unexpected value type %d", (int) G_VALUE_TYPE (&value)); if (strcmp (g_value_get_string (&value), "foo")) lose ("(wrapped) unstringify call returned unexpected string %s", g_value_get_string (&value)); g_value_unset (&value); g_print ("Calling (wrapped) unstringify, for int\n"); if (!org_freedesktop_DBus_GLib_Tests_MyObject_unstringify (proxy, "10", &value, &error)) lose_gerror ("Failed to complete (wrapped) unstringify call", error); if (!G_VALUE_HOLDS_INT (&value)) lose ("(wrapped) unstringify call returned unexpected value type %d", (int) G_VALUE_TYPE (&value)); if (g_value_get_int (&value) != 10) lose ("(wrapped) unstringify call returned unexpected integer %d", g_value_get_int (&value)); g_value_unset (&value); } run_mainloop (); { GArray *array; guint32 arraylen; array = g_array_new (FALSE, TRUE, sizeof (guint32)); arraylen = 0; g_print ("Calling (wrapped) zero-length recursive1\n"); if (!org_freedesktop_DBus_GLib_Tests_MyObject_recursive1 (proxy, array, &arraylen, &error)) lose_gerror ("Failed to complete (wrapped) zero-length recursive1 call", error); if (arraylen != 0) lose ("(wrapped) zero-length recursive1 call returned invalid length %u", arraylen); } { GArray *array; guint32 val; guint32 arraylen; array = g_array_new (FALSE, TRUE, sizeof (guint32)); val = 42; g_array_append_val (array, val); val = 69; g_array_append_val (array, val); val = 88; g_array_append_val (array, val); val = 26; g_array_append_val (array, val); val = 2; g_array_append_val (array, val); arraylen = 0; g_print ("Calling (wrapped) recursive1\n"); if (!org_freedesktop_DBus_GLib_Tests_MyObject_recursive1 (proxy, array, &arraylen, &error)) lose_gerror ("Failed to complete (wrapped) recursive1 call", error); if (arraylen != 5) lose ("(wrapped) recursive1 call returned invalid length %u", arraylen); } { GArray *array = NULL; guint32 *arrayvals; g_print ("Calling (wrapped) recursive2\n"); if (!org_freedesktop_DBus_GLib_Tests_MyObject_recursive2 (proxy, 2, &array, &error)) lose_gerror ("Failed to complete (wrapped) Recursive2 call", error); if (array == NULL) lose ("(wrapped) Recursive2 call returned NULL"); if (array->len != 5) lose ("(wrapped) Recursive2 call returned unexpected array length %u", array->len); arrayvals = (guint32*) array->data; if (arrayvals[0] != 42) lose ("(wrapped) Recursive2 call returned unexpected value %d in position 0", arrayvals[0]); if (arrayvals[1] != 26) lose ("(wrapped) Recursive2 call returned unexpected value %d in position 1", arrayvals[1]); if (arrayvals[4] != 2) lose ("(wrapped) Recursive2 call returned unexpected value %d in position 4", arrayvals[4]); g_array_free (array, TRUE); } run_mainloop (); { const char *strs[] = { "hello", "HellO", "HELLO", NULL }; char **strs_ret; strs_ret = NULL; g_print ("Calling (wrapped) many_uppercase\n"); if (!org_freedesktop_DBus_GLib_Tests_MyObject_many_uppercase (proxy, strs, &strs_ret, &error)) lose_gerror ("Failed to complete (wrapped) ManyUppercase call", error); g_assert (strs_ret != NULL); if (strcmp ("HELLO", strs_ret[0]) != 0) lose ("(wrapped) ManyUppercase call returned unexpected string %s", strs_ret[0]); if (strcmp ("HELLO", strs_ret[1]) != 0) lose ("(wrapped) ManyUppercase call returned unexpected string %s", strs_ret[1]); if (strcmp ("HELLO", strs_ret[2]) != 0) lose ("(wrapped) ManyUppercase call returned unexpected string %s", strs_ret[2]); g_strfreev (strs_ret); } { GHashTable *table; guint len; table = g_hash_table_new (g_str_hash, g_str_equal); g_hash_table_insert (table, "moooo", "b"); g_hash_table_insert (table, "xxx", "cow!"); len = 0; g_print ("Calling (wrapped) str_hash_len\n"); if (!org_freedesktop_DBus_GLib_Tests_MyObject_str_hash_len (proxy, table, &len, &error)) lose_gerror ("(wrapped) StrHashLen call failed", error); if (len != 13) lose ("(wrapped) StrHashLen returned unexpected length %u", len); g_hash_table_destroy (table); } { GHashTable *table; const char *val; g_print ("Calling (wrapped) get_hash\n"); if (!org_freedesktop_DBus_GLib_Tests_MyObject_get_hash (proxy, &table, &error)) lose_gerror ("(wrapped) GetHash call failed", error); val = g_hash_table_lookup (table, "foo"); if (val == NULL || strcmp ("bar", val)) lose ("(wrapped) StrHashLen returned invalid value %s for key \"foo\"", val ? val : "(null)"); val = g_hash_table_lookup (table, "baz"); if (val == NULL || strcmp ("whee", val)) lose ("(wrapped) StrHashLen returned invalid value %s for key \"whee\"", val ? val : "(null)"); val = g_hash_table_lookup (table, "cow"); if (val == NULL || strcmp ("crack", val)) lose ("(wrapped) StrHashLen returned invalid value %s for key \"cow\"", val ? val : "(null)"); if (g_hash_table_size (table) != 3) lose ("(wrapped) StrHashLen returned unexpected hash size %u", g_hash_table_size (table)); g_hash_table_destroy (table); } run_mainloop (); { GValueArray *vals; GValueArray *vals_ret; GValue *val; vals = g_value_array_new (3); g_value_array_append (vals, NULL); g_value_init (g_value_array_get_nth (vals, vals->n_values - 1), G_TYPE_STRING); g_value_set_string (g_value_array_get_nth (vals, 0), "foo"); g_value_array_append (vals, NULL); g_value_init (g_value_array_get_nth (vals, vals->n_values - 1), G_TYPE_UINT); g_value_set_uint (g_value_array_get_nth (vals, vals->n_values - 1), 42); g_value_array_append (vals, NULL); g_value_init (g_value_array_get_nth (vals, vals->n_values - 1), G_TYPE_VALUE); val = g_new0 (GValue, 1); g_value_init (val, G_TYPE_UCHAR); g_value_set_uchar (val, '!'); g_value_set_boxed (g_value_array_get_nth (vals, vals->n_values - 1), val); vals_ret = NULL; g_print ("Calling SendCar\n"); if (!dbus_g_proxy_call (proxy, "SendCar", &error, G_TYPE_VALUE_ARRAY, vals, G_TYPE_INVALID, G_TYPE_VALUE_ARRAY, &vals_ret, G_TYPE_INVALID)) lose_gerror ("Failed to complete SendCar call", error); g_assert (vals_ret != NULL); g_assert (vals_ret->n_values == 2); g_assert (G_VALUE_HOLDS_UINT (g_value_array_get_nth (vals_ret, 0))); g_assert (g_value_get_uint (g_value_array_get_nth (vals_ret, 0)) == 43); g_assert (G_VALUE_TYPE (g_value_array_get_nth (vals_ret, 1)) == DBUS_TYPE_G_OBJECT_PATH); g_assert (!strcmp ("/org/freedesktop/DBus/GLib/Tests/MyTestObject2", g_value_get_boxed (g_value_array_get_nth (vals_ret, 1)))); g_free (val); g_value_array_free (vals); g_value_array_free (vals_ret); } { const gchar *in_sig = "a(iou)sq"; gchar *out_sig = NULL; g_print ("Calling EchoSignature: %s\n", in_sig); if (!org_freedesktop_DBus_GLib_Tests_MyObject_echo_signature (proxy, in_sig, &out_sig, &error)) lose_gerror ("Failed to complete EchoSignature call", error); if (out_sig == NULL) lose ("EchoSignature returned NULL"); if (strcmp (in_sig, out_sig) != 0) lose ("EchoSignature changed the signature"); g_print ("EchoSignature returned: %s\n", out_sig); g_free (out_sig); } { GValue *val; GHashTable *table; GHashTable *ret_table; table = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, unset_and_free_gvalue); val = g_new0 (GValue, 1); g_value_init (val, G_TYPE_UINT); g_value_set_uint (val, 42); g_hash_table_insert (table, g_strdup ("foo"), val); val = g_new0 (GValue, 1); g_value_init (val, G_TYPE_STRING); g_value_set_string (val, "hello"); g_hash_table_insert (table, g_strdup ("bar"), val); ret_table = NULL; g_print ("Calling ManyStringify\n"); if (!dbus_g_proxy_call (proxy, "ManyStringify", &error, dbus_g_type_get_map ("GHashTable", G_TYPE_STRING, G_TYPE_VALUE), table, G_TYPE_INVALID, dbus_g_type_get_map ("GHashTable", G_TYPE_STRING, G_TYPE_VALUE), &ret_table, G_TYPE_INVALID)) lose_gerror ("Failed to complete ManyStringify call", error); g_assert (ret_table != NULL); g_assert (g_hash_table_size (ret_table) == 2); val = g_hash_table_lookup (ret_table, "foo"); g_assert (val != NULL); g_assert (G_VALUE_HOLDS_STRING (val)); g_assert (!strcmp ("42", g_value_get_string (val))); val = g_hash_table_lookup (ret_table, "bar"); g_assert (val != NULL); g_assert (G_VALUE_HOLDS_STRING (val)); g_assert (!strcmp ("hello", g_value_get_string (val))); g_hash_table_destroy (table); g_hash_table_destroy (ret_table); } { GPtrArray *in_array; GPtrArray *out_array; char **strs; GArray *uints; in_array = g_ptr_array_new (); strs = g_new0 (char *, 3); strs[0] = "foo"; strs[1] = "bar"; strs[2] = NULL; g_ptr_array_add (in_array, strs); strs = g_new0 (char *, 4); strs[0] = "baz"; strs[1] = "whee"; strs[2] = "moo"; strs[3] = NULL; g_ptr_array_add (in_array, strs); out_array = NULL; g_print ("Calling RecArrays\n"); if (!dbus_g_proxy_call (proxy, "RecArrays", &error, dbus_g_type_get_collection ("GPtrArray", G_TYPE_STRV), in_array, G_TYPE_INVALID, dbus_g_type_get_collection ("GPtrArray", dbus_g_type_get_collection ("GPtrArray", G_TYPE_UINT)), &out_array, G_TYPE_INVALID)) lose_gerror ("Failed to complete RecArrays call", error); g_free (g_ptr_array_index (in_array, 0)); g_free (g_ptr_array_index (in_array, 1)); g_assert (out_array); g_assert (out_array->len == 2); uints = g_ptr_array_index (out_array, 0); g_assert (uints); g_assert (uints->len == 3); g_assert (g_array_index (uints, guint, 0) == 10); g_assert (g_array_index (uints, guint, 1) == 42); g_assert (g_array_index (uints, guint, 2) == 27); g_array_free (uints, TRUE); uints = g_ptr_array_index (out_array, 1); g_assert (uints); g_assert (uints->len == 1); g_assert (g_array_index (uints, guint, 0) == 30); g_array_free (uints, TRUE); g_ptr_array_free (out_array, TRUE); } { guint val; char *ret_path; DBusGProxy *ret_proxy; g_print ("Calling (wrapped) objpath\n"); if (!dbus_g_proxy_call (proxy, "Objpath", &error, DBUS_TYPE_G_PROXY, proxy, G_TYPE_INVALID, DBUS_TYPE_G_PROXY, &ret_proxy, G_TYPE_INVALID)) lose_gerror ("Failed to complete Objpath call", error); if (strcmp ("/org/freedesktop/DBus/GLib/Tests/MyTestObject2", dbus_g_proxy_get_path (ret_proxy)) != 0) lose ("(wrapped) objpath call returned unexpected proxy %s", dbus_g_proxy_get_path (ret_proxy)); g_print ("Doing get/increment val tests\n"); val = 1; if (!org_freedesktop_DBus_GLib_Tests_MyObject_get_val (ret_proxy, &val, &error)) lose_gerror ("Failed to complete (wrapped) GetVal call", error); if (val != 0) lose ("(wrapped) GetVal returned invalid value %d", val); if (!org_freedesktop_DBus_GLib_Tests_MyObject_increment_val (ret_proxy, &error)) lose_gerror ("Failed to complete (wrapped) IncrementVal call", error); if (!org_freedesktop_DBus_GLib_Tests_MyObject_increment_val (ret_proxy, &error)) lose_gerror ("Failed to complete (wrapped) IncrementVal call", error); if (!org_freedesktop_DBus_GLib_Tests_MyObject_increment_val (ret_proxy, &error)) lose_gerror ("Failed to complete (wrapped) IncrementVal call", error); if (!org_freedesktop_DBus_GLib_Tests_MyObject_get_val (ret_proxy, &val, &error)) lose_gerror ("Failed to complete (wrapped) GetVal call", error); if (val != 3) lose ("(wrapped) GetVal returned invalid value %d", val); if (!org_freedesktop_DBus_GLib_Tests_MyObject_get_val (proxy, &val, &error)) lose_gerror ("Failed to complete (wrapped) GetVal call", error); if (val != 0) lose ("(wrapped) GetVal returned invalid value %d", val); if (!org_freedesktop_DBus_GLib_Tests_MyObject_increment_val (proxy, &error)) lose_gerror ("Failed to complete (wrapped) IncrementVal call", error); if (!org_freedesktop_DBus_GLib_Tests_MyObject_get_val (proxy, &val, &error)) lose_gerror ("Failed to complete (wrapped) GetVal call", error); if (val != 1) lose ("(wrapped) GetVal returned invalid value %d", val); if (!org_freedesktop_DBus_GLib_Tests_MyObject_get_val (ret_proxy, &val, &error)) lose_gerror ("Failed to complete (wrapped) GetVal call", error); if (val != 3) lose ("(wrapped) GetVal returned invalid value %d", val); g_object_unref (G_OBJECT (ret_proxy)); g_print ("Calling objpath again\n"); ret_proxy = NULL; if (!dbus_g_proxy_call (proxy, "Objpath", &error, DBUS_TYPE_G_OBJECT_PATH, dbus_g_proxy_get_path (proxy), G_TYPE_INVALID, DBUS_TYPE_G_OBJECT_PATH, &ret_path, G_TYPE_INVALID)) lose_gerror ("Failed to complete Objpath call 2", error); if (strcmp ("/org/freedesktop/DBus/GLib/Tests/MyTestObject2", ret_path) != 0) lose ("Objpath call 2 returned unexpected path %s", ret_path); ret_proxy = dbus_g_proxy_new_for_name_owner (connection, "org.freedesktop.DBus.GLib.TestService", ret_path, "org.freedesktop.DBus.GLib.Tests.FooObject", &error); g_free (ret_path); val = 0; if (!org_freedesktop_DBus_GLib_Tests_FooObject_get_value (ret_proxy, &val, &error)) lose_gerror ("Failed to complete (wrapped) GetValue call", error); if (val != 3) lose ("(wrapped) GetValue returned invalid value %d", val); } run_mainloop (); { GPtrArray *objs; guint i; g_print ("Calling GetObjs\n"); if (!dbus_g_proxy_call (proxy, "GetObjs", &error, G_TYPE_INVALID, dbus_g_type_get_collection ("GPtrArray", DBUS_TYPE_G_OBJECT_PATH), &objs, G_TYPE_INVALID)) lose_gerror ("Failed to complete GetObjs call", error); if (objs->len != 2) lose ("GetObjs call returned unexpected number of objects %d, expected 2", objs->len); if (strcmp ("/org/freedesktop/DBus/GLib/Tests/MyTestObject", g_ptr_array_index (objs, 0)) != 0) lose ("GetObjs call returned unexpected path \"%s\" in position 0; expected /org/freedesktop/DBus/GLib/Tests/MyTestObject", (char*) g_ptr_array_index (objs, 0)); if (strcmp ("/org/freedesktop/DBus/GLib/Tests/MyTestObject2", g_ptr_array_index (objs, 1)) != 0) lose ("GetObjs call returned unexpected path \"%s\" in position 1; expected /org/freedesktop/DBus/GLib/Tests/MyTestObject2", (char*) g_ptr_array_index (objs, 1)); for (i = 0; i < objs->len; i++) g_free (g_ptr_array_index (objs, i)); g_ptr_array_free (objs, TRUE); } { GValue *variant; GArray *array; gint i; g_print ("Calling ProcessVariantOfArrayOfInts123\n"); array = g_array_sized_new (FALSE, FALSE, sizeof(gint), 3); i = 1; g_array_append_val (array, i); i++; g_array_append_val (array, i); i++; g_array_append_val (array, i); variant = g_new0 (GValue, 1); g_value_init (variant, dbus_g_type_get_collection ("GArray", G_TYPE_INT)); g_value_take_boxed (variant, array); if (!dbus_g_proxy_call (proxy, "ProcessVariantOfArrayOfInts123", &error, G_TYPE_VALUE, variant, G_TYPE_INVALID, G_TYPE_INVALID)) lose_gerror ("Failed to send a vairant of array of ints 1, 2 and 3!", error); g_value_unset (variant); g_free (variant); } for (i=0; i<3; i++) { gchar *val; GHashTable *table; GHashTable *subtable; GHashTable *ret_table; table = g_hash_table_new_full (g_str_hash, g_str_equal, (GDestroyNotify) (g_free), (GDestroyNotify) (g_hash_table_destroy)); subtable = g_hash_table_new_full (g_str_hash, g_str_equal, (GDestroyNotify) (g_free), (GDestroyNotify) (g_free)); g_hash_table_insert (subtable, g_strdup ("foo"), g_strdup("1")); g_hash_table_insert (subtable, g_strdup ("bar"), g_strdup("2")); g_hash_table_insert (subtable, g_strdup ("baz"), g_strdup("3")); g_hash_table_insert (table, g_strdup("dict1"), subtable); subtable = g_hash_table_new_full (g_str_hash, g_str_equal, (GDestroyNotify) (g_free), (GDestroyNotify) (g_free)); g_hash_table_insert (subtable, g_strdup ("foo"), g_strdup("4")); g_hash_table_insert (subtable, g_strdup ("bar"), g_strdup("5")); g_hash_table_insert (subtable, g_strdup ("baz"), g_strdup("6")); g_hash_table_insert (table, g_strdup("dict2"), subtable); subtable = NULL; ret_table = NULL; g_print ("Calling DictOfDicts\n"); if (!dbus_g_proxy_call (proxy, "DictOfDicts", &error, dbus_g_type_get_map ("GHashTable", G_TYPE_STRING, dbus_g_type_get_map ("GHashTable", G_TYPE_STRING, G_TYPE_STRING)), table, G_TYPE_INVALID, dbus_g_type_get_map ("GHashTable", G_TYPE_STRING, dbus_g_type_get_map ("GHashTable", G_TYPE_STRING, G_TYPE_STRING)), &ret_table, G_TYPE_INVALID)) lose_gerror ("Failed to complete DictOfDicts call", error); g_assert (ret_table != NULL); g_assert (g_hash_table_size (ret_table) == 2); subtable = g_hash_table_lookup (ret_table, "dict1"); g_assert(subtable); g_assert (g_hash_table_size (subtable) == 3); val = g_hash_table_lookup (subtable, "foo"); g_assert (val != NULL); g_assert (!strcmp ("dict1 1", val)); val = g_hash_table_lookup (subtable, "bar"); g_assert (val != NULL); g_assert (!strcmp ("dict1 2", val)); val = g_hash_table_lookup (subtable, "baz"); g_assert (val != NULL); g_assert (!strcmp ("dict1 3", val)); subtable = g_hash_table_lookup (ret_table, "dict2"); g_assert(subtable); g_assert (g_hash_table_size (subtable) == 3); val = g_hash_table_lookup (subtable, "foo"); g_assert (val != NULL); g_assert (!strcmp ("dict2 4", val)); val = g_hash_table_lookup (subtable, "bar"); g_assert (val != NULL); g_assert (!strcmp ("dict2 5", val)); val = g_hash_table_lookup (subtable, "baz"); g_assert (val != NULL); g_assert (!strcmp ("dict2 6", val)); g_hash_table_destroy (table); g_hash_table_destroy (ret_table); g_mem_profile (); } for (i=0; i<3; i++) { GHashTable *table; GHashTable *ret_table = NULL; const gchar *foo[] = { "foo", NULL }; const gchar *bar[] = { "bar", "baz", NULL }; const gchar **ret_foo = NULL, **ret_bar = NULL; table = g_hash_table_new (g_str_hash, g_str_equal); g_hash_table_insert (table, "dub", foo); g_hash_table_insert (table, "sox", bar); g_print ("Calling DictOfSigs\n"); if (!org_freedesktop_DBus_GLib_Tests_MyObject_dict_of_sigs (proxy, table, &ret_table, &error)) lose_gerror ("Failed to complete DictOfSigs call", error); if (ret_table == NULL) lose ("DictOfSigs didn't return a hash table"); if (g_hash_table_size (ret_table) != 2) lose ("DictOfSigs has too many entries"); ret_foo = g_hash_table_lookup (ret_table, "dub"); ret_bar = g_hash_table_lookup (ret_table, "sox"); if (ret_foo == NULL || ret_bar == NULL) lose ("DictOfSigs is missing entries"); if (ret_foo[0] == NULL || ret_foo[1] != NULL || strcmp (ret_foo[0], "foo") != 0) lose ("DictOfSigs mangled foo"); if (ret_bar[0] == NULL || ret_bar[1] == NULL || ret_bar[2] != NULL || strcmp (ret_bar[0], "bar") != 0 || strcmp (ret_bar[1], "baz") != 0) lose ("DictOfSigs mangled bar"); g_hash_table_destroy (table); g_hash_table_destroy (ret_table); g_mem_profile (); } for (i=0; i<3; i++) { GHashTable *table; GHashTable *ret_table = NULL; GPtrArray *foo, *bar; GPtrArray *ret_foo = NULL, *ret_bar = NULL; foo = g_ptr_array_new (); g_ptr_array_add (foo, "/foo"); bar = g_ptr_array_new (); g_ptr_array_add (bar, "/bar"); g_ptr_array_add (bar, "/baz"); table = g_hash_table_new (g_str_hash, g_str_equal); g_hash_table_insert (table, "/foo", foo); g_hash_table_insert (table, "/bar", bar); g_print ("Calling DictOfObjs\n"); if (!org_freedesktop_DBus_GLib_Tests_MyObject_dict_of_objs (proxy, table, &ret_table, &error)) lose_gerror ("Failed to complete DictOfObjs call", error); g_ptr_array_free (foo, TRUE); g_ptr_array_free (bar, TRUE); g_hash_table_destroy (table); if (ret_table == NULL) lose ("DictOfObjs didn't return a hash table"); if (g_hash_table_size (ret_table) != 2) lose ("DictOfObjs has too many entries"); ret_foo = g_hash_table_lookup (ret_table, "/foo"); ret_bar = g_hash_table_lookup (ret_table, "/bar"); if (ret_foo == NULL || ret_bar == NULL) lose ("DictOfObjs is missing entries"); if (ret_foo->len != 1 || strcmp (g_ptr_array_index (ret_foo, 0), "/foo") != 0) lose ("DictOfObjs mangled /foo"); if (ret_bar->len != 2 || strcmp (g_ptr_array_index (ret_bar, 0), "/bar") != 0 || strcmp (g_ptr_array_index (ret_bar, 1), "/baz") != 0) lose ("DictOfObjs mangled /bar"); g_boxed_free (dbus_g_type_get_map ("GHashTable", DBUS_TYPE_G_OBJECT_PATH, dbus_g_type_get_collection ("GPtrArray", DBUS_TYPE_G_OBJECT_PATH)), ret_table); g_mem_profile (); } /* Signal handling tests */ g_print ("Testing signal handling\n"); dbus_g_proxy_add_signal (proxy, "Frobnicate", G_TYPE_INT, G_TYPE_INVALID); dbus_g_proxy_connect_signal (proxy, "Frobnicate", G_CALLBACK (frobnicate_signal_handler), NULL, NULL); g_print ("Calling EmitFrobnicate\n"); if (!dbus_g_proxy_call (proxy, "EmitFrobnicate", &error, G_TYPE_INVALID, G_TYPE_INVALID)) lose_gerror ("Failed to complete EmitFrobnicate call", error); dbus_g_connection_flush (connection); exit_timeout = g_timeout_add (5000, timed_exit, loop); g_main_loop_run (loop); if (n_times_frobnicate_received != 1) lose ("Frobnicate signal received %d times, should have been 1", n_times_frobnicate_received); g_print ("Calling EmitFrobnicate again\n"); if (!dbus_g_proxy_call (proxy, "EmitFrobnicate", &error, G_TYPE_INVALID, G_TYPE_INVALID)) lose_gerror ("Failed to complete EmitFrobnicate call", error); dbus_g_connection_flush (connection); exit_timeout = g_timeout_add (5000, timed_exit, loop); g_main_loop_run (loop); if (n_times_frobnicate_received != 2) lose ("Frobnicate signal received %d times, should have been 2", n_times_frobnicate_received); g_object_unref (G_OBJECT (proxy)); run_mainloop (); g_print ("Creating proxy for FooObject interface\n"); proxy = dbus_g_proxy_new_for_name_owner (connection, "org.freedesktop.DBus.GLib.TestService", "/org/freedesktop/DBus/GLib/Tests/MyTestObject", "org.freedesktop.DBus.GLib.Tests.FooObject", &error); if (proxy == NULL) lose_gerror ("Failed to create proxy for name owner", error); my_object_register_marshallers (); dbus_g_proxy_add_signal (proxy, "Sig0", G_TYPE_STRING, G_TYPE_INT, G_TYPE_STRING, G_TYPE_INVALID); dbus_g_proxy_add_signal (proxy, "Sig1", G_TYPE_STRING, G_TYPE_VALUE, G_TYPE_INVALID); dbus_g_proxy_add_signal (proxy, "Sig2", DBUS_TYPE_G_STRING_STRING_HASHTABLE, G_TYPE_INVALID); dbus_g_proxy_connect_signal (proxy, "Sig0", G_CALLBACK (sig0_signal_handler), NULL, NULL); dbus_g_proxy_connect_signal (proxy, "Sig1", G_CALLBACK (sig1_signal_handler), NULL, NULL); dbus_g_proxy_connect_signal (proxy, "Sig2", G_CALLBACK (sig2_signal_handler), NULL, NULL); g_print ("Calling FooObject EmitSignals\n"); dbus_g_proxy_call_no_reply (proxy, "EmitSignals", G_TYPE_INVALID); dbus_g_connection_flush (connection); exit_timeout = g_timeout_add (5000, timed_exit, loop); g_main_loop_run (loop); exit_timeout = g_timeout_add (5000, timed_exit, loop); g_main_loop_run (loop); if (n_times_sig0_received != 1) lose ("Sig0 signal received %d times, should have been 1", n_times_sig0_received); if (n_times_sig1_received != 1) lose ("Sig1 signal received %d times, should have been 1", n_times_sig1_received); g_print ("Calling FooObject EmitSignals and EmitSignal2\n"); dbus_g_proxy_call_no_reply (proxy, "EmitSignal2", G_TYPE_INVALID); dbus_g_connection_flush (connection); exit_timeout = g_timeout_add (5000, timed_exit, loop); g_main_loop_run (loop); if (n_times_sig2_received != 1) lose ("Sig2 signal received %d times, should have been 1", n_times_sig2_received); g_print ("Calling FooObject EmitSignals two more times\n"); dbus_g_proxy_call_no_reply (proxy, "EmitSignals", G_TYPE_INVALID); dbus_g_proxy_call_no_reply (proxy, "EmitSignals", G_TYPE_INVALID); dbus_g_connection_flush (connection); exit_timeout = g_timeout_add (5000, timed_exit, loop); g_main_loop_run (loop); exit_timeout = g_timeout_add (5000, timed_exit, loop); g_main_loop_run (loop); exit_timeout = g_timeout_add (5000, timed_exit, loop); g_main_loop_run (loop); exit_timeout = g_timeout_add (5000, timed_exit, loop); g_main_loop_run (loop); if (n_times_sig0_received != 3) lose ("Sig0 signal received %d times, should have been 3", n_times_sig0_received); if (n_times_sig1_received != 3) lose ("Sig1 signal received %d times, should have been 3", n_times_sig1_received); /* Terminate again */ g_print ("Terminating service\n"); await_terminating_service = "org.freedesktop.DBus.GLib.TestService"; dbus_g_proxy_call_no_reply (proxy, "Terminate", G_TYPE_INVALID); proxy_destroyed = FALSE; proxy_destroy_and_nameowner = TRUE; proxy_destroy_and_nameowner_complete = FALSE; g_signal_connect (G_OBJECT (proxy), "destroy", G_CALLBACK (proxy_destroyed_cb), NULL); dbus_g_connection_flush (connection); exit_timeout = g_timeout_add (5000, timed_exit, loop); g_main_loop_run (loop); if (await_terminating_service != NULL) lose ("Didn't see name loss for \"org.freedesktop.DBus.GLib.TestService\""); if (!proxy_destroyed) lose ("Didn't get proxy_destroyed"); g_print ("Proxy destroyed successfully\n"); /* Don't need to unref, proxy was destroyed */ run_mainloop (); /* Create a new proxy for the name; should not be associated */ proxy = dbus_g_proxy_new_for_name (connection, "org.freedesktop.DBus.GLib.TestService", "/org/freedesktop/DBus/GLib/Tests/MyTestObject", "org.freedesktop.DBus.GLib.Tests.MyObject"); g_assert (proxy != NULL); proxy_destroyed = FALSE; proxy_destroy_and_nameowner = FALSE; proxy_destroy_and_nameowner_complete = FALSE; g_signal_connect (G_OBJECT (proxy), "destroy", G_CALLBACK (proxy_destroyed_cb), NULL); if (!dbus_g_proxy_call (driver, "GetNameOwner", &error, G_TYPE_STRING, "org.freedesktop.DBus.GLib.TestService", G_TYPE_INVALID, G_TYPE_STRING, &v_STRING_2, G_TYPE_INVALID)) { if (error->domain == DBUS_GERROR && error->code == DBUS_GERROR_NAME_HAS_NO_OWNER) g_print ("Got expected error \"org.freedesktop.DBus.Error.NameHasNoOwner\"\n"); else lose_gerror ("Unexpected error from GetNameOwner", error); } else lose ("GetNameOwner unexpectedly succeeded!"); g_clear_error (&error); /* This will have the side-effect of activating the service, thus * causing a NameOwnerChanged, which should let our name proxy * get signals */ g_print ("Calling Uppercase for name proxy\n"); if (!dbus_g_proxy_call (proxy, "Uppercase", &error, G_TYPE_STRING, "bazwhee", G_TYPE_INVALID, G_TYPE_STRING, &v_STRING_2, G_TYPE_INVALID)) lose_gerror ("Failed to complete Uppercase call", error); g_free (v_STRING_2); if (getenv ("DBUS_GLIB_TEST_SLEEP_AFTER_ACTIVATION1")) g_usleep (8 * G_USEC_PER_SEC); dbus_g_proxy_add_signal (proxy, "Frobnicate", G_TYPE_INT, G_TYPE_INVALID); dbus_g_proxy_connect_signal (proxy, "Frobnicate", G_CALLBACK (frobnicate_signal_handler), NULL, NULL); g_print ("Calling EmitFrobnicate\n"); if (!dbus_g_proxy_call (proxy, "EmitFrobnicate", &error, G_TYPE_INVALID, G_TYPE_INVALID)) lose_gerror ("Failed to complete EmitFrobnicate call", error); n_times_frobnicate_received = 0; dbus_g_connection_flush (connection); exit_timeout = g_timeout_add (5000, timed_exit, loop); g_main_loop_run (loop); if (n_times_frobnicate_received != 1) lose ("Frobnicate signal received %d times, should have been 1", n_times_frobnicate_received); /* Now terminate the service, then start it again (implicitly) and wait for signals */ g_print ("Terminating service (2)\n"); await_terminating_service = "org.freedesktop.DBus.GLib.TestService"; dbus_g_proxy_call_no_reply (proxy, "Terminate", G_TYPE_INVALID); dbus_g_connection_flush (connection); exit_timeout = g_timeout_add (5000, timed_exit, loop); g_main_loop_run (loop); if (await_terminating_service != NULL) lose ("Didn't see name loss for \"org.freedesktop.DBus.GLib.TestService\""); if (proxy_destroyed) lose ("Unexpectedly got proxy_destroyed!"); n_times_frobnicate_received = 0; g_print ("Calling EmitFrobnicate (2)\n"); if (!dbus_g_proxy_call (proxy, "EmitFrobnicate", &error, G_TYPE_INVALID, G_TYPE_INVALID)) lose_gerror ("Failed to complete EmitFrobnicate call", error); if (getenv ("DBUS_GLIB_TEST_SLEEP_AFTER_ACTIVATION2")) g_usleep (8 * G_USEC_PER_SEC); dbus_g_connection_flush (connection); exit_timeout = g_timeout_add (5000, timed_exit, loop); g_main_loop_run (loop); if (n_times_frobnicate_received != 1) lose ("Frobnicate signal received %d times, should have been 1", n_times_frobnicate_received); if (proxy_destroyed) lose ("Unexpectedly got proxy_destroyed!"); /* Create another proxy for the name; should be associated immediately */ proxy2 = dbus_g_proxy_new_for_name (connection, "org.freedesktop.DBus.GLib.TestService", "/org/freedesktop/DBus/GLib/Tests/MyTestObject", "org.freedesktop.DBus.GLib.Tests.MyObject"); g_assert (proxy2 != NULL); dbus_g_proxy_add_signal (proxy2, "Frobnicate", G_TYPE_INT, G_TYPE_INVALID); dbus_g_proxy_connect_signal (proxy2, "Frobnicate", G_CALLBACK (frobnicate_signal_handler_2), NULL, NULL); g_print ("Calling EmitFrobnicate (3)\n"); if (!dbus_g_proxy_call (proxy, "EmitFrobnicate", &error, G_TYPE_INVALID, G_TYPE_INVALID)) lose_gerror ("Failed to complete EmitFrobnicate call", error); dbus_g_connection_flush (connection); exit_timeout = g_timeout_add (5000, timed_exit, loop); g_main_loop_run (loop); if (n_times_frobnicate_received != 2) lose ("Frobnicate signal received %d times for 1st proxy, should have been 2", n_times_frobnicate_received); if (n_times_frobnicate_received_2 != 1) lose ("Frobnicate signal received %d times for 2nd proxy, should have been 1", n_times_frobnicate_received_2); g_object_unref (G_OBJECT (proxy)); g_object_unref (G_OBJECT (proxy2)); run_mainloop (); /* Tests for a "compatibilty" object path. This is the same object as above, just * at a different path. */ proxy = dbus_g_proxy_new_for_name_owner (connection, "org.freedesktop.DBus.GLib.TestService", "/org/freedesktop/DBus/GLib/Tests/Compat/MyTestObjectCompat", "org.freedesktop.DBus.GLib.Tests.MyObject", &error); dbus_g_proxy_add_signal (proxy, "Frobnicate", G_TYPE_INT, G_TYPE_INVALID); dbus_g_proxy_connect_signal (proxy, "Frobnicate", G_CALLBACK (frobnicate_signal_handler_compat), NULL, NULL); g_print ("Calling EmitFrobnicate (compat)\n"); if (!dbus_g_proxy_call (proxy, "EmitFrobnicate", &error, G_TYPE_INVALID, G_TYPE_INVALID)) lose_gerror ("Failed to complete EmitFrobnicate call on compat proxy", error); g_main_loop_run (loop); if (n_times_compat_frobnicate_received != 1) lose ("Frobnicate signal received %d times for compat proxy, should have been 1", n_times_compat_frobnicate_received); g_object_unref (proxy); /* Test introspection */ proxy = dbus_g_proxy_new_for_name_owner (connection, "org.freedesktop.DBus.GLib.TestService", "/org/freedesktop/DBus/GLib/Tests/MyTestObject", "org.freedesktop.DBus.Introspectable", &error); if (proxy == NULL) lose_gerror ("Failed to create proxy for name owner", error); g_print ("Testing introspect\n"); if (!dbus_g_proxy_call (proxy, "Introspect", &error, G_TYPE_INVALID, G_TYPE_STRING, &v_STRING_2, G_TYPE_INVALID)) lose_gerror ("Failed to complete Introspect call", error); /* Could just do strcmp(), but that seems more fragile */ { NodeInfo *node; GSList *elt; gboolean found_introspectable; gboolean found_properties; gboolean found_myobject; gboolean found_fooobject; node = description_load_from_string (v_STRING_2, strlen (v_STRING_2), &error); if (!node) lose_gerror ("Failed to parse introspection data: %s", error); found_introspectable = FALSE; found_properties = FALSE; found_myobject = FALSE; found_fooobject = FALSE; for (elt = node_info_get_interfaces (node); elt ; elt = elt->next) { InterfaceInfo *iface = elt->data; if (!found_introspectable && strcmp (interface_info_get_name (iface), "org.freedesktop.DBus.Introspectable") == 0) found_introspectable = TRUE; else if (!found_properties && strcmp (interface_info_get_name (iface), "org.freedesktop.DBus.Properties") == 0) found_properties = TRUE; else if (!found_myobject && strcmp (interface_info_get_name (iface), "org.freedesktop.DBus.GLib.Tests.MyObject") == 0) { GSList *elt; gboolean found_manyargs; gboolean found_no_touching = FALSE; found_myobject = TRUE; found_manyargs = FALSE; for (elt = interface_info_get_methods (iface); elt; elt = elt->next) { MethodInfo *method; method = elt->data; if (strcmp (method_info_get_name (method), "ManyArgs") == 0) { found_manyargs = TRUE; break; } } if (!found_manyargs) lose ("Missing method org.freedesktop.DBus.GLib.Tests.MyObject.ManyArgs"); for (elt = interface_info_get_properties (iface); elt; elt = elt->next) { PropertyInfo *prop = elt->data; if (strcmp (property_info_get_name (prop), "no-touching") == 0) { if (property_info_get_access (prop) != PROPERTY_READ) lose ("property no-touching had incorrect access %d", property_info_get_access (prop)); else { found_no_touching = TRUE; break; } } } if (!found_no_touching) lose ("didn't find property \"no-touching\" in org.freedesktop.DBus.GLib.Tests.MyObject"); } else if (!found_fooobject && strcmp (interface_info_get_name (iface), "org.freedesktop.DBus.GLib.Tests.FooObject") == 0) found_fooobject = TRUE; else lose ("Unexpected or duplicate interface %s", interface_info_get_name (iface)); } if (!(found_introspectable && found_myobject && found_properties)) lose ("Missing interface"); g_free (node); } g_free (v_STRING_2); /* Properties tests */ property_proxy = dbus_g_proxy_new_from_proxy (proxy, DBUS_INTERFACE_PROPERTIES, NULL); g_object_unref (proxy); proxy = NULL; g_print ("Calling GetProperty (1)\n"); { GValue value = {0,}; if (!dbus_g_proxy_call (property_proxy, "Get", &error, G_TYPE_STRING, "org.freedesktop.DBus.GLib.Tests.MyObject", G_TYPE_STRING, "this_is_a_string", G_TYPE_INVALID, G_TYPE_VALUE, &value, G_TYPE_INVALID)) lose_gerror ("Failed to complete GetProperty call", error); g_assert (G_VALUE_HOLDS (&value, G_TYPE_STRING)); g_assert (!strcmp (g_value_get_string (&value), "")); g_value_unset (&value); } g_print ("Calling SetProperty (1)\n"); { GValue value = {0,}; g_value_init (&value, G_TYPE_STRING); g_value_set_string (&value, "testing value"); if (!dbus_g_proxy_call (property_proxy, "Set", &error, G_TYPE_STRING, "org.freedesktop.DBus.GLib.Tests.MyObject", G_TYPE_STRING, "this_is_a_string", G_TYPE_VALUE, &value, G_TYPE_INVALID, G_TYPE_INVALID)) lose_gerror ("Failed to complete SetProperty call", error); g_value_unset (&value); } g_print ("Calling GetProperty of read-only property\n"); { GValue value = {0,}; if (!dbus_g_proxy_call (property_proxy, "Get", &error, G_TYPE_STRING, "org.freedesktop.DBus.GLib.Tests.MyObject", G_TYPE_STRING, "no-touching", G_TYPE_INVALID, G_TYPE_VALUE, &value, G_TYPE_INVALID)) lose_gerror ("Failed to complete GetProperty no-touching call", error); g_assert (G_VALUE_HOLDS (&value, G_TYPE_UINT)); g_assert (g_value_get_uint (&value) == 42); g_value_unset (&value); } g_print ("Calling SetProperty (1)\n"); { GValue value = {0,}; g_value_init (&value, G_TYPE_UINT); g_value_set_uint (&value, 40); if (dbus_g_proxy_call (property_proxy, "Set", &error, G_TYPE_STRING, "org.freedesktop.DBus.GLib.Tests.MyObject", G_TYPE_STRING, "no-touching", G_TYPE_VALUE, &value, G_TYPE_INVALID, G_TYPE_INVALID)) lose ("Unexpected success from SetProperty call for read-only value \"no-touching\""); g_clear_error (&error); g_value_unset (&value); } g_print ("Calling GetProperty of read-only property (again)\n"); { GValue value = {0,}; if (!dbus_g_proxy_call (property_proxy, "Get", &error, G_TYPE_STRING, "org.freedesktop.DBus.GLib.Tests.MyObject", G_TYPE_STRING, "no-touching", G_TYPE_INVALID, G_TYPE_VALUE, &value, G_TYPE_INVALID)) lose_gerror ("Failed to complete GetProperty call", error); g_assert (G_VALUE_HOLDS (&value, G_TYPE_UINT)); g_assert (g_value_get_uint (&value) == 42); g_value_unset (&value); } g_print ("Calling GetProperty (2)\n"); { GValue value = {0,}; if (!dbus_g_proxy_call (property_proxy, "Get", &error, G_TYPE_STRING, "org.freedesktop.DBus.GLib.Tests.MyObject", G_TYPE_STRING, "this_is_a_string", G_TYPE_INVALID, G_TYPE_VALUE, &value, G_TYPE_INVALID)) lose_gerror ("Failed to complete GetProperty call", error); g_assert (G_VALUE_HOLDS (&value, G_TYPE_STRING)); g_assert (!strcmp (g_value_get_string (&value), "testing value")); g_value_unset (&value); } g_print ("Calling GetProperty: SuperStudly\n"); { GValue value = {0,}; if (!dbus_g_proxy_call (property_proxy, "Get", &error, G_TYPE_STRING, "org.freedesktop.DBus.GLib.Tests.MyObject", G_TYPE_STRING, "SuperStudly", G_TYPE_INVALID, G_TYPE_VALUE, &value, G_TYPE_INVALID)) lose_gerror ("Failed to complete GetProperty call", error); g_assert (G_VALUE_HOLDS (&value, G_TYPE_DOUBLE)); g_value_unset (&value); } g_print ("Calling GetProperty: super-studly\n"); { GValue value = {0,}; if (!dbus_g_proxy_call (property_proxy, "Get", &error, G_TYPE_STRING, "org.freedesktop.DBus.GLib.Tests.MyObject", G_TYPE_STRING, "super-studly", G_TYPE_INVALID, G_TYPE_VALUE, &value, G_TYPE_INVALID)) lose_gerror ("Failed to complete GetProperty call", error); g_assert (G_VALUE_HOLDS (&value, G_TYPE_DOUBLE)); g_value_unset (&value); } g_print ("Calling GetProperty: super_studly\n"); { GValue value = {0,}; if (!dbus_g_proxy_call (property_proxy, "Get", &error, G_TYPE_STRING, "org.freedesktop.DBus.GLib.Tests.MyObject", G_TYPE_STRING, "super_studly", G_TYPE_INVALID, G_TYPE_VALUE, &value, G_TYPE_INVALID)) lose_gerror ("Failed to complete GetProperty call", error); g_assert (G_VALUE_HOLDS (&value, G_TYPE_DOUBLE)); g_value_unset (&value); } g_print ("Calling GetProperty on unknown property\n"); { GValue value = {0,}; if (dbus_g_proxy_call (property_proxy, "Get", &error, G_TYPE_STRING, "org.freedesktop.DBus.GLib.Tests.MyObject", G_TYPE_STRING, "SomeUnknownProperty", G_TYPE_INVALID, G_TYPE_VALUE, &value, G_TYPE_INVALID)) lose ("Unexpected success for GetProperty call of unknown property"); g_clear_error (&error); } /* These two are expected to pass unless we call disable_legacy_property_access */ g_print ("Calling GetProperty on not-exported property (legacy enabled)\n"); { GValue value = {0,}; if (!dbus_g_proxy_call (property_proxy, "Get", &error, G_TYPE_STRING, "org.freedesktop.DBus.GLib.Tests.MyObject", G_TYPE_STRING, "should-be-hidden", G_TYPE_INVALID, G_TYPE_VALUE, &value, G_TYPE_INVALID)) lose_gerror ("Failed GetProperty call of \"should-be-hidden\" property", error); g_assert (G_VALUE_HOLDS_BOOLEAN (&value)); g_assert (g_value_get_boolean (&value) == FALSE); g_value_unset (&value); } g_print ("Calling GetProperty on not-exported property (legacy enabled)\n"); { GValue value = {0,}; if (!dbus_g_proxy_call (property_proxy, "Get", &error, G_TYPE_STRING, "org.freedesktop.DBus.GLib.Tests.MyObject", G_TYPE_STRING, "ShouldBeHidden", G_TYPE_INVALID, G_TYPE_VALUE, &value, G_TYPE_INVALID)) lose_gerror ("Failed GetProperty call of \"ShouldBeHidden\" property", error); g_value_unset (&value); } g_print ("Calling SetProperty on not-exported property (legacy enabled)\n"); { GValue value = {0,}; g_value_init (&value, G_TYPE_BOOLEAN); g_value_set_boolean (&value, TRUE); if (dbus_g_proxy_call (property_proxy, "Set", &error, G_TYPE_STRING, "org.freedesktop.DBus.GLib.Tests.MyObject", G_TYPE_STRING, "should-be-hidden", G_TYPE_VALUE, &value, G_TYPE_INVALID, G_TYPE_INVALID)) lose ("Unexpected success from SetProperty call of \"should-be-hidden\" property"); g_value_unset (&value); g_clear_error (&error); } g_print ("Calling GetProperty on not-exported property (legacy enabled)\n"); { GValue value = {0,}; if (!dbus_g_proxy_call (property_proxy, "Get", &error, G_TYPE_STRING, "org.freedesktop.DBus.GLib.Tests.MyObject", G_TYPE_STRING, "should-be-hidden", G_TYPE_INVALID, G_TYPE_VALUE, &value, G_TYPE_INVALID)) lose_gerror ("Failed GetProperty call of \"should-be-hidden\" property", error); g_assert (G_VALUE_HOLDS_BOOLEAN (&value)); g_assert (g_value_get_boolean (&value) == FALSE); g_value_unset (&value); } /* Test GetAll */ /* 'testing value' set earlier by the SetProperty tests */ test_base_class_get_all (connection, "/org/freedesktop/DBus/GLib/Tests/MyTestObject", "testing value"); /* "" is base class default for this_is_a_string property since the * property isn't marked with G_PARAM_CONSTRUT. */ test_base_class_get_all (connection, "/org/freedesktop/DBus/GLib/Tests/MyTestObjectSubclass", ""); /* Finally test GetAll of a subclass on a different interface to ensure that * the right properties are returned (fdo #19145) */ test_subclass_get_all (connection, "/org/freedesktop/DBus/GLib/Tests/MyTestObjectSubclass"); /* Now, call disable_legacy_property_access */ g_assert (proxy == NULL); proxy = dbus_g_proxy_new_for_name_owner (connection, "org.freedesktop.DBus.GLib.TestService", "/org/freedesktop/DBus/GLib/Tests/MyTestObject", "org.freedesktop.DBus.GLib.Tests.MyObject", &error); if (!dbus_g_proxy_call (proxy, "UnsafeDisableLegacyPropertyAccess", &error, G_TYPE_INVALID, G_TYPE_INVALID)) lose_gerror ("Failed to invoke UnsafeDisableLegacyPropertyAccess", error); g_object_unref (proxy); proxy = NULL; g_print ("Calling GetProperty on not-exported property (legacy *disabled*)\n"); { GValue value = {0,}; if (dbus_g_proxy_call (property_proxy, "Get", &error, G_TYPE_STRING, "org.freedesktop.DBus.GLib.Tests.MyObject", G_TYPE_STRING, "should-be-hidden", G_TYPE_INVALID, G_TYPE_VALUE, &value, G_TYPE_INVALID)) lose ("Unexpected success from GetProperty call of \"should-be-hidden\" property"); g_clear_error (&error); } g_print ("Calling GetProperty on not-exported property (legacy *disabled*)\n"); { GValue value = {0,}; if (dbus_g_proxy_call (property_proxy, "Get", &error, G_TYPE_STRING, "org.freedesktop.DBus.GLib.Tests.MyObject", G_TYPE_STRING, "ShouldBeHidden", G_TYPE_INVALID, G_TYPE_VALUE, &value, G_TYPE_INVALID)) lose ("Unexpected success from GetProperty call of \"ShouldBeHidden\" property"); g_clear_error (&error); } g_print ("Calling SetProperty on not-exported property (legacy *disabled*)\n"); { GValue value = {0,}; g_value_init (&value, G_TYPE_BOOLEAN); g_value_set_boolean (&value, FALSE); if (dbus_g_proxy_call (property_proxy, "Set", &error, G_TYPE_STRING, "org.freedesktop.DBus.GLib.Tests.MyObject", G_TYPE_STRING, "should-be-hidden", G_TYPE_VALUE, &value, G_TYPE_INVALID, G_TYPE_INVALID)) lose ("Unexpected success from SetProperty call of \"should-be-hidden\" property"); g_value_unset (&value); g_clear_error (&error); } g_object_unref (property_proxy); property_proxy = NULL; test_terminate_proxy1 = dbus_g_proxy_new_for_name_owner (connection, "org.freedesktop.DBus.GLib.TestService", "/org/freedesktop/DBus/GLib/Tests/MyTestObject", "org.freedesktop.DBus.GLib.Tests.MyObject", &error); if (test_terminate_proxy1 == NULL) lose_gerror ("Failed to create proxy for name owner", error); test_terminate_proxy2 = dbus_g_proxy_new_for_name_owner (connection, "org.freedesktop.DBus.GLib.TestService", "/org/freedesktop/DBus/GLib/Tests/MyTestObject", "org.freedesktop.DBus.GLib.Tests.MyObject", &error); if (test_terminate_proxy2 == NULL) lose_gerror ("Failed to create proxy for name owner", error); g_print ("Testing duplicate proxy destruction\n"); await_terminating_service = "org.freedesktop.DBus.GLib.TestService"; dbus_g_proxy_call_no_reply (test_terminate_proxy1, "Terminate", G_TYPE_INVALID); proxy_destroyed = FALSE; proxy_destroy_and_nameowner = TRUE; proxy_destroy_and_nameowner_complete = FALSE; g_signal_connect (G_OBJECT (test_terminate_proxy1), "destroy", G_CALLBACK (test_terminate_proxy1_destroyed_cb), NULL); dbus_g_connection_flush (connection); exit_timeout = g_timeout_add (5000, timed_exit, loop); g_main_loop_run (loop); if (await_terminating_service != NULL) lose ("Didn't see name loss for \"org.freedesktop.DBus.GLib.TestService\""); if (!proxy_destroyed) lose ("Didn't get proxy_destroyed"); if (test_terminate_proxy2) lose ("Duplicate proxy wasn'tdestroyed"); g_print ("Proxy and duplicate destroyed successfully\n"); g_print ("Beginning private connection tests\n"); { DBusGConnection *privconn = dbus_g_bus_get_private (DBUS_BUS_SESSION, NULL, &error); if (privconn == NULL) lose_gerror ("Failed to open private connection to bus", error); g_assert (privconn != connection); proxy = dbus_g_proxy_new_for_name (privconn, "org.freedesktop.DBus.GLib.TestService", "/org/freedesktop/DBus/GLib/Tests/MyTestObject", "org.freedesktop.DBus.GLib.Tests.MyObject"); g_print ("[private connection] Calling (wrapped) do_nothing\n"); if (!org_freedesktop_DBus_GLib_Tests_MyObject_do_nothing (proxy, &error)) lose_gerror ("Failed to complete (wrapped) DoNothing call", error); g_object_unref (G_OBJECT (proxy)); } g_object_unref (G_OBJECT (driver)); g_print ("Successfully completed %s\n", argv[0]); return 0; } dbus-glib-0.100.2/test/core/peer-server.c0000644000175000017500000000233012107524614014755 00000000000000#include #include #include #include #include #include #include "my-object.h" GMainLoop *loop; static void new_connection_func (DBusServer *server, DBusConnection *conn, gpointer user_data) { GObject *obj; obj = g_object_new (MY_TYPE_OBJECT, NULL); dbus_connection_ref (conn); dbus_connection_setup_with_g_main (conn, NULL); dbus_g_connection_register_g_object (dbus_connection_get_g_connection (conn), "/", obj); } int main (int argc, char **argv) { DBusError error; DBusServer *server; char *addr; dbus_error_init (&error); g_thread_init (NULL); dbus_g_thread_init (); g_type_init (); loop = g_main_loop_new (NULL, TRUE); server = dbus_server_listen ("unix:tmpdir=/tmp", &error); if (!server) { g_warning ("Cannot create server: %s", error.message); return 1; } addr = dbus_server_get_address (server); fprintf (stdout, "%s\n", addr); fflush (stdout); free (addr); dbus_server_setup_with_g_main (server, NULL); dbus_server_set_new_connection_function (server, new_connection_func, NULL, NULL); g_main_loop_run (loop); g_main_loop_unref (loop); return 0; } dbus-glib-0.100.2/test/core/test-thread.h0000644000175000017500000000003111634152371014744 00000000000000#define N_TEST_THREADS 5 dbus-glib-0.100.2/test/core/peer-on-bus.c0000644000175000017500000001114012107524614014651 00000000000000/* Regression test for object registration and unregistration * * Copyright © 2009 Collabora Ltd. * Copyright © 2009-2011 Nokia Corporation * * In preparation for dbus-glib relicensing (if it ever happens), this file is * licensed under (at your option) either the AFL v2.1, the GPL v2 or later, * or an MIT/X11-style license: * * Licensed under the Academic Free License version 2.1 * * 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 of the License, or * (at your option) any later version. * * 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 AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ #include #include #include #include "test/lib/util.h" GMainLoop *loop = NULL; typedef struct { DBusGConnection *bus; DBusGConnection *bus2; } Fixture; static void setup (Fixture *f, gconstpointer path_to_use) { f->bus = dbus_g_bus_get_private (DBUS_BUS_SESSION, NULL, NULL); g_assert (f->bus != NULL); f->bus2 = dbus_g_bus_get_private (DBUS_BUS_SESSION, NULL, NULL); g_assert (f->bus2 != NULL); } static void teardown (Fixture *f, gconstpointer test_data G_GNUC_UNUSED) { if (f->bus != NULL) { test_run_until_disconnected (f->bus, NULL); dbus_g_connection_unref (f->bus); } if (f->bus2 != NULL) { test_run_until_disconnected (f->bus2, NULL); dbus_g_connection_unref (f->bus2); } dbus_shutdown (); } static void destroy_cb (DBusGProxy *proxy G_GNUC_UNUSED, gpointer user_data) { gboolean *destroyed = user_data; *destroyed = TRUE; } static void test_name_owner_changed (Fixture *f, gconstpointer test_data G_GNUC_UNUSED) { DBusGProxy *peer; DBusGProxy *named; gboolean destroyed = FALSE; g_test_bug ("41126"); /* bus has a proxy for bus2... */ named = dbus_g_proxy_new_for_name (f->bus, dbus_bus_get_unique_name (dbus_g_connection_get_connection (f->bus2)), "/", "org.freedesktop.DBus.Peer"); /* ... and also a proxy for the peer (i.e. the dbus-daemon) */ peer = dbus_g_proxy_new_for_peer (f->bus, "/", "org.freedesktop.DBus.Peer"); g_signal_connect (G_OBJECT (named), "destroy", G_CALLBACK (destroy_cb), &destroyed); /* Disconnect bus2, to provoke a NameOwnerChanged signal on bus */ test_run_until_disconnected (f->bus2, NULL); dbus_g_connection_unref (f->bus2); f->bus2 = NULL; /* Wait for that NameOwnerChanged to be processed */ while (!destroyed) g_main_context_iteration (NULL, TRUE); g_signal_handlers_disconnect_by_func (named, destroy_cb, &destroyed); /* The first part of the bug was that we'd never get here, because checking * whether 'peer' was affected by the NameOwnerChanged caused a NULL * dereference and segfault. If we get here, all is OK. * * The second part of the bug was that if the last proxy in existence was * for a peer, when it was unregistered there would be no owner_match_rules, * causing a crash. Unref named before peer, to exercise that. */ g_object_unref (named); g_object_unref (peer); } int main (int argc, char **argv) { g_setenv ("DBUS_FATAL_WARNINGS", "1", TRUE); g_type_init (); g_log_set_always_fatal (G_LOG_LEVEL_WARNING | G_LOG_LEVEL_CRITICAL); dbus_g_type_specialized_init (); g_test_bug_base ("https://bugs.freedesktop.org/show_bug.cgi?id="); g_test_init (&argc, &argv, NULL); g_test_add ("/peer-on-bus/name-owner-changed", Fixture, NULL, setup, test_name_owner_changed, teardown); return g_test_run (); } dbus-glib-0.100.2/test/core/registrations.c0000644000175000017500000003360212107524614015421 00000000000000/* Regression test for object registration and unregistration * * Copyright © 2009 Collabora Ltd. * Copyright © 2009-2011 Nokia Corporation * * In preparation for dbus-glib relicensing (if it ever happens), this file is * licensed under (at your option) either the AFL v2.1, the GPL v2 or later, * or an MIT/X11-style license: * * Licensed under the Academic Free License version 2.1 * * 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 of the License, or * (at your option) any later version. * * 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 AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ #include #include #include #include "my-object.h" GMainLoop *loop = NULL; typedef struct { DBusError dbus_error; DBusGConnection *bus; DBusGConnection *bus2; GObject *object; DBusMessage *frobnicate1_message; DBusMessage *frobnicate2_message; gboolean received_objectified; } Fixture; #define assert_no_error(e) _assert_no_error (e, __FILE__, __LINE__) static void _assert_no_error (const DBusError *e, const char *file, int line) { if (G_UNLIKELY (dbus_error_is_set (e))) g_error ("%s:%d: expected success but got error: %s: %s", file, line, e->name, e->message); } static void setup (Fixture *f, gconstpointer path_to_use) { dbus_error_init (&f->dbus_error); f->bus = dbus_g_bus_get_private (DBUS_BUS_SESSION, NULL, NULL); g_assert (f->bus != NULL); f->bus2 = dbus_g_bus_get_private (DBUS_BUS_SESSION, NULL, NULL); g_assert (f->bus2 != NULL); f->object = g_object_new (MY_TYPE_OBJECT, NULL); g_assert (MY_IS_OBJECT (f->object)); } static void teardown (Fixture *f, gconstpointer test_data G_GNUC_UNUSED) { /* we close the connection before releasing the object, to test fd.o #5688 * in test_lookup() */ if (f->bus != NULL) { dbus_connection_close (dbus_g_connection_get_connection (f->bus)); dbus_g_connection_unref (f->bus); } if (f->bus2 != NULL) { dbus_connection_close (dbus_g_connection_get_connection (f->bus2)); dbus_g_connection_unref (f->bus2); } if (f->object != NULL) { g_object_unref (f->object); } /* This is safe to call on an initialized-but-unset DBusError, a bit like * g_clear_error */ dbus_error_free (&f->dbus_error); } static void test_lookup (Fixture *f, gconstpointer test_data G_GNUC_UNUSED) { /* teardown() closes the connection before f->object is destroyed, which * used to be broken */ g_test_bug ("5688"); dbus_g_connection_register_g_object (f->bus, "/foo", f->object); g_assert (dbus_g_connection_lookup_g_object (f->bus, "/foo") == f->object); /* this was briefly broken while fixing fd.o#5688 */ g_assert (dbus_g_connection_lookup_g_object (f->bus, "/bar") == NULL); } static void test_unregister (Fixture *f, gconstpointer test_data G_GNUC_UNUSED) { /* feature test: objects can be unregistered */ g_test_bug ("21219"); dbus_g_connection_register_g_object (f->bus, "/foo", f->object); g_assert (dbus_g_connection_lookup_g_object (f->bus, "/foo") == f->object); dbus_g_connection_unregister_g_object (f->bus, f->object); g_assert (dbus_g_connection_lookup_g_object (f->bus, "/foo") == NULL); } static void test_unregister_on_last_unref (Fixture *f, gconstpointer test_data G_GNUC_UNUSED) { gpointer weak_pointer; weak_pointer = f->object; g_object_add_weak_pointer (weak_pointer, &weak_pointer); dbus_g_connection_register_g_object (f->bus, "/foo", f->object); g_assert (dbus_g_connection_lookup_g_object (f->bus, "/foo") == f->object); /* implicit unregistration by the last-unref of the object */ g_object_unref (f->object); f->object = NULL; g_assert (weak_pointer == NULL); g_assert (dbus_g_connection_lookup_g_object (f->bus, "/foo") == NULL); } static void test_unregister_on_forced_dispose (Fixture *f, gconstpointer test_data G_GNUC_UNUSED) { dbus_g_connection_register_g_object (f->bus, "/foo", f->object); g_assert (dbus_g_connection_lookup_g_object (f->bus, "/foo") == f->object); /* implicit unregistration by dispose() of the object (don't try * this at home) */ g_object_run_dispose (f->object); g_assert (dbus_g_connection_lookup_g_object (f->bus, "/foo") == NULL); } static void test_reregister (Fixture *f, gconstpointer test_data G_GNUC_UNUSED) { dbus_g_connection_register_g_object (f->bus, "/foo", f->object); g_assert (dbus_g_connection_lookup_g_object (f->bus, "/foo") == f->object); /* Before 0.82, re-registering the same object path was leaky but successful. * 0.82 disallowed this behaviour. Since 0.84 it was meant to be allowed * again, and a no-op, but it actually had the effect of removing all * record of the registrations (while leaving the object registered with * libdbus). */ dbus_g_connection_register_g_object (f->bus, "/foo", f->object); g_assert (dbus_g_connection_lookup_g_object (f->bus, "/foo") == f->object); /* This would critical in 0.84. */ dbus_g_connection_unregister_g_object (f->bus, f->object); g_assert (dbus_g_connection_lookup_g_object (f->bus, "/foo") == NULL); } static DBusHandlerResult frobnicate_cb (DBusConnection *conn, DBusMessage *message, void *user_data) { Fixture *f = user_data; if (dbus_message_is_signal (message, "org.freedesktop.DBus.GLib.Tests.MyObject", "Frobnicate")) { const char *sender = dbus_message_get_sender (message); const char *path = dbus_message_get_path (message); g_assert (sender != NULL); g_assert (path != NULL); if (g_strcmp0 (path, "/foo") == 0) { g_assert_cmpstr (sender, ==, dbus_bus_get_unique_name ( dbus_g_connection_get_connection (f->bus))); g_assert (f->frobnicate1_message == NULL); f->frobnicate1_message = dbus_message_ref (message); } else { g_assert_cmpstr (path, ==, "/bar"); g_assert_cmpstr (sender, ==, dbus_bus_get_unique_name ( dbus_g_connection_get_connection (f->bus2))); g_assert (f->frobnicate2_message == NULL); f->frobnicate2_message = dbus_message_ref (message); } } return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; } static void test_twice (Fixture *f, gconstpointer test_data G_GNUC_UNUSED) { dbus_bool_t mem; g_test_bug ("32087"); dbus_g_connection_register_g_object (f->bus, "/foo", f->object); dbus_g_connection_register_g_object (f->bus2, "/bar", f->object); g_assert (dbus_g_connection_lookup_g_object (f->bus, "/foo") == f->object); g_assert (dbus_g_connection_lookup_g_object (f->bus2, "/bar") == f->object); dbus_bus_add_match (dbus_g_connection_get_connection (f->bus), "type='signal'", &f->dbus_error); assert_no_error (&f->dbus_error); mem = dbus_connection_add_filter (dbus_g_connection_get_connection (f->bus), frobnicate_cb, f, NULL); g_assert (mem); my_object_emit_frobnicate ((MyObject *) f->object, NULL); /* The object should emit the signal once onto each connection, * from the appropriate location */ while (f->frobnicate1_message == NULL || f->frobnicate2_message == NULL) g_main_context_iteration (NULL, TRUE); dbus_message_unref (f->frobnicate1_message); f->frobnicate1_message = NULL; dbus_message_unref (f->frobnicate2_message); f->frobnicate2_message = NULL; /* try again, to catch any extra emissions, but first unregister one of the * object's locations */ dbus_g_connection_unregister_g_object (f->bus, f->object); my_object_emit_frobnicate ((MyObject *) f->object, NULL); while (f->frobnicate2_message == NULL) g_main_context_iteration (NULL, TRUE); g_assert (f->frobnicate1_message == NULL); dbus_message_unref (f->frobnicate2_message); f->frobnicate2_message = NULL; } static void test_clean_slate (Fixture *f, gconstpointer test_data G_GNUC_UNUSED) { DBusError e; dbus_bool_t mem; dbus_bus_add_match (dbus_g_connection_get_connection (f->bus), "type='signal'", &f->dbus_error); assert_no_error (&f->dbus_error); mem = dbus_connection_add_filter (dbus_g_connection_get_connection (f->bus), frobnicate_cb, f, NULL); g_assert (mem); dbus_g_connection_register_g_object (f->bus, "/foo", f->object); g_assert (dbus_g_connection_lookup_g_object (f->bus, "/foo") == f->object); my_object_emit_frobnicate ((MyObject *) f->object, NULL); while (f->frobnicate1_message == NULL) g_main_context_iteration (NULL, TRUE); dbus_message_unref (f->frobnicate1_message); f->frobnicate1_message = NULL; /* unregister the object from its last object path, then put it back * in the same location */ dbus_g_connection_unregister_g_object (f->bus, f->object); dbus_g_connection_register_g_object (f->bus, "/foo", f->object); g_assert (dbus_g_connection_lookup_g_object (f->bus, "/foo") == f->object); /* bug: in 0.92, this would be emitted twice because the hook was added * twice */ my_object_emit_frobnicate ((MyObject *) f->object, NULL); while (f->frobnicate1_message == NULL) g_main_context_iteration (NULL, TRUE); dbus_message_unref (f->frobnicate1_message); f->frobnicate1_message = NULL; /* unregister the object from its last object path, then put it back * at a different location */ dbus_g_connection_unregister_g_object (f->bus, f->object); dbus_g_connection_register_g_object (f->bus2, "/bar", f->object); g_assert (dbus_g_connection_lookup_g_object (f->bus2, "/bar") == f->object); my_object_emit_frobnicate ((MyObject *) f->object, NULL); while (f->frobnicate2_message == NULL) g_main_context_iteration (NULL, TRUE); /* check that this wasn't received anyway, which would indicate that * either unregistration from /foo was unsuccessful, or the double * emission mentioned above was seen */ g_assert (f->frobnicate1_message == NULL); dbus_message_unref (f->frobnicate2_message); f->frobnicate2_message = NULL; } static DBusHandlerResult objectified_cb (DBusConnection *conn, DBusMessage *message, void *user_data) { Fixture *f = user_data; if (dbus_message_is_signal (message, "org.freedesktop.DBus.GLib.Tests.MyObject", "Objectified")) { const char *sender = dbus_message_get_sender (message); const char *path = dbus_message_get_path (message); dbus_bool_t ok; DBusError e; dbus_error_init (&e); g_assert (sender != NULL); g_assert (path != NULL); g_assert_cmpstr (path, ==, "/foo"); g_assert_cmpstr (sender, ==, dbus_bus_get_unique_name ( dbus_g_connection_get_connection (f->bus))); path = NULL; ok = dbus_message_get_args (message, &e, DBUS_TYPE_OBJECT_PATH, &path, DBUS_TYPE_INVALID); if (dbus_error_is_set (&e)) g_error ("%s: %s", e.name, e.message); g_assert (ok); g_assert_cmpstr (path, ==, "/foo"); f->received_objectified = TRUE; } return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; } static void test_marshal_object (Fixture *f, gconstpointer test_data G_GNUC_UNUSED) { dbus_bool_t mem; g_test_bug ("37852"); dbus_g_connection_register_g_object (f->bus, "/foo", f->object); g_assert (dbus_g_connection_lookup_g_object (f->bus, "/foo") == f->object); dbus_bus_add_match (dbus_g_connection_get_connection (f->bus), "type='signal'", &f->dbus_error); assert_no_error (&f->dbus_error); mem = dbus_connection_add_filter (dbus_g_connection_get_connection (f->bus), objectified_cb, f, NULL); g_assert (mem); my_object_emit_objectified ((MyObject *) f->object, f->object); while (!f->received_objectified) g_main_context_iteration (NULL, TRUE); } int main (int argc, char **argv) { loop = g_main_loop_new (NULL, FALSE); g_type_init (); g_log_set_always_fatal (G_LOG_LEVEL_WARNING | G_LOG_LEVEL_CRITICAL); dbus_g_type_specialized_init (); g_test_bug_base ("https://bugs.freedesktop.org/show_bug.cgi?id="); g_test_init (&argc, &argv, NULL); g_test_add ("/registrations/lookup", Fixture, NULL, setup, test_lookup, teardown); g_test_add ("/registrations/unregister", Fixture, NULL, setup, test_unregister, teardown); g_test_add ("/registrations/unregister-on-last-unref", Fixture, NULL, setup, test_unregister_on_last_unref, teardown); g_test_add ("/registrations/unregister-on-forced-dispose", Fixture, NULL, setup, test_unregister_on_forced_dispose, teardown); g_test_add ("/registrations/reregister", Fixture, NULL, setup, test_reregister, teardown); g_test_add ("/registrations/twice", Fixture, NULL, setup, test_twice, teardown); g_test_add ("/registrations/clean-slate", Fixture, NULL, setup, test_clean_slate, teardown); g_test_add ("/registrations/marshal-object", Fixture, NULL, setup, test_marshal_object, teardown); return g_test_run (); } dbus-glib-0.100.2/test/core/test-thread-server.c0000644000175000017500000001157612107524614016262 00000000000000#include #include #include #include #include #include "test-thread.h" typedef struct { guint32 counters[N_TEST_THREADS]; } ThreadTestData; static ThreadTestData * thread_test_data_new (void) { ThreadTestData *data; data = g_new0 (ThreadTestData, 1); return data; } static void thread_test_data_free (ThreadTestData *data) { g_free (data); } static DBusHandlerResult filter_test_message (DBusConnection *connection, DBusMessage *message, void *user_data) { ThreadTestData *data = user_data; DBusMessageIter iter; gint32 threadnr; guint32 counter; const char *str; char *expected_str; GString *counter_str; int i; if (!dbus_message_is_method_call (message, "org.freedesktop.DBus.GLib.ThreadTest", "TestMethod")) return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; dbus_message_iter_init (message, &iter); if (dbus_message_iter_get_arg_type (&iter) != DBUS_TYPE_INT32) { g_print ("First arg not right type\n"); goto out; } dbus_message_iter_get_basic (&iter, &threadnr); if (threadnr < 0 || threadnr >= N_TEST_THREADS) { g_print ("Invalid thread nr\n"); goto out; } if (! dbus_message_iter_next (&iter)) { g_print ("Couldn't get second arg\n"); goto out; } if (dbus_message_iter_get_arg_type (&iter) != DBUS_TYPE_INT32) { g_print ("Second arg not right type\n"); goto out; } dbus_message_iter_get_basic (&iter, &counter); if (counter != data->counters[threadnr]) { g_print ("Thread %d, counter %d, expected %d\n", threadnr, counter, data->counters[threadnr]); goto out; } data->counters[threadnr]++; if (! dbus_message_iter_next (&iter)) { g_print ("Couldn't get third arg\n"); goto out; } if (dbus_message_iter_get_arg_type (&iter) != DBUS_TYPE_STRING) { g_print ("Third arg not right type\n"); goto out; } dbus_message_iter_get_basic (&iter, &str); if (str == NULL) { g_print ("No third arg\n"); goto out; } expected_str = g_strdup_printf ("Thread %d-%d\n", threadnr, counter); if (strcmp (expected_str, str) != 0) { g_print ("Wrong string '%s', expected '%s'\n", str, expected_str); g_free (expected_str); goto out; } g_free (expected_str); if (dbus_message_iter_next (&iter)) { g_print ("Extra args on end of message\n"); goto out; } dbus_connection_flush (connection); counter_str = g_string_new (""); for (i = 0; i < N_TEST_THREADS; i++) { g_string_append_printf (counter_str, "%d ", data->counters[i]); } g_print ("%s\r", counter_str->str); g_string_free (counter_str, TRUE); out: return DBUS_HANDLER_RESULT_HANDLED; } static DBusHandlerResult filter_disconnect (DBusConnection *connection, DBusMessage *message, void *user_data) { if (!dbus_message_is_signal (message, DBUS_INTERFACE_LOCAL, "Disconnected")) return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; g_print ("connection disconnected\n"); dbus_connection_unref (connection); return DBUS_HANDLER_RESULT_HANDLED; } static void new_connection_callback (DBusServer *server, DBusConnection *new_connection, void *user_data) { ThreadTestData * data; g_print ("new_connection_callback\n"); dbus_connection_ref (new_connection); dbus_connection_setup_with_g_main (new_connection, NULL); data = thread_test_data_new (); if (!dbus_connection_add_filter (new_connection, filter_test_message, data, (DBusFreeFunction) thread_test_data_free)) goto nomem; if (!dbus_connection_add_filter (new_connection, filter_disconnect, NULL, NULL)) goto nomem; return; nomem: g_error ("no memory to setup new connection"); } int main (int argc, char *argv[]) { GMainLoop *loop; DBusServer *server; DBusError error; g_thread_init (NULL); dbus_g_thread_init (); if (argc < 2) { fprintf (stderr, "Give the server address as an argument\n"); return 1; } dbus_error_init (&error); server = dbus_server_listen (argv[1], &error); if (server == NULL) { fprintf (stderr, "Failed to start server on %s: %s\n", argv[1], error.message); dbus_error_free (&error); return 1; } dbus_server_set_new_connection_function (server, new_connection_callback, NULL, NULL); dbus_server_setup_with_g_main (server, NULL); loop = g_main_loop_new (NULL, FALSE); g_main_loop_run (loop); return 0; } dbus-glib-0.100.2/test/core/test-service-glib.c0000644000175000017500000000642012107524614016052 00000000000000#include /* -*- mode: C; c-file-style: "gnu" -*- */ #include /* NOTE - outside of D-BUS core this would be * include */ #include "tools/dbus-glib-bindings.h" #include #include #include #include #include #include "my-object.h" #include "my-object-subclass.h" static GObject *obj; static GObject *obj2; static GObject *subobj; GMainLoop *loop; #define TEST_SERVICE_NAME "org.freedesktop.DBus.GLib.TestService" int main (int argc, char **argv) { DBusGConnection *connection; GError *error; DBusGProxy *driver_proxy; guint32 request_name_ret; g_type_init (); g_thread_init (NULL); dbus_g_thread_init (); dbus_g_error_domain_register (MY_OBJECT_ERROR, NULL, MY_TYPE_ERROR); g_printerr ("Launching test-service-glib\n"); loop = g_main_loop_new (NULL, FALSE); { GLogLevelFlags fatal_mask; fatal_mask = g_log_set_always_fatal (G_LOG_FATAL_MASK); fatal_mask |= G_LOG_LEVEL_WARNING | G_LOG_LEVEL_CRITICAL; g_log_set_always_fatal (fatal_mask); } error = NULL; connection = dbus_g_bus_get (DBUS_BUS_STARTER, &error); if (connection == NULL) { g_printerr ("Failed to open connection to bus: %s\n", error->message); g_error_free (error); exit (1); } obj = g_object_new (MY_TYPE_OBJECT, NULL); obj2 = g_object_new (MY_TYPE_OBJECT, NULL); subobj = g_object_new (MY_TYPE_OBJECT_SUBCLASS, NULL); dbus_g_connection_register_g_object (connection, "/org/freedesktop/DBus/GLib/Tests/MyTestObject", obj); /* Register a second time; we want the object to also be reachable through this interface */ dbus_g_connection_register_g_object (connection, "/org/freedesktop/DBus/GLib/Tests/Compat/MyTestObjectCompat", obj); dbus_g_connection_register_g_object (connection, "/org/freedesktop/DBus/GLib/Tests/MyTestObject2", obj2); dbus_g_connection_register_g_object (connection, "/org/freedesktop/DBus/GLib/Tests/MyTestObjectSubclass", subobj); driver_proxy = dbus_g_proxy_new_for_name (connection, DBUS_SERVICE_DBUS, DBUS_PATH_DBUS, DBUS_INTERFACE_DBUS); if (!org_freedesktop_DBus_request_name (driver_proxy, TEST_SERVICE_NAME, 0, &request_name_ret, &error)) { g_assert (error != NULL); g_printerr ("Failed to get name: %s\n", error->message); g_clear_error (&error); exit (1); } if (!(request_name_ret == DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER)) { g_printerr ("Got result code %u from requesting name\n", request_name_ret); exit (1); } g_printerr ("GLib test service has name '%s'\n", TEST_SERVICE_NAME); g_printerr ("GLib test service entering main loop\n"); g_main_loop_run (loop); g_printerr ("Successfully completed %s\n", argv[0]); return 0; } dbus-glib-0.100.2/test/core/my-object-subclass.c0000644000175000017500000000664112107524563016240 00000000000000#include #include #include #include #include "my-object-subclass.h" #include "test-service-glib-subclass-glue.h" /* Properties */ enum { PROP_0, PROP_THIS_IS_A_SUBCLASS_STRING, PROP_THIS_IS_A_SUBCLASS_UINT }; G_DEFINE_TYPE(MyObjectSubclass, my_object_subclass, MY_TYPE_OBJECT) static void my_object_subclass_finalize (GObject *object) { MyObjectSubclass *mobject = MY_OBJECT_SUBCLASS (object); g_free (mobject->this_is_a_subclass_string); (G_OBJECT_CLASS (my_object_subclass_parent_class)->finalize) (object); } static void my_object_subclass_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) { MyObjectSubclass *mobject; mobject = MY_OBJECT_SUBCLASS (object); switch (prop_id) { case PROP_THIS_IS_A_SUBCLASS_STRING: g_free (mobject->this_is_a_subclass_string); mobject->this_is_a_subclass_string = g_value_dup_string (value); break; case PROP_THIS_IS_A_SUBCLASS_UINT: mobject->this_is_a_subclass_uint = g_value_get_uint (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } } static void my_object_subclass_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) { MyObjectSubclass *mobject; mobject = MY_OBJECT_SUBCLASS (object); switch (prop_id) { case PROP_THIS_IS_A_SUBCLASS_STRING: g_value_set_string (value, mobject->this_is_a_subclass_string); break; case PROP_THIS_IS_A_SUBCLASS_UINT: g_value_set_uint (value, mobject->this_is_a_subclass_uint); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } } static void my_object_subclass_init (MyObjectSubclass *obj) { } static void my_object_subclass_class_init (MyObjectSubclassClass *mobject_class) { GObjectClass *gobject_class = G_OBJECT_CLASS (mobject_class); dbus_g_object_type_install_info (MY_TYPE_OBJECT_SUBCLASS, &dbus_glib_my_object_subclass_object_info); gobject_class->finalize = my_object_subclass_finalize; gobject_class->set_property = my_object_subclass_set_property; gobject_class->get_property = my_object_subclass_get_property; g_object_class_install_property (gobject_class, PROP_THIS_IS_A_SUBCLASS_STRING, g_param_spec_string ("this_is_a_subclass_string", _("Sample string"), _("Example of a string property"), "default subclass value", G_PARAM_READWRITE | G_PARAM_CONSTRUCT)); g_object_class_install_property (gobject_class, PROP_THIS_IS_A_SUBCLASS_UINT, g_param_spec_uint ("this_is_a_subclass_uint", _("Sample uint"), _("Example of a uint property"), 0, G_MAXUINT32, 1234567, G_PARAM_READWRITE | G_PARAM_CONSTRUCT)); } dbus-glib-0.100.2/test/core/test-variant-recursion.c0000644000175000017500000000613712107524614017157 00000000000000#include /* -*- mode: C; c-file-style: "gnu" -*- */ #include #include #include #include #include #include static gboolean make_recursive_stringify_call (int recursion_depth, DBusGProxy *proxy, GError **error) { char *out_str; int i; GValue *vals = g_new0 (GValue, recursion_depth+1); for (i = recursion_depth-1; i >= 0; i--) { GValue *curval = &(vals[i]); g_value_init (curval, G_TYPE_VALUE); } for (i = 0; i < recursion_depth; i++) { GValue *curval = &(vals[i]); GValue *nextval = &(vals[i+1]); g_value_take_boxed (curval, nextval); } g_value_init (&(vals[recursion_depth]), G_TYPE_STRING); g_value_set_string (&(vals[recursion_depth]), "end of the line"); return dbus_g_proxy_call (proxy, "Stringify", error, G_TYPE_VALUE, &(vals[0]), G_TYPE_INVALID, G_TYPE_STRING, &out_str, G_TYPE_INVALID); } int main (int argc, char **argv) { DBusGConnection *connection; GError *error = NULL; DBusGProxy *proxy; GMainLoop *loop; g_type_init (); g_log_set_always_fatal (G_LOG_LEVEL_WARNING | G_LOG_LEVEL_CRITICAL); loop = g_main_loop_new (NULL, FALSE); connection = dbus_g_bus_get (DBUS_BUS_SESSION, &error); if (connection == NULL) g_error ("Failed to open connection to bus: %s", error->message); proxy = dbus_g_proxy_new_for_name (connection, "org.freedesktop.DBus.GLib.TestService", "/org/freedesktop/DBus/GLib/Tests/MyTestObject", "org.freedesktop.DBus.GLib.Tests.MyObject"); if (proxy == NULL) g_error ("Failed to create proxy for name owner: %s", error->message); /* Do an echo to be sure it started */ if (!dbus_g_proxy_call (proxy, "DoNothing", &error, G_TYPE_INVALID, G_TYPE_INVALID)) g_error ("Failed to complete DoNothing call: %s", error->message); /* Fewer than the current internal limit (16) */ if (make_recursive_stringify_call (10, proxy, &error)) g_error ("Unexpected success code from 10 recursive variant call: %s", error->message); if (error->code != DBUS_GERROR_REMOTE_EXCEPTION) g_error ("Error code was not remote exception: %s", error->message); g_printerr ("Got expected error %d: \"%s\" from recursive variant call\n", error->code, error->message); g_clear_error (&error); /* More than the current internal limit (16) */ if (make_recursive_stringify_call (50, proxy, &error)) g_error ("Unexpected success code from 50 recursive variant call: %s", error->message); if (error->code != DBUS_GERROR_REMOTE_EXCEPTION) g_error ("Error code was not remote exception: %s", error->message); g_printerr ("Got expected error %d: \"%s\" from recursive variant call\n", error->code, error->message); g_clear_error (&error); g_object_unref (G_OBJECT (proxy)); g_main_loop_unref (loop); return 0; } dbus-glib-0.100.2/test/core/my-object-marshal.list0000644000175000017500000000005111634152371016564 00000000000000NONE:STRING,INT,STRING NONE:STRING,BOXED dbus-glib-0.100.2/test/core/test-thread-client.c0000644000175000017500000000437712107524614016233 00000000000000#include #include #include #include #include #include #include "test-thread.h" DBusConnection *connection; static gpointer thread_func (gpointer data) { gint32 threadnr = GPOINTER_TO_INT (data); guint32 counter = 0; DBusMessageIter iter; DBusMessage *message; char *str; while (1) { message = dbus_message_new_method_call (NULL, "/org/freedesktop/DBus/GLib/ThreadTest", "org.freedesktop.DBus.GLib.ThreadTest", "TestMethod"); dbus_message_iter_init_append (message, &iter); if (!dbus_message_iter_append_basic (&iter, DBUS_TYPE_INT32, &threadnr)) { g_print ("thread %d: append threadnr failed\n", threadnr); } if (!dbus_message_iter_append_basic (&iter, DBUS_TYPE_INT32, &counter)) { g_print ("thread %d: append counter (%d) failed\n", threadnr, counter); } str = g_strdup_printf ("Thread %d-%d\n", threadnr, counter); if (!dbus_message_iter_append_basic (&iter, DBUS_TYPE_STRING, &str)) { g_print ("thread %d: append string (%s) failed\n", threadnr, str); } g_free (str); if (!dbus_connection_send (connection, message, NULL)) { g_print ("thread %d: send message failed\n", threadnr); } dbus_message_unref (message); counter ++; } return NULL; } int main (int argc, char *argv[]) { GMainLoop *loop; DBusError error; int i; g_thread_init (NULL); dbus_g_thread_init (); if(argc < 2) { g_error("Need an address as argv[1]\n"); return 1; } dbus_error_init (&error); connection = dbus_connection_open (argv[1], &error); if (connection == NULL) { g_printerr ("could not open connection: %s\n", error.message); dbus_error_free (&error); return 1; } dbus_connection_setup_with_g_main (connection, NULL); for (i = 0; i < N_TEST_THREADS; i++) { g_thread_create (thread_func, GINT_TO_POINTER (i), FALSE, NULL); } loop = g_main_loop_new (NULL, FALSE); g_main_loop_run (loop); return 0; } dbus-glib-0.100.2/test/core/test-service-glib.xml0000644000175000017500000001243412107524614016432 00000000000000 dbus-glib-0.100.2/test/core/run-peer-test.sh0000755000175000017500000000032211634152371015423 00000000000000#!/bin/sh set -e # The peer server writes its address over stdout, which the client reads ${DBUS_TOP_BUILDDIR}/libtool --mode=execute ./peer-server | ${DBUS_TOP_BUILDDIR}/libtool --mode=execute ./peer-client dbus-glib-0.100.2/test/core/test-service-glib-subclass.xml0000644000175000017500000000054212107524563020247 00000000000000 dbus-glib-0.100.2/test/core/30574.c0000644000175000017500000000530712107524614013207 00000000000000#include #include #include #include #include #include DBusConnection *bus; GMainContext *main_context; typedef struct _SpiReentrantCallClosure { GMainLoop *loop; DBusMessage *reply; } SpiReentrantCallClosure; static void set_reply (DBusPendingCall * pending, void *user_data) { SpiReentrantCallClosure* closure = (SpiReentrantCallClosure *) user_data; closure->reply = dbus_pending_call_steal_reply (pending); dbus_connection_setup_with_g_main (bus, NULL); g_main_loop_quit (closure->loop); } static DBusMessage * send_and_allow_reentry (DBusConnection * bus, DBusMessage * message) { DBusPendingCall *pending; SpiReentrantCallClosure closure; closure.loop = g_main_loop_new (main_context, FALSE); dbus_connection_setup_with_g_main (bus, main_context); if (!dbus_connection_send_with_reply (bus, message, &pending, 3000)) { dbus_connection_setup_with_g_main (bus, NULL); return NULL; } dbus_pending_call_set_notify (pending, set_reply, (void *) &closure, NULL); g_main_loop_run (closure.loop); g_main_loop_unref (closure.loop); return closure.reply; } int main(int argc, const char *argv[]) { DBusError error; DBusMessage *message = NULL, *reply = NULL; const char *str; main_context = g_main_context_new (); dbus_error_init (&error); bus = dbus_bus_get (DBUS_BUS_SESSION, &error); if (!bus) { fprintf(stderr, "Couldn't connect to bus: %s\n", error.name); return 1; } dbus_connection_setup_with_g_main (bus, NULL); message = dbus_message_new_method_call ("org.freedesktop.DBus", "/org/freedesktop/DBus", DBUS_INTERFACE_DBUS, "GetId"); reply = send_and_allow_reentry (bus, message); if (dbus_message_get_type (reply) == DBUS_MESSAGE_TYPE_ERROR) { char *err; dbus_message_get_args (reply, NULL, DBUS_TYPE_STRING, &err, DBUS_TYPE_INVALID); fprintf (stderr, "Got error: %s\n", err); return 1; } dbus_message_unref (reply); dbus_message_unref (message); message = dbus_message_new_method_call ("org.freedesktop.DBus", "/org/freedesktop/DBus", DBUS_INTERFACE_DBUS, "GetId"); reply = send_and_allow_reentry (bus, message); if (!reply) { fprintf(stderr, "Sorry; dbus wouldn't answer me: %s\n", error.message); exit(1); } if (dbus_message_get_type (reply) == DBUS_MESSAGE_TYPE_ERROR) { char *err; dbus_message_get_args (reply, NULL, DBUS_TYPE_STRING, &err, DBUS_TYPE_INVALID); fprintf (stderr, "Got error: %s\n", err); return 1; } if (!dbus_message_get_args (reply, &error, DBUS_TYPE_STRING, &str, DBUS_TYPE_INVALID)) { fprintf(stderr, "Sorry; can't communicate: %s\n", error.message); exit(1); } return 0; } dbus-glib-0.100.2/test/core/test-gvariant.c0000644000175000017500000007124112107524614015315 00000000000000/* GVariant to dbus-glib escape hatch * * Copyright © 2010 Collabora Ltd. * * Licensed under the Academic Free License version 2.1 * * 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 of the License, or * (at your option) any later version. * * Alternatively, at your option, you can redistribute and/or modify * this single file under the terms of the GNU Lesser General Public License * as published by the Free Software Foundation; either version 2.1 of * that 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * */ #include #include #include /** * test_g_variant_equivalent: * * The function g_variant_equal() cannot be used for dictionaries because it * cares about the ordering of dictionaries, which breaks our tests. */ static gboolean test_g_variant_equivalent (GVariant *one, GVariant *two) { if (!g_variant_type_equal ( g_variant_get_type (one), g_variant_get_type (two))) { return FALSE; } else if (g_variant_is_of_type (one, G_VARIANT_TYPE_DICTIONARY) && g_variant_is_of_type (two, G_VARIANT_TYPE_DICTIONARY)) { GHashTable *hash; GVariantIter iter; GVariant *child; gboolean equal = TRUE; if (g_variant_n_children (one) != g_variant_n_children (two)) return FALSE; /* pack @one into a hash table */ hash = g_hash_table_new_full (g_variant_hash, g_variant_equal, (GDestroyNotify) g_variant_unref, (GDestroyNotify) g_variant_unref); g_variant_iter_init (&iter, one); while ((child = g_variant_iter_next_value (&iter))) { g_hash_table_insert (hash, g_variant_get_child_value (child, 0), g_variant_get_child_value (child, 1)); g_variant_unref (child); } /* now iterate @two to check for the keys in @hash */ g_variant_iter_init (&iter, two); while (equal && (child = g_variant_iter_next_value (&iter))) { GVariant *k, *v1, *v2; k = g_variant_get_child_value (child, 0); v1 = g_variant_get_child_value (child, 1); v2 = g_hash_table_lookup (hash, k); if (v2 == NULL || !test_g_variant_equivalent (v1, v2)) equal = FALSE; else g_hash_table_remove (hash, k); g_variant_unref (k); g_variant_unref (v1); g_variant_unref (child); } if (g_hash_table_size (hash) > 0) equal = FALSE; g_hash_table_destroy (hash); return equal; } else if (g_variant_is_container (one) && g_variant_is_container (two)) { guint i, size; gboolean equal = TRUE; if (g_variant_n_children (one) != g_variant_n_children (two)) return FALSE; size = g_variant_n_children (one); for (i = 0; equal && i < size; i++) { GVariant *child1, *child2; child1 = g_variant_get_child_value (one, i); child2 = g_variant_get_child_value (two, i); equal = test_g_variant_equivalent (child1, child2); g_variant_unref (child1); g_variant_unref (child2); } return equal; } else { return g_variant_equal (one, two); } } #define assert_g_variant_equivalent(a,e) \ assert_g_variant_equivalent_internal (__FILE__, __LINE__, \ #a, a, #e, e) static void assert_g_variant_equivalent_internal ( const gchar *file, gint line, const gchar *actual_name, GVariant *actual, const gchar *expected_name, GVariant *expected); static void assert_g_variant_equivalent_internal (const gchar *file, gint line, const gchar *actual_name, GVariant *actual, const gchar *expected_name, GVariant *expected) { if (!test_g_variant_equivalent (actual, expected)) { gchar *a = g_variant_print (actual, TRUE); gchar *e = g_variant_print (expected, TRUE); g_error ("%s:%d: Variants should have been equal:\n" "%s = %s\n" "%s = %s", file, line, actual_name, a, expected_name, e); /* no point in freeing the strings, we've just crashed anyway */ } } /* test_g_variant_equivalent tests */ static void test_simple_equiv (void) { GVariant *v1, *v2; v1 = g_variant_new_int32 (1984); v2 = g_variant_new_int32 (1984); g_assert (test_g_variant_equivalent (v1, v2)); g_variant_unref (v1); g_variant_unref (v2); } static void test_simple_not_equiv (void) { GVariant *v1, *v2; v1 = g_variant_new_int32 (1982); v2 = g_variant_new_int32 (1984); g_assert (!test_g_variant_equivalent (v1, v2)); g_variant_unref (v1); g_variant_unref (v2); } static void test_array_not_equiv (void) { GVariantBuilder b; GVariant *v1, *v2; g_variant_builder_init (&b, G_VARIANT_TYPE ("av")); g_variant_builder_add (&b, "v", g_variant_new_int32 (1984)); g_variant_builder_add (&b, "v", g_variant_new_string ("Orwell")); g_variant_builder_add (&b, "v", g_variant_new_object_path ("/cats/escher")); v1 = g_variant_builder_end (&b); g_variant_builder_init (&b, G_VARIANT_TYPE ("av")); /* note the order has changed */ g_variant_builder_add (&b, "v", g_variant_new_string ("Orwell")); g_variant_builder_add (&b, "v", g_variant_new_int32 (1984)); g_variant_builder_add (&b, "v", g_variant_new_object_path ("/cats/escher")); v2 = g_variant_builder_end (&b); g_assert (!test_g_variant_equivalent (v1, v2)); g_variant_unref (v1); g_variant_unref (v2); } static void test_map_equiv (void) { GVariantBuilder b; GVariant *v1, *v2; g_variant_builder_init (&b, G_VARIANT_TYPE ("a{os}")); g_variant_builder_add (&b, "{os}", "/cats/escher", "Escher Moonbeam"); g_variant_builder_add (&b, "{os}", "/cats/harvey", "Harvey Nomcat"); g_variant_builder_add (&b, "{os}", "/cats/josh", "Josh Smith"); v1 = g_variant_builder_end (&b); g_variant_builder_init (&b, G_VARIANT_TYPE ("a{os}")); /* note the order has changed */ g_variant_builder_add (&b, "{os}", "/cats/harvey", "Harvey Nomcat"); g_variant_builder_add (&b, "{os}", "/cats/escher", "Escher Moonbeam"); g_variant_builder_add (&b, "{os}", "/cats/josh", "Josh Smith"); v2 = g_variant_builder_end (&b); g_assert (test_g_variant_equivalent (v1, v2)); g_variant_unref (v1); g_variant_unref (v2); } static void test_map_not_equiv1 (void) { GVariantBuilder b; GVariant *v1, *v2; g_variant_builder_init (&b, G_VARIANT_TYPE ("a{os}")); g_variant_builder_add (&b, "{os}", "/cats/escher", "Escher Moonbeam"); g_variant_builder_add (&b, "{os}", "/cats/harvey", "Harvey Nomcat"); g_variant_builder_add (&b, "{os}", "/cats/josh", "Josh Smith"); v1 = g_variant_builder_end (&b); g_variant_builder_init (&b, G_VARIANT_TYPE ("a{os}")); g_variant_builder_add (&b, "{os}", "/cats/escher", "Escher Moonbeam"); g_variant_builder_add (&b, "{os}", "/cats/harvey", "Harvey Nomcat"); g_variant_builder_add (&b, "{os}", "/cats/josh", "Josh Smith"); g_variant_builder_add (&b, "{os}", "/cats/rory", "Rory Cat"); v2 = g_variant_builder_end (&b); g_assert (!test_g_variant_equivalent (v1, v2)); g_variant_unref (v1); g_variant_unref (v2); } static void test_map_not_equiv2 (void) { GVariantBuilder b; GVariant *v1, *v2; g_variant_builder_init (&b, G_VARIANT_TYPE ("a{os}")); g_variant_builder_add (&b, "{os}", "/cats/escher", "Escher Moonbeam"); g_variant_builder_add (&b, "{os}", "/cats/harvey", "Harvey Nomcat"); g_variant_builder_add (&b, "{os}", "/cats/josh", "Josh Smith"); v1 = g_variant_builder_end (&b); g_variant_builder_init (&b, G_VARIANT_TYPE ("a{os}")); g_variant_builder_add (&b, "{os}", "/cats/escher", "Escher Moonbeam"); g_variant_builder_add (&b, "{os}", "/cats/harvey", "Harvey Nomcat"); g_variant_builder_add (&b, "{os}", "/cats/josh", "Josh Cat"); v2 = g_variant_builder_end (&b); g_assert (!test_g_variant_equivalent (v1, v2)); g_variant_unref (v1); g_variant_unref (v2); } /* dbus_g_value_build_g_variant tests */ static void test_i (void) { GValue v = { 0, }; GVariant *var, *varc; g_value_init (&v, G_TYPE_INT); g_value_set_int (&v, 1984); var = dbus_g_value_build_g_variant (&v); g_value_unset (&v); varc = g_variant_new_int32 (1984); g_assert (test_g_variant_equivalent (var, varc)); g_variant_unref (var); g_variant_unref (varc); } static void test_s (void) { GValue v = { 0, }; GVariant *var, *varc; g_value_init (&v, G_TYPE_STRING); g_value_set_static_string (&v, "Orwell"); var = dbus_g_value_build_g_variant (&v); g_value_unset (&v); varc = g_variant_new_string ("Orwell"); g_assert (test_g_variant_equivalent (var, varc)); g_variant_unref (var); g_variant_unref (varc); } static void test_o (void) { GValue v = { 0, }; GVariant *var, *varc; g_value_init (&v, DBUS_TYPE_G_OBJECT_PATH); g_value_set_boxed (&v, "/cats/escher"); var = dbus_g_value_build_g_variant (&v); g_value_unset (&v); varc = g_variant_new_object_path ("/cats/escher"); g_assert (test_g_variant_equivalent (var, varc)); g_variant_unref (var); g_variant_unref (varc); } static void test_us (void) { GValue v = { 0, }; GVariant *var, *varc; GType us = dbus_g_type_get_struct ("GValueArray", G_TYPE_UINT, G_TYPE_STRING, G_TYPE_INVALID); g_value_init (&v, us); g_value_take_boxed (&v, dbus_g_type_specialized_construct (us)); dbus_g_type_struct_set (&v, 0, 1984, 1, "Orwell", G_MAXUINT); var = dbus_g_value_build_g_variant (&v); g_value_unset (&v); varc = g_variant_new ("(us)", 1984, "Orwell"); g_assert (test_g_variant_equivalent (var, varc)); g_variant_unref (var); g_variant_unref (varc); } static void test_a_os (void) { GValue v = { 0, }; GHashTable *map; GVariantBuilder b; GVariant *var, *varc; GType a_os = dbus_g_type_get_map ("GHashTable", DBUS_TYPE_G_OBJECT_PATH, G_TYPE_STRING); g_value_init (&v, a_os); map = dbus_g_type_specialized_construct (a_os); g_hash_table_insert (map, g_strdup ("/cats/escher"), g_strdup ("Escher Moonbeam")); g_hash_table_insert (map, g_strdup ("/cats/harvey"), g_strdup ("Harvey Nomcat")); g_hash_table_insert (map, g_strdup ("/cats/josh"), g_strdup ("Josh Smith")); g_value_take_boxed (&v, map); var = dbus_g_value_build_g_variant (&v); g_value_unset (&v); g_variant_builder_init (&b, G_VARIANT_TYPE ("a{os}")); g_variant_builder_add (&b, "{os}", "/cats/escher", "Escher Moonbeam"); g_variant_builder_add (&b, "{os}", "/cats/harvey", "Harvey Nomcat"); g_variant_builder_add (&b, "{os}", "/cats/josh", "Josh Smith"); varc = g_variant_builder_end (&b); g_assert (test_g_variant_equivalent (var, varc)); g_variant_unref (var); g_variant_unref (varc); } static void test_av (void) { GValue v = { 0, }, *v2; GVariantBuilder b; GVariant *var, *varc; GType av = dbus_g_type_get_collection ("GPtrArray", G_TYPE_VALUE); GPtrArray *array; g_value_init (&v, av); array = dbus_g_type_specialized_construct (av); v2 = g_new0 (GValue, 1); g_value_init (v2, G_TYPE_INT); g_value_set_int (v2, 1984); g_ptr_array_add (array, v2); v2 = g_new0 (GValue, 1); g_value_init (v2, G_TYPE_STRING); g_value_set_static_string (v2, "Orwell"); g_ptr_array_add (array, v2); v2 = g_new0 (GValue, 1); g_value_init (v2, DBUS_TYPE_G_OBJECT_PATH); g_value_set_boxed (v2, "/cats/escher"); g_ptr_array_add (array, v2); g_value_take_boxed (&v, array); var = dbus_g_value_build_g_variant (&v); g_value_unset (&v); g_variant_builder_init (&b, G_VARIANT_TYPE ("av")); g_variant_builder_add (&b, "v", g_variant_new_int32 (1984)); g_variant_builder_add (&b, "v", g_variant_new_string ("Orwell")); g_variant_builder_add (&b, "v", g_variant_new_object_path ("/cats/escher")); varc = g_variant_builder_end (&b); g_assert (test_g_variant_equivalent (var, varc)); g_variant_unref (var); g_variant_unref (varc); } static void test_ab (void) { GValue v = { 0, }; gboolean bools[] = { TRUE, FALSE }; GVariantBuilder b; GVariant *var, *varc; GType ab = dbus_g_type_get_collection ("GArray", G_TYPE_BOOLEAN); GArray *array; g_value_init (&v, ab); array = dbus_g_type_specialized_construct (ab); g_array_append_vals (array, bools, 2); g_assert_cmpint (g_array_index (array, gboolean, 0), ==, TRUE); g_assert_cmpint (g_array_index (array, gboolean, 1), ==, FALSE); g_value_take_boxed (&v, array); var = dbus_g_value_build_g_variant (&v); g_value_unset (&v); g_variant_builder_init (&b, G_VARIANT_TYPE ("ab")); g_variant_builder_add (&b, "b", TRUE); g_variant_builder_add (&b, "b", FALSE); varc = g_variant_builder_end (&b); g_assert (test_g_variant_equivalent (var, varc)); g_variant_unref (var); g_variant_unref (varc); } static void test_ai (void) { GValue v = { 0, }; gint ints[] = { 1984, 1066 }; GVariantBuilder b; GVariant *var, *varc; GType ai = dbus_g_type_get_collection ("GArray", G_TYPE_INT); GArray *array; g_value_init (&v, ai); array = dbus_g_type_specialized_construct (ai); g_array_append_vals (array, ints, 2); g_assert_cmpint (g_array_index (array, gint, 0), ==, 1984); g_assert_cmpint (g_array_index (array, gint, 1), ==, 1066); g_value_take_boxed (&v, array); var = dbus_g_value_build_g_variant (&v); g_value_unset (&v); g_variant_builder_init (&b, G_VARIANT_TYPE ("ai")); g_variant_builder_add (&b, "i", 1984); g_variant_builder_add (&b, "i", 1066); varc = g_variant_builder_end (&b); g_assert (test_g_variant_equivalent (var, varc)); g_variant_unref (var); g_variant_unref (varc); } static void test_au (void) { GValue v = { 0, }; guint uints[] = { 1984, 1066 }; GVariantBuilder b; GVariant *var, *varc; GType au = dbus_g_type_get_collection ("GArray", G_TYPE_UINT); GArray *array; g_value_init (&v, au); array = dbus_g_type_specialized_construct (au); g_array_append_vals (array, uints, 2); g_assert_cmpuint (g_array_index (array, guint, 0), ==, 1984); g_assert_cmpuint (g_array_index (array, guint, 1), ==, 1066); g_value_take_boxed (&v, array); var = dbus_g_value_build_g_variant (&v); g_value_unset (&v); g_variant_builder_init (&b, G_VARIANT_TYPE ("au")); g_variant_builder_add (&b, "u", 1984); g_variant_builder_add (&b, "u", 1066); varc = g_variant_builder_end (&b); g_assert (test_g_variant_equivalent (var, varc)); g_variant_unref (var); g_variant_unref (varc); } static void test_ax (void) { GValue v = { 0, }; gint64 ints[] = { G_GINT64_CONSTANT (-0xAAABBBBCCCCDDDD), 1066 }; GVariantBuilder b; GVariant *var, *varc; GType ax = dbus_g_type_get_collection ("GArray", G_TYPE_INT64); GArray *array; g_value_init (&v, ax); array = dbus_g_type_specialized_construct (ax); g_array_append_vals (array, ints, 2); g_assert_cmpint ((g_array_index (array, gint64, 0) / G_GINT64_CONSTANT (0x100000000)), ==, -0xAAABBBB); g_assert_cmpuint ((-(g_array_index (array, gint64, 0))) % G_GINT64_CONSTANT (0x100000000), ==, 0xCCCCDDDDu); g_assert_cmpint ((g_array_index (array, gint64, 1) / G_GINT64_CONSTANT (0x100000000)), ==, 0); g_assert_cmpuint ((g_array_index (array, gint64, 1)) % G_GINT64_CONSTANT (0x100000000), ==, 1066); g_value_take_boxed (&v, array); var = dbus_g_value_build_g_variant (&v); g_value_unset (&v); g_variant_builder_init (&b, G_VARIANT_TYPE ("ax")); g_variant_builder_add (&b, "x", G_GINT64_CONSTANT (-0xAAABBBBCCCCDDDD)); g_variant_builder_add (&b, "x", G_GINT64_CONSTANT (1066)); varc = g_variant_builder_end (&b); g_assert (test_g_variant_equivalent (var, varc)); g_variant_unref (var); g_variant_unref (varc); } static void test_at (void) { GValue v = { 0, }; guint64 uints[] = { G_GUINT64_CONSTANT (0xAAAABBBBCCCCDDDD), 1066 }; GVariantBuilder b; GVariant *var, *varc; GType at = dbus_g_type_get_collection ("GArray", G_TYPE_UINT64); GArray *array; g_value_init (&v, at); array = dbus_g_type_specialized_construct (at); g_array_append_vals (array, uints, 2); g_assert_cmpuint ((g_array_index (array, guint64, 0) / G_GUINT64_CONSTANT (0x100000000)), ==, 0xAAAABBBBu); g_assert_cmpuint ((g_array_index (array, guint64, 0) % G_GUINT64_CONSTANT (0x100000000)), ==, 0xCCCCDDDDu); g_assert_cmpuint ((g_array_index (array, guint64, 1) / G_GUINT64_CONSTANT (0x100000000)), ==, 0); g_assert_cmpuint ((g_array_index (array, guint64, 1) % G_GUINT64_CONSTANT (0x100000000)), ==, 1066); g_value_take_boxed (&v, array); var = dbus_g_value_build_g_variant (&v); g_value_unset (&v); g_variant_builder_init (&b, G_VARIANT_TYPE ("at")); g_variant_builder_add (&b, "t", G_GUINT64_CONSTANT (0xAAAABBBBCCCCDDDD)); g_variant_builder_add (&b, "t", G_GUINT64_CONSTANT (1066)); varc = g_variant_builder_end (&b); g_assert (test_g_variant_equivalent (var, varc)); g_variant_unref (var); g_variant_unref (varc); } static void test_ay (void) { GValue v = { 0, }; guchar bytes[] = { 23, 42 }; GVariantBuilder b; GVariant *var, *varc; GType ay = dbus_g_type_get_collection ("GArray", G_TYPE_UCHAR); GArray *array; g_value_init (&v, ay); array = dbus_g_type_specialized_construct (ay); g_array_append_vals (array, bytes, 2); g_assert_cmpint (g_array_index (array, guchar, 0), ==, 23); g_assert_cmpint (g_array_index (array, guchar, 1), ==, 42); g_value_take_boxed (&v, array); var = dbus_g_value_build_g_variant (&v); g_value_unset (&v); g_variant_builder_init (&b, G_VARIANT_TYPE ("ay")); g_variant_builder_add (&b, "y", 23); g_variant_builder_add (&b, "y", 42); varc = g_variant_builder_end (&b); g_assert (test_g_variant_equivalent (var, varc)); g_variant_unref (var); g_variant_unref (varc); } static void test_g (void) { GValue v = { 0, }; GVariant *var, *varc; g_value_init (&v, DBUS_TYPE_G_SIGNATURE); g_value_set_boxed (&v, "a{u(ua{sa{sv}})}"); var = dbus_g_value_build_g_variant (&v); g_value_unset (&v); varc = g_variant_new_signature ("a{u(ua{sa{sv}})}"); g_assert (test_g_variant_equivalent (var, varc)); g_variant_unref (var); g_variant_unref (varc); } static void test_roundtrip (gconstpointer user_data) { const gchar *text = user_data; GVariant *before, *after; GValue v = { 0 }; before = g_variant_new_parsed (text); dbus_g_value_parse_g_variant (before, &v); after = dbus_g_value_build_g_variant (&v); g_value_unset (&v); assert_g_variant_equivalent (before, after); g_variant_unref (before); g_variant_unref (after); } static void test_parse_basic (void) { GVariant *variant; GValue v = { 0 }; variant = g_variant_new_parsed ("'o hai'"); dbus_g_value_parse_g_variant (variant, &v); g_assert_cmpstr (G_VALUE_TYPE_NAME (&v), ==, g_type_name (G_TYPE_STRING)); g_assert_cmpstr (g_value_get_string (&v), ==, "o hai"); g_value_unset (&v); g_variant_unref (variant); variant = g_variant_new_parsed ("objectpath '/hello/world'"); dbus_g_value_parse_g_variant (variant, &v); g_assert_cmpstr (G_VALUE_TYPE_NAME (&v), ==, g_type_name (DBUS_TYPE_G_OBJECT_PATH)); g_assert_cmpstr ((gchar *) g_value_get_boxed (&v), ==, "/hello/world"); g_value_unset (&v); g_variant_unref (variant); variant = g_variant_new_parsed ("signature 'a{sv}'"); dbus_g_value_parse_g_variant (variant, &v); g_assert_cmpstr (G_VALUE_TYPE_NAME (&v), ==, g_type_name (DBUS_TYPE_G_SIGNATURE)); g_assert_cmpstr ((gchar *) g_value_get_boxed (&v), ==, "a{sv}"); g_value_unset (&v); g_variant_unref (variant); variant = g_variant_new_parsed ("23.5"); dbus_g_value_parse_g_variant (variant, &v); g_assert_cmpstr (G_VALUE_TYPE_NAME (&v), ==, g_type_name (G_TYPE_DOUBLE)); /* this is chosen to be exactly representable in binary; we use inequalities * to work around -Wfloat-equal */ g_assert_cmpfloat (g_value_get_double (&v), >=, 23.5); g_assert_cmpfloat (g_value_get_double (&v), <=, 23.5); g_value_unset (&v); g_variant_unref (variant); variant = g_variant_new_parsed ("byte 42"); dbus_g_value_parse_g_variant (variant, &v); g_assert_cmpstr (G_VALUE_TYPE_NAME (&v), ==, g_type_name (G_TYPE_UCHAR)); g_assert_cmpuint (g_value_get_uchar (&v), ==, 42); g_value_unset (&v); g_variant_unref (variant); variant = g_variant_new_parsed ("uint16 16"); dbus_g_value_parse_g_variant (variant, &v); g_assert_cmpstr (G_VALUE_TYPE_NAME (&v), ==, g_type_name (G_TYPE_UINT)); g_assert_cmpuint (g_value_get_uint (&v), ==, 16); g_value_unset (&v); g_variant_unref (variant); variant = g_variant_new_parsed ("uint32 32"); dbus_g_value_parse_g_variant (variant, &v); g_assert_cmpstr (G_VALUE_TYPE_NAME (&v), ==, g_type_name (G_TYPE_UINT)); g_assert_cmpuint (g_value_get_uint (&v), ==, 32); g_value_unset (&v); g_variant_unref (variant); variant = g_variant_new_parsed ("uint64 64"); dbus_g_value_parse_g_variant (variant, &v); g_assert_cmpstr (G_VALUE_TYPE_NAME (&v), ==, g_type_name (G_TYPE_UINT64)); g_assert_cmpuint ((guint) g_value_get_uint64 (&v), ==, 64); g_value_unset (&v); g_variant_unref (variant); variant = g_variant_new_parsed ("int16 -16"); dbus_g_value_parse_g_variant (variant, &v); g_assert_cmpstr (G_VALUE_TYPE_NAME (&v), ==, g_type_name (G_TYPE_INT)); g_assert_cmpint (g_value_get_int (&v), ==, -16); g_value_unset (&v); g_variant_unref (variant); variant = g_variant_new_parsed ("int32 -32"); dbus_g_value_parse_g_variant (variant, &v); g_assert_cmpstr (G_VALUE_TYPE_NAME (&v), ==, g_type_name (G_TYPE_INT)); g_assert_cmpint (g_value_get_int (&v), ==, -32); g_value_unset (&v); g_variant_unref (variant); variant = g_variant_new_parsed ("int64 -64"); dbus_g_value_parse_g_variant (variant, &v); g_assert_cmpstr (G_VALUE_TYPE_NAME (&v), ==, g_type_name (G_TYPE_INT64)); g_assert_cmpint ((gint) g_value_get_int64 (&v), ==, -64); g_value_unset (&v); g_variant_unref (variant); } static void test_parse_array (void) { GVariant *variant; GValue v = { 0 }; GArray *a; /* We can't test the 16-bit cases via a round-trip, because information is * lost. */ variant = g_variant_new_parsed ("[uint16 16, uint16 1600]"); dbus_g_value_parse_g_variant (variant, &v); g_assert_cmpstr (G_VALUE_TYPE_NAME (&v), ==, g_type_name (DBUS_TYPE_G_UINT_ARRAY)); a = g_value_get_boxed (&v); g_assert_cmpuint (a->len, ==, 2); g_assert_cmpuint (g_array_index (a, guint, 0), ==, 16); g_assert_cmpuint (g_array_index (a, guint, 1), ==, 1600); g_value_unset (&v); g_variant_unref (variant); variant = g_variant_new_parsed ("[int16 -16, int16 -1600]"); dbus_g_value_parse_g_variant (variant, &v); g_assert_cmpstr (G_VALUE_TYPE_NAME (&v), ==, g_type_name (DBUS_TYPE_G_INT_ARRAY)); a = g_value_get_boxed (&v); g_assert_cmpuint (a->len, ==, 2); g_assert_cmpint (g_array_index (a, gint, 0), ==, -16); g_assert_cmpint (g_array_index (a, gint, 1), ==, -1600); g_value_unset (&v); g_variant_unref (variant); variant = g_variant_new_parsed ("@aq []"); dbus_g_value_parse_g_variant (variant, &v); g_assert_cmpstr (G_VALUE_TYPE_NAME (&v), ==, g_type_name (DBUS_TYPE_G_UINT_ARRAY)); a = g_value_get_boxed (&v); g_assert_cmpuint (a->len, ==, 0); g_value_unset (&v); g_variant_unref (variant); variant = g_variant_new_parsed ("@an []"); dbus_g_value_parse_g_variant (variant, &v); g_assert_cmpstr (G_VALUE_TYPE_NAME (&v), ==, g_type_name (DBUS_TYPE_G_INT_ARRAY)); a = g_value_get_boxed (&v); g_assert_cmpuint (a->len, ==, 0); g_value_unset (&v); g_variant_unref (variant); } static void test_parse_string_hash (void) { GVariant *variant; GHashTable *h; GValue v = { 0 }; variant = g_variant_new_parsed ("@a{ss} {'foo': 'bar'}"); dbus_g_value_parse_g_variant (variant, &v); g_assert_cmpstr (G_VALUE_TYPE_NAME (&v), ==, g_type_name (DBUS_TYPE_G_STRING_STRING_HASHTABLE)); h = g_value_get_boxed (&v); g_assert_cmpuint (g_hash_table_size (h), ==, 1); g_assert_cmpstr (g_hash_table_lookup (h, "foo"), ==, "bar"); g_value_unset (&v); g_variant_unref (variant); } int main (int argc, char **argv) { g_type_init (); dbus_g_type_specialized_init (); g_test_init (&argc, &argv, NULL); /* test_g_variant_equivalent tests */ g_test_add_func ("/test_g_variant_equivalent/test_simple_equiv", test_simple_equiv); g_test_add_func ("/test_g_variant_equivalent/test_simple_not_equiv", test_simple_not_equiv); g_test_add_func ("/test_g_variant_equivalent/test_array_not_equiv", test_array_not_equiv); g_test_add_func ("/test_g_variant_equivalent/test_map_equiv", test_map_equiv); g_test_add_func ("/test_g_variant_equivalent/test_map_not_equiv1", test_map_not_equiv1); g_test_add_func ("/test_g_variant_equivalent/test_map_not_equiv2", test_map_not_equiv2); /* dbus_g_value_build_g_variant tests */ g_test_add_func ("/gvalue-to-gvariant/i", test_i); g_test_add_func ("/gvalue-to-gvariant/s", test_s); g_test_add_func ("/gvalue-to-gvariant/o", test_o); g_test_add_func ("/gvalue-to-gvariant/us", test_us); g_test_add_func ("/gvalue-to-gvariant/a{os}", test_a_os); g_test_add_func ("/gvalue-to-gvariant/av", test_av); g_test_add_func ("/gvalue-to-gvariant/ab", test_ab); g_test_add_func ("/gvalue-to-gvariant/ai", test_ai); g_test_add_func ("/gvalue-to-gvariant/au", test_au); g_test_add_func ("/gvalue-to-gvariant/ax", test_ax); g_test_add_func ("/gvalue-to-gvariant/at", test_at); g_test_add_func ("/gvalue-to-gvariant/ay", test_ay); g_test_add_func ("/gvalue-to-gvariant/g", test_g); /* dbus_g_value_parse_g_variant tests */ g_test_add_func ("/parse-gvariant/basic", test_parse_basic); g_test_add_func ("/parse-gvariant/array", test_parse_array); g_test_add_func ("/parse-gvariant/string_hash", test_parse_string_hash); /* round-trips */ g_test_add_data_func ("/parse-gvariant/roundtrip/u", "@u 42", test_roundtrip); g_test_add_data_func ("/parse-gvariant/roundtrip/non_empty_array", "@ai [23, 42]", test_roundtrip); g_test_add_data_func ("/roundtrip/empty_array", "@ai []", test_roundtrip); g_test_add_data_func ("/roundtrip/aav", "[[<'bees'>]]", test_roundtrip); g_test_add_data_func ("/roundtrip/aau", "[[uint32 666]]", test_roundtrip); g_test_add_data_func ("/roundtrip/aax", "[[int64 666]]", test_roundtrip); g_test_add_data_func ("/roundtrip/aat", "[[uint64 666]]", test_roundtrip); g_test_add_data_func ("/roundtrip/aas", "[['a', 'b']]", test_roundtrip); g_test_add_data_func ("/roundtrip/aao", "[[objectpath '/a', objectpath '/b']]", test_roundtrip); g_test_add_data_func ("/roundtrip/aag", "[[signature 'ab', signature 'g']]", test_roundtrip); g_test_add_data_func ("/roundtrip/aad", "[[5.25, 3.5]]", test_roundtrip); g_test_add_data_func ("/roundtrip/aay", "@aay [[1, 2]]", test_roundtrip); g_test_add_data_func ("/roundtrip/empty_aay", "@aay [[]]", test_roundtrip); g_test_add_data_func ("/roundtrip/aab", "[[true, false]]", test_roundtrip); g_test_add_data_func ("/roundtrip/empty_aab", "@aab [[]]", test_roundtrip); g_test_add_data_func ("/roundtrip/aa_asv", "[[@a{sv} {'x': <'y'>}]]", test_roundtrip); g_test_add_data_func ("/roundtrip/empty_av", "@av []", test_roundtrip); g_test_add_data_func ("/roundtrip/empty_hash", "@a{uu} {}", test_roundtrip); g_test_add_data_func ("/roundtrip/easy_string_hash", "@a{ss} {'foo': 'bar'}", test_roundtrip); g_test_add_data_func ("/roundtrip/non_empty_asv", "@a{sv} {'badger': <42>, 'mushroom': , 'snake': <''>}", test_roundtrip); g_test_add_data_func ("/roundtrip/variant_nesting", "<<<42>>>", test_roundtrip); g_test_add_data_func ("/roundtrip/tuple", "(23, 42, true)", test_roundtrip); g_test_add_data_func ("/roundtrip/nested", "[[[(1, 2)]]]", test_roundtrip); g_test_add_data_func ("/roundtrip/empty_aaa", "@aaav [[]]", test_roundtrip); g_test_add_data_func ("/roundtrip/empty_aa_asv", "@aaa{sv} [[]]", test_roundtrip); g_test_add_data_func ("/roundtrip/empty_aa_struct", "@aa(us) [[]]", test_roundtrip); g_test_add_data_func ("/roundtrip/empty_aaas", "@aaas [[]]", test_roundtrip); g_test_add_data_func ("/roundtrip/empty_aax", "@aax [[]]", test_roundtrip); g_test_add_data_func ("/roundtrip/empty_aat", "@aat [[]]", test_roundtrip); g_test_add_data_func ("/roundtrip/empty_aad", "@aad [[]]", test_roundtrip); g_test_add_data_func ("/roundtrip/empty_aao", "@aao [[]]", test_roundtrip); g_test_add_data_func ("/roundtrip/empty_aag", "@aag [[]]", test_roundtrip); return g_test_run (); } dbus-glib-0.100.2/test/core/test-profile.c0000644000175000017500000007406412112652540015144 00000000000000/* -*- mode: C; c-file-style: "gnu" -*- */ /* test-profile.c Program that does basic message-response for timing; doesn't really use glib bindings * * Copyright (C) 2003, 2004 Red Hat Inc. * * Licensed under the Academic Free License version 2.1 * * 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 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * */ #include #include /* This test uses Unix-specific facilities */ #ifdef G_OS_WIN32 #define TEST_PROFILE_DISABLED #endif #ifndef TEST_PROFILE_DISABLED #include #include #include #include #include #include #include #include #include #include #include #ifndef HAVE_SOCKLEN_T #define socklen_t int #endif #define _DBUS_ZERO(object) (memset (&(object), '\0', sizeof ((object)))) #define _DBUS_MAX_SUN_PATH_LENGTH 99 /* Note that if you set threads > 1 you get a bogus profile since the * clients start blocking on the server, so the client write() will go * higher in the profile the larger the number of threads. */ #define N_CLIENT_THREADS 1 /* It seems like at least 750000 or so iterations reduces the variability to sane levels */ #define N_ITERATIONS 2000 #define N_PROGRESS_UPDATES 20 /* Don't make PAYLOAD_SIZE too huge because it gets used as a static buffer size */ #define PAYLOAD_SIZE 0 #define ECHO_SERVICE "org.freedesktop.DBus.GLib.EchoTestServer" #define ECHO_PATH "/org/freedesktop/DBus/GLib/EchoTest" #define ECHO_INTERFACE "org.freedesktop.DBus.GLib.EchoTest" #define ECHO_PING_METHOD "Ping" static const char *messages_address; static const char *plain_sockets_address; static unsigned char *payload; static int echo_call_size; static int echo_return_size; typedef struct ProfileRunVTable ProfileRunVTable; typedef struct { const ProfileRunVTable *vtable; int iterations; GMainLoop *loop; } ClientData; typedef struct { const ProfileRunVTable *vtable; int handled; GMainLoop *loop; int n_clients; } ServerData; struct ProfileRunVTable { const char *name; gboolean fake_malloc_overhead; void* (* init_server) (ServerData *sd); void (* stop_server) (ServerData *sd, void *server); void* (* client_thread_func) (void *data); /* Data has to be the vtable */ /* this is so different runs show up in the profiler with * different backtrace */ void (* main_loop_run_func) (GMainLoop *loop); }; /* Note, this is all crack-a-rific; it isn't using DBusGProxy and thus is * a major pain */ static void send_echo_method_call (DBusConnection *connection) { DBusMessage *message; const char *hello = "Hello World!"; dbus_int32_t i32 = 123456; message = dbus_message_new_method_call (ECHO_SERVICE, ECHO_PATH, ECHO_INTERFACE, ECHO_PING_METHOD); dbus_message_append_args (message, DBUS_TYPE_STRING, &hello, DBUS_TYPE_INT32, &i32, #if PAYLOAD_SIZE > 0 DBUS_TYPE_ARRAY, DBUS_TYPE_BYTE, &payload, PAYLOAD_SIZE, #endif DBUS_TYPE_INVALID); dbus_connection_send (connection, message, NULL); dbus_message_unref (message); dbus_connection_flush (connection); } static void send_echo_method_return (DBusConnection *connection, DBusMessage *call_message) { DBusMessage *message; message = dbus_message_new_method_return (call_message); dbus_connection_send (connection, message, NULL); dbus_message_unref (message); dbus_connection_flush (connection); } static DBusHandlerResult with_or_without_bus_client_filter (DBusConnection *connection, DBusMessage *message, ClientData *cd) { if (dbus_message_is_signal (message, DBUS_INTERFACE_LOCAL, "Disconnected")) { g_printerr ("Client thread disconnected\n"); exit (1); } else if (dbus_message_get_type (message) == DBUS_MESSAGE_TYPE_METHOD_RETURN) { cd->iterations += 1; if (cd->iterations >= N_ITERATIONS) { g_printerr ("\nCompleted %d iterations\n", N_ITERATIONS); g_main_loop_quit (cd->loop); } else if (cd->iterations % (N_ITERATIONS/N_PROGRESS_UPDATES) == 0) { g_printerr ("%d%% ", (int) (cd->iterations/(double)N_ITERATIONS * 100.0)); } send_echo_method_call (connection); return DBUS_HANDLER_RESULT_HANDLED; } return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; } static DBusHandlerResult no_bus_client_filter (DBusConnection *connection, DBusMessage *message, void *user_data) { ClientData *cd = user_data; return with_or_without_bus_client_filter (connection, message, cd); } static void* no_bus_thread_func (void *data) { DBusError error; GMainContext *context; DBusConnection *connection; ClientData cd; g_printerr ("Starting client thread %p\n", g_thread_self()); dbus_error_init (&error); connection = dbus_connection_open_private (messages_address, &error); if (connection == NULL) { g_printerr ("could not open connection: %s\n", error.message); dbus_error_free (&error); exit (1); } context = g_main_context_new (); cd.iterations = 1; cd.loop = g_main_loop_new (context, FALSE); if (!dbus_connection_add_filter (connection, no_bus_client_filter, &cd, NULL)) g_error ("no memory"); dbus_connection_setup_with_g_main (connection, context); g_printerr ("Client thread sending message to prime pingpong\n"); send_echo_method_call (connection); g_printerr ("Client thread sent message\n"); g_printerr ("Client thread entering main loop\n"); g_main_loop_run (cd.loop); g_printerr ("Client thread %p exiting main loop\n", g_thread_self()); dbus_connection_close (connection); g_main_loop_unref (cd.loop); g_main_context_unref (context); return NULL; } static DBusHandlerResult no_bus_server_filter (DBusConnection *connection, DBusMessage *message, void *user_data) { ServerData *sd = user_data; if (dbus_message_is_signal (message, DBUS_INTERFACE_LOCAL, "Disconnected")) { g_printerr ("Client disconnected from server\n"); sd->n_clients -= 1; if (sd->n_clients == 0) g_main_loop_quit (sd->loop); } else if (dbus_message_is_method_call (message, ECHO_INTERFACE, ECHO_PING_METHOD)) { sd->handled += 1; send_echo_method_return (connection, message); return DBUS_HANDLER_RESULT_HANDLED; } return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; } static void no_bus_new_connection_callback (DBusServer *server, DBusConnection *new_connection, void *user_data) { ServerData *sd = user_data; dbus_connection_ref (new_connection); dbus_connection_setup_with_g_main (new_connection, NULL); if (!dbus_connection_add_filter (new_connection, no_bus_server_filter, sd, NULL)) g_error ("no memory"); sd->n_clients += 1; /* FIXME we leak the handler */ } static void* no_bus_init_server (ServerData *sd) { DBusServer *server; DBusError error; dbus_error_init (&error); server = dbus_server_listen ("unix:tmpdir="DBUS_TEST_SOCKET_DIR, &error); if (server == NULL) { g_printerr ("Could not start server: %s\n", error.message); exit (1); } messages_address = dbus_server_get_address (server); dbus_server_set_new_connection_function (server, no_bus_new_connection_callback, sd, NULL); dbus_server_setup_with_g_main (server, NULL); return server; } static void no_bus_stop_server (ServerData *sd, void *server) { dbus_server_disconnect (server); dbus_server_unref (server); } static void no_bus_main_loop_run (GMainLoop *loop) { g_main_loop_run (loop); } static const ProfileRunVTable no_bus_vtable = { "dbus direct without bus", FALSE, no_bus_init_server, no_bus_stop_server, no_bus_thread_func, no_bus_main_loop_run }; typedef struct { const ProfileRunVTable *vtable; ServerData *sd; GHashTable *client_names; DBusConnection *connection; } WithBusServer; static DBusHandlerResult with_bus_client_filter (DBusConnection *connection, DBusMessage *message, void *user_data) { ClientData *cd = user_data; return with_or_without_bus_client_filter (connection, message, cd); } static void* with_bus_thread_func (void *data) { DBusError error; DBusConnection *connection; ClientData cd; const char *address; GMainContext *context; g_printerr ("Starting client thread %p\n", g_thread_self()); address = g_getenv ("DBUS_SESSION_BUS_ADDRESS"); if (address == NULL) { g_printerr ("DBUS_SESSION_BUS_ADDRESS not set\n"); exit (1); } dbus_error_init (&error); connection = dbus_connection_open_private (address, &error); if (connection == NULL) { g_printerr ("could not open connection to bus: %s\n", error.message); dbus_error_free (&error); exit (1); } if (!dbus_bus_register (connection, &error)) { g_printerr ("could not register with bus: %s\n", error.message); dbus_error_free (&error); exit (1); } context = g_main_context_new (); cd.iterations = 1; cd.loop = g_main_loop_new (context, FALSE); if (!dbus_connection_add_filter (connection, with_bus_client_filter, &cd, NULL)) g_error ("no memory"); dbus_connection_setup_with_g_main (connection, context); g_printerr ("Client thread sending message to prime pingpong\n"); send_echo_method_call (connection); g_printerr ("Client thread sent message\n"); g_printerr ("Client thread entering main loop\n"); g_main_loop_run (cd.loop); g_printerr ("Client thread %p exiting main loop\n", g_thread_self()); dbus_connection_close (connection); g_main_loop_unref (cd.loop); g_main_context_unref (context); return NULL; } static DBusHandlerResult with_bus_server_filter (DBusConnection *connection, DBusMessage *message, void *user_data) { WithBusServer *server = user_data; if (dbus_message_is_signal (message, DBUS_INTERFACE_LOCAL, "Disconnected")) { g_printerr ("Server disconnected from message bus\n"); exit (1); } else if (dbus_message_has_sender (message, DBUS_SERVICE_DBUS) && dbus_message_is_signal (message, DBUS_INTERFACE_DBUS, "NameOwnerChanged")) { const char *name, *old_owner, *new_owner; DBusError error; name = NULL; old_owner = NULL; new_owner = NULL; dbus_error_init (&error); if (!dbus_message_get_args (message, &error, DBUS_TYPE_STRING, &name, DBUS_TYPE_STRING, &old_owner, DBUS_TYPE_STRING, &new_owner, DBUS_TYPE_INVALID)) { g_printerr ("dbus_message_get_args(): %s\n", error.message); exit (1); } if (g_hash_table_lookup (server->client_names, name) && *old_owner != '\0' && *new_owner == '\0') { g_hash_table_remove (server->client_names, name); server->sd->n_clients -= 1; if (server->sd->n_clients == 0) g_main_loop_quit (server->sd->loop); } } else if (dbus_message_is_method_call (message, ECHO_INTERFACE, ECHO_PING_METHOD)) { const char *sender; sender = dbus_message_get_sender (message); if (!g_hash_table_lookup (server->client_names, sender)) { g_printerr ("First message from new client %s on bus\n", sender); g_hash_table_replace (server->client_names, g_strdup (sender), GINT_TO_POINTER (1)); server->sd->n_clients += 1; } server->sd->handled += 1; send_echo_method_return (connection, message); return DBUS_HANDLER_RESULT_HANDLED; } return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; } static void* with_bus_init_server (ServerData *sd) { DBusGConnection *gconnection; DBusConnection *connection; GError *gerror; const char *s; WithBusServer *server; char *rule; server = g_new0 (WithBusServer, 1); server->vtable = sd->vtable; server->sd = sd; s = g_getenv ("DBUS_TEST_GLIB_RUN_TEST_SCRIPT"); if (s == NULL || *s != '1') { g_printerr ("You have to run with_bus mode with the run-test.sh script\n"); exit (1); } /* Note that we use the standard global bus connection for the * server, and the clients open their own connections so they can * have their own main loops and because I'm not sure "talking to * yourself" really works yet */ gerror = NULL; gconnection = dbus_g_bus_get (DBUS_BUS_SESSION, &gerror); if (gconnection == NULL) { g_printerr ("could not open connection to bus: %s\n", gerror->message); g_error_free (gerror); exit (1); } server->client_names = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL); connection = dbus_g_connection_get_connection (gconnection); dbus_bus_request_name (connection, ECHO_SERVICE, 0, NULL); /* ignore errors because we suck */ rule = g_strdup_printf ("type='signal',sender='%s',member='%s'", DBUS_SERVICE_DBUS, "NameOwnerChanged"); /* ignore errors because we suck */ dbus_bus_add_match (connection, rule, NULL); g_free (rule); if (!dbus_connection_add_filter (connection, with_bus_server_filter, server, NULL)) g_error ("no memory"); server->connection = connection; server->client_names = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL); return server; } static void with_bus_stop_server (ServerData *sd, void *serverv) { WithBusServer *server = serverv; dbus_connection_remove_filter (server->connection, with_bus_server_filter, server); g_hash_table_destroy (server->client_names); dbus_connection_unref (server->connection); g_free (server); } static void with_bus_main_loop_run (GMainLoop *loop) { g_main_loop_run (loop); } static const ProfileRunVTable with_bus_vtable = { "routing via a bus", FALSE, with_bus_init_server, with_bus_stop_server, with_bus_thread_func, with_bus_main_loop_run }; typedef struct { const ProfileRunVTable *vtable; int listen_fd; ServerData *sd; unsigned int source_id; } PlainSocketServer; static void read_and_drop_on_floor (int fd, int count, gboolean fake_malloc_overhead) { int bytes_read; int val; char *buf; char *allocated; char not_allocated[512+PAYLOAD_SIZE]; g_assert (count < (int) sizeof(not_allocated)); if (fake_malloc_overhead) { allocated = g_malloc (count); buf = allocated; } else { allocated = NULL; buf = not_allocated; } bytes_read = 0; while (bytes_read < count) { again: val = read (fd, buf + bytes_read, count - bytes_read); if (val < 0) { if (errno == EINTR) goto again; else { g_printerr ("read() failed thread %p: %s\n", g_thread_self(), strerror (errno)); exit (1); } } else { bytes_read += val; } } if (fake_malloc_overhead) g_free (allocated); #if 0 g_printerr ("%p read %d bytes from fd %d\n", g_thread_self(), bytes_read, fd); #endif } static void write_junk (int fd, int count, gboolean fake_malloc_overhead) { int bytes_written; int val; char *buf; char *allocated; char not_allocated[512+PAYLOAD_SIZE] = { '\0', }; g_assert (count < (int) sizeof(not_allocated)); if (fake_malloc_overhead) { int i; allocated = g_malloc (count); buf = allocated; /* Write some stuff into the allocated buffer to simulate * creating some sort of data */ i = 0; while (i < count) { allocated[i] = (char) i; ++i; } } else { allocated = NULL; buf = not_allocated; } bytes_written = 0; while (bytes_written < count) { again: val = write (fd, buf + bytes_written, count - bytes_written); if (val < 0) { if (errno == EINTR) goto again; else { g_printerr ("write() failed thread %p: %s\n", g_thread_self(), strerror (errno)); exit (1); } } else { bytes_written += val; } } if (fake_malloc_overhead) g_free (allocated); #if 0 g_printerr ("%p wrote %d bytes to fd %d\n", g_thread_self(), bytes_written, fd); #endif } static gboolean plain_sockets_talk_to_client_watch (GIOChannel *source, GIOCondition condition, gpointer data) { PlainSocketServer *server = data; int client_fd = g_io_channel_unix_get_fd (source); if (condition & G_IO_HUP) { g_printerr ("Client disconnected from server\n"); server->sd->n_clients -= 1; if (server->sd->n_clients == 0) g_main_loop_quit (server->sd->loop); return FALSE; /* remove watch */ } else if (condition & G_IO_IN) { server->sd->handled += 1; read_and_drop_on_floor (client_fd, echo_call_size, server->vtable->fake_malloc_overhead); write_junk (client_fd, echo_return_size, server->vtable->fake_malloc_overhead); } else { g_printerr ("Unexpected IO condition in server thread\n"); exit (1); } return TRUE; } static gboolean plain_sockets_new_client_watch (GIOChannel *source, GIOCondition condition, gpointer data) { int client_fd; struct sockaddr addr; socklen_t addrlen; GIOChannel *channel; PlainSocketServer *server = data; if (!(condition & G_IO_IN)) { g_printerr ("Unexpected IO condition on server socket\n"); exit (1); } addrlen = sizeof (addr); retry: client_fd = accept (server->listen_fd, &addr, &addrlen); if (client_fd < 0) { if (errno == EINTR) goto retry; else { g_printerr ("Failed to accept() connection from client: %s\n", strerror (errno)); exit (1); } } channel = g_io_channel_unix_new (client_fd); g_io_add_watch (channel, G_IO_IN | G_IO_ERR | G_IO_HUP | G_IO_NVAL | G_IO_PRI, plain_sockets_talk_to_client_watch, server); g_io_channel_unref (channel); server->sd->n_clients += 1; return TRUE; } static void* plain_sockets_init_server (ServerData *sd) { PlainSocketServer *server; struct sockaddr_un addr; static char path[] = "/tmp/dbus-test-profile-XXXXXX"; char *p; GIOChannel *channel; server = g_new0 (PlainSocketServer, 1); server->sd = sd; server->vtable = sd->vtable; /* for convenience */ p = path; while (*p) { if (*p == 'X') *p = 'a' + (int) (26.0*rand()/(RAND_MAX+1.0)); ++p; } g_printerr ("Socket is %s\n", path); server->listen_fd = socket (PF_UNIX, SOCK_STREAM, 0); if (server->listen_fd < 0) { g_printerr ("Failed to create socket: %s", strerror (errno)); exit (1); } _DBUS_ZERO (addr); addr.sun_family = AF_UNIX; #ifdef HAVE_ABSTRACT_SOCKETS /* remember that abstract names aren't nul-terminated so we rely * on sun_path being filled in with zeroes above. */ addr.sun_path[0] = '\0'; /* this is what says "use abstract" */ strncpy (&addr.sun_path[1], path, _DBUS_MAX_SUN_PATH_LENGTH - 2); /* _dbus_verbose_bytes (addr.sun_path, sizeof (addr.sun_path)); */ #else /* HAVE_ABSTRACT_SOCKETS */ { struct stat sb; if (stat (path, &sb) == 0 && S_ISSOCK (sb.st_mode)) unlink (path); } strncpy (addr.sun_path, path, _DBUS_MAX_SUN_PATH_LENGTH - 1); #endif /* ! HAVE_ABSTRACT_SOCKETS */ if (bind (server->listen_fd, (struct sockaddr*) &addr, sizeof (addr)) < 0) { g_printerr ("Failed to bind socket \"%s\": %s", path, strerror (errno)); exit (1); } if (listen (server->listen_fd, 30 /* backlog */) < 0) { g_printerr ("Failed to listen on socket \"%s\": %s", path, strerror (errno)); exit (1); } plain_sockets_address = path; channel = g_io_channel_unix_new (server->listen_fd); server->source_id = g_io_add_watch (channel, G_IO_IN | G_IO_ERR | G_IO_HUP | G_IO_NVAL | G_IO_PRI, plain_sockets_new_client_watch, server); g_io_channel_unref (channel); return server; } static void plain_sockets_stop_server (ServerData *sd, void *server_v) { PlainSocketServer *server = server_v; g_source_remove (server->source_id); close (server->listen_fd); g_free (server); { struct stat sb; if (stat (plain_sockets_address, &sb) == 0 && S_ISSOCK (sb.st_mode)) unlink (plain_sockets_address); } } static gboolean plain_sockets_client_side_watch (GIOChannel *source, GIOCondition condition, gpointer data) { ClientData *cd = data; int fd = g_io_channel_unix_get_fd (source); if (condition & G_IO_IN) { read_and_drop_on_floor (fd, echo_return_size, cd->vtable->fake_malloc_overhead); } else if (condition & G_IO_OUT) { cd->iterations += 1; if (cd->iterations >= N_ITERATIONS) { g_printerr ("\nCompleted %d iterations\n", N_ITERATIONS); g_main_loop_quit (cd->loop); } else if (cd->iterations % (N_ITERATIONS/N_PROGRESS_UPDATES) == 0) { g_printerr ("%d%% ", (int) (cd->iterations/(double)N_ITERATIONS * 100.0)); } write_junk (fd, echo_call_size, cd->vtable->fake_malloc_overhead); } else { g_printerr ("Unexpected IO condition in client thread\n"); exit (1); } return TRUE; } static void* plain_sockets_thread_func (void *data) { GMainContext *context; ClientData cd; int fd; struct sockaddr_un addr; GIOChannel *channel; GSource *gsource; g_printerr ("Starting client thread %p\n", g_thread_self()); fd = socket (PF_UNIX, SOCK_STREAM, 0); if (fd < 0) { g_printerr ("Failed to create socket: %s", strerror (errno)); exit (1); } _DBUS_ZERO (addr); addr.sun_family = AF_UNIX; #ifdef HAVE_ABSTRACT_SOCKETS /* remember that abstract names aren't nul-terminated so we rely * on sun_path being filled in with zeroes above. */ addr.sun_path[0] = '\0'; /* this is what says "use abstract" */ strncpy (&addr.sun_path[1], plain_sockets_address, _DBUS_MAX_SUN_PATH_LENGTH - 2); /* _dbus_verbose_bytes (addr.sun_path, sizeof (addr.sun_path)); */ #else /* HAVE_ABSTRACT_SOCKETS */ strncpy (addr.sun_path, plain_sockets_address, _DBUS_MAX_SUN_PATH_LENGTH - 1); #endif /* ! HAVE_ABSTRACT_SOCKETS */ if (connect (fd, (struct sockaddr*) &addr, sizeof (addr)) < 0) { g_printerr ("Failed to connect to socket %s: %s", plain_sockets_address, strerror (errno)); exit (1); } context = g_main_context_new (); cd.iterations = 1; cd.loop = g_main_loop_new (context, FALSE); cd.vtable = data; channel = g_io_channel_unix_new (fd); gsource = g_io_create_watch (channel, G_IO_IN | G_IO_OUT | G_IO_ERR | G_IO_HUP | G_IO_NVAL | G_IO_PRI); g_source_set_callback (gsource, (GSourceFunc)plain_sockets_client_side_watch, &cd, NULL); g_source_attach (gsource, context); g_io_channel_unref (channel); g_printerr ("Client thread writing to prime pingpong\n"); write_junk (fd, echo_call_size, cd.vtable->fake_malloc_overhead); g_printerr ("Client thread done writing primer\n"); g_printerr ("Client thread entering main loop\n"); g_main_loop_run (cd.loop); g_printerr ("Client thread %p exiting main loop\n", g_thread_self()); g_source_destroy (gsource); close (fd); g_main_loop_unref (cd.loop); g_main_context_unref (context); return NULL; } static void plain_sockets_main_loop_run (GMainLoop *loop) { g_main_loop_run (loop); } static const ProfileRunVTable plain_sockets_vtable = { "plain sockets", FALSE, plain_sockets_init_server, plain_sockets_stop_server, plain_sockets_thread_func, plain_sockets_main_loop_run }; static const ProfileRunVTable plain_sockets_with_malloc_vtable = { "plain sockets with malloc overhead", TRUE, plain_sockets_init_server, plain_sockets_stop_server, plain_sockets_thread_func, plain_sockets_main_loop_run }; static double do_profile_run (const ProfileRunVTable *vtable) { GTimer *timer; int i; double secs; ServerData sd; void *server; g_printerr ("Profiling %s\n", vtable->name); sd.handled = 0; sd.n_clients = 0; sd.loop = g_main_loop_new (NULL, FALSE); sd.vtable = vtable; server = (* vtable->init_server) (&sd); for (i = 0; i < N_CLIENT_THREADS; i++) { g_thread_create (vtable->client_thread_func, (void*) vtable, FALSE, NULL); } timer = g_timer_new (); g_printerr ("Server thread %p entering main loop\n", g_thread_self()); (* vtable->main_loop_run_func) (sd.loop); g_printerr ("Server thread %p exiting main loop\n", g_thread_self()); secs = g_timer_elapsed (timer, NULL); g_timer_destroy (timer); g_printerr ("%s: %g seconds, %d round trips, %f seconds per pingpong\n", vtable->name, secs, sd.handled, secs/sd.handled); (* vtable->stop_server) (&sd, server); g_main_loop_unref (sd.loop); return secs; } static void print_result (const ProfileRunVTable *vtable, double seconds, double baseline) { g_printerr (" %g times slower for %s (%g seconds, %f per iteration)\n", seconds/baseline, vtable->name, seconds, seconds / N_ITERATIONS); } #endif int main (int argc, char *argv[]) { #ifndef TEST_PROFILE_DISABLED g_thread_init (NULL); dbus_g_thread_init (); #ifndef DBUS_DISABLE_ASSERT g_printerr ("You should probably --disable-asserts before you profile as they have noticeable overhead\n"); #endif #if DBUS_ENABLE_VERBOSE_MODE g_printerr ("You should probably --disable-verbose-mode before you profile as verbose has noticeable overhead\n"); #endif payload = g_malloc (PAYLOAD_SIZE); /* The actual size of the DBusMessage on the wire, as of Nov 23 2004, * without the payload */ echo_call_size = 140 + PAYLOAD_SIZE; echo_return_size = 32; if (argc > 1 && strcmp (argv[1], "plain_sockets") == 0) do_profile_run (&plain_sockets_vtable); else if (argc > 1 && strcmp (argv[1], "plain_sockets_with_malloc") == 0) do_profile_run (&plain_sockets_with_malloc_vtable); else if (argc > 1 && strcmp (argv[1], "no_bus") == 0) do_profile_run (&no_bus_vtable); else if (argc > 1 && strcmp (argv[1], "with_bus") == 0) do_profile_run (&with_bus_vtable); else if (argc > 1 && strcmp (argv[1], "all") == 0) { double e1, e2, e3, e4; e1 = do_profile_run (&plain_sockets_vtable); e2 = do_profile_run (&plain_sockets_with_malloc_vtable); e3 = do_profile_run (&no_bus_vtable); e4 = do_profile_run (&with_bus_vtable); g_printerr ("Baseline plain sockets time %g seconds for %d iterations\n", e1, N_ITERATIONS); print_result (&plain_sockets_vtable, e1, e1); print_result (&plain_sockets_with_malloc_vtable, e2, e1); print_result (&no_bus_vtable, e3, e1); print_result (&with_bus_vtable, e4, e1); } else { g_printerr ("Specify profile type plain_sockets, plain_sockets_with_malloc, no_bus, with_bus, all\n"); exit (1); } /* Make valgrind happy */ dbus_shutdown (); #endif /* TEST_PROFILE_DISABLED */ return 0; } dbus-glib-0.100.2/test/core/my-object-subclass.h0000644000175000017500000000221312107524563016234 00000000000000#ifndef __MY_OBJECT_SUBCLASS_H__ #define __MY_OBJECT_SUBCLASS_H__ #include #include #include "my-object.h" typedef struct MyObjectSubclass MyObjectSubclass; typedef struct MyObjectSubclassClass MyObjectSubclassClass; GType my_object_subclass_get_type (void); struct MyObjectSubclass { MyObject parent; char *this_is_a_subclass_string; guint this_is_a_subclass_uint; }; struct MyObjectSubclassClass { MyObjectClass parent; }; #define MY_TYPE_OBJECT_SUBCLASS (my_object_subclass_get_type ()) #define MY_OBJECT_SUBCLASS(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), MY_TYPE_OBJECT_SUBCLASS, MyObjectSubclass)) #define MY_OBJECT_SUBCLASS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MY_TYPE_OBJECT_SUBCLASS, MyObjectSubclassClass)) #define MY_IS_OBJECT_SUBCLASS(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), MY_TYPE_OBJECT_SUBCLASS)) #define MY_IS_OBJECT_SUBCLASS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MY_TYPE_OBJECT_SUBCLASS)) #define MY_OBJECT_SUBCLASS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MY_TYPE_OBJECT_SUBCLASS, MyObjectSubclassClass)) #endif dbus-glib-0.100.2/test/core/peer-client.c0000644000175000017500000000716012107524614014733 00000000000000#include #include #include #include #include #include #include static GMainLoop *loop; static guint exit_timeout = 0; static int n_times_frobnicate_received = 0; static gboolean terminating = FALSE, terminated = FALSE; static void lose (const char *str, ...) { va_list args; va_start (args, str); vfprintf (stderr, str, args); fputc ('\n', stderr); va_end (args); exit (1); } static void lose_gerror (const char *prefix, GError *error) { if (error->domain == DBUS_GERROR && error->code == DBUS_GERROR_REMOTE_EXCEPTION) lose ("%s (%s): %s", prefix, dbus_g_error_get_name (error), error->message); else lose ("%s: %s", prefix, error->message); } static gboolean timed_exit (gpointer loop) { g_print ("timed exit!\n"); g_main_loop_quit (loop); return TRUE; } static void frobnicate_signal_handler (DBusGProxy *proxy, int val, void *user_data) { n_times_frobnicate_received += 1; g_assert (val == 42); g_main_loop_quit (loop); g_source_remove (exit_timeout); } static void destroy_cb (DBusGProxy *proxy, gpointer user_data) { if (!terminating) { lose ("Proxy destroyed when it shouldn't have been"); } else { terminated = TRUE; g_main_loop_quit (loop); g_source_remove (exit_timeout); } } int main (int argc, char **argv) { GError *error = NULL; DBusGConnection *conn; DBusGProxy *proxy; guint32 v_UINT32_2; char *addrbuf; gsize lineoffset; GIOChannel *io; g_thread_init (NULL); dbus_g_thread_init (); g_type_init (); io = g_io_channel_unix_new (0); if (!g_io_channel_read_line (io, &addrbuf, NULL, &lineoffset, &error)) lose_gerror ("failed to read address from stdin", error); /* trim newline */ addrbuf[lineoffset] = '\0'; loop = g_main_loop_new (NULL, TRUE); conn = dbus_g_connection_open (addrbuf, &error); if (!conn) g_error ("Cannot open connection: %s", error->message); proxy = dbus_g_proxy_new_for_peer (conn, "/", "org.freedesktop.DBus.GLib.Tests.MyObject"); g_assert (proxy); if (!dbus_g_proxy_call (proxy, "DoNothing", &error, G_TYPE_INVALID, G_TYPE_INVALID)) lose_gerror ("Failed to complete DoNothing call", error); if (!dbus_g_proxy_call (proxy, "Increment", &error, G_TYPE_UINT, 42, G_TYPE_INVALID, G_TYPE_UINT, &v_UINT32_2, G_TYPE_INVALID)) lose_gerror ("Failed to complete Increment call", error); if (v_UINT32_2 != 43) lose ("Increment call returned %d, should be 43", v_UINT32_2); n_times_frobnicate_received = 0; dbus_g_proxy_add_signal (proxy, "Frobnicate", G_TYPE_INT, G_TYPE_INVALID); dbus_g_proxy_connect_signal (proxy, "Frobnicate", G_CALLBACK (frobnicate_signal_handler), NULL, NULL); g_signal_connect (G_OBJECT (proxy), "destroy", G_CALLBACK (destroy_cb), NULL); if (!dbus_g_proxy_call (proxy, "EmitFrobnicate", &error, G_TYPE_INVALID, G_TYPE_INVALID)) lose_gerror ("Failed to complete EmitFrobnicate call", error); exit_timeout = g_timeout_add (5000, timed_exit, loop); g_main_loop_run (loop); if (n_times_frobnicate_received != 1) lose ("Frobnicate signal received %d times, should have been 1", n_times_frobnicate_received); terminating = TRUE; if (!dbus_g_proxy_call (proxy, "Terminate", &error, G_TYPE_INVALID, G_TYPE_INVALID)) lose_gerror ("Failed to complete Terminate call", error); exit_timeout = g_timeout_add (5000, timed_exit, loop); g_main_loop_run (loop); if (!terminated) lose ("Proxy didn't destroy when peer terminated"); g_main_loop_unref (loop); return 0; } dbus-glib-0.100.2/test/core/Makefile.am0000644000175000017500000001031012112652540014377 00000000000000INCLUDES = \ -I$(top_srcdir) \ -I$(top_srcdir)/dbus \ -I$(top_builddir) \ -I$(top_builddir)/dbus \ $(DBUS_CFLAGS) \ $(DBUS_GLIB_CFLAGS) \ -DDBUS_COMPILATION LDADD = \ $(DBUS_GLIB_THREADS_LIBS) \ $(DBUS_GLIB_LIBS) \ $(DBUS_LIBS) \ $(top_builddir)/dbus/libdbus-glib-1.la \ $(top_builddir)/test/lib/libtest.la \ $(NULL) tool_ldadd = \ $(LDADD) \ $(DBUS_GLIB_TOOL_LIBS) \ $(top_builddir)/dbus/libdbus-gtool.la ## note that TESTS has special meaning (stuff to use in make check) ## so if adding tests not to be run in make check, don't add them to ## TESTS if DBUS_BUILD_TESTS TESTS_ENVIRONMENT=DBUS_TOP_BUILDDIR=$(ABSOLUTE_TOP_BUILDDIR) TESTS=run-test.sh run-peer-test.sh else TESTS= endif EXTRA_DIST=run-test.sh run-peer-test.sh test-service-glib.xml my-object-marshal.list test-service-glib-subclass.xml if DBUS_BUILD_TESTS if HAVE_GLIB_THREADS THREAD_APPS=test-thread-server test-thread-client test-profile test_thread_server_SOURCES= \ test-thread-server.c \ test-thread.h test_thread_client_SOURCES= \ test-thread-client.c \ test-thread.h endif ## we use noinst_PROGRAMS not check_PROGRAMS for TESTS so that we ## build even when not doing "make check" noinst_PROGRAMS = \ test-dbus-glib \ test-error-mapping \ test-service-glib \ $(THREAD_APPS) \ peer-server \ peer-client \ test-types \ test-30574 \ test-peer-on-bus \ test-proxy-peer \ test-registrations \ test-variant-recursion \ test-gvariant test_30574_SOURCES = \ 30574.c test_proxy_peer_SOURCES = \ my-object-marshal.c \ my-object.c \ my-object.h \ proxy-peer.c test_registrations_SOURCES = \ my-object.c \ my-object.h \ my-object-subclass.c \ my-object-subclass.h \ my-object-marshal.c \ registrations.c test_dbus_glib_SOURCES= \ my-object.c \ my-object.h \ my-object-marshal.c \ test-dbus-glib.c test_dbus_glib_LDADD= $(tool_ldadd) test_error_mapping_SOURCES = \ my-object.c \ my-object.h \ my-object-marshal.c \ error-mapping.c test_variant_recursion_SOURCES=test-variant-recursion.c test_variant_recursion_LDADD= $(tool_ldadd) BUILT_SOURCES = test-service-glib-glue.h test-service-glib-subclass-glue.h test-service-glib-bindings.h my-object-marshal.c my-object-marshal.h test_service_glib_SOURCES= \ my-object.c \ my-object.h \ my-object-subclass.c \ my-object-subclass.h \ my-object-marshal.c \ test-service-glib.c test-service-glib-glue.h: test-service-glib.xml $(top_builddir)/dbus/dbus-binding-tool$(EXEEXT) $(DEBUG) $(DBUS_BINDING_TOOL) --prefix=my_object --mode=glib-server --output=test-service-glib-glue.h $(srcdir)/test-service-glib.xml test-service-glib-subclass-glue.h: test-service-glib-subclass.xml $(top_builddir)/dbus/dbus-binding-tool$(EXEEXT) $(DEBUG) $(DBUS_BINDING_TOOL) --prefix=my_object_subclass --mode=glib-server --output=test-service-glib-subclass-glue.h $(srcdir)/test-service-glib-subclass.xml test-service-glib-bindings.h: test-service-glib.xml $(top_builddir)/dbus/dbus-binding-tool$(EXEEXT) $(DEBUG) $(DBUS_BINDING_TOOL) --prefix=my_object --mode=glib-client --output=test-service-glib-bindings.h $(srcdir)/test-service-glib.xml my-object-marshal.c: Makefile my-object-marshal.list echo "#include " > $@.tmp @GLIB_GENMARSHAL@ --prefix=my_object_marshal $(srcdir)/my-object-marshal.list --header --body >> $@.tmp mv $@.tmp $@ my-object-marshal.h: Makefile my-object-marshal.list @GLIB_GENMARSHAL@ --prefix=my_object_marshal $(srcdir)/my-object-marshal.list --header > my-object-marshal.h peer_server_SOURCES = \ my-object.c \ my-object.h \ my-object-subclass.c \ my-object-subclass.h \ my-object-marshal.c \ peer-server.c peer_client_SOURCES = \ peer-client.c test_types_SOURCES = \ test-types.c test_gvariant_SOURCES = \ test-gvariant.c test_peer_on_bus_SOURCES = peer-on-bus.c CLEANFILES = \ $(BUILT_SOURCES) \ run-with-tmp-session-bus.conf else ### not building tests if HAVE_GLIB_THREADS noinst_PROGRAMS=test-profile endif endif if HAVE_GLIB_THREADS test_profile_SOURCES= \ test-profile.c endif dbus-glib-0.100.2/test/core/my-object-marshal.h0000644000175000017500000000274712112653617016057 00000000000000 #ifndef __my_object_marshal_MARSHAL_H__ #define __my_object_marshal_MARSHAL_H__ #include G_BEGIN_DECLS /* NONE:STRING,INT,STRING (/home/smcv/src/fdo/dbus-glib/test/core/my-object-marshal.list:1) */ extern void my_object_marshal_VOID__STRING_INT_STRING (GClosure *closure, GValue *return_value, guint n_param_values, const GValue *param_values, gpointer invocation_hint, gpointer marshal_data); #define my_object_marshal_NONE__STRING_INT_STRING my_object_marshal_VOID__STRING_INT_STRING /* NONE:STRING,BOXED (/home/smcv/src/fdo/dbus-glib/test/core/my-object-marshal.list:2) */ extern void my_object_marshal_VOID__STRING_BOXED (GClosure *closure, GValue *return_value, guint n_param_values, const GValue *param_values, gpointer invocation_hint, gpointer marshal_data); #define my_object_marshal_NONE__STRING_BOXED my_object_marshal_VOID__STRING_BOXED G_END_DECLS #endif /* __my_object_marshal_MARSHAL_H__ */ dbus-glib-0.100.2/test/core/test-types.c0000644000175000017500000000174412107524614014647 00000000000000#include #include #include #include #include static void lose (const char *str, ...) { va_list args; va_start (args, str); vfprintf (stderr, str, args); fputc ('\n', stderr); va_end (args); exit (1); } int main (int argc, char **argv) { DBusError derror; GError *gerror = NULL; DBusGConnection *gconn, *gconn2; DBusConnection *conn; g_type_init (); dbus_error_init (&derror); /* Check DBusGConnection -> DBusConnection -> DBusGConnection */ gconn = dbus_g_bus_get (DBUS_BUS_SESSION, &gerror); if (!gconn) lose ("Cannot get connection: %s", gerror->message); conn = dbus_g_connection_get_connection (gconn); if (!conn) lose ("Cannot get DBusConnection from DBusGConnection"); gconn2 = dbus_connection_get_g_connection (conn); if (gconn != gconn2) lose ("Retrieved DBusGConection != original DBusGConnection"); dbus_g_connection_unref (gconn); return 0; } dbus-glib-0.100.2/test/core/run-test.sh0000755000175000017500000000467712112652540014506 00000000000000#! /bin/sh SCRIPTNAME=$0 MODE=$1 die() { echo $@ 1>&2 exit 1 } ## so the tests can complain if you fail to use the script to launch them DBUS_TEST_GLIB_RUN_TEST_SCRIPT=1 export DBUS_TEST_GLIB_RUN_TEST_SCRIPT DBUS_TOP_SRCDIR=`dirname "$0"`/../.. export DBUS_TOP_SRCDIR # Rerun ourselves with tmp session bus if we're not already if test -z "$DBUS_TEST_GLIB_IN_RUN_TEST"; then DBUS_TEST_GLIB_IN_RUN_TEST=1 export DBUS_TEST_GLIB_IN_RUN_TEST exec $DBUS_TOP_SRCDIR/tools/run-with-tmp-session-bus.sh $SCRIPTNAME $MODE fi if test x$MODE = xprofile ; then echo "profiling type $PROFILE_TYPE" sleep 2 ## this lets the bus get started so its startup time doesn't affect the profile too much if test x$PROFILE_TYPE = x ; then PROFILE_TYPE=all fi ${DBUS_TOP_BUILDDIR}/libtool --mode=execute $DEBUG $DBUS_TOP_BUILDDIR/test/core/test-profile $PROFILE_TYPE || die "test-profile failed" elif test x$MODE = xviewer ; then echo "Launching dbus-viewer" ARGS= if test x$DEBUG = x ; then ARGS="--services org.freedesktop.DBus org.freedesktop.DBus.GLib.TestService" fi ${DBUS_TOP_BUILDDIR}/libtool --mode=execute $DEBUG $DBUS_TOP_BUILDDIR/tools/dbus-viewer $ARGS || die "could not run dbus-viewer" elif test x$MODE = xwait ; then echo "Waiting DBUS_SESSION_BUS_ADDRESS=$DBUS_SESSION_BUS_ADDRESS" sleep 86400 else echo "running test-dbus-glib" if test x$DBUS_TEST_MONITOR != x; then dbus-monitor --session & fi ${DBUS_TOP_BUILDDIR}/libtool --mode=execute $DEBUG $DBUS_TOP_BUILDDIR/test/core/test-types || die "test-types failed" ${DBUS_TOP_BUILDDIR}/libtool --mode=execute $DEBUG $DBUS_TOP_BUILDDIR/test/core/test-registrations || die "test-registrations failed" ${DBUS_TOP_BUILDDIR}/libtool --mode=execute $DEBUG $DBUS_TOP_BUILDDIR/test/core/test-dbus-glib || die "test-dbus-glib failed" ${DBUS_TOP_BUILDDIR}/libtool --mode=execute $DEBUG $DBUS_TOP_BUILDDIR/test/core/test-variant-recursion || die "test-variant-recursion failed" ${DBUS_TOP_BUILDDIR}/libtool --mode=execute $DEBUG $DBUS_TOP_BUILDDIR/test/core/test-gvariant || die "test-gvariant failed" ${DBUS_TOP_BUILDDIR}/libtool --mode=execute $DEBUG $DBUS_TOP_BUILDDIR/test/core/test-30574 || die "test-30574 failed" ${DBUS_TOP_BUILDDIR}/libtool --mode=execute $DEBUG $DBUS_TOP_BUILDDIR/test/core/test-error-mapping || die "test-error-mapping failed" ${DBUS_TOP_BUILDDIR}/libtool --mode=execute $DEBUG $DBUS_TOP_BUILDDIR/test/core/test-peer-on-bus || die "test-peer-on-bus failed" fi dbus-glib-0.100.2/test/core/my-object-marshal.c0000644000175000017500000001577312112653617016055 00000000000000#include #ifndef __my_object_marshal_MARSHAL_H__ #define __my_object_marshal_MARSHAL_H__ #include G_BEGIN_DECLS #ifdef G_ENABLE_DEBUG #define g_marshal_value_peek_boolean(v) g_value_get_boolean (v) #define g_marshal_value_peek_char(v) g_value_get_schar (v) #define g_marshal_value_peek_uchar(v) g_value_get_uchar (v) #define g_marshal_value_peek_int(v) g_value_get_int (v) #define g_marshal_value_peek_uint(v) g_value_get_uint (v) #define g_marshal_value_peek_long(v) g_value_get_long (v) #define g_marshal_value_peek_ulong(v) g_value_get_ulong (v) #define g_marshal_value_peek_int64(v) g_value_get_int64 (v) #define g_marshal_value_peek_uint64(v) g_value_get_uint64 (v) #define g_marshal_value_peek_enum(v) g_value_get_enum (v) #define g_marshal_value_peek_flags(v) g_value_get_flags (v) #define g_marshal_value_peek_float(v) g_value_get_float (v) #define g_marshal_value_peek_double(v) g_value_get_double (v) #define g_marshal_value_peek_string(v) (char*) g_value_get_string (v) #define g_marshal_value_peek_param(v) g_value_get_param (v) #define g_marshal_value_peek_boxed(v) g_value_get_boxed (v) #define g_marshal_value_peek_pointer(v) g_value_get_pointer (v) #define g_marshal_value_peek_object(v) g_value_get_object (v) #define g_marshal_value_peek_variant(v) g_value_get_variant (v) #else /* !G_ENABLE_DEBUG */ /* WARNING: This code accesses GValues directly, which is UNSUPPORTED API. * Do not access GValues directly in your code. Instead, use the * g_value_get_*() functions */ #define g_marshal_value_peek_boolean(v) (v)->data[0].v_int #define g_marshal_value_peek_char(v) (v)->data[0].v_int #define g_marshal_value_peek_uchar(v) (v)->data[0].v_uint #define g_marshal_value_peek_int(v) (v)->data[0].v_int #define g_marshal_value_peek_uint(v) (v)->data[0].v_uint #define g_marshal_value_peek_long(v) (v)->data[0].v_long #define g_marshal_value_peek_ulong(v) (v)->data[0].v_ulong #define g_marshal_value_peek_int64(v) (v)->data[0].v_int64 #define g_marshal_value_peek_uint64(v) (v)->data[0].v_uint64 #define g_marshal_value_peek_enum(v) (v)->data[0].v_long #define g_marshal_value_peek_flags(v) (v)->data[0].v_ulong #define g_marshal_value_peek_float(v) (v)->data[0].v_float #define g_marshal_value_peek_double(v) (v)->data[0].v_double #define g_marshal_value_peek_string(v) (v)->data[0].v_pointer #define g_marshal_value_peek_param(v) (v)->data[0].v_pointer #define g_marshal_value_peek_boxed(v) (v)->data[0].v_pointer #define g_marshal_value_peek_pointer(v) (v)->data[0].v_pointer #define g_marshal_value_peek_object(v) (v)->data[0].v_pointer #define g_marshal_value_peek_variant(v) (v)->data[0].v_pointer #endif /* !G_ENABLE_DEBUG */ /* NONE:STRING,INT,STRING (/home/smcv/src/fdo/dbus-glib/test/core/my-object-marshal.list:1) */ extern void my_object_marshal_VOID__STRING_INT_STRING (GClosure *closure, GValue *return_value, guint n_param_values, const GValue *param_values, gpointer invocation_hint, gpointer marshal_data); void my_object_marshal_VOID__STRING_INT_STRING (GClosure *closure, GValue *return_value G_GNUC_UNUSED, guint n_param_values, const GValue *param_values, gpointer invocation_hint G_GNUC_UNUSED, gpointer marshal_data) { typedef void (*GMarshalFunc_VOID__STRING_INT_STRING) (gpointer data1, gpointer arg_1, gint arg_2, gpointer arg_3, gpointer data2); register GMarshalFunc_VOID__STRING_INT_STRING callback; register GCClosure *cc = (GCClosure*) closure; register gpointer data1, data2; g_return_if_fail (n_param_values == 4); if (G_CCLOSURE_SWAP_DATA (closure)) { data1 = closure->data; data2 = g_value_peek_pointer (param_values + 0); } else { data1 = g_value_peek_pointer (param_values + 0); data2 = closure->data; } callback = (GMarshalFunc_VOID__STRING_INT_STRING) (marshal_data ? marshal_data : cc->callback); callback (data1, g_marshal_value_peek_string (param_values + 1), g_marshal_value_peek_int (param_values + 2), g_marshal_value_peek_string (param_values + 3), data2); } #define my_object_marshal_NONE__STRING_INT_STRING my_object_marshal_VOID__STRING_INT_STRING /* NONE:STRING,BOXED (/home/smcv/src/fdo/dbus-glib/test/core/my-object-marshal.list:2) */ extern void my_object_marshal_VOID__STRING_BOXED (GClosure *closure, GValue *return_value, guint n_param_values, const GValue *param_values, gpointer invocation_hint, gpointer marshal_data); void my_object_marshal_VOID__STRING_BOXED (GClosure *closure, GValue *return_value G_GNUC_UNUSED, guint n_param_values, const GValue *param_values, gpointer invocation_hint G_GNUC_UNUSED, gpointer marshal_data) { typedef void (*GMarshalFunc_VOID__STRING_BOXED) (gpointer data1, gpointer arg_1, gpointer arg_2, gpointer data2); register GMarshalFunc_VOID__STRING_BOXED callback; register GCClosure *cc = (GCClosure*) closure; register gpointer data1, data2; g_return_if_fail (n_param_values == 3); if (G_CCLOSURE_SWAP_DATA (closure)) { data1 = closure->data; data2 = g_value_peek_pointer (param_values + 0); } else { data1 = g_value_peek_pointer (param_values + 0); data2 = closure->data; } callback = (GMarshalFunc_VOID__STRING_BOXED) (marshal_data ? marshal_data : cc->callback); callback (data1, g_marshal_value_peek_string (param_values + 1), g_marshal_value_peek_boxed (param_values + 2), data2); } #define my_object_marshal_NONE__STRING_BOXED my_object_marshal_VOID__STRING_BOXED G_END_DECLS #endif /* __my_object_marshal_MARSHAL_H__ */ dbus-glib-0.100.2/NEWS0000644000175000017500000001571012112652540011144 00000000000000== IMPORTANT NOTE: This file isn't maintained anymore == Release summaries are done on the mailing list and linked through the wiki. == END IMPORTANT NOTE == D-Bus GLib Bindings 0.78 (04 Dec 2008) Thanks to Robert McQueen, Philip Van Hoof, David Zeuthen, Colin Walters, Dan Williams, Nick Welch, Tomas Pelka and others for their contributions. Reliability fixes: - #16114 [patch] wincaps-to-uscore property names for GetAll() - #16419: recursive variants demarshaling limits - #18573: service tracker race Other notable fixes and enhancements: - #17329: allow hash tables to contain complex types - #17798: add support for 'o', 'g' and 'as' in dictionaries - #16925: bash completion for dbus-send D-Bus GLib Bindings 0.75 (05 Jun 2008) == Thanks to Dan Williams, David Zeuthen, Kimmo Hämäläinen, Ross Burton, William Jon McCann, Colin Walters, Brian Cameron, Peter O'Gorman, Peter Kjellerstedt, Christian Persch, Rob Taylor and others for their contributions in this release. Critical fixes: - #15430: ABI now guaranteed frozen - #8607: Fix broken introspection XML - #16079: Return an error on unknown property Get - #10834: Fix error handling in dbus_g_proxy_end_call_internal Other notable fixes: - #11672: Fixes for /bin/sh as dash - #11675: Fixes for non-gcc compilers - #10668: Correctly detect path to dbus-daemon - #12849, #12857: Memory leak fixes - New function to specify default timeout for calls on proxy - Implement org.freedesktop.DBus.Properties.GetAll - Require DBus 1.1 D-Bus GLib Bindings 0.74 (27 Jun 2007) == - Init threading first to stop a warning from new GLib. - Remove the XML documentation support in configure - Fix typo in _dbus_gvalue_signals_error (#10837) (Thanks to Peter Kjellerstedt) - Update GLib requirement (Closes #10889). - Document dbus-gtype-specialized - Add simple test suite for peer objects. - Support peer-to-peer proxies. (Closes #10233). - Add dbus_connection_get_g_connection. - Stop compiler warnings (Closes #10374). - Handle dbus errors which are not name has no owner - Update abstract socket test from DBus, which now cross-compiles - Rename the error quark to be unique - Update AUTHORS D-Bus GLib Bindings 0.73 (13 Feb 2007) == - Allow passing of NULL to strv out arguments. (Patch due to Luiz Augusto von Dentz . Fixes bug #8795.) - Make uscore_to_wincaps return NULL when passed NULL. (Fixes bug #8318.) - Only respond to NameOwnerChanged if its one of our names. (Patch by Kimmo Hämäläinen . Fixes bug #8235.) - Fix dbus-binding-tool to generate headers usable from C++. (Thanks to Christian Persch . Fixes bug #6358.) - Only require --prefix for server side binding generation. (Fixes reopened bug #4185.) - Clarify documentation for dbus_g_method_get_sender. (Fixes #8832.) - Add new API for specifying the timeout in DBusGProxy calls. (Patch due to S. Nalliami . Fixes bug #9832.) - Don't check for libxml2 when expat not found. (Fixes bugs #9894 and #9000.) - Add configure flags --with-introspect-xml. (Fixes bug #9105) - Use dbus_threads_init_default() rather than using own threading primitives. (Fixes bug #9259.) - Reduce dependency to dbus version 0.93, error out if correct version not found. (Patch due to Luiz Augusto von Dentz . Fixes bug #8793.) - Allow dbus and dbus-glib to live in different prefixes. (Fixes bug #9384.) - Add pkg-config support for uninstalled use. (Fix due to Damien Carbery . Fixes bug #9769.) D-Bus GLib Bindings 0.72 (26 Oct 2006) == - Only use -Wfloat-equal if compiler supports it (Closes #7658. Thanks to Jens Granseuer for the patch). - Return NULL from g_return_val_if_fail in dbus_g_proxy_begin_call (Closes #4159.) - Add dbus-gidl.h to IGNORE_HFILES for doxygen docs - Update tools/Makefile.am for new dbus-binding-tool behaviour - Remove bashism in make-dbus-glib-error-enum.sh (Closes #6700). - Fix introspection when object has exported properties. (dbus-gobject:write_interface was completely broken) - Fix thanks to mccann@jhu.edu. (Closes #8607). - Require --prefix in dbus-binding-tool (Closes #4185). - Don't shadow index. Rename usage of index to index_. Thanks stdlib... (Closes #8353). - Fix small leak when marshal_table is destroyed (Closes #6870 with patch from Richard Hult ). - Fixes crash if disposing one DBusGProxy causes another for the same service to be unrefed in a destroyed callback. - Use modern AC_INIT, AM_INIT_AUTOMAKE - Clean generated run-with-tmp-session-bus.conf on make clean - Actually run unit tests and checks when doing make distcheck - Use TEST_CORE_SERVICE_BINARY path for core test service file - Use dbus-daemon --introspect to generate DBus service introspect xml - Add tests for new interfaces functionaility - Bump GLib dependency to 2.6 (Closes #4390). - Add gobject-2.0 to dbus-glib-1.pc.in - Puts all exposed services in the org.freedesktop.DBus.GLib namespace - Update COPYING and HACKING to be correct for dbus-glib - Move tests/glib to test/core - Rename configure.in to configure.ac for modernity - Fix memleak in lookup_or_register_specialized (Applies fix from Daniel d'Andrada Tenório de Carvalho, closing bug #7352). - Add an m4 directory and add gtk-doc.m4, which is installed in the tree by gtkdocize. - tools/Makefile.am: Add tools/session.conf to EXTRA_DIST so make check works from tarballs - Fix compilation with -Werror - Make test scripts run during out-of-tree compilation - Fix out-of-tree compilation - Replace doxygen with gtk-doc in INSTALL - Commit patch to switch to gtk-doc with gtype-specialized doc and - Updates from Marc-Andre Lureau , with minor cleanup. (Closes #7726.) D-Bus GLib Bindings 0.71 (24 July 2006) == - Correctly installs a few missing headers - Build was cleaned up a bit D-Bus GLib Bindings 0.70 (17 July 2006) == - First release after bindings split - dbus-binding-tool heeds org.freedesktop.DBus.GLib.ClientCSymbol C symbol name annotations when generating glib client bindings - DBusGProxy can now be inherited from - Support added for generating bindings to arrays that are represented as GPtrArrays rather than GArrays (ie size-variable things, such as strings, objects, structs, etc). - Modification of the existing specialised types to have N type parameters (rather than the current 1 or 2 for arrays and dictionaries respectively). You can then use this to get a glib type to represent any arbitrary D-Bus struct type using dbus_g_type_get_struct. The only implementation of these types is with GValueArrays as before, but it's now possible to store these in arrays, emit them in signals, etc. - New methodbus_g_connection_open provides a way to open connections to an arbitrary address - Various bugs and memory leaks fixed Sleep after starting the peer server, before starting the peer client. This fixes random failures due to the race.