summaryrefslogtreecommitdiff
path: root/subprojects/dbus-gmain
diff options
context:
space:
mode:
Diffstat (limited to 'subprojects/dbus-gmain')
-rw-r--r--subprojects/dbus-gmain/AUTHORS15
-rw-r--r--subprojects/dbus-gmain/CONTRIBUTING.md110
-rw-r--r--subprojects/dbus-gmain/COPYING7
-rw-r--r--subprojects/dbus-gmain/LICENSES/AFL-2.1.txt45
-rw-r--r--subprojects/dbus-gmain/LICENSES/GPL-2.0-or-later.txt117
-rw-r--r--subprojects/dbus-gmain/LICENSES/MIT.txt9
-rw-r--r--subprojects/dbus-gmain/Makefile.am101
-rw-r--r--subprojects/dbus-gmain/Makefile.in1205
-rw-r--r--subprojects/dbus-gmain/README.md51
-rw-r--r--subprojects/dbus-gmain/dbus-gmain.c666
-rw-r--r--subprojects/dbus-gmain/dbus-gmain/dbus-gmain.h60
-rw-r--r--subprojects/dbus-gmain/meson.build140
-rw-r--r--subprojects/dbus-gmain/meson_options.txt23
-rw-r--r--subprojects/dbus-gmain/tests/30574.c143
-rw-r--r--subprojects/dbus-gmain/tests/meson.build66
-rw-r--r--subprojects/dbus-gmain/tests/test-thread-client.c123
-rw-r--r--subprojects/dbus-gmain/tests/test-thread-server.c235
-rw-r--r--subprojects/dbus-gmain/tests/test-thread.h5
-rw-r--r--subprojects/dbus-gmain/tests/use-as-subproject.py34
-rw-r--r--subprojects/dbus-gmain/tests/use-as-subproject/README8
-rw-r--r--subprojects/dbus-gmain/tests/use-as-subproject/meson.build30
-rw-r--r--subprojects/dbus-gmain/tests/use-as-subproject/use-dbus-gmain.c14
-rw-r--r--subprojects/dbus-gmain/tests/util.c48
-rw-r--r--subprojects/dbus-gmain/tests/util.h34
24 files changed, 3289 insertions, 0 deletions
diff --git a/subprojects/dbus-gmain/AUTHORS b/subprojects/dbus-gmain/AUTHORS
new file mode 100644
index 0000000..83c7766
--- /dev/null
+++ b/subprojects/dbus-gmain/AUTHORS
@@ -0,0 +1,15 @@
+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
diff --git a/subprojects/dbus-gmain/CONTRIBUTING.md b/subprojects/dbus-gmain/CONTRIBUTING.md
new file mode 100644
index 0000000..5bbcee1
--- /dev/null
+++ b/subprojects/dbus-gmain/CONTRIBUTING.md
@@ -0,0 +1,110 @@
+# 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:
+<https://gitlab.freedesktop.org/dbus/dbus-glib/tree/dbus-gmain>
+
+## 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 <https://gitlab.freedesktop.org/dbus/dbus-glib>
+ on freedesktop.org Gitlab
+* push your changes to your personal fork as a branch
+* create a merge request at
+ <https://gitlab.freedesktop.org/dbus/dbus-glib/merge_requests>,
+ 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: <https://www.freedesktop.org/wiki/CodeOfConduct>
+
+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.
diff --git a/subprojects/dbus-gmain/COPYING b/subprojects/dbus-gmain/COPYING
new file mode 100644
index 0000000..72084a8
--- /dev/null
+++ b/subprojects/dbus-gmain/COPYING
@@ -0,0 +1,7 @@
+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 available in the LICENSES directory.
+
+This project's licensing is REUSE-compliant <https://reuse.software/>.
+See individual files for full details of copyright and licensing,
+and see LICENSES/*.txt for the license text.
diff --git a/subprojects/dbus-gmain/LICENSES/AFL-2.1.txt b/subprojects/dbus-gmain/LICENSES/AFL-2.1.txt
new file mode 100644
index 0000000..011d6d4
--- /dev/null
+++ b/subprojects/dbus-gmain/LICENSES/AFL-2.1.txt
@@ -0,0 +1,45 @@
+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.
diff --git a/subprojects/dbus-gmain/LICENSES/GPL-2.0-or-later.txt b/subprojects/dbus-gmain/LICENSES/GPL-2.0-or-later.txt
new file mode 100644
index 0000000..17cb286
--- /dev/null
+++ b/subprojects/dbus-gmain/LICENSES/GPL-2.0-or-later.txt
@@ -0,0 +1,117 @@
+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
diff --git a/subprojects/dbus-gmain/LICENSES/MIT.txt b/subprojects/dbus-gmain/LICENSES/MIT.txt
new file mode 100644
index 0000000..2071b23
--- /dev/null
+++ b/subprojects/dbus-gmain/LICENSES/MIT.txt
@@ -0,0 +1,9 @@
+MIT License
+
+Copyright (c) <year> <copyright holders>
+
+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.
diff --git a/subprojects/dbus-gmain/Makefile.am b/subprojects/dbus-gmain/Makefile.am
new file mode 100644
index 0000000..a65244a
--- /dev/null
+++ b/subprojects/dbus-gmain/Makefile.am
@@ -0,0 +1,101 @@
+# 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
+
+EXTRA_DIST = \
+ AUTHORS \
+ CONTRIBUTING.md \
+ COPYING \
+ LICENSES/AFL-2.1.txt \
+ LICENSES/GPL-2.0-or-later.txt \
+ LICENSES/MIT.txt \
+ README.md \
+ meson.build \
+ meson_options.txt \
+ tests/meson.build \
+ tests/use-as-subproject.py \
+ tests/use-as-subproject/README \
+ tests/use-as-subproject/meson.build \
+ tests/use-as-subproject/use-dbus-gmain.c \
+ $(NULL)
+
+AM_CPPFLAGS = \
+ -I$(top_srcdir) \
+ -I$(top_srcdir)/subprojects \
+ -I$(top_builddir) \
+ -I$(top_builddir)/subprojects \
+ $(DBUS_CFLAGS) \
+ $(GLIB_CFLAGS) \
+ $(NULL)
+
+noinst_LTLIBRARIES = \
+ libdbus-gmain.la \
+ tests/libtest.la \
+ $(NULL)
+
+libdbus_gmain_la_SOURCES = \
+ dbus-gmain.c \
+ dbus-gmain/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) --
diff --git a/subprojects/dbus-gmain/Makefile.in b/subprojects/dbus-gmain/Makefile.in
new file mode 100644
index 0000000..e60b4ed
--- /dev/null
+++ b/subprojects/dbus-gmain/Makefile.in
@@ -0,0 +1,1205 @@
+# Makefile.in generated by automake 1.16.5 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2021 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 © 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
+
+
+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))
+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 = subprojects/dbus-gmain
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_append_compile_flags.m4 \
+ $(top_srcdir)/m4/ax_append_flag.m4 \
+ $(top_srcdir)/m4/ax_append_link_flags.m4 \
+ $(top_srcdir)/m4/ax_check_compile_flag.m4 \
+ $(top_srcdir)/m4/ax_check_link_flag.m4 \
+ $(top_srcdir)/m4/ax_compiler_flags.m4 \
+ $(top_srcdir)/m4/ax_compiler_flags_cflags.m4 \
+ $(top_srcdir)/m4/ax_compiler_flags_gir.m4 \
+ $(top_srcdir)/m4/ax_compiler_flags_ldflags.m4 \
+ $(top_srcdir)/m4/ax_is_release.m4 \
+ $(top_srcdir)/m4/ax_python_devel.m4 \
+ $(top_srcdir)/m4/ax_python_module.m4 \
+ $(top_srcdir)/m4/ax_require_defined.m4 \
+ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
+ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
+ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/pkg.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_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_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 -z "$$files" \
+ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+ $(am__cd) "$$dir" && rm -f $$files; }; \
+ }
+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" \
+ --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 '$(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_CFLAGS = @DBUS_CFLAGS@
+DBUS_LIBS = @DBUS_LIBS@
+DBUS_PYTHON_MAJOR_VERSION = @DBUS_PYTHON_MAJOR_VERSION@
+DBUS_PYTHON_MICRO_VERSION = @DBUS_PYTHON_MICRO_VERSION@
+DBUS_PYTHON_MINOR_VERSION = @DBUS_PYTHON_MINOR_VERSION@
+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_LIBS = @GLIB_LIBS@
+GREP = @GREP@
+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_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@
+PLATFORM = @PLATFORM@
+PYTHON = @PYTHON@
+PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@
+PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
+PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@
+PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
+PYTHON_INCLUDES = @PYTHON_INCLUDES@
+PYTHON_LIBS = @PYTHON_LIBS@
+PYTHON_PLATFORM = @PYTHON_PLATFORM@
+PYTHON_PLATFORM_SITE_PKG = @PYTHON_PLATFORM_SITE_PKG@
+PYTHON_PREFIX = @PYTHON_PREFIX@
+PYTHON_SITE_PKG = @PYTHON_SITE_PKG@
+PYTHON_VERSION = @PYTHON_VERSION@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+WARN_CFLAGS = @WARN_CFLAGS@
+WARN_LDFLAGS = @WARN_LDFLAGS@
+WARN_SCANNERFLAGS = @WARN_SCANNERFLAGS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+pkgpyexecdir = @pkgpyexecdir@
+pkgpythondir = @pkgpythondir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+pyexecdir = @pyexecdir@
+pythondir = @pythondir@
+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 \
+ LICENSES/AFL-2.1.txt \
+ LICENSES/GPL-2.0-or-later.txt \
+ LICENSES/MIT.txt \
+ README.md \
+ meson.build \
+ meson_options.txt \
+ tests/meson.build \
+ tests/use-as-subproject.py \
+ tests/use-as-subproject/README \
+ tests/use-as-subproject/meson.build \
+ tests/use-as-subproject/use-dbus-gmain.c \
+ $(NULL)
+
+AM_CPPFLAGS = \
+ -I$(top_srcdir) \
+ -I$(top_srcdir)/subprojects \
+ -I$(top_builddir) \
+ -I$(top_builddir)/subprojects \
+ $(DBUS_CFLAGS) \
+ $(GLIB_CFLAGS) \
+ $(NULL)
+
+noinst_LTLIBRARIES = \
+ libdbus-gmain.la \
+ tests/libtest.la \
+ $(NULL)
+
+libdbus_gmain_la_SOURCES = \
+ dbus-gmain.c \
+ dbus-gmain/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 subprojects/dbus-gmain/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign subprojects/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:
+ @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \
+ echo " rm -f" $$list; \
+ rm -f $$list || exit $$?; \
+ test -n "$(EXEEXT)" || exit 0; \
+ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+ echo " rm -f" $$list; \
+ rm -f $$list
+
+clean-noinstLTLIBRARIES:
+ -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
+ @list='$(noinst_LTLIBRARIES)'; \
+ locs=`for p in $$list; do echo $$p; done | \
+ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
+ sort -u`; \
+ test -z "$$locs" || { \
+ echo rm -f $${locs}; \
+ 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)
+ @echo '# dummy' >$@-t && $(am__mv) $@-t $@
+
+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"; \
+ }; \
+ { \
+ echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \
+ $(am__rst_title); \
+ create_testsuite_report --no-color; \
+ 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)$${std}"; \
+ if test -n "$(PACKAGE_BUGREPORT)"; then \
+ echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}"; \
+ fi; \
+ echo "$$col$$br$$std"; \
+ fi; \
+ $$success || exit 1
+
+check-TESTS:
+ @list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list
+ @list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list
+ @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
+ @set +e; $(am__set_TESTS_bases); \
+ log_list=`for i in $$bases; do echo $$i.log; done`; \
+ trs_list=`for i in $$bases; do echo $$i.trs; done`; \
+ log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \
+ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \
+ exit $$?;
+recheck: all
+ @test -z "$(TEST_SUITE_LOG)" || 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:
+ -test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS)
+ -test -z "$(TEST_LOGS:.log=.trs)" || rm -f $(TEST_LOGS:.log=.trs)
+ -test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+ -rm -f tests/$(DEPDIR)/$(am__dirstamp)
+ -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:
diff --git a/subprojects/dbus-gmain/README.md b/subprojects/dbus-gmain/README.md
new file mode 100644
index 0000000..8f40161
--- /dev/null
+++ b/subprojects/dbus-gmain/README.md
@@ -0,0 +1,51 @@
+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__)`.
diff --git a/subprojects/dbus-gmain/dbus-gmain.c b/subprojects/dbus-gmain/dbus-gmain.c
new file mode 100644
index 0000000..3b7e596
--- /dev/null
+++ b/subprojects/dbus-gmain/dbus-gmain.c
@@ -0,0 +1,666 @@
+/* -*- 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 <config.h>
+#endif
+
+#include <dbus-gmain/dbus-gmain.h>
+
+/*
+ * 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 (G_GNUC_UNUSED GSource *source)
+{
+ return FALSE;
+}
+
+static gboolean
+message_queue_dispatch (GSource *source,
+ G_GNUC_UNUSED GSourceFunc callback,
+ G_GNUC_UNUSED 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 (G_GNUC_UNUSED 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) (void (*) (void)) 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 (G_GNUC_UNUSED 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");
+}
diff --git a/subprojects/dbus-gmain/dbus-gmain/dbus-gmain.h b/subprojects/dbus-gmain/dbus-gmain/dbus-gmain.h
new file mode 100644
index 0000000..b8df034
--- /dev/null
+++ b/subprojects/dbus-gmain/dbus-gmain/dbus-gmain.h
@@ -0,0 +1,60 @@
+/* -*- 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 <config.h>
+#endif
+
+#include <dbus/dbus.h>
+#include <glib.h>
+
+#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 */
+
+
+
+
diff --git a/subprojects/dbus-gmain/meson.build b/subprojects/dbus-gmain/meson.build
new file mode 100644
index 0000000..09f60b5
--- /dev/null
+++ b/subprojects/dbus-gmain/meson.build
@@ -0,0 +1,140 @@
+# Copyright 2022 Collabora Ltd.
+# SPDX-License-Identifier: MIT
+
+project(
+ 'dbus-gmain',
+ 'c',
+ default_options: [
+ 'warning_level=2',
+ ],
+ meson_version: '>=0.56',
+)
+
+cc = meson.get_compiler('c')
+compile_warnings = []
+compile_warnings_c = []
+
+if cc.get_id() != 'msvc'
+ # -fno-common makes the linker more strict: on some systems the linker
+ # is *always* this strict, so we want to behave like that everywhere.
+ # We treat this like a warning, since that's basically how we're using it.
+ compile_warnings += ['-fno-common']
+
+ compile_warnings += [
+ # Intentionally disabled: missing field initializers being implicitly
+ # default-initialized is a feature, not a bug
+ '-Wno-missing-field-initializers',
+
+ # General warnings for both C and C++, excluding those that are part
+ # of -Wall or -Wextra
+ '-Wcast-align',
+ '-Wdouble-promotion',
+ '-Wduplicated-branches',
+ '-Wduplicated-cond',
+ '-Wfloat-equal',
+ '-Wformat-nonliteral',
+ '-Wformat-security',
+ '-Wformat=2',
+ '-Winit-self',
+ '-Wlogical-op',
+ '-Wmissing-declarations',
+ '-Wmissing-format-attribute',
+ '-Wmissing-include-dirs',
+ '-Wmissing-noreturn',
+ '-Wnull-dereference',
+ '-Wpacked',
+ '-Wpointer-arith',
+ '-Wredundant-decls',
+ '-Wshadow',
+ '-Wswitch-default',
+ '-Wswitch-enum',
+ '-Wundef',
+ '-Wunused-but-set-variable',
+ '-Wwrite-strings',
+ ]
+
+ compile_warnings_c += [
+ # Extra warnings just for C
+ '-Wdeclaration-after-statement',
+ '-Wjump-misses-init',
+ '-Wmissing-prototypes',
+ '-Wnested-externs',
+ '-Wold-style-definition',
+ '-Wpointer-sign',
+ '-Wstrict-prototypes',
+ ]
+endif
+
+compile_warnings_c = cc.get_supported_arguments(
+ compile_warnings + compile_warnings_c,
+)
+add_project_arguments(compile_warnings_c, language: 'c')
+
+if get_option('redefine_function_declaration') != ''
+ if not get_option('redefine_function_declaration').contains('name')
+ error('redefine_function_declaration option needs to contain "name"')
+ endif
+
+ if not get_option('redefine_function_declaration').contains('ret')
+ error('redefine_function_declaration option needs to contain "ret"')
+ endif
+
+ if not get_option('redefine_function_declaration').contains('__VA_ARGS__')
+ error('redefine_function_declaration option needs to contain "__VA_ARGS__"')
+ endif
+
+ add_project_arguments(
+ '-DDBUS_GMAIN_FUNCTION(ret, name, ...)=@0@'.format(
+ get_option('redefine_function_declaration'),
+ ),
+ language: 'c',
+ )
+endif
+
+if get_option('redefine_function_name') != ''
+ if not get_option('redefine_function_name').contains('name')
+ error('redefine_function_name option needs to contain "name"')
+ endif
+
+ add_project_arguments(
+ '-DDBUS_GMAIN_FUNCTION_NAME(name)=@0@'.format(
+ get_option('redefine_function_name'),
+ ),
+ language: 'c',
+ )
+endif
+
+dbus_dep = dependency('dbus-1', version: '>=1.8')
+glib_dep = dependency('glib-2.0', version: '>=2.40')
+gthread_dep = dependency(
+ 'gthread-2.0',
+ version: '>=2.40',
+ required: get_option('tests'),
+)
+
+libdbus_gmain = static_library(
+ 'dbus-gmain',
+ 'dbus-gmain.c',
+ dependencies: [
+ dbus_dep,
+ glib_dep,
+ ],
+)
+
+dbus_gmain_dep = declare_dependency(
+ dependencies: [
+ dbus_dep,
+ glib_dep,
+ ],
+ include_directories: include_directories('.'),
+ link_with: libdbus_gmain,
+)
+
+dbus_run_session = find_program(
+ 'dbus-run-session',
+ required: get_option('tests'),
+)
+
+if get_option('tests')
+ subdir('tests')
+endif
diff --git a/subprojects/dbus-gmain/meson_options.txt b/subprojects/dbus-gmain/meson_options.txt
new file mode 100644
index 0000000..ed06753
--- /dev/null
+++ b/subprojects/dbus-gmain/meson_options.txt
@@ -0,0 +1,23 @@
+# Copyright 2022 Collabora Ltd.
+# SPDX-License-Identifier: MIT
+
+option(
+ 'redefine_function_declaration',
+ type: 'string',
+ value: 'G_GNUC_INTERNAL ret DBUS_GMAIN_FUNCTION_NAME (name) (__VA_ARGS__)',
+ description: 'Redefinition of DBUS_GMAIN_FUNCTION(ret, name, ...)',
+)
+
+option(
+ 'redefine_function_name',
+ type: 'string',
+ value: 'dbus_gmain_ ## name',
+ description: 'Redefinition of DBUS_GMAIN_FUNCTION_NAME(name)',
+)
+
+option(
+ 'tests',
+ type: 'boolean',
+ value: true,
+ description: 'Enable unit tests',
+)
diff --git a/subprojects/dbus-gmain/tests/30574.c b/subprojects/dbus-gmain/tests/30574.c
new file mode 100644
index 0000000..6fe2b90
--- /dev/null
+++ b/subprojects/dbus-gmain/tests/30574.c
@@ -0,0 +1,143 @@
+/*
+ * 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 <config.h>
+#endif
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <dbus/dbus.h>
+#include <glib.h>
+#include <dbus-gmain/dbus-gmain.h>
+#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 *conn, DBusMessage *message,
+ dbus_bool_t switch_after_send)
+{
+ DBusPendingCall *pending;
+ SpiReentrantCallClosure closure;
+
+ g_assert (conn == bus);
+
+ 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 (G_GNUC_UNUSED int argc, G_GNUC_UNUSED 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;
+}
diff --git a/subprojects/dbus-gmain/tests/meson.build b/subprojects/dbus-gmain/tests/meson.build
new file mode 100644
index 0000000..8344ee2
--- /dev/null
+++ b/subprojects/dbus-gmain/tests/meson.build
@@ -0,0 +1,66 @@
+# Copyright 2022 Collabora Ltd.
+# SPDX-License-Identifier: MIT
+
+testlib = static_library(
+ 'testutils',
+ 'util.c',
+ dependencies: [
+ dbus_dep,
+ glib_dep,
+ ],
+)
+
+test_thread_server = executable(
+ 'test-thread-server',
+ 'test-thread-server.c',
+ dependencies: [
+ dbus_gmain_dep,
+ dbus_dep,
+ glib_dep,
+ gthread_dep,
+ ],
+ link_with: testlib,
+)
+
+test_thread_client = executable(
+ 'test-thread-client',
+ 'test-thread-client.c',
+ dependencies: [
+ dbus_gmain_dep,
+ dbus_dep,
+ glib_dep,
+ gthread_dep,
+ ],
+ link_with: testlib,
+)
+
+test_cases = ['30574']
+
+foreach test_case : test_cases
+ exe = executable(
+ 'test-' + test_case,
+ test_case + '.c',
+ dependencies: [
+ dbus_gmain_dep,
+ dbus_dep,
+ glib_dep,
+ ],
+ link_with: testlib,
+ )
+ test(
+ test_case,
+ dbus_run_session,
+ args: [
+ '--',
+ exe,
+ ],
+ )
+endforeach
+
+test(
+ 'use-as-subproject',
+ find_program('python3'),
+ args: [
+ files('use-as-subproject.py'),
+ ],
+)
diff --git a/subprojects/dbus-gmain/tests/test-thread-client.c b/subprojects/dbus-gmain/tests/test-thread-client.c
new file mode 100644
index 0000000..a115d41
--- /dev/null
+++ b/subprojects/dbus-gmain/tests/test-thread-client.c
@@ -0,0 +1,123 @@
+/*
+ * 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 <config.h>
+#endif
+
+#include <glib.h>
+#include <dbus-gmain/dbus-gmain.h>
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+
+#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;
+}
+
diff --git a/subprojects/dbus-gmain/tests/test-thread-server.c b/subprojects/dbus-gmain/tests/test-thread-server.c
new file mode 100644
index 0000000..df821fb
--- /dev/null
+++ b/subprojects/dbus-gmain/tests/test-thread-server.c
@@ -0,0 +1,235 @@
+/*
+ * 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 <config.h>
+#endif
+
+#include <glib.h>
+#include <dbus-gmain/dbus-gmain.h>
+#include <stdio.h>
+#include <string.h>
+
+#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,
+ G_GNUC_UNUSED 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 (G_GNUC_UNUSED DBusServer *server,
+ DBusConnection *new_connection,
+ G_GNUC_UNUSED 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;
+}
diff --git a/subprojects/dbus-gmain/tests/test-thread.h b/subprojects/dbus-gmain/tests/test-thread.h
new file mode 100644
index 0000000..74371f4
--- /dev/null
+++ b/subprojects/dbus-gmain/tests/test-thread.h
@@ -0,0 +1,5 @@
+/*
+ * Copyright 2006 Red Hat, Inc.
+ * SPDX-License-Identifier: AFL-2.1 OR GPL-2.0-or-later
+ */
+#define N_TEST_THREADS 5
diff --git a/subprojects/dbus-gmain/tests/use-as-subproject.py b/subprojects/dbus-gmain/tests/use-as-subproject.py
new file mode 100644
index 0000000..3f45c5b
--- /dev/null
+++ b/subprojects/dbus-gmain/tests/use-as-subproject.py
@@ -0,0 +1,34 @@
+#!/usr/bin/env python3
+# Copyright 2022 Collabora Ltd.
+# SPDX-License-Identifier: MIT
+
+import os
+import shutil
+import subprocess
+import tempfile
+
+HERE = os.path.dirname(os.path.abspath(__file__))
+
+if __name__ == '__main__':
+ if shutil.which('meson') is None:
+ print('SKIP: meson not found in PATH')
+ raise SystemExit(0)
+
+ with tempfile.TemporaryDirectory() as temp:
+ shutil.copytree(
+ os.path.join(HERE, 'use-as-subproject'),
+ os.path.join(temp, 'src'),
+ )
+ os.makedirs(os.path.join(temp, 'src', 'subprojects'), exist_ok=True)
+ os.symlink(
+ os.path.dirname(HERE),
+ os.path.join(temp, 'src', 'subprojects', 'dbus-gmain'),
+ )
+ subprocess.run(
+ ['meson', os.path.join(temp, 'src'), os.path.join(temp, 'build')],
+ check=True,
+ )
+ subprocess.run(
+ ['meson', 'compile', '-C', os.path.join(temp, 'build')],
+ check=True,
+ )
diff --git a/subprojects/dbus-gmain/tests/use-as-subproject/README b/subprojects/dbus-gmain/tests/use-as-subproject/README
new file mode 100644
index 0000000..d0f10fd
--- /dev/null
+++ b/subprojects/dbus-gmain/tests/use-as-subproject/README
@@ -0,0 +1,8 @@
+This is a simple example of a project that uses dbus-gmain as a subproject.
+The intention is that if this project can successfully build and use it
+as a subproject, then so could dbus-glib and dbus-python.
+
+<!--
+Copyright 2022 Collabora Ltd.
+SPDX-License-Identifier: MIT
+-->
diff --git a/subprojects/dbus-gmain/tests/use-as-subproject/meson.build b/subprojects/dbus-gmain/tests/use-as-subproject/meson.build
new file mode 100644
index 0000000..65f651a
--- /dev/null
+++ b/subprojects/dbus-gmain/tests/use-as-subproject/meson.build
@@ -0,0 +1,30 @@
+# Copyright 2022 Collabora Ltd.
+# SPDX-License-Identifier: MIT
+
+project(
+ 'use-dbus-gmain-as-subproject',
+ 'c',
+ version : '0',
+ meson_version : '>=0.49.0',
+)
+
+redefine_function_declaration = 'ret DBUS_GMAIN_FUNCTION_NAME (name) (__VA_ARGS__)'
+redefine_function_name = '_my_ ## name'
+
+add_project_arguments(
+ '-DDBUS_GMAIN_FUNCTION(ret, name, ...)=' + redefine_function_declaration,
+ '-DDBUS_GMAIN_FUNCTION_NAME(name)=' + redefine_function_name,
+ language: 'c',
+)
+
+dbus_gmain = subproject(
+ 'dbus-gmain',
+ default_options: [
+ 'redefine_function_declaration=' + redefine_function_declaration,
+ 'redefine_function_name=' + redefine_function_name,
+ 'tests=false',
+ ],
+)
+dbus_gmain_dep = dbus_gmain.get_variable('dbus_gmain_dep')
+
+executable('use-dbus-gmain', 'use-dbus-gmain.c', dependencies: dbus_gmain_dep)
diff --git a/subprojects/dbus-gmain/tests/use-as-subproject/use-dbus-gmain.c b/subprojects/dbus-gmain/tests/use-as-subproject/use-dbus-gmain.c
new file mode 100644
index 0000000..21bf8e9
--- /dev/null
+++ b/subprojects/dbus-gmain/tests/use-as-subproject/use-dbus-gmain.c
@@ -0,0 +1,14 @@
+/*
+ * Copyright 2022 Collabora Ltd.
+ * SPDX-License-Identifier: MIT
+ */
+
+#include <dbus-gmain/dbus-gmain.h>
+
+int
+main (void)
+{
+ DBusConnection *conn = dbus_bus_get (DBUS_BUS_SESSION, NULL);
+ _my_set_up_connection (conn, NULL);
+ return 0;
+}
diff --git a/subprojects/dbus-gmain/tests/util.c b/subprojects/dbus-gmain/tests/util.c
new file mode 100644
index 0000000..07da5d9
--- /dev/null
+++ b/subprojects/dbus-gmain/tests/util.c
@@ -0,0 +1,48 @@
+/* Regression test utilities
+ *
+ * Copyright © 2009-2018 Collabora Ltd. <http://www.collabora.co.uk/>
+ * 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 <config.h>
+#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");
+}
diff --git a/subprojects/dbus-gmain/tests/util.h b/subprojects/dbus-gmain/tests/util.h
new file mode 100644
index 0000000..0d8bfa3
--- /dev/null
+++ b/subprojects/dbus-gmain/tests/util.h
@@ -0,0 +1,34 @@
+/* Regression test utilities
+ *
+ * Copyright © 2009-2018 Collabora Ltd. <http://www.collabora.co.uk/>
+ * 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 <dbus/dbus.h>
+#include <glib.h>
+
+void test_run_until_disconnected (DBusConnection *connection,
+ GMainContext *context);
+
+#endif