dbus-glib-0.114/0000775000175000017500000000000014764624122007142 5dbus-glib-0.114/gtk-doc.make0000644000175000017500000002506314764623725011265 # -*- mode: makefile -*- # # gtk-doc.make - make rules for gtk-doc # Copyright (C) 2003 James Henstridge # 2004-2007 Damon Chaplin # 2007-2017 Stefan Sauer # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . #################################### # Everything below here is generic # #################################### if GTK_DOC_USE_LIBTOOL GTKDOC_CC = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(INCLUDES) $(GTKDOC_DEPS_CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) GTKDOC_LD = $(LIBTOOL) --tag=CC --mode=link $(CC) $(GTKDOC_DEPS_LIBS) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) GTKDOC_RUN = $(LIBTOOL) --mode=execute else GTKDOC_CC = $(CC) $(INCLUDES) $(GTKDOC_DEPS_CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) GTKDOC_LD = $(CC) $(GTKDOC_DEPS_LIBS) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) GTKDOC_RUN = endif # We set GPATH here; this gives us semantics for GNU make # which are more like other make's VPATH, when it comes to # whether a source that is a target of one rule is then # searched for in VPATH/GPATH. # GPATH = $(srcdir) TARGET_DIR=$(HTML_DIR)/$(DOC_MODULE) SETUP_FILES = \ $(content_files) \ $(expand_content_files) \ $(DOC_MAIN_SGML_FILE) \ $(DOC_MODULE)-sections.txt \ $(DOC_MODULE)-overrides.txt EXTRA_DIST = \ $(HTML_IMAGES) \ $(SETUP_FILES) DOC_STAMPS=setup-build.stamp scan-build.stamp sgml-build.stamp \ html-build.stamp pdf-build.stamp \ sgml.stamp html.stamp pdf.stamp SCANOBJ_FILES = \ $(DOC_MODULE).actions \ $(DOC_MODULE).args \ $(DOC_MODULE).hierarchy \ $(DOC_MODULE).interfaces \ $(DOC_MODULE).prerequisites \ $(DOC_MODULE).signals REPORT_FILES = \ $(DOC_MODULE)-undocumented.txt \ $(DOC_MODULE)-undeclared.txt \ $(DOC_MODULE)-unused.txt gtkdoc-check.test: Makefile $(AM_V_GEN)echo "#!/bin/sh -e" > $@; \ echo "$(GTKDOC_CHECK_PATH) || exit 1" >> $@; \ chmod +x $@ CLEANFILES = $(SCANOBJ_FILES) $(REPORT_FILES) $(DOC_STAMPS) gtkdoc-check.test if GTK_DOC_BUILD_HTML HTML_BUILD_STAMP=html-build.stamp else HTML_BUILD_STAMP= endif if GTK_DOC_BUILD_PDF PDF_BUILD_STAMP=pdf-build.stamp else PDF_BUILD_STAMP= endif all-gtk-doc: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP) .PHONY: all-gtk-doc if ENABLE_GTK_DOC all-local: all-gtk-doc endif docs: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP) $(REPORT_FILES): sgml-build.stamp #### setup #### GTK_DOC_V_SETUP=$(GTK_DOC_V_SETUP_@AM_V@) GTK_DOC_V_SETUP_=$(GTK_DOC_V_SETUP_@AM_DEFAULT_V@) GTK_DOC_V_SETUP_0=@echo " DOC Preparing build"; setup-build.stamp: -$(GTK_DOC_V_SETUP)if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \ files=`echo $(SETUP_FILES) $(DOC_MODULE).types`; \ if test "x$$files" != "x" ; then \ for file in $$files ; do \ destdir=`dirname $(abs_builddir)/$$file`; \ test -d "$$destdir" || mkdir -p "$$destdir"; \ test -f $(abs_srcdir)/$$file && \ cp -pf $(abs_srcdir)/$$file $(abs_builddir)/$$file || true; \ done; \ fi; \ fi $(AM_V_at)touch setup-build.stamp #### scan #### GTK_DOC_V_SCAN=$(GTK_DOC_V_SCAN_@AM_V@) GTK_DOC_V_SCAN_=$(GTK_DOC_V_SCAN_@AM_DEFAULT_V@) GTK_DOC_V_SCAN_0=@echo " DOC Scanning header files"; GTK_DOC_V_INTROSPECT=$(GTK_DOC_V_INTROSPECT_@AM_V@) GTK_DOC_V_INTROSPECT_=$(GTK_DOC_V_INTROSPECT_@AM_DEFAULT_V@) GTK_DOC_V_INTROSPECT_0=@echo " DOC Introspecting gobjects"; scan-build.stamp: setup-build.stamp $(HFILE_GLOB) $(CFILE_GLOB) $(GTK_DOC_V_SCAN)_source_dir='' ; \ for i in $(DOC_SOURCE_DIR) ; do \ _source_dir="$${_source_dir} --source-dir=$$i" ; \ done ; \ gtkdoc-scan --module=$(DOC_MODULE) --ignore-headers="$(IGNORE_HFILES)" $${_source_dir} $(SCAN_OPTIONS) $(EXTRA_HFILES) $(GTK_DOC_V_INTROSPECT)if grep -l '^..*$$' $(DOC_MODULE).types > /dev/null 2>&1 ; then \ scanobj_options=""; \ gtkdoc-scangobj 2>&1 --help | grep >/dev/null "\--verbose"; \ if test "$$?" = "0"; then \ if test "x$(V)" = "x1"; then \ scanobj_options="--verbose"; \ fi; \ fi; \ CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" RUN="$(GTKDOC_RUN)" CFLAGS="$(GTKDOC_CFLAGS) $(CFLAGS)" LDFLAGS="$(GTKDOC_LIBS) $(LDFLAGS)" \ gtkdoc-scangobj $(SCANGOBJ_OPTIONS) $$scanobj_options --module=$(DOC_MODULE); \ else \ for i in $(SCANOBJ_FILES) ; do \ test -f $$i || touch $$i ; \ done \ fi $(AM_V_at)touch scan-build.stamp $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt: scan-build.stamp @true #### xml #### GTK_DOC_V_XML=$(GTK_DOC_V_XML_@AM_V@) GTK_DOC_V_XML_=$(GTK_DOC_V_XML_@AM_DEFAULT_V@) GTK_DOC_V_XML_0=@echo " DOC Building XML"; sgml-build.stamp: setup-build.stamp $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(HFILE_GLOB) $(CFILE_GLOB) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt $(expand_content_files) xml/gtkdocentities.ent $(GTK_DOC_V_XML)_source_dir='' ; \ for i in $(DOC_SOURCE_DIR) ; do \ _source_dir="$${_source_dir} --source-dir=$$i" ; \ done ; \ gtkdoc-mkdb --module=$(DOC_MODULE) --output-format=xml --expand-content-files="$(expand_content_files)" --main-sgml-file=$(DOC_MAIN_SGML_FILE) $${_source_dir} $(MKDB_OPTIONS) $(AM_V_at)touch sgml-build.stamp sgml.stamp: sgml-build.stamp @true $(DOC_MAIN_SGML_FILE): sgml-build.stamp @true xml/gtkdocentities.ent: Makefile $(GTK_DOC_V_XML)$(MKDIR_P) $(@D) && ( \ echo ""; \ echo ""; \ echo ""; \ echo ""; \ echo ""; \ echo ""; \ echo ""; \ ) > $@ #### html #### GTK_DOC_V_HTML=$(GTK_DOC_V_HTML_@AM_V@) GTK_DOC_V_HTML_=$(GTK_DOC_V_HTML_@AM_DEFAULT_V@) GTK_DOC_V_HTML_0=@echo " DOC Building HTML"; GTK_DOC_V_XREF=$(GTK_DOC_V_XREF_@AM_V@) GTK_DOC_V_XREF_=$(GTK_DOC_V_XREF_@AM_DEFAULT_V@) GTK_DOC_V_XREF_0=@echo " DOC Fixing cross-references"; html-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files) $(expand_content_files) $(GTK_DOC_V_HTML)rm -rf html && mkdir html && \ mkhtml_options=""; \ gtkdoc-mkhtml 2>&1 --help | grep >/dev/null "\--verbose"; \ if test "$$?" = "0"; then \ if test "x$(V)" = "x1"; then \ mkhtml_options="$$mkhtml_options --verbose"; \ fi; \ fi; \ gtkdoc-mkhtml 2>&1 --help | grep >/dev/null "\--path"; \ if test "$$?" = "0"; then \ mkhtml_options="$$mkhtml_options --path=\"$(abs_srcdir)\""; \ fi; \ cd html && gtkdoc-mkhtml $$mkhtml_options $(MKHTML_OPTIONS) $(DOC_MODULE) ../$(DOC_MAIN_SGML_FILE) -@test "x$(HTML_IMAGES)" = "x" || \ for file in $(HTML_IMAGES) ; do \ test -f $(abs_srcdir)/$$file && cp $(abs_srcdir)/$$file $(abs_builddir)/html; \ test -f $(abs_builddir)/$$file && cp $(abs_builddir)/$$file $(abs_builddir)/html; \ test -f $$file && cp $$file $(abs_builddir)/html; \ done; $(GTK_DOC_V_XREF)gtkdoc-fixxref --module=$(DOC_MODULE) --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS) $(AM_V_at)touch html-build.stamp #### pdf #### GTK_DOC_V_PDF=$(GTK_DOC_V_PDF_@AM_V@) GTK_DOC_V_PDF_=$(GTK_DOC_V_PDF_@AM_DEFAULT_V@) GTK_DOC_V_PDF_0=@echo " DOC Building PDF"; pdf-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files) $(expand_content_files) $(GTK_DOC_V_PDF)rm -f $(DOC_MODULE).pdf && \ mkpdf_options=""; \ gtkdoc-mkpdf 2>&1 --help | grep >/dev/null "\--verbose"; \ if test "$$?" = "0"; then \ if test "x$(V)" = "x1"; then \ mkpdf_options="$$mkpdf_options --verbose"; \ fi; \ fi; \ if test "x$(HTML_IMAGES)" != "x"; then \ for img in $(HTML_IMAGES); do \ part=`dirname $$img`; \ echo $$mkpdf_options | grep >/dev/null "\--imgdir=$$part "; \ if test $$? != 0; then \ mkpdf_options="$$mkpdf_options --imgdir=$$part"; \ fi; \ done; \ fi; \ gtkdoc-mkpdf --path="$(abs_srcdir)" $$mkpdf_options $(DOC_MODULE) $(DOC_MAIN_SGML_FILE) $(MKPDF_OPTIONS) $(AM_V_at)touch pdf-build.stamp ############## clean-local: @rm -f *~ *.bak @rm -rf .libs @if echo $(SCAN_OPTIONS) | grep -q "\--rebuild-types" ; then \ rm -f $(DOC_MODULE).types; \ fi @if echo $(SCAN_OPTIONS) | grep -q "\--rebuild-sections" ; then \ rm -f $(DOC_MODULE)-sections.txt; \ fi distclean-local: @rm -rf xml html $(REPORT_FILES) $(DOC_MODULE).pdf \ $(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt @if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \ rm -f $(SETUP_FILES) $(DOC_MODULE).types; \ fi maintainer-clean-local: @rm -rf xml html install-data-local: @installfiles=`echo $(builddir)/html/*`; \ if test "$$installfiles" = '$(builddir)/html/*'; \ then echo 1>&2 'Nothing to install' ; \ else \ if test -n "$(DOC_MODULE_VERSION)"; then \ installdir="$(DESTDIR)$(TARGET_DIR)-$(DOC_MODULE_VERSION)"; \ else \ installdir="$(DESTDIR)$(TARGET_DIR)"; \ fi; \ $(mkinstalldirs) $${installdir} ; \ for i in $$installfiles; do \ echo ' $(INSTALL_DATA) '$$i ; \ $(INSTALL_DATA) $$i $${installdir}; \ done; \ if test -n "$(DOC_MODULE_VERSION)"; then \ mv -f $${installdir}/$(DOC_MODULE).devhelp2 \ $${installdir}/$(DOC_MODULE)-$(DOC_MODULE_VERSION).devhelp2; \ fi; \ $(GTKDOC_REBASE) --relative --dest-dir=$(DESTDIR) --html-dir=$${installdir}; \ fi uninstall-local: @if test -n "$(DOC_MODULE_VERSION)"; then \ installdir="$(DESTDIR)$(TARGET_DIR)-$(DOC_MODULE_VERSION)"; \ else \ installdir="$(DESTDIR)$(TARGET_DIR)"; \ fi; \ rm -rf $${installdir} # # Require gtk-doc when making dist # if HAVE_GTK_DOC dist-check-gtkdoc: docs else dist-check-gtkdoc: @echo "*** gtk-doc is needed to run 'make dist'. ***" @echo "*** gtk-doc was not found when 'configure' ran. ***" @echo "*** please install gtk-doc and rerun 'configure'. ***" @false endif dist-hook: dist-check-gtkdoc all-gtk-doc dist-hook-local @mkdir $(distdir)/html @cp ./html/* $(distdir)/html @-cp ./$(DOC_MODULE).pdf $(distdir)/ @-cp ./$(DOC_MODULE).types $(distdir)/ @-cp ./$(DOC_MODULE)-sections.txt $(distdir)/ @cd $(distdir) && rm -f $(DISTCLEANFILES) @$(GTKDOC_REBASE) --online --relative --html-dir=$(distdir)/html .PHONY : dist-hook-local docs dbus-glib-0.114/doc/0000775000175000017500000000000014764624122007707 5dbus-glib-0.114/doc/reference/0000775000175000017500000000000014764624122011645 5dbus-glib-0.114/doc/reference/dbus-glib.types0000644000175000017500000000000014764624122014507 dbus-glib-0.114/doc/reference/html/0000775000175000017500000000000014764624122012611 5dbus-glib-0.114/doc/reference/html/index.html0000664000175000017500000000650614764624122014535 D-Bus GLib bindings - Reference Manual: D-Bus GLib bindings - Reference Manual

for version 0.114


Introduction
API Reference
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
Index of all symbols

dbus-glib is a deprecated API for use of D-Bus from GLib applications. Do not use it in new code.

Since version 2.26, GLib's accompanying GIO library provides a high-level API for D-Bus, "GDBus", based on an independent reimplementation of the D-Bus protocol. The maintainers of D-Bus recommend that GLib applications should use GDBus instead of dbus-glib.

dbus-glib-0.114/doc/reference/html/dbus-glib-Specializable-GType-System.html0000664000175000017500000043040714764624122022354 Specializable GType System: D-Bus GLib bindings - Reference Manual

Specializable GType System

Specializable GType System — Specialized GTypes

Stability Level

Unstable, unless otherwise indicated

Functions

void (*DBusGTypeSpecializedCollectionIterator) ()
void (*DBusGTypeSpecializedMapIterator) ()
gpointer (*DBusGTypeSpecializedConstructor) ()
void (*DBusGTypeSpecializedFreeFunc) ()
gpointer (*DBusGTypeSpecializedCopyFunc) ()
gboolean (*DBusGTypeSpecializedCollectionFixedAccessorFunc) ()
void (*DBusGTypeSpecializedCollectionIteratorFunc) ()
void (*DBusGTypeSpecializedCollectionAppendFunc) ()
void (*DBusGTypeSpecializedCollectionEndAppendFunc) ()
void (*DBusGTypeSpecializedMapIteratorFunc) ()
void (*DBusGTypeSpecializedMapAppendFunc) ()
gboolean (*DBusGTypeSpecializedStructGetMember) ()
gboolean (*DBusGTypeSpecializedStructSetMember) ()
GType dbus_g_type_get_collection ()
GType dbus_g_type_get_map ()
GType dbus_g_type_get_structv ()
GType dbus_g_type_get_struct ()
gboolean dbus_g_type_is_collection ()
gboolean dbus_g_type_is_map ()
gboolean dbus_g_type_is_struct ()
GType dbus_g_type_get_collection_specialization ()
GType dbus_g_type_get_map_key_specialization ()
GType dbus_g_type_get_map_value_specialization ()
GType dbus_g_type_get_struct_member_type ()
guint dbus_g_type_get_struct_size ()
gpointer dbus_g_type_specialized_construct ()
void dbus_g_type_specialized_init_append ()
void dbus_g_type_specialized_collection_append ()
void dbus_g_type_specialized_collection_end_append ()
void dbus_g_type_specialized_map_append ()
gboolean dbus_g_type_collection_get_fixed ()
void dbus_g_type_collection_value_iterate ()
void dbus_g_type_map_value_iterate ()
gboolean dbus_g_type_struct_get_member ()
gboolean dbus_g_type_struct_set_member ()
gboolean dbus_g_type_struct_get ()
gboolean dbus_g_type_struct_set ()
void dbus_g_type_specialized_init ()
void dbus_g_type_register_collection ()
void dbus_g_type_register_map ()
const DBusGTypeSpecializedMapVtable * dbus_g_type_map_peek_vtable ()
const DBusGTypeSpecializedCollectionVtable * dbus_g_type_collection_peek_vtable ()
const DBusGTypeSpecializedStructVtable * dbus_g_type_struct_peek_vtable ()
void dbus_g_type_register_struct ()
GVariant * dbus_g_value_build_g_variant ()
void dbus_g_value_parse_g_variant ()

Includes

#include <dbus/dbus-glib.h>

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.

Functions

DBusGTypeSpecializedCollectionIterator ()

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

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

New code should use GDBus instead.

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

Parameters

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);

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

New code should use GDBus instead.

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

Parameters

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()

 

DBusGTypeSpecializedConstructor ()

gpointer
(*DBusGTypeSpecializedConstructor) (GType type);

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

New code should use GDBus instead.

Parameters

type

a specialized boxed type

 

Returns

a new instance of type


DBusGTypeSpecializedFreeFunc ()

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

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

New code should use GDBus instead.

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).

Parameters

type

a specialized boxed type

 

val

an instance of type

 

DBusGTypeSpecializedCopyFunc ()

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

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

New code should use GDBus instead.

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).

Parameters

type

a specialized boxed type

 

src

an instance of type

 

Returns

a deep copy of src


DBusGTypeSpecializedCollectionFixedAccessorFunc ()

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

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

New code should use GDBus instead.

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

Parameters

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);

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

New code should use GDBus instead.

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

Parameters

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);

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

New code should use GDBus instead.

Implements dbus_g_type_specialized_collection_append().

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

Parameters

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);

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

New code should use GDBus instead.

Implements dbus_g_type_specialized_collection_end_append().

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

Parameters

ctx

an appending context returned by dbus_g_type_specialized_init_append()

 

DBusGTypeSpecializedMapIteratorFunc ()

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

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

New code should use GDBus instead.

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

Parameters

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);

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

New code should use GDBus instead.

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 .

Parameters

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

 

DBusGTypeSpecializedStructGetMember ()

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

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

New code should use GDBus instead.

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

Parameters

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);

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

New code should use GDBus instead.

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

Parameters

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


dbus_g_type_get_collection ()

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

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

New code should use GDBus instead.

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

Parameters

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);

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

New code should use GDBus instead.

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

Parameters

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);

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

New code should use GDBus instead.

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

Parameters

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,
                        ...);

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

New code should use GDBus instead.

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

Parameters

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);

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

New code should use GDBus instead.

Tests if a given GType is a collection.

Parameters

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);

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

New code should use GDBus instead.

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

Parameters

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);

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

New code should use GDBus instead.

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

Parameters

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);

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

New code should use GDBus instead.

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

Parameters

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);

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

New code should use GDBus instead.

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

Parameters

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);

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

New code should use GDBus instead.

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

Parameters

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);

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

New code should use GDBus instead.

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

Parameters

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);

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

New code should use GDBus instead.

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

Parameters

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);

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

New code should use GDBus instead.

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)

Parameters

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);

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

New code should use GDBus instead.

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..

Parameters

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);

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

New code should use GDBus instead.

Appends a given element to the end of a collection.

Parameters

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);

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

New code should use GDBus instead.

Finish appending elements to a given collection

Parameters

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);

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

New code should use GDBus instead.

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

Parameters

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);

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

New code should use GDBus instead.

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.

Parameters

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);

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

New code should use GDBus instead.

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.

Parameters

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);

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

New code should use GDBus instead.

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.

Parameters

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);

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

New code should use GDBus instead.

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

Parameters

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);

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

New code should use GDBus instead.

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.

Parameters

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,
                        ...);

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

New code should use GDBus instead.

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

Parameters

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 G_MAXUINT

 

Returns

FALSE on failure


dbus_g_type_struct_set ()

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

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

New code should use GDBus instead.

Sets the selected members of the struct in value .

Parameters

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);

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

New code should use GDBus instead.

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);

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

New code should use GDBus instead.

Defines a new collection container.

Parameters

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);

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

New code should use GDBus instead.

Defines a new map container.

Parameters

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);

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

New code should use GDBus instead.

Peek the vtable for a given map specialization

Parameters

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);

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

New code should use GDBus instead.

Peek the vtable for a given collection specialization

Parameters

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);

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

New code should use GDBus instead.

Peek the vtable for a given struct specialization

Parameters

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);

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

New code should use GDBus instead.

Defines a new struct container.

Parameters

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);

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

New code should use GDBus instead.

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).

Parameters

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);

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

New code should use GDBus instead.

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.

Parameters

variant

a GVariant

 

value

a zero-filled GValue

 

Types and Values

DBusGTypeSpecializedAppendContext

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

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

New code should use GDBus instead.

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

Members

GValue *val;

the GValue containing the array to which you're appending

 

GType specialization_type;

the GType of the array's elements

 

DBusGTypeSpecializedVtable

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

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

New code should use GDBus instead.

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.

Members

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

 

DBusGTypeSpecializedCollectionVtable

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

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

New code should use GDBus instead.

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

Members

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

 

DBusGTypeSpecializedMapVtable

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

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

New code should use GDBus instead.

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

Members

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

 

DBusGTypeSpecializedStructVtable

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

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

New code should use GDBus instead.

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

Members

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_TYPE_G_BOOLEAN_ARRAY

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

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

New code should use GDBus instead. The closest equivalent is G_VARIANT_TYPE ("ab").

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))

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

New code should use GDBus instead. The closest equivalent is G_VARIANT_TYPE_BYTESTRING.

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))

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

New code should use GDBus instead. The closest equivalent is G_VARIANT_TYPE ("au").

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))

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

New code should use GDBus instead. The closest equivalent is G_VARIANT_TYPE ("ai").

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))

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

New code should use GDBus instead. The closest equivalent is G_VARIANT_TYPE ("at").

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))

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

New code should use GDBus instead. The closest equivalent is G_VARIANT_TYPE ("ax").

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))

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

New code should use GDBus instead. The closest equivalent is G_VARIANT_TYPE_OBJECT_PATH_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

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

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

New code should use GDBus instead. The closest equivalent is G_VARIANT_TYPE ("a{ss}").

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;

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

New code should use GDBus instead. The closest equivalent is a GVariant (G_TYPE_VARIANT) of type G_VARIANT_TYPE_SIGNATURE.

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 ())

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

New code should use GDBus instead. The closest equivalent is a GVariant (G_TYPE_VARIANT) of type G_VARIANT_TYPE_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


DBusGObjectPath

typedef gchar DBusGObjectPath;

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

New code should use GDBus instead. The closest equivalent is a GVariant (G_TYPE_VARIANT) of type G_VARIANT_TYPE_OBJECT_PATH.

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 ())

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

New code should use GDBus instead. The closest equivalent is a GVariant (G_TYPE_VARIANT) of type G_VARIANT_TYPE_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

dbus-glib-0.114/doc/reference/html/dbus-glib-DBusGProxy.html0000664000175000017500000021401214764624122017273 DBusGProxy: D-Bus GLib bindings - Reference Manual

DBusGProxy

DBusGProxy — DBus Proxy

Stability Level

Stable, unless otherwise indicated

Types and Values

Includes

#include <dbus/dbus-glib.h>

Description

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

Functions

DBusGProxyCallNotify ()

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

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

New code should use GDBus instead. The closest equivalent is the standard GAsyncReadyCallback mechanism.

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.

Parameters

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);

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

New code should use GDBus instead. The closest equivalent is g_dbus_proxy_new_sync().

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.

Parameters

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);

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

New code should use GDBus instead. The closest equivalent is g_dbus_proxy_new_sync() with the name owner's unique name passed as name .

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.

Parameters

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);

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

New code should use GDBus instead. The closest equivalent is g_dbus_proxy_new_sync().

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

Parameters

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);

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

New code should use GDBus instead. The closest equivalent is g_dbus_proxy_new_sync().

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.

Parameters

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);

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

New code should use GDBus instead. There is no direct equivalent for this function: construct a new proxy instead.

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.

Parameters

proxy

the proxy

 

interface_name

an object interface

 

dbus_g_proxy_get_path ()

const char *
dbus_g_proxy_get_path (DBusGProxy *proxy);

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

New code should use GDBus instead. The closest equivalent is g_dbus_proxy_get_object_path().

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.

Parameters

proxy

the proxy

 

Returns

an object path


dbus_g_proxy_get_bus_name ()

const char *
dbus_g_proxy_get_bus_name (DBusGProxy *proxy);

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

New code should use GDBus instead. The closest equivalent is g_dbus_proxy_get_name() or g_dbus_proxy_get_name_owner(), depending how the proxy was created.

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.

Parameters

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);

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

New code should use GDBus instead. The closest equivalent is g_dbus_proxy_get_interface_name().

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.

Parameters

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,
                         ...);

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

New code should use GDBus instead.

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.

Parameters

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);

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

New code should use GDBus instead. The closest equivalent is g_dbus_connection_signal_subscribe().

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.

Parameters

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);

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

New code should use GDBus instead. The closest equivalent is g_dbus_connection_signal_unsubscribe().

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.

Parameters

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);

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

New code should use GDBus instead. The closest equivalent is g_dbus_connection_send_message().

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.

Parameters

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,
                   ...);

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

New code should use GDBus instead. The closest equivalent is g_dbus_proxy_call_sync().

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.

Parameters

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,
                                ...);

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

New code should use GDBus instead. The closest equivalent is g_dbus_proxy_call_sync().

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.

Parameters

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,
                            ...);

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

New code should use GDBus instead. The closest equivalent is g_dbus_proxy_call() with callback = NULL.

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.

Parameters

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,
                         ...);

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

New code should use GDBus instead. The closest equivalent is g_dbus_proxy_call().

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.

Parameters

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,
                                      ...);

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

New code should use GDBus instead. The closest equivalent is g_dbus_proxy_call().

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.

Parameters

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,
                       ...);

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

New code should use GDBus instead. The closest equivalent is g_dbus_proxy_call_finish().

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.

Parameters

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);

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

New code should use GDBus instead. The closest equivalent is g_cancellable_cancel().

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.

Parameters

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);

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

New code should use GDBus instead.

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.

Parameters

proxy

a proxy for a remote interface

 

timeout

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

 

Since: 0.75

Types and Values

struct DBusGProxy

struct DBusGProxy {
};

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

New code should use GDBus instead. The closest equivalent is GDBusProxy.

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


DBusGProxyCall

typedef struct _DBusGProxyCall DBusGProxyCall;

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

New code should use GDBus instead. There is no direct equivalent in GDBus, but the standard GCancellable mechanism is analogous.

An opaque pointer representing an asynchronous call in progress.

See Also

DBusGProxy

dbus-glib-0.114/doc/reference/html/dbus-glib-DBusGMethod.html0000664000175000017500000004027214764624122017377 DBusGMethod: D-Bus GLib bindings - Reference Manual

DBusGMethod

DBusGMethod — GMethod Info & Invocation

Stability Level

Stable, unless otherwise indicated

Types and Values

Includes

#include <dbus/dbus-glib.h>

Description

These types are used to call methods on GObject objects.

Functions

dbus_g_method_get_sender ()

gchar *
dbus_g_method_get_sender (DBusGMethodInvocation *context);

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

New code should use GDBus instead. The closest equivalent is g_dbus_method_invocation_get_sender().

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).

Parameters

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);

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

New code should use GDBus instead. The closest equivalent is g_dbus_method_invocation_return_value().

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

Parameters

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);

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

New code should use GDBus instead. The closest equivalent is g_dbus_method_invocation_return_value().

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

Parameters

context

the method context

 

reply

the reply message, will be unreffed

 

dbus_g_method_return ()

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

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

New code should use GDBus instead. The closest equivalent is g_dbus_method_invocation_return_value().

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

Parameters

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);

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

New code should use GDBus instead. The closest equivalent is g_dbus_method_invocation_return_gerror().

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

Parameters

context

the method context

 

error

the error to send

 

Types and Values

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.

Members

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;

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

New code should use GDBus instead. The closest equivalent is GDBusMethodInvocation.

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

See Also

DBusGMessage

dbus-glib-0.114/doc/reference/html/dbus-glib-DBusGMessage.html0000664000175000017500000002521214764624122017540 DBusGMessage: D-Bus GLib bindings - Reference Manual

DBusGMessage

DBusGMessage — DBus Message

Stability Level

Stable, unless otherwise indicated

Types and Values

Includes

#include <dbus/dbus-glib.h>

Description

A DBusGMessage is a boxed type abstracting a DBusMessage.

Functions

dbus_g_message_ref ()

DBusGMessage *
dbus_g_message_ref (DBusGMessage *message);

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

New code should use GDBusMessage instead.

Increment refcount on a DBusGMessage

Parameters

message

the message to ref

 

Returns

the message that was ref'd


dbus_g_message_unref ()

void
dbus_g_message_unref (DBusGMessage *message);

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

New code should use GDBusMessage instead.

Decrement refcount on a DBusGMessage

Parameters

message

the message to unref

 

dbus_g_message_get_message ()

DBusMessage *
dbus_g_message_get_message (DBusGMessage *gmessage);

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

New code should use GDBus instead.

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

Parameters

gmessage

a DBusGMessage

 

Returns

DBusMessage

Types and Values

DBusGMessage

typedef struct _DBusGMessage DBusGMessage;

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

New code should use GDBusMessage instead.

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 ())

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

New code should use GDBus instead.

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

Returns

the GLib type

See Also

DBusMessage

dbus-glib-0.114/doc/reference/html/dbus-glib-DBusGError.html0000664000175000017500000004557214764624122017260 DBusGError: D-Bus GLib bindings - Reference Manual

DBusGError

DBusGError — DBus GError

Stability Level

Stable, unless otherwise indicated

Functions

Types and Values

enum DBusGError
#define DBUS_GERROR

Includes

#include <dbus/dbus-glib.h>

Description

DBusGError is the GError used by DBus.

Functions

dbus_g_error_has_name ()

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

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

New code should use GDBus instead. The closest equivalent is g_dbus_error_get_remote_error().

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).

Parameters

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);

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

New code should use GDBus instead. The closest equivalent is g_dbus_error_get_remote_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.

Parameters

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);

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

New code should use GDBus instead. The closest equivalent is g_dbus_error_register_error_domain().

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.)

Parameters

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

 

Types and Values

enum DBusGError

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

New code should use GDBus and its GDBusError enum instead.

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.

Members

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

   

DBUS_GERROR

#define DBUS_GERROR dbus_g_error_quark ()

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

New code should use GDBus and its GDBusError enum instead.

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

See Also

GError

dbus-glib-0.114/doc/reference/html/dbus-glib-DBusGConnection.html0000664000175000017500000007200714764624122020257 DBusGConnection: D-Bus GLib bindings - Reference Manual

DBusGConnection

DBusGConnection — DBus Connection

Stability Level

Stable, unless otherwise indicated

Types and Values

Includes

#include <dbus/dbus-glib.h>

Description

A DBusGConnection is a boxed type abstracting a DBusConnection.

Functions

dbus_g_bus_get ()

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

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

New code should use GDBus instead. The closest equivalent is g_bus_get_sync().

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.)

Parameters

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);

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

New code should use GDBus instead. The closest equivalent is g_bus_get_sync().

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.

Parameters

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);

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

New code should use GDBus instead. GDBus is always thread-safe, whereas dbus-glib is never thread-safe.

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.

Equivalent to dbus_threads_init_default(), which does nothing. dbus-glib requires dbus >= 1.8, which is thread-safe by default.

Note that dbus-glib's GObject mapping is explicitly *not* thread-safe.


dbus_g_connection_open ()

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

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

New code should use GDBus instead. The closest equivalent is g_dbus_connection_new_for_address_sync().

Returns a connection to the given address.

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

Parameters

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);

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

New code should use GDBusConnection instead.

Increment refcount on a DBusGConnection

Parameters

connection

the DBusGConnection to ref

 

Returns

the connection that was ref'd


dbus_g_connection_unref ()

void
dbus_g_connection_unref (DBusGConnection *connection);

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

New code should use GDBusConnection instead.

Decrement refcount on a DBusGConnection

Parameters

connection

the connection to unref

 

dbus_g_connection_flush ()

void
dbus_g_connection_flush (DBusGConnection *connection);

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

The closest equivalent in GDBus is g_dbus_connection_flush_sync().

Blocks until outgoing calls and signal emissions have been sent.

Parameters

connection

the DBusGConnection to flush

 

dbus_g_connection_get_connection ()

DBusConnection *
dbus_g_connection_get_connection (DBusGConnection *gconnection);

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

New code should use GDBus instead.

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

Parameters

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);

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

New code should use GDBus instead. The closest equivalent is g_dbus_connection_register_object(), but GDBusObjectManagerServer and GDBusObjectSkeleton provide a higher-level API.

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.

Parameters

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);

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

New code should use GDBus instead. The closest equivalent is g_dbus_connection_unregister_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.

Parameters

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);

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

New code should use GDBus instead. There is no direct equivalent for this function.

FIXME

Parameters

connection

a DBusGConnection

 

at_path

path

 

Returns

the object at path at_path

Types and Values

DBusGConnection

typedef struct _DBusGConnection DBusGConnection;

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

New code should use GDBusConnection from the GIO library, which is not based on libdbus or dbus-glib.

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 ())

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

New code should use GDBus instead.

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

Returns

the GLib type

See Also

DBusConnection

dbus-glib-0.114/doc/reference/html/dbus-glib-DBus-GObject-related-functions.html0000664000175000017500000005003114764624122023060 DBus GObject related functions: D-Bus GLib bindings - Reference Manual

DBus GObject related functions

DBus GObject related functions — Exporting a GObject remotely

Stability Level

Stable, unless otherwise indicated

Types and Values

Includes

#include <dbus/dbus-glib.h>

Description

FIXME

Functions

dbus_g_object_type_install_info ()

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

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

New code should use GDBus instead. There is no direct equivalent for this function.

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.

Parameters

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);

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

New code should use GDBus instead. There is no equivalent for this function, because GDBus does not conflate GObject and D-Bus property names in the same way.

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.

Parameters

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_register_marshaller ()

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

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

New code should use GDBus instead.

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 is no longer useful, and is only provided for compatibility with older dbus-glib. The GClosureMarshal will not be called.

Parameters

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);

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

New code should use GDBus instead.

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

Parameters

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);

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

New code should use GDBus instead. There is no equivalent for this function.

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

Types and Values

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.

Members

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

 

See Also

GObject

dbus-glib-0.114/doc/reference/html/dbus-glib-DBus-GLib-low-level.html0000664000175000017500000003776214764624122020660 DBus GLib low level: D-Bus GLib bindings - Reference Manual

DBus GLib low level

DBus GLib low level — DBus lower level functions

Stability Level

Unstable, unless otherwise indicated

Types and Values

Includes

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

Description

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

Functions

dbus_set_g_error ()

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

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

New code should use GDBus instead. GDBus' error encoding is much simpler and more reliable, and the closest equivalent is g_dbus_error_new_for_dbus_error().

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
size_t len = strlen(msg);
const char *error_name = msg+len+1;]|

Parameters

gerror

an error

 

derror

a DBusError

 

dbus_connection_setup_with_g_main ()

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

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

New code should use GDBus instead. Modules that need to connect libdbus to a GLib main loop should use the dbus-gmain submodule via git subtree or git submodule.

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.

Parameters

connection

the connection

 

context

the GMainContext or NULL for default context

 

dbus_connection_get_g_connection ()

DBusGConnection *
dbus_connection_get_g_connection (DBusConnection *connection);

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

New code should use GDBus instead.

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.

Parameters

connection

a DBusConnection

 

Returns

DBusGConnection


dbus_server_setup_with_g_main ()

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

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

New code should use GDBus instead. Modules that need to connect libdbus to a GLib main loop should use the dbus-gmain submodule via git subtree or git submodule.

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.

Parameters

server

the server

 

context

the GMainContext or NULL for default

 

Types and Values

DBUS_TYPE_CONNECTION

#define DBUS_TYPE_CONNECTION      (dbus_connection_get_g_type ())

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

New code should use GDBus instead.

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 ())

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

New code should use GDBus instead.

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.114/doc/reference/html/dbus-binding-tool.html0000664000175000017500000000611214764624122016737 dbus-binding-tool: D-Bus GLib bindings - Reference Manual

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.114/doc/reference/html/ch03.html0000664000175000017500000000356714764624122014167 Tools Reference: D-Bus GLib bindings - Reference Manual

Tools Reference

dbus-binding-tool — C language GLib bindings generation utility
dbus-glib-0.114/doc/reference/html/ch02.html0000664000175000017500000000570414764624122014161 API Reference: D-Bus GLib bindings - Reference Manual

API Reference

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
dbus-glib-0.114/doc/reference/html/ch01.html0000664000175000017500000000445214764624122014157 Introduction: D-Bus GLib bindings - Reference Manual

Introduction

D-Bus is a message bus system, a simple way for applications to talk to one another. For more information on D-Bus, see http://www.freedesktop.org/wiki/Software/dbus.

dbus-glib is a deprecated API for use of D-Bus from GLib applications. Do not use it in new code.

Since version 2.26, GLib's accompanying GIO library provides a high-level API for D-Bus, "GDBus", based on an independent reimplementation of the D-Bus protocol. The maintainers of D-Bus recommend that GLib applications should use GDBus instead of dbus-glib.

dbus-glib-0.114/doc/reference/html/api-index-full.html0000664000175000017500000012032314764624122016236 Index of all symbols: D-Bus GLib bindings - Reference Manual

Index of all symbols

C

dbus_connection_get_g_connection, function in DBus GLib low level
dbus_connection_setup_with_g_main, function in DBus GLib low level

G

DBusGConnection, struct in DBusGConnection
DBUS_GERROR, macro in DBusGError
DBusGError, enum in DBusGError
dbus_glib_global_set_disable_legacy_property_access, function in DBus GObject related functions
DBusGMessage, struct in DBusGMessage
DBusGMethodInfo, struct in DBusGMethod
DBusGMethodInvocation, struct in DBusGMethod
DBusGObjectInfo, struct in DBus GObject related functions
DBusGObjectPath, typedef in Specializable GType System
DBusGProxy, struct in DBusGProxy
DBusGProxyCall, struct in DBusGProxy
DBusGProxyCallNotify, user_function in DBusGProxy
DBusGSignature, typedef in Specializable GType System
DBusGTypeSpecializedAppendContext, struct in Specializable GType System
DBusGTypeSpecializedCollectionAppendFunc, user_function in Specializable GType System
DBusGTypeSpecializedCollectionEndAppendFunc, user_function in Specializable GType System
DBusGTypeSpecializedCollectionFixedAccessorFunc, user_function in Specializable GType System
DBusGTypeSpecializedCollectionIterator, user_function in Specializable GType System
DBusGTypeSpecializedCollectionIteratorFunc, user_function in Specializable GType System
DBusGTypeSpecializedCollectionVtable, struct in Specializable GType System
DBusGTypeSpecializedConstructor, user_function in Specializable GType System
DBusGTypeSpecializedCopyFunc, user_function in Specializable GType System
DBusGTypeSpecializedFreeFunc, user_function in Specializable GType System
DBusGTypeSpecializedMapAppendFunc, user_function in Specializable GType System
DBusGTypeSpecializedMapIterator, user_function in Specializable GType System
DBusGTypeSpecializedMapIteratorFunc, user_function in Specializable GType System
DBusGTypeSpecializedMapVtable, struct in Specializable GType System
DBusGTypeSpecializedStructGetMember, user_function in Specializable GType System
DBusGTypeSpecializedStructSetMember, user_function in Specializable GType System
DBusGTypeSpecializedStructVtable, struct in Specializable GType System
DBusGTypeSpecializedVtable, struct in Specializable GType System
dbus_g_bus_get, function in DBusGConnection
dbus_g_bus_get_private, function in DBusGConnection
dbus_g_connection_flush, function in DBusGConnection
dbus_g_connection_get_connection, function in DBusGConnection
dbus_g_connection_lookup_g_object, function in DBusGConnection
dbus_g_connection_open, function in DBusGConnection
dbus_g_connection_ref, function in DBusGConnection
dbus_g_connection_register_g_object, function in DBusGConnection
dbus_g_connection_unref, function in DBusGConnection
dbus_g_connection_unregister_g_object, function in DBusGConnection
dbus_g_error_domain_register, function in DBusGError
dbus_g_error_get_name, function in DBusGError
dbus_g_error_has_name, function in DBusGError
dbus_g_message_get_message, function in DBusGMessage
dbus_g_message_ref, function in DBusGMessage
dbus_g_message_unref, function in DBusGMessage
dbus_g_method_get_reply, function in DBusGMethod
dbus_g_method_get_sender, function in DBusGMethod
dbus_g_method_return, function in DBusGMethod
dbus_g_method_return_error, function in DBusGMethod
dbus_g_method_send_reply, function in DBusGMethod
dbus_g_object_register_marshaller, function in DBus GObject related functions
dbus_g_object_register_marshaller_array, function in DBus GObject related functions
dbus_g_object_type_install_info, function in DBus GObject related functions
dbus_g_object_type_register_shadow_property, function in DBus GObject related functions
dbus_g_proxy_add_signal, function in DBusGProxy
dbus_g_proxy_begin_call, function in DBusGProxy
dbus_g_proxy_begin_call_with_timeout, function in DBusGProxy
dbus_g_proxy_call, function in DBusGProxy
dbus_g_proxy_call_no_reply, function in DBusGProxy
dbus_g_proxy_call_with_timeout, function in DBusGProxy
dbus_g_proxy_cancel_call, function in DBusGProxy
dbus_g_proxy_connect_signal, function in DBusGProxy
dbus_g_proxy_disconnect_signal, function in DBusGProxy
dbus_g_proxy_end_call, function in DBusGProxy
dbus_g_proxy_get_bus_name, function in DBusGProxy
dbus_g_proxy_get_interface, function in DBusGProxy
dbus_g_proxy_get_path, function in DBusGProxy
dbus_g_proxy_new_for_name, function in DBusGProxy
dbus_g_proxy_new_for_name_owner, function in DBusGProxy
dbus_g_proxy_new_for_peer, function in DBusGProxy
dbus_g_proxy_new_from_proxy, function in DBusGProxy
dbus_g_proxy_send, function in DBusGProxy
dbus_g_proxy_set_default_timeout, function in DBusGProxy
dbus_g_proxy_set_interface, function in DBusGProxy
dbus_g_thread_init, function in DBusGConnection
dbus_g_type_collection_get_fixed, function in Specializable GType System
dbus_g_type_collection_peek_vtable, function in Specializable GType System
dbus_g_type_collection_value_iterate, function in Specializable GType System
dbus_g_type_get_collection, function in Specializable GType System
dbus_g_type_get_collection_specialization, function in Specializable GType System
dbus_g_type_get_map, function in Specializable GType System
dbus_g_type_get_map_key_specialization, function in Specializable GType System
dbus_g_type_get_map_value_specialization, function in Specializable GType System
dbus_g_type_get_struct, function in Specializable GType System
dbus_g_type_get_structv, function in Specializable GType System
dbus_g_type_get_struct_member_type, function in Specializable GType System
dbus_g_type_get_struct_size, function in Specializable GType System
dbus_g_type_is_collection, function in Specializable GType System
dbus_g_type_is_map, function in Specializable GType System
dbus_g_type_is_struct, function in Specializable GType System
dbus_g_type_map_peek_vtable, function in Specializable GType System
dbus_g_type_map_value_iterate, function in Specializable GType System
dbus_g_type_register_collection, function in Specializable GType System
dbus_g_type_register_map, function in Specializable GType System
dbus_g_type_register_struct, function in Specializable GType System
dbus_g_type_specialized_collection_append, function in Specializable GType System
dbus_g_type_specialized_collection_end_append, function in Specializable GType System
dbus_g_type_specialized_construct, function in Specializable GType System
dbus_g_type_specialized_init, function in Specializable GType System
dbus_g_type_specialized_init_append, function in Specializable GType System
dbus_g_type_specialized_map_append, function in Specializable GType System
dbus_g_type_struct_get, function in Specializable GType System
dbus_g_type_struct_get_member, function in Specializable GType System
dbus_g_type_struct_peek_vtable, function in Specializable GType System
dbus_g_type_struct_set, function in Specializable GType System
dbus_g_type_struct_set_member, function in Specializable GType System
dbus_g_value_build_g_variant, function in Specializable GType System
dbus_g_value_parse_g_variant, function in Specializable GType System

S

dbus_server_setup_with_g_main, function in DBus GLib low level
dbus_set_g_error, function in DBus GLib low level

T

DBUS_TYPE_CONNECTION, macro in DBus GLib low level
DBUS_TYPE_G_BOOLEAN_ARRAY, macro in Specializable GType System
DBUS_TYPE_G_CONNECTION, macro in DBusGConnection
DBUS_TYPE_G_INT64_ARRAY, macro in Specializable GType System
DBUS_TYPE_G_INT_ARRAY, macro in Specializable GType System
DBUS_TYPE_G_MESSAGE, macro in DBusGMessage
DBUS_TYPE_G_OBJECT_ARRAY, macro in Specializable GType System
DBUS_TYPE_G_OBJECT_PATH, macro in Specializable GType System
DBUS_TYPE_G_SIGNATURE, macro in Specializable GType System
DBUS_TYPE_G_STRING_STRING_HASHTABLE, macro in Specializable GType System
DBUS_TYPE_G_UCHAR_ARRAY, macro in Specializable GType System
DBUS_TYPE_G_UINT64_ARRAY, macro in Specializable GType System
DBUS_TYPE_G_UINT_ARRAY, macro in Specializable GType System
DBUS_TYPE_MESSAGE, macro in DBus GLib low level
dbus-glib-0.114/doc/reference/html/up.png0000644000175000017500000000040414764624122013657 PNG  IHDRabKGD pHYs B(xtIME eIDAT81 @D{xa;$]r =JR1, Sd-}0̟oL:m-QO[ k TzMޠL,:ךu!tK; Pp Ot@l/̵*l}IENDB`dbus-glib-0.114/doc/reference/html/up-insensitive.png0000644000175000017500000000056614764624122016226 PNG  IHDRabKGD pHYs B(xtIME eIDAT8?/Qϙ?[u$VHTDۈBM+! dt { padding-top: 0.25em; padding-bottom: 0.25em; font-weight: bold; } dl.toc > dl { padding-bottom: 0.5em; } .parameter { font-style: normal; } .footer { padding-top: 3.5em; /* tango:aluminium 3 */ color: #babdb6; text-align: center; font-size: 80%; } .informalfigure, .figure { margin: 1em; } .informalexample, .example { margin-top: 1em; margin-bottom: 1em; } .warning { /* tango:orange 0/1 */ background: #ffeed9; background: rgba(252, 175, 62, 0.1); border-color: #ffb04f; border-color: rgba(252, 175, 62, 0.2); } .note { /* tango:chameleon 0/0.5 */ background: #d8ffb2; background: rgba(138, 226, 52, 0.1); border-color: #abf562; border-color: rgba(138, 226, 52, 0.2); } div.blockquote { border-color: #eeeeec; } .note, .warning, div.blockquote { padding: 0.5em; border-width: 1px; border-style: solid; margin: 2em; } .note p, .warning p { margin: 0; } div.warning h3.title, div.note h3.title { display: none; } p + div.section { margin-top: 1em; } div.refnamediv, div.refsynopsisdiv, div.refsect1, div.refsect2, div.toc, div.section { margin-bottom: 1em; } /* blob links */ h2 .extralinks, h3 .extralinks { float: right; /* tango:aluminium 3 */ color: #babdb6; font-size: 80%; font-weight: normal; } .lineart { color: #d3d7cf; font-weight: normal; } .annotation { /* tango:aluminium 5 */ color: #555753; font-weight: normal; } .structfield { font-style: normal; font-weight: normal; } acronym,abbr { border-bottom: 1px dotted gray; } .listing_frame { /* tango:sky blue 1 */ border: solid 1px #729fcf; border: solid 1px rgba(114, 159, 207, 0.2); padding: 0px; } .listing_lines, .listing_code { margin-top: 0px; margin-bottom: 0px; padding: 0.5em; } .listing_lines { /* tango:sky blue 0.5 */ background: #a6c5e3; background: rgba(114, 159, 207, 0.2); /* tango:aluminium 6 */ color: #2e3436; } .listing_code { /* tango:sky blue 0 */ background: #e6f3ff; background: rgba(114, 159, 207, 0.1); } .listing_code .programlisting { /* override from previous */ border: none 0px; padding: 0px; background: none; } .listing_lines pre, .listing_code pre { margin: 0px; } @media screen { /* these have a as a first child, but since there are no parent selectors * we can't use that. */ a.footnote { position: relative; top: 0em ! important; } /* this is needed so that the local anchors are displayed below the naviagtion */ div.footnote a[name], div.refnamediv a[name], div.refsect1 a[name], div.refsect2 a[name], div.index a[name], div.glossary a[name], div.sect1 a[name] { display: inline-block; position: relative; top:-5em; } /* this seems to be a bug in the xsl style sheets when generating indexes */ div.index div.index { top: 0em; } /* make space for the fixed navigation bar and add space at the bottom so that * link targets appear somewhat close to top */ body { padding-top: 2.5em; padding-bottom: 500px; max-width: 60em; } p { max-width: 60em; } /* style and size the navigation bar */ table.navigation#top { position: fixed; background: #e2e2e2; border-bottom: solid 1px #babdb6; border-spacing: 5px; margin-top: 0; margin-bottom: 0; top: 0; left: 0; z-index: 10; } table.navigation#top td { padding-left: 6px; padding-right: 6px; } .navigation a, .navigation a:visited { /* tango:sky blue 3 */ color: #204a87; } .navigation a:hover { /* tango:sky blue 2 */ color: #3465a4; } td.shortcuts { /* tango:sky blue 2 */ color: #3465a4; font-size: 80%; white-space: nowrap; } td.shortcuts .dim { color: #babdb6; } .navigation .title { font-size: 80%; max-width: none; margin: 0px; font-weight: normal; } } @media screen and (min-width: 60em) { /* screen larger than 60em */ body { margin: auto; } } @media screen and (max-width: 60em) { /* screen less than 60em */ #nav_hierarchy { display: none; } #nav_interfaces { display: none; } #nav_prerequisites { display: none; } #nav_derived_interfaces { display: none; } #nav_implementations { display: none; } #nav_child_properties { display: none; } #nav_style_properties { display: none; } #nav_index { display: none; } #nav_glossary { display: none; } .gallery_image { display: none; } .property_flags { display: none; } .signal_flags { display: none; } .parameter_annotations { display: none; } .enum_member_annotations { display: none; } .struct_member_annotations { display: none; } .union_member_annotations { display: none; } /* now that a column is hidden, optimize space */ col.parameters_name { width: auto; } col.parameters_description { width: auto; } col.struct_members_name { width: auto; } col.struct_members_description { width: auto; } col.enum_members_name { width: auto; } col.enum_members_description { width: auto; } col.union_members_name { width: auto; } col.union_members_description { width: auto; } .listing_lines { display: none; } } @media print { table.navigation { visibility: collapse; display: none; } div.titlepage table.navigation { visibility: visible; display: table; background: #e2e2e2; border: solid 1px #babdb6; margin-top: 0; margin-bottom: 0; top: 0; left: 0; height: 3em; } } pre { line-height: 125%; } td.linenos .normal { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; } span.linenos { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; } td.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; } span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; } .hll { background-color: #ffffcc } .c { color: #3D7B7B; font-style: italic } /* Comment */ .err { border: 1px solid #FF0000 } /* Error */ .k { color: #008000; font-weight: bold } /* Keyword */ .o { color: #666666 } /* Operator */ .ch { color: #3D7B7B; font-style: italic } /* Comment.Hashbang */ .cm { color: #3D7B7B; font-style: italic } /* Comment.Multiline */ .cp { color: #9C6500 } /* Comment.Preproc */ .cpf { color: #3D7B7B; font-style: italic } /* Comment.PreprocFile */ .c1 { color: #3D7B7B; font-style: italic } /* Comment.Single */ .cs { color: #3D7B7B; font-style: italic } /* Comment.Special */ .gd { color: #A00000 } /* Generic.Deleted */ .ge { font-style: italic } /* Generic.Emph */ .ges { font-weight: bold; font-style: italic } /* Generic.EmphStrong */ .gr { color: #E40000 } /* Generic.Error */ .gh { color: #000080; font-weight: bold } /* Generic.Heading */ .gi { color: #008400 } /* Generic.Inserted */ .go { color: #717171 } /* Generic.Output */ .gp { color: #000080; font-weight: bold } /* Generic.Prompt */ .gs { font-weight: bold } /* Generic.Strong */ .gu { color: #800080; font-weight: bold } /* Generic.Subheading */ .gt { color: #0044DD } /* Generic.Traceback */ .kc { color: #008000; font-weight: bold } /* Keyword.Constant */ .kd { color: #008000; font-weight: bold } /* Keyword.Declaration */ .kn { color: #008000; font-weight: bold } /* Keyword.Namespace */ .kp { color: #008000 } /* Keyword.Pseudo */ .kr { color: #008000; font-weight: bold } /* Keyword.Reserved */ .kt { color: #B00040 } /* Keyword.Type */ .m { color: #666666 } /* Literal.Number */ .s { color: #BA2121 } /* Literal.String */ .na { color: #687822 } /* Name.Attribute */ .nb { color: #008000 } /* Name.Builtin */ .nc { color: #0000FF; font-weight: bold } /* Name.Class */ .no { color: #880000 } /* Name.Constant */ .nd { color: #AA22FF } /* Name.Decorator */ .ni { color: #717171; font-weight: bold } /* Name.Entity */ .ne { color: #CB3F38; font-weight: bold } /* Name.Exception */ .nf { color: #0000FF } /* Name.Function */ .nl { color: #767600 } /* Name.Label */ .nn { color: #0000FF; font-weight: bold } /* Name.Namespace */ .nt { color: #008000; font-weight: bold } /* Name.Tag */ .nv { color: #19177C } /* Name.Variable */ .ow { color: #AA22FF; font-weight: bold } /* Operator.Word */ .w { color: #bbbbbb } /* Text.Whitespace */ .mb { color: #666666 } /* Literal.Number.Bin */ .mf { color: #666666 } /* Literal.Number.Float */ .mh { color: #666666 } /* Literal.Number.Hex */ .mi { color: #666666 } /* Literal.Number.Integer */ .mo { color: #666666 } /* Literal.Number.Oct */ .sa { color: #BA2121 } /* Literal.String.Affix */ .sb { color: #BA2121 } /* Literal.String.Backtick */ .sc { color: #BA2121 } /* Literal.String.Char */ .dl { color: #BA2121 } /* Literal.String.Delimiter */ .sd { color: #BA2121; font-style: italic } /* Literal.String.Doc */ .s2 { color: #BA2121 } /* Literal.String.Double */ .se { color: #AA5D1F; font-weight: bold } /* Literal.String.Escape */ .sh { color: #BA2121 } /* Literal.String.Heredoc */ .si { color: #A45A77; font-weight: bold } /* Literal.String.Interpol */ .sx { color: #008000 } /* Literal.String.Other */ .sr { color: #A45A77 } /* Literal.String.Regex */ .s1 { color: #BA2121 } /* Literal.String.Single */ .ss { color: #19177C } /* Literal.String.Symbol */ .bp { color: #008000 } /* Name.Builtin.Pseudo */ .fm { color: #0000FF } /* Name.Function.Magic */ .vc { color: #19177C } /* Name.Variable.Class */ .vg { color: #19177C } /* Name.Variable.Global */ .vi { color: #19177C } /* Name.Variable.Instance */ .vm { color: #19177C } /* Name.Variable.Magic */ .il { color: #666666 } /* Literal.Number.Integer.Long */dbus-glib-0.114/doc/reference/html/right.png0000644000175000017500000000040514764624122014351 PNG  IHDRabKGD pHYs B(xtIME eIDAT8үa?MIdEr,-hAIl ry}sX6 !9#D r$-Br$G"$;WZ&!cq \`軀O=QoufIENDB`dbus-glib-0.114/doc/reference/html/right-insensitive.png0000644000175000017500000000056514764624122016716 PNG  IHDRabKGD pHYs B(xtIME eIDAT8͒J` /S_$AqrW(>m"]\(49.Nd39{eM#MSIιEiHz|3{̲l3,KkV'@EEQlwyiq]Kh4:mĦ,;ts\aR5/7'Wps׭I,K1=0j0Wg> PU𻤝0 ]?qCҫιg~kA_IENDB`dbus-glib-0.114/doc/reference/html/left.png0000644000175000017500000000040614764624122014167 PNG  IHDRabKGD pHYs B(xtIME eIDAT8үa?DAPY\$[p+IIMlf('}Mpy{_ޥ}^q xZ <=Yj) <04\~+Pl#",Qϑp Iǐlsw>[/]_i03IENDB`dbus-glib-0.114/doc/reference/html/left-insensitive.png0000644000175000017500000000061314764624122016525 PNG  IHDRabKGD pHYs B(xtIME eIDAT8͒NQ@pds`*4@W@ A!Ԇ@6^ 5hxIH R`sQp̙339B|sKEQTK@۝΁i^~Wʆ`0TJ6TcYn6A ƀ~߱>}ǭs; lYkwr 5U= /" "uU=ɲlArDzp5I4^E+P3Ɯq_p ̥iUYp=#IENDB`dbus-glib-0.114/doc/reference/html/home.png0000644000175000017500000000040014764624122014157 PNG  IHDRabKGD pHYs B(xtIME eIDAT8ҽ Aߞf`n v`6`/`Yܡ`f&k$,} 0b+ԸaQW~b O e{y N[L}.piBzmm o.I]7^[;%:VIENDB`dbus-glib-0.114/doc/reference/html/dbus-glib.devhelp20000664000175000017500000007622414764624122016047 dbus-glib-0.114/doc/reference/dbus-glib-overrides.txt0000644000175000017500000000000013233560240016150 dbus-glib-0.114/doc/reference/dbus-glib-sections.txt0000644000175000017500000001176514764624122016033
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_register_marshaller dbus_g_object_register_marshaller_array dbus_glib_global_set_disable_legacy_property_access dbus_g_object_path_get_g_type
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.114/doc/reference/dbus-glib-docs.sgml0000644000175000017500000000454613233560240015244 ]> D-Bus GLib bindings - Reference Manual for version &version; dbus-glib is a deprecated API for use of D-Bus from GLib applications. Do not use it in new code. Since version 2.26, GLib's accompanying GIO library provides a high-level API for D-Bus, "GDBus", based on an independent reimplementation of the D-Bus protocol. The maintainers of D-Bus recommend that GLib applications should use GDBus instead of dbus-glib. Introduction D-Bus is a message bus system, a simple way for applications to talk to one another. For more information on D-Bus, see http://www.freedesktop.org/wiki/Software/dbus. dbus-glib is a deprecated API for use of D-Bus from GLib applications. Do not use it in new code. Since version 2.26, GLib's accompanying GIO library provides a high-level API for D-Bus, "GDBus", based on an independent reimplementation of the D-Bus protocol. The maintainers of D-Bus recommend that GLib applications should use GDBus instead of dbus-glib. API Reference Tools Reference &dbus-binding-tool; Index of all symbols dbus-glib-0.114/doc/reference/dbus-binding-tool.xml0000644000175000017500000000236213233560240015616 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.114/doc/reference/version.xml0000664000175000017500000000000614764623742013777 0.114 dbus-glib-0.114/doc/reference/version.xml.in0000644000175000017500000000001113233560240014355 @VERSION@dbus-glib-0.114/doc/reference/Makefile.in0000664000175000017500000007037214764623731013650 # Makefile.in generated by automake 1.17 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2024 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 -*- # # gtk-doc.make - make rules for gtk-doc # Copyright (C) 2003 James Henstridge # 2004-2007 Damon Chaplin # 2007-2017 Stefan Sauer # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . #################################### # Everything below here is generic # #################################### VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) am__rm_f = rm -f $(am__rm_f_notfound) am__rm_rf = rm -rf $(am__rm_f_notfound) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = doc/reference 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) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = version.xml CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : 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_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = 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__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/version.xml.in \ $(top_srcdir)/gtk-doc.make DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) 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@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DBUS_BINDING_TOOL = @DBUS_BINDING_TOOL@ DBUS_CFLAGS = @DBUS_CFLAGS@ DBUS_GLIB_TOOL_CFLAGS = @DBUS_GLIB_TOOL_CFLAGS@ DBUS_GLIB_TOOL_LIBS = @DBUS_GLIB_TOOL_LIBS@ DBUS_LIBS = @DBUS_LIBS@ DBUS_RUN_SESSION = @DBUS_RUN_SESSION@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FILECMD = @FILECMD@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ GLIB_THREADS_LIBS = @GLIB_THREADS_LIBS@ GREP = @GREP@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ HTML_DIR = @HTML_DIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ 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@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ 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@ 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__rm_f_notfound = @am__rm_f_notfound@ am__tar = @am__tar@ am__untar = @am__untar@ am__xargs_n = @am__xargs_n@ 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@ runstatedir = @runstatedir@ 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) $(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) \ $(expand_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 sgml-build.stamp \ html-build.stamp pdf-build.stamp \ sgml.stamp html.stamp pdf.stamp SCANOBJ_FILES = \ $(DOC_MODULE).actions \ $(DOC_MODULE).args \ $(DOC_MODULE).hierarchy \ $(DOC_MODULE).interfaces \ $(DOC_MODULE).prerequisites \ $(DOC_MODULE).signals REPORT_FILES = \ $(DOC_MODULE)-undocumented.txt \ $(DOC_MODULE)-undeclared.txt \ $(DOC_MODULE)-unused.txt CLEANFILES = $(SCANOBJ_FILES) $(REPORT_FILES) $(DOC_STAMPS) gtkdoc-check.test @GTK_DOC_BUILD_HTML_FALSE@HTML_BUILD_STAMP = @GTK_DOC_BUILD_HTML_TRUE@HTML_BUILD_STAMP = html-build.stamp @GTK_DOC_BUILD_PDF_FALSE@PDF_BUILD_STAMP = @GTK_DOC_BUILD_PDF_TRUE@PDF_BUILD_STAMP = pdf-build.stamp #### setup #### GTK_DOC_V_SETUP = $(GTK_DOC_V_SETUP_@AM_V@) GTK_DOC_V_SETUP_ = $(GTK_DOC_V_SETUP_@AM_DEFAULT_V@) GTK_DOC_V_SETUP_0 = @echo " DOC Preparing build"; #### scan #### GTK_DOC_V_SCAN = $(GTK_DOC_V_SCAN_@AM_V@) GTK_DOC_V_SCAN_ = $(GTK_DOC_V_SCAN_@AM_DEFAULT_V@) GTK_DOC_V_SCAN_0 = @echo " DOC Scanning header files"; GTK_DOC_V_INTROSPECT = $(GTK_DOC_V_INTROSPECT_@AM_V@) GTK_DOC_V_INTROSPECT_ = $(GTK_DOC_V_INTROSPECT_@AM_DEFAULT_V@) GTK_DOC_V_INTROSPECT_0 = @echo " DOC Introspecting gobjects"; #### xml #### GTK_DOC_V_XML = $(GTK_DOC_V_XML_@AM_V@) GTK_DOC_V_XML_ = $(GTK_DOC_V_XML_@AM_DEFAULT_V@) GTK_DOC_V_XML_0 = @echo " DOC Building XML"; #### html #### GTK_DOC_V_HTML = $(GTK_DOC_V_HTML_@AM_V@) GTK_DOC_V_HTML_ = $(GTK_DOC_V_HTML_@AM_DEFAULT_V@) GTK_DOC_V_HTML_0 = @echo " DOC Building HTML"; GTK_DOC_V_XREF = $(GTK_DOC_V_XREF_@AM_V@) GTK_DOC_V_XREF_ = $(GTK_DOC_V_XREF_@AM_DEFAULT_V@) GTK_DOC_V_XREF_0 = @echo " DOC Fixing cross-references"; #### pdf #### GTK_DOC_V_PDF = $(GTK_DOC_V_PDF_@AM_V@) GTK_DOC_V_PDF_ = $(GTK_DOC_V_PDF_@AM_DEFAULT_V@) GTK_DOC_V_PDF_0 = @echo " DOC Building PDF"; # 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) --foreign doc/reference/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign doc/reference/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__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_srcdir)/gtk-doc.make $(am__empty): $(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: ctags CTAGS: cscope cscopelist: distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(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 @ENABLE_GTK_DOC_FALSE@all-local: all-am: Makefile all-local installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -$(am__rm_f) $(CLEANFILES) distclean-generic: -$(am__rm_f) $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || $(am__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 cscopelist-am ctags-am 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 tags-am uninstall \ uninstall-am uninstall-local .PRECIOUS: Makefile gtkdoc-check.test: Makefile $(AM_V_GEN)echo "#!/bin/sh -e" > $@; \ echo "$(GTKDOC_CHECK_PATH) || exit 1" >> $@; \ chmod +x $@ all-gtk-doc: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP) .PHONY: all-gtk-doc @ENABLE_GTK_DOC_TRUE@all-local: all-gtk-doc docs: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP) $(REPORT_FILES): sgml-build.stamp setup-build.stamp: -$(GTK_DOC_V_SETUP)if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \ files=`echo $(SETUP_FILES) $(DOC_MODULE).types`; \ if test "x$$files" != "x" ; then \ for file in $$files ; do \ destdir=`dirname $(abs_builddir)/$$file`; \ test -d "$$destdir" || mkdir -p "$$destdir"; \ test -f $(abs_srcdir)/$$file && \ cp -pf $(abs_srcdir)/$$file $(abs_builddir)/$$file || true; \ done; \ fi; \ fi $(AM_V_at)touch setup-build.stamp scan-build.stamp: setup-build.stamp $(HFILE_GLOB) $(CFILE_GLOB) $(GTK_DOC_V_SCAN)_source_dir='' ; \ for i in $(DOC_SOURCE_DIR) ; do \ _source_dir="$${_source_dir} --source-dir=$$i" ; \ done ; \ gtkdoc-scan --module=$(DOC_MODULE) --ignore-headers="$(IGNORE_HFILES)" $${_source_dir} $(SCAN_OPTIONS) $(EXTRA_HFILES) $(GTK_DOC_V_INTROSPECT)if grep -l '^..*$$' $(DOC_MODULE).types > /dev/null 2>&1 ; then \ scanobj_options=""; \ gtkdoc-scangobj 2>&1 --help | grep >/dev/null "\--verbose"; \ if test "$$?" = "0"; then \ if test "x$(V)" = "x1"; then \ scanobj_options="--verbose"; \ fi; \ fi; \ CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" RUN="$(GTKDOC_RUN)" CFLAGS="$(GTKDOC_CFLAGS) $(CFLAGS)" LDFLAGS="$(GTKDOC_LIBS) $(LDFLAGS)" \ gtkdoc-scangobj $(SCANGOBJ_OPTIONS) $$scanobj_options --module=$(DOC_MODULE); \ else \ for i in $(SCANOBJ_FILES) ; do \ test -f $$i || touch $$i ; \ done \ fi $(AM_V_at)touch scan-build.stamp $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt: scan-build.stamp @true sgml-build.stamp: setup-build.stamp $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(HFILE_GLOB) $(CFILE_GLOB) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt $(expand_content_files) xml/gtkdocentities.ent $(GTK_DOC_V_XML)_source_dir='' ; \ for i in $(DOC_SOURCE_DIR) ; do \ _source_dir="$${_source_dir} --source-dir=$$i" ; \ done ; \ gtkdoc-mkdb --module=$(DOC_MODULE) --output-format=xml --expand-content-files="$(expand_content_files)" --main-sgml-file=$(DOC_MAIN_SGML_FILE) $${_source_dir} $(MKDB_OPTIONS) $(AM_V_at)touch sgml-build.stamp sgml.stamp: sgml-build.stamp @true $(DOC_MAIN_SGML_FILE): sgml-build.stamp @true xml/gtkdocentities.ent: Makefile $(GTK_DOC_V_XML)$(MKDIR_P) $(@D) && ( \ echo ""; \ echo ""; \ echo ""; \ echo ""; \ echo ""; \ echo ""; \ echo ""; \ ) > $@ html-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files) $(expand_content_files) $(GTK_DOC_V_HTML)rm -rf html && mkdir html && \ mkhtml_options=""; \ gtkdoc-mkhtml 2>&1 --help | grep >/dev/null "\--verbose"; \ if test "$$?" = "0"; then \ if test "x$(V)" = "x1"; then \ mkhtml_options="$$mkhtml_options --verbose"; \ fi; \ fi; \ gtkdoc-mkhtml 2>&1 --help | grep >/dev/null "\--path"; \ if test "$$?" = "0"; then \ mkhtml_options="$$mkhtml_options --path=\"$(abs_srcdir)\""; \ fi; \ cd html && gtkdoc-mkhtml $$mkhtml_options $(MKHTML_OPTIONS) $(DOC_MODULE) ../$(DOC_MAIN_SGML_FILE) -@test "x$(HTML_IMAGES)" = "x" || \ for file in $(HTML_IMAGES) ; do \ test -f $(abs_srcdir)/$$file && cp $(abs_srcdir)/$$file $(abs_builddir)/html; \ test -f $(abs_builddir)/$$file && cp $(abs_builddir)/$$file $(abs_builddir)/html; \ test -f $$file && cp $$file $(abs_builddir)/html; \ done; $(GTK_DOC_V_XREF)gtkdoc-fixxref --module=$(DOC_MODULE) --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS) $(AM_V_at)touch html-build.stamp pdf-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files) $(expand_content_files) $(GTK_DOC_V_PDF)rm -f $(DOC_MODULE).pdf && \ mkpdf_options=""; \ gtkdoc-mkpdf 2>&1 --help | grep >/dev/null "\--verbose"; \ if test "$$?" = "0"; then \ if test "x$(V)" = "x1"; then \ mkpdf_options="$$mkpdf_options --verbose"; \ fi; \ fi; \ if test "x$(HTML_IMAGES)" != "x"; then \ for img in $(HTML_IMAGES); do \ part=`dirname $$img`; \ echo $$mkpdf_options | grep >/dev/null "\--imgdir=$$part "; \ if test $$? != 0; then \ mkpdf_options="$$mkpdf_options --imgdir=$$part"; \ fi; \ done; \ fi; \ gtkdoc-mkpdf --path="$(abs_srcdir)" $$mkpdf_options $(DOC_MODULE) $(DOC_MAIN_SGML_FILE) $(MKPDF_OPTIONS) $(AM_V_at)touch pdf-build.stamp ############## clean-local: @rm -f *~ *.bak @rm -rf .libs @if echo $(SCAN_OPTIONS) | grep -q "\--rebuild-types" ; then \ rm -f $(DOC_MODULE).types; \ fi @if echo $(SCAN_OPTIONS) | grep -q "\--rebuild-sections" ; then \ rm -f $(DOC_MODULE)-sections.txt; \ fi distclean-local: @rm -rf xml html $(REPORT_FILES) $(DOC_MODULE).pdf \ $(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt @if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \ rm -f $(SETUP_FILES) $(DOC_MODULE).types; \ fi maintainer-clean-local: @rm -rf xml html install-data-local: @installfiles=`echo $(builddir)/html/*`; \ if test "$$installfiles" = '$(builddir)/html/*'; \ then echo 1>&2 'Nothing to install' ; \ else \ if test -n "$(DOC_MODULE_VERSION)"; then \ installdir="$(DESTDIR)$(TARGET_DIR)-$(DOC_MODULE_VERSION)"; \ else \ installdir="$(DESTDIR)$(TARGET_DIR)"; \ fi; \ $(mkinstalldirs) $${installdir} ; \ for i in $$installfiles; do \ echo ' $(INSTALL_DATA) '$$i ; \ $(INSTALL_DATA) $$i $${installdir}; \ done; \ if test -n "$(DOC_MODULE_VERSION)"; then \ mv -f $${installdir}/$(DOC_MODULE).devhelp2 \ $${installdir}/$(DOC_MODULE)-$(DOC_MODULE_VERSION).devhelp2; \ fi; \ $(GTKDOC_REBASE) --relative --dest-dir=$(DESTDIR) --html-dir=$${installdir}; \ fi uninstall-local: @if test -n "$(DOC_MODULE_VERSION)"; then \ installdir="$(DESTDIR)$(TARGET_DIR)-$(DOC_MODULE_VERSION)"; \ else \ installdir="$(DESTDIR)$(TARGET_DIR)"; \ fi; \ rm -rf $${installdir} # # Require gtk-doc when making dist # @HAVE_GTK_DOC_TRUE@dist-check-gtkdoc: docs @HAVE_GTK_DOC_FALSE@dist-check-gtkdoc: @HAVE_GTK_DOC_FALSE@ @echo "*** gtk-doc is needed to run 'make dist'. ***" @HAVE_GTK_DOC_FALSE@ @echo "*** gtk-doc was not found when 'configure' ran. ***" @HAVE_GTK_DOC_FALSE@ @echo "*** please install gtk-doc and rerun 'configure'. ***" @HAVE_GTK_DOC_FALSE@ @false dist-hook: dist-check-gtkdoc all-gtk-doc dist-hook-local @mkdir $(distdir)/html @cp ./html/* $(distdir)/html @-cp ./$(DOC_MODULE).pdf $(distdir)/ @-cp ./$(DOC_MODULE).types $(distdir)/ @-cp ./$(DOC_MODULE)-sections.txt $(distdir)/ @cd $(distdir) && rm -f $(DISTCLEANFILES) @$(GTKDOC_REBASE) --online --relative --html-dir=$(distdir)/html .PHONY : dist-hook-local docs #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: # Tell GNU make to disable its built-in pattern rules. %:: %,v %:: RCS/%,v %:: RCS/% %:: s.% %:: SCCS/s.% dbus-glib-0.114/doc/reference/Makefile.am0000644000175000017500000001001413233575561013615 ## 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) $(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.114/doc/dbus-binding-tool.1.in0000664000175000017500000001767714714624023013653 '\" te .TH dbus-binding-tool 1 "8 Oct 2018" "@PACKAGE_STRING@" "User Commands" .SH "NAME" dbus-binding-tool \- C language dbus-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\&, using the deprecated \fBdbus-glib\fR binding for GLib. 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@bindir@/dbus-binding-tool\fR \fR .in +32n .rt Executable for the D\-Bus Binding Tool application\&. .sp .sp 1 .in -32n .SH "SEE ALSO" .PP \fBgdbus-codegen\fR(1), \fBdbus-cleanup-sockets\fR(1), \fBdbus-daemon\fR(1), \fBdbus-monitor\fR(1), \fBdbus-send\fR(1), \fBdbus-uuidgen\fR(1) .SH "NOTES" .PP \fBdbus-binding-tool\fR is part of \fBdbus-glib\fR, which is a deprecated D-Bus binding for GLib. .PP dbus-glib receives minimal maintenance and security fixes for the benefit of projects like Telepathy and NetworkManager that still rely on it, but should not be used in new projects (and existing projects should try to move away from it, too). Please use GDBus, part of GLib since 2.26. .PP \fBgdbus-codegen\fR(1) is the GDBus replacement for \fBdbus-binding-tool\fR. .SH "AUTHORS" .PP Man page written by Brian Cameron, Sun Microsystems Inc\&., 2009\&. \" created by instant / solbook-to-man, Thu 26 Feb 2009, 19:15 dbus-glib-0.114/doc/Makefile.in0000664000175000017500000005446114764623731011713 # Makefile.in generated by automake 1.17 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2024 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__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) am__rm_f = rm -f $(am__rm_f_notfound) am__rm_rf = rm -rf $(am__rm_f_notfound) 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 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) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = dbus-binding-tool.1 CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : 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_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-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 \ tags-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 ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && echo $$files | $(am__xargs_n) 40 $(am__rm_f); }; \ } 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_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir distdir-am am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in \ $(srcdir)/dbus-binding-tool.1.in 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" 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@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DBUS_BINDING_TOOL = @DBUS_BINDING_TOOL@ DBUS_CFLAGS = @DBUS_CFLAGS@ DBUS_GLIB_TOOL_CFLAGS = @DBUS_GLIB_TOOL_CFLAGS@ DBUS_GLIB_TOOL_LIBS = @DBUS_GLIB_TOOL_LIBS@ DBUS_LIBS = @DBUS_LIBS@ DBUS_RUN_SESSION = @DBUS_RUN_SESSION@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FILECMD = @FILECMD@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ GLIB_THREADS_LIBS = @GLIB_THREADS_LIBS@ GREP = @GREP@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ HTML_DIR = @HTML_DIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ 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@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ 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@ 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__rm_f_notfound = @am__rm_f_notfound@ am__tar = @am__tar@ am__untar = @am__untar@ am__xargs_n = @am__xargs_n@ 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@ runstatedir = @runstatedir@ 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 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) --foreign doc/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign doc/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__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ 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): dbus-binding-tool.1: $(top_builddir)/config.status $(srcdir)/dbus-binding-tool.1.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ 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. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ 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" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) 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; \ $(am__define_uniq_tagged_files); \ 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-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ 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" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile $(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: -$(am__rm_f) $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || $(am__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: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool cscopelist-am ctags \ ctags-am 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-am uninstall \ uninstall-am uninstall-man uninstall-man1 .PRECIOUS: Makefile # 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: # Tell GNU make to disable its built-in pattern rules. %:: %,v %:: RCS/%,v %:: RCS/% %:: s.% %:: SCCS/s.% dbus-glib-0.114/doc/Makefile.am0000644000175000017500000000006213515561041011650 SUBDIRS=reference man_MANS = dbus-binding-tool.1 dbus-glib-0.114/dbus/0000775000175000017500000000000014764624122010077 5dbus-glib-0.114/dbus/examples/0000775000175000017500000000000014764624122011715 5dbus-glib-0.114/dbus/examples/statemachine/0000775000175000017500000000000014764624122014362 5dbus-glib-0.114/dbus/examples/statemachine/statemachine.xml0000644000175000017500000000127413233560240017461 dbus-glib-0.114/dbus/examples/statemachine/statemachine-server.xml0000644000175000017500000000053713233560240020766 dbus-glib-0.114/dbus/examples/statemachine/sm-marshal.list0000644000175000017500000000002213233560240017221 VOID:STRING,BOXED dbus-glib-0.114/dbus/examples/statemachine/statemachine-server.h0000644000175000017500000000221213515561575020424 /* SPDX-License-Identifier: AFL-2.1 OR GPL-2.0-or-later */ #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.114/dbus/examples/statemachine/statemachine.h0000644000175000017500000000374613515561575017135 /* SPDX-License-Identifier: AFL-2.1 OR GPL-2.0-or-later */ #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.114/dbus/examples/statemachine/statemachine.c0000644000175000017500000002002613515561575017116 /* SPDX-License-Identifier: AFL-2.1 OR GPL-2.0-or-later */ #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.114/dbus/examples/statemachine/sm-marshal.c0000664000175000017500000001037014764623743016523 #include #include "sm-marshal.h" /* This file is generated by glib-genmarshal, do not modify it. This code is licensed under the same license as the containing project. Note that it links to GLib, so must comply with the LGPL linking clauses. */ #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_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/dbus-glib/dbus/examples/statemachine/sm-marshal.list:1) */ 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 arg1, gpointer arg2, gpointer data2); GCClosure *cc = (GCClosure *) closure; gpointer data1, data2; GMarshalFunc_VOID__STRING_BOXED callback; 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); } dbus-glib-0.114/dbus/examples/statemachine/statemachine-server.c0000644000175000017500000001341013515561575020421 /* SPDX-License-Identifier: AFL-2.1 OR GPL-2.0-or-later */ #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.114/dbus/examples/statemachine/Makefile.in0000664000175000017500000005140314764623731016357 # Makefile.in generated by automake 1.17 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2024 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__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) am__rm_f = rm -f $(am__rm_f_notfound) am__rm_rf = rm -rf $(am__rm_f_notfound) 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 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) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) 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 am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : 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_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/sm-marshal.Po \ ./$(DEPDIR)/statemachine-server.Po ./$(DEPDIR)/statemachine.Po 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_CC_1 = 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_CCLD_1 = 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 am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` am__DIST_COMMON = $(srcdir)/Makefile.in \ $(top_srcdir)/build-aux/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) 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@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DBUS_BINDING_TOOL = @DBUS_BINDING_TOOL@ DBUS_CFLAGS = @DBUS_CFLAGS@ DBUS_GLIB_TOOL_CFLAGS = @DBUS_GLIB_TOOL_CFLAGS@ DBUS_GLIB_TOOL_LIBS = @DBUS_GLIB_TOOL_LIBS@ DBUS_LIBS = @DBUS_LIBS@ DBUS_RUN_SESSION = @DBUS_RUN_SESSION@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FILECMD = @FILECMD@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ GLIB_THREADS_LIBS = @GLIB_THREADS_LIBS@ GREP = @GREP@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ HTML_DIR = @HTML_DIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ 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@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ 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@ 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__rm_f_notfound = @am__rm_f_notfound@ am__tar = @am__tar@ am__untar = @am__untar@ am__xargs_n = @am__xargs_n@ 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@ runstatedir = @runstatedir@ 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_builddir)/dbus \ $(DBUS_CFLAGS) \ $(GLIB_CFLAGS) \ $(DBUS_GTK_THREADS_CFLAGS) \ -DDBUS_COMPILATION LDADD = $(top_builddir)/dbus/libdbus-glib-1.la \ $(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) --foreign dbus/examples/statemachine/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign dbus/examples/statemachine/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__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ 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: $(am__rm_f) $(noinst_PROGRAMS) test -z "$(EXEEXT)" || $(am__rm_f) $(noinst_PROGRAMS:$(EXEEXT)=) 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@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/statemachine-server.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/statemachine.Po@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @: >>$@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.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 -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.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 -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.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: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ 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-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ 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" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(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: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) 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: -$(am__rm_f) $(CLEANFILES) distclean-generic: -$(am__rm_f) $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || $(am__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." -$(am__rm_f) $(BUILT_SOURCES) clean: clean-am clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/sm-marshal.Po -rm -f ./$(DEPDIR)/statemachine-server.Po -rm -f ./$(DEPDIR)/statemachine.Po -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 -f ./$(DEPDIR)/sm-marshal.Po -rm -f ./$(DEPDIR)/statemachine-server.Po -rm -f ./$(DEPDIR)/statemachine.Po -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-exec install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-libtool clean-noinstPROGRAMS cscopelist-am \ ctags ctags-am 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 tags-am uninstall uninstall-am .PRECIOUS: Makefile 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 echo "#include \"sm-marshal.h\"" >> $@.tmp $(GLIB_GENMARSHAL) --prefix=sm_marshal $(srcdir)/sm-marshal.list --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: # Tell GNU make to disable its built-in pattern rules. %:: %,v %:: RCS/%,v %:: RCS/% %:: s.% %:: SCCS/s.% dbus-glib-0.114/dbus/examples/statemachine/Makefile.am0000644000175000017500000000275614764567217016361 AM_CPPFLAGS = \ -I$(top_srcdir) \ -I$(top_builddir) \ -I$(top_builddir)/dbus \ $(DBUS_CFLAGS) \ $(GLIB_CFLAGS) \ $(DBUS_GTK_THREADS_CFLAGS) \ -DDBUS_COMPILATION LDADD = $(top_builddir)/dbus/libdbus-glib-1.la \ $(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 echo "#include \"sm-marshal.h\"" >> $@.tmp $(GLIB_GENMARSHAL) --prefix=sm_marshal $(srcdir)/sm-marshal.list --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.114/dbus/examples/example-signal-emitter.xml0000644000175000017500000000040113233560240016713 dbus-glib-0.114/dbus/examples/example-service.xml0000644000175000017500000000063013233560240015433 dbus-glib-0.114/dbus/examples/example-signal-recipient.c0000644000175000017500000000535713515561575016704 /* SPDX-License-Identifier: AFL-2.1 OR GPL-2.0-or-later */ #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.114/dbus/examples/example-signal-emitter.c0000644000175000017500000000636713515561575016375 /* SPDX-License-Identifier: AFL-2.1 OR GPL-2.0-or-later */ #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.114/dbus/examples/example-service.c0000664000175000017500000001025214764565250015100 /* SPDX-License-Identifier: AFL-2.1 OR GPL-2.0-or-later */ #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) { G_GNUC_BEGIN_IGNORE_DEPRECATIONS *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); G_GNUC_END_IGNORE_DEPRECATIONS 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.114/dbus/examples/example-client.c0000664000175000017500000000742414764565250014725 /* SPDX-License-Identifier: AFL-2.1 OR GPL-2.0-or-later */ #include #include #include #include static GType deprecated_value_array_type (void) { G_GNUC_BEGIN_IGNORE_DEPRECATIONS return g_value_array_get_type (); G_GNUC_END_IGNORE_DEPRECATIONS } 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, deprecated_value_array_type (), &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); G_GNUC_BEGIN_IGNORE_DEPRECATIONS 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_GNUC_END_IGNORE_DEPRECATIONS } G_GNUC_BEGIN_IGNORE_DEPRECATIONS g_value_array_free (hello_reply_struct); G_GNUC_END_IGNORE_DEPRECATIONS 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.114/dbus/examples/Makefile.in0000664000175000017500000006523114764623731013716 # Makefile.in generated by automake 1.17 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2024 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__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) am__rm_f = rm -f $(am__rm_f_notfound) am__rm_rf = rm -rf $(am__rm_f_notfound) 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 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) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) 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__v_lt_1 = 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 AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : 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_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/example-client.Po \ ./$(DEPDIR)/example-service.Po \ ./$(DEPDIR)/example-signal-emitter.Po \ ./$(DEPDIR)/example-signal-recipient.Po 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_CC_1 = 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_CCLD_1 = 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 cscopelist-recursive \ ctags-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 \ tags-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_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir distdir-am am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in \ $(top_srcdir)/build-aux/depcomp 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" 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@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DBUS_BINDING_TOOL = @DBUS_BINDING_TOOL@ DBUS_CFLAGS = @DBUS_CFLAGS@ DBUS_GLIB_TOOL_CFLAGS = @DBUS_GLIB_TOOL_CFLAGS@ DBUS_GLIB_TOOL_LIBS = @DBUS_GLIB_TOOL_LIBS@ DBUS_LIBS = @DBUS_LIBS@ DBUS_RUN_SESSION = @DBUS_RUN_SESSION@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FILECMD = @FILECMD@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ GLIB_THREADS_LIBS = @GLIB_THREADS_LIBS@ GREP = @GREP@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ HTML_DIR = @HTML_DIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ 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@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ 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@ 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__rm_f_notfound = @am__rm_f_notfound@ am__tar = @am__tar@ am__untar = @am__untar@ am__xargs_n = @am__xargs_n@ 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@ runstatedir = @runstatedir@ 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 AM_CPPFLAGS = \ -I$(top_srcdir) \ -I$(top_builddir) \ -I$(top_builddir)/dbus \ $(DBUS_CFLAGS) \ $(GLIB_CFLAGS) \ -DDBUS_COMPILATION LDADD = \ $(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) --foreign dbus/examples/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign dbus/examples/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__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ 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: $(am__rm_f) $(noinst_PROGRAMS) test -z "$(EXEEXT)" || $(am__rm_f) $(noinst_PROGRAMS:$(EXEEXT)=) 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@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/example-service.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/example-signal-emitter.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/example-signal-recipient.Po@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @: >>$@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.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 -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.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 -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.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. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ 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" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) 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; \ $(am__define_uniq_tagged_files); \ 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-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ 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" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(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: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) 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: -$(am__rm_f) $(CLEANFILES) distclean-generic: -$(am__rm_f) $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || $(am__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." -$(am__rm_f) $(BUILT_SOURCES) clean: clean-recursive clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ mostlyclean-am distclean: distclean-recursive -rm -f ./$(DEPDIR)/example-client.Po -rm -f ./$(DEPDIR)/example-service.Po -rm -f ./$(DEPDIR)/example-signal-emitter.Po -rm -f ./$(DEPDIR)/example-signal-recipient.Po -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 -f ./$(DEPDIR)/example-client.Po -rm -f ./$(DEPDIR)/example-service.Po -rm -f ./$(DEPDIR)/example-signal-emitter.Po -rm -f ./$(DEPDIR)/example-signal-recipient.Po -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: $(am__recursive_targets) all check install install-am \ install-exec install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ am--depfiles check check-am clean clean-generic clean-libtool \ clean-noinstPROGRAMS cscopelist-am ctags ctags-am 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-am uninstall \ uninstall-am .PRECIOUS: Makefile 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: # Tell GNU make to disable its built-in pattern rules. %:: %,v %:: RCS/%,v %:: RCS/% %:: s.% %:: SCCS/s.% dbus-glib-0.114/dbus/examples/Makefile.am0000644000175000017500000000236713233575561013701 SUBDIRS = . statemachine AM_CPPFLAGS = \ -I$(top_srcdir) \ -I$(top_builddir) \ -I$(top_builddir)/dbus \ $(DBUS_CFLAGS) \ $(GLIB_CFLAGS) \ -DDBUS_COMPILATION LDADD = \ $(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.114/dbus/dbus-bash-completion.sh.in0000644000175000017500000000105113233560240014760 # 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.114/dbus/dbus-gmarshal.list0000644000175000017500000000003214764570403013440 VOID:STRING,STRING,STRING dbus-glib-0.114/dbus/dbus-gtest-main.c0000644000175000017500000000255413515561575013177 /* -*- mode: C; c-file-style: "gnu" -*- */ /* dbus-gtest-main.c Program to run all libdbus-glib tests * * Copyright (C) 2003 Red Hat Inc. * * SPDX-License-Identifier: AFL-2.1 OR GPL-2.0-or-later * * 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.114/dbus/dbus-glib-tool.c0000644000175000017500000002712113515561575013014 /* -*- mode: C; c-file-style: "gnu" -*- */ /* dbus-glib-tool.c Tool used by apps using glib bindings * * Copyright (C) 2003, 2004 Red Hat, Inc. * * SPDX-License-Identifier: AFL-2.1 OR GPL-2.0-or-later * * 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.114/dbus/dbus-glib-tool.h0000644000175000017500000000247313621620575013016 /* -*- mode: C; c-file-style: "gnu" -*- */ /* dbus-glib-tool.h: Definitions used internally by binding tool * * Copyright (C) 2005 Red Hat, Inc. * * SPDX-License-Identifier: AFL-2.1 OR GPL-2.0-or-later * * 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.114/dbus/dbus-binding-tool-glib.c0000664000175000017500000014051714764570670014436 /* -*- 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 * * SPDX-License-Identifier: AFL-2.1 OR GPL-2.0-or-later * * 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); data.channel = NULL; goto io_lose; } g_io_channel_shutdown (data.channel, TRUE, error); g_io_channel_unref (data.channel); data.channel = NULL; /* 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); G_GNUC_BEGIN_IGNORE_DEPRECATIONS if (gtype == g_value_array_get_type ()) return g_strdup ("G_TYPE_VALUE_ARRAY"); G_GNUC_END_IGNORE_DEPRECATIONS 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 inline DBusGProxyCall*\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 inline gboolean\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 inline void\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.114/dbus/dbus-binding-tool-glib.h0000644000175000017500000000342613515561575014433 /* -*- mode: C; c-file-style: "gnu" -*- */ /* dbus-binding-tool-output-glib.h prototypes for glib output * * Copyright (C) 2005 Red Hat, Inc. * * SPDX-License-Identifier: AFL-2.1 OR GPL-2.0-or-later * * 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.114/dbus/dbus-bash-completion-helper.c0000644000175000017500000003561213515561575015471 /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ /* dbus-bash-completion-helper.c Bash Completion helper routines * * Copyright (C) 2008 David Zeuthen * * SPDX-License-Identifier: GPL-2.0-or-later * * 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.114/dbus/dbus-gparser.h0000644000175000017500000000504513515561575012575 /* -*- mode: C; c-file-style: "gnu" -*- */ /* dbus-gparser.h parse DBus description files * * Copyright (C) 2003 Red Hat, Inc. * * SPDX-License-Identifier: AFL-2.1 OR GPL-2.0-or-later * * 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.114/dbus/dbus-gparser.c0000644000175000017500000005743513515561575012602 /* -*- mode: C; c-file-style: "gnu" -*- */ /* dbus-gparser.c parse DBus description files * * Copyright (C) 2003, 2005 Red Hat, Inc. * * SPDX-License-Identifier: AFL-2.1 OR GPL-2.0-or-later * * 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 #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; } if (!g_dbus_is_interface_name (name)) { g_set_error (error, G_MARKUP_ERROR, G_MARKUP_ERROR_PARSE, "\"%s\" is not a valid D-Bus interface name", 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; } if (!g_dbus_is_member_name (name)) { g_set_error (error, G_MARKUP_ERROR, G_MARKUP_ERROR_PARSE, "\"%s\" is not a valid D-Bus member name", 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; } if (!g_dbus_is_member_name (name)) { g_set_error (error, G_MARKUP_ERROR, G_MARKUP_ERROR_PARSE, "\"%s\" is not a valid D-Bus member name", 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; } if (!g_utf8_validate (name, -1, NULL)) { g_set_error (error, G_MARKUP_ERROR, G_MARKUP_ERROR_PARSE, "\"%s\" is not UTF-8", 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.114/dbus/dbus-gloader-expat.c0000644000175000017500000001520613515561575013661 /* -*- mode: C; c-file-style: "gnu" -*- */ /* dbus-gloader-expat.c expat XML loader * * Copyright (C) 2003 Red Hat, Inc. * * SPDX-License-Identifier: AFL-2.1 OR GPL-2.0-or-later * * 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.114/dbus/dbus-gidl.h0000644000175000017500000001740613515561575012055 /* -*- 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. * * SPDX-License-Identifier: AFL-2.1 OR GPL-2.0-or-later * * 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.114/dbus/dbus-gidl.c0000644000175000017500000003526714764567020012053 /* -*- 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. * * SPDX-License-Identifier: AFL-2.1 OR GPL-2.0-or-later * * 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 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; g_return_val_if_fail (g_dbus_is_interface_name (name), NULL); 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) { G_GNUC_UNUSED /* if assertions are disabled */ 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; g_return_val_if_fail (g_dbus_is_member_name (name), NULL); 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; g_return_val_if_fail (g_dbus_is_member_name (name), NULL); 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; g_return_val_if_fail (g_utf8_validate (name, -1, NULL), NULL); g_return_val_if_fail (g_variant_is_signature (type), NULL); 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.114/dbus/dbus-gvalue-utils.h0000644000175000017500000000547413621620670013547 /* -*- mode: C; c-file-style: "gnu" -*- */ /* dbus-gvalue-utils.h: Non-DBus-specific functions related to GType/GValue * * Copyright (C) 2005 Red Hat, Inc. * * SPDX-License-Identifier: AFL-2.1 OR GPL-2.0-or-later * * 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.114/dbus/dbus-gvalue-utils.c0000664000175000017500000010541314764567004013550 /* -*- mode: C; c-file-style: "gnu" -*- */ /* dbus-gvalue-utils.c: Non-DBus-specific functions related to GType/GValue * * Copyright (C) 2005 Red Hat, Inc. * * SPDX-License-Identifier: AFL-2.1 OR GPL-2.0-or-later * * 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_schar (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_schar (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 GType deprecated_value_array_type (void) { G_GNUC_BEGIN_IGNORE_DEPRECATIONS return g_value_array_get_type (); G_GNUC_END_IGNORE_DEPRECATIONS } 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 == deprecated_value_array_type ()) { G_GNUC_BEGIN_IGNORE_DEPRECATIONS *func = (GDestroyNotify) g_value_array_free; G_GNUC_END_IGNORE_DEPRECATIONS 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 = NULL; G_GNUC_UNUSED /* if assertions are disabled */ 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_schar (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_schar (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; G_GNUC_BEGIN_IGNORE_DEPRECATIONS ret = g_value_array_new (size); G_GNUC_END_IGNORE_DEPRECATIONS for (i=0; i < size; i++) { GValue val = {0,}; g_value_init (&val, dbus_g_type_get_struct_member_type (type, i)); G_GNUC_BEGIN_IGNORE_DEPRECATIONS g_value_array_append(ret, &val); G_GNUC_END_IGNORE_DEPRECATIONS } return (gpointer)ret; } static gpointer valuearray_copy (GType type, gpointer src) { G_GNUC_BEGIN_IGNORE_DEPRECATIONS return g_value_array_copy ((GValueArray*) src); G_GNUC_END_IGNORE_DEPRECATIONS } static void valuearray_simple_free (gpointer val) { G_GNUC_BEGIN_IGNORE_DEPRECATIONS g_value_array_free (val); G_GNUC_END_IGNORE_DEPRECATIONS } 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)) { G_GNUC_BEGIN_IGNORE_DEPRECATIONS val = g_value_array_get_nth (va, member); G_GNUC_END_IGNORE_DEPRECATIONS 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)) { G_GNUC_BEGIN_IGNORE_DEPRECATIONS vp = g_value_array_get_nth (va, member); G_GNUC_END_IGNORE_DEPRECATIONS 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_schar (&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_schar (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); } dbus-glib-0.114/dbus/dbus-gsignature.h0000644000175000017500000000300213515561575013271 /* -*- mode: C; c-file-style: "gnu" -*- */ /* * Copyright (C) 2005-2006 Red Hat, Inc. * * SPDX-License-Identifier: AFL-2.1 OR GPL-2.0-or-later * * 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_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.114/dbus/dbus-gsignature.c0000644000175000017500000001430613515561575013275 /* -*- mode: C; c-file-style: "gnu" -*- */ /* dbus-gsignature.c Mapping from dbus type signatures to GType * * Copyright (C) 2005 Red Hat, Inc. * * SPDX-License-Identifier: AFL-2.1 OR GPL-2.0-or-later * * 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); 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 if (current_type == DBUS_TYPE_VARIANT || current_type == DBUS_TYPE_ARRAY || current_type == DBUS_TYPE_STRUCT) { 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; } } else { /* dbus-glib does not handle DBUS_TYPE_UNIX_FD or DBUS_TYPE_MAYBE */ 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.114/dbus/dbus-gutils.h0000644000175000017500000000415613515561575012443 /* -*- mode: C; c-file-style: "gnu" -*- */ /* dbus-gutils.h Utils shared between convenience lib and installed lib * * Copyright (C) 2003 Red Hat, Inc. * * SPDX-License-Identifier: AFL-2.1 OR GPL-2.0-or-later * * 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.114/dbus/dbus-gutils.c0000644000175000017500000000473313515561575012437 /* -*- mode: C; c-file-style: "gnu" -*- */ /* dbus-gutils.c Utils shared between convenience lib and installed lib * * Copyright (C) 2003 Red Hat, Inc. * * SPDX-License-Identifier: AFL-2.1 OR GPL-2.0-or-later * * 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.114/dbus/dbus-gtype-specialized-priv.h0000644000175000017500000000361613515561575015534 /* -*- mode: C; c-file-style: "gnu" -*- */ /* dbus-gtype-specialized-priv.h: internals of specialized GTypes * * Copyright (C) 2009 Collabora Ltd. * * SPDX-License-Identifier: AFL-2.1 OR GPL-2.0-or-later * * 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.114/dbus/dbus-gtype-specialized.c0000644000175000017500000015366113515561575014557 /* -*- 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. * * SPDX-License-Identifier: AFL-2.1 OR GPL-2.0-or-later * * 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 * @title: Specializable GType System * @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. * * Deprecated: New code should use GDBus instead. The closest equivalent * is #GVariant, which is much better-designed. */ /** * 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"). * * Deprecated: New code should use GDBus instead. The closest equivalent * is `G_VARIANT_TYPE ("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"). * * Deprecated: New code should use GDBus instead. The closest equivalent * is `G_VARIANT_TYPE ("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"). * * Deprecated: New code should use GDBus instead. The closest equivalent * is `G_VARIANT_TYPE ("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"). * * Deprecated: New code should use GDBus instead. The closest equivalent * is `G_VARIANT_TYPE ("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"). * * Deprecated: New code should use GDBus instead. The closest equivalent * is `G_VARIANT_TYPE ("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. * * Deprecated: New code should use GDBus instead. The closest equivalent * is %G_VARIANT_TYPE_BYTESTRING. */ /** * 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)). * * Deprecated: New code should use GDBus instead. The closest equivalent * is %G_VARIANT_TYPE_OBJECT_PATH_ARRAY. */ /** * 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}"). * * Deprecated: New code should use GDBus instead. The closest equivalent * is `G_VARIANT_TYPE ("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. * * Deprecated: New code should use GDBus instead. */ /** * DBusGTypeSpecializedConstructor: * @type: a specialized boxed type * * * * Returns: a new instance of @type * * Deprecated: New code should use GDBus instead. */ /** * 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). * * Deprecated: New code should use GDBus instead. */ /** * 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 * * Deprecated: New code should use GDBus instead. */ /** * 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 * * Deprecated: New code should use GDBus instead. */ /** * 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. * * Deprecated: New code should use GDBus instead. */ /** * 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. * * Deprecated: New code should use GDBus instead. */ /** * 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. * * Deprecated: New code should use GDBus instead. */ /** * 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. * * Deprecated: New code should use GDBus instead. */ /** * 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. * * Deprecated: New code should use GDBus instead. */ /** * 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. * * Deprecated: New code should use GDBus instead. */ /** * 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. * * Deprecated: New code should use GDBus instead. */ /** * 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. * * Deprecated: New code should use GDBus instead. */ /** * 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. * * Deprecated: New code should use GDBus instead. */ /** * 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 * * Deprecated: New code should use GDBus instead. */ /** * 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 * * Deprecated: New code should use GDBus instead. */ /** * 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. * * Deprecated: New code should use GDBus instead. */ 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. * * Deprecated: New code should use GDBus instead. */ 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. * * Deprecated: New code should use GDBus instead. */ 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. * * Deprecated: New code should use GDBus instead. */ 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. * * Deprecated: New code should use GDBus instead. */ 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 * * Deprecated: New code should use GDBus instead. */ 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 * * Deprecated: New code should use GDBus instead. */ 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 * * Deprecated: New code should use GDBus instead. */ 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 * * Deprecated: New code should use GDBus instead. */ 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 * * Deprecated: New code should use GDBus instead. */ 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 * * Deprecated: New code should use GDBus instead. */ 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 method to get a #GType for a particular struct instance, * creating the type if not already created. * * Returns: the #GType of that instance * * Deprecated: New code should use GDBus instead. */ 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 * * Deprecated: New code should use GDBus instead. */ 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 * * Deprecated: New code should use GDBus instead. */ 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 * * Deprecated: New code should use GDBus instead. */ 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. * * Deprecated: New code should use GDBus instead. */ 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. * * Deprecated: New code should use GDBus instead. */ 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. * * Deprecated: New code should use GDBus instead. */ 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() * * Deprecated: New code should use GDBus instead. */ 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. * * Deprecated: New code should use GDBus instead. */ 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. * * Deprecated: New code should use GDBus instead. */ 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 * * Deprecated: New code should use GDBus instead. */ 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. * * Deprecated: New code should use GDBus instead. */ 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. * * Deprecated: New code should use GDBus instead. */ 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.. * * Deprecated: New code should use GDBus instead. */ 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. * * Deprecated: New code should use GDBus instead. */ 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 * * Deprecated: New code should use GDBus instead. */ 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. * * Deprecated: New code should use GDBus instead. */ 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. * * Deprecated: New code should use GDBus instead. */ 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 * * Deprecated: New code should use GDBus instead. */ 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 * * Deprecated: New code should use GDBus instead. */ 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 %G_MAXUINT * * Collects the selected values of this struct into the return locations * provided. * * Returns: %FALSE on failure * * Deprecated: New code should use GDBus instead. */ 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 * * Deprecated: New code should use GDBus instead. */ 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 * * Deprecated: New code should use GDBus instead. */ 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) { const gchar *str = g_value_get_string (value); return g_variant_new_string ((str != NULL) ? str : ""); } else if (type == G_TYPE_STRV) { const gchar * const *strv = g_value_get_boxed (value); return g_variant_new_strv (strv, (strv != NULL) ? -1 : 0); } 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.114/dbus/dbus-gthread.c0000644000175000017500000000331713515561575012543 /* -*- mode: C; c-file-style: "gnu" -*- */ /* dbus-gthread.c GThread integration * * Copyright (C) 2002 CodeFactory AB * * SPDX-License-Identifier: AFL-2.1 OR GPL-2.0-or-later * * 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. * * Equivalent to dbus_threads_init_default(), which does nothing. * dbus-glib requires dbus >= 1.8, which is thread-safe by default. * * Note that dbus-glib's GObject mapping is explicitly *not* thread-safe. * * Deprecated: New code should use GDBus instead. GDBus is always * thread-safe, whereas dbus-glib is never thread-safe. */ void dbus_g_thread_init (void) { /* keep this pointless method call just in case */ dbus_threads_init_default (); } dbus-glib-0.114/dbus/dbus-gvalue-parse-variant.c0000664000175000017500000003704114764565250015166 /* GVariant to dbus-glib escape hatch * * Copyright © 2010 Collabora Ltd. * * SPDX-License-Identifier: AFL-2.1 OR GPL-2.0-or-later OR LGPL-2.1-or-later * * 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; G_GNUC_BEGIN_IGNORE_DEPRECATIONS GValueArray *va = g_value_array_new (n); G_GNUC_END_IGNORE_DEPRECATIONS 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_GNUC_BEGIN_IGNORE_DEPRECATIONS g_value_array_append (va, NULL); G_GNUC_END_IGNORE_DEPRECATIONS 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_GNUC_BEGIN_IGNORE_DEPRECATIONS g_value_array_free (va); G_GNUC_END_IGNORE_DEPRECATIONS } 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. * * Deprecated: New code should use GDBus instead. */ 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.114/dbus/dbus-gvalue.h0000644000175000017500000000272313515561575012415 /* SPDX-License-Identifier: AFL-2.1 OR GPL-2.0-or-later */ #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.114/dbus/dbus-gvalue.c0000664000175000017500000016146514764565250012424 /* -*- mode: C; c-file-style: "gnu" -*- */ /* dbus-gvalue.c GValue to-from DBusMessageIter * * Copyright (C) 2004 Ximian, Inc. * Copyright (C) 2005 Red Hat, Inc. * * SPDX-License-Identifier: AFL-2.1 OR GPL-2.0-or-later * * 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 GType deprecated_value_array_type (void) { G_GNUC_BEGIN_IGNORE_DEPRECATIONS return g_value_array_get_type (); G_GNUC_END_IGNORE_DEPRECATIONS } 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 * * Deprecated: New code should use GDBus instead. The closest equivalent * is a #GVariant (%G_TYPE_VARIANT) of type %G_VARIANT_TYPE_OBJECT_PATH. */ /** * 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 * * Deprecated: New code should use GDBus instead. The closest equivalent * is a #GVariant (%G_TYPE_VARIANT) of type %G_VARIANT_TYPE_OBJECT_PATH. */ 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 * * Deprecated: New code should use GDBus instead. The closest equivalent * is a #GVariant (%G_TYPE_VARIANT) of type %G_VARIANT_TYPE_SIGNATURE. */ /** * 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 * * Deprecated: New code should use GDBus instead. The closest equivalent * is a #GVariant (%G_TYPE_VARIANT) of type %G_VARIANT_TYPE_SIGNATURE. */ 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, deprecated_value_array_type ())) { 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; G_GNUC_BEGIN_IGNORE_DEPRECATIONS sig = _dbus_gvalue_to_signature (g_value_array_get_nth (array, i)); G_GNUC_END_IGNORE_DEPRECATIONS 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 b; if (!G_VALUE_HOLDS (value, G_TYPE_BOOLEAN)) goto invalid_type; dbus_message_iter_get_basic (iter, &b); g_value_set_boolean (value, b); 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) { /* It can happen if we received an unknown type such as * DBUS_TYPE_UNIX_FD or DBUS_TYPE_MAYBE. */ g_set_error (error, DBUS_GERROR, DBUS_GERROR_INVALID_SIGNATURE, "Variant contains unknown signature \'%s\'", sig); dbus_free (sig); return FALSE; } dbus_free (sig); g_value_init (value, variant_type); if (!_dbus_gvalue_demarshal (context, &subiter, value, error)) return FALSE; 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); G_GNUC_BEGIN_IGNORE_DEPRECATIONS ret = g_value_array_new (12); G_GNUC_END_IGNORE_DEPRECATIONS while ((current_type = dbus_message_iter_get_arg_type (&subiter)) != DBUS_TYPE_INVALID) { GValue *val; GType elt_type; char *current_sig; G_GNUC_BEGIN_IGNORE_DEPRECATIONS g_value_array_append (ret, NULL); val = g_value_array_get_nth (ret, ret->n_values - 1); G_GNUC_END_IGNORE_DEPRECATIONS current_sig = dbus_message_iter_get_signature (&subiter); elt_type = _dbus_gtype_from_signature (current_sig, TRUE); if (elt_type == G_TYPE_INVALID) { G_GNUC_BEGIN_IGNORE_DEPRECATIONS g_value_array_free (ret); G_GNUC_END_IGNORE_DEPRECATIONS 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_GNUC_BEGIN_IGNORE_DEPRECATIONS g_value_array_free (ret); G_GNUC_END_IGNORE_DEPRECATIONS 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, deprecated_value_array_type ())) 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_; G_GNUC_BEGIN_IGNORE_DEPRECATIONS ret = g_value_array_new (6); /* 6 is a typical maximum for arguments */ G_GNUC_END_IGNORE_DEPRECATIONS 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_GNUC_BEGIN_IGNORE_DEPRECATIONS g_value_array_append (ret, NULL); value = g_value_array_get_nth (ret, index_); G_GNUC_END_IGNORE_DEPRECATIONS 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_GNUC_BEGIN_IGNORE_DEPRECATIONS g_value_array_free (ret); G_GNUC_END_IGNORE_DEPRECATIONS 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_schar (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) == deprecated_value_array_type ()); 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++) { G_GNUC_BEGIN_IGNORE_DEPRECATIONS if (!_dbus_gvalue_marshal (&subiter, g_value_array_get_nth (array, i))) { dbus_message_iter_abandon_container (iter, &subiter); return FALSE; } G_GNUC_END_IGNORE_DEPRECATIONS } } 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, deprecated_value_array_type ())) 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_nonnull (sig); g_assert_cmpstr (expected_sig, ==, sig); g_free (sig); } static void assert_signature_maps_to (const char *sig, GType expected_gtype) { g_assert_cmpuint (_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) { GType type; GType rectype; g_type_init (); _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 ); rectype = dbus_g_type_get_collection ("GArray", G_TYPE_UINT); g_assert_cmpuint (rectype, !=, G_TYPE_INVALID); g_assert_cmpstr (g_type_name (rectype), ==, "GArray_guint_"); type = _dbus_gtype_from_signature ("au", TRUE); g_assert_cmpuint (type, ==, rectype); rectype = dbus_g_type_get_map ("GHashTable", G_TYPE_STRING, G_TYPE_STRING); g_assert_cmpuint (rectype, !=, G_TYPE_INVALID); g_assert_cmpstr (g_type_name (rectype), ==, "GHashTable_gchararray+gchararray_"); type = _dbus_gtype_from_signature ("a{ss}", TRUE); g_assert_cmpuint (type, ==, rectype); type = _dbus_gtype_from_signature ("o", FALSE); g_assert_cmpuint (type, ==, DBUS_TYPE_G_OBJECT_PATH); type = _dbus_gtype_from_signature ("o", TRUE); g_assert_cmpuint (type, ==, DBUS_TYPE_G_OBJECT_PATH); type = _dbus_gtype_from_signature ("g", TRUE); g_assert_cmpuint (type, ==, DBUS_TYPE_G_SIGNATURE); return TRUE; } #endif /* DBUS_BUILD_TESTS */ dbus-glib-0.114/dbus/dbus-gtest.h0000644000175000017500000000240013515561575012250 /* -*- mode: C; c-file-style: "gnu" -*- */ /* dbus-gtest.h Declarations of test functions. * * Copyright (C) 2003 Red Hat Inc. * * SPDX-License-Identifier: AFL-2.1 OR GPL-2.0-or-later * * 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_gobject_test (const char *test_data_dir); gboolean _dbus_gvalue_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.114/dbus/dbus-gtest.c0000644000175000017500000000431313515561575012250 /* -*- mode: C; c-file-style: "gnu" -*- */ /* dbus-test.c Program to run all tests * * Copyright (C) 2002, 2003 Red Hat Inc. * * SPDX-License-Identifier: AFL-2.1 OR GPL-2.0-or-later * * 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 tests\n", "dbus-glib-test"); if (!_dbus_gvalue_test (test_data_dir)) die ("gvalue utils"); 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.114/dbus/dbus-gproxy.c0000664000175000017500000027015714764567037012475 /* -*- 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 * * SPDX-License-Identifier: AFL-2.1 OR GPL-2.0-or-later * * 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 { GMutex 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_mutex_lock (&(mgr)->lock)) /** Unlock the DBusGProxyManager */ #define UNLOCK_MANAGER(mgr) (g_mutex_unlock (&(mgr)->lock)) static int g_proxy_manager_slot = -1; /* Lock controlling get/set manager as data on each connection */ static GMutex connection_g_proxy_lock; 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_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_mutex_unlock (&connection_g_proxy_lock); return manager; } manager = g_new0 (DBusGProxyManager, 1); manager->refcount = 1; manager->connection = connection; g_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_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_mutex_clear (&manager->lock); g_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_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; G_GNUC_UNUSED /* if assertions are disabled */ 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; /** * DBusGProxy::destroy: * @dbusgproxy: the object which received the signal. * * Deprecated: New code should use #GDBusProxy instead. */ 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); /* * DBusGProxy::received: * @dbusgproxy: the object which received the signal. * * Deprecated: New code should use #GDBusProxy instead. */ 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; 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); { 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_GNUC_BEGIN_IGNORE_DEPRECATIONS 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); G_GNUC_END_IGNORE_DEPRECATIONS g_cclosure_marshal_generic (closure, return_value, value_array->n_values, value_array->values, invocation_hint, marshal_data); G_GNUC_BEGIN_IGNORE_DEPRECATIONS g_value_array_free (value_array); G_GNUC_END_IGNORE_DEPRECATIONS } 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. * * Deprecated: New code should use GDBus instead. The closest equivalent * is the standard #GAsyncReadyCallback mechanism. */ 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 { \ G_GNUC_BEGIN_IGNORE_DEPRECATIONS \ 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_GNUC_END_IGNORE_DEPRECATIONS \ } 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_GNUC_BEGIN_IGNORE_DEPRECATIONS g_value_array_free (arg_values); G_GNUC_END_IGNORE_DEPRECATIONS } va_end (args); return DBUS_G_PROXY_ID_TO_CALL (call_id); } /** * SECTION:dbus-gproxy * @title: DBusGProxy * @short_description: DBus Proxy * @see_also: #DBusGProxy * @stability: Stable * * A #DBusGProxy is a #GObject representing a remote object in a D-Bus * service. * * Deprecated: New code should use #GDBusProxy instead. */ /** * DBusGProxy: * * A #GObject representing a remote object in a D-Bus service. * * Deprecated: New code should use GDBus instead. The closest equivalent * is #GDBusProxy. */ /** * DBusGProxyCall: * * An opaque pointer representing an asynchronous call in progress. * * Deprecated: New code should use GDBus instead. There is no direct * equivalent in GDBus, but the standard #GCancellable mechanism is * analogous. */ /* * dbus_g_proxy_get_type: * Standard GObject get_type() function for DBusGProxy. * * Returns: type ID for DBusGProxy class * * Deprecated: New code should use #GDBusProxy instead. */ 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 * * Deprecated: New code should use GDBus instead. The closest equivalent * is g_dbus_proxy_new_sync(). */ 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 * * Deprecated: New code should use GDBus instead. The closest equivalent * is g_dbus_proxy_new_sync() with the name owner's unique name * passed as @name. */ 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 * * Deprecated: New code should use GDBus instead. The closest equivalent * is g_dbus_proxy_new_sync(). */ 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 * * Deprecated: New code should use GDBus instead. The closest equivalent * is g_dbus_proxy_new_sync(). */ 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 * * Deprecated: New code should use GDBus instead. The closest equivalent * is g_dbus_proxy_get_name() or g_dbus_proxy_get_name_owner(), * depending how the proxy was created. */ 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 * * Deprecated: New code should use GDBus instead. The closest equivalent * is g_dbus_proxy_get_interface_name(). */ 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. * * Deprecated: New code should use GDBus instead. There is no * direct equivalent for this function: construct a new proxy instead. */ 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 * * Deprecated: New code should use GDBus instead. The closest equivalent * is g_dbus_proxy_get_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; G_GNUC_BEGIN_IGNORE_DEPRECATIONS gvalue = g_value_array_get_nth (args, i); G_GNUC_END_IGNORE_DEPRECATIONS 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. * * Deprecated: New code should use GDBus instead. The closest equivalent * is g_dbus_proxy_call(). */ 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_GNUC_BEGIN_IGNORE_DEPRECATIONS g_value_array_free (arg_values); G_GNUC_END_IGNORE_DEPRECATIONS } 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. * * Deprecated: New code should use GDBus instead. The closest equivalent * is g_dbus_proxy_call(). */ 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_GNUC_BEGIN_IGNORE_DEPRECATIONS g_value_array_free (arg_values); G_GNUC_END_IGNORE_DEPRECATIONS } 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 * * Deprecated: New code should use GDBus instead. The closest equivalent * is g_dbus_proxy_call_finish(). */ 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 * * Deprecated: New code should use GDBus instead. The closest equivalent * is g_dbus_proxy_call_sync(). */ 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_GNUC_BEGIN_IGNORE_DEPRECATIONS g_value_array_free (in_args); G_GNUC_END_IGNORE_DEPRECATIONS } 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 * * Deprecated: New code should use GDBus instead. The closest equivalent * is g_dbus_proxy_call_sync(). */ 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_GNUC_BEGIN_IGNORE_DEPRECATIONS g_value_array_free (in_args); G_GNUC_END_IGNORE_DEPRECATIONS } 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. * * Deprecated: New code should use GDBus instead. The closest equivalent * is g_dbus_proxy_call() with @callback = %NULL. */ 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_GNUC_BEGIN_IGNORE_DEPRECATIONS g_value_array_free (in_args); G_GNUC_END_IGNORE_DEPRECATIONS } 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. * * Deprecated: New code should use GDBus instead. The closest equivalent * is g_cancellable_cancel(). */ 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. * * Deprecated: New code should use GDBus instead. The closest equivalent * is g_dbus_connection_send_message(). */ 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. * * Deprecated: New code should use GDBus instead. */ 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); 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. * * Deprecated: New code should use GDBus instead. The closest equivalent * is g_dbus_connection_signal_subscribe(). */ 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. * * Deprecated: New code should use GDBus instead. The closest equivalent * is g_dbus_connection_signal_unsubscribe(). */ 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 * * Deprecated: New code should use GDBus instead. */ 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.114/dbus/dbus-gobject.h0000644000175000017500000000235113621620605012530 /* -*- 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. * * SPDX-License-Identifier: AFL-2.1 OR GPL-2.0-or-later * * 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); G_END_DECLS #endif dbus-glib-0.114/dbus/dbus-gobject.c0000664000175000017500000033040614764566761012557 /* -*- 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 * * SPDX-License-Identifier: AFL-2.1 OR GPL-2.0-or-later * * 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 GRWLock globals_lock; /* See comments in check_property_access */ static gboolean disable_legacy_property_access = FALSE; 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) { G_GNUC_UNUSED /* if assertions are disabled */ 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. * * Deprecated: New code should use GDBus instead. There is no * equivalent for this function, because GDBus does not conflate * GObject and D-Bus property names in the same way. */ 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_rw_lock_reader_lock (&globals_lock); if (error_metadata != NULL) info = g_datalist_id_get_data (&error_metadata, domain); else info = NULL; g_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_FILE_EXISTS: name = DBUS_ERROR_FILE_EXISTS; break; case DBUS_GERROR_UNKNOWN_METHOD: name = DBUS_ERROR_UNKNOWN_METHOD; break; case DBUS_GERROR_TIMED_OUT: name = DBUS_ERROR_TIMED_OUT; break; case DBUS_GERROR_MATCH_RULE_NOT_FOUND: name = DBUS_ERROR_MATCH_RULE_NOT_FOUND; break; case DBUS_GERROR_MATCH_RULE_INVALID: name = DBUS_ERROR_MATCH_RULE_INVALID; break; case DBUS_GERROR_SPAWN_EXEC_FAILED: name = DBUS_ERROR_SPAWN_EXEC_FAILED; break; case DBUS_GERROR_SPAWN_FORK_FAILED: name = DBUS_ERROR_SPAWN_FORK_FAILED; break; case DBUS_GERROR_SPAWN_CHILD_EXITED: name = DBUS_ERROR_SPAWN_CHILD_EXITED; break; case DBUS_GERROR_SPAWN_CHILD_SIGNALED: name = DBUS_ERROR_SPAWN_CHILD_SIGNALED; break; case DBUS_GERROR_SPAWN_FAILED: name = DBUS_ERROR_SPAWN_FAILED; break; case DBUS_GERROR_UNIX_PROCESS_ID_UNKNOWN: name = DBUS_ERROR_UNIX_PROCESS_ID_UNKNOWN; break; case DBUS_GERROR_INVALID_SIGNATURE: name = DBUS_ERROR_INVALID_SIGNATURE; break; case DBUS_GERROR_INVALID_FILE_CONTENT: name = DBUS_ERROR_INVALID_FILE_CONTENT; break; case DBUS_GERROR_SELINUX_SECURITY_CONTEXT_UNKNOWN: name = DBUS_ERROR_SELINUX_SECURITY_CONTEXT_UNKNOWN; 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 * @title: DBusGMethod * @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(). * * Deprecated: New code should use GDBus instead. The closest * equivalent is #GDBusMethodInvocation. */ 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 = gerror_to_dbus_error_message (object_info, message, error); 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_GNUC_BEGIN_IGNORE_DEPRECATIONS 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); G_GNUC_END_IGNORE_DEPRECATIONS 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_GNUC_BEGIN_IGNORE_DEPRECATIONS g_value_array_append (value_array, &context_value); G_GNUC_END_IGNORE_DEPRECATIONS } 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. */ G_GNUC_BEGIN_IGNORE_DEPRECATIONS out_param_gvalues = g_value_array_new (out_param_count); G_GNUC_END_IGNORE_DEPRECATIONS 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_GNUC_BEGIN_IGNORE_DEPRECATIONS g_value_array_append (out_param_gvalues, NULL); G_GNUC_END_IGNORE_DEPRECATIONS g_value_set_pointer (&value, out_param_gvalues->values + out_param_gvalue_pos); out_param_gvalue_pos++; } G_GNUC_BEGIN_IGNORE_DEPRECATIONS g_value_array_append (value_array, &value); G_GNUC_END_IGNORE_DEPRECATIONS } } /* Append GError as final argument if necessary */ if (retval_signals_error) { g_assert (have_retval); G_GNUC_BEGIN_IGNORE_DEPRECATIONS 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); G_GNUC_END_IGNORE_DEPRECATIONS } /* 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_GNUC_BEGIN_IGNORE_DEPRECATIONS g_value_array_free (out_param_gvalues); G_GNUC_END_IGNORE_DEPRECATIONS } if (gerror != NULL) g_clear_error (&gerror); G_GNUC_BEGIN_IGNORE_DEPRECATIONS g_value_array_free (value_array); G_GNUC_END_IGNORE_DEPRECATIONS 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;]| * * Deprecated: New code should use GDBus instead. GDBus' error encoding * is much simpler and more reliable, and the closest equivalent * is g_dbus_error_new_for_dbus_error(). */ 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 * @title: DBus GObject related functions * @short_description: Exporting a GObject remotely * @see_also: #GObject * @stability: Stable * * FIXME * * Deprecated: New code should use GDBus instead. */ /** * 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 * * Deprecated: New code should use GDBus instead. There is no * equivalent for this function. */ 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. * * Deprecated: New code should use GDBus instead. There is no direct * equivalent for this function. */ 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.) * * Deprecated: New code should use GDBus instead. The closest equivalent * is g_dbus_error_register_error_domain(). */ 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_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_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. * * Deprecated: New code should use GDBus instead. * The closest equivalent is g_dbus_connection_unregister_object(). */ 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. * * Deprecated: New code should use GDBus instead. * The closest equivalent is g_dbus_connection_register_object(), * but #GDBusObjectManagerServer and #GDBusObjectSkeleton provide * a higher-level API. */ 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 * * Deprecated: New code should use GDBus instead. There is no direct * equivalent for this function. */ 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; /** * 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 is no longer useful, and is only provided * for compatibility with older dbus-glib. The #GClosureMarshal * will not be called. * * Deprecated: New code should use GDBus instead. */ void dbus_g_object_register_marshaller (GClosureMarshal marshaller, GType rettype, ...) { } /** * 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() * * Deprecated: New code should use GDBus instead. */ void dbus_g_object_register_marshaller_array (GClosureMarshal marshaller, GType rettype, guint n_types, const GType* types) { } /** * 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. * * Deprecated: New code should use GDBus instead. The closest equivalent * is g_dbus_method_invocation_get_sender(). */ 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 * * Deprecated: New code should use GDBus instead. The closest equivalent * is g_dbus_method_invocation_return_value(). */ 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 * * Deprecated: New code should use GDBus instead. The closest equivalent * is g_dbus_method_invocation_return_value(). */ 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. * * Deprecated: New code should use GDBus instead. The closest equivalent * is g_dbus_method_invocation_return_value(). */ 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. * * Deprecated: New code should use GDBus instead. The closest equivalent * is g_dbus_method_invocation_return_gerror(). */ 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); } /** * dbus_g_method_invocation_get_g_connection: * @context: the method context * * * * Returns: (transfer none): the @DBusGConnection from which the method was called. * * Deprecated: New code should use GDBus instead. The closest equivalent * is g_dbus_method_invocation_get_connection(). */ DBusGConnection * dbus_g_method_invocation_get_g_connection (DBusGMethodInvocation *context) { g_return_val_if_fail (context != NULL, NULL); return context->connection; } 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_cmpint (*arg, ==, '\0'); /* Increment */ arg = method_arg_info_from_object_info (&dbus_glib_internal_test_object_info, &(dbus_glib_internal_test_methods[1])); g_assert_cmpint (*arg, !=, '\0'); arg = arg_iterate (arg, &arg_name, &arg_in, &constval, &retval, &arg_signature); g_assert_cmpstr (arg_name, ==, "x"); g_assert_true (arg_in); g_assert_cmpstr (arg_signature, ==, "u"); g_assert_cmpint (*arg, !=, '\0'); arg = arg_iterate (arg, &arg_name, &arg_in, &constval, &retval, &arg_signature); g_assert_false (arg_in); g_assert_cmpint (retval, ==, RETVAL_NONE); g_assert_cmpstr (arg_signature, ==, "u"); g_assert_cmpint (*arg, ==, '\0'); /* IncrementRetval */ arg = method_arg_info_from_object_info (&dbus_glib_internal_test_object_info, &(dbus_glib_internal_test_methods[2])); g_assert_cmpint (*arg, !=, '\0'); arg = arg_iterate (arg, &arg_name, &arg_in, &constval, &retval, &arg_signature); g_assert_cmpstr (arg_name, ==, "x"); g_assert_true (arg_in); g_assert_cmpstr (arg_signature, ==, "u"); g_assert_cmpint (*arg, !=, '\0'); arg = arg_iterate (arg, &arg_name, &arg_in, &constval, &retval, &arg_signature); g_assert_cmpint (retval, ==, RETVAL_NOERROR); g_assert_false (arg_in); g_assert_cmpstr (arg_signature, ==, "u"); g_assert_cmpint (*arg, ==, '\0'); /* IncrementRetvalError */ arg = method_arg_info_from_object_info (&dbus_glib_internal_test_object_info, &(dbus_glib_internal_test_methods[3])); g_assert_cmpint (*arg, !=, '\0'); arg = arg_iterate (arg, &arg_name, &arg_in, &constval, &retval, &arg_signature); g_assert_cmpstr (arg_name, ==, "x"); g_assert_true (arg_in); g_assert_cmpstr (arg_signature, ==, "u"); g_assert_cmpint (*arg, !=, '\0'); arg = arg_iterate (arg, &arg_name, &arg_in, &constval, &retval, &arg_signature); g_assert_cmpint (retval, ==, RETVAL_ERROR); g_assert_false (arg_in); g_assert_cmpstr (arg_signature, ==, "u"); g_assert_cmpint (*arg, ==, '\0'); /* Stringify */ arg = method_arg_info_from_object_info (&dbus_glib_internal_test_object_info, &(dbus_glib_internal_test_methods[8])); g_assert_cmpint (*arg, !=, '\0'); arg = arg_iterate (arg, &arg_name, &arg_in, &constval, &retval, &arg_signature); g_assert_cmpstr (arg_name, ==, "val"); g_assert_true (arg_in); g_assert_cmpstr (arg_signature, ==, "v"); g_assert_cmpint (*arg, !=, '\0'); arg = arg_iterate (arg, &arg_name, &arg_in, &constval, &retval, &arg_signature); g_assert_cmpint (retval, ==, RETVAL_NONE); g_assert_false (arg_in); g_assert_cmpstr (arg_signature, ==, "s"); g_assert_cmpint (*arg, ==, '\0'); sigdata = dbus_glib_internal_test_object_info.exported_signals; g_assert (*sigdata != '\0'); sigdata = signal_iterate (sigdata, &iface, &signame); g_assert_cmpstr (iface, ==, "org.freedesktop.DBus.Tests.MyObject"); g_assert_cmpstr (signame, ==, "Frobnicate"); g_assert (*sigdata != '\0'); sigdata = signal_iterate (sigdata, &iface, &signame); g_assert_cmpstr (iface, ==, "org.freedesktop.DBus.Tests.FooObject"); g_assert_cmpstr (signame, ==, "Sig0"); g_assert (*sigdata != '\0'); sigdata = signal_iterate (sigdata, &iface, &signame); g_assert_cmpstr (iface, ==, "org.freedesktop.DBus.Tests.FooObject"); g_assert_cmpstr (signame, ==, "Sig1"); g_assert (*sigdata != '\0'); sigdata = signal_iterate (sigdata, &iface, &signame); g_assert_cmpstr (iface, ==, "org.freedesktop.DBus.Tests.FooObject"); g_assert_cmpstr (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.114/dbus/dbus-gmarshal.h0000644000175000017500000000157213515561575012731 /* SPDX-License-Identifier: AFL-2.1 OR GPL-2.0-or-later */ #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.114/dbus/dbus-gmarshal.c0000644000175000017500000001056113515561575012722 /* SPDX-License-Identifier: AFL-2.1 OR GPL-2.0-or-later */ #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.114/dbus/dbus-glib.c0000644000175000017500000004275213515561575012050 /* -*- mode: C; c-file-style: "gnu" -*- */ /* dbus-glib.c General GLib binding stuff * * Copyright (C) 2004 Red Hat, Inc. * * SPDX-License-Identifier: AFL-2.1 OR GPL-2.0-or-later * * 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/dbus-glib-lowlevel.h" #include "dbus-gmain/dbus-gmain.h" #include "dbus-gtest.h" #include "dbus-gutils.h" #include "dbus-gvalue.h" #include "dbus-gobject.h" #include /** * SECTION:dbus-gconnection * @title: DBusGConnection * @short_description: DBus Connection * @see_also: #DBusConnection * @stability: Stable * * A #DBusGConnection is a boxed type abstracting a DBusConnection. * * Deprecated: New code should use #GDBusConnection from the GIO library, * which is not based on libdbus or dbus-glib. */ /** * DBusGConnection: * * A #DBusGConnection is a boxed type abstracting a DBusConnection from * libdbus. * * Deprecated: New code should use #GDBusConnection from the GIO library, * which is not based on libdbus or dbus-glib. */ /** * dbus_g_connection_flush: * @connection: the #DBusGConnection to flush * * Blocks until outgoing calls and signal emissions have been sent. * * Deprecated: The closest equivalent in GDBus is * #g_dbus_connection_flush_sync(). */ 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 * * Deprecated: New code should use #GDBusConnection instead. */ 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 * * Deprecated: New code should use #GDBusConnection instead. */ void dbus_g_connection_unref (DBusGConnection *connection) { DBusConnection *c; c = DBUS_CONNECTION_FROM_G_CONNECTION (connection); dbus_connection_unref (c); } /** * SECTION:dbus-gmessage * @title: DBusGMessage * @short_description: DBus Message * @see_also: #DBusMessage * @stability: Stable * * A #DBusGMessage is a boxed type abstracting a DBusMessage. * * Deprecated: New code should use #GDBusMessage instead. */ /** * DBusGMessage: * * A #DBusGMessage is a boxed type abstracting a DBusMessage from * libdbus. * * Deprecated: New code should use #GDBusMessage instead. */ /** * dbus_g_message_ref: * @message: the message to ref * * Increment refcount on a #DBusGMessage * * Returns: the message that was ref'd * * Deprecated: New code should use #GDBusMessage instead. */ 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 * * Deprecated: New code should use #GDBusMessage instead. */ void dbus_g_message_unref (DBusGMessage *message) { DBusMessage *c; c = DBUS_MESSAGE_FROM_G_MESSAGE (message); dbus_message_unref (c); } /** * SECTION:dbus-gerror * @title: DBusGError * @short_description: DBus GError * @see_also: #GError * @stability: Stable * * #DBusGError is the #GError used by DBus. * * Deprecated: New code should use GDBus and its #GDBusError enum instead. */ /** * 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. * * Deprecated: New code should use GDBus and its #GDBusError enum instead. */ /** * DBUS_GERROR: * * Expands to a function call returning the error domain quark for #DBusGError, * for use with #GError. * * Deprecated: New code should use GDBus and its #GDBusError enum instead. */ 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 * * Deprecated: New code should use GDBus instead. The closest equivalent * is g_dbus_error_get_remote_error(). */ 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. * * Deprecated: New code should use GDBus instead. The closest equivalent * is g_dbus_error_get_remote_error(). */ 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 * * Deprecated: New code should use GDBus instead. */ 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 * * Deprecated: New code should use GDBus instead. */ 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 * * Deprecated: New code should use GDBus instead. */ 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 * * Deprecated: New code should use GDBus instead. */ 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 * @title: DBus GLib low level * @short_description: DBus lower level functions * @stability: Unstable * * These functions can be used to access lower level of DBus. * * Deprecated: New code should use GDBus instead. */ /** * 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 * * Deprecated: New code should use GDBus instead. */ 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 * * Deprecated: New code should use GDBus instead. */ 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 * * Deprecated: New code should use GDBus instead. */ DBusMessage* dbus_g_message_get_message (DBusGMessage *gmessage) { return DBUS_MESSAGE_FROM_G_MESSAGE (gmessage); } /** * 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 * * Deprecated: New code should use GDBus instead. The closest equivalent * is g_dbus_connection_new_for_address_sync(). */ 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_connection_open_private: * @address: address of the connection to open * @context: the #GMainContext or %NULL for default context * @error: address where an error can be returned. * * Returns a private connection to the given address; this * connection does not talk to a bus daemon and thus the caller * must set up any authentication by itself. If the address * refers to a message bus, the caller must call dbus_bus_register(). * * (Internally, calls dbus_connection_open_private() then calls * dbus_connection_setup_with_g_main() on the result.) * * Returns: (transfer full): a #DBusGConnection * * Deprecated: New code should use GDBus instead. The closest equivalent * is g_dbus_connection_new_for_address_sync(). */ DBusGConnection * dbus_g_connection_open_private (const gchar *address, 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_connection_open_private (address, &derror); if (connection == NULL) { dbus_set_g_error (error, &derror); dbus_error_free (&derror); return NULL; } dbus_connection_setup_with_g_main (connection, context); 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 * * Deprecated: New code should use GDBus instead. The closest equivalent * is g_bus_get_sync(). */ 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 * * Deprecated: New code should use GDBus instead. The closest equivalent * is g_bus_get_sync(). */ 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); } /** * 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. * * Deprecated: New code should use GDBus instead. * Modules that need to connect `libdbus` to a GLib main loop should * use the dbus-gmain submodule via `git subtree` or `git submodule`. */ void dbus_connection_setup_with_g_main (DBusConnection *connection, GMainContext *context) { _dbus_g_set_up_connection (connection, context); } /** * 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. * * Deprecated: New code should use GDBus instead. * Modules that need to connect `libdbus` to a GLib main loop should * use the dbus-gmain submodule via `git subtree` or `git submodule`. */ void dbus_server_setup_with_g_main (DBusServer *server, GMainContext *context) { _dbus_g_set_up_server (server, context); } dbus-glib-0.114/dbus/Makefile.in0000664000175000017500000016074514764623731012106 # Makefile.in generated by automake 1.17 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2024 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__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) am__rm_f = rm -f $(am__rm_f_notfound) am__rm_rf = rm -rf $(am__rm_f_notfound) 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 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) DIST_COMMON = $(srcdir)/Makefile.am $(libdbus_glib_HEADERS) \ $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(libexecdir)" \ "$(DESTDIR)$(libdir)" "$(DESTDIR)$(completiondir)" \ "$(DESTDIR)$(libdbus_glibdir)" @DBUS_BUILD_TESTS_TRUE@am__EXEEXT_1 = dbus-glib-test$(EXEEXT) PROGRAMS = $(bin_PROGRAMS) $(libexec_PROGRAMS) $(noinst_PROGRAMS) 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 ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && echo $$files | $(am__xargs_n) 40 $(am__rm_f); }; \ } LTLIBRARIES = $(lib_LTLIBRARIES) $(noinst_LTLIBRARIES) am__DEPENDENCIES_1 = libdbus_glib_1_la_DEPENDENCIES = \ $(top_builddir)/dbus-gmain/libdbus-gmain.la \ $(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-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 am__v_lt_1 = 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__DEPENDENCIES_1) libdbus-glib-1.la 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) 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) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : 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_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/dbus-bash-completion-helper.Po \ ./$(DEPDIR)/dbus-binding-tool-glib.Po \ ./$(DEPDIR)/dbus-gidl.Plo ./$(DEPDIR)/dbus-glib-tool.Po \ ./$(DEPDIR)/dbus-glib.Plo ./$(DEPDIR)/dbus-gloader-expat.Plo \ ./$(DEPDIR)/dbus-gmarshal.Plo ./$(DEPDIR)/dbus-gobject.Plo \ ./$(DEPDIR)/dbus-gparser.Plo ./$(DEPDIR)/dbus-gproxy.Plo \ ./$(DEPDIR)/dbus-gsignature.Plo ./$(DEPDIR)/dbus-gtest-main.Po \ ./$(DEPDIR)/dbus-gtest.Plo ./$(DEPDIR)/dbus-gthread.Plo \ ./$(DEPDIR)/dbus-gtype-specialized.Plo \ ./$(DEPDIR)/dbus-gutils.Plo \ ./$(DEPDIR)/dbus-gvalue-parse-variant.Plo \ ./$(DEPDIR)/dbus-gvalue-utils.Plo ./$(DEPDIR)/dbus-gvalue.Plo 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_CC_1 = 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_CCLD_1 = 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 cscopelist-recursive \ ctags-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 \ tags-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_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ check recheck distdir distdir-am am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` am__tty_colors_dummy = \ mgn= red= grn= lgn= blu= brg= std=; \ am__color_tests=no am__tty_colors = { \ $(am__tty_colors_dummy); \ if test "X$(AM_COLOR_TESTS)" = Xno; then \ am__color_tests=no; \ elif test "X$(AM_COLOR_TESTS)" = Xalways; then \ am__color_tests=yes; \ elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \ am__color_tests=yes; \ fi; \ if test $$am__color_tests = yes; then \ red=''; \ grn=''; \ lgn=''; \ blu=''; \ mgn=''; \ brg=''; \ std=''; \ fi; \ } am__recheck_rx = ^[ ]*:recheck:[ ]* am__global_test_result_rx = ^[ ]*:global-test-result:[ ]* am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]* # A command that, given a newline-separated list of test names on the # standard input, print the name of the tests that are to be re-run # upon "make recheck". am__list_recheck_tests = $(AWK) '{ \ recheck = 1; \ while ((rc = (getline line < ($$0 ".trs"))) != 0) \ { \ if (rc < 0) \ { \ if ((getline line2 < ($$0 ".log")) < 0) \ recheck = 0; \ break; \ } \ else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \ { \ recheck = 0; \ break; \ } \ else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \ { \ break; \ } \ }; \ if (recheck) \ print $$0; \ close ($$0 ".trs"); \ close ($$0 ".log"); \ }' # A command that, given a newline-separated list of test names on the # standard input, create the global log from their .trs and .log files. am__create_global_log = $(AWK) ' \ function fatal(msg) \ { \ print "fatal: making $@: " msg | "cat >&2"; \ exit 1; \ } \ function rst_section(header) \ { \ print header; \ len = length(header); \ for (i = 1; i <= len; i = i + 1) \ printf "="; \ printf "\n\n"; \ } \ { \ copy_in_global_log = 1; \ global_test_result = "RUN"; \ while ((rc = (getline line < ($$0 ".trs"))) != 0) \ { \ if (rc < 0) \ fatal("failed to read from " $$0 ".trs"); \ if (line ~ /$(am__global_test_result_rx)/) \ { \ sub("$(am__global_test_result_rx)", "", line); \ sub("[ ]*$$", "", line); \ global_test_result = line; \ } \ else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \ copy_in_global_log = 0; \ }; \ if (copy_in_global_log) \ { \ rst_section(global_test_result ": " $$0); \ while ((rc = (getline line < ($$0 ".log"))) != 0) \ { \ if (rc < 0) \ fatal("failed to read from " $$0 ".log"); \ print line; \ }; \ printf "\n"; \ }; \ close ($$0 ".trs"); \ close ($$0 ".log"); \ }' # Restructured Text title. am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; } # Solaris 10 'make', and several other traditional 'make' implementations, # pass "-e" to $(SHELL), and POSIX 2008 even requires this. Work around it # by disabling -e (using the XSI extension "set +e") if it's set. am__sh_e_setup = case $$- in *e*) set +e;; esac # Default flags passed to test drivers. am__common_driver_flags = \ --color-tests "$$am__color_tests" \ $$am__collect_skipped_logs \ --enable-hard-errors "$$am__enable_hard_errors" \ --expect-failure "$$am__expect_failure" # To be inserted before the command running the test. Creates the # directory for the log if needed. Stores in $dir the directory # containing $f, in $tst the test, in $log the log. Executes the # developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and # passes TESTS_ENVIRONMENT. Set up options for the wrapper that # will run the test scripts (or their associated LOG_COMPILER, if # thy have one). am__check_pre = \ $(am__sh_e_setup); \ $(am__vpath_adj_setup) $(am__vpath_adj) \ $(am__tty_colors); \ srcdir=$(srcdir); export srcdir; \ case "$@" in \ */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \ *) am__odir=.;; \ esac; \ test "x$$am__odir" = x"." || test -d "$$am__odir" \ || $(MKDIR_P) "$$am__odir" || exit $$?; \ if test -f "./$$f"; then dir=./; \ elif test -f "$$f"; then dir=; \ else dir="$(srcdir)/"; fi; \ tst=$$dir$$f; log='$@'; \ if test -n '$(IGNORE_SKIPPED_LOGS)'; then \ am__collect_skipped_logs='--collect-skipped-logs no'; \ else \ am__collect_skipped_logs=''; \ fi; \ if test -n '$(DISABLE_HARD_ERRORS)'; then \ am__enable_hard_errors=no; \ else \ am__enable_hard_errors=yes; \ fi; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \ am__expect_failure=yes;; \ *) \ am__expect_failure=no;; \ esac; \ $(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT) # A shell command to get the names of the tests scripts with any registered # extension removed (i.e., equivalently, the names of the test logs, with # the '.log' extension removed). The result is saved in the shell variable # '$bases'. This honors runtime overriding of TESTS and TEST_LOGS. Sadly, # we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)", # since that might cause problem with VPATH rewrites for suffix-less tests. # See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'. am__set_TESTS_bases = \ bases='$(TEST_LOGS)'; \ bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \ bases=`echo $$bases` AM_TESTSUITE_SUMMARY_HEADER = ' for $(PACKAGE_STRING)' RECHECK_LOGS = $(TEST_LOGS) TEST_SUITE_LOG = test-suite.log TEST_EXTENSIONS = @EXEEXT@ .test LOG_DRIVER = $(SHELL) $(top_srcdir)/build-aux/test-driver LOG_COMPILE = $(LOG_COMPILER) $(AM_LOG_FLAGS) $(LOG_FLAGS) am__set_b = \ case '$@' in \ */*) \ case '$*' in \ */*) b='$*';; \ *) b=`echo '$@' | sed 's/\.log$$//'`; \ esac;; \ *) \ b='$*';; \ esac am__test_logs1 = $(TESTS:=.log) am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log) TEST_LOGS = $(am__test_logs2:.test.log=.log) TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/build-aux/test-driver TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \ $(TEST_LOG_FLAGS) DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in \ $(top_srcdir)/build-aux/depcomp \ $(top_srcdir)/build-aux/test-driver 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" 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@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DBUS_BINDING_TOOL = @DBUS_BINDING_TOOL@ DBUS_CFLAGS = @DBUS_CFLAGS@ DBUS_GLIB_TOOL_CFLAGS = @DBUS_GLIB_TOOL_CFLAGS@ DBUS_GLIB_TOOL_LIBS = @DBUS_GLIB_TOOL_LIBS@ DBUS_LIBS = @DBUS_LIBS@ DBUS_RUN_SESSION = @DBUS_RUN_SESSION@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FILECMD = @FILECMD@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ GLIB_THREADS_LIBS = @GLIB_THREADS_LIBS@ GREP = @GREP@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ HTML_DIR = @HTML_DIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ 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@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ 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@ 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__rm_f_notfound = @am__rm_f_notfound@ am__tar = @am__tar@ am__untar = @am__untar@ am__xargs_n = @am__xargs_n@ 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@ runstatedir = @runstatedir@ 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 AM_CPPFLAGS = \ -I$(top_srcdir) \ -I$(top_builddir) \ $(DBUS_CFLAGS) \ $(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-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 \ $(NULL) libdbus_glibdir = $(includedir)/dbus-1.0/dbus libdbus_glib_1_la_LIBADD = \ $(top_builddir)/dbus-gmain/libdbus-gmain.la \ $(DBUS_LIBS) \ $(GLIB_LIBS) \ $(NULL) 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 = \ -lexpat \ $(DBUS_LIBS) \ $(GLIB_LIBS) \ libdbus-glib-1.la \ $(NULL) 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) $(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) $(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 .log .o .obj .test .test$(EXEEXT) .trs $(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) --foreign dbus/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign dbus/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__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ 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-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)" && $(am__rm_f) $$files clean-binPROGRAMS: $(am__rm_f) $(bin_PROGRAMS) test -z "$(EXEEXT)" || $(am__rm_f) $(bin_PROGRAMS:$(EXEEXT)=) 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)" && $(am__rm_f) $$files clean-libexecPROGRAMS: $(am__rm_f) $(libexec_PROGRAMS) test -z "$(EXEEXT)" || $(am__rm_f) $(libexec_PROGRAMS:$(EXEEXT)=) clean-noinstPROGRAMS: $(am__rm_f) $(noinst_PROGRAMS) test -z "$(EXEEXT)" || $(am__rm_f) $(noinst_PROGRAMS:$(EXEEXT)=) 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: -$(am__rm_f) $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ echo rm -f $${locs}; \ $(am__rm_f) $${locs} clean-noinstLTLIBRARIES: -$(am__rm_f) $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ echo rm -f $${locs}; \ $(am__rm_f) $${locs} 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) 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@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbus-binding-tool-glib.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbus-gidl.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbus-glib-tool.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbus-glib.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbus-gloader-expat.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbus-gmarshal.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbus-gobject.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbus-gparser.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbus-gproxy.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbus-gsignature.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbus-gtest-main.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbus-gtest.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbus-gthread.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbus-gtype-specialized.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbus-gutils.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbus-gvalue-parse-variant.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbus-gvalue-utils.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbus-gvalue.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @: >>$@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.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 -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.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 -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.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. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ 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" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) 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; \ $(am__define_uniq_tagged_files); \ 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-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ 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" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags # Recover from deleted '.trs' file; this should ensure that # "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create # both 'foo.log' and 'foo.trs'. Break the recipe in two subshells # to avoid problems with "make -n". .log.trs: rm -f $< $@ $(MAKE) $(AM_MAKEFLAGS) $< # Leading 'am--fnord' is there to ensure the list of targets does not # expand to empty, as could happen e.g. with make check TESTS=''. am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck) am--force-recheck: @: $(TEST_SUITE_LOG): $(TEST_LOGS) @$(am__set_TESTS_bases); \ am__f_ok () { test -f "$$1" && test -r "$$1"; }; \ redo_bases=`for i in $$bases; do \ am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \ done`; \ if test -n "$$redo_bases"; then \ redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \ redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \ if $(am__make_dryrun); then :; else \ rm -f $$redo_logs && rm -f $$redo_results || exit 1; \ fi; \ fi; \ if test -n "$$am__remaking_logs"; then \ echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \ "recursion detected" >&2; \ elif test -n "$$redo_logs"; then \ am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \ fi; \ if $(am__make_dryrun); then :; else \ st=0; \ errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \ for i in $$redo_bases; do \ test -f $$i.trs && test -r $$i.trs \ || { echo "$$errmsg $$i.trs" >&2; st=1; }; \ test -f $$i.log && test -r $$i.log \ || { echo "$$errmsg $$i.log" >&2; st=1; }; \ done; \ test $$st -eq 0 || exit 1; \ fi @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \ ws='[ ]'; \ results=`for b in $$bases; do echo $$b.trs; done`; \ test -n "$$results" || results=/dev/null; \ all=` grep "^$$ws*:test-result:" $$results | wc -l`; \ pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \ fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \ skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \ xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \ xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \ error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \ if test `expr $$fail + $$xpass + $$error` -eq 0; then \ success=true; \ else \ success=false; \ fi; \ br='==================='; br=$$br$$br$$br$$br; \ result_count () \ { \ if test x"$$1" = x"--maybe-color"; then \ maybe_colorize=yes; \ elif test x"$$1" = x"--no-color"; then \ maybe_colorize=no; \ else \ echo "$@: invalid 'result_count' usage" >&2; exit 4; \ fi; \ shift; \ desc=$$1 count=$$2; \ if test $$maybe_colorize = yes && test $$count -gt 0; then \ color_start=$$3 color_end=$$std; \ else \ color_start= color_end=; \ fi; \ echo "$${color_start}# $$desc $$count$${color_end}"; \ }; \ create_testsuite_report () \ { \ result_count $$1 "TOTAL:" $$all "$$brg"; \ result_count $$1 "PASS: " $$pass "$$grn"; \ result_count $$1 "SKIP: " $$skip "$$blu"; \ result_count $$1 "XFAIL:" $$xfail "$$lgn"; \ result_count $$1 "FAIL: " $$fail "$$red"; \ result_count $$1 "XPASS:" $$xpass "$$red"; \ result_count $$1 "ERROR:" $$error "$$mgn"; \ }; \ output_system_information () \ { \ echo; \ { uname -a | $(AWK) '{ \ printf "System information (uname -a):"; \ for (i = 1; i < NF; ++i) \ { \ if (i != 2) \ printf " %s", $$i; \ } \ printf "\n"; \ }'; } 2>&1; \ if test -r /etc/os-release; then \ echo "Distribution information (/etc/os-release):"; \ sed 8q /etc/os-release; \ elif test -r /etc/issue; then \ echo "Distribution information (/etc/issue):"; \ cat /etc/issue; \ fi; \ }; \ please_report () \ { \ echo "Some test(s) failed. Please report this to $(PACKAGE_BUGREPORT),"; \ echo "together with the test-suite.log file (gzipped) and your system"; \ echo "information. Thanks."; \ }; \ { \ echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \ $(am__rst_title); \ create_testsuite_report --no-color; \ output_system_information; \ echo; \ echo ".. contents:: :depth: 2"; \ echo; \ for b in $$bases; do echo $$b; done \ | $(am__create_global_log); \ } >$(TEST_SUITE_LOG).tmp || exit 1; \ mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \ if $$success; then \ col="$$grn"; \ else \ col="$$red"; \ test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \ fi; \ echo "$${col}$$br$${std}"; \ echo "$${col}Testsuite summary"$(AM_TESTSUITE_SUMMARY_HEADER)"$${std}"; \ echo "$${col}$$br$${std}"; \ create_testsuite_report --maybe-color; \ echo "$$col$$br$$std"; \ if $$success; then :; else \ echo "$${col}See $(subdir)/$(TEST_SUITE_LOG) for debugging.$${std}";\ if test -n "$(PACKAGE_BUGREPORT)"; then \ please_report | sed -e "s/^/$${col}/" -e s/'$$'/"$${std}"/; \ fi; \ echo "$$col$$br$$std"; \ fi; \ $$success || exit 1 check-TESTS: @$(am__rm_f) $(RECHECK_LOGS) @$(am__rm_f) $(RECHECK_LOGS:.log=.trs) @$(am__rm_f) $(TEST_SUITE_LOG) @set +e; $(am__set_TESTS_bases); \ log_list=`for i in $$bases; do echo $$i.log; done`; \ log_list=`echo $$log_list`; \ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \ exit $$?; recheck: all @$(am__rm_f) $(TEST_SUITE_LOG) @set +e; $(am__set_TESTS_bases); \ bases=`for i in $$bases; do echo $$i; done \ | $(am__list_recheck_tests)` || exit 1; \ log_list=`for i in $$bases; do echo $$i.log; done`; \ log_list=`echo $$log_list`; \ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \ am__force_recheck=am--force-recheck \ TEST_LOGS="$$log_list"; \ exit $$? dbus-glib-test.log: dbus-glib-test$(EXEEXT) @p='dbus-glib-test$(EXEEXT)'; \ b='dbus-glib-test'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) .test.log: @p='$<'; \ $(am__set_b); \ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) @am__EXEEXT_TRUE@.test$(EXEEXT).log: @am__EXEEXT_TRUE@ @p='$<'; \ @am__EXEEXT_TRUE@ $(am__set_b); \ @am__EXEEXT_TRUE@ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ @am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \ @am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ @am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT) distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(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) $(LTLIBRARIES) $(SCRIPTS) $(HEADERS) install-binPROGRAMS: install-libLTLIBRARIES install-libexecPROGRAMS: install-libLTLIBRARIES installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(libexecdir)" "$(DESTDIR)$(libdir)" "$(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: -$(am__rm_f) $(TEST_LOGS) -$(am__rm_f) $(TEST_LOGS:.log=.trs) -$(am__rm_f) $(TEST_SUITE_LOG) clean-generic: -$(am__rm_f) $(CLEANFILES) distclean-generic: -$(am__rm_f) $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || $(am__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 -f ./$(DEPDIR)/dbus-bash-completion-helper.Po -rm -f ./$(DEPDIR)/dbus-binding-tool-glib.Po -rm -f ./$(DEPDIR)/dbus-gidl.Plo -rm -f ./$(DEPDIR)/dbus-glib-tool.Po -rm -f ./$(DEPDIR)/dbus-glib.Plo -rm -f ./$(DEPDIR)/dbus-gloader-expat.Plo -rm -f ./$(DEPDIR)/dbus-gmarshal.Plo -rm -f ./$(DEPDIR)/dbus-gobject.Plo -rm -f ./$(DEPDIR)/dbus-gparser.Plo -rm -f ./$(DEPDIR)/dbus-gproxy.Plo -rm -f ./$(DEPDIR)/dbus-gsignature.Plo -rm -f ./$(DEPDIR)/dbus-gtest-main.Po -rm -f ./$(DEPDIR)/dbus-gtest.Plo -rm -f ./$(DEPDIR)/dbus-gthread.Plo -rm -f ./$(DEPDIR)/dbus-gtype-specialized.Plo -rm -f ./$(DEPDIR)/dbus-gutils.Plo -rm -f ./$(DEPDIR)/dbus-gvalue-parse-variant.Plo -rm -f ./$(DEPDIR)/dbus-gvalue-utils.Plo -rm -f ./$(DEPDIR)/dbus-gvalue.Plo -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 -f ./$(DEPDIR)/dbus-bash-completion-helper.Po -rm -f ./$(DEPDIR)/dbus-binding-tool-glib.Po -rm -f ./$(DEPDIR)/dbus-gidl.Plo -rm -f ./$(DEPDIR)/dbus-glib-tool.Po -rm -f ./$(DEPDIR)/dbus-glib.Plo -rm -f ./$(DEPDIR)/dbus-gloader-expat.Plo -rm -f ./$(DEPDIR)/dbus-gmarshal.Plo -rm -f ./$(DEPDIR)/dbus-gobject.Plo -rm -f ./$(DEPDIR)/dbus-gparser.Plo -rm -f ./$(DEPDIR)/dbus-gproxy.Plo -rm -f ./$(DEPDIR)/dbus-gsignature.Plo -rm -f ./$(DEPDIR)/dbus-gtest-main.Po -rm -f ./$(DEPDIR)/dbus-gtest.Plo -rm -f ./$(DEPDIR)/dbus-gthread.Plo -rm -f ./$(DEPDIR)/dbus-gtype-specialized.Plo -rm -f ./$(DEPDIR)/dbus-gutils.Plo -rm -f ./$(DEPDIR)/dbus-gvalue-parse-variant.Plo -rm -f ./$(DEPDIR)/dbus-gvalue-utils.Plo -rm -f ./$(DEPDIR)/dbus-gvalue.Plo -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: $(am__recursive_targets) check-am install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ am--depfiles check check-TESTS check-am clean \ clean-binPROGRAMS clean-generic clean-libLTLIBRARIES \ clean-libexecPROGRAMS clean-libtool clean-noinstLTLIBRARIES \ clean-noinstPROGRAMS cscopelist-am ctags ctags-am 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 \ recheck tags tags-am uninstall uninstall-am \ uninstall-binPROGRAMS uninstall-completionSCRIPTS \ uninstall-libLTLIBRARIES uninstall-libdbus_glibHEADERS \ uninstall-libexecPROGRAMS .PRECIOUS: Makefile 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) $(AM_CPPFLAGS) $(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: # Tell GNU make to disable its built-in pattern rules. %:: %,v %:: RCS/%,v %:: RCS/% %:: s.% %:: SCCS/s.% dbus-glib-0.114/dbus/dbus-glib-lowlevel.h0000664000175000017500000000501714714623727013677 /* -*- 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. * * SPDX-License-Identifier: AFL-2.1 OR GPL-2.0-or-later * * 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.114/dbus/dbus-glib.h0000664000175000017500000003465614714623727012063 /* -*- mode: C; c-file-style: "gnu" -*- */ /* dbus-glib.h GLib integration * * Copyright (C) 2002, 2003 CodeFactory AB * Copyright (C) 2003, 2004 Red Hat, Inc. * * SPDX-License-Identifier: AFL-2.1 OR GPL-2.0-or-later * * 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_connection_open_private (const gchar *address, GMainContext *context, 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); DBusGConnection * dbus_g_method_invocation_get_g_connection (DBusGMethodInvocation *context); /* 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.114/dbus/dbus-gvalue-parse-variant.h0000664000175000017500000000267014714623727015172 /* GVariant to dbus-glib escape hatch * * Copyright © 2010 Collabora Ltd. * * SPDX-License-Identifier: AFL-2.1 OR GPL-2.0-or-later OR LGPL-2.1-or-later * * 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.114/dbus/dbus-gtype-specialized.h0000664000175000017500000002141114714623727014551 /* -*- mode: C; c-file-style: "gnu" -*- */ /* dbus-gtype-specialized.h: Non-DBus-specific functions for specialized GTypes * * Copyright (C) 2005 Red Hat, Inc. * * SPDX-License-Identifier: AFL-2.1 OR GPL-2.0-or-later * * 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.114/dbus/Makefile.am0000644000175000017500000001002013515561041012033 SUBDIRS = . examples AM_CPPFLAGS = \ -I$(top_srcdir) \ -I$(top_builddir) \ $(DBUS_CFLAGS) \ $(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-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 \ $(NULL) libdbus_glibdir = $(includedir)/dbus-1.0/dbus libdbus_glib_1_la_LIBADD = \ $(top_builddir)/dbus-gmain/libdbus-gmain.la \ $(DBUS_LIBS) \ $(GLIB_LIBS) \ $(NULL) ## 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 = \ -lexpat \ $(DBUS_LIBS) \ $(GLIB_LIBS) \ libdbus-glib-1.la \ $(NULL) 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) $(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) $(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) $(AM_CPPFLAGS) $(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.114/dbus-gmain/0000775000175000017500000000000014764624122011170 5dbus-glib-0.114/dbus-gmain/CONTRIBUTING.md0000644000175000017500000001100113355160271013323 # Contributing to dbus-gmain dbus-gmain is hosted by freedesktop.org. The source code repository, issue tracking and merge requests are provided by freedesktop.org's Gitlab installation, as a branch in the dbus-glib project: ## Making changes If you are making changes that you wish to be incorporated upstream, please do as small commits to your local git tree that are individually correct, so there is a good history of your changes. The first line of the commit message should be a single sentence that describes the change, optionally with a prefix that identifies the area of the code that is affected. The body of the commit message should describe what the patch changes and why, and also note any particular side effects. This shouldn't be empty on most of the cases. It shouldn't take a lot of effort to write a commit message for an obvious change, so an empty commit message body is only acceptable if the questions "What?" and "Why?" are already answered on the one-line summary. The lines of the commit message should have at most 76 characters, to cope with the way git log presents them. See [notes on commit messages](https://who-t.blogspot.com/2009/12/on-commit-messages.html), [A Note About Git Commit Messages](https://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html) or [How to Write a Git Commit Message](https://chris.beams.io/posts/git-commit/) for recommended reading on writing high-quality commit messages. Your patches should also include a Signed-off-by line with your name and email address, indicating that your contribution follows the [Developer's Certificate of Origin](https://developercertificate.org/). If you're not the patch's original author, you should also gather S-o-b's by them (and/or whomever gave the patch to you.) The significance of this is that it certifies that you created the patch, that it was created under an appropriate open source license, or provided to you under those terms. This lets us indicate a chain of responsibility for the copyright status of the code. We won't reject patches that lack S-o-b, but it is strongly recommended. When you consider changes ready for merging to mainline: * create a personal fork of on freedesktop.org Gitlab * push your changes to your personal fork as a branch * create a merge request at , and remember to specify `dbus-gmain` as the target branch ## Automated tests For nontrivial changes please try to extend the test suite to cover it. dbus-gmain uses GLib's test framework; tests are in the `tests/` directory. Run `make check` to run the test suite. ## Coding style Please match the existing code style (Emacs: "gnu"). ## Licensing Please match the existing licensing (a dual-license: AFL-2.1 or GPL-2+, recipient's choice). Entirely new modules can be placed under a more permissive license: to avoid license proliferation, our preferred permissive license is the variant of the MIT/X11 license used by the Expat XML library (for example see the top of tools/ci-build.sh). ## Conduct As a freedesktop.org project, dbus follows the Contributor Covenant, found at: Please conduct yourself in a respectful and civilised manner when interacting with community members on mailing lists, IRC, or bug trackers. The community represents the project as a whole, and abusive or bullying behaviour is not tolerated by the project. ## (Lack of) versioning and releases dbus-gmain is currently set up to be a git subtree or git submodule, so it does not have releases in its own right. It gets merged or otherwise included in larger projects like dbus-glib and dbus-python instead. ## Information for maintainers This section is not directly relevant to infrequent contributors. ### Updating the copies of dbus-gmain in dbus-glib and dbus-python dbus-gmain is maintained via `git subtree`. To update one of the dependent projects, assuming you have a checkout of the dbus-gmain branch of the dbus-glib repository in ../dbus-gmain: git subtree pull -P dbus-gmain ../dbus-gmain HEAD ### Committing other people's patches 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 ..." Nontrivial patches should always go through Gitlab for peer review, so you should have an issue number or a merge request ID to refer to. dbus-glib-0.114/dbus-gmain/dbus-gmain.h0000644000175000017500000000332613515561575013316 /* -*- mode: C; c-file-style: "gnu" -*- */ /* dbus-gmain.h — GLib main loop integration for libdbus * * Copyright (C) 2002, 2003 CodeFactory AB * Copyright (C) 2003, 2004 Red Hat, Inc. * * SPDX-License-Identifier: AFL-2.1 OR GPL-2.0-or-later * * 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_GMAIN_H #define DBUS_GMAIN_H #ifdef HAVE_CONFIG_H #include #endif #include #include #ifndef DBUS_GMAIN_FUNCTION_NAME # define DBUS_GMAIN_FUNCTION_NAME(name) dbus_gmain_ ## name #endif #ifndef DBUS_GMAIN_FUNCTION # define DBUS_GMAIN_FUNCTION(ret, name, ...) \ G_GNUC_INTERNAL ret DBUS_GMAIN_FUNCTION_NAME (name) (__VA_ARGS__) #endif G_BEGIN_DECLS DBUS_GMAIN_FUNCTION (void, set_up_connection, DBusConnection *connection, GMainContext *context); DBUS_GMAIN_FUNCTION (void, set_up_server, DBusServer *server, GMainContext *context); G_END_DECLS #endif /* DBUS_GMAIN_H */ dbus-glib-0.114/dbus-gmain/dbus-gmain.c0000644000175000017500000004001113533234607013272 /* -*- mode: C; c-file-style: "gnu" -*- */ /* dbus-gmain.c GLib main loop integration * * Copyright © 2002-2003 CodeFactory AB * Copyright © 2002-2010 Red Hat, Inc. * Copyright © 2003 James Willcox * Copyright © 2006 Marc-Andre Lureau * Copyright © 2006-2018 Collabora Ltd. * Copyright © 2010-2012 Mike Gorse * * SPDX-License-Identifier: AFL-2.1 OR GPL-2.0-or-later * * 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 * */ #ifdef HAVE_CONFIG_H #include #endif #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; 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_gmain_set_up_connection: * @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. */ DBUS_GMAIN_FUNCTION (void, set_up_connection, 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_gmain_set_up_server: * @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. */ DBUS_GMAIN_FUNCTION (void, set_up_server, 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-glib-0.114/dbus-gmain/README.md0000644000175000017500000000427713355160271012372 dbus-gmain - GLib main loop integration for libdbus =================================================== This directory contains GLib main loop integration for libdbus, salvaged from dbus-glib. At the moment it is designed to be bundled in other projects using the `git subtree` or `git submodule` commands. Please do not use this module unless you really need it. The majority of GLib-based D-Bus users would be better off using GDBus, part of GLib, instead of the low-level APIs provided by libdbus. In particular, the combination of dbus-gmain and libdbus is known to have thread-safety issues. However, using this module is still better than using dbus-glib; the rest of dbus-glib mostly consists of design flaws. Integrating dbus-gmain in a larger project ------------------------------------------ dbus-gmain requires libdbus >= 1.8. This can be reduced to some ancient version if you don't build the tests. dbus-gmain requires GLib >= 2.40. This can be reduced to 2.32, or probably older, if you don't build the tests. If you use the included Makefile.am (which requires building the tests), you must check for libdbus via pkg-config using the prefix `DBUS`, check for GLib (and optionally gobject and gio) via pkg-config using the prefix `GLIB`, and check for `DBUS_RUN_SESSION` for the tests: ``` PKG_CHECK_MODULES([DBUS], [dbus-1 >= 1.8]) PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.40]) AC_ARG_VAR([DBUS_RUN_SESSION], [The dbus-run-session tool from dbus 1.8 or later]) AC_PATH_PROG([DBUS_RUN_SESSION], [dbus-run-session], [dbus-run-session]) ``` Alternatively, you can include dbus-gmain.[ch] among the source files for some executable or library. By default, dbus-gmain declares its functions in the `dbus_gmain_`\* namespace. To change this, define `DBUS_GMAIN_FUNCTION_NAME(name)` to a suitably prefixed or suffixed version of name. The default is `dbus_gmain_ ## name`. By default, dbus-gmain declares its functions `G_GNUC_INTERNAL`, so they will not be part of your library's ABI on supported compilers. To change this (not recommended), define `DBUS_GMAIN_FUNCTION(ret, name, ...)` to a form that includes suitable decorators. The default is `G_GNUC_INTERNAL ret DBUS_GMAIN_FUNCTION_NAME (name) (__VA_ARGS__)`. dbus-glib-0.114/dbus-gmain/COPYING0000644000175000017500000007060713515561575012160 The D-Bus GLib main loop 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. In SPDX terms, this is: SPDX-License-Identifier: AFL-2.1 OR GPL-2.0-or-later ------------------------------------------------------------------------ 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. ------------------------------------------------------------------------ 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.114/dbus-gmain/AUTHORS0000644000175000017500000000035613233575561012164 Alexander Larsson Anders Carlsson Carlos Garnacho Parro Christian Dywan Colin Walters Havoc Pennington James Willcox Kristian Hogsberg Marc-Andre Lureau Mikael Hallendal Mike Gorse Richard Hult Ross Burton Steve Frécinaux Tobias Mueller dbus-glib-0.114/dbus-gmain/Makefile.in0000664000175000017500000011642614764623731013174 # Makefile.in generated by automake 1.17 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2024 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@ # SPDX-License-Identifier: AFL-2.1 OR GPL-2.0-or-later VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) am__rm_f = rm -f $(am__rm_f_notfound) am__rm_rf = rm -rf $(am__rm_f_notfound) 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@ TESTS = tests/test-30574$(EXEEXT) noinst_PROGRAMS = tests/test-30574$(EXEEXT) \ tests/test-thread-server$(EXEEXT) \ tests/test-thread-client$(EXEEXT) subdir = dbus-gmain 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) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = PROGRAMS = $(noinst_PROGRAMS) LTLIBRARIES = $(noinst_LTLIBRARIES) am__DEPENDENCIES_1 = libdbus_gmain_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) am_libdbus_gmain_la_OBJECTS = dbus-gmain.lo libdbus_gmain_la_OBJECTS = $(am_libdbus_gmain_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = libdbus_gmain_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(AM_CFLAGS) $(CFLAGS) $(libdbus_gmain_la_LDFLAGS) $(LDFLAGS) \ -o $@ tests_libtest_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) am__dirstamp = $(am__leading_dot)dirstamp am_tests_libtest_la_OBJECTS = tests/util.lo tests_libtest_la_OBJECTS = $(am_tests_libtest_la_OBJECTS) tests_libtest_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(AM_CFLAGS) $(CFLAGS) $(tests_libtest_la_LDFLAGS) $(LDFLAGS) \ -o $@ am_tests_test_30574_OBJECTS = tests/30574.$(OBJEXT) tests_test_30574_OBJECTS = $(am_tests_test_30574_OBJECTS) tests_test_30574_DEPENDENCIES = libdbus-gmain.la tests/libtest.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am_tests_test_thread_client_OBJECTS = \ tests/test-thread-client.$(OBJEXT) tests_test_thread_client_OBJECTS = \ $(am_tests_test_thread_client_OBJECTS) tests_test_thread_client_DEPENDENCIES = libdbus-gmain.la \ tests/libtest.la $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) am_tests_test_thread_server_OBJECTS = \ tests/test-thread-server.$(OBJEXT) tests_test_thread_server_OBJECTS = \ $(am_tests_test_thread_server_OBJECTS) tests_test_thread_server_DEPENDENCIES = libdbus-gmain.la \ tests/libtest.la $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : 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_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/dbus-gmain.Plo \ tests/$(DEPDIR)/30574.Po tests/$(DEPDIR)/test-thread-client.Po \ tests/$(DEPDIR)/test-thread-server.Po tests/$(DEPDIR)/util.Plo 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_CC_1 = 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_CCLD_1 = SOURCES = $(libdbus_gmain_la_SOURCES) $(tests_libtest_la_SOURCES) \ $(tests_test_30574_SOURCES) \ $(tests_test_thread_client_SOURCES) \ $(tests_test_thread_server_SOURCES) DIST_SOURCES = $(libdbus_gmain_la_SOURCES) $(tests_libtest_la_SOURCES) \ $(tests_test_30574_SOURCES) \ $(tests_test_thread_client_SOURCES) \ $(tests_test_thread_server_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` am__tty_colors_dummy = \ mgn= red= grn= lgn= blu= brg= std=; \ am__color_tests=no am__tty_colors = { \ $(am__tty_colors_dummy); \ if test "X$(AM_COLOR_TESTS)" = Xno; then \ am__color_tests=no; \ elif test "X$(AM_COLOR_TESTS)" = Xalways; then \ am__color_tests=yes; \ elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \ am__color_tests=yes; \ fi; \ if test $$am__color_tests = yes; then \ red=''; \ grn=''; \ lgn=''; \ blu=''; \ mgn=''; \ brg=''; \ std=''; \ fi; \ } 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 ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && echo $$files | $(am__xargs_n) 40 $(am__rm_f); }; \ } am__recheck_rx = ^[ ]*:recheck:[ ]* am__global_test_result_rx = ^[ ]*:global-test-result:[ ]* am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]* # A command that, given a newline-separated list of test names on the # standard input, print the name of the tests that are to be re-run # upon "make recheck". am__list_recheck_tests = $(AWK) '{ \ recheck = 1; \ while ((rc = (getline line < ($$0 ".trs"))) != 0) \ { \ if (rc < 0) \ { \ if ((getline line2 < ($$0 ".log")) < 0) \ recheck = 0; \ break; \ } \ else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \ { \ recheck = 0; \ break; \ } \ else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \ { \ break; \ } \ }; \ if (recheck) \ print $$0; \ close ($$0 ".trs"); \ close ($$0 ".log"); \ }' # A command that, given a newline-separated list of test names on the # standard input, create the global log from their .trs and .log files. am__create_global_log = $(AWK) ' \ function fatal(msg) \ { \ print "fatal: making $@: " msg | "cat >&2"; \ exit 1; \ } \ function rst_section(header) \ { \ print header; \ len = length(header); \ for (i = 1; i <= len; i = i + 1) \ printf "="; \ printf "\n\n"; \ } \ { \ copy_in_global_log = 1; \ global_test_result = "RUN"; \ while ((rc = (getline line < ($$0 ".trs"))) != 0) \ { \ if (rc < 0) \ fatal("failed to read from " $$0 ".trs"); \ if (line ~ /$(am__global_test_result_rx)/) \ { \ sub("$(am__global_test_result_rx)", "", line); \ sub("[ ]*$$", "", line); \ global_test_result = line; \ } \ else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \ copy_in_global_log = 0; \ }; \ if (copy_in_global_log) \ { \ rst_section(global_test_result ": " $$0); \ while ((rc = (getline line < ($$0 ".log"))) != 0) \ { \ if (rc < 0) \ fatal("failed to read from " $$0 ".log"); \ print line; \ }; \ printf "\n"; \ }; \ close ($$0 ".trs"); \ close ($$0 ".log"); \ }' # Restructured Text title. am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; } # Solaris 10 'make', and several other traditional 'make' implementations, # pass "-e" to $(SHELL), and POSIX 2008 even requires this. Work around it # by disabling -e (using the XSI extension "set +e") if it's set. am__sh_e_setup = case $$- in *e*) set +e;; esac # Default flags passed to test drivers. am__common_driver_flags = \ --color-tests "$$am__color_tests" \ $$am__collect_skipped_logs \ --enable-hard-errors "$$am__enable_hard_errors" \ --expect-failure "$$am__expect_failure" # To be inserted before the command running the test. Creates the # directory for the log if needed. Stores in $dir the directory # containing $f, in $tst the test, in $log the log. Executes the # developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and # passes TESTS_ENVIRONMENT. Set up options for the wrapper that # will run the test scripts (or their associated LOG_COMPILER, if # thy have one). am__check_pre = \ $(am__sh_e_setup); \ $(am__vpath_adj_setup) $(am__vpath_adj) \ $(am__tty_colors); \ srcdir=$(srcdir); export srcdir; \ case "$@" in \ */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \ *) am__odir=.;; \ esac; \ test "x$$am__odir" = x"." || test -d "$$am__odir" \ || $(MKDIR_P) "$$am__odir" || exit $$?; \ if test -f "./$$f"; then dir=./; \ elif test -f "$$f"; then dir=; \ else dir="$(srcdir)/"; fi; \ tst=$$dir$$f; log='$@'; \ if test -n '$(IGNORE_SKIPPED_LOGS)'; then \ am__collect_skipped_logs='--collect-skipped-logs no'; \ else \ am__collect_skipped_logs=''; \ fi; \ if test -n '$(DISABLE_HARD_ERRORS)'; then \ am__enable_hard_errors=no; \ else \ am__enable_hard_errors=yes; \ fi; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \ am__expect_failure=yes;; \ *) \ am__expect_failure=no;; \ esac; \ $(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT) # A shell command to get the names of the tests scripts with any registered # extension removed (i.e., equivalently, the names of the test logs, with # the '.log' extension removed). The result is saved in the shell variable # '$bases'. This honors runtime overriding of TESTS and TEST_LOGS. Sadly, # we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)", # since that might cause problem with VPATH rewrites for suffix-less tests. # See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'. am__set_TESTS_bases = \ bases='$(TEST_LOGS)'; \ bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \ bases=`echo $$bases` AM_TESTSUITE_SUMMARY_HEADER = ' for $(PACKAGE_STRING)' RECHECK_LOGS = $(TEST_LOGS) AM_RECURSIVE_TARGETS = check recheck TEST_SUITE_LOG = test-suite.log TEST_EXTENSIONS = @EXEEXT@ .test LOG_DRIVER = $(SHELL) $(top_srcdir)/build-aux/test-driver LOG_COMPILE = $(LOG_COMPILER) $(AM_LOG_FLAGS) $(LOG_FLAGS) am__set_b = \ case '$@' in \ */*) \ case '$*' in \ */*) b='$*';; \ *) b=`echo '$@' | sed 's/\.log$$//'`; \ esac;; \ *) \ b='$*';; \ esac am__test_logs1 = $(TESTS:=.log) am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log) TEST_LOGS = $(am__test_logs2:.test.log=.log) TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/build-aux/test-driver TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \ $(TEST_LOG_FLAGS) am__DIST_COMMON = $(srcdir)/Makefile.in \ $(top_srcdir)/build-aux/depcomp \ $(top_srcdir)/build-aux/test-driver AUTHORS COPYING README.md DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) 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@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DBUS_BINDING_TOOL = @DBUS_BINDING_TOOL@ DBUS_CFLAGS = @DBUS_CFLAGS@ DBUS_GLIB_TOOL_CFLAGS = @DBUS_GLIB_TOOL_CFLAGS@ DBUS_GLIB_TOOL_LIBS = @DBUS_GLIB_TOOL_LIBS@ DBUS_LIBS = @DBUS_LIBS@ DBUS_RUN_SESSION = @DBUS_RUN_SESSION@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FILECMD = @FILECMD@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ GLIB_THREADS_LIBS = @GLIB_THREADS_LIBS@ GREP = @GREP@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ HTML_DIR = @HTML_DIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ 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@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ 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@ 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__rm_f_notfound = @am__rm_f_notfound@ am__tar = @am__tar@ am__untar = @am__untar@ am__xargs_n = @am__xargs_n@ 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@ runstatedir = @runstatedir@ 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 = \ AUTHORS \ CONTRIBUTING.md \ COPYING \ README.md \ $(NULL) AM_CPPFLAGS = \ -I$(top_srcdir) \ -I$(top_builddir) \ $(DBUS_CFLAGS) \ $(GLIB_CFLAGS) \ $(NULL) noinst_LTLIBRARIES = \ libdbus-gmain.la \ tests/libtest.la \ $(NULL) libdbus_gmain_la_SOURCES = \ dbus-gmain.c \ dbus-gmain.h \ $(NULL) libdbus_gmain_la_LIBADD = $(DBUS_LIBS) $(GLIB_LIBS) libdbus_gmain_la_LDFLAGS = -no-undefined tests_libtest_la_SOURCES = \ tests/util.c \ tests/util.h \ $(NULL) tests_libtest_la_LIBADD = $(DBUS_LIBS) $(GLIB_LIBS) tests_libtest_la_LDFLAGS = -no-undefined tests_test_thread_server_SOURCES = \ tests/test-thread-server.c \ tests/test-thread.h \ $(NULL) tests_test_thread_server_LDADD = \ libdbus-gmain.la \ tests/libtest.la \ $(GLIB_THREADS_LIBS) \ $(GLIB_LIBS) \ $(DBUS_LIBS) \ $(NULL) tests_test_thread_client_SOURCES = \ tests/test-thread-client.c \ tests/test-thread.h \ $(NULL) tests_test_thread_client_LDADD = \ libdbus-gmain.la \ tests/libtest.la \ $(GLIB_THREADS_LIBS) \ $(GLIB_LIBS) \ $(DBUS_LIBS) \ $(NULL) tests_test_30574_SOURCES = \ tests/30574.c \ $(NULL) tests_test_30574_LDADD = \ libdbus-gmain.la \ tests/libtest.la \ $(GLIB_LIBS) \ $(DBUS_LIBS) \ $(NULL) LOG_COMPILER = $(DBUS_RUN_SESSION) -- all: all-am .SUFFIXES: .SUFFIXES: .c .lo .log .o .obj .test .test$(EXEEXT) .trs $(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) --foreign dbus-gmain/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign dbus-gmain/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__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ 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: $(am__rm_f) $(noinst_PROGRAMS) test -z "$(EXEEXT)" || $(am__rm_f) $(noinst_PROGRAMS:$(EXEEXT)=) clean-noinstLTLIBRARIES: -$(am__rm_f) $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ echo rm -f $${locs}; \ $(am__rm_f) $${locs} libdbus-gmain.la: $(libdbus_gmain_la_OBJECTS) $(libdbus_gmain_la_DEPENDENCIES) $(EXTRA_libdbus_gmain_la_DEPENDENCIES) $(AM_V_CCLD)$(libdbus_gmain_la_LINK) $(libdbus_gmain_la_OBJECTS) $(libdbus_gmain_la_LIBADD) $(LIBS) tests/$(am__dirstamp): @$(MKDIR_P) tests @: >>tests/$(am__dirstamp) tests/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) tests/$(DEPDIR) @: >>tests/$(DEPDIR)/$(am__dirstamp) tests/util.lo: tests/$(am__dirstamp) tests/$(DEPDIR)/$(am__dirstamp) tests/libtest.la: $(tests_libtest_la_OBJECTS) $(tests_libtest_la_DEPENDENCIES) $(EXTRA_tests_libtest_la_DEPENDENCIES) tests/$(am__dirstamp) $(AM_V_CCLD)$(tests_libtest_la_LINK) $(tests_libtest_la_OBJECTS) $(tests_libtest_la_LIBADD) $(LIBS) tests/30574.$(OBJEXT): tests/$(am__dirstamp) \ tests/$(DEPDIR)/$(am__dirstamp) tests/test-30574$(EXEEXT): $(tests_test_30574_OBJECTS) $(tests_test_30574_DEPENDENCIES) $(EXTRA_tests_test_30574_DEPENDENCIES) tests/$(am__dirstamp) @rm -f tests/test-30574$(EXEEXT) $(AM_V_CCLD)$(LINK) $(tests_test_30574_OBJECTS) $(tests_test_30574_LDADD) $(LIBS) tests/test-thread-client.$(OBJEXT): tests/$(am__dirstamp) \ tests/$(DEPDIR)/$(am__dirstamp) tests/test-thread-client$(EXEEXT): $(tests_test_thread_client_OBJECTS) $(tests_test_thread_client_DEPENDENCIES) $(EXTRA_tests_test_thread_client_DEPENDENCIES) tests/$(am__dirstamp) @rm -f tests/test-thread-client$(EXEEXT) $(AM_V_CCLD)$(LINK) $(tests_test_thread_client_OBJECTS) $(tests_test_thread_client_LDADD) $(LIBS) tests/test-thread-server.$(OBJEXT): tests/$(am__dirstamp) \ tests/$(DEPDIR)/$(am__dirstamp) tests/test-thread-server$(EXEEXT): $(tests_test_thread_server_OBJECTS) $(tests_test_thread_server_DEPENDENCIES) $(EXTRA_tests_test_thread_server_DEPENDENCIES) tests/$(am__dirstamp) @rm -f tests/test-thread-server$(EXEEXT) $(AM_V_CCLD)$(LINK) $(tests_test_thread_server_OBJECTS) $(tests_test_thread_server_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) -rm -f tests/*.$(OBJEXT) -rm -f tests/*.lo distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbus-gmain.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/30574.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/test-thread-client.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/test-thread-server.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/util.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @: >>$@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.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 -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.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 -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.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 -rm -rf tests/.libs tests/_libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ 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-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ 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" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags # Recover from deleted '.trs' file; this should ensure that # "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create # both 'foo.log' and 'foo.trs'. Break the recipe in two subshells # to avoid problems with "make -n". .log.trs: rm -f $< $@ $(MAKE) $(AM_MAKEFLAGS) $< # Leading 'am--fnord' is there to ensure the list of targets does not # expand to empty, as could happen e.g. with make check TESTS=''. am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck) am--force-recheck: @: $(TEST_SUITE_LOG): $(TEST_LOGS) @$(am__set_TESTS_bases); \ am__f_ok () { test -f "$$1" && test -r "$$1"; }; \ redo_bases=`for i in $$bases; do \ am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \ done`; \ if test -n "$$redo_bases"; then \ redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \ redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \ if $(am__make_dryrun); then :; else \ rm -f $$redo_logs && rm -f $$redo_results || exit 1; \ fi; \ fi; \ if test -n "$$am__remaking_logs"; then \ echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \ "recursion detected" >&2; \ elif test -n "$$redo_logs"; then \ am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \ fi; \ if $(am__make_dryrun); then :; else \ st=0; \ errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \ for i in $$redo_bases; do \ test -f $$i.trs && test -r $$i.trs \ || { echo "$$errmsg $$i.trs" >&2; st=1; }; \ test -f $$i.log && test -r $$i.log \ || { echo "$$errmsg $$i.log" >&2; st=1; }; \ done; \ test $$st -eq 0 || exit 1; \ fi @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \ ws='[ ]'; \ results=`for b in $$bases; do echo $$b.trs; done`; \ test -n "$$results" || results=/dev/null; \ all=` grep "^$$ws*:test-result:" $$results | wc -l`; \ pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \ fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \ skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \ xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \ xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \ error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \ if test `expr $$fail + $$xpass + $$error` -eq 0; then \ success=true; \ else \ success=false; \ fi; \ br='==================='; br=$$br$$br$$br$$br; \ result_count () \ { \ if test x"$$1" = x"--maybe-color"; then \ maybe_colorize=yes; \ elif test x"$$1" = x"--no-color"; then \ maybe_colorize=no; \ else \ echo "$@: invalid 'result_count' usage" >&2; exit 4; \ fi; \ shift; \ desc=$$1 count=$$2; \ if test $$maybe_colorize = yes && test $$count -gt 0; then \ color_start=$$3 color_end=$$std; \ else \ color_start= color_end=; \ fi; \ echo "$${color_start}# $$desc $$count$${color_end}"; \ }; \ create_testsuite_report () \ { \ result_count $$1 "TOTAL:" $$all "$$brg"; \ result_count $$1 "PASS: " $$pass "$$grn"; \ result_count $$1 "SKIP: " $$skip "$$blu"; \ result_count $$1 "XFAIL:" $$xfail "$$lgn"; \ result_count $$1 "FAIL: " $$fail "$$red"; \ result_count $$1 "XPASS:" $$xpass "$$red"; \ result_count $$1 "ERROR:" $$error "$$mgn"; \ }; \ output_system_information () \ { \ echo; \ { uname -a | $(AWK) '{ \ printf "System information (uname -a):"; \ for (i = 1; i < NF; ++i) \ { \ if (i != 2) \ printf " %s", $$i; \ } \ printf "\n"; \ }'; } 2>&1; \ if test -r /etc/os-release; then \ echo "Distribution information (/etc/os-release):"; \ sed 8q /etc/os-release; \ elif test -r /etc/issue; then \ echo "Distribution information (/etc/issue):"; \ cat /etc/issue; \ fi; \ }; \ please_report () \ { \ echo "Some test(s) failed. Please report this to $(PACKAGE_BUGREPORT),"; \ echo "together with the test-suite.log file (gzipped) and your system"; \ echo "information. Thanks."; \ }; \ { \ echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \ $(am__rst_title); \ create_testsuite_report --no-color; \ output_system_information; \ echo; \ echo ".. contents:: :depth: 2"; \ echo; \ for b in $$bases; do echo $$b; done \ | $(am__create_global_log); \ } >$(TEST_SUITE_LOG).tmp || exit 1; \ mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \ if $$success; then \ col="$$grn"; \ else \ col="$$red"; \ test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \ fi; \ echo "$${col}$$br$${std}"; \ echo "$${col}Testsuite summary"$(AM_TESTSUITE_SUMMARY_HEADER)"$${std}"; \ echo "$${col}$$br$${std}"; \ create_testsuite_report --maybe-color; \ echo "$$col$$br$$std"; \ if $$success; then :; else \ echo "$${col}See $(subdir)/$(TEST_SUITE_LOG) for debugging.$${std}";\ if test -n "$(PACKAGE_BUGREPORT)"; then \ please_report | sed -e "s/^/$${col}/" -e s/'$$'/"$${std}"/; \ fi; \ echo "$$col$$br$$std"; \ fi; \ $$success || exit 1 check-TESTS: @$(am__rm_f) $(RECHECK_LOGS) @$(am__rm_f) $(RECHECK_LOGS:.log=.trs) @$(am__rm_f) $(TEST_SUITE_LOG) @set +e; $(am__set_TESTS_bases); \ log_list=`for i in $$bases; do echo $$i.log; done`; \ log_list=`echo $$log_list`; \ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \ exit $$?; recheck: all @$(am__rm_f) $(TEST_SUITE_LOG) @set +e; $(am__set_TESTS_bases); \ bases=`for i in $$bases; do echo $$i; done \ | $(am__list_recheck_tests)` || exit 1; \ log_list=`for i in $$bases; do echo $$i.log; done`; \ log_list=`echo $$log_list`; \ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \ am__force_recheck=am--force-recheck \ TEST_LOGS="$$log_list"; \ exit $$? tests/test-30574.log: tests/test-30574$(EXEEXT) @p='tests/test-30574$(EXEEXT)'; \ b='tests/test-30574'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) .test.log: @p='$<'; \ $(am__set_b); \ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) @am__EXEEXT_TRUE@.test$(EXEEXT).log: @am__EXEEXT_TRUE@ @p='$<'; \ @am__EXEEXT_TRUE@ $(am__set_b); \ @am__EXEEXT_TRUE@ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ @am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \ @am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ @am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT) distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(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: check-am all-am: Makefile $(PROGRAMS) $(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: -$(am__rm_f) $(TEST_LOGS) -$(am__rm_f) $(TEST_LOGS:.log=.trs) -$(am__rm_f) $(TEST_SUITE_LOG) clean-generic: distclean-generic: -$(am__rm_f) $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || $(am__rm_f) $(CONFIG_CLEAN_VPATH_FILES) -$(am__rm_f) tests/$(DEPDIR)/$(am__dirstamp) -$(am__rm_f) tests/$(am__dirstamp) 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 \ clean-noinstPROGRAMS mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/dbus-gmain.Plo -rm -f tests/$(DEPDIR)/30574.Po -rm -f tests/$(DEPDIR)/test-thread-client.Po -rm -f tests/$(DEPDIR)/test-thread-server.Po -rm -f tests/$(DEPDIR)/util.Plo -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 -f ./$(DEPDIR)/dbus-gmain.Plo -rm -f tests/$(DEPDIR)/30574.Po -rm -f tests/$(DEPDIR)/test-thread-client.Po -rm -f tests/$(DEPDIR)/test-thread-server.Po -rm -f tests/$(DEPDIR)/util.Plo -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: check-am install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-TESTS \ check-am clean clean-generic clean-libtool \ clean-noinstLTLIBRARIES clean-noinstPROGRAMS cscopelist-am \ ctags ctags-am 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 \ recheck tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # 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: # Tell GNU make to disable its built-in pattern rules. %:: %,v %:: RCS/%,v %:: RCS/% %:: s.% %:: SCCS/s.% dbus-glib-0.114/dbus-gmain/Makefile.am0000644000175000017500000000267413515561575013160 # SPDX-License-Identifier: AFL-2.1 OR GPL-2.0-or-later EXTRA_DIST = \ AUTHORS \ CONTRIBUTING.md \ COPYING \ README.md \ $(NULL) AM_CPPFLAGS = \ -I$(top_srcdir) \ -I$(top_builddir) \ $(DBUS_CFLAGS) \ $(GLIB_CFLAGS) \ $(NULL) noinst_LTLIBRARIES = \ libdbus-gmain.la \ tests/libtest.la \ $(NULL) libdbus_gmain_la_SOURCES = \ dbus-gmain.c \ dbus-gmain.h \ $(NULL) libdbus_gmain_la_LIBADD = $(DBUS_LIBS) $(GLIB_LIBS) libdbus_gmain_la_LDFLAGS = -no-undefined tests_libtest_la_SOURCES = \ tests/util.c \ tests/util.h \ $(NULL) tests_libtest_la_LIBADD = $(DBUS_LIBS) $(GLIB_LIBS) tests_libtest_la_LDFLAGS = -no-undefined TESTS = \ tests/test-30574 \ $(NULL) noinst_PROGRAMS = \ tests/test-30574 \ tests/test-thread-server \ tests/test-thread-client \ $(NULL) tests_test_thread_server_SOURCES = \ tests/test-thread-server.c \ tests/test-thread.h \ $(NULL) tests_test_thread_server_LDADD = \ libdbus-gmain.la \ tests/libtest.la \ $(GLIB_THREADS_LIBS) \ $(GLIB_LIBS) \ $(DBUS_LIBS) \ $(NULL) tests_test_thread_client_SOURCES = \ tests/test-thread-client.c \ tests/test-thread.h \ $(NULL) tests_test_thread_client_LDADD = \ libdbus-gmain.la \ tests/libtest.la \ $(GLIB_THREADS_LIBS) \ $(GLIB_LIBS) \ $(DBUS_LIBS) \ $(NULL) tests_test_30574_SOURCES = \ tests/30574.c \ $(NULL) tests_test_30574_LDADD = \ libdbus-gmain.la \ tests/libtest.la \ $(GLIB_LIBS) \ $(DBUS_LIBS) \ $(NULL) LOG_COMPILER = $(DBUS_RUN_SESSION) -- dbus-glib-0.114/dbus-gmain/tests/0000775000175000017500000000000014764624122012332 5dbus-glib-0.114/dbus-gmain/tests/test-thread-server.c0000644000175000017500000001343413515561575016156 /* * Copyright © 2003-2006 Red Hat Inc. * Copyright © 2006-2018 Collabora Ltd. * * SPDX-License-Identifier: AFL-2.1 OR GPL-2.0-or-later * * 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 * */ #ifdef HAVE_CONFIG_H #include #endif #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_GMAIN_FUNCTION_NAME (set_up_connection) (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; 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_GMAIN_FUNCTION_NAME (set_up_server) (server, NULL); loop = g_main_loop_new (NULL, FALSE); g_main_loop_run (loop); return 0; } dbus-glib-0.114/dbus-gmain/tests/test-thread.h0000644000175000017500000000003113233575561014641 #define N_TEST_THREADS 5 dbus-glib-0.114/dbus-gmain/tests/test-thread-client.c0000644000175000017500000000622013515561575016121 /* * Copyright © 2003 Red Hat Inc. * Copyright © 2006-2018 Collabora Ltd. * * SPDX-License-Identifier: AFL-2.1 OR GPL-2.0-or-later * * 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 * */ #ifdef HAVE_CONFIG_H #include #endif #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; 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_GMAIN_FUNCTION_NAME (set_up_connection) (connection, NULL); for (i = 0; i < N_TEST_THREADS; i++) { g_thread_new ("client thread", thread_func, GINT_TO_POINTER (i)); } loop = g_main_loop_new (NULL, FALSE); g_main_loop_run (loop); return 0; } dbus-glib-0.114/dbus-gmain/tests/30574.c0000644000175000017500000001005413515561575013103 /* * Copyright © 2010-2012 Mike Gorse * Copyright © 2011-2018 Collabora Ltd. * * SPDX-License-Identifier: AFL-2.1 OR GPL-2.0-or-later * * 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 * */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include #include "util.h" 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_GMAIN_FUNCTION_NAME (set_up_connection) (bus, NULL); g_main_loop_quit (closure->loop); } static DBusMessage * send_and_allow_reentry (DBusConnection * bus, DBusMessage * message, dbus_bool_t switch_after_send) { DBusPendingCall *pending; SpiReentrantCallClosure closure; closure.loop = g_main_loop_new (main_context, FALSE); DBUS_GMAIN_FUNCTION_NAME (set_up_connection) (bus, (switch_after_send ? NULL : main_context)); if (!dbus_connection_send_with_reply (bus, message, &pending, 3000)) { DBUS_GMAIN_FUNCTION_NAME (set_up_connection) (bus, NULL); return NULL; } dbus_pending_call_set_notify (pending, set_reply, (void *) &closure, NULL); if (switch_after_send) DBUS_GMAIN_FUNCTION_NAME (set_up_connection) (bus, main_context); g_main_loop_run (closure.loop); g_main_loop_unref (closure.loop); dbus_pending_call_unref (pending); return closure.reply; } static void send_test_message (dbus_bool_t switch_after_send) { DBusMessage *message, *reply; const char *str; DBusError error; dbus_error_init (&error); message = dbus_message_new_method_call ("org.freedesktop.DBus", "/org/freedesktop/DBus", DBUS_INTERFACE_DBUS, "GetId"); reply = send_and_allow_reentry (bus, message, switch_after_send); if (!reply) { fprintf(stderr, "Got no reply from send_and_allow_reentry\n"); exit(1); } if (dbus_message_get_type (reply) == DBUS_MESSAGE_TYPE_ERROR) { char *err = NULL; dbus_message_get_args (reply, NULL, DBUS_TYPE_STRING, &err, DBUS_TYPE_INVALID); fprintf (stderr, "Got error: %s\n", err); exit(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); } dbus_message_unref (reply); dbus_message_unref (message); } int main(int argc, const char *argv[]) { DBusError error; main_context = g_main_context_new (); dbus_error_init (&error); bus = dbus_bus_get_private (DBUS_BUS_SESSION, &error); if (!bus) { fprintf(stderr, "Couldn't connect to bus: %s\n", error.name); return 1; } DBUS_GMAIN_FUNCTION_NAME (set_up_connection) (bus, NULL); send_test_message (FALSE); send_test_message (FALSE); send_test_message (TRUE); test_run_until_disconnected (bus, NULL); dbus_connection_unref (bus); dbus_shutdown (); g_main_context_unref (main_context); return 0; } dbus-glib-0.114/dbus-gmain/tests/util.h0000644000175000017500000000225213515561575013404 /* Regression test utilities * * Copyright © 2009-2018 Collabora Ltd. * Copyright © 2009-2011 Nokia Corporation * * SPDX-License-Identifier: AFL-2.1 OR GPL-2.0-or-later * * 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 (DBusConnection *connection, GMainContext *context); #endif dbus-glib-0.114/dbus-gmain/tests/util.c0000644000175000017500000000272413515561575013403 /* Regression test utilities * * Copyright © 2009-2018 Collabora Ltd. * Copyright © 2009-2011 Nokia Corporation * * SPDX-License-Identifier: AFL-2.1 OR GPL-2.0-or-later * * 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 */ #ifdef HAVE_CONFIG_H #include #endif #include "util.h" void test_run_until_disconnected (DBusConnection *connection, GMainContext *context) { g_printerr ("Disconnecting... "); dbus_connection_set_exit_on_disconnect (connection, FALSE); dbus_connection_close (connection); while (dbus_connection_get_is_connected (connection)) { g_printerr ("."); g_main_context_iteration (context, TRUE); } g_printerr (" disconnected\n"); } dbus-glib-0.114/dbus-bus-introspect.xml0000644000175000017500000000443513233560240013512 dbus-glib-0.114/CONTRIBUTING.md0000644000175000017500000001371214027353113011304 # Contributing to dbus-glib The short version is "don't". Please contribute to (and use) a better project instead, for example GDBus in GLib's GIO module. However, if you are really sure that dbus-glib is the project to which you want to be contributing, read on. ## Source code repository and issue tracking dbus-glib is hosted by freedesktop.org. The source code repository, issue tracking and merge requests are provided by freedesktop.org's Gitlab installation: ## Making changes If you are making changes that you wish to be incorporated upstream, please do as small commits to your local git tree that are individually correct, so there is a good history of your changes. The first line of the commit message should be a single sentence that describes the change, optionally with a prefix that identifies the area of the code that is affected. The body of the commit message should describe what the patch changes and why, and also note any particular side effects. This shouldn't be empty on most of the cases. It shouldn't take a lot of effort to write a commit message for an obvious change, so an empty commit message body is only acceptable if the questions "What?" and "Why?" are already answered on the one-line summary. The lines of the commit message should have at most 76 characters, to cope with the way git log presents them. See [notes on commit messages](https://who-t.blogspot.com/2009/12/on-commit-messages.html), [A Note About Git Commit Messages](https://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html) or [How to Write a Git Commit Message](https://chris.beams.io/posts/git-commit/) for recommended reading on writing high-quality commit messages. Your patches should also include a Signed-off-by line with your name and email address, indicating that your contribution follows the [Developer's Certificate of Origin](https://developercertificate.org/). If you're not the patch's original author, you should also gather S-o-b's by them (and/or whomever gave the patch to you.) The significance of this is that it certifies that you created the patch, that it was created under an appropriate open source license, or provided to you under those terms. This lets us indicate a chain of responsibility for the copyright status of the code. We won't reject patches that lack S-o-b, but it is strongly recommended. When you consider changes ready for merging to mainline: * create a personal fork of on freedesktop.org Gitlab * push your changes to your personal fork as a branch * create a merge request at ## Automated tests For nontrivial changes please try to extend the test suite to cover it. The test infrastructure is in `test/core/`. If possible, use a GTester-style test like `registrations.c`; or if necessary, add things to the giant catch-all test, `test-dbus-glib.c`. Run `make check` to run the test suite. ## Coding style Please match the existing code style (Emacs: "gnu"). ## Licensing Please match the existing licensing (a dual-license: AFL-2.1 or GPL-2+, recipient's choice). Entirely new modules can be placed under a more permissive license: to avoid license proliferation, our preferred permissive license is the variant of the MIT/X11 license used by the Expat XML library (for example see the top of tools/ci-build.sh). ## Conduct As a freedesktop.org project, dbus follows the Contributor Covenant, found at: Please conduct yourself in a respectful and civilised manner when interacting with community members on mailing lists, IRC, or bug trackers. The community represents the project as a whole, and abusive or bullying behaviour is not tolerated by the project. ## Versioning Version 0.N, where *N* is even (divisible by 2), is a real release. Point releases can be versioned 0.N.M where *N* is even and *M* is any number greater than zero. Version 0.(N+1), where *N* is even (divisible by 2), identifies a development snapshot leading to version 0.(N+2). Odd-numbered versions should never be used as releases. ## Contributing to dbus-gmain The `dbus-gmain` subproject is shared by `dbus-glib` and `dbus-python`, and has its own contributing guidelines (which are similar to these). Please see [dbus-gmain/CONTRIBUTING.md](dbus-gmain/CONTRIBUTING.md) for details. ## Information for maintainers This section is not directly relevant to infrequent contributors. ### dbus-gmain dbus-gmain is maintained via `git subtree`. To update, assuming you have a checkout of the dbus-gmain branch of the dbus-glib repository in ../dbus-gmain: git subtree pull -P dbus-gmain ../dbus-gmain HEAD ### Committing other people's patches 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 ..." Nontrivial patches should always go through Gitlab for peer review, so you should have an issue number or a merge request ID to refer to. ### Making a release dbus-glib uses an even-stable odd-development release numbering system. The current number in configure.ac should be odd, except when releasing. 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` * edit NEWS, summarize notable changes since the last release * `./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, quoting the notable changes from NEWS. dbus-glib-0.114/README0000644000175000017500000000052213233560240007725 dbus-glib is a deprecated D-Bus binding for GLib. dbus-glib receives minimal maintenance and security fixes for the benefit of projects like Telepathy and NetworkManager that still rely on it, but should not be used in new projects (and existing projects should try to move away from it, too). Please use GDBus, part of GLib since 2.26. dbus-glib-0.114/NEWS0000644000175000017500000006161314764623565007600 dbus-glib is deprecated, please use GDBus in new GLib-based projects. dbus-glib 0.114 (2025-03-13) ============================ Enhancements: • Fix bug reporting URL (Simon McVittie) • Move license documents to a REUSE-style LICENSES/ directory (Simon McVittie) • Fix numerous deprecation warnings (Simon McVittie) Bug fixes: • Avoid naming a variable 'bool', which is a reserved word in C23 and caused compilation to fail with gcc-15 (Debian#1096507, Simon McVittie) • CI updates (Simon McVittie) dbus-glib 0.112 (2021-03-26) ============================ The “haunted teacup” release. dbus-glib version control is now hosted on freedesktop.org's Gitlab installation, and bug reports and feature requests have switched from Bugzilla bugs (indicated by "fd.o #nnn") to Gitlab issues ("dbus-glib#nnn") and merge requests ("dbus-glib!nnn"). See README and CONTRIBUTING.md for more details. Dependencies: • dbus 1.8 was already required, but is more strongly required now: the workarounds that were used to run continuous integration with dbus 1.6 on Ubuntu 14.04 'trusty' have been removed. (Note that dbus 1.8 has already reached end-of-life for security support, and newer dbus stable branches are strongly recommended.) • pkg-config 0.28 is required when building from git Enhancements: • Rewrite CONTRIBUTING.md document, based on Wayland's equivalent (Simon McVittie, with thanks to Ander Conselvan de Oliveira, Bryce Harrington, Eric Engestrom, Pekka Paalanen and Daniel Stone for their contributions to the equivalent file in Wayland) • A generated ChangeLog file, which made up a significant proportion of the size of source tarball releases, is no longer included. Please refer to the git repository at https://gitlab.freedesktop.org/dbus/dbus-glib for detailed change history. (Simon McVittie) • Improve man page (dbus-glib!1, Alan Coopersmith) • Add test coverage for fd.o#80557 (dbus-glib#1, Simon McVittie) • Use more modern GLib assertions in unit tests (dbus-glib#16, dbus-glib!3, dbus-glib!4; Simon McVittie) • Improve continuous integration to be run by GitLab in addition to Travis-CI (Simon McVittie) • Add clearer license information using SPDX-License-Identifier (Simon McVittie) Fixes: • Allow glib-genmarshal to be overridden with `./configure GLIB_GENMARSHAL=/path/to/glib-genmarshal`, for cross-compilation (dbus-glib!2, Yann E. MORIN) • Avoid a double-free in dbus-binding-tool for certain inputs, possibly involving nested introspection data structures (dbus-glib#9, Zhipeng Xie) • Report a better error for excessive recursion depth or unsupported data types (dbus-glib#1, Simon McVittie) • Map the 15 most-recently-added DBusGError members to their corresponding D-Bus error names (dbus-glib#1, Simon McVittie) • Mark all documented symbols as deprecated (Simon McVittie) • Fix unit test failures during distcheck by enabling assertions (Simon McVittie) • Fix a core dump during installed-tests by not attempting to close a shared DBusConnection (Simon McVittie) dbus-glib 0.110 (2018-01-29) ============================ The “sphere tank” release. Dependencies: • GLib 2.40 is required Enhancements: • The GLib main-loop glue, "dbus-gmain", is now available as a separate subproject (the dbus-gmain branch in dbus-glib's git repository) for embedding in larger projects like dbus-glib and dbus-python via the `git subtree` or `git submodule` commands. This removes dbus-python's dependency on the rest of dbus-glib. Fixes: • autogen.sh can now detect gtk-doc >= 1.26. • More files have per-file copyright information. dbus-glib 0.108 (2016-09-09) ============================ The “toxic chair” release. Fixes: • Use dbus-run-session instead of dbus-launch for tests. dbus-glib 0.106 (2016-01-14) ============================ The “crumbling vestige” release. Fixes: • Stop testing G_HAVE_INLINE, which ceased to work in GLib 2.47.2 and wasn't meant to be API anyway. Instead, rely on "static inline" doing the right thing. On pre-C99 compilers, this relies on defining inline to __inline, __inline__ or the empty string if the compiler requires it, which it has done since 2000. (fd.o #93513, Colin Watson) • Stop calling g_mem_profile() in the tests, which no longer does anything and caused the tests to fail by issuing a warning (Simon McVittie) • Slightly modernize build system, and remove a weird cross-directory dependency which was breaking distcheck (Simon McVittie) • Stop distributing generated marshallers in the tarball (Simon McVittie) dbus-glib 0.104 (2015-02-09) ============================ The “smoke and ashes” release. Deprecations: • Document the entire library as deprecated (Simon McVittie, Philip Withnall) Dependencies: • libdbus 1.8 is required • GLib 2.32 is required Enhancements: • The libdbus 1.8 dependency means we can now document that dbus_g_thread_init() is idempotent and thread-safe (fd.o #54770, Simon McVittie) • Use g_cclosure_marshal_generic for all marshalling (fd.o #64214, Simon McVittie) Fixes: • Allow timeouts to be migrated from one main context to another without an assertion failure (fd.o #30574, Mike Gorse) • Don't trip a libdbus fatal warning if a Unix fd or other unsupported type is encountered in a message (fd.o #80557, Alban Crequy) • Make the tests pass with newer GLib by not removing removed sources (fd.o #83530, Simon McVittie) • Fix some typos in the documentation (fd.o #45686, Jiří Klimeš) • Make the Autotools setup less awful (fd.o #58698; Rafał Mużyło, Simon McVittie) dbus-glib 0.102 (2014-02-12) ============================ The “I've come to the conclusion that Debian should choose Russ Allbery to be its new init system” release. [1] Enhancements: • Add dbus_g_method_invocation_get_connection (fd.o #55729, Dan Williams) • Add dbus_g_connection_open_private (fd.o #55730, Dan Williams) • Better regression tests (fd.o #23633, fd.o #40711, fd.o #41129, fd.o #51511, fd.o #68603; Simon McVittie, Dan Williams) • Get rid of more dead code (fd.o #40711, Simon McVittie) • dbus-binding-tool: check validity of names (fd.o #7909, Simon McVittie) Fixes: • dbus_g_value_build_g_variant: treat GValues containing (G_TYPE_STRING, NULL) or (G_TYPE_STRV, NULL) as empty string or empty array instead of asserting (fd.o #71811, Xavier Claessens) • Upload documentation correctly (Simon McVittie) • Fix under-linking (fd.o #68601, Simon McVittie) [1] credit: https://twitter.com/keybuk/status/433058371290157056 dbus-glib 0.100.2 (2013-02-25) ============================== The "I would prefer lengthier studies, and fewer explosions" release. This release is a respin of the 0.100.1 tarball to drop some old, broken versions of generated documentation files (fd.o #55830). There are no source changes. dbus-glib 0.100.1 (2013-02-15) ============================== Security: • Sebastian Krahmer discovered and published an authentication bypass vulnerability in pam_fprintd, caused by a bug in dbus-glib. It is possible that other users of dbus-glib can be exploited in the same way. CVE-2013-0292 has been allocated for this vulnerability. This vulnerability is fixed in dbus-glib version 0.100.1 by git commit 166978a. All users of dbus-glib should upgrade. (fd.o #60916; Colin Walters, Simon McVittie) dbus-glib 0.100 (2012-06-25) ============================ The "Flabbergasted Jerome" release. Enhancements: • Support building on Android with androgenizer (fd.o #42532, Derek Foreman) • Respect NOCONFIGURE=1 in autogen.sh (Colin Walters) Fixes: • Fix several GVariant reference leaks in dbus_g_value_parse_variant (fd.o #41125, Simon McVittie) • Don't crash if an error code is out of range for its domain or has a negative code (fd.o #40151; David Woodhouse, Simon McVittie) • Fix compilation with -Werror=format-security (Matthias Klose) • Don't crash if dbus_g_proxy_new_for_peer() is used to talk to the dbus-daemon (fd.o #41126, Simon McVittie) dbus-glib 0.98 (2011-09-30) =========================== The "undocumented feature" release. • Fix the documentation, a lot. We have nearly 100% coverage now. (fd.o #37793, smcv) • In specialized collection iterators, check that the type is correct; g_critical and return harmlessly, rather than crashing, if not (smcv) • If library users register specialized GTypes, warn if their vtables have missing callbacks which would cause accessors to crash (smcv) • Fix production of documentation out-of-tree with newer gtk-doc (smcv) • Simplify invoke_object_method() and OOM handling in dbus-gobject (fd.o #35767, smcv) dbus-glib 0.96 (2011-09-21) =========================== The "terminating at New Cross Gate" release. • Fix a regression in marshalling GObject instances as object paths, which broke NetworkManager (fd.o #37852, Debian #628890; Simon McVittie) • Fix crashes when sending a message when disconnected from D-Bus but still working through our backlog of incoming messages, similar to fd.o #12675 (fd.o #38406, Simon McVittie) • Cope more gracefully, with a critical warning instead of a memory leak, if programmer error causes G_VALUE_COLLECT to fail (fd.o #38406, NB#86280, NB#180486; Kimmo Hämäläinen, Christian Dywan, Simon McVittie) • Avoid an assertion failure when unregistering a proxy if GetNameOwner failed (fd.o #38408, NB#116862; Janne Karhunen, Simon McVittie) • Don't report various programmer errors as "out of memory"; raise suitable critical warnings instead, and don't leak memory (fd.o #35767, fd.o #35766; Simon McVittie) • If a remote process sends a wrong method call on the Properties interface, send back an error reply, instead of warning on stderr and not replying (fd.o #35766, Simon McVittie) • Show a warning if dbus_g_method_return fails to marshal something (fd.o #29884, NB#180486; Christian Dywan, Simon McVittie) • Remove remnants of i18n (fd.o #36428, Simon McVittie) • Remove dead code (NB#180486; Christian Dywan) dbus-glib 0.94 (2011-06-01) =========================== The "Norwegian Blue" release. Dependencies: * dbus 1.2.16 is required (dbus 1.4 is recommended) * GIO 2.26 (packaged with GLib) is required Fixes: * fd.o #10890: remove Doxygen support, to clarify that gtk-doc is the way to get dbus-glib documentation (Simon McVittie) * fd.o #22667: improve documentation (Will Thompson) * fd.o #22854: update libtool versioning (Simon McVittie) * fd.o #23616: document which DBusGProxy methods stop working on ::destroy, and improve precondition checks (Simon McVittie) * fd.o #26952: add infrastructure to upload tarballs and documentation (Simon McVittie) * fd.o #27193, Gentoo #254192: don't use ${SHELL} to run shell scripts (Simon McVittie) * fd.o #27598: allow signals and properties to be annotated (Christian Dywan, Simon McVittie) * fd.o #29884: improve error handling in various places (Christian Dywan) * fd.o #30171: check validity of more arguments, don't report "out of memory" or "should not have been reached" if an invalid string or boolean is given, and abandon broken containers more gracefully (Simon McVittie) * fd.o #30274: allow underscores in error names (Christian Dywan) * fd.o #32087: if an object is on more than one connection, emit signals on all of them; if it's unregistered, only unregister it from the requested connection (Simon McVittie) * fd.o #32351: fix memory leaks in dbus-binding-tool (Christian Dywan) * fd.o #33145, fd.o #37789: improve error output if dependencies are too old (Simon McVittie) * fd.o #33646: don't duplicate match rules (Alban Crequy) * fd.o #34282: fix linking order for modern ld (Robert Ancell) * fd.o #35115: fix ability to switch a DBusConnection from one GMainContext to another (Mike Gorse) * fd.o #35952: forbid a ReturnVal annotation after the first OUT , which had never worked correctly anyway (Simon McVittie) * fd.o #36216: remove false claim that we use Introspect() at runtime, and document more error cases (Simon McVittie) * fd.o #36428: remove unused support for translated messages (Simon McVittie) * fd.o #36793: don't corrupt internal data if a GObject is registered twice on the same (connection, path) tuple, and fix out-of-bounds reading (Simon McVittie) * fd.o #36811: fix multiple signal emissions if an object is removed from all of its locations then re-exported, and a memory leak if an exported object is disposed (Simon McVittie) * fd.o #37060: rebuild everything if gcov is enabled/disabled, or if gcc is upgraded while gcov is enabled (Simon McVittie) * fd.o #37062: fail to build if our assumptions about int sizes are not met, and remove useless variables detected by gcc 4.6 (Simon McVittie) * fd.o #37790: remove empty "tests" which don't test anything (Simon McVittie) * fd.o #37795: log the error message if object registration fails (Dan Williams) * fd.o #37812: delete temporary file if dbus-binding-tool fails (Simon McVittie) dbus-glib 0.92 (2010-11-10) =========================== Fixes: * check for GLib 2.26 correctly dbus-glib 0.90 (2010-11-07) =========================== Dependencies: * GLib 2.26 is required Enhancements: * Add DBusGObjectPath, DBusGSignature typedefs * Give specialized GArrays iteration/appending support * Test dbus_g_value_build_g_variant for various fixed arrays * Remove gcov decoder, which hasn't worked since dbus-glib left libdbus * replace remnants of gcov support with lcov.am from telepathy-glib * fd.o #30428: add dbus_g_value_parse_g_variant * dbus_g_type_specialized_map_append: document that the value contents are stolen Fixes: * Remove unused method attribute variables in introspect_interfaces * Dereference main loop once variant recursion test is done * Plug leak of expected_str in threaded server test * Free path string after emission in in statemachine server example * Always free method_c_name in dbus binding tool * Free looked up function name in dbus binding tool * Fix switching a connection's GMainContext * dbus_g_value_build_g_variant: cope with empty arrays, maps * Build test/ before its subdirs dbus-glib 0.88 (2010-08-12) =========================== First note, and most importantly, this fixes a security issue: https://bugzilla.redhat.com/show_bug.cgi?id=585394 Note that affected system services will need to be rebuilt (but not necessarily patched). Dependencies: * GLib 2.24 is required Security: * CVE-2010-1172: Respect property access flags for writing, allow disabling for reads Enhancements: * Allow duplicate object path registrations for different connections * fd.o #28715: Add dbus_g_value_build_g_variant() * Support DBUS_TYPE_G_SIGNATURE * fd.o #27958: dbus_g_error_domain_register: rewrite the documentation Other fixes: * Refer to dbus_g_connection_flush rather than the plain dbus call * core: don't pass malformed error interface to dbus (rh#581794) * Fix lookup of regular properties when shadow properties are used * Don't use the identifier "interface" in public headers * Use AC_CANONICAL_HOST, not _TARGET * Use EXEEXT so that we satisfy dependencies when cross-compiling * Fix linking of tests on Windows * Put the G_OS_WIN32 check where it can be defined. * add mising DBUS_TYPE_G_* to the doc * Bug 14579: remove pending call from hash table before cancelling it * Add various tests etc. to .gitignore dbus-glib 0.86 (2010-03-24) =========================== Enhancements: * [configure.ac] Use AM_SILENT_RULES if available * core: allow duplicate property names on GInterfaces * core: performance optimization for object info lookup * turn the gtk-doc documentation into buildable shape Fixes: * Fix hyphenated error codes * [dbus-gobject.c] Trivial compiler warning fixes * Free errors returned by method implementations dbus-glib 0.84 (2010-01-27) =========================== Enhancements: * Import dbus-bus-introspect.xml upstream * Bug 19623 - Add dbus_g_bus_get_private * Support duplicate object registrations * fd.o #20936: Update FSF address Fixes: * dbus-gvalue: set an error when demarshal_basic doesn't recognize type * Fix bad NAME in dbus-binding-tool man page * fd.o #25119: Don't leak DBusGMethodInvocation for no-reply calls dbus-glib 0.82 (2009-07-16) =========================== Enhancements: * Bug 20343 - Add a man page for dbus-binding-tool * Bug 14183 - Listen to NameOwnerChanged using arg0 matching * Bug 19927 - Use const for GError * param we're not modifying * Clean up some compilation warnings * Bug 21362 - Remove use of deprecated symbols * Bug 13908: make dbus_g_type_specialized_init() safe for library users to call * add --with-dbus-binding-tool option to use an external dbus-binding-tool * Bug 16776: teach dbus_g_method_return_error about DBUS_GERROR * Remove all sorts of libdbus cruft from configure.ac * dbus_g_type_specialized_init: make some effort at being thread-safe * fd.o #21219: implement unregistration of objects * fd.o #13908: silently initialize specialized types whenever required Fixes: * Bug 18294 - Be defensive about a possibly NULL property string * Bug 21753 - Correctly initialize GValues in dbus-binding-tool generated code * Use -fno-strict-aliasing by default * Add missing prototype for dbus_g_connection_unregister_g_object * Fix format-security warning * Bug 22244 - Only include , not individual headers * build: fix undefined macro: AM_PROG_LIBTOOL with recent libtool * 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 * fd.o #5688: don't assert when exported object is destroyed after D-Bus connection closes * Use g_strdup instead of strdup in dbus_g_method_get_sender * Bug 20879 - Use --skip-source argument for glib-genmarshal dbus-glib 0.80 (2009-02-02) =========================== Fixes: * Bug 19441: Don't send replies for messages explicitly not requesting one * Bug 19065 - handle nested nodes in dbus-binding-tool * Bug 19325 - parallel build fix * Bug 19259: Always use /etc/bash_completion.d * Bug 19647: Move test-types inside run-test to avoid dep on existing session bus * Fix linking order so -Wl,--as-needed works * Use the provided interface for org.freedesktop.DBus.Properties.GetAll call. 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. dbus-glib-0.114/INSTALL0000644000175000017500000002134513233560240010104 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.114/COPYING0000644000175000017500000000132614714624625010120 The 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. In SPDX terms, this is: SPDX-License-Identifier: AFL-2.1 OR GPL-2.0-or-later Exceptions are noted in individual source files. In particular: * dbus/dbus-bash-completion-helper.c is licensed more restrictively: it is under GPL-2.0-or-later, without the AFL-2.1 dual-license option. See that file for details. * Some source files are more permissively licensed, with a LGPL-2.1-or-later or MIT option, or under the MIT license only. See individual source files for details. Please see the files in LICENSES/ for full license text. dbus-glib-0.114/AUTHORS0000644000175000017500000000143313233560240010117 Ross 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.114/dbus-glib-1.pc.in0000664000175000017500000000043614717151020012012 prefix=@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.114/dbus-glib-1-uninstalled.pc.in0000644000175000017500000000050313233560240014323 prefix=@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.114/config.h.in0000664000175000017500000000465214764623731011121 /* config.h.in. Generated from configure.ac by autoheader. */ /* Enable bash completion */ #undef DBUS_BASH_COMPLETION /* Build test code */ #undef DBUS_BUILD_TESTS /* Defined to the gcc version if gcov is enabled, to force a rebuild due to config.h changing */ #undef DBUS_GCOV_ENABLED /* Warn on use of APIs added after GLib 2.40 */ #undef GLIB_VERSION_MAX_ALLOWED /* Warn on use of APIs deprecated before GLib 2.32 */ #undef GLIB_VERSION_MIN_REQUIRED /* Disable GLib assertion macros */ #undef G_DISABLE_ASSERT /* Disable GLib public API sanity checking */ #undef G_DISABLE_CHECKS /* 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 /* 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_STDIO_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 where libtool stores uninstalled libraries. */ #undef LT_OBJDIR /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the home page for this package. */ #undef PACKAGE_URL /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Define to 1 if all of the C89 standard headers exist (not just the ones required in a freestanding environment). This macro is provided for backward compatibility; new code need not use it. */ #undef STDC_HEADERS /* Version number of package */ #undef VERSION #define DBUS_GMAIN_FUNCTION_NAME(name) _dbus_g_ ## name dbus-glib-0.114/Makefile.in0000664000175000017500000010231514764623731011136 # Makefile.in generated by automake 1.17 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2024 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__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) am__rm_f = rm -f $(am__rm_f_notfound) am__rm_rf = rm -rf $(am__rm_f_notfound) 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 = . 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) DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \ $(am__configure_deps) $(am__DIST_COMMON) 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_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : 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_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-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 \ tags-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 ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && echo $$files | $(am__xargs_n) 40 $(am__rm_f); }; \ } 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_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ cscope distdir distdir-am dist dist-all distcheck am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) \ config.h.in # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` am__DIST_COMMON = $(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)/build-aux/compile \ $(top_srcdir)/build-aux/config.guess \ $(top_srcdir)/build-aux/config.sub \ $(top_srcdir)/build-aux/install-sh \ $(top_srcdir)/build-aux/ltmain.sh \ $(top_srcdir)/build-aux/missing \ $(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 INSTALL NEWS README build-aux/compile \ build-aux/config.guess build-aux/config.sub \ build-aux/install-sh build-aux/ltmain.sh build-aux/missing 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 -700 -exec chmod u+rwx {} ';' \ ; rm -rf "$(distdir)" \ || { sleep 5 && rm -rf "$(distdir)"; }; \ else :; fi am__post_remove_distdir = $(am__remove_distdir) 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 = -9 DIST_TARGETS = dist-gzip # Exists only to be overridden by the user if desired. AM_DISTCHECK_DVI_TARGET = dvi distuninstallcheck_listfiles = find . -type f -print am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' distcleancheck_listfiles = \ find . \( -type f -a \! \ \( -name .nfs* -o -name .smb* -o -name .__afs* \) \) -print 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@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DBUS_BINDING_TOOL = @DBUS_BINDING_TOOL@ DBUS_CFLAGS = @DBUS_CFLAGS@ DBUS_GLIB_TOOL_CFLAGS = @DBUS_GLIB_TOOL_CFLAGS@ DBUS_GLIB_TOOL_LIBS = @DBUS_GLIB_TOOL_LIBS@ DBUS_LIBS = @DBUS_LIBS@ DBUS_RUN_SESSION = @DBUS_RUN_SESSION@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FILECMD = @FILECMD@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ GLIB_THREADS_LIBS = @GLIB_THREADS_LIBS@ GREP = @GREP@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ HTML_DIR = @HTML_DIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ 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@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ 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@ 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__rm_f_notfound = @am__rm_f_notfound@ am__tar = @am__tar@ am__untar = @am__untar@ am__xargs_n = @am__xargs_n@ 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@ runstatedir = @runstatedir@ 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-gmain dbus tools test doc DIST_SUBDIRS = dbus-gmain dbus tools test doc m4 pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = $(GLIB_PC) DISTCLEANFILES = \ $(GLIB_PC) EXTRA_DIST = \ CONTRIBUTING.md \ LICENSES/AFL-2.1.txt \ LICENSES/GPL-2.0-or-later.txt \ LICENSES/LGPL-2.1-or-later.txt \ LICENSES/MIT.txt \ NEWS \ dbus-bus-introspect.xml \ dbus-glib-1.pc.in # Creating ChangeLog from git log: DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc --enable-checks --enable-tests --enable-asserts 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) --foreign'; \ $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign 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__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles);; \ esac; $(srcdir)/tools/lcov.am $(am__empty): $(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 @test -f $@ || rm -f stamp-h1 @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1 stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status $(AM_V_at)rm -f stamp-h1 $(AM_V_GEN)cd $(top_builddir) && $(SHELL) ./config.status config.h $(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) $(AM_V_GEN)($(am__cd) $(top_srcdir) && $(AUTOHEADER)) $(AM_V_at)rm -f stamp-h1 $(AM_V_at)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. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ 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" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) 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; \ $(am__define_uniq_tagged_files); \ 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-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ 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" cscope: cscope.files test ! -s cscope.files \ || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) clean-cscope: -rm -f cscope.files cscope.files: clean-cscope cscopelist cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -rm -f cscope.out cscope.in.out cscope.po.out cscope.files distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) $(am__remove_distdir) $(AM_V_at)$(MKDIR_P) "$(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) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz $(am__post_remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 $(am__post_remove_distdir) dist-lzip: distdir tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz $(am__post_remove_distdir) dist-xz: distdir tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz $(am__post_remove_distdir) dist-zstd: distdir tardir=$(distdir) && $(am__tar) | zstd -c $${ZSTD_CLEVEL-$${ZSTD_OPT--19}} >$(distdir).tar.zst $(am__post_remove_distdir) dist-tarZ: distdir @echo WARNING: "Support for distribution archives compressed with" \ "legacy program 'compress' is deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__post_remove_distdir) dist-shar: distdir @echo WARNING: "Support for shar distribution archives is" \ "deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz $(am__post_remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__post_remove_distdir) dist dist-all: $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' $(am__post_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*) \ eval GZIP= gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(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*) \ eval GZIP= gzip -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ *.tar.zst*) \ zstd -dc $(distdir).tar.zst | $(am__untar) ;;\ esac chmod -R a-w $(distdir) chmod u+w $(distdir) mkdir $(distdir)/_build $(distdir)/_build/sub $(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/sub \ && ../../configure \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ --srcdir=../.. --prefix="$$dc_install_base" \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) $(AM_DISTCHECK_DVI_TARGET) \ && $(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__post_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: -$(am__rm_f) $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || $(am__rm_f) $(CONFIG_CLEAN_VPATH_FILES) -$(am__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." 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: $(am__recursive_targets) all install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ am--refresh check check-am clean clean-cscope clean-generic \ clean-libtool cscope cscopelist-am ctags ctags-am dist \ dist-all dist-bzip2 dist-gzip dist-lzip dist-shar dist-tarZ \ dist-xz dist-zip dist-zstd 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-am uninstall uninstall-am \ uninstall-pkgconfigDATA .PRECIOUS: Makefile %.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 doc/reference/html/ \ dbus.freedesktop.org:/srv/dbus.freedesktop.org/www/doc/@PACKAGE@/ check-valgrind: all $(MAKE) -C test check-valgrind 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: # Tell GNU make to disable its built-in pattern rules. %:: %,v %:: RCS/%,v %:: RCS/% %:: s.% %:: SCCS/s.% dbus-glib-0.114/aclocal.m40000664000175000017500000017335614764623730010745 # generated automatically by aclocal 1.17 -*- Autoconf -*- # Copyright (C) 1996-2024 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_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.72],, [m4_warning([this file was generated for autoconf 2.72. 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 use pkg-config. -*- Autoconf -*- # serial 12 (pkg-config-0.29.2) dnl Copyright © 2004 Scott James Remnant . dnl Copyright © 2012-2015 Dan Nicholson dnl dnl This program is free software; you can redistribute it and/or modify dnl it under the terms of the GNU General Public License as published by dnl the Free Software Foundation; either version 2 of the License, or dnl (at your option) any later version. dnl dnl This program is distributed in the hope that it will be useful, but dnl WITHOUT ANY WARRANTY; without even the implied warranty of dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU dnl General Public License for more details. dnl dnl You should have received a copy of the GNU General Public License dnl along with this program; if not, write to the Free Software dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA dnl 02111-1307, USA. dnl dnl As a special exception to the GNU General Public License, if you dnl distribute this file as part of a program that contains a dnl configuration script generated by Autoconf, you may include it under dnl the same distribution terms that you use for the rest of that dnl program. dnl PKG_PREREQ(MIN-VERSION) dnl ----------------------- dnl Since: 0.29 dnl dnl Verify that the version of the pkg-config macros are at least dnl MIN-VERSION. Unlike PKG_PROG_PKG_CONFIG, which checks the user's dnl installed version of pkg-config, this checks the developer's version dnl of pkg.m4 when generating configure. dnl dnl To ensure that this macro is defined, also add: dnl m4_ifndef([PKG_PREREQ], dnl [m4_fatal([must install pkg-config 0.29 or later before running autoconf/autogen])]) dnl dnl See the "Since" comment for each macro you use to see what version dnl of the macros you require. m4_defun([PKG_PREREQ], [m4_define([PKG_MACROS_VERSION], [0.29.2]) m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1, [m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])]) ])dnl PKG_PREREQ dnl PKG_PROG_PKG_CONFIG([MIN-VERSION]) dnl ---------------------------------- dnl Since: 0.16 dnl dnl Search for the pkg-config tool and set the PKG_CONFIG variable to dnl first found in the path. Checks that the version of pkg-config found dnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is dnl used since that's the first version where most current features of dnl pkg-config existed. AC_DEFUN([PKG_PROG_PKG_CONFIG], [m4_pattern_forbid([^_?PKG_[A-Z_]+$]) m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$]) m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$]) AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility]) AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path]) AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path]) if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) fi if test -n "$PKG_CONFIG"; then _pkg_min_version=m4_default([$1], [0.9.0]) AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) PKG_CONFIG="" fi fi[]dnl ])dnl PKG_PROG_PKG_CONFIG dnl PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) dnl ------------------------------------------------------------------- dnl Since: 0.18 dnl dnl Check to see whether a particular set of modules exists. Similar to dnl PKG_CHECK_MODULES(), but does not set variables or print errors. dnl dnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) dnl only at the first occurrence in configure.ac, so if the first place dnl it's called might be skipped (such as if it is within an "if", you dnl have to call PKG_CHECK_EXISTS manually AC_DEFUN([PKG_CHECK_EXISTS], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl if test -n "$PKG_CONFIG" && \ AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then m4_default([$2], [:]) m4_ifvaln([$3], [else $3])dnl fi]) dnl _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) dnl --------------------------------------------- dnl Internal wrapper calling pkg-config via PKG_CONFIG and setting dnl pkg_failed based on the result. m4_define([_PKG_CONFIG], [if test -n "$$1"; then pkg_cv_[]$1="$$1" elif test -n "$PKG_CONFIG"; then PKG_CHECK_EXISTS([$3], [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes ], [pkg_failed=yes]) else pkg_failed=untried fi[]dnl ])dnl _PKG_CONFIG dnl _PKG_SHORT_ERRORS_SUPPORTED dnl --------------------------- dnl Internal check to see if pkg-config supports short errors. AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], [AC_REQUIRE([PKG_PROG_PKG_CONFIG]) if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi[]dnl ])dnl _PKG_SHORT_ERRORS_SUPPORTED dnl PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], dnl [ACTION-IF-NOT-FOUND]) dnl -------------------------------------------------------------- dnl Since: 0.4.0 dnl dnl Note that if there is a possibility the first call to dnl PKG_CHECK_MODULES might not happen, you should be sure to include an dnl explicit call to PKG_PROG_PKG_CONFIG in your configure.ac AC_DEFUN([PKG_CHECK_MODULES], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl pkg_failed=no AC_MSG_CHECKING([for $2]) _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) _PKG_CONFIG([$1][_LIBS], [libs], [$2]) m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS and $1[]_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details.]) if test $pkg_failed = yes; then AC_MSG_RESULT([no]) _PKG_SHORT_ERRORS_SUPPORTED if test $_pkg_short_errors_supported = yes; then $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1` else $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD m4_default([$4], [AC_MSG_ERROR( [Package requirements ($2) were not met: $$1_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. _PKG_TEXT])[]dnl ]) elif test $pkg_failed = untried; then AC_MSG_RESULT([no]) m4_default([$4], [AC_MSG_FAILURE( [The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. _PKG_TEXT To get pkg-config, see .])[]dnl ]) else $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS $1[]_LIBS=$pkg_cv_[]$1[]_LIBS AC_MSG_RESULT([yes]) $3 fi[]dnl ])dnl PKG_CHECK_MODULES dnl PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], dnl [ACTION-IF-NOT-FOUND]) dnl --------------------------------------------------------------------- dnl Since: 0.29 dnl dnl Checks for existence of MODULES and gathers its build flags with dnl static libraries enabled. Sets VARIABLE-PREFIX_CFLAGS from --cflags dnl and VARIABLE-PREFIX_LIBS from --libs. dnl dnl Note that if there is a possibility the first call to dnl PKG_CHECK_MODULES_STATIC might not happen, you should be sure to dnl include an explicit call to PKG_PROG_PKG_CONFIG in your dnl configure.ac. AC_DEFUN([PKG_CHECK_MODULES_STATIC], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl _save_PKG_CONFIG=$PKG_CONFIG PKG_CONFIG="$PKG_CONFIG --static" PKG_CHECK_MODULES($@) PKG_CONFIG=$_save_PKG_CONFIG[]dnl ])dnl PKG_CHECK_MODULES_STATIC dnl PKG_INSTALLDIR([DIRECTORY]) dnl ------------------------- dnl Since: 0.27 dnl dnl Substitutes the variable pkgconfigdir as the location where a module dnl should install pkg-config .pc files. By default the directory is dnl $libdir/pkgconfig, but the default can be changed by passing dnl DIRECTORY. The user can override through the --with-pkgconfigdir dnl parameter. AC_DEFUN([PKG_INSTALLDIR], [m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])]) m4_pushdef([pkg_description], [pkg-config installation directory @<:@]pkg_default[@:>@]) AC_ARG_WITH([pkgconfigdir], [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],, [with_pkgconfigdir=]pkg_default) AC_SUBST([pkgconfigdir], [$with_pkgconfigdir]) m4_popdef([pkg_default]) m4_popdef([pkg_description]) ])dnl PKG_INSTALLDIR dnl PKG_NOARCH_INSTALLDIR([DIRECTORY]) dnl -------------------------------- dnl Since: 0.27 dnl dnl Substitutes the variable noarch_pkgconfigdir as the location where a dnl module should install arch-independent pkg-config .pc files. By dnl default the directory is $datadir/pkgconfig, but the default can be dnl changed by passing DIRECTORY. The user can override through the dnl --with-noarch-pkgconfigdir parameter. AC_DEFUN([PKG_NOARCH_INSTALLDIR], [m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])]) m4_pushdef([pkg_description], [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@]) AC_ARG_WITH([noarch-pkgconfigdir], [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],, [with_noarch_pkgconfigdir=]pkg_default) AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir]) m4_popdef([pkg_default]) m4_popdef([pkg_description]) ])dnl PKG_NOARCH_INSTALLDIR dnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE, dnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) dnl ------------------------------------------- dnl Since: 0.28 dnl dnl Retrieves the value of the pkg-config variable for the given module. AC_DEFUN([PKG_CHECK_VAR], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl _PKG_CONFIG([$1], [variable="][$3]["], [$2]) AS_VAR_COPY([$1], [pkg_cv_][$1]) AS_VAR_IF([$1], [""], [$5], [$4])dnl ])dnl PKG_CHECK_VAR dnl PKG_WITH_MODULES(VARIABLE-PREFIX, MODULES, dnl [ACTION-IF-FOUND],[ACTION-IF-NOT-FOUND], dnl [DESCRIPTION], [DEFAULT]) dnl ------------------------------------------ dnl dnl Prepare a "--with-" configure option using the lowercase dnl [VARIABLE-PREFIX] name, merging the behaviour of AC_ARG_WITH and dnl PKG_CHECK_MODULES in a single macro. AC_DEFUN([PKG_WITH_MODULES], [ m4_pushdef([with_arg], m4_tolower([$1])) m4_pushdef([description], [m4_default([$5], [build with ]with_arg[ support])]) m4_pushdef([def_arg], [m4_default([$6], [auto])]) m4_pushdef([def_action_if_found], [AS_TR_SH([with_]with_arg)=yes]) m4_pushdef([def_action_if_not_found], [AS_TR_SH([with_]with_arg)=no]) m4_case(def_arg, [yes],[m4_pushdef([with_without], [--without-]with_arg)], [m4_pushdef([with_without],[--with-]with_arg)]) AC_ARG_WITH(with_arg, AS_HELP_STRING(with_without, description[ @<:@default=]def_arg[@:>@]),, [AS_TR_SH([with_]with_arg)=def_arg]) AS_CASE([$AS_TR_SH([with_]with_arg)], [yes],[PKG_CHECK_MODULES([$1],[$2],$3,$4)], [auto],[PKG_CHECK_MODULES([$1],[$2], [m4_n([def_action_if_found]) $3], [m4_n([def_action_if_not_found]) $4])]) m4_popdef([with_arg]) m4_popdef([description]) m4_popdef([def_arg]) ])dnl PKG_WITH_MODULES dnl PKG_HAVE_WITH_MODULES(VARIABLE-PREFIX, MODULES, dnl [DESCRIPTION], [DEFAULT]) dnl ----------------------------------------------- dnl dnl Convenience macro to trigger AM_CONDITIONAL after PKG_WITH_MODULES dnl check._[VARIABLE-PREFIX] is exported as make variable. AC_DEFUN([PKG_HAVE_WITH_MODULES], [ PKG_WITH_MODULES([$1],[$2],,,[$3],[$4]) AM_CONDITIONAL([HAVE_][$1], [test "$AS_TR_SH([with_]m4_tolower([$1]))" = "yes"]) ])dnl PKG_HAVE_WITH_MODULES dnl PKG_HAVE_DEFINE_WITH_MODULES(VARIABLE-PREFIX, MODULES, dnl [DESCRIPTION], [DEFAULT]) dnl ------------------------------------------------------ dnl dnl Convenience macro to run AM_CONDITIONAL and AC_DEFINE after dnl PKG_WITH_MODULES check. HAVE_[VARIABLE-PREFIX] is exported as make dnl and preprocessor variable. AC_DEFUN([PKG_HAVE_DEFINE_WITH_MODULES], [ PKG_HAVE_WITH_MODULES([$1],[$2],[$3],[$4]) AS_IF([test "$AS_TR_SH([with_]m4_tolower([$1]))" = "yes"], [AC_DEFINE([HAVE_][$1], 1, [Enable ]m4_tolower([$1])[ support])]) ])dnl PKG_HAVE_DEFINE_WITH_MODULES # Copyright (C) 2002-2024 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. # 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.17' 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.17], [], [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.17])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-2024 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. # 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], [AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl # Expand $ac_aux_dir to an absolute path. am_aux_dir=`cd "$ac_aux_dir" && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997-2024 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. # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ([2.52])dnl m4_if([$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-2024 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. # 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", "OBJC", "OBJCXX", "UPC", or "GJC". # 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 m4_if([$1], [CC], [depcc="$CC" am_compiler_list=], [$1], [CXX], [depcc="$CXX" am_compiler_list=], [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$1], [OBJCXX], [depcc="$OBJCXX" 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 10 /bin/sh. echo '/* dummy */' > 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 thus: # 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], [dnl AS_HELP_STRING( [--enable-dependency-tracking], [do not reject slow dependency extractors]) AS_HELP_STRING( [--disable-dependency-tracking], [speeds up one-time build])]) 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-2024 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. # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [{ # Older Autoconf 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. # TODO: see whether this extra hack can be removed once we start # requiring Autoconf 2.70 or later. AS_CASE([$CONFIG_FILES], [*\'*], [eval set x "$CONFIG_FILES"], [*], [set x $CONFIG_FILES]) shift # Used to flag and report bootstrapping failures. am_rc=0 for am_mf do # Strip MF so we end up with the name of the file. am_mf=`AS_ECHO(["$am_mf"]) | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile which includes # dependency-tracking related rules and includes. # Grep'ing the whole file directly is not great: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ || continue am_dirpart=`AS_DIRNAME(["$am_mf"])` am_filepart=`AS_BASENAME(["$am_mf"])` AM_RUN_LOG([cd "$am_dirpart" \ && sed -e '/# am--include-marker/d' "$am_filepart" \ | $MAKE -f - am--depfiles]) || am_rc=$? done if test $am_rc -ne 0; then AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments for automatic dependency tracking. If GNU make was not used, consider re-running the configure script with MAKE="gmake" (or whatever is necessary). You can also try re-running configure with the '--disable-dependency-tracking' option to at least be able to build the package (albeit without support for automatic dependency tracking).]) fi AS_UNSET([am_dirpart]) AS_UNSET([am_filepart]) AS_UNSET([am_mf]) AS_UNSET([am_rc]) rm -f conftest-deps.mk } ])# _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. # This creates each '.Po' and '.Plo' makefile fragment that we'll 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" MAKE="${MAKE-make}"])]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996-2024 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 macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. m4_define([AC_PROG_CC], m4_defn([AC_PROG_CC]) [_AM_PROG_CC_C_O ]) # 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.65])dnl m4_ifdef([_$0_ALREADY_INIT], [m4_fatal([$0 expanded multiple times ]m4_defn([_$0_ALREADY_INIT]))], [m4_define([_$0_ALREADY_INIT], m4_expansion_stack)])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], [AC_DIAGNOSE([obsolete], [$0: two- and three-arguments forms are deprecated.]) 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_ifset([AC_PACKAGE_NAME], [ok]):m4_ifset([AC_PACKAGE_VERSION], [ok]), [ok:ok],, [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([AC_PROG_MKDIR_P])dnl # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # AC_SUBST([mkdir_p], ['$(MKDIR_P)']) # We need awk for the "check" target (and possibly the TAP driver). 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])], [m4_define([AC_PROG_CC], m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES([CXX])], [m4_define([AC_PROG_CXX], m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES([OBJC])], [m4_define([AC_PROG_OBJC], m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], [_AM_DEPENDENCIES([OBJCXX])], [m4_define([AC_PROG_OBJCXX], m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl ]) # Variables for tags utilities; see am/tags.am if test -z "$CTAGS"; then CTAGS=ctags fi AC_SUBST([CTAGS]) if test -z "$ETAGS"; then ETAGS=etags fi AC_SUBST([ETAGS]) if test -z "$CSCOPE"; then CSCOPE=cscope fi AC_SUBST([CSCOPE]) AC_REQUIRE([_AM_SILENT_RULES])dnl dnl The testsuite driver may need to know about EXEEXT, so add the dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This dnl macro 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 AC_REQUIRE([_AM_PROG_RM_F]) AC_REQUIRE([_AM_PROG_XARGS_N]) dnl The trailing newline in this macro's definition is deliberate, for dnl backward compatibility and to allow trailing 'dnl'-style comments dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841. ]) 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-2024 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. # 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+set}" != 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-2024 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. # 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-2024 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. # 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], [AS_HELP_STRING([--]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 ] ) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001-2024 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. # AM_MAKE_INCLUDE() # ----------------- # Check whether make has an 'include' directive that can support all # the idioms we need for our automatic dependency tracking code. AC_DEFUN([AM_MAKE_INCLUDE], [AC_MSG_CHECKING([whether ${MAKE-make} supports the include directive]) cat > confinc.mk << 'END' am__doit: @echo this is the am__doit target >confinc.out .PHONY: am__doit END am__include="#" am__quote= # BSD make does it like this. echo '.include "confinc.mk" # ignored' > confmf.BSD # Other make implementations (GNU, Solaris 10, AIX) do it like this. echo 'include confinc.mk # ignored' > confmf.GNU _am_result=no for s in GNU BSD; do AM_RUN_LOG([${MAKE-make} -f confmf.$s && cat confinc.out]) AS_CASE([$?:`cat confinc.out 2>/dev/null`], ['0:this is the am__doit target'], [AS_CASE([$s], [BSD], [am__include='.include' am__quote='"'], [am__include='include' am__quote=''])]) if test "$am__include" != "#"; then _am_result="yes ($s style)" break fi done rm -f confinc.* confmf.* AC_MSG_RESULT([${_am_result}]) AC_SUBST([am__include])]) AC_SUBST([am__quote])]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997-2024 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. # 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 is modern enough. # If it is, 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 MISSING="\${SHELL} '$am_aux_dir/missing'" fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= AC_MSG_WARN(['missing' script is too old or missing]) fi ]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001-2024 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. # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # -------------------- # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), [1])]) # _AM_SET_OPTIONS(OPTIONS) # ------------------------ # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # Copyright (C) 1999-2024 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. # _AM_PROG_CC_C_O # --------------- # Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC # to automatically call this. AC_DEFUN([_AM_PROG_CC_C_O], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([compile])dnl AC_LANG_PUSH([C])dnl AC_CACHE_CHECK( [whether $CC understands -c and -o together], [am_cv_prog_cc_c_o], [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i]) if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi AC_LANG_POP([C])]) # For backward compatibility. AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) # Copyright (C) 2022-2024 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. # _AM_PROG_RM_F # --------------- # Check whether 'rm -f' without any arguments works. # https://bugs.gnu.org/10828 AC_DEFUN([_AM_PROG_RM_F], [am__rm_f_notfound= AS_IF([(rm -f && rm -fr && rm -rf) 2>/dev/null], [], [am__rm_f_notfound='""']) AC_SUBST(am__rm_f_notfound) ]) # Copyright (C) 2001-2024 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. # AM_RUN_LOG(COMMAND) # ------------------- # Run COMMAND, save the exit status in ac_status, and log it. # (This has been adapted from Autoconf's _AC_RUN_LOG macro.) AC_DEFUN([AM_RUN_LOG], [{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD (exit $ac_status); }]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996-2024 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. # _AM_SLEEP_FRACTIONAL_SECONDS # ---------------------------- AC_DEFUN([_AM_SLEEP_FRACTIONAL_SECONDS], [dnl AC_CACHE_CHECK([whether sleep supports fractional seconds], am_cv_sleep_fractional_seconds, [dnl AS_IF([sleep 0.001 2>/dev/null], [am_cv_sleep_fractional_seconds=yes], [am_cv_sleep_fractional_seconds=no]) ])]) # _AM_FILESYSTEM_TIMESTAMP_RESOLUTION # ----------------------------------- # Determine the filesystem's resolution for file modification # timestamps. The coarsest we know of is FAT, with a resolution # of only two seconds, even with the most recent "exFAT" extensions. # The finest (e.g. ext4 with large inodes, XFS, ZFS) is one # nanosecond, matching clock_gettime. However, it is probably not # possible to delay execution of a shell script for less than one # millisecond, due to process creation overhead and scheduling # granularity, so we don't check for anything finer than that. (See below.) AC_DEFUN([_AM_FILESYSTEM_TIMESTAMP_RESOLUTION], [dnl AC_REQUIRE([_AM_SLEEP_FRACTIONAL_SECONDS]) AC_CACHE_CHECK([filesystem timestamp resolution], am_cv_filesystem_timestamp_resolution, [dnl # Default to the worst case. am_cv_filesystem_timestamp_resolution=2 # Only try to go finer than 1 sec if sleep can do it. # Don't try 1 sec, because if 0.01 sec and 0.1 sec don't work, # - 1 sec is not much of a win compared to 2 sec, and # - it takes 2 seconds to perform the test whether 1 sec works. # # Instead, just use the default 2s on platforms that have 1s resolution, # accept the extra 1s delay when using $sleep in the Automake tests, in # exchange for not incurring the 2s delay for running the test for all # packages. # am_try_resolutions= if test "$am_cv_sleep_fractional_seconds" = yes; then # Even a millisecond often causes a bunch of false positives, # so just try a hundredth of a second. The time saved between .001 and # .01 is not terribly consequential. am_try_resolutions="0.01 0.1 $am_try_resolutions" fi # In order to catch current-generation FAT out, we must *modify* files # that already exist; the *creation* timestamp is finer. Use names # that make ls -t sort them differently when they have equal # timestamps than when they have distinct timestamps, keeping # in mind that ls -t prints the *newest* file first. rm -f conftest.ts? : > conftest.ts1 : > conftest.ts2 : > conftest.ts3 # Make sure ls -t actually works. Do 'set' in a subshell so we don't # clobber the current shell's arguments. (Outer-level square brackets # are removed by m4; they're present so that m4 does not expand # ; be careful, easy to get confused.) if ( set X `[ls -t conftest.ts[12]]` && { test "$[]*" != "X conftest.ts1 conftest.ts2" || test "$[]*" != "X conftest.ts2 conftest.ts1"; } ); then :; else # 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_ECHO_UNQUOTED( ["Bad output from ls -t: \"`[ls -t conftest.ts[12]]`\""], [AS_MESSAGE_LOG_FD]) AC_MSG_FAILURE([ls -t produces unexpected output. Make sure there is not a broken ls alias in your environment.]) fi for am_try_res in $am_try_resolutions; do # Any one fine-grained sleep might happen to cross the boundary # between two values of a coarser actual resolution, but if we do # two fine-grained sleeps in a row, at least one of them will fall # entirely within a coarse interval. echo alpha > conftest.ts1 sleep $am_try_res echo beta > conftest.ts2 sleep $am_try_res echo gamma > conftest.ts3 # We assume that 'ls -t' will make use of high-resolution # timestamps if the operating system supports them at all. if (set X `ls -t conftest.ts?` && test "$[]2" = conftest.ts3 && test "$[]3" = conftest.ts2 && test "$[]4" = conftest.ts1); then # # Ok, ls -t worked. If we're at a resolution of 1 second, we're done, # because we don't need to test make. make_ok=true if test $am_try_res != 1; then # But if we've succeeded so far with a subsecond resolution, we # have one more thing to check: make. It can happen that # everything else supports the subsecond mtimes, but make doesn't; # notably on macOS, which ships make 3.81 from 2006 (the last one # released under GPLv2). https://bugs.gnu.org/68808 # # We test $MAKE if it is defined in the environment, else "make". # It might get overridden later, but our hope is that in practice # it does not matter: it is the system "make" which is (by far) # the most likely to be broken, whereas if the user overrides it, # probably they did so with a better, or at least not worse, make. # https://lists.gnu.org/archive/html/automake/2024-06/msg00051.html # # Create a Makefile (real tab character here): rm -f conftest.mk echo 'conftest.ts1: conftest.ts2' >conftest.mk echo ' touch conftest.ts2' >>conftest.mk # # Now, running # touch conftest.ts1; touch conftest.ts2; make # should touch ts1 because ts2 is newer. This could happen by luck, # but most often, it will fail if make's support is insufficient. So # test for several consecutive successes. # # (We reuse conftest.ts[12] because we still want to modify existing # files, not create new ones, per above.) n=0 make=${MAKE-make} until test $n -eq 3; do echo one > conftest.ts1 sleep $am_try_res echo two > conftest.ts2 # ts2 should now be newer than ts1 if $make -f conftest.mk | grep 'up to date' >/dev/null; then make_ok=false break # out of $n loop fi n=`expr $n + 1` done fi # if $make_ok; then # Everything we know to check worked out, so call this resolution good. am_cv_filesystem_timestamp_resolution=$am_try_res break # out of $am_try_res loop fi # Otherwise, we'll go on to check the next resolution. fi done rm -f conftest.ts? # (end _am_filesystem_timestamp_resolution) ])]) # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_REQUIRE([_AM_FILESYSTEM_TIMESTAMP_RESOLUTION]) # This check should not be cached, as it may vary across builds of # different projects. AC_MSG_CHECKING([whether build environment is sane]) # 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). am_build_env_is_sane=no am_has_slept=no rm -f conftest.file for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file 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 test "$[]2" = conftest.file ); then am_build_env_is_sane=yes break fi # Just in case. sleep "$am_cv_filesystem_timestamp_resolution" am_has_slept=yes done AC_MSG_RESULT([$am_build_env_is_sane]) if test "$am_build_env_is_sane" = no; then AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= AS_IF([test -e conftest.file || grep 'slept: no' conftest.file >/dev/null 2>&1],, [dnl ( sleep "$am_cv_filesystem_timestamp_resolution" ) & am_sleep_pid=$! ]) AC_CONFIG_COMMANDS_PRE( [AC_MSG_CHECKING([that generated files are newer than configure]) if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi AC_MSG_RESULT([done])]) rm -f conftest.file ]) # Copyright (C) 2009-2024 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. # _AM_SILENT_RULES # ---------------- # Enable less verbose build rules support. AC_DEFUN([_AM_SILENT_RULES], [AM_DEFAULT_VERBOSITY=1 AC_ARG_ENABLE([silent-rules], [dnl AS_HELP_STRING( [--enable-silent-rules], [less verbose build output (undo: "make V=1")]) AS_HELP_STRING( [--disable-silent-rules], [verbose build output (undo: "make V=0")])dnl ]) 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]) 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 dnl Delay evaluation of AM_DEFAULT_VERBOSITY to the end to allow multiple calls dnl to AM_SILENT_RULES to change the default value. AC_CONFIG_COMMANDS_PRE([dnl case $enable_silent_rules in @%:@ ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; esac 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 ])dnl ]) # AM_SILENT_RULES([DEFAULT]) # -------------------------- # Set the default verbosity level to DEFAULT ("yes" being less verbose, "no" or # empty being verbose). AC_DEFUN([AM_SILENT_RULES], [AC_REQUIRE([_AM_SILENT_RULES]) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1])]) # Copyright (C) 2001-2024 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. # 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-2024 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. # _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-2024 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. # _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}']) # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' m4_if([$1], [v7], [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], [m4_case([$1], [ustar], [# The POSIX 1988 'ustar' format is defined with fixed-size fields. # There is notably a 21 bits limit for the UID and the GID. In fact, # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 # and bug#13588). am_max_uid=2097151 # 2^21 - 1 am_max_gid=$am_max_uid # The $UID and $GID variables are not portable, so we need to resort # to the POSIX-mandated id(1) utility. Errors in the 'id' calls # below are definitely unexpected, so allow the users to see them # (that is, avoid stderr redirection). am_uid=`id -u || echo unknown` am_gid=`id -g || echo unknown` AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) if test x$am_uid = xunknown; then AC_MSG_WARN([ancient id detected; assuming current UID is ok, but dist-ustar might not work]) elif test $am_uid -le $am_max_uid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) if test x$gm_gid = xunknown; then AC_MSG_WARN([ancient id detected; assuming current GID is ok, but dist-ustar might not work]) elif test $am_gid -le $am_max_gid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi], [pax], [], [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Go ahead even if we have the value already cached. We do so because we # need to set the values for the 'am__tar' and 'am__untar' variables. _am_tools=${am_cv_prog_tar_$1-$_am_tools} 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 # Copyright (C) 2022-2024 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. # _AM_PROG_XARGS_N # ---------------- # Check whether 'xargs -n' works. It should work everywhere, so the fallback # is not optimized at all as we never expect to use it. AC_DEFUN([_AM_PROG_XARGS_N], [AC_CACHE_CHECK([xargs -n works], am_cv_xargs_n_works, [dnl AS_IF([test "`echo 1 2 3 | xargs -n2 echo`" = "1 2 3"], [am_cv_xargs_n_works=yes], [am_cv_xargs_n_works=no])]) AS_IF([test "$am_cv_xargs_n_works" = yes], [am__xargs_n='xargs -n'], [dnl am__xargs_n='am__xargs_n () { shift; sed "s/ /\\n/g" | while read am__xargs_n_arg; do "$@" "$am__xargs_n_arg"; done; }' ])dnl AC_SUBST(am__xargs_n) ]) 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.114/configure.ac0000644000175000017500000002372114764623612011356 dnl -*- mode: m4 -*- AC_PREREQ(2.52) AC_INIT([dbus-glib], [0.114], [https://gitlab.freedesktop.org/dbus/dbus-glib/-/issues/new]) AC_CONFIG_AUX_DIR([build-aux]) AC_CANONICAL_HOST AM_INIT_AUTOMAKE([1.9 foreign subdir-objects]) AC_CONFIG_HEADERS(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=5 ## increment any time the source changes; set to ## 0 if you increment CURRENT LT_REVISION=6 ## 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=3 AC_SUBST(LT_CURRENT) AC_SUBST(LT_REVISION) AC_SUBST(LT_AGE) m4_ifndef([PKG_PROG_PKG_CONFIG], [pkg.m4 version 0.28 or later is required]) 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(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) 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 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 AC_ARG_ENABLE([asserts], [AS_HELP_STRING([--enable-asserts], [include assertion checks])], [enable_asserts=$enableval], [enable_asserts=$USE_MAINTAINER_MODE]) if test x$enable_asserts = xno; then AC_DEFINE([G_DISABLE_ASSERT], [1], [Disable GLib assertion macros]) fi AC_ARG_ENABLE([checks], [AS_HELP_STRING([--enable-checks], [include sanity checks on public API])], [enable_checks=$enableval], [enable_checks=yes]) if test x$enable_checks = xno; then 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_LANG_PROGRAM([[]], [[]])], [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 LT_INIT 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_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #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 #### 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.8]) AC_SUBST([DBUS_CFLAGS]) AC_SUBST([DBUS_LIBS]) # Glib detection AC_DEFINE([GLIB_VERSION_MAX_ALLOWED], [GLIB_VERSION_2_40], [Warn on use of APIs added after GLib 2.40]) AC_DEFINE([GLIB_VERSION_MIN_REQUIRED], [GLIB_VERSION_2_32], [Warn on use of APIs deprecated before GLib 2.32]) PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.40, gobject-2.0 >= 2.40, gio-2.0 >= 2.40]) PKG_CHECK_VAR([GLIB_GENMARSHAL], [glib-2.0], [glib_genmarshal], [], [AC_MSG_ERROR([cannot find glib-genmarshal])]) dnl GLib flags AC_SUBST(GLIB_CFLAGS) AC_SUBST(GLIB_LIBS) AC_SUBST(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) AC_ARG_VAR([DBUS_RUN_SESSION], [The dbus-run-session tool from dbus 1.8 or later]) AC_PATH_PROG([DBUS_RUN_SESSION], [dbus-run-session], [dbus-run-session]) ### gtk-doc Documentation GTK_DOC_CHECK([1.14], [--flavour no-tmpl]) # Make dbus-gmain submodule part of dbus-glib's namespace AH_BOTTOM([ #define DBUS_GMAIN_FUNCTION_NAME(name) _dbus_g_ ## name ]) AC_CONFIG_FILES([ Makefile m4/Makefile doc/Makefile doc/dbus-binding-tool.1 doc/reference/Makefile doc/reference/version.xml dbus/Makefile dbus/examples/Makefile dbus/examples/statemachine/Makefile dbus-gmain/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 tools/Makefile dbus-glib-1.pc dbus-glib-1-uninstalled.pc ]) AC_OUTPUT dnl ========================================================================== echo " D-BUS GLIB BINDINGS $VERSION ============== prefix: ${prefix} exec_prefix: ${exec_prefix} 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 assertions: ${enable_asserts} Building checks: ${enable_checks} Building Gtk-doc docs: ${enable_gtk_doc} Bash Completion: ${enable_bash_completion} Using XML parser: ${with_xml} " 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_gcov = xyes; then echo "NOTE: building with coverage profiling is definitely for developers only." 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.114/configure0000775000175000017500000176011514764623730011010 #! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.72 for dbus-glib 0.114. # # Report bugs to . # # # Copyright (C) 1992-1996, 1998-2017, 2020-2023 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 ${ZSH_VERSION+y} && (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 e in #( e) case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac ;; esac fi # Reset variables that may have inherited troublesome values from # the environment. # IFS needs to be set, to space, tab, and newline, in precisely that order. # (If _AS_PATH_WALK were called with IFS unset, it would have the # side effect of setting IFS to empty, thus disabling word splitting.) # Quoting is to prevent editors from complaining about space-tab. as_nl=' ' export as_nl IFS=" "" $as_nl" PS1='$ ' PS2='> ' PS4='+ ' # Ensure predictable behavior from utilities with locale-dependent output. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # We cannot yet rely on "unset" to work, but we need these variables # to be unset--not just set to an empty or harmless value--now, to # avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct # also avoids known problems related to "unset" and subshell syntax # in other old shells (e.g. bash 2.01 and pdksh 5.2.14). for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH do eval test \${$as_var+y} \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done # Ensure that fds 0, 1, and 2 are open. if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi if (exec 3>&2) ; then :; else exec 2>/dev/null; fi # The user is always right. if ${PATH_SEPARATOR+false} :; 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 # 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac 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 printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # 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'. printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 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 \${ZSH_VERSION+y} && (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 e in #( e) case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac ;; 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 case e in #( e) exitcode=1; echo positional parameters were not saved. ;; esac fi test x\$exitcode = x0 || exit 1 blah=\$(echo \$(echo blah)) test x\"\$blah\" = xblah || 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 case e in #( e) as_have_required=no ;; esac fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null then : else case e in #( e) 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac 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_run=a "$as_shell" -c "$as_bourne_compatible""$as_required" 2>/dev/null then : CONFIG_SHELL=$as_shell as_have_required=yes if as_run=a "$as_shell" -c "$as_bourne_compatible""$as_suggested" 2>/dev/null then : break 2 fi fi done;; esac as_found=false done IFS=$as_save_IFS if $as_found then : else case e in #( e) if { test -f "$SHELL" || test -f "$SHELL.exe"; } && as_run=a "$SHELL" -c "$as_bourne_compatible""$as_required" 2>/dev/null then : CONFIG_SHELL=$SHELL as_have_required=yes fi ;; esac fi 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'. printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno then : printf "%s\n" "$0: This script requires a shell more modern than all" printf "%s\n" "$0: the shells that I found on your system." if test ${ZSH_VERSION+y} ; then printf "%s\n" "$0: In particular, zsh $ZSH_VERSION has bugs and should" printf "%s\n" "$0: be upgraded to zsh 4.3.4 or later." else printf "%s\n" "$0: Please tell bug-autoconf@gnu.org and $0: https://gitlab.freedesktop.org/dbus/dbus-glib/-/issues/new $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 ;; esac 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=`printf "%s\n" "$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 || printf "%s\n" 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 case e in #( e) as_fn_append () { eval $1=\$$1\$2 } ;; esac 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 case e in #( e) as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } ;; esac 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 printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi printf "%s\n" "$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 || printf "%s\n" 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 ' t clear :clear 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" || { printf "%s\n" "$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 } # Determine whether it's possible to make 'echo' print without a newline. # These variables are no longer used directly by Autoconf, but are AC_SUBSTed # for compatibility with existing Makefiles. 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 # For backward compatibility with old third-party macros, we provide # the shell variables $as_echo and $as_echo_n. New code should use # AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. as_echo='printf %s\n' as_echo_n='printf %s' 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_sed_cpp="y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" as_tr_cpp="eval sed '$as_sed_cpp'" # deprecated # Sed expression to map a string onto a valid variable name. as_sed_sh="y%*+%pp%;s%[^_$as_cr_alnum]%_%g" as_tr_sh="eval sed '$as_sed_sh'" # deprecated 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.114' PACKAGE_STRING='dbus-glib 0.114' PACKAGE_BUGREPORT='https://gitlab.freedesktop.org/dbus/dbus-glib/-/issues/new' PACKAGE_URL='' # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_STDIO_H # include #endif #ifdef HAVE_STDLIB_H # include #endif #ifdef HAVE_STRING_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_header_c_list= ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LIBOBJS GTK_DOC_USE_REBASE_FALSE GTK_DOC_USE_REBASE_TRUE GTK_DOC_USE_LIBTOOL_FALSE GTK_DOC_USE_LIBTOOL_TRUE GTK_DOC_BUILD_PDF_FALSE GTK_DOC_BUILD_PDF_TRUE GTK_DOC_BUILD_HTML_FALSE GTK_DOC_BUILD_HTML_TRUE ENABLE_GTK_DOC_FALSE ENABLE_GTK_DOC_TRUE HAVE_GTK_DOC_FALSE HAVE_GTK_DOC_TRUE GTKDOC_DEPS_LIBS GTKDOC_DEPS_CFLAGS HTML_DIR GTKDOC_MKPDF GTKDOC_REBASE GTKDOC_CHECK_PATH GTKDOC_CHECK DBUS_RUN_SESSION DBUS_GLIB_TOOL_LIBS DBUS_GLIB_TOOL_CFLAGS GLIB_THREADS_LIBS GLIB_GENMARSHAL GLIB_LIBS GLIB_CFLAGS DBUS_LIBS DBUS_CFLAGS PKG_CONFIG_LIBDIR PKG_CONFIG_PATH PKG_CONFIG LT_SYS_LIBRARY_PATH OTOOL64 OTOOL LIPO NMEDIT DSYMUTIL MANIFEST_TOOL RANLIB ac_ct_AR AR DLLTOOL OBJDUMP FILECMD 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 am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE am__nodep AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE am__include DEPDIR OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC LT_AGE LT_REVISION LT_CURRENT MAINT MAINTAINER_MODE_FALSE MAINTAINER_MODE_TRUE am__xargs_n am__rm_f_notfound AM_BACKSLASH AM_DEFAULT_VERBOSITY AM_DEFAULT_V AM_V CSCOPE ETAGS CTAGS 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 runstatedir 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 am__quote' ac_subst_files='' ac_user_opts=' enable_option_checking enable_silent_rules enable_maintainer_mode enable_dependency_tracking enable_tests enable_ansi enable_gcov enable_bash_completion with_dbus_binding_tool enable_asserts enable_checks enable_shared enable_static enable_pic with_pic enable_fast_install enable_aix_soname with_aix_soname 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 LT_SYS_LIBRARY_PATH PKG_CONFIG PKG_CONFIG_PATH PKG_CONFIG_LIBDIR DBUS_CFLAGS DBUS_LIBS GLIB_CFLAGS GLIB_LIBS GLIB_GENMARSHAL DBUS_RUN_SESSION 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' runstatedir='${localstatedir}/run' 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 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=`printf "%s\n" "$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=`printf "%s\n" "$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 ;; -runstatedir | --runstatedir | --runstatedi | --runstated \ | --runstate | --runstat | --runsta | --runst | --runs \ | --run | --ru | --r) ac_prev=runstatedir ;; -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ | --run=* | --ru=* | --r=*) runstatedir=$ac_optarg ;; -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=`printf "%s\n" "$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=`printf "%s\n" "$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. printf "%s\n" "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && printf "%s\n" "$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" ;; *) printf "%s\n" "$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 runstatedir 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 || printf "%s\n" 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.114 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] --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] --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.114:";; esac cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-silent-rules less verbose build output (undo: "make V=1") --disable-silent-rules verbose build output (undo: "make V=0") --enable-maintainer-mode enable make rules and dependencies not useful (and sometimes confusing) to the casual installer --enable-dependency-tracking do not reject slow dependency extractors --disable-dependency-tracking speeds up one-time build --enable-tests enable unit test code --enable-ansi enable -ansi -pedantic gcc flags --enable-gcov compile with coverage profiling instrumentation (gcc only) --enable-bash-completion install bash completion scripts --enable-asserts include assertion checks --enable-checks include sanity checks on public API --enable-shared[=PKGS] build shared libraries [default=yes] --enable-static[=PKGS] build static libraries [default=yes] --enable-pic[=PKGS] try to use only PIC/non-PIC objects [default=use both] --enable-fast-install[=PKGS] optimize for fast installation [default=yes] --enable-aix-soname=aix|svr4|both shared library versioning (aka "SONAME") variant to provide on AIX, [default=aix]. --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-dbus-binding-tool=filename Use external dbus-binding-tool program --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 LT_SYS_LIBRARY_PATH User-defined run-time library search path. 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 GLIB_CFLAGS C compiler flags for GLIB, overriding pkg-config GLIB_LIBS linker flags for GLIB, overriding pkg-config GLIB_GENMARSHAL value of glib_genmarshal for glib-2.0, overriding pkg-config DBUS_RUN_SESSION The dbus-run-session tool from dbus 1.8 or later 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=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`printf "%s\n" "$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 configure.gnu first; this name is used for a wrapper for # Metaconfig's "Configure" on case-insensitive file systems. 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 printf "%s\n" "$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.114 generated by GNU Autoconf 2.72 Copyright (C) 2023 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 conftest.beam 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\"" printf "%s\n" "$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 printf "%s\n" "$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 case e in #( e) printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 ;; esac 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.beam 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\"" printf "%s\n" "$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 printf "%s\n" "$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 case e in #( e) printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 ;; esac fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in # INCLUDES, setting the cache variable VAR accordingly. ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 printf %s "checking for $2... " >&6; } if eval test \${$3+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 case e in #( e) eval "$3=no" ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi eval ac_res=\$$3 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 printf "%s\n" "$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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 printf %s "checking for $2... " >&6; } if eval test \${$3+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 (void); below. */ #include #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 (void); /* 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 (void) { return $2 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : eval "$3=yes" else case e in #( e) eval "$3=no" ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext ;; esac fi eval ac_res=\$$3 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func ac_configure_args_raw= for ac_arg do case $ac_arg in *\'*) ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append ac_configure_args_raw " '$ac_arg'" done case $ac_configure_args_raw in *$as_nl*) ac_safe_unquote= ;; *) ac_unsafe_z='|&;<>()$`\\"*?[ '' ' # This string ends in space, tab. ac_unsafe_a="$ac_unsafe_z#~" ac_safe_unquote="s/ '\\([^$ac_unsafe_a][^$ac_unsafe_z]*\\)'/ \\1/g" ac_configure_args_raw=` printf "%s\n" "$ac_configure_args_raw" | sed "$ac_safe_unquote"`;; esac 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.114, which was generated by GNU Autoconf 2.72. Invocation command line was $ $0$ac_configure_args_raw _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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac printf "%s\n" "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=`printf "%s\n" "$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=$? # Sanitize IFS. IFS=" "" $as_nl" # Save into config.log some information that might help in debugging. { echo printf "%s\n" "## ---------------- ## ## 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_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 printf "%s\n" "$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 printf "%s\n" "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac printf "%s\n" "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then printf "%s\n" "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac printf "%s\n" "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then printf "%s\n" "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && printf "%s\n" "$as_me: caught signal $ac_signal" printf "%s\n" "$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 printf "%s\n" "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. printf "%s\n" "#define PACKAGE_NAME \"$PACKAGE_NAME\"" >>confdefs.h printf "%s\n" "#define PACKAGE_TARNAME \"$PACKAGE_TARNAME\"" >>confdefs.h printf "%s\n" "#define PACKAGE_VERSION \"$PACKAGE_VERSION\"" >>confdefs.h printf "%s\n" "#define PACKAGE_STRING \"$PACKAGE_STRING\"" >>confdefs.h printf "%s\n" "#define PACKAGE_BUGREPORT \"$PACKAGE_BUGREPORT\"" >>confdefs.h printf "%s\n" "#define PACKAGE_URL \"$PACKAGE_URL\"" >>confdefs.h # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. if test -n "$CONFIG_SITE"; then ac_site_files="$CONFIG_SITE" elif test "x$prefix" != xNONE; then ac_site_files="$prefix/share/config.site $prefix/etc/config.site" else ac_site_files="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi for ac_site_file in $ac_site_files do case $ac_site_file in #( */*) : ;; #( *) : ac_site_file=./$ac_site_file ;; esac if test -f "$ac_site_file" && test -r "$ac_site_file"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 printf "%s\n" "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 printf "%s\n" "$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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 printf "%s\n" "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 printf "%s\n" "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Test code for whether the C compiler supports C89 (global declarations) ac_c_conftest_c89_globals=' /* Does the compiler advertise C89 conformance? Do not test the value of __STDC__, because some compilers set it to 0 while being otherwise adequately conformant. */ #if !defined __STDC__ # error "Compiler does not advertise C89 conformance" #endif #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7 src/conf.sh. */ struct buf { int x; }; struct buf * (*rcsopen) (struct buf *, struct stat *, int); static char *e (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; } /* C89 style stringification. */ #define noexpand_stringify(a) #a const char *stringified = noexpand_stringify(arbitrary+token=sequence); /* C89 style token pasting. Exercises some of the corner cases that e.g. old MSVC gets wrong, but not very hard. */ #define noexpand_concat(a,b) a##b #define expand_concat(a,b) noexpand_concat(a,b) extern int vA; extern int vbee; #define aye A #define bee B int *pvA = &expand_concat(v,aye); int *pvbee = &noexpand_concat(v,bee); /* 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 do not provoke an error unfortunately, instead are silently treated as an "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 is necessary to write \x00 == 0 to get something that is 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 **, int *(*)(struct buf *, struct stat *, int), int, int);' # Test code for whether the C compiler supports C89 (body of main). ac_c_conftest_c89_main=' ok |= (argc == 0 || f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]); ' # Test code for whether the C compiler supports C99 (global declarations) ac_c_conftest_c99_globals=' /* Does the compiler advertise C99 conformance? */ #if !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L # error "Compiler does not advertise C99 conformance" #endif // See if C++-style comments work. #include extern int puts (const char *); extern int printf (const char *, ...); extern int dprintf (int, const char *, ...); extern void *malloc (size_t); extern void free (void *); // Check varargs macros. These examples are taken from C99 6.10.3.5. // dprintf is used instead of fprintf to avoid needing to declare // FILE and stderr. #define debug(...) dprintf (2, __VA_ARGS__) #define showlist(...) puts (#__VA_ARGS__) #define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__)) static void test_varargs_macros (void) { int x = 1234; int y = 5678; debug ("Flag"); debug ("X = %d\n", x); showlist (The first, second, and third items.); report (x>y, "x is %d but y is %d", x, y); } // Check long long types. #define BIG64 18446744073709551615ull #define BIG32 4294967295ul #define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0) #if !BIG_OK #error "your preprocessor is broken" #endif #if BIG_OK #else #error "your preprocessor is broken" #endif static long long int bignum = -9223372036854775807LL; static unsigned long long int ubignum = BIG64; struct incomplete_array { int datasize; double data[]; }; struct named_init { int number; const wchar_t *name; double average; }; typedef const char *ccp; static inline int test_restrict (ccp restrict text) { // Iterate through items via the restricted pointer. // Also check for declarations in for loops. for (unsigned int i = 0; *(text+i) != '\''\0'\''; ++i) continue; return 0; } // Check varargs and va_copy. static bool test_varargs (const char *format, ...) { va_list args; va_start (args, format); va_list args_copy; va_copy (args_copy, args); const char *str = ""; int number = 0; float fnumber = 0; while (*format) { switch (*format++) { case '\''s'\'': // string str = va_arg (args_copy, const char *); break; case '\''d'\'': // int number = va_arg (args_copy, int); break; case '\''f'\'': // float fnumber = va_arg (args_copy, double); break; default: break; } } va_end (args_copy); va_end (args); return *str && number && fnumber; } ' # Test code for whether the C compiler supports C99 (body of main). ac_c_conftest_c99_main=' // Check bool. _Bool success = false; success |= (argc != 0); // Check restrict. if (test_restrict ("String literal") == 0) success = true; char *restrict newvar = "Another string"; // Check varargs. success &= test_varargs ("s, d'\'' f .", "string", 65, 34.234); test_varargs_macros (); // Check flexible array members. struct incomplete_array *ia = malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10)); ia->datasize = 10; for (int i = 0; i < ia->datasize; ++i) ia->data[i] = i * 1.234; // Work around memory leak warnings. free (ia); // Check named initializers. struct named_init ni = { .number = 34, .name = L"Test wide string", .average = 543.34343, }; ni.number = 58; int dynamic_array[ni.number]; dynamic_array[0] = argv[0][0]; dynamic_array[ni.number - 1] = 543; // work around unused variable warnings ok |= (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == '\''x'\'' || dynamic_array[ni.number - 1] != 543); ' # Test code for whether the C compiler supports C11 (global declarations) ac_c_conftest_c11_globals=' /* Does the compiler advertise C11 conformance? */ #if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112L # error "Compiler does not advertise C11 conformance" #endif // Check _Alignas. char _Alignas (double) aligned_as_double; char _Alignas (0) no_special_alignment; extern char aligned_as_int; char _Alignas (0) _Alignas (int) aligned_as_int; // Check _Alignof. enum { int_alignment = _Alignof (int), int_array_alignment = _Alignof (int[100]), char_alignment = _Alignof (char) }; _Static_assert (0 < -_Alignof (int), "_Alignof is signed"); // Check _Noreturn. int _Noreturn does_not_return (void) { for (;;) continue; } // Check _Static_assert. struct test_static_assert { int x; _Static_assert (sizeof (int) <= sizeof (long int), "_Static_assert does not work in struct"); long int y; }; // Check UTF-8 literals. #define u8 syntax error! char const utf8_literal[] = u8"happens to be ASCII" "another string"; // Check duplicate typedefs. typedef long *long_ptr; typedef long int *long_ptr; typedef long_ptr long_ptr; // Anonymous structures and unions -- taken from C11 6.7.2.1 Example 1. struct anonymous { union { struct { int i; int j; }; struct { int k; long int l; } w; }; int m; } v1; ' # Test code for whether the C compiler supports C11 (body of main). ac_c_conftest_c11_main=' _Static_assert ((offsetof (struct anonymous, i) == offsetof (struct anonymous, w.k)), "Anonymous union alignment botch"); v1.i = 2; v1.w.k = 5; ok |= v1.i != 5; ' # Test code for whether the C compiler supports C11 (complete). ac_c_conftest_c11_program="${ac_c_conftest_c89_globals} ${ac_c_conftest_c99_globals} ${ac_c_conftest_c11_globals} int main (int argc, char **argv) { int ok = 0; ${ac_c_conftest_c89_main} ${ac_c_conftest_c99_main} ${ac_c_conftest_c11_main} return ok; } " # Test code for whether the C compiler supports C99 (complete). ac_c_conftest_c99_program="${ac_c_conftest_c89_globals} ${ac_c_conftest_c99_globals} int main (int argc, char **argv) { int ok = 0; ${ac_c_conftest_c89_main} ${ac_c_conftest_c99_main} return ok; } " # Test code for whether the C compiler supports C89 (complete). ac_c_conftest_c89_program="${ac_c_conftest_c89_globals} int main (int argc, char **argv) { int ok = 0; ${ac_c_conftest_c89_main} return ok; } " as_fn_append ac_header_c_list " stdio.h stdio_h HAVE_STDIO_H" as_fn_append ac_header_c_list " stdlib.h stdlib_h HAVE_STDLIB_H" as_fn_append ac_header_c_list " string.h string_h HAVE_STRING_H" as_fn_append ac_header_c_list " inttypes.h inttypes_h HAVE_INTTYPES_H" as_fn_append ac_header_c_list " stdint.h stdint_h HAVE_STDINT_H" as_fn_append ac_header_c_list " strings.h strings_h HAVE_STRINGS_H" as_fn_append ac_header_c_list " sys/stat.h sys_stat_h HAVE_SYS_STAT_H" as_fn_append ac_header_c_list " sys/types.h sys_types_h HAVE_SYS_TYPES_H" as_fn_append ac_header_c_list " unistd.h unistd_h HAVE_UNISTD_H" # Auxiliary files required by this configure script. ac_aux_files="ltmain.sh compile missing install-sh config.guess config.sub" # Locations in which to look for auxiliary files. ac_aux_dir_candidates="${srcdir}/build-aux" # Search for a directory containing all of the required auxiliary files, # $ac_aux_files, from the $PATH-style list $ac_aux_dir_candidates. # If we don't find one directory that contains all the files we need, # we report the set of missing files from the *first* directory in # $ac_aux_dir_candidates and give up. ac_missing_aux_files="" ac_first_candidate=: printf "%s\n" "$as_me:${as_lineno-$LINENO}: looking for aux files: $ac_aux_files" >&5 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in $ac_aux_dir_candidates do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac as_found=: printf "%s\n" "$as_me:${as_lineno-$LINENO}: trying $as_dir" >&5 ac_aux_dir_found=yes ac_install_sh= for ac_aux in $ac_aux_files do # As a special case, if "install-sh" is required, that requirement # can be satisfied by any of "install-sh", "install.sh", or "shtool", # and $ac_install_sh is set appropriately for whichever one is found. if test x"$ac_aux" = x"install-sh" then if test -f "${as_dir}install-sh"; then printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}install-sh found" >&5 ac_install_sh="${as_dir}install-sh -c" elif test -f "${as_dir}install.sh"; then printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}install.sh found" >&5 ac_install_sh="${as_dir}install.sh -c" elif test -f "${as_dir}shtool"; then printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}shtool found" >&5 ac_install_sh="${as_dir}shtool install -c" else ac_aux_dir_found=no if $ac_first_candidate; then ac_missing_aux_files="${ac_missing_aux_files} install-sh" else break fi fi else if test -f "${as_dir}${ac_aux}"; then printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}${ac_aux} found" >&5 else ac_aux_dir_found=no if $ac_first_candidate; then ac_missing_aux_files="${ac_missing_aux_files} ${ac_aux}" else break fi fi fi done if test "$ac_aux_dir_found" = yes; then ac_aux_dir="$as_dir" break fi ac_first_candidate=false as_found=false done IFS=$as_save_IFS if $as_found then : else case e in #( e) as_fn_error $? "cannot find required auxiliary files:$ac_missing_aux_files" "$LINENO" 5 ;; esac 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. if test -f "${ac_aux_dir}config.guess"; then ac_config_guess="$SHELL ${ac_aux_dir}config.guess" fi if test -f "${ac_aux_dir}config.sub"; then ac_config_sub="$SHELL ${ac_aux_dir}config.sub" fi if test -f "$ac_aux_dir/configure"; then ac_configure="$SHELL ${ac_aux_dir}configure" 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,) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: '$ac_var' was set to '$ac_old_val' in the previous run" >&5 printf "%s\n" "$as_me: error: '$ac_var' was set to '$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: '$ac_var' was not set in the previous run" >&5 printf "%s\n" "$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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: '$ac_var' has changed since the previous run:" >&5 printf "%s\n" "$as_me: error: '$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in '$ac_var' since the previous run:" >&5 printf "%s\n" "$as_me: warning: ignoring whitespace changes in '$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: former value: '$ac_old_val'" >&5 printf "%s\n" "$as_me: former value: '$ac_old_val'" >&2;} { printf "%s\n" "$as_me:${as_lineno-$LINENO}: current value: '$ac_new_val'" >&5 printf "%s\n" "$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=`printf "%s\n" "$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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 printf "%s\n" "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run '${MAKE-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 # 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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 printf %s "checking build system type... " >&6; } if test ${ac_cv_build+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 printf "%s\n" "$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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 printf %s "checking host system type... " >&6; } if test ${ac_cv_host+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 printf "%s\n" "$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.17' # 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. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 printf %s "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if test ${ac_cv_path_install+y} then : printf %s "(cached) " >&6 else case e in #( e) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac # Account for fact that we put trailing slashes in our PATH walk. 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 ;; esac fi if test ${ac_cv_path_install+y}; 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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 printf "%s\n" "$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' { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether sleep supports fractional seconds" >&5 printf %s "checking whether sleep supports fractional seconds... " >&6; } if test ${am_cv_sleep_fractional_seconds+y} then : printf %s "(cached) " >&6 else case e in #( e) if sleep 0.001 2>/dev/null then : am_cv_sleep_fractional_seconds=yes else case e in #( e) am_cv_sleep_fractional_seconds=no ;; esac fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_sleep_fractional_seconds" >&5 printf "%s\n" "$am_cv_sleep_fractional_seconds" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking filesystem timestamp resolution" >&5 printf %s "checking filesystem timestamp resolution... " >&6; } if test ${am_cv_filesystem_timestamp_resolution+y} then : printf %s "(cached) " >&6 else case e in #( e) # Default to the worst case. am_cv_filesystem_timestamp_resolution=2 # Only try to go finer than 1 sec if sleep can do it. # Don't try 1 sec, because if 0.01 sec and 0.1 sec don't work, # - 1 sec is not much of a win compared to 2 sec, and # - it takes 2 seconds to perform the test whether 1 sec works. # # Instead, just use the default 2s on platforms that have 1s resolution, # accept the extra 1s delay when using $sleep in the Automake tests, in # exchange for not incurring the 2s delay for running the test for all # packages. # am_try_resolutions= if test "$am_cv_sleep_fractional_seconds" = yes; then # Even a millisecond often causes a bunch of false positives, # so just try a hundredth of a second. The time saved between .001 and # .01 is not terribly consequential. am_try_resolutions="0.01 0.1 $am_try_resolutions" fi # In order to catch current-generation FAT out, we must *modify* files # that already exist; the *creation* timestamp is finer. Use names # that make ls -t sort them differently when they have equal # timestamps than when they have distinct timestamps, keeping # in mind that ls -t prints the *newest* file first. rm -f conftest.ts? : > conftest.ts1 : > conftest.ts2 : > conftest.ts3 # Make sure ls -t actually works. Do 'set' in a subshell so we don't # clobber the current shell's arguments. (Outer-level square brackets # are removed by m4; they're present so that m4 does not expand # ; be careful, easy to get confused.) if ( set X `ls -t conftest.ts[12]` && { test "$*" != "X conftest.ts1 conftest.ts2" || test "$*" != "X conftest.ts2 conftest.ts1"; } ); then :; else # 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". printf "%s\n" ""Bad output from ls -t: \"`ls -t conftest.ts[12]`\""" >&5 { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "ls -t produces unexpected output. Make sure there is not a broken ls alias in your environment. See 'config.log' for more details" "$LINENO" 5; } fi for am_try_res in $am_try_resolutions; do # Any one fine-grained sleep might happen to cross the boundary # between two values of a coarser actual resolution, but if we do # two fine-grained sleeps in a row, at least one of them will fall # entirely within a coarse interval. echo alpha > conftest.ts1 sleep $am_try_res echo beta > conftest.ts2 sleep $am_try_res echo gamma > conftest.ts3 # We assume that 'ls -t' will make use of high-resolution # timestamps if the operating system supports them at all. if (set X `ls -t conftest.ts?` && test "$2" = conftest.ts3 && test "$3" = conftest.ts2 && test "$4" = conftest.ts1); then # # Ok, ls -t worked. If we're at a resolution of 1 second, we're done, # because we don't need to test make. make_ok=true if test $am_try_res != 1; then # But if we've succeeded so far with a subsecond resolution, we # have one more thing to check: make. It can happen that # everything else supports the subsecond mtimes, but make doesn't; # notably on macOS, which ships make 3.81 from 2006 (the last one # released under GPLv2). https://bugs.gnu.org/68808 # # We test $MAKE if it is defined in the environment, else "make". # It might get overridden later, but our hope is that in practice # it does not matter: it is the system "make" which is (by far) # the most likely to be broken, whereas if the user overrides it, # probably they did so with a better, or at least not worse, make. # https://lists.gnu.org/archive/html/automake/2024-06/msg00051.html # # Create a Makefile (real tab character here): rm -f conftest.mk echo 'conftest.ts1: conftest.ts2' >conftest.mk echo ' touch conftest.ts2' >>conftest.mk # # Now, running # touch conftest.ts1; touch conftest.ts2; make # should touch ts1 because ts2 is newer. This could happen by luck, # but most often, it will fail if make's support is insufficient. So # test for several consecutive successes. # # (We reuse conftest.ts[12] because we still want to modify existing # files, not create new ones, per above.) n=0 make=${MAKE-make} until test $n -eq 3; do echo one > conftest.ts1 sleep $am_try_res echo two > conftest.ts2 # ts2 should now be newer than ts1 if $make -f conftest.mk | grep 'up to date' >/dev/null; then make_ok=false break # out of $n loop fi n=`expr $n + 1` done fi # if $make_ok; then # Everything we know to check worked out, so call this resolution good. am_cv_filesystem_timestamp_resolution=$am_try_res break # out of $am_try_res loop fi # Otherwise, we'll go on to check the next resolution. fi done rm -f conftest.ts? # (end _am_filesystem_timestamp_resolution) ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_filesystem_timestamp_resolution" >&5 printf "%s\n" "$am_cv_filesystem_timestamp_resolution" >&6; } # This check should not be cached, as it may vary across builds of # different projects. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 printf %s "checking whether build environment is sane... " >&6; } # 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). am_build_env_is_sane=no am_has_slept=no rm -f conftest.file for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file 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 test "$2" = conftest.file ); then am_build_env_is_sane=yes break fi # Just in case. sleep "$am_cv_filesystem_timestamp_resolution" am_has_slept=yes done { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_build_env_is_sane" >&5 printf "%s\n" "$am_build_env_is_sane" >&6; } if test "$am_build_env_is_sane" = no; then as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if test -e conftest.file || grep 'slept: no' conftest.file >/dev/null 2>&1 then : else case e in #( e) ( sleep "$am_cv_filesystem_timestamp_resolution" ) & am_sleep_pid=$! ;; esac fi rm -f conftest.file 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=`printf "%s\n" "$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 MISSING="\${SHELL} '$am_aux_dir/missing'" fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 printf "%s\n" "$as_me: WARNING: 'missing' script is too old or missing" >&2;} fi if test x"${install_sh+set}" != 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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_STRIP+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac 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" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 printf "%s\n" "$STRIP" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_STRIP+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac 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" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 printf "%s\n" "$ac_ct_STRIP" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$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" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a race-free mkdir -p" >&5 printf %s "checking for a race-free mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if test ${ac_cv_path_mkdir+y} then : printf %s "(cached) " >&6 else case e in #( e) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac 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 ('*'coreutils) '* | \ *'BusyBox '* | \ '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 ;; esac fi test -d ./--version && rmdir ./--version if test ${ac_cv_path_mkdir+y}; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use plain mkdir -p, # in the hope it doesn't have the bugs of ancient mkdir. MKDIR_P='mkdir -p' fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 printf "%s\n" "$MKDIR_P" >&6; } 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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_AWK+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac 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" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 printf "%s\n" "$AWK" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$AWK" && break done { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 printf %s "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`printf "%s\n" "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval test \${ac_cv_prog_make_${ac_make}_set+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 ;; esac fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } SET_MAKE= else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "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 AM_DEFAULT_VERBOSITY=1 # Check whether --enable-silent-rules was given. if test ${enable_silent_rules+y} then : enableval=$enable_silent_rules; fi am_make=${MAKE-make} { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 printf %s "checking whether $am_make supports nested variables... " >&6; } if test ${am_cv_make_support_nested_variables+y} then : printf %s "(cached) " >&6 else case e in #( e) if printf "%s\n" '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 ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 printf "%s\n" "$am_cv_make_support_nested_variables" >&6; } AM_BACKSLASH='\' am__rm_f_notfound= if (rm -f && rm -fr && rm -rf) 2>/dev/null then : else case e in #( e) am__rm_f_notfound='""' ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking xargs -n works" >&5 printf %s "checking xargs -n works... " >&6; } if test ${am_cv_xargs_n_works+y} then : printf %s "(cached) " >&6 else case e in #( e) if test "`echo 1 2 3 | xargs -n2 echo`" = "1 2 3" then : am_cv_xargs_n_works=yes else case e in #( e) am_cv_xargs_n_works=no ;; esac fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_xargs_n_works" >&5 printf "%s\n" "$am_cv_xargs_n_works" >&6; } if test "$am_cv_xargs_n_works" = yes then : am__xargs_n='xargs -n' else case e in #( e) am__xargs_n='am__xargs_n () { shift; sed "s/ /\\n/g" | while read am__xargs_n_arg; do "" "$am__xargs_n_arg"; done; }' ;; esac fi 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.114' printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h printf "%s\n" "#define VERSION \"$VERSION\"" >>confdefs.h # 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"} # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # mkdir_p='$(MKDIR_P)' # We need awk for the "check" target (and possibly the TAP driver). 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}' # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar pax cpio none' am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' # Variables for tags utilities; see am/tags.am if test -z "$CTAGS"; then CTAGS=ctags fi if test -z "$ETAGS"; then ETAGS=etags fi if test -z "$CSCOPE"; then CSCOPE=cscope fi 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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5 printf %s "checking whether to enable maintainer-specific portions of Makefiles... " >&6; } # Check whether --enable-maintainer-mode was given. if test ${enable_maintainer_mode+y} then : enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval else case e in #( e) USE_MAINTAINER_MODE=no ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5 printf "%s\n" "$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 AM_DEFAULT_VERBOSITY=0 # 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=5 ## increment any time the source changes; set to ## 0 if you increment CURRENT LT_REVISION=6 ## 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=3 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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac 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" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac 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" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 printf "%s\n" "$ac_ct_CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac 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" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac 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" printf "%s\n" "$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 ;; esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac 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" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac 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" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 printf "%s\n" "$ac_ct_CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "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:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}clang", so it can be a program name with args. set dummy ${ac_tool_prefix}clang; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac 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}clang" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "clang", so it can be a program name with args. set dummy clang; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac 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="clang" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 printf "%s\n" "$ac_ct_CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$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 fi test -z "$CC" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 printf "%s\n" "$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. printf "%s\n" "$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 -version; 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\"" printf "%s\n" "$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 printf "%s\n" "$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 (void) { ; 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. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 printf %s "checking whether the C compiler works... " >&6; } ac_link_default=`printf "%s\n" "$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\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? printf "%s\n" "$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+y} && 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 case e in #( e) ac_file='' ;; esac fi if test -z "$ac_file" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 printf "%s\n" "$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 case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 printf %s "checking for C compiler default output file name... " >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 printf "%s\n" "$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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 printf %s "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\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? printf "%s\n" "$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 case e in #( e) { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 printf "%s\n" "$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; } ;; esac fi rm -f conftest conftest$ac_cv_exeext { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 printf "%s\n" "$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 (void) { FILE *f = fopen ("conftest.out", "w"); if (!f) return 1; 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. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 printf %s "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\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? printf "%s\n" "$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\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? printf "%s\n" "$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 { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error 77 "cannot run C compiled programs. If you meant to cross compile, use '--host'. See 'config.log' for more details" "$LINENO" 5; } fi fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 printf "%s\n" "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext \ conftest.o conftest.obj conftest.out ac_clean_files=$ac_clean_files_save { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 printf %s "checking for suffix of object files... " >&6; } if test ${ac_cv_objext+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; 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\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? printf "%s\n" "$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 case e in #( e) printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 printf "%s\n" "$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; } ;; esac fi rm -f conftest.$ac_cv_objext conftest.$ac_ext ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 printf "%s\n" "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C" >&5 printf %s "checking whether the compiler supports GNU C... " >&6; } if test ${ac_cv_c_compiler_gnu+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_compiler_gnu=yes else case e in #( e) ac_compiler_gnu=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 printf "%s\n" "$ac_cv_c_compiler_gnu" >&6; } ac_compiler_gnu=$ac_cv_c_compiler_gnu if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+y} ac_save_CFLAGS=$CFLAGS { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 printf %s "checking whether $CC accepts -g... " >&6; } if test ${ac_cv_prog_cc_g+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_g=yes else case e in #( e) CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : else case e in #( e) ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; 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.beam conftest.$ac_ext ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 printf "%s\n" "$ac_cv_prog_cc_g" >&6; } if test $ac_test_CFLAGS; 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 ac_prog_cc_stdc=no if test x$ac_prog_cc_stdc = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C11 features" >&5 printf %s "checking for $CC option to enable C11 features... " >&6; } if test ${ac_cv_prog_cc_c11+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_cv_prog_cc_c11=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_c_conftest_c11_program _ACEOF for ac_arg in '' -std=gnu11 do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_c11=$ac_arg fi rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c11" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC ;; esac fi if test "x$ac_cv_prog_cc_c11" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } else case e in #( e) if test "x$ac_cv_prog_cc_c11" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5 printf "%s\n" "$ac_cv_prog_cc_c11" >&6; } CC="$CC $ac_cv_prog_cc_c11" ;; esac fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11 ac_prog_cc_stdc=c11 ;; esac fi fi if test x$ac_prog_cc_stdc = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C99 features" >&5 printf %s "checking for $CC option to enable C99 features... " >&6; } if test ${ac_cv_prog_cc_c99+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_cv_prog_cc_c99=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_c_conftest_c99_program _ACEOF for ac_arg in '' -std=gnu99 -std=c99 -c99 -qlanglvl=extc1x -qlanglvl=extc99 -AC99 -D_STDC_C99= do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_c99=$ac_arg fi rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c99" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC ;; esac fi if test "x$ac_cv_prog_cc_c99" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } else case e in #( e) if test "x$ac_cv_prog_cc_c99" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 printf "%s\n" "$ac_cv_prog_cc_c99" >&6; } CC="$CC $ac_cv_prog_cc_c99" ;; esac fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99 ac_prog_cc_stdc=c99 ;; esac fi fi if test x$ac_prog_cc_stdc = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C89 features" >&5 printf %s "checking for $CC option to enable C89 features... " >&6; } if test ${ac_cv_prog_cc_c89+y} then : printf %s "(cached) " >&6 else case e in #( e) ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_c_conftest_c89_program _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 conftest.beam test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC ;; esac fi if test "x$ac_cv_prog_cc_c89" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } else case e in #( e) if test "x$ac_cv_prog_cc_c89" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 printf "%s\n" "$ac_cv_prog_cc_c89" >&6; } CC="$CC $ac_cv_prog_cc_c89" ;; esac fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89 ac_prog_cc_stdc=c89 ;; esac fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu 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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 printf %s "checking whether $CC understands -c and -o together... " >&6; } if test ${am_cv_prog_cc_c_o+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 printf "%s\n" "$am_cv_prog_cc_c_o" >&6; } if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" 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" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} supports the include directive" >&5 printf %s "checking whether ${MAKE-make} supports the include directive... " >&6; } cat > confinc.mk << 'END' am__doit: @echo this is the am__doit target >confinc.out .PHONY: am__doit END am__include="#" am__quote= # BSD make does it like this. echo '.include "confinc.mk" # ignored' > confmf.BSD # Other make implementations (GNU, Solaris 10, AIX) do it like this. echo 'include confinc.mk # ignored' > confmf.GNU _am_result=no for s in GNU BSD; do { echo "$as_me:$LINENO: ${MAKE-make} -f confmf.$s && cat confinc.out" >&5 (${MAKE-make} -f confmf.$s && cat confinc.out) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } case $?:`cat confinc.out 2>/dev/null` in #( '0:this is the am__doit target') : case $s in #( BSD) : am__include='.include' am__quote='"' ;; #( *) : am__include='include' am__quote='' ;; esac ;; #( *) : ;; esac if test "$am__include" != "#"; then _am_result="yes ($s style)" break fi done rm -f confinc.* confmf.* { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ${_am_result}" >&5 printf "%s\n" "${_am_result}" >&6; } # Check whether --enable-dependency-tracking was given. if test ${enable_dependency_tracking+y} 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= { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 printf %s "checking dependency style of $depcc... " >&6; } if test ${am_cv_CC_dependencies_compiler_type+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 10 /bin/sh. echo '/* dummy */' > 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 thus: # 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 ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 printf "%s\n" "$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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing strerror" >&5 printf %s "checking for library containing strerror... " >&6; } if test ${ac_cv_search_strerror+y} then : printf %s "(cached) " >&6 else case e in #( e) 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. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char strerror (void); int main (void) { 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.beam \ conftest$ac_exeext if test ${ac_cv_search_strerror+y} then : break fi done if test ${ac_cv_search_strerror+y} then : else case e in #( e) ac_cv_search_strerror=no ;; esac fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_strerror" >&5 printf "%s\n" "$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_header= ac_cache= for ac_item in $ac_header_c_list do if test $ac_cache; then ac_fn_c_check_header_compile "$LINENO" $ac_header ac_cv_header_$ac_cache "$ac_includes_default" if eval test \"x\$ac_cv_header_$ac_cache\" = xyes; then printf "%s\n" "#define $ac_item 1" >> confdefs.h fi ac_header= ac_cache= elif test $ac_header; then ac_cache=$ac_item else ac_header=$ac_item fi done if test $ac_cv_header_stdlib_h = yes && test $ac_cv_header_string_h = yes then : printf "%s\n" "#define STDC_HEADERS 1" >>confdefs.h fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 printf %s "checking for grep that handles long lines and -e... " >&6; } if test ${ac_cv_path_GREP+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac 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 printf %s 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" printf "%s\n" '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 ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 printf "%s\n" "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" # Autoupdate added the next two lines to ensure that your configure # script's behavior did not change. They are probably safe to remove. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 printf %s "checking for egrep... " >&6; } if test ${ac_cv_path_EGREP+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac 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 printf %s 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" printf "%s\n" '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 ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 printf "%s\n" "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" EGREP_TRADITIONAL=$EGREP ac_cv_path_EGREP_TRADITIONAL=$EGREP # Check whether --enable-tests was given. if test ${enable_tests+y} then : enableval=$enable_tests; enable_tests=$enableval else case e in #( e) enable_tests=$USE_MAINTAINER_MODE ;; esac fi # Check whether --enable-ansi was given. if test ${enable_ansi+y} then : enableval=$enable_ansi; enable_ansi=$enableval else case e in #( e) enable_ansi=no ;; esac fi # Check whether --enable-gcov was given. if test ${enable_gcov+y} then : enableval=$enable_gcov; enable_gcov=$enableval else case e in #( e) enable_gcov=no ;; esac fi # Check whether --enable-bash-completion was given. if test ${enable_bash_completion+y} then : enableval=$enable_bash_completion; enable_bash_completion=$enableval else case e in #( e) enable_bash_completion=yes ;; esac 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 printf "%s\n" "#define DBUS_BASH_COMPLETION 1" >>confdefs.h fi # Check whether --with-dbus-binding-tool was given. if test ${with_dbus_binding_tool+y} then : withval=$with_dbus_binding_tool; DBUS_BINDING_TOOL=$withval else case e in #( e) DBUS_BINDING_TOOL=\$\(top_builddir\)/dbus/dbus-binding-tool ;; esac 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 printf "%s\n" "#define DBUS_BUILD_TESTS 1" >>confdefs.h fi # Check whether --enable-asserts was given. if test ${enable_asserts+y} then : enableval=$enable_asserts; enable_asserts=$enableval else case e in #( e) enable_asserts=$USE_MAINTAINER_MODE ;; esac fi if test x$enable_asserts = xno; then printf "%s\n" "#define G_DISABLE_ASSERT 1" >>confdefs.h fi # Check whether --enable-checks was given. if test ${enable_checks+y} then : enableval=$enable_checks; enable_checks=$enableval else case e in #( e) enable_checks=yes ;; esac fi if test x$enable_checks = xno; then printf "%s\n" "#define G_DISABLE_CHECKS 1" >>confdefs.h fi #### gcc warning flags if test "x$GCC" = "xyes"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether gcc understands -Wfloat-equal" >&5 printf %s "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. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cc_flag=yes else case e in #( e) ac_cc_flag=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam 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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cc_flag" >&5 printf "%s\n" "$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 *\ * | *\ *) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 printf "%s\n" "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; esac macro_version='2.5.4' macro_revision='2.5.4' 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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 printf %s "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*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: printf" >&5 printf "%s\n" "printf" >&6; } ;; print*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 printf "%s\n" "print -r" >&6; } ;; *) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: cat" >&5 printf "%s\n" "cat" >&6; } ;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 printf %s "checking for a sed that does not truncate output... " >&6; } if test ${ac_cv_path_SED+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac 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 printf %s 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" printf "%s\n" '' >> "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 ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 printf "%s\n" "$ac_cv_path_SED" >&6; } SED="$ac_cv_path_SED" rm -f conftest.sed test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 printf %s "checking for fgrep... " >&6; } if test ${ac_cv_path_FGREP+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac 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 printf %s 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" printf "%s\n" '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 ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 printf "%s\n" "$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+y} then : withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes else case e in #( e) with_gnu_ld=no ;; esac fi ac_prog=ld if test yes = "$GCC"; then # Check if gcc -print-prog-name=ld gives a path. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 printf %s "checking for ld used by $CC... " >&6; } case $host in *-*-mingw* | *-*-windows*) # gcc leaves a trailing carriage return, which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD=$ac_prog ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test yes = "$with_gnu_ld"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 printf %s "checking for GNU ld... " >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 printf %s "checking for non-GNU ld... " >&6; } fi if test ${lt_cv_path_LD+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 printf "%s\n" "$LD" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 printf %s "checking if the linker ($LD) is GNU ld... " >&6; } if test ${lt_cv_prog_gnu_ld+y} then : printf %s "(cached) " >&6 else case e in #( e) # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 printf "%s\n" "$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 printf %s "checking for BSD- or MS-compatible name lister (nm)... " >&6; } if test ${lt_cv_path_NM+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM=$NM else lt_nm_to_check=${ac_tool_prefix}nm if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. tmp_nm=$ac_dir/$lt_tmp_nm if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then # Check to see if the nm accepts a BSD-compat flag. # Adding the 'sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file # MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty case $build_os in mingw* | windows*) lt_bad_file=conftest.nm/nofile ;; *) lt_bad_file=/dev/null ;; esac case `"$tmp_nm" -B $lt_bad_file 2>&1 | $SED '1q'` in *$lt_bad_file* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break 2 ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | $SED '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break 2 ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS=$lt_save_ifs done : ${lt_cv_path_NM=no} fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 printf "%s\n" "$lt_cv_path_NM" >&6; } if test no != "$lt_cv_path_NM"; then NM=$lt_cv_path_NM else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else if test -n "$ac_tool_prefix"; then for ac_prog in dumpbin "link -dump" do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_DUMPBIN+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac 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" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi DUMPBIN=$ac_cv_prog_DUMPBIN if test -n "$DUMPBIN"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 printf "%s\n" "$DUMPBIN" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_DUMPBIN+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac 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" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN if test -n "$ac_ct_DUMPBIN"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 printf "%s\n" "$ac_ct_DUMPBIN" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "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:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DUMPBIN=$ac_ct_DUMPBIN fi fi case `$DUMPBIN -symbols -headers /dev/null 2>&1 | $SED '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols -headers" ;; *) DUMPBIN=: ;; esac fi if test : != "$DUMPBIN"; then NM=$DUMPBIN fi fi test -z "$NM" && NM=nm { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 printf %s "checking the name lister ($NM) interface... " >&6; } if test ${lt_cv_nm_interface+y} then : printf %s "(cached) " >&6 else case e in #( e) 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* ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 printf "%s\n" "$lt_cv_nm_interface" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 printf %s "checking whether ln -s works... " >&6; } LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 printf "%s\n" "no, using $LN_S" >&6; } fi # find the maximum length of command line arguments { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 printf %s "checking the maximum length of command line arguments... " >&6; } if test ${lt_cv_sys_max_cmd_len+y} then : printf %s "(cached) " >&6 else case e in #( e) 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* | ironclad*) # Under GNU Hurd and Ironclad, 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* | windows* | 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; ;; darwin* | dragonfly* | freebsd* | midnightbsd* | netbsd* | openbsd*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; os2*) # The test takes a long time on OS/2. lt_cv_sys_max_cmd_len=8192 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | $SED 's/.*[ ]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len" && \ test undefined != "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test X`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test 17 != "$i" # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac ;; esac fi if test -n "$lt_cv_sys_max_cmd_len"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 printf "%s\n" "$lt_cv_sys_max_cmd_len" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none" >&5 printf "%s\n" "none" >&6; } fi max_cmd_len=$lt_cv_sys_max_cmd_len : ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 printf %s "checking how to convert $build file names to $host format... " >&6; } if test ${lt_cv_to_host_file_cmd+y} then : printf %s "(cached) " >&6 else case e in #( e) case $host in *-*-mingw* ) case $build in *-*-mingw* | *-*-windows* ) # 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* | *-*-windows* ) # 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 ;; esac fi to_host_file_cmd=$lt_cv_to_host_file_cmd { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 printf "%s\n" "$lt_cv_to_host_file_cmd" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 printf %s "checking how to convert $build file names to toolchain format... " >&6; } if test ${lt_cv_to_tool_file_cmd+y} then : printf %s "(cached) " >&6 else case e in #( e) #assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in *-*-mingw* | *-*-windows* ) case $build in *-*-mingw* | *-*-windows* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac ;; esac ;; esac fi to_tool_file_cmd=$lt_cv_to_tool_file_cmd { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 printf "%s\n" "$lt_cv_to_tool_file_cmd" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 printf %s "checking for $LD option to reload object files... " >&6; } if test ${lt_cv_ld_reload_flag+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_ld_reload_flag='-r' ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 printf "%s\n" "$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* | windows* | pw32* | cegcc*) if test yes != "$GCC"; then reload_cmds=false fi ;; darwin*) if test yes = "$GCC"; then reload_cmds='$LTCC $LTCFLAGS -nostdlib $wl-r -o $output$reload_objs' else reload_cmds='$LD$reload_flag -o $output$reload_objs' fi ;; esac # Extract the first word of "file", so it can be a program name with args. set dummy file; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_FILECMD+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$FILECMD"; then ac_cv_prog_FILECMD="$FILECMD" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac 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_FILECMD="file" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_FILECMD" && ac_cv_prog_FILECMD=":" fi ;; esac fi FILECMD=$ac_cv_prog_FILECMD if test -n "$FILECMD"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $FILECMD" >&5 printf "%s\n" "$FILECMD" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi 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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_OBJDUMP+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac 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" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi OBJDUMP=$ac_cv_prog_OBJDUMP if test -n "$OBJDUMP"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 printf "%s\n" "$OBJDUMP" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_OBJDUMP+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac 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" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP if test -n "$ac_ct_OBJDUMP"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 printf "%s\n" "$ac_ct_OBJDUMP" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_OBJDUMP" = x; then OBJDUMP="false" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 printf %s "checking how to recognize dependent libraries... " >&6; } if test ${lt_cv_deplibs_check_method+y} then : printf %s "(cached) " >&6 else case e in #( e) 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. # 'file_magic [[regex]]' -- check by looking for files in library path # that responds to the $file_magic_cmd with a given extended regex. # If you have 'file' or equivalent on your system and you're not sure # whether 'pass_all' will *always* work, you probably want this one. case $host_os in aix[4-9]*) lt_cv_deplibs_check_method=pass_all ;; beos*) lt_cv_deplibs_check_method=pass_all ;; bsdi[45]*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' lt_cv_file_magic_cmd='$FILECMD -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* | windows* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. if ( file / ) >/dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64|pe-aarch64)' 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* | midnightbsd*) 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=$FILECMD 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=$FILECMD 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 ;; *-mlibc) 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=$FILECMD 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__`"; 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 ;; serenity*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; os2*) lt_cv_deplibs_check_method=pass_all ;; esac ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 printf "%s\n" "$lt_cv_deplibs_check_method" >&6; } file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in mingw* | windows* | 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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_DLLTOOL+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac 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" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi DLLTOOL=$ac_cv_prog_DLLTOOL if test -n "$DLLTOOL"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 printf "%s\n" "$DLLTOOL" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_DLLTOOL+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac 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" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL if test -n "$ac_ct_DLLTOOL"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 printf "%s\n" "$ac_ct_DLLTOOL" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_DLLTOOL" = x; then DLLTOOL="false" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 printf %s "checking how to associate runtime and link libraries... " >&6; } if test ${lt_cv_sharedlib_from_linklib_cmd+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in cygwin* | mingw* | windows* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh; # decide which one to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ;; *) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ;; esac ;; *) # fallback: assume linklib IS sharedlib lt_cv_sharedlib_from_linklib_cmd=$ECHO ;; esac ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 printf "%s\n" "$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 # 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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_RANLIB+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac 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" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 printf "%s\n" "$RANLIB" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_RANLIB+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac 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" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 printf "%s\n" "$ac_ct_RANLIB" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then RANLIB=":" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$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 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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_AR+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac 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" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi AR=$ac_cv_prog_AR if test -n "$AR"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 printf "%s\n" "$AR" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_AR+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac 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" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 printf "%s\n" "$ac_ct_AR" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "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:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$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} # Use ARFLAGS variable as AR's operation code to sync the variable naming with # Automake. If both AR_FLAGS and ARFLAGS are specified, AR_FLAGS should have # higher priority because that's what people were doing historically (setting # ARFLAGS for automake and AR_FLAGS for libtool). FIXME: Make the AR_FLAGS # variable obsoleted/removed. test ${AR_FLAGS+y} || AR_FLAGS=${ARFLAGS-cr} lt_ar_flags=$AR_FLAGS # Make AR_FLAGS overridable by 'make ARFLAGS='. Don't try to run-time override # by AR_FLAGS because that was never working and AR_FLAGS is about to die. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 printf %s "checking for archiver @FILE support... " >&6; } if test ${lt_cv_ar_at_file+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_ar_at_file=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; 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=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test 0 -eq "$ac_status"; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test 0 -ne "$ac_status"; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 printf "%s\n" "$lt_cv_ar_at_file" >&6; } if test no = "$lt_cv_ar_at_file"; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_STRIP+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac 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" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 printf "%s\n" "$STRIP" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_STRIP+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac 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" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 printf "%s\n" "$ac_ct_STRIP" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$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=: 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 old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" old_postinstall_cmds="$old_postinstall_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. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 printf %s "checking command to parse $NM output from $compiler object... " >&6; } if test ${lt_cv_sys_global_symbol_pipe+y} then : printf %s "(cached) " >&6 else case e in #( e) # 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* | windows* | pw32* | cegcc*) symcode='[ABCDGISTW]' ;; hpux*) if test ia64 = "$host_cpu"; then symcode='[ABCDEGRST]' fi ;; irix* | nonstopux*) symcode='[BCDEGRST]' ;; osf*) symcode='[BCDEGQRST]' ;; solaris*) symcode='[BCDRT]' ;; sco3.2v5*) symcode='[DT]' ;; sysv4.2uw2*) symcode='[DT]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[ABDT]' ;; sysv4) symcode='[DFNSTU]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[ABCDGIRSTW]' ;; esac if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Gets list of data symbols to import. lt_cv_sys_global_symbol_to_import="$SED -n -e 's/^I .* \(.*\)$/\1/p'" # Adjust the below global symbol transforms to fixup imported variables. lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'" lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'" lt_c_name_lib_hook="\ -e 's/^I .* \(lib.*\)$/ {\"\1\", (void *) 0},/p'\ -e 's/^I .* \(.*\)$/ {\"lib\1\", (void *) 0},/p'" else # Disable hooks by default. lt_cv_sys_global_symbol_to_import= lt_cdecl_hook= lt_c_name_hook= lt_c_name_lib_hook= fi # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="$SED -n"\ $lt_cdecl_hook\ " -e 's/^T .* \(.*\)$/extern int \1();/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="$SED -n"\ $lt_c_name_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'" # Transform an extracted symbol line into symbol name with lib prefix and # symbol address. lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="$SED -n"\ $lt_c_name_lib_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"lib\1\", (void *) \&\1},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw* | windows*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function, # D for any global variable and I for any imported variable. # Also find C++ and __fastcall symbols from MSVC++ or ICC, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK '"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\ " /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\ " /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\ " {split(\$ 0,a,/\||\r/); split(a[2],s)};"\ " s[1]~/^[@?]/{print f,s[1],s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx" else lt_cv_sys_global_symbol_pipe="$SED -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | $SED '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(void){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=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then # Now try to grab the symbols. nlist=conftest.nm $ECHO "$as_me:$LINENO: $NM conftest.$ac_objext | $lt_cv_sys_global_symbol_pipe > $nlist" >&5 if eval "$NM" conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist 2>&5 && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE /* DATA imports from DLLs on WIN32 can't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #elif defined __osf__ /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ LT_DLSYM_CONST struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS LIBS=conftstm.$ac_objext CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest$ac_exeext; then pipe_works=yes fi LIBS=$lt_globsym_save_LIBS CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&5 fi else echo "cannot find nm_test_var in $nlist" >&5 fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 fi else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test yes = "$pipe_works"; then break else lt_cv_sys_global_symbol_pipe= fi done ;; esac 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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: failed" >&5 printf "%s\n" "failed" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ok" >&5 printf "%s\n" "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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 printf %s "checking for sysroot... " >&6; } # Check whether --with-sysroot was given. if test ${with_sysroot+y} then : withval=$with_sysroot; else case e in #( e) with_sysroot=no ;; esac fi lt_sysroot= case $with_sysroot in #( yes) if test yes = "$GCC"; then # Trim trailing / since we'll always append absolute paths and we want # to avoid //, if only for less confusing output for the user. lt_sysroot=`$CC --print-sysroot 2>/dev/null | $SED 's:/\+$::'` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_sysroot" >&5 printf "%s\n" "$with_sysroot" >&6; } as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 ;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 printf "%s\n" "${lt_sysroot:-no}" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a working dd" >&5 printf %s "checking for a working dd... " >&6; } if test ${ac_cv_path_lt_DD+y} then : printf %s "(cached) " >&6 else case e in #( e) printf 0123456789abcdef0123456789abcdef >conftest.i cat conftest.i conftest.i >conftest2.i : ${lt_DD:=$DD} if test -z "$lt_DD"; then ac_path_lt_DD_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_prog in dd do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_lt_DD="$as_dir$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_lt_DD" || continue if "$ac_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=: fi $ac_path_lt_DD_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_lt_DD"; then : fi else ac_cv_path_lt_DD=$lt_DD fi rm -f conftest.i conftest2.i conftest.out ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_lt_DD" >&5 printf "%s\n" "$ac_cv_path_lt_DD" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to truncate binary pipes" >&5 printf %s "checking how to truncate binary pipes... " >&6; } if test ${lt_cv_truncate_bin+y} then : printf %s "(cached) " >&6 else case e in #( e) printf 0123456789abcdef0123456789abcdef >conftest.i cat conftest.i conftest.i >conftest2.i lt_cv_truncate_bin= if "$ac_cv_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1" fi rm -f conftest.i conftest2.i conftest.out test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q" ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_truncate_bin" >&5 printf "%s\n" "$lt_cv_truncate_bin" >&6; } # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. func_cc_basename () { for cc_temp in $*""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` } # Check whether --enable-libtool-lock was given. if test ${enable_libtool_lock+y} then : enableval=$enable_libtool_lock; fi test no = "$enable_libtool_lock" || enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out what ABI is being produced by ac_compile, and set mode # options accordingly. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `$FILECMD conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE=32 ;; *ELF-64*) HPUX_IA64_MODE=64 ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo '#line '$LINENO' "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then if test yes = "$lt_cv_prog_gnu_ld"; then case `$FILECMD conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `$FILECMD conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; mips64*-*linux*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo '#line '$LINENO' "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then emul=elf case `$FILECMD conftest.$ac_objext` in *32-bit*) emul="${emul}32" ;; *64-bit*) emul="${emul}64" ;; esac case `$FILECMD conftest.$ac_objext` in *MSB*) emul="${emul}btsmip" ;; *LSB*) emul="${emul}ltsmip" ;; esac case `$FILECMD conftest.$ac_objext` in *N32*) emul="${emul}n32" ;; esac LD="${LD-ld} -m $emul" fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*|x86_64-gnu*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. Note that the listed cases only cover the # situations where additional linker options are needed (such as when # doing 32-bit compilation for a host where ld defaults to 64-bit, or # vice versa); the common cases where no linker options are needed do # not appear in the list. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `$FILECMD conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*|x86_64-gnu*) case `$FILECMD conftest.o` in *x86-64*) LD="${LD-ld} -m elf32_x86_64" ;; *) LD="${LD-ld} -m elf_i386" ;; esac ;; powerpc64le-*linux*) LD="${LD-ld} -m elf32lppclinux" ;; powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*|x86_64-gnu*) LD="${LD-ld} -m elf_x86_64" ;; powerpcle-*linux*) LD="${LD-ld} -m elf64lppc" ;; powerpc-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS=$CFLAGS CFLAGS="$CFLAGS -belf" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 printf %s "checking whether the C compiler needs -belf... " >&6; } if test ${lt_cv_cc_needs_belf+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 (void) { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : lt_cv_cc_needs_belf=yes else case e in #( e) lt_cv_cc_needs_belf=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ 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 ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 printf "%s\n" "$lt_cv_cc_needs_belf" >&6; } if test yes != "$lt_cv_cc_needs_belf"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS=$SAVE_CFLAGS fi ;; *-*solaris*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `$FILECMD conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) case $host in i?86-*-solaris*|x86_64-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) LD="${LD-ld} -m elf64_sparc" ;; esac # GNU ld 2.21 introduced _sol2 emulations. Use them if available. if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then LD=${LD-ld}_sol2 fi ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks=$enable_libtool_lock if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. set dummy ${ac_tool_prefix}mt; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_MANIFEST_TOOL+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac 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" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL if test -n "$MANIFEST_TOOL"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 printf "%s\n" "$MANIFEST_TOOL" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_MANIFEST_TOOL+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac 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" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL if test -n "$ac_ct_MANIFEST_TOOL"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 printf "%s\n" "$ac_ct_MANIFEST_TOOL" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_MANIFEST_TOOL" = x; then MANIFEST_TOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 printf %s "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } if test ${lt_cv_path_manifest_tool+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_path_manifest_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_manifest_tool=yes fi rm -f conftest* ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_manifest_tool" >&5 printf "%s\n" "$lt_cv_path_manifest_tool" >&6; } if test yes != "$lt_cv_path_manifest_tool"; then MANIFEST_TOOL=: fi case $host_os in rhapsody* | darwin*) if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_DSYMUTIL+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac 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" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi DSYMUTIL=$ac_cv_prog_DSYMUTIL if test -n "$DSYMUTIL"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 printf "%s\n" "$DSYMUTIL" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_DSYMUTIL+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac 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" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL if test -n "$ac_ct_DSYMUTIL"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 printf "%s\n" "$ac_ct_DSYMUTIL" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_DSYMUTIL" = x; then DSYMUTIL=":" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_NMEDIT+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac 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" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi NMEDIT=$ac_cv_prog_NMEDIT if test -n "$NMEDIT"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 printf "%s\n" "$NMEDIT" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_NMEDIT+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac 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" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT if test -n "$ac_ct_NMEDIT"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 printf "%s\n" "$ac_ct_NMEDIT" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_NMEDIT" = x; then NMEDIT=":" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_LIPO+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac 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" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi LIPO=$ac_cv_prog_LIPO if test -n "$LIPO"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 printf "%s\n" "$LIPO" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_LIPO+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac 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" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO if test -n "$ac_ct_LIPO"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 printf "%s\n" "$ac_ct_LIPO" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_LIPO" = x; then LIPO=":" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_OTOOL+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac 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" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi OTOOL=$ac_cv_prog_OTOOL if test -n "$OTOOL"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 printf "%s\n" "$OTOOL" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_OTOOL+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac 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" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL if test -n "$ac_ct_OTOOL"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 printf "%s\n" "$ac_ct_OTOOL" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_OTOOL" = x; then OTOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_OTOOL64+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac 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" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi OTOOL64=$ac_cv_prog_OTOOL64 if test -n "$OTOOL64"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 printf "%s\n" "$OTOOL64" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_OTOOL64+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac 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" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 if test -n "$ac_ct_OTOOL64"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 printf "%s\n" "$ac_ct_OTOOL64" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_OTOOL64" = x; then OTOOL64=":" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 printf %s "checking for -single_module linker flag... " >&6; } if test ${lt_cv_apple_cc_single_mod+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_apple_cc_single_mod=no if test -z "$LT_MULTI_MODULE"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&5 $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? # If there is a non-empty error log, and "single_module" # appears in it, assume the flag caused a linker warning if test -s conftest.err && $GREP single_module conftest.err; then cat conftest.err >&5 # Otherwise, if the output was created with a 0 exit code from # the compiler, it worked. elif test -f libconftest.dylib && test 0 = "$_lt_result"; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&5 fi rm -rf libconftest.dylib* rm -f conftest.* fi ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 printf "%s\n" "$lt_cv_apple_cc_single_mod" >&6; } # Feature test to disable chained fixups since it is not # compatible with '-undefined dynamic_lookup' { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -no_fixup_chains linker flag" >&5 printf %s "checking for -no_fixup_chains linker flag... " >&6; } if test ${lt_cv_support_no_fixup_chains+y} then : printf %s "(cached) " >&6 else case e in #( e) save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -Wl,-no_fixup_chains" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : lt_cv_support_no_fixup_chains=yes else case e in #( e) lt_cv_support_no_fixup_chains=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_support_no_fixup_chains" >&5 printf "%s\n" "$lt_cv_support_no_fixup_chains" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 printf %s "checking for -exported_symbols_list linker flag... " >&6; } if test ${lt_cv_ld_exported_symbols_list+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 (void) { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : lt_cv_ld_exported_symbols_list=yes else case e in #( e) lt_cv_ld_exported_symbols_list=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 printf "%s\n" "$lt_cv_ld_exported_symbols_list" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 printf %s "checking for -force_load linker flag... " >&6; } if test ${lt_cv_ld_force_load+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 $AR_FLAGS libconftest.a conftest.o" >&5 $AR $AR_FLAGS libconftest.a conftest.o 2>&5 echo "$RANLIB libconftest.a" >&5 $RANLIB libconftest.a 2>&5 cat > conftest.c << _LT_EOF int main(void) { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? if test -s conftest.err && $GREP force_load conftest.err; then cat conftest.err >&5 elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then lt_cv_ld_force_load=yes else cat conftest.err >&5 fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 printf "%s\n" "$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*) case $MACOSX_DEPLOYMENT_TARGET,$host in 10.[012],*|,*powerpc*-darwin[5-8]*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; *) _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' if test yes = "$lt_cv_support_no_fixup_chains"; then as_fn_append _lt_dar_allow_undefined ' $wl-no_fixup_chains' fi ;; esac ;; esac if test yes = "$lt_cv_apple_cc_single_mod"; then _lt_dar_single_mod='$single_module' fi _lt_dar_needs_single_mod=no case $host_os in rhapsody* | darwin1.*) _lt_dar_needs_single_mod=yes ;; darwin*) # When targeting Mac OS X 10.4 (darwin 8) or later, # -single_module is the default and -multi_module is unsupported. # The toolchain on macOS 10.14 (darwin 18) and later cannot # target any OS version that needs -single_module. case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*-darwin[567].*|10.[0-3],*-darwin[5-9].*|10.[0-3],*-darwin1[0-7].*) _lt_dar_needs_single_mod=yes ;; esac ;; esac if test yes = "$lt_cv_ld_exported_symbols_list"; then _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib' fi if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac # func_munge_path_list VARIABLE PATH # ----------------------------------- # VARIABLE is name of variable containing _space_ separated list of # directories to be munged by the contents of PATH, which is string # having a format: # "DIR[:DIR]:" # string "DIR[ DIR]" will be prepended to VARIABLE # ":DIR[:DIR]" # string "DIR[ DIR]" will be appended to VARIABLE # "DIRP[:DIRP]::[DIRA:]DIRA" # string "DIRP[ DIRP]" will be prepended to VARIABLE and string # "DIRA[ DIRA]" will be appended to VARIABLE # "DIR[:DIR]" # VARIABLE will be replaced by "DIR[ DIR]" func_munge_path_list () { case x$2 in x) ;; *:) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\" ;; x:*) eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\" ;; *::*) eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\" ;; *) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\" ;; esac } 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 : printf "%s\n" "#define HAVE_DLFCN_H 1" >>confdefs.h fi # Set options enable_dlopen=no enable_win32_dll=no # Check whether --enable-shared was given. if test ${enable_shared+y} 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 case e in #( e) enable_shared=yes ;; esac fi # Check whether --enable-static was given. if test ${enable_static+y} 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 case e in #( e) enable_static=yes ;; esac fi # Check whether --enable-pic was given. if test ${enable_pic+y} then : enableval=$enable_pic; lt_p=${PACKAGE-default} case $enableval in yes|no) pic_mode=$enableval ;; *) 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 $enableval; 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 case e in #( e) # Check whether --with-pic was given. if test ${with_pic+y} 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 case e in #( e) pic_mode=default ;; esac fi ;; esac fi # Check whether --enable-fast-install was given. if test ${enable_fast_install+y} 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 case e in #( e) enable_fast_install=yes ;; esac fi shared_archive_member_spec= case $host,$enable_shared in power*-*-aix[5-9]*,yes) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking which variant of shared library versioning to provide" >&5 printf %s "checking which variant of shared library versioning to provide... " >&6; } # Check whether --enable-aix-soname was given. if test ${enable_aix_soname+y} then : enableval=$enable_aix_soname; case $enableval in aix|svr4|both) ;; *) as_fn_error $? "Unknown argument to --enable-aix-soname" "$LINENO" 5 ;; esac lt_cv_with_aix_soname=$enable_aix_soname else case e in #( e) # Check whether --with-aix-soname was given. if test ${with_aix_soname+y} then : withval=$with_aix_soname; case $withval in aix|svr4|both) ;; *) as_fn_error $? "Unknown argument to --with-aix-soname" "$LINENO" 5 ;; esac lt_cv_with_aix_soname=$with_aix_soname else case e in #( e) if test ${lt_cv_with_aix_soname+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_with_aix_soname=aix ;; esac fi ;; esac fi enable_aix_soname=$lt_cv_with_aix_soname ;; esac fi with_aix_soname=$enable_aix_soname { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_aix_soname" >&5 printf "%s\n" "$with_aix_soname" >&6; } if test aix != "$with_aix_soname"; then # For the AIX way of multilib, we name the shared archive member # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o', # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File. # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag, # the AIX toolchain works better with OBJECT_MODE set (default 32). if test 64 = "${OBJECT_MODE-32}"; then shared_archive_member_spec=shr_64 else shared_archive_member_spec=shr fi fi ;; *) with_aix_soname=aix ;; esac # This can be used to rebuild libtool when needed LIBTOOL_DEPS=$ltmain # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' test -z "$LN_S" && LN_S="ln -s" if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 printf %s "checking for objdir... " >&6; } if test ${lt_cv_objdir+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 printf "%s\n" "$lt_cv_objdir" >&6; } objdir=$lt_cv_objdir printf "%s\n" "#define LT_OBJDIR \"$lt_cv_objdir/\"" >>confdefs.h case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a '.a' archive for static linking (except MSVC and # ICC, which need '.lib'). libext=a with_gnu_ld=$lt_cv_prog_gnu_ld old_CC=$CC old_CFLAGS=$CFLAGS # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o func_cc_basename $compiler cc_basename=$func_cc_basename_result # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 printf %s "checking for ${ac_tool_prefix}file... " >&6; } if test ${lt_cv_path_MAGIC_CMD+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 ;; esac fi MAGIC_CMD=$lt_cv_path_MAGIC_CMD if test -n "$MAGIC_CMD"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 printf "%s\n" "$MAGIC_CMD" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for file" >&5 printf %s "checking for file... " >&6; } if test ${lt_cv_path_MAGIC_CMD+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 ;; esac fi MAGIC_CMD=$lt_cv_path_MAGIC_CMD if test -n "$MAGIC_CMD"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 printf "%s\n" "$MAGIC_CMD" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "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(void){return(0);}' # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then lt_prog_compiler_no_builtin_flag= if test yes = "$GCC"; then case $cc_basename in nvcc*) lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; *) lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 printf %s "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } if test ${lt_cv_prog_compiler_rtti_exceptions+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-fno-rtti -fno-exceptions" ## exclude from sc_useless_quotes_in_assignment # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_rtti_exceptions=yes fi fi $RM conftest* ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 printf "%s\n" "$lt_cv_prog_compiler_rtti_exceptions" >&6; } if test yes = "$lt_cv_prog_compiler_rtti_exceptions"; then lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" else : fi fi lt_prog_compiler_wl= lt_prog_compiler_pic= lt_prog_compiler_static= if test yes = "$GCC"; then lt_prog_compiler_wl='-Wl,' lt_prog_compiler_static='-static' case $host_os in aix*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' fi lt_prog_compiler_pic='-fPIC' ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support lt_prog_compiler_pic='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the '-m68020' flag to GCC prevents building anything better, # like '-m68040'. lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | windows* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries lt_prog_compiler_pic='-DDLL_EXPORT' case $host_os in os2*) lt_prog_compiler_static='$wl-static' ;; esac ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. lt_prog_compiler_static= ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) lt_prog_compiler_pic='-fPIC' ;; esac ;; interix[3-9]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic=-Kconform_pic fi ;; *) lt_prog_compiler_pic='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 lt_prog_compiler_wl='-Xlinker ' if test -n "$lt_prog_compiler_pic"; then lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic" fi ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl='-Wl,' if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' else lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' fi ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' case $cc_basename in nagfor*) # NAG Fortran compiler lt_prog_compiler_wl='-Wl,-Wl,,' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; esac ;; mingw* | windows* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic='-DDLL_EXPORT' case $host_os in os2*) lt_prog_compiler_static='$wl-static' ;; esac ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static='$wl-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in # old Intel for x86_64, which still supported -KPIC. ecc*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-static' ;; *flang* | ftn | f18* | f95*) # Flang compiler. lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; # flang / f18. f95 an alias for gfortran or flang on Debian flang* | f18* | f95*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; # Lahey Fortran 8.1. lf95*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='--shared' lt_prog_compiler_static='--static' ;; nagfor*) # NAG Fortran compiler lt_prog_compiler_wl='-Wl,-Wl,,' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; tcc*) # Fabrice Bellard et al's Tiny C Compiler lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; ccc*) lt_prog_compiler_wl='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-qpic' lt_prog_compiler_static='-qstaticlink' ;; *) case `$CC -V 2>&1 | $SED 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='' ;; *Sun\ F* | *Sun*Fortran*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Qoption ld ' ;; *Sun\ C*) # Sun C 5.9 lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Wl,' ;; *Intel*\ [CF]*Compiler*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; *Portland\ Group*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; esac ;; esac ;; newsos6) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; *-mlibc) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; *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' ;; serenity*) ;; solaris*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) lt_prog_compiler_wl='-Qoption ld ';; *) lt_prog_compiler_wl='-Wl,';; esac ;; sunos4*) lt_prog_compiler_wl='-Qoption ld ' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic='-Kconform_pic' lt_prog_compiler_static='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; unicos*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_can_build_shared=no ;; uts4*) lt_prog_compiler_pic='-pic' lt_prog_compiler_static='-Bstatic' ;; *) lt_prog_compiler_can_build_shared=no ;; esac fi case $host_os in # For platforms that do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic= ;; *) lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" ;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 printf %s "checking for $compiler option to produce PIC... " >&6; } if test ${lt_cv_prog_compiler_pic+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_prog_compiler_pic=$lt_prog_compiler_pic ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 printf "%s\n" "$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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 printf %s "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } if test ${lt_cv_prog_compiler_pic_works+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_prog_compiler_pic_works=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic -DPIC" ## exclude from sc_useless_quotes_in_assignment # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works=yes fi fi $RM conftest* ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 printf "%s\n" "$lt_cv_prog_compiler_pic_works" >&6; } if test yes = "$lt_cv_prog_compiler_pic_works"; then case $lt_prog_compiler_pic in "" | " "*) ;; *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; esac else lt_prog_compiler_pic= lt_prog_compiler_can_build_shared=no fi fi # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 printf %s "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } if test ${lt_cv_prog_compiler_static_works+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 printf "%s\n" "$lt_cv_prog_compiler_static_works" >&6; } if test yes = "$lt_cv_prog_compiler_static_works"; then : else lt_prog_compiler_static= fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 printf %s "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if test ${lt_cv_prog_compiler_c_o+y} then : printf %s "(cached) " >&6 else case e in #( e) 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* ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 printf "%s\n" "$lt_cv_prog_compiler_c_o" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 printf %s "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if test ${lt_cv_prog_compiler_c_o+y} then : printf %s "(cached) " >&6 else case e in #( e) 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* ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 printf "%s\n" "$lt_cv_prog_compiler_c_o" >&6; } hard_links=nottested if test no = "$lt_cv_prog_compiler_c_o" && test no != "$need_locks"; then # do not overwrite the value of need_locks provided by the user { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 printf %s "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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 printf "%s\n" "$hard_links" >&6; } if test no = "$hard_links"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5 printf "%s\n" "$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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 printf %s "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* | windows* | pw32* | cegcc*) # FIXME: the MSVC++ and ICC port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++ or Intel C++ Compiler. if test yes != "$GCC"; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++ or ICC) with_gnu_ld=yes ;; 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 yes = "$with_gnu_ld"; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility # with the native linker. However, as the warning in the GNU ld # block says, versions before 2.19.5* couldn't really create working # shared libraries, regardless of the interface used. case `$LD -v 2>&1` in *\ \(GNU\ Binutils\)\ 2.19.5*) ;; *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; *\ \(GNU\ Binutils\)\ [3-9]*) ;; *) lt_use_gnu_ld_interface=yes ;; esac ;; *) lt_use_gnu_ld_interface=yes ;; esac fi if test yes = "$lt_use_gnu_ld_interface"; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='$wl' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' export_dynamic_flag_spec='$wl--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then whole_archive_flag_spec=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' else whole_archive_flag_spec= fi supports_anon_versioning=no case `$LD -v | $SED -e 's/([^)]\+)\s\+//' 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[3-9]*) # On AIX/PPC, the GNU linker is very broken if test ia64 != "$host_cpu"; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then allow_undefined_flag=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' else ld_shlibs=no fi ;; cygwin* | mingw* | windows* | 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' file_list_spec='@' if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file, use it as # is; otherwise, prepend EXPORTS... archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs=no fi ;; haiku*) archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' link_all_deplibs=no ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported shrext_cmds=.dll archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' old_archive_from_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' enable_shared_with_static_runtimes=yes file_list_spec='@' ;; interix[3-9]*) hardcode_direct=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='$wl-rpath,$libdir' export_dynamic_flag_spec='$wl-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds='$SED "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test linux-dietlibc = "$host_os"; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test no = "$tmp_diet" then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 whole_archive_flag_spec= tmp_sharedflag='--shared' ;; nagfor*) # NAGFOR 5.3 tmp_sharedflag='-Wl,-shared' ;; xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' compiler_needs_object=yes ;; esac case `$CC -V 2>&1 | $SED 5q` in *Sun\ C*) # Sun C 5.9 whole_archive_flag_spec='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' compiler_needs_object=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' if test yes = "$supports_anon_versioning"; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi case $cc_basename in tcc*) hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' export_dynamic_flag_spec='-rdynamic' ;; xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test yes = "$supports_anon_versioning"; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else ld_shlibs=no fi ;; *-mlibc) 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' ;; 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 cannot *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac ;; sunos4*) archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct=yes hardcode_shlibpath_var=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac if test no = "$ld_shlibs"; then runpath_var= hardcode_libdir_flag_spec= export_dynamic_flag_spec= whole_archive_flag_spec= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag=unsupported always_export_symbols=yes archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported fi ;; aix[4-9]*) if test ia64 = "$host_cpu"; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag= else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to GNU nm, but means don't demangle to AIX nm. # Without the "-l" option, or with the "-B" option, AIX nm treats # weak defined symbols like other global defined symbols, whereas # GNU nm marks them as "W". # While the 'weak' keyword is ignored in the Export File, we need # it in the Import File for the 'aix-soname' feature, so we have # to replace the "-B" option with "-P" for AIX nm. if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else export_symbols_cmds='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # have runtime linking enabled, and use it for executables. # For shared libraries, we enable/disable runtime linking # depending on the kind of the shared library created - # when "with_aix_soname,aix_use_runtimelinking" is: # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables # "aix,yes" lib.so shared, rtl:yes, for executables # lib.a static archive # "both,no" lib.so.V(shr.o) shared, rtl:yes # lib.a(lib.so.V) shared, rtl:no, for executables # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a(lib.so.V) shared, rtl:no # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a static archive case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then aix_use_runtimelinking=yes break fi done if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then # With aix-soname=svr4, we create the lib.so.V shared archives only, # so we don't have lib.a shared libs to link our executables. # We have to force runtime linking in this case. aix_use_runtimelinking=yes LDFLAGS="$LDFLAGS -Wl,-brtl" fi ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds='' hardcode_direct=yes hardcode_direct_absolute=yes hardcode_libdir_separator=':' link_all_deplibs=yes file_list_spec='$wl-f,' case $with_aix_soname,$aix_use_runtimelinking in aix,*) ;; # traditional, no import file svr4,* | *,yes) # use import file # The Import File defines what to hardcode. hardcode_direct=no hardcode_direct_absolute=no ;; esac if test yes = "$GCC"; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`$CC -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 hardcode_direct=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L=yes hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_separator= fi ;; esac shared_flag='-shared' if test yes = "$aix_use_runtimelinking"; then shared_flag="$shared_flag "'$wl-G' fi # Need to ensure runtime linking is disabled for the traditional # shared library, or the linker may eventually find shared libraries # /with/ Import File - we do not want to mix them. shared_flag_aix='-shared' shared_flag_svr4='-shared $wl-G' else # not using gcc if test ia64 = "$host_cpu"; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test yes = "$aix_use_runtimelinking"; then shared_flag='$wl-G' else shared_flag='$wl-bM:SRE' fi shared_flag_aix='$wl-bM:SRE' shared_flag_svr4='$wl-G' fi fi export_dynamic_flag_spec='$wl-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols=yes if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag='-berok' # Determine the default libpath from the value encoded in an # empty executable. if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else if test ${lt_cv_aix_libpath_+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; 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.beam \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=/usr/lib:/lib fi ;; esac fi aix_libpath=$lt_cv_aix_libpath_ fi hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag else if test ia64 = "$host_cpu"; then hardcode_libdir_flag_spec='$wl-R $libdir:/usr/lib:/lib' allow_undefined_flag="-z nodefs" archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else if test ${lt_cv_aix_libpath_+y} then : printf %s "(cached) " >&6 else case e in #( e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; 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.beam \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=/usr/lib:/lib fi ;; esac fi aix_libpath=$lt_cv_aix_libpath_ fi hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag=' $wl-bernotok' allow_undefined_flag=' $wl-berok' if test yes = "$with_gnu_ld"; then # We only use this code for GNU lds that support --whole-archive. whole_archive_flag_spec='$wl--whole-archive$convenience $wl--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec='$convenience' fi archive_cmds_need_lc=yes archive_expsym_cmds='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' # -brtl affects multiple linker settings, -berok does not and is overridden later compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([, ]\\)%-berok\\1%g"`' if test svr4 != "$with_aix_soname"; then # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' fi if test aix != "$with_aix_soname"; then archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' else # used by -dlpreopen to get the symbols archive_expsym_cmds="$archive_expsym_cmds"'~$MV $output_objdir/$realname.d/$soname $output_objdir' fi archive_expsym_cmds="$archive_expsym_cmds"'~$RM -r $output_objdir/$realname.d' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; bsdi[45]*) export_dynamic_flag_spec=-rdynamic ;; cygwin* | mingw* | windows* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++ or Intel C++ Compiler. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl* | icl*) # Native MSVC or ICC 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 -Fe$output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then cp "$export_symbols" "$output_objdir/$soname.def"; echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; else $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -Fe$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 and ICC wrapper hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_from_new_cmds='true' # FIXME: Should let the user specify the lib program. old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' enable_shared_with_static_runtimes=yes ;; esac ;; darwin* | rhapsody*) archive_cmds_need_lc=no hardcode_direct=no hardcode_automatic=yes hardcode_shlibpath_var=unsupported if test yes = "$lt_cv_ld_force_load"; then whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' else whole_archive_flag_spec='' fi link_all_deplibs=yes allow_undefined_flag=$_lt_dar_allow_undefined case $cc_basename in ifort*|nagfor*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test yes = "$_lt_dar_can_shared"; then output_verbose_link_cmd=func_echo_all archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" archive_expsym_cmds="$SED 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" module_expsym_cmds="$SED -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" else ld_shlibs=no fi ;; dgux*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2.*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly* | midnightbsd*) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; hpux9*) if test yes = "$GCC"; then archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' else archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec='$wl+b $wl$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes export_dynamic_flag_spec='$wl-E' ;; hpux10*) if test yes,no = "$GCC,$with_gnu_ld"; then archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test no = "$with_gnu_ld"; then hardcode_libdir_flag_spec='$wl+b $wl$libdir' hardcode_libdir_separator=: hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='$wl-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes fi ;; hpux11*) if test yes,no = "$GCC,$with_gnu_ld"; then case $host_cpu in hppa*64*) archive_cmds='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) archive_cmds='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 printf %s "checking if $CC understands -b... " >&6; } if test ${lt_cv_prog_compiler__b+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 printf "%s\n" "$lt_cv_prog_compiler__b" >&6; } if test yes = "$lt_cv_prog_compiler__b"; then archive_cmds='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi ;; esac fi if test no = "$with_gnu_ld"; then hardcode_libdir_flag_spec='$wl+b $wl$libdir' hardcode_libdir_separator=: case $host_cpu in hppa*64*|ia64*) hardcode_direct=no hardcode_shlibpath_var=no ;; *) hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='$wl-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test yes = "$GCC"; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 printf %s "checking whether the $host_os linker accepts -exported_symbol... " >&6; } if test ${lt_cv_irix_exported_symbol+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 case e in #( e) lt_cv_irix_exported_symbol=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 printf "%s\n" "$lt_cv_irix_exported_symbol" >&6; } if test yes = "$lt_cv_irix_exported_symbol"; then archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib' fi link_all_deplibs=no else archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' hardcode_libdir_separator=: inherit_rpath=yes link_all_deplibs=yes ;; linux*) case $cc_basename in tcc*) # Fabrice Bellard et al's Tiny C Compiler ld_shlibs=yes archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' ;; esac ;; *-mlibc) ;; 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__`"; then archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols' hardcode_libdir_flag_spec='$wl-rpath,$libdir' export_dynamic_flag_spec='$wl-E' else archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='$wl-rpath,$libdir' fi else ld_shlibs=no fi ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported shrext_cmds=.dll archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' old_archive_from_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' enable_shared_with_static_runtimes=yes file_list_spec='@' ;; osf3*) if test yes = "$GCC"; then allow_undefined_flag=' $wl-expect_unresolved $wl\*' archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test yes = "$GCC"; then allow_undefined_flag=' $wl-expect_unresolved $wl\*' archive_cmds='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' fi archive_cmds_need_lc='no' hardcode_libdir_separator=: ;; serenity*) ;; solaris*) no_undefined_flag=' -z defs' if test yes = "$GCC"; then wlarc='$wl' archive_cmds='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' archive_cmds='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='$wl' archive_cmds='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi hardcode_libdir_flag_spec='-R$libdir' hardcode_shlibpath_var=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands '-z linker_flag'. GCC discards it without '$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test yes = "$GCC"; then whole_archive_flag_spec='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' else whole_archive_flag_spec='-z allextract$convenience -z defaultextract' fi ;; esac link_all_deplibs=yes ;; sunos4*) if test sequent = "$host_vendor"; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; sysv4) case $host_vendor in sni) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds='$CC -r -o $output$reload_objs' hardcode_direct=no ;; motorola) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var=no ;; sysv4.3*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no export_dynamic_flag_spec='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) no_undefined_flag='$wl-z,text' archive_cmds_need_lc=no hardcode_shlibpath_var=no runpath_var='LD_RUN_PATH' if test yes = "$GCC"; then archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We CANNOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. no_undefined_flag='$wl-z,text' allow_undefined_flag='$wl-z,nodefs' archive_cmds_need_lc=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='$wl-R,$libdir' hardcode_libdir_separator=':' link_all_deplibs=yes export_dynamic_flag_spec='$wl-Bexport' runpath_var='LD_RUN_PATH' if test yes = "$GCC"; then archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; *) ld_shlibs=no ;; esac if test sni = "$host_vendor"; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) export_dynamic_flag_spec='$wl-Blargedynsym' ;; esac fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 printf "%s\n" "$ld_shlibs" >&6; } test no = "$ld_shlibs" && can_build_shared=no with_gnu_ld=$with_gnu_ld # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc" in x|xyes) # Assume -lc should be added archive_cmds_need_lc=yes if test yes,yes = "$GCC,$enable_shared"; then case $archive_cmds in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 printf %s "checking whether -lc should be explicitly linked in... " >&6; } if test ${lt_cv_archive_cmds_need_lc+y} then : printf %s "(cached) " >&6 else case e in #( e) $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=$? printf "%s\n" "$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=$? printf "%s\n" "$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* ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 printf "%s\n" "$lt_cv_archive_cmds_need_lc" >&6; } archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc ;; esac fi ;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 printf %s "checking dynamic linker characteristics... " >&6; } if test yes = "$GCC"; then case $host_os in darwin*) lt_awk_arg='/^libraries:/,/LR/' ;; *) lt_awk_arg='/^libraries:/' ;; esac case $host_os in mingw* | windows* | cegcc*) lt_sed_strip_eq='s|=\([A-Za-z]:\)|\1|g' ;; *) lt_sed_strip_eq='s|=/|/|g' ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in *\;*) # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` ;; *) lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` ;; esac # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary... lt_tmp_lt_search_path_spec= lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` # ...but if some path component already ends with the multilib dir we assume # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer). case "$lt_multi_os_dir; $lt_search_path_spec " in "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*) lt_multi_os_dir= ;; esac for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir" elif test -n "$lt_multi_os_dir"; then test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS = " "; FS = "/|\n";} { lt_foo = ""; lt_count = 0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo = "/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[lt_foo]++; } if (lt_freq[lt_foo] == 1) { print lt_foo; } }'` # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in mingw* | windows* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's|/\([A-Za-z]:\)|\1|g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=.so postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='$libname$release$shared_ext$major' ;; aix[4-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test ia64 = "$host_cpu"; then # AIX 5 supports IA64 library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line '#! .'. This would cause the generated library to # depend on '.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # Using Import Files as archive members, it is possible to support # filename-based versioning of shared library archives on AIX. While # this would work for both with and without runtime linking, it will # prevent static linking of such archives. So we do filename-based # shared library versioning with .so extension only, which is used # when both runtime linking and shared linking is enabled. # Unfortunately, runtime linking may impact performance, so we do # not want this to be the default eventually. Also, we use the # versioned .so libs for executables only if there is the -brtl # linker flag in LDFLAGS as well, or --enable-aix-soname=svr4 only. # To allow for filename-based versioning support, we need to create # libNAME.so.V as an archive file, containing: # *) an Import File, referring to the versioned filename of the # archive as well as the shared archive member, telling the # bitwidth (32 or 64) of that shared object, and providing the # list of exported symbols of that shared object, eventually # decorated with the 'weak' keyword # *) the shared object with the F_LOADONLY flag set, to really avoid # it being seen by the linker. # At run time we better use the real file rather than another symlink, # but for link time we create the symlink libNAME.so -> libNAME.so.V case $with_aix_soname,$aix_use_runtimelinking in # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. aix,yes) # traditional libtool dynamic_linker='AIX unversionable lib.so' # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; aix,no) # traditional AIX only dynamic_linker='AIX lib.a(lib.so.V)' # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' ;; svr4,*) # full svr4 only dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o)" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,yes) # both, prefer svr4 dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o), lib.a(lib.so.V)" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # unpreferred sharedlib libNAME.a needs extra handling postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,no) # both, prefer aix dynamic_linker="AIX lib.a(lib.so.V), lib.so.V($shared_archive_member_spec.o)" library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' ;; esac shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='$libname$shared_ext' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | windows* | 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 # If user builds GCC with multilib enabled, # it should just install on $(libdir) # not on $(libdir)/../bin or 32 bits dlls would override 64 bit ones. if test xyes = x"$multilib"; then postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ $install_prog $dir/$dlname $destdir/$dlname~ chmod a+x $destdir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib $destdir/$dlname'\'' || exit \$?; fi' else 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' 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* | windows* | 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* | *,icl*) # Native MSVC or ICC 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* | windows*) 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 and ICC 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* | midnightbsd*) # 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$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' need_version=yes ;; esac case $host_cpu in powerpc64) # On FreeBSD bi-arch platforms, a different variable is used for 32-bit # binaries. See . cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int test_pointer_size[sizeof (void *) - 5]; _ACEOF if ac_fn_c_try_compile "$LINENO" then : shlibpath_var=LD_LIBRARY_PATH else case e in #( e) shlibpath_var=LD_32_LIBRARY_PATH ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; *) shlibpath_var=LD_LIBRARY_PATH ;; esac case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec='/boot/system/non-packaged/develop/lib /boot/system/develop/lib' sys_lib_dlsearch_path_spec='/boot/home/config/non-packaged/lib /boot/home/config/lib /boot/system/non-packaged/lib /boot/system/lib' hardcode_into_libs=no ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' if test 32 = "$HPUX_IA64_MODE"; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" sys_lib_dlsearch_path_spec=/usr/lib/hpux32 else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" sys_lib_dlsearch_path_spec=/usr/lib/hpux64 fi ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[3-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test yes = "$lt_cv_prog_gnu_ld"; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='$libname$release$shared_ext$major' library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff" sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; linux*android*) version_type=none # Android doesn't support versioned libraries. need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext $libname$shared_ext' soname_spec='$libname$release$shared_ext' finish_cmds= shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes dynamic_linker='Android linker' # -rpath works at least for libraries that are not overridden by # libraries installed in system locations. hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH if test ${lt_cv_shlibpath_overrides_runpath+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 (void) { ; 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.beam \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir ;; esac fi shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Ideally, we could use ldconfig to report *all* directories which are # searched for libraries, however this is still not possible. Aside from not # being certain /sbin/ldconfig is available, command # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, # even though it is searched at run-time. Try to do the best guess by # appending ld.so.conf contents (and includes) to the search path. if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; 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' ;; 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 ;; *-mlibc) 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='mlibc ld.so' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no 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 if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then need_version=no else need_version=yes fi library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; os2*) libname_spec='$name' version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no # OS/2 can only load a DLL with a base name of 8 characters or less. soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; v=$($ECHO $release$versuffix | tr -d .-); n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); $ECHO $n$v`$shared_ext' library_names_spec='${libname}_dll.$libext' dynamic_linker='OS/2 ld.exe' shlibpath_var=BEGINLIBPATH sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='$libname$release$shared_ext$major' library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; rdos*) dynamic_linker=no ;; serenity*) 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=no dynamic_linker='SerenityOS LibELF' ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test yes = "$with_gnu_ld"; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec; then version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext' soname_spec='$libname$shared_ext.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=sco need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test yes = "$with_gnu_ld"; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; emscripten*) version_type=none need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext' soname_spec='$libname$release$shared_ext' finish_cmds= dynamic_linker="Emscripten linker" lt_prog_compiler_wl= lt_prog_compiler_pic= lt_prog_compiler_static= if test yes = "$GCC"; then lt_prog_compiler_wl='-Wl,' lt_prog_compiler_static='-static' case $host_os in aix*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' fi lt_prog_compiler_pic='-fPIC' ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support lt_prog_compiler_pic='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the '-m68020' flag to GCC prevents building anything better, # like '-m68040'. lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | windows* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries lt_prog_compiler_pic='-DDLL_EXPORT' case $host_os in os2*) lt_prog_compiler_static='$wl-static' ;; esac ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. lt_prog_compiler_static= ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) lt_prog_compiler_pic='-fPIC' ;; esac ;; interix[3-9]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic=-Kconform_pic fi ;; *) lt_prog_compiler_pic='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 lt_prog_compiler_wl='-Xlinker ' if test -n "$lt_prog_compiler_pic"; then lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic" fi ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl='-Wl,' if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' else lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' fi ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' case $cc_basename in nagfor*) # NAG Fortran compiler lt_prog_compiler_wl='-Wl,-Wl,,' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; esac ;; mingw* | windows* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic='-DDLL_EXPORT' case $host_os in os2*) lt_prog_compiler_static='$wl-static' ;; esac ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static='$wl-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in # old Intel for x86_64, which still supported -KPIC. ecc*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-static' ;; *flang* | ftn | f18* | f95*) # Flang compiler. lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; # flang / f18. f95 an alias for gfortran or flang on Debian flang* | f18* | f95*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; # Lahey Fortran 8.1. lf95*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='--shared' lt_prog_compiler_static='--static' ;; nagfor*) # NAG Fortran compiler lt_prog_compiler_wl='-Wl,-Wl,,' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; tcc*) # Fabrice Bellard et al's Tiny C Compiler lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; ccc*) lt_prog_compiler_wl='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-qpic' lt_prog_compiler_static='-qstaticlink' ;; *) case `$CC -V 2>&1 | $SED 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='' ;; *Sun\ F* | *Sun*Fortran*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Qoption ld ' ;; *Sun\ C*) # Sun C 5.9 lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Wl,' ;; *Intel*\ [CF]*Compiler*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; *Portland\ Group*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; esac ;; esac ;; newsos6) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; *-mlibc) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; *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' ;; serenity*) ;; solaris*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) lt_prog_compiler_wl='-Qoption ld ';; *) lt_prog_compiler_wl='-Wl,';; esac ;; sunos4*) lt_prog_compiler_wl='-Qoption ld ' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic='-Kconform_pic' lt_prog_compiler_static='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; unicos*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_can_build_shared=no ;; uts4*) lt_prog_compiler_pic='-pic' lt_prog_compiler_static='-Bstatic' ;; *) lt_prog_compiler_can_build_shared=no ;; esac fi case $host_os in # For platforms that do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic= ;; *) lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" ;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 printf %s "checking for $compiler option to produce PIC... " >&6; } if test ${lt_cv_prog_compiler_pic+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_prog_compiler_pic=$lt_prog_compiler_pic ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 printf "%s\n" "$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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 printf %s "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } if test ${lt_cv_prog_compiler_pic_works+y} then : printf %s "(cached) " >&6 else case e in #( e) lt_cv_prog_compiler_pic_works=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic -DPIC" ## exclude from sc_useless_quotes_in_assignment # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works=yes fi fi $RM conftest* ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 printf "%s\n" "$lt_cv_prog_compiler_pic_works" >&6; } if test yes = "$lt_cv_prog_compiler_pic_works"; then case $lt_prog_compiler_pic in "" | " "*) ;; *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; esac else lt_prog_compiler_pic= lt_prog_compiler_can_build_shared=no fi fi # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 printf %s "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } if test ${lt_cv_prog_compiler_static_works+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 printf "%s\n" "$lt_cv_prog_compiler_static_works" >&6; } if test yes = "$lt_cv_prog_compiler_static_works"; then : else lt_prog_compiler_static= fi ='-fPIC' archive_cmds='$CC -sSIDE_MODULE=2 -shared $libobjs $deplibs $compiler_flags -o $lib' archive_expsym_cmds='$SED "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -sSIDE_MODULE=2 -shared $libobjs $deplibs $compiler_flags -o $lib -s EXPORTED_FUNCTIONS=@$output_objdir/$soname.expsym' archive_cmds_need_lc=no no_undefined_flag= ;; *) dynamic_linker=no ;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 printf "%s\n" "$dynamic_linker" >&6; } test no = "$dynamic_linker" && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test yes = "$GCC"; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec fi if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec fi # remember unaugmented sys_lib_dlsearch_path content for libtool script decls... configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec # ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" # to be used as default LT_SYS_LIBRARY_PATH value in generated libtool configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 printf %s "checking how to hardcode library paths into programs... " >&6; } hardcode_action= if test -n "$hardcode_libdir_flag_spec" || test -n "$runpath_var" || test yes = "$hardcode_automatic"; then # We can hardcode non-existent directories. if test no != "$hardcode_direct" && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, )" && test no != "$hardcode_minus_L"; then # Linking always hardcodes the temporary library directory. hardcode_action=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action=unsupported fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 printf "%s\n" "$hardcode_action" >&6; } if test relink = "$hardcode_action" || test yes = "$inherit_rpath"; then # Fast installation is not supported enable_fast_install=no elif test yes = "$shlibpath_overrides_runpath" || test no = "$enable_shared"; then # Fast installation is not necessary enable_fast_install=needless fi if test yes != "$enable_dlopen"; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen=load_add_on lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | windows* | 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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 printf %s "checking for dlopen in -ldl... " >&6; } if test ${ac_cv_lib_dl_dlopen+y} then : printf %s "(cached) " >&6 else case e in #( e) 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. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char dlopen (void); int main (void) { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_dl_dlopen=yes else case e in #( e) ac_cv_lib_dl_dlopen=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 printf "%s\n" "$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 case e in #( e) lt_cv_dlopen=dyld lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; esac fi ;; tpf*) # Don't try to run any link tests for TPF. We know it's impossible # because TPF is a cross-compiler, and we know how we open DSOs. lt_cv_dlopen=dlopen lt_cv_dlopen_libs= lt_cv_dlopen_self=no ;; *) ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" if test "x$ac_cv_func_shl_load" = xyes then : lt_cv_dlopen=shl_load else case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 printf %s "checking for shl_load in -ldld... " >&6; } if test ${ac_cv_lib_dld_shl_load+y} then : printf %s "(cached) " >&6 else case e in #( e) 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. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char shl_load (void); int main (void) { return shl_load (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_dld_shl_load=yes else case e in #( e) ac_cv_lib_dld_shl_load=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 printf "%s\n" "$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 case e in #( e) 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 case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 printf %s "checking for dlopen in -ldl... " >&6; } if test ${ac_cv_lib_dl_dlopen+y} then : printf %s "(cached) " >&6 else case e in #( e) 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. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char dlopen (void); int main (void) { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_dl_dlopen=yes else case e in #( e) ac_cv_lib_dl_dlopen=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 printf "%s\n" "$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 case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 printf %s "checking for dlopen in -lsvld... " >&6; } if test ${ac_cv_lib_svld_dlopen+y} then : printf %s "(cached) " >&6 else case e in #( e) 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. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char dlopen (void); int main (void) { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_svld_dlopen=yes else case e in #( e) ac_cv_lib_svld_dlopen=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 printf "%s\n" "$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 case e in #( e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 printf %s "checking for dld_link in -ldld... " >&6; } if test ${ac_cv_lib_dld_dld_link+y} then : printf %s "(cached) " >&6 else case e in #( e) 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. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char dld_link (void); int main (void) { return dld_link (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_dld_dld_link=yes else case e in #( e) ac_cv_lib_dld_dld_link=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 printf "%s\n" "$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 ;; esac fi ;; esac fi ;; esac fi ;; esac fi ;; esac fi ;; esac if test no = "$lt_cv_dlopen"; then enable_dlopen=no else enable_dlopen=yes fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS=$CPPFLAGS test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS=$LDFLAGS wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS=$LIBS LIBS="$lt_cv_dlopen_libs $LIBS" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 printf %s "checking whether a program can dlopen itself... " >&6; } if test ${lt_cv_dlopen_self+y} then : printf %s "(cached) " >&6 else case e in #( e) if test yes = "$cross_compiling"; then : lt_cv_dlopen_self=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisibility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord (void) __attribute__((visibility("default"))); #endif int fnord (void) { return 42; } int main (void) { 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=$? printf "%s\n" "$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* ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 printf "%s\n" "$lt_cv_dlopen_self" >&6; } if test yes = "$lt_cv_dlopen_self"; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 printf %s "checking whether a statically linked program can dlopen itself... " >&6; } if test ${lt_cv_dlopen_self_static+y} then : printf %s "(cached) " >&6 else case e in #( e) if test yes = "$cross_compiling"; then : lt_cv_dlopen_self_static=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisibility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord (void) __attribute__((visibility("default"))); #endif int fnord (void) { return 42; } int main (void) { 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=$? printf "%s\n" "$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* ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 printf "%s\n" "$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= { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 printf %s "checking whether stripping libraries is possible... " >&6; } if test -z "$STRIP"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } else if $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then old_striplib="$STRIP --strip-debug" striplib="$STRIP --strip-unneeded" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } else case $host_os in darwin*) # FIXME - insert some real tests, host_os isn't really good enough striplib="$STRIP -x" old_striplib="$STRIP -S" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } ;; freebsd*) if $STRIP -V 2>&1 | $GREP "elftoolchain" >/dev/null; then old_striplib="$STRIP --strip-debug" striplib="$STRIP --strip-unneeded" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi ;; *) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } ;; esac fi fi # Report what library types will actually be built { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 printf %s "checking if libtool supports shared libraries... " >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 printf "%s\n" "$can_build_shared" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 printf %s "checking whether to build shared libraries... " >&6; } test no = "$can_build_shared" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[4-9]*) if test ia64 != "$host_cpu"; then case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in yes,aix,yes) ;; # shared object as lib.so file only yes,svr4,*) ;; # shared object as lib.so archive member only yes,*) enable_static=no ;; # shared object in lib.a archive as well esac fi ;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 printf "%s\n" "$enable_shared" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 printf %s "checking whether to build static libraries... " >&6; } # Make sure either enable_shared or enable_static is yes. test yes = "$enable_shared" || enable_static=yes { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 printf "%s\n" "$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 printf "%s\n" "#define DBUS_GCOV_ENABLED __GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__" >>confdefs.h fi #### Various functions { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing socket" >&5 printf %s "checking for library containing socket... " >&6; } if test ${ac_cv_search_socket+y} then : printf %s "(cached) " >&6 else case e in #( e) 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. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char socket (void); int main (void) { 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.beam \ conftest$ac_exeext if test ${ac_cv_search_socket+y} then : break fi done if test ${ac_cv_search_socket+y} then : else case e in #( e) ac_cv_search_socket=no ;; esac fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_socket" >&5 printf "%s\n" "$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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether socklen_t is defined" >&5 printf %s "checking whether socklen_t is defined... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include int main (void) { socklen_t foo; foo = 1; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : dbus_have_socklen_t=yes else case e in #( e) dbus_have_socklen_t=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $dbus_have_socklen_t" >&5 printf "%s\n" "$dbus_have_socklen_t" >&6; } if test "x$dbus_have_socklen_t" = "xyes"; then printf "%s\n" "#define HAVE_SOCKLEN_T 1" >>confdefs.h fi #### Sort out XML library # see what we have { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for XML_ParserCreate_MM in -lexpat" >&5 printf %s "checking for XML_ParserCreate_MM in -lexpat... " >&6; } if test ${ac_cv_lib_expat_XML_ParserCreate_MM+y} then : printf %s "(cached) " >&6 else case e in #( e) 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. The 'extern "C"' is for builds by C++ compilers; although this is not generally supported in C code supporting it here has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif char XML_ParserCreate_MM (void); int main (void) { return XML_ParserCreate_MM (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_expat_XML_ParserCreate_MM=yes else case e in #( e) ac_cv_lib_expat_XML_ParserCreate_MM=no ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_expat_XML_ParserCreate_MM" >&5 printf "%s\n" "$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_compile "$LINENO" "expat.h" "ac_cv_header_expat_h" "$ac_includes_default" if test "x$ac_cv_header_expat_h" = xyes then : printf "%s\n" "#define HAVE_EXPAT_H 1" >>confdefs.h have_expat=true else case e in #( e) have_expat=false ;; esac fi done else case e in #( e) have_expat=false ;; esac 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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_PKG_CONFIG+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac 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" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG if test -n "$PKG_CONFIG"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 printf "%s\n" "$PKG_CONFIG" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_ac_pt_PKG_CONFIG+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac 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" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac ;; esac fi ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG if test -n "$ac_pt_PKG_CONFIG"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5 printf "%s\n" "$ac_pt_PKG_CONFIG" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_pt_PKG_CONFIG" = x; then PKG_CONFIG="" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5 printf %s "checking pkg-config is at least version $_pkg_min_version... " >&6; } if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } PKG_CONFIG="" fi fi pkg_failed=no { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dbus-1 >= 1.8" >&5 printf %s "checking for dbus-1 >= 1.8... " >&6; } if test -n "$DBUS_CFLAGS"; then pkg_cv_DBUS_CFLAGS="$DBUS_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"dbus-1 >= 1.8\""; } >&5 ($PKG_CONFIG --exists --print-errors "dbus-1 >= 1.8") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_DBUS_CFLAGS=`$PKG_CONFIG --cflags "dbus-1 >= 1.8" 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" && \ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"dbus-1 >= 1.8\""; } >&5 ($PKG_CONFIG --exists --print-errors "dbus-1 >= 1.8") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_DBUS_LIBS=`$PKG_CONFIG --libs "dbus-1 >= 1.8" 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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "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.8" 2>&1` else DBUS_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "dbus-1 >= 1.8" 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.8) 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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 printf "%s\n" "$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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } fi # Glib detection printf "%s\n" "#define GLIB_VERSION_MAX_ALLOWED GLIB_VERSION_2_40" >>confdefs.h printf "%s\n" "#define GLIB_VERSION_MIN_REQUIRED GLIB_VERSION_2_32" >>confdefs.h pkg_failed=no { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for glib-2.0 >= 2.40, gobject-2.0 >= 2.40, gio-2.0 >= 2.40" >&5 printf %s "checking for glib-2.0 >= 2.40, gobject-2.0 >= 2.40, gio-2.0 >= 2.40... " >&6; } if test -n "$GLIB_CFLAGS"; then pkg_cv_GLIB_CFLAGS="$GLIB_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glib-2.0 >= 2.40, gobject-2.0 >= 2.40, gio-2.0 >= 2.40\""; } >&5 ($PKG_CONFIG --exists --print-errors "glib-2.0 >= 2.40, gobject-2.0 >= 2.40, gio-2.0 >= 2.40") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_GLIB_CFLAGS=`$PKG_CONFIG --cflags "glib-2.0 >= 2.40, gobject-2.0 >= 2.40, gio-2.0 >= 2.40" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$GLIB_LIBS"; then pkg_cv_GLIB_LIBS="$GLIB_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glib-2.0 >= 2.40, gobject-2.0 >= 2.40, gio-2.0 >= 2.40\""; } >&5 ($PKG_CONFIG --exists --print-errors "glib-2.0 >= 2.40, gobject-2.0 >= 2.40, gio-2.0 >= 2.40") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_GLIB_LIBS=`$PKG_CONFIG --libs "glib-2.0 >= 2.40, gobject-2.0 >= 2.40, gio-2.0 >= 2.40" 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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then GLIB_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "glib-2.0 >= 2.40, gobject-2.0 >= 2.40, gio-2.0 >= 2.40" 2>&1` else GLIB_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "glib-2.0 >= 2.40, gobject-2.0 >= 2.40, gio-2.0 >= 2.40" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$GLIB_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (glib-2.0 >= 2.40, gobject-2.0 >= 2.40, gio-2.0 >= 2.40) were not met: $GLIB_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables GLIB_CFLAGS and GLIB_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables GLIB_CFLAGS and GLIB_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See 'config.log' for more details" "$LINENO" 5; } else GLIB_CFLAGS=$pkg_cv_GLIB_CFLAGS GLIB_LIBS=$pkg_cv_GLIB_LIBS { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } fi if test -n "$GLIB_GENMARSHAL"; then pkg_cv_GLIB_GENMARSHAL="$GLIB_GENMARSHAL" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glib-2.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "glib-2.0") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_GLIB_GENMARSHAL=`$PKG_CONFIG --variable="glib_genmarshal" "glib-2.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi GLIB_GENMARSHAL=$pkg_cv_GLIB_GENMARSHAL if test "x$GLIB_GENMARSHAL" = x"" then : as_fn_error $? "cannot find glib-genmarshal" "$LINENO" 5 fi DBUS_GLIB_TOOL_CFLAGS=$XML_CFLAGS DBUS_GLIB_TOOL_LIBS="$XML_LIBS" # Extract the first word of "dbus-run-session", so it can be a program name with args. set dummy dbus-run-session; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_DBUS_RUN_SESSION+y} then : printf %s "(cached) " >&6 else case e in #( e) case $DBUS_RUN_SESSION in [\\/]* | ?:[\\/]*) ac_cv_path_DBUS_RUN_SESSION="$DBUS_RUN_SESSION" # 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac 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_DBUS_RUN_SESSION="$as_dir$ac_word$ac_exec_ext" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_DBUS_RUN_SESSION" && ac_cv_path_DBUS_RUN_SESSION="dbus-run-session" ;; esac ;; esac fi DBUS_RUN_SESSION=$ac_cv_path_DBUS_RUN_SESSION if test -n "$DBUS_RUN_SESSION"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DBUS_RUN_SESSION" >&5 printf "%s\n" "$DBUS_RUN_SESSION" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi ### gtk-doc Documentation gtk_doc_requires="gtk-doc >= 1.14" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for gtk-doc" >&5 printf %s "checking for gtk-doc... " >&6; } if test -n "$PKG_CONFIG" && \ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$gtk_doc_requires\""; } >&5 ($PKG_CONFIG --exists --print-errors "$gtk_doc_requires") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then have_gtk_doc=yes else have_gtk_doc=no fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $have_gtk_doc" >&5 printf "%s\n" "$have_gtk_doc" >&6; } if test "$have_gtk_doc" = "no"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: You will not be able to create source packages with 'make dist' because $gtk_doc_requires is not found." >&5 printf "%s\n" "$as_me: WARNING: You will not be able to create source packages with 'make dist' because $gtk_doc_requires is not found." >&2;} fi # Extract the first word of "gtkdoc-check", so it can be a program name with args. set dummy gtkdoc-check; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_GTKDOC_CHECK+y} then : printf %s "(cached) " >&6 else case e in #( e) if test -n "$GTKDOC_CHECK"; then ac_cv_prog_GTKDOC_CHECK="$GTKDOC_CHECK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_GTKDOC_CHECK="gtkdoc-check.test" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi ;; esac fi GTKDOC_CHECK=$ac_cv_prog_GTKDOC_CHECK if test -n "$GTKDOC_CHECK"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $GTKDOC_CHECK" >&5 printf "%s\n" "$GTKDOC_CHECK" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi # Extract the first word of "gtkdoc-check", so it can be a program name with args. set dummy gtkdoc-check; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_GTKDOC_CHECK_PATH+y} then : printf %s "(cached) " >&6 else case e in #( e) case $GTKDOC_CHECK_PATH in [\\/]* | ?:[\\/]*) ac_cv_path_GTKDOC_CHECK_PATH="$GTKDOC_CHECK_PATH" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_path_GTKDOC_CHECK_PATH="$as_dir$ac_word$ac_exec_ext" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac ;; esac fi GTKDOC_CHECK_PATH=$ac_cv_path_GTKDOC_CHECK_PATH if test -n "$GTKDOC_CHECK_PATH"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $GTKDOC_CHECK_PATH" >&5 printf "%s\n" "$GTKDOC_CHECK_PATH" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_GTKDOC_REBASE+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac 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" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac ;; esac fi GTKDOC_REBASE=$ac_cv_path_GTKDOC_REBASE if test -n "$GTKDOC_REBASE"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $GTKDOC_REBASE" >&5 printf "%s\n" "$GTKDOC_REBASE" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_GTKDOC_MKPDF+y} then : printf %s "(cached) " >&6 else case e in #( e) 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac 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" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac ;; esac fi GTKDOC_MKPDF=$ac_cv_path_GTKDOC_MKPDF if test -n "$GTKDOC_MKPDF"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $GTKDOC_MKPDF" >&5 printf "%s\n" "$GTKDOC_MKPDF" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi # Check whether --with-html-dir was given. if test ${with_html_dir+y} then : withval=$with_html_dir; else case e in #( e) with_html_dir='${datadir}/gtk-doc/html' ;; esac fi HTML_DIR="$with_html_dir" # Check whether --enable-gtk-doc was given. if test ${enable_gtk_doc+y} then : enableval=$enable_gtk_doc; else case e in #( e) enable_gtk_doc=no ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to build gtk-doc documentation" >&5 printf %s "checking whether to build gtk-doc documentation... " >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_gtk_doc" >&5 printf "%s\n" "$enable_gtk_doc" >&6; } if test "x$enable_gtk_doc" = "xyes" && test "$have_gtk_doc" = "no"; then as_fn_error $? " You must have $gtk_doc_requires installed to build documentation for $PACKAGE_NAME. Please install gtk-doc or disable building the documentation by adding '--disable-gtk-doc' to '$0'." "$LINENO" 5 fi if test "x$PACKAGE_NAME" != "xglib"; then pkg_failed=no { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0" >&5 printf %s "checking for glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0... " >&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" && \ { { printf "%s\n" "$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=$? printf "%s\n" "$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" && \ { { printf "%s\n" "$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=$? printf "%s\n" "$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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then GTKDOC_DEPS_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0" 2>&1` else GTKDOC_DEPS_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$GTKDOC_DEPS_PKG_ERRORS" >&5 : elif test $pkg_failed = untried; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } : else GTKDOC_DEPS_CFLAGS=$pkg_cv_GTKDOC_DEPS_CFLAGS GTKDOC_DEPS_LIBS=$pkg_cv_GTKDOC_DEPS_LIBS { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } fi fi # Check whether --enable-gtk-doc-html was given. if test ${enable_gtk_doc_html+y} then : enableval=$enable_gtk_doc_html; else case e in #( e) enable_gtk_doc_html=yes ;; esac fi # Check whether --enable-gtk-doc-pdf was given. if test ${enable_gtk_doc_pdf+y} then : enableval=$enable_gtk_doc_pdf; else case e in #( e) enable_gtk_doc_pdf=no ;; esac fi if test -z "$GTKDOC_MKPDF"; then enable_gtk_doc_pdf=no fi if test -z "$AM_DEFAULT_VERBOSITY"; then AM_DEFAULT_VERBOSITY=1 fi if test x$have_gtk_doc = xyes; then HAVE_GTK_DOC_TRUE= HAVE_GTK_DOC_FALSE='#' else HAVE_GTK_DOC_TRUE='#' HAVE_GTK_DOC_FALSE= fi if test x$enable_gtk_doc = xyes; then ENABLE_GTK_DOC_TRUE= ENABLE_GTK_DOC_FALSE='#' else ENABLE_GTK_DOC_TRUE='#' ENABLE_GTK_DOC_FALSE= fi if test x$enable_gtk_doc_html = xyes; then GTK_DOC_BUILD_HTML_TRUE= GTK_DOC_BUILD_HTML_FALSE='#' else GTK_DOC_BUILD_HTML_TRUE='#' GTK_DOC_BUILD_HTML_FALSE= fi if test x$enable_gtk_doc_pdf = xyes; then GTK_DOC_BUILD_PDF_TRUE= GTK_DOC_BUILD_PDF_FALSE='#' else GTK_DOC_BUILD_PDF_TRUE='#' GTK_DOC_BUILD_PDF_FALSE= fi if test -n "$LIBTOOL"; then GTK_DOC_USE_LIBTOOL_TRUE= GTK_DOC_USE_LIBTOOL_FALSE='#' else GTK_DOC_USE_LIBTOOL_TRUE='#' GTK_DOC_USE_LIBTOOL_FALSE= fi if test -n "$GTKDOC_REBASE"; then GTK_DOC_USE_REBASE_TRUE= GTK_DOC_USE_REBASE_FALSE='#' else GTK_DOC_USE_REBASE_TRUE='#' GTK_DOC_USE_REBASE_FALSE= fi # Make dbus-gmain submodule part of dbus-glib's namespace ac_config_files="$ac_config_files Makefile m4/Makefile doc/Makefile doc/dbus-binding-tool.1 doc/reference/Makefile doc/reference/version.xml dbus/Makefile dbus/examples/Makefile dbus/examples/statemachine/Makefile dbus-gmain/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 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_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 printf "%s\n" "$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+y} || &/ 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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 printf "%s\n" "$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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 printf "%s\n" "$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=`printf "%s\n" "$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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 printf %s "checking that generated files are newer than configure... " >&6; } if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: done" >&5 printf "%s\n" "done" >&6; } case $enable_silent_rules in # ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; esac 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 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_GTK_DOC_TRUE}" && test -z "${HAVE_GTK_DOC_FALSE}"; then as_fn_error $? "conditional \"HAVE_GTK_DOC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_GTK_DOC_TRUE}" && test -z "${ENABLE_GTK_DOC_FALSE}"; then as_fn_error $? "conditional \"ENABLE_GTK_DOC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${GTK_DOC_BUILD_HTML_TRUE}" && test -z "${GTK_DOC_BUILD_HTML_FALSE}"; then as_fn_error $? "conditional \"GTK_DOC_BUILD_HTML\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${GTK_DOC_BUILD_PDF_TRUE}" && test -z "${GTK_DOC_BUILD_PDF_FALSE}"; then as_fn_error $? "conditional \"GTK_DOC_BUILD_PDF\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${GTK_DOC_USE_LIBTOOL_TRUE}" && test -z "${GTK_DOC_USE_LIBTOOL_FALSE}"; then as_fn_error $? "conditional \"GTK_DOC_USE_LIBTOOL\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${GTK_DOC_USE_REBASE_TRUE}" && test -z "${GTK_DOC_USE_REBASE_FALSE}"; then as_fn_error $? "conditional \"GTK_DOC_USE_REBASE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 printf "%s\n" "$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 ${ZSH_VERSION+y} && (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 e in #( e) case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac ;; esac fi # Reset variables that may have inherited troublesome values from # the environment. # IFS needs to be set, to space, tab, and newline, in precisely that order. # (If _AS_PATH_WALK were called with IFS unset, it would have the # side effect of setting IFS to empty, thus disabling word splitting.) # Quoting is to prevent editors from complaining about space-tab. as_nl=' ' export as_nl IFS=" "" $as_nl" PS1='$ ' PS2='> ' PS4='+ ' # Ensure predictable behavior from utilities with locale-dependent output. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # We cannot yet rely on "unset" to work, but we need these variables # to be unset--not just set to an empty or harmless value--now, to # avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct # also avoids known problems related to "unset" and subshell syntax # in other old shells (e.g. bash 2.01 and pdksh 5.2.14). for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH do eval test \${$as_var+y} \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done # Ensure that fds 0, 1, and 2 are open. if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi if (exec 3>&2) ; then :; else exec 2>/dev/null; fi # The user is always right. if ${PATH_SEPARATOR+false} :; 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 # 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac 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 printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # 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 printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi printf "%s\n" "$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 case e in #( e) as_fn_append () { eval $1=\$$1\$2 } ;; esac 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 case e in #( e) as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } ;; esac 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 || printf "%s\n" 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 # Determine whether it's possible to make 'echo' print without a newline. # These variables are no longer used directly by Autoconf, but are AC_SUBSTed # for compatibility with existing Makefiles. 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 # For backward compatibility with old third-party macros, we provide # the shell variables $as_echo and $as_echo_n. New code should use # AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. as_echo='printf %s\n' as_echo_n='printf %s' 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=`printf "%s\n" "$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 || printf "%s\n" 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_sed_cpp="y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" as_tr_cpp="eval sed '$as_sed_cpp'" # deprecated # Sed expression to map a string onto a valid variable name. as_sed_sh="y%*+%pp%;s%[^_$as_cr_alnum]%_%g" as_tr_sh="eval sed '$as_sed_sh'" # deprecated 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.114, which was generated by GNU Autoconf 2.72. 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 ac_cs_config=`printf "%s\n" "$ac_configure_args" | sed "$ac_safe_unquote"` ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\''/g"` cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ dbus-glib config.status 0.114 configured by $0, generated by GNU Autoconf 2.72, with options \\"\$ac_cs_config\\" Copyright (C) 2023 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 ) printf "%s\n" "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) printf "%s\n" "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`printf "%s\n" "$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=`printf "%s\n" "$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 ) printf "%s\n" "$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 \printf "%s\n" "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 printf "%s\n" "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}" # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`' macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`' enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' shared_archive_member_spec='`$ECHO "$shared_archive_member_spec" | $SED "$delay_single_quote_subst"`' SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`' host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`' build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`' build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`' SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`' Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`' GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`' EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`' FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`' LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`' NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`' LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`' max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`' ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`' exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`' lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`' lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' FILECMD='`$ECHO "$FILECMD" | $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"`' lt_ar_flags='`$ECHO "$lt_ar_flags" | $SED "$delay_single_quote_subst"`' AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`' old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`' lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`' CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`' CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`' compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`' GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_import='`$ECHO "$lt_cv_sys_global_symbol_to_import" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' lt_cv_nm_interface='`$ECHO "$lt_cv_nm_interface" | $SED "$delay_single_quote_subst"`' nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`' lt_cv_truncate_bin='`$ECHO "$lt_cv_truncate_bin" | $SED "$delay_single_quote_subst"`' objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`' DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`' OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`' libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`' shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`' extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`' enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`' export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`' whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`' compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`' old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`' old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`' archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`' module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`' module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`' with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`' hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`' hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`' file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`' version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`' runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`' libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`' library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`' soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`' install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`' postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`' postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`' finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' configure_time_dlsearch_path='`$ECHO "$configure_time_dlsearch_path" | $SED "$delay_single_quote_subst"`' configure_time_lt_sys_library_path='`$ECHO "$configure_time_lt_sys_library_path" | $SED "$delay_single_quote_subst"`' hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' 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 \ FILECMD \ OBJDUMP \ deplibs_check_method \ file_magic_cmd \ file_magic_glob \ want_nocaseglob \ DLLTOOL \ sharedlib_from_linklib_cmd \ AR \ archiver_list_spec \ STRIP \ RANLIB \ CC \ CFLAGS \ compiler \ lt_cv_sys_global_symbol_pipe \ lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_import \ lt_cv_sys_global_symbol_to_c_name_address \ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ lt_cv_nm_interface \ nm_file_list_spec \ lt_cv_truncate_bin \ lt_prog_compiler_no_builtin_flag \ lt_prog_compiler_pic \ lt_prog_compiler_wl \ lt_prog_compiler_static \ lt_cv_prog_compiler_c_o \ need_locks \ MANIFEST_TOOL \ DSYMUTIL \ NMEDIT \ LIPO \ OTOOL \ OTOOL64 \ shrext_cmds \ export_dynamic_flag_spec \ whole_archive_flag_spec \ compiler_needs_object \ with_gnu_ld \ allow_undefined_flag \ no_undefined_flag \ hardcode_libdir_flag_spec \ hardcode_libdir_separator \ exclude_expsyms \ include_expsyms \ file_list_spec \ variables_saved_for_relink \ libname_spec \ library_names_spec \ soname_spec \ install_override_mode \ finish_eval \ old_striplib \ striplib; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in reload_cmds \ old_postinstall_cmds \ old_postuninstall_cmds \ old_archive_cmds \ extract_expsyms_cmds \ old_archive_from_new_cmds \ old_archive_from_expsyms_cmds \ archive_cmds \ archive_expsym_cmds \ module_cmds \ module_expsym_cmds \ export_symbols_cmds \ prelink_cmds \ postlink_cmds \ postinstall_cmds \ postuninstall_cmds \ finish_cmds \ sys_lib_search_path_spec \ configure_time_dlsearch_path \ configure_time_lt_sys_library_path; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done ac_aux_dir='$ac_aux_dir' # See if we are running on zsh, and set the options that allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi PACKAGE='$PACKAGE' VERSION='$VERSION' RM='$RM' ofile='$ofile' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "m4/Makefile") CONFIG_FILES="$CONFIG_FILES m4/Makefile" ;; "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; "doc/dbus-binding-tool.1") CONFIG_FILES="$CONFIG_FILES doc/dbus-binding-tool.1" ;; "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" ;; "dbus-gmain/Makefile") CONFIG_FILES="$CONFIG_FILES dbus-gmain/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" ;; "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+y} || CONFIG_FILES=$config_files test ${CONFIG_HEADERS+y} || CONFIG_HEADERS=$config_headers test ${CONFIG_COMMANDS+y} || 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=`printf "%s\n" "$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 '` printf "%s\n" "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 printf "%s\n" "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`printf "%s\n" "$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 || printf "%s\n" 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=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`printf "%s\n" "$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@*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 printf "%s\n" "$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"; } && { printf "%s\n" "$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 printf "%s\n" "$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 { printf "%s\n" "/* $configure_input */" >&1 \ && 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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 printf "%s\n" "$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 printf "%s\n" "/* $configure_input */" >&1 \ && 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 || printf "%s\n" 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) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 printf "%s\n" "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || { # Older Autoconf 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. # TODO: see whether this extra hack can be removed once we start # requiring Autoconf 2.70 or later. case $CONFIG_FILES in #( *\'*) : eval set x "$CONFIG_FILES" ;; #( *) : set x $CONFIG_FILES ;; #( *) : ;; esac shift # Used to flag and report bootstrapping failures. am_rc=0 for am_mf do # Strip MF so we end up with the name of the file. am_mf=`printf "%s\n" "$am_mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile which includes # dependency-tracking related rules and includes. # Grep'ing the whole file directly is not great: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ || continue am_dirpart=`$as_dirname -- "$am_mf" || $as_expr X"$am_mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$am_mf" : 'X\(//\)[^/]' \| \ X"$am_mf" : 'X\(//\)$' \| \ X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X"$am_mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` am_filepart=`$as_basename -- "$am_mf" || $as_expr X/"$am_mf" : '.*/\([^/][^/]*\)/*$' \| \ X"$am_mf" : 'X\(//\)$' \| \ X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X/"$am_mf" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` { echo "$as_me:$LINENO: cd "$am_dirpart" \ && sed -e '/# am--include-marker/d' "$am_filepart" \ | $MAKE -f - am--depfiles" >&5 (cd "$am_dirpart" \ && sed -e '/# am--include-marker/d' "$am_filepart" \ | $MAKE -f - am--depfiles) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } || am_rc=$? done if test $am_rc -ne 0; then { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "Something went wrong bootstrapping makefile fragments for automatic dependency tracking. If GNU make was not used, consider re-running the configure script with MAKE=\"gmake\" (or whatever is necessary). You can also try re-running configure with the '--disable-dependency-tracking' option to at least be able to build the package (albeit without support for automatic dependency tracking). See 'config.log' for more details" "$LINENO" 5; } fi { am_dirpart=; unset am_dirpart;} { am_filepart=; unset am_filepart;} { am_mf=; unset am_mf;} { am_rc=; unset am_rc;} rm -f conftest-deps.mk } ;; "libtool":C) # See if we are running on zsh, and set the options that allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi cfgfile=${ofile}T trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # Generated automatically by $as_me ($PACKAGE) $VERSION # NOTE: Changes made to this file will be lost: look at ltmain.sh. # Provide generalized library-building support services. # Written by Gordon Matzigkeit, 1996 # Copyright (C) 2024 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # GNU Libtool is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program or library that is built # using GNU Libtool, you may include this file under the same # distribution terms that you use for the rest of that program. # # GNU Libtool is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # The names of the tagged configurations supported by this script. available_tags='' # Configured defaults for sys_lib_dlsearch_path munging. : \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"} # ### BEGIN LIBTOOL CONFIG # Which release of libtool.m4 was used? macro_version=$macro_version macro_revision=$macro_revision # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # What type of objects to build. pic_mode=$pic_mode # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # Shared archive member basename,for filename based shared library versioning on AIX. shared_archive_member_spec=$shared_archive_member_spec # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # An echo program that protects backslashes. ECHO=$lt_ECHO # The PATH separator for the build system. PATH_SEPARATOR=$lt_PATH_SEPARATOR # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # A sed program that does not truncate output. SED=$lt_SED # Sed that helps us avoid accidentally triggering echo(1) options like -n. Xsed="\$SED -e 1s/^X//" # A grep program that handles long lines. GREP=$lt_GREP # An ERE matcher. EGREP=$lt_EGREP # A literal string matcher. FGREP=$lt_FGREP # A BSD- or MS-compatible name lister. NM=$lt_NM # Whether we need soft or hard links. LN_S=$lt_LN_S # What is the maximum length of a command? max_cmd_len=$max_cmd_len # Object file suffix (normally "o"). objext=$ac_objext # Executable file suffix (normally ""). exeext=$exeext # whether the shell understands "unset". lt_unset=$lt_unset # turn spaces into newlines. SP2NL=$lt_lt_SP2NL # turn newlines into spaces. NL2SP=$lt_lt_NL2SP # convert \$build file names to \$host format. to_host_file_cmd=$lt_cv_to_host_file_cmd # convert \$build files to toolchain format. to_tool_file_cmd=$lt_cv_to_tool_file_cmd # A file(cmd) program that detects file types. FILECMD=$lt_FILECMD # 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 (by configure). lt_ar_flags=$lt_ar_flags # Flags to create an archive. AR_FLAGS=\${ARFLAGS-"\$lt_ar_flags"} # How to feed a file listing to the archiver. archiver_list_spec=$lt_archiver_list_spec # A symbol stripping program. STRIP=$lt_STRIP # Commands used to install an old-style archive. RANLIB=$lt_RANLIB old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Whether to use a lock for old archive extraction. lock_old_archive_extraction=$lock_old_archive_extraction # A C compiler. LTCC=$lt_CC # LTCC compiler flags. LTCFLAGS=$lt_CFLAGS # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration. global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm into a list of symbols to manually relocate. global_symbol_to_import=$lt_lt_cv_sys_global_symbol_to_import # Transform the output of nm in a C name address pair. global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # Transform the output of nm in a C name address pair when lib prefix is needed. global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix # The name lister interface. nm_interface=$lt_lt_cv_nm_interface # Specify filename containing input files for \$NM. nm_file_list_spec=$lt_nm_file_list_spec # The root where to search for dependent libraries,and where our libraries should be installed. lt_sysroot=$lt_sysroot # Command to truncate a binary pipe. lt_truncate_bin=$lt_lt_cv_truncate_bin # The name of the directory that contains temporary libtool files. objdir=$objdir # Used to examine libraries when file_magic_cmd begins with "file". MAGIC_CMD=$MAGIC_CMD # Must we lock files when doing compilation? need_locks=$lt_need_locks # Manifest tool. MANIFEST_TOOL=$lt_MANIFEST_TOOL # Tool to manipulate archived DWARF debug symbol files on Mac OS X. DSYMUTIL=$lt_DSYMUTIL # Tool to change global to local symbols on Mac OS X. NMEDIT=$lt_NMEDIT # Tool to manipulate fat objects and archives on Mac OS X. LIPO=$lt_LIPO # ldd/readelf like tool for Mach-O binaries on Mac OS X. OTOOL=$lt_OTOOL # ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. OTOOL64=$lt_OTOOL64 # Old archive suffix (normally "a"). libext=$libext # Shared library suffix (normally ".so"). shrext_cmds=$lt_shrext_cmds # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Variables whose values should be saved in libtool wrapper scripts and # restored at link time. variables_saved_for_relink=$lt_variables_saved_for_relink # Do we need the "lib" prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Library versioning type. version_type=$version_type # Shared library runtime path variable. runpath_var=$runpath_var # Shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Permission mode override for installation of shared libraries. install_override_mode=$lt_install_override_mode # Command to use after installation of a shared archive. postinstall_cmds=$lt_postinstall_cmds # Command to use after uninstallation of a shared archive. postuninstall_cmds=$lt_postuninstall_cmds # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # As "finish_cmds", except a single script fragment to be evaled but # not shown. finish_eval=$lt_finish_eval # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Compile-time system search path for libraries. sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Detected run-time system search path for libraries. sys_lib_dlsearch_path_spec=$lt_configure_time_dlsearch_path # Explicit LT_SYS_LIBRARY_PATH set during ./configure time. configure_time_lt_sys_library_path=$lt_configure_time_lt_sys_library_path # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # The linker used to build libraries. LD=$lt_LD # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds # A language specific compiler. CC=$lt_compiler # Is the compiler the GNU compiler? with_gcc=$GCC # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc # Whether or not to disallow shared libs when runtime libs are static. allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec # Whether the compiler copes with passing no objects directly. compiler_needs_object=$lt_compiler_needs_object # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds # Commands used to build a shared archive. archive_cmds=$lt_archive_cmds archive_expsym_cmds=$lt_archive_expsym_cmds # Commands used to build a loadable module if different from building # a shared archive. module_cmds=$lt_module_cmds module_expsym_cmds=$lt_module_expsym_cmds # Whether we are building with GNU ld or not. with_gnu_ld=$lt_with_gnu_ld # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag # Flag that enforces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec # Whether we need a single "-rpath" flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator # Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes # DIR into the resulting binary. hardcode_direct=$hardcode_direct # Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes # DIR into the resulting binary and the resulting library dependency is # "absolute",i.e. impossible to change by setting \$shlibpath_var if the # library is relocated. hardcode_direct_absolute=$hardcode_direct_absolute # Set to "yes" if using the -LDIR flag during linking hardcodes DIR # into the resulting binary. hardcode_minus_L=$hardcode_minus_L # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR # into the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var # Set to "yes" if building a shared library automatically hardcodes DIR # into the library and all subsequent libraries and executables linked # against it. hardcode_automatic=$hardcode_automatic # Set to yes if linker adds runtime paths of dependent libraries # to runtime path list. inherit_rpath=$inherit_rpath # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs # Set to "yes" if exported symbols are required. always_export_symbols=$always_export_symbols # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms # Symbols that must always be exported. include_expsyms=$lt_include_expsyms # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds # Commands necessary for finishing linking programs. postlink_cmds=$lt_postlink_cmds # Specify filename containing input files. file_list_spec=$lt_file_list_spec # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action # ### END LIBTOOL CONFIG _LT_EOF cat <<'_LT_EOF' >> "$cfgfile" # ### BEGIN FUNCTIONS SHARED WITH CONFIGURE # func_munge_path_list VARIABLE PATH # ----------------------------------- # VARIABLE is name of variable containing _space_ separated list of # directories to be munged by the contents of PATH, which is string # having a format: # "DIR[:DIR]:" # string "DIR[ DIR]" will be prepended to VARIABLE # ":DIR[:DIR]" # string "DIR[ DIR]" will be appended to VARIABLE # "DIRP[:DIRP]::[DIRA:]DIRA" # string "DIRP[ DIRP]" will be prepended to VARIABLE and string # "DIRA[ DIRA]" will be appended to VARIABLE # "DIR[:DIR]" # VARIABLE will be replaced by "DIR[ DIR]" func_munge_path_list () { case x$2 in x) ;; *:) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\" ;; x:*) eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\" ;; *::*) eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\" ;; *) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\" ;; esac } # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. func_cc_basename () { for cc_temp in $*""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` } # ### END FUNCTIONS SHARED WITH CONFIGURE _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac ltmain=$ac_aux_dir/ltmain.sh # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? $SED '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ;; 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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi echo " D-BUS GLIB BINDINGS $VERSION ============== prefix: ${prefix} exec_prefix: ${exec_prefix} 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 assertions: ${enable_asserts} Building checks: ${enable_checks} Building Gtk-doc docs: ${enable_gtk_doc} Bash Completion: ${enable_bash_completion} Using XML parser: ${with_xml} " 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_gcov = xyes; then echo "NOTE: building with coverage profiling is definitely for developers only." 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.114/Makefile.am0000644000175000017500000000236314764547157011134 ACLOCAL_AMFLAGS = -I m4 GLIB_PC=dbus-glib-1.pc SUBDIRS = dbus-gmain dbus tools test doc DIST_SUBDIRS = dbus-gmain dbus tools test doc m4 pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = $(GLIB_PC) DISTCLEANFILES = \ $(GLIB_PC) EXTRA_DIST = \ CONTRIBUTING.md \ LICENSES/AFL-2.1.txt \ LICENSES/GPL-2.0-or-later.txt \ LICENSES/LGPL-2.1-or-later.txt \ LICENSES/MIT.txt \ NEWS \ dbus-bus-introspect.xml \ dbus-glib-1.pc.in # Creating ChangeLog from git log: DISTCHECK_CONFIGURE_FLAGS=--enable-gtk-doc --enable-checks --enable-tests --enable-asserts %.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 doc/reference/html/ \ dbus.freedesktop.org:/srv/dbus.freedesktop.org/www/doc/@PACKAGE@/ check-valgrind: all $(MAKE) -C test check-valgrind include tools/lcov.am dbus-glib-0.114/tools/0000775000175000017500000000000014764624122010302 5dbus-glib-0.114/tools/session.conf0000644000175000017500000000134513233560240012543 session unix:tmpdir=./ dbus-glib-0.114/tools/run-with-tmp-session-bus.sh0000755000175000017500000000275013233560240015374 #! /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 # Execute wrapped script echo "Running dbus-run-session --config-file=$CONFIG_FILE -- $WRAPPED_SCRIPT $@" >&2 dbus-run-session --config-file="$CONFIG_FILE" -- $WRAPPED_SCRIPT "$@" exit $? dbus-glib-0.114/tools/Makefile.in0000664000175000017500000004410114764623732012275 # Makefile.in generated by automake 1.17 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2024 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__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) am__rm_f = rm -f $(am__rm_f_notfound) am__rm_rf = rm -rf $(am__rm_f_notfound) 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 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) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : 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_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = 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 ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && echo $$files | $(am__xargs_n) 40 $(am__rm_f); }; \ } am__installdirs = "$(DESTDIR)$(libdbus_glibdir)" HEADERS = $(nodist_libdbus_glib_HEADERS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) 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@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DBUS_BINDING_TOOL = @DBUS_BINDING_TOOL@ DBUS_CFLAGS = @DBUS_CFLAGS@ DBUS_GLIB_TOOL_CFLAGS = @DBUS_GLIB_TOOL_CFLAGS@ DBUS_GLIB_TOOL_LIBS = @DBUS_GLIB_TOOL_LIBS@ DBUS_LIBS = @DBUS_LIBS@ DBUS_RUN_SESSION = @DBUS_RUN_SESSION@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FILECMD = @FILECMD@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ GLIB_THREADS_LIBS = @GLIB_THREADS_LIBS@ GREP = @GREP@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ HTML_DIR = @HTML_DIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ 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@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ 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@ 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__rm_f_notfound = @am__rm_f_notfound@ am__tar = @am__tar@ am__untar = @am__untar@ am__xargs_n = @am__xargs_n@ 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@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AM_CPPFLAGS = \ -I$(top_srcdir) \ $(DBUS_CFLAGS) \ $(GLIB_CFLAGS) \ $(DBUS_X_CFLAGS) \ $(DBUS_GTK_THREADS_CFLAGS) \ -DDBUS_COMPILATION \ $(NULL) 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) --foreign tools/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign tools/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__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ 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: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ 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-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ 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" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(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: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) 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: -$(am__rm_f) $(CLEANFILES) distclean-generic: -$(am__rm_f) $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || $(am__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." -$(am__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-exec install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libtool cscopelist-am ctags ctags-am 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 tags-am uninstall \ uninstall-am uninstall-nodist_libdbus_glibHEADERS .PRECIOUS: Makefile 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: # Tell GNU make to disable its built-in pattern rules. %:: %,v %:: RCS/%,v %:: RCS/% %:: s.% %:: SCCS/s.% dbus-glib-0.114/tools/Makefile.am0000644000175000017500000000122713233575561012260 AM_CPPFLAGS = \ -I$(top_srcdir) \ $(DBUS_CFLAGS) \ $(GLIB_CFLAGS) \ $(DBUS_X_CFLAGS) \ $(DBUS_GTK_THREADS_CFLAGS) \ -DDBUS_COMPILATION \ $(NULL) 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.114/tools/lcov.am0000664000175000017500000000351214764547007011513 # 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.114/test/0000775000175000017500000000000014764624122010121 5dbus-glib-0.114/test/interfaces/0000775000175000017500000000000014764624122012244 5dbus-glib-0.114/test/interfaces/valid-annotations.xml0000644000175000017500000000206413233560240016326 dbus-glib-0.114/test/interfaces/test-dup-prop-b.xml0000644000175000017500000000037113233560240015635 dbus-glib-0.114/test/interfaces/test-dup-prop-a.xml0000644000175000017500000000037113233560240015634 dbus-glib-0.114/test/interfaces/test-song.xml0000644000175000017500000000056313233560240014621 dbus-glib-0.114/test/interfaces/test-hello.xml0000644000175000017500000000062713233560240014757 dbus-glib-0.114/test/interfaces/test-goodbye.xml0000644000175000017500000000057513233560240015306 dbus-glib-0.114/test/interfaces/run-test.sh0000755000175000017500000000225213233560240014271 #! /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 set -e 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 dbus-glib-0.114/test/interfaces/invalid-nested-annotation.xml0000644000175000017500000000057013233560240017752 dbus-glib-0.114/test/interfaces/invalid-annotated-node.xml0000644000175000017500000000053713233560240017223 dbus-glib-0.114/test/interfaces/test-server.c0000644000175000017500000000341614027364762014620 /* SPDX-License-Identifier: AFL-2.1 OR GPL-2.0-or-later */ #include #undef G_DISABLE_ASSERT #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.114/test/interfaces/test-objects.h0000644000175000017500000000270013515561575014745 /* SPDX-License-Identifier: AFL-2.1 OR GPL-2.0-or-later */ #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.114/test/interfaces/test-objects.c0000644000175000017500000000306214027364762014740 /* SPDX-License-Identifier: AFL-2.1 OR GPL-2.0-or-later */ #include #undef G_DISABLE_ASSERT #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.114/test/interfaces/test-dup-prop.h0000644000175000017500000000405413515561575015066 /* SPDX-License-Identifier: AFL-2.1 OR GPL-2.0-or-later */ #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.114/test/interfaces/test-dup-prop.c0000644000175000017500000001107614027364762015061 /* SPDX-License-Identifier: AFL-2.1 OR GPL-2.0-or-later */ #ifdef HAVE_CONFIG_H # include # undef G_DISABLE_ASSERT #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.114/test/interfaces/test-interfaces.h0000644000175000017500000000340613515561575015443 /* SPDX-License-Identifier: AFL-2.1 OR GPL-2.0-or-later */ #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.114/test/interfaces/test-interfaces.c0000644000175000017500000000522414027364762015434 /* SPDX-License-Identifier: AFL-2.1 OR GPL-2.0-or-later */ #ifdef HAVE_CONFIG_H # include # undef G_DISABLE_ASSERT #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.114/test/interfaces/test-client.c0000644000175000017500000002260414027364762014570 /* SPDX-License-Identifier: AFL-2.1 OR GPL-2.0-or-later */ #include #undef G_DISABLE_ASSERT #include #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" #include "dbus-gmain/tests/util.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_private (DBUS_BUS_SESSION, NULL, &error); if (connection == NULL) { g_error ("Failed to make connection to session bus: %s", error->message); g_error_free (error); exit(1); } dbus_connection_set_exit_on_disconnect (dbus_g_connection_get_connection (connection), FALSE); 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_nonnull (proxy); 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); node_info_unref (node); 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); } } g_object_unref (dp_proxy); test_run_until_disconnected (dbus_g_connection_get_connection (connection), NULL); dbus_g_connection_unref (connection); dbus_shutdown (); exit(0); } /* ex:ts=2:et: */ dbus-glib-0.114/test/interfaces/Makefile.in0000664000175000017500000012156514764623732014251 # Makefile.in generated by automake 1.17 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2024 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__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) am__rm_f = rm -f $(am__rm_f_notfound) am__rm_rf = rm -rf $(am__rm_f_notfound) 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 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) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) 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)/dbus-gmain/tests/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__v_lt_1 = 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)/dbus-gmain/tests/libtest.la AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : 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_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/test-client.Po \ ./$(DEPDIR)/test-dup-prop.Po ./$(DEPDIR)/test-interfaces.Po \ ./$(DEPDIR)/test-objects.Po ./$(DEPDIR)/test-server.Po 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_CC_1 = 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_CCLD_1 = 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 am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` am__tty_colors_dummy = \ mgn= red= grn= lgn= blu= brg= std=; \ am__color_tests=no am__tty_colors = { \ $(am__tty_colors_dummy); \ if test "X$(AM_COLOR_TESTS)" = Xno; then \ am__color_tests=no; \ elif test "X$(AM_COLOR_TESTS)" = Xalways; then \ am__color_tests=yes; \ elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \ am__color_tests=yes; \ fi; \ if test $$am__color_tests = yes; then \ red=''; \ grn=''; \ lgn=''; \ blu=''; \ mgn=''; \ brg=''; \ std=''; \ fi; \ } 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 ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && echo $$files | $(am__xargs_n) 40 $(am__rm_f); }; \ } am__recheck_rx = ^[ ]*:recheck:[ ]* am__global_test_result_rx = ^[ ]*:global-test-result:[ ]* am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]* # A command that, given a newline-separated list of test names on the # standard input, print the name of the tests that are to be re-run # upon "make recheck". am__list_recheck_tests = $(AWK) '{ \ recheck = 1; \ while ((rc = (getline line < ($$0 ".trs"))) != 0) \ { \ if (rc < 0) \ { \ if ((getline line2 < ($$0 ".log")) < 0) \ recheck = 0; \ break; \ } \ else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \ { \ recheck = 0; \ break; \ } \ else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \ { \ break; \ } \ }; \ if (recheck) \ print $$0; \ close ($$0 ".trs"); \ close ($$0 ".log"); \ }' # A command that, given a newline-separated list of test names on the # standard input, create the global log from their .trs and .log files. am__create_global_log = $(AWK) ' \ function fatal(msg) \ { \ print "fatal: making $@: " msg | "cat >&2"; \ exit 1; \ } \ function rst_section(header) \ { \ print header; \ len = length(header); \ for (i = 1; i <= len; i = i + 1) \ printf "="; \ printf "\n\n"; \ } \ { \ copy_in_global_log = 1; \ global_test_result = "RUN"; \ while ((rc = (getline line < ($$0 ".trs"))) != 0) \ { \ if (rc < 0) \ fatal("failed to read from " $$0 ".trs"); \ if (line ~ /$(am__global_test_result_rx)/) \ { \ sub("$(am__global_test_result_rx)", "", line); \ sub("[ ]*$$", "", line); \ global_test_result = line; \ } \ else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \ copy_in_global_log = 0; \ }; \ if (copy_in_global_log) \ { \ rst_section(global_test_result ": " $$0); \ while ((rc = (getline line < ($$0 ".log"))) != 0) \ { \ if (rc < 0) \ fatal("failed to read from " $$0 ".log"); \ print line; \ }; \ printf "\n"; \ }; \ close ($$0 ".trs"); \ close ($$0 ".log"); \ }' # Restructured Text title. am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; } # Solaris 10 'make', and several other traditional 'make' implementations, # pass "-e" to $(SHELL), and POSIX 2008 even requires this. Work around it # by disabling -e (using the XSI extension "set +e") if it's set. am__sh_e_setup = case $$- in *e*) set +e;; esac # Default flags passed to test drivers. am__common_driver_flags = \ --color-tests "$$am__color_tests" \ $$am__collect_skipped_logs \ --enable-hard-errors "$$am__enable_hard_errors" \ --expect-failure "$$am__expect_failure" # To be inserted before the command running the test. Creates the # directory for the log if needed. Stores in $dir the directory # containing $f, in $tst the test, in $log the log. Executes the # developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and # passes TESTS_ENVIRONMENT. Set up options for the wrapper that # will run the test scripts (or their associated LOG_COMPILER, if # thy have one). am__check_pre = \ $(am__sh_e_setup); \ $(am__vpath_adj_setup) $(am__vpath_adj) \ $(am__tty_colors); \ srcdir=$(srcdir); export srcdir; \ case "$@" in \ */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \ *) am__odir=.;; \ esac; \ test "x$$am__odir" = x"." || test -d "$$am__odir" \ || $(MKDIR_P) "$$am__odir" || exit $$?; \ if test -f "./$$f"; then dir=./; \ elif test -f "$$f"; then dir=; \ else dir="$(srcdir)/"; fi; \ tst=$$dir$$f; log='$@'; \ if test -n '$(IGNORE_SKIPPED_LOGS)'; then \ am__collect_skipped_logs='--collect-skipped-logs no'; \ else \ am__collect_skipped_logs=''; \ fi; \ if test -n '$(DISABLE_HARD_ERRORS)'; then \ am__enable_hard_errors=no; \ else \ am__enable_hard_errors=yes; \ fi; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \ am__expect_failure=yes;; \ *) \ am__expect_failure=no;; \ esac; \ $(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT) # A shell command to get the names of the tests scripts with any registered # extension removed (i.e., equivalently, the names of the test logs, with # the '.log' extension removed). The result is saved in the shell variable # '$bases'. This honors runtime overriding of TESTS and TEST_LOGS. Sadly, # we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)", # since that might cause problem with VPATH rewrites for suffix-less tests. # See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'. am__set_TESTS_bases = \ bases='$(TEST_LOGS)'; \ bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \ bases=`echo $$bases` AM_TESTSUITE_SUMMARY_HEADER = ' for $(PACKAGE_STRING)' RECHECK_LOGS = $(TEST_LOGS) AM_RECURSIVE_TARGETS = check recheck TEST_SUITE_LOG = test-suite.log TEST_EXTENSIONS = @EXEEXT@ .test LOG_DRIVER = $(SHELL) $(top_srcdir)/build-aux/test-driver LOG_COMPILE = $(LOG_COMPILER) $(AM_LOG_FLAGS) $(LOG_FLAGS) am__set_b = \ case '$@' in \ */*) \ case '$*' in \ */*) b='$*';; \ *) b=`echo '$@' | sed 's/\.log$$//'`; \ esac;; \ *) \ b='$*';; \ esac am__test_logs1 = $(TESTS:=.log) am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log) TEST_LOGS = $(am__test_logs2:.test.log=.log) TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/build-aux/test-driver TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \ $(TEST_LOG_FLAGS) am__DIST_COMMON = $(srcdir)/Makefile.in \ $(top_srcdir)/build-aux/depcomp \ $(top_srcdir)/build-aux/test-driver DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) 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@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DBUS_BINDING_TOOL = @DBUS_BINDING_TOOL@ DBUS_CFLAGS = @DBUS_CFLAGS@ DBUS_GLIB_TOOL_CFLAGS = @DBUS_GLIB_TOOL_CFLAGS@ DBUS_GLIB_TOOL_LIBS = @DBUS_GLIB_TOOL_LIBS@ DBUS_LIBS = @DBUS_LIBS@ DBUS_RUN_SESSION = @DBUS_RUN_SESSION@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FILECMD = @FILECMD@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ GLIB_THREADS_LIBS = @GLIB_THREADS_LIBS@ GREP = @GREP@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ HTML_DIR = @HTML_DIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ 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@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ 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@ 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__rm_f_notfound = @am__rm_f_notfound@ am__tar = @am__tar@ am__untar = @am__untar@ am__xargs_n = @am__xargs_n@ 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@ runstatedir = @runstatedir@ 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_builddir)/dbus \ $(DBUS_CFLAGS) \ $(GLIB_CFLAGS) \ -DDBUS_COMPILATION LDADD = $(GLIB_LIBS) \ $(top_builddir)/dbus/libdbus-glib-1.la \ $(top_builddir)/dbus/libdbus-gtool.la \ $(top_builddir)/dbus-gmain/tests/libtest.la \ $(NULL) @DBUS_BUILD_TESTS_TRUE@TESTS_ENVIRONMENT = \ @DBUS_BUILD_TESTS_TRUE@ DBUS_TOP_BUILDDIR=@abs_top_builddir@ \ @DBUS_BUILD_TESTS_TRUE@ DBUS_BINDING_TOOL=$(DBUS_BINDING_TOOL) \ @DBUS_BUILD_TESTS_TRUE@ $(NULL) VALGRIND_ENV = G_DEBUG=gc-friendly G_SLICE=always-malloc VALGRIND = valgrind VALGRIND_ARGS = \ --gen-suppressions=all \ --leak-check=full \ --leak-resolution=high \ --num-callers=20 \ --suppressions=$(abs_top_srcdir)/tools/dbus-glib.supp \ --suppressions=$(abs_top_srcdir)/tools/dbus-glib-tests.supp \ --verbose \ $(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 .log .o .obj .test .test$(EXEEXT) .trs $(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) --foreign test/interfaces/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign test/interfaces/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__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ 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: $(am__rm_f) $(noinst_PROGRAMS) test -z "$(EXEEXT)" || $(am__rm_f) $(noinst_PROGRAMS:$(EXEEXT)=) 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@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-dup-prop.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-interfaces.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-objects.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-server.Po@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @: >>$@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.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 -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.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 -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.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: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ 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-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ 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" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags # Recover from deleted '.trs' file; this should ensure that # "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create # both 'foo.log' and 'foo.trs'. Break the recipe in two subshells # to avoid problems with "make -n". .log.trs: rm -f $< $@ $(MAKE) $(AM_MAKEFLAGS) $< # Leading 'am--fnord' is there to ensure the list of targets does not # expand to empty, as could happen e.g. with make check TESTS=''. am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck) am--force-recheck: @: $(TEST_SUITE_LOG): $(TEST_LOGS) @$(am__set_TESTS_bases); \ am__f_ok () { test -f "$$1" && test -r "$$1"; }; \ redo_bases=`for i in $$bases; do \ am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \ done`; \ if test -n "$$redo_bases"; then \ redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \ redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \ if $(am__make_dryrun); then :; else \ rm -f $$redo_logs && rm -f $$redo_results || exit 1; \ fi; \ fi; \ if test -n "$$am__remaking_logs"; then \ echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \ "recursion detected" >&2; \ elif test -n "$$redo_logs"; then \ am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \ fi; \ if $(am__make_dryrun); then :; else \ st=0; \ errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \ for i in $$redo_bases; do \ test -f $$i.trs && test -r $$i.trs \ || { echo "$$errmsg $$i.trs" >&2; st=1; }; \ test -f $$i.log && test -r $$i.log \ || { echo "$$errmsg $$i.log" >&2; st=1; }; \ done; \ test $$st -eq 0 || exit 1; \ fi @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \ ws='[ ]'; \ results=`for b in $$bases; do echo $$b.trs; done`; \ test -n "$$results" || results=/dev/null; \ all=` grep "^$$ws*:test-result:" $$results | wc -l`; \ pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \ fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \ skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \ xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \ xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \ error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \ if test `expr $$fail + $$xpass + $$error` -eq 0; then \ success=true; \ else \ success=false; \ fi; \ br='==================='; br=$$br$$br$$br$$br; \ result_count () \ { \ if test x"$$1" = x"--maybe-color"; then \ maybe_colorize=yes; \ elif test x"$$1" = x"--no-color"; then \ maybe_colorize=no; \ else \ echo "$@: invalid 'result_count' usage" >&2; exit 4; \ fi; \ shift; \ desc=$$1 count=$$2; \ if test $$maybe_colorize = yes && test $$count -gt 0; then \ color_start=$$3 color_end=$$std; \ else \ color_start= color_end=; \ fi; \ echo "$${color_start}# $$desc $$count$${color_end}"; \ }; \ create_testsuite_report () \ { \ result_count $$1 "TOTAL:" $$all "$$brg"; \ result_count $$1 "PASS: " $$pass "$$grn"; \ result_count $$1 "SKIP: " $$skip "$$blu"; \ result_count $$1 "XFAIL:" $$xfail "$$lgn"; \ result_count $$1 "FAIL: " $$fail "$$red"; \ result_count $$1 "XPASS:" $$xpass "$$red"; \ result_count $$1 "ERROR:" $$error "$$mgn"; \ }; \ output_system_information () \ { \ echo; \ { uname -a | $(AWK) '{ \ printf "System information (uname -a):"; \ for (i = 1; i < NF; ++i) \ { \ if (i != 2) \ printf " %s", $$i; \ } \ printf "\n"; \ }'; } 2>&1; \ if test -r /etc/os-release; then \ echo "Distribution information (/etc/os-release):"; \ sed 8q /etc/os-release; \ elif test -r /etc/issue; then \ echo "Distribution information (/etc/issue):"; \ cat /etc/issue; \ fi; \ }; \ please_report () \ { \ echo "Some test(s) failed. Please report this to $(PACKAGE_BUGREPORT),"; \ echo "together with the test-suite.log file (gzipped) and your system"; \ echo "information. Thanks."; \ }; \ { \ echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \ $(am__rst_title); \ create_testsuite_report --no-color; \ output_system_information; \ echo; \ echo ".. contents:: :depth: 2"; \ echo; \ for b in $$bases; do echo $$b; done \ | $(am__create_global_log); \ } >$(TEST_SUITE_LOG).tmp || exit 1; \ mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \ if $$success; then \ col="$$grn"; \ else \ col="$$red"; \ test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \ fi; \ echo "$${col}$$br$${std}"; \ echo "$${col}Testsuite summary"$(AM_TESTSUITE_SUMMARY_HEADER)"$${std}"; \ echo "$${col}$$br$${std}"; \ create_testsuite_report --maybe-color; \ echo "$$col$$br$$std"; \ if $$success; then :; else \ echo "$${col}See $(subdir)/$(TEST_SUITE_LOG) for debugging.$${std}";\ if test -n "$(PACKAGE_BUGREPORT)"; then \ please_report | sed -e "s/^/$${col}/" -e s/'$$'/"$${std}"/; \ fi; \ echo "$$col$$br$$std"; \ fi; \ $$success || exit 1 check-TESTS: @$(am__rm_f) $(RECHECK_LOGS) @$(am__rm_f) $(RECHECK_LOGS:.log=.trs) @$(am__rm_f) $(TEST_SUITE_LOG) @set +e; $(am__set_TESTS_bases); \ log_list=`for i in $$bases; do echo $$i.log; done`; \ log_list=`echo $$log_list`; \ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \ exit $$?; recheck: all @$(am__rm_f) $(TEST_SUITE_LOG) @set +e; $(am__set_TESTS_bases); \ bases=`for i in $$bases; do echo $$i; done \ | $(am__list_recheck_tests)` || exit 1; \ log_list=`for i in $$bases; do echo $$i.log; done`; \ log_list=`echo $$log_list`; \ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \ am__force_recheck=am--force-recheck \ TEST_LOGS="$$log_list"; \ exit $$? run-test.sh.log: run-test.sh @p='run-test.sh'; \ b='run-test.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) .test.log: @p='$<'; \ $(am__set_b); \ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) @am__EXEEXT_TRUE@.test$(EXEEXT).log: @am__EXEEXT_TRUE@ @p='$<'; \ @am__EXEEXT_TRUE@ $(am__set_b); \ @am__EXEEXT_TRUE@ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ @am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \ @am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ @am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT) distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(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: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) 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: -$(am__rm_f) $(TEST_LOGS) -$(am__rm_f) $(TEST_LOGS:.log=.trs) -$(am__rm_f) $(TEST_SUITE_LOG) clean-generic: -$(am__rm_f) $(CLEANFILES) distclean-generic: -$(am__rm_f) $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || $(am__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." -$(am__rm_f) $(BUILT_SOURCES) clean: clean-am clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/test-client.Po -rm -f ./$(DEPDIR)/test-dup-prop.Po -rm -f ./$(DEPDIR)/test-interfaces.Po -rm -f ./$(DEPDIR)/test-objects.Po -rm -f ./$(DEPDIR)/test-server.Po -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 -f ./$(DEPDIR)/test-client.Po -rm -f ./$(DEPDIR)/test-dup-prop.Po -rm -f ./$(DEPDIR)/test-interfaces.Po -rm -f ./$(DEPDIR)/test-objects.Po -rm -f ./$(DEPDIR)/test-server.Po -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-exec \ install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-TESTS \ check-am clean clean-generic clean-libtool \ clean-noinstPROGRAMS cscopelist-am ctags ctags-am 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 recheck tags tags-am uninstall \ uninstall-am .PRECIOUS: Makefile check-valgrind: all $(MAKE) check-TESTS \ DEBUG="env $(VALGRIND_ENV) $(VALGRIND) $(VALGRIND_ARGS)" @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: # Tell GNU make to disable its built-in pattern rules. %:: %,v %:: RCS/%,v %:: RCS/% %:: s.% %:: SCCS/s.% dbus-glib-0.114/test/interfaces/Makefile.am0000644000175000017500000001103613233575561014221 AM_CPPFLAGS = \ -I$(top_srcdir) \ -I$(top_builddir) \ -I$(top_builddir)/dbus \ $(DBUS_CFLAGS) \ $(GLIB_CFLAGS) \ -DDBUS_COMPILATION LDADD = $(GLIB_LIBS) \ $(top_builddir)/dbus/libdbus-glib-1.la \ $(top_builddir)/dbus/libdbus-gtool.la \ $(top_builddir)/dbus-gmain/tests/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=@abs_top_builddir@ \ DBUS_BINDING_TOOL=$(DBUS_BINDING_TOOL) \ $(NULL) TESTS=run-test.sh else TESTS= endif VALGRIND_ENV = G_DEBUG=gc-friendly G_SLICE=always-malloc VALGRIND = valgrind VALGRIND_ARGS = \ --gen-suppressions=all \ --leak-check=full \ --leak-resolution=high \ --num-callers=20 \ --suppressions=$(abs_top_srcdir)/tools/dbus-glib.supp \ --suppressions=$(abs_top_srcdir)/tools/dbus-glib-tests.supp \ --verbose \ $(NULL) check-valgrind: all $(MAKE) check-TESTS \ DEBUG="env $(VALGRIND_ENV) $(VALGRIND) $(VALGRIND_ARGS)" 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.114/test/core/0000775000175000017500000000000014764624122011051 5dbus-glib-0.114/test/core/test-service-glib.xml0000644000175000017500000001243413233560240015033 dbus-glib-0.114/test/core/test-service-glib-subclass.xml0000644000175000017500000000054213233560240016645 dbus-glib-0.114/test/core/run-test.sh0000755000175000017500000000532313515561041013103 #! /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-shared-bus || die "test-shared-bus failed" ${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-private || die "test-private 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" ${DBUS_TOP_BUILDDIR}/libtool --mode=execute $DEBUG $DBUS_TOP_BUILDDIR/test/core/test-unsupported-type || die "test-unsupported-type failed" fi dbus-glib-0.114/test/core/run-peer-test.sh0000755000175000017500000000032213233560240014023 #!/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.114/test/core/test-variant-recursion.c0000644000175000017500000000651414027364762015574 /* SPDX-License-Identifier: AFL-2.1 OR GPL-2.0-or-later */ #include #undef G_DISABLE_ASSERT /* -*- mode: C; c-file-style: "gnu" -*- */ #include #include #include #include #include #include #include #include #include "dbus-gmain/tests/util.h" static gboolean make_recursive_stringify_call (int recursion_depth, DBusGProxy *proxy, GError **error) { gchar *out_str; gboolean ret; int i; GValue *val = g_new0 (GValue, 1); g_value_init (val, G_TYPE_STRING); g_value_set_string (val, "end of the line"); for (i = 0; i < recursion_depth; i++) { GValue *tmp = g_new0 (GValue, 1); g_value_init (tmp, G_TYPE_VALUE); g_value_take_boxed (tmp, val); val = tmp; } ret = dbus_g_proxy_call (proxy, "Stringify", error, G_TYPE_VALUE, val, G_TYPE_INVALID, G_TYPE_STRING, &out_str, G_TYPE_INVALID); g_boxed_free (G_TYPE_VALUE, val); /* the out parameter is meaningless if it failed */ if (ret) g_free (out_str); return ret; } 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_private (DBUS_BUS_SESSION, NULL, &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); g_assert_error (error, DBUS_GERROR, DBUS_GERROR_NO_MEMORY); 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)); test_run_until_disconnected (dbus_g_connection_get_connection (connection), NULL); dbus_g_connection_unref (connection); g_main_loop_unref (loop); dbus_shutdown (); return 0; } dbus-glib-0.114/test/core/unsupported-type.c0000644000175000017500000002117214027364762014510 /* * Copyright © 2009-2014 Collabora Ltd. * Copyright © 2009-2011 Nokia Corporation * * SPDX-License-Identifier: AFL-2.1 OR GPL-2.0-or-later OR MIT * * 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 #undef G_DISABLE_ASSERT #include #include #include #include #include #ifdef G_OS_UNIX # include # include # include # include #endif #include "my-object.h" GMainLoop *loop = NULL; typedef struct { DBusGConnection *bus; GObject *object; DBusGProxy *proxy; DBusGProxyCall *call; gsize in_flight; int fd; } Fixture; #ifdef G_OS_UNIX static void call_cb (DBusGProxy *proxy, DBusGProxyCall *call, gpointer user_data) { Fixture *f = user_data; g_assert (proxy == f->proxy); g_assert (call == f->call); f->in_flight--; } static void setup (Fixture *f, gconstpointer path_to_use) { DBusConnection *libdbus; f->bus = dbus_g_bus_get_private (DBUS_BUS_SESSION, g_main_context_default (), NULL); g_assert (f->bus != NULL); libdbus = dbus_g_connection_get_connection (f->bus); dbus_connection_set_exit_on_disconnect (libdbus, FALSE); f->object = g_object_new (MY_TYPE_OBJECT, NULL); g_assert (MY_IS_OBJECT (f->object)); dbus_g_connection_register_g_object (f->bus, "/object", (GObject *) f->object); f->proxy = dbus_g_proxy_new_for_name (f->bus, dbus_bus_get_unique_name (libdbus), "/notdbusglib", "org.freedesktop.DBus.GLib.Tests.Example"); f->fd = g_open ("/dev/null", O_RDONLY, 0); if (f->fd < 0) g_error ("unable to open /dev/null: %s", g_strerror (errno)); } static void teardown (Fixture *f, gconstpointer test_data G_GNUC_UNUSED) { g_clear_object (&f->proxy); if (f->object != NULL) { dbus_g_connection_unregister_g_object (f->bus, f->object); g_object_unref (f->object); } if (f->bus != NULL) { dbus_connection_close (dbus_g_connection_get_connection (f->bus)); dbus_g_connection_unref (f->bus); } if (f->fd >= 0) { close (f->fd); f->fd = -1; } } static void pending_call_store_reply (DBusPendingCall *pc, void *data) { DBusMessage **message_p = data; g_assert (*message_p == NULL); *message_p = dbus_pending_call_steal_reply (pc); g_assert (*message_p != NULL); } /* * Exercise a call to a dbus-glib method with an unsupported parameter * type. The only unsupported parameter type we know is 'h', a Unix fd, * which is why this test is Unix-only. */ static void test_call (Fixture *f, gconstpointer test_data G_GNUC_UNUSED) { DBusConnection *libdbus = dbus_g_connection_get_connection (f->bus); const char *unique = dbus_bus_get_unique_name (libdbus); DBusMessage *m = dbus_message_new_method_call (unique, "/object", "org.freedesktop.DBus.GLib.Tests.MyObject", "EchoVariant"); DBusPendingCall *pc; DBusMessageIter iter; DBusMessageIter var_iter; DBusMessage *reply = NULL; if (m == NULL) g_error ("OOM"); dbus_message_iter_init_append (m, &iter); if (!dbus_message_iter_open_container (&iter, DBUS_TYPE_VARIANT, DBUS_TYPE_UNIX_FD_AS_STRING, &var_iter)) g_error ("OOM"); if (!dbus_message_iter_append_basic (&var_iter, DBUS_TYPE_UNIX_FD, &f->fd)) { /* FIXME: cannot distinguish between inability to use fd and OOM */ dbus_message_iter_abandon_container (&iter, &var_iter); dbus_message_unref (m); g_test_skip ("Unix fd-passing does not appear to be supported"); return; } if (!dbus_message_iter_close_container (&iter, &var_iter)) g_error ("OOM"); if (!dbus_connection_send_with_reply (libdbus, m, &pc, -1) || pc == NULL) g_error ("OOM"); if (dbus_pending_call_get_completed (pc)) pending_call_store_reply (pc, &reply); else if (!dbus_pending_call_set_notify (pc, pending_call_store_reply, &reply, NULL)) g_error ("OOM"); dbus_message_unref (m); while (reply == NULL) g_main_context_iteration (NULL, TRUE); dbus_pending_call_unref (pc); /* it didn't work */ /* this is what it should be */ g_assert_cmpstr (dbus_message_get_error_name (reply), ==, DBUS_ERROR_INVALID_SIGNATURE); /* it didn't call the into the user-supplied C code */ g_assert_cmpuint (MY_OBJECT (f->object)->echo_variant_called, ==, 0); dbus_message_unref (reply); } /* * Exercise a call from dbus-glib to a method returning an unsupported * parameter type. Again, the only unsupported parameter type we know is 'h'. */ static void unregister_cb (DBusConnection *conn, void *user_data) { } static DBusHandlerResult message_cb (DBusConnection *conn, DBusMessage *m, void *user_data) { Fixture *f = user_data; DBusMessage *reply = dbus_message_new_method_return (m); DBusMessageIter iter; DBusMessageIter var_iter; if (reply == NULL) g_error ("OOM"); dbus_message_iter_init_append (reply, &iter); if (!dbus_message_iter_open_container (&iter, DBUS_TYPE_VARIANT, DBUS_TYPE_UNIX_FD_AS_STRING, &var_iter)) g_error ("OOM"); if (dbus_message_iter_append_basic (&var_iter, DBUS_TYPE_UNIX_FD, &f->fd)) { if (!dbus_message_iter_close_container (&iter, &var_iter)) g_error ("OOM"); } else { /* FIXME: cannot distinguish between inability to use fd and OOM */ dbus_message_iter_abandon_container (&iter, &var_iter); dbus_message_unref (reply); reply = dbus_message_new_error (m, DBUS_ERROR_NOT_SUPPORTED, "Unable to append Unix fd"); if (reply == NULL) g_error ("OOM"); } if (!dbus_connection_send (conn, reply, NULL)) g_error ("OOM"); return DBUS_HANDLER_RESULT_HANDLED; } static DBusObjectPathVTable vtable = { unregister_cb, message_cb, NULL, NULL, NULL, NULL }; static void test_ret (Fixture *f, gconstpointer test_data G_GNUC_UNUSED) { DBusConnection *libdbus = dbus_g_connection_get_connection (f->bus); GError *error = NULL; GValue value; dbus_connection_register_object_path (libdbus, "/notdbusglib", &vtable, f); f->in_flight = 1; f->call = dbus_g_proxy_begin_call (f->proxy, "ReturnUnixFd", call_cb, f, NULL, G_TYPE_INVALID); while (f->in_flight > 0) g_main_context_iteration (NULL, TRUE); if (dbus_g_proxy_end_call (f->proxy, f->call, &error, G_TYPE_VALUE, &value, G_TYPE_INVALID)) { g_error ("that shouldn't have worked!"); } if (g_error_matches (error, DBUS_GERROR, DBUS_GERROR_NOT_SUPPORTED)) { g_test_skip ("couldn't send a Unix fd"); } else { g_assert_error (error, DBUS_GERROR, DBUS_GERROR_INVALID_ARGS); } g_clear_error (&error); dbus_connection_unregister_object_path (libdbus, "/notdbusglib"); } #endif int main (int argc, char **argv) { g_type_init (); dbus_g_type_specialized_init (); g_test_init (&argc, &argv, NULL); #ifdef G_OS_UNIX g_test_add ("/unsupported-type/call", Fixture, NULL, setup, test_call, teardown); g_test_add ("/unsupported-type/ret", Fixture, NULL, setup, test_ret, teardown); #endif return g_test_run (); } dbus-glib-0.114/test/core/test-types.c0000644000175000017500000000216614027364762013264 /* SPDX-License-Identifier: AFL-2.1 OR GPL-2.0-or-later */ #include #undef G_DISABLE_ASSERT #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_private (DBUS_BUS_SESSION, NULL, &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_connection_close (conn); dbus_g_connection_unref (gconn); dbus_shutdown (); return 0; } dbus-glib-0.114/test/core/shared-bus.c0000644000175000017500000000747614027364762013211 /* Regression test for the shared bus instance. * This test is expected to "leak" the shared connection. * * Copyright © 2006-2010 Red Hat, Inc. * Copyright © 2006-2008 Collabora Ltd. * Copyright © 2011 Nokia Corporation * * SPDX-License-Identifier: AFL-2.1 OR GPL-2.0-or-later * * 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 #undef G_DISABLE_ASSERT #include #include #include GMainLoop *loop = NULL; typedef struct { DBusGConnection *bus; DBusGConnection *priv; GError *error; } Fixture; static void destroy_cb (DBusGProxy *proxy G_GNUC_UNUSED, gpointer user_data) { gboolean *disconnected = user_data; *disconnected = TRUE; } static void disconnect (DBusGConnection **bus) { DBusGProxy *proxy; gboolean disconnected = FALSE; g_printerr ("Disconnecting... "); dbus_connection_set_exit_on_disconnect (dbus_g_connection_get_connection (*bus), FALSE); proxy = dbus_g_proxy_new_for_peer (*bus, "/", "org.freedesktop.DBus.Peer"); g_signal_connect (G_OBJECT (proxy), "destroy", G_CALLBACK (destroy_cb), &disconnected); dbus_connection_close (dbus_g_connection_get_connection (*bus)); while (!disconnected) { g_printerr ("."); g_main_context_iteration (NULL, TRUE); } g_signal_handlers_disconnect_by_func (proxy, destroy_cb, &disconnected); g_object_unref (proxy); dbus_g_connection_unref (*bus); *bus = NULL; g_printerr (" disconnected\n"); } static void setup (Fixture *f, gconstpointer test_data G_GNUC_UNUSED) { } static void teardown (Fixture *f, gconstpointer test_data G_GNUC_UNUSED) { if (f->bus != NULL) dbus_g_connection_unref (f->bus); if (f->priv != NULL) disconnect (&f->priv); g_clear_error (&f->error); dbus_shutdown (); } static void test_shared_bus (Fixture *f, gconstpointer test_data G_GNUC_UNUSED) { f->bus = dbus_g_bus_get (DBUS_BUS_SESSION, &f->error); g_assert_no_error (f->error); g_assert_nonnull (f->bus); dbus_connection_set_exit_on_disconnect (dbus_g_connection_get_connection (f->bus), FALSE); g_assert_true (f->bus == dbus_g_bus_get (DBUS_BUS_SESSION, NULL)); g_assert_true (f->bus == dbus_g_bus_get (DBUS_BUS_SESSION, NULL)); g_assert_true (f->bus == dbus_g_bus_get (DBUS_BUS_SESSION, NULL)); f->priv = dbus_g_bus_get_private (DBUS_BUS_SESSION, NULL, &f->error); g_assert_no_error (f->error); g_assert_nonnull (f->priv); g_assert_true (f->priv != f->bus); dbus_connection_set_exit_on_disconnect (dbus_g_connection_get_connection (f->priv), FALSE); } int main (int argc, char **argv) { g_type_init (); g_log_set_always_fatal (G_LOG_LEVEL_WARNING | G_LOG_LEVEL_CRITICAL); g_test_bug_base ("https://bugs.freedesktop.org/show_bug.cgi?id="); g_test_init (&argc, &argv, NULL); g_test_add ("/shared-bus", Fixture, NULL, setup, test_shared_bus, teardown); return g_test_run (); } dbus-glib-0.114/test/core/test-service-glib.c0000644000175000017500000000651614027364762014476 /* SPDX-License-Identifier: AFL-2.1 OR GPL-2.0-or-later */ #include #undef G_DISABLE_ASSERT /* -*- 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 (); 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_nonnull (error); 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.114/test/core/registrations.c0000644000175000017500000003405414027364762014041 /* Regression test for object registration and unregistration * * Copyright © 2009 Collabora Ltd. * Copyright © 2009-2011 Nokia Corporation * * SPDX-License-Identifier: AFL-2.1 OR GPL-2.0-or-later OR MIT * * 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 #undef G_DISABLE_ASSERT #include #include #include "my-object.h" #include "dbus-gmain/tests/util.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_nonnull (f->bus); f->bus2 = dbus_g_bus_get_private (DBUS_BUS_SESSION, NULL, NULL); g_assert_nonnull (f->bus2); f->object = g_object_new (MY_TYPE_OBJECT, NULL); g_assert_true (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) { test_run_until_disconnected (dbus_g_connection_get_connection (f->bus), NULL); dbus_g_connection_unref (f->bus); } if (f->bus2 != NULL) { test_run_until_disconnected (dbus_g_connection_get_connection (f->bus2), NULL); 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); dbus_shutdown (); } 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_true (dbus_g_connection_lookup_g_object (f->bus, "/foo") == f->object); /* this was briefly broken while fixing fd.o#5688 */ g_assert_null (dbus_g_connection_lookup_g_object (f->bus, "/bar")); } 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_true (dbus_g_connection_lookup_g_object (f->bus, "/foo") == f->object); dbus_g_connection_unregister_g_object (f->bus, f->object); g_assert_null (dbus_g_connection_lookup_g_object (f->bus, "/foo")); } 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_true (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_null (weak_pointer); g_assert_null (dbus_g_connection_lookup_g_object (f->bus, "/foo")); } 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_true (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_null (dbus_g_connection_lookup_g_object (f->bus, "/foo")); } 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_true (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_true (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_null (dbus_g_connection_lookup_g_object (f->bus, "/foo")); } 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_nonnull (sender); g_assert_nonnull (path); if (g_strcmp0 (path, "/foo") == 0) { g_assert_cmpstr (sender, ==, dbus_bus_get_unique_name ( dbus_g_connection_get_connection (f->bus))); g_assert_null (f->frobnicate1_message); 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_null (f->frobnicate2_message); 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_true (dbus_g_connection_lookup_g_object (f->bus, "/foo") == f->object); g_assert_true (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_true (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_null (f->frobnicate1_message); dbus_message_unref (f->frobnicate2_message); f->frobnicate2_message = NULL; } static void test_clean_slate (Fixture *f, gconstpointer test_data G_GNUC_UNUSED) { 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_true (mem); dbus_g_connection_register_g_object (f->bus, "/foo", f->object); g_assert_true (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_true (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_true (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_null (f->frobnicate1_message); 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_nonnull (sender); g_assert_nonnull (path); 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_true (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_true (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_true (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) { 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.114/test/core/proxy-peer.c0000644000175000017500000001541314027364762013254 /* Regression tests for using a DBusGProxy on a peer-to-peer connection. * * Author: Simon McVittie * Copyright © 2011 Nokia Corporation * * SPDX-License-Identifier: MIT * * 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 #undef G_DISABLE_ASSERT #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_null (f->server_conn); 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_true (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_nonnull (f->server); dbus_server_set_new_connection_function (f->server, new_conn_cb, f, NULL); dbus_server_setup_with_g_main (f->server, NULL); g_assert_null (f->server_conn); f->client_conn = dbus_connection_open_private ( dbus_server_get_address (f->server), &f->e); assert_no_error (&f->e); g_assert_nonnull (f->client_conn); 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_nonnull (f->proxy); g_assert_true (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_true (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_nonnull (call); 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_true (ok); ok = dbus_g_proxy_end_call (f->proxy, call, &error, G_TYPE_INVALID); g_assert_no_error (error); g_assert_true (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_null (fail); ok = dbus_g_proxy_end_call (f->proxy, fail, &error, G_TYPE_INVALID); g_assert_error (error, DBUS_GERROR, DBUS_GERROR_DISCONNECTED); g_assert_false (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.114/test/core/proxy-noc.c0000644000175000017500000001736614027364762013111 /* Regression tests for DBusGProxy's NameOwnerChanged handling. * * Author: Simon McVittie * Copyright © 2011 Nokia Corporation * Copyright © 2013 Collabora Ltd. * * SPDX-License-Identifier: MIT * * 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. */ /* To compile outside dbus-glib: cc -otest-proxy-noc \ `pkg-config --cflags --libs gobject-2.0 dbus-glib-1 dbus-1` \ proxy-noc.c */ #ifdef HAVE_CONFIG_H #include #undef G_DISABLE_ASSERT #endif #include #include #include #include #define WELL_KNOWN_NAME "com.example.AuthService" #define PATH "/" #define IFACE WELL_KNOWN_NAME #define AUTH_RESULT "AuthenticationResult" typedef struct { GError *error; DBusError dbus_error; DBusConnection *service_conn; DBusGConnection *service_gconn; DBusConnection *attacker_conn; DBusGConnection *attacker_gconn; DBusConnection *client_conn; DBusGConnection *client_gconn; DBusGProxy *proxy; GPtrArray *auth_results; } Fixture; static void oom (void) G_GNUC_NORETURN; static void oom (void) { g_error ("out of memory"); } 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 auth_result_cb (DBusGProxy *proxy, const gchar *res, gpointer user_data) { Fixture *f = user_data; g_assert_true (proxy == f->proxy); g_ptr_array_add (f->auth_results, g_strdup (res)); } static void setup (Fixture *f, gconstpointer addr) { int ret; dbus_error_init (&f->dbus_error); /* A trusted service on the bus. (For this to be a vulnerability, it * would have to be the system bus.) */ f->service_gconn = dbus_g_bus_get_private (DBUS_BUS_SESSION, NULL, &f->error); g_assert_no_error (f->error); g_assert_nonnull (f->service_gconn); f->service_conn = dbus_g_connection_get_connection (f->service_gconn); /* An attacker that intends to pretend to be that service. */ f->attacker_gconn = dbus_g_bus_get_private (DBUS_BUS_SESSION, NULL, &f->error); g_assert_no_error (f->error); g_assert_nonnull (f->attacker_gconn); f->attacker_conn = dbus_g_connection_get_connection (f->attacker_gconn); /* The service owns a well-known name. */ ret = dbus_bus_request_name (f->service_conn, WELL_KNOWN_NAME, DBUS_NAME_FLAG_DO_NOT_QUEUE, &f->dbus_error); assert_no_error (&f->dbus_error); g_assert_cmpint (ret, ==, DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER); /* The victim of the attack. */ f->client_gconn = dbus_g_bus_get_private (DBUS_BUS_SESSION, NULL, &f->error); g_assert_no_error (f->error); g_assert_nonnull (f->client_gconn); f->client_conn = dbus_g_connection_get_connection (f->client_gconn); f->proxy = dbus_g_proxy_new_for_name (f->client_gconn, WELL_KNOWN_NAME, PATH, IFACE); g_assert_true (DBUS_IS_G_PROXY (f->proxy)); /* The proxy is listening for the signal. */ f->auth_results = g_ptr_array_new_with_free_func (g_free); dbus_g_proxy_add_signal (f->proxy, AUTH_RESULT, G_TYPE_STRING, G_TYPE_INVALID); dbus_g_proxy_connect_signal (f->proxy, AUTH_RESULT, G_CALLBACK (auth_result_cb), f, NULL); } static void test_spoof (Fixture *f, gconstpointer addr) { DBusMessage *message; const char *well_known_name = WELL_KNOWN_NAME; const char *service_name = dbus_bus_get_unique_name (f->service_conn); const char *client_name = dbus_bus_get_unique_name (f->client_conn); const char *attacker_name = dbus_bus_get_unique_name (f->attacker_conn); const char *auth_result; auth_result = "on yr bus spoofing yr authentication"; /* The attacker tries to pretend to be the service by spoofing * NameOwnerChanged(name=WELL_KNOWN_NAME, old=service, new=attacker). */ message = dbus_message_new_signal (DBUS_PATH_DBUS, DBUS_INTERFACE_DBUS, "NameOwnerChanged"); if (message == NULL || /* Bypass match rules by sending it unicast */ !dbus_message_set_destination (message, client_name) || !dbus_message_append_args (message, DBUS_TYPE_STRING, &well_known_name, DBUS_TYPE_STRING, &service_name, DBUS_TYPE_STRING, &attacker_name, DBUS_TYPE_INVALID) || !dbus_connection_send (f->attacker_conn, message, NULL)) { oom (); } dbus_message_unref (message); /* The attacker sends a message purporting to be from the service. */ message = dbus_message_new_signal (PATH, IFACE, AUTH_RESULT); if (message == NULL || /* Again, bypass match rules by sending it unicast */ !dbus_message_set_destination (message, client_name) || !dbus_message_append_args (message, DBUS_TYPE_STRING, &auth_result, DBUS_TYPE_INVALID) || !dbus_connection_send (f->attacker_conn, message, NULL)) { oom (); } dbus_message_unref (message); /* The service sends a message - too slow! The attacker won the race. */ auth_result = "access denied"; message = dbus_message_new_signal (PATH, IFACE, AUTH_RESULT); if (message == NULL || !dbus_message_append_args (message, DBUS_TYPE_STRING, &auth_result, DBUS_TYPE_INVALID) || !dbus_connection_send (f->service_conn, message, NULL)) { oom (); } dbus_message_unref (message); /* Client waits for the first response */ while (f->auth_results->len < 1) g_main_context_iteration (NULL, TRUE); /* The spoofed result was ignored, the real result was used. */ g_assert_cmpstr (g_ptr_array_index (f->auth_results, 0), ==, "access denied"); } static void teardown (Fixture *f, gconstpointer addr G_GNUC_UNUSED) { f->client_gconn = NULL; f->service_gconn = NULL; f->attacker_gconn = NULL; g_ptr_array_unref (f->auth_results); if (f->proxy != NULL) { dbus_g_proxy_disconnect_signal (f->proxy, AUTH_RESULT, G_CALLBACK (auth_result_cb), f); g_object_unref (f->proxy); f->proxy = NULL; } if (f->client_conn != NULL) { dbus_connection_close (f->client_conn); dbus_connection_unref (f->client_conn); f->client_conn = NULL; } if (f->service_conn != NULL) { dbus_connection_close (f->service_conn); dbus_connection_unref (f->service_conn); f->service_conn = NULL; } if (f->attacker_conn != NULL) { dbus_connection_close (f->attacker_conn); dbus_connection_unref (f->attacker_conn); f->attacker_conn = 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/spoof", Fixture, "unix:tmpdir=/tmp", setup, test_spoof, teardown); return g_test_run (); } dbus-glib-0.114/test/core/test-profile.c0000664000175000017500000007245514764565250013575 /* -*- 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. * * SPDX-License-Identifier: AFL-2.1 OR GPL-2.0-or-later * * 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); } dbus_connection_set_exit_on_disconnect (connection, FALSE); 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=/tmp", &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); } dbus_connection_set_exit_on_disconnect (connection, FALSE); 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_connection_set_exit_on_disconnect (connection, FALSE); 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_cmpint (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_cmpint (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; { 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); 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; strncpy (addr.sun_path, plain_sockets_address, _DBUS_MAX_SUN_PATH_LENGTH - 1); 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_new ("client-thread", vtable->client_thread_func, (void*) vtable); } 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[]) { #if (!GLIB_CHECK_VERSION (2, 35, 1)) g_type_init (); #endif #ifndef TEST_PROFILE_DISABLED dbus_g_thread_init (); #ifndef G_DISABLE_ASSERT g_printerr ("You should probably --disable-asserts before you profile as they have 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.114/test/core/private.c0000664000175000017500000001572314764565250012625 /* Feature test for freedesktop.org #23633 - non-default main context * * Copyright © 2009 Collabora Ltd. * Copyright © 2009-2011 Nokia Corporation * * SPDX-License-Identifier: AFL-2.1 OR GPL-2.0-or-later OR MIT * * 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 "my-object.h" /* MyObject needs this, but it doesn't do anything useful... */ GMainLoop *loop = NULL; typedef struct { GMainContext *context; DBusGConnection *bus; GObject *object; DBusGProxy *proxy; DBusGProxyCall *call; gsize in_flight; } Fixture; static void call_cb (DBusGProxy *proxy, DBusGProxyCall *call, gpointer user_data) { Fixture *f = user_data; g_assert_true (proxy == f->proxy); g_assert_true (call == f->call); f->in_flight--; } static void frobnicate_cb (DBusGProxy *proxy, int arg, gpointer user_data) { Fixture *f = user_data; g_assert_true (proxy == f->proxy); f->in_flight--; g_assert_cmpint (arg, ==, 42); } static void setup (Fixture *f, gconstpointer path_to_use) { f->context = g_main_context_new (); f->in_flight = 0; f->bus = dbus_g_bus_get_private (DBUS_BUS_SESSION, f->context, NULL); g_assert_nonnull (f->bus); f->object = g_object_new (MY_TYPE_OBJECT, NULL); g_assert_true (MY_IS_OBJECT (f->object)); dbus_g_connection_register_g_object (f->bus, "/object", (GObject *) f->object); f->proxy = dbus_g_proxy_new_for_name (f->bus, dbus_bus_get_unique_name (dbus_g_connection_get_connection (f->bus)), "/object", "org.freedesktop.DBus.GLib.Tests.MyObject"); dbus_g_proxy_add_signal (f->proxy, "Frobnicate", G_TYPE_INT, G_TYPE_INVALID); dbus_g_proxy_connect_signal (f->proxy, "Frobnicate", G_CALLBACK (frobnicate_cb), f, NULL); } static void teardown (Fixture *f, gconstpointer test_data G_GNUC_UNUSED) { if (f->proxy != NULL) { dbus_g_proxy_disconnect_signal (f->proxy, "Frobnicate", G_CALLBACK (frobnicate_cb), f); g_object_unref (f->proxy); } if (f->object != NULL) { dbus_g_connection_unregister_g_object (f->bus, f->object); g_object_unref (f->object); } if (f->bus != NULL) { dbus_connection_close (dbus_g_connection_get_connection (f->bus)); dbus_g_connection_unref (f->bus); } if (f->context != NULL) g_main_context_unref (f->context); } static void test_call (Fixture *f, gconstpointer test_data G_GNUC_UNUSED) { guint i, iterations; double t; if (g_test_perf ()) iterations = 100000; else iterations = 1000; g_test_timer_start (); for (i = 0; i < iterations; i++) { GError *error = NULL; guint result; gboolean ok; f->in_flight++; f->call = dbus_g_proxy_begin_call (f->proxy, "Increment", call_cb, f, NULL, G_TYPE_UINT, 666, G_TYPE_INVALID); while (f->in_flight) g_main_context_iteration (f->context, TRUE); ok = dbus_g_proxy_end_call (f->proxy, f->call, &error, G_TYPE_UINT, &result, G_TYPE_INVALID); g_assert_no_error (error); g_assert_true (ok); g_assert_cmpuint (result, ==, 667); } t = g_test_timer_elapsed (); g_test_maximized_result (t / iterations, "%f seconds / %u iterations = %f s**-1", t, iterations, t / iterations); } static void test_emit (Fixture *f, gconstpointer test_data G_GNUC_UNUSED) { guint i, iterations; double t; if (g_test_perf ()) iterations = 100000; else iterations = 1000; g_test_timer_start (); for (i = 0; i < iterations; i++) { f->in_flight++; my_object_emit_frobnicate (MY_OBJECT (f->object), NULL); while (f->in_flight) g_main_context_iteration (f->context, TRUE); } t = g_test_timer_elapsed (); g_test_maximized_result (t / iterations, "%f seconds / %u iterations = %f s**-1", t, iterations, t / iterations); } static void test_timeout (Fixture *f, gconstpointer test_data G_GNUC_UNUSED) { guint i; for (i = 0; i < 100; i++) { GError *error = NULL; guint result; gboolean ok; f->in_flight++; /* AsyncIncrement doesn't return until the default main context * runs, and we're not letting it run, so this will time out after 1 * millisecond */ f->call = dbus_g_proxy_begin_call_with_timeout (f->proxy, "AsyncIncrement", call_cb, f, NULL, 1, G_TYPE_UINT, 666, G_TYPE_INVALID); while (f->in_flight) g_main_context_iteration (f->context, TRUE); ok = dbus_g_proxy_end_call (f->proxy, f->call, &error, G_TYPE_UINT, &result, G_TYPE_INVALID); g_assert_error (error, DBUS_GERROR, DBUS_GERROR_NO_REPLY); g_assert_false (ok); g_clear_error (&error); } /* drain the queue of idles with replies (which will be ignored) * just so we don't leak them */ while (g_main_context_pending (NULL)) g_main_context_iteration (NULL, FALSE); while (g_main_context_pending (f->context)) g_main_context_iteration (f->context, FALSE); } int main (int argc, char **argv) { dbus_g_type_specialized_init (); g_test_init (&argc, &argv, NULL); g_test_add ("/private/call", Fixture, NULL, setup, test_call, teardown); g_test_add ("/private/emit", Fixture, NULL, setup, test_emit, teardown); g_test_add ("/private/timeout", Fixture, NULL, setup, test_timeout, teardown); return g_test_run (); } dbus-glib-0.114/test/core/peer-on-bus.c0000644000175000017500000001145314027364762013276 /* Regression test for object registration and unregistration * * Copyright © 2009 Collabora Ltd. * Copyright © 2009-2011 Nokia Corporation * * SPDX-License-Identifier: AFL-2.1 OR GPL-2.0-or-later OR MIT * * 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 #undef G_DISABLE_ASSERT #include #include #include "dbus-gmain/tests/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_nonnull (f->bus); f->bus2 = dbus_g_bus_get_private (DBUS_BUS_SESSION, NULL, NULL); g_assert_nonnull (f->bus2); } static void teardown (Fixture *f, gconstpointer test_data G_GNUC_UNUSED) { if (f->bus != NULL) { test_run_until_disconnected (dbus_g_connection_get_connection (f->bus), NULL); dbus_g_connection_unref (f->bus); } if (f->bus2 != NULL) { test_run_until_disconnected (dbus_g_connection_get_connection (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 (dbus_g_connection_get_connection (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.114/test/core/test-gvariant.c0000644000175000017500000007155014027364762013736 /* GVariant to dbus-glib escape hatch * * Copyright © 2010 Collabora Ltd. * * SPDX-License-Identifier: AFL-2.1 OR GPL-2.0-or-later OR LGPL-2.1-or-later * * 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 #undef G_DISABLE_ASSERT #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_true (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_false (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_false (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_true (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_false (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_false (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_true (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_true (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_true (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_true (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_true (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_true (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_true (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_true (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_true (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_true (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_true (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_true (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_true (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.114/test/core/error-mapping.c0000644000175000017500000002163514027364762013727 /* 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 * * SPDX-License-Identifier: AFL-2.1 OR GPL-2.0-or-later * * 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 #undef G_DISABLE_ASSERT #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_nonnull (f->conn); f->object = g_object_new (MY_TYPE_OBJECT, NULL); g_assert_true (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_nonnull (f->proxy); } static void throw_error_cb (DBusGProxy *proxy, GError *error, gpointer user_data) { Fixture *f = user_data; g_assert_nonnull (error); 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; /* On error, this callback is expected to free it, which is pretty * astonishing, but is how it's always been. In principle, the generated * code ought to document this, or something. * https://bugs.freedesktop.org/show_bug.cgi?id=29195 */ g_error_free (error); } 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.114/test/core/test-dbus-glib.c0000664000175000017500000024445314764565250014004 /* 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 * * SPDX-License-Identifier: AFL-2.1 OR GPL-2.0-or-later * * 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 #undef G_DISABLE_ASSERT /* -*- mode: C; c-file-style: "gnu" -*- */ #include #include #include #include #include #include "test-service-glib-bindings.h" #include #include #include #include #include "my-object.h" #include "dbus-gmain/tests/util.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; static GType deprecated_value_array_type (void) { G_GNUC_BEGIN_IGNORE_DEPRECATIONS return g_value_array_get_type (); G_GNUC_END_IGNORE_DEPRECATIONS } static void cancel_exit_timeout (void) { if (exit_timeout != 0) { g_source_remove (exit_timeout); exit_timeout = 0; } } #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); /* will repeat, so do not clear exit_timeout */ 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) { cancel_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_proxy1); test_terminate_proxy1 = NULL; g_object_unref(test_terminate_proxy2); test_terminate_proxy2 = NULL; cancel_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) { cancel_exit_timeout (); g_main_loop_quit (loop); proxy_destroy_and_nameowner_complete = TRUE; } else if (!proxy_destroy_and_nameowner) { cancel_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); cancel_exit_timeout (); } static void frobnicate_signal_handler (DBusGProxy *proxy, int val, void *user_data) { n_times_frobnicate_received += 1; g_assert_cmpint (val, ==, 42); g_print ("Got Frobnicate signal\n"); g_main_loop_quit (loop); cancel_exit_timeout (); } static void frobnicate_signal_handler_2 (DBusGProxy *proxy, int val, void *user_data) { n_times_frobnicate_received_2 += 1; g_assert_cmpint (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_cmpint (val, ==, 42); g_print ("Got Frobnicate signal (compat)\n"); g_main_loop_quit (loop); cancel_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_cmpstr (str0, ==, "foo"); g_assert_cmpint (val, ==, 22); g_assert_cmpstr (str1, ==, "moo"); g_print ("Got Sig0 signal\n"); g_main_loop_quit (loop); cancel_exit_timeout (); } static void sig1_signal_handler (DBusGProxy *proxy, const char *str0, GValue *value, void *user_data) { n_times_sig1_received += 1; g_assert_cmpstr (str0, ==, "baz"); g_assert_true (G_VALUE_HOLDS_STRING (value)); g_assert_cmpstr (g_value_get_string (value), ==, "bar"); g_print ("Got Sig1 signal\n"); g_main_loop_quit (loop); cancel_exit_timeout (); } static void sig2_signal_handler (DBusGProxy *proxy, GHashTable *table, void *user_data) { n_times_sig2_received += 1; g_assert_cmpuint (g_hash_table_size (table), ==, 2); g_assert_nonnull (g_hash_table_lookup (table, "baz")); g_assert_cmpstr (g_hash_table_lookup (table, "baz"), ==, "cow"); g_assert_nonnull (g_hash_table_lookup (table, "bar")); g_assert_cmpstr (g_hash_table_lookup (table, "bar"), ==, "foo"); g_print ("Got Sig2 signal\n"); g_main_loop_quit (loop); cancel_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_true (call == echo_call); g_assert_null (data); 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_nonnull (echo_data); g_print ("Async echo gave \"%s\"\n", echo_data); g_free (echo_data); g_main_loop_quit (loop); cancel_exit_timeout (); } static void increment_received_cb (DBusGProxy *proxy, DBusGProxyCall *call, gpointer data) { GError *error; guint val; g_assert_cmpstr (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); cancel_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); cancel_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_nonnull (expected_string_value); g_assert_nonnull (object_path); /* 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_nonnull (proxy); 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_nonnull (object_path); /* 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_nonnull (proxy); 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_private (DBUS_BUS_SESSION, NULL, &error); if (connection == NULL) lose_gerror ("Failed to open connection to bus", error); /* 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_nonnull (name_list[i]); g_print (" %s\n", name_list[i]); ++i; } g_assert_null (name_list[i]); 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); cancel_exit_timeout (); 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); cancel_exit_timeout (); 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); g_array_unref (array); } { 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); g_array_unref (array); } { 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_nonnull (strs_ret); 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; G_GNUC_BEGIN_IGNORE_DEPRECATIONS 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); G_GNUC_END_IGNORE_DEPRECATIONS vals_ret = NULL; g_print ("Calling SendCar\n"); if (!dbus_g_proxy_call (proxy, "SendCar", &error, deprecated_value_array_type (), vals, G_TYPE_INVALID, deprecated_value_array_type (), &vals_ret, G_TYPE_INVALID)) lose_gerror ("Failed to complete SendCar call", error); g_assert_nonnull (vals_ret); g_assert_cmpuint (vals_ret->n_values, ==, 2); G_GNUC_BEGIN_IGNORE_DEPRECATIONS g_assert_true (G_VALUE_HOLDS_UINT (g_value_array_get_nth (vals_ret, 0))); g_assert_cmpuint (g_value_get_uint (g_value_array_get_nth (vals_ret, 0)), ==, 43); g_assert_true (G_VALUE_TYPE (g_value_array_get_nth (vals_ret, 1)) == DBUS_TYPE_G_OBJECT_PATH); g_assert_cmpstr ("/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); G_GNUC_END_IGNORE_DEPRECATIONS } { 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_nonnull (ret_table); g_assert_cmpuint (g_hash_table_size (ret_table), ==, 2); val = g_hash_table_lookup (ret_table, "foo"); g_assert_nonnull (val); g_assert_true (G_VALUE_HOLDS_STRING (val)); g_assert_cmpstr ("42", ==, g_value_get_string (val)); val = g_hash_table_lookup (ret_table, "bar"); g_assert_nonnull (val); g_assert_true (G_VALUE_HOLDS_STRING (val)); g_assert_cmpstr ("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_ptr_array_free (in_array, TRUE); g_assert_nonnull (out_array); g_assert_cmpuint (out_array->len, ==, 2); uints = g_ptr_array_index (out_array, 0); g_assert_nonnull (uints); g_assert_cmpuint (uints->len, ==, 3); g_assert_cmpuint (g_array_index (uints, guint, 0), ==, 10); g_assert_cmpuint (g_array_index (uints, guint, 1), ==, 42); g_assert_cmpuint (g_array_index (uints, guint, 2), ==, 27); g_array_free (uints, TRUE); uints = g_ptr_array_index (out_array, 1); g_assert_nonnull (uints); g_assert_cmpuint (uints->len, ==, 1); g_assert_cmpuint (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); g_object_unref (ret_proxy); } 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_nonnull (ret_table); g_assert_cmpuint (g_hash_table_size (ret_table), ==, 2); subtable = g_hash_table_lookup (ret_table, "dict1"); g_assert_nonnull (subtable); g_assert_cmpuint (g_hash_table_size (subtable), ==, 3); val = g_hash_table_lookup (subtable, "foo"); g_assert_nonnull (val); g_assert_cmpstr ("dict1 1", ==, val); val = g_hash_table_lookup (subtable, "bar"); g_assert_nonnull (val); g_assert_cmpstr ("dict1 2", ==, val); val = g_hash_table_lookup (subtable, "baz"); g_assert_nonnull (val); g_assert_cmpstr ("dict1 3", ==, val); subtable = g_hash_table_lookup (ret_table, "dict2"); g_assert_nonnull (subtable); g_assert_cmpuint (g_hash_table_size (subtable), ==, 3); val = g_hash_table_lookup (subtable, "foo"); g_assert_nonnull (val); g_assert_cmpstr ("dict2 4", ==, val); val = g_hash_table_lookup (subtable, "bar"); g_assert_nonnull (val); g_assert_cmpstr ("dict2 5", ==, val); val = g_hash_table_lookup (subtable, "baz"); g_assert_nonnull (val); g_assert_cmpstr ("dict2 6", ==, val); g_hash_table_destroy (table); g_hash_table_destroy (ret_table); } 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); } 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); } /* 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); cancel_exit_timeout (); 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); cancel_exit_timeout (); 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); 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); cancel_exit_timeout (); exit_timeout = g_timeout_add (5000, timed_exit, loop); g_main_loop_run (loop); cancel_exit_timeout (); 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); cancel_exit_timeout (); 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); cancel_exit_timeout (); exit_timeout = g_timeout_add (5000, timed_exit, loop); g_main_loop_run (loop); cancel_exit_timeout (); exit_timeout = g_timeout_add (5000, timed_exit, loop); g_main_loop_run (loop); cancel_exit_timeout (); exit_timeout = g_timeout_add (5000, timed_exit, loop); g_main_loop_run (loop); cancel_exit_timeout (); 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); cancel_exit_timeout (); 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"); /* "destroy" does not mean last-unref! */ g_object_unref (proxy); 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_nonnull (proxy); 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); cancel_exit_timeout (); 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); cancel_exit_timeout (); 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); cancel_exit_timeout (); 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_nonnull (proxy2); 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); cancel_exit_timeout (); 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"); node_info_unref (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_true (G_VALUE_HOLDS (&value, G_TYPE_STRING)); g_assert_cmpstr (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_true (G_VALUE_HOLDS (&value, G_TYPE_UINT)); g_assert_cmpuint (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_true (G_VALUE_HOLDS (&value, G_TYPE_UINT)); g_assert_cmpuint (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_true (G_VALUE_HOLDS (&value, G_TYPE_STRING)); g_assert_cmpstr (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_true (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_true (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_true (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_true (G_VALUE_HOLDS_BOOLEAN (&value)); g_assert_false (g_value_get_boolean (&value)); 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_true (G_VALUE_HOLDS_BOOLEAN (&value)); g_assert_false (g_value_get_boolean (&value)); 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_null (proxy); 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); cancel_exit_timeout (); 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_true (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)); test_run_until_disconnected (dbus_g_connection_get_connection (privconn), NULL); dbus_g_connection_unref (privconn); } g_object_unref (G_OBJECT (driver)); test_run_until_disconnected (dbus_g_connection_get_connection (connection), NULL); dbus_g_connection_unref (connection); g_print ("Successfully completed %s\n", argv[0]); dbus_shutdown (); g_main_loop_unref (loop); return 0; } dbus-glib-0.114/test/core/peer-server.c0000644000175000017500000000242614027364762013401 /* SPDX-License-Identifier: AFL-2.1 OR GPL-2.0-or-later */ #include #undef G_DISABLE_ASSERT #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); 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.114/test/core/my-object-subclass.h0000644000175000017500000000230713515561575014655 /* SPDX-License-Identifier: AFL-2.1 OR GPL-2.0-or-later */ #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.114/test/core/my-object-subclass.c0000644000175000017500000000676614027364762014663 /* SPDX-License-Identifier: AFL-2.1 OR GPL-2.0-or-later */ #include #undef G_DISABLE_ASSERT #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.114/test/core/peer-client.c0000644000175000017500000000727714027364762013362 /* SPDX-License-Identifier: AFL-2.1 OR GPL-2.0-or-later */ #include #undef G_DISABLE_ASSERT #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_cmpint (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; 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_nonnull (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.114/test/core/my-object.h0000644000175000017500000001166713515561575013051 /* SPDX-License-Identifier: AFL-2.1 OR GPL-2.0-or-later */ #ifndef __MY_OBJECT_H__ #define __MY_OBJECT_H__ #include #include typedef struct MyObject MyObject; typedef struct MyObjectClass MyObjectClass; 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; gsize echo_variant_called; }; 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); gboolean my_object_unsafe_disable_legacy_property_access (MyObject *obj, GError **error); 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.114/test/core/my-object.c0000664000175000017500000005227614764565250013050 /* SPDX-License-Identifier: AFL-2.1 OR GPL-2.0-or-later */ #include #undef G_DISABLE_ASSERT #include #include #include #include "my-object.h" #include "test-service-glib-glue.h" /* 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); 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, NULL, 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, NULL, 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) { G_GNUC_BEGIN_IGNORE_DEPRECATIONS 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")); G_GNUC_END_IGNORE_DEPRECATIONS 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; obj->echo_variant_called++; 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); } gboolean my_object_unsafe_disable_legacy_property_access (MyObject *obj, GError **error) { dbus_glib_global_set_disable_legacy_property_access (); return TRUE; } 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.114/test/core/Makefile.in0000664000175000017500000016101214764623732013045 # Makefile.in generated by automake 1.17 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2024 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__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) am__rm_f = rm -f $(am__rm_f_notfound) am__rm_rf = rm -rf $(am__rm_f_notfound) 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@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@ test-profile$(EXEEXT) \ @DBUS_BUILD_TESTS_TRUE@ manual/test-invalid-usage$(EXEEXT) \ @DBUS_BUILD_TESTS_TRUE@ peer-server$(EXEEXT) \ @DBUS_BUILD_TESTS_TRUE@ peer-client$(EXEEXT) \ @DBUS_BUILD_TESTS_TRUE@ test-types$(EXEEXT) \ @DBUS_BUILD_TESTS_TRUE@ test-private$(EXEEXT) \ @DBUS_BUILD_TESTS_TRUE@ test-peer-on-bus$(EXEEXT) \ @DBUS_BUILD_TESTS_TRUE@ test-proxy-noc$(EXEEXT) \ @DBUS_BUILD_TESTS_TRUE@ test-proxy-peer$(EXEEXT) \ @DBUS_BUILD_TESTS_TRUE@ test-registrations$(EXEEXT) \ @DBUS_BUILD_TESTS_TRUE@ test-unsupported-type$(EXEEXT) \ @DBUS_BUILD_TESTS_TRUE@ test-variant-recursion$(EXEEXT) \ @DBUS_BUILD_TESTS_TRUE@ test-gvariant$(EXEEXT) \ @DBUS_BUILD_TESTS_TRUE@ test-shared-bus$(EXEEXT) subdir = test/core 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) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = PROGRAMS = $(noinst_PROGRAMS) am__manual_test_invalid_usage_SOURCES_DIST = manual/invalid-usage.c \ my-object.c my-object.h am__dirstamp = $(am__leading_dot)dirstamp @DBUS_BUILD_TESTS_TRUE@am_manual_test_invalid_usage_OBJECTS = \ @DBUS_BUILD_TESTS_TRUE@ manual/invalid-usage.$(OBJEXT) \ @DBUS_BUILD_TESTS_TRUE@ my-object.$(OBJEXT) manual_test_invalid_usage_OBJECTS = \ $(am_manual_test_invalid_usage_OBJECTS) manual_test_invalid_usage_LDADD = $(LDADD) am__DEPENDENCIES_1 = manual_test_invalid_usage_DEPENDENCIES = $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(top_builddir)/dbus/libdbus-glib-1.la \ $(top_builddir)/dbus-gmain/tests/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__v_lt_1 = 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) peer_client_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(top_builddir)/dbus/libdbus-glib-1.la \ $(top_builddir)/dbus-gmain/tests/libtest.la am__peer_server_SOURCES_DIST = my-object.c my-object.h \ my-object-subclass.c my-object-subclass.h 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@ 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)/dbus-gmain/tests/libtest.la am__test_dbus_glib_SOURCES_DIST = my-object.c my-object.h \ test-dbus-glib.c @DBUS_BUILD_TESTS_TRUE@am_test_dbus_glib_OBJECTS = \ @DBUS_BUILD_TESTS_TRUE@ my-object.$(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)/dbus-gmain/tests/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 \ error-mapping.c @DBUS_BUILD_TESTS_TRUE@am_test_error_mapping_OBJECTS = \ @DBUS_BUILD_TESTS_TRUE@ my-object.$(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)/dbus-gmain/tests/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)/dbus-gmain/tests/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)/dbus-gmain/tests/libtest.la am__test_private_SOURCES_DIST = my-object.c my-object.h private.c @DBUS_BUILD_TESTS_TRUE@am_test_private_OBJECTS = my-object.$(OBJEXT) \ @DBUS_BUILD_TESTS_TRUE@ private.$(OBJEXT) test_private_OBJECTS = $(am_test_private_OBJECTS) test_private_LDADD = $(LDADD) test_private_DEPENDENCIES = $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(top_builddir)/dbus/libdbus-glib-1.la \ $(top_builddir)/dbus-gmain/tests/libtest.la am_test_profile_OBJECTS = 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)/dbus-gmain/tests/libtest.la am__test_proxy_noc_SOURCES_DIST = proxy-noc.c @DBUS_BUILD_TESTS_TRUE@am_test_proxy_noc_OBJECTS = \ @DBUS_BUILD_TESTS_TRUE@ proxy-noc.$(OBJEXT) test_proxy_noc_OBJECTS = $(am_test_proxy_noc_OBJECTS) test_proxy_noc_LDADD = $(LDADD) test_proxy_noc_DEPENDENCIES = $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(top_builddir)/dbus/libdbus-glib-1.la \ $(top_builddir)/dbus-gmain/tests/libtest.la am__test_proxy_peer_SOURCES_DIST = my-object.c my-object.h \ proxy-peer.c @DBUS_BUILD_TESTS_TRUE@am_test_proxy_peer_OBJECTS = \ @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)/dbus-gmain/tests/libtest.la am__test_registrations_SOURCES_DIST = my-object.c my-object.h \ my-object-subclass.c my-object-subclass.h 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@ 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)/dbus-gmain/tests/libtest.la am__test_service_glib_SOURCES_DIST = my-object.c my-object.h \ my-object-subclass.c my-object-subclass.h 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@ 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)/dbus-gmain/tests/libtest.la am__test_shared_bus_SOURCES_DIST = shared-bus.c @DBUS_BUILD_TESTS_TRUE@am_test_shared_bus_OBJECTS = \ @DBUS_BUILD_TESTS_TRUE@ shared-bus.$(OBJEXT) test_shared_bus_OBJECTS = $(am_test_shared_bus_OBJECTS) test_shared_bus_LDADD = $(LDADD) test_shared_bus_DEPENDENCIES = $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(top_builddir)/dbus/libdbus-glib-1.la \ $(top_builddir)/dbus-gmain/tests/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)/dbus-gmain/tests/libtest.la am__test_unsupported_type_SOURCES_DIST = my-object.c my-object.h \ unsupported-type.c @DBUS_BUILD_TESTS_TRUE@am_test_unsupported_type_OBJECTS = \ @DBUS_BUILD_TESTS_TRUE@ my-object.$(OBJEXT) \ @DBUS_BUILD_TESTS_TRUE@ unsupported-type.$(OBJEXT) test_unsupported_type_OBJECTS = $(am_test_unsupported_type_OBJECTS) test_unsupported_type_LDADD = $(LDADD) test_unsupported_type_DEPENDENCIES = $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(top_builddir)/dbus/libdbus-glib-1.la \ $(top_builddir)/dbus-gmain/tests/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) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : 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_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/error-mapping.Po \ ./$(DEPDIR)/my-object-subclass.Po ./$(DEPDIR)/my-object.Po \ ./$(DEPDIR)/peer-client.Po ./$(DEPDIR)/peer-on-bus.Po \ ./$(DEPDIR)/peer-server.Po ./$(DEPDIR)/private.Po \ ./$(DEPDIR)/proxy-noc.Po ./$(DEPDIR)/proxy-peer.Po \ ./$(DEPDIR)/registrations.Po ./$(DEPDIR)/shared-bus.Po \ ./$(DEPDIR)/test-dbus-glib.Po ./$(DEPDIR)/test-gvariant.Po \ ./$(DEPDIR)/test-profile.Po ./$(DEPDIR)/test-service-glib.Po \ ./$(DEPDIR)/test-types.Po \ ./$(DEPDIR)/test-variant-recursion.Po \ ./$(DEPDIR)/unsupported-type.Po \ manual/$(DEPDIR)/invalid-usage.Po 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_CC_1 = 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_CCLD_1 = SOURCES = $(manual_test_invalid_usage_SOURCES) $(peer_client_SOURCES) \ $(peer_server_SOURCES) $(test_dbus_glib_SOURCES) \ $(test_error_mapping_SOURCES) $(test_gvariant_SOURCES) \ $(test_peer_on_bus_SOURCES) $(test_private_SOURCES) \ $(test_profile_SOURCES) $(test_proxy_noc_SOURCES) \ $(test_proxy_peer_SOURCES) $(test_registrations_SOURCES) \ $(test_service_glib_SOURCES) $(test_shared_bus_SOURCES) \ $(test_types_SOURCES) $(test_unsupported_type_SOURCES) \ $(test_variant_recursion_SOURCES) DIST_SOURCES = $(am__manual_test_invalid_usage_SOURCES_DIST) \ $(am__peer_client_SOURCES_DIST) \ $(am__peer_server_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_private_SOURCES_DIST) $(test_profile_SOURCES) \ $(am__test_proxy_noc_SOURCES_DIST) \ $(am__test_proxy_peer_SOURCES_DIST) \ $(am__test_registrations_SOURCES_DIST) \ $(am__test_service_glib_SOURCES_DIST) \ $(am__test_shared_bus_SOURCES_DIST) \ $(am__test_types_SOURCES_DIST) \ $(am__test_unsupported_type_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 am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` am__tty_colors_dummy = \ mgn= red= grn= lgn= blu= brg= std=; \ am__color_tests=no am__tty_colors = { \ $(am__tty_colors_dummy); \ if test "X$(AM_COLOR_TESTS)" = Xno; then \ am__color_tests=no; \ elif test "X$(AM_COLOR_TESTS)" = Xalways; then \ am__color_tests=yes; \ elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \ am__color_tests=yes; \ fi; \ if test $$am__color_tests = yes; then \ red=''; \ grn=''; \ lgn=''; \ blu=''; \ mgn=''; \ brg=''; \ std=''; \ fi; \ } 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 ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && echo $$files | $(am__xargs_n) 40 $(am__rm_f); }; \ } am__recheck_rx = ^[ ]*:recheck:[ ]* am__global_test_result_rx = ^[ ]*:global-test-result:[ ]* am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]* # A command that, given a newline-separated list of test names on the # standard input, print the name of the tests that are to be re-run # upon "make recheck". am__list_recheck_tests = $(AWK) '{ \ recheck = 1; \ while ((rc = (getline line < ($$0 ".trs"))) != 0) \ { \ if (rc < 0) \ { \ if ((getline line2 < ($$0 ".log")) < 0) \ recheck = 0; \ break; \ } \ else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \ { \ recheck = 0; \ break; \ } \ else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \ { \ break; \ } \ }; \ if (recheck) \ print $$0; \ close ($$0 ".trs"); \ close ($$0 ".log"); \ }' # A command that, given a newline-separated list of test names on the # standard input, create the global log from their .trs and .log files. am__create_global_log = $(AWK) ' \ function fatal(msg) \ { \ print "fatal: making $@: " msg | "cat >&2"; \ exit 1; \ } \ function rst_section(header) \ { \ print header; \ len = length(header); \ for (i = 1; i <= len; i = i + 1) \ printf "="; \ printf "\n\n"; \ } \ { \ copy_in_global_log = 1; \ global_test_result = "RUN"; \ while ((rc = (getline line < ($$0 ".trs"))) != 0) \ { \ if (rc < 0) \ fatal("failed to read from " $$0 ".trs"); \ if (line ~ /$(am__global_test_result_rx)/) \ { \ sub("$(am__global_test_result_rx)", "", line); \ sub("[ ]*$$", "", line); \ global_test_result = line; \ } \ else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \ copy_in_global_log = 0; \ }; \ if (copy_in_global_log) \ { \ rst_section(global_test_result ": " $$0); \ while ((rc = (getline line < ($$0 ".log"))) != 0) \ { \ if (rc < 0) \ fatal("failed to read from " $$0 ".log"); \ print line; \ }; \ printf "\n"; \ }; \ close ($$0 ".trs"); \ close ($$0 ".log"); \ }' # Restructured Text title. am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; } # Solaris 10 'make', and several other traditional 'make' implementations, # pass "-e" to $(SHELL), and POSIX 2008 even requires this. Work around it # by disabling -e (using the XSI extension "set +e") if it's set. am__sh_e_setup = case $$- in *e*) set +e;; esac # Default flags passed to test drivers. am__common_driver_flags = \ --color-tests "$$am__color_tests" \ $$am__collect_skipped_logs \ --enable-hard-errors "$$am__enable_hard_errors" \ --expect-failure "$$am__expect_failure" # To be inserted before the command running the test. Creates the # directory for the log if needed. Stores in $dir the directory # containing $f, in $tst the test, in $log the log. Executes the # developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and # passes TESTS_ENVIRONMENT. Set up options for the wrapper that # will run the test scripts (or their associated LOG_COMPILER, if # thy have one). am__check_pre = \ $(am__sh_e_setup); \ $(am__vpath_adj_setup) $(am__vpath_adj) \ $(am__tty_colors); \ srcdir=$(srcdir); export srcdir; \ case "$@" in \ */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \ *) am__odir=.;; \ esac; \ test "x$$am__odir" = x"." || test -d "$$am__odir" \ || $(MKDIR_P) "$$am__odir" || exit $$?; \ if test -f "./$$f"; then dir=./; \ elif test -f "$$f"; then dir=; \ else dir="$(srcdir)/"; fi; \ tst=$$dir$$f; log='$@'; \ if test -n '$(IGNORE_SKIPPED_LOGS)'; then \ am__collect_skipped_logs='--collect-skipped-logs no'; \ else \ am__collect_skipped_logs=''; \ fi; \ if test -n '$(DISABLE_HARD_ERRORS)'; then \ am__enable_hard_errors=no; \ else \ am__enable_hard_errors=yes; \ fi; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \ am__expect_failure=yes;; \ *) \ am__expect_failure=no;; \ esac; \ $(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT) # A shell command to get the names of the tests scripts with any registered # extension removed (i.e., equivalently, the names of the test logs, with # the '.log' extension removed). The result is saved in the shell variable # '$bases'. This honors runtime overriding of TESTS and TEST_LOGS. Sadly, # we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)", # since that might cause problem with VPATH rewrites for suffix-less tests. # See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'. am__set_TESTS_bases = \ bases='$(TEST_LOGS)'; \ bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \ bases=`echo $$bases` AM_TESTSUITE_SUMMARY_HEADER = ' for $(PACKAGE_STRING)' RECHECK_LOGS = $(TEST_LOGS) AM_RECURSIVE_TARGETS = check recheck TEST_SUITE_LOG = test-suite.log TEST_EXTENSIONS = @EXEEXT@ .test LOG_DRIVER = $(SHELL) $(top_srcdir)/build-aux/test-driver LOG_COMPILE = $(LOG_COMPILER) $(AM_LOG_FLAGS) $(LOG_FLAGS) am__set_b = \ case '$@' in \ */*) \ case '$*' in \ */*) b='$*';; \ *) b=`echo '$@' | sed 's/\.log$$//'`; \ esac;; \ *) \ b='$*';; \ esac am__test_logs1 = $(TESTS:=.log) am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log) TEST_LOGS = $(am__test_logs2:.test.log=.log) TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/build-aux/test-driver TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \ $(TEST_LOG_FLAGS) am__DIST_COMMON = $(srcdir)/Makefile.in \ $(top_srcdir)/build-aux/depcomp \ $(top_srcdir)/build-aux/test-driver DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) 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@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DBUS_BINDING_TOOL = @DBUS_BINDING_TOOL@ DBUS_CFLAGS = @DBUS_CFLAGS@ DBUS_GLIB_TOOL_CFLAGS = @DBUS_GLIB_TOOL_CFLAGS@ DBUS_GLIB_TOOL_LIBS = @DBUS_GLIB_TOOL_LIBS@ DBUS_LIBS = @DBUS_LIBS@ DBUS_RUN_SESSION = @DBUS_RUN_SESSION@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FILECMD = @FILECMD@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ GLIB_THREADS_LIBS = @GLIB_THREADS_LIBS@ GREP = @GREP@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ HTML_DIR = @HTML_DIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ 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@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ 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@ 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__rm_f_notfound = @am__rm_f_notfound@ am__tar = @am__tar@ am__untar = @am__untar@ am__xargs_n = @am__xargs_n@ 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@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AM_CPPFLAGS = \ -I$(top_srcdir) \ -I$(top_srcdir)/dbus \ -I$(top_builddir) \ -I$(top_builddir)/dbus \ $(DBUS_CFLAGS) \ $(GLIB_CFLAGS) \ -DDBUS_COMPILATION LDADD = \ $(GLIB_THREADS_LIBS) \ $(GLIB_LIBS) \ $(DBUS_LIBS) \ $(top_builddir)/dbus/libdbus-glib-1.la \ $(top_builddir)/dbus-gmain/tests/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=@abs_top_builddir@ VALGRIND_ENV = G_DEBUG=gc-friendly G_SLICE=always-malloc VALGRIND = valgrind VALGRIND_ARGS = \ --gen-suppressions=all \ --leak-check=full \ --leak-resolution=high \ --num-callers=20 \ --suppressions=$(abs_top_srcdir)/tools/dbus-glib.supp \ --suppressions=$(abs_top_srcdir)/tools/dbus-glib-tests.supp \ --verbose \ $(NULL) EXTRA_DIST = \ run-peer-test.sh \ run-test.sh \ test-service-glib-subclass.xml \ test-service-glib.xml \ $(NULL) # This "test" exercises invalid usage. It is deliberately not run in # TESTS, because it's (by design) full of bugs. @DBUS_BUILD_TESTS_TRUE@manual_test_invalid_usage_SOURCES = \ @DBUS_BUILD_TESTS_TRUE@ manual/invalid-usage.c \ @DBUS_BUILD_TESTS_TRUE@ my-object.c \ @DBUS_BUILD_TESTS_TRUE@ my-object.h \ @DBUS_BUILD_TESTS_TRUE@ $(NULL) @DBUS_BUILD_TESTS_TRUE@test_private_SOURCES = \ @DBUS_BUILD_TESTS_TRUE@ my-object.c \ @DBUS_BUILD_TESTS_TRUE@ my-object.h \ @DBUS_BUILD_TESTS_TRUE@ private.c @DBUS_BUILD_TESTS_TRUE@test_proxy_noc_SOURCES = \ @DBUS_BUILD_TESTS_TRUE@ proxy-noc.c @DBUS_BUILD_TESTS_TRUE@test_proxy_peer_SOURCES = \ @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@ 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@ 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@ 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 = \ @DBUS_BUILD_TESTS_TRUE@ test-service-glib-bindings.h \ @DBUS_BUILD_TESTS_TRUE@ test-service-glib-glue.h \ @DBUS_BUILD_TESTS_TRUE@ test-service-glib-subclass-glue.h \ @DBUS_BUILD_TESTS_TRUE@ $(NULL) @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@ 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@ 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@test_shared_bus_SOURCES = shared-bus.c @DBUS_BUILD_TESTS_TRUE@test_unsupported_type_SOURCES = \ @DBUS_BUILD_TESTS_TRUE@ my-object.c \ @DBUS_BUILD_TESTS_TRUE@ my-object.h \ @DBUS_BUILD_TESTS_TRUE@ unsupported-type.c \ @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 test_profile_SOURCES = \ test-profile.c all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .c .lo .log .o .obj .test .test$(EXEEXT) .trs $(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) --foreign test/core/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign test/core/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__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ 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: $(am__rm_f) $(noinst_PROGRAMS) test -z "$(EXEEXT)" || $(am__rm_f) $(noinst_PROGRAMS:$(EXEEXT)=) manual/$(am__dirstamp): @$(MKDIR_P) manual @: >>manual/$(am__dirstamp) manual/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) manual/$(DEPDIR) @: >>manual/$(DEPDIR)/$(am__dirstamp) manual/invalid-usage.$(OBJEXT): manual/$(am__dirstamp) \ manual/$(DEPDIR)/$(am__dirstamp) manual/test-invalid-usage$(EXEEXT): $(manual_test_invalid_usage_OBJECTS) $(manual_test_invalid_usage_DEPENDENCIES) $(EXTRA_manual_test_invalid_usage_DEPENDENCIES) manual/$(am__dirstamp) @rm -f manual/test-invalid-usage$(EXEEXT) $(AM_V_CCLD)$(LINK) $(manual_test_invalid_usage_OBJECTS) $(manual_test_invalid_usage_LDADD) $(LIBS) 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-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-private$(EXEEXT): $(test_private_OBJECTS) $(test_private_DEPENDENCIES) $(EXTRA_test_private_DEPENDENCIES) @rm -f test-private$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_private_OBJECTS) $(test_private_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-noc$(EXEEXT): $(test_proxy_noc_OBJECTS) $(test_proxy_noc_DEPENDENCIES) $(EXTRA_test_proxy_noc_DEPENDENCIES) @rm -f test-proxy-noc$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_proxy_noc_OBJECTS) $(test_proxy_noc_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-shared-bus$(EXEEXT): $(test_shared_bus_OBJECTS) $(test_shared_bus_DEPENDENCIES) $(EXTRA_test_shared_bus_DEPENDENCIES) @rm -f test-shared-bus$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_shared_bus_OBJECTS) $(test_shared_bus_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-unsupported-type$(EXEEXT): $(test_unsupported_type_OBJECTS) $(test_unsupported_type_DEPENDENCIES) $(EXTRA_test_unsupported_type_DEPENDENCIES) @rm -f test-unsupported-type$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_unsupported_type_OBJECTS) $(test_unsupported_type_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) -rm -f manual/*.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/error-mapping.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/my-object-subclass.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/my-object.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/peer-client.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/peer-on-bus.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/peer-server.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/private.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/proxy-noc.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/proxy-peer.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/registrations.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shared-bus.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-dbus-glib.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-gvariant.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-profile.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-service-glib.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-types.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-variant-recursion.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unsupported-type.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@manual/$(DEPDIR)/invalid-usage.Po@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @: >>$@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.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 -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.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 -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.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 -rm -rf manual/.libs manual/_libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ 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-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ 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" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags # Recover from deleted '.trs' file; this should ensure that # "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create # both 'foo.log' and 'foo.trs'. Break the recipe in two subshells # to avoid problems with "make -n". .log.trs: rm -f $< $@ $(MAKE) $(AM_MAKEFLAGS) $< # Leading 'am--fnord' is there to ensure the list of targets does not # expand to empty, as could happen e.g. with make check TESTS=''. am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck) am--force-recheck: @: $(TEST_SUITE_LOG): $(TEST_LOGS) @$(am__set_TESTS_bases); \ am__f_ok () { test -f "$$1" && test -r "$$1"; }; \ redo_bases=`for i in $$bases; do \ am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \ done`; \ if test -n "$$redo_bases"; then \ redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \ redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \ if $(am__make_dryrun); then :; else \ rm -f $$redo_logs && rm -f $$redo_results || exit 1; \ fi; \ fi; \ if test -n "$$am__remaking_logs"; then \ echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \ "recursion detected" >&2; \ elif test -n "$$redo_logs"; then \ am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \ fi; \ if $(am__make_dryrun); then :; else \ st=0; \ errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \ for i in $$redo_bases; do \ test -f $$i.trs && test -r $$i.trs \ || { echo "$$errmsg $$i.trs" >&2; st=1; }; \ test -f $$i.log && test -r $$i.log \ || { echo "$$errmsg $$i.log" >&2; st=1; }; \ done; \ test $$st -eq 0 || exit 1; \ fi @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \ ws='[ ]'; \ results=`for b in $$bases; do echo $$b.trs; done`; \ test -n "$$results" || results=/dev/null; \ all=` grep "^$$ws*:test-result:" $$results | wc -l`; \ pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \ fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \ skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \ xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \ xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \ error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \ if test `expr $$fail + $$xpass + $$error` -eq 0; then \ success=true; \ else \ success=false; \ fi; \ br='==================='; br=$$br$$br$$br$$br; \ result_count () \ { \ if test x"$$1" = x"--maybe-color"; then \ maybe_colorize=yes; \ elif test x"$$1" = x"--no-color"; then \ maybe_colorize=no; \ else \ echo "$@: invalid 'result_count' usage" >&2; exit 4; \ fi; \ shift; \ desc=$$1 count=$$2; \ if test $$maybe_colorize = yes && test $$count -gt 0; then \ color_start=$$3 color_end=$$std; \ else \ color_start= color_end=; \ fi; \ echo "$${color_start}# $$desc $$count$${color_end}"; \ }; \ create_testsuite_report () \ { \ result_count $$1 "TOTAL:" $$all "$$brg"; \ result_count $$1 "PASS: " $$pass "$$grn"; \ result_count $$1 "SKIP: " $$skip "$$blu"; \ result_count $$1 "XFAIL:" $$xfail "$$lgn"; \ result_count $$1 "FAIL: " $$fail "$$red"; \ result_count $$1 "XPASS:" $$xpass "$$red"; \ result_count $$1 "ERROR:" $$error "$$mgn"; \ }; \ output_system_information () \ { \ echo; \ { uname -a | $(AWK) '{ \ printf "System information (uname -a):"; \ for (i = 1; i < NF; ++i) \ { \ if (i != 2) \ printf " %s", $$i; \ } \ printf "\n"; \ }'; } 2>&1; \ if test -r /etc/os-release; then \ echo "Distribution information (/etc/os-release):"; \ sed 8q /etc/os-release; \ elif test -r /etc/issue; then \ echo "Distribution information (/etc/issue):"; \ cat /etc/issue; \ fi; \ }; \ please_report () \ { \ echo "Some test(s) failed. Please report this to $(PACKAGE_BUGREPORT),"; \ echo "together with the test-suite.log file (gzipped) and your system"; \ echo "information. Thanks."; \ }; \ { \ echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \ $(am__rst_title); \ create_testsuite_report --no-color; \ output_system_information; \ echo; \ echo ".. contents:: :depth: 2"; \ echo; \ for b in $$bases; do echo $$b; done \ | $(am__create_global_log); \ } >$(TEST_SUITE_LOG).tmp || exit 1; \ mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \ if $$success; then \ col="$$grn"; \ else \ col="$$red"; \ test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \ fi; \ echo "$${col}$$br$${std}"; \ echo "$${col}Testsuite summary"$(AM_TESTSUITE_SUMMARY_HEADER)"$${std}"; \ echo "$${col}$$br$${std}"; \ create_testsuite_report --maybe-color; \ echo "$$col$$br$$std"; \ if $$success; then :; else \ echo "$${col}See $(subdir)/$(TEST_SUITE_LOG) for debugging.$${std}";\ if test -n "$(PACKAGE_BUGREPORT)"; then \ please_report | sed -e "s/^/$${col}/" -e s/'$$'/"$${std}"/; \ fi; \ echo "$$col$$br$$std"; \ fi; \ $$success || exit 1 check-TESTS: @$(am__rm_f) $(RECHECK_LOGS) @$(am__rm_f) $(RECHECK_LOGS:.log=.trs) @$(am__rm_f) $(TEST_SUITE_LOG) @set +e; $(am__set_TESTS_bases); \ log_list=`for i in $$bases; do echo $$i.log; done`; \ log_list=`echo $$log_list`; \ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \ exit $$?; recheck: all @$(am__rm_f) $(TEST_SUITE_LOG) @set +e; $(am__set_TESTS_bases); \ bases=`for i in $$bases; do echo $$i; done \ | $(am__list_recheck_tests)` || exit 1; \ log_list=`for i in $$bases; do echo $$i.log; done`; \ log_list=`echo $$log_list`; \ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \ am__force_recheck=am--force-recheck \ TEST_LOGS="$$log_list"; \ exit $$? run-test.sh.log: run-test.sh @p='run-test.sh'; \ b='run-test.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) run-peer-test.sh.log: run-peer-test.sh @p='run-peer-test.sh'; \ b='run-peer-test.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) .test.log: @p='$<'; \ $(am__set_b); \ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) @am__EXEEXT_TRUE@.test$(EXEEXT).log: @am__EXEEXT_TRUE@ @p='$<'; \ @am__EXEEXT_TRUE@ $(am__set_b); \ @am__EXEEXT_TRUE@ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ @am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \ @am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ @am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT) distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(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: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) 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: -$(am__rm_f) $(TEST_LOGS) -$(am__rm_f) $(TEST_LOGS:.log=.trs) -$(am__rm_f) $(TEST_SUITE_LOG) clean-generic: -$(am__rm_f) $(CLEANFILES) distclean-generic: -$(am__rm_f) $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || $(am__rm_f) $(CONFIG_CLEAN_VPATH_FILES) -$(am__rm_f) manual/$(DEPDIR)/$(am__dirstamp) -$(am__rm_f) manual/$(am__dirstamp) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -$(am__rm_f) $(BUILT_SOURCES) clean: clean-am clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/error-mapping.Po -rm -f ./$(DEPDIR)/my-object-subclass.Po -rm -f ./$(DEPDIR)/my-object.Po -rm -f ./$(DEPDIR)/peer-client.Po -rm -f ./$(DEPDIR)/peer-on-bus.Po -rm -f ./$(DEPDIR)/peer-server.Po -rm -f ./$(DEPDIR)/private.Po -rm -f ./$(DEPDIR)/proxy-noc.Po -rm -f ./$(DEPDIR)/proxy-peer.Po -rm -f ./$(DEPDIR)/registrations.Po -rm -f ./$(DEPDIR)/shared-bus.Po -rm -f ./$(DEPDIR)/test-dbus-glib.Po -rm -f ./$(DEPDIR)/test-gvariant.Po -rm -f ./$(DEPDIR)/test-profile.Po -rm -f ./$(DEPDIR)/test-service-glib.Po -rm -f ./$(DEPDIR)/test-types.Po -rm -f ./$(DEPDIR)/test-variant-recursion.Po -rm -f ./$(DEPDIR)/unsupported-type.Po -rm -f manual/$(DEPDIR)/invalid-usage.Po -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 -f ./$(DEPDIR)/error-mapping.Po -rm -f ./$(DEPDIR)/my-object-subclass.Po -rm -f ./$(DEPDIR)/my-object.Po -rm -f ./$(DEPDIR)/peer-client.Po -rm -f ./$(DEPDIR)/peer-on-bus.Po -rm -f ./$(DEPDIR)/peer-server.Po -rm -f ./$(DEPDIR)/private.Po -rm -f ./$(DEPDIR)/proxy-noc.Po -rm -f ./$(DEPDIR)/proxy-peer.Po -rm -f ./$(DEPDIR)/registrations.Po -rm -f ./$(DEPDIR)/shared-bus.Po -rm -f ./$(DEPDIR)/test-dbus-glib.Po -rm -f ./$(DEPDIR)/test-gvariant.Po -rm -f ./$(DEPDIR)/test-profile.Po -rm -f ./$(DEPDIR)/test-service-glib.Po -rm -f ./$(DEPDIR)/test-types.Po -rm -f ./$(DEPDIR)/test-variant-recursion.Po -rm -f ./$(DEPDIR)/unsupported-type.Po -rm -f manual/$(DEPDIR)/invalid-usage.Po -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-exec \ install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-TESTS \ check-am clean clean-generic clean-libtool \ clean-noinstPROGRAMS cscopelist-am ctags ctags-am 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 recheck tags tags-am uninstall \ uninstall-am .PRECIOUS: Makefile check-valgrind: all $(MAKE) check-TESTS \ DEBUG="env $(VALGRIND_ENV) $(VALGRIND) $(VALGRIND_ARGS)" @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 # 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: # Tell GNU make to disable its built-in pattern rules. %:: %,v %:: RCS/%,v %:: RCS/% %:: s.% %:: SCCS/s.% dbus-glib-0.114/test/core/Makefile.am0000644000175000017500000001042113515561041013012 AM_CPPFLAGS = \ -I$(top_srcdir) \ -I$(top_srcdir)/dbus \ -I$(top_builddir) \ -I$(top_builddir)/dbus \ $(DBUS_CFLAGS) \ $(GLIB_CFLAGS) \ -DDBUS_COMPILATION LDADD = \ $(GLIB_THREADS_LIBS) \ $(GLIB_LIBS) \ $(DBUS_LIBS) \ $(top_builddir)/dbus/libdbus-glib-1.la \ $(top_builddir)/dbus-gmain/tests/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=@abs_top_builddir@ TESTS=run-test.sh run-peer-test.sh else TESTS= endif VALGRIND_ENV = G_DEBUG=gc-friendly G_SLICE=always-malloc VALGRIND = valgrind VALGRIND_ARGS = \ --gen-suppressions=all \ --leak-check=full \ --leak-resolution=high \ --num-callers=20 \ --suppressions=$(abs_top_srcdir)/tools/dbus-glib.supp \ --suppressions=$(abs_top_srcdir)/tools/dbus-glib-tests.supp \ --verbose \ $(NULL) check-valgrind: all $(MAKE) check-TESTS \ DEBUG="env $(VALGRIND_ENV) $(VALGRIND) $(VALGRIND_ARGS)" EXTRA_DIST = \ run-peer-test.sh \ run-test.sh \ test-service-glib-subclass.xml \ test-service-glib.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-dbus-glib \ test-error-mapping \ test-service-glib \ test-profile \ manual/test-invalid-usage \ peer-server \ peer-client \ test-types \ test-private \ test-peer-on-bus \ test-proxy-noc \ test-proxy-peer \ test-registrations \ test-unsupported-type \ test-variant-recursion \ test-gvariant \ test-shared-bus \ $(NULL) # This "test" exercises invalid usage. It is deliberately not run in # TESTS, because it's (by design) full of bugs. manual_test_invalid_usage_SOURCES = \ manual/invalid-usage.c \ my-object.c \ my-object.h \ $(NULL) test_private_SOURCES = \ my-object.c \ my-object.h \ private.c test_proxy_noc_SOURCES = \ proxy-noc.c test_proxy_peer_SOURCES = \ 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 \ registrations.c test_dbus_glib_SOURCES= \ my-object.c \ my-object.h \ test-dbus-glib.c test_dbus_glib_LDADD= $(tool_ldadd) test_error_mapping_SOURCES = \ my-object.c \ my-object.h \ error-mapping.c test_variant_recursion_SOURCES=test-variant-recursion.c test_variant_recursion_LDADD= $(tool_ldadd) BUILT_SOURCES = \ test-service-glib-bindings.h \ test-service-glib-glue.h \ test-service-glib-subclass-glue.h \ $(NULL) test_service_glib_SOURCES= \ my-object.c \ my-object.h \ my-object-subclass.c \ my-object-subclass.h \ 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 peer_server_SOURCES = \ my-object.c \ my-object.h \ my-object-subclass.c \ my-object-subclass.h \ 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 test_shared_bus_SOURCES = shared-bus.c test_unsupported_type_SOURCES = \ my-object.c \ my-object.h \ unsupported-type.c \ $(NULL) CLEANFILES = \ $(BUILT_SOURCES) \ run-with-tmp-session-bus.conf else ### not building tests noinst_PROGRAMS=test-profile endif test_profile_SOURCES= \ test-profile.c dbus-glib-0.114/test/core/manual/0000775000175000017500000000000014764624122012326 5dbus-glib-0.114/test/core/manual/invalid-usage.c0000644000175000017500000002157114027364762015151 /* 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 * * SPDX-License-Identifier: AFL-2.1 OR GPL-2.0-or-later * * 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 #undef G_DISABLE_ASSERT #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_nonnull (f->conn); f->proxy = dbus_g_proxy_new_for_name (f->conn, "com.example.Test", "/com/example/Test/Object", "com.example.Test.Fallible"); g_assert_nonnull (f->proxy); f->object = g_object_new (MY_TYPE_OBJECT, NULL); g_assert_true (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_nonnull (f->proxy_for_self); } 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_nonnull (error); *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.114/test/test-compile-nested.sh0000755000175000017500000000047213233560240014254 #!/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.114/test/specialized-types.c0000644000175000017500000003322314027364762013647 /* Regression test for dbus-glib specialized types * * Copyright © 2005 Red Hat, Inc. * Copyright © 2011 Nokia Corporation * * SPDX-License-Identifier: AFL-2.1 OR GPL-2.0-or-later * * 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 #undef G_DISABLE_ASSERT #include #include #include #include typedef struct { int dummy; } Fixture; static void setup (Fixture *f G_GNUC_UNUSED, gconstpointer context G_GNUC_UNUSED) { dbus_g_type_specialized_init (); } static void test_au (Fixture *f G_GNUC_UNUSED, gconstpointer context G_GNUC_UNUSED) { GType type; GArray *instance; 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); instance = dbus_g_type_specialized_construct (type); g_assert (instance->len == 0); g_array_free (instance, TRUE); } 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 (); } } static void test_map_ss (Fixture *f G_GNUC_UNUSED, gconstpointer context G_GNUC_UNUSED) { GType type; GHashTable *instance; GValue val = { 0, }; TestSpecializedHashData hashdata; 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); 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); } static void test_map_sv (Fixture *f G_GNUC_UNUSED, gconstpointer context G_GNUC_UNUSED) { GType type; 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); } } static void test_ao_slist (Fixture *f G_GNUC_UNUSED, gconstpointer context G_GNUC_UNUSED) { GType type; 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_nonnull (obj); 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); } } } static void test_as_ptrarray (Fixture *f G_GNUC_UNUSED, gconstpointer context G_GNUC_UNUSED) { GType type; 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); } } static void test_suo (Fixture *f G_GNUC_UNUSED, gconstpointer context G_GNUC_UNUSED) { GType type; 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_cmpstr (string, ==, "foo"); g_assert (intval == 42); g_assert_cmpstr (path, ==, "/bar/moo/foo/baz"); } g_value_unset (&val); } } static void teardown (Fixture *f G_GNUC_UNUSED, gconstpointer context G_GNUC_UNUSED) { } int main (int argc, char **argv) { g_test_init (&argc, &argv, NULL); g_type_init (); g_test_add ("/specialized-types/au/GArray", Fixture, NULL, setup, test_au, teardown); g_test_add ("/specialized-types/a{ss}/GHashTable", Fixture, NULL, setup, test_map_ss, teardown); g_test_add ("/specialized-types/a{sv}/GHashTable", Fixture, NULL, setup, test_map_sv, teardown); g_test_add ("/specialized-types/ao/GSList", Fixture, NULL, setup, test_ao_slist, teardown); g_test_add ("/specialized-types/as/GPtrArray", Fixture, NULL, setup, test_as_ptrarray, teardown); g_test_add ("/specialized-types/suo/GValueArray", Fixture, NULL, setup, test_suo, teardown); return g_test_run (); } dbus-glib-0.114/test/test-service.c0000664000175000017500000002423314764547007012634 /* SPDX-License-Identifier: AFL-2.1 OR GPL-2.0-or-later */ #include #undef G_DISABLE_ASSERT #include #include #include #include static dbus_bool_t already_quit = FALSE; static dbus_bool_t hello_from_self_reply_recived = FALSE; static DBusConnection *connection = NULL; 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; int type; dbus_error_init (&error); 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; dbus_error_init (&error); connection = dbus_bus_get_private (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.114/test/errors.c0000644000175000017500000000374314027364762011531 /* Regression test for dbus-glib GError mapping * * Copyright © 2004 Red Hat, Inc. * Copyright © 2011 Nokia Corporation * * SPDX-License-Identifier: AFL-2.1 OR GPL-2.0-or-later * * 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 #undef G_DISABLE_ASSERT #include #include #include #include typedef struct { int dummy; } Fixture; static void setup (Fixture *f G_GNUC_UNUSED, gconstpointer context G_GNUC_UNUSED) { } static void test_errors (Fixture *f G_GNUC_UNUSED, gconstpointer context G_GNUC_UNUSED) { 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_nonnull (gerror); g_assert_error (gerror, DBUS_GERROR, DBUS_GERROR_NO_MEMORY); g_assert_cmpstr (gerror->message, ==, "Out of memory!"); dbus_error_init (&err); g_clear_error (&gerror); } static void teardown (Fixture *f G_GNUC_UNUSED, gconstpointer addr G_GNUC_UNUSED) { } int main (int argc, char **argv) { g_test_init (&argc, &argv, NULL); g_type_init (); g_test_add ("/errors", Fixture, NULL, setup, test_errors, teardown); return g_test_run (); } dbus-glib-0.114/test/Makefile.in0000664000175000017500000012144014764623731012115 # Makefile.in generated by automake 1.17 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2024 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__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) am__rm_f = rm -f $(am__rm_f_notfound) am__rm_rf = rm -rf $(am__rm_f_notfound) 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@ TESTS = $(am__EXEEXT_1) $(am__EXEEXT_3) noinst_PROGRAMS = $(am__EXEEXT_1) $(am__EXEEXT_2) subdir = test 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) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) 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-errors$(EXEEXT) \ @DBUS_BUILD_TESTS_TRUE@ test-specialized-types$(EXEEXT) @DBUS_BUILD_TESTS_TRUE@am__EXEEXT_2 = test-service$(EXEEXT) PROGRAMS = $(noinst_PROGRAMS) am_test_errors_OBJECTS = errors.$(OBJEXT) test_errors_OBJECTS = $(am_test_errors_OBJECTS) test_errors_LDADD = $(LDADD) am__DEPENDENCIES_1 = test_errors_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 am__v_lt_1 = am_test_service_OBJECTS = test-service.$(OBJEXT) test_service_OBJECTS = $(am_test_service_OBJECTS) test_service_DEPENDENCIES = $(am__DEPENDENCIES_1) am_test_specialized_types_OBJECTS = specialized-types.$(OBJEXT) test_specialized_types_OBJECTS = $(am_test_specialized_types_OBJECTS) test_specialized_types_LDADD = $(LDADD) test_specialized_types_DEPENDENCIES = \ $(top_builddir)/dbus/libdbus-glib-1.la $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : 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_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/errors.Po \ ./$(DEPDIR)/specialized-types.Po ./$(DEPDIR)/test-service.Po 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_CC_1 = 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_CCLD_1 = SOURCES = $(test_errors_SOURCES) $(test_service_SOURCES) \ $(test_specialized_types_SOURCES) DIST_SOURCES = $(test_errors_SOURCES) $(test_service_SOURCES) \ $(test_specialized_types_SOURCES) RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-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 \ tags-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_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ check recheck distdir distdir-am am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` am__tty_colors_dummy = \ mgn= red= grn= lgn= blu= brg= std=; \ am__color_tests=no am__tty_colors = { \ $(am__tty_colors_dummy); \ if test "X$(AM_COLOR_TESTS)" = Xno; then \ am__color_tests=no; \ elif test "X$(AM_COLOR_TESTS)" = Xalways; then \ am__color_tests=yes; \ elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \ am__color_tests=yes; \ fi; \ if test $$am__color_tests = yes; then \ red=''; \ grn=''; \ lgn=''; \ blu=''; \ mgn=''; \ brg=''; \ std=''; \ fi; \ } 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 ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && echo $$files | $(am__xargs_n) 40 $(am__rm_f); }; \ } am__recheck_rx = ^[ ]*:recheck:[ ]* am__global_test_result_rx = ^[ ]*:global-test-result:[ ]* am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]* # A command that, given a newline-separated list of test names on the # standard input, print the name of the tests that are to be re-run # upon "make recheck". am__list_recheck_tests = $(AWK) '{ \ recheck = 1; \ while ((rc = (getline line < ($$0 ".trs"))) != 0) \ { \ if (rc < 0) \ { \ if ((getline line2 < ($$0 ".log")) < 0) \ recheck = 0; \ break; \ } \ else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \ { \ recheck = 0; \ break; \ } \ else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \ { \ break; \ } \ }; \ if (recheck) \ print $$0; \ close ($$0 ".trs"); \ close ($$0 ".log"); \ }' # A command that, given a newline-separated list of test names on the # standard input, create the global log from their .trs and .log files. am__create_global_log = $(AWK) ' \ function fatal(msg) \ { \ print "fatal: making $@: " msg | "cat >&2"; \ exit 1; \ } \ function rst_section(header) \ { \ print header; \ len = length(header); \ for (i = 1; i <= len; i = i + 1) \ printf "="; \ printf "\n\n"; \ } \ { \ copy_in_global_log = 1; \ global_test_result = "RUN"; \ while ((rc = (getline line < ($$0 ".trs"))) != 0) \ { \ if (rc < 0) \ fatal("failed to read from " $$0 ".trs"); \ if (line ~ /$(am__global_test_result_rx)/) \ { \ sub("$(am__global_test_result_rx)", "", line); \ sub("[ ]*$$", "", line); \ global_test_result = line; \ } \ else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \ copy_in_global_log = 0; \ }; \ if (copy_in_global_log) \ { \ rst_section(global_test_result ": " $$0); \ while ((rc = (getline line < ($$0 ".log"))) != 0) \ { \ if (rc < 0) \ fatal("failed to read from " $$0 ".log"); \ print line; \ }; \ printf "\n"; \ }; \ close ($$0 ".trs"); \ close ($$0 ".log"); \ }' # Restructured Text title. am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; } # Solaris 10 'make', and several other traditional 'make' implementations, # pass "-e" to $(SHELL), and POSIX 2008 even requires this. Work around it # by disabling -e (using the XSI extension "set +e") if it's set. am__sh_e_setup = case $$- in *e*) set +e;; esac # Default flags passed to test drivers. am__common_driver_flags = \ --color-tests "$$am__color_tests" \ $$am__collect_skipped_logs \ --enable-hard-errors "$$am__enable_hard_errors" \ --expect-failure "$$am__expect_failure" # To be inserted before the command running the test. Creates the # directory for the log if needed. Stores in $dir the directory # containing $f, in $tst the test, in $log the log. Executes the # developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and # passes TESTS_ENVIRONMENT. Set up options for the wrapper that # will run the test scripts (or their associated LOG_COMPILER, if # thy have one). am__check_pre = \ $(am__sh_e_setup); \ $(am__vpath_adj_setup) $(am__vpath_adj) \ $(am__tty_colors); \ srcdir=$(srcdir); export srcdir; \ case "$@" in \ */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \ *) am__odir=.;; \ esac; \ test "x$$am__odir" = x"." || test -d "$$am__odir" \ || $(MKDIR_P) "$$am__odir" || exit $$?; \ if test -f "./$$f"; then dir=./; \ elif test -f "$$f"; then dir=; \ else dir="$(srcdir)/"; fi; \ tst=$$dir$$f; log='$@'; \ if test -n '$(IGNORE_SKIPPED_LOGS)'; then \ am__collect_skipped_logs='--collect-skipped-logs no'; \ else \ am__collect_skipped_logs=''; \ fi; \ if test -n '$(DISABLE_HARD_ERRORS)'; then \ am__enable_hard_errors=no; \ else \ am__enable_hard_errors=yes; \ fi; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \ am__expect_failure=yes;; \ *) \ am__expect_failure=no;; \ esac; \ $(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT) # A shell command to get the names of the tests scripts with any registered # extension removed (i.e., equivalently, the names of the test logs, with # the '.log' extension removed). The result is saved in the shell variable # '$bases'. This honors runtime overriding of TESTS and TEST_LOGS. Sadly, # we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)", # since that might cause problem with VPATH rewrites for suffix-less tests. # See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'. am__set_TESTS_bases = \ bases='$(TEST_LOGS)'; \ bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \ bases=`echo $$bases` AM_TESTSUITE_SUMMARY_HEADER = ' for $(PACKAGE_STRING)' RECHECK_LOGS = $(TEST_LOGS) am__EXEEXT_3 = test-compile-nested.sh TEST_SUITE_LOG = test-suite.log TEST_EXTENSIONS = @EXEEXT@ .test LOG_DRIVER = $(SHELL) $(top_srcdir)/build-aux/test-driver LOG_COMPILE = $(LOG_COMPILER) $(AM_LOG_FLAGS) $(LOG_FLAGS) am__set_b = \ case '$@' in \ */*) \ case '$*' in \ */*) b='$*';; \ *) b=`echo '$@' | sed 's/\.log$$//'`; \ esac;; \ *) \ b='$*';; \ esac am__test_logs1 = $(TESTS:=.log) am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log) TEST_LOGS = $(am__test_logs2:.test.log=.log) TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/build-aux/test-driver TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \ $(TEST_LOG_FLAGS) am__DIST_COMMON = $(srcdir)/Makefile.in \ $(top_srcdir)/build-aux/depcomp \ $(top_srcdir)/build-aux/test-driver 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" 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@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DBUS_BINDING_TOOL = @DBUS_BINDING_TOOL@ DBUS_CFLAGS = @DBUS_CFLAGS@ DBUS_GLIB_TOOL_CFLAGS = @DBUS_GLIB_TOOL_CFLAGS@ DBUS_GLIB_TOOL_LIBS = @DBUS_GLIB_TOOL_LIBS@ DBUS_LIBS = @DBUS_LIBS@ DBUS_RUN_SESSION = @DBUS_RUN_SESSION@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FILECMD = @FILECMD@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ GLIB_THREADS_LIBS = @GLIB_THREADS_LIBS@ GREP = @GREP@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ HTML_DIR = @HTML_DIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ 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@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ 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@ 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__rm_f_notfound = @am__rm_f_notfound@ am__tar = @am__tar@ am__untar = @am__untar@ am__xargs_n = @am__xargs_n@ 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@ runstatedir = @runstatedir@ 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 = . core interfaces DIST_SUBDIRS = core interfaces AM_CPPFLAGS = \ -I$(top_srcdir) \ -I$(top_builddir) \ -I$(top_builddir)/dbus \ $(DBUS_CFLAGS) \ $(GLIB_CFLAGS) \ $(NULL) LDADD = \ $(top_builddir)/dbus/libdbus-glib-1.la \ $(GLIB_LIBS) \ $(DBUS_LIBS) \ $(NULL) @DBUS_BUILD_TESTS_TRUE@test_programs = \ @DBUS_BUILD_TESTS_TRUE@ test-errors \ @DBUS_BUILD_TESTS_TRUE@ test-specialized-types \ @DBUS_BUILD_TESTS_TRUE@ $(NULL) # not actually tests, but used by tests @DBUS_BUILD_TESTS_TRUE@test_related_programs = \ @DBUS_BUILD_TESTS_TRUE@ test-service \ @DBUS_BUILD_TESTS_TRUE@ $(NULL) test_errors_SOURCES = errors.c test_specialized_types_SOURCES = specialized-types.c 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) test_scripts = \ test-compile-nested.sh \ $(NULL) all: all-recursive .SUFFIXES: .SUFFIXES: .c .lo .log .o .obj .test .test$(EXEEXT) .trs $(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) --foreign test/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign test/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__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ 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: $(am__rm_f) $(noinst_PROGRAMS) test -z "$(EXEEXT)" || $(am__rm_f) $(noinst_PROGRAMS:$(EXEEXT)=) test-errors$(EXEEXT): $(test_errors_OBJECTS) $(test_errors_DEPENDENCIES) $(EXTRA_test_errors_DEPENDENCIES) @rm -f test-errors$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_errors_OBJECTS) $(test_errors_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) test-specialized-types$(EXEEXT): $(test_specialized_types_OBJECTS) $(test_specialized_types_DEPENDENCIES) $(EXTRA_test_specialized_types_DEPENDENCIES) @rm -f test-specialized-types$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_specialized_types_OBJECTS) $(test_specialized_types_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/errors.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/specialized-types.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-service.Po@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @: >>$@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.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 -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.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 -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.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. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ 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" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) 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; \ $(am__define_uniq_tagged_files); \ 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-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ 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" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags # Recover from deleted '.trs' file; this should ensure that # "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create # both 'foo.log' and 'foo.trs'. Break the recipe in two subshells # to avoid problems with "make -n". .log.trs: rm -f $< $@ $(MAKE) $(AM_MAKEFLAGS) $< # Leading 'am--fnord' is there to ensure the list of targets does not # expand to empty, as could happen e.g. with make check TESTS=''. am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck) am--force-recheck: @: $(TEST_SUITE_LOG): $(TEST_LOGS) @$(am__set_TESTS_bases); \ am__f_ok () { test -f "$$1" && test -r "$$1"; }; \ redo_bases=`for i in $$bases; do \ am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \ done`; \ if test -n "$$redo_bases"; then \ redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \ redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \ if $(am__make_dryrun); then :; else \ rm -f $$redo_logs && rm -f $$redo_results || exit 1; \ fi; \ fi; \ if test -n "$$am__remaking_logs"; then \ echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \ "recursion detected" >&2; \ elif test -n "$$redo_logs"; then \ am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \ fi; \ if $(am__make_dryrun); then :; else \ st=0; \ errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \ for i in $$redo_bases; do \ test -f $$i.trs && test -r $$i.trs \ || { echo "$$errmsg $$i.trs" >&2; st=1; }; \ test -f $$i.log && test -r $$i.log \ || { echo "$$errmsg $$i.log" >&2; st=1; }; \ done; \ test $$st -eq 0 || exit 1; \ fi @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \ ws='[ ]'; \ results=`for b in $$bases; do echo $$b.trs; done`; \ test -n "$$results" || results=/dev/null; \ all=` grep "^$$ws*:test-result:" $$results | wc -l`; \ pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \ fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \ skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \ xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \ xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \ error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \ if test `expr $$fail + $$xpass + $$error` -eq 0; then \ success=true; \ else \ success=false; \ fi; \ br='==================='; br=$$br$$br$$br$$br; \ result_count () \ { \ if test x"$$1" = x"--maybe-color"; then \ maybe_colorize=yes; \ elif test x"$$1" = x"--no-color"; then \ maybe_colorize=no; \ else \ echo "$@: invalid 'result_count' usage" >&2; exit 4; \ fi; \ shift; \ desc=$$1 count=$$2; \ if test $$maybe_colorize = yes && test $$count -gt 0; then \ color_start=$$3 color_end=$$std; \ else \ color_start= color_end=; \ fi; \ echo "$${color_start}# $$desc $$count$${color_end}"; \ }; \ create_testsuite_report () \ { \ result_count $$1 "TOTAL:" $$all "$$brg"; \ result_count $$1 "PASS: " $$pass "$$grn"; \ result_count $$1 "SKIP: " $$skip "$$blu"; \ result_count $$1 "XFAIL:" $$xfail "$$lgn"; \ result_count $$1 "FAIL: " $$fail "$$red"; \ result_count $$1 "XPASS:" $$xpass "$$red"; \ result_count $$1 "ERROR:" $$error "$$mgn"; \ }; \ output_system_information () \ { \ echo; \ { uname -a | $(AWK) '{ \ printf "System information (uname -a):"; \ for (i = 1; i < NF; ++i) \ { \ if (i != 2) \ printf " %s", $$i; \ } \ printf "\n"; \ }'; } 2>&1; \ if test -r /etc/os-release; then \ echo "Distribution information (/etc/os-release):"; \ sed 8q /etc/os-release; \ elif test -r /etc/issue; then \ echo "Distribution information (/etc/issue):"; \ cat /etc/issue; \ fi; \ }; \ please_report () \ { \ echo "Some test(s) failed. Please report this to $(PACKAGE_BUGREPORT),"; \ echo "together with the test-suite.log file (gzipped) and your system"; \ echo "information. Thanks."; \ }; \ { \ echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \ $(am__rst_title); \ create_testsuite_report --no-color; \ output_system_information; \ echo; \ echo ".. contents:: :depth: 2"; \ echo; \ for b in $$bases; do echo $$b; done \ | $(am__create_global_log); \ } >$(TEST_SUITE_LOG).tmp || exit 1; \ mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \ if $$success; then \ col="$$grn"; \ else \ col="$$red"; \ test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \ fi; \ echo "$${col}$$br$${std}"; \ echo "$${col}Testsuite summary"$(AM_TESTSUITE_SUMMARY_HEADER)"$${std}"; \ echo "$${col}$$br$${std}"; \ create_testsuite_report --maybe-color; \ echo "$$col$$br$$std"; \ if $$success; then :; else \ echo "$${col}See $(subdir)/$(TEST_SUITE_LOG) for debugging.$${std}";\ if test -n "$(PACKAGE_BUGREPORT)"; then \ please_report | sed -e "s/^/$${col}/" -e s/'$$'/"$${std}"/; \ fi; \ echo "$$col$$br$$std"; \ fi; \ $$success || exit 1 check-TESTS: @$(am__rm_f) $(RECHECK_LOGS) @$(am__rm_f) $(RECHECK_LOGS:.log=.trs) @$(am__rm_f) $(TEST_SUITE_LOG) @set +e; $(am__set_TESTS_bases); \ log_list=`for i in $$bases; do echo $$i.log; done`; \ log_list=`echo $$log_list`; \ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \ exit $$?; recheck: all @$(am__rm_f) $(TEST_SUITE_LOG) @set +e; $(am__set_TESTS_bases); \ bases=`for i in $$bases; do echo $$i; done \ | $(am__list_recheck_tests)` || exit 1; \ log_list=`for i in $$bases; do echo $$i.log; done`; \ log_list=`echo $$log_list`; \ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \ am__force_recheck=am--force-recheck \ TEST_LOGS="$$log_list"; \ exit $$? test-errors.log: test-errors$(EXEEXT) @p='test-errors$(EXEEXT)'; \ b='test-errors'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-specialized-types.log: test-specialized-types$(EXEEXT) @p='test-specialized-types$(EXEEXT)'; \ b='test-specialized-types'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-compile-nested.sh.log: test-compile-nested.sh @p='test-compile-nested.sh'; \ b='test-compile-nested.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) .test.log: @p='$<'; \ $(am__set_b); \ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) @am__EXEEXT_TRUE@.test$(EXEEXT).log: @am__EXEEXT_TRUE@ @p='$<'; \ @am__EXEEXT_TRUE@ $(am__set_b); \ @am__EXEEXT_TRUE@ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ @am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \ @am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ @am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT) distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(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: -$(am__rm_f) $(TEST_LOGS) -$(am__rm_f) $(TEST_LOGS:.log=.trs) -$(am__rm_f) $(TEST_SUITE_LOG) clean-generic: distclean-generic: -$(am__rm_f) $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || $(am__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 -f ./$(DEPDIR)/errors.Po -rm -f ./$(DEPDIR)/specialized-types.Po -rm -f ./$(DEPDIR)/test-service.Po -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 -f ./$(DEPDIR)/errors.Po -rm -f ./$(DEPDIR)/specialized-types.Po -rm -f ./$(DEPDIR)/test-service.Po -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: $(am__recursive_targets) check-am install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ am--depfiles check check-TESTS check-am clean clean-generic \ clean-libtool clean-noinstPROGRAMS cscopelist-am ctags \ ctags-am 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 \ recheck tags tags-am uninstall uninstall-am .PRECIOUS: Makefile check-valgrind: all $(MAKE) -C core check-valgrind $(MAKE) -C interfaces check-valgrind # 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: # Tell GNU make to disable its built-in pattern rules. %:: %,v %:: RCS/%,v %:: RCS/% %:: s.% %:: SCCS/s.% dbus-glib-0.114/test/Makefile.am0000644000175000017500000000202713233575561012076 SUBDIRS = . core interfaces DIST_SUBDIRS = core interfaces AM_CPPFLAGS = \ -I$(top_srcdir) \ -I$(top_builddir) \ -I$(top_builddir)/dbus \ $(DBUS_CFLAGS) \ $(GLIB_CFLAGS) \ $(NULL) LDADD = \ $(top_builddir)/dbus/libdbus-glib-1.la \ $(GLIB_LIBS) \ $(DBUS_LIBS) \ $(NULL) if DBUS_BUILD_TESTS test_programs = \ test-errors \ test-specialized-types \ $(NULL) # not actually tests, but used by tests test_related_programs = \ test-service \ $(NULL) endif test_errors_SOURCES = errors.c test_specialized_types_SOURCES = specialized-types.c 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) test_scripts = \ test-compile-nested.sh \ $(NULL) TESTS = \ $(test_programs) \ $(test_scripts) \ $(NULL) noinst_PROGRAMS = \ $(test_programs) \ $(test_related_programs) \ $(NULL) check-valgrind: all $(MAKE) -C core check-valgrind $(MAKE) -C interfaces check-valgrind dbus-glib-0.114/test/data/0000775000175000017500000000000014764624122011032 5dbus-glib-0.114/test/data/nested-introspect.xml0000644000175000017500000000035413233560240015134 dbus-glib-0.114/test/data/valid-service-files/0000775000175000017500000000000014764624122014667 5dbus-glib-0.114/test/data/valid-service-files/interfaces-test.service.in0000644000175000017500000000017413233560240021664 [D-BUS Service] Name=org.freedesktop.DBus.GLib.Test.Interfaces Exec=@abs_top_builddir@/test/interfaces/test-service@EXEEXT@ dbus-glib-0.114/test/data/valid-service-files/debug-glib.service.in0000644000175000017500000000016713233560240020567 [D-BUS Service] Name=org.freedesktop.DBus.GLib.TestService Exec=@abs_top_builddir@/test/core/test-service-glib@EXEEXT@ dbus-glib-0.114/test/data/valid-service-files/debug-echo.service.in0000644000175000017500000000016113233560240020562 [D-BUS Service] Name=org.freedesktop.DBus.GLib.TestEchoService Exec=@abs_top_builddir@/test/test-service@EXEEXT@ dbus-glib-0.114/m4/0000775000175000017500000000000014764624122007462 5dbus-glib-0.114/m4/Makefile.in0000664000175000017500000003150514764623731011460 # Makefile.in generated by automake 1.17 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2024 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__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) am__rm_f = rm -f $(am__rm_f_notfound) am__rm_rf = rm -rf $(am__rm_f_notfound) 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 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) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : 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_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = 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__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) 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@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DBUS_BINDING_TOOL = @DBUS_BINDING_TOOL@ DBUS_CFLAGS = @DBUS_CFLAGS@ DBUS_GLIB_TOOL_CFLAGS = @DBUS_GLIB_TOOL_CFLAGS@ DBUS_GLIB_TOOL_LIBS = @DBUS_GLIB_TOOL_LIBS@ DBUS_LIBS = @DBUS_LIBS@ DBUS_RUN_SESSION = @DBUS_RUN_SESSION@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FILECMD = @FILECMD@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ GLIB_THREADS_LIBS = @GLIB_THREADS_LIBS@ GREP = @GREP@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ HTML_DIR = @HTML_DIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ 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@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ 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@ 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__rm_f_notfound = @am__rm_f_notfound@ am__tar = @am__tar@ am__untar = @am__untar@ am__xargs_n = @am__xargs_n@ 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@ runstatedir = @runstatedir@ 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) --foreign m4/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign m4/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__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ 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: ctags CTAGS: cscope cscopelist: distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(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: -$(am__rm_f) $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || $(am__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 \ cscopelist-am ctags-am 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 \ tags-am uninstall uninstall-am .PRECIOUS: Makefile # 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: # Tell GNU make to disable its built-in pattern rules. %:: %,v %:: RCS/%,v %:: RCS/% %:: s.% %:: SCCS/s.% dbus-glib-0.114/m4/Makefile.am0000644000175000017500000000003013233560240011413 EXTRA_DIST = gtk-doc.m4 dbus-glib-0.114/m4/lt~obsolete.m40000644000175000017500000001400714764623724012225 # lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- # # Copyright (C) 2004-2005, 2007, 2009, 2011-2019, 2021-2024 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.114/m4/ltversion.m40000644000175000017500000000131214764623724011673 # ltversion.m4 -- version numbers -*- Autoconf -*- # # Copyright (C) 2004, 2011-2019, 2021-2024 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 4441 ltversion.m4 # This file is part of GNU Libtool m4_define([LT_PACKAGE_VERSION], [2.5.4]) m4_define([LT_PACKAGE_REVISION], [2.5.4]) AC_DEFUN([LTVERSION_VERSION], [macro_version='2.5.4' macro_revision='2.5.4' _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) _LT_DECL(, macro_revision, 0) ]) dbus-glib-0.114/m4/ltsugar.m40000644000175000017500000001045314764623724011335 # ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- # # Copyright (C) 2004-2005, 2007-2008, 2011-2019, 2021-2024 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.114/m4/ltoptions.m40000644000175000017500000003612114764623724011707 # Helper functions for option handling. -*- Autoconf -*- # # Copyright (C) 2004-2005, 2007-2009, 2011-2019, 2021-2024 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 10 ltoptions.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) # _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME) # ------------------------------------------ m4_define([_LT_MANGLE_OPTION], [[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])]) # _LT_SET_OPTION(MACRO-NAME, OPTION-NAME) # --------------------------------------- # Set option OPTION-NAME for macro MACRO-NAME, and if there is a # matching handler defined, dispatch to it. Other OPTION-NAMEs are # saved as a flag. m4_define([_LT_SET_OPTION], [m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]), _LT_MANGLE_DEFUN([$1], [$2]), [m4_warning([Unknown $1 option '$2'])])[]dnl ]) # _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET]) # ------------------------------------------------------------ # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. m4_define([_LT_IF_OPTION], [m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])]) # _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET) # ------------------------------------------------------- # Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME # are set. m4_define([_LT_UNLESS_OPTIONS], [m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option), [m4_define([$0_found])])])[]dnl m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3 ])[]dnl ]) # _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST) # ---------------------------------------- # OPTION-LIST is a space-separated list of Libtool options associated # with MACRO-NAME. If any OPTION has a matching handler declared with # LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about # the unknown option and exit. m4_defun([_LT_SET_OPTIONS], [# Set options m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [_LT_SET_OPTION([$1], _LT_Option)]) m4_if([$1],[LT_INIT],[ dnl dnl Simply set some default values (i.e off) if boolean options were not dnl specified: _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no ]) _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no ]) dnl dnl If no reference was made to various pairs of opposing options, then dnl we run the default mode handler for the pair. For example, if neither dnl 'shared' nor 'disable-shared' was passed, we enable building of shared dnl archives by default: _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED]) _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC]) _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC]) _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install], [_LT_ENABLE_FAST_INSTALL]) _LT_UNLESS_OPTIONS([LT_INIT], [aix-soname=aix aix-soname=both aix-soname=svr4], [_LT_WITH_AIX_SONAME([aix])]) ]) ])# _LT_SET_OPTIONS ## --------------------------------- ## ## Macros to handle LT_INIT options. ## ## --------------------------------- ## # _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME) # ----------------------------------------- m4_define([_LT_MANGLE_DEFUN], [[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])]) # LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE) # ----------------------------------------------- m4_define([LT_OPTION_DEFINE], [m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl ])# LT_OPTION_DEFINE # dlopen # ------ LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes ]) AU_DEFUN([AC_LIBTOOL_DLOPEN], [_LT_SET_OPTION([LT_INIT], [dlopen]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the 'dlopen' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], []) # win32-dll # --------- # Declare package support for building win32 dll's. LT_OPTION_DEFINE([LT_INIT], [win32-dll], [enable_win32_dll=yes case $host in *-*-cygwin* | *-*-mingw* | *-*-windows* | *-*-pw32* | *-*-cegcc*) AC_CHECK_TOOL(AS, as, false) AC_CHECK_TOOL(DLLTOOL, dlltool, false) AC_CHECK_TOOL(OBJDUMP, objdump, false) ;; esac test -z "$AS" && AS=as _LT_DECL([], [AS], [1], [Assembler program])dnl test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl ])# win32-dll AU_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_REQUIRE([AC_CANONICAL_HOST])dnl _LT_SET_OPTION([LT_INIT], [win32-dll]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the 'win32-dll' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], []) # _LT_ENABLE_SHARED([DEFAULT]) # ---------------------------- # implement the --enable-shared flag, and supports the 'shared' and # 'disable-shared' LT_INIT options. # DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'. m4_define([_LT_ENABLE_SHARED], [m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([shared], [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@], [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS=$lt_save_ifs ;; esac], [enable_shared=]_LT_ENABLE_SHARED_DEFAULT) _LT_DECL([build_libtool_libs], [enable_shared], [0], [Whether or not to build shared libraries]) ])# _LT_ENABLE_SHARED LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])]) # Old names: AC_DEFUN([AC_ENABLE_SHARED], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared]) ]) AC_DEFUN([AC_DISABLE_SHARED], [_LT_SET_OPTION([LT_INIT], [disable-shared]) ]) AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_SHARED], []) dnl AC_DEFUN([AM_DISABLE_SHARED], []) # _LT_ENABLE_STATIC([DEFAULT]) # ---------------------------- # implement the --enable-static flag, and support the 'static' and # 'disable-static' LT_INIT options. # DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'. m4_define([_LT_ENABLE_STATIC], [m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([static], [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@], [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS=$lt_save_ifs ;; esac], [enable_static=]_LT_ENABLE_STATIC_DEFAULT) _LT_DECL([build_old_libs], [enable_static], [0], [Whether or not to build static libraries]) ])# _LT_ENABLE_STATIC LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])]) # Old names: AC_DEFUN([AC_ENABLE_STATIC], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static]) ]) AC_DEFUN([AC_DISABLE_STATIC], [_LT_SET_OPTION([LT_INIT], [disable-static]) ]) AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_STATIC], []) dnl AC_DEFUN([AM_DISABLE_STATIC], []) # _LT_ENABLE_FAST_INSTALL([DEFAULT]) # ---------------------------------- # implement the --enable-fast-install flag, and support the 'fast-install' # and 'disable-fast-install' LT_INIT options. # DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'. m4_define([_LT_ENABLE_FAST_INSTALL], [m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([fast-install], [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS=$lt_save_ifs ;; esac], [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT) _LT_DECL([fast_install], [enable_fast_install], [0], [Whether or not to optimize for fast installation])dnl ])# _LT_ENABLE_FAST_INSTALL LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])]) # Old names: AU_DEFUN([AC_ENABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the 'fast-install' option into LT_INIT's first parameter.]) ]) AU_DEFUN([AC_DISABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], [disable-fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the 'disable-fast-install' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], []) dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], []) # _LT_WITH_AIX_SONAME([DEFAULT]) # ---------------------------------- # implement the --enable-aix-soname configure option, and support the # `aix-soname=aix' and `aix-soname=both' and `aix-soname=svr4' LT_INIT options. # DEFAULT is either `aix', `both', or `svr4'. If omitted, it defaults to `aix'. m4_define([_LT_WITH_AIX_SONAME], [m4_define([_LT_WITH_AIX_SONAME_DEFAULT], [m4_if($1, svr4, svr4, m4_if($1, both, both, aix))])dnl shared_archive_member_spec= case $host,$enable_shared in power*-*-aix[[5-9]]*,yes) AC_MSG_CHECKING([which variant of shared library versioning to provide]) AC_ARG_ENABLE([aix-soname], [AS_HELP_STRING([--enable-aix-soname=aix|svr4|both], [shared library versioning (aka "SONAME") variant to provide on AIX, @<:@default=]_LT_WITH_AIX_SONAME_DEFAULT[@:>@.])], [case $enableval in aix|svr4|both) ;; *) AC_MSG_ERROR([Unknown argument to --enable-aix-soname]) ;; esac lt_cv_with_aix_soname=$enable_aix_soname], [_AC_ENABLE_IF([with], [aix-soname], [case $withval in aix|svr4|both) ;; *) AC_MSG_ERROR([Unknown argument to --with-aix-soname]) ;; esac lt_cv_with_aix_soname=$with_aix_soname], [AC_CACHE_VAL([lt_cv_with_aix_soname], [lt_cv_with_aix_soname=]_LT_WITH_AIX_SONAME_DEFAULT)]) enable_aix_soname=$lt_cv_with_aix_soname]) with_aix_soname=$enable_aix_soname AC_MSG_RESULT([$with_aix_soname]) if test aix != "$with_aix_soname"; then # For the AIX way of multilib, we name the shared archive member # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o', # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File. # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag, # the AIX toolchain works better with OBJECT_MODE set (default 32). if test 64 = "${OBJECT_MODE-32}"; then shared_archive_member_spec=shr_64 else shared_archive_member_spec=shr fi fi ;; *) with_aix_soname=aix ;; esac _LT_DECL([], [shared_archive_member_spec], [0], [Shared archive member basename, for filename based shared library versioning on AIX])dnl ])# _LT_WITH_AIX_SONAME LT_OPTION_DEFINE([LT_INIT], [aix-soname=aix], [_LT_WITH_AIX_SONAME([aix])]) LT_OPTION_DEFINE([LT_INIT], [aix-soname=both], [_LT_WITH_AIX_SONAME([both])]) LT_OPTION_DEFINE([LT_INIT], [aix-soname=svr4], [_LT_WITH_AIX_SONAME([svr4])]) # _LT_WITH_PIC([MODE]) # -------------------- # implement the --enable-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_ENABLE([pic], [AS_HELP_STRING([--enable-pic@<:@=PKGS@:>@], [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], [lt_p=${PACKAGE-default} case $enableval in yes|no) pic_mode=$enableval ;; *) 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 $enableval; do IFS=$lt_save_ifs if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done IFS=$lt_save_ifs ;; esac], [dnl Continue to support --with-pic and --without-pic, for backward dnl compatibility. _AC_ENABLE_IF([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], [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.114/m4/libtool.m40000644000175000017500000114100514764623724011317 # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # # Copyright (C) 1996-2001, 2003-2019, 2021-2024 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) 2024 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # GNU Libtool is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program or library that is built # using GNU Libtool, you may include this file under the same # distribution terms that you use for the rest of that program. # # GNU Libtool is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . ]) # serial 63 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.64])dnl We use AC_PATH_PROGS_FEATURE_CHECK AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl AC_BEFORE([$0], [LT_LANG])dnl AC_BEFORE([$0], [LT_OUTPUT])dnl AC_BEFORE([$0], [LTDL_INIT])dnl m4_require([_LT_CHECK_BUILDDIR])dnl dnl Autoconf doesn't catch unexpanded LT_ macros by default: m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4 dnl unless we require an AC_DEFUNed macro: AC_REQUIRE([LTOPTIONS_VERSION])dnl AC_REQUIRE([LTSUGAR_VERSION])dnl AC_REQUIRE([LTVERSION_VERSION])dnl AC_REQUIRE([LTOBSOLETE_VERSION])dnl m4_require([_LT_PROG_LTMAIN])dnl _LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}]) dnl Parse OPTIONS _LT_SET_OPTIONS([$0], [$1]) # This can be used to rebuild libtool when needed LIBTOOL_DEPS=$ltmain # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' AC_SUBST(LIBTOOL)dnl _LT_SETUP # Only expand once: m4_define([LT_INIT]) ])# LT_INIT # Old names: AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT]) AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PROG_LIBTOOL], []) dnl AC_DEFUN([AM_PROG_LIBTOOL], []) # _LT_PREPARE_CC_BASENAME # ----------------------- m4_defun([_LT_PREPARE_CC_BASENAME], [ # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. func_cc_basename () { for cc_temp in @S|@*""; do case $cc_temp in compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; \-*) ;; *) break;; esac done func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` } ])# _LT_PREPARE_CC_BASENAME # _LT_CC_BASENAME(CC) # ------------------- # It would be clearer to call AC_REQUIREs from _LT_PREPARE_CC_BASENAME, # but that macro is also expanded into generated libtool script, which # arranges for $SED and $ECHO to be set by different means. m4_defun([_LT_CC_BASENAME], [m4_require([_LT_PREPARE_CC_BASENAME])dnl AC_REQUIRE([_LT_DECL_SED])dnl AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl func_cc_basename $1 cc_basename=$func_cc_basename_result ]) # _LT_FILEUTILS_DEFAULTS # ---------------------- # It is okay to use these file commands and assume they have been set # sensibly after 'm4_require([_LT_FILEUTILS_DEFAULTS])'. m4_defun([_LT_FILEUTILS_DEFAULTS], [: ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} ])# _LT_FILEUTILS_DEFAULTS # _LT_SETUP # --------- m4_defun([_LT_SETUP], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl _LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl dnl _LT_DECL([], [host_alias], [0], [The host system])dnl _LT_DECL([], [host], [0])dnl _LT_DECL([], [host_os], [0])dnl dnl _LT_DECL([], [build_alias], [0], [The build system])dnl _LT_DECL([], [build], [0])dnl _LT_DECL([], [build_os], [0])dnl dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl dnl AC_REQUIRE([AC_PROG_LN_S])dnl test -z "$LN_S" && LN_S="ln -s" _LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl dnl AC_REQUIRE([LT_CMD_MAX_LEN])dnl _LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl _LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl m4_require([_LT_CMD_RELOAD])dnl m4_require([_LT_DECL_FILECMD])dnl m4_require([_LT_CHECK_MAGIC_METHOD])dnl m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl m4_require([_LT_CMD_OLD_ARCHIVE])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_WITH_SYSROOT])dnl m4_require([_LT_CMD_TRUNCATE])dnl _LT_CONFIG_LIBTOOL_INIT([ # See if we are running on zsh, and set the options that allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi ]) if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi _LT_CHECK_OBJDIR m4_require([_LT_TAG_COMPILER])dnl case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a '.a' archive for static linking (except MSVC and # ICC, which need '.lib'). libext=a with_gnu_ld=$lt_cv_prog_gnu_ld old_CC=$CC old_CFLAGS=$CFLAGS # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o _LT_CC_BASENAME([$compiler]) # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then _LT_PATH_MAGIC fi ;; esac # Use C for the default configuration in the libtool script LT_SUPPORTED_TAG([CC]) _LT_LANG_C_CONFIG _LT_LANG_DEFAULT_CONFIG _LT_CONFIG_COMMANDS ])# _LT_SETUP # _LT_PREPARE_SED_QUOTE_VARS # -------------------------- # Define a few sed substitution that help us do robust quoting. m4_defun([_LT_PREPARE_SED_QUOTE_VARS], [# Backslashify metacharacters that are still active within # double-quoted strings. sed_quote_subst='s/\([["`$\\]]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\([["`\\]]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' ]) # _LT_PROG_LTMAIN # --------------- # Note that this code is called both from 'configure', and 'config.status' # now that we use AC_CONFIG_COMMANDS to generate libtool. Notably, # 'config.status' has no value for ac_aux_dir unless we are using Automake, # so we pass a copy along to make sure it has a sensible value anyway. m4_defun([_LT_PROG_LTMAIN], [m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl _LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir']) ltmain=$ac_aux_dir/ltmain.sh ])# _LT_PROG_LTMAIN ## ------------------------------------- ## ## Accumulate code for creating libtool. ## ## ------------------------------------- ## # So that we can recreate a full libtool script including additional # tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS # in macros and then make a single call at the end using the 'libtool' # label. # _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS]) # ---------------------------------------- # Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL_INIT], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_INIT], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_INIT]) # _LT_CONFIG_LIBTOOL([COMMANDS]) # ------------------------------ # Register COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS]) # _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS]) # ----------------------------------------------------- m4_defun([_LT_CONFIG_SAVE_COMMANDS], [_LT_CONFIG_LIBTOOL([$1]) _LT_CONFIG_LIBTOOL_INIT([$2]) ]) # _LT_FORMAT_COMMENT([COMMENT]) # ----------------------------- # Add leading comment marks to the start of each line, and a trailing # full-stop to the whole comment if one is not present already. m4_define([_LT_FORMAT_COMMENT], [m4_ifval([$1], [ m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])], [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.]) )]) ## ------------------------ ## ## FIXME: Eliminate VARNAME ## ## ------------------------ ## # _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?]) # ------------------------------------------------------------------- # CONFIGNAME is the name given to the value in the libtool script. # VARNAME is the (base) name used in the configure script. # VALUE may be 0, 1 or 2 for a computed quote escaped value based on # VARNAME. Any other value will be used directly. m4_define([_LT_DECL], [lt_if_append_uniq([lt_decl_varnames], [$2], [, ], [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name], [m4_ifval([$1], [$1], [$2])]) lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3]) m4_ifval([$4], [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])]) lt_dict_add_subkey([lt_decl_dict], [$2], [tagged?], [m4_ifval([$5], [yes], [no])])]) ]) # _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION]) # -------------------------------------------------------- m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])]) # lt_decl_tag_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_tag_varnames], [_lt_decl_filter([tagged?], [yes], $@)]) # _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..]) # --------------------------------------------------------- m4_define([_lt_decl_filter], [m4_case([$#], [0], [m4_fatal([$0: too few arguments: $#])], [1], [m4_fatal([$0: too few arguments: $#: $1])], [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)], [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)], [lt_dict_filter([lt_decl_dict], $@)])[]dnl ]) # lt_decl_quote_varnames([SEPARATOR], [VARNAME1...]) # -------------------------------------------------- m4_define([lt_decl_quote_varnames], [_lt_decl_filter([value], [1], $@)]) # lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_dquote_varnames], [_lt_decl_filter([value], [2], $@)]) # lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_varnames_tagged], [m4_assert([$# <= 2])dnl _$0(m4_quote(m4_default([$1], [[, ]])), m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]), m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))]) m4_define([_lt_decl_varnames_tagged], [m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])]) # lt_decl_all_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_all_varnames], [_$0(m4_quote(m4_default([$1], [[, ]])), m4_if([$2], [], m4_quote(lt_decl_varnames), m4_quote(m4_shift($@))))[]dnl ]) m4_define([_lt_decl_all_varnames], [lt_join($@, lt_decl_varnames_tagged([$1], lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl ]) # _LT_CONFIG_STATUS_DECLARE([VARNAME]) # ------------------------------------ # Quote a variable value, and forward it to 'config.status' so that its # declaration there will have the same value as in 'configure'. VARNAME # must have a single quote delimited value for this to work. m4_define([_LT_CONFIG_STATUS_DECLARE], [$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`']) # _LT_CONFIG_STATUS_DECLARATIONS # ------------------------------ # We delimit libtool config variables with single quotes, so when # we write them to config.status, we have to be sure to quote all # embedded single quotes properly. In configure, this macro expands # each variable declared with _LT_DECL (and _LT_TAGDECL) into: # # ='`$ECHO "$" | $SED "$delay_single_quote_subst"`' m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], [m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames), [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAGS # ---------------- # Output comment and list of tags supported by the script m4_defun([_LT_LIBTOOL_TAGS], [_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl available_tags='_LT_TAGS'dnl ]) # _LT_LIBTOOL_DECLARE(VARNAME, [TAG]) # ----------------------------------- # Extract the dictionary values for VARNAME (optionally with TAG) and # expand to a commented shell variable setting: # # # Some comment about what VAR is for. # visible_name=$lt_internal_name m4_define([_LT_LIBTOOL_DECLARE], [_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [description])))[]dnl m4_pushdef([_libtool_name], m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])), [0], [_libtool_name=[$]$1], [1], [_libtool_name=$lt_[]$1], [2], [_libtool_name=$lt_[]$1], [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl ]) # _LT_LIBTOOL_CONFIG_VARS # ----------------------- # Produce commented declarations of non-tagged libtool config variables # suitable for insertion in the LIBTOOL CONFIG section of the 'libtool' # script. Tagged libtool config variables (even for the LIBTOOL CONFIG # section) are produced by _LT_LIBTOOL_TAG_VARS. m4_defun([_LT_LIBTOOL_CONFIG_VARS], [m4_foreach([_lt_var], m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAG_VARS(TAG) # ------------------------- m4_define([_LT_LIBTOOL_TAG_VARS], [m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])]) # _LT_TAGVAR(VARNAME, [TAGNAME]) # ------------------------------ m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])]) # _LT_CONFIG_COMMANDS # ------------------- # Send accumulated output to $CONFIG_STATUS. Thanks to the lists of # variables for single and double quote escaping we saved from calls # to _LT_DECL, we can put quote escaped variables declarations # into 'config.status', and then the shell code to quote escape them in # for loops in 'config.status'. Finally, any additional code accumulated # from calls to _LT_CONFIG_LIBTOOL_INIT is expanded. m4_defun([_LT_CONFIG_COMMANDS], [AC_PROVIDE_IFELSE([LT_OUTPUT], dnl If the libtool generation code has been placed in $CONFIG_LT, dnl instead of duplicating it all over again into config.status, dnl then we will have config.status run $CONFIG_LT later, so it dnl needs to know what name is stored there: [AC_CONFIG_COMMANDS([libtool], [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])], dnl If the libtool generation code is destined for config.status, dnl expand the accumulated commands and init code now: [AC_CONFIG_COMMANDS([libtool], [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])]) ])#_LT_CONFIG_COMMANDS # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT], [ # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' _LT_CONFIG_STATUS_DECLARATIONS LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$[]1 _LTECHO_EOF' } # Quote evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_quote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_dquote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done _LT_OUTPUT_LIBTOOL_INIT ]) # _LT_GENERATED_FILE_INIT(FILE, [COMMENT]) # ------------------------------------ # Generate a child script FILE with all initialization necessary to # reuse the environment learned by the parent script, and make the # file executable. If COMMENT is supplied, it is inserted after the # '#!' sequence but before initialization text begins. After this # macro, additional text can be appended to FILE to form the body of # the child script. The macro ends with non-zero status if the # file could not be fully written (such as if the disk is full). m4_ifdef([AS_INIT_GENERATED], [m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])], [m4_defun([_LT_GENERATED_FILE_INIT], [m4_require([AS_PREPARE])]dnl [m4_pushdef([AS_MESSAGE_LOG_FD])]dnl [lt_write_fail=0 cat >$1 <<_ASEOF || lt_write_fail=1 #! $SHELL # Generated by $as_me. $2 SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$1 <<\_ASEOF || lt_write_fail=1 AS_SHELL_SANITIZE _AS_PREPARE exec AS_MESSAGE_FD>&1 _ASEOF test 0 = "$lt_write_fail" && chmod +x $1[]dnl m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT # LT_OUTPUT # --------- # This macro allows early generation of the libtool script (before # AC_OUTPUT is called), in case 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) 2024 Free Software Foundation, Inc. This config.lt script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." while test 0 != $[#] do case $[1] in --version | --v* | -V ) echo "$lt_cl_version"; exit 0 ;; --help | --h* | -h ) echo "$lt_cl_help"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --quiet | --q* | --silent | --s* | -q ) lt_cl_silent=: ;; -*) AC_MSG_ERROR([unrecognized option: $[1] Try '$[0] --help' for more information.]) ;; *) AC_MSG_ERROR([unrecognized argument: $[1] Try '$[0] --help' for more information.]) ;; esac shift done if $lt_cl_silent; then exec AS_MESSAGE_FD>/dev/null fi _LTEOF cat >>"$CONFIG_LT" <<_LTEOF _LT_OUTPUT_LIBTOOL_COMMANDS_INIT _LTEOF cat >>"$CONFIG_LT" <<\_LTEOF AC_MSG_NOTICE([creating $ofile]) _LT_OUTPUT_LIBTOOL_COMMANDS AS_EXIT(0) _LTEOF chmod +x "$CONFIG_LT" # configure is writing to config.log, but config.lt does its own redirection, # appending to config.log, which fails on DOS, as config.log is still kept # open by configure. Here we exec the FD to /dev/null, effectively closing # config.log, so it can be properly (re)opened and appended to by config.lt. lt_cl_success=: test yes = "$silent" && lt_config_lt_args="$lt_config_lt_args --quiet" exec AS_MESSAGE_LOG_FD>/dev/null $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false exec AS_MESSAGE_LOG_FD>>config.log $lt_cl_success || AS_EXIT(1) ])# LT_OUTPUT # _LT_CONFIG(TAG) # --------------- # If TAG is the built-in tag, create an initial libtool script with a # default configuration from the untagged config vars. Otherwise add code # to config.status for appending the configuration named by TAG from the # matching tagged config vars. m4_defun([_LT_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_CONFIG_SAVE_COMMANDS([ m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl m4_if(_LT_TAG, [C], [ # See if we are running on zsh, and set the options that allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi cfgfile=${ofile}T trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # Generated automatically by $as_me ($PACKAGE) $VERSION # NOTE: Changes made to this file will be lost: look at ltmain.sh. # Provide generalized library-building support services. # Written by Gordon Matzigkeit, 1996 _LT_COPYING _LT_LIBTOOL_TAGS # Configured defaults for sys_lib_dlsearch_path munging. : \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"} # ### BEGIN LIBTOOL CONFIG _LT_LIBTOOL_CONFIG_VARS _LT_LIBTOOL_TAG_VARS # ### END LIBTOOL CONFIG _LT_EOF cat <<'_LT_EOF' >> "$cfgfile" # ### BEGIN FUNCTIONS SHARED WITH CONFIGURE _LT_PREPARE_MUNGE_PATH_LIST _LT_PREPARE_CC_BASENAME # ### END FUNCTIONS SHARED WITH CONFIGURE _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac _LT_PROG_LTMAIN # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? $SED '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ], [cat <<_LT_EOF >> "$ofile" dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded dnl in a comment (ie after a #). # ### BEGIN LIBTOOL TAG CONFIG: $1 _LT_LIBTOOL_TAG_VARS(_LT_TAG) # ### END LIBTOOL TAG CONFIG: $1 _LT_EOF ])dnl /m4_if ], [m4_if([$1], [], [ PACKAGE='$PACKAGE' VERSION='$VERSION' RM='$RM' ofile='$ofile'], []) ])dnl /_LT_CONFIG_SAVE_COMMANDS ])# _LT_CONFIG # LT_SUPPORTED_TAG(TAG) # --------------------- # Trace this macro to discover what tags are supported by the libtool # --tag option, using: # autoconf --trace 'LT_SUPPORTED_TAG:$1' AC_DEFUN([LT_SUPPORTED_TAG], []) # C support is built-in for now m4_define([_LT_LANG_C_enabled], []) m4_define([_LT_TAGS], []) # LT_LANG(LANG) # ------------- # Enable libtool support for the given language if not already enabled. AC_DEFUN([LT_LANG], [AC_BEFORE([$0], [LT_OUTPUT])dnl m4_case([$1], [C], [_LT_LANG(C)], [C++], [_LT_LANG(CXX)], [Go], [_LT_LANG(GO)], [Java], [_LT_LANG(GCJ)], [Fortran 77], [_LT_LANG(F77)], [Fortran], [_LT_LANG(FC)], [Windows Resource], [_LT_LANG(RC)], [m4_ifdef([_LT_LANG_]$1[_CONFIG], [_LT_LANG($1)], [m4_fatal([$0: unsupported language: "$1"])])])dnl ])# LT_LANG # _LT_LANG(LANGNAME) # ------------------ m4_defun([_LT_LANG], [m4_ifdef([_LT_LANG_]$1[_enabled], [], [LT_SUPPORTED_TAG([$1])dnl m4_append([_LT_TAGS], [$1 ])dnl m4_define([_LT_LANG_]$1[_enabled], [])dnl _LT_LANG_$1_CONFIG($1)])dnl ])# _LT_LANG m4_ifndef([AC_PROG_GO], [ ############################################################ # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_GO. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # ############################################################ m4_defun([AC_PROG_GO], [AC_LANG_PUSH(Go)dnl AC_ARG_VAR([GOC], [Go compiler command])dnl AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl _AC_ARG_VAR_LDFLAGS()dnl AC_CHECK_TOOL(GOC, gccgo) if test -z "$GOC"; then if test -n "$ac_tool_prefix"; then AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo]) fi fi if test -z "$GOC"; then AC_CHECK_PROG(GOC, gccgo, gccgo, false) fi ])#m4_defun ])#m4_ifndef # _LT_LANG_DEFAULT_CONFIG # ----------------------- m4_defun([_LT_LANG_DEFAULT_CONFIG], [AC_PROVIDE_IFELSE([AC_PROG_CXX], [LT_LANG(CXX)], [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])]) AC_PROVIDE_IFELSE([AC_PROG_F77], [LT_LANG(F77)], [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])]) AC_PROVIDE_IFELSE([AC_PROG_FC], [LT_LANG(FC)], [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])]) dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal dnl pulling things in needlessly. AC_PROVIDE_IFELSE([AC_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([LT_PROG_GCJ], [LT_LANG(GCJ)], [m4_ifdef([AC_PROG_GCJ], [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([A][M_PROG_GCJ], [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([LT_PROG_GCJ], [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])]) AC_PROVIDE_IFELSE([AC_PROG_GO], [LT_LANG(GO)], [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])]) AC_PROVIDE_IFELSE([LT_PROG_RC], [LT_LANG(RC)], [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])]) ])# _LT_LANG_DEFAULT_CONFIG # Obsolete macros: AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)]) AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)]) AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)]) AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)]) AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_CXX], []) dnl AC_DEFUN([AC_LIBTOOL_F77], []) dnl AC_DEFUN([AC_LIBTOOL_FC], []) dnl AC_DEFUN([AC_LIBTOOL_GCJ], []) dnl AC_DEFUN([AC_LIBTOOL_RC], []) # _LT_TAG_COMPILER # ---------------- m4_defun([_LT_TAG_COMPILER], [AC_REQUIRE([AC_PROG_CC])dnl _LT_DECL([LTCC], [CC], [1], [A C compiler])dnl _LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl _LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl _LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC ])# _LT_TAG_COMPILER # _LT_COMPILER_BOILERPLATE # ------------------------ # Check for compiler boilerplate output or warnings with # the simple compiler test code. m4_defun([_LT_COMPILER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ])# _LT_COMPILER_BOILERPLATE # _LT_LINKER_BOILERPLATE # ---------------------- # Check for linker boilerplate output or warnings with # the simple link test code. m4_defun([_LT_LINKER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* ])# _LT_LINKER_BOILERPLATE # _LT_REQUIRED_DARWIN_CHECKS # ------------------------- m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ case $host_os in rhapsody* | darwin*) AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:]) AC_CHECK_TOOL([NMEDIT], [nmedit], [:]) AC_CHECK_TOOL([LIPO], [lipo], [:]) AC_CHECK_TOOL([OTOOL], [otool], [:]) AC_CHECK_TOOL([OTOOL64], [otool64], [:]) _LT_DECL([], [DSYMUTIL], [1], [Tool to manipulate archived DWARF debug symbol files on Mac OS X]) _LT_DECL([], [NMEDIT], [1], [Tool to change global to local symbols on Mac OS X]) _LT_DECL([], [LIPO], [1], [Tool to manipulate fat objects and archives on Mac OS X]) _LT_DECL([], [OTOOL], [1], [ldd/readelf like tool for Mach-O binaries on Mac OS X]) _LT_DECL([], [OTOOL64], [1], [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4]) AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod], [lt_cv_apple_cc_single_mod=no if test -z "$LT_MULTI_MODULE"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? # If there is a non-empty error log, and "single_module" # appears in it, assume the flag caused a linker warning if test -s conftest.err && $GREP single_module conftest.err; then cat conftest.err >&AS_MESSAGE_LOG_FD # Otherwise, if the output was created with a 0 exit code from # the compiler, it worked. elif test -f libconftest.dylib && test 0 = "$_lt_result"; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&AS_MESSAGE_LOG_FD fi rm -rf libconftest.dylib* rm -f conftest.* fi]) # Feature test to disable chained fixups since it is not # compatible with '-undefined dynamic_lookup' AC_CACHE_CHECK([for -no_fixup_chains linker flag], [lt_cv_support_no_fixup_chains], [ save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -Wl,-no_fixup_chains" AC_LINK_IFELSE( [AC_LANG_PROGRAM([],[])], lt_cv_support_no_fixup_chains=yes, lt_cv_support_no_fixup_chains=no ) LDFLAGS=$save_LDFLAGS ] ) 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 $AR_FLAGS libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD $AR $AR_FLAGS 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(void) { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? if test -s conftest.err && $GREP force_load conftest.err; then cat conftest.err >&AS_MESSAGE_LOG_FD elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then lt_cv_ld_force_load=yes else cat conftest.err >&AS_MESSAGE_LOG_FD fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM ]) case $host_os in rhapsody* | darwin1.[[012]]) _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; darwin*) case $MACOSX_DEPLOYMENT_TARGET,$host in 10.[[012]],*|,*powerpc*-darwin[[5-8]]*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; *) _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' if test yes = "$lt_cv_support_no_fixup_chains"; then AS_VAR_APPEND([_lt_dar_allow_undefined], [' $wl-no_fixup_chains']) fi ;; esac ;; esac if test yes = "$lt_cv_apple_cc_single_mod"; then _lt_dar_single_mod='$single_module' fi _lt_dar_needs_single_mod=no case $host_os in rhapsody* | darwin1.*) _lt_dar_needs_single_mod=yes ;; darwin*) # When targeting Mac OS X 10.4 (darwin 8) or later, # -single_module is the default and -multi_module is unsupported. # The toolchain on macOS 10.14 (darwin 18) and later cannot # target any OS version that needs -single_module. case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*-darwin[[567]].*|10.[[0-3]],*-darwin[[5-9]].*|10.[[0-3]],*-darwin1[[0-7]].*) _lt_dar_needs_single_mod=yes ;; esac ;; esac if test yes = "$lt_cv_ld_exported_symbols_list"; then _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib' fi if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac ]) # _LT_DARWIN_LINKER_FEATURES([TAG]) # --------------------------------- # Checks for linker and compiler features on darwin m4_defun([_LT_DARWIN_LINKER_FEATURES], [ m4_require([_LT_REQUIRED_DARWIN_CHECKS]) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported if test yes = "$lt_cv_ld_force_load"; then _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes], [FC], [_LT_TAGVAR(compiler_needs_object, $1)=yes]) else _LT_TAGVAR(whole_archive_flag_spec, $1)='' fi _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=$_lt_dar_allow_undefined case $cc_basename in ifort*|nagfor*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test yes = "$_lt_dar_can_shared"; then output_verbose_link_cmd=func_echo_all _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" _LT_TAGVAR(archive_expsym_cmds, $1)="$SED 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" _LT_TAGVAR(module_expsym_cmds, $1)="$SED -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" m4_if([$1], [CXX], [ if test yes = "$_lt_dar_needs_single_mod" -a yes != "$lt_cv_apple_cc_single_mod"; then _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dsymutil" _LT_TAGVAR(archive_expsym_cmds, $1)="$SED 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil" fi ],[]) else _LT_TAGVAR(ld_shlibs, $1)=no fi ]) # _LT_SYS_MODULE_PATH_AIX([TAGNAME]) # ---------------------------------- # Links a minimal program and checks the executable # for the system default hardcoded library path. In most cases, # this is /usr/lib:/lib, but when the MPI compilers are used # the location of the communication and MPI libs are included too. # If we don't find anything, use the default library path according # to the aix ld manual. # Store the results from the different compilers for each TAGNAME. # Allow to override them for all tags through lt_cv_aix_libpath. m4_defun([_LT_SYS_MODULE_PATH_AIX], [m4_require([_LT_DECL_SED])dnl if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])], [AC_LINK_IFELSE([AC_LANG_PROGRAM],[ lt_aix_libpath_sed='[ /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }]' _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi],[]) if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=/usr/lib:/lib fi ]) aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1]) fi ])# _LT_SYS_MODULE_PATH_AIX # _LT_SHELL_INIT(ARG) # ------------------- m4_define([_LT_SHELL_INIT], [m4_divert_text([M4SH-INIT], [$1 ])])# _LT_SHELL_INIT # _LT_PROG_ECHO_BACKSLASH # ----------------------- # Find how we can fake an echo command that does not interpret backslash. # In particular, with Autoconf 2.60 or later we add some code to the start # of the generated configure script that will find a shell with a builtin # printf (that we can use as an echo command). m4_defun([_LT_PROG_ECHO_BACKSLASH], [ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO AC_MSG_CHECKING([how to print strings]) # Test print first, because it will be a builtin if present. if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='print -r --' elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='printf %s\n' else # Use this function as a fallback that always works. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $[]1 _LTECHO_EOF' } ECHO='func_fallback_echo' fi # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "$*" } case $ECHO in printf*) AC_MSG_RESULT([printf]) ;; print*) AC_MSG_RESULT([print -r]) ;; *) AC_MSG_RESULT([cat]) ;; esac m4_ifdef([_AS_DETECT_SUGGESTED], [_AS_DETECT_SUGGESTED([ test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test "X`printf %s $ECHO`" = "X$ECHO" \ || test "X`print -r -- $ECHO`" = "X$ECHO" )])]) _LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) _LT_DECL([], [ECHO], [1], [An echo program that protects backslashes]) ])# _LT_PROG_ECHO_BACKSLASH # _LT_WITH_SYSROOT # ---------------- AC_DEFUN([_LT_WITH_SYSROOT], [m4_require([_LT_DECL_SED])dnl AC_MSG_CHECKING([for sysroot]) AC_ARG_WITH([sysroot], [AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@], [Search for dependent libraries within DIR (or the compiler's sysroot if not specified).])], [], [with_sysroot=no]) dnl lt_sysroot will always be passed unquoted. We quote it here dnl in case the user passed a directory name. lt_sysroot= case $with_sysroot in #( yes) if test yes = "$GCC"; then # Trim trailing / since we'll always append absolute paths and we want # to avoid //, if only for less confusing output for the user. lt_sysroot=`$CC --print-sysroot 2>/dev/null | $SED 's:/\+$::'` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) AC_MSG_RESULT([$with_sysroot]) AC_MSG_ERROR([The sysroot must be an absolute path.]) ;; esac AC_MSG_RESULT([${lt_sysroot:-no}]) _LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl [dependent libraries, and where our libraries should be installed.])]) # _LT_ENABLE_LOCK # --------------- m4_defun([_LT_ENABLE_LOCK], [AC_ARG_ENABLE([libtool-lock], [AS_HELP_STRING([--disable-libtool-lock], [avoid locking (might break parallel builds)])]) test no = "$enable_libtool_lock" || enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out what ABI is being produced by ac_compile, and set mode # options accordingly. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `$FILECMD conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE=32 ;; *ELF-64*) HPUX_IA64_MODE=64 ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then if test yes = "$lt_cv_prog_gnu_ld"; then case `$FILECMD conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `$FILECMD conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; mips64*-*linux*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then emul=elf case `$FILECMD conftest.$ac_objext` in *32-bit*) emul="${emul}32" ;; *64-bit*) emul="${emul}64" ;; esac case `$FILECMD conftest.$ac_objext` in *MSB*) emul="${emul}btsmip" ;; *LSB*) emul="${emul}ltsmip" ;; esac case `$FILECMD conftest.$ac_objext` in *N32*) emul="${emul}n32" ;; esac LD="${LD-ld} -m $emul" fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*|x86_64-gnu*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. Note that the listed cases only cover the # situations where additional linker options are needed (such as when # doing 32-bit compilation for a host where ld defaults to 64-bit, or # vice versa); the common cases where no linker options are needed do # not appear in the list. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `$FILECMD conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*|x86_64-gnu*) case `$FILECMD conftest.o` in *x86-64*) LD="${LD-ld} -m elf32_x86_64" ;; *) LD="${LD-ld} -m elf_i386" ;; esac ;; powerpc64le-*linux*) LD="${LD-ld} -m elf32lppclinux" ;; powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*|x86_64-gnu*) LD="${LD-ld} -m elf_x86_64" ;; powerpcle-*linux*) LD="${LD-ld} -m elf64lppc" ;; powerpc-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS=$CFLAGS CFLAGS="$CFLAGS -belf" AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, [AC_LANG_PUSH(C) AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) AC_LANG_POP]) if test yes != "$lt_cv_cc_needs_belf"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS=$SAVE_CFLAGS fi ;; *-*solaris*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `$FILECMD conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) case $host in i?86-*-solaris*|x86_64-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) LD="${LD-ld} -m elf64_sparc" ;; esac # GNU ld 2.21 introduced _sol2 emulations. Use them if available. if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then LD=${LD-ld}_sol2 fi ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks=$enable_libtool_lock ])# _LT_ENABLE_LOCK # _LT_PROG_AR # ----------- m4_defun([_LT_PROG_AR], [AC_CHECK_TOOLS(AR, [ar], false) : ${AR=ar} _LT_DECL([], [AR], [1], [The archiver]) # Use ARFLAGS variable as AR's operation code to sync the variable naming with # Automake. If both AR_FLAGS and ARFLAGS are specified, AR_FLAGS should have # higher priority because that's what people were doing historically (setting # ARFLAGS for automake and AR_FLAGS for libtool). FIXME: Make the AR_FLAGS # variable obsoleted/removed. test ${AR_FLAGS+y} || AR_FLAGS=${ARFLAGS-cr} lt_ar_flags=$AR_FLAGS _LT_DECL([], [lt_ar_flags], [0], [Flags to create an archive (by configure)]) # Make AR_FLAGS overridable by 'make ARFLAGS='. Don't try to run-time override # by AR_FLAGS because that was never working and AR_FLAGS is about to die. _LT_DECL([], [AR_FLAGS], [\@S|@{ARFLAGS-"\@S|@lt_ar_flags"}], [Flags to create an archive]) AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file], [lt_cv_ar_at_file=no AC_COMPILE_IFELSE([AC_LANG_PROGRAM], [echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD' AC_TRY_EVAL([lt_ar_try]) if test 0 -eq "$ac_status"; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a AC_TRY_EVAL([lt_ar_try]) if test 0 -ne "$ac_status"; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a ]) ]) if test no = "$lt_cv_ar_at_file"; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file fi _LT_DECL([], [archiver_list_spec], [1], [How to feed a file listing to the archiver]) ])# _LT_PROG_AR # _LT_CMD_OLD_ARCHIVE # ------------------- m4_defun([_LT_CMD_OLD_ARCHIVE], [_LT_PROG_AR AC_CHECK_TOOL(STRIP, strip, :) test -z "$STRIP" && STRIP=: _LT_DECL([], [STRIP], [1], [A symbol stripping program]) AC_REQUIRE([AC_PROG_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 old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in darwin*) lock_old_archive_extraction=yes ;; *) lock_old_archive_extraction=no ;; esac _LT_DECL([], [old_postinstall_cmds], [2]) _LT_DECL([], [old_postuninstall_cmds], [2]) _LT_TAGDECL([], [old_archive_cmds], [2], [Commands used to build an old-style archive]) _LT_DECL([], [lock_old_archive_extraction], [0], [Whether to use a lock for old archive extraction]) ])# _LT_CMD_OLD_ARCHIVE # _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------------------- # Check whether the given compiler option works AC_DEFUN([_LT_COMPILER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$3" ## exclude from sc_useless_quotes_in_assignment # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi fi $RM conftest* ]) if test yes = "[$]$2"; then m4_if([$5], , :, [$5]) else m4_if([$6], , :, [$6]) fi ])# _LT_COMPILER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], []) # _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------- # Check whether the given linker option works AC_DEFUN([_LT_LINKER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS $3" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&AS_MESSAGE_LOG_FD $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi else $2=yes fi fi $RM -r conftest* LDFLAGS=$save_LDFLAGS ]) if test yes = "[$]$2"; then m4_if([$4], , :, [$4]) else m4_if([$5], , :, [$5]) fi ])# _LT_LINKER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], []) # LT_CMD_MAX_LEN #--------------- AC_DEFUN([LT_CMD_MAX_LEN], [AC_REQUIRE([AC_CANONICAL_HOST])dnl # find the maximum length of command line arguments AC_MSG_CHECKING([the maximum length of command line arguments]) AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl i=0 teststring=ABCD case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu* | ironclad*) # Under GNU Hurd and Ironclad, 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* | windows* | 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; ;; darwin* | dragonfly* | freebsd* | midnightbsd* | netbsd* | openbsd*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; os2*) # The test takes a long time on OS/2. lt_cv_sys_max_cmd_len=8192 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | $SED 's/.*[[ ]]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len" && \ test undefined != "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test X`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test 17 != "$i" # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac ]) if test -n "$lt_cv_sys_max_cmd_len"; then AC_MSG_RESULT($lt_cv_sys_max_cmd_len) else AC_MSG_RESULT(none) fi max_cmd_len=$lt_cv_sys_max_cmd_len _LT_DECL([], [max_cmd_len], [0], [What is the maximum length of a command?]) ])# LT_CMD_MAX_LEN # Old name: AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], []) # _LT_HEADER_DLFCN # ---------------- m4_defun([_LT_HEADER_DLFCN], [AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl ])# _LT_HEADER_DLFCN # _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, # ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) # ---------------------------------------------------------------- m4_defun([_LT_TRY_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test yes = "$cross_compiling"; then : [$4] else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF [#line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisibility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord (void) __attribute__((visibility("default"))); #endif int fnord (void) { return 42; } int main (void) { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; }] _LT_EOF if AC_TRY_EVAL(ac_link) && test -s "conftest$ac_exeext" 2>/dev/null; then (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) $1 ;; x$lt_dlneed_uscore) $2 ;; x$lt_dlunknown|x*) $3 ;; esac else : # compilation failed $3 fi fi rm -fr conftest* ])# _LT_TRY_DLOPEN_SELF # LT_SYS_DLOPEN_SELF # ------------------ AC_DEFUN([LT_SYS_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test yes != "$enable_dlopen"; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen=load_add_on lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | windows* | pw32* | cegcc*) lt_cv_dlopen=LoadLibrary lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen=dlopen lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl],[ lt_cv_dlopen=dyld lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ]) ;; tpf*) # Don't try to run any link tests for TPF. We know it's impossible # because TPF is a cross-compiler, and we know how we open DSOs. lt_cv_dlopen=dlopen lt_cv_dlopen_libs= lt_cv_dlopen_self=no ;; *) AC_CHECK_FUNC([shl_load], [lt_cv_dlopen=shl_load], [AC_CHECK_LIB([dld], [shl_load], [lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld], [AC_CHECK_FUNC([dlopen], [lt_cv_dlopen=dlopen], [AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl], [AC_CHECK_LIB([svld], [dlopen], [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld], [AC_CHECK_LIB([dld], [dld_link], [lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld]) ]) ]) ]) ]) ]) ;; esac if test no = "$lt_cv_dlopen"; then enable_dlopen=no else enable_dlopen=yes fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS=$CPPFLAGS test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS=$LDFLAGS wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS=$LIBS LIBS="$lt_cv_dlopen_libs $LIBS" AC_CACHE_CHECK([whether a program can dlopen itself], lt_cv_dlopen_self, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) ]) if test yes = "$lt_cv_dlopen_self"; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" AC_CACHE_CHECK([whether a statically linked program can dlopen itself], lt_cv_dlopen_self_static, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) ]) fi CPPFLAGS=$save_CPPFLAGS LDFLAGS=$save_LDFLAGS LIBS=$save_LIBS ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi _LT_DECL([dlopen_support], [enable_dlopen], [0], [Whether dlopen is supported]) _LT_DECL([dlopen_self], [enable_dlopen_self], [0], [Whether dlopen of programs is supported]) _LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0], [Whether dlopen of statically linked programs is supported]) ])# LT_SYS_DLOPEN_SELF # Old name: AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], []) # _LT_COMPILER_C_O([TAGNAME]) # --------------------------- # Check to see if options -c and -o are simultaneously supported by compiler. # This macro does not hard code the compiler like AC_PROG_CC_C_O. m4_defun([_LT_COMPILER_C_O], [m4_require([_LT_DECL_SED])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes fi fi chmod u+w . 2>&AS_MESSAGE_LOG_FD $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* ]) _LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1], [Does compiler simultaneously support -c and -o options?]) ])# _LT_COMPILER_C_O # _LT_COMPILER_FILE_LOCKS([TAGNAME]) # ---------------------------------- # Check to see if we can do hard links to lock some files if needed m4_defun([_LT_COMPILER_FILE_LOCKS], [m4_require([_LT_ENABLE_LOCK])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_COMPILER_C_O([$1]) hard_links=nottested if test no = "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" && test no != "$need_locks"; then # do not overwrite the value of need_locks provided by the user AC_MSG_CHECKING([if we can lock with hard links]) hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no AC_MSG_RESULT([$hard_links]) if test no = "$hard_links"; then AC_MSG_WARN(['$CC' does not support '-c -o', so 'make -j' may be unsafe]) need_locks=warn fi else need_locks=no fi _LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?]) ])# _LT_COMPILER_FILE_LOCKS # _LT_CHECK_OBJDIR # ---------------- m4_defun([_LT_CHECK_OBJDIR], [AC_CACHE_CHECK([for objdir], [lt_cv_objdir], [rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null]) objdir=$lt_cv_objdir _LT_DECL([], [objdir], [0], [The name of the directory that contains temporary libtool files])dnl m4_pattern_allow([LT_OBJDIR])dnl AC_DEFINE_UNQUOTED([LT_OBJDIR], "$lt_cv_objdir/", [Define to the sub-directory where libtool stores uninstalled libraries.]) ])# _LT_CHECK_OBJDIR # _LT_LINKER_HARDCODE_LIBPATH([TAGNAME]) # -------------------------------------- # Check hardcoding attributes. m4_defun([_LT_LINKER_HARDCODE_LIBPATH], [AC_MSG_CHECKING([how to hardcode library paths into programs]) _LT_TAGVAR(hardcode_action, $1)= if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" || test -n "$_LT_TAGVAR(runpath_var, $1)" || test yes = "$_LT_TAGVAR(hardcode_automatic, $1)"; then # We can hardcode non-existent directories. if test no != "$_LT_TAGVAR(hardcode_direct, $1)" && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" && test no != "$_LT_TAGVAR(hardcode_minus_L, $1)"; then # Linking always hardcodes the temporary library directory. _LT_TAGVAR(hardcode_action, $1)=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. _LT_TAGVAR(hardcode_action, $1)=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. _LT_TAGVAR(hardcode_action, $1)=unsupported fi AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)]) if test relink = "$_LT_TAGVAR(hardcode_action, $1)" || test yes = "$_LT_TAGVAR(inherit_rpath, $1)"; then # Fast installation is not supported enable_fast_install=no elif test yes = "$shlibpath_overrides_runpath" || test no = "$enable_shared"; then # Fast installation is not necessary enable_fast_install=needless fi _LT_TAGDECL([], [hardcode_action], [0], [How to hardcode a shared library path into an executable]) ])# _LT_LINKER_HARDCODE_LIBPATH # _LT_CMD_STRIPLIB # ---------------- m4_defun([_LT_CMD_STRIPLIB], [m4_require([_LT_DECL_EGREP]) striplib= old_striplib= AC_MSG_CHECKING([whether stripping libraries is possible]) if test -z "$STRIP"; then AC_MSG_RESULT([no]) else if $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then old_striplib="$STRIP --strip-debug" striplib="$STRIP --strip-unneeded" AC_MSG_RESULT([yes]) else case $host_os in darwin*) # FIXME - insert some real tests, host_os isn't really good enough striplib="$STRIP -x" old_striplib="$STRIP -S" AC_MSG_RESULT([yes]) ;; freebsd*) if $STRIP -V 2>&1 | $GREP "elftoolchain" >/dev/null; then old_striplib="$STRIP --strip-debug" striplib="$STRIP --strip-unneeded" AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi ;; *) AC_MSG_RESULT([no]) ;; esac fi fi _LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) _LT_DECL([], [striplib], [1]) ])# _LT_CMD_STRIPLIB # _LT_PREPARE_MUNGE_PATH_LIST # --------------------------- # Make sure func_munge_path_list() is defined correctly. m4_defun([_LT_PREPARE_MUNGE_PATH_LIST], [[# func_munge_path_list VARIABLE PATH # ----------------------------------- # VARIABLE is name of variable containing _space_ separated list of # directories to be munged by the contents of PATH, which is string # having a format: # "DIR[:DIR]:" # string "DIR[ DIR]" will be prepended to VARIABLE # ":DIR[:DIR]" # string "DIR[ DIR]" will be appended to VARIABLE # "DIRP[:DIRP]::[DIRA:]DIRA" # string "DIRP[ DIRP]" will be prepended to VARIABLE and string # "DIRA[ DIRA]" will be appended to VARIABLE # "DIR[:DIR]" # VARIABLE will be replaced by "DIR[ DIR]" func_munge_path_list () { case x@S|@2 in x) ;; *:) eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'` \@S|@@S|@1\" ;; x:*) eval @S|@1=\"\@S|@@S|@1 `$ECHO @S|@2 | $SED 's/:/ /g'`\" ;; *::*) eval @S|@1=\"\@S|@@S|@1\ `$ECHO @S|@2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" eval @S|@1=\"`$ECHO @S|@2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \@S|@@S|@1\" ;; *) eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'`\" ;; esac } ]])# _LT_PREPARE_PATH_LIST # _LT_SYS_DYNAMIC_LINKER([TAG]) # ----------------------------- # PORTME Fill in your ld.so characteristics m4_defun([_LT_SYS_DYNAMIC_LINKER], [AC_REQUIRE([AC_CANONICAL_HOST])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_OBJDUMP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl m4_require([_LT_PREPARE_MUNGE_PATH_LIST])dnl AC_MSG_CHECKING([dynamic linker characteristics]) m4_if([$1], [], [ if test yes = "$GCC"; then case $host_os in darwin*) lt_awk_arg='/^libraries:/,/LR/' ;; *) lt_awk_arg='/^libraries:/' ;; esac case $host_os in mingw* | windows* | cegcc*) lt_sed_strip_eq='s|=\([[A-Za-z]]:\)|\1|g' ;; *) lt_sed_strip_eq='s|=/|/|g' ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in *\;*) # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` ;; *) lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` ;; esac # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary... lt_tmp_lt_search_path_spec= lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` # ...but if some path component already ends with the multilib dir we assume # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer). case "$lt_multi_os_dir; $lt_search_path_spec " in "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*) lt_multi_os_dir= ;; esac for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir" elif test -n "$lt_multi_os_dir"; then test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS = " "; FS = "/|\n";} { lt_foo = ""; lt_count = 0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo = "/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[[lt_foo]]++; } if (lt_freq[[lt_foo]] == 1) { print lt_foo; } }'` # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in mingw* | windows* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's|/\([[A-Za-z]]:\)|\1|g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi]) library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=.so postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown AC_ARG_VAR([LT_SYS_LIBRARY_PATH], [User-defined run-time library search path.]) case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='$libname$release$shared_ext$major' ;; aix[[4-9]]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test ia64 = "$host_cpu"; then # AIX 5 supports IA64 library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line '#! .'. This would cause the generated library to # depend on '.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[[01]] | aix4.[[01]].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # Using Import Files as archive members, it is possible to support # filename-based versioning of shared library archives on AIX. While # this would work for both with and without runtime linking, it will # prevent static linking of such archives. So we do filename-based # shared library versioning with .so extension only, which is used # when both runtime linking and shared linking is enabled. # Unfortunately, runtime linking may impact performance, so we do # not want this to be the default eventually. Also, we use the # versioned .so libs for executables only if there is the -brtl # linker flag in LDFLAGS as well, or --enable-aix-soname=svr4 only. # To allow for filename-based versioning support, we need to create # libNAME.so.V as an archive file, containing: # *) an Import File, referring to the versioned filename of the # archive as well as the shared archive member, telling the # bitwidth (32 or 64) of that shared object, and providing the # list of exported symbols of that shared object, eventually # decorated with the 'weak' keyword # *) the shared object with the F_LOADONLY flag set, to really avoid # it being seen by the linker. # At run time we better use the real file rather than another symlink, # but for link time we create the symlink libNAME.so -> libNAME.so.V case $with_aix_soname,$aix_use_runtimelinking in # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. aix,yes) # traditional libtool dynamic_linker='AIX unversionable lib.so' # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; aix,no) # traditional AIX only dynamic_linker='AIX lib.a[(]lib.so.V[)]' # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' ;; svr4,*) # full svr4 only dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)]" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,yes) # both, prefer svr4 dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)], lib.a[(]lib.so.V[)]" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # unpreferred sharedlib libNAME.a needs extra handling postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,no) # both, prefer aix dynamic_linker="AIX lib.a[(]lib.so.V[)], lib.so.V[(]$shared_archive_member_spec.o[)]" library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' ;; esac shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='$libname$shared_ext' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[[45]]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | windows* | 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 # If user builds GCC with multilib enabled, # it should just install on $(libdir) # not on $(libdir)/../bin or 32 bits dlls would override 64 bit ones. if test xyes = x"$multilib"; then postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ $install_prog $dir/$dlname $destdir/$dlname~ chmod a+x $destdir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib $destdir/$dlname'\'' || exit \$?; fi' else 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' 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* | windows* | 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* | *,icl*) # Native MSVC or ICC 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* | windows*) 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 and ICC 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* | midnightbsd*) # 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$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' need_version=yes ;; esac case $host_cpu in powerpc64) # On FreeBSD bi-arch platforms, a different variable is used for 32-bit # binaries. See . AC_COMPILE_IFELSE( [AC_LANG_SOURCE( [[int test_pointer_size[sizeof (void *) - 5]; ]])], [shlibpath_var=LD_LIBRARY_PATH], [shlibpath_var=LD_32_LIBRARY_PATH]) ;; *) shlibpath_var=LD_LIBRARY_PATH ;; esac case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[[01]]* | freebsdelf3.[[01]]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec='/boot/system/non-packaged/develop/lib /boot/system/develop/lib' sys_lib_dlsearch_path_spec='/boot/home/config/non-packaged/lib /boot/home/config/lib /boot/system/non-packaged/lib /boot/system/lib' hardcode_into_libs=no ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' if test 32 = "$HPUX_IA64_MODE"; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" sys_lib_dlsearch_path_spec=/usr/lib/hpux32 else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" sys_lib_dlsearch_path_spec=/usr/lib/hpux64 fi ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[[3-9]]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test yes = "$lt_cv_prog_gnu_ld"; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='$libname$release$shared_ext$major' library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff" sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; linux*android*) version_type=none # Android doesn't support versioned libraries. need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext $libname$shared_ext' soname_spec='$libname$release$shared_ext' finish_cmds= shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes dynamic_linker='Android linker' # -rpath works at least for libraries that are not overridden by # libraries installed in system locations. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath], [lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], [lt_cv_shlibpath_overrides_runpath=yes])]) LDFLAGS=$save_LDFLAGS libdir=$save_libdir ]) shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Ideally, we could use ldconfig to report *all* directories which are # searched for libraries, however this is still not possible. Aside from not # being certain /sbin/ldconfig is available, command # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, # even though it is searched at run-time. Try to do the best guess by # appending ld.so.conf contents (and includes) to the search path. if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; 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' ;; 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 ;; *-mlibc) 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='mlibc ld.so' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no 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 if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then need_version=no else need_version=yes fi library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; os2*) libname_spec='$name' version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no # OS/2 can only load a DLL with a base name of 8 characters or less. soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; v=$($ECHO $release$versuffix | tr -d .-); n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); $ECHO $n$v`$shared_ext' library_names_spec='${libname}_dll.$libext' dynamic_linker='OS/2 ld.exe' shlibpath_var=BEGINLIBPATH sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='$libname$release$shared_ext$major' library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; rdos*) dynamic_linker=no ;; serenity*) 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=no dynamic_linker='SerenityOS LibELF' ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test yes = "$with_gnu_ld"; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec; then version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext' soname_spec='$libname$shared_ext.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=sco need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test yes = "$with_gnu_ld"; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; emscripten*) version_type=none need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext' soname_spec='$libname$release$shared_ext' finish_cmds= dynamic_linker="Emscripten linker" _LT_COMPILER_PIC($1)='-fPIC' _LT_TAGVAR(archive_cmds, $1)='$CC -sSIDE_MODULE=2 -shared $libobjs $deplibs $compiler_flags -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$SED "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -sSIDE_MODULE=2 -shared $libobjs $deplibs $compiler_flags -o $lib -s EXPORTED_FUNCTIONS=@$output_objdir/$soname.expsym' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(no_undefined_flag, $1)= ;; *) dynamic_linker=no ;; esac AC_MSG_RESULT([$dynamic_linker]) test no = "$dynamic_linker" && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test yes = "$GCC"; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec fi if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec fi # remember unaugmented sys_lib_dlsearch_path content for libtool script decls... configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec # ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" # to be used as default LT_SYS_LIBRARY_PATH value in generated libtool configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH _LT_DECL([], [variables_saved_for_relink], [1], [Variables whose values should be saved in libtool wrapper scripts and restored at link time]) _LT_DECL([], [need_lib_prefix], [0], [Do we need the "lib" prefix for modules?]) _LT_DECL([], [need_version], [0], [Do we need a version for libraries?]) _LT_DECL([], [version_type], [0], [Library versioning type]) _LT_DECL([], [runpath_var], [0], [Shared library runtime path variable]) _LT_DECL([], [shlibpath_var], [0],[Shared library path variable]) _LT_DECL([], [shlibpath_overrides_runpath], [0], [Is shlibpath searched before the hard-coded library search path?]) _LT_DECL([], [libname_spec], [1], [Format of library name prefix]) _LT_DECL([], [library_names_spec], [1], [[List of archive names. First name is the real one, the rest are links. The last name is the one that the linker finds with -lNAME]]) _LT_DECL([], [soname_spec], [1], [[The coded name of the library, if different from the real name]]) _LT_DECL([], [install_override_mode], [1], [Permission mode override for installation of shared libraries]) _LT_DECL([], [postinstall_cmds], [2], [Command to use after installation of a shared archive]) _LT_DECL([], [postuninstall_cmds], [2], [Command to use after uninstallation of a shared archive]) _LT_DECL([], [finish_cmds], [2], [Commands used to finish a libtool library installation in a directory]) _LT_DECL([], [finish_eval], [1], [[As "finish_cmds", except a single script fragment to be evaled but not shown]]) _LT_DECL([], [hardcode_into_libs], [0], [Whether we should hardcode library paths into libraries]) _LT_DECL([], [sys_lib_search_path_spec], [2], [Compile-time system search path for libraries]) _LT_DECL([sys_lib_dlsearch_path_spec], [configure_time_dlsearch_path], [2], [Detected run-time system search path for libraries]) _LT_DECL([], [configure_time_lt_sys_library_path], [2], [Explicit LT_SYS_LIBRARY_PATH set during ./configure time]) ])# _LT_SYS_DYNAMIC_LINKER # _LT_PATH_TOOL_PREFIX(TOOL) # -------------------------- # find a file program that can recognize shared library AC_DEFUN([_LT_PATH_TOOL_PREFIX], [m4_require([_LT_DECL_EGREP])dnl AC_MSG_CHECKING([for $1]) AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, [case $MAGIC_CMD in [[\\/*] | ?:[\\/]*]) lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD=$MAGIC_CMD lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR dnl $ac_dummy forces splitting on constant user-supplied paths. dnl POSIX.2 word splitting is done only on the output of word expansions, dnl not every word. This closes a longstanding sh security hole. ac_dummy="m4_if([$2], , $PATH, [$2])" for ac_dir in $ac_dummy; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$1"; then lt_cv_path_MAGIC_CMD=$ac_dir/"$1" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD=$lt_cv_path_MAGIC_CMD if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS=$lt_save_ifs MAGIC_CMD=$lt_save_MAGIC_CMD ;; esac]) MAGIC_CMD=$lt_cv_path_MAGIC_CMD if test -n "$MAGIC_CMD"; then AC_MSG_RESULT($MAGIC_CMD) else AC_MSG_RESULT(no) fi _LT_DECL([], [MAGIC_CMD], [0], [Used to examine libraries when file_magic_cmd begins with "file"])dnl ])# _LT_PATH_TOOL_PREFIX # Old name: AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], []) # _LT_PATH_MAGIC # -------------- # find a file program that can recognize a shared library m4_defun([_LT_PATH_MAGIC], [_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) else MAGIC_CMD=: fi fi ])# _LT_PATH_MAGIC # LT_PATH_LD # ---------- # find the pathname to the GNU or non-GNU linker AC_DEFUN([LT_PATH_LD], [AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_PROG_ECHO_BACKSLASH])dnl AC_ARG_WITH([gnu-ld], [AS_HELP_STRING([--with-gnu-ld], [assume the C compiler uses GNU ld @<:@default=no@:>@])], [test no = "$withval" || with_gnu_ld=yes], [with_gnu_ld=no])dnl ac_prog=ld if test yes = "$GCC"; then # Check if gcc -print-prog-name=ld gives a path. AC_MSG_CHECKING([for ld used by $CC]) case $host in *-*-mingw* | *-*-windows*) # gcc leaves a trailing carriage return, which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [[\\/]]* | ?:[[\\/]]*) re_direlt='/[[^/]][[^/]]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD=$ac_prog ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test yes = "$with_gnu_ld"; then AC_MSG_CHECKING([for GNU ld]) else AC_MSG_CHECKING([for non-GNU ld]) fi AC_CACHE_VAL(lt_cv_path_LD, [if test -z "$LD"; then lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD=$ac_dir/$ac_prog # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &1 conftest.i cat conftest.i conftest.i >conftest2.i : ${lt_DD:=$DD} AC_PATH_PROGS_FEATURE_CHECK([lt_DD], [dd], [if "$ac_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=: fi]) rm -f conftest.i conftest2.i conftest.out]) ])# _LT_PATH_DD # _LT_CMD_TRUNCATE # ---------------- # find command to truncate a binary pipe m4_defun([_LT_CMD_TRUNCATE], [m4_require([_LT_PATH_DD]) AC_CACHE_CHECK([how to truncate binary pipes], [lt_cv_truncate_bin], [printf 0123456789abcdef0123456789abcdef >conftest.i cat conftest.i conftest.i >conftest2.i lt_cv_truncate_bin= if "$ac_cv_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1" fi rm -f conftest.i conftest2.i conftest.out test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q"]) _LT_DECL([lt_truncate_bin], [lt_cv_truncate_bin], [1], [Command to truncate a binary pipe]) ])# _LT_CMD_TRUNCATE # _LT_CHECK_MAGIC_METHOD # ---------------------- # how to check for library dependencies # -- PORTME fill in with the dynamic library characteristics m4_defun([_LT_CHECK_MAGIC_METHOD], [m4_require([_LT_DECL_EGREP]) m4_require([_LT_DECL_OBJDUMP]) AC_CACHE_CHECK([how to recognize dependent libraries], lt_cv_deplibs_check_method, [lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. # 'unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'file_magic [[regex]]' -- check by looking for files in library path # that responds to the $file_magic_cmd with a given extended regex. # If you have 'file' or equivalent on your system and you're not sure # whether 'pass_all' will *always* work, you probably want this one. case $host_os in aix[[4-9]]*) lt_cv_deplibs_check_method=pass_all ;; beos*) lt_cv_deplibs_check_method=pass_all ;; bsdi[[45]]*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)' lt_cv_file_magic_cmd='$FILECMD -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* | windows* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. if ( file / ) >/dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64|pe-aarch64)' 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* | midnightbsd*) 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=$FILECMD 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=$FILECMD 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 ;; *-mlibc) 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=$FILECMD 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__`"; 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 ;; serenity*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; os2*) lt_cv_deplibs_check_method=pass_all ;; esac ]) file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in mingw* | windows* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"` fi ;; esac fi file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown _LT_DECL([], [deplibs_check_method], [1], [Method to check whether dependent libraries are shared objects]) _LT_DECL([], [file_magic_cmd], [1], [Command to use when deplibs_check_method = "file_magic"]) _LT_DECL([], [file_magic_glob], [1], [How to find potential files when deplibs_check_method = "file_magic"]) _LT_DECL([], [want_nocaseglob], [1], [Find potential files using nocaseglob when deplibs_check_method = "file_magic"]) ])# _LT_CHECK_MAGIC_METHOD # LT_PATH_NM # ---------- # find the pathname to a BSD- or MS-compatible name lister AC_DEFUN([LT_PATH_NM], [AC_REQUIRE([AC_PROG_CC])dnl AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM, [if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM=$NM else lt_nm_to_check=${ac_tool_prefix}nm if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. tmp_nm=$ac_dir/$lt_tmp_nm if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then # Check to see if the nm accepts a BSD-compat flag. # Adding the 'sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file # MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty case $build_os in mingw* | windows*) lt_bad_file=conftest.nm/nofile ;; *) lt_bad_file=/dev/null ;; esac case `"$tmp_nm" -B $lt_bad_file 2>&1 | $SED '1q'` in *$lt_bad_file* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break 2 ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | $SED '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break 2 ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS=$lt_save_ifs done : ${lt_cv_path_NM=no} fi]) if test no != "$lt_cv_path_NM"; then NM=$lt_cv_path_NM else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :) case `$DUMPBIN -symbols -headers /dev/null 2>&1 | $SED '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols -headers" ;; *) DUMPBIN=: ;; esac fi AC_SUBST([DUMPBIN]) if test : != "$DUMPBIN"; then NM=$DUMPBIN fi fi test -z "$NM" && NM=nm AC_SUBST([NM]) _LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface], [lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD) cat conftest.out >&AS_MESSAGE_LOG_FD if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest*]) ])# LT_PATH_NM # Old names: AU_ALIAS([AM_PROG_NM], [LT_PATH_NM]) AU_ALIAS([AC_PROG_NM], [LT_PATH_NM]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_PROG_NM], []) dnl AC_DEFUN([AC_PROG_NM], []) # _LT_CHECK_SHAREDLIB_FROM_LINKLIB # -------------------------------- # how to determine the name of the shared library # associated with a specific link library. # -- PORTME fill in with the dynamic library characteristics m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB], [m4_require([_LT_DECL_EGREP]) m4_require([_LT_DECL_OBJDUMP]) m4_require([_LT_DECL_DLLTOOL]) AC_CACHE_CHECK([how to associate runtime and link libraries], lt_cv_sharedlib_from_linklib_cmd, [lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in cygwin* | mingw* | windows* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh; # decide which one to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ;; *) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ;; esac ;; *) # fallback: assume linklib IS sharedlib lt_cv_sharedlib_from_linklib_cmd=$ECHO ;; esac ]) sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO _LT_DECL([], [sharedlib_from_linklib_cmd], [1], [Command to associate shared and link libraries]) ])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB # _LT_PATH_MANIFEST_TOOL # ---------------------- # locate the manifest tool m4_defun([_LT_PATH_MANIFEST_TOOL], [AC_CHECK_TOOL(MANIFEST_TOOL, mt, :) test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_manifest_tool], [lt_cv_path_manifest_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_manifest_tool=yes fi rm -f conftest*]) if test yes != "$lt_cv_path_manifest_tool"; then MANIFEST_TOOL=: fi _LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl ])# _LT_PATH_MANIFEST_TOOL # _LT_DLL_DEF_P([FILE]) # --------------------- # True iff FILE is a Windows DLL '.def' file. # Keep in sync with func_dll_def_p in the libtool script AC_DEFUN([_LT_DLL_DEF_P], [dnl test DEF = "`$SED -n dnl -e '\''s/^[[ ]]*//'\'' dnl Strip leading whitespace -e '\''/^\(;.*\)*$/d'\'' dnl Delete empty lines and comments -e '\''s/^\(EXPORTS\|LIBRARY\)\([[ ]].*\)*$/DEF/p'\'' dnl -e q dnl Only consider the first "real" line $1`" dnl ])# _LT_DLL_DEF_P # LT_LIB_M # -------- # check for math library AC_DEFUN([LT_LIB_M], [AC_REQUIRE([AC_CANONICAL_HOST])dnl LIBM= case $host in *-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-mingw* | *-*-pw32* | *-*-darwin*) # These system don't have libm, or don't need it ;; *-ncr-sysv4.3*) AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM=-lmw) AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") ;; *) AC_CHECK_LIB(m, cos, LIBM=-lm) ;; esac AC_SUBST([LIBM]) ])# LT_LIB_M # Old name: AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_CHECK_LIBM], []) # _LT_COMPILER_NO_RTTI([TAGNAME]) # ------------------------------- m4_defun([_LT_COMPILER_NO_RTTI], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= if test yes = "$GCC"; then case $cc_basename in nvcc*) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;; *) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;; esac _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], lt_cv_prog_compiler_rtti_exceptions, [-fno-rtti -fno-exceptions], [], [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) fi _LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1], [Compiler flag to turn off builtin functions]) ])# _LT_COMPILER_NO_RTTI # _LT_CMD_GLOBAL_SYMBOLS # ---------------------- m4_defun([_LT_CMD_GLOBAL_SYMBOLS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([LT_PATH_NM])dnl AC_REQUIRE([LT_PATH_LD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_TAG_COMPILER])dnl # Check for command to grab the raw symbol name followed by C symbol from nm. AC_MSG_CHECKING([command to parse $NM output from $compiler object]) AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], [ # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[[BCDEGRST]]' # Regexp to match symbols that can be accessed directly from C. sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[[BCDT]]' ;; cygwin* | mingw* | windows* | pw32* | cegcc*) symcode='[[ABCDGISTW]]' ;; hpux*) if test ia64 = "$host_cpu"; then symcode='[[ABCDEGRST]]' fi ;; irix* | nonstopux*) symcode='[[BCDEGRST]]' ;; osf*) symcode='[[BCDEGQRST]]' ;; solaris*) symcode='[[BCDRT]]' ;; sco3.2v5*) symcode='[[DT]]' ;; sysv4.2uw2*) symcode='[[DT]]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[[ABDT]]' ;; sysv4) symcode='[[DFNSTU]]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[[ABCDGIRSTW]]' ;; esac if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Gets list of data symbols to import. lt_cv_sys_global_symbol_to_import="$SED -n -e 's/^I .* \(.*\)$/\1/p'" # Adjust the below global symbol transforms to fixup imported variables. lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'" lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'" lt_c_name_lib_hook="\ -e 's/^I .* \(lib.*\)$/ {\"\1\", (void *) 0},/p'\ -e 's/^I .* \(.*\)$/ {\"lib\1\", (void *) 0},/p'" else # Disable hooks by default. lt_cv_sys_global_symbol_to_import= lt_cdecl_hook= lt_c_name_hook= lt_c_name_lib_hook= fi # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="$SED -n"\ $lt_cdecl_hook\ " -e 's/^T .* \(.*\)$/extern int \1();/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="$SED -n"\ $lt_c_name_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'" # Transform an extracted symbol line into symbol name with lib prefix and # symbol address. lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="$SED -n"\ $lt_c_name_lib_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"lib\1\", (void *) \&\1},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw* | windows*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function, # D for any global variable and I for any imported variable. # Also find C++ and __fastcall symbols from MSVC++ or ICC, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK ['"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\ " /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\ " /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\ " {split(\$ 0,a,/\||\r/); split(a[2],s)};"\ " s[1]~/^[@?]/{print f,s[1],s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx]" else lt_cv_sys_global_symbol_pipe="$SED -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | $SED '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(void){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 $ECHO "$as_me:$LINENO: $NM conftest.$ac_objext | $lt_cv_sys_global_symbol_pipe > $nlist" >&AS_MESSAGE_LOG_FD if eval "$NM" conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist 2>&AS_MESSAGE_LOG_FD && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE /* DATA imports from DLLs on WIN32 can't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT@&t@_DLSYM_CONST #elif defined __osf__ /* This system does not cope well with relocations in const data. */ # define LT@&t@_DLSYM_CONST #else # define LT@&t@_DLSYM_CONST const #endif #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ LT@&t@_DLSYM_CONST struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[[]] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS LIBS=conftstm.$ac_objext CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" if AC_TRY_EVAL(ac_link) && test -s conftest$ac_exeext; then pipe_works=yes fi LIBS=$lt_globsym_save_LIBS CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD fi else echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test yes = "$pipe_works"; then break else lt_cv_sys_global_symbol_pipe= fi done ]) if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then AC_MSG_RESULT(failed) else AC_MSG_RESULT(ok) fi # Response file support. if test "$lt_cv_nm_interface" = "MS dumpbin"; then nm_file_list_spec='@' elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then nm_file_list_spec='@' fi _LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1], [Take the output of nm and produce a listing of raw symbols and C names]) _LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1], [Transform the output of nm in a proper C declaration]) _LT_DECL([global_symbol_to_import], [lt_cv_sys_global_symbol_to_import], [1], [Transform the output of nm into a list of symbols to manually relocate]) _LT_DECL([global_symbol_to_c_name_address], [lt_cv_sys_global_symbol_to_c_name_address], [1], [Transform the output of nm in a C name address pair]) _LT_DECL([global_symbol_to_c_name_address_lib_prefix], [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1], [Transform the output of nm in a C name address pair when lib prefix is needed]) _LT_DECL([nm_interface], [lt_cv_nm_interface], [1], [The name lister interface]) _LT_DECL([], [nm_file_list_spec], [1], [Specify filename containing input files for $NM]) ]) # _LT_CMD_GLOBAL_SYMBOLS # _LT_COMPILER_PIC([TAGNAME]) # --------------------------- m4_defun([_LT_COMPILER_PIC], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_wl, $1)= _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)= m4_if([$1], [CXX], [ # C++ specific cases for pic, static, wl, etc. if test yes = "$GXX"; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the '-m68020' flag to GCC prevents building anything better, # like '-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | windows* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) case $host_os in os2*) _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static' ;; esac ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. _LT_TAGVAR(lt_prog_compiler_static, $1)= ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac else case $host_os in aix[[4-9]]*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; esac ;; mingw* | windows* | 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* | midnightbsd*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive' if test ia64 != "$host_cpu"; then _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' fi ;; aCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac ;; *) ;; esac ;; interix*) # This is c89, which is MS Visual C++ (no shared libs) # Anyone wants to do a port? ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # KAI C++ Compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; ecpc* ) # old Intel C++ for x86_64, which still supported -KPIC. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; icpc* ) # Intel C++, used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; pgCC* | pgcpp*) # Portland Group C++ compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; cxx*) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL 8.0, 9.0 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | $SED 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; esac ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' ;; *) ;; esac ;; netbsd* | netbsdelf*-gnu) ;; *-mlibc) ;; *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*) ;; serenity*) ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; lcc*) # Lucid _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; *) ;; esac ;; vxworks*) ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ], [ if test yes = "$GCC"; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the '-m68020' flag to GCC prevents building anything better, # like '-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | windows* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) case $host_os in os2*) _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static' ;; esac ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. _LT_TAGVAR(lt_prog_compiler_static, $1)= ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker ' if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)" fi ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' case $cc_basename in nagfor*) # NAG Fortran compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; mingw* | windows* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) case $host_os in os2*) _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static' ;; esac ;; hpux9* | hpux10* | hpux11*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC (with -KPIC) is the default. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in # old Intel for x86_64, which still supported -KPIC. ecc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; *flang* | ftn | f18* | f95*) # Flang 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' ;; # flang / f18. f95 an alias for gfortran or flang on Debian flang* | f18* | f95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # Lahey Fortran 8.1. lf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared' _LT_TAGVAR(lt_prog_compiler_static, $1)='--static' ;; nagfor*) # NAG Fortran compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; tcc*) # Fabrice Bellard et al's Tiny C Compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; ccc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All Alpha code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | $SED 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='' ;; *Sun\ F* | *Sun*Fortran*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ;; *Intel*\ [[CF]]*Compiler*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; *Portland\ Group*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; esac ;; newsos6) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *-mlibc) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; *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' ;; serenity*) ;; solaris*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; *) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; esac ;; sunos4*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; unicos*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; uts4*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ]) case $host_os in # For platforms that do not support PIC, -DPIC is meaningless: *djgpp*) _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])" ;; esac AC_CACHE_CHECK([for $compiler option to produce PIC], [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) _LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1) # # Check to make sure the PIC flag actually works. # if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works], [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)], [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [], [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in "" | " "*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;; esac], [_LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) fi _LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1], [Additional compiler flags for building library objects]) _LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], [How to pass a linker flag through the compiler]) # # Check to make sure the static flag actually works. # wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\" _LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1), $lt_tmp_static_flag, [], [_LT_TAGVAR(lt_prog_compiler_static, $1)=]) _LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1], [Compiler flag to prevent dynamic linking]) ])# _LT_COMPILER_PIC # _LT_LINKER_SHLIBS([TAGNAME]) # ---------------------------- # See if the linker supports building shared libraries. m4_defun([_LT_LINKER_SHLIBS], [AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl m4_require([_LT_PATH_MANIFEST_TOOL])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) m4_if([$1], [CXX], [ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] case $host_os in aix[[4-9]]*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to GNU nm, but means don't demangle to AIX nm. # Without the "-l" option, or with the "-B" option, AIX nm treats # weak defined symbols like other global defined symbols, whereas # GNU nm marks them as "W". # While the 'weak' keyword is ignored in the Export File, we need # it in the Import File for the 'aix-soname' feature, so we have # to replace the "-B" option with "-P" for AIX nm. if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi ;; pw32*) _LT_TAGVAR(export_symbols_cmds, $1)=$ltdll_cmds ;; cygwin* | mingw* | windows* | cegcc*) case $cc_basename in cl* | icl*) _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* | windows* | pw32* | cegcc*) # FIXME: the MSVC++ and ICC port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++ or Intel C++ Compiler. if test yes != "$GCC"; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++ or ICC) with_gnu_ld=yes ;; 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 yes = "$with_gnu_ld"; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility # with the native linker. However, as the warning in the GNU ld # block says, versions before 2.19.5* couldn't really create working # shared libraries, regardless of the interface used. case `$LD -v 2>&1` in *\ \(GNU\ Binutils\)\ 2.19.5*) ;; *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;; *\ \(GNU\ Binutils\)\ [[3-9]]*) ;; *) lt_use_gnu_ld_interface=yes ;; esac ;; *) lt_use_gnu_ld_interface=yes ;; esac fi if test yes = "$lt_use_gnu_ld_interface"; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='$wl' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi supports_anon_versioning=no case `$LD -v | $SED -e 's/([[^)]]\+)\s\+//' 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[[3-9]]*) # On AIX/PPC, the GNU linker is very broken if test ia64 != "$host_cpu"; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; cygwin* | mingw* | windows* | 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'] _LT_TAGVAR(file_list_spec, $1)='@' if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file, use it as # is; otherwise, prepend EXPORTS... _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=no ;; os2*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported shrext_cmds=.dll _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$SED "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test linux-dietlibc = "$host_os"; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test no = "$tmp_diet" then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 _LT_TAGVAR(whole_archive_flag_spec, $1)= tmp_sharedflag='--shared' ;; nagfor*) # NAGFOR 5.3 tmp_sharedflag='-Wl,-shared' ;; xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes ;; esac case `$CC -V 2>&1 | $SED 5q` in *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' if test yes = "$supports_anon_versioning"; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi case $cc_basename in tcc*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='-rdynamic' ;; xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test yes = "$supports_anon_versioning"; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; *-mlibc) _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' ;; 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 cannot *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; sunos4*) _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac if test no = "$_LT_TAGVAR(ld_shlibs, $1)"; then runpath_var= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. _LT_TAGVAR(hardcode_minus_L, $1)=yes if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. _LT_TAGVAR(hardcode_direct, $1)=unsupported fi ;; aix[[4-9]]*) if test ia64 = "$host_cpu"; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag= else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to GNU nm, but means don't demangle to AIX nm. # Without the "-l" option, or with the "-B" option, AIX nm treats # weak defined symbols like other global defined symbols, whereas # GNU nm marks them as "W". # While the 'weak' keyword is ignored in the Export File, we need # it in the Import File for the 'aix-soname' feature, so we have # to replace the "-B" option with "-P" for AIX nm. if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # have runtime linking enabled, and use it for executables. # For shared libraries, we enable/disable runtime linking # depending on the kind of the shared library created - # when "with_aix_soname,aix_use_runtimelinking" is: # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables # "aix,yes" lib.so shared, rtl:yes, for executables # lib.a static archive # "both,no" lib.so.V(shr.o) shared, rtl:yes # lib.a(lib.so.V) shared, rtl:no, for executables # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a(lib.so.V) shared, rtl:no # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a static archive case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then aix_use_runtimelinking=yes break fi done if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then # With aix-soname=svr4, we create the lib.so.V shared archives only, # so we don't have lib.a shared libs to link our executables. # We have to force runtime linking in this case. aix_use_runtimelinking=yes LDFLAGS="$LDFLAGS -Wl,-brtl" fi ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='$wl-f,' case $with_aix_soname,$aix_use_runtimelinking in aix,*) ;; # traditional, no import file svr4,* | *,yes) # use import file # The Import File defines what to hardcode. _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no ;; esac if test yes = "$GCC"; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`$CC -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi ;; esac shared_flag='-shared' if test yes = "$aix_use_runtimelinking"; then shared_flag="$shared_flag "'$wl-G' fi # Need to ensure runtime linking is disabled for the traditional # shared library, or the linker may eventually find shared libraries # /with/ Import File - we do not want to mix them. shared_flag_aix='-shared' shared_flag_svr4='-shared $wl-G' else # not using gcc if test ia64 = "$host_cpu"; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test yes = "$aix_use_runtimelinking"; then shared_flag='$wl-G' else shared_flag='$wl-bM:SRE' fi shared_flag_aix='$wl-bM:SRE' shared_flag_svr4='$wl-G' fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. _LT_TAGVAR(always_export_symbols, $1)=yes if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag else if test ia64 = "$host_cpu"; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok' if test yes = "$with_gnu_ld"; then # We only use this code for GNU lds that support --whole-archive. _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' # -brtl affects multiple linker settings, -berok does not and is overridden later compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`' if test svr4 != "$with_aix_soname"; then # This is similar to how AIX traditionally builds its shared libraries. _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' fi if test aix != "$with_aix_soname"; then _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' else # used by -dlpreopen to get the symbols _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV $output_objdir/$realname.d/$soname $output_objdir' fi _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; bsdi[[45]]*) _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic ;; cygwin* | mingw* | windows* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++ or Intel C++ Compiler. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl* | icl*) # Native MSVC or ICC _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 -Fe$output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then cp "$export_symbols" "$output_objdir/$soname.def"; echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; else $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -Fe$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 and ICC 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* | midnightbsd*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; hpux9*) if test yes = "$GCC"; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' else _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' ;; hpux10*) if test yes,no = "$GCC,$with_gnu_ld"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test no = "$with_gnu_ld"; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes fi ;; hpux11*) if test yes,no = "$GCC,$with_gnu_ld"; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) m4_if($1, [], [ # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) _LT_LINKER_OPTION([if $CC understands -b], _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b], [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'], [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])], [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags']) ;; esac fi if test no = "$with_gnu_ld"; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test yes = "$GCC"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol], [lt_cv_irix_exported_symbol], [save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null" AC_LINK_IFELSE( [AC_LANG_SOURCE( [AC_LANG_CASE([C], [[int foo (void) { return 0; }]], [C++], [[int foo (void) { return 0; }]], [Fortran 77], [[ subroutine foo end]], [Fortran], [[ subroutine foo end]])])], [lt_cv_irix_exported_symbol=yes], [lt_cv_irix_exported_symbol=no]) LDFLAGS=$save_LDFLAGS]) if test yes = "$lt_cv_irix_exported_symbol"; then _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib' fi _LT_TAGVAR(link_all_deplibs, $1)=no else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes _LT_TAGVAR(link_all_deplibs, $1)=yes ;; linux*) case $cc_basename in tcc*) # Fabrice Bellard et al's Tiny C Compiler _LT_TAGVAR(ld_shlibs, $1)=yes _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' ;; esac ;; *-mlibc) ;; 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__`"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' fi else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; os2*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported shrext_cmds=.dll _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' ;; osf3*) if test yes = "$GCC"; then _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test yes = "$GCC"; then _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; serenity*) ;; solaris*) _LT_TAGVAR(no_undefined_flag, $1)=' -z defs' if test yes = "$GCC"; then wlarc='$wl' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' _LT_TAGVAR(archive_cmds, $1)='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='$wl' _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands '-z linker_flag'. GCC discards it without '$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test yes = "$GCC"; then _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' else _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' fi ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes ;; sunos4*) if test sequent = "$host_vendor"; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4) case $host_vendor in sni) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' _LT_TAGVAR(hardcode_direct, $1)=no ;; motorola) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4.3*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes _LT_TAGVAR(ld_shlibs, $1)=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' if test yes = "$GCC"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We CANNOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport' runpath_var='LD_RUN_PATH' if test yes = "$GCC"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(ld_shlibs, $1)=no ;; esac if test sni = "$host_vendor"; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Blargedynsym' ;; esac fi fi ]) AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no _LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld _LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl _LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl _LT_DECL([], [extract_expsyms_cmds], [2], [The commands to extract the exported symbol list from a shared archive]) # # Do we need to explicitly link libc? # case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in x|xyes) # Assume -lc should be added _LT_TAGVAR(archive_cmds_need_lc, $1)=yes if test yes,yes = "$GCC,$enable_shared"; then case $_LT_TAGVAR(archive_cmds, $1) in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. AC_CACHE_CHECK([whether -lc should be explicitly linked in], [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1), [$RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if AC_TRY_EVAL(ac_compile) 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) _LT_TAGVAR(allow_undefined_flag, $1)= if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) then lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no else lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes fi _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* ]) _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1) ;; esac fi ;; esac _LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0], [Whether or not to add -lc for building shared libraries]) _LT_TAGDECL([allow_libtool_libs_with_static_runtimes], [enable_shared_with_static_runtimes], [0], [Whether or not to disallow shared libs when runtime libs are static]) _LT_TAGDECL([], [export_dynamic_flag_spec], [1], [Compiler flag to allow reflexive dlopens]) _LT_TAGDECL([], [whole_archive_flag_spec], [1], [Compiler flag to generate shared objects directly from archives]) _LT_TAGDECL([], [compiler_needs_object], [1], [Whether the compiler copes with passing no objects directly]) _LT_TAGDECL([], [old_archive_from_new_cmds], [2], [Create an old-style archive from a shared archive]) _LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2], [Create a temporary old-style archive to link instead of a shared archive]) _LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive]) _LT_TAGDECL([], [archive_expsym_cmds], [2]) _LT_TAGDECL([], [module_cmds], [2], [Commands used to build a loadable module if different from building a shared archive.]) _LT_TAGDECL([], [module_expsym_cmds], [2]) _LT_TAGDECL([], [with_gnu_ld], [1], [Whether we are building with GNU ld or not]) _LT_TAGDECL([], [allow_undefined_flag], [1], [Flag that allows shared libraries with undefined symbols to be built]) _LT_TAGDECL([], [no_undefined_flag], [1], [Flag that enforces no undefined symbols]) _LT_TAGDECL([], [hardcode_libdir_flag_spec], [1], [Flag to hardcode $libdir into a binary during linking. This must work even if $libdir does not exist]) _LT_TAGDECL([], [hardcode_libdir_separator], [1], [Whether we need a single "-rpath" flag with a separated argument]) _LT_TAGDECL([], [hardcode_direct], [0], [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_direct_absolute], [0], [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes DIR into the resulting binary and the resulting library dependency is "absolute", i.e. impossible to change by setting $shlibpath_var if the library is relocated]) _LT_TAGDECL([], [hardcode_minus_L], [0], [Set to "yes" if using the -LDIR flag during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_shlibpath_var], [0], [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_automatic], [0], [Set to "yes" if building a shared library automatically hardcodes DIR into the library and all subsequent libraries and executables linked against it]) _LT_TAGDECL([], [inherit_rpath], [0], [Set to yes if linker adds runtime paths of dependent libraries to runtime path list]) _LT_TAGDECL([], [link_all_deplibs], [0], [Whether libtool must link a program against all its dependency libraries]) _LT_TAGDECL([], [always_export_symbols], [0], [Set to "yes" if exported symbols are required]) _LT_TAGDECL([], [export_symbols_cmds], [2], [The commands to list exported symbols]) _LT_TAGDECL([], [exclude_expsyms], [1], [Symbols that should not be listed in the preloaded symbols]) _LT_TAGDECL([], [include_expsyms], [1], [Symbols that must always be exported]) _LT_TAGDECL([], [prelink_cmds], [2], [Commands necessary for linking programs (against libraries) with templates]) _LT_TAGDECL([], [postlink_cmds], [2], [Commands necessary for finishing linking programs]) _LT_TAGDECL([], [file_list_spec], [1], [Specify filename containing input files]) dnl FIXME: Not yet implemented dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1], dnl [Compiler flag to generate thread safe objects]) ])# _LT_LINKER_SHLIBS # _LT_LANG_C_CONFIG([TAG]) # ------------------------ # Ensure that the configuration variables for a C compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to 'libtool'. m4_defun([_LT_LANG_C_CONFIG], [m4_require([_LT_DECL_EGREP])dnl lt_save_CC=$CC AC_LANG_PUSH(C) # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(void){return(0);}' _LT_TAG_COMPILER # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) LT_SYS_DLOPEN_SELF _LT_CMD_STRIPLIB # Report what library types will actually be built AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test no = "$can_build_shared" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test ia64 != "$host_cpu"; then case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in yes,aix,yes) ;; # shared object as lib.so file only yes,svr4,*) ;; # shared object as lib.so archive member only yes,*) enable_static=no ;; # shared object in lib.a archive as well esac fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test yes = "$enable_shared" || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_CONFIG($1) fi AC_LANG_POP CC=$lt_save_CC ])# _LT_LANG_C_CONFIG # _LT_LANG_CXX_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a C++ compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to 'libtool'. m4_defun([_LT_LANG_CXX_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_PATH_MANIFEST_TOOL])dnl if test -n "$CXX" && ( test no != "$CXX" && ( (test g++ = "$CXX" && `g++ -v >/dev/null 2>&1` ) || (test g++ != "$CXX"))); then AC_PROG_CXXCPP else _lt_caught_CXX_error=yes fi AC_LANG_PUSH(C++) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the CXX compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test yes != "$_lt_caught_CXX_error"; then # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else $as_unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else $as_unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} CFLAGS=$CXXFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then # We don't want -fno-exception when compiling C++ code, so set the # no_builtin_flag separately if test yes = "$GXX"; then _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' else _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= fi if test yes = "$GXX"; then # Set up default GNU C++ configuration LT_PATH_LD # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test yes = "$with_gnu_ld"; then _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) wlarc='$wl' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else with_gnu_ld=no wlarc= # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " [[-]]L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) _LT_TAGVAR(ld_shlibs, $1)=yes case $host_os in aix3*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aix[[4-9]]*) if test ia64 = "$host_cpu"; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag= else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # have runtime linking enabled, and use it for executables. # For shared libraries, we enable/disable runtime linking # depending on the kind of the shared library created - # when "with_aix_soname,aix_use_runtimelinking" is: # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables # "aix,yes" lib.so shared, rtl:yes, for executables # lib.a static archive # "both,no" lib.so.V(shr.o) shared, rtl:yes # lib.a(lib.so.V) shared, rtl:no, for executables # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a(lib.so.V) shared, rtl:no # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a static archive case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac done if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then # With aix-soname=svr4, we create the lib.so.V shared archives only, # so we don't have lib.a shared libs to link our executables. # We have to force runtime linking in this case. aix_use_runtimelinking=yes LDFLAGS="$LDFLAGS -Wl,-brtl" fi ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='$wl-f,' case $with_aix_soname,$aix_use_runtimelinking in aix,*) ;; # no import file svr4,* | *,yes) # use import file # The Import File defines what to hardcode. _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no ;; esac if test yes = "$GXX"; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`$CC -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi esac shared_flag='-shared' if test yes = "$aix_use_runtimelinking"; then shared_flag=$shared_flag' $wl-G' fi # Need to ensure runtime linking is disabled for the traditional # shared library, or the linker may eventually find shared libraries # /with/ Import File - we do not want to mix them. shared_flag_aix='-shared' shared_flag_svr4='-shared $wl-G' else # not using gcc if test ia64 = "$host_cpu"; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test yes = "$aix_use_runtimelinking"; then shared_flag='$wl-G' else shared_flag='$wl-bM:SRE' fi shared_flag_aix='$wl-bM:SRE' shared_flag_svr4='$wl-G' fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to # export. _LT_TAGVAR(always_export_symbols, $1)=yes if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. # The "-G" linker flag allows undefined symbols. _LT_TAGVAR(no_undefined_flag, $1)='-bernotok' # Determine the default libpath from the value encoded in an empty # executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag else if test ia64 = "$host_cpu"; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok' if test yes = "$with_gnu_ld"; then # We only use this code for GNU lds that support --whole-archive. _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' # -brtl affects multiple linker settings, -berok does not and is overridden later compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`' if test svr4 != "$with_aix_soname"; then # This is similar to how AIX traditionally builds its shared # libraries. Need -bnortl late, we may have -brtl in LDFLAGS. _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' fi if test aix != "$with_aix_soname"; then _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' else # used by -dlpreopen to get the symbols _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV $output_objdir/$realname.d/$soname $output_objdir' fi _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d' fi fi ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; cygwin* | mingw* | windows* | pw32* | cegcc*) case $GXX,$cc_basename in ,cl* | no,cl* | ,icl* | no,icl*) # Native MSVC or ICC # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then cp "$export_symbols" "$output_objdir/$soname.def"; echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; else $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile=$lt_outputfile.exe lt_tool_outputfile=$lt_tool_outputfile.exe ;; esac~ func_to_tool_file "$lt_outputfile"~ if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # g++ # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file, use it as # is; otherwise, prepend EXPORTS... _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; os2*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported shrext_cmds=.dll _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(file_list_spec, $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* | midnightbsd*) # 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)=no ;; hpux9*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "[[-]]L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes = "$GXX"; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; hpux10*|hpux11*) if test no = "$with_gnu_ld"; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) ;; *) _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' ;; esac fi case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP " [[-]]L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes = "$GXX"; then if test no = "$with_gnu_ld"; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$SED "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in CC*) # SGI C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test yes = "$GXX"; then if test no = "$with_gnu_ld"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` -o $lib' fi fi _LT_TAGVAR(link_all_deplibs, $1)=yes ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib $wl-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc* | ecpc* ) # Intel C++ with_gnu_ld=yes # version 8.0 and above of icpc choke on multiply defined symbols # if we add $predep_objects and $postdep_objects, however 7.1 and # earlier do not add the objects themselves. case `$CC -V 2>&1` in *"Version 7."*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 8.0 or newer tmp_idyn= case $host_cpu in ia64*) tmp_idyn=' -i_dynamic';; esac _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; esac _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive' ;; pgCC* | pgcpp*) # Portland Group C++ compiler case `$CC -V` in *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*) _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ $RANLIB $oldlib' _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 6 and above use weak symbols _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl--rpath $wl$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' ;; cxx*) # Compaq C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib $wl-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' ;; xl* | mpixl* | bgxl*) # IBM XL 8.0 on PPC, with GNU ld _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' if test yes = "$supports_anon_versioning"; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi ;; *) case `$CC -V 2>&1 | $SED 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file $wl$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes # Not sure whether something based on # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 # would be better. output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; esac ;; esac ;; lynxos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; m88k*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; *-mlibc) _LT_TAGVAR(ld_shlibs, $1)=yes ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; *nto* | *qnx*) _LT_TAGVAR(ld_shlibs, $1)=yes ;; openbsd*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`"; then _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file,$export_symbols -o $lib' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' fi output_verbose_link_cmd=func_echo_all else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Archives containing C++ object files must be created using # the KAI C++ compiler. case $host in osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; esac ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; cxx*) case $host in osf3*) _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $soname `test -n "$verstring" && func_echo_all "$wl-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' ;; *) _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname $wl-input $wl$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~ $RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' ;; esac _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes,no = "$GXX,$with_gnu_ld"; then _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' case $host in osf3*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " [[-]]L"' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; serenity*) ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(archive_cmds_need_lc,$1)=yes _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G$allow_undefined_flag $wl-M $wl$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands '-z linker_flag'. # Supported since Solaris 2.6 (maybe 2.5.1?) _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test yes,no = "$GXX,$with_gnu_ld"; then _LT_TAGVAR(no_undefined_flag, $1)=' $wl-z ${wl}defs' if $CC --version | $GREP -v '^2\.7' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " [[-]]L"' else # g++ 2.7 appears to require '-G' NOT '-shared' on this # platform. _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " [[-]]L"' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $wl$libdir' case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' ;; esac fi ;; esac ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We CANNOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~ '"$_LT_TAGVAR(old_archive_cmds, $1)" _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~ '"$_LT_TAGVAR(reload_cmds, $1)" ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no _LT_TAGVAR(GCC, $1)=$GXX _LT_TAGVAR(LD, $1)=$LD ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld fi # test yes != "$_lt_caught_CXX_error" AC_LANG_POP ])# _LT_LANG_CXX_CONFIG # _LT_FUNC_STRIPNAME_CNF # ---------------------- # func_stripname_cnf prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). # # This function is identical to the (non-XSI) version of func_stripname, # except this one can be used by m4 code that may be executed by configure, # rather than the libtool script. m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl AC_REQUIRE([_LT_DECL_SED]) AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH]) func_stripname_cnf () { case @S|@2 in .*) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%\\\\@S|@2\$%%"`;; *) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%@S|@2\$%%"`;; esac } # func_stripname_cnf ])# _LT_FUNC_STRIPNAME_CNF # _LT_SYS_HIDDEN_LIBDEPS([TAGNAME]) # --------------------------------- # Figure out "hidden" library dependencies from verbose # compiler output when linking a shared library. # Parse the compiler output and extract the necessary # objects, libraries and library flags. m4_defun([_LT_SYS_HIDDEN_LIBDEPS], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl # Dependencies to place before and after the object being linked: _LT_TAGVAR(predep_objects, $1)= _LT_TAGVAR(postdep_objects, $1)= _LT_TAGVAR(predeps, $1)= _LT_TAGVAR(postdeps, $1)= _LT_TAGVAR(compiler_lib_search_path, $1)= dnl we can't use the lt_simple_compile_test_code here, dnl because it contains code intended for an executable, dnl not a library. It's possible we should let each dnl tag define a new lt_????_link_test_code variable, dnl but it's only used here... m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF int a; void foo (void) { a = 0; } _LT_EOF ], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF class Foo { public: Foo (void) { a = 0; } private: int a; }; _LT_EOF ], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer*4 a a=0 return end _LT_EOF ], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer a a=0 return end _LT_EOF ], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF public class foo { private int a; public void bar (void) { a = 0; } }; _LT_EOF ], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF package foo func foo() { } _LT_EOF ]) _lt_libdeps_save_CFLAGS=$CFLAGS case "$CC $CFLAGS " in #( *\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; *\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; *\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; esac dnl Parse the compiler output and extract the necessary dnl objects, libraries and library flags. if AC_TRY_EVAL(ac_compile); then # Parse the compiler output and extract the necessary # objects, libraries and library flags. # Sentinel used to keep track of whether or not we are before # the conftest object file. pre_test_object_deps_done=no for p in `eval "$output_verbose_link_cmd"`; do case $prev$p in -L* | -R* | -l*) # Some compilers place space between "-{L,R,l}" and the path. # Remove the space. if test x-L = x"$p" || test x-R = x"$p" || test x-l = x"$p"; then prev=$p continue fi # Expand the sysroot to ease extracting the directories later. if test -z "$prev"; then case $p in -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; esac fi case $p in =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; esac if test no = "$pre_test_object_deps_done"; then case $prev in -L | -R) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then _LT_TAGVAR(compiler_lib_search_path, $1)=$prev$p else _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} $prev$p" fi ;; # The "-l" case would never come before the object being # linked, so don't bother handling this case. esac else if test -z "$_LT_TAGVAR(postdeps, $1)"; then _LT_TAGVAR(postdeps, $1)=$prev$p else _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} $prev$p" fi fi prev= ;; *.lto.$objext) ;; # Ignore GCC LTO objects *.$objext) # This assumes that the test object file only shows up # once in the compiler output. if test "$p" = "conftest.$objext"; then pre_test_object_deps_done=yes continue fi if test no = "$pre_test_object_deps_done"; then if test -z "$_LT_TAGVAR(predep_objects, $1)"; then _LT_TAGVAR(predep_objects, $1)=$p else _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p" fi else if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then _LT_TAGVAR(postdep_objects, $1)=$p else _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p" fi fi ;; *) ;; # Ignore the rest. esac done # Clean up. rm -f a.out a.exe else echo "libtool.m4: error: problem compiling $1 test program" fi $RM -f confest.$objext CFLAGS=$_lt_libdeps_save_CFLAGS # PORTME: override above test on systems where it is broken m4_if([$1], [CXX], [case $host_os in interix[[3-9]]*) # Interix 3.5 installs completely hosed .la files for C++, so rather than # hack all around it, let's just trust "g++" to DTRT. _LT_TAGVAR(predep_objects,$1)= _LT_TAGVAR(postdep_objects,$1)= _LT_TAGVAR(postdeps,$1)= ;; esac ]) case " $_LT_TAGVAR(postdeps, $1) " in *" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; esac _LT_TAGVAR(compiler_lib_search_dirs, $1)= if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | $SED -e 's! -L! !g' -e 's!^ !!'` fi _LT_TAGDECL([], [compiler_lib_search_dirs], [1], [The directories searched by this compiler when creating a shared library]) _LT_TAGDECL([], [predep_objects], [1], [Dependencies to place before and after the objects being linked to create a shared library]) _LT_TAGDECL([], [postdep_objects], [1]) _LT_TAGDECL([], [predeps], [1]) _LT_TAGDECL([], [postdeps], [1]) _LT_TAGDECL([], [compiler_lib_search_path], [1], [The library search path used internally by the compiler when linking a shared library]) ])# _LT_SYS_HIDDEN_LIBDEPS # _LT_LANG_F77_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a Fortran 77 compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_F77_CONFIG], [AC_LANG_PUSH(Fortran 77) if test -z "$F77" || test no = "$F77"; then _lt_disable_F77=yes fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for f77 test sources. ac_ext=f # Object file extension for compiled f77 test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the F77 compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test yes != "$_lt_disable_F77"; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${F77-"f77"} CFLAGS=$FFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) GCC=$G77 if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test no = "$can_build_shared" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test ia64 != "$host_cpu"; then case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in yes,aix,yes) ;; # shared object as lib.so file only yes,svr4,*) ;; # shared object as lib.so archive member only yes,*) enable_static=no ;; # shared object in lib.a archive as well esac fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test yes = "$enable_shared" || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)=$G77 _LT_TAGVAR(LD, $1)=$LD ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS fi # test yes != "$_lt_disable_F77" AC_LANG_POP ])# _LT_LANG_F77_CONFIG # _LT_LANG_FC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for a Fortran compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_FC_CONFIG], [AC_LANG_PUSH(Fortran) if test -z "$FC" || test no = "$FC"; then _lt_disable_FC=yes fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for fc test sources. ac_ext=${ac_fc_srcext-f} # Object file extension for compiled fc test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the FC compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test yes != "$_lt_disable_FC"; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${FC-"f95"} CFLAGS=$FCFLAGS compiler=$CC GCC=$ac_cv_fc_compiler_gnu _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test no = "$can_build_shared" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test ia64 != "$host_cpu"; then case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in yes,aix,yes) ;; # shared object as lib.so file only yes,svr4,*) ;; # shared object as lib.so archive member only yes,*) enable_static=no ;; # shared object in lib.a archive as well esac fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test yes = "$enable_shared" || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)=$ac_cv_fc_compiler_gnu _LT_TAGVAR(LD, $1)=$LD ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS fi # test yes != "$_lt_disable_FC" AC_LANG_POP ])# _LT_LANG_FC_CONFIG # _LT_LANG_GCJ_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for the GNU Java Compiler compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_GCJ_CONFIG], [AC_REQUIRE([LT_PROG_GCJ])dnl AC_LANG_SAVE # Source file extension for Java test sources. ac_ext=java # Object file extension for compiled Java test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="class foo {}" # Code to be used in simple link tests lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC=yes CC=${GCJ-"gcj"} CFLAGS=$GCJFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)=$LD _LT_CC_BASENAME([$compiler]) # GCJ did not exist at the time GCC didn't implicitly link libc in. _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi AC_LANG_RESTORE GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GCJ_CONFIG # _LT_LANG_GO_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for the GNU Go compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_GO_CONFIG], [AC_REQUIRE([LT_PROG_GO])dnl AC_LANG_SAVE # Source file extension for Go test sources. ac_ext=go # Object file extension for compiled Go test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="package main; func main() { }" # Code to be used in simple link tests lt_simple_link_test_code='package main; func main() { }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC=yes CC=${GOC-"gccgo"} CFLAGS=$GOFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)=$LD _LT_CC_BASENAME([$compiler]) # Go did not exist at the time GCC didn't implicitly link libc in. _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi AC_LANG_RESTORE GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GO_CONFIG # _LT_LANG_RC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for the Windows resource compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_RC_CONFIG], [AC_REQUIRE([LT_PROG_RC])dnl AC_LANG_SAVE # Source file extension for RC test sources. ac_ext=rc # Object file extension for compiled RC test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' # Code to be used in simple link tests lt_simple_link_test_code=$lt_simple_compile_test_code # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC= CC=${RC-"windres"} CFLAGS= compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes if test -n "$compiler"; then : _LT_CONFIG($1) fi GCC=$lt_save_GCC AC_LANG_RESTORE CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_RC_CONFIG # LT_PROG_GCJ # ----------- AC_DEFUN([LT_PROG_GCJ], [m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ], [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ], [AC_CHECK_TOOL(GCJ, gcj,) test set = "${GCJFLAGS+set}" || GCJFLAGS="-g -O2" AC_SUBST(GCJFLAGS)])])[]dnl ]) # Old name: AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_GCJ], []) # LT_PROG_GO # ---------- AC_DEFUN([LT_PROG_GO], [AC_CHECK_TOOL(GOC, gccgo,) ]) # LT_PROG_RC # ---------- AC_DEFUN([LT_PROG_RC], [AC_CHECK_TOOL(RC, windres,) ]) # Old name: AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_RC], []) # _LT_DECL_EGREP # -------------- # If we don't have a new enough Autoconf to choose the best grep # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_EGREP], [AC_REQUIRE([AC_PROG_EGREP])dnl AC_REQUIRE([AC_PROG_FGREP])dnl test -z "$GREP" && GREP=grep _LT_DECL([], [GREP], [1], [A grep program that handles long lines]) _LT_DECL([], [EGREP], [1], [An ERE matcher]) _LT_DECL([], [FGREP], [1], [A literal string matcher]) dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too AC_SUBST([GREP]) ]) # _LT_DECL_OBJDUMP # -------------- # If we don't have a new enough Autoconf to choose the best objdump # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_OBJDUMP], [AC_CHECK_TOOL(OBJDUMP, objdump, false) test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [An object symbol dumper]) AC_SUBST([OBJDUMP]) ]) # _LT_DECL_DLLTOOL # ---------------- # Ensure DLLTOOL variable is set. m4_defun([_LT_DECL_DLLTOOL], [AC_CHECK_TOOL(DLLTOOL, dlltool, false) test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [1], [DLL creation program]) AC_SUBST([DLLTOOL]) ]) # _LT_DECL_FILECMD # ---------------- # Check for a file(cmd) program that can be used to detect file type and magic m4_defun([_LT_DECL_FILECMD], [AC_CHECK_PROG([FILECMD], [file], [file], [:]) _LT_DECL([], [FILECMD], [1], [A file(cmd) program that detects file types]) ])# _LD_DECL_FILECMD # _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 dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_SED], []) # _LT_CHECK_SHELL_FEATURES # ------------------------ # Find out whether the shell is Bourne or XSI compatible, # or has some other useful features. m4_defun([_LT_CHECK_SHELL_FEATURES], [if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi _LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac _LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl _LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl ])# _LT_CHECK_SHELL_FEATURES # _LT_PATH_CONVERSION_FUNCTIONS # ----------------------------- # Determine what file name conversion functions should be used by # func_to_host_file (and, implicitly, by func_to_host_path). These are needed # for certain cross-compile configurations and native mingw. m4_defun([_LT_PATH_CONVERSION_FUNCTIONS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_MSG_CHECKING([how to convert $build file names to $host format]) AC_CACHE_VAL(lt_cv_to_host_file_cmd, [case $host in *-*-mingw* ) case $build in *-*-mingw* | *-*-windows* ) # 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* | *-*-windows* ) # 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* | *-*-windows* ) case $build in *-*-mingw* | *-*-windows* ) # 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.114/m4/gtk-doc.m40000644000175000017500000001066014764623725011205 # -*- mode: autoconf -*- # # gtk-doc.m4 - configure macro to check for gtk-doc # Copyright (C) 2003 James Henstridge # 2007-2017 Stefan Sauer # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # # As a special exception, the above copyright owner gives unlimited # permission to copy, distribute and modify the configure scripts that # are the output of Autoconf when processing the Macro. You need not # follow the terms of the GNU General Public License when using or # distributing such scripts, even though portions of the text of the # Macro appear in them. The GNU General Public License (GPL) does govern # all other use of the material that constitutes the Autoconf Macro. # serial 2 dnl Usage: dnl GTK_DOC_CHECK([minimum-gtk-doc-version]) AC_DEFUN([GTK_DOC_CHECK], [ AC_REQUIRE([PKG_PROG_PKG_CONFIG]) AC_BEFORE([AC_PROG_LIBTOOL],[$0])dnl setup libtool first AC_BEFORE([AM_PROG_LIBTOOL],[$0])dnl setup libtool first ifelse([$1],[],[gtk_doc_requires="gtk-doc"],[gtk_doc_requires="gtk-doc >= $1"]) AC_MSG_CHECKING([for gtk-doc]) PKG_CHECK_EXISTS([$gtk_doc_requires],[have_gtk_doc=yes],[have_gtk_doc=no]) AC_MSG_RESULT($have_gtk_doc) if test "$have_gtk_doc" = "no"; then AC_MSG_WARN([ You will not be able to create source packages with 'make dist' because $gtk_doc_requires is not found.]) fi dnl check for tools we added during development dnl Use AC_CHECK_PROG to avoid the check target using an absolute path that dnl may not be writable by the user. Currently, automake requires that the dnl test name must end in '.test'. dnl https://bugzilla.gnome.org/show_bug.cgi?id=701638 AC_CHECK_PROG([GTKDOC_CHECK],[gtkdoc-check],[gtkdoc-check.test]) AC_PATH_PROG([GTKDOC_CHECK_PATH],[gtkdoc-check]) AC_PATH_PROGS([GTKDOC_REBASE],[gtkdoc-rebase],[true]) AC_PATH_PROG([GTKDOC_MKPDF],[gtkdoc-mkpdf]) dnl for overriding the documentation installation directory AC_ARG_WITH([html-dir], AS_HELP_STRING([--with-html-dir=PATH], [path to installed docs]),, [with_html_dir='${datadir}/gtk-doc/html']) HTML_DIR="$with_html_dir" AC_SUBST([HTML_DIR]) dnl enable/disable documentation building AC_ARG_ENABLE([gtk-doc], AS_HELP_STRING([--enable-gtk-doc], [use gtk-doc to build documentation [[default=no]]]),, [enable_gtk_doc=no]) AC_MSG_CHECKING([whether to build gtk-doc documentation]) AC_MSG_RESULT($enable_gtk_doc) if test "x$enable_gtk_doc" = "xyes" && test "$have_gtk_doc" = "no"; then AC_MSG_ERROR([ You must have $gtk_doc_requires installed to build documentation for $PACKAGE_NAME. Please install gtk-doc or disable building the documentation by adding '--disable-gtk-doc' to '[$]0'.]) fi dnl don't check for glib if we build glib if test "x$PACKAGE_NAME" != "xglib"; then dnl don't fail if someone does not have glib PKG_CHECK_MODULES(GTKDOC_DEPS, glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0,,[:]) fi dnl enable/disable output formats AC_ARG_ENABLE([gtk-doc-html], AS_HELP_STRING([--enable-gtk-doc-html], [build documentation in html format [[default=yes]]]),, [enable_gtk_doc_html=yes]) AC_ARG_ENABLE([gtk-doc-pdf], AS_HELP_STRING([--enable-gtk-doc-pdf], [build documentation in pdf format [[default=no]]]),, [enable_gtk_doc_pdf=no]) if test -z "$GTKDOC_MKPDF"; then enable_gtk_doc_pdf=no fi if test -z "$AM_DEFAULT_VERBOSITY"; then AM_DEFAULT_VERBOSITY=1 fi AC_SUBST([AM_DEFAULT_VERBOSITY]) AM_CONDITIONAL([HAVE_GTK_DOC], [test x$have_gtk_doc = xyes]) AM_CONDITIONAL([ENABLE_GTK_DOC], [test x$enable_gtk_doc = xyes]) AM_CONDITIONAL([GTK_DOC_BUILD_HTML], [test x$enable_gtk_doc_html = xyes]) AM_CONDITIONAL([GTK_DOC_BUILD_PDF], [test x$enable_gtk_doc_pdf = xyes]) AM_CONDITIONAL([GTK_DOC_USE_LIBTOOL], [test -n "$LIBTOOL"]) AM_CONDITIONAL([GTK_DOC_USE_REBASE], [test -n "$GTKDOC_REBASE"]) ]) dbus-glib-0.114/LICENSES/0000775000175000017500000000000014764624122010347 5dbus-glib-0.114/LICENSES/MIT.txt0000644000175000017500000000206614714624470011464 MIT License Copyright (c) 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. dbus-glib-0.114/LICENSES/LGPL-2.1-or-later.txt0000644000175000017500000006255714714624471013626 GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 Copyright (C) 1991, 1999 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. [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things. To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. one line to give the library's name and an idea of what it does. Copyright (C) year name of author This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. signature of Ty Coon, 1 April 1990 Ty Coon, President of Vice That's all there is to it! dbus-glib-0.114/LICENSES/GPL-2.0-or-later.txt0000644000175000017500000004167114714624474013506 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 Lesser 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. 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. one line to give the program's name and an idea of what it does. Copyright (C) yyyy name of author 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. signature of Ty Coon, 1 April 1989 Ty Coon, President of Vice dbus-glib-0.114/LICENSES/AFL-2.1.txt0000644000175000017500000002136414714624476011743 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. dbus-glib-0.114/build-aux/0000775000175000017500000000000014764624122011034 5dbus-glib-0.114/build-aux/test-driver0000755000175000017500000001213714764623732013162 #! /bin/sh # test-driver - basic testsuite driver script. scriptversion=2024-06-19.01; # UTC # Copyright (C) 2011-2024 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. # This file is maintained in Automake, please report # bugs to or send patches to # . # Make unconditional expansion of undefined variables an error. This # helps a lot in preventing typo-related bugs. set -u usage_error () { echo "$0: $*" >&2 print_usage >&2 exit 2 } print_usage () { cat <. GNU Automake home page: . General help using GNU software: . END } test_name= # Used for reporting. log_file= # Where to save the output of the test script. trs_file= # Where to save the metadata of the test run. expect_failure=no color_tests=no collect_skipped_logs=yes enable_hard_errors=yes while test $# -gt 0; do case $1 in --help) print_usage; exit $?;; --version) echo "test-driver (GNU Automake) $scriptversion"; exit $?;; --test-name) test_name=$2; shift;; --log-file) log_file=$2; shift;; --trs-file) trs_file=$2; shift;; --color-tests) color_tests=$2; shift;; --collect-skipped-logs) collect_skipped_logs=$2; shift;; --expect-failure) expect_failure=$2; shift;; --enable-hard-errors) enable_hard_errors=$2; shift;; --) shift; break;; -*) usage_error "invalid option: '$1'";; *) break;; esac shift done missing_opts= test x"$test_name" = x && missing_opts="$missing_opts --test-name" test x"$log_file" = x && missing_opts="$missing_opts --log-file" test x"$trs_file" = x && missing_opts="$missing_opts --trs-file" if test x"$missing_opts" != x; then usage_error "the following mandatory options are missing:$missing_opts" fi if test $# -eq 0; then usage_error "missing argument" fi if test $color_tests = yes; then # Keep this in sync with 'lib/am/check.am:$(am__tty_colors)'. red='' # Red. grn='' # Green. lgn='' # Light green. blu='' # Blue. mgn='' # Magenta. std='' # No color. else red= grn= lgn= blu= mgn= std= fi do_exit='rm -f $log_file $trs_file; (exit $st); exit $st' trap "st=129; $do_exit" 1 trap "st=130; $do_exit" 2 trap "st=141; $do_exit" 13 trap "st=143; $do_exit" 15 # Test script is run here. We create the file first, then append to it, # to ameliorate tests themselves also writing to the log file. Our tests # don't, but others can (automake bug#35762). : >"$log_file" "$@" >>"$log_file" 2>&1 estatus=$? if test $enable_hard_errors = no && test $estatus -eq 99; then tweaked_estatus=1 else tweaked_estatus=$estatus fi case $tweaked_estatus:$expect_failure in 0:yes) col=$red res=XPASS recheck=yes gcopy=yes;; 0:*) col=$grn res=PASS recheck=no gcopy=no;; 77:*) col=$blu res=SKIP recheck=no gcopy=$collect_skipped_logs;; 99:*) col=$mgn res=ERROR recheck=yes gcopy=yes;; *:yes) col=$lgn res=XFAIL recheck=no gcopy=yes;; *:*) col=$red res=FAIL recheck=yes gcopy=yes;; esac # Report the test outcome and exit status in the logs, so that one can # know whether the test passed or failed simply by looking at the '.log' # file, without the need of also peaking into the corresponding '.trs' # file (automake bug#11814). echo "$res $test_name (exit status: $estatus)" >>"$log_file" # Report outcome to console. echo "${col}${res}${std}: $test_name" # Register the test result, and other relevant metadata. echo ":test-result: $res" > $trs_file echo ":global-test-result: $res" >> $trs_file echo ":recheck: $recheck" >> $trs_file echo ":copy-in-global-log: $gcopy" >> $trs_file # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: dbus-glib-0.114/build-aux/depcomp0000755000175000017500000005621714764623732012350 #! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2024-06-19.01; # UTC # Copyright (C) 1999-2024 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 . GNU Automake home page: . General help using GNU software: . EOF exit $? ;; -v | --v*) echo "depcomp (GNU Automake) $scriptversion" exit $? ;; esac # Get the directory component of the given path, and save it in the # global variables '$dir'. Note that this directory component will # be either empty or ending with a '/' character. This is deliberate. set_dir_from () { case $1 in */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;; *) dir=;; esac } # Get the suffix-stripped basename of the given path, and save it the # global variable '$base'. set_base_from () { base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'` } # If no dependency file was actually created by the compiler invocation, # we still have to create a dummy depfile, to avoid errors with the # Makefile "include basename.Plo" scheme. make_dummy_depfile () { echo "#dummy" > "$depfile" } # Factor out some common post-processing of the generated depfile. # Requires the auxiliary global variable '$tmpdepfile' to be set. aix_post_process_depfile () { # If the compiler actually managed to produce a dependency file, # post-process it. if test -f "$tmpdepfile"; then # Each line is of the form 'foo.o: dependency.h'. # Do two passes, one to just change these to # $object: dependency.h # and one to simply output # dependency.h: # which is needed to avoid the deleted-header problem. { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile" sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile" } > "$depfile" rm -f "$tmpdepfile" else make_dummy_depfile fi } # A tabulation character. tab=' ' # A newline character. nl=' ' # Character ranges might be problematic outside the C locale. # These definitions help. upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ lower=abcdefghijklmnopqrstuvwxyz alpha=${upper}${lower} 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" # Avoid interference from the environment. gccflag= dashmflag= # 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 information. 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 -ne 0; then rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## Note that this doesn't just cater to obsolete pre-3.x GCC compilers. ## but also to in-use compilers like IBM xlc/xlC and the HP C compiler. ## (see the conditional assignment to $gccflag above). ## 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). Also, it might not be ## supported by the other compilers which use the 'gcc' depmode. ## - 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 -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # 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. ## 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. tr ' ' "$nl" < "$tmpdepfile" \ | 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 -ne 0; then 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 make_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. set_dir_from "$object" set_base_from "$object" 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 -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done aix_post_process_depfile ;; tcc) # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26 # FIXME: That version still under development at the moment of writing. # Make that this statement remains true also for stable, released # versions. # It will wrap lines (doesn't matter whether long or short) with a # trailing '\', as in: # # foo.o : \ # foo.c \ # foo.h \ # # It will put a trailing '\' even on the last line, and will use leading # spaces rather than leading tabs (at least since its commit 0394caf7 # "Emit spaces for -MD"). "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'. # We have to change lines of the first kind to '$object: \'. sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile" # And for each line of the second kind, we have to emit a 'dep.h:' # dummy dependency, to avoid the deleted-header problem. sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile" rm -f "$tmpdepfile" ;; ## The order of this option in the case statement is important, since the ## shell code in configure will try each of these formats in the order ## listed in this file. A plain '-MD' option would be understood by many ## compilers, so we must ensure this comes after the gcc and icc options. pgcc) # Portland's C compiler understands '-MD'. # Will always output deps to 'file.d' where file is the root name of the # source file under compilation, even if file resides in a subdirectory. # The object file name does not affect the name of the '.d' file. # pgcc 10.2 will output # foo.o: sub/foo.c sub/foo.h # and will wrap long lines using '\' : # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... set_dir_from "$object" # Use the source, not the object, to determine the base name, since # that's sadly what pgcc will do too. set_base_from "$source" tmpdepfile=$base.d # For projects that build the same source file twice into different object # files, the pgcc approach of using the *source* file root name can cause # problems in parallel builds. Use a locking strategy to avoid stomping on # the same $tmpdepfile. lockdir=$base.d-lock trap " echo '$0: caught signal, cleaning up...' >&2 rmdir '$lockdir' exit 1 " 1 2 13 15 numtries=100 i=$numtries while test $i -gt 0; do # mkdir is a portable test-and-set. if mkdir "$lockdir" 2>/dev/null; then # This process acquired the lock. "$@" -MD stat=$? # Release the lock. rmdir "$lockdir" break else # If the lock is being held by a different process, wait # until the winning process is done or we timeout. while test -d "$lockdir" && test $i -gt 0; do sleep 1 i=`expr $i - 1` done fi i=`expr $i - 1` done trap - 1 2 13 15 if test $i -le 0; then echo "$0: failed to acquire lock after $numtries attempts" >&2 echo "$0: check lockdir '$lockdir'" >&2 exit 1 fi if test $stat -ne 0; then 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 "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this invocation # correctly. Breaking it into two sed invocations is a workaround. sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \ | sed -e 's/$/ :/' >> "$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. set_dir_from "$object" set_base_from "$object" 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 -ne 0; then 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,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile" # Add 'dependent.h:' lines. sed -ne '2,${ s/^ *// s/ \\*$// s/$/:/ p }' "$tmpdepfile" >> "$depfile" else make_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. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then # Libtool 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$base.o.d # libtool 1.5 tmpdepfile2=$dir.libs/$base.o.d # Likewise. tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504 "$@" -Wc,-MD else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d tmpdepfile3=$dir$base.d "$@" -MD fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done # Same post-processing that is required for AIX mode. aix_post_process_depfile ;; 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 -ne 0; then 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" echo >> "$depfile" # make sure the fragment doesn't end with a backslash 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" # Some versions of the HPUX 10.20 sed can't process this sed invocation # correctly. Breaking it into two sed invocations is a workaround. tr ' ' "$nl" < "$tmpdepfile" \ | 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" # Some versions of the HPUX 10.20 sed can't process the last invocation # correctly. Breaking it into two sed invocations is a workaround. sed '1,2d' "$tmpdepfile" \ | tr ' ' "$nl" \ | 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 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: dbus-glib-0.114/build-aux/missing0000755000175000017500000001706014764623731012362 #! /bin/sh # Common wrapper for a few potentially missing GNU and other programs. scriptversion=2024-06-07.14; # UTC # shellcheck disable=SC2006,SC2268 # we must support pre-POSIX shells # Copyright (C) 1996-2024 Free Software Foundation, Inc. # Originally written 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 case $1 in --is-lightweight) # Used by our autoconf macros to check whether the available missing # script is modern enough. exit 0 ;; --run) # Back-compat with the calling convention used by older automake. shift ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due to PROGRAM being missing or too old. Options: -h, --help display this help and exit -v, --version output version information and exit Supported PROGRAM values: aclocal autoconf autogen autoheader autom4te automake autoreconf bison flex help2man lex makeinfo perl yacc Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and 'g' are ignored when checking the name. Report bugs to . GNU Automake home page: . General help using GNU software: ." exit $? ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing (GNU Automake) $scriptversion" exit $? ;; -*) echo 1>&2 "$0: unknown '$1' option" echo 1>&2 "Try '$0 --help' for more information" exit 1 ;; esac # Run the given program, remember its exit status. "$@"; st=$? # If it succeeded, we are done. test $st -eq 0 && exit 0 # Also exit now if we it failed (or wasn't found), and '--version' was # passed; such an option is passed most likely to detect whether the # program is present and works. case $2 in --version|--help) exit $st;; esac # Exit code 63 means version mismatch. This often happens when the user # tries to use an ancient version of a tool on a file that requires a # minimum version. if test $st -eq 63; then msg="probably too old" elif test $st -eq 127; then # Program was missing. msg="missing on your system" else # Program was found and executed, but failed. Give up. exit $st fi perl_URL=https://www.perl.org/ flex_URL=https://github.com/westes/flex gnu_software_URL=https://www.gnu.org/software program_details () { case $1 in aclocal|automake|autoreconf) echo "The '$1' program is part of the GNU Automake package:" echo "<$gnu_software_URL/automake>" echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/autoconf>" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; autoconf|autom4te|autoheader) echo "The '$1' program is part of the GNU Autoconf package:" echo "<$gnu_software_URL/autoconf/>" echo "It also requires GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; *) : ;; esac } give_advice () { # Normalize program name to check for. normalized_program=`echo "$1" | sed ' s/^gnu-//; t s/^gnu//; t s/^g//; t'` printf '%s\n' "'$1' is $msg." configure_deps="'configure.ac' or m4 files included by 'configure.ac'" autoheader_deps="'acconfig.h'" automake_deps="'Makefile.am'" aclocal_deps="'acinclude.m4'" case $normalized_program in aclocal*) echo "You should only need it if you modified $aclocal_deps or" echo "$configure_deps." ;; autoconf*) echo "You should only need it if you modified $configure_deps." ;; autogen*) echo "You should only need it if you modified a '.def' or '.tpl' file." echo "You may want to install the GNU AutoGen package:" echo "<$gnu_software_URL/autogen/>" ;; autoheader*) echo "You should only need it if you modified $autoheader_deps or" echo "$configure_deps." ;; automake*) echo "You should only need it if you modified $automake_deps or" echo "$configure_deps." ;; autom4te*) echo "You might have modified some maintainer files that require" echo "the 'autom4te' program to be rebuilt." ;; autoreconf*) echo "You should only need it if you modified $aclocal_deps or" echo "$automake_deps or $autoheader_deps or $automake_deps or" echo "$configure_deps." ;; bison*|yacc*) echo "You should only need it if you modified a '.y' file." echo "You may want to install the GNU Bison package:" echo "<$gnu_software_URL/bison/>" ;; help2man*) echo "You should only need it if you modified a dependency" \ "of a man page." echo "You may want to install the GNU Help2man package:" echo "<$gnu_software_URL/help2man/>" ;; lex*|flex*) echo "You should only need it if you modified a '.l' file." echo "You may want to install the Fast Lexical Analyzer package:" echo "<$flex_URL>" ;; makeinfo*) echo "You should only need it if you modified a '.texi' file, or" echo "any other file indirectly affecting the aspect of the manual." echo "You might want to install the Texinfo package:" echo "<$gnu_software_URL/texinfo/>" echo "The spurious makeinfo call might also be the consequence of" echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might" echo "want to install GNU make:" echo "<$gnu_software_URL/make/>" ;; perl*) echo "You should only need it to run GNU Autoconf, GNU Automake, " echo " assorted other tools, or if you modified a Perl source file." echo "You may want to install the Perl 5 language interpreter:" echo "<$perl_URL>" ;; *) echo "You might have modified some files without having the proper" echo "tools for further handling them. Check the 'README' file, it" echo "often tells you about the needed prerequisites for installing" echo "this package. You may also peek at any GNU archive site, in" echo "case some other package contains this missing '$1' program." ;; esac program_details "$normalized_program" } give_advice "$1" | sed -e '1s/^/WARNING: /' \ -e '2,$s/^/ /' >&2 # Propagate the correct exit status (expected to be 127 for a program # not found, 63 for a program that failed due to version mismatch). exit $st # Local variables: # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: dbus-glib-0.114/build-aux/ltmain.sh0000755000175000017500000122276514764623724012623 #! /usr/bin/env sh ## DO NOT EDIT - This file generated from ./build-aux/ltmain.in ## by inline-source v2019-02-19.15 # libtool (GNU libtool) 2.5.4 # Provide generalized library-building support services. # Written by Gordon Matzigkeit , 1996 # Copyright (C) 1996-2019, 2021-2024 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # GNU Libtool is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . PROGRAM=libtool PACKAGE=libtool VERSION="2.5.4 Debian-2.5.4-4" package_revision=2.5.4 ## ------ ## ## Usage. ## ## ------ ## # Run './libtool --help' for help with using this script from the # command line. ## ------------------------------- ## ## User overridable command paths. ## ## ------------------------------- ## # After configure completes, it has a better idea of some of the # shell tools we need than the defaults used by the functions shared # with bootstrap, so set those here where they can still be over- # ridden by the user, but otherwise take precedence. : ${AUTOCONF="autoconf"} : ${AUTOMAKE="automake"} ## -------------------------- ## ## Source external libraries. ## ## -------------------------- ## # Much of our low-level functionality needs to be sourced from external # libraries, which are installed to $pkgauxdir. # Set a version string for this script. scriptversion=2024-12-01.17; # UTC # General shell script boiler plate, and helper functions. # Written by Gary V. Vaughan, 2004 # This is free software. There is NO warranty; not even for # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # # Copyright (C) 2004-2019, 2021, 2023-2024 Bootstrap Authors # # This file is dual licensed under the terms of the MIT license # , and GPL version 2 or later # . You must apply one of # these licenses when using or redistributing this software or any of # the files within it. See the URLs above, or the file `LICENSE` # included in the Bootstrap distribution for the full license texts. # Please report bugs or propose patches to: # ## ------ ## ## Usage. ## ## ------ ## # Evaluate this file near the top of your script to gain access to # the functions and variables defined here: # # . `echo "$0" | ${SED-sed} 's|[^/]*$||'`/build-aux/funclib.sh # # If you need to override any of the default environment variable # settings, do that before evaluating this file. ## -------------------- ## ## Shell normalisation. ## ## -------------------- ## # Some shells need a little help to be as Bourne compatible as possible. # Before doing anything else, make sure all that help has been provided! DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi # NLS nuisances: We save the old values in case they are required later. _G_user_locale= _G_safe_locale= for _G_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test set = \"\${$_G_var+set}\"; then save_$_G_var=\$$_G_var $_G_var=C export $_G_var _G_user_locale=\"$_G_var=\\\$save_\$_G_var; \$_G_user_locale\" _G_safe_locale=\"$_G_var=C; \$_G_safe_locale\" fi" done # These NLS vars are set unconditionally (bootstrap issue #24). Unset those # in case the environment reset is needed later and the $save_* variant is not # defined (see the code above). LC_ALL=C LANGUAGE=C export LANGUAGE LC_ALL # Make sure IFS has a sensible default sp=' ' nl=' ' IFS="$sp $nl" # There are apparently some systems that use ';' as a PATH separator! if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # func_unset VAR # -------------- # Portably unset VAR. # In some shells, an 'unset VAR' statement leaves a non-zero return # status if VAR is already unset, which might be problematic if the # statement is used at the end of a function (thus poisoning its return # value) or when 'set -e' is active (causing even a spurious abort of # the script in this case). func_unset () { { eval $1=; (eval unset $1) >/dev/null 2>&1 && eval unset $1 || : ; } } # Make sure CDPATH doesn't cause `cd` commands to output the target dir. func_unset CDPATH # Make sure ${,E,F}GREP behave sanely. func_unset GREP_OPTIONS ## ------------------------- ## ## Locate command utilities. ## ## ------------------------- ## # func_executable_p FILE # ---------------------- # Check that FILE is an executable regular file. func_executable_p () { test -f "$1" && test -x "$1" } # func_path_progs PROGS_LIST CHECK_FUNC [PATH] # -------------------------------------------- # Search for either a program that responds to --version with output # containing "GNU", or else returned by CHECK_FUNC otherwise, by # trying all the directories in PATH with each of the elements of # PROGS_LIST. # # CHECK_FUNC should accept the path to a candidate program, and # set $func_check_prog_result if it truncates its output less than # $_G_path_prog_max characters. func_path_progs () { _G_progs_list=$1 _G_check_func=$2 _G_PATH=${3-"$PATH"} _G_path_prog_max=0 _G_path_prog_found=false _G_save_IFS=$IFS; IFS=${PATH_SEPARATOR-:} for _G_dir in $_G_PATH; do IFS=$_G_save_IFS test -z "$_G_dir" && _G_dir=. for _G_prog_name in $_G_progs_list; do for _exeext in '' .EXE; do _G_path_prog=$_G_dir/$_G_prog_name$_exeext func_executable_p "$_G_path_prog" || continue case `"$_G_path_prog" --version 2>&1` in *GNU*) func_path_progs_result=$_G_path_prog _G_path_prog_found=: ;; *) $_G_check_func $_G_path_prog func_path_progs_result=$func_check_prog_result ;; esac $_G_path_prog_found && break 3 done done done IFS=$_G_save_IFS test -z "$func_path_progs_result" && { echo "no acceptable sed could be found in \$PATH" >&2 exit 1 } } # We want to be able to use the functions in this file before configure # has figured out where the best binaries are kept, which means we have # to search for them ourselves - except when the results are already set # where we skip the searches. # Unless the user overrides by setting SED, search the path for either GNU # sed, or the sed that truncates its output the least. test -z "$SED" && { _G_sed_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for _G_i in 1 2 3 4 5 6 7; do _G_sed_script=$_G_sed_script$nl$_G_sed_script done echo "$_G_sed_script" 2>/dev/null | sed 99q >conftest.sed _G_sed_script= func_check_prog_sed () { _G_path_prog=$1 _G_count=0 printf 0123456789 >conftest.in while : do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo '' >> conftest.nl "$_G_path_prog" -f conftest.sed conftest.out 2>/dev/null || break diff conftest.out conftest.nl >/dev/null 2>&1 || break _G_count=`expr $_G_count + 1` if test "$_G_count" -gt "$_G_path_prog_max"; then # Best one so far, save it but keep looking for a better one func_check_prog_result=$_G_path_prog _G_path_prog_max=$_G_count fi # 10*(2^10) chars as input seems more than enough test 10 -lt "$_G_count" && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out } func_path_progs "sed gsed" func_check_prog_sed "$PATH:/usr/xpg4/bin" rm -f conftest.sed SED=$func_path_progs_result } # Unless the user overrides by setting GREP, search the path for either GNU # grep, or the grep that truncates its output the least. test -z "$GREP" && { func_check_prog_grep () { _G_path_prog=$1 _G_count=0 _G_path_prog_max=0 printf 0123456789 >conftest.in while : do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo 'GREP' >> conftest.nl "$_G_path_prog" -e 'GREP$' -e '-(cannot match)-' conftest.out 2>/dev/null || break diff conftest.out conftest.nl >/dev/null 2>&1 || break _G_count=`expr $_G_count + 1` if test "$_G_count" -gt "$_G_path_prog_max"; then # Best one so far, save it but keep looking for a better one func_check_prog_result=$_G_path_prog _G_path_prog_max=$_G_count fi # 10*(2^10) chars as input seems more than enough test 10 -lt "$_G_count" && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out } func_path_progs "grep ggrep" func_check_prog_grep "$PATH:/usr/xpg4/bin" GREP=$func_path_progs_result } ## ------------------------------- ## ## User overridable command paths. ## ## ------------------------------- ## # All uppercase variable names are used for environment variables. These # variables can be overridden by the user before calling a script that # uses them if a suitable command of that name is not already available # in the command search PATH. : ${CP="cp -f"} : ${ECHO="printf %s\n"} : ${EGREP="$GREP -E"} : ${FGREP="$GREP -F"} : ${LN_S="ln -s"} : ${MAKE="make"} : ${MKDIR="mkdir"} : ${MV="mv -f"} : ${RM="rm -f"} : ${SHELL="${CONFIG_SHELL-/bin/sh}"} ## -------------------- ## ## Useful sed snippets. ## ## -------------------- ## sed_dirname='s|/[^/]*$||' sed_basename='s|^.*/||' # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. sed_quote_subst='s|\([`"$\\]\)|\\\1|g' # Same as above, but do not quote variable references. sed_double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution that turns a string into a regex matching for the # string literally. sed_make_literal_regex='s|[].[^$\\*\/]|\\&|g' # Sed substitution that converts a w32 file name or path # that contains forward slashes, into one that contains # (escaped) backslashes. A very naive implementation. sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' # Re-'\' parameter expansions in output of sed_double_quote_subst that # were '\'-ed in input to the same. If an odd number of '\' preceded a # '$' in input to sed_double_quote_subst, that '$' was protected from # expansion. Since each input '\' is now two '\'s, look for any number # of runs of four '\'s followed by two '\'s and then a '$'. '\' that '$'. _G_bs='\\' _G_bs2='\\\\' _G_bs4='\\\\\\\\' _G_dollar='\$' sed_double_backslash="\ s/$_G_bs4/&\\ /g s/^$_G_bs2$_G_dollar/$_G_bs&/ s/\\([^$_G_bs]\\)$_G_bs2$_G_dollar/\\1$_G_bs2$_G_bs$_G_dollar/g s/\n//g" # require_check_ifs_backslash # --------------------------- # Check if we can use backslash as IFS='\' separator, and set # $check_ifs_backshlash_broken to ':' or 'false'. require_check_ifs_backslash=func_require_check_ifs_backslash func_require_check_ifs_backslash () { _G_save_IFS=$IFS IFS='\' _G_check_ifs_backshlash='a\\b' for _G_i in $_G_check_ifs_backshlash do case $_G_i in a) check_ifs_backshlash_broken=false ;; '') break ;; *) check_ifs_backshlash_broken=: break ;; esac done IFS=$_G_save_IFS require_check_ifs_backslash=: } ## ----------------- ## ## Global variables. ## ## ----------------- ## # Except for the global variables explicitly listed below, the following # functions in the '^func_' namespace, and the '^require_' namespace # variables initialised in the 'Resource management' section, sourcing # this file will not pollute your global namespace with anything # else. There's no portable way to scope variables in Bourne shell # though, so actually running these functions will sometimes place # results into a variable named after the function, and often use # temporary variables in the '^_G_' namespace. If you are careful to # avoid using those namespaces casually in your sourcing script, things # should continue to work as you expect. And, of course, you can freely # overwrite any of the functions or variables defined here before # calling anything to customize them. EXIT_SUCCESS=0 EXIT_FAILURE=1 EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing. EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake. # Allow overriding, eg assuming that you follow the convention of # putting '$debug_cmd' at the start of all your functions, you can get # bash to show function call trace with: # # debug_cmd='echo "${FUNCNAME[0]} $*" >&2' bash your-script-name debug_cmd=${debug_cmd-":"} exit_cmd=: # By convention, finish your script with: # # exit $exit_status # # so that you can set exit_status to non-zero if you want to indicate # something went wrong during execution without actually bailing out at # the point of failure. exit_status=$EXIT_SUCCESS # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh # is ksh but when the shell is invoked as "sh" and the current value of # the _XPG environment variable is not equal to 1 (one), the special # positional parameter $0, within a function call, is the name of the # function. progpath=$0 # The name of this program. progname=`$ECHO "$progpath" |$SED "$sed_basename"` # Make sure we have an absolute progpath for reexecution: case $progpath in [\\/]*|[A-Za-z]:\\*) ;; *[\\/]*) progdir=`$ECHO "$progpath" |$SED "$sed_dirname"` progdir=`cd "$progdir" && pwd` progpath=$progdir/$progname ;; *) _G_IFS=$IFS IFS=${PATH_SEPARATOR-:} for progdir in $PATH; do IFS=$_G_IFS test -x "$progdir/$progname" && break done IFS=$_G_IFS test -n "$progdir" || progdir=`pwd` progpath=$progdir/$progname ;; esac ## ----------------- ## ## Standard options. ## ## ----------------- ## # The following options affect the operation of the functions defined # below, and should be set appropriately depending on run-time para- # meters passed on the command line. opt_dry_run=false opt_quiet=false opt_verbose=false # Categories 'all' and 'none' are always available. Append any others # you will pass as the first argument to func_warning from your own # code. warning_categories= # By default, display warnings according to 'opt_warning_types'. Set # 'warning_func' to ':' to elide all warnings, or func_fatal_error to # treat the next displayed warning as a fatal error. warning_func=func_warn_and_continue # Set to 'all' to display all warnings, 'none' to suppress all # warnings, or a space delimited list of some subset of # 'warning_categories' to display only the listed warnings. opt_warning_types=all ## -------------------- ## ## Resource management. ## ## -------------------- ## # This section contains definitions for functions that each ensure a # particular resource (a file, or a non-empty configuration variable for # example) is available, and if appropriate to extract default values # from pertinent package files. Call them using their associated # 'require_*' variable to ensure that they are executed, at most, once. # # It's entirely deliberate that calling these functions can set # variables that don't obey the namespace limitations obeyed by the rest # of this file, in order that that they be as useful as possible to # callers. # require_term_colors # ------------------- # Allow display of bold text on terminals that support it. require_term_colors=func_require_term_colors func_require_term_colors () { $debug_cmd test -t 1 && { # COLORTERM and USE_ANSI_COLORS environment variables take # precedence, because most terminfo databases neglect to describe # whether color sequences are supported. test -n "${COLORTERM+set}" && : ${USE_ANSI_COLORS="1"} if test 1 = "$USE_ANSI_COLORS"; then # Standard ANSI escape sequences tc_reset='' tc_bold=''; tc_standout='' tc_red=''; tc_green='' tc_blue=''; tc_cyan='' else # Otherwise trust the terminfo database after all. test -n "`tput sgr0 2>/dev/null`" && { tc_reset=`tput sgr0` test -n "`tput bold 2>/dev/null`" && tc_bold=`tput bold` tc_standout=$tc_bold test -n "`tput smso 2>/dev/null`" && tc_standout=`tput smso` test -n "`tput setaf 1 2>/dev/null`" && tc_red=`tput setaf 1` test -n "`tput setaf 2 2>/dev/null`" && tc_green=`tput setaf 2` test -n "`tput setaf 4 2>/dev/null`" && tc_blue=`tput setaf 4` test -n "`tput setaf 5 2>/dev/null`" && tc_cyan=`tput setaf 5` } fi } require_term_colors=: } ## ----------------- ## ## Function library. ## ## ----------------- ## # This section contains a variety of useful functions to call in your # scripts. Take note of the portable wrappers for features provided by # some modern shells, which will fall back to slower equivalents on # less featureful shells. # func_append VAR VALUE # --------------------- # Append VALUE onto the existing contents of VAR. # _G_HAVE_PLUSEQ_OP # Can be empty, in which case the shell is probed, "yes" if += is # usable or anything else if it does not work. if test -z "$_G_HAVE_PLUSEQ_OP" && \ __PLUSEQ_TEST="a" && \ __PLUSEQ_TEST+=" b" 2>/dev/null && \ test "a b" = "$__PLUSEQ_TEST"; then _G_HAVE_PLUSEQ_OP=yes fi if test yes = "$_G_HAVE_PLUSEQ_OP" then # This is an XSI compatible shell, allowing a faster implementation... eval 'func_append () { $debug_cmd eval "$1+=\$2" }' else # ...otherwise fall back to using expr, which is often a shell builtin. func_append () { $debug_cmd eval "$1=\$$1\$2" } fi # func_append_quoted VAR VALUE # ---------------------------- # Quote VALUE and append to the end of shell variable VAR, separated # by a space. if test yes = "$_G_HAVE_PLUSEQ_OP"; then eval 'func_append_quoted () { $debug_cmd func_quote_arg pretty "$2" eval "$1+=\\ \$func_quote_arg_result" }' else func_append_quoted () { $debug_cmd func_quote_arg pretty "$2" eval "$1=\$$1\\ \$func_quote_arg_result" } fi # func_append_uniq VAR VALUE # -------------------------- # Append unique VALUE onto the existing contents of VAR, assuming # entries are delimited by the first character of VALUE. For example: # # func_append_uniq options " --another-option option-argument" # # will only append to $options if " --another-option option-argument " # is not already present somewhere in $options already (note spaces at # each end implied by leading space in second argument). func_append_uniq () { $debug_cmd eval _G_current_value='`$ECHO $'$1'`' _G_delim=`expr "$2" : '\(.\)'` case $_G_delim$_G_current_value$_G_delim in *"$2$_G_delim"*) ;; *) func_append "$@" ;; esac } # func_arith TERM... # ------------------ # Set func_arith_result to the result of evaluating TERMs. test -z "$_G_HAVE_ARITH_OP" \ && (eval 'test 2 = $(( 1 + 1 ))') 2>/dev/null \ && _G_HAVE_ARITH_OP=yes if test yes = "$_G_HAVE_ARITH_OP"; then eval 'func_arith () { $debug_cmd func_arith_result=$(( $* )) }' else func_arith () { $debug_cmd func_arith_result=`expr "$@"` } fi # func_basename FILE # ------------------ # Set func_basename_result to FILE with everything up to and including # the last / stripped. if test yes = "$_G_HAVE_XSI_OPS"; then # If this shell supports suffix pattern removal, then use it to avoid # forking. Hide the definitions single quotes in case the shell chokes # on unsupported syntax... _b='func_basename_result=${1##*/}' _d='case $1 in */*) func_dirname_result=${1%/*}$2 ;; * ) func_dirname_result=$3 ;; esac' else # ...otherwise fall back to using sed. _b='func_basename_result=`$ECHO "$1" |$SED "$sed_basename"`' _d='func_dirname_result=`$ECHO "$1" |$SED "$sed_dirname"` if test "X$func_dirname_result" = "X$1"; then func_dirname_result=$3 else func_append func_dirname_result "$2" fi' fi eval 'func_basename () { $debug_cmd '"$_b"' }' # func_dirname FILE APPEND NONDIR_REPLACEMENT # ------------------------------------------- # Compute the dirname of FILE. If nonempty, add APPEND to the result, # otherwise set result to NONDIR_REPLACEMENT. eval 'func_dirname () { $debug_cmd '"$_d"' }' # func_dirname_and_basename FILE APPEND NONDIR_REPLACEMENT # -------------------------------------------------------- # Perform func_basename and func_dirname in a single function # call: # dirname: Compute the dirname of FILE. If nonempty, # add APPEND to the result, otherwise set result # to NONDIR_REPLACEMENT. # value returned in "$func_dirname_result" # basename: Compute filename of FILE. # value returned in "$func_basename_result" # For efficiency, we do not delegate to the functions above but instead # duplicate the functionality here. eval 'func_dirname_and_basename () { $debug_cmd '"$_b"' '"$_d"' }' # func_echo ARG... # ---------------- # Echo program name prefixed message. func_echo () { $debug_cmd _G_message=$* func_echo_IFS=$IFS IFS=$nl for _G_line in $_G_message; do IFS=$func_echo_IFS $ECHO "$progname: $_G_line" done IFS=$func_echo_IFS } # func_echo_all ARG... # -------------------- # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "$*" } # func_echo_infix_1 INFIX ARG... # ------------------------------ # Echo program name, followed by INFIX on the first line, with any # additional lines not showing INFIX. func_echo_infix_1 () { $debug_cmd $require_term_colors _G_infix=$1; shift _G_indent=$_G_infix _G_prefix="$progname: $_G_infix: " _G_message=$* # Strip color escape sequences before counting printable length for _G_tc in "$tc_reset" "$tc_bold" "$tc_standout" "$tc_red" "$tc_green" "$tc_blue" "$tc_cyan" do test -n "$_G_tc" && { _G_esc_tc=`$ECHO "$_G_tc" | $SED "$sed_make_literal_regex"` _G_indent=`$ECHO "$_G_indent" | $SED "s|$_G_esc_tc||g"` } done _G_indent="$progname: "`echo "$_G_indent" | $SED 's|.| |g'`" " ## exclude from sc_prohibit_nested_quotes func_echo_infix_1_IFS=$IFS IFS=$nl for _G_line in $_G_message; do IFS=$func_echo_infix_1_IFS $ECHO "$_G_prefix$tc_bold$_G_line$tc_reset" >&2 _G_prefix=$_G_indent done IFS=$func_echo_infix_1_IFS } # func_error ARG... # ----------------- # Echo program name prefixed message to standard error. func_error () { $debug_cmd $require_term_colors func_echo_infix_1 " $tc_standout${tc_red}error$tc_reset" "$*" >&2 } # func_fatal_error ARG... # ----------------------- # Echo program name prefixed message to standard error, and exit. func_fatal_error () { $debug_cmd func_error "$*" exit $EXIT_FAILURE } # func_grep EXPRESSION FILENAME # ----------------------------- # Check whether EXPRESSION matches any line of FILENAME, without output. func_grep () { $debug_cmd $GREP "$1" "$2" >/dev/null 2>&1 } # func_len STRING # --------------- # Set func_len_result to the length of STRING. STRING may not # start with a hyphen. test -z "$_G_HAVE_XSI_OPS" \ && (eval 'x=a/b/c; test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \ && _G_HAVE_XSI_OPS=yes if test yes = "$_G_HAVE_XSI_OPS"; then eval 'func_len () { $debug_cmd func_len_result=${#1} }' else func_len () { $debug_cmd func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len` } fi # func_mkdir_p DIRECTORY-PATH # --------------------------- # Make sure the entire path to DIRECTORY-PATH is available. func_mkdir_p () { $debug_cmd _G_directory_path=$1 _G_dir_list= if test -n "$_G_directory_path" && test : != "$opt_dry_run"; then # Protect directory names starting with '-' case $_G_directory_path in -*) _G_directory_path=./$_G_directory_path ;; esac # While some portion of DIR does not yet exist... while test ! -d "$_G_directory_path"; do # ...make a list in topmost first order. Use a colon delimited # list in case some portion of path contains whitespace. _G_dir_list=$_G_directory_path:$_G_dir_list # If the last portion added has no slash in it, the list is done case $_G_directory_path in */*) ;; *) break ;; esac # ...otherwise throw away the child directory and loop _G_directory_path=`$ECHO "$_G_directory_path" | $SED -e "$sed_dirname"` done _G_dir_list=`$ECHO "$_G_dir_list" | $SED 's|:*$||'` func_mkdir_p_IFS=$IFS; IFS=: for _G_dir in $_G_dir_list; do IFS=$func_mkdir_p_IFS # mkdir can fail with a 'File exist' error if two processes # try to create one of the directories concurrently. Don't # stop in that case! $MKDIR "$_G_dir" 2>/dev/null || : done IFS=$func_mkdir_p_IFS # Bail out if we (or some other process) failed to create a directory. test -d "$_G_directory_path" || \ func_fatal_error "Failed to create '$1'" fi } # func_mktempdir [BASENAME] # ------------------------- # Make a temporary directory that won't clash with other running # libtool processes, and avoids race conditions if possible. If # given, BASENAME is the basename for that directory. func_mktempdir () { $debug_cmd _G_template=${TMPDIR-/tmp}/${1-$progname} if test : = "$opt_dry_run"; then # Return a directory name, but don't create it in dry-run mode _G_tmpdir=$_G_template-$$ else # If mktemp works, use that first and foremost _G_tmpdir=`mktemp -d "$_G_template-XXXXXXXX" 2>/dev/null` if test ! -d "$_G_tmpdir"; then # Failing that, at least try and use $RANDOM to avoid a race _G_tmpdir=$_G_template-${RANDOM-0}$$ func_mktempdir_umask=`umask` umask 0077 $MKDIR "$_G_tmpdir" umask $func_mktempdir_umask fi # If we're not in dry-run mode, bomb out on failure test -d "$_G_tmpdir" || \ func_fatal_error "cannot create temporary directory '$_G_tmpdir'" fi $ECHO "$_G_tmpdir" } # func_normal_abspath PATH # ------------------------ # Remove doubled-up and trailing slashes, "." path components, # and cancel out any ".." path components in PATH after making # it an absolute path. func_normal_abspath () { $debug_cmd # These SED scripts presuppose an absolute path with a trailing slash. _G_pathcar='s|^/\([^/]*\).*$|\1|' _G_pathcdr='s|^/[^/]*||' _G_removedotparts=':dotsl s|/\./|/|g t dotsl s|/\.$|/|' _G_collapseslashes='s|/\{1,\}|/|g' _G_finalslash='s|/*$|/|' # Start from root dir and reassemble the path. func_normal_abspath_result= func_normal_abspath_tpath=$1 func_normal_abspath_altnamespace= case $func_normal_abspath_tpath in "") # Empty path, that just means $cwd. func_stripname '' '/' "`pwd`" func_normal_abspath_result=$func_stripname_result return ;; # The next three entries are used to spot a run of precisely # two leading slashes without using negated character classes; # we take advantage of case's first-match behaviour. ///*) # Unusual form of absolute path, do nothing. ;; //*) # Not necessarily an ordinary path; POSIX reserves leading '//' # and for example Cygwin uses it to access remote file shares # over CIFS/SMB, so we conserve a leading double slash if found. func_normal_abspath_altnamespace=/ ;; /*) # Absolute path, do nothing. ;; *) # Relative path, prepend $cwd. func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath ;; esac # Cancel out all the simple stuff to save iterations. We also want # the path to end with a slash for ease of parsing, so make sure # there is one (and only one) here. func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$_G_removedotparts" -e "$_G_collapseslashes" -e "$_G_finalslash"` while :; do # Processed it all yet? if test / = "$func_normal_abspath_tpath"; then # If we ascended to the root using ".." the result may be empty now. if test -z "$func_normal_abspath_result"; then func_normal_abspath_result=/ fi break fi func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$_G_pathcar"` func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$_G_pathcdr"` # Figure out what to do with it case $func_normal_abspath_tcomponent in "") # Trailing empty path component, ignore it. ;; ..) # Parent dir; strip last assembled component from result. func_dirname "$func_normal_abspath_result" func_normal_abspath_result=$func_dirname_result ;; *) # Actual path component, append it. func_append func_normal_abspath_result "/$func_normal_abspath_tcomponent" ;; esac done # Restore leading double-slash if one was found on entry. func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result } # func_notquiet ARG... # -------------------- # Echo program name prefixed message only when not in quiet mode. func_notquiet () { $debug_cmd $opt_quiet || func_echo ${1+"$@"} # A bug in bash halts the script if the last line of a function # fails when set -e is in force, so we need another command to # work around that: : } # func_relative_path SRCDIR DSTDIR # -------------------------------- # Set func_relative_path_result to the relative path from SRCDIR to DSTDIR. func_relative_path () { $debug_cmd func_relative_path_result= func_normal_abspath "$1" func_relative_path_tlibdir=$func_normal_abspath_result func_normal_abspath "$2" func_relative_path_tbindir=$func_normal_abspath_result # Ascend the tree starting from libdir while :; do # check if we have found a prefix of bindir case $func_relative_path_tbindir in $func_relative_path_tlibdir) # found an exact match func_relative_path_tcancelled= break ;; $func_relative_path_tlibdir*) # found a matching prefix func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir" func_relative_path_tcancelled=$func_stripname_result if test -z "$func_relative_path_result"; then func_relative_path_result=. fi break ;; *) func_dirname $func_relative_path_tlibdir func_relative_path_tlibdir=$func_dirname_result if test -z "$func_relative_path_tlibdir"; then # Have to descend all the way to the root! func_relative_path_result=../$func_relative_path_result func_relative_path_tcancelled=$func_relative_path_tbindir break fi func_relative_path_result=../$func_relative_path_result ;; esac done # Now calculate path; take care to avoid doubling-up slashes. func_stripname '' '/' "$func_relative_path_result" func_relative_path_result=$func_stripname_result func_stripname '/' '/' "$func_relative_path_tcancelled" if test -n "$func_stripname_result"; then func_append func_relative_path_result "/$func_stripname_result" fi # Normalisation. If bindir is libdir, return '.' else relative path. if test -n "$func_relative_path_result"; then func_stripname './' '' "$func_relative_path_result" func_relative_path_result=$func_stripname_result fi test -n "$func_relative_path_result" || func_relative_path_result=. : } # func_quote_portable EVAL ARG # ---------------------------- # Internal function to portably implement func_quote_arg. Note that we still # keep attention to performance here so we as much as possible try to avoid # calling sed binary (so far O(N) complexity as long as func_append is O(1)). func_quote_portable () { $debug_cmd $require_check_ifs_backslash func_quote_portable_result=$2 # one-time-loop (easy break) while true do if $1; then func_quote_portable_result=`$ECHO "$2" | $SED \ -e "$sed_double_quote_subst" -e "$sed_double_backslash"` break fi # Quote for eval. case $func_quote_portable_result in *[\\\`\"\$]*) # Fallback to sed for $func_check_bs_ifs_broken=:, or when the string # contains the shell wildcard characters. case $check_ifs_backshlash_broken$func_quote_portable_result in :*|*[\[\*\?]*) func_quote_portable_result=`$ECHO "$func_quote_portable_result" \ | $SED "$sed_quote_subst"` break ;; esac func_quote_portable_old_IFS=$IFS for _G_char in '\' '`' '"' '$' do # STATE($1) PREV($2) SEPARATOR($3) set start "" "" func_quote_portable_result=dummy"$_G_char$func_quote_portable_result$_G_char"dummy IFS=$_G_char for _G_part in $func_quote_portable_result do case $1 in quote) func_append func_quote_portable_result "$3$2" set quote "$_G_part" "\\$_G_char" ;; start) set first "" "" func_quote_portable_result= ;; first) set quote "$_G_part" "" ;; esac done done IFS=$func_quote_portable_old_IFS ;; *) ;; esac break done func_quote_portable_unquoted_result=$func_quote_portable_result case $func_quote_portable_result in # double-quote args containing shell metacharacters to delay # word splitting, command substitution and variable expansion # for a subsequent eval. # many bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") func_quote_portable_result=\"$func_quote_portable_result\" ;; esac } # func_quotefast_eval ARG # ----------------------- # Quote one ARG (internal). This is equivalent to 'func_quote_arg eval ARG', # but optimized for speed. Result is stored in $func_quotefast_eval. if test xyes = `(x=; printf -v x %q yes; echo x"$x") 2>/dev/null`; then printf -v _GL_test_printf_tilde %q '~' if test '\~' = "$_GL_test_printf_tilde"; then func_quotefast_eval () { printf -v func_quotefast_eval_result %q "$1" } else # Broken older Bash implementations. Make those faster too if possible. func_quotefast_eval () { case $1 in '~'*) func_quote_portable false "$1" func_quotefast_eval_result=$func_quote_portable_result ;; *) printf -v func_quotefast_eval_result %q "$1" ;; esac } fi else func_quotefast_eval () { func_quote_portable false "$1" func_quotefast_eval_result=$func_quote_portable_result } fi # func_quote_arg MODEs ARG # ------------------------ # Quote one ARG to be evaled later. MODEs argument may contain zero or more # specifiers listed below separated by ',' character. This function returns two # values: # i) func_quote_arg_result # double-quoted (when needed), suitable for a subsequent eval # ii) func_quote_arg_unquoted_result # has all characters that are still active within double # quotes backslashified. Available only if 'unquoted' is specified. # # Available modes: # ---------------- # 'eval' (default) # - escape shell special characters # 'expand' # - the same as 'eval'; but do not quote variable references # 'pretty' # - request aesthetic output, i.e. '"a b"' instead of 'a\ b'. This might # be used later in func_quote to get output like: 'echo "a b"' instead # of 'echo a\ b'. This is slower than default on some shells. # 'unquoted' # - produce also $func_quote_arg_unquoted_result which does not contain # wrapping double-quotes. # # Examples for 'func_quote_arg pretty,unquoted string': # # string | *_result | *_unquoted_result # ------------+-----------------------+------------------- # " | \" | \" # a b | "a b" | a b # "a b" | "\"a b\"" | \"a b\" # * | "*" | * # z="${x-$y}" | "z=\"\${x-\$y}\"" | z=\"\${x-\$y}\" # # Examples for 'func_quote_arg pretty,unquoted,expand string': # # string | *_result | *_unquoted_result # --------------+---------------------+-------------------- # z="${x-$y}" | "z=\"${x-$y}\"" | z=\"${x-$y}\" func_quote_arg () { _G_quote_expand=false case ,$1, in *,expand,*) _G_quote_expand=: ;; esac case ,$1, in *,pretty,*|*,expand,*|*,unquoted,*) func_quote_portable $_G_quote_expand "$2" func_quote_arg_result=$func_quote_portable_result func_quote_arg_unquoted_result=$func_quote_portable_unquoted_result ;; *) # Faster quote-for-eval for some shells. func_quotefast_eval "$2" func_quote_arg_result=$func_quotefast_eval_result ;; esac } # func_quote MODEs ARGs... # ------------------------ # Quote all ARGs to be evaled later and join them into single command. See # func_quote_arg's description for more info. func_quote () { $debug_cmd _G_func_quote_mode=$1 ; shift func_quote_result= while test 0 -lt $#; do func_quote_arg "$_G_func_quote_mode" "$1" if test -n "$func_quote_result"; then func_append func_quote_result " $func_quote_arg_result" else func_append func_quote_result "$func_quote_arg_result" fi shift done } # func_stripname PREFIX SUFFIX NAME # --------------------------------- # strip PREFIX and SUFFIX from NAME, and store in func_stripname_result. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). if test yes = "$_G_HAVE_XSI_OPS"; then eval 'func_stripname () { $debug_cmd # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are # positional parameters, so assign one to ordinary variable first. func_stripname_result=$3 func_stripname_result=${func_stripname_result#"$1"} func_stripname_result=${func_stripname_result%"$2"} }' else func_stripname () { $debug_cmd case $2 in .*) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%\\\\$2\$%%"`;; *) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%$2\$%%"`;; esac } fi # func_show_eval CMD [FAIL_EXP] # ----------------------------- # Unless opt_quiet is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. func_show_eval () { $debug_cmd _G_cmd=$1 _G_fail_exp=${2-':'} func_quote_arg pretty,expand "$_G_cmd" eval "func_notquiet $func_quote_arg_result" $opt_dry_run || { eval "$_G_cmd" _G_status=$? if test 0 -ne "$_G_status"; then eval "(exit $_G_status); $_G_fail_exp" fi } } # func_show_eval_locale CMD [FAIL_EXP] # ------------------------------------ # Unless opt_quiet is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. Use the saved locale for evaluation. func_show_eval_locale () { $debug_cmd _G_cmd=$1 _G_fail_exp=${2-':'} $opt_quiet || { func_quote_arg expand,pretty "$_G_cmd" eval "func_echo $func_quote_arg_result" } $opt_dry_run || { eval "$_G_user_locale $_G_cmd" _G_status=$? eval "$_G_safe_locale" if test 0 -ne "$_G_status"; then eval "(exit $_G_status); $_G_fail_exp" fi } } # func_tr_sh # ---------- # Turn $1 into a string suitable for a shell variable name. # Result is stored in $func_tr_sh_result. All characters # not in the set a-zA-Z0-9_ are replaced with '_'. Further, # if $1 begins with a digit, a '_' is prepended as well. func_tr_sh () { $debug_cmd case $1 in [0-9]* | *[!a-zA-Z0-9_]*) func_tr_sh_result=`$ECHO "$1" | $SED -e 's/^\([0-9]\)/_\1/' -e 's/[^a-zA-Z0-9_]/_/g'` ;; * ) func_tr_sh_result=$1 ;; esac } # func_verbose ARG... # ------------------- # Echo program name prefixed message in verbose mode only. func_verbose () { $debug_cmd $opt_verbose && func_echo "$*" : } # func_warn_and_continue ARG... # ----------------------------- # Echo program name prefixed warning message to standard error. func_warn_and_continue () { $debug_cmd $require_term_colors func_echo_infix_1 "${tc_red}warning$tc_reset" "$*" >&2 } # func_warning CATEGORY ARG... # ---------------------------- # Echo program name prefixed warning message to standard error. Warning # messages can be filtered according to CATEGORY, where this function # elides messages where CATEGORY is not listed in the global variable # 'opt_warning_types'. func_warning () { $debug_cmd # CATEGORY must be in the warning_categories list! case " $warning_categories " in *" $1 "*) ;; *) func_internal_error "invalid warning category '$1'" ;; esac _G_category=$1 shift case " $opt_warning_types " in *" $_G_category "*) $warning_func ${1+"$@"} ;; esac } # func_sort_ver VER1 VER2 # ----------------------- # 'sort -V' is not generally available. # Note this deviates from the version comparison in automake # in that it treats 1.5 < 1.5.0, and treats 1.4.4a < 1.4-p3a # but this should suffice as we won't be specifying old # version formats or redundant trailing .0 in bootstrap.conf. # If we did want full compatibility then we should probably # use m4_version_compare from autoconf. func_sort_ver () { $debug_cmd printf '%s\n%s\n' "$1" "$2" \ | sort -t. -k 1,1n -k 2,2n -k 3,3n -k 4,4n -k 5,5n -k 6,6n -k 7,7n -k 8,8n -k 9,9n } # func_lt_ver PREV CURR # --------------------- # Return true if PREV and CURR are in the correct order according to # func_sort_ver, otherwise false. Use it like this: # # func_lt_ver "$prev_ver" "$proposed_ver" || func_fatal_error "..." func_lt_ver () { $debug_cmd test "x$1" = x`func_sort_ver "$1" "$2" | $SED 1q` } # Local variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC" # time-stamp-time-zone: "UTC" # End: #! /bin/sh # A portable, pluggable option parser for Bourne shell. # Written by Gary V. Vaughan, 2010 # This is free software. There is NO warranty; not even for # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # # Copyright (C) 2010-2019, 2021, 2023-2024 Bootstrap Authors # # This file is dual licensed under the terms of the MIT license # , and GPL version 2 or later # . You must apply one of # these licenses when using or redistributing this software or any of # the files within it. See the URLs above, or the file `LICENSE` # included in the Bootstrap distribution for the full license texts. # Please report bugs or propose patches to: # # Set a version string for this script. scriptversion=2019-02-19.15; # UTC ## ------ ## ## Usage. ## ## ------ ## # This file is a library for parsing options in your shell scripts along # with assorted other useful supporting features that you can make use # of too. # # For the simplest scripts you might need only: # # #!/bin/sh # . relative/path/to/funclib.sh # . relative/path/to/options-parser # scriptversion=1.0 # func_options ${1+"$@"} # eval set dummy "$func_options_result"; shift # ...rest of your script... # # In order for the '--version' option to work, you will need to have a # suitably formatted comment like the one at the top of this file # starting with '# Written by ' and ending with '# Copyright'. # # For '-h' and '--help' to work, you will also need a one line # description of your script's purpose in a comment directly above the # '# Written by ' line, like the one at the top of this file. # # The default options also support '--debug', which will turn on shell # execution tracing (see the comment above debug_cmd below for another # use), and '--verbose' and the func_verbose function to allow your script # to display verbose messages only when your user has specified # '--verbose'. # # After sourcing this file, you can plug in processing for additional # options by amending the variables from the 'Configuration' section # below, and following the instructions in the 'Option parsing' # section further down. ## -------------- ## ## Configuration. ## ## -------------- ## # You should override these variables in your script after sourcing this # file so that they reflect the customisations you have added to the # option parser. # The usage line for option parsing errors and the start of '-h' and # '--help' output messages. You can embed shell variables for delayed # expansion at the time the message is displayed, but you will need to # quote other shell meta-characters carefully to prevent them being # expanded when the contents are evaled. usage='$progpath [OPTION]...' # Short help message in response to '-h' and '--help'. Add to this or # override it after sourcing this library to reflect the full set of # options your script accepts. usage_message="\ --debug enable verbose shell tracing -W, --warnings=CATEGORY report the warnings falling in CATEGORY [all] -v, --verbose verbosely report processing --version print version information and exit -h, --help print short or long help message and exit " # Additional text appended to 'usage_message' in response to '--help'. long_help_message=" Warning categories include: 'all' show all warnings 'none' turn off all the warnings 'error' warnings are treated as fatal errors" # Help message printed before fatal option parsing errors. fatal_help="Try '\$progname --help' for more information." ## ------------------------- ## ## Hook function management. ## ## ------------------------- ## # This section contains functions for adding, removing, and running hooks # in the main code. A hook is just a list of function names that can be # run in order later on. # func_hookable FUNC_NAME # ----------------------- # Declare that FUNC_NAME will run hooks added with # 'func_add_hook FUNC_NAME ...'. func_hookable () { $debug_cmd func_append hookable_fns " $1" } # func_add_hook FUNC_NAME HOOK_FUNC # --------------------------------- # Request that FUNC_NAME call HOOK_FUNC before it returns. FUNC_NAME must # first have been declared "hookable" by a call to 'func_hookable'. func_add_hook () { $debug_cmd case " $hookable_fns " in *" $1 "*) ;; *) func_fatal_error "'$1' does not accept hook functions." ;; esac eval func_append ${1}_hooks '" $2"' } # func_remove_hook FUNC_NAME HOOK_FUNC # ------------------------------------ # Remove HOOK_FUNC from the list of hook functions to be called by # FUNC_NAME. func_remove_hook () { $debug_cmd eval ${1}_hooks='`$ECHO "\$'$1'_hooks" |$SED "s| '$2'||"`' } # func_propagate_result FUNC_NAME_A FUNC_NAME_B # --------------------------------------------- # If the *_result variable of FUNC_NAME_A _is set_, assign its value to # *_result variable of FUNC_NAME_B. func_propagate_result () { $debug_cmd func_propagate_result_result=: if eval "test \"\${${1}_result+set}\" = set" then eval "${2}_result=\$${1}_result" else func_propagate_result_result=false fi } # func_run_hooks FUNC_NAME [ARG]... # --------------------------------- # Run all hook functions registered to FUNC_NAME. # It's assumed that the list of hook functions contains nothing more # than a whitespace-delimited list of legal shell function names, and # no effort is wasted trying to catch shell meta-characters or preserve # whitespace. func_run_hooks () { $debug_cmd _G_rc_run_hooks=false case " $hookable_fns " in *" $1 "*) ;; *) func_fatal_error "'$1' does not support hook functions." ;; esac eval _G_hook_fns=\$$1_hooks; shift for _G_hook in $_G_hook_fns; do func_unset "${_G_hook}_result" eval $_G_hook '${1+"$@"}' func_propagate_result $_G_hook func_run_hooks if $func_propagate_result_result; then eval set dummy "$func_run_hooks_result"; shift fi done } ## --------------- ## ## Option parsing. ## ## --------------- ## # In order to add your own option parsing hooks, you must accept the # full positional parameter list from your hook function. You may remove # or edit any options that you action, and then pass back the remaining # unprocessed options in '_result', escaped # suitably for 'eval'. # # The '_result' variable is automatically unset # before your hook gets called; for best performance, only set the # *_result variable when necessary (i.e. don't call the 'func_quote' # function unnecessarily because it can be an expensive operation on some # machines). # # Like this: # # my_options_prep () # { # $debug_cmd # # # Extend the existing usage message. # usage_message=$usage_message' # -s, --silent don'\''t print informational messages # ' # # No change in '$@' (ignored completely by this hook). Leave # # my_options_prep_result variable intact. # } # func_add_hook func_options_prep my_options_prep # # # my_silent_option () # { # $debug_cmd # # args_changed=false # # # Note that, for efficiency, we parse as many options as we can # # recognise in a loop before passing the remainder back to the # # caller on the first unrecognised argument we encounter. # while test $# -gt 0; do # opt=$1; shift # case $opt in # --silent|-s) opt_silent=: # args_changed=: # ;; # # Separate non-argument short options: # -s*) func_split_short_opt "$_G_opt" # set dummy "$func_split_short_opt_name" \ # "-$func_split_short_opt_arg" ${1+"$@"} # shift # args_changed=: # ;; # *) # Make sure the first unrecognised option "$_G_opt" # # is added back to "$@" in case we need it later, # # if $args_changed was set to 'true'. # set dummy "$_G_opt" ${1+"$@"}; shift; break ;; # esac # done # # # Only call 'func_quote' here if we processed at least one argument. # if $args_changed; then # func_quote eval ${1+"$@"} # my_silent_option_result=$func_quote_result # fi # } # func_add_hook func_parse_options my_silent_option # # # my_option_validation () # { # $debug_cmd # # $opt_silent && $opt_verbose && func_fatal_help "\ # '--silent' and '--verbose' options are mutually exclusive." # } # func_add_hook func_validate_options my_option_validation # # You'll also need to manually amend $usage_message to reflect the extra # options you parse. It's preferable to append if you can, so that # multiple option parsing hooks can be added safely. # func_options_finish [ARG]... # ---------------------------- # Finishing the option parse loop (call 'func_options' hooks ATM). func_options_finish () { $debug_cmd func_run_hooks func_options ${1+"$@"} func_propagate_result func_run_hooks func_options_finish } # func_options [ARG]... # --------------------- # All the functions called inside func_options are hookable. See the # individual implementations for details. func_hookable func_options func_options () { $debug_cmd _G_options_quoted=false for my_func in options_prep parse_options validate_options options_finish do func_unset func_${my_func}_result func_unset func_run_hooks_result eval func_$my_func '${1+"$@"}' func_propagate_result func_$my_func func_options if $func_propagate_result_result; then eval set dummy "$func_options_result"; shift _G_options_quoted=: fi done $_G_options_quoted || { # As we (func_options) are top-level options-parser function and # nobody quoted "$@" for us yet, we need to do it explicitly for # caller. func_quote eval ${1+"$@"} func_options_result=$func_quote_result } } # func_options_prep [ARG]... # -------------------------- # All initialisations required before starting the option parse loop. # Note that when calling hook functions, we pass through the list of # positional parameters. If a hook function modifies that list, and # needs to propagate that back to rest of this script, then the complete # modified list must be put in 'func_run_hooks_result' before returning. func_hookable func_options_prep func_options_prep () { $debug_cmd # Option defaults: opt_verbose=false opt_warning_types= func_run_hooks func_options_prep ${1+"$@"} func_propagate_result func_run_hooks func_options_prep } # func_parse_options [ARG]... # --------------------------- # The main option parsing loop. func_hookable func_parse_options func_parse_options () { $debug_cmd _G_parse_options_requote=false # this just eases exit handling while test $# -gt 0; do # Defer to hook functions for initial option parsing, so they # get priority in the event of reusing an option name. func_run_hooks func_parse_options ${1+"$@"} func_propagate_result func_run_hooks func_parse_options if $func_propagate_result_result; then eval set dummy "$func_parse_options_result"; shift # Even though we may have changed "$@", we passed the "$@" array # down into the hook and it quoted it for us (because we are in # this if-branch). No need to quote it again. _G_parse_options_requote=false fi # Break out of the loop if we already parsed every option. test $# -gt 0 || break # We expect that one of the options parsed in this function matches # and thus we remove _G_opt from "$@" and need to re-quote. _G_match_parse_options=: _G_opt=$1 shift case $_G_opt in --debug|-x) debug_cmd='set -x' func_echo "enabling shell trace mode" >&2 $debug_cmd ;; --no-warnings|--no-warning|--no-warn) set dummy --warnings none ${1+"$@"} shift ;; --warnings|--warning|-W) if test $# = 0 && func_missing_arg $_G_opt; then _G_parse_options_requote=: break fi case " $warning_categories $1" in *" $1 "*) # trailing space prevents matching last $1 above func_append_uniq opt_warning_types " $1" ;; *all) opt_warning_types=$warning_categories ;; *none) opt_warning_types=none warning_func=: ;; *error) opt_warning_types=$warning_categories warning_func=func_fatal_error ;; *) func_fatal_error \ "unsupported warning category: '$1'" ;; esac shift ;; --verbose|-v) opt_verbose=: ;; --version) func_version ;; -\?|-h) func_usage ;; --help) func_help ;; # Separate optargs to long options (plugins may need this): --*=*) func_split_equals "$_G_opt" set dummy "$func_split_equals_lhs" \ "$func_split_equals_rhs" ${1+"$@"} shift ;; # Separate optargs to short options: -W*) func_split_short_opt "$_G_opt" set dummy "$func_split_short_opt_name" \ "$func_split_short_opt_arg" ${1+"$@"} shift ;; # Separate non-argument short options: -\?*|-h*|-v*|-x*) func_split_short_opt "$_G_opt" set dummy "$func_split_short_opt_name" \ "-$func_split_short_opt_arg" ${1+"$@"} shift ;; --) _G_parse_options_requote=: ; break ;; -*) func_fatal_help "unrecognised option: '$_G_opt'" ;; *) set dummy "$_G_opt" ${1+"$@"}; shift _G_match_parse_options=false break ;; esac if $_G_match_parse_options; then _G_parse_options_requote=: fi done if $_G_parse_options_requote; then # save modified positional parameters for caller func_quote eval ${1+"$@"} func_parse_options_result=$func_quote_result fi } # func_validate_options [ARG]... # ------------------------------ # Perform any sanity checks on option settings and/or unconsumed # arguments. func_hookable func_validate_options func_validate_options () { $debug_cmd # Display all warnings if -W was not given. test -n "$opt_warning_types" || opt_warning_types=" $warning_categories" func_run_hooks func_validate_options ${1+"$@"} func_propagate_result func_run_hooks func_validate_options # Bail if the options were screwed! $exit_cmd $EXIT_FAILURE } ## ----------------- ## ## Helper functions. ## ## ----------------- ## # This section contains the helper functions used by the rest of the # hookable option parser framework in ascii-betical order. # func_fatal_help ARG... # ---------------------- # Echo program name prefixed message to standard error, followed by # a help hint, and exit. func_fatal_help () { $debug_cmd eval \$ECHO \""Usage: $usage"\" eval \$ECHO \""$fatal_help"\" func_error ${1+"$@"} exit $EXIT_FAILURE } # func_help # --------- # Echo long help message to standard output and exit. func_help () { $debug_cmd func_usage_message $ECHO "$long_help_message" exit 0 } # func_missing_arg ARGNAME # ------------------------ # Echo program name prefixed message to standard error and set global # exit_cmd. func_missing_arg () { $debug_cmd func_error "Missing argument for '$1'." exit_cmd=exit } # func_split_equals STRING # ------------------------ # Set func_split_equals_lhs and func_split_equals_rhs shell variables # after splitting STRING at the '=' sign. test -z "$_G_HAVE_XSI_OPS" \ && (eval 'x=a/b/c; test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \ && _G_HAVE_XSI_OPS=yes if test yes = "$_G_HAVE_XSI_OPS" then # This is an XSI compatible shell, allowing a faster implementation... eval 'func_split_equals () { $debug_cmd func_split_equals_lhs=${1%%=*} func_split_equals_rhs=${1#*=} if test "x$func_split_equals_lhs" = "x$1"; then func_split_equals_rhs= fi }' else # ...otherwise fall back to using expr, which is often a shell builtin. func_split_equals () { $debug_cmd func_split_equals_lhs=`expr "x$1" : 'x\([^=]*\)'` func_split_equals_rhs= test "x$func_split_equals_lhs=" = "x$1" \ || func_split_equals_rhs=`expr "x$1" : 'x[^=]*=\(.*\)$'` } fi #func_split_equals # func_split_short_opt SHORTOPT # ----------------------------- # Set func_split_short_opt_name and func_split_short_opt_arg shell # variables after splitting SHORTOPT after the 2nd character. if test yes = "$_G_HAVE_XSI_OPS" then # This is an XSI compatible shell, allowing a faster implementation... eval 'func_split_short_opt () { $debug_cmd func_split_short_opt_arg=${1#??} func_split_short_opt_name=${1%"$func_split_short_opt_arg"} }' else # ...otherwise fall back to using expr, which is often a shell builtin. func_split_short_opt () { $debug_cmd func_split_short_opt_name=`expr "x$1" : 'x\(-.\)'` func_split_short_opt_arg=`expr "x$1" : 'x-.\(.*\)$'` } fi #func_split_short_opt # func_usage # ---------- # Echo short help message to standard output and exit. func_usage () { $debug_cmd func_usage_message $ECHO "Run '$progname --help |${PAGER-more}' for full usage" exit 0 } # func_usage_message # ------------------ # Echo short help message to standard output. func_usage_message () { $debug_cmd eval \$ECHO \""Usage: $usage"\" echo $SED -n 's|^# || /^Written by/{ x;p;x } h /^Written by/q' < "$progpath" echo eval \$ECHO \""$usage_message"\" } # func_version # ------------ # Echo version message to standard output and exit. # The version message is extracted from the calling file's header # comments, with leading '# ' stripped: # 1. First display the progname and version # 2. Followed by the header comment line matching /^# Written by / # 3. Then a blank line followed by the first following line matching # /^# Copyright / # 4. Immediately followed by any lines between the previous matches, # except lines preceding the intervening completely blank line. # For example, see the header comments of this file. func_version () { $debug_cmd printf '%s\n' "$progname $scriptversion" $SED -n ' /^# Written by /!b s|^# ||; p; n :fwd2blnk /./ { n b fwd2blnk } p; n :holdwrnt s|^# || s|^# *$|| /^Copyright /!{ /./H n b holdwrnt } s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2| G s|\(\n\)\n*|\1|g p; q' < "$progpath" exit $? } # Local variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-pattern: "30/scriptversion=%:y-%02m-%02d.%02H; # UTC" # time-stamp-time-zone: "UTC" # End: # Set a version string. scriptversion='(GNU libtool) 2.5.4' # func_version # ------------ # Echo version message to standard output and exit. func_version () { $debug_cmd year=`date +%Y` cat < This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Originally written by Gordon Matzigkeit, 1996 (See AUTHORS for complete contributor listing) EOF exit $? } # func_echo ARG... # ---------------- # Libtool also displays the current mode in messages, so override # funclib.sh func_echo with this custom definition. func_echo () { $debug_cmd _G_message=$* func_echo_IFS=$IFS IFS=$nl for _G_line in $_G_message; do IFS=$func_echo_IFS $ECHO "$progname${opt_mode+: $opt_mode}: $_G_line" done IFS=$func_echo_IFS } ## ---------------- ## ## Options parsing. ## ## ---------------- ## # Hook in the functions to make sure our own options are parsed during # the option parsing loop. usage='$progpath [OPTION]... [MODE-ARG]...' # Short help message in response to '-h'. usage_message="Options: --config show all configuration variables --debug enable verbose shell tracing -n, --dry-run display commands without modifying any files --features display basic configuration information --finish use operation '--mode=finish' --mode=MODE use operation mode MODE --no-finish don't update shared library cache --no-quiet, --no-silent print default informational messages --no-warnings equivalent to '-Wnone' --preserve-dup-deps don't remove duplicate dependency libraries --quiet, --silent don't print informational messages --reorder-cache=DIRS reorder shared library cache for preferred DIRS --tag=TAG use configuration variables from tag TAG -v, --verbose print more informational messages than default --version print version information -W, --warnings=CATEGORY report the warnings falling in CATEGORY [all] -h, --help, --help-all print short, long, or detailed help message " # Additional text appended to 'usage_message' in response to '--help'. func_help () { $debug_cmd func_usage_message $ECHO "$long_help_message MODE must be one of the following: clean remove files from the build directory compile compile a source file into a libtool object execute automatically set library path, then run a program finish complete the installation of libtool libraries install install libraries or executables link create a library or an executable uninstall remove libraries from an installed directory MODE-ARGS vary depending on the MODE. When passed as first option, '--mode=MODE' may be abbreviated as 'MODE' or a unique abbreviation of that. Try '$progname --help --mode=MODE' for a more detailed description of MODE. When reporting a bug, please describe a test case to reproduce it and include the following information: host-triplet: $host shell: $SHELL compiler: $LTCC compiler flags: $LTCFLAGS linker: $LD (gnu? $with_gnu_ld) version: $progname $scriptversion Debian-2.5.4-4 automake: `($AUTOMAKE --version) 2>/dev/null |$SED 1q` autoconf: `($AUTOCONF --version) 2>/dev/null |$SED 1q` Report bugs to . GNU libtool home page: . General help using GNU software: ." exit 0 } # func_lo2o OBJECT-NAME # --------------------- # Transform OBJECT-NAME from a '.lo' suffix to the platform specific # object suffix. lo2o=s/\\.lo\$/.$objext/ o2lo=s/\\.$objext\$/.lo/ if test yes = "$_G_HAVE_XSI_OPS"; then eval 'func_lo2o () { case $1 in *.lo) func_lo2o_result=${1%.lo}.$objext ;; * ) func_lo2o_result=$1 ;; esac }' # func_xform LIBOBJ-OR-SOURCE # --------------------------- # Transform LIBOBJ-OR-SOURCE from a '.o' or '.c' (or otherwise) # suffix to a '.lo' libtool-object suffix. eval 'func_xform () { func_xform_result=${1%.*}.lo }' else # ...otherwise fall back to using sed. func_lo2o () { func_lo2o_result=`$ECHO "$1" | $SED "$lo2o"` } func_xform () { func_xform_result=`$ECHO "$1" | $SED 's|\.[^.]*$|.lo|'` } fi # func_fatal_configuration ARG... # ------------------------------- # Echo program name prefixed message to standard error, followed by # a configuration failure hint, and exit. func_fatal_configuration () { func_fatal_error ${1+"$@"} \ "See the $PACKAGE documentation for more information." \ "Fatal configuration error." } # func_config # ----------- # Display the configuration for all the tags in this script. func_config () { re_begincf='^# ### BEGIN LIBTOOL' re_endcf='^# ### END LIBTOOL' # Default configuration. $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath" # Now print the configurations for the tags. for tagname in $taglist; do $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath" done exit $? } # func_features # ------------- # Display the features supported by this script. func_features () { echo "host: $host" if test yes = "$build_libtool_libs"; then echo "enable shared libraries" else echo "disable shared libraries" fi if test yes = "$build_old_libs"; then echo "enable static libraries" else echo "disable static libraries" fi exit $? } # func_enable_tag TAGNAME # ----------------------- # Verify that TAGNAME is valid, and either flag an error and exit, or # enable the TAGNAME tag. We also add TAGNAME to the global $taglist # variable here. func_enable_tag () { # Global variable: tagname=$1 re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$" re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$" sed_extractcf=/$re_begincf/,/$re_endcf/p # Validate tagname. case $tagname in *[!-_A-Za-z0-9,/]*) func_fatal_error "invalid tag name: $tagname" ;; esac # Don't test for the "default" C tag, as we know it's # there but not specially marked. case $tagname in CC) ;; *) if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then taglist="$taglist $tagname" # Evaluate the configuration. Be careful to quote the path # and the sed script, to avoid splitting on whitespace, but # also don't use non-portable quotes within backquotes within # quotes we have to do it in 2 steps: extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"` eval "$extractedcf" else func_error "ignoring unknown tag $tagname" fi ;; esac } # func_check_version_match # ------------------------ # Ensure that we are using m4 macros, and libtool script from the same # release of libtool. func_check_version_match () { if test "$package_revision" != "$macro_revision"; then if test "$VERSION" != "$macro_version"; then if test -z "$macro_version"; then cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from an older release. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from $PACKAGE $macro_version. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF fi else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, $progname: but the definition of this LT_INIT comes from revision $macro_revision. $progname: You should recreate aclocal.m4 with macros from revision $package_revision $progname: of $PACKAGE $VERSION and run autoconf again. _LT_EOF fi exit $EXIT_MISMATCH fi } # libtool_options_prep [ARG]... # ----------------------------- # Preparation for options parsed by libtool. libtool_options_prep () { $debug_mode # Option defaults: opt_config=false opt_dlopen= opt_dry_run=false opt_help=false opt_mode= opt_reorder_cache=false opt_preserve_dup_deps=false opt_quiet=false opt_finishing=true opt_warning= nonopt= preserve_args= _G_rc_lt_options_prep=: _G_rc_lt_options_prep=: # 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 ;; *) _G_rc_lt_options_prep=false ;; esac if $_G_rc_lt_options_prep; then # Pass back the list of options. func_quote eval ${1+"$@"} libtool_options_prep_result=$func_quote_result fi } func_add_hook func_options_prep libtool_options_prep # libtool_parse_options [ARG]... # --------------------------------- # Provide handling for libtool specific options. libtool_parse_options () { $debug_cmd _G_rc_lt_parse_options=false # Perform our own loop to consume as many options as possible in # each iteration. while test $# -gt 0; do _G_match_lt_parse_options=: _G_opt=$1 shift case $_G_opt in --dry-run|--dryrun|-n) opt_dry_run=: ;; --config) func_config ;; --dlopen|-dlopen) opt_dlopen="${opt_dlopen+$opt_dlopen }$1" shift ;; --preserve-dup-deps) opt_preserve_dup_deps=: ;; --features) func_features ;; --finish) set dummy --mode finish ${1+"$@"}; shift ;; --help) opt_help=: ;; --help-all) opt_help=': help-all' ;; --mode) test $# = 0 && func_missing_arg $_G_opt && break opt_mode=$1 case $1 in # Valid mode arguments: clean|compile|execute|finish|install|link|relink|uninstall) ;; # Catch anything else as an error *) func_error "invalid argument '$1' for $_G_opt" exit_cmd=exit ;; esac shift ;; --no-finish) opt_finishing=false func_append preserve_args " $_G_opt" ;; --no-silent|--no-quiet) opt_quiet=false func_append preserve_args " $_G_opt" ;; --no-warnings|--no-warning|--no-warn) opt_warning=false func_append preserve_args " $_G_opt" ;; --no-verbose) opt_verbose=false func_append preserve_args " $_G_opt" ;; --reorder-cache) opt_reorder_cache=true shared_lib_dirs=$1 if test -n "$shared_lib_dirs"; then case $1 in # Must begin with /: /*) ;; # Catch anything else as an error (relative paths) *) func_error "invalid argument '$1' for $_G_opt" func_error "absolute paths are required for $_G_opt" exit_cmd=exit ;; esac fi shift ;; --silent|--quiet) opt_quiet=: opt_verbose=false func_append preserve_args " $_G_opt" ;; --tag) test $# = 0 && func_missing_arg $_G_opt && break opt_tag=$1 func_append preserve_args " $_G_opt $1" func_enable_tag "$1" shift ;; --verbose|-v) opt_quiet=false opt_verbose=: func_append preserve_args " $_G_opt" ;; # An option not handled by this hook function: *) set dummy "$_G_opt" ${1+"$@"} ; shift _G_match_lt_parse_options=false break ;; esac $_G_match_lt_parse_options && _G_rc_lt_parse_options=: done if $_G_rc_lt_parse_options; then # save modified positional parameters for caller func_quote eval ${1+"$@"} libtool_parse_options_result=$func_quote_result fi } func_add_hook func_parse_options libtool_parse_options # func_warning ARG... # ------------------- # Libtool warnings are not categorized, so override funclib.sh # func_warning with this simpler definition. func_warning () { if $opt_warning; then $debug_cmd $warning_func ${1+"$@"} fi } # libtool_validate_options [ARG]... # --------------------------------- # Perform any sanity checks on option settings and/or unconsumed # arguments. libtool_validate_options () { # save first non-option argument if test 0 -lt $#; then nonopt=$1 shift fi # preserve --debug test : = "$debug_cmd" || func_append preserve_args " --debug" case $host_os in # Solaris2 added to fix http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16452 # see also: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59788 cygwin* | mingw* | windows* | pw32* | cegcc* | solaris2* | os2*) # don't eliminate duplications in $postdeps and $predeps opt_duplicate_compiler_generated_deps=: ;; *) opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps ;; esac $opt_help || { # Sanity checks first: func_check_version_match test yes != "$build_libtool_libs" \ && test yes != "$build_old_libs" \ && func_fatal_configuration "not configured to build any kind of library" # Darwin sucks eval std_shrext=\"$shrext_cmds\" # Only execute mode is allowed to have -dlopen flags. if test -n "$opt_dlopen" && test execute != "$opt_mode"; then func_error "unrecognized option '-dlopen'" $ECHO "$help" 1>&2 exit $EXIT_FAILURE fi # Change the help message to a mode-specific one. generic_help=$help help="Try '$progname --help --mode=$opt_mode' for more information." } # Pass back the unparsed argument list func_quote eval ${1+"$@"} libtool_validate_options_result=$func_quote_result } func_add_hook func_validate_options libtool_validate_options # Process options as early as possible so that --help and --version # can return quickly. func_options ${1+"$@"} eval set dummy "$func_options_result"; shift ## ----------- ## ## Main. ## ## ----------- ## magic='%%%MAGIC variable%%%' magic_exe='%%%MAGIC EXE variable%%%' # Global variables. extracted_archives= extracted_serial=0 # If this variable is set in any of the actions, the command in it # will be execed at the end. This prevents here-documents from being # left over by shells. exec_cmd= # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } # func_generated_by_libtool # True iff stdin has been generated by Libtool. This function is only # a basic sanity check; it will hardly flush out determined imposters. func_generated_by_libtool_p () { $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 } # func_lalib_p file # True iff FILE is a libtool '.la' library or '.lo' object file. # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_lalib_p () { test -f "$1" && $SED -e 4q "$1" 2>/dev/null | func_generated_by_libtool_p } # func_lalib_unsafe_p file # True iff FILE is a libtool '.la' library or '.lo' object file. # This function implements the same check as func_lalib_p without # resorting to external programs. To this end, it redirects stdin and # closes it afterwards, without saving the original file descriptor. # As a safety measure, use it only where a negative result would be # fatal anyway. Works if 'file' does not exist. func_lalib_unsafe_p () { lalib_p=no if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then for lalib_p_l in 1 2 3 4 do read lalib_p_line case $lalib_p_line in \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;; esac done exec 0<&5 5<&- fi test yes = "$lalib_p" } # func_ltwrapper_script_p file # True iff FILE is a libtool wrapper script # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_script_p () { test -f "$1" && $lt_truncate_bin < "$1" 2>/dev/null | func_generated_by_libtool_p } # func_ltwrapper_executable_p file # True iff FILE is a libtool wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_executable_p () { func_ltwrapper_exec_suffix= case $1 in *.exe) ;; *) func_ltwrapper_exec_suffix=.exe ;; esac $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1 } # func_ltwrapper_scriptname file # Assumes file is an ltwrapper_executable # uses $file to determine the appropriate filename for a # temporary ltwrapper_script. func_ltwrapper_scriptname () { func_dirname_and_basename "$1" "" "." func_stripname '' '.exe' "$func_basename_result" func_ltwrapper_scriptname_result=$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper } # func_ltwrapper_p file # True iff FILE is a libtool wrapper script or wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_p () { func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1" } # func_execute_cmds commands fail_cmd # Execute tilde-delimited COMMANDS. # If FAIL_CMD is given, eval that upon failure. # FAIL_CMD may read-access the current command in variable CMD! func_execute_cmds () { $debug_cmd save_ifs=$IFS; IFS='~' for cmd in $1; do IFS=$sp$nl eval cmd=\"$cmd\" IFS=$save_ifs func_show_eval "$cmd" "${2-:}" done IFS=$save_ifs } # func_source file # Source FILE, adding directory component if necessary. # Note that it is not necessary on cygwin/mingw to append a dot to # FILE even if both FILE and FILE.exe exist: automatic-append-.exe # behavior happens only for exec(3), not for open(2)! Also, sourcing # 'FILE.' does not work on cygwin managed mounts. func_source () { $debug_cmd case $1 in */* | *\\*) . "$1" ;; *) . "./$1" ;; esac } # func_resolve_sysroot PATH # Replace a leading = in PATH with a sysroot. Store the result into # func_resolve_sysroot_result func_resolve_sysroot () { func_resolve_sysroot_result=$1 case $func_resolve_sysroot_result in =*) func_stripname '=' '' "$func_resolve_sysroot_result" func_resolve_sysroot_result=$lt_sysroot$func_stripname_result ;; esac } # func_replace_sysroot PATH # If PATH begins with the sysroot, replace it with = and # store the result into func_replace_sysroot_result. func_replace_sysroot () { case $lt_sysroot:$1 in ?*:"$lt_sysroot"*) func_stripname "$lt_sysroot" '' "$1" func_replace_sysroot_result='='$func_stripname_result ;; *) # Including no sysroot. func_replace_sysroot_result=$1 ;; esac } # func_infer_tag arg # Infer tagged configuration to use if any are available and # if one wasn't chosen via the "--tag" command line option. # Only attempt this if the compiler in the base compile # command doesn't match the default compiler. # arg is usually of the form 'gcc ...' func_infer_tag () { $debug_cmd if test -n "$available_tags" && test -z "$tagname"; then CC_quoted= for arg in $CC; do func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` case $@ in # Blanks in the command may have been stripped by the calling shell, # but not from the CC environment variable when configure was run. " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;; # Blanks at the start of $base_compile will cause this to fail # if we don't check for them as well. *) for z in $available_tags; do if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then # Evaluate the configuration. eval "`$SED -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" CC_quoted= for arg in $CC; do # Double-quote args containing other shell metacharacters. func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` case "$@ " in " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) # The compiler in the base compile command matches # the one in the tagged configuration. # Assume this is the tagged configuration we want. tagname=$z break ;; esac fi done # If $tagname still isn't set, then no tagged configuration # was found and let the user know that the "--tag" command # line option must be used. if test -z "$tagname"; then func_echo "unable to infer tagged configuration" func_fatal_error "specify a tag with '--tag'" # else # func_verbose "using $tagname tagged configuration" fi ;; esac fi } # func_write_libtool_object output_name pic_name nonpic_name # Create a libtool object file (analogous to a ".la" file), # but don't create it if we're doing a dry run. func_write_libtool_object () { write_libobj=$1 if test yes = "$build_libtool_libs"; then write_lobj=\'$2\' else write_lobj=none fi if test yes = "$build_old_libs"; then write_oldobj=\'$3\' else write_oldobj=none fi $opt_dry_run || { cat >${write_libobj}T </dev/null` if test "$?" -eq 0 && test -n "$func_convert_core_file_wine_to_w32_tmp"; then func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" | $SED -e "$sed_naive_backslashify"` else func_convert_core_file_wine_to_w32_result= fi fi } # end: func_convert_core_file_wine_to_w32 # func_convert_core_path_wine_to_w32 ARG # Helper function used by path conversion functions when $build is *nix, and # $host is mingw, windows, cygwin, or some other w32 environment. Relies on a # correctly configured wine environment available, with the winepath program # in $build's $PATH. Assumes ARG has no leading or trailing path separator # characters. # # ARG is path to be converted from $build format to win32. # Result is available in $func_convert_core_path_wine_to_w32_result. # Unconvertible file (directory) names in ARG are skipped; if no directory names # are convertible, then the result may be empty. func_convert_core_path_wine_to_w32 () { $debug_cmd # unfortunately, winepath doesn't convert paths, only file names func_convert_core_path_wine_to_w32_result= if test -n "$1"; then oldIFS=$IFS IFS=: for func_convert_core_path_wine_to_w32_f in $1; do IFS=$oldIFS func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f" if test -n "$func_convert_core_file_wine_to_w32_result"; then if test -z "$func_convert_core_path_wine_to_w32_result"; then func_convert_core_path_wine_to_w32_result=$func_convert_core_file_wine_to_w32_result else func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result" fi fi done IFS=$oldIFS fi } # end: func_convert_core_path_wine_to_w32 # func_cygpath ARGS... # Wrapper around calling the cygpath program via LT_CYGPATH. This is used when # when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2) # $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or # (2), returns the Cygwin file name or path in func_cygpath_result (input # file name or path is assumed to be in w32 format, as previously converted # from $build's *nix or MSYS format). In case (3), returns the w32 file name # or path in func_cygpath_result (input file name or path is assumed to be in # Cygwin format). Returns an empty string on error. # # ARGS are passed to cygpath, with the last one being the file name or path to # be converted. # # Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH # environment variable; do not put it in $PATH. func_cygpath () { $debug_cmd if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null` if test "$?" -ne 0; then # on failure, ensure result is empty func_cygpath_result= fi else func_cygpath_result= func_error "LT_CYGPATH is empty or specifies non-existent file: '$LT_CYGPATH'" fi } #end: func_cygpath # func_convert_core_msys_to_w32 ARG # Convert file name or path ARG from MSYS format to w32 format. Return # result in func_convert_core_msys_to_w32_result. func_convert_core_msys_to_w32 () { $debug_cmd # awkward: cmd appends spaces to result func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null | $SED -e 's/[ ]*$//' -e "$sed_naive_backslashify"` } #end: func_convert_core_msys_to_w32 # func_convert_file_check ARG1 ARG2 # Verify that ARG1 (a file name in $build format) was converted to $host # format in ARG2. Otherwise, emit an error message, but continue (resetting # func_to_host_file_result to ARG1). func_convert_file_check () { $debug_cmd if test -z "$2" && test -n "$1"; then func_error "Could not determine host file name corresponding to" func_error " '$1'" func_error "Continuing, but uninstalled executables may not work." # Fallback: func_to_host_file_result=$1 fi } # end func_convert_file_check # func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH # Verify that FROM_PATH (a path in $build format) was converted to $host # format in TO_PATH. Otherwise, emit an error message, but continue, resetting # func_to_host_file_result to a simplistic fallback value (see below). func_convert_path_check () { $debug_cmd if test -z "$4" && test -n "$3"; then func_error "Could not determine the host path corresponding to" func_error " '$3'" func_error "Continuing, but uninstalled executables may not work." # Fallback. This is a deliberately simplistic "conversion" and # should not be "improved". See libtool.info. if test "x$1" != "x$2"; then lt_replace_pathsep_chars="s|$1|$2|g" func_to_host_path_result=`echo "$3" | $SED -e "$lt_replace_pathsep_chars"` else func_to_host_path_result=$3 fi fi } # end func_convert_path_check # func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG # Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT # and appending REPL if ORIG matches BACKPAT. func_convert_path_front_back_pathsep () { $debug_cmd case $4 in $1 ) func_to_host_path_result=$3$func_to_host_path_result ;; esac case $4 in $2 ) func_append func_to_host_path_result "$3" ;; esac } # end func_convert_path_front_back_pathsep # func_convert_delimited_path PATH ORIG_DELIMITER NEW_DELIMITER # Replaces a delimiter for a given path. func_convert_delimited_path () { converted_path=`$ECHO "$1" | $SED "s#$2#$3#g"` } # end func_convert_delimited_path ################################################## # $build to $host FILE NAME CONVERSION FUNCTIONS # ################################################## # invoked via '$to_host_file_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # Result will be available in $func_to_host_file_result. # func_to_host_file ARG # Converts the file name ARG from $build format to $host format. Return result # in func_to_host_file_result. func_to_host_file () { $debug_cmd $to_host_file_cmd "$1" } # end func_to_host_file # func_to_tool_file ARG LAZY # converts the file name ARG from $build format to toolchain format. Return # result in func_to_tool_file_result. If the conversion in use is listed # in (the comma separated) LAZY, no conversion takes place. func_to_tool_file () { $debug_cmd case ,$2, in *,"$to_tool_file_cmd",*) func_to_tool_file_result=$1 ;; *) $to_tool_file_cmd "$1" func_to_tool_file_result=$func_to_host_file_result ;; esac } # end func_to_tool_file # func_convert_file_noop ARG # Copy ARG to func_to_host_file_result. func_convert_file_noop () { func_to_host_file_result=$1 } # end func_convert_file_noop # func_convert_file_msys_to_w32 ARG # Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic # conversion to w32 is not available inside the cwrapper. Returns result in # func_to_host_file_result. func_convert_file_msys_to_w32 () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_to_host_file_result=$func_convert_core_msys_to_w32_result fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_msys_to_w32 # func_convert_file_cygwin_to_w32 ARG # Convert file name ARG from Cygwin to w32 format. Returns result in # func_to_host_file_result. func_convert_file_cygwin_to_w32 () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then # because $build is cygwin, we call "the" cygpath in $PATH; no need to use # LT_CYGPATH in this case. func_to_host_file_result=`cygpath -m "$1"` fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_cygwin_to_w32 # func_convert_file_nix_to_w32 ARG # Convert file name ARG from *nix to w32 format. Requires a wine environment # and a working winepath. Returns result in func_to_host_file_result. func_convert_file_nix_to_w32 () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then func_convert_core_file_wine_to_w32 "$1" func_to_host_file_result=$func_convert_core_file_wine_to_w32_result fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_nix_to_w32 # func_convert_file_msys_to_cygwin ARG # Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. # Returns result in func_to_host_file_result. func_convert_file_msys_to_cygwin () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_cygpath -u "$func_convert_core_msys_to_w32_result" func_to_host_file_result=$func_cygpath_result fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_msys_to_cygwin # func_convert_file_nix_to_cygwin ARG # Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed # in a wine environment, working winepath, and LT_CYGPATH set. Returns result # in func_to_host_file_result. func_convert_file_nix_to_cygwin () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then # convert from *nix to w32, then use cygpath to convert from w32 to cygwin. func_convert_core_file_wine_to_w32 "$1" func_cygpath -u "$func_convert_core_file_wine_to_w32_result" func_to_host_file_result=$func_cygpath_result fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_nix_to_cygwin ############################################# # $build to $host PATH CONVERSION FUNCTIONS # ############################################# # invoked via '$to_host_path_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # The result will be available in $func_to_host_path_result. # # Path separators are also converted from $build format to $host format. If # ARG begins or ends with a path separator character, it is preserved (but # converted to $host format) on output. # # All path conversion functions are named using the following convention: # file name conversion function : func_convert_file_X_to_Y () # path conversion function : func_convert_path_X_to_Y () # where, for any given $build/$host combination the 'X_to_Y' value is the # same. If conversion functions are added for new $build/$host combinations, # the two new functions must follow this pattern, or func_init_to_host_path_cmd # will break. # func_init_to_host_path_cmd # Ensures that function "pointer" variable $to_host_path_cmd is set to the # appropriate value, based on the value of $to_host_file_cmd. to_host_path_cmd= func_init_to_host_path_cmd () { $debug_cmd if test -z "$to_host_path_cmd"; then func_stripname 'func_convert_file_' '' "$to_host_file_cmd" to_host_path_cmd=func_convert_path_$func_stripname_result fi } # func_to_host_path ARG # Converts the path ARG from $build format to $host format. Return result # in func_to_host_path_result. func_to_host_path () { $debug_cmd func_init_to_host_path_cmd $to_host_path_cmd "$1" } # end func_to_host_path # func_convert_path_noop ARG # Copy ARG to func_to_host_path_result. func_convert_path_noop () { func_to_host_path_result=$1 } # end func_convert_path_noop # func_convert_path_msys_to_w32 ARG # Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic # conversion to w32 is not available inside the cwrapper. Returns result in # func_to_host_path_result. func_convert_path_msys_to_w32 () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # Remove leading and trailing path separator characters from ARG. MSYS # behavior is inconsistent here; cygpath turns them into '.;' and ';.'; # and winepath ignores them completely. func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result=$func_convert_core_msys_to_w32_result func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_msys_to_w32 # func_convert_path_cygwin_to_w32 ARG # Convert path ARG from Cygwin to w32 format. Returns result in # func_to_host_file_result. func_convert_path_cygwin_to_w32 () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"` func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_cygwin_to_w32 # func_convert_path_nix_to_w32 ARG # Convert path ARG from *nix to w32 format. Requires a wine environment and # a working winepath. Returns result in func_to_host_file_result. func_convert_path_nix_to_w32 () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result=$func_convert_core_path_wine_to_w32_result func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_nix_to_w32 # func_convert_path_msys_to_cygwin ARG # Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. # Returns result in func_to_host_file_result. func_convert_path_msys_to_cygwin () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_msys_to_w32_result" func_to_host_path_result=$func_cygpath_result func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" fi } # end func_convert_path_msys_to_cygwin # func_convert_path_nix_to_cygwin ARG # Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a # a wine environment, working winepath, and LT_CYGPATH set. Returns result in # func_to_host_file_result. func_convert_path_nix_to_cygwin () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # Remove leading and trailing path separator characters from # ARG. msys behavior is inconsistent here, cygpath turns them # into '.;' and ';.', and winepath ignores them completely. func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result" func_to_host_path_result=$func_cygpath_result func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" fi } # end func_convert_path_nix_to_cygwin # func_dll_def_p FILE # True iff FILE is a Windows DLL '.def' file. # Keep in sync with _LT_DLL_DEF_P in libtool.m4 func_dll_def_p () { $debug_cmd func_dll_def_p_tmp=`$SED -n \ -e 's/^[ ]*//' \ -e '/^\(;.*\)*$/d' \ -e 's/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p' \ -e q \ "$1"` test DEF = "$func_dll_def_p_tmp" } # func_reorder_shared_lib_cache DIRS # Reorder the shared library cache by unconfiguring previous shared library cache # and configuring preferred search directories before previous search directories. # Previous shared library cache: /usr/lib /usr/local/lib # Preferred search directories: /tmp/testing # Reordered shared library cache: /tmp/testing /usr/lib /usr/local/lib func_reorder_shared_lib_cache () { $debug_cmd case $host_os in openbsd*) get_search_directories=`PATH="$PATH:/sbin" ldconfig -r | $GREP "search directories" | $SED "s#.*search directories:\ ##g"` func_convert_delimited_path "$get_search_directories" ':' '\ ' save_search_directories=$converted_path func_convert_delimited_path "$1" ':' '\ ' # Ensure directories exist for dir in $converted_path; do # Ensure each directory is an absolute path case $dir in /*) ;; *) func_error "Directory '$dir' is not an absolute path" exit $EXIT_FAILURE ;; esac # Ensure no trailing slashes func_stripname '' '/' "$dir" dir=$func_stripname_result if test -d "$dir"; then if test -n "$preferred_search_directories"; then preferred_search_directories="$preferred_search_directories $dir" else preferred_search_directories=$dir fi else func_error "Directory '$dir' does not exist" exit $EXIT_FAILURE fi done PATH="$PATH:/sbin" ldconfig -U $save_search_directories PATH="$PATH:/sbin" ldconfig -m $preferred_search_directories $save_search_directories get_search_directories=`PATH="$PATH:/sbin" ldconfig -r | $GREP "search directories" | $SED "s#.*search directories:\ ##g"` func_convert_delimited_path "$get_search_directories" ':' '\ ' reordered_search_directories=$converted_path $ECHO "Original: $save_search_directories" $ECHO "Reordered: $reordered_search_directories" exit $EXIT_SUCCESS ;; *) func_error "--reorder-cache is not supported for host_os=$host_os." exit $EXIT_FAILURE ;; esac } # end func_reorder_shared_lib_cache # func_mode_compile arg... func_mode_compile () { $debug_cmd # Get the compilation command and the source file. base_compile= srcfile=$nonopt # always keep a non-empty value in "srcfile" suppress_opt=yes suppress_output= arg_mode=normal libobj= later= pie_flag= for arg do case $arg_mode in arg ) # do not "continue". Instead, add this to base_compile lastarg=$arg arg_mode=normal ;; target ) libobj=$arg arg_mode=normal continue ;; normal ) # Accept any command-line options. case $arg in -o) test -n "$libobj" && \ func_fatal_error "you cannot specify '-o' more than once" arg_mode=target continue ;; -pie | -fpie | -fPIE) func_append pie_flag " $arg" continue ;; -shared | -static | -prefer-pic | -prefer-non-pic) func_append later " $arg" continue ;; -no-suppress) suppress_opt=no continue ;; -Xcompiler) arg_mode=arg # the next one goes into the "base_compile" arg list continue # The current "srcfile" will either be retained or ;; # replaced later. I would guess that would be a bug. -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result lastarg= save_ifs=$IFS; IFS=, for arg in $args; do IFS=$save_ifs func_append_quoted lastarg "$arg" done IFS=$save_ifs func_stripname ' ' '' "$lastarg" lastarg=$func_stripname_result # Add the arguments to base_compile. func_append base_compile " $lastarg" continue ;; *) # Accept the current argument as the source file. # The previous "srcfile" becomes the current argument. # lastarg=$srcfile srcfile=$arg ;; esac # case $arg ;; esac # case $arg_mode # Aesthetically quote the previous argument. func_append_quoted base_compile "$lastarg" done # for arg case $arg_mode in arg) func_fatal_error "you must specify an argument for -Xcompile" ;; target) func_fatal_error "you must specify a target with '-o'" ;; *) # Get the name of the library object. test -z "$libobj" && { func_basename "$srcfile" libobj=$func_basename_result } ;; esac # Recognize several different file suffixes. # If the user specifies -o file.o, it is replaced with file.lo case $libobj in *.[cCFSifmso] | \ *.ada | *.adb | *.ads | *.asm | \ *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \ *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup) func_xform "$libobj" libobj=$func_xform_result ;; esac case $libobj in *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;; *) func_fatal_error "cannot determine name of library object from '$libobj'" ;; esac func_infer_tag $base_compile for arg in $later; do case $arg in -shared) test yes = "$build_libtool_libs" \ || func_fatal_configuration "cannot build a shared library" build_old_libs=no continue ;; -static) build_libtool_libs=no build_old_libs=yes continue ;; -prefer-pic) pic_mode=yes continue ;; -prefer-non-pic) pic_mode=no continue ;; esac done func_quote_arg pretty "$libobj" test "X$libobj" != "X$func_quote_arg_result" \ && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \ && func_warning "libobj name '$libobj' may not contain shell special characters." func_dirname_and_basename "$obj" "/" "" objname=$func_basename_result xdir=$func_dirname_result lobj=$xdir$objdir/$objname test -z "$base_compile" && \ func_fatal_help "you must specify a compilation command" # Delete any leftover library objects. if test yes = "$build_old_libs"; then removelist="$obj $lobj $libobj ${libobj}T" else removelist="$lobj $libobj ${libobj}T" fi # On Cygwin there's no "real" PIC flag so we must build both object types case $host_os in cygwin* | mingw* | windows* | pw32* | os2* | cegcc*) pic_mode=default ;; esac if test no = "$pic_mode" && test pass_all != "$deplibs_check_method"; then # non-PIC code in shared libraries is not supported pic_mode=default fi # Calculate the filename of the output object if compiler does # not support -o with -c if test no = "$compiler_c_o"; then output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.$objext lockfile=$output_obj.lock else output_obj= need_locks=no lockfile= fi # Lock this critical section if it is needed # We use this script file to make the link, it avoids creating a new file if test yes = "$need_locks"; then until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done elif test warn = "$need_locks"; then if test -f "$lockfile"; then $ECHO "\ *** ERROR, $lockfile exists and contains: `cat $lockfile 2>/dev/null` This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support '-c' and '-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi func_append removelist " $output_obj" $ECHO "$srcfile" > "$lockfile" fi $opt_dry_run || $RM $removelist func_append removelist " $lockfile" trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 func_to_tool_file "$srcfile" func_convert_file_msys_to_w32 srcfile=$func_to_tool_file_result func_quote_arg pretty "$srcfile" qsrcfile=$func_quote_arg_result # Only build a PIC object if we are building libtool libraries. if test yes = "$build_libtool_libs"; then # Without this assignment, base_compile gets emptied. fbsd_hideous_sh_bug=$base_compile if test no != "$pic_mode"; then command="$base_compile $qsrcfile $pic_flag" else # Don't build PIC code command="$base_compile $qsrcfile" fi func_mkdir_p "$xdir$objdir" if test -z "$output_obj"; then # Place PIC objects in $objdir func_append command " -o $lobj" fi func_show_eval_locale "$command" \ 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE' if test warn = "$need_locks" && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support '-c' and '-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed, then go on to compile the next one if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then func_show_eval '$MV "$output_obj" "$lobj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi # Allow error messages only from the first compilation. if test yes = "$suppress_opt"; then suppress_output=' >/dev/null 2>&1' fi fi # Only build a position-dependent object if we build old libraries. if test yes = "$build_old_libs"; then if test yes != "$pic_mode"; then # Don't build PIC code command="$base_compile $qsrcfile$pie_flag" else command="$base_compile $qsrcfile $pic_flag" fi if test yes = "$compiler_c_o"; then func_append command " -o $obj" fi # Suppress compiler output if we already did a PIC compilation. func_append command "$suppress_output" func_show_eval_locale "$command" \ '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' if test warn = "$need_locks" && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support '-c' and '-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then func_show_eval '$MV "$output_obj" "$obj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi fi $opt_dry_run || { func_write_libtool_object "$libobj" "$objdir/$objname" "$objname" # Unlock the critical section if it was locked if test no != "$need_locks"; then removelist=$lockfile $RM "$lockfile" fi } exit $EXIT_SUCCESS } $opt_help || { test compile = "$opt_mode" && func_mode_compile ${1+"$@"} } func_mode_help () { # We need to display help for each of the modes. case $opt_mode in "") # Generic help is extracted from the usage comments # at the start of this file. func_help ;; clean) $ECHO \ "Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE... Remove files from the build directory. RM is the name of the program to use to delete files associated with each FILE (typically '/bin/rm'). RM-OPTIONS are options (such as '-f') to be passed to RM. If FILE is a libtool library, object or program, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; compile) $ECHO \ "Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE Compile a source file into a libtool library object. This mode accepts the following additional options: -o OUTPUT-FILE set the output file name to OUTPUT-FILE -no-suppress do not suppress compiler output for multiple passes -prefer-pic try to build PIC objects only -prefer-non-pic try to build non-PIC objects only -shared do not build a '.o' file suitable for static linking -static only build a '.o' file suitable for static linking -Wc,FLAG -Xcompiler FLAG pass FLAG directly to the compiler COMPILE-COMMAND is a command to be used in creating a 'standard' object file from the given SOURCEFILE. The output file name is determined by removing the directory component from SOURCEFILE, then substituting the C source code suffix '.c' with the library object suffix, '.lo'." ;; execute) $ECHO \ "Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]... Automatically set library path, then run a program. This mode accepts the following additional options: -dlopen FILE add the directory containing FILE to the library path This mode sets the library path environment variable according to '-dlopen' flags. If any of the ARGS are libtool executable wrappers, then they are translated into their corresponding uninstalled binary, and any of their required library directories are added to the library path. Then, COMMAND is executed, with ARGS as arguments." ;; finish) $ECHO \ "Usage: $progname [OPTION]... --mode=finish [LIBDIR]... Complete the installation of libtool libraries. Each LIBDIR is a directory that contains libtool libraries. The commands that this mode executes may require superuser privileges. Use the '--dry-run' option if you just want to see what would be executed." ;; install) $ECHO \ "Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND... Install executables or libraries. INSTALL-COMMAND is the installation command. The first component should be either the 'install' or 'cp' program. The following components of INSTALL-COMMAND are treated specially: -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation The rest of the components are interpreted as arguments to that command (only BSD-compatible install options are recognized)." ;; link) $ECHO \ "Usage: $progname [OPTION]... --mode=link LINK-COMMAND... Link object files or libraries together to form another library, or to create an executable program. LINK-COMMAND is a command using the C compiler that you would use to create a program from several object files. The following components of LINK-COMMAND are treated specially: -all-static do not do any dynamic linking at all -avoid-version do not add a version suffix if possible -bindir BINDIR specify path to binaries directory (for systems where libraries must be found in the PATH setting at runtime) -dlopen FILE '-dlpreopen' FILE if it cannot be dlopened at runtime -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) -export-symbols SYMFILE try to export only the symbols listed in SYMFILE -export-symbols-regex REGEX try to export only the symbols matching REGEX -LLIBDIR search LIBDIR for required installed libraries -lNAME OUTPUT-FILE requires the installed library libNAME -module build a library that can dlopened -no-fast-install disable the fast-install mode -no-install link a not-installable executable -no-undefined declare that a library does not refer to external symbols -o OUTPUT-FILE create OUTPUT-FILE from the specified objects -objectlist FILE use a list of object files found in FILE to specify objects -os2dllname NAME force a short DLL name on OS/2 (no effect on other OSes) -precious-files-regex REGEX don't remove output files matching REGEX -release RELEASE specify package release information -rpath LIBDIR the created library will eventually be installed in LIBDIR -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries -shared only do dynamic linking of libtool libraries -shrext SUFFIX override the standard shared library file extension -static do not do any dynamic linking of uninstalled libtool libraries -static-libtool-libs do not do any dynamic linking of libtool libraries -version-info CURRENT[:REVISION[:AGE]] specify library version info [each variable defaults to 0] -weak LIBNAME declare that the target provides the LIBNAME interface -Wc,FLAG -Xcompiler FLAG pass linker-specific FLAG directly to the compiler -Wa,FLAG -Xassembler FLAG pass linker-specific FLAG directly to the assembler -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 # If option '--reorder-cache', reorder the shared library cache and exit. if $opt_reorder_cache; then func_reorder_shared_lib_cache $shared_lib_dirs fi # func_mode_execute arg... func_mode_execute () { $debug_cmd # The first argument is the command name. cmd=$nonopt test -z "$cmd" && \ func_fatal_help "you must specify a COMMAND" # Handle -dlopen flags immediately. for file in $opt_dlopen; do test -f "$file" \ || func_fatal_help "'$file' is not a file" dir= case $file in *.la) func_resolve_sysroot "$file" file=$func_resolve_sysroot_result # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "'$lib' is not a valid libtool archive" # Read the libtool library. dlname= library_names= func_source "$file" # Skip this library if it cannot be dlopened. if test -z "$dlname"; then # Warn if it was a shared library. test -n "$library_names" && \ func_warning "'$file' was not linked with '-export-dynamic'" continue fi func_dirname "$file" "" "." dir=$func_dirname_result if test -f "$dir/$objdir/$dlname"; then func_append dir "/$objdir" else if test ! -f "$dir/$dlname"; then func_fatal_error "cannot find '$dlname' in '$dir' or '$dir/$objdir'" fi fi ;; *.lo) # Just add the directory containing the .lo file. func_dirname "$file" "" "." dir=$func_dirname_result ;; *) func_warning "'-dlopen' is ignored for non-libtool libraries and objects" continue ;; esac # Get the absolute pathname. absdir=`cd "$dir" && pwd` test -n "$absdir" && dir=$absdir # Now add the directory to shlibpath_var. if eval "test -z \"\$$shlibpath_var\""; then eval "$shlibpath_var=\"\$dir\"" else eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" fi done # This variable tells wrapper scripts just to set shlibpath_var # rather than running their programs. libtool_execute_magic=$magic # Check if any of the arguments is a wrapper script. args= for file do case $file in -* | *.la | *.lo ) ;; *) # Do a test to see if this is really a libtool program. if func_ltwrapper_script_p "$file"; then func_source "$file" # Transform arg to wrapped name. file=$progdir/$program elif func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" func_source "$func_ltwrapper_scriptname_result" # Transform arg to wrapped name. file=$progdir/$program fi ;; esac # Quote arguments (to preserve shell metacharacters). func_append_quoted args "$file" done if $opt_dry_run; then # Display what would be done. if test -n "$shlibpath_var"; then eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\"" echo "export $shlibpath_var" fi $ECHO "$cmd$args" exit $EXIT_SUCCESS else if test -n "$shlibpath_var"; then # Export the shlibpath_var. eval "export $shlibpath_var" fi # Restore saved environment variables for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test \"\${save_$lt_var+set}\" = set; then $lt_var=\$save_$lt_var; export $lt_var else $lt_unset $lt_var fi" done # Now prepare to actually exec the command. exec_cmd=\$cmd$args fi } test execute = "$opt_mode" && func_mode_execute ${1+"$@"} # func_mode_finish arg... func_mode_finish () { $debug_cmd libs= libdirs= admincmds= for opt in "$nonopt" ${1+"$@"} do if test -d "$opt"; then func_append libdirs " $opt" elif test -f "$opt"; then if func_lalib_unsafe_p "$opt"; then func_append libs " $opt" else func_warning "'$opt' is not a valid libtool archive" fi else func_fatal_error "invalid argument '$opt'" fi done if test -n "$libs"; then if test -n "$lt_sysroot"; then sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"` sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;" else sysroot_cmd= fi # Remove sysroot references if $opt_dry_run; then for lib in $libs; do echo "removing references to $lt_sysroot and '=' prefixes from $lib" done else tmpdir=`func_mktempdir` for lib in $libs; do $SED -e "$sysroot_cmd s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \ > $tmpdir/tmp-la mv -f $tmpdir/tmp-la $lib done ${RM}r "$tmpdir" fi fi if test -n "$finish_cmds$finish_eval" && test -n "$libdirs" && $opt_finishing; then for libdir in $libdirs; do if test -n "$finish_cmds"; then # Do each command in the finish commands. func_execute_cmds "$finish_cmds" 'admincmds="$admincmds '"$cmd"'"' fi if test -n "$finish_eval"; then # Do the single finish_eval. eval cmds=\"$finish_eval\" $opt_dry_run || eval "$cmds" || func_append admincmds " $cmds" fi done fi # Exit here if they wanted silent mode. $opt_quiet && exit $EXIT_SUCCESS if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then echo "----------------------------------------------------------------------" echo "Libraries have been installed in:" for libdir in $libdirs; do $ECHO " $libdir" done if test "false" = "$opt_finishing"; then echo echo "NOTE: finish_cmds were not executed during testing, so you must" echo "manually run ldconfig to add a given test directory, LIBDIR, to" echo "the search path for generated executables." fi echo echo "If you ever happen to want to link against installed libraries" echo "in a given directory, LIBDIR, you must either use libtool, and" echo "specify the full pathname of the library, or use the '-LLIBDIR'" echo "flag during linking and do at least one of the following:" if test -n "$shlibpath_var"; then echo " - add LIBDIR to the '$shlibpath_var' environment variable" echo " during execution" fi if test -n "$runpath_var"; then echo " - add LIBDIR to the '$runpath_var' environment variable" echo " during linking" fi if test -n "$hardcode_libdir_flag_spec"; then libdir=LIBDIR eval flag=\"$hardcode_libdir_flag_spec\" $ECHO " - use the '$flag' linker flag" fi if test -n "$admincmds"; then $ECHO " - have your system administrator run these commands:$admincmds" fi if test -f /etc/ld.so.conf; then echo " - have your system administrator add LIBDIR to '/etc/ld.so.conf'" fi echo echo "See any operating system documentation about shared libraries for" case $host in solaris2.[6789]|solaris2.1[0-9]) echo "more information, such as the ld(1), crle(1) and ld.so(8) manual" echo "pages." ;; *) echo "more information, such as the ld(1) and ld.so(8) manual pages." ;; esac echo "----------------------------------------------------------------------" fi exit $EXIT_SUCCESS } test finish = "$opt_mode" && func_mode_finish ${1+"$@"} # func_mode_install arg... func_mode_install () { $debug_cmd # There may be an optional sh(1) argument at the beginning of # install_prog (especially on Windows NT). if test "$SHELL" = "$nonopt" || test /bin/sh = "$nonopt" || # Allow the use of GNU shtool's install command. case $nonopt in *shtool*) :;; *) false;; esac then # Aesthetically quote it. func_quote_arg pretty "$nonopt" install_prog="$func_quote_arg_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_arg pretty "$arg" func_append install_prog "$func_quote_arg_result" install_shared_prog=$install_prog case " $install_prog " in *[\\\ /]cp\ *) install_cp=: ;; *) install_cp=false ;; esac # We need to accept at least all the BSD install flags. dest= files= opts= prev= install_type= isdir=false stripme= no_mode=: for arg do arg2= if test -n "$dest"; then func_append files " $dest" dest=$arg continue fi case $arg in -d) isdir=: ;; -f) if $install_cp; then :; else prev=$arg fi ;; -g | -m | -o) prev=$arg ;; -s) stripme=" -s" continue ;; -*) ;; *) # If the previous option needed an argument, then skip it. if test -n "$prev"; then if test X-m = "X$prev" && test -n "$install_override_mode"; then arg2=$install_override_mode no_mode=false fi prev= else dest=$arg continue fi ;; esac # Aesthetically quote the argument. func_quote_arg pretty "$arg" func_append install_prog " $func_quote_arg_result" if test -n "$arg2"; then func_quote_arg pretty "$arg2" fi func_append install_shared_prog " $func_quote_arg_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_arg pretty "$install_override_mode" func_append install_shared_prog " -m $func_quote_arg_result" fi fi if test -z "$files"; then if test -z "$dest"; then func_fatal_help "no file or destination specified" else func_fatal_help "you must specify a destination" fi fi # Strip any trailing slash from the destination. func_stripname '' '/' "$dest" dest=$func_stripname_result # Check to see that the destination is a directory. test -d "$dest" && isdir=: if $isdir; then destdir=$dest destname= else func_dirname_and_basename "$dest" "" "." destdir=$func_dirname_result destname=$func_basename_result # Not a directory, so check to see that there is only one file specified. set dummy $files; shift test "$#" -gt 1 && \ func_fatal_help "'$dest' is not a directory" fi case $destdir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) for file in $files; do case $file in *.lo) ;; *) func_fatal_help "'$destdir' must be an absolute directory name" ;; esac done ;; esac # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic=$magic staticlibs= future_libdirs= current_libdirs= for file in $files; do # Do each installation. case $file in *.$libext) # Do the static libraries later. func_append staticlibs " $file" ;; *.la) func_resolve_sysroot "$file" file=$func_resolve_sysroot_result # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "'$file' is not a valid libtool archive" library_names= old_library= relink_command= func_source "$file" # Add the libdir to current_libdirs if it is the destination. if test "X$destdir" = "X$libdir"; then case "$current_libdirs " in *" $libdir "*) ;; *) func_append current_libdirs " $libdir" ;; esac else # Note the libdir as a future libdir. case "$future_libdirs " in *" $libdir "*) ;; *) func_append future_libdirs " $libdir" ;; esac fi func_dirname "$file" "/" "" dir=$func_dirname_result func_append dir "$objdir" if test -n "$relink_command"; then # Strip any trailing slash from the destination. func_stripname '' '/' "$libdir" destlibdir=$func_stripname_result func_stripname '' '/' "$destdir" s_destdir=$func_stripname_result # Determine the prefix the user has applied to our future dir. inst_prefix_dir=`$ECHO "X$s_destdir" | $Xsed -e "s%$destlibdir\$%%"` # 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* | windows* | pw32* | cegcc*) case $realname in *.dll.a) tstripme= ;; esac ;; os2*) case $realname in *_dll.a) tstripme= ;; esac ;; esac if test -n "$tstripme" && test -n "$striplib"; then func_show_eval "$striplib $destdir/$realname" 'exit $?' fi if test "$#" -gt 0; then # Delete the old symlinks, and create new ones. # Try 'ln -sf' first, because the 'ln' binary might depend on # the symlink we replace! Solaris /bin/ln does not understand -f, # so we also need to try rm && ln -s. for linkname do test "$linkname" != "$realname" \ && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })" done fi # Do each command in the postinstall commands. lib=$destdir/$realname func_execute_cmds "$postinstall_cmds" 'exit $?' fi # Install the pseudo-library for information purposes. func_basename "$file" name=$func_basename_result instname=$dir/${name}i func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' # Maybe install the static library, too. test -n "$old_library" && func_append staticlibs " $dir/$old_library" ;; *.lo) # Install (i.e. copy) a libtool object. # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile=$destdir/$destname else func_basename "$file" destfile=$func_basename_result destfile=$destdir/$destfile fi # Deduce the name of the destination old-style object file. case $destfile in *.lo) func_lo2o "$destfile" staticdest=$func_lo2o_result ;; *.$objext) staticdest=$destfile destfile= ;; *) func_fatal_help "cannot copy a libtool object to '$destfile'" ;; esac # Install the libtool object if requested. test -n "$destfile" && \ func_show_eval "$install_prog $file $destfile" 'exit $?' # Install the old object if enabled. if test yes = "$build_old_libs"; then # Deduce the name of the old-style object file. func_lo2o "$file" staticobj=$func_lo2o_result func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?' fi exit $EXIT_SUCCESS ;; *) # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile=$destdir/$destname else func_basename "$file" destfile=$func_basename_result destfile=$destdir/$destfile fi # If the file is missing, and there is a .exe on the end, strip it # because it is most likely a libtool script we actually want to # install stripped_ext= case $file in *.exe) if test ! -f "$file"; then func_stripname '' '.exe' "$file" file=$func_stripname_result stripped_ext=.exe fi ;; esac # Do a test to see if this is really a libtool program. case $host in *cygwin* | *mingw* | *windows*) if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" wrapper=$func_ltwrapper_scriptname_result else func_stripname '' '.exe' "$file" wrapper=$func_stripname_result fi ;; *) wrapper=$file ;; esac if func_ltwrapper_script_p "$wrapper"; then notinst_deplibs= relink_command= func_source "$wrapper" # Check the variables that should have been set. test -z "$generated_by_libtool_version" && \ func_fatal_error "invalid libtool wrapper script '$wrapper'" finalize=: for lib in $notinst_deplibs; do # Check to see that each library is installed. libdir= if test -f "$lib"; then func_source "$lib" fi libfile=$libdir/`$ECHO "$lib" | $SED 's%^.*/%%g'` if test -n "$libdir" && test ! -f "$libfile"; then func_warning "'$lib' has not been installed in '$libdir'" finalize=false fi done relink_command= func_source "$wrapper" outputname= if test no = "$fast_install" && test -n "$relink_command"; then $opt_dry_run || { if $finalize; then tmpdir=`func_mktempdir` func_basename "$file$stripped_ext" file=$func_basename_result outputname=$tmpdir/$file # Replace the output file specification. relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` $opt_quiet || { func_quote_arg expand,pretty "$relink_command" eval "func_echo $func_quote_arg_result" } if eval "$relink_command"; then : else func_error "error: relink '$file' with the above command before installing it" $opt_dry_run || ${RM}r "$tmpdir" continue fi file=$outputname else func_warning "cannot relink '$file'" fi } else # Install the binary that we compiled earlier. file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"` fi fi # remove .exe since cygwin /usr/bin/install will append another # one anyway case $install_prog,$host in */usr/bin/install*,*cygwin*) case $file:$destfile in *.exe:*.exe) # this is ok ;; *.exe:*) destfile=$destfile.exe ;; *:*.exe) func_stripname '' '.exe' "$destfile" destfile=$func_stripname_result ;; esac ;; esac func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?' $opt_dry_run || if test -n "$outputname"; then ${RM}r "$tmpdir" fi ;; esac done for file in $staticlibs; do func_basename "$file" name=$func_basename_result # Set up the ranlib parameters. oldlib=$destdir/$name func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 tool_oldlib=$func_to_tool_file_result func_show_eval "$install_prog \$file \$oldlib" 'exit $?' if test -n "$stripme" && test -n "$old_striplib"; then func_show_eval "$old_striplib $tool_oldlib" 'exit $?' fi # Do each command in the postinstall commands. func_execute_cmds "$old_postinstall_cmds" 'exit $?' done test -n "$future_libdirs" && \ func_warning "remember to run '$progname --finish$future_libdirs'" if test -n "$current_libdirs"; then # Maybe just do a dry run. $opt_dry_run && current_libdirs=" -n$current_libdirs" exec_cmd='$SHELL "$progpath" $preserve_args --finish$current_libdirs' else exit $EXIT_SUCCESS fi } test install = "$opt_mode" && func_mode_install ${1+"$@"} # func_generate_dlsyms outputname originator pic_p # Extract symbols from dlprefiles and create ${outputname}S.o with # a dlpreopen symbol table. func_generate_dlsyms () { $debug_cmd my_outputname=$1 my_originator=$2 my_pic_p=${3-false} my_prefix=`$ECHO "$my_originator" | $SED 's%[^a-zA-Z0-9]%_%g'` my_dlsyms= if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then if test -n "$NM" && test -n "$global_symbol_pipe"; then my_dlsyms=${my_outputname}S.c else func_error "not configured to extract global symbols from dlpreopened files" fi fi if test -n "$my_dlsyms"; then case $my_dlsyms in "") ;; *.c) # Discover the nlist of each of the dlfiles. nlist=$output_objdir/$my_outputname.nm func_show_eval "$RM $nlist ${nlist}S ${nlist}T" # Parse the name list into a source file. func_verbose "creating $output_objdir/$my_dlsyms" $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\ /* $my_dlsyms - symbol resolution table for '$my_outputname' dlsym emulation. */ /* Generated by $PROGRAM (GNU $PACKAGE) $VERSION */ #ifdef __cplusplus extern \"C\" { #endif #if defined __GNUC__ && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4)) #pragma GCC diagnostic ignored \"-Wstrict-prototypes\" #endif /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE /* DATA imports from DLLs on WIN32 can't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #elif defined __osf__ /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif #define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0) /* External symbol declarations for the compiler. */\ " if test yes = "$dlself"; then func_verbose "generating symbol list for '$output'" $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" # Add our own program objects to the symbol list. progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP` for progfile in $progfiles; do func_to_tool_file "$progfile" func_convert_file_msys_to_w32 func_verbose "extracting global C symbols from '$func_to_tool_file_result'" $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'" done if test -n "$exclude_expsyms"; then $opt_dry_run || { eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi if test -n "$export_symbols_regex"; then $opt_dry_run || { eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi # Prepare the list of exported symbols if test -z "$export_symbols"; then export_symbols=$output_objdir/$outputname.exp $opt_dry_run || { $RM $export_symbols eval "$SED -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' case $host in *cygwin* | *mingw* | *windows* | *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* | *windows* | *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* | *windows* | *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 case $host in i[3456]86-*-mingw32*) 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'" ;; *) 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'" ;; esac } else # not an import lib $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } fi ;; *) $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } ;; esac done $opt_dry_run || { # Make sure we have at least an empty file. test -f "$nlist" || : > "$nlist" if test -n "$exclude_expsyms"; then $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T $MV "$nlist"T "$nlist" fi # Try sorting and uniquifying the output. if $GREP -v "^: " < "$nlist" | if sort -k 3 /dev/null 2>&1; then sort -k 3 else sort +2 fi | uniq > "$nlist"S; then : else $GREP -v "^: " < "$nlist" > "$nlist"S fi if test -f "$nlist"S; then eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"' else echo '/* NONE */' >> "$output_objdir/$my_dlsyms" fi func_show_eval '$RM "${nlist}I"' if test -n "$global_symbol_to_import"; then eval "$global_symbol_to_import"' < "$nlist"S > "$nlist"I' fi echo >> "$output_objdir/$my_dlsyms" "\ /* The mapping between symbol names and symbols. */ typedef struct { const char *name; void *address; } lt_dlsymlist; extern LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[];\ " if test -s "$nlist"I; then echo >> "$output_objdir/$my_dlsyms" "\ static void lt_syminit(void) { LT_DLSYM_CONST lt_dlsymlist *symbol = lt_${my_prefix}_LTX_preloaded_symbols; for (; symbol->name; ++symbol) {" $SED 's/.*/ if (STREQ (symbol->name, \"&\")) symbol->address = (void *) \&&;/' < "$nlist"I >> "$output_objdir/$my_dlsyms" echo >> "$output_objdir/$my_dlsyms" "\ } }" fi echo >> "$output_objdir/$my_dlsyms" "\ LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[] = { {\"$my_originator\", (void *) 0}," if test -s "$nlist"I; then echo >> "$output_objdir/$my_dlsyms" "\ {\"@INIT@\", (void *) <_syminit}," fi case $need_lib_prefix in no) eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; *) eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; esac echo >> "$output_objdir/$my_dlsyms" "\ {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt_${my_prefix}_LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif\ " } # !$opt_dry_run pic_flag_for_symtable= case "$compile_command " in *" -static "*) ;; *) case $host in # compiling the symbol table file with pic_flag works around # a FreeBSD bug that causes programs to crash when -lm is # linked before any other PIC object. But we must not use # pic_flag when linking with -static. The problem exists in # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;; *-*-hpux*) pic_flag_for_symtable=" $pic_flag" ;; *) $my_pic_p && pic_flag_for_symtable=" $pic_flag" ;; esac ;; esac symtab_cflags= for arg in $LTCFLAGS; do case $arg in -pie | -fpie | -fPIE) ;; *) func_append symtab_cflags " $arg" ;; esac done # Now compile the dynamic symbol file. func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?' # Clean up the generated files. func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T" "${nlist}I"' # Transform the symbol file into the correct name. symfileobj=$output_objdir/${my_outputname}S.$objext case $host in *cygwin* | *mingw* | *windows* | *cegcc* ) if test -f "$output_objdir/$my_outputname.def"; then compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` else compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` fi ;; *) compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` ;; esac ;; *) func_fatal_error "unknown suffix for '$my_dlsyms'" ;; esac else # We keep going just in case the user didn't refer to # lt_preloaded_symbols. The linker will fail if global_symbol_pipe # really was required. # Nullify the symbol file. compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"` finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"` fi } # func_cygming_gnu_implib_p ARG # This predicate returns with zero status (TRUE) if # ARG is a GNU/binutils-style import library. Returns # with nonzero status (FALSE) otherwise. func_cygming_gnu_implib_p () { $debug_cmd func_to_tool_file "$1" func_convert_file_msys_to_w32 func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'` test -n "$func_cygming_gnu_implib_tmp" } # func_cygming_ms_implib_p ARG # This predicate returns with zero status (TRUE) if # ARG is an MS-style import library. Returns # with nonzero status (FALSE) otherwise. func_cygming_ms_implib_p () { $debug_cmd func_to_tool_file "$1" func_convert_file_msys_to_w32 func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'` test -n "$func_cygming_ms_implib_tmp" } # func_win32_libid arg # return the library type of file 'arg' # # Need a lot of goo to handle *both* DLLs and import libs # Has to be a shell function in order to 'eat' the argument # that is supplied when $file_magic_command is called. # Despite the name, also deal with 64 bit binaries. func_win32_libid () { $debug_cmd win32_libid_type=unknown win32_fileres=`file -L $1 2>/dev/null` case $win32_fileres in *ar\ archive\ import\ library*) # definitely import win32_libid_type="x86 archive import" ;; *ar\ archive*) # could be an import, or static # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD. if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64|pe-aarch64)' >/dev/null; then case $nm_interface in "MS dumpbin") if func_cygming_ms_implib_p "$1" || func_cygming_gnu_implib_p "$1" then win32_nmres=import else win32_nmres= fi ;; *) func_to_tool_file "$1" func_convert_file_msys_to_w32 win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" | $SED -n -e ' 1,100{ / I /{ s|.*|import| p q } }'` ;; esac case $win32_nmres in import*) win32_libid_type="x86 archive import";; *) win32_libid_type="x86 archive static";; esac fi ;; *DLL*) win32_libid_type="x86 DLL" ;; *executable*) # but shell scripts are "executable" too... case $win32_fileres in *MS\ Windows\ PE\ Intel*) win32_libid_type="x86 DLL" ;; esac ;; esac $ECHO "$win32_libid_type" } # func_cygming_dll_for_implib ARG # # Platform-specific function to extract the # name of the DLL associated with the specified # import library ARG. # Invoked by eval'ing the libtool variable # $sharedlib_from_linklib_cmd # Result is available in the variable # $sharedlib_from_linklib_result func_cygming_dll_for_implib () { $debug_cmd sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"` } # func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs # # The is the core of a fallback implementation of a # platform-specific function to extract the name of the # DLL associated with the specified import library LIBNAME. # # SECTION_NAME is either .idata$6 or .idata$7, depending # on the platform and compiler that created the implib. # # Echos the name of the DLL associated with the # specified import library. func_cygming_dll_for_implib_fallback_core () { $debug_cmd match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"` $OBJDUMP -s --section "$1" "$2" 2>/dev/null | $SED '/^Contents of section '"$match_literal"':/{ # Place marker at beginning of archive member dllname section s/.*/====MARK====/ p d } # These lines can sometimes be longer than 43 characters, but # are always uninteresting /:[ ]*file format pe[i]\{,1\}-/d /^In archive [^:]*:/d # Ensure marker is printed /^====MARK====/p # Remove all lines with less than 43 characters /^.\{43\}/!d # From remaining lines, remove first 43 characters s/^.\{43\}//' | $SED -n ' # Join marker and all lines until next marker into a single line /^====MARK====/ b para H $ b para b :para x s/\n//g # Remove the marker s/^====MARK====// # Remove trailing dots and whitespace s/[\. \t]*$// # Print /./p' | # we now have a list, one entry per line, of the stringified # contents of the appropriate section of all members of the # archive that possess that section. Heuristic: eliminate # all those that have a first or second character that is # a '.' (that is, objdump's representation of an unprintable # character.) This should work for all archives with less than # 0x302f exports -- but will fail for DLLs whose name actually # begins with a literal '.' or a single character followed by # a '.'. # # Of those that remain, print the first one. $SED -e '/^\./d;/^.\./d;q' } # func_cygming_dll_for_implib_fallback ARG # Platform-specific function to extract the # name of the DLL associated with the specified # import library ARG. # # This fallback implementation is for use when $DLLTOOL # does not support the --identify-strict option. # Invoked by eval'ing the libtool variable # $sharedlib_from_linklib_cmd # Result is available in the variable # $sharedlib_from_linklib_result func_cygming_dll_for_implib_fallback () { $debug_cmd if func_cygming_gnu_implib_p "$1"; then # binutils import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"` elif func_cygming_ms_implib_p "$1"; then # ms-generated import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"` else # unknown sharedlib_from_linklib_result= fi } # func_extract_an_archive dir oldlib func_extract_an_archive () { $debug_cmd f_ex_an_ar_dir=$1; shift f_ex_an_ar_oldlib=$1 if test yes = "$lock_old_archive_extraction"; then lockfile=$f_ex_an_ar_oldlib.lock until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done fi func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \ 'stat=$?; rm -f "$lockfile"; exit $stat' if test yes = "$lock_old_archive_extraction"; then $opt_dry_run || rm -f "$lockfile" fi if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then : else func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" fi } # func_extract_archives gentop oldlib ... func_extract_archives () { $debug_cmd my_gentop=$1; shift my_oldlibs=${1+"$@"} my_oldobjs= my_xlib= my_xabs= my_xdir= for my_xlib in $my_oldlibs; do # Extract the objects. case $my_xlib in [\\/]* | [A-Za-z]:[\\/]*) my_xabs=$my_xlib ;; *) my_xabs=`pwd`"/$my_xlib" ;; esac func_basename "$my_xlib" my_xlib=$func_basename_result my_xlib_u=$my_xlib while :; do case " $extracted_archives " in *" $my_xlib_u "*) func_arith $extracted_serial + 1 extracted_serial=$func_arith_result my_xlib_u=lt$extracted_serial-$my_xlib ;; *) break ;; esac done extracted_archives="$extracted_archives $my_xlib_u" my_xdir=$my_gentop/$my_xlib_u func_mkdir_p "$my_xdir" case $host in *-darwin*) func_verbose "Extracting $my_xabs" # Do not bother doing anything if just a dry run $opt_dry_run || { darwin_orig_dir=`pwd` cd $my_xdir || exit $? darwin_archive=$my_xabs darwin_curdir=`pwd` func_basename "$darwin_archive" darwin_base_archive=$func_basename_result darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true` if test -n "$darwin_arches"; then darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'` darwin_arch= func_verbose "$darwin_base_archive has multiple architectures $darwin_arches" for darwin_arch in $darwin_arches; do func_mkdir_p "unfat-$$/$darwin_base_archive-$darwin_arch" $LIPO -thin $darwin_arch -output "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive" "$darwin_archive" cd "unfat-$$/$darwin_base_archive-$darwin_arch" func_extract_an_archive "`pwd`" "$darwin_base_archive" cd "$darwin_curdir" $RM "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive" done # $darwin_arches ## Okay now we've a bunch of thin objects, gotta fatten them up :) darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$sed_basename" | sort -u` darwin_file= darwin_files= for darwin_file in $darwin_filelist; do darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP` $LIPO -create -output "$darwin_file" $darwin_files done # $darwin_filelist $RM -rf unfat-$$ cd "$darwin_orig_dir" else cd $darwin_orig_dir func_extract_an_archive "$my_xdir" "$my_xabs" fi # $darwin_arches } # !$opt_dry_run ;; *) func_extract_an_archive "$my_xdir" "$my_xabs" ;; esac my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP` done func_extract_archives_result=$my_oldobjs } # func_emit_wrapper [arg=no] # # Emit a libtool wrapper script on stdout. # Don't directly open a file because we may want to # incorporate the script contents within a cygwin/mingw/windows # wrapper executable. Must ONLY be called from within # func_mode_link because it depends on a number of variables # set therein. # # ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR # variable will take. If 'yes', then the emitted script # will assume that the directory where it is stored is # the $objdir directory. This is a cygwin/mingw/windows-specific # behavior. func_emit_wrapper () { func_emit_wrapper_arg1=${1-no} $ECHO "\ #! $SHELL # $output - temporary wrapper script for $objdir/$outputname # Generated by $PROGRAM (GNU $PACKAGE) $VERSION # # The $output program cannot be directly executed until all the libtool # libraries that it depends on are installed. # # This wrapper script should never be moved out of the build directory. # If it is, it will not operate correctly. # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. sed_quote_subst='$sed_quote_subst' # Be Bourne compatible if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac fi BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH relink_command=\"$relink_command\" # This environment variable determines our operation mode. if test \"\$libtool_install_magic\" = \"$magic\"; then # install mode needs the following variables: generated_by_libtool_version='$macro_version' notinst_deplibs='$notinst_deplibs' else # When we are sourced in execute mode, \$file and \$ECHO are already set. if test \"\$libtool_execute_magic\" != \"$magic\"; then file=\"\$0\"" func_quote_arg pretty "$ECHO" qECHO=$func_quote_arg_result $ECHO "\ # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } ECHO=$qECHO fi # Very basic option parsing. These options are (a) specific to # the libtool wrapper, (b) are identical between the wrapper # /script/ and the wrapper /executable/ that is used only on # windows platforms, and (c) all begin with the string "--lt-" # (application programs are unlikely to have options that match # this pattern). # # There are only two supported options: --lt-debug and # --lt-dump-script. There is, deliberately, no --lt-help. # # The first argument to this parsing function should be the # script's $0 value, followed by "$@". lt_option_debug= func_parse_lt_options () { lt_script_arg0=\$0 shift for lt_opt do case \"\$lt_opt\" in --lt-debug) lt_option_debug=1 ;; --lt-dump-script) lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\` test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=. lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\` cat \"\$lt_dump_D/\$lt_dump_F\" exit 0 ;; --lt-*) \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2 exit 1 ;; esac done # Print the debug banner immediately: if test -n \"\$lt_option_debug\"; then echo \"$outputname:$output:\$LINENO: libtool wrapper (GNU $PACKAGE) $VERSION\" 1>&2 fi } # Used when --lt-debug. Prints its arguments to stdout # (redirection is the responsibility of the caller) func_lt_dump_args () { lt_dump_args_N=1; for lt_arg do \$ECHO \"$outputname:$output:\$LINENO: newargv[\$lt_dump_args_N]: \$lt_arg\" lt_dump_args_N=\`expr \$lt_dump_args_N + 1\` done } # Core function for launching the target application func_exec_program_core () { " case $host in # Backslashes separate directories on plain windows *-*-mingw* | *-*-windows* | *-*-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/windows when embedded into # the cwrapper. WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1 if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then # special case for '.' if test \"\$thisdir\" = \".\"; then thisdir=\`pwd\` fi # remove .libs from thisdir case \"\$thisdir\" in *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;; $objdir ) thisdir=. ;; esac fi # Try to get the absolute directory name. absdir=\`cd \"\$thisdir\" && pwd\` test -n \"\$absdir\" && thisdir=\"\$absdir\" " if test yes = "$fast_install"; then $ECHO "\ program=lt-'$outputname'$exeext progdir=\"\$thisdir/$objdir\" if test ! -f \"\$progdir/\$program\" || { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | $SED 1q\`; \\ test \"X\$file\" != \"X\$progdir/\$program\"; }; then file=\"\$\$-\$program\" if test ! -d \"\$progdir\"; then $MKDIR \"\$progdir\" else $RM \"\$progdir/\$file\" fi" $ECHO "\ # relink executable if necessary if test -n \"\$relink_command\"; then if relink_command_output=\`eval \$relink_command 2>&1\`; then : else \$ECHO \"\$relink_command_output\" >&2 $RM \"\$progdir/\$file\" exit 1 fi fi $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || { $RM \"\$progdir/\$program\"; $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; } $RM \"\$progdir/\$file\" fi" else $ECHO "\ program='$outputname' progdir=\"\$thisdir/$objdir\" " fi $ECHO "\ if test -f \"\$progdir/\$program\"; then" # fixup the dll searchpath if we need to. # # Fix the DLL searchpath if we need to. Do this before prepending # to shlibpath, because on Windows, both are PATH and uninstalled # libraries must come first. if test -n "$dllsearchpath"; then $ECHO "\ # Add the dll search path components to the executable PATH PATH=$dllsearchpath:\$PATH " fi # Export our shlibpath_var if we have one. if test yes = "$shlibpath_overrides_runpath" && test -n "$shlibpath_var" && test -n "$temp_rpath"; then $ECHO "\ # Add our own library path to $shlibpath_var $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" # Some systems cannot cope with colon-terminated $shlibpath_var # The second colon is a workaround for a bug in BeOS R4 sed $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\` export $shlibpath_var " fi $ECHO "\ if test \"\$libtool_execute_magic\" != \"$magic\"; then # Run the actual program with our arguments. func_exec_program \${1+\"\$@\"} fi else # The program doesn't exist. \$ECHO \"\$0: error: '\$progdir/\$program' does not exist\" 1>&2 \$ECHO \"This script is just a wrapper for \$program.\" 1>&2 \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 exit 1 fi fi\ " } # func_emit_cwrapperexe_src # emit the source code for a wrapper executable on stdout # Must ONLY be called from within func_mode_link because # it depends on a number of variable set therein. func_emit_cwrapperexe_src () { cat < #include #if defined _WIN32 && !defined __GNUC__ # include # include # include #else # include # include # ifdef __CYGWIN__ # include # endif #endif #include #include #include #include #include #include #include #include #define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0) /* declarations of non-ANSI functions */ #if defined __MINGW32__ # ifdef __STRICT_ANSI__ _CRTIMP int __cdecl _putenv (const char *); # endif #elif defined __CYGWIN__ # ifdef __STRICT_ANSI__ char *realpath (const char *, char *); int putenv (char *); int setenv (const char *, const char *, int); # endif /* #elif defined other_platform || defined ... */ #endif /* portability defines, excluding path handling macros */ #if defined _MSC_VER # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv # define S_IXUSR _S_IEXEC #elif defined __MINGW32__ # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv #elif defined __CYGWIN__ # define HAVE_SETENV # define FOPEN_WB "wb" /* #elif defined other platforms ... */ #endif #if defined PATH_MAX # define LT_PATHMAX PATH_MAX #elif defined MAXPATHLEN # define LT_PATHMAX MAXPATHLEN #else # define LT_PATHMAX 1024 #endif #ifndef S_IXOTH # define S_IXOTH 0 #endif #ifndef S_IXGRP # define S_IXGRP 0 #endif /* path handling portability macros */ #ifndef DIR_SEPARATOR # define DIR_SEPARATOR '/' # define PATH_SEPARATOR ':' #endif #if defined _WIN32 || defined __MSDOS__ || defined __DJGPP__ || \ defined __OS2__ # define HAVE_DOS_BASED_FILE_SYSTEM # define FOPEN_WB "wb" # ifndef DIR_SEPARATOR_2 # define DIR_SEPARATOR_2 '\\' # endif # ifndef PATH_SEPARATOR_2 # define PATH_SEPARATOR_2 ';' # endif #endif #ifndef DIR_SEPARATOR_2 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) #else /* DIR_SEPARATOR_2 */ # define IS_DIR_SEPARATOR(ch) \ (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) #endif /* DIR_SEPARATOR_2 */ #ifndef PATH_SEPARATOR_2 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) #else /* PATH_SEPARATOR_2 */ # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) #endif /* PATH_SEPARATOR_2 */ #ifndef FOPEN_WB # define FOPEN_WB "w" #endif #ifndef _O_BINARY # define _O_BINARY 0 #endif #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) #define XFREE(stale) do { \ if (stale) { free (stale); stale = 0; } \ } while (0) #if defined LT_DEBUGWRAPPER static int lt_debug = 1; #else static int lt_debug = 0; #endif const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */ void *xmalloc (size_t num); char *xstrdup (const char *string); const char *base_name (const char *name); char *find_executable (const char *wrapper); char *chase_symlinks (const char *pathspec); int make_executable (const char *path); int check_executable (const char *path); char *strendzap (char *str, const char *pat); void lt_debugprintf (const char *file, int line, const char *fmt, ...); void lt_fatal (const char *file, int line, const char *message, ...); static const char *nonnull (const char *s); static const char *nonempty (const char *s); void lt_setenv (const char *name, const char *value); char *lt_extend_str (const char *orig_value, const char *add, int to_end); void lt_update_exe_path (const char *name, const char *value); void lt_update_lib_path (const char *name, const char *value); char **prepare_spawn (char **argv); void lt_dump_script (FILE *f); EOF cat <= 0) && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) return 1; else return 0; } int make_executable (const char *path) { int rval = 0; struct stat st; lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n", nonempty (path)); if ((!path) || (!*path)) return 0; if (stat (path, &st) >= 0) { rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR); } return rval; } /* Searches for the full path of the wrapper. Returns newly allocated full path name if found, NULL otherwise Does not chase symlinks, even on platforms that support them. */ char * find_executable (const char *wrapper) { int has_slash = 0; const char *p; const char *p_next; /* static buffer for getcwd */ char tmp[LT_PATHMAX + 1]; size_t tmp_len; char *concat_name; lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n", nonempty (wrapper)); if ((wrapper == NULL) || (*wrapper == '\0')) return NULL; /* Absolute path? */ #if defined HAVE_DOS_BASED_FILE_SYSTEM if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':') { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } else { #endif if (IS_DIR_SEPARATOR (wrapper[0])) { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } #if defined HAVE_DOS_BASED_FILE_SYSTEM } #endif for (p = wrapper; *p; p++) if (*p == '/') { has_slash = 1; break; } if (!has_slash) { /* no slashes; search PATH */ const char *path = getenv ("PATH"); if (path != NULL) { for (p = path; *p; p = p_next) { const char *q; size_t p_len; for (q = p; *q; q++) if (IS_PATH_SEPARATOR (*q)) break; p_len = (size_t) (q - p); p_next = (*q == '\0' ? q : q + 1); if (p_len == 0) { /* empty path: current directory */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); } else { concat_name = XMALLOC (char, p_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, p, p_len); concat_name[p_len] = '/'; strcpy (concat_name + p_len + 1, wrapper); } if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } } /* not found in PATH; assume curdir */ } /* Relative path | not found in path: prepend cwd */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); return NULL; } char * chase_symlinks (const char *pathspec) { #ifndef S_ISLNK return xstrdup (pathspec); #else char buf[LT_PATHMAX]; struct stat s; char *tmp_pathspec = xstrdup (pathspec); char *p; int has_symlinks = 0; while (strlen (tmp_pathspec) && !has_symlinks) { lt_debugprintf (__FILE__, __LINE__, "checking path component for symlinks: %s\n", tmp_pathspec); if (lstat (tmp_pathspec, &s) == 0) { if (S_ISLNK (s.st_mode) != 0) { has_symlinks = 1; break; } /* search backwards for last DIR_SEPARATOR */ p = tmp_pathspec + strlen (tmp_pathspec) - 1; while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) p--; if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) { /* no more DIR_SEPARATORS left */ break; } *p = '\0'; } else { lt_fatal (__FILE__, __LINE__, "error accessing file \"%s\": %s", tmp_pathspec, nonnull (strerror (errno))); } } XFREE (tmp_pathspec); if (!has_symlinks) { return xstrdup (pathspec); } tmp_pathspec = realpath (pathspec, buf); if (tmp_pathspec == 0) { lt_fatal (__FILE__, __LINE__, "could not follow symlinks for %s", pathspec); } return xstrdup (tmp_pathspec); #endif } char * strendzap (char *str, const char *pat) { size_t len, patlen; assert (str != NULL); assert (pat != NULL); len = strlen (str); patlen = strlen (pat); if (patlen <= len) { str += len - patlen; if (STREQ (str, pat)) *str = '\0'; } return str; } void lt_debugprintf (const char *file, int line, const char *fmt, ...) { va_list args; if (lt_debug) { (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line); va_start (args, fmt); (void) vfprintf (stderr, fmt, args); va_end (args); } } static void lt_error_core (int exit_status, const char *file, int line, const char *mode, const char *message, va_list ap) { fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode); vfprintf (stderr, message, ap); fprintf (stderr, ".\n"); if (exit_status >= 0) exit (exit_status); } void lt_fatal (const char *file, int line, const char *message, ...) { va_list ap; va_start (ap, message); lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap); va_end (ap); } static const char * nonnull (const char *s) { return s ? s : "(null)"; } static const char * nonempty (const char *s) { return (s && !*s) ? "(empty)" : nonnull (s); } void lt_setenv (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_setenv) setting '%s' to '%s'\n", nonnull (name), nonnull (value)); { #ifdef HAVE_SETENV /* always make a copy, for consistency with !HAVE_SETENV */ char *str = xstrdup (value); setenv (name, str, 1); #else size_t len = strlen (name) + 1 + strlen (value) + 1; char *str = XMALLOC (char, len); sprintf (str, "%s=%s", name, value); if (putenv (str) != EXIT_SUCCESS) { XFREE (str); } #endif } } char * lt_extend_str (const char *orig_value, const char *add, int to_end) { char *new_value; if (orig_value && *orig_value) { size_t orig_value_len = strlen (orig_value); size_t add_len = strlen (add); new_value = XMALLOC (char, add_len + orig_value_len + 1); if (to_end) { strcpy (new_value, orig_value); strcpy (new_value + orig_value_len, add); } else { strcpy (new_value, add); strcpy (new_value + add_len, orig_value); } } else { new_value = xstrdup (add); } return new_value; } void lt_update_exe_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_exe_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); /* some systems can't cope with a ':'-terminated path #' */ size_t len = strlen (new_value); while ((len > 0) && IS_PATH_SEPARATOR (new_value[len-1])) { new_value[--len] = '\0'; } lt_setenv (name, new_value); XFREE (new_value); } } void lt_update_lib_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_lib_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); lt_setenv (name, new_value); XFREE (new_value); } } EOF case $host_os in mingw* | windows*) cat <<"EOF" /* Prepares an argument vector before calling spawn(). Note that spawn() does not by itself call the command interpreter (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") : ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); GetVersionEx(&v); v.dwPlatformId == VER_PLATFORM_WIN32_NT; }) ? "cmd.exe" : "command.com"). Instead it simply concatenates the arguments, separated by ' ', and calls CreateProcess(). We must quote the arguments since Win32 CreateProcess() interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a special way: - Space and tab are interpreted as delimiters. They are not treated as delimiters if they are surrounded by double quotes: "...". - Unescaped double quotes are removed from the input. Their only effect is that within double quotes, space and tab are treated like normal characters. - Backslashes not followed by double quotes are not special. - But 2*n+1 backslashes followed by a double quote become n backslashes followed by a double quote (n >= 0): \" -> " \\\" -> \" \\\\\" -> \\" */ #define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" #define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" char ** prepare_spawn (char **argv) { size_t argc; char **new_argv; size_t i; /* Count number of arguments. */ for (argc = 0; argv[argc] != NULL; argc++) ; /* Allocate new argument vector. */ new_argv = XMALLOC (char *, argc + 1); /* Put quoted arguments into the new argument vector. */ for (i = 0; i < argc; i++) { const char *string = argv[i]; if (string[0] == '\0') new_argv[i] = xstrdup ("\"\""); else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL) { int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL); size_t length; unsigned int backslashes; const char *s; char *quoted_string; char *p; length = 0; backslashes = 0; if (quote_around) length++; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') length += backslashes + 1; length++; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) length += backslashes + 1; quoted_string = XMALLOC (char, length + 1); p = quoted_string; backslashes = 0; if (quote_around) *p++ = '"'; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') { unsigned int j; for (j = backslashes + 1; j > 0; j--) *p++ = '\\'; } *p++ = c; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) { unsigned int j; for (j = backslashes; j > 0; j--) *p++ = '\\'; *p++ = '"'; } *p = '\0'; new_argv[i] = quoted_string; } else new_argv[i] = (char *) string; } new_argv[argc] = NULL; return new_argv; } EOF ;; esac cat <<"EOF" void lt_dump_script (FILE* f) { EOF func_emit_wrapper yes | $SED -n -e ' s/^\(.\{79\}\)\(..*\)/\1\ \2/ h s/\([\\"]\)/\\\1/g s/$/\\n/ s/\([^\n]*\).*/ fputs ("\1", f);/p g D' cat <<"EOF" } EOF } # end: func_emit_cwrapperexe_src # func_win32_import_lib_p ARG # True if ARG is an import lib, as indicated by $file_magic_cmd func_win32_import_lib_p () { $debug_cmd case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in *import*) : ;; *) false ;; esac } # func_suncc_cstd_abi # !!ONLY CALL THIS FOR SUN CC AFTER $compile_command IS FULLY EXPANDED!! # Several compiler flags select an ABI that is incompatible with the # Cstd library. Avoid specifying it if any are in CXXFLAGS. func_suncc_cstd_abi () { $debug_cmd case " $compile_command " in *" -compat=g "*|*\ -std=c++[0-9][0-9]\ *|*" -library=stdcxx4 "*|*" -library=stlport4 "*) suncc_use_cstd_abi=no ;; *) suncc_use_cstd_abi=yes ;; esac } # func_mode_link arg... func_mode_link () { $debug_cmd case $host in *-*-cygwin* | *-*-mingw* | *-*-windows* | *-*-pw32* | *-*-os2* | *-cegcc*) # It is impossible to link a dll without this setting, and # we shouldn't force the makefile maintainer to figure out # what system we are compiling for in order to pass an extra # flag for every libtool invocation. # allow_undefined=no # FIXME: Unfortunately, there are problems with the above when trying # to make a dll that has undefined symbols, in which case not # even a static library is built. For now, we need to specify # -no-undefined on the libtool link line when we can be certain # that all symbols are satisfied, otherwise we get a static library. allow_undefined=yes ;; *) allow_undefined=yes ;; esac libtool_args=$nonopt base_compile="$nonopt $@" compile_command=$nonopt finalize_command=$nonopt compile_rpath= compile_rpath_tail= finalize_rpath= compile_shlibpath= finalize_shlibpath= convenience= old_convenience= deplibs= old_deplibs= compiler_flags= linker_flags= dllsearchpath= lib_search_path=`pwd` inst_prefix_dir= new_inherited_linker_flags= avoid_version=no bindir= dlfiles= dlprefiles= dlself=no export_dynamic=no export_symbols= export_symbols_regex= generated= libobjs= ltlibs= module=no no_install=no objs= os2dllname= non_pic_objects= precious_files_regex= prefer_static_libs=no preload=false prev= prevarg= release= rpath= xrpath= perm_rpath= temp_rpath= temp_rpath_tail= thread_safe=no vinfo= vinfo_number=no weak_libs= rpath_arg= single_module=$wl-single_module func_infer_tag $base_compile # We need to know -static, to get the right output filenames. for arg do case $arg in -shared) test yes != "$build_libtool_libs" \ && func_fatal_configuration "cannot build a shared library" build_old_libs=no break ;; -all-static | -static | -static-libtool-libs) case $arg in -all-static) if test yes = "$build_libtool_libs" && test -z "$link_static_flag"; then func_warning "complete static linking is impossible in this configuration" fi if test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; -static) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=built ;; -static-libtool-libs) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; esac build_libtool_libs=no build_old_libs=yes break ;; esac done # See if our shared archives depend on static archives. test -n "$old_archive_from_new_cmds" && build_old_libs=yes # Go through the arguments, transforming them on the way. while test "$#" -gt 0; do arg=$1 shift func_quote_arg pretty,unquoted "$arg" qarg=$func_quote_arg_unquoted_result func_append libtool_args " $func_quote_arg_result" # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in output) func_append compile_command " @OUTPUT@" func_append finalize_command " @OUTPUT@" ;; esac case $prev in bindir) bindir=$arg prev= continue ;; dlfiles|dlprefiles) $preload || { # Add the symbol object into the linking commands. func_append compile_command " @SYMFILE@" func_append finalize_command " @SYMFILE@" preload=: } case $arg in *.la | *.lo) ;; # We handle these cases below. force) if test no = "$dlself"; then dlself=needless export_dynamic=yes fi prev= continue ;; self) if test dlprefiles = "$prev"; then dlself=yes elif test dlfiles = "$prev" && test yes != "$dlopen_self"; then dlself=yes else dlself=needless export_dynamic=yes fi prev= continue ;; *) if test dlfiles = "$prev"; then func_append dlfiles " $arg" else func_append dlprefiles " $arg" fi prev= continue ;; esac ;; expsyms) export_symbols=$arg test -f "$arg" \ || func_fatal_error "symbol file '$arg' does not exist" prev= continue ;; expsyms_regex) export_symbols_regex=$arg prev= continue ;; framework) case $host in *-*-darwin*) case "$deplibs " in *" $qarg.ltframework "*) ;; *) func_append deplibs " $qarg.ltframework" # this is fixed later ;; esac ;; esac prev= continue ;; inst_prefix) inst_prefix_dir=$arg prev= continue ;; mllvm) # Clang does not use LLVM to link, so we can simply discard any # '-mllvm $arg' options when doing the link step. prev= continue ;; objectlist) if test -f "$arg"; then save_arg=$arg moreargs= for fil in `cat "$save_arg"` do # func_append moreargs " $fil" arg=$fil # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test none = "$pic_object" && test none = "$non_pic_object"; then func_fatal_error "cannot find name of object for '$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir=$func_dirname_result if test none != "$pic_object"; then # Prepend the subdirectory the object is found in. pic_object=$xdir$pic_object if test dlfiles = "$prev"; then if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then func_append dlfiles " $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test dlprefiles = "$prev"; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg=$pic_object fi # Non-PIC object. if test none != "$non_pic_object"; then # Prepend the subdirectory the object is found in. non_pic_object=$xdir$non_pic_object # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test none = "$pic_object"; then arg=$non_pic_object fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object=$pic_object func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir=$func_dirname_result func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "'$arg' is not a valid libtool object" fi fi done else func_fatal_error "link input file '$arg' does not exist" fi arg=$save_arg prev= continue ;; os2dllname) os2dllname=$arg prev= continue ;; precious_regex) precious_files_regex=$arg prev= continue ;; release) release=-$arg prev= continue ;; rpath | xrpath) # We need an absolute path. case $arg in [\\/]* | [A-Za-z]:[\\/]*) ;; *) func_fatal_error "argument to -rpath is not absolute: $arg" ;; esac if test rpath = "$prev"; then case "$rpath " in *" $arg "*) ;; *) func_append rpath " $arg" ;; esac else case "$xrpath " in *" $arg "*) ;; *) func_append xrpath " $arg" ;; esac fi prev= continue ;; shrext) shrext_cmds=$arg prev= continue ;; weak) func_append weak_libs " $arg" prev= continue ;; xassembler) func_append compiler_flags " -Xassembler $qarg" prev= func_append compile_command " -Xassembler $qarg" func_append finalize_command " -Xassembler $qarg" continue ;; xcclinker) func_append linker_flags " $qarg" func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xcompiler) func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xlinker) func_append linker_flags " $qarg" func_append compiler_flags " $wl$qarg" prev= func_append compile_command " $wl$qarg" func_append finalize_command " $wl$qarg" continue ;; *) eval "$prev=\"\$arg\"" prev= continue ;; esac fi # test -n "$prev" prevarg=$arg case $arg in -all-static) if test -n "$link_static_flag"; then # See comment for -static flag below, for more details. func_append compile_command " $link_static_flag" func_append finalize_command " $link_static_flag" fi continue ;; -allow-undefined) # FIXME: remove this flag sometime in the future. func_fatal_error "'-allow-undefined' must not be used because it is the default" ;; -avoid-version) avoid_version=yes continue ;; -bindir) prev=bindir continue ;; -dlopen) prev=dlfiles continue ;; -dlpreopen) prev=dlprefiles continue ;; -export-dynamic) export_dynamic=yes continue ;; -export-symbols | -export-symbols-regex) if test -n "$export_symbols" || test -n "$export_symbols_regex"; then func_fatal_error "more than one -exported-symbols argument is not allowed" fi if test X-export-symbols = "X$arg"; then prev=expsyms else prev=expsyms_regex fi continue ;; -framework) prev=framework continue ;; -inst-prefix-dir) prev=inst_prefix continue ;; # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* # so, if we see these flags be careful not to treat them like -L -L[A-Z][A-Z]*:*) case $with_gcc/$host in no/*-*-irix* | /*-*-irix*) func_append compile_command " $arg" func_append finalize_command " $arg" ;; esac continue ;; -L*) func_stripname "-L" '' "$arg" if test -z "$func_stripname_result"; then if test "$#" -gt 0; then func_fatal_error "require no space between '-L' and '$1'" else func_fatal_error "need path for '-L' option" fi fi func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) absdir=`cd "$dir" && pwd` test -z "$absdir" && \ func_fatal_error "cannot determine absolute directory name of '$dir'" dir=$absdir ;; esac case "$deplibs " in *" -L$dir "* | *" $arg "*) # Will only happen for absolute or sysroot arguments ;; *) # Preserve sysroot, but never include relative directories case $dir in [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;; *) func_append deplibs " -L$dir" ;; esac func_append lib_search_path " $dir" ;; esac case $host in *-*-cygwin* | *-*-mingw* | *-*-windows* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'` case :$dllsearchpath: in *":$dir:"*) ;; ::) dllsearchpath=$dir;; *) func_append dllsearchpath ":$dir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append dllsearchpath ":$testbindir";; esac ;; esac continue ;; -l*) if test X-lc = "X$arg" || test X-lm = "X$arg"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-windows* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*) # These systems don't actually have a C or math library (as such) continue ;; *-*-os2*) # These systems don't actually have a C library (as such) test X-lc = "X$arg" && continue ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-midnightbsd*) # Do not include libc due to us having libc/libc_r. test X-lc = "X$arg" && continue ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C and math libraries are in the System framework func_append deplibs " System.ltframework" continue ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype test X-lc = "X$arg" && continue ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work test X-lc = "X$arg" && continue ;; esac elif test X-lc_r = "X$arg"; then case $host in *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-midnightbsd*) # Do not include libc_r directly, use -pthread flag. continue ;; esac fi func_append deplibs " $arg" continue ;; -mllvm) prev=mllvm continue ;; -module) module=yes continue ;; # Tru64 UNIX uses -model [arg] to determine the layout of C++ # classes, name mangling, and exception handling. # Darwin uses the -arch flag to determine output architecture. # -q