diff --git a/debian/files b/debian/files index ebacac881154efe6b0f7f41c01b22e590e89d257..a0667afde47510b671580d924c855ddb5ffc1002 100644 --- a/debian/files +++ b/debian/files @@ -1 +1 @@ -sflphone_0.9.2-1_i386.deb gnome optional +sflphone_0.9.2-0ubuntu1_i386.deb gnome optional diff --git a/debian/rules b/debian/rules index 145965e043d4b2cf09ee38f97f694953f7088ca8..a3db23565f9b3eb2764753c31c58c07a681c9e85 100755 --- a/debian/rules +++ b/debian/rules @@ -78,6 +78,7 @@ install-arch: $(MAKE) prefix=$(CURDIR)/debian/$(package)/usr install cd sflphone-gtk; $(MAKE) prefix=$(CURDIR)/debian/$(package)/usr install cd libs/pjproject-1.0; $(MAKE) prefix=$(CURDIR)/debian/$(package)/usr install + rm -rf $(CURDIR)/debian/$(package)/usr/include dh_install -s # Must not depend on anything. This is to be called by # binary-arch/binary-indep diff --git a/libs/dbus-c++/AUTHORS b/libs/dbus-c++/AUTHORS deleted file mode 100644 index d9c8833559ba2c6f650242249c6b4bb98138c7bd..0000000000000000000000000000000000000000 --- a/libs/dbus-c++/AUTHORS +++ /dev/null @@ -1 +0,0 @@ -Paolo Durante <shackan@gmail.com> diff --git a/libs/dbus-c++/COPYING b/libs/dbus-c++/COPYING deleted file mode 100644 index 5ab7695ab8cabe0c5c8a814bb0ab1e8066578fbb..0000000000000000000000000000000000000000 --- a/libs/dbus-c++/COPYING +++ /dev/null @@ -1,504 +0,0 @@ - GNU LESSER GENERAL PUBLIC LICENSE - Version 2.1, February 1999 - - Copyright (C) 1991, 1999 Free Software Foundation, Inc. - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - -[This is the first released version of the Lesser GPL. It also counts - as the successor of the GNU Library Public License, version 2, hence - the version number 2.1.] - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -Licenses are intended to guarantee your freedom to share and change -free software--to make sure the software is free for all its users. - - This license, the Lesser General Public License, applies to some -specially designated software packages--typically libraries--of the -Free Software Foundation and other authors who decide to use it. You -can use it too, but we suggest you first think carefully about whether -this license or the ordinary General Public License is the better -strategy to use in any particular case, based on the explanations below. - - When we speak of free software, we are referring to freedom of use, -not price. Our General Public Licenses are designed to make sure that -you have the freedom to distribute copies of free software (and charge -for this service if you wish); that you receive source code or can get -it if you want it; that you can change the software and use pieces of -it in new free programs; and that you are informed that you can do -these things. - - To protect your rights, we need to make restrictions that forbid -distributors to deny you these rights or to ask you to surrender these -rights. These restrictions translate to certain responsibilities for -you if you distribute copies of the library or if you modify it. - - For example, if you distribute copies of the library, whether gratis -or for a fee, you must give the recipients all the rights that we gave -you. You must make sure that they, too, receive or can get the source -code. If you link other code with the library, you must provide -complete object files to the recipients, so that they can relink them -with the library after making changes to the library and recompiling -it. And you must show them these terms so they know their rights. - - We protect your rights with a two-step method: (1) we copyright the -library, and (2) we offer you this license, which gives you legal -permission to copy, distribute and/or modify the library. - - To protect each distributor, we want to make it very clear that -there is no warranty for the free library. Also, if the library is -modified by someone else and passed on, the recipients should know -that what they have is not the original version, so that the original -author's reputation will not be affected by problems that might be -introduced by others. - - Finally, software patents pose a constant threat to the existence of -any free program. We wish to make sure that a company cannot -effectively restrict the users of a free program by obtaining a -restrictive license from a patent holder. Therefore, we insist that -any patent license obtained for a version of the library must be -consistent with the full freedom of use specified in this license. - - Most GNU software, including some libraries, is covered by the -ordinary GNU General Public License. This license, the GNU Lesser -General Public License, applies to certain designated libraries, and -is quite different from the ordinary General Public License. We use -this license for certain libraries in order to permit linking those -libraries into non-free programs. - - When a program is linked with a library, whether statically or using -a shared library, the combination of the two is legally speaking a -combined work, a derivative of the original library. The ordinary -General Public License therefore permits such linking only if the -entire combination fits its criteria of freedom. The Lesser General -Public License permits more lax criteria for linking other code with -the library. - - We call this license the "Lesser" General Public License because it -does Less to protect the user's freedom than the ordinary General -Public License. It also provides other free software developers Less -of an advantage over competing non-free programs. These disadvantages -are the reason we use the ordinary General Public License for many -libraries. However, the Lesser license provides advantages in certain -special circumstances. - - For example, on rare occasions, there may be a special need to -encourage the widest possible use of a certain library, so that it becomes -a de-facto standard. To achieve this, non-free programs must be -allowed to use the library. A more frequent case is that a free -library does the same job as widely used non-free libraries. In this -case, there is little to gain by limiting the free library to free -software only, so we use the Lesser General Public License. - - In other cases, permission to use a particular library in non-free -programs enables a greater number of people to use a large body of -free software. For example, permission to use the GNU C Library in -non-free programs enables many more people to use the whole GNU -operating system, as well as its variant, the GNU/Linux operating -system. - - Although the Lesser General Public License is Less protective of the -users' freedom, it does ensure that the user of a program that is -linked with the Library has the freedom and the wherewithal to run -that program using a modified version of the Library. - - The precise terms and conditions for copying, distribution and -modification follow. Pay close attention to the difference between a -"work based on the library" and a "work that uses the library". The -former contains code derived from the library, whereas the latter must -be combined with the library in order to run. - - GNU LESSER GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License Agreement applies to any software library or other -program which contains a notice placed by the copyright holder or -other authorized party saying it may be distributed under the terms of -this Lesser General Public License (also called "this License"). -Each licensee is addressed as "you". - - A "library" means a collection of software functions and/or data -prepared so as to be conveniently linked with application programs -(which use some of those functions and data) to form executables. - - The "Library", below, refers to any such software library or work -which has been distributed under these terms. A "work based on the -Library" means either the Library or any derivative work under -copyright law: that is to say, a work containing the Library or a -portion of it, either verbatim or with modifications and/or translated -straightforwardly into another language. (Hereinafter, translation is -included without limitation in the term "modification".) - - "Source code" for a work means the preferred form of the work for -making modifications to it. For a library, complete source code means -all the source code for all modules it contains, plus any associated -interface definition files, plus the scripts used to control compilation -and installation of the library. - - Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running a program using the Library is not restricted, and output from -such a program is covered only if its contents constitute a work based -on the Library (independent of the use of the Library in a tool for -writing it). Whether that is true depends on what the Library does -and what the program that uses the Library does. - - 1. You may copy and distribute verbatim copies of the Library's -complete source code as you receive it, in any medium, provided that -you conspicuously and appropriately publish on each copy an -appropriate copyright notice and disclaimer of warranty; keep intact -all the notices that refer to this License and to the absence of any -warranty; and distribute a copy of this License along with the -Library. - - You may charge a fee for the physical act of transferring a copy, -and you may at your option offer warranty protection in exchange for a -fee. - - 2. You may modify your copy or copies of the Library or any portion -of it, thus forming a work based on the Library, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) The modified work must itself be a software library. - - b) You must cause the files modified to carry prominent notices - stating that you changed the files and the date of any change. - - c) You must cause the whole of the work to be licensed at no - charge to all third parties under the terms of this License. - - d) If a facility in the modified Library refers to a function or a - table of data to be supplied by an application program that uses - the facility, other than as an argument passed when the facility - is invoked, then you must make a good faith effort to ensure that, - in the event an application does not supply such function or - table, the facility still operates, and performs whatever part of - its purpose remains meaningful. - - (For example, a function in a library to compute square roots has - a purpose that is entirely well-defined independent of the - application. Therefore, Subsection 2d requires that any - application-supplied function or table used by this function must - be optional: if the application does not supply it, the square - root function must still compute square roots.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Library, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Library, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote -it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Library. - -In addition, mere aggregation of another work not based on the Library -with the Library (or with a work based on the Library) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may opt to apply the terms of the ordinary GNU General Public -License instead of this License to a given copy of the Library. To do -this, you must alter all the notices that refer to this License, so -that they refer to the ordinary GNU General Public License, version 2, -instead of to this License. (If a newer version than version 2 of the -ordinary GNU General Public License has appeared, then you can specify -that version instead if you wish.) Do not make any other change in -these notices. - - Once this change is made in a given copy, it is irreversible for -that copy, so the ordinary GNU General Public License applies to all -subsequent copies and derivative works made from that copy. - - This option is useful when you wish to copy part of the code of -the Library into a program that is not a library. - - 4. You may copy and distribute the Library (or a portion or -derivative of it, under Section 2) in object code or executable form -under the terms of Sections 1 and 2 above provided that you accompany -it with the complete corresponding machine-readable source code, which -must be distributed under the terms of Sections 1 and 2 above on a -medium customarily used for software interchange. - - If distribution of object code is made by offering access to copy -from a designated place, then offering equivalent access to copy the -source code from the same place satisfies the requirement to -distribute the source code, even though third parties are not -compelled to copy the source along with the object code. - - 5. A program that contains no derivative of any portion of the -Library, but is designed to work with the Library by being compiled or -linked with it, is called a "work that uses the Library". Such a -work, in isolation, is not a derivative work of the Library, and -therefore falls outside the scope of this License. - - However, linking a "work that uses the Library" with the Library -creates an executable that is a derivative of the Library (because it -contains portions of the Library), rather than a "work that uses the -library". The executable is therefore covered by this License. -Section 6 states terms for distribution of such executables. - - When a "work that uses the Library" uses material from a header file -that is part of the Library, the object code for the work may be a -derivative work of the Library even though the source code is not. -Whether this is true is especially significant if the work can be -linked without the Library, or if the work is itself a library. The -threshold for this to be true is not precisely defined by law. - - If such an object file uses only numerical parameters, data -structure layouts and accessors, and small macros and small inline -functions (ten lines or less in length), then the use of the object -file is unrestricted, regardless of whether it is legally a derivative -work. (Executables containing this object code plus portions of the -Library will still fall under Section 6.) - - Otherwise, if the work is a derivative of the Library, you may -distribute the object code for the work under the terms of Section 6. -Any executables containing that work also fall under Section 6, -whether or not they are linked directly with the Library itself. - - 6. As an exception to the Sections above, you may also combine or -link a "work that uses the Library" with the Library to produce a -work containing portions of the Library, and distribute that work -under terms of your choice, provided that the terms permit -modification of the work for the customer's own use and reverse -engineering for debugging such modifications. - - You must give prominent notice with each copy of the work that the -Library is used in it and that the Library and its use are covered by -this License. You must supply a copy of this License. If the work -during execution displays copyright notices, you must include the -copyright notice for the Library among them, as well as a reference -directing the user to the copy of this License. Also, you must do one -of these things: - - a) Accompany the work with the complete corresponding - machine-readable source code for the Library including whatever - changes were used in the work (which must be distributed under - Sections 1 and 2 above); and, if the work is an executable linked - with the Library, with the complete machine-readable "work that - uses the Library", as object code and/or source code, so that the - user can modify the Library and then relink to produce a modified - executable containing the modified Library. (It is understood - that the user who changes the contents of definitions files in the - Library will not necessarily be able to recompile the application - to use the modified definitions.) - - b) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (1) uses at run time a - copy of the library already present on the user's computer system, - rather than copying library functions into the executable, and (2) - will operate properly with a modified version of the library, if - the user installs one, as long as the modified version is - interface-compatible with the version that the work was made with. - - c) Accompany the work with a written offer, valid for at - least three years, to give the same user the materials - specified in Subsection 6a, above, for a charge no more - than the cost of performing this distribution. - - d) If distribution of the work is made by offering access to copy - from a designated place, offer equivalent access to copy the above - specified materials from the same place. - - e) Verify that the user has already received a copy of these - materials or that you have already sent this user a copy. - - For an executable, the required form of the "work that uses the -Library" must include any data and utility programs needed for -reproducing the executable from it. However, as a special exception, -the materials to be distributed need not include anything that is -normally distributed (in either source or binary form) with the major -components (compiler, kernel, and so on) of the operating system on -which the executable runs, unless that component itself accompanies -the executable. - - It may happen that this requirement contradicts the license -restrictions of other proprietary libraries that do not normally -accompany the operating system. Such a contradiction means you cannot -use both them and the Library together in an executable that you -distribute. - - 7. You may place library facilities that are a work based on the -Library side-by-side in a single library together with other library -facilities not covered by this License, and distribute such a combined -library, provided that the separate distribution of the work based on -the Library and of the other library facilities is otherwise -permitted, and provided that you do these two things: - - a) Accompany the combined library with a copy of the same work - based on the Library, uncombined with any other library - facilities. This must be distributed under the terms of the - Sections above. - - b) Give prominent notice with the combined library of the fact - that part of it is a work based on the Library, and explaining - where to find the accompanying uncombined form of the same work. - - 8. You may not copy, modify, sublicense, link with, or distribute -the Library except as expressly provided under this License. Any -attempt otherwise to copy, modify, sublicense, link with, or -distribute the Library is void, and will automatically terminate your -rights under this License. However, parties who have received copies, -or rights, from you under this License will not have their licenses -terminated so long as such parties remain in full compliance. - - 9. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Library or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Library (or any work based on the -Library), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Library or works based on it. - - 10. Each time you redistribute the Library (or any work based on the -Library), the recipient automatically receives a license from the -original licensor to copy, distribute, link with or modify the Library -subject to these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties with -this License. - - 11. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Library at all. For example, if a patent -license would not permit royalty-free redistribution of the Library by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Library. - -If any portion of this section is held invalid or unenforceable under any -particular circumstance, the balance of the section is intended to apply, -and the section as a whole is intended to apply in other circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 12. If the distribution and/or use of the Library is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Library under this License may add -an explicit geographical distribution limitation excluding those countries, -so that distribution is permitted only in or among countries not thus -excluded. In such case, this License incorporates the limitation as if -written in the body of this License. - - 13. The Free Software Foundation may publish revised and/or new -versions of the Lesser General Public License from time to time. -Such new versions will be similar in spirit to the present version, -but may differ in detail to address new problems or concerns. - -Each version is given a distinguishing version number. If the Library -specifies a version number of this License which applies to it and -"any later version", you have the option of following the terms and -conditions either of that version or of any later version published by -the Free Software Foundation. If the Library does not specify a -license version number, you may choose any version ever published by -the Free Software Foundation. - - 14. If you wish to incorporate parts of the Library into other free -programs whose distribution conditions are incompatible with these, -write to the author to ask for permission. For software which is -copyrighted by the Free Software Foundation, write to the Free -Software Foundation; we sometimes make exceptions for this. Our -decision will be guided by the two goals of preserving the free status -of all derivatives of our free software and of promoting the sharing -and reuse of software generally. - - NO WARRANTY - - 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO -WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. -EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR -OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY -KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE -LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME -THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN -WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY -AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU -FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR -CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE -LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING -RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A -FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF -SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Libraries - - If you develop a new library, and you want it to be of the greatest -possible use to the public, we recommend making it free software that -everyone can redistribute and change. You can do so by permitting -redistribution under these terms (or, alternatively, under the terms of the -ordinary General Public License). - - To apply these terms, attach the following notices to the library. It is -safest to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least the -"copyright" line and a pointer to where the full notice is found. - - <one line to give the library's name and a brief idea of what it does.> - Copyright (C) <year> <name of author> - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - -Also add information on how to contact you by electronic and paper mail. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the library, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the - library `Frob' (a library for tweaking knobs) written by James Random Hacker. - - <signature of Ty Coon>, 1 April 1990 - Ty Coon, President of Vice - -That's all there is to it! - - diff --git a/libs/dbus-c++/ChangeLog b/libs/dbus-c++/ChangeLog deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/libs/dbus-c++/INSTALL b/libs/dbus-c++/INSTALL deleted file mode 100644 index 23e5f25d0e5f85798dcfb368ecb2f04f59777f61..0000000000000000000000000000000000000000 --- a/libs/dbus-c++/INSTALL +++ /dev/null @@ -1,236 +0,0 @@ -Installation Instructions -************************* - -Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005 Free -Software Foundation, Inc. - -This file is free documentation; the Free Software Foundation gives -unlimited permission to copy, distribute and modify it. - -Basic Installation -================== - -These are generic installation instructions. - - The `configure' shell script attempts to guess correct values for -various system-dependent variables used during compilation. It uses -those values to create a `Makefile' in each directory of the package. -It may also create one or more `.h' files containing system-dependent -definitions. Finally, it creates a shell script `config.status' that -you can run in the future to recreate the current configuration, and a -file `config.log' containing compiler output (useful mainly for -debugging `configure'). - - It can also use an optional file (typically called `config.cache' -and enabled with `--cache-file=config.cache' or simply `-C') that saves -the results of its tests to speed up reconfiguring. (Caching is -disabled by default to prevent problems with accidental use of stale -cache files.) - - If you need to do unusual things to compile the package, please try -to figure out how `configure' could check whether to do them, and mail -diffs or instructions to the address given in the `README' so they can -be considered for the next release. If you are using the cache, and at -some point `config.cache' contains results you don't want to keep, you -may remove or edit it. - - The file `configure.ac' (or `configure.in') is used to create -`configure' by a program called `autoconf'. You only need -`configure.ac' if you want to change it or regenerate `configure' using -a newer version of `autoconf'. - -The simplest way to compile this package is: - - 1. `cd' to the directory containing the package's source code and type - `./configure' to configure the package for your system. If you're - using `csh' on an old version of System V, you might need to type - `sh ./configure' instead to prevent `csh' from trying to execute - `configure' itself. - - Running `configure' takes awhile. While running, it prints some - messages telling which features it is checking for. - - 2. Type `make' to compile the package. - - 3. Optionally, type `make check' to run any self-tests that come with - the package. - - 4. Type `make install' to install the programs and any data files and - documentation. - - 5. You can remove the program binaries and object files from the - source code directory by typing `make clean'. To also remove the - files that `configure' created (so you can compile the package for - a different kind of computer), type `make distclean'. There is - also a `make maintainer-clean' target, but that is intended mainly - for the package's developers. If you use it, you may have to get - all sorts of other programs in order to regenerate files that came - with the distribution. - -Compilers and Options -===================== - -Some systems require unusual options for compilation or linking that the -`configure' script does not know about. Run `./configure --help' for -details on some of the pertinent environment variables. - - You can give `configure' initial values for configuration parameters -by setting variables in the command line or in the environment. Here -is an example: - - ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix - - *Note Defining Variables::, for more details. - -Compiling For Multiple Architectures -==================================== - -You can compile the package for more than one kind of computer at the -same time, by placing the object files for each architecture in their -own directory. To do this, you must use a version of `make' that -supports the `VPATH' variable, such as GNU `make'. `cd' to the -directory where you want the object files and executables to go and run -the `configure' script. `configure' automatically checks for the -source code in the directory that `configure' is in and in `..'. - - If you have to use a `make' that does not support the `VPATH' -variable, you have to compile the package for one architecture at a -time in the source code directory. After you have installed the -package for one architecture, use `make distclean' before reconfiguring -for another architecture. - -Installation Names -================== - -By default, `make install' installs the package's commands under -`/usr/local/bin', include files under `/usr/local/include', etc. You -can specify an installation prefix other than `/usr/local' by giving -`configure' the option `--prefix=PREFIX'. - - You can specify separate installation prefixes for -architecture-specific files and architecture-independent files. If you -pass the option `--exec-prefix=PREFIX' to `configure', the package uses -PREFIX as the prefix for installing programs and libraries. -Documentation and other data files still use the regular prefix. - - In addition, if you use an unusual directory layout you can give -options like `--bindir=DIR' to specify different values for particular -kinds of files. Run `configure --help' for a list of the directories -you can set and what kinds of files go in them. - - If the package supports it, you can cause programs to be installed -with an extra prefix or suffix on their names by giving `configure' the -option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. - -Optional Features -================= - -Some packages pay attention to `--enable-FEATURE' options to -`configure', where FEATURE indicates an optional part of the package. -They may also pay attention to `--with-PACKAGE' options, where PACKAGE -is something like `gnu-as' or `x' (for the X Window System). The -`README' should mention any `--enable-' and `--with-' options that the -package recognizes. - - For packages that use the X Window System, `configure' can usually -find the X include and library files automatically, but if it doesn't, -you can use the `configure' options `--x-includes=DIR' and -`--x-libraries=DIR' to specify their locations. - -Specifying the System Type -========================== - -There may be some features `configure' cannot figure out automatically, -but needs to determine by the type of machine the package will run on. -Usually, assuming the package is built to be run on the _same_ -architectures, `configure' can figure that out, but if it prints a -message saying it cannot guess the machine type, give it the -`--build=TYPE' option. TYPE can either be a short name for the system -type, such as `sun4', or a canonical name which has the form: - - CPU-COMPANY-SYSTEM - -where SYSTEM can have one of these forms: - - OS KERNEL-OS - - See the file `config.sub' for the possible values of each field. If -`config.sub' isn't included in this package, then this package doesn't -need to know the machine type. - - If you are _building_ compiler tools for cross-compiling, you should -use the option `--target=TYPE' to select the type of system they will -produce code for. - - If you want to _use_ a cross compiler, that generates code for a -platform different from the build platform, you should specify the -"host" platform (i.e., that on which the generated programs will -eventually be run) with `--host=TYPE'. - -Sharing Defaults -================ - -If you want to set default values for `configure' scripts to share, you -can create a site shell script called `config.site' that gives default -values for variables like `CC', `cache_file', and `prefix'. -`configure' looks for `PREFIX/share/config.site' if it exists, then -`PREFIX/etc/config.site' if it exists. Or, you can set the -`CONFIG_SITE' environment variable to the location of the site script. -A warning: not all `configure' scripts look for a site script. - -Defining Variables -================== - -Variables not defined in a site shell script can be set in the -environment passed to `configure'. However, some packages may run -configure again during the build, and the customized values of these -variables may be lost. In order to avoid this problem, you should set -them in the `configure' command line, using `VAR=value'. For example: - - ./configure CC=/usr/local2/bin/gcc - -causes the specified `gcc' to be used as the C compiler (unless it is -overridden in the site shell script). Here is a another example: - - /bin/bash ./configure CONFIG_SHELL=/bin/bash - -Here the `CONFIG_SHELL=/bin/bash' operand causes subsequent -configuration-related scripts to be executed by `/bin/bash'. - -`configure' Invocation -====================== - -`configure' recognizes the following options to control how it operates. - -`--help' -`-h' - Print a summary of the options to `configure', and exit. - -`--version' -`-V' - Print the version of Autoconf used to generate the `configure' - script, and exit. - -`--cache-file=FILE' - Enable the cache: use and save the results of the tests in FILE, - traditionally `config.cache'. FILE defaults to `/dev/null' to - disable caching. - -`--config-cache' -`-C' - Alias for `--cache-file=config.cache'. - -`--quiet' -`--silent' -`-q' - Do not print messages saying which checks are being made. To - suppress all normal output, redirect it to `/dev/null' (any error - messages will still be shown). - -`--srcdir=DIR' - Look for the package's source code in directory DIR. Usually - `configure' can determine that directory automatically. - -`configure' also accepts some other, not widely useful, options. Run -`configure --help' for more details. - diff --git a/libs/dbus-c++/Makefile.am b/libs/dbus-c++/Makefile.am deleted file mode 100644 index 29bb7c9bb72b0e73a77594019c38280345c20cf2..0000000000000000000000000000000000000000 --- a/libs/dbus-c++/Makefile.am +++ /dev/null @@ -1,22 +0,0 @@ -SUBDIRS = src tools data doc examples - -EXTRA_DIST = autogen.sh libdbus-c++.spec libdbus-c++.spec.in - -pkgconfigdir = $(libdir)/pkgconfig -pkgconfig_DATA = dbus-c++-1.pc - -MAINTAINERCLEANFILES = \ - configure \ - Makefile.in \ - aclocal.m4 \ - compile \ - config.guess \ - config.sub \ - depcomp \ - install-sh \ - ltmain.sh \ - mdate-sh \ - missing \ - mkinstalldirs \ - libdbus-c++.spec - diff --git a/libs/dbus-c++/NEWS b/libs/dbus-c++/NEWS deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/libs/dbus-c++/README b/libs/dbus-c++/README deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/libs/dbus-c++/SConscript b/libs/dbus-c++/SConscript deleted file mode 100644 index d7b235898951800d2de2cb1470266aa63daad1df..0000000000000000000000000000000000000000 --- a/libs/dbus-c++/SConscript +++ /dev/null @@ -1,85 +0,0 @@ -# -# library -# - -env = WengoGetEnvironment() - -env.ParseConfig('pkg-config --cflags --libs dbus-1') - -libs = [ - 'expat' -] -lib_path = [] -include_path = [ - 'include' -] -defines = { - 'DBUS_API_SUBJECT_TO_CHANGE':1, - 'DEBUG':1 -} -headers = [] -sources = [ - 'src/connection.cpp', - 'src/debug.cpp', - 'src/dispatcher.cpp', - 'src/error.cpp', - 'src/eventloop.cpp', - 'src/interface.cpp', - 'src/introspection.cpp', - 'src/property.cpp', - 'src/message.cpp', - 'src/object.cpp', - 'src/pendingcall.cpp', - 'src/server.cpp', - 'src/types.cpp', - 'src/xml.cpp' -] - -env.WengoAddDefines(defines) -env.WengoAddIncludePath(include_path) -env.WengoUseLibraries(libs) -env.WengoStaticLibrary('dbus-c++', sources) - -# -# tools -# - -tools_env = WengoGetEnvironment() - -tools_libs = [ - 'dbus-c++' -] -tools_defines = { - 'DBUS_API_SUBJECT_TO_CHANGE':1, -} -introspect_sources = [ - 'tools/introspect.cpp', -] - -xml2cpp_sources = [ - 'tools/xml2cpp.cpp' -] - -#tools_env.Append(LINKFLAGS = '-z origin') -#tools_env.Append(RPATH = env.Literal('\\$$ORIGIN\.')) - -tools_env.WengoAddDefines(tools_defines) -tools_env.WengoAddIncludePath(include_path) -tools_env.WengoUseLibraries(tools_libs) - -dbusxx_introspect = tools_env.WengoProgram('dbusxx-introspect', introspect_sources) -dbusxx_xml2cpp = tools_env.WengoProgram('dbusxx-xml2cpp', xml2cpp_sources) - -# -# xml translator -# - -def dbusxx_xml2cpp_emitter(target, source, env): - env.Depends(target, dbusxx_xml2cpp) - return (target, source) - -dbusxx_xml2cpp_builder = Builder(action = dbusxx_xml2cpp[0].abspath + ' $SOURCE --adaptor=$TARGET', - emitter = dbusxx_xml2cpp_emitter, - suffix = '.h', src_suffix = '.xml') - -Export('dbusxx_xml2cpp_builder') diff --git a/libs/dbus-c++/TODO b/libs/dbus-c++/TODO deleted file mode 100644 index f975a80a45241239e7a50bbb859bdc26de54d1c2..0000000000000000000000000000000000000000 --- a/libs/dbus-c++/TODO +++ /dev/null @@ -1,8 +0,0 @@ -* Implement asynchronous method calls (hint: start from DBus::PendingCall) -* ...and patch the codegen to generate stubs for them -* Implement continuations in a saner way -* Find time for some hardcore valgrinding -* Make DBus::Server free an incoming connection when it's disconnected, not when freeing the server -* More examples -* Inline (Doxygen-style) documentation -* Native protocol implementation (as an alternative to libdbus) diff --git a/libs/dbus-c++/autogen.sh b/libs/dbus-c++/autogen.sh deleted file mode 100755 index 4af86e25d4b4dde140668ab04805c9f0c3a8018e..0000000000000000000000000000000000000000 --- a/libs/dbus-c++/autogen.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash - -function autocmd() -{ - echo "Running ${1}..." - $* || { - echo "Error running ${1}" - exit 1 - } -} - -autocmd libtoolize --force --copy -autocmd aclocal -autocmd autoheader -autocmd automake --add-missing --force-missing --copy -Wall -autocmd autoconf - -echo "Autogen done, now you can ./configure" diff --git a/libs/dbus-c++/config.guess b/libs/dbus-c++/config.guess deleted file mode 100755 index 278f9e9e07c1d1a3bda668e6529bcce3006cfbdf..0000000000000000000000000000000000000000 --- a/libs/dbus-c++/config.guess +++ /dev/null @@ -1,1516 +0,0 @@ -#! /bin/sh -# Attempt to guess a canonical system name. -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, -# Inc. - -timestamp='2007-07-22' - -# This file is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA -# 02110-1301, USA. -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - - -# Originally written by Per Bothner <per@bothner.com>. -# Please send patches to <config-patches@gnu.org>. Submit a context -# diff and a properly formatted ChangeLog entry. -# -# This script attempts to guess a canonical system name similar to -# config.sub. If it succeeds, it prints the system name on stdout, and -# exits with 0. Otherwise, it exits with 1. -# -# The plan is that this can be called by configure scripts if you -# don't specify an explicit build system type. - -me=`echo "$0" | sed -e 's,.*/,,'` - -usage="\ -Usage: $0 [OPTION] - -Output the configuration name of the system \`$me' is run on. - -Operation modes: - -h, --help print this help, then exit - -t, --time-stamp print date of last modification, then exit - -v, --version print version number, then exit - -Report bugs and patches to <config-patches@gnu.org>." - -version="\ -GNU config.guess ($timestamp) - -Originally written by Per Bothner. -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 -Free Software Foundation, Inc. - -This is free software; see the source for copying conditions. There is NO -warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." - -help=" -Try \`$me --help' for more information." - -# Parse command line -while test $# -gt 0 ; do - case $1 in - --time-stamp | --time* | -t ) - echo "$timestamp" ; exit ;; - --version | -v ) - echo "$version" ; exit ;; - --help | --h* | -h ) - echo "$usage"; exit ;; - -- ) # Stop option processing - shift; break ;; - - ) # Use stdin as input. - break ;; - -* ) - echo "$me: invalid option $1$help" >&2 - exit 1 ;; - * ) - break ;; - esac -done - -if test $# != 0; then - echo "$me: too many arguments$help" >&2 - exit 1 -fi - -trap 'exit 1' 1 2 15 - -# CC_FOR_BUILD -- compiler used by this script. Note that the use of a -# compiler to aid in system detection is discouraged as it requires -# temporary files to be created and, as you can see below, it is a -# headache to deal with in a portable fashion. - -# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still -# use `HOST_CC' if defined, but it is deprecated. - -# Portable tmp directory creation inspired by the Autoconf team. - -set_cc_for_build=' -trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; -trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; -: ${TMPDIR=/tmp} ; - { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || - { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || - { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || - { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; -dummy=$tmp/dummy ; -tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; -case $CC_FOR_BUILD,$HOST_CC,$CC in - ,,) echo "int x;" > $dummy.c ; - for c in cc gcc c89 c99 ; do - if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then - CC_FOR_BUILD="$c"; break ; - fi ; - done ; - if test x"$CC_FOR_BUILD" = x ; then - CC_FOR_BUILD=no_compiler_found ; - fi - ;; - ,,*) CC_FOR_BUILD=$CC ;; - ,*,*) CC_FOR_BUILD=$HOST_CC ;; -esac ; set_cc_for_build= ;' - -# This is needed to find uname on a Pyramid OSx when run in the BSD universe. -# (ghazi@noc.rutgers.edu 1994-08-24) -if (test -f /.attbin/uname) >/dev/null 2>&1 ; then - PATH=$PATH:/.attbin ; export PATH -fi - -UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown -UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown -UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown -UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown - -# Note: order is significant - the case branches are not exclusive. - -case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in - *:NetBSD:*:*) - # NetBSD (nbsd) targets should (where applicable) match one or - # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, - # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently - # switched to ELF, *-*-netbsd* would select the old - # object file format. This provides both forward - # compatibility and a consistent mechanism for selecting the - # object file format. - # - # Note: NetBSD doesn't particularly care about the vendor - # portion of the name. We always set it to "unknown". - sysctl="sysctl -n hw.machine_arch" - UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ - /usr/sbin/$sysctl 2>/dev/null || echo unknown)` - case "${UNAME_MACHINE_ARCH}" in - armeb) machine=armeb-unknown ;; - arm*) machine=arm-unknown ;; - sh3el) machine=shl-unknown ;; - sh3eb) machine=sh-unknown ;; - sh5el) machine=sh5le-unknown ;; - *) machine=${UNAME_MACHINE_ARCH}-unknown ;; - esac - # The Operating System including object format, if it has switched - # to ELF recently, or will in the future. - case "${UNAME_MACHINE_ARCH}" in - arm*|i386|m68k|ns32k|sh3*|sparc|vax) - eval $set_cc_for_build - if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ - | grep __ELF__ >/dev/null - then - # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). - # Return netbsd for either. FIX? - os=netbsd - else - os=netbsdelf - fi - ;; - *) - os=netbsd - ;; - esac - # The OS release - # Debian GNU/NetBSD machines have a different userland, and - # thus, need a distinct triplet. However, they do not need - # kernel version information, so it can be replaced with a - # suitable tag, in the style of linux-gnu. - case "${UNAME_VERSION}" in - Debian*) - release='-gnu' - ;; - *) - release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` - ;; - esac - # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: - # contains redundant information, the shorter form: - # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. - echo "${machine}-${os}${release}" - exit ;; - *:OpenBSD:*:*) - UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` - echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} - exit ;; - *:ekkoBSD:*:*) - echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} - exit ;; - *:SolidBSD:*:*) - echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} - exit ;; - macppc:MirBSD:*:*) - echo powerpc-unknown-mirbsd${UNAME_RELEASE} - exit ;; - *:MirBSD:*:*) - echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} - exit ;; - alpha:OSF1:*:*) - case $UNAME_RELEASE in - *4.0) - UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` - ;; - *5.*) - UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` - ;; - esac - # According to Compaq, /usr/sbin/psrinfo has been available on - # OSF/1 and Tru64 systems produced since 1995. I hope that - # covers most systems running today. This code pipes the CPU - # types through head -n 1, so we only detect the type of CPU 0. - ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` - case "$ALPHA_CPU_TYPE" in - "EV4 (21064)") - UNAME_MACHINE="alpha" ;; - "EV4.5 (21064)") - UNAME_MACHINE="alpha" ;; - "LCA4 (21066/21068)") - UNAME_MACHINE="alpha" ;; - "EV5 (21164)") - UNAME_MACHINE="alphaev5" ;; - "EV5.6 (21164A)") - UNAME_MACHINE="alphaev56" ;; - "EV5.6 (21164PC)") - UNAME_MACHINE="alphapca56" ;; - "EV5.7 (21164PC)") - UNAME_MACHINE="alphapca57" ;; - "EV6 (21264)") - UNAME_MACHINE="alphaev6" ;; - "EV6.7 (21264A)") - UNAME_MACHINE="alphaev67" ;; - "EV6.8CB (21264C)") - UNAME_MACHINE="alphaev68" ;; - "EV6.8AL (21264B)") - UNAME_MACHINE="alphaev68" ;; - "EV6.8CX (21264D)") - UNAME_MACHINE="alphaev68" ;; - "EV6.9A (21264/EV69A)") - UNAME_MACHINE="alphaev69" ;; - "EV7 (21364)") - UNAME_MACHINE="alphaev7" ;; - "EV7.9 (21364A)") - UNAME_MACHINE="alphaev79" ;; - esac - # A Pn.n version is a patched version. - # A Vn.n version is a released version. - # A Tn.n version is a released field test version. - # A Xn.n version is an unreleased experimental baselevel. - # 1.2 uses "1.2" for uname -r. - echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - exit ;; - Alpha\ *:Windows_NT*:*) - # How do we know it's Interix rather than the generic POSIX subsystem? - # Should we change UNAME_MACHINE based on the output of uname instead - # of the specific Alpha model? - echo alpha-pc-interix - exit ;; - 21064:Windows_NT:50:3) - echo alpha-dec-winnt3.5 - exit ;; - Amiga*:UNIX_System_V:4.0:*) - echo m68k-unknown-sysv4 - exit ;; - *:[Aa]miga[Oo][Ss]:*:*) - echo ${UNAME_MACHINE}-unknown-amigaos - exit ;; - *:[Mm]orph[Oo][Ss]:*:*) - echo ${UNAME_MACHINE}-unknown-morphos - exit ;; - *:OS/390:*:*) - echo i370-ibm-openedition - exit ;; - *:z/VM:*:*) - echo s390-ibm-zvmoe - exit ;; - *:OS400:*:*) - echo powerpc-ibm-os400 - exit ;; - arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) - echo arm-acorn-riscix${UNAME_RELEASE} - exit ;; - arm:riscos:*:*|arm:RISCOS:*:*) - echo arm-unknown-riscos - exit ;; - SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) - echo hppa1.1-hitachi-hiuxmpp - exit ;; - Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) - # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. - if test "`(/bin/universe) 2>/dev/null`" = att ; then - echo pyramid-pyramid-sysv3 - else - echo pyramid-pyramid-bsd - fi - exit ;; - NILE*:*:*:dcosx) - echo pyramid-pyramid-svr4 - exit ;; - DRS?6000:unix:4.0:6*) - echo sparc-icl-nx6 - exit ;; - DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) - case `/usr/bin/uname -p` in - sparc) echo sparc-icl-nx7; exit ;; - esac ;; - sun4H:SunOS:5.*:*) - echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; - sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) - echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; - i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) - echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; - sun4*:SunOS:6*:*) - # According to config.sub, this is the proper way to canonicalize - # SunOS6. Hard to guess exactly what SunOS6 will be like, but - # it's likely to be more like Solaris than SunOS4. - echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; - sun4*:SunOS:*:*) - case "`/usr/bin/arch -k`" in - Series*|S4*) - UNAME_RELEASE=`uname -v` - ;; - esac - # Japanese Language versions have a version number like `4.1.3-JL'. - echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` - exit ;; - sun3*:SunOS:*:*) - echo m68k-sun-sunos${UNAME_RELEASE} - exit ;; - sun*:*:4.2BSD:*) - UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` - test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 - case "`/bin/arch`" in - sun3) - echo m68k-sun-sunos${UNAME_RELEASE} - ;; - sun4) - echo sparc-sun-sunos${UNAME_RELEASE} - ;; - esac - exit ;; - aushp:SunOS:*:*) - echo sparc-auspex-sunos${UNAME_RELEASE} - exit ;; - # The situation for MiNT is a little confusing. The machine name - # can be virtually everything (everything which is not - # "atarist" or "atariste" at least should have a processor - # > m68000). The system name ranges from "MiNT" over "FreeMiNT" - # to the lowercase version "mint" (or "freemint"). Finally - # the system name "TOS" denotes a system which is actually not - # MiNT. But MiNT is downward compatible to TOS, so this should - # be no problem. - atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} - exit ;; - atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} - exit ;; - *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} - exit ;; - milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) - echo m68k-milan-mint${UNAME_RELEASE} - exit ;; - hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) - echo m68k-hades-mint${UNAME_RELEASE} - exit ;; - *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) - echo m68k-unknown-mint${UNAME_RELEASE} - exit ;; - m68k:machten:*:*) - echo m68k-apple-machten${UNAME_RELEASE} - exit ;; - powerpc:machten:*:*) - echo powerpc-apple-machten${UNAME_RELEASE} - exit ;; - RISC*:Mach:*:*) - echo mips-dec-mach_bsd4.3 - exit ;; - RISC*:ULTRIX:*:*) - echo mips-dec-ultrix${UNAME_RELEASE} - exit ;; - VAX*:ULTRIX*:*:*) - echo vax-dec-ultrix${UNAME_RELEASE} - exit ;; - 2020:CLIX:*:* | 2430:CLIX:*:*) - echo clipper-intergraph-clix${UNAME_RELEASE} - exit ;; - mips:*:*:UMIPS | mips:*:*:RISCos) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c -#ifdef __cplusplus -#include <stdio.h> /* for printf() prototype */ - int main (int argc, char *argv[]) { -#else - int main (argc, argv) int argc; char *argv[]; { -#endif - #if defined (host_mips) && defined (MIPSEB) - #if defined (SYSTYPE_SYSV) - printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); - #endif - #if defined (SYSTYPE_SVR4) - printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); - #endif - #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) - printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); - #endif - #endif - exit (-1); - } -EOF - $CC_FOR_BUILD -o $dummy $dummy.c && - dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && - SYSTEM_NAME=`$dummy $dummyarg` && - { echo "$SYSTEM_NAME"; exit; } - echo mips-mips-riscos${UNAME_RELEASE} - exit ;; - Motorola:PowerMAX_OS:*:*) - echo powerpc-motorola-powermax - exit ;; - Motorola:*:4.3:PL8-*) - echo powerpc-harris-powermax - exit ;; - Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) - echo powerpc-harris-powermax - exit ;; - Night_Hawk:Power_UNIX:*:*) - echo powerpc-harris-powerunix - exit ;; - m88k:CX/UX:7*:*) - echo m88k-harris-cxux7 - exit ;; - m88k:*:4*:R4*) - echo m88k-motorola-sysv4 - exit ;; - m88k:*:3*:R3*) - echo m88k-motorola-sysv3 - exit ;; - AViiON:dgux:*:*) - # DG/UX returns AViiON for all architectures - UNAME_PROCESSOR=`/usr/bin/uname -p` - if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] - then - if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ - [ ${TARGET_BINARY_INTERFACE}x = x ] - then - echo m88k-dg-dgux${UNAME_RELEASE} - else - echo m88k-dg-dguxbcs${UNAME_RELEASE} - fi - else - echo i586-dg-dgux${UNAME_RELEASE} - fi - exit ;; - M88*:DolphinOS:*:*) # DolphinOS (SVR3) - echo m88k-dolphin-sysv3 - exit ;; - M88*:*:R3*:*) - # Delta 88k system running SVR3 - echo m88k-motorola-sysv3 - exit ;; - XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) - echo m88k-tektronix-sysv3 - exit ;; - Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) - echo m68k-tektronix-bsd - exit ;; - *:IRIX*:*:*) - echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` - exit ;; - ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. - echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id - exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' - i*86:AIX:*:*) - echo i386-ibm-aix - exit ;; - ia64:AIX:*:*) - if [ -x /usr/bin/oslevel ] ; then - IBM_REV=`/usr/bin/oslevel` - else - IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} - fi - echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} - exit ;; - *:AIX:2:3) - if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #include <sys/systemcfg.h> - - main() - { - if (!__power_pc()) - exit(1); - puts("powerpc-ibm-aix3.2.5"); - exit(0); - } -EOF - if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` - then - echo "$SYSTEM_NAME" - else - echo rs6000-ibm-aix3.2.5 - fi - elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then - echo rs6000-ibm-aix3.2.4 - else - echo rs6000-ibm-aix3.2 - fi - exit ;; - *:AIX:*:[45]) - IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` - if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then - IBM_ARCH=rs6000 - else - IBM_ARCH=powerpc - fi - if [ -x /usr/bin/oslevel ] ; then - IBM_REV=`/usr/bin/oslevel` - else - IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} - fi - echo ${IBM_ARCH}-ibm-aix${IBM_REV} - exit ;; - *:AIX:*:*) - echo rs6000-ibm-aix - exit ;; - ibmrt:4.4BSD:*|romp-ibm:BSD:*) - echo romp-ibm-bsd4.4 - exit ;; - ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and - echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to - exit ;; # report: romp-ibm BSD 4.3 - *:BOSX:*:*) - echo rs6000-bull-bosx - exit ;; - DPX/2?00:B.O.S.:*:*) - echo m68k-bull-sysv3 - exit ;; - 9000/[34]??:4.3bsd:1.*:*) - echo m68k-hp-bsd - exit ;; - hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) - echo m68k-hp-bsd4.4 - exit ;; - 9000/[34678]??:HP-UX:*:*) - HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` - case "${UNAME_MACHINE}" in - 9000/31? ) HP_ARCH=m68000 ;; - 9000/[34]?? ) HP_ARCH=m68k ;; - 9000/[678][0-9][0-9]) - if [ -x /usr/bin/getconf ]; then - sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` - sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` - case "${sc_cpu_version}" in - 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 - 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 - 532) # CPU_PA_RISC2_0 - case "${sc_kernel_bits}" in - 32) HP_ARCH="hppa2.0n" ;; - 64) HP_ARCH="hppa2.0w" ;; - '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 - esac ;; - esac - fi - if [ "${HP_ARCH}" = "" ]; then - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - - #define _HPUX_SOURCE - #include <stdlib.h> - #include <unistd.h> - - int main () - { - #if defined(_SC_KERNEL_BITS) - long bits = sysconf(_SC_KERNEL_BITS); - #endif - long cpu = sysconf (_SC_CPU_VERSION); - - switch (cpu) - { - case CPU_PA_RISC1_0: puts ("hppa1.0"); break; - case CPU_PA_RISC1_1: puts ("hppa1.1"); break; - case CPU_PA_RISC2_0: - #if defined(_SC_KERNEL_BITS) - switch (bits) - { - case 64: puts ("hppa2.0w"); break; - case 32: puts ("hppa2.0n"); break; - default: puts ("hppa2.0"); break; - } break; - #else /* !defined(_SC_KERNEL_BITS) */ - puts ("hppa2.0"); break; - #endif - default: puts ("hppa1.0"); break; - } - exit (0); - } -EOF - (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` - test -z "$HP_ARCH" && HP_ARCH=hppa - fi ;; - esac - if [ ${HP_ARCH} = "hppa2.0w" ] - then - eval $set_cc_for_build - - # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating - # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler - # generating 64-bit code. GNU and HP use different nomenclature: - # - # $ CC_FOR_BUILD=cc ./config.guess - # => hppa2.0w-hp-hpux11.23 - # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess - # => hppa64-hp-hpux11.23 - - if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | - grep __LP64__ >/dev/null - then - HP_ARCH="hppa2.0w" - else - HP_ARCH="hppa64" - fi - fi - echo ${HP_ARCH}-hp-hpux${HPUX_REV} - exit ;; - ia64:HP-UX:*:*) - HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` - echo ia64-hp-hpux${HPUX_REV} - exit ;; - 3050*:HI-UX:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #include <unistd.h> - int - main () - { - long cpu = sysconf (_SC_CPU_VERSION); - /* The order matters, because CPU_IS_HP_MC68K erroneously returns - true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct - results, however. */ - if (CPU_IS_PA_RISC (cpu)) - { - switch (cpu) - { - case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; - case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; - case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; - default: puts ("hppa-hitachi-hiuxwe2"); break; - } - } - else if (CPU_IS_HP_MC68K (cpu)) - puts ("m68k-hitachi-hiuxwe2"); - else puts ("unknown-hitachi-hiuxwe2"); - exit (0); - } -EOF - $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && - { echo "$SYSTEM_NAME"; exit; } - echo unknown-hitachi-hiuxwe2 - exit ;; - 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) - echo hppa1.1-hp-bsd - exit ;; - 9000/8??:4.3bsd:*:*) - echo hppa1.0-hp-bsd - exit ;; - *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) - echo hppa1.0-hp-mpeix - exit ;; - hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) - echo hppa1.1-hp-osf - exit ;; - hp8??:OSF1:*:*) - echo hppa1.0-hp-osf - exit ;; - i*86:OSF1:*:*) - if [ -x /usr/sbin/sysversion ] ; then - echo ${UNAME_MACHINE}-unknown-osf1mk - else - echo ${UNAME_MACHINE}-unknown-osf1 - fi - exit ;; - parisc*:Lites*:*:*) - echo hppa1.1-hp-lites - exit ;; - C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) - echo c1-convex-bsd - exit ;; - C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) - if getsysinfo -f scalar_acc - then echo c32-convex-bsd - else echo c2-convex-bsd - fi - exit ;; - C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) - echo c34-convex-bsd - exit ;; - C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) - echo c38-convex-bsd - exit ;; - C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) - echo c4-convex-bsd - exit ;; - CRAY*Y-MP:*:*:*) - echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; - CRAY*[A-Z]90:*:*:*) - echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ - | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ - -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ - -e 's/\.[^.]*$/.X/' - exit ;; - CRAY*TS:*:*:*) - echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; - CRAY*T3E:*:*:*) - echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; - CRAY*SV1:*:*:*) - echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; - *:UNICOS/mp:*:*) - echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; - F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) - FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` - echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" - exit ;; - 5000:UNIX_System_V:4.*:*) - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` - echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" - exit ;; - i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) - echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} - exit ;; - sparc*:BSD/OS:*:*) - echo sparc-unknown-bsdi${UNAME_RELEASE} - exit ;; - *:BSD/OS:*:*) - echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} - exit ;; - *:FreeBSD:*:*) - case ${UNAME_MACHINE} in - pc98) - echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; - amd64) - echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; - *) - echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; - esac - exit ;; - i*:CYGWIN*:*) - echo ${UNAME_MACHINE}-pc-cygwin - exit ;; - *:MINGW*:*) - echo ${UNAME_MACHINE}-pc-mingw32 - exit ;; - i*:windows32*:*) - # uname -m includes "-pc" on this system. - echo ${UNAME_MACHINE}-mingw32 - exit ;; - i*:PW*:*) - echo ${UNAME_MACHINE}-pc-pw32 - exit ;; - *:Interix*:[3456]*) - case ${UNAME_MACHINE} in - x86) - echo i586-pc-interix${UNAME_RELEASE} - exit ;; - EM64T | authenticamd) - echo x86_64-unknown-interix${UNAME_RELEASE} - exit ;; - esac ;; - [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) - echo i${UNAME_MACHINE}-pc-mks - exit ;; - i*:Windows_NT*:* | Pentium*:Windows_NT*:*) - # How do we know it's Interix rather than the generic POSIX subsystem? - # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we - # UNAME_MACHINE based on the output of uname instead of i386? - echo i586-pc-interix - exit ;; - i*:UWIN*:*) - echo ${UNAME_MACHINE}-pc-uwin - exit ;; - amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) - echo x86_64-unknown-cygwin - exit ;; - p*:CYGWIN*:*) - echo powerpcle-unknown-cygwin - exit ;; - prep*:SunOS:5.*:*) - echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; - *:GNU:*:*) - # the GNU system - echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` - exit ;; - *:GNU/*:*:*) - # other systems with GNU libc and userland - echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu - exit ;; - i*86:Minix:*:*) - echo ${UNAME_MACHINE}-pc-minix - exit ;; - arm*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - avr32*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - cris:Linux:*:*) - echo cris-axis-linux-gnu - exit ;; - crisv32:Linux:*:*) - echo crisv32-axis-linux-gnu - exit ;; - frv:Linux:*:*) - echo frv-unknown-linux-gnu - exit ;; - ia64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - m32r*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - m68*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - mips:Linux:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #undef CPU - #undef mips - #undef mipsel - #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) - CPU=mipsel - #else - #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) - CPU=mips - #else - CPU= - #endif - #endif -EOF - eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' - /^CPU/{ - s: ::g - p - }'`" - test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } - ;; - mips64:Linux:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #undef CPU - #undef mips64 - #undef mips64el - #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) - CPU=mips64el - #else - #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) - CPU=mips64 - #else - CPU= - #endif - #endif -EOF - eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' - /^CPU/{ - s: ::g - p - }'`" - test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } - ;; - or32:Linux:*:*) - echo or32-unknown-linux-gnu - exit ;; - ppc:Linux:*:*) - echo powerpc-unknown-linux-gnu - exit ;; - ppc64:Linux:*:*) - echo powerpc64-unknown-linux-gnu - exit ;; - alpha:Linux:*:*) - case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in - EV5) UNAME_MACHINE=alphaev5 ;; - EV56) UNAME_MACHINE=alphaev56 ;; - PCA56) UNAME_MACHINE=alphapca56 ;; - PCA57) UNAME_MACHINE=alphapca56 ;; - EV6) UNAME_MACHINE=alphaev6 ;; - EV67) UNAME_MACHINE=alphaev67 ;; - EV68*) UNAME_MACHINE=alphaev68 ;; - esac - objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null - if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi - echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} - exit ;; - parisc:Linux:*:* | hppa:Linux:*:*) - # Look for CPU level - case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in - PA7*) echo hppa1.1-unknown-linux-gnu ;; - PA8*) echo hppa2.0-unknown-linux-gnu ;; - *) echo hppa-unknown-linux-gnu ;; - esac - exit ;; - parisc64:Linux:*:* | hppa64:Linux:*:*) - echo hppa64-unknown-linux-gnu - exit ;; - s390:Linux:*:* | s390x:Linux:*:*) - echo ${UNAME_MACHINE}-ibm-linux - exit ;; - sh64*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - sh*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - sparc:Linux:*:* | sparc64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - vax:Linux:*:*) - echo ${UNAME_MACHINE}-dec-linux-gnu - exit ;; - x86_64:Linux:*:*) - echo x86_64-unknown-linux-gnu - exit ;; - xtensa:Linux:*:*) - echo xtensa-unknown-linux-gnu - exit ;; - i*86:Linux:*:*) - # The BFD linker knows what the default object file format is, so - # first see if it will tell us. cd to the root directory to prevent - # problems with other programs or directories called `ld' in the path. - # Set LC_ALL=C to ensure ld outputs messages in English. - ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ - | sed -ne '/supported targets:/!d - s/[ ][ ]*/ /g - s/.*supported targets: *// - s/ .*// - p'` - case "$ld_supported_targets" in - elf32-i386) - TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" - ;; - a.out-i386-linux) - echo "${UNAME_MACHINE}-pc-linux-gnuaout" - exit ;; - coff-i386) - echo "${UNAME_MACHINE}-pc-linux-gnucoff" - exit ;; - "") - # Either a pre-BFD a.out linker (linux-gnuoldld) or - # one that does not give us useful --help. - echo "${UNAME_MACHINE}-pc-linux-gnuoldld" - exit ;; - esac - # Determine whether the default compiler is a.out or elf - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #include <features.h> - #ifdef __ELF__ - # ifdef __GLIBC__ - # if __GLIBC__ >= 2 - LIBC=gnu - # else - LIBC=gnulibc1 - # endif - # else - LIBC=gnulibc1 - # endif - #else - #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) - LIBC=gnu - #else - LIBC=gnuaout - #endif - #endif - #ifdef __dietlibc__ - LIBC=dietlibc - #endif -EOF - eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' - /^LIBC/{ - s: ::g - p - }'`" - test x"${LIBC}" != x && { - echo "${UNAME_MACHINE}-pc-linux-${LIBC}" - exit - } - test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; } - ;; - i*86:DYNIX/ptx:4*:*) - # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. - # earlier versions are messed up and put the nodename in both - # sysname and nodename. - echo i386-sequent-sysv4 - exit ;; - i*86:UNIX_SV:4.2MP:2.*) - # Unixware is an offshoot of SVR4, but it has its own version - # number series starting with 2... - # I am not positive that other SVR4 systems won't match this, - # I just have to hope. -- rms. - # Use sysv4.2uw... so that sysv4* matches it. - echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} - exit ;; - i*86:OS/2:*:*) - # If we were able to find `uname', then EMX Unix compatibility - # is probably installed. - echo ${UNAME_MACHINE}-pc-os2-emx - exit ;; - i*86:XTS-300:*:STOP) - echo ${UNAME_MACHINE}-unknown-stop - exit ;; - i*86:atheos:*:*) - echo ${UNAME_MACHINE}-unknown-atheos - exit ;; - i*86:syllable:*:*) - echo ${UNAME_MACHINE}-pc-syllable - exit ;; - i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) - echo i386-unknown-lynxos${UNAME_RELEASE} - exit ;; - i*86:*DOS:*:*) - echo ${UNAME_MACHINE}-pc-msdosdjgpp - exit ;; - i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) - UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` - if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then - echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} - else - echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} - fi - exit ;; - i*86:*:5:[678]*) - # UnixWare 7.x, OpenUNIX and OpenServer 6. - case `/bin/uname -X | grep "^Machine"` in - *486*) UNAME_MACHINE=i486 ;; - *Pentium) UNAME_MACHINE=i586 ;; - *Pent*|*Celeron) UNAME_MACHINE=i686 ;; - esac - echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} - exit ;; - i*86:*:3.2:*) - if test -f /usr/options/cb.name; then - UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name` - echo ${UNAME_MACHINE}-pc-isc$UNAME_REL - elif /bin/uname -X 2>/dev/null >/dev/null ; then - UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` - (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 - (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ - && UNAME_MACHINE=i586 - (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ - && UNAME_MACHINE=i686 - (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ - && UNAME_MACHINE=i686 - echo ${UNAME_MACHINE}-pc-sco$UNAME_REL - else - echo ${UNAME_MACHINE}-pc-sysv32 - fi - exit ;; - pc:*:*:*) - # Left here for compatibility: - # uname -m prints for DJGPP always 'pc', but it prints nothing about - # the processor, so we play safe by assuming i386. - echo i386-pc-msdosdjgpp - exit ;; - Intel:Mach:3*:*) - echo i386-pc-mach3 - exit ;; - paragon:*:*:*) - echo i860-intel-osf1 - exit ;; - i860:*:4.*:*) # i860-SVR4 - if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then - echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 - else # Add other i860-SVR4 vendors below as they are discovered. - echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 - fi - exit ;; - mini*:CTIX:SYS*5:*) - # "miniframe" - echo m68010-convergent-sysv - exit ;; - mc68k:UNIX:SYSTEM5:3.51m) - echo m68k-convergent-sysv - exit ;; - M680?0:D-NIX:5.3:*) - echo m68k-diab-dnix - exit ;; - M68*:*:R3V[5678]*:*) - test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; - 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) - OS_REL='' - test -r /etc/.relid \ - && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` - /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4.3${OS_REL}; exit; } - /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ - && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; - 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) - /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4; exit; } ;; - m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) - echo m68k-unknown-lynxos${UNAME_RELEASE} - exit ;; - mc68030:UNIX_System_V:4.*:*) - echo m68k-atari-sysv4 - exit ;; - TSUNAMI:LynxOS:2.*:*) - echo sparc-unknown-lynxos${UNAME_RELEASE} - exit ;; - rs6000:LynxOS:2.*:*) - echo rs6000-unknown-lynxos${UNAME_RELEASE} - exit ;; - PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) - echo powerpc-unknown-lynxos${UNAME_RELEASE} - exit ;; - SM[BE]S:UNIX_SV:*:*) - echo mips-dde-sysv${UNAME_RELEASE} - exit ;; - RM*:ReliantUNIX-*:*:*) - echo mips-sni-sysv4 - exit ;; - RM*:SINIX-*:*:*) - echo mips-sni-sysv4 - exit ;; - *:SINIX-*:*:*) - if uname -p 2>/dev/null >/dev/null ; then - UNAME_MACHINE=`(uname -p) 2>/dev/null` - echo ${UNAME_MACHINE}-sni-sysv4 - else - echo ns32k-sni-sysv - fi - exit ;; - PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort - # says <Richard.M.Bartel@ccMail.Census.GOV> - echo i586-unisys-sysv4 - exit ;; - *:UNIX_System_V:4*:FTX*) - # From Gerald Hewes <hewes@openmarket.com>. - # How about differentiating between stratus architectures? -djm - echo hppa1.1-stratus-sysv4 - exit ;; - *:*:*:FTX*) - # From seanf@swdc.stratus.com. - echo i860-stratus-sysv4 - exit ;; - i*86:VOS:*:*) - # From Paul.Green@stratus.com. - echo ${UNAME_MACHINE}-stratus-vos - exit ;; - *:VOS:*:*) - # From Paul.Green@stratus.com. - echo hppa1.1-stratus-vos - exit ;; - mc68*:A/UX:*:*) - echo m68k-apple-aux${UNAME_RELEASE} - exit ;; - news*:NEWS-OS:6*:*) - echo mips-sony-newsos6 - exit ;; - R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) - if [ -d /usr/nec ]; then - echo mips-nec-sysv${UNAME_RELEASE} - else - echo mips-unknown-sysv${UNAME_RELEASE} - fi - exit ;; - BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. - echo powerpc-be-beos - exit ;; - BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. - echo powerpc-apple-beos - exit ;; - BePC:BeOS:*:*) # BeOS running on Intel PC compatible. - echo i586-pc-beos - exit ;; - SX-4:SUPER-UX:*:*) - echo sx4-nec-superux${UNAME_RELEASE} - exit ;; - SX-5:SUPER-UX:*:*) - echo sx5-nec-superux${UNAME_RELEASE} - exit ;; - SX-6:SUPER-UX:*:*) - echo sx6-nec-superux${UNAME_RELEASE} - exit ;; - SX-7:SUPER-UX:*:*) - echo sx7-nec-superux${UNAME_RELEASE} - exit ;; - SX-8:SUPER-UX:*:*) - echo sx8-nec-superux${UNAME_RELEASE} - exit ;; - SX-8R:SUPER-UX:*:*) - echo sx8r-nec-superux${UNAME_RELEASE} - exit ;; - Power*:Rhapsody:*:*) - echo powerpc-apple-rhapsody${UNAME_RELEASE} - exit ;; - *:Rhapsody:*:*) - echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} - exit ;; - *:Darwin:*:*) - UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown - case $UNAME_PROCESSOR in - unknown) UNAME_PROCESSOR=powerpc ;; - esac - echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} - exit ;; - *:procnto*:*:* | *:QNX:[0123456789]*:*) - UNAME_PROCESSOR=`uname -p` - if test "$UNAME_PROCESSOR" = "x86"; then - UNAME_PROCESSOR=i386 - UNAME_MACHINE=pc - fi - echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} - exit ;; - *:QNX:*:4*) - echo i386-pc-qnx - exit ;; - NSE-?:NONSTOP_KERNEL:*:*) - echo nse-tandem-nsk${UNAME_RELEASE} - exit ;; - NSR-?:NONSTOP_KERNEL:*:*) - echo nsr-tandem-nsk${UNAME_RELEASE} - exit ;; - *:NonStop-UX:*:*) - echo mips-compaq-nonstopux - exit ;; - BS2000:POSIX*:*:*) - echo bs2000-siemens-sysv - exit ;; - DS/*:UNIX_System_V:*:*) - echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} - exit ;; - *:Plan9:*:*) - # "uname -m" is not consistent, so use $cputype instead. 386 - # is converted to i386 for consistency with other x86 - # operating systems. - if test "$cputype" = "386"; then - UNAME_MACHINE=i386 - else - UNAME_MACHINE="$cputype" - fi - echo ${UNAME_MACHINE}-unknown-plan9 - exit ;; - *:TOPS-10:*:*) - echo pdp10-unknown-tops10 - exit ;; - *:TENEX:*:*) - echo pdp10-unknown-tenex - exit ;; - KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) - echo pdp10-dec-tops20 - exit ;; - XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) - echo pdp10-xkl-tops20 - exit ;; - *:TOPS-20:*:*) - echo pdp10-unknown-tops20 - exit ;; - *:ITS:*:*) - echo pdp10-unknown-its - exit ;; - SEI:*:*:SEIUX) - echo mips-sei-seiux${UNAME_RELEASE} - exit ;; - *:DragonFly:*:*) - echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` - exit ;; - *:*VMS:*:*) - UNAME_MACHINE=`(uname -p) 2>/dev/null` - case "${UNAME_MACHINE}" in - A*) echo alpha-dec-vms ; exit ;; - I*) echo ia64-dec-vms ; exit ;; - V*) echo vax-dec-vms ; exit ;; - esac ;; - *:XENIX:*:SysV) - echo i386-pc-xenix - exit ;; - i*86:skyos:*:*) - echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' - exit ;; - i*86:rdos:*:*) - echo ${UNAME_MACHINE}-pc-rdos - exit ;; -esac - -#echo '(No uname command or uname output not recognized.)' 1>&2 -#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 - -eval $set_cc_for_build -cat >$dummy.c <<EOF -#ifdef _SEQUENT_ -# include <sys/types.h> -# include <sys/utsname.h> -#endif -main () -{ -#if defined (sony) -#if defined (MIPSEB) - /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, - I don't know.... */ - printf ("mips-sony-bsd\n"); exit (0); -#else -#include <sys/param.h> - printf ("m68k-sony-newsos%s\n", -#ifdef NEWSOS4 - "4" -#else - "" -#endif - ); exit (0); -#endif -#endif - -#if defined (__arm) && defined (__acorn) && defined (__unix) - printf ("arm-acorn-riscix\n"); exit (0); -#endif - -#if defined (hp300) && !defined (hpux) - printf ("m68k-hp-bsd\n"); exit (0); -#endif - -#if defined (NeXT) -#if !defined (__ARCHITECTURE__) -#define __ARCHITECTURE__ "m68k" -#endif - int version; - version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; - if (version < 4) - printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); - else - printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); - exit (0); -#endif - -#if defined (MULTIMAX) || defined (n16) -#if defined (UMAXV) - printf ("ns32k-encore-sysv\n"); exit (0); -#else -#if defined (CMU) - printf ("ns32k-encore-mach\n"); exit (0); -#else - printf ("ns32k-encore-bsd\n"); exit (0); -#endif -#endif -#endif - -#if defined (__386BSD__) - printf ("i386-pc-bsd\n"); exit (0); -#endif - -#if defined (sequent) -#if defined (i386) - printf ("i386-sequent-dynix\n"); exit (0); -#endif -#if defined (ns32000) - printf ("ns32k-sequent-dynix\n"); exit (0); -#endif -#endif - -#if defined (_SEQUENT_) - struct utsname un; - - uname(&un); - - if (strncmp(un.version, "V2", 2) == 0) { - printf ("i386-sequent-ptx2\n"); exit (0); - } - if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ - printf ("i386-sequent-ptx1\n"); exit (0); - } - printf ("i386-sequent-ptx\n"); exit (0); - -#endif - -#if defined (vax) -# if !defined (ultrix) -# include <sys/param.h> -# if defined (BSD) -# if BSD == 43 - printf ("vax-dec-bsd4.3\n"); exit (0); -# else -# if BSD == 199006 - printf ("vax-dec-bsd4.3reno\n"); exit (0); -# else - printf ("vax-dec-bsd\n"); exit (0); -# endif -# endif -# else - printf ("vax-dec-bsd\n"); exit (0); -# endif -# else - printf ("vax-dec-ultrix\n"); exit (0); -# endif -#endif - -#if defined (alliant) && defined (i860) - printf ("i860-alliant-bsd\n"); exit (0); -#endif - - exit (1); -} -EOF - -$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && - { echo "$SYSTEM_NAME"; exit; } - -# Apollos put the system type in the environment. - -test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } - -# Convex versions that predate uname can use getsysinfo(1) - -if [ -x /usr/convex/getsysinfo ] -then - case `getsysinfo -f cpu_type` in - c1*) - echo c1-convex-bsd - exit ;; - c2*) - if getsysinfo -f scalar_acc - then echo c32-convex-bsd - else echo c2-convex-bsd - fi - exit ;; - c34*) - echo c34-convex-bsd - exit ;; - c38*) - echo c38-convex-bsd - exit ;; - c4*) - echo c4-convex-bsd - exit ;; - esac -fi - -cat >&2 <<EOF -$0: unable to guess system type - -This script, last modified $timestamp, has failed to recognize -the operating system you are using. It is advised that you -download the most up to date version of the config scripts from - - http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.guess -and - http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.sub - -If the version you run ($0) is already up to date, please -send the following data and any information you think might be -pertinent to <config-patches@gnu.org> in order to provide the needed -information to handle your system. - -config.guess timestamp = $timestamp - -uname -m = `(uname -m) 2>/dev/null || echo unknown` -uname -r = `(uname -r) 2>/dev/null || echo unknown` -uname -s = `(uname -s) 2>/dev/null || echo unknown` -uname -v = `(uname -v) 2>/dev/null || echo unknown` - -/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` -/bin/uname -X = `(/bin/uname -X) 2>/dev/null` - -hostinfo = `(hostinfo) 2>/dev/null` -/bin/universe = `(/bin/universe) 2>/dev/null` -/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` -/bin/arch = `(/bin/arch) 2>/dev/null` -/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` -/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` - -UNAME_MACHINE = ${UNAME_MACHINE} -UNAME_RELEASE = ${UNAME_RELEASE} -UNAME_SYSTEM = ${UNAME_SYSTEM} -UNAME_VERSION = ${UNAME_VERSION} -EOF - -exit 1 - -# Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "timestamp='" -# time-stamp-format: "%:y-%02m-%02d" -# time-stamp-end: "'" -# End: diff --git a/libs/dbus-c++/config.sub b/libs/dbus-c++/config.sub deleted file mode 100755 index 1761d8bdf6307c02067b3581e183ba2fdef7e1fa..0000000000000000000000000000000000000000 --- a/libs/dbus-c++/config.sub +++ /dev/null @@ -1,1626 +0,0 @@ -#! /bin/sh -# Configuration validation subroutine script. -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, -# Inc. - -timestamp='2007-06-28' - -# This file is (in principle) common to ALL GNU software. -# The presence of a machine in this file suggests that SOME GNU software -# can handle that machine. It does not imply ALL GNU software can. -# -# This file is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA -# 02110-1301, USA. -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - - -# Please send patches to <config-patches@gnu.org>. Submit a context -# diff and a properly formatted ChangeLog entry. -# -# Configuration subroutine to validate and canonicalize a configuration type. -# Supply the specified configuration type as an argument. -# If it is invalid, we print an error message on stderr and exit with code 1. -# Otherwise, we print the canonical config type on stdout and succeed. - -# This file is supposed to be the same for all GNU packages -# and recognize all the CPU types, system types and aliases -# that are meaningful with *any* GNU software. -# Each package is responsible for reporting which valid configurations -# it does not support. The user should be able to distinguish -# a failure to support a valid configuration from a meaningless -# configuration. - -# The goal of this file is to map all the various variations of a given -# machine specification into a single specification in the form: -# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM -# or in some cases, the newer four-part form: -# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM -# It is wrong to echo any other type of specification. - -me=`echo "$0" | sed -e 's,.*/,,'` - -usage="\ -Usage: $0 [OPTION] CPU-MFR-OPSYS - $0 [OPTION] ALIAS - -Canonicalize a configuration name. - -Operation modes: - -h, --help print this help, then exit - -t, --time-stamp print date of last modification, then exit - -v, --version print version number, then exit - -Report bugs and patches to <config-patches@gnu.org>." - -version="\ -GNU config.sub ($timestamp) - -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 -Free Software Foundation, Inc. - -This is free software; see the source for copying conditions. There is NO -warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." - -help=" -Try \`$me --help' for more information." - -# Parse command line -while test $# -gt 0 ; do - case $1 in - --time-stamp | --time* | -t ) - echo "$timestamp" ; exit ;; - --version | -v ) - echo "$version" ; exit ;; - --help | --h* | -h ) - echo "$usage"; exit ;; - -- ) # Stop option processing - shift; break ;; - - ) # Use stdin as input. - break ;; - -* ) - echo "$me: invalid option $1$help" - exit 1 ;; - - *local*) - # First pass through any local machine types. - echo $1 - exit ;; - - * ) - break ;; - esac -done - -case $# in - 0) echo "$me: missing argument$help" >&2 - exit 1;; - 1) ;; - *) echo "$me: too many arguments$help" >&2 - exit 1;; -esac - -# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). -# Here we must recognize all the valid KERNEL-OS combinations. -maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` -case $maybe_os in - nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \ - uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \ - storm-chaos* | os2-emx* | rtmk-nova*) - os=-$maybe_os - basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` - ;; - *) - basic_machine=`echo $1 | sed 's/-[^-]*$//'` - if [ $basic_machine != $1 ] - then os=`echo $1 | sed 's/.*-/-/'` - else os=; fi - ;; -esac - -### Let's recognize common machines as not being operating systems so -### that things like config.sub decstation-3100 work. We also -### recognize some manufacturers as not being operating systems, so we -### can provide default operating systems below. -case $os in - -sun*os*) - # Prevent following clause from handling this invalid input. - ;; - -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ - -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ - -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ - -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ - -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ - -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ - -apple | -axis | -knuth | -cray) - os= - basic_machine=$1 - ;; - -sim | -cisco | -oki | -wec | -winbond) - os= - basic_machine=$1 - ;; - -scout) - ;; - -wrs) - os=-vxworks - basic_machine=$1 - ;; - -chorusos*) - os=-chorusos - basic_machine=$1 - ;; - -chorusrdb) - os=-chorusrdb - basic_machine=$1 - ;; - -hiux*) - os=-hiuxwe2 - ;; - -sco6) - os=-sco5v6 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco5) - os=-sco3.2v5 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco4) - os=-sco3.2v4 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco3.2.[4-9]*) - os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco3.2v[4-9]*) - # Don't forget version if it is 3.2v4 or newer. - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco5v6*) - # Don't forget version if it is 3.2v4 or newer. - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco*) - os=-sco3.2v2 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -udk*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -isc) - os=-isc2.2 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -clix*) - basic_machine=clipper-intergraph - ;; - -isc*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -lynx*) - os=-lynxos - ;; - -ptx*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` - ;; - -windowsnt*) - os=`echo $os | sed -e 's/windowsnt/winnt/'` - ;; - -psos*) - os=-psos - ;; - -mint | -mint[0-9]*) - basic_machine=m68k-atari - os=-mint - ;; -esac - -# Decode aliases for certain CPU-COMPANY combinations. -case $basic_machine in - # Recognize the basic CPU types without company name. - # Some are omitted here because they have special meanings below. - 1750a | 580 \ - | a29k \ - | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ - | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ - | am33_2.0 \ - | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ - | bfin \ - | c4x | clipper \ - | d10v | d30v | dlx | dsp16xx \ - | fido | fr30 | frv \ - | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ - | i370 | i860 | i960 | ia64 \ - | ip2k | iq2000 \ - | m32c | m32r | m32rle | m68000 | m68k | m88k \ - | maxq | mb | microblaze | mcore | mep \ - | mips | mipsbe | mipseb | mipsel | mipsle \ - | mips16 \ - | mips64 | mips64el \ - | mips64vr | mips64vrel \ - | mips64orion | mips64orionel \ - | mips64vr4100 | mips64vr4100el \ - | mips64vr4300 | mips64vr4300el \ - | mips64vr5000 | mips64vr5000el \ - | mips64vr5900 | mips64vr5900el \ - | mipsisa32 | mipsisa32el \ - | mipsisa32r2 | mipsisa32r2el \ - | mipsisa64 | mipsisa64el \ - | mipsisa64r2 | mipsisa64r2el \ - | mipsisa64sb1 | mipsisa64sb1el \ - | mipsisa64sr71k | mipsisa64sr71kel \ - | mipstx39 | mipstx39el \ - | mn10200 | mn10300 \ - | mt \ - | msp430 \ - | nios | nios2 \ - | ns16k | ns32k \ - | or32 \ - | pdp10 | pdp11 | pj | pjl \ - | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ - | pyramid \ - | score \ - | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ - | sh64 | sh64le \ - | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ - | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ - | spu | strongarm \ - | tahoe | thumb | tic4x | tic80 | tron \ - | v850 | v850e \ - | we32k \ - | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \ - | z8k) - basic_machine=$basic_machine-unknown - ;; - m6811 | m68hc11 | m6812 | m68hc12) - # Motorola 68HC11/12. - basic_machine=$basic_machine-unknown - os=-none - ;; - m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) - ;; - ms1) - basic_machine=mt-unknown - ;; - - # We use `pc' rather than `unknown' - # because (1) that's what they normally are, and - # (2) the word "unknown" tends to confuse beginning users. - i*86 | x86_64) - basic_machine=$basic_machine-pc - ;; - # Object if more than one company name word. - *-*-*) - echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 - exit 1 - ;; - # Recognize the basic CPU types with company name. - 580-* \ - | a29k-* \ - | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ - | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ - | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ - | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ - | avr-* | avr32-* \ - | bfin-* | bs2000-* \ - | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ - | clipper-* | craynv-* | cydra-* \ - | d10v-* | d30v-* | dlx-* \ - | elxsi-* \ - | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ - | h8300-* | h8500-* \ - | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ - | i*86-* | i860-* | i960-* | ia64-* \ - | ip2k-* | iq2000-* \ - | m32c-* | m32r-* | m32rle-* \ - | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ - | m88110-* | m88k-* | maxq-* | mcore-* \ - | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ - | mips16-* \ - | mips64-* | mips64el-* \ - | mips64vr-* | mips64vrel-* \ - | mips64orion-* | mips64orionel-* \ - | mips64vr4100-* | mips64vr4100el-* \ - | mips64vr4300-* | mips64vr4300el-* \ - | mips64vr5000-* | mips64vr5000el-* \ - | mips64vr5900-* | mips64vr5900el-* \ - | mipsisa32-* | mipsisa32el-* \ - | mipsisa32r2-* | mipsisa32r2el-* \ - | mipsisa64-* | mipsisa64el-* \ - | mipsisa64r2-* | mipsisa64r2el-* \ - | mipsisa64sb1-* | mipsisa64sb1el-* \ - | mipsisa64sr71k-* | mipsisa64sr71kel-* \ - | mipstx39-* | mipstx39el-* \ - | mmix-* \ - | mt-* \ - | msp430-* \ - | nios-* | nios2-* \ - | none-* | np1-* | ns16k-* | ns32k-* \ - | orion-* \ - | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ - | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ - | pyramid-* \ - | romp-* | rs6000-* \ - | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ - | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ - | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ - | sparclite-* \ - | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \ - | tahoe-* | thumb-* \ - | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ - | tron-* \ - | v850-* | v850e-* | vax-* \ - | we32k-* \ - | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \ - | xstormy16-* | xtensa-* \ - | ymp-* \ - | z8k-*) - ;; - # Recognize the various machine names and aliases which stand - # for a CPU type and a company and sometimes even an OS. - 386bsd) - basic_machine=i386-unknown - os=-bsd - ;; - 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) - basic_machine=m68000-att - ;; - 3b*) - basic_machine=we32k-att - ;; - a29khif) - basic_machine=a29k-amd - os=-udi - ;; - abacus) - basic_machine=abacus-unknown - ;; - adobe68k) - basic_machine=m68010-adobe - os=-scout - ;; - alliant | fx80) - basic_machine=fx80-alliant - ;; - altos | altos3068) - basic_machine=m68k-altos - ;; - am29k) - basic_machine=a29k-none - os=-bsd - ;; - amd64) - basic_machine=x86_64-pc - ;; - amd64-*) - basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - amdahl) - basic_machine=580-amdahl - os=-sysv - ;; - amiga | amiga-*) - basic_machine=m68k-unknown - ;; - amigaos | amigados) - basic_machine=m68k-unknown - os=-amigaos - ;; - amigaunix | amix) - basic_machine=m68k-unknown - os=-sysv4 - ;; - apollo68) - basic_machine=m68k-apollo - os=-sysv - ;; - apollo68bsd) - basic_machine=m68k-apollo - os=-bsd - ;; - aux) - basic_machine=m68k-apple - os=-aux - ;; - balance) - basic_machine=ns32k-sequent - os=-dynix - ;; - c90) - basic_machine=c90-cray - os=-unicos - ;; - convex-c1) - basic_machine=c1-convex - os=-bsd - ;; - convex-c2) - basic_machine=c2-convex - os=-bsd - ;; - convex-c32) - basic_machine=c32-convex - os=-bsd - ;; - convex-c34) - basic_machine=c34-convex - os=-bsd - ;; - convex-c38) - basic_machine=c38-convex - os=-bsd - ;; - cray | j90) - basic_machine=j90-cray - os=-unicos - ;; - craynv) - basic_machine=craynv-cray - os=-unicosmp - ;; - cr16) - basic_machine=cr16-unknown - os=-elf - ;; - crds | unos) - basic_machine=m68k-crds - ;; - crisv32 | crisv32-* | etraxfs*) - basic_machine=crisv32-axis - ;; - cris | cris-* | etrax*) - basic_machine=cris-axis - ;; - crx) - basic_machine=crx-unknown - os=-elf - ;; - da30 | da30-*) - basic_machine=m68k-da30 - ;; - decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) - basic_machine=mips-dec - ;; - decsystem10* | dec10*) - basic_machine=pdp10-dec - os=-tops10 - ;; - decsystem20* | dec20*) - basic_machine=pdp10-dec - os=-tops20 - ;; - delta | 3300 | motorola-3300 | motorola-delta \ - | 3300-motorola | delta-motorola) - basic_machine=m68k-motorola - ;; - delta88) - basic_machine=m88k-motorola - os=-sysv3 - ;; - djgpp) - basic_machine=i586-pc - os=-msdosdjgpp - ;; - dpx20 | dpx20-*) - basic_machine=rs6000-bull - os=-bosx - ;; - dpx2* | dpx2*-bull) - basic_machine=m68k-bull - os=-sysv3 - ;; - ebmon29k) - basic_machine=a29k-amd - os=-ebmon - ;; - elxsi) - basic_machine=elxsi-elxsi - os=-bsd - ;; - encore | umax | mmax) - basic_machine=ns32k-encore - ;; - es1800 | OSE68k | ose68k | ose | OSE) - basic_machine=m68k-ericsson - os=-ose - ;; - fx2800) - basic_machine=i860-alliant - ;; - genix) - basic_machine=ns32k-ns - ;; - gmicro) - basic_machine=tron-gmicro - os=-sysv - ;; - go32) - basic_machine=i386-pc - os=-go32 - ;; - h3050r* | hiux*) - basic_machine=hppa1.1-hitachi - os=-hiuxwe2 - ;; - h8300hms) - basic_machine=h8300-hitachi - os=-hms - ;; - h8300xray) - basic_machine=h8300-hitachi - os=-xray - ;; - h8500hms) - basic_machine=h8500-hitachi - os=-hms - ;; - harris) - basic_machine=m88k-harris - os=-sysv3 - ;; - hp300-*) - basic_machine=m68k-hp - ;; - hp300bsd) - basic_machine=m68k-hp - os=-bsd - ;; - hp300hpux) - basic_machine=m68k-hp - os=-hpux - ;; - hp3k9[0-9][0-9] | hp9[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hp9k2[0-9][0-9] | hp9k31[0-9]) - basic_machine=m68000-hp - ;; - hp9k3[2-9][0-9]) - basic_machine=m68k-hp - ;; - hp9k6[0-9][0-9] | hp6[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hp9k7[0-79][0-9] | hp7[0-79][0-9]) - basic_machine=hppa1.1-hp - ;; - hp9k78[0-9] | hp78[0-9]) - # FIXME: really hppa2.0-hp - basic_machine=hppa1.1-hp - ;; - hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) - # FIXME: really hppa2.0-hp - basic_machine=hppa1.1-hp - ;; - hp9k8[0-9][13679] | hp8[0-9][13679]) - basic_machine=hppa1.1-hp - ;; - hp9k8[0-9][0-9] | hp8[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hppa-next) - os=-nextstep3 - ;; - hppaosf) - basic_machine=hppa1.1-hp - os=-osf - ;; - hppro) - basic_machine=hppa1.1-hp - os=-proelf - ;; - i370-ibm* | ibm*) - basic_machine=i370-ibm - ;; -# I'm not sure what "Sysv32" means. Should this be sysv3.2? - i*86v32) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv32 - ;; - i*86v4*) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv4 - ;; - i*86v) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv - ;; - i*86sol2) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-solaris2 - ;; - i386mach) - basic_machine=i386-mach - os=-mach - ;; - i386-vsta | vsta) - basic_machine=i386-unknown - os=-vsta - ;; - iris | iris4d) - basic_machine=mips-sgi - case $os in - -irix*) - ;; - *) - os=-irix4 - ;; - esac - ;; - isi68 | isi) - basic_machine=m68k-isi - os=-sysv - ;; - m88k-omron*) - basic_machine=m88k-omron - ;; - magnum | m3230) - basic_machine=mips-mips - os=-sysv - ;; - merlin) - basic_machine=ns32k-utek - os=-sysv - ;; - mingw32) - basic_machine=i386-pc - os=-mingw32 - ;; - mingw32ce) - basic_machine=arm-unknown - os=-mingw32ce - ;; - miniframe) - basic_machine=m68000-convergent - ;; - *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) - basic_machine=m68k-atari - os=-mint - ;; - mips3*-*) - basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` - ;; - mips3*) - basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown - ;; - monitor) - basic_machine=m68k-rom68k - os=-coff - ;; - morphos) - basic_machine=powerpc-unknown - os=-morphos - ;; - msdos) - basic_machine=i386-pc - os=-msdos - ;; - ms1-*) - basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` - ;; - mvs) - basic_machine=i370-ibm - os=-mvs - ;; - ncr3000) - basic_machine=i486-ncr - os=-sysv4 - ;; - netbsd386) - basic_machine=i386-unknown - os=-netbsd - ;; - netwinder) - basic_machine=armv4l-rebel - os=-linux - ;; - news | news700 | news800 | news900) - basic_machine=m68k-sony - os=-newsos - ;; - news1000) - basic_machine=m68030-sony - os=-newsos - ;; - news-3600 | risc-news) - basic_machine=mips-sony - os=-newsos - ;; - necv70) - basic_machine=v70-nec - os=-sysv - ;; - next | m*-next ) - basic_machine=m68k-next - case $os in - -nextstep* ) - ;; - -ns2*) - os=-nextstep2 - ;; - *) - os=-nextstep3 - ;; - esac - ;; - nh3000) - basic_machine=m68k-harris - os=-cxux - ;; - nh[45]000) - basic_machine=m88k-harris - os=-cxux - ;; - nindy960) - basic_machine=i960-intel - os=-nindy - ;; - mon960) - basic_machine=i960-intel - os=-mon960 - ;; - nonstopux) - basic_machine=mips-compaq - os=-nonstopux - ;; - np1) - basic_machine=np1-gould - ;; - nsr-tandem) - basic_machine=nsr-tandem - ;; - op50n-* | op60c-*) - basic_machine=hppa1.1-oki - os=-proelf - ;; - openrisc | openrisc-*) - basic_machine=or32-unknown - ;; - os400) - basic_machine=powerpc-ibm - os=-os400 - ;; - OSE68000 | ose68000) - basic_machine=m68000-ericsson - os=-ose - ;; - os68k) - basic_machine=m68k-none - os=-os68k - ;; - pa-hitachi) - basic_machine=hppa1.1-hitachi - os=-hiuxwe2 - ;; - paragon) - basic_machine=i860-intel - os=-osf - ;; - pbd) - basic_machine=sparc-tti - ;; - pbb) - basic_machine=m68k-tti - ;; - pc532 | pc532-*) - basic_machine=ns32k-pc532 - ;; - pc98) - basic_machine=i386-pc - ;; - pc98-*) - basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentium | p5 | k5 | k6 | nexgen | viac3) - basic_machine=i586-pc - ;; - pentiumpro | p6 | 6x86 | athlon | athlon_*) - basic_machine=i686-pc - ;; - pentiumii | pentium2 | pentiumiii | pentium3) - basic_machine=i686-pc - ;; - pentium4) - basic_machine=i786-pc - ;; - pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) - basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentiumpro-* | p6-* | 6x86-* | athlon-*) - basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) - basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentium4-*) - basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pn) - basic_machine=pn-gould - ;; - power) basic_machine=power-ibm - ;; - ppc) basic_machine=powerpc-unknown - ;; - ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ppcle | powerpclittle | ppc-le | powerpc-little) - basic_machine=powerpcle-unknown - ;; - ppcle-* | powerpclittle-*) - basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ppc64) basic_machine=powerpc64-unknown - ;; - ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ppc64le | powerpc64little | ppc64-le | powerpc64-little) - basic_machine=powerpc64le-unknown - ;; - ppc64le-* | powerpc64little-*) - basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ps2) - basic_machine=i386-ibm - ;; - pw32) - basic_machine=i586-unknown - os=-pw32 - ;; - rdos) - basic_machine=i386-pc - os=-rdos - ;; - rom68k) - basic_machine=m68k-rom68k - os=-coff - ;; - rm[46]00) - basic_machine=mips-siemens - ;; - rtpc | rtpc-*) - basic_machine=romp-ibm - ;; - s390 | s390-*) - basic_machine=s390-ibm - ;; - s390x | s390x-*) - basic_machine=s390x-ibm - ;; - sa29200) - basic_machine=a29k-amd - os=-udi - ;; - sb1) - basic_machine=mipsisa64sb1-unknown - ;; - sb1el) - basic_machine=mipsisa64sb1el-unknown - ;; - sde) - basic_machine=mipsisa32-sde - os=-elf - ;; - sei) - basic_machine=mips-sei - os=-seiux - ;; - sequent) - basic_machine=i386-sequent - ;; - sh) - basic_machine=sh-hitachi - os=-hms - ;; - sh5el) - basic_machine=sh5le-unknown - ;; - sh64) - basic_machine=sh64-unknown - ;; - sparclite-wrs | simso-wrs) - basic_machine=sparclite-wrs - os=-vxworks - ;; - sps7) - basic_machine=m68k-bull - os=-sysv2 - ;; - spur) - basic_machine=spur-unknown - ;; - st2000) - basic_machine=m68k-tandem - ;; - stratus) - basic_machine=i860-stratus - os=-sysv4 - ;; - sun2) - basic_machine=m68000-sun - ;; - sun2os3) - basic_machine=m68000-sun - os=-sunos3 - ;; - sun2os4) - basic_machine=m68000-sun - os=-sunos4 - ;; - sun3os3) - basic_machine=m68k-sun - os=-sunos3 - ;; - sun3os4) - basic_machine=m68k-sun - os=-sunos4 - ;; - sun4os3) - basic_machine=sparc-sun - os=-sunos3 - ;; - sun4os4) - basic_machine=sparc-sun - os=-sunos4 - ;; - sun4sol2) - basic_machine=sparc-sun - os=-solaris2 - ;; - sun3 | sun3-*) - basic_machine=m68k-sun - ;; - sun4) - basic_machine=sparc-sun - ;; - sun386 | sun386i | roadrunner) - basic_machine=i386-sun - ;; - sv1) - basic_machine=sv1-cray - os=-unicos - ;; - symmetry) - basic_machine=i386-sequent - os=-dynix - ;; - t3e) - basic_machine=alphaev5-cray - os=-unicos - ;; - t90) - basic_machine=t90-cray - os=-unicos - ;; - tic54x | c54x*) - basic_machine=tic54x-unknown - os=-coff - ;; - tic55x | c55x*) - basic_machine=tic55x-unknown - os=-coff - ;; - tic6x | c6x*) - basic_machine=tic6x-unknown - os=-coff - ;; - tx39) - basic_machine=mipstx39-unknown - ;; - tx39el) - basic_machine=mipstx39el-unknown - ;; - toad1) - basic_machine=pdp10-xkl - os=-tops20 - ;; - tower | tower-32) - basic_machine=m68k-ncr - ;; - tpf) - basic_machine=s390x-ibm - os=-tpf - ;; - udi29k) - basic_machine=a29k-amd - os=-udi - ;; - ultra3) - basic_machine=a29k-nyu - os=-sym1 - ;; - v810 | necv810) - basic_machine=v810-nec - os=-none - ;; - vaxv) - basic_machine=vax-dec - os=-sysv - ;; - vms) - basic_machine=vax-dec - os=-vms - ;; - vpp*|vx|vx-*) - basic_machine=f301-fujitsu - ;; - vxworks960) - basic_machine=i960-wrs - os=-vxworks - ;; - vxworks68) - basic_machine=m68k-wrs - os=-vxworks - ;; - vxworks29k) - basic_machine=a29k-wrs - os=-vxworks - ;; - w65*) - basic_machine=w65-wdc - os=-none - ;; - w89k-*) - basic_machine=hppa1.1-winbond - os=-proelf - ;; - xbox) - basic_machine=i686-pc - os=-mingw32 - ;; - xps | xps100) - basic_machine=xps100-honeywell - ;; - ymp) - basic_machine=ymp-cray - os=-unicos - ;; - z8k-*-coff) - basic_machine=z8k-unknown - os=-sim - ;; - none) - basic_machine=none-none - os=-none - ;; - -# Here we handle the default manufacturer of certain CPU types. It is in -# some cases the only manufacturer, in others, it is the most popular. - w89k) - basic_machine=hppa1.1-winbond - ;; - op50n) - basic_machine=hppa1.1-oki - ;; - op60c) - basic_machine=hppa1.1-oki - ;; - romp) - basic_machine=romp-ibm - ;; - mmix) - basic_machine=mmix-knuth - ;; - rs6000) - basic_machine=rs6000-ibm - ;; - vax) - basic_machine=vax-dec - ;; - pdp10) - # there are many clones, so DEC is not a safe bet - basic_machine=pdp10-unknown - ;; - pdp11) - basic_machine=pdp11-dec - ;; - we32k) - basic_machine=we32k-att - ;; - sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele) - basic_machine=sh-unknown - ;; - sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) - basic_machine=sparc-sun - ;; - cydra) - basic_machine=cydra-cydrome - ;; - orion) - basic_machine=orion-highlevel - ;; - orion105) - basic_machine=clipper-highlevel - ;; - mac | mpw | mac-mpw) - basic_machine=m68k-apple - ;; - pmac | pmac-mpw) - basic_machine=powerpc-apple - ;; - *-unknown) - # Make sure to match an already-canonicalized machine name. - ;; - *) - echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 - exit 1 - ;; -esac - -# Here we canonicalize certain aliases for manufacturers. -case $basic_machine in - *-digital*) - basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` - ;; - *-commodore*) - basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` - ;; - *) - ;; -esac - -# Decode manufacturer-specific aliases for certain operating systems. - -if [ x"$os" != x"" ] -then -case $os in - # First match some system type aliases - # that might get confused with valid system types. - # -solaris* is a basic system type, with this one exception. - -solaris1 | -solaris1.*) - os=`echo $os | sed -e 's|solaris1|sunos4|'` - ;; - -solaris) - os=-solaris2 - ;; - -svr4*) - os=-sysv4 - ;; - -unixware*) - os=-sysv4.2uw - ;; - -gnu/linux*) - os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` - ;; - # First accept the basic system types. - # The portable systems comes first. - # Each alternative MUST END IN A *, to match a version number. - # -sysv* is not here because it comes later, after sysvr4. - -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ - | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ - | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ - | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ - | -aos* \ - | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ - | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ - | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ - | -openbsd* | -solidbsd* \ - | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ - | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ - | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ - | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ - | -chorusos* | -chorusrdb* \ - | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ - | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \ - | -uxpv* | -beos* | -mpeix* | -udk* \ - | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ - | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ - | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ - | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ - | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ - | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ - | -skyos* | -haiku* | -rdos* | -toppers* | -drops*) - # Remember, each alternative MUST END IN *, to match a version number. - ;; - -qnx*) - case $basic_machine in - x86-* | i*86-*) - ;; - *) - os=-nto$os - ;; - esac - ;; - -nto-qnx*) - ;; - -nto*) - os=`echo $os | sed -e 's|nto|nto-qnx|'` - ;; - -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ - | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ - | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) - ;; - -mac*) - os=`echo $os | sed -e 's|mac|macos|'` - ;; - -linux-dietlibc) - os=-linux-dietlibc - ;; - -linux*) - os=`echo $os | sed -e 's|linux|linux-gnu|'` - ;; - -sunos5*) - os=`echo $os | sed -e 's|sunos5|solaris2|'` - ;; - -sunos6*) - os=`echo $os | sed -e 's|sunos6|solaris3|'` - ;; - -opened*) - os=-openedition - ;; - -os400*) - os=-os400 - ;; - -wince*) - os=-wince - ;; - -osfrose*) - os=-osfrose - ;; - -osf*) - os=-osf - ;; - -utek*) - os=-bsd - ;; - -dynix*) - os=-bsd - ;; - -acis*) - os=-aos - ;; - -atheos*) - os=-atheos - ;; - -syllable*) - os=-syllable - ;; - -386bsd) - os=-bsd - ;; - -ctix* | -uts*) - os=-sysv - ;; - -nova*) - os=-rtmk-nova - ;; - -ns2 ) - os=-nextstep2 - ;; - -nsk*) - os=-nsk - ;; - # Preserve the version number of sinix5. - -sinix5.*) - os=`echo $os | sed -e 's|sinix|sysv|'` - ;; - -sinix*) - os=-sysv4 - ;; - -tpf*) - os=-tpf - ;; - -triton*) - os=-sysv3 - ;; - -oss*) - os=-sysv3 - ;; - -svr4) - os=-sysv4 - ;; - -svr3) - os=-sysv3 - ;; - -sysvr4) - os=-sysv4 - ;; - # This must come after -sysvr4. - -sysv*) - ;; - -ose*) - os=-ose - ;; - -es1800*) - os=-ose - ;; - -xenix) - os=-xenix - ;; - -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) - os=-mint - ;; - -aros*) - os=-aros - ;; - -kaos*) - os=-kaos - ;; - -zvmoe) - os=-zvmoe - ;; - -none) - ;; - *) - # Get rid of the `-' at the beginning of $os. - os=`echo $os | sed 's/[^-]*-//'` - echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 - exit 1 - ;; -esac -else - -# Here we handle the default operating systems that come with various machines. -# The value should be what the vendor currently ships out the door with their -# machine or put another way, the most popular os provided with the machine. - -# Note that if you're going to try to match "-MANUFACTURER" here (say, -# "-sun"), then you have to tell the case statement up towards the top -# that MANUFACTURER isn't an operating system. Otherwise, code above -# will signal an error saying that MANUFACTURER isn't an operating -# system, and we'll never get to this point. - -case $basic_machine in - score-*) - os=-elf - ;; - spu-*) - os=-elf - ;; - *-acorn) - os=-riscix1.2 - ;; - arm*-rebel) - os=-linux - ;; - arm*-semi) - os=-aout - ;; - c4x-* | tic4x-*) - os=-coff - ;; - # This must come before the *-dec entry. - pdp10-*) - os=-tops20 - ;; - pdp11-*) - os=-none - ;; - *-dec | vax-*) - os=-ultrix4.2 - ;; - m68*-apollo) - os=-domain - ;; - i386-sun) - os=-sunos4.0.2 - ;; - m68000-sun) - os=-sunos3 - # This also exists in the configure program, but was not the - # default. - # os=-sunos4 - ;; - m68*-cisco) - os=-aout - ;; - mep-*) - os=-elf - ;; - mips*-cisco) - os=-elf - ;; - mips*-*) - os=-elf - ;; - or32-*) - os=-coff - ;; - *-tti) # must be before sparc entry or we get the wrong os. - os=-sysv3 - ;; - sparc-* | *-sun) - os=-sunos4.1.1 - ;; - *-be) - os=-beos - ;; - *-haiku) - os=-haiku - ;; - *-ibm) - os=-aix - ;; - *-knuth) - os=-mmixware - ;; - *-wec) - os=-proelf - ;; - *-winbond) - os=-proelf - ;; - *-oki) - os=-proelf - ;; - *-hp) - os=-hpux - ;; - *-hitachi) - os=-hiux - ;; - i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) - os=-sysv - ;; - *-cbm) - os=-amigaos - ;; - *-dg) - os=-dgux - ;; - *-dolphin) - os=-sysv3 - ;; - m68k-ccur) - os=-rtu - ;; - m88k-omron*) - os=-luna - ;; - *-next ) - os=-nextstep - ;; - *-sequent) - os=-ptx - ;; - *-crds) - os=-unos - ;; - *-ns) - os=-genix - ;; - i370-*) - os=-mvs - ;; - *-next) - os=-nextstep3 - ;; - *-gould) - os=-sysv - ;; - *-highlevel) - os=-bsd - ;; - *-encore) - os=-bsd - ;; - *-sgi) - os=-irix - ;; - *-siemens) - os=-sysv4 - ;; - *-masscomp) - os=-rtu - ;; - f30[01]-fujitsu | f700-fujitsu) - os=-uxpv - ;; - *-rom68k) - os=-coff - ;; - *-*bug) - os=-coff - ;; - *-apple) - os=-macos - ;; - *-atari*) - os=-mint - ;; - *) - os=-none - ;; -esac -fi - -# Here we handle the case where we know the os, and the CPU type, but not the -# manufacturer. We pick the logical manufacturer. -vendor=unknown -case $basic_machine in - *-unknown) - case $os in - -riscix*) - vendor=acorn - ;; - -sunos*) - vendor=sun - ;; - -aix*) - vendor=ibm - ;; - -beos*) - vendor=be - ;; - -hpux*) - vendor=hp - ;; - -mpeix*) - vendor=hp - ;; - -hiux*) - vendor=hitachi - ;; - -unos*) - vendor=crds - ;; - -dgux*) - vendor=dg - ;; - -luna*) - vendor=omron - ;; - -genix*) - vendor=ns - ;; - -mvs* | -opened*) - vendor=ibm - ;; - -os400*) - vendor=ibm - ;; - -ptx*) - vendor=sequent - ;; - -tpf*) - vendor=ibm - ;; - -vxsim* | -vxworks* | -windiss*) - vendor=wrs - ;; - -aux*) - vendor=apple - ;; - -hms*) - vendor=hitachi - ;; - -mpw* | -macos*) - vendor=apple - ;; - -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) - vendor=atari - ;; - -vos*) - vendor=stratus - ;; - esac - basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` - ;; -esac - -echo $basic_machine$os -exit - -# Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "timestamp='" -# time-stamp-format: "%:y-%02m-%02d" -# time-stamp-end: "'" -# End: diff --git a/libs/dbus-c++/configure.ac b/libs/dbus-c++/configure.ac deleted file mode 100644 index 8517c67c2fce4a43b36a61a59d0b28b69aee6df8..0000000000000000000000000000000000000000 --- a/libs/dbus-c++/configure.ac +++ /dev/null @@ -1,196 +0,0 @@ -# Autojunk script for libdbus-c++ - -AC_PREREQ(2.59) -AC_INIT([libdbus-c++], 0.5.0, [shackan@gmail.com]) - -AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION) -AM_CONFIG_HEADER([include/dbus-c++/config.h]) - -AC_CANONICAL_HOST - -AC_SUBST(PACKAGE_VERSION) - - -# Set configuration options - -AC_ARG_ENABLE(debug, - AS_HELP_STRING([--enable-debug], - [enable debugging support]), - [enable_debug=$enableval], - [enable_debug=no] -) - -AC_ARG_ENABLE(glib, - AS_HELP_STRING([--enable-glib], - [enable glib integration]), - [enable_glib=$enableval], - [enable_glib=no] -) - -AC_ARG_ENABLE(doxygen-docs, - AS_HELP_STRING([--enable-doxygen-docs], - [build DOXYGEN documentation (requires Doxygen)]), - [enable_doxygen_docs=$enableval], - [enable_doxygen_docs=no] -) - -# Check for programs - -AC_LANG_CPLUSPLUS - -AC_PROG_CC -AC_PROG_CXX - -CXX_FOR_BUILD=${CXX_FOR_BUILD-${CXX}} -AC_SUBST(CXX_FOR_BUILD) - -AM_PROG_LIBTOOL - -PKG_PROG_PKG_CONFIG - - -AC_MSG_CHECKING([whether $CXX supports symbol visibility]) - -vtest=`$CXX --help --verbose 2>&1 | grep fvisibility` - -if test -n "$vtest"; then - AC_MSG_RESULT(yes) - - AC_DEFINE(GCC_HASCLASSVISIBILITY, 1, [to enable hidden symbols]) - CXXFLAGS="-fvisibility=hidden" -else - AC_MSG_RESULT(no) -fi - - -# Check for dependencies - -DBUS_REQUIRED_VERSION=0.60 -PKG_CHECK_MODULES(dbus, [dbus-1 >= $DBUS_REQUIRED_VERSION],, - AC_MSG_ERROR([You need the DBus libraries (version 0.6 or better)] - [http://www.freedesktop.org/wiki/Software_2fdbus]) -) -AC_SUBST(dbus_CFLAGS) -AC_SUBST(dbus_LIBS) - -DBUS_API_STABLE_VERSION=1.0.0 -PKG_CHECK_EXISTS([dbus-1 < $DBUS_API_STABLE_VERSION], - [AC_DEFINE(DBUS_API_SUBJECT_TO_CHANGE, , [unstable DBus])] -) - -DBUS_THREADS_INIT_DEFAULT_VERSION=0.93 -PKG_CHECK_EXISTS([dbus-1 >= $DBUS_THREADS_INIT_DEFAULT_VERSION], - [AC_DEFINE(DBUS_HAS_THREADS_INIT_DEFAULT, , [dbus_threads_init_default (needs DBus >= 0.93)])] -) - -DBUS_RECURSIVE_MUTEX_VERSION=0.95 -PKG_CHECK_EXISTS([dbus-1 >= $DBUS_RECURSIVE_MUTEX_VERSION], - [AC_DEFINE(DBUS_HAS_RECURSIVE_MUTEX, , [DBus supports recursive mutexes (needs DBus >= 0.95)])] -) - - -if test "$enable_glib" = "yes" ; then -PKG_CHECK_MODULES([glib], glib-2.0) -AC_SUBST(glib_CFLAGS) -AC_SUBST(glib_LIBS) -AM_CONDITIONAL(ENABLE_GLIB, test 1 = 1) -PKG_CHECK_MODULES([gtkmm], gtkmm-2.4, - AM_CONDITIONAL(HAVE_GTKMM, test 1 = 1), - AM_CONDITIONAL(HAVE_GTKMM, test 0 = 1) -) -AC_SUBST(gtkmm_CFLAGS) -AC_SUBST(gtkmm_LIBS) -else -AM_CONDITIONAL(ENABLE_GLIB, test 0 = 1) -AM_CONDITIONAL(HAVE_GTKMM, test 0 = 1) -fi - -AC_CHECK_LIB([expat], XML_ParserCreate_MM, - [AC_CHECK_HEADERS(expat.h, have_expat=true, have_expat=false)], - have_expat=false) - -if ! $have_expat; then - AC_MSG_ERROR([You need the eXpat xml parser] - [http://expat.sourceforge.net/]) -fi - -xml_CFLAGS= -xml_LIBS=-lexpat - -AC_SUBST(xml_CFLAGS) -AC_SUBST(xml_LIBS) - -AC_CHECK_LIB([pthread], pthread_create, - [AC_CHECK_HEADERS(pthread.h, have_pthread=true, have_pthread=false)], - have_pthread=false) - -if test "$have_pthread" = "false"; then - AC_MSG_ERROR([You need the POSIX Thread library (pthreads)]) -fi - -if test "$enable_debug" = "yes" ; then - CXXFLAGS="$CXXFLAGS -Wall -ggdb -O0 -DDEBUG -Wfatal-errors -Werror" -else - CXXFLAGS="$CXXFLAGS -Wall -O3" -fi - - -# Doxygen Documentation - -AC_PATH_PROG(DOXYGEN, doxygen, no) - -AC_MSG_CHECKING([whether to build Doxygen documentation]) - -if test "$DOXYGEN" = "no" ; then - have_doxygen=no -else - have_doxygen=yes -fi - -if test "$enable_doxygen_docs" = "auto" ; then - enable_doxygen_docs=no - - AC_MSG_RESULT(no) -fi - -if test "$enable_doxygen_docs" = "yes" ; then - if test "$have_doxygen" = "no"; then - AC_MSG_ERROR([Building Doxygen docs explicitly required, but Doxygen not found]) - fi - - AC_MSG_RESULT(yes) -fi - -AM_CONDITIONAL(DBUS_DOXYGEN_DOCS_ENABLED, test "$enable_doxygen_docs" = "yes") - -# For the tools/, we need libdbus-c++ for the "build" architecture as well - -AM_CONDITIONAL(CROSS_COMPILING, test "$cross_compiling" = "yes") - -AC_ARG_WITH(build-libdbus-cxx, - AS_HELP_STRING([--with-build-libdbus-cxx], - [For cross compilation: path to libdbus-cxx which was compiled for the 'build' system.]), - [ BUILD_LIBDBUS_CXX_DIR=${withval} ], - [ BUILD_LIBDBUS_CXX_DIR="\$(top_builddir)" ] -) -AC_SUBST(BUILD_LIBDBUS_CXX_DIR) - - -# Save processed files - -AC_OUTPUT( - Makefile - src/Makefile - tools/Makefile - data/Makefile - doc/Makefile - doc/Doxyfile - examples/Makefile - examples/properties/Makefile - examples/echo/Makefile - examples/hal/Makefile - examples/glib/Makefile - dbus-c++-1.pc - dbus-c++-1-uninstalled.pc - libdbus-c++.spec -) diff --git a/libs/dbus-c++/data/Makefile.am b/libs/dbus-c++/data/Makefile.am deleted file mode 100644 index 23df86ec8db8fe4cc2cfd00328f5edc0d1097fae..0000000000000000000000000000000000000000 --- a/libs/dbus-c++/data/Makefile.am +++ /dev/null @@ -1,4 +0,0 @@ -EXTRA_DIST = org.freedesktop.DBus.xml - -MAINTAINERCLEANFILES = \ - Makefile.in diff --git a/libs/dbus-c++/data/org.freedesktop.DBus.xml b/libs/dbus-c++/data/org.freedesktop.DBus.xml deleted file mode 100644 index cbb38abfff52d715d60941907e759189101dc576..0000000000000000000000000000000000000000 --- a/libs/dbus-c++/data/org.freedesktop.DBus.xml +++ /dev/null @@ -1,90 +0,0 @@ -<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" - "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd"> -<node> - <interface name="org.freedesktop.DBus.Introspectable"> - <method name="Introspect"> - <arg name="data" direction="out" type="s"/> - </method> - </interface> - <interface name="org.freedesktop.DBus.Properties"> - <method name="Get"> - <arg name="interface_name" direction="in" type="s"/> - <arg name="property_name" direction="in" type="s"/> - <arg name="value" direction="out" type="v"/> - </method> - <method name="Set"> - <arg name="interface_name" direction="in" type="s"/> - <arg name="property_name" direction="in" type="s"/> - <arg name="value" direction="in" type="v"/> - </method> - <method name="GetAll"> - <arg name="interface_name" direction="in" type="s"/> - <arg name="props" direction="out" type="a{sv}"/> - </method> - </interface> - <interface name="org.freedesktop.DBus"> - <method name="RequestName"> - <arg direction="in" type="s"/> - <arg direction="in" type="u"/> - <arg direction="out" type="u"/> - </method> - <method name="ReleaseName"> - <arg direction="in" type="s"/> - <arg direction="out" type="u"/> - </method> - <method name="StartServiceByName"> - <arg direction="in" type="s"/> - <arg direction="in" type="u"/> - <arg direction="out" type="u"/> - </method> - <method name="Hello"> - <arg direction="out" type="s"/> - </method> - <method name="NameHasOwner"> - <arg direction="in" type="s"/> - <arg direction="out" type="b"/> - </method> - <method name="ListNames"> - <arg direction="out" type="as"/> - </method> - <method name="AddMatch"> - <arg direction="in" type="s"/> - </method> - <method name="RemoveMatch"> - <arg direction="in" type="s"/> - </method> - <method name="GetNameOwner"> - <arg direction="in" type="s"/> - <arg direction="out" type="s"/> - </method> - <method name="ListQueuedOwners"> - <arg direction="in" type="s"/> - <arg direction="out" type="as"/> - </method> - <method name="GetConnectionUnixUser"> - <arg direction="in" type="s"/> - <arg direction="out" type="u"/> - </method> - <method name="GetConnectionUnixProcessID"> - <arg direction="in" type="s"/> - <arg direction="out" type="u"/> - </method> - <method name="GetConnectionSELinuxSecurityContext"> - <arg direction="in" type="s"/> - <arg direction="out" type="ay"/> - </method> - <method name="ReloadConfig"> - </method> - <signal name="NameOwnerChanged"> - <arg type="s"/> - <arg type="s"/> - <arg type="s"/> - </signal> - <signal name="NameLost"> - <arg type="s"/> - </signal> - <signal name="NameAcquired"> - <arg type="s"/> - </signal> - </interface> -</node> diff --git a/libs/dbus-c++/dbus-c++-1-uninstalled.pc.in b/libs/dbus-c++/dbus-c++-1-uninstalled.pc.in deleted file mode 100644 index 839fa86ab6375c46cf961ad5dca2c9789eecca2e..0000000000000000000000000000000000000000 --- a/libs/dbus-c++/dbus-c++-1-uninstalled.pc.in +++ /dev/null @@ -1,13 +0,0 @@ -prefix= -exec_prefix= -libdir=src -includedir=include - -Name: @PACKAGE@ -Description: Native C++ bindings for D-Bus, Not Installed -Version: @VERSION@ -Requires: -Conflicts: -Libs: ${pcfiledir}/${libdir}/libdbus-c++-1.la -Cflags: -I${pcfiledir}/${includedir} - diff --git a/libs/dbus-c++/dbus-c++-1.pc.in b/libs/dbus-c++/dbus-c++-1.pc.in deleted file mode 100644 index bc5860a95594e9bd30af8687b7c1e162f6fd79bb..0000000000000000000000000000000000000000 --- a/libs/dbus-c++/dbus-c++-1.pc.in +++ /dev/null @@ -1,11 +0,0 @@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -libdir=@libdir@ -includedir=@includedir@ - -Name: dbus-c++ -Description: Native C++ bindings for D-Bus. -Requires: dbus-1 -Version: @VERSION@ -Libs: -L${libdir} -ldbus-c++-1 -Cflags: -I${includedir}/dbus-c++-1 -DDBUS_API_SUBJECT_TO_CHANGE diff --git a/libs/dbus-c++/depcomp b/libs/dbus-c++/depcomp deleted file mode 100755 index 04701da536f33a7c39d7bb01b87a70ae3a776df5..0000000000000000000000000000000000000000 --- a/libs/dbus-c++/depcomp +++ /dev/null @@ -1,530 +0,0 @@ -#! /bin/sh -# depcomp - compile a program generating dependencies as side-effects - -scriptversion=2005-07-09.11 - -# Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -# 02110-1301, USA. - -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>. - -case $1 in - '') - echo "$0: No command. Try \`$0 --help' for more information." 1>&2 - exit 1; - ;; - -h | --h*) - cat <<\EOF -Usage: depcomp [--help] [--version] PROGRAM [ARGS] - -Run PROGRAMS ARGS to compile a file, generating dependencies -as side-effects. - -Environment variables: - depmode Dependency tracking mode. - source Source file read by `PROGRAMS ARGS'. - object Object file output by `PROGRAMS ARGS'. - DEPDIR directory where to store dependencies. - depfile Dependency file to output. - tmpdepfile Temporary file to use when outputing dependencies. - libtool Whether libtool is used (yes/no). - -Report bugs to <bug-automake@gnu.org>. -EOF - exit $? - ;; - -v | --v*) - echo "depcomp $scriptversion" - exit $? - ;; -esac - -if test -z "$depmode" || test -z "$source" || test -z "$object"; then - echo "depcomp: Variables source, object and depmode must be set" 1>&2 - exit 1 -fi - -# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. -depfile=${depfile-`echo "$object" | - sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} -tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} - -rm -f "$tmpdepfile" - -# Some modes work just like other modes, but use different flags. We -# parameterize here, but still list the modes in the big case below, -# to make depend.m4 easier to write. Note that we *cannot* use a case -# here, because this file can only contain one case statement. -if test "$depmode" = hp; then - # HP compiler uses -M and no extra arg. - gccflag=-M - depmode=gcc -fi - -if test "$depmode" = dashXmstdout; then - # This is just like dashmstdout with a different argument. - dashmflag=-xM - depmode=dashmstdout -fi - -case "$depmode" in -gcc3) -## gcc 3 implements dependency tracking that does exactly what -## we want. Yay! Note: for some reason libtool 1.4 doesn't like -## it if -MD -MP comes after the -MF stuff. Hmm. - "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" - stat=$? - if test $stat -eq 0; then : - else - rm -f "$tmpdepfile" - exit $stat - fi - mv "$tmpdepfile" "$depfile" - ;; - -gcc) -## There are various ways to get dependency output from gcc. Here's -## why we pick this rather obscure method: -## - Don't want to use -MD because we'd like the dependencies to end -## up in a subdir. Having to rename by hand is ugly. -## (We might end up doing this anyway to support other compilers.) -## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like -## -MM, not -M (despite what the docs say). -## - Using -M directly means running the compiler twice (even worse -## than renaming). - if test -z "$gccflag"; then - gccflag=-MD, - fi - "$@" -Wp,"$gccflag$tmpdepfile" - stat=$? - if test $stat -eq 0; then : - else - rm -f "$tmpdepfile" - exit $stat - fi - rm -f "$depfile" - echo "$object : \\" > "$depfile" - alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz -## The second -e expression handles DOS-style file names with drive letters. - sed -e 's/^[^:]*: / /' \ - -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" -## This next piece of magic avoids the `deleted header file' problem. -## The problem is that when a header file which appears in a .P file -## is deleted, the dependency causes make to die (because there is -## typically no way to rebuild the header). We avoid this by adding -## dummy dependencies for each header file. Too bad gcc doesn't do -## this for us directly. - tr ' ' ' -' < "$tmpdepfile" | -## Some versions of gcc put a space before the `:'. On the theory -## that the space means something, we add a space to the output as -## well. -## Some versions of the HPUX 10.20 sed can't process this invocation -## correctly. Breaking it into two sed invocations is a workaround. - sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" - rm -f "$tmpdepfile" - ;; - -hp) - # This case exists only to let depend.m4 do its work. It works by - # looking at the text of this script. This case will never be run, - # since it is checked for above. - exit 1 - ;; - -sgi) - if test "$libtool" = yes; then - "$@" "-Wp,-MDupdate,$tmpdepfile" - else - "$@" -MDupdate "$tmpdepfile" - fi - stat=$? - if test $stat -eq 0; then : - else - rm -f "$tmpdepfile" - exit $stat - fi - rm -f "$depfile" - - if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files - echo "$object : \\" > "$depfile" - - # Clip off the initial element (the dependent). Don't try to be - # clever and replace this with sed code, as IRIX sed won't handle - # lines with more than a fixed number of characters (4096 in - # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; - # the IRIX cc adds comments like `#:fec' to the end of the - # dependency line. - tr ' ' ' -' < "$tmpdepfile" \ - | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ - tr ' -' ' ' >> $depfile - echo >> $depfile - - # The second pass generates a dummy entry for each header file. - tr ' ' ' -' < "$tmpdepfile" \ - | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ - >> $depfile - else - # The sourcefile does not contain any dependencies, so just - # store a dummy comment line, to avoid errors with the Makefile - # "include basename.Plo" scheme. - echo "#dummy" > "$depfile" - fi - rm -f "$tmpdepfile" - ;; - -aix) - # The C for AIX Compiler uses -M and outputs the dependencies - # in a .u file. In older versions, this file always lives in the - # current directory. Also, the AIX compiler puts `$object:' at the - # start of each line; $object doesn't have directory information. - # Version 6 uses the directory in both cases. - stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'` - tmpdepfile="$stripped.u" - if test "$libtool" = yes; then - "$@" -Wc,-M - else - "$@" -M - fi - stat=$? - - if test -f "$tmpdepfile"; then : - else - stripped=`echo "$stripped" | sed 's,^.*/,,'` - tmpdepfile="$stripped.u" - fi - - if test $stat -eq 0; then : - else - rm -f "$tmpdepfile" - exit $stat - fi - - if test -f "$tmpdepfile"; then - outname="$stripped.o" - # Each line is of the form `foo.o: dependent.h'. - # Do two passes, one to just change these to - # `$object: dependent.h' and one to simply `dependent.h:'. - sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile" - sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile" - else - # The sourcefile does not contain any dependencies, so just - # store a dummy comment line, to avoid errors with the Makefile - # "include basename.Plo" scheme. - echo "#dummy" > "$depfile" - fi - rm -f "$tmpdepfile" - ;; - -icc) - # Intel's C compiler understands `-MD -MF file'. However on - # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c - # ICC 7.0 will fill foo.d with something like - # foo.o: sub/foo.c - # foo.o: sub/foo.h - # which is wrong. We want: - # sub/foo.o: sub/foo.c - # sub/foo.o: sub/foo.h - # sub/foo.c: - # sub/foo.h: - # ICC 7.1 will output - # foo.o: sub/foo.c sub/foo.h - # and will wrap long lines using \ : - # foo.o: sub/foo.c ... \ - # sub/foo.h ... \ - # ... - - "$@" -MD -MF "$tmpdepfile" - stat=$? - if test $stat -eq 0; then : - else - rm -f "$tmpdepfile" - exit $stat - fi - rm -f "$depfile" - # Each line is of the form `foo.o: dependent.h', - # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. - # Do two passes, one to just change these to - # `$object: dependent.h' and one to simply `dependent.h:'. - sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" - # Some versions of the HPUX 10.20 sed can't process this invocation - # correctly. Breaking it into two sed invocations is a workaround. - sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" | - sed -e 's/$/ :/' >> "$depfile" - rm -f "$tmpdepfile" - ;; - -tru64) - # The Tru64 compiler uses -MD to generate dependencies as a side - # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. - # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put - # dependencies in `foo.d' instead, so we check for that too. - # Subdirectories are respected. - dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` - test "x$dir" = "x$object" && dir= - base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` - - if test "$libtool" = yes; then - # With Tru64 cc, shared objects can also be used to make a - # static library. This mecanism is used in libtool 1.4 series to - # handle both shared and static libraries in a single compilation. - # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. - # - # With libtool 1.5 this exception was removed, and libtool now - # generates 2 separate objects for the 2 libraries. These two - # compilations output dependencies in in $dir.libs/$base.o.d and - # in $dir$base.o.d. We have to check for both files, because - # one of the two compilations can be disabled. We should prefer - # $dir$base.o.d over $dir.libs/$base.o.d because the latter is - # automatically cleaned when .libs/ is deleted, while ignoring - # the former would cause a distcleancheck panic. - tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4 - tmpdepfile2=$dir$base.o.d # libtool 1.5 - tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5 - tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504 - "$@" -Wc,-MD - else - tmpdepfile1=$dir$base.o.d - tmpdepfile2=$dir$base.d - tmpdepfile3=$dir$base.d - tmpdepfile4=$dir$base.d - "$@" -MD - fi - - stat=$? - if test $stat -eq 0; then : - else - rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" - exit $stat - fi - - for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" - do - test -f "$tmpdepfile" && break - done - if test -f "$tmpdepfile"; then - sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" - # That's a tab and a space in the []. - sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" - else - echo "#dummy" > "$depfile" - fi - rm -f "$tmpdepfile" - ;; - -#nosideeffect) - # This comment above is used by automake to tell side-effect - # dependency tracking mechanisms from slower ones. - -dashmstdout) - # Important note: in order to support this mode, a compiler *must* - # always write the preprocessed file to stdout, regardless of -o. - "$@" || exit $? - - # Remove the call to Libtool. - if test "$libtool" = yes; then - while test $1 != '--mode=compile'; do - shift - done - shift - fi - - # Remove `-o $object'. - IFS=" " - for arg - do - case $arg in - -o) - shift - ;; - $object) - shift - ;; - *) - set fnord "$@" "$arg" - shift # fnord - shift # $arg - ;; - esac - done - - test -z "$dashmflag" && dashmflag=-M - # Require at least two characters before searching for `:' - # in the target name. This is to cope with DOS-style filenames: - # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise. - "$@" $dashmflag | - sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" - rm -f "$depfile" - cat < "$tmpdepfile" > "$depfile" - tr ' ' ' -' < "$tmpdepfile" | \ -## Some versions of the HPUX 10.20 sed can't process this invocation -## correctly. Breaking it into two sed invocations is a workaround. - sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" - rm -f "$tmpdepfile" - ;; - -dashXmstdout) - # This case only exists to satisfy depend.m4. It is never actually - # run, as this mode is specially recognized in the preamble. - exit 1 - ;; - -makedepend) - "$@" || exit $? - # Remove any Libtool call - if test "$libtool" = yes; then - while test $1 != '--mode=compile'; do - shift - done - shift - fi - # X makedepend - shift - cleared=no - for arg in "$@"; do - case $cleared in - no) - set ""; shift - cleared=yes ;; - esac - case "$arg" in - -D*|-I*) - set fnord "$@" "$arg"; shift ;; - # Strip any option that makedepend may not understand. Remove - # the object too, otherwise makedepend will parse it as a source file. - -*|$object) - ;; - *) - set fnord "$@" "$arg"; shift ;; - esac - done - obj_suffix="`echo $object | sed 's/^.*\././'`" - touch "$tmpdepfile" - ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" - rm -f "$depfile" - cat < "$tmpdepfile" > "$depfile" - sed '1,2d' "$tmpdepfile" | tr ' ' ' -' | \ -## Some versions of the HPUX 10.20 sed can't process this invocation -## correctly. Breaking it into two sed invocations is a workaround. - sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" - rm -f "$tmpdepfile" "$tmpdepfile".bak - ;; - -cpp) - # Important note: in order to support this mode, a compiler *must* - # always write the preprocessed file to stdout. - "$@" || exit $? - - # Remove the call to Libtool. - if test "$libtool" = yes; then - while test $1 != '--mode=compile'; do - shift - done - shift - fi - - # Remove `-o $object'. - IFS=" " - for arg - do - case $arg in - -o) - shift - ;; - $object) - shift - ;; - *) - set fnord "$@" "$arg" - shift # fnord - shift # $arg - ;; - esac - done - - "$@" -E | - sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ - -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | - sed '$ s: \\$::' > "$tmpdepfile" - rm -f "$depfile" - echo "$object : \\" > "$depfile" - cat < "$tmpdepfile" >> "$depfile" - sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" - rm -f "$tmpdepfile" - ;; - -msvisualcpp) - # Important note: in order to support this mode, a compiler *must* - # always write the preprocessed file to stdout, regardless of -o, - # because we must use -o when running libtool. - "$@" || exit $? - IFS=" " - for arg - do - case "$arg" in - "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") - set fnord "$@" - shift - shift - ;; - *) - set fnord "$@" "$arg" - shift - shift - ;; - esac - done - "$@" -E | - sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile" - rm -f "$depfile" - echo "$object : \\" > "$depfile" - . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" - echo " " >> "$depfile" - . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile" - rm -f "$tmpdepfile" - ;; - -none) - exec "$@" - ;; - -*) - echo "Unknown depmode $depmode" 1>&2 - exit 1 - ;; -esac - -exit 0 - -# Local Variables: -# mode: shell-script -# sh-indentation: 2 -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "scriptversion=" -# time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-end: "$" -# End: diff --git a/libs/dbus-c++/doc/Doxyfile.in b/libs/dbus-c++/doc/Doxyfile.in deleted file mode 100644 index a2b3d4415fe2026b0f0e520d88934377bda6ff9a..0000000000000000000000000000000000000000 --- a/libs/dbus-c++/doc/Doxyfile.in +++ /dev/null @@ -1,251 +0,0 @@ -# Doxyfile 1.4.6 - -#--------------------------------------------------------------------------- -# Project related configuration options -#--------------------------------------------------------------------------- -PROJECT_NAME = @PACKAGE@ -PROJECT_NUMBER = @VERSION@ -OUTPUT_DIRECTORY = @top_srcdir@/doc/ -CREATE_SUBDIRS = NO -OUTPUT_LANGUAGE = English -USE_WINDOWS_ENCODING = NO -BRIEF_MEMBER_DESC = YES -REPEAT_BRIEF = YES -ABBREVIATE_BRIEF = "The $name class" \ - "The $name widget" \ - "The $name file" \ - is \ - provides \ - specifies \ - contains \ - represents \ - a \ - an \ - the -ALWAYS_DETAILED_SEC = NO -INLINE_INHERITED_MEMB = NO -FULL_PATH_NAMES = NO -STRIP_FROM_PATH = -STRIP_FROM_INC_PATH = -SHORT_NAMES = NO -JAVADOC_AUTOBRIEF = YES -MULTILINE_CPP_IS_BRIEF = NO -DETAILS_AT_TOP = NO -INHERIT_DOCS = YES -SEPARATE_MEMBER_PAGES = NO -TAB_SIZE = 4 -ALIASES = -OPTIMIZE_OUTPUT_FOR_C = NO -OPTIMIZE_OUTPUT_JAVA = NO -BUILTIN_STL_SUPPORT = YES -DISTRIBUTE_GROUP_DOC = NO -SUBGROUPING = YES -#--------------------------------------------------------------------------- -# Build related configuration options -#--------------------------------------------------------------------------- -EXTRACT_ALL = YES -EXTRACT_PRIVATE = NO -EXTRACT_STATIC = NO -EXTRACT_LOCAL_CLASSES = NO -EXTRACT_LOCAL_METHODS = NO -HIDE_UNDOC_MEMBERS = NO -HIDE_UNDOC_CLASSES = NO -HIDE_FRIEND_COMPOUNDS = YES -HIDE_IN_BODY_DOCS = NO -INTERNAL_DOCS = NO -CASE_SENSE_NAMES = YES -HIDE_SCOPE_NAMES = NO -SHOW_INCLUDE_FILES = YES -INLINE_INFO = YES -SORT_MEMBER_DOCS = YES -SORT_BRIEF_DOCS = NO -SORT_BY_SCOPE_NAME = NO -GENERATE_TODOLIST = YES -GENERATE_TESTLIST = YES -GENERATE_BUGLIST = YES -GENERATE_DEPRECATEDLIST= YES -ENABLED_SECTIONS = -MAX_INITIALIZER_LINES = 30 -SHOW_USED_FILES = YES -SHOW_DIRECTORIES = NO -FILE_VERSION_FILTER = -#--------------------------------------------------------------------------- -# configuration options related to warning and progress messages -#--------------------------------------------------------------------------- -QUIET = YES -WARNINGS = YES -WARN_IF_UNDOCUMENTED = YES -WARN_IF_DOC_ERROR = YES -WARN_NO_PARAMDOC = NO -WARN_FORMAT = -WARN_LOGFILE = -#--------------------------------------------------------------------------- -# configuration options related to the input files -#--------------------------------------------------------------------------- -INPUT = @top_srcdir@/src/ @top_srcdir@/include/ -FILE_PATTERNS = *.cpp \ - *.h -RECURSIVE = YES -EXCLUDE = -EXCLUDE_SYMLINKS = NO -EXCLUDE_PATTERNS = Makefile.* \ - ChangeLog \ - CHANGES \ - CHANGES.* \ - README \ - README.* \ - *.png \ - AUTHORS \ - DESIGN \ - DESIGN.* \ - *.desktop \ - DESKTOP* \ - COMMENTS \ - HOWTO \ - magic \ - NOTES \ - TODO \ - THANKS -EXAMPLE_PATH = -EXAMPLE_PATTERNS = -EXAMPLE_RECURSIVE = NO -IMAGE_PATH = -INPUT_FILTER = -FILTER_PATTERNS = -FILTER_SOURCE_FILES = NO -#--------------------------------------------------------------------------- -# configuration options related to source browsing -#--------------------------------------------------------------------------- -SOURCE_BROWSER = YES -INLINE_SOURCES = NO -STRIP_CODE_COMMENTS = YES -REFERENCED_BY_RELATION = YES -REFERENCES_RELATION = YES -USE_HTAGS = NO -VERBATIM_HEADERS = YES -#--------------------------------------------------------------------------- -# configuration options related to the alphabetical class index -#--------------------------------------------------------------------------- -ALPHABETICAL_INDEX = NO -COLS_IN_ALPHA_INDEX = 5 -IGNORE_PREFIX = -#--------------------------------------------------------------------------- -# configuration options related to the HTML output -#--------------------------------------------------------------------------- -GENERATE_HTML = YES -HTML_OUTPUT = -HTML_FILE_EXTENSION = .html -HTML_HEADER = -HTML_FOOTER = -HTML_STYLESHEET = -HTML_ALIGN_MEMBERS = YES -GENERATE_HTMLHELP = NO -CHM_FILE = -HHC_LOCATION = -GENERATE_CHI = NO -BINARY_TOC = NO -TOC_EXPAND = NO -DISABLE_INDEX = NO -ENUM_VALUES_PER_LINE = 4 -GENERATE_TREEVIEW = NO -TREEVIEW_WIDTH = 250 -#--------------------------------------------------------------------------- -# configuration options related to the LaTeX output -#--------------------------------------------------------------------------- -GENERATE_LATEX = NO -LATEX_OUTPUT = -LATEX_CMD_NAME = latex -MAKEINDEX_CMD_NAME = makeindex -COMPACT_LATEX = NO -PAPER_TYPE = a4wide -EXTRA_PACKAGES = -LATEX_HEADER = -PDF_HYPERLINKS = NO -USE_PDFLATEX = NO -LATEX_BATCHMODE = NO -LATEX_HIDE_INDICES = NO -#--------------------------------------------------------------------------- -# configuration options related to the RTF output -#--------------------------------------------------------------------------- -GENERATE_RTF = NO -RTF_OUTPUT = -COMPACT_RTF = NO -RTF_HYPERLINKS = NO -RTF_STYLESHEET_FILE = -RTF_EXTENSIONS_FILE = -#--------------------------------------------------------------------------- -# configuration options related to the man page output -#--------------------------------------------------------------------------- -GENERATE_MAN = NO -MAN_OUTPUT = man -MAN_EXTENSION = -MAN_LINKS = NO -#--------------------------------------------------------------------------- -# configuration options related to the XML output -#--------------------------------------------------------------------------- -GENERATE_XML = NO -XML_OUTPUT = xml -XML_SCHEMA = -XML_DTD = -XML_PROGRAMLISTING = YES -#--------------------------------------------------------------------------- -# configuration options for the AutoGen Definitions output -#--------------------------------------------------------------------------- -GENERATE_AUTOGEN_DEF = NO -#--------------------------------------------------------------------------- -# configuration options related to the Perl module output -#--------------------------------------------------------------------------- -GENERATE_PERLMOD = NO -PERLMOD_LATEX = NO -PERLMOD_PRETTY = YES -PERLMOD_MAKEVAR_PREFIX = -#--------------------------------------------------------------------------- -# Configuration options related to the preprocessor -#--------------------------------------------------------------------------- -ENABLE_PREPROCESSING = YES -MACRO_EXPANSION = YES -EXPAND_ONLY_PREDEF = YES -SEARCH_INCLUDES = YES -INCLUDE_PATH = -INCLUDE_FILE_PATTERNS = -PREDEFINED = DOXYGEN_SHOULD_SKIP_THIS -EXPAND_AS_DEFINED = -SKIP_FUNCTION_MACROS = NO -#--------------------------------------------------------------------------- -# Configuration::additions related to external references -#--------------------------------------------------------------------------- -TAGFILES = -GENERATE_TAGFILE = -ALLEXTERNALS = NO -EXTERNAL_GROUPS = YES -PERL_PATH = -#--------------------------------------------------------------------------- -# Configuration options related to the dot tool -#--------------------------------------------------------------------------- -CLASS_DIAGRAMS = YES -HIDE_UNDOC_RELATIONS = YES -HAVE_DOT = NO -CLASS_GRAPH = YES -COLLABORATION_GRAPH = YES -GROUP_GRAPHS = YES -UML_LOOK = NO -TEMPLATE_RELATIONS = YES -INCLUDE_GRAPH = YES -INCLUDED_BY_GRAPH = YES -CALL_GRAPH = NO -GRAPHICAL_HIERARCHY = YES -DIRECTORY_GRAPH = YES -DOT_IMAGE_FORMAT = png -DOT_PATH = -DOTFILE_DIRS = -MAX_DOT_GRAPH_WIDTH = 640 -MAX_DOT_GRAPH_HEIGHT = 1024 -MAX_DOT_GRAPH_DEPTH = 1000 -DOT_TRANSPARENT = NO -DOT_MULTI_TARGETS = NO -GENERATE_LEGEND = YES -DOT_CLEANUP = YES -#--------------------------------------------------------------------------- -# Configuration::additions related to the search engine -#--------------------------------------------------------------------------- -SEARCHENGINE = NO diff --git a/libs/dbus-c++/doc/Makefile.am b/libs/dbus-c++/doc/Makefile.am deleted file mode 100644 index 39fd9b9deb140ecfadc9dde627dc835de95fb335..0000000000000000000000000000000000000000 --- a/libs/dbus-c++/doc/Makefile.am +++ /dev/null @@ -1,15 +0,0 @@ -if DBUS_DOXYGEN_DOCS_ENABLED - -EXTRA_DIST = Doxyfile.in - -noinst_PROGRAMS = index.html - -index_html_SOURCES = Doxyfile - -index.html: Doxyfile - doxygen Doxyfile - -endif - -MAINTAINERCLEANFILES = \ - Makefile.in diff --git a/libs/dbus-c++/doc/html/Makefile.am b/libs/dbus-c++/doc/html/Makefile.am deleted file mode 100644 index 8eb67f86574b1821e66ddf261e6c7de2eaa46546..0000000000000000000000000000000000000000 --- a/libs/dbus-c++/doc/html/Makefile.am +++ /dev/null @@ -1,4 +0,0 @@ -CLEANFILES = *.html *.css *.png *.gif - -MAINTAINERCLEANFILES = \ - Makefile.in diff --git a/libs/dbus-c++/examples/Makefile.am b/libs/dbus-c++/examples/Makefile.am deleted file mode 100644 index b346604bad07e6aabfc20c1e3a581325446085f1..0000000000000000000000000000000000000000 --- a/libs/dbus-c++/examples/Makefile.am +++ /dev/null @@ -1,5 +0,0 @@ -SUBDIRS = properties echo hal glib - -MAINTAINERCLEANFILES = \ - Makefile.in - diff --git a/libs/dbus-c++/examples/echo/Makefile.am b/libs/dbus-c++/examples/echo/Makefile.am deleted file mode 100644 index 565fb1a0136bd9eaaa6fcfe4d0119438dd7e1041..0000000000000000000000000000000000000000 --- a/libs/dbus-c++/examples/echo/Makefile.am +++ /dev/null @@ -1,28 +0,0 @@ -EXTRA_DIST = README echo-introspect.xml - -AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include - -noinst_PROGRAMS = echo-server - -echo_server_SOURCES = echo-server-glue.h echo-server.h echo-server.cpp -echo_server_LDADD = $(top_builddir)/src/libdbus-c++-1.la - -echo-server-glue.h: echo-introspect.xml - $(top_builddir)/tools/dbusxx-xml2cpp $^ --adaptor=$@ - -noinst_PROGRAMS += echo-client-mt - -echo_client_mt_SOURCES = echo-client-glue.h echo-client.h echo-client.cpp -echo_client_mt_LDADD = $(top_builddir)/src/libdbus-c++-1.la -lpthread - -echo-client-glue.h: echo-introspect.xml - $(top_builddir)/tools/dbusxx-xml2cpp $^ --proxy=$@ - -BUILT_SOURCES = echo-server-glue.h echo-client-glue.h -CLEANFILES = $(BUILT_SOURCES) - -dist-hook: - cd $(distdir); rm -f $(BUILT_SOURCES) - -MAINTAINERCLEANFILES = \ - Makefile.in diff --git a/libs/dbus-c++/examples/echo/README b/libs/dbus-c++/examples/echo/README deleted file mode 100644 index 74e1d6d16c59858237e98e5186000951397d95d5..0000000000000000000000000000000000000000 --- a/libs/dbus-c++/examples/echo/README +++ /dev/null @@ -1,23 +0,0 @@ -This is probably the most simple D-Bus program you could conceive - -To test, run `DBUSXX_VERBOSE=1 ./echo-server` and try the following commands: - -dbus-send --dest=org.freedesktop.DBus.Examples.Echo --type=method_call --print-reply /org/freedesktop/DBus/Examples/Echo org.freedesktop.DBus.EchoDemo.Random - -dbus-send --dest=org.freedesktop.DBus.Examples.Echo --type=method_call --print-reply /org/freedesktop/DBus/Examples/Echo org.freedesktop.DBus.EchoDemo.Hello string:"world" - -dbus-send --dest=org.freedesktop.DBus.Examples.Echo --type=method_call --print-reply /org/freedesktop/DBus/Examples/Echo org.freedesktop.DBus.EchoDemo.Sum array:int32:10,100,250 - -dbus-send --dest=org.freedesktop.DBus.Examples.Echo --type=method_call --print-reply /org/freedesktop/DBus/Examples/Echo org.freedesktop.DBus.EchoDemo.Info - -or, using python instead - -$ python -import dbus -bus = dbus.SessionBus() -object = bus.get_object('org.freedesktop.DBus.Examples.Echo','/org/freedesktop/DBus/Examples/Echo') -echo = dbus.Interface(object, dbus_interface='org.freedesktop.DBus.EchoDemo') -echo.Random() -echo.Hello("world") -echo.Sum([123, 234, 95, 520]) -echo.Info() diff --git a/libs/dbus-c++/examples/echo/echo-client.cpp b/libs/dbus-c++/examples/echo/echo-client.cpp deleted file mode 100644 index 287206671d08f5d98be3df7e151f876660a2883f..0000000000000000000000000000000000000000 --- a/libs/dbus-c++/examples/echo/echo-client.cpp +++ /dev/null @@ -1,94 +0,0 @@ -#include "echo-client.h" -#include <iostream> -#include <pthread.h> -#include <signal.h> - -#ifdef HAVE_CONFIG_H -#include <dbus-c++/config.h> -#endif - -using namespace std; - -static const char *ECHO_SERVER_NAME = "org.freedesktop.DBus.Examples.Echo"; -static const char *ECHO_SERVER_PATH = "/org/freedesktop/DBus/Examples/Echo"; - -EchoClient::EchoClient(DBus::Connection &connection, const char *path, const char *name) -: DBus::ObjectProxy(connection, path, name) -{ -} - -void EchoClient::Echoed(const DBus::Variant &value) -{ - cout << "!"; -} - -/* - * For some strange reason, libdbus frequently dies with an OOM - */ - -static const int THREADS = 3; - -static bool spin = true; - -void *greeter_thread(void *arg) -{ - DBus::Connection *conn = reinterpret_cast<DBus::Connection *>(arg); - - EchoClient client(*conn, ECHO_SERVER_PATH, ECHO_SERVER_NAME); - - char idstr[16]; - - snprintf(idstr, sizeof(idstr), "%lu", pthread_self()); - - for (int i = 0; i < 30 && spin; ++i) - { - cout << client.Hello(idstr) << endl; - } - - cout << idstr << " done " << endl; - - return NULL; -} - -DBus::BusDispatcher dispatcher; - -void niam(int sig) -{ - spin = false; - - dispatcher.leave(); -} - -int main() -{ - signal(SIGTERM, niam); - signal(SIGINT, niam); - -#ifdef DBUS_HAS_THREADS_INIT_DEFAULT - DBus::_init_threading(); -#else - cerr << "Thread support is not enabled! your D-Bus version is too old" << endl; -#endif - - DBus::default_dispatcher = &dispatcher; - - DBus::Connection conn = DBus::Connection::SessionBus(); - - pthread_t threads[THREADS]; - - for (int i = 0; i < THREADS; ++i) - { - pthread_create(threads+i, NULL, greeter_thread, &conn); - } - - dispatcher.enter(); - - cout << "terminating" << endl; - - for (int i = 0; i < THREADS; ++i) - { - pthread_join(threads[i], NULL); - } - - return 0; -} diff --git a/libs/dbus-c++/examples/echo/echo-client.h b/libs/dbus-c++/examples/echo/echo-client.h deleted file mode 100644 index 54401eca4152e03a5621e6b947a3062eb911d702..0000000000000000000000000000000000000000 --- a/libs/dbus-c++/examples/echo/echo-client.h +++ /dev/null @@ -1,19 +0,0 @@ -#ifndef __DEMO_ECHO_CLIENT_H -#define __DEMO_ECHO_CLIENT_H - -#include <dbus-c++/dbus.h> -#include "echo-client-glue.h" - -class EchoClient -: public org::freedesktop::DBus::EchoDemo_proxy, - public DBus::IntrospectableProxy, - public DBus::ObjectProxy -{ -public: - - EchoClient(DBus::Connection &connection, const char *path, const char *name); - - void Echoed(const DBus::Variant &value); -}; - -#endif//__DEMO_ECHO_CLIENT_H diff --git a/libs/dbus-c++/examples/echo/echo-introspect.xml b/libs/dbus-c++/examples/echo/echo-introspect.xml deleted file mode 100644 index 7d415abdd4c17c9bd653bb9d619fc9dff22f5264..0000000000000000000000000000000000000000 --- a/libs/dbus-c++/examples/echo/echo-introspect.xml +++ /dev/null @@ -1,30 +0,0 @@ -<?xml version="1.0" ?> -<node name="/org/freedesktop/DBus/Examples/Echo"> - <interface name="org.freedesktop.DBus.EchoDemo"> - <method name="Random"> - <arg type="i" name="version" direction="out"/> - </method> - <method name="Hello"> - <arg type="s" name="name" direction="in"/> - <arg type="s" name="greeting" direction="out"/> - </method> - <method name="Echo"> - <arg type="v" name="input" direction="in"/> - <arg type="v" name="output" direction="out"/> - </method> - <method name="Cat"> - <arg type="s" name="file" direction="in"/> - <arg type="ay" name="stream" direction="out"/> - </method> - <method name="Sum"> - <arg type="ai" name="ints" direction="in"/> - <arg type="i" names="sum" direction="out"/> - </method> - <signal name="Echoed"> - <arg type="v" name="value"/> - </signal> - <method name="Info"> - <arg type="a{ss}" name="info" direction="out"/> - </method> - </interface> -</node> diff --git a/libs/dbus-c++/examples/echo/echo-server.cpp b/libs/dbus-c++/examples/echo/echo-server.cpp deleted file mode 100644 index d69333b56141167eaf2599b346edfe14c70648dc..0000000000000000000000000000000000000000 --- a/libs/dbus-c++/examples/echo/echo-server.cpp +++ /dev/null @@ -1,92 +0,0 @@ -#include "echo-server.h" -#include <unistd.h> -#include <stdlib.h> -#include <signal.h> -#include <stdio.h> -#include <limits.h> - -static const char *ECHO_SERVER_NAME = "org.freedesktop.DBus.Examples.Echo"; -static const char *ECHO_SERVER_PATH = "/org/freedesktop/DBus/Examples/Echo"; - -EchoServer::EchoServer(DBus::Connection &connection) -: DBus::ObjectAdaptor(connection, ECHO_SERVER_PATH) -{ -} - -int32_t EchoServer::Random() -{ - return rand(); -} - -std::string EchoServer::Hello(const std::string &name) -{ - return "Hello " + name + "!"; -} - -DBus::Variant EchoServer::Echo(const DBus::Variant &value) -{ - this->Echoed(value); - - return value; -} - -std::vector< uint8_t > EchoServer::Cat(const std::string &file) -{ - FILE *handle = fopen(file.c_str(), "rb"); - - if (!handle) throw DBus::Error("org.freedesktop.DBus.EchoDemo.ErrorFileNotFound", "file not found"); - - uint8_t buff[1024]; - - size_t nread = fread(buff, 1, sizeof(buff), handle); - - fclose(handle); - - return std::vector< uint8_t > (buff, buff + nread); -} - -int32_t EchoServer::Sum(const std::vector<int32_t>& ints) -{ - int32_t sum = 0; - - for (size_t i = 0; i < ints.size(); ++i) sum += ints[i]; - - return sum; -} - -std::map< std::string, std::string > EchoServer::Info() -{ - std::map< std::string, std::string > info; - char hostname[HOST_NAME_MAX]; - - gethostname(hostname, sizeof(hostname)); - info["hostname"] = hostname; - info["username"] = getlogin(); - - return info; -} - - -DBus::BusDispatcher dispatcher; - -void niam(int sig) -{ - dispatcher.leave(); -} - -int main() -{ - signal(SIGTERM, niam); - signal(SIGINT, niam); - - DBus::default_dispatcher = &dispatcher; - - DBus::Connection conn = DBus::Connection::SessionBus(); - conn.request_name(ECHO_SERVER_NAME); - - EchoServer server(conn); - - dispatcher.enter(); - - return 0; -} diff --git a/libs/dbus-c++/examples/echo/echo-server.h b/libs/dbus-c++/examples/echo/echo-server.h deleted file mode 100644 index 3f0be5811733e4439ff9a80fa762266b1a9df974..0000000000000000000000000000000000000000 --- a/libs/dbus-c++/examples/echo/echo-server.h +++ /dev/null @@ -1,29 +0,0 @@ -#ifndef __DEMO_ECHO_SERVER_H -#define __DEMO_ECHO_SERVER_H - -#include <dbus-c++/dbus.h> -#include "echo-server-glue.h" - -class EchoServer -: public org::freedesktop::DBus::EchoDemo_adaptor, - public DBus::IntrospectableAdaptor, - public DBus::ObjectAdaptor -{ -public: - - EchoServer(DBus::Connection &connection); - - int32_t Random(); - - std::string Hello(const std::string &name); - - DBus::Variant Echo(const DBus::Variant &value); - - std::vector< uint8_t > Cat(const std::string &file); - - int32_t Sum(const std::vector<int32_t> & ints); - - std::map< std::string, std::string > Info(); -}; - -#endif//__DEMO_ECHO_SERVER_H diff --git a/libs/dbus-c++/examples/glib/Makefile.am b/libs/dbus-c++/examples/glib/Makefile.am deleted file mode 100644 index 42a33d8edb4959e50ea54e7edca045f79e5ca783..0000000000000000000000000000000000000000 --- a/libs/dbus-c++/examples/glib/Makefile.am +++ /dev/null @@ -1,22 +0,0 @@ -EXTRA_DIST = - -AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include $(gtkmm_CFLAGS) -I$(top_srcdir)/tools - -if HAVE_GTKMM -noinst_PROGRAMS = dbus-browser -endif - -dbus_browser_SOURCES = dbus-glue.h dbus-browser.h dbus-browser.cpp $(top_srcdir)/tools/xml.cpp -dbus_browser_LDADD = $(top_builddir)/src/libdbus-c++-1.la $(gtkmm_LIBS) - -dbus-glue.h: $(top_srcdir)/data/org.freedesktop.DBus.xml - $(top_builddir)/tools/dbusxx-xml2cpp $^ --proxy=$@ - -BUILT_SOURCES = dbus-glue.h -CLEANFILES = $(BUILT_SOURCES) - -dist-hook: - cd $(distdir); rm -f $(BUILT_SOURCES) - -MAINTAINERCLEANFILES = \ - Makefile.in diff --git a/libs/dbus-c++/examples/glib/dbus-browser.cpp b/libs/dbus-c++/examples/glib/dbus-browser.cpp deleted file mode 100644 index 382d07f17a1dae20f200a445c18ae5e5b687278a..0000000000000000000000000000000000000000 --- a/libs/dbus-c++/examples/glib/dbus-browser.cpp +++ /dev/null @@ -1,136 +0,0 @@ -#include "dbus-browser.h" - -#include <xml.h> -#include <iostream> - -using namespace std; - -static const char *DBUS_SERVER_NAME = "org.freedesktop.DBus"; -static const char *DBUS_SERVER_PATH = "/org/freedesktop/DBus"; - -DBusBrowser::DBusBrowser(::DBus::Connection &conn) -: ::DBus::ObjectProxy(conn, DBUS_SERVER_PATH, DBUS_SERVER_NAME) -{ - set_title("D-Bus Browser"); - set_border_width(5); - set_default_size(400, 500); - - typedef std::vector< std::string > Names; - - Names names = ListNames(); - - for (Names::iterator it = names.begin(); it != names.end(); ++it) - { - _cb_busnames.append_text(*it); - } - - _cb_busnames.signal_changed().connect(sigc::mem_fun(*this, &DBusBrowser::on_select_busname)); - - _tm_inspect = Gtk::TreeStore::create(_records); - _tv_inspect.set_model(_tm_inspect); - _tv_inspect.append_column("Node", _records.name); - - _sc_tree.set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC); - _sc_tree.add(_tv_inspect); - - _vbox.pack_start(_cb_busnames, Gtk::PACK_SHRINK); - _vbox.pack_start(_sc_tree); - - add(_vbox); - - show_all_children(); -} - -void DBusBrowser::NameOwnerChanged( - const std::string &name, const std::string &old_owner, const std::string &new_owner) -{ - cout << name << ": " << old_owner << " -> " << new_owner << endl; -} - -void DBusBrowser::NameLost(const std::string &name) -{ - cout << name << " lost" << endl; -} - -void DBusBrowser::NameAcquired(const std::string &name) -{ - cout << name << " acquired" << endl; -} - -void DBusBrowser::on_select_busname() -{ - Glib::ustring busname = _cb_busnames.get_active_text(); - if (busname.empty()) return; - - _tm_inspect->clear(); - _inspect_append(NULL, "", busname); -} - -void DBusBrowser::_inspect_append(Gtk::TreeModel::Row *row, const std::string &buspath, const std::string &busname) -{ - DBusInspector inspector(conn(), buspath.empty() ? "/" : buspath.c_str(), busname.c_str()); - - ::DBus::Xml::Document doc(inspector.Introspect()); - ::DBus::Xml::Node &root = *(doc.root); - - ::DBus::Xml::Nodes ifaces = root["interface"]; - - for (::DBus::Xml::Nodes::iterator ii = ifaces.begin(); ii != ifaces.end(); ++ii) - { - ::DBus::Xml::Node &iface = **ii; - - Gtk::TreeModel::Row i_row = row - ? *(_tm_inspect->append(row->children())) - : *(_tm_inspect->append()); - i_row[_records.name] = "interface: " + iface.get("name"); - - ::DBus::Xml::Nodes methods = iface["method"]; - - for (::DBus::Xml::Nodes::iterator im = methods.begin(); im != methods.end(); ++im) - { - Gtk::TreeModel::Row m_row = *(_tm_inspect->append(i_row.children())); - m_row[_records.name] = "method: " + (*im)->get("name"); - } - - ::DBus::Xml::Nodes signals = iface["signal"]; - - for (::DBus::Xml::Nodes::iterator is = signals.begin(); is != signals.end(); ++is) - { - Gtk::TreeModel::Row s_row = *(_tm_inspect->append(i_row.children())); - s_row[_records.name] = "signal: " + (*is)->get("name"); - } - } - - ::DBus::Xml::Nodes nodes = root["node"]; - - for (::DBus::Xml::Nodes::iterator in = nodes.begin(); in != nodes.end(); ++in) - { - std::string name = (*in)->get("name"); - - Gtk::TreeModel::Row n_row = row - ? *(_tm_inspect->append(row->children())) - : *(_tm_inspect->append()); - n_row[_records.name] = name; - - _inspect_append(&n_row, buspath + "/" + name, busname); - } -} - -DBus::Glib::BusDispatcher dispatcher; - -int main(int argc, char *argv[]) -{ - Gtk::Main kit(argc, argv); - - DBus::default_dispatcher = &dispatcher; - - dispatcher.attach(NULL); - - DBus::Connection conn = DBus::Connection::SessionBus(); - - DBusBrowser browser(conn); - - Gtk::Main::run(browser); - - return 0; -} diff --git a/libs/dbus-c++/examples/glib/dbus-browser.h b/libs/dbus-c++/examples/glib/dbus-browser.h deleted file mode 100644 index 9bbefbf084d9188376439b36e4294653f7787660..0000000000000000000000000000000000000000 --- a/libs/dbus-c++/examples/glib/dbus-browser.h +++ /dev/null @@ -1,62 +0,0 @@ -#ifndef __DEMO_DBUS_BROWSER_H -#define __DEMO_DBUS_BROWSER_H - -#include <dbus-c++/dbus.h> -#include <dbus-c++/glib-integration.h> -#include <gtkmm.h> - -#include "dbus-glue.h" - -class DBusInspector -: public DBus::IntrospectableProxy, - public DBus::ObjectProxy -{ -public: - - DBusInspector(DBus::Connection &conn, const char *path, const char *service) - : DBus::ObjectProxy(conn, path, service) - {} -}; - -class DBusBrowser -: public org::freedesktop::DBus_proxy, - public DBus::IntrospectableProxy, - public DBus::ObjectProxy, - public Gtk::Window -{ -public: - - DBusBrowser(::DBus::Connection &); - -private: - - void NameOwnerChanged(const std::string &, const std::string &, const std::string &); - - void NameLost(const std::string &); - - void NameAcquired(const std::string &); - - void on_select_busname(); - - void _inspect_append(Gtk::TreeModel::Row *, const std::string &, const std::string &); - -private: - - class InspectRecord : public Gtk::TreeModel::ColumnRecord - { - public: - - InspectRecord() { add(name); } - - Gtk::TreeModelColumn<Glib::ustring> name; - }; - - Gtk::VBox _vbox; - Gtk::ScrolledWindow _sc_tree; - Gtk::ComboBoxText _cb_busnames; - Gtk::TreeView _tv_inspect; - Glib::RefPtr<Gtk::TreeStore> _tm_inspect; - InspectRecord _records; -}; - -#endif//__DEMO_DBUS_BROWSER_H diff --git a/libs/dbus-c++/examples/hal/Makefile.am b/libs/dbus-c++/examples/hal/Makefile.am deleted file mode 100644 index 22868c80fa8c8bb5e5579ce4089c09b8044e401a..0000000000000000000000000000000000000000 --- a/libs/dbus-c++/examples/hal/Makefile.am +++ /dev/null @@ -1,9 +0,0 @@ -AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include - -noinst_PROGRAMS = hal-listen - -hal_listen_SOURCES = hal-listen.h hal-listen.cpp -hal_listen_LDADD = $(top_builddir)/src/libdbus-c++-1.la - -MAINTAINERCLEANFILES = \ - Makefile.in diff --git a/libs/dbus-c++/examples/hal/hal-listen.cpp b/libs/dbus-c++/examples/hal/hal-listen.cpp deleted file mode 100644 index 11e18de300343891da03a76ee71348cc5c29ef5a..0000000000000000000000000000000000000000 --- a/libs/dbus-c++/examples/hal/hal-listen.cpp +++ /dev/null @@ -1,125 +0,0 @@ -#include "hal-listen.h" - -#include <signal.h> -#include <iostream> - -HalManagerProxy::HalManagerProxy(DBus::Connection &connection) -: DBus::InterfaceProxy("org.freedesktop.Hal.Manager"), - DBus::ObjectProxy(connection, "/org/freedesktop/Hal/Manager", "org.freedesktop.Hal") -{ - connect_signal(HalManagerProxy, DeviceAdded, DeviceAddedCb); - connect_signal(HalManagerProxy, DeviceRemoved, DeviceRemovedCb); - - std::vector< std::string > devices = GetAllDevices(); - - std::vector< std::string >::iterator it; - for (it = devices.begin(); it != devices.end(); ++it) - { - DBus::Path udi = *it; - - std::cout << "found device " << udi << std::endl; - - _devices[udi] = new HalDeviceProxy(connection, udi); - } -} - -std::vector< std::string > HalManagerProxy::GetAllDevices() -{ - std::vector< std::string > udis; - DBus::CallMessage call; - - call.member("GetAllDevices"); - - DBus::Message reply = invoke_method(call); - DBus::MessageIter it = reply.reader(); - - it >> udis; - return udis; -} - -void HalManagerProxy::DeviceAddedCb(const DBus::SignalMessage &sig) -{ - DBus::MessageIter it = sig.reader(); - std::string devname; - - it >> devname; - - DBus::Path udi(devname); - - _devices[devname] = new HalDeviceProxy(conn(), udi); - std::cout << "added device " << udi << std::endl; -} - -void HalManagerProxy::DeviceRemovedCb(const DBus::SignalMessage &sig) -{ - DBus::MessageIter it = sig.reader(); - std::string devname; - - it >> devname; - - std::cout << "removed device " << devname << std::endl; - - _devices.erase(devname); -} - -HalDeviceProxy::HalDeviceProxy(DBus::Connection &connection, DBus::Path &udi) -: DBus::InterfaceProxy("org.freedesktop.Hal.Device"), - DBus::ObjectProxy(connection, udi, "org.freedesktop.Hal") -{ - connect_signal(HalDeviceProxy, PropertyModified, PropertyModifiedCb); - connect_signal(HalDeviceProxy, Condition, ConditionCb); -} - -void HalDeviceProxy::PropertyModifiedCb(const DBus::SignalMessage &sig) -{ - typedef DBus::Struct< std::string, bool, bool > HalProperty; - - DBus::MessageIter it = sig.reader(); - int32_t number; - - it >> number; - - DBus::MessageIter arr = it.recurse(); - - for (int i = 0; i < number; ++i, ++arr) - { - HalProperty hp; - - arr >> hp; - - std::cout << "modified property " << hp._1 << " in " << path() << std::endl; - } -} - -void HalDeviceProxy::ConditionCb(const DBus::SignalMessage &sig) -{ - DBus::MessageIter it = sig.reader(); - std::string condition; - - it >> condition; - - std::cout << "encountered condition " << condition << " in " << path() << std::endl; -} - -DBus::BusDispatcher dispatcher; - -void niam(int sig) -{ - dispatcher.leave(); -} - -int main() -{ - signal(SIGTERM, niam); - signal(SIGINT, niam); - - DBus::default_dispatcher = &dispatcher; - - DBus::Connection conn = DBus::Connection::SystemBus(); - - HalManagerProxy hal(conn); - - dispatcher.enter(); - - return 0; -} diff --git a/libs/dbus-c++/examples/hal/hal-listen.h b/libs/dbus-c++/examples/hal/hal-listen.h deleted file mode 100644 index 12862e617e9e97679bbd403cba6f68122004e6c0..0000000000000000000000000000000000000000 --- a/libs/dbus-c++/examples/hal/hal-listen.h +++ /dev/null @@ -1,44 +0,0 @@ -#ifndef __DEMO_HAL_LISTEN_H -#define __DEMO_HAL_LISTEN_H - -#include <dbus-c++/dbus.h> -#include <vector> -#include <map> - -class HalDeviceProxy; - -class HalManagerProxy -: public DBus::InterfaceProxy, - public DBus::ObjectProxy -{ -public: - - HalManagerProxy(DBus::Connection &connection); - - std::vector< std::string > GetAllDevices(); - -private: - - void DeviceAddedCb(const DBus::SignalMessage &sig); - - void DeviceRemovedCb(const DBus::SignalMessage &sig); - - std::map< std::string, DBus::RefPtr< HalDeviceProxy > > _devices; -}; - -class HalDeviceProxy -: public DBus::InterfaceProxy, - public DBus::ObjectProxy -{ -public: - - HalDeviceProxy(DBus::Connection &connection, DBus::Path &udi); - -private: - - void PropertyModifiedCb(const DBus::SignalMessage &sig); - - void ConditionCb(const DBus::SignalMessage &sig); -}; - -#endif//__DEMO_HAL_LISTEN_H diff --git a/libs/dbus-c++/examples/properties/Makefile.am b/libs/dbus-c++/examples/properties/Makefile.am deleted file mode 100644 index a99749a19f191c29b6d6b350e32449b871b5135b..0000000000000000000000000000000000000000 --- a/libs/dbus-c++/examples/properties/Makefile.am +++ /dev/null @@ -1,26 +0,0 @@ -EXTRA_DIST = propsgs-introspect.xml - -AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include - -noinst_PROGRAMS = propsgs-server propsgs-client - -propsgs_server_SOURCES = propsgs-glue-adaptor.h propsgs-server.h propsgs-server.cpp -propsgs_server_LDADD = $(top_builddir)/src/libdbus-c++-1.la - -propsgs_client_SOURCES = propsgs-glue-proxy.h propsgs-client.h propsgs-client.cpp -propsgs_client_LDADD = $(top_builddir)/src/libdbus-c++-1.la -lpthread - -propsgs-glue-adaptor.h: propsgs-introspect.xml - $(top_builddir)/tools/dbusxx-xml2cpp $^ --adaptor=$@ -- - -propsgs-glue-proxy.h: propsgs-introspect.xml - $(top_builddir)/tools/dbusxx-xml2cpp $^ --proxy=$@ -- - -BUILT_SOURCES = propsgs-glue-adaptor.h propsgs-glue-proxy.h -CLEANFILES = $(BUILT_SOURCES) - -dist-hook: - cd $(distdir); rm -f $(BUILT_SOURCES) - -MAINTAINERCLEANFILES = \ - Makefile.in diff --git a/libs/dbus-c++/examples/properties/propsgs-client.cpp b/libs/dbus-c++/examples/properties/propsgs-client.cpp deleted file mode 100644 index d4b51f4bd258afdacd966b613456ad4e8b572599..0000000000000000000000000000000000000000 --- a/libs/dbus-c++/examples/properties/propsgs-client.cpp +++ /dev/null @@ -1,72 +0,0 @@ -#include "propsgs-client.h" -#include <iostream> -#include <signal.h> -#include <pthread.h> - -using namespace org::freedesktop::DBus; - -static const char *PROPS_SERVER_NAME = "org.freedesktop.DBus.Examples.Properties"; -static const char *PROPS_SERVER_PATH = "/org/freedesktop/DBus/Examples/Properties"; - -PropsClient::PropsClient(DBus::Connection &connection, const char *path, const char *name) -: DBus::ObjectProxy(connection, path, name) -{ -} - -void PropsClient::MessageChanged(const std::string& message) -{ - std::cout << "MessageChanged signal, new value: " << message << "\n"; -}; - -void PropsClient::DataChanged(const double& data) -{ - std::cout << "DataChanged signal, new value:" << data << "\n"; -}; - -void *test_property_proxy(void * input) -{ - PropsClient *client = static_cast<PropsClient*>(input); - - std::cout << "read property 'Version', value:" << client->Version() << "\n"; - - std::cout << "read property 'Message', value:" << client->Message() << "\n"; - - client->Message("message set by property access"); - std::cout << "wrote property 'Message'\n"; - - std::cout << "read property 'Message', value:" << client->Message() << "\n"; - - client->Data(1.1); - std::cout << "wrote property 'Data'\n"; - - return NULL; -} - -DBus::BusDispatcher dispatcher; - -void niam(int sig) -{ - dispatcher.leave(); - pthread_exit(NULL); -} - -int main() -{ - signal(SIGTERM, niam); - signal(SIGINT, niam); - - DBus::default_dispatcher = &dispatcher; - - DBus::_init_threading(); - - DBus::Connection conn = DBus::Connection::SessionBus(); - - PropsClient client (conn, PROPS_SERVER_PATH, PROPS_SERVER_NAME); - - pthread_t thread; - pthread_create(&thread, NULL, test_property_proxy, &client); - - dispatcher.enter(); - - return 0; -} diff --git a/libs/dbus-c++/examples/properties/propsgs-client.h b/libs/dbus-c++/examples/properties/propsgs-client.h deleted file mode 100644 index 99b70c500c4f9098c691ba6e11ef58a74349decc..0000000000000000000000000000000000000000 --- a/libs/dbus-c++/examples/properties/propsgs-client.h +++ /dev/null @@ -1,22 +0,0 @@ -#ifndef __DEMO_PROPS_SERVER_H -#define __DEMO_PROPS_SERVER_H - -#include <dbus-c++/dbus.h> -#include "propsgs-glue-proxy.h" - -class PropsClient -: public org::freedesktop::DBus::PropsGSDemo_proxy, - public DBus::IntrospectableProxy, - public DBus::PropertiesProxy, - public DBus::ObjectProxy -{ -public: - - PropsClient(DBus::Connection &connection, const char *path, const char *name); - - void MessageChanged(const std::string& message); - - void DataChanged(const double& data); -}; - -#endif//__DEMO_PROPS_SERVER_H diff --git a/libs/dbus-c++/examples/properties/propsgs-introspect.xml b/libs/dbus-c++/examples/properties/propsgs-introspect.xml deleted file mode 100644 index 10459308fc3b0e5118e09dcefe6d6241eadc4b46..0000000000000000000000000000000000000000 --- a/libs/dbus-c++/examples/properties/propsgs-introspect.xml +++ /dev/null @@ -1,14 +0,0 @@ -<?xml version="1.0" ?> -<node name="/org/freedesktop/DBus/Examples/Properties"> - <interface name="org.freedesktop.DBus.PropsGSDemo"> - <property name="Version" type="i" access="read"/> - <property name="Message" type="s" access="readwrite"/> - <property name="Data" type="d" access="write"/> - <signal name="MessageChanged"> - <arg name="message" type="s"/> - </signal> - <signal name="DataChanged"> - <arg name="Data" type="d"/> - </signal> - </interface> -</node> diff --git a/libs/dbus-c++/examples/properties/propsgs-server.cpp b/libs/dbus-c++/examples/properties/propsgs-server.cpp deleted file mode 100644 index c3ff23f645bc6d986f05ed0d894b3de998596d7f..0000000000000000000000000000000000000000 --- a/libs/dbus-c++/examples/properties/propsgs-server.cpp +++ /dev/null @@ -1,56 +0,0 @@ -#include "propsgs-server.h" -#include <iostream> -#include <signal.h> - -static const char *PROPS_SERVER_NAME = "org.freedesktop.DBus.Examples.Properties"; -static const char *PROPS_SERVER_PATH = "/org/freedesktop/DBus/Examples/Properties"; - -PropsServer::PropsServer(DBus::Connection &connection) -: DBus::ObjectAdaptor(connection, PROPS_SERVER_PATH) -{ - Version = 1; - Message = "default message"; -} - -void PropsServer::on_set_property - (DBus::InterfaceAdaptor &interface, const std::string &property, const DBus::Variant &value) -{ - if (property == "Message") - { - std::cout << "'Message' has been changed\n"; - - std::string msg = value; - this->MessageChanged(msg); - } - if (property == "Data") - { - std::cout << "'Data' has been changed\n"; - - double data = value; - this->DataChanged(data); - } -} - -DBus::BusDispatcher dispatcher; - -void niam(int sig) -{ - dispatcher.leave(); -} - -int main() -{ - signal(SIGTERM, niam); - signal(SIGINT, niam); - - DBus::default_dispatcher = &dispatcher; - - DBus::Connection conn = DBus::Connection::SessionBus(); - conn.request_name(PROPS_SERVER_NAME); - - PropsServer server(conn); - - dispatcher.enter(); - - return 0; -} diff --git a/libs/dbus-c++/examples/properties/propsgs-server.h b/libs/dbus-c++/examples/properties/propsgs-server.h deleted file mode 100644 index a3169d629f9c857bd4a307c3a54e34b3886a8ae6..0000000000000000000000000000000000000000 --- a/libs/dbus-c++/examples/properties/propsgs-server.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef __DEMO_PROPS_SERVER_H -#define __DEMO_PROPS_SERVER_H - -#include <dbus-c++/dbus.h> -#include "propsgs-glue-adaptor.h" - -class PropsServer -: public org::freedesktop::DBus::PropsGSDemo_adaptor, - public DBus::IntrospectableAdaptor, - public DBus::PropertiesAdaptor, - public DBus::ObjectAdaptor -{ -public: - - PropsServer(DBus::Connection &connection); - - void on_set_property - (DBus::InterfaceAdaptor &interface, const std::string &property, const DBus::Variant &value); -}; - -#endif//__DEMO_PROPS_SERVER_H diff --git a/libs/dbus-c++/include/dbus-c++/api.h b/libs/dbus-c++/include/dbus-c++/api.h deleted file mode 100644 index 9afe229bd6f65a2ae695b5a056424a971b2a3a79..0000000000000000000000000000000000000000 --- a/libs/dbus-c++/include/dbus-c++/api.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - * - * D-Bus++ - C++ bindings for D-Bus - * - * Copyright (C) 2005-2007 Paolo Durante <shackan@gmail.com> - * - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - - -#ifndef __DBUSXX_API_H -#define __DBUSXX_API_H - -#ifdef HAVE_CONFIG_H -#include <dbus-c++/config.h> -#endif - -#ifdef GCC_HASCLASSVISIBILITY -# define DXXAPILOCAL __attribute__ ((visibility("hidden"))) -# define DXXAPIPUBLIC __attribute__ ((visibility("default"))) -#else -# define DXXAPILOCAL -# define DXXAPIPUBLIC -#endif - -#define DXXAPI DXXAPIPUBLIC - -#endif//__DBUSXX_API_H diff --git a/libs/dbus-c++/include/dbus-c++/config.h.in b/libs/dbus-c++/include/dbus-c++/config.h.in deleted file mode 100644 index f803e5dde35090e8ba837143213fc255bea902d4..0000000000000000000000000000000000000000 --- a/libs/dbus-c++/include/dbus-c++/config.h.in +++ /dev/null @@ -1,73 +0,0 @@ -/* include/dbus-c++/config.h.in. Generated from configure.ac by autoheader. */ - -/* unstable DBus */ -#undef DBUS_API_SUBJECT_TO_CHANGE - -/* DBus supports recursive mutexes (needs DBus >= 0.95) */ -#undef DBUS_HAS_RECURSIVE_MUTEX - -/* dbus_threads_init_default (needs DBus >= 0.93) */ -#undef DBUS_HAS_THREADS_INIT_DEFAULT - -/* to enable hidden symbols */ -#undef GCC_HASCLASSVISIBILITY - -/* Define to 1 if you have the <dlfcn.h> header file. */ -#undef HAVE_DLFCN_H - -/* Define to 1 if you have the <expat.h> header file. */ -#undef HAVE_EXPAT_H - -/* Define to 1 if you have the <inttypes.h> header file. */ -#undef HAVE_INTTYPES_H - -/* Define to 1 if you have the <memory.h> header file. */ -#undef HAVE_MEMORY_H - -/* Define to 1 if you have the <pthread.h> header file. */ -#undef HAVE_PTHREAD_H - -/* Define to 1 if you have the <stdint.h> header file. */ -#undef HAVE_STDINT_H - -/* Define to 1 if you have the <stdlib.h> header file. */ -#undef HAVE_STDLIB_H - -/* Define to 1 if you have the <strings.h> header file. */ -#undef HAVE_STRINGS_H - -/* Define to 1 if you have the <string.h> header file. */ -#undef HAVE_STRING_H - -/* Define to 1 if you have the <sys/stat.h> header file. */ -#undef HAVE_SYS_STAT_H - -/* Define to 1 if you have the <sys/types.h> header file. */ -#undef HAVE_SYS_TYPES_H - -/* Define to 1 if you have the <unistd.h> header file. */ -#undef HAVE_UNISTD_H - -/* Name of package */ -#undef PACKAGE - -/* Define to the address where bug reports for this package should be sent. */ -#undef PACKAGE_BUGREPORT - -/* Define to the full name of this package. */ -#undef PACKAGE_NAME - -/* Define to the full name and version of this package. */ -#undef PACKAGE_STRING - -/* Define to the one symbol short name of this package. */ -#undef PACKAGE_TARNAME - -/* Define to the version of this package. */ -#undef PACKAGE_VERSION - -/* Define to 1 if you have the ANSI C header files. */ -#undef STDC_HEADERS - -/* Version number of package */ -#undef VERSION diff --git a/libs/dbus-c++/include/dbus-c++/connection.h b/libs/dbus-c++/include/dbus-c++/connection.h deleted file mode 100644 index c2bc4ede396b67b65b6e7393781ba837ff20d691..0000000000000000000000000000000000000000 --- a/libs/dbus-c++/include/dbus-c++/connection.h +++ /dev/null @@ -1,126 +0,0 @@ -/* - * - * D-Bus++ - C++ bindings for D-Bus - * - * Copyright (C) 2005-2007 Paolo Durante <shackan@gmail.com> - * - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - - -#ifndef __DBUSXX_CONNECTION_H -#define __DBUSXX_CONNECTION_H - -#ifdef HAVE_CONFIG_H -#include <dbus-c++/config.h> -#endif - -#include <list> - -#include "api.h" -#include "types.h" -#include "util.h" -#include "message.h" -#include "pendingcall.h" - -namespace DBus { - -class Connection; - -typedef Slot<bool, const Message &> MessageSlot; - -typedef std::list<Connection> ConnectionList; - -class ObjectAdaptor; -class Dispatcher; - -class DXXAPI Connection -{ -public: - - static Connection SystemBus(); - - static Connection SessionBus(); - - static Connection ActivationBus(); - - struct Private; - - typedef std::list<Private *> PrivatePList; - - Connection(Private *); - - Connection(const char *address, bool priv = true); - - Connection(const Connection &c); - - virtual ~Connection(); - - Dispatcher *setup(Dispatcher *); - - bool operator == (const Connection &) const; - - void add_match(const char *rule); - - void remove_match(const char *rule); - - bool add_filter(MessageSlot &); - - void remove_filter(MessageSlot &); - - bool unique_name(const char *n); - - const char *unique_name() const; - - bool register_bus(); - - bool connected() const; - - void disconnect(); - - void exit_on_disconnect(bool exit); - - void flush(); - - bool send(const Message &, unsigned int *serial = NULL); - - Message send_blocking(Message &msg, int timeout = -1); - - PendingCall send_async(Message &msg, int timeout); - - void request_name(const char *name, int flags = 0); - - bool has_name(const char *name); - - bool start_service(const char *name, unsigned long flags); - - const std::vector<std::string>& names(); - -private: - - DXXAPILOCAL void init(); - -private: - - RefPtrI<Private> _pvt; - -friend class ObjectAdaptor; // needed in order to register object paths for a connection -}; - -} /* namespace DBus */ - -#endif//__DBUSXX_CONNECTION_H diff --git a/libs/dbus-c++/include/dbus-c++/dbus.h b/libs/dbus-c++/include/dbus-c++/dbus.h deleted file mode 100644 index 0e05e6a57fa109ec2eccdb741131a48f29d2d1cd..0000000000000000000000000000000000000000 --- a/libs/dbus-c++/include/dbus-c++/dbus.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - * - * D-Bus++ - C++ bindings for D-Bus - * - * Copyright (C) 2005-2007 Paolo Durante <shackan@gmail.com> - * - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - - -#ifndef __DBUSXX_DBUS_H -#define __DBUSXX_DBUS_H - -#ifdef HAVE_CONFIG_H -#include <dbus-c++/config.h> -#endif - -#include "types.h" -#include "interface.h" -#include "object.h" -#include "property.h" -#include "connection.h" -#include "server.h" -#include "error.h" -#include "message.h" -#include "debug.h" -#include "pendingcall.h" -#include "server.h" -#include "util.h" -#include "dispatcher.h" -#include "eventloop.h" -#include "eventloop-integration.h" -#include "introspection.h" - -#endif//__DBUSXX_DBUS_H diff --git a/libs/dbus-c++/include/dbus-c++/debug.h b/libs/dbus-c++/include/dbus-c++/debug.h deleted file mode 100644 index 6b871f612869e4084fa68406ea07f5f9bbd338e0..0000000000000000000000000000000000000000 --- a/libs/dbus-c++/include/dbus-c++/debug.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - * - * D-Bus++ - C++ bindings for D-Bus - * - * Copyright (C) 2005-2007 Paolo Durante <shackan@gmail.com> - * - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - - -#ifndef __DBUSXX_DEBUG_H -#define __DBUSXX_DEBUG_H - -#ifdef HAVE_CONFIG_H -#include <dbus-c++/config.h> -#endif - -#include "api.h" - -namespace DBus { - -typedef void (*LogFunction)(const char *format, ...); - -extern DXXAPI LogFunction debug_log; - -} /* namespace DBus */ - -#endif diff --git a/libs/dbus-c++/include/dbus-c++/dispatcher.h b/libs/dbus-c++/include/dbus-c++/dispatcher.h deleted file mode 100644 index c6f4d125de3381dad3852cad405d1d1171d89024..0000000000000000000000000000000000000000 --- a/libs/dbus-c++/include/dbus-c++/dispatcher.h +++ /dev/null @@ -1,260 +0,0 @@ -/* - * - * D-Bus++ - C++ bindings for D-Bus - * - * Copyright (C) 2005-2007 Paolo Durante <shackan@gmail.com> - * - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - - -#ifndef __DBUSXX_DISPATCHER_H -#define __DBUSXX_DISPATCHER_H - -#ifdef HAVE_CONFIG_H -#include <dbus-c++/config.h> -#endif - -#include "api.h" -#include "connection.h" -#include "eventloop.h" - -namespace DBus { - -class DXXAPI Timeout -{ -public: - - class Internal; - - Timeout(Internal *i); - - virtual ~Timeout(){} - - int interval() const; - - bool enabled() const; - - bool handle(); - - virtual void toggle() = 0; - -private: - - DXXAPILOCAL Timeout(const Timeout &); - -private: - - Internal *_int; -}; - -class DXXAPI Watch -{ -public: - - class Internal; - - Watch(Internal *i); - - virtual ~Watch(){} - - int descriptor() const; - - int flags() const; - - bool enabled() const; - - bool handle(int flags); - - virtual void toggle() = 0; - -private: - - DXXAPILOCAL Watch(const Watch &); - -private: - - Internal *_int; -}; - -class DXXAPI Dispatcher -{ -public: - - virtual ~Dispatcher() - {} - - void queue_connection(Connection::Private *); - - void dispatch_pending(); - - virtual void enter() = 0; - - virtual void leave() = 0; - - virtual Timeout *add_timeout(Timeout::Internal *) = 0; - - virtual void rem_timeout(Timeout *) = 0; - - virtual Watch *add_watch(Watch::Internal *) = 0; - - virtual void rem_watch(Watch *) = 0; - - struct Private; - -private: - - DefaultMutex _mutex_p; - Connection::PrivatePList _pending_queue; -}; - -extern DXXAPI Dispatcher *default_dispatcher; - -/* classes for multithreading support -*/ - -class DXXAPI Mutex -{ -public: - - virtual ~Mutex() {} - - virtual void lock() = 0; - - virtual void unlock() = 0; - - struct Internal; - -protected: - - Internal *_int; -}; - -class DXXAPI CondVar -{ -public: - - virtual ~CondVar() {} - - virtual void wait(Mutex *) = 0; - - virtual bool wait_timeout(Mutex *, int timeout) = 0; - - virtual void wake_one() = 0; - - virtual void wake_all() = 0; - - struct Internal; - -protected: - - Internal *_int; -}; - -#ifndef DBUS_HAS_RECURSIVE_MUTEX -typedef Mutex *(*MutexNewFn)(); -typedef bool (*MutexFreeFn)(Mutex *mx); -typedef bool (*MutexLockFn)(Mutex *mx); -typedef void (*MutexUnlockFn)(Mutex *mx); -#else -typedef Mutex *(*MutexNewFn)(); -typedef void (*MutexFreeFn)(Mutex *mx); -typedef void (*MutexLockFn)(Mutex *mx); -typedef void (*MutexUnlockFn)(Mutex *mx); -#endif//DBUS_HAS_RECURSIVE_MUTEX - -typedef CondVar *(*CondVarNewFn)(); -typedef void (*CondVarFreeFn)(CondVar *cv); -typedef void (*CondVarWaitFn)(CondVar *cv, Mutex *mx); -typedef bool (*CondVarWaitTimeoutFn)(CondVar *cv, Mutex *mx, int timeout); -typedef void (*CondVarWakeOneFn)(CondVar *cv); -typedef void (*CondVarWakeAllFn)(CondVar *cv); - -#ifdef DBUS_HAS_THREADS_INIT_DEFAULT -void DXXAPI _init_threading(); -#endif//DBUS_HAS_THREADS_INIT_DEFAULT - -void DXXAPI _init_threading( - MutexNewFn, MutexFreeFn, MutexLockFn, MutexUnlockFn, - CondVarNewFn, CondVarFreeFn, CondVarWaitFn, CondVarWaitTimeoutFn, CondVarWakeOneFn, CondVarWakeAllFn -); - -template<class Mx, class Cv> -struct Threading -{ - static void init() - { - _init_threading( - mutex_new, mutex_free, mutex_lock, mutex_unlock, - condvar_new, condvar_free, condvar_wait, condvar_wait_timeout, condvar_wake_one, condvar_wake_all - ); - } - - static Mutex *mutex_new() - { - return new Mx; - } - - static void mutex_free(Mutex *mx) - { - delete mx; - } - - static void mutex_lock(Mutex *mx) - { - mx->lock(); - } - - static void mutex_unlock(Mutex *mx) - { - mx->unlock(); - } - - static CondVar *condvar_new() - { - return new Cv; - } - - static void condvar_free(CondVar *cv) - { - delete cv; - } - - static void condvar_wait(CondVar *cv, Mutex *mx) - { - cv->wait(mx); - } - - static bool condvar_wait_timeout(CondVar *cv, Mutex *mx, int timeout) - { - return cv->wait_timeout(mx, timeout); - } - - static void condvar_wake_one(CondVar *cv) - { - cv->wake_one(); - } - - static void condvar_wake_all(CondVar *cv) - { - cv->wake_all(); - } -}; - -} /* namespace DBus */ - -#endif//__DBUSXX_DISPATCHER_H diff --git a/libs/dbus-c++/include/dbus-c++/error.h b/libs/dbus-c++/include/dbus-c++/error.h deleted file mode 100644 index 9339e5ef06be08724a4d205f6290e7de933a5ea0..0000000000000000000000000000000000000000 --- a/libs/dbus-c++/include/dbus-c++/error.h +++ /dev/null @@ -1,289 +0,0 @@ -/* - * - * D-Bus++ - C++ bindings for D-Bus - * - * Copyright (C) 2005-2007 Paolo Durante <shackan@gmail.com> - * - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - - -#ifndef __DBUSXX_ERROR_H -#define __DBUSXX_ERROR_H - -#ifdef HAVE_CONFIG_H -#include <dbus-c++/config.h> -#endif - -#include "api.h" -#include "util.h" - -#include <exception> - -namespace DBus { - -class Message; -class InternalError; - -class DXXAPI Error : public std::exception -{ -public: - - Error(); - - Error(InternalError &); - - Error(const char *name, const char *message); - - Error(Message &); - - ~Error() throw(); - - const char *what() const throw(); - - const char *name() const; - - const char *message() const; - - void set(const char *name, const char *message); - // parameters MUST be static strings - - bool is_set() const; - - operator bool() const - { - return is_set(); - } - -private: - - RefPtrI<InternalError> _int; -}; - -struct DXXAPI ErrorFailed : public Error -{ - ErrorFailed(const char *message) - : Error("org.freedesktop.DBus.Error.Failed", message) - {} -}; - -struct DXXAPI ErrorNoMemory : public Error -{ - ErrorNoMemory(const char *message) - : Error("org.freedesktop.DBus.Error.NoMemory", message) - {} -}; - -struct DXXAPI ErrorServiceUnknown : public Error -{ - ErrorServiceUnknown(const char *message) - : Error("org.freedesktop.DBus.Error.ServiceUnknown", message) - {} -}; - -struct DXXAPI ErrorNameHasNoOwner : public Error -{ - ErrorNameHasNoOwner(const char *message) - : Error("org.freedesktop.DBus.Error.NameHasNoOwner", message) - {} -}; - -struct DXXAPI ErrorNoReply : public Error -{ - ErrorNoReply(const char *message) - : Error("org.freedesktop.DBus.Error.NoReply", message) - {} -}; - -struct DXXAPI ErrorIOError : public Error -{ - ErrorIOError(const char *message) - : Error("org.freedesktop.DBus.Error.IOError", message) - {} -}; - -struct DXXAPI ErrorBadAddress : public Error -{ - ErrorBadAddress(const char *message) - : Error("org.freedesktop.DBus.Error.BadAddress", message) - {} -}; - -struct DXXAPI ErrorNotSupported : public Error -{ - ErrorNotSupported(const char *message) - : Error("org.freedesktop.DBus.Error.NotSupported", message) - {} -}; - -struct DXXAPI ErrorLimitsExceeded : public Error -{ - ErrorLimitsExceeded(const char *message) - : Error("org.freedesktop.DBus.Error.LimitsExceeded", message) - {} -}; - -struct DXXAPI ErrorAccessDenied : public Error -{ - ErrorAccessDenied(const char *message) - : Error("org.freedesktop.DBus.Error.AccessDenied", message) - {} -}; - -struct DXXAPI ErrorAuthFailed : public Error -{ - ErrorAuthFailed(const char *message) - : Error("org.freedesktop.DBus.Error.AuthFailed", message) - {} -}; - -struct DXXAPI ErrorNoServer : public Error -{ - ErrorNoServer(const char *message) - : Error("org.freedesktop.DBus.Error.NoServer", message) - {} -}; - -struct DXXAPI ErrorTimeout : public Error -{ - ErrorTimeout(const char *message) - : Error("org.freedesktop.DBus.Error.Timeout", message) - {} -}; - -struct DXXAPI ErrorNoNetwork : public Error -{ - ErrorNoNetwork(const char *message) - : Error("org.freedesktop.DBus.Error.NoNetwork", message) - {} -}; - -struct DXXAPI ErrorAddressInUse : public Error -{ - ErrorAddressInUse(const char *message) - : Error("org.freedesktop.DBus.Error.AddressInUse", message) - {} -}; - -struct DXXAPI ErrorDisconnected : public Error -{ - ErrorDisconnected(const char *message) - : Error("org.freedesktop.DBus.Error.Disconnected", message) - {} -}; - -struct DXXAPI ErrorInvalidArgs : public Error -{ - ErrorInvalidArgs(const char *message) - : Error("org.freedesktop.DBus.Error.InvalidArgs", message) - {} -}; - -struct DXXAPI ErrorFileNotFound : public Error -{ - ErrorFileNotFound(const char *message) - : Error("org.freedesktop.DBus.Error.FileNotFound", message) - {} -}; - -struct DXXAPI ErrorUnknownMethod : public Error -{ - ErrorUnknownMethod(const char *message) - : Error("org.freedesktop.DBus.Error.UnknownMethod", message) - {} -}; - -struct DXXAPI ErrorTimedOut : public Error -{ - ErrorTimedOut(const char *message) - : Error("org.freedesktop.DBus.Error.TimedOut", message) - {} -}; - -struct DXXAPI ErrorMatchRuleNotFound : public Error -{ - ErrorMatchRuleNotFound(const char *message) - : Error("org.freedesktop.DBus.Error.MatchRuleNotFound", message) - {} -}; - -struct DXXAPI ErrorMatchRuleInvalid : public Error -{ - ErrorMatchRuleInvalid(const char *message) - : Error("org.freedesktop.DBus.Error.MatchRuleInvalid", message) - {} -}; - -struct DXXAPI ErrorSpawnExecFailed : public Error -{ - ErrorSpawnExecFailed(const char *message) - : Error("org.freedesktop.DBus.Error.Spawn.ExecFailed", message) - {} -}; - -struct DXXAPI ErrorSpawnForkFailed : public Error -{ - ErrorSpawnForkFailed(const char *message) - : Error("org.freedesktop.DBus.Error.Spawn.ForkFailed", message) - {} -}; - -struct DXXAPI ErrorSpawnChildExited : public Error -{ - ErrorSpawnChildExited(const char *message) - : Error("org.freedesktop.DBus.Error.Spawn.ChildExited", message) - {} -}; - -struct DXXAPI ErrorSpawnChildSignaled : public Error -{ - ErrorSpawnChildSignaled(const char *message) - : Error("org.freedesktop.DBus.Error.Spawn.ChildSignaled", message) - {} -}; - -struct DXXAPI ErrorSpawnFailed : public Error -{ - ErrorSpawnFailed(const char *message) - : Error("org.freedesktop.DBus.Error.Spawn.Failed", message) - {} -}; - -struct DXXAPI ErrorInvalidSignature : public Error -{ - ErrorInvalidSignature(const char *message) - : Error("org.freedesktop.DBus.Error.InvalidSignature", message) - {} -}; - -struct DXXAPI ErrorUnixProcessIdUnknown : public Error -{ - ErrorUnixProcessIdUnknown(const char *message) - : Error("org.freedesktop.DBus.Error.UnixProcessIdUnknown", message) - {} -}; - -struct DXXAPI ErrorSELinuxSecurityContextUnknown : public Error -{ - ErrorSELinuxSecurityContextUnknown(const char *message) - : Error("org.freedesktop.DBus.Error.SELinuxSecurityContextUnknown", message) - {} -}; - -} /* namespace DBus */ - -#endif//__DBUSXX_ERROR_H diff --git a/libs/dbus-c++/include/dbus-c++/eventloop-integration.h b/libs/dbus-c++/include/dbus-c++/eventloop-integration.h deleted file mode 100644 index 4a5289e59a376070ba0d7492d8f1170b9d1b0f29..0000000000000000000000000000000000000000 --- a/libs/dbus-c++/include/dbus-c++/eventloop-integration.h +++ /dev/null @@ -1,98 +0,0 @@ -/* - * - * D-Bus++ - C++ bindings for D-Bus - * - * Copyright (C) 2005-2007 Paolo Durante <shackan@gmail.com> - * - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - - -#ifndef __DBUSXX_EVENTLOOP_INTEGRATION_H -#define __DBUSXX_EVENTLOOP_INTEGRATION_H - -#ifdef HAVE_CONFIG_H -#include <dbus-c++/config.h> -#endif - -#include "api.h" -#include "dispatcher.h" -#include "util.h" -#include "eventloop.h" - -namespace DBus { - -/* - * Glue between the event loop and the DBus library - */ - -class BusDispatcher; - -class DXXAPI BusTimeout : public Timeout, public DefaultTimeout -{ - BusTimeout(Timeout::Internal *, BusDispatcher *); - - void toggle(); - -friend class BusDispatcher; -}; - -class DXXAPI BusWatch : public Watch, public DefaultWatch -{ - BusWatch(Watch::Internal *, BusDispatcher *); - - void toggle(); - -friend class BusDispatcher; -}; - -class DXXAPI BusDispatcher : public Dispatcher, public DefaultMainLoop -{ -public: - - BusDispatcher() : _running(false) - {} - - ~BusDispatcher() - {} - - virtual void enter(); - - virtual void leave(); - - virtual void do_iteration(); - - virtual Timeout *add_timeout(Timeout::Internal *); - - virtual void rem_timeout(Timeout *); - - virtual Watch *add_watch(Watch::Internal *); - - virtual void rem_watch(Watch *); - - void watch_ready(DefaultWatch &); - - void timeout_expired(DefaultTimeout &); - -private: - - bool _running; -}; - -} /* namespace DBus */ - -#endif//__DBUSXX_EVENTLOOP_INTEGRATION_H diff --git a/libs/dbus-c++/include/dbus-c++/eventloop.h b/libs/dbus-c++/include/dbus-c++/eventloop.h deleted file mode 100644 index 42d66b16c8e8b9f704beaa0e30d9e350f8b284ab..0000000000000000000000000000000000000000 --- a/libs/dbus-c++/include/dbus-c++/eventloop.h +++ /dev/null @@ -1,170 +0,0 @@ -/* - * - * D-Bus++ - C++ bindings for D-Bus - * - * Copyright (C) 2005-2007 Paolo Durante <shackan@gmail.com> - * - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - - -#ifndef __DBUSXX_EVENTLOOP_H -#define __DBUSXX_EVENTLOOP_H - -#ifdef HAVE_CONFIG_H -#include <dbus-c++/config.h> -#endif - -#include <pthread.h> -#include <list> - -#include "api.h" -#include "util.h" - -namespace DBus { - -/* - * these Default *classes implement a very simple event loop which - * is used here as the default main loop, if you want to hook - * a different one use the Bus *classes in eventloop-integration.h - * or the Glib::Bus *classes as a reference - */ - -class DefaultMainLoop; - -class DXXAPI DefaultTimeout -{ -public: - - DefaultTimeout(int interval, bool repeat, DefaultMainLoop *); - - virtual ~DefaultTimeout(); - - bool enabled(){ return _enabled; } - void enabled(bool e){ _enabled = e; } - - int interval(){ return _interval; } - void interval(int i){ _interval = i; } - - bool repeat(){ return _repeat; } - void repeat(bool r){ _repeat = r; } - - void *data(){ return _data; } - void data(void *d){ _data = d; } - - Slot<void, DefaultTimeout &> expired; - -private: - - bool _enabled; - - int _interval; - bool _repeat; - - double _expiration; - - void *_data; - - DefaultMainLoop *_disp; - -friend class DefaultMainLoop; -}; - -typedef std::list< DefaultTimeout *> DefaultTimeouts; - -class DXXAPI DefaultWatch -{ -public: - - DefaultWatch(int fd, int flags, DefaultMainLoop *); - - virtual ~DefaultWatch(); - - bool enabled(){ return _enabled; } - void enabled(bool e){ _enabled = e; } - - int descriptor(){ return _fd; } - - int flags(){ return _flags; } - void flags(int f){ _flags = f; } - - int state(){ return _state; } - - void *data(){ return _data; } - void data(void *d){ _data = d; } - - Slot<void, DefaultWatch &> ready; - -private: - - bool _enabled; - - int _fd; - int _flags; - int _state; - - void *_data; - - DefaultMainLoop *_disp; - -friend class DefaultMainLoop; -}; - -typedef std::list< DefaultWatch *> DefaultWatches; - -class DXXAPI DefaultMutex -{ -public: - - DefaultMutex(); - - ~DefaultMutex(); - - void lock(); - - void unlock(); - -private: - - pthread_mutex_t _mutex; -}; - -class DXXAPI DefaultMainLoop -{ -public: - - DefaultMainLoop(); - - virtual ~DefaultMainLoop(); - - virtual void dispatch(); - -private: - - DefaultMutex _mutex_t; - DefaultTimeouts _timeouts; - - DefaultMutex _mutex_w; - DefaultWatches _watches; - -friend class DefaultTimeout; -friend class DefaultWatch; -}; - -} /* namespace DBus */ - -#endif//__DBUSXX_EVENTLOOP_H diff --git a/libs/dbus-c++/include/dbus-c++/glib-integration.h b/libs/dbus-c++/include/dbus-c++/glib-integration.h deleted file mode 100644 index 82f8178a991bea95dff0ffda19d3475603f6d567..0000000000000000000000000000000000000000 --- a/libs/dbus-c++/include/dbus-c++/glib-integration.h +++ /dev/null @@ -1,125 +0,0 @@ -/* - * - * D-Bus++ - C++ bindings for D-Bus - * - * Copyright (C) 2005-2007 Paolo Durante <shackan@gmail.com> - * - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - - -#ifndef __DBUSXX_GLIB_INTEGRATION_H -#define __DBUSXX_GLIB_INTEGRATION_H - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include <glib.h> - -#include "api.h" -#include "dispatcher.h" - -namespace DBus { - -namespace Glib { - -class BusDispatcher; - -class DXXAPI BusTimeout : public Timeout -{ -private: - - BusTimeout(Timeout::Internal *, GMainContext *, int); - - ~BusTimeout(); - - void toggle(); - - static gboolean timeout_handler(gpointer); - - void _enable(); - - void _disable(); - -private: - - GSource *_source; - GMainContext *_ctx; - int _priority; - -friend class BusDispatcher; -}; - -class DXXAPI BusWatch : public Watch -{ -private: - - BusWatch(Watch::Internal *, GMainContext *, int); - - ~BusWatch(); - - void toggle(); - - static gboolean watch_handler(gpointer); - - void _enable(); - - void _disable(); - -private: - - GSource *_source; - GMainContext *_ctx; - int _priority; - -friend class BusDispatcher; -}; - -class DXXAPI BusDispatcher : public Dispatcher -{ -public: - - BusDispatcher() : _ctx(NULL), _priority(G_PRIORITY_DEFAULT) {} - - void attach(GMainContext *); - - void enter() {} - - void leave() {} - - Timeout *add_timeout(Timeout::Internal *); - - void rem_timeout(Timeout *); - - Watch *add_watch(Watch::Internal *); - - void rem_watch(Watch *); - - void set_priority(int priority); - -private: - - GMainContext *_ctx; - int _priority; -}; - -} /* namespace Glib */ - -} /* namespace DBus */ - -#endif//__DBUSXX_GLIB_INTEGRATION_H diff --git a/libs/dbus-c++/include/dbus-c++/interface.h b/libs/dbus-c++/include/dbus-c++/interface.h deleted file mode 100644 index 00da7c2a909dbba05832d37a81a1dcb9dfb25055..0000000000000000000000000000000000000000 --- a/libs/dbus-c++/include/dbus-c++/interface.h +++ /dev/null @@ -1,195 +0,0 @@ -/* - * - * D-Bus++ - C++ bindings for D-Bus - * - * Copyright (C) 2005-2007 Paolo Durante <shackan@gmail.com> - * - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - - -#ifndef __DBUSXX_INTERFACE_H -#define __DBUSXX_INTERFACE_H - -#ifdef HAVE_CONFIG_H -#include <dbus-c++/config.h> -#endif - -#include <string> -#include <map> -#include "api.h" -#include "util.h" -#include "types.h" - -#include "message.h" - -namespace DBus { - -//todo: this should belong to to properties.h -struct DXXAPI PropertyData -{ - bool read; - bool write; - std::string sig; - Variant value; -}; - -typedef std::map<std::string, PropertyData> PropertyTable; - -class IntrospectedInterface; - -class ObjectAdaptor; -class InterfaceAdaptor; -class SignalMessage; - -typedef std::map<std::string, InterfaceAdaptor *> InterfaceAdaptorTable; - -class DXXAPI AdaptorBase -{ -public: - - virtual const ObjectAdaptor *object() const = 0 ; - -protected: - - InterfaceAdaptor *find_interface(const std::string &name); - - virtual ~AdaptorBase() - {} - - virtual void _emit_signal(SignalMessage &) = 0; - - InterfaceAdaptorTable _interfaces; -}; - -/* -*/ - -class ObjectProxy; -class InterfaceProxy; -class CallMessage; - -typedef std::map<std::string, InterfaceProxy *> InterfaceProxyTable; - -class DXXAPI ProxyBase -{ -public: - - virtual const ObjectProxy *object() const = 0 ; - -protected: - - InterfaceProxy *find_interface(const std::string &name); - - virtual ~ProxyBase() - {} - - virtual Message _invoke_method(CallMessage &) = 0; - - InterfaceProxyTable _interfaces; -}; - -class DXXAPI Interface -{ -public: - - Interface(const std::string &name); - - virtual ~Interface(); - - inline const std::string &name() const; - -private: - - std::string _name; -}; - -/* -*/ - -const std::string &Interface::name() const -{ - return _name; -} - -/* -*/ - -typedef std::map< std::string, Slot<Message, const CallMessage &> > MethodTable; - -class DXXAPI InterfaceAdaptor : public Interface, public virtual AdaptorBase -{ -public: - - InterfaceAdaptor(const std::string &name); - - Message dispatch_method(const CallMessage &); - - void emit_signal(const SignalMessage &); - - Variant *get_property(const std::string &name); - - void set_property(const std::string &name, Variant &value); - - virtual IntrospectedInterface *const introspect() const - { - return NULL; - } - -protected: - - MethodTable _methods; - PropertyTable _properties; -}; - -/* -*/ - -typedef std::map< std::string, Slot<void, const SignalMessage &> > SignalTable; - -class DXXAPI InterfaceProxy : public Interface, public virtual ProxyBase -{ -public: - - InterfaceProxy(const std::string &name); - - Message invoke_method(const CallMessage &); - - bool dispatch_signal(const SignalMessage &); - -protected: - - SignalTable _signals; -}; - -# define register_method(interface, method, callback) \ - InterfaceAdaptor::_methods[ #method ] = \ - new ::DBus::Callback< interface, ::DBus::Message, const ::DBus::CallMessage &>(this, & interface :: callback); - -# define bind_property(variable, type, can_read, can_write) \ - InterfaceAdaptor::_properties[ #variable ].read = can_read; \ - InterfaceAdaptor::_properties[ #variable ].write = can_write; \ - InterfaceAdaptor::_properties[ #variable ].sig = type; \ - variable.bind(InterfaceAdaptor::_properties[ #variable ]); - -# define connect_signal(interface, signal, callback) \ - InterfaceProxy::_signals[ #signal ] = \ - new ::DBus::Callback< interface, void, const ::DBus::SignalMessage &>(this, & interface :: callback); - -} /* namespace DBus */ - -#endif//__DBUSXX_INTERFACE_H diff --git a/libs/dbus-c++/include/dbus-c++/introspection.h b/libs/dbus-c++/include/dbus-c++/introspection.h deleted file mode 100644 index 8bb4ee9892af50ce6c3bfd7cef8aad7d1021b3f5..0000000000000000000000000000000000000000 --- a/libs/dbus-c++/include/dbus-c++/introspection.h +++ /dev/null @@ -1,90 +0,0 @@ -/* - * - * D-Bus++ - C++ bindings for D-Bus - * - * Copyright (C) 2005-2007 Paolo Durante <shackan@gmail.com> - * - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - - -#ifndef __DBUSXX_INTROSPECTION_H -#define __DBUSXX_INTROSPECTION_H - -#ifdef HAVE_CONFIG_H -#include <dbus-c++/config.h> -#endif - -#include "api.h" -#include "interface.h" - -namespace DBus { - -struct DXXAPI IntrospectedArgument -{ - const char *name; - const char *type; - const bool in; -}; - -struct DXXAPI IntrospectedMethod -{ - const char *name; - const IntrospectedArgument *args; -}; - -struct DXXAPI IntrospectedProperty -{ - const char *name; - const char *type; - const bool read; - const bool write; -}; - -struct DXXAPI IntrospectedInterface -{ - const char *name; - const IntrospectedMethod *methods; - const IntrospectedMethod *signals; - const IntrospectedProperty *properties; -}; - -class DXXAPI IntrospectableAdaptor : public InterfaceAdaptor -{ -public: - - IntrospectableAdaptor(); - - Message Introspect(const CallMessage &); - -protected: - - IntrospectedInterface *const introspect() const; -}; - -class DXXAPI IntrospectableProxy : public InterfaceProxy -{ -public: - - IntrospectableProxy(); - - std::string Introspect(); -}; - -} /* namespace DBus */ - -#endif//__DBUSXX_INTROSPECTION_H diff --git a/libs/dbus-c++/include/dbus-c++/message.h b/libs/dbus-c++/include/dbus-c++/message.h deleted file mode 100644 index 3b27fdd425a9c4725f9a683d2941321de70f7777..0000000000000000000000000000000000000000 --- a/libs/dbus-c++/include/dbus-c++/message.h +++ /dev/null @@ -1,312 +0,0 @@ -/* - * - * D-Bus++ - C++ bindings for D-Bus - * - * Copyright (C) 2005-2007 Paolo Durante <shackan@gmail.com> - * - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - - -#ifndef __DBUSXX_MESSAGE_H -#define __DBUSXX_MESSAGE_H - -#ifdef HAVE_CONFIG_H -#include <dbus-c++/config.h> -#endif - -#include <string> -#include <map> - -#include "api.h" -#include "util.h" - -namespace DBus { - -class Message; -class ErrorMessage; -class SignalMessage; -class ReturnMessage; -class Error; -class Connection; - -class DXXAPI MessageIter -{ -public: - - MessageIter() {} - - int type(); - - bool at_end(); - - bool has_next(); - - MessageIter &operator ++(); - - MessageIter operator ++(int); - - bool append_byte(unsigned char byte); - - unsigned char get_byte(); - - bool append_bool(bool b); - - bool get_bool(); - - bool append_int16(signed short i); - - signed short get_int16(); - - bool append_uint16(unsigned short u); - - unsigned short get_uint16(); - - bool append_int32(signed int i); - - signed int get_int32(); - - bool append_uint32(unsigned int u); - - unsigned int get_uint32(); - - bool append_int64(signed long long i); - - signed long long get_int64(); - - bool append_uint64(unsigned long long i); - - unsigned long long get_uint64(); - - bool append_double(double d); - - double get_double(); - - bool append_string(const char *chars); - - const char *get_string(); - - bool append_path(const char *chars); - - const char *get_path(); - - bool append_signature(const char *chars); - - const char *get_signature(); - - char *signature() const; //returned string must be manually free()'d - - MessageIter recurse(); - - bool append_array(char type, const void *ptr, size_t length); - - int array_type(); - - int get_array(void *ptr); - - bool is_array(); - - bool is_dict(); - - MessageIter new_array(const char *sig); - - MessageIter new_variant(const char *sig); - - MessageIter new_struct(); - - MessageIter new_dict_entry(); - - void close_container(MessageIter &container); - - void copy_data(MessageIter &to); - - Message &msg() const - { - return *_msg; - } - -private: - - DXXAPILOCAL MessageIter(Message &msg) : _msg(&msg) {} - - DXXAPILOCAL bool append_basic(int type_id, void *value); - - DXXAPILOCAL void get_basic(int type_id, void *ptr); - -private: - - /* I'm sorry, but don't want to include dbus.h in the public api - */ - unsigned char _iter[sizeof(void *)*3+sizeof(int)*11]; - - Message *_msg; - -friend class Message; -}; - -class DXXAPI Message -{ -public: - - struct Private; - - Message(Private *, bool incref = true); - - Message(const Message &m); - - ~Message(); - - Message &operator = (const Message &m); - - Message copy(); - - int type() const; - - int serial() const; - - int reply_serial() const; - - bool reply_serial(int); - - const char *sender() const; - - bool sender(const char *s); - - const char *destination() const; - - bool destination(const char *s); - - bool is_error() const; - - bool is_signal(const char *interface, const char *member) const; - - MessageIter reader() const; - - MessageIter writer(); - - bool append(int first_type, ...); - - void terminate(); - -protected: - - Message(); - -protected: - - RefPtrI<Private> _pvt; - -/* classes who need to read `_pvt` directly -*/ -friend class ErrorMessage; -friend class ReturnMessage; -friend class MessageIter; -friend class Error; -friend class Connection; -}; - -/* -*/ - -class DXXAPI ErrorMessage : public Message -{ -public: - - ErrorMessage(); - - ErrorMessage(const Message &, const char *name, const char *message); - - const char *name() const; - - bool name(const char *n); - - bool operator == (const ErrorMessage &) const; -}; - -/* -*/ - -class DXXAPI SignalMessage : public Message -{ -public: - - SignalMessage(const char *name); - - SignalMessage(const char *path, const char *interface, const char *name); - - const char *interface() const; - - bool interface(const char *i); - - const char *member() const; - - bool member(const char *m); - - const char *path() const; - - char ** path_split() const; - - bool path(const char *p); - - bool operator == (const SignalMessage &) const; -}; - -/* -*/ - -class DXXAPI CallMessage : public Message -{ -public: - - CallMessage(); - - CallMessage(const char *dest, const char *path, const char *iface, const char *method); - - const char *interface() const; - - bool interface(const char *i); - - const char *member() const; - - bool member(const char *m); - - const char *path() const; - - char ** path_split() const; - - bool path(const char *p); - - const char *signature() const; - - bool operator == (const CallMessage &) const; -}; - -/* -*/ - -class DXXAPI ReturnMessage : public Message -{ -public: - - ReturnMessage(const CallMessage &callee); - - const char *signature() const; -}; - -} /* namespace DBus */ - -#endif//__DBUSXX_MESSAGE_H diff --git a/libs/dbus-c++/include/dbus-c++/object.h b/libs/dbus-c++/include/dbus-c++/object.h deleted file mode 100644 index a7ed84d43f0be2d5ea0c91d63561135ddccde10b..0000000000000000000000000000000000000000 --- a/libs/dbus-c++/include/dbus-c++/object.h +++ /dev/null @@ -1,226 +0,0 @@ -/* - * - * D-Bus++ - C++ bindings for D-Bus - * - * Copyright (C) 2005-2007 Paolo Durante <shackan@gmail.com> - * - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - - -#ifndef __DBUSXX_OBJECT_H -#define __DBUSXX_OBJECT_H - -#ifdef HAVE_CONFIG_H -#include <dbus-c++/config.h> -#endif - -#include <string> -#include <list> - -#include "api.h" -#include "interface.h" -#include "connection.h" -#include "message.h" -#include "types.h" - -namespace DBus { - -class DXXAPI Object -{ -protected: - - Object(Connection &conn, const Path &path, const char *service); - -public: - - virtual ~Object(); - - inline const DBus::Path &path() const; - - inline const std::string &service() const; - - inline Connection &conn(); - -private: - - DXXAPILOCAL virtual bool handle_message(const Message &) = 0; - DXXAPILOCAL virtual void register_obj() = 0; - DXXAPILOCAL virtual void unregister_obj() = 0; - -private: - - Connection _conn; - DBus::Path _path; - std::string _service; -}; - -/* -*/ - -Connection &Object::conn() -{ - return _conn; -} - -const DBus::Path &Object::path() const -{ - return _path; -} - -const std::string &Object::service() const -{ - return _service; -} - -/* -*/ - -class DXXAPI Tag -{ -public: - - virtual ~Tag() - {} -}; - -/* -*/ - -class ObjectAdaptor; - -typedef std::list<ObjectAdaptor *> ObjectAdaptorPList; -typedef std::list<std::string> ObjectPathList; - -class DXXAPI ObjectAdaptor : public Object, public virtual AdaptorBase -{ -public: - - static ObjectAdaptor *from_path(const Path &path); - - static ObjectAdaptorPList from_path_prefix(const std::string &prefix); - - static ObjectPathList child_nodes_from_prefix(const std::string &prefix); - - struct Private; - - ObjectAdaptor(Connection &conn, const Path &path); - - ~ObjectAdaptor(); - - inline const ObjectAdaptor *object() const; - -protected: - - class DXXAPI Continuation - { - public: - - inline MessageIter &writer(); - - inline Tag *tag(); - - private: - - Continuation(Connection &conn, const CallMessage &call, const Tag *tag); - - Connection _conn; - CallMessage _call; - MessageIter _writer; - ReturnMessage _return; - const Tag *_tag; - - friend class ObjectAdaptor; - }; - - void return_later(const Tag *tag); - - void return_now(Continuation *ret); - - void return_error(Continuation *ret, const Error error); - - Continuation *find_continuation(const Tag *tag); - -private: - - void _emit_signal(SignalMessage &); - - bool handle_message(const Message &); - - void register_obj(); - void unregister_obj(); - - typedef std::map<const Tag *, Continuation *> ContinuationMap; - ContinuationMap _continuations; - -friend struct Private; -}; - -const ObjectAdaptor *ObjectAdaptor::object() const -{ - return this; -} - -Tag *ObjectAdaptor::Continuation::tag() -{ - return const_cast<Tag *>(_tag); -} - -MessageIter &ObjectAdaptor::Continuation::writer() -{ - return _writer; -} - -/* -*/ - -class ObjectProxy; - -typedef std::list<ObjectProxy *> ObjectProxyPList; - -class DXXAPI ObjectProxy : public Object, public virtual ProxyBase -{ -public: - - ObjectProxy(Connection &conn, const Path &path, const char *service = ""); - - ~ObjectProxy(); - - inline const ObjectProxy *object() const; - -private: - - Message _invoke_method(CallMessage &); - - bool handle_message(const Message &); - - void register_obj(); - void unregister_obj(); - -private: - - MessageSlot _filtered; -}; - -const ObjectProxy *ObjectProxy::object() const -{ - return this; -} - -} /* namespace DBus */ - -#endif//__DBUSXX_OBJECT_H diff --git a/libs/dbus-c++/include/dbus-c++/pendingcall.h b/libs/dbus-c++/include/dbus-c++/pendingcall.h deleted file mode 100644 index 1ba28568479d2d168c9d26dd2dfb26c72d386baf..0000000000000000000000000000000000000000 --- a/libs/dbus-c++/include/dbus-c++/pendingcall.h +++ /dev/null @@ -1,78 +0,0 @@ -/* - * - * D-Bus++ - C++ bindings for D-Bus - * - * Copyright (C) 2005-2007 Paolo Durante <shackan@gmail.com> - * - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - - -#ifndef __DBUSXX_PENDING_CALL_H -#define __DBUSXX_PENDING_CALL_H - -#ifdef HAVE_CONFIG_H -#include <dbus-c++/config.h> -#endif - -#include "api.h" -#include "util.h" -#include "message.h" - -namespace DBus { - -class Connection; - -class DXXAPI PendingCall -{ -public: - - struct Private; - - PendingCall(Private *); - - PendingCall(const PendingCall &); - - virtual ~PendingCall(); - - PendingCall &operator = (const PendingCall &); - - bool completed(); - - void cancel(); - - void block(); - - void data(void *); - - void *data(); - - Slot<void, PendingCall &>& slot(); - - Message steal_reply(); - -private: - - RefPtrI<Private> _pvt; - -friend struct Private; -friend class Connection; -}; - -} /* namespace DBus */ - -#endif//__DBUSXX_PENDING_CALL_H diff --git a/libs/dbus-c++/include/dbus-c++/property.h b/libs/dbus-c++/include/dbus-c++/property.h deleted file mode 100644 index c9755e1fd32fa9c5e425636c5755dbfda3fac61b..0000000000000000000000000000000000000000 --- a/libs/dbus-c++/include/dbus-c++/property.h +++ /dev/null @@ -1,106 +0,0 @@ -/* - * - * D-Bus++ - C++ bindings for D-Bus - * - * Copyright (C) 2005-2007 Paolo Durante <shackan@gmail.com> - * - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - - -#ifndef __DBUSXX_PROPERTY_H -#define __DBUSXX_PROPERTY_H - -#ifdef HAVE_CONFIG_H -#include <dbus-c++/config.h> -#endif - -#include "api.h" -#include "types.h" -#include "interface.h" - -namespace DBus { - -template <typename T> -class PropertyAdaptor -{ -public: - - PropertyAdaptor() : _data(0) - {} - - void bind(PropertyData &data) - { - _data = &data; - } - - T operator() (void) const - { - return (T)_data->value; - } - - PropertyAdaptor &operator = (const T &t) - { - _data->value.clear(); - MessageIter wi = _data->value.writer(); - wi << t; - return *this; - } - -private: - - PropertyData *_data; -}; - -struct IntrospectedInterface; - -class DXXAPI PropertiesAdaptor : public InterfaceAdaptor -{ -public: - - PropertiesAdaptor(); - - Message Get(const CallMessage &); - - Message Set(const CallMessage &); - -protected: - - virtual void on_get_property(InterfaceAdaptor &/*interface*/, const std::string &/*property*/, Variant &/*value*/) - {} - - virtual void on_set_property(InterfaceAdaptor &/*interface*/, const std::string &/*property*/, const Variant &/*value*/) - {} - - IntrospectedInterface *const introspect() const; -}; - -class DXXAPI PropertiesProxy : public InterfaceProxy -{ -public: - - PropertiesProxy(); - - Variant Get(const std::string &interface, const std::string &property); - - void Set(const std::string &interface, const std::string &property, const Variant &value); -}; - -} /* namespace DBus */ - -#endif//__DBUSXX_PROPERTY_H - diff --git a/libs/dbus-c++/include/dbus-c++/refptr_impl.h b/libs/dbus-c++/include/dbus-c++/refptr_impl.h deleted file mode 100644 index d35d8349ed1e9c1b6d254e94132655aa0149049a..0000000000000000000000000000000000000000 --- a/libs/dbus-c++/include/dbus-c++/refptr_impl.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - * - * D-Bus++ - C++ bindings for D-Bus - * - * Copyright (C) 2005-2007 Paolo Durante <shackan@gmail.com> - * - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - - -#ifndef __DBUSXX_REFPTR_IMPL_H -#define __DBUSXX_REFPTR_IMPL_H - -#ifdef HAVE_CONFIG_H -#include <dbus-c++/config.h> -#endif - -#include "api.h" -#include "util.h" - -namespace DBus { - -template <class T> -RefPtrI<T>::RefPtrI(T *ptr) -: __ptr(ptr) -{} - -template <class T> -RefPtrI<T>::~RefPtrI() -{ - if (__cnt.one()) delete __ptr; -} - -} /* namespace DBus */ - -#endif//__DBUSXX_REFPTR_IMPL_H diff --git a/libs/dbus-c++/include/dbus-c++/server.h b/libs/dbus-c++/include/dbus-c++/server.h deleted file mode 100644 index adc6edef264612c1f42b93cbbd32161304e9961b..0000000000000000000000000000000000000000 --- a/libs/dbus-c++/include/dbus-c++/server.h +++ /dev/null @@ -1,78 +0,0 @@ -/* - * - * D-Bus++ - C++ bindings for D-Bus - * - * Copyright (C) 2005-2007 Paolo Durante <shackan@gmail.com> - * - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - - -#ifndef __DBUSXX_SERVER_H -#define __DBUSXX_SERVER_H - -#ifdef HAVE_CONFIG_H -#include <dbus-c++/config.h> -#endif - -#include <list> - -#include "api.h" -#include "error.h" -#include "connection.h" -#include "util.h" -#include "dispatcher.h" - -namespace DBus { - -class Server; - -typedef std::list<Server> ServerList; - -class DXXAPI Server -{ -public: - - Server(const char *address); - - Dispatcher *setup(Dispatcher *); - - virtual ~Server(); - - bool listening() const; - - bool operator == (const Server &) const; - - void disconnect(); - - struct Private; - -protected: - - Server(const Server & /* s */) - {} - - virtual void on_new_connection(Connection &c) = 0; - -private: - - RefPtrI<Private> _pvt; -}; - -} /* namespace DBus */ - -#endif//__DBUSXX_SERVER_H diff --git a/libs/dbus-c++/include/dbus-c++/types.h b/libs/dbus-c++/include/dbus-c++/types.h deleted file mode 100644 index a2b6b830a023de5bca4c54ac819bdf27f32b830b..0000000000000000000000000000000000000000 --- a/libs/dbus-c++/include/dbus-c++/types.h +++ /dev/null @@ -1,504 +0,0 @@ -/* - * - * D-Bus++ - C++ bindings for D-Bus - * - * Copyright (C) 2005-2007 Paolo Durante <shackan@gmail.com> - * - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - - -#ifndef __DBUSXX_TYPES_H -#define __DBUSXX_TYPES_H - -#ifdef HAVE_CONFIG_H -#include <dbus-c++/config.h> -#endif - -#include <stdint.h> -#include <string> -#include <vector> -#include <map> - -#include "api.h" -#include "util.h" -#include "message.h" -#include "error.h" - -namespace DBus { - -struct DXXAPI Path : public std::string -{ - Path() {} - Path(const std::string &s) : std::string(s) {} - Path(const char *c) : std::string(c) {} - Path &operator = (std::string &s) - { - std::string::operator = (s); - return *this; - } -}; - -struct DXXAPI Signature : public std::string -{ - Signature() {} - Signature(const std::string &s) : std::string(s) {} - Signature(const char *c) : std::string(c) {} - Signature &operator = (std::string &s) - { - std::string::operator = (s); - return *this; - } -}; - -struct DXXAPI Invalid {}; - -class DXXAPI Variant -{ -public: - - Variant(); - - Variant(MessageIter &it); - - Variant &operator = (const Variant &v); - - const Signature signature() const; - - void clear(); - - MessageIter reader() const - { - return _msg.reader(); - } - - MessageIter writer() - { - return _msg.writer(); - } - - template <typename T> - operator T() const - { - T cast; - MessageIter ri = _msg.reader(); - ri >> cast; - return cast; - } - -private: - - Message _msg; -}; - -template < - typename T1, - typename T2 = Invalid, - typename T3 = Invalid, - typename T4 = Invalid, - typename T5 = Invalid, - typename T6 = Invalid, - typename T7 = Invalid, - typename T8 = Invalid // who needs more than eight? -> -struct Struct -{ - T1 _1; T2 _2; T3 _3; T4 _4; T5 _5; T6 _6; T7 _7; T8 _8; -}; - -template<typename K, typename V> -inline bool dict_has_key(const std::map<K,V>& map, const K &key) -{ - return map.find(key) != map.end(); -} - -template <typename T> -struct type -{ - static std::string sig() - { - throw ErrorInvalidArgs("unknown type"); - return ""; - } -}; - -template <> struct type<Variant> { static std::string sig(){ return "v"; } }; -template <> struct type<uint8_t> { static std::string sig(){ return "y"; } }; -template <> struct type<bool> { static std::string sig(){ return "b"; } }; -template <> struct type<int16_t> { static std::string sig(){ return "n"; } }; -template <> struct type<uint16_t> { static std::string sig(){ return "q"; } }; -template <> struct type<int32_t> { static std::string sig(){ return "i"; } }; -template <> struct type<uint32_t> { static std::string sig(){ return "u"; } }; -template <> struct type<int64_t> { static std::string sig(){ return "x"; } }; -template <> struct type<uint64_t> { static std::string sig(){ return "t"; } }; -template <> struct type<double> { static std::string sig(){ return "d"; } }; -template <> struct type<std::string> { static std::string sig(){ return "s"; } }; -template <> struct type<Path> { static std::string sig(){ return "o"; } }; -template <> struct type<Signature> { static std::string sig(){ return "g"; } }; -template <> struct type<Invalid> { static std::string sig(){ return ""; } }; - -template <typename E> -struct type< std::vector<E> > -{ static std::string sig(){ return "a" + type<E>::sig(); } }; - -template <typename K, typename V> -struct type< std::map<K,V> > -{ static std::string sig(){ return "a{" + type<K>::sig() + type<V>::sig() + "}"; } }; - -template < - typename T1, - typename T2, - typename T3, - typename T4, - typename T5, - typename T6, - typename T7, - typename T8 // who needs more than eight? -> -struct type< Struct<T1,T2,T3,T4,T5,T6,T7,T8> > -{ - static std::string sig() - { - return "(" - + type<T1>::sig() - + type<T2>::sig() - + type<T3>::sig() - + type<T4>::sig() - + type<T5>::sig() - + type<T6>::sig() - + type<T7>::sig() - + type<T8>::sig() - + ")"; - } -}; - -} /* namespace DBus */ - -inline DBus::MessageIter &operator << (DBus::MessageIter &iter, const DBus::Invalid &) -{ - return iter; -} - -inline DBus::MessageIter &operator << (DBus::MessageIter &iter, const uint8_t &val) -{ - iter.append_byte(val); - return iter; -} - -inline DBus::MessageIter &operator << (DBus::MessageIter &iter, const bool &val) -{ - iter.append_bool(val); - return iter; -} - -inline DBus::MessageIter &operator << (DBus::MessageIter &iter, const int16_t& val) -{ - iter.append_int16(val); - return iter; -} - -inline DBus::MessageIter &operator << (DBus::MessageIter &iter, const uint16_t& val) -{ - iter.append_uint16(val); - return iter; -} - -inline DBus::MessageIter &operator << (DBus::MessageIter &iter, const int32_t& val) -{ - iter.append_int32(val); - return iter; -} - -inline DBus::MessageIter &operator << (DBus::MessageIter &iter, const uint32_t& val) -{ - iter.append_uint32(val); - return iter; -} - -inline DBus::MessageIter &operator << (DBus::MessageIter &iter, const int64_t& val) -{ - iter.append_int64(val); - return iter; -} - -inline DBus::MessageIter &operator << (DBus::MessageIter &iter, const uint64_t& val) -{ - iter.append_uint64(val); - return iter; -} - -inline DBus::MessageIter &operator << (DBus::MessageIter &iter, const double &val) -{ - iter.append_double(val); - return iter; -} - -inline DBus::MessageIter &operator << (DBus::MessageIter &iter, const std::string &val) -{ - iter.append_string(val.c_str()); - return iter; -} - -inline DBus::MessageIter &operator << (DBus::MessageIter &iter, const DBus::Path &val) -{ - iter.append_path(val.c_str()); - return iter; -} - -inline DBus::MessageIter &operator << (DBus::MessageIter &iter, const DBus::Signature &val) -{ - iter.append_signature(val.c_str()); - return iter; -} - -template<typename E> -inline DBus::MessageIter &operator << (DBus::MessageIter &iter, const std::vector<E>& val) -{ - const std::string sig = DBus::type<E>::sig(); - DBus::MessageIter ait = iter.new_array(sig.c_str()); - - typename std::vector<E>::const_iterator vit; - for (vit = val.begin(); vit != val.end(); ++vit) - { - ait << *vit; - } - - iter.close_container(ait); - return iter; -} - -template<> -inline DBus::MessageIter &operator << (DBus::MessageIter &iter, const std::vector<uint8_t>& val) -{ - DBus::MessageIter ait = iter.new_array("y"); - ait.append_array('y', &val.front(), val.size()); - iter.close_container(ait); - return iter; -} - -template<typename K, typename V> -inline DBus::MessageIter &operator << (DBus::MessageIter &iter, const std::map<K,V>& val) -{ - const std::string sig = "{" + DBus::type<K>::sig() + DBus::type<V>::sig() + "}"; - DBus::MessageIter ait = iter.new_array(sig.c_str()); - - typename std::map<K,V>::const_iterator mit; - for (mit = val.begin(); mit != val.end(); ++mit) - { - DBus::MessageIter eit = ait.new_dict_entry(); - - eit << mit->first << mit->second; - - ait.close_container(eit); - } - - iter.close_container(ait); - return iter; -} - -template < - typename T1, - typename T2, - typename T3, - typename T4, - typename T5, - typename T6, - typename T7, - typename T8 -> -inline DBus::MessageIter &operator << (DBus::MessageIter &iter, const DBus::Struct<T1,T2,T3,T4,T5,T6,T7,T8>& val) -{ -/* const std::string sig = - DBus::type<T1>::sig() + DBus::type<T2>::sig() + DBus::type<T3>::sig() + DBus::type<T4>::sig() + - DBus::type<T5>::sig() + DBus::type<T6>::sig() + DBus::type<T7>::sig() + DBus::type<T8>::sig(); -*/ - DBus::MessageIter sit = iter.new_struct(/*sig.c_str()*/); - - sit << val._1 << val._2 << val._3 << val._4 << val._5 << val._6 << val._7 << val._8; - - iter.close_container(sit); - - return iter; -} - -extern DXXAPI DBus::MessageIter &operator << (DBus::MessageIter &iter, const DBus::Variant &val); - -/* - */ - -inline DBus::MessageIter &operator >> (DBus::MessageIter &iter, DBus::Invalid &) -{ - return iter; -} - -inline DBus::MessageIter &operator >> (DBus::MessageIter &iter, uint8_t &val) -{ - val = iter.get_byte(); - return ++iter; -} - -inline DBus::MessageIter &operator >> (DBus::MessageIter &iter, bool &val) -{ - val = iter.get_bool(); - return ++iter; -} - -inline DBus::MessageIter &operator >> (DBus::MessageIter &iter, int16_t& val) -{ - val = iter.get_int16(); - return ++iter; -} - -inline DBus::MessageIter &operator >> (DBus::MessageIter &iter, uint16_t& val) -{ - val = iter.get_uint16(); - return ++iter; -} - -inline DBus::MessageIter &operator >> (DBus::MessageIter &iter, int32_t& val) -{ - val = iter.get_int32(); - return ++iter; -} - -inline DBus::MessageIter &operator >> (DBus::MessageIter &iter, uint32_t& val) -{ - val = iter.get_uint32(); - return ++iter; -} - -inline DBus::MessageIter &operator >> (DBus::MessageIter &iter, int64_t& val) -{ - val = iter.get_int64(); - return ++iter; -} - -inline DBus::MessageIter &operator >> (DBus::MessageIter &iter, uint64_t& val) -{ - val = iter.get_uint64(); - return ++iter; -} - -inline DBus::MessageIter &operator >> (DBus::MessageIter &iter, double &val) -{ - val = iter.get_double(); - return ++iter; -} - -inline DBus::MessageIter &operator >> (DBus::MessageIter &iter, std::string &val) -{ - val = iter.get_string(); - return ++iter; -} - -inline DBus::MessageIter &operator >> (DBus::MessageIter &iter, DBus::Path &val) -{ - val = iter.get_path(); - return ++iter; -} - -inline DBus::MessageIter &operator >> (DBus::MessageIter &iter, DBus::Signature &val) -{ - val = iter.get_signature(); - return ++iter; -} - -template<typename E> -inline DBus::MessageIter &operator >> (DBus::MessageIter &iter, std::vector<E>& val) -{ - if (!iter.is_array()) - throw DBus::ErrorInvalidArgs("array expected"); - - DBus::MessageIter ait = iter.recurse(); - - while (!ait.at_end()) - { - E elem; - - ait >> elem; - - val.push_back(elem); - } - return ++iter; -} - -template<> -inline DBus::MessageIter &operator >> (DBus::MessageIter &iter, std::vector<uint8_t>& val) -{ - if (!iter.is_array()) - throw DBus::ErrorInvalidArgs("array expected"); - - if (iter.array_type() != 'y') - throw DBus::ErrorInvalidArgs("byte-array expected"); - - DBus::MessageIter ait = iter.recurse(); - - uint8_t *array; - size_t length = ait.get_array(&array); - - val.insert(val.end(), array, array+length); - - return ++iter; -} - -template<typename K, typename V> -inline DBus::MessageIter &operator >> (DBus::MessageIter &iter, std::map<K,V>& val) -{ - if (!iter.is_dict()) - throw DBus::ErrorInvalidArgs("dictionary value expected"); - - DBus::MessageIter mit = iter.recurse(); - - while (!mit.at_end()) - { - K key; V value; - - DBus::MessageIter eit = mit.recurse(); - - eit >> key >> value; - - val[key] = value; - - ++mit; - } - - return ++iter; -} - -template < - typename T1, - typename T2, - typename T3, - typename T4, - typename T5, - typename T6, - typename T7, - typename T8 -> -inline DBus::MessageIter &operator >> (DBus::MessageIter &iter, DBus::Struct<T1,T2,T3,T4,T5,T6,T7,T8>& val) -{ - DBus::MessageIter sit = iter.recurse(); - - sit >> val._1 >> val._2 >> val._3 >> val._4 >> val._5 >> val._6 >> val._7 >> val._8; - - return ++iter; -} - -extern DXXAPI DBus::MessageIter &operator >> (DBus::MessageIter &iter, DBus::Variant &val); - -#endif//__DBUSXX_TYPES_H - diff --git a/libs/dbus-c++/include/dbus-c++/util.h b/libs/dbus-c++/include/dbus-c++/util.h deleted file mode 100644 index 071ad306c27da5d31964256441e9c9329fb9e84b..0000000000000000000000000000000000000000 --- a/libs/dbus-c++/include/dbus-c++/util.h +++ /dev/null @@ -1,277 +0,0 @@ -/* - * - * D-Bus++ - C++ bindings for D-Bus - * - * Copyright (C) 2005-2007 Paolo Durante <shackan@gmail.com> - * - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - - -#ifndef __DBUSXX_UTIL_H -#define __DBUSXX_UTIL_H - -#ifdef HAVE_CONFIG_H -#include <dbus-c++/config.h> -#endif - -#include "api.h" -#include "debug.h" - -namespace DBus { - -/* - * Very simple reference counting - */ - -class DXXAPI RefCnt -{ -public: - - RefCnt() - { - __ref = new int; - (*__ref) = 1; - } - - RefCnt(const RefCnt &rc) - { - __ref = rc.__ref; - ref(); - } - - virtual ~RefCnt() - { - unref(); - } - - RefCnt &operator = (const RefCnt &ref) - { - ref.ref(); - unref(); - __ref = ref.__ref; - return *this; - } - - bool noref() const - { - return (*__ref) == 0; - } - - bool one() const - { - return (*__ref) == 1; - } - -private: - - DXXAPILOCAL void ref() const - { - ++ (*__ref); - } - DXXAPILOCAL void unref() const - { - -- (*__ref); - - if ((*__ref) < 0) - { - debug_log("%p: refcount dropped below zero!", __ref); - } - - if (noref()) - { - delete __ref; - } - } - -private: - - int *__ref; -}; - -/* - * Reference counting pointers (emulate boost::shared_ptr) - */ - -template <class T> -class RefPtrI // RefPtr to incomplete type -{ -public: - - RefPtrI(T *ptr = 0); - - ~RefPtrI(); - - RefPtrI &operator = (const RefPtrI &ref) - { - if (this != &ref) - { - if (__cnt.one()) delete __ptr; - - __ptr = ref.__ptr; - __cnt = ref.__cnt; - } - return *this; - } - - T &operator *() const - { - return *__ptr; - } - - T *operator ->() const - { - if (__cnt.noref()) return 0; - - return __ptr; - } - - T *get() const - { - if (__cnt.noref()) return 0; - - return __ptr; - } - -private: - - T *__ptr; - RefCnt __cnt; -}; - -template <class T> -class RefPtr -{ -public: - - RefPtr(T *ptr = 0) - : __ptr(ptr) - {} - - ~RefPtr() - { - if (__cnt.one()) delete __ptr; - } - - RefPtr &operator = (const RefPtr &ref) - { - if (this != &ref) - { - if (__cnt.one()) delete __ptr; - - __ptr = ref.__ptr; - __cnt = ref.__cnt; - } - return *this; - } - - T &operator *() const - { - return *__ptr; - } - - T *operator ->() const - { - if (__cnt.noref()) return 0; - - return __ptr; - } - - T *get() const - { - if (__cnt.noref()) return 0; - - return __ptr; - } - -private: - - T *__ptr; - RefCnt __cnt; -}; - -/* - * Typed callback template - */ - -template <class R, class P> -class Callback_Base -{ -public: - - virtual R call(P param) const = 0; - - virtual ~Callback_Base() - {} -}; - -template <class R, class P> -class Slot -{ -public: - - Slot &operator = (Callback_Base<R,P>* s) - { - _cb = s; - - return *this; - } - - R operator()(P param) const - { - /*if (_cb.get())*/ return _cb->call(param); - } - - R call(P param) const - { - /*if (_cb.get())*/ return _cb->call(param); - } - - bool empty() - { - return _cb.get() == 0; - } - -private: - - RefPtr< Callback_Base<R,P> > _cb; -}; - -template <class C, class R, class P> -class Callback : public Callback_Base<R,P> -{ -public: - - typedef R (C::*M)(P); - - Callback(C *c, M m) - : _c(c), _m(m) - {} - - R call(P param) const - { - /*if (_c)*/ return (_c->*_m)(param); - } - -private: - - C *_c; M _m; -}; - -} /* namespace DBus */ - -#endif//__DBUSXX_UTIL_H diff --git a/libs/dbus-c++/install-sh b/libs/dbus-c++/install-sh deleted file mode 100755 index 4d4a9519eaf88b18fb157dfe5fae59c1c5d005c7..0000000000000000000000000000000000000000 --- a/libs/dbus-c++/install-sh +++ /dev/null @@ -1,323 +0,0 @@ -#!/bin/sh -# install - install a program, script, or datafile - -scriptversion=2005-05-14.22 - -# This originates from X11R5 (mit/util/scripts/install.sh), which was -# later released in X11R6 (xc/config/util/install.sh) with the -# following copyright and license. -# -# Copyright (C) 1994 X Consortium -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to -# deal in the Software without restriction, including without limitation the -# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -# sell copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- -# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# -# Except as contained in this notice, the name of the X Consortium shall not -# be used in advertising or otherwise to promote the sale, use or other deal- -# ings in this Software without prior written authorization from the X Consor- -# tium. -# -# -# FSF changes to this file are in the public domain. -# -# Calling this script install-sh is preferred over install.sh, to prevent -# `make' implicit rules from creating a file called install from it -# when there is no Makefile. -# -# This script is compatible with the BSD install script, but was written -# from scratch. It can only install one file at a time, a restriction -# shared with many OS's install programs. - -# set DOITPROG to echo to test this script - -# Don't use :- since 4.3BSD and earlier shells don't like it. -doit="${DOITPROG-}" - -# put in absolute paths if you don't have them in your path; or use env. vars. - -mvprog="${MVPROG-mv}" -cpprog="${CPPROG-cp}" -chmodprog="${CHMODPROG-chmod}" -chownprog="${CHOWNPROG-chown}" -chgrpprog="${CHGRPPROG-chgrp}" -stripprog="${STRIPPROG-strip}" -rmprog="${RMPROG-rm}" -mkdirprog="${MKDIRPROG-mkdir}" - -chmodcmd="$chmodprog 0755" -chowncmd= -chgrpcmd= -stripcmd= -rmcmd="$rmprog -f" -mvcmd="$mvprog" -src= -dst= -dir_arg= -dstarg= -no_target_directory= - -usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE - or: $0 [OPTION]... SRCFILES... DIRECTORY - or: $0 [OPTION]... -t DIRECTORY SRCFILES... - or: $0 [OPTION]... -d DIRECTORIES... - -In the 1st form, copy SRCFILE to DSTFILE. -In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. -In the 4th, create DIRECTORIES. - -Options: --c (ignored) --d create directories instead of installing files. --g GROUP $chgrpprog installed files to GROUP. --m MODE $chmodprog installed files to MODE. --o USER $chownprog installed files to USER. --s $stripprog installed files. --t DIRECTORY install into DIRECTORY. --T report an error if DSTFILE is a directory. ---help display this help and exit. ---version display version info and exit. - -Environment variables override the default commands: - CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG -" - -while test -n "$1"; do - case $1 in - -c) shift - continue;; - - -d) dir_arg=true - shift - continue;; - - -g) chgrpcmd="$chgrpprog $2" - shift - shift - continue;; - - --help) echo "$usage"; exit $?;; - - -m) chmodcmd="$chmodprog $2" - shift - shift - continue;; - - -o) chowncmd="$chownprog $2" - shift - shift - continue;; - - -s) stripcmd=$stripprog - shift - continue;; - - -t) dstarg=$2 - shift - shift - continue;; - - -T) no_target_directory=true - shift - continue;; - - --version) echo "$0 $scriptversion"; exit $?;; - - *) # When -d is used, all remaining arguments are directories to create. - # When -t is used, the destination is already specified. - test -n "$dir_arg$dstarg" && break - # Otherwise, the last argument is the destination. Remove it from $@. - for arg - do - if test -n "$dstarg"; then - # $@ is not empty: it contains at least $arg. - set fnord "$@" "$dstarg" - shift # fnord - fi - shift # arg - dstarg=$arg - done - break;; - esac -done - -if test -z "$1"; then - if test -z "$dir_arg"; then - echo "$0: no input file specified." >&2 - exit 1 - fi - # It's OK to call `install-sh -d' without argument. - # This can happen when creating conditional directories. - exit 0 -fi - -for src -do - # Protect names starting with `-'. - case $src in - -*) src=./$src ;; - esac - - if test -n "$dir_arg"; then - dst=$src - src= - - if test -d "$dst"; then - mkdircmd=: - chmodcmd= - else - mkdircmd=$mkdirprog - fi - else - # Waiting for this to be detected by the "$cpprog $src $dsttmp" command - # might cause directories to be created, which would be especially bad - # if $src (and thus $dsttmp) contains '*'. - if test ! -f "$src" && test ! -d "$src"; then - echo "$0: $src does not exist." >&2 - exit 1 - fi - - if test -z "$dstarg"; then - echo "$0: no destination specified." >&2 - exit 1 - fi - - dst=$dstarg - # Protect names starting with `-'. - case $dst in - -*) dst=./$dst ;; - esac - - # If destination is a directory, append the input filename; won't work - # if double slashes aren't ignored. - if test -d "$dst"; then - if test -n "$no_target_directory"; then - echo "$0: $dstarg: Is a directory" >&2 - exit 1 - fi - dst=$dst/`basename "$src"` - fi - fi - - # This sed command emulates the dirname command. - dstdir=`echo "$dst" | sed -e 's,/*$,,;s,[^/]*$,,;s,/*$,,;s,^$,.,'` - - # Make sure that the destination directory exists. - - # Skip lots of stat calls in the usual case. - if test ! -d "$dstdir"; then - defaultIFS=' - ' - IFS="${IFS-$defaultIFS}" - - oIFS=$IFS - # Some sh's can't handle IFS=/ for some reason. - IFS='%' - set x `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'` - shift - IFS=$oIFS - - pathcomp= - - while test $# -ne 0 ; do - pathcomp=$pathcomp$1 - shift - if test ! -d "$pathcomp"; then - $mkdirprog "$pathcomp" - # mkdir can fail with a `File exist' error in case several - # install-sh are creating the directory concurrently. This - # is OK. - test -d "$pathcomp" || exit - fi - pathcomp=$pathcomp/ - done - fi - - if test -n "$dir_arg"; then - $doit $mkdircmd "$dst" \ - && { test -z "$chowncmd" || $doit $chowncmd "$dst"; } \ - && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } \ - && { test -z "$stripcmd" || $doit $stripcmd "$dst"; } \ - && { test -z "$chmodcmd" || $doit $chmodcmd "$dst"; } - - else - dstfile=`basename "$dst"` - - # Make a couple of temp file names in the proper directory. - dsttmp=$dstdir/_inst.$$_ - rmtmp=$dstdir/_rm.$$_ - - # Trap to clean up those temp files at exit. - trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 - trap '(exit $?); exit' 1 2 13 15 - - # Copy the file name to the temp name. - $doit $cpprog "$src" "$dsttmp" && - - # and set any options; do chmod last to preserve setuid bits. - # - # If any of these fail, we abort the whole thing. If we want to - # ignore errors from any of these, just make sure not to ignore - # errors from the above "$doit $cpprog $src $dsttmp" command. - # - { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \ - && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \ - && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \ - && { test -z "$chmodcmd" || $doit $chmodcmd "$dsttmp"; } && - - # Now rename the file to the real destination. - { $doit $mvcmd -f "$dsttmp" "$dstdir/$dstfile" 2>/dev/null \ - || { - # The rename failed, perhaps because mv can't rename something else - # to itself, or perhaps because mv is so ancient that it does not - # support -f. - - # Now remove or move aside any old file at destination location. - # We try this two ways since rm can't unlink itself on some - # systems and the destination file might be busy for other - # reasons. In this case, the final cleanup might fail but the new - # file should still install successfully. - { - if test -f "$dstdir/$dstfile"; then - $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null \ - || $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null \ - || { - echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2 - (exit 1); exit 1 - } - else - : - fi - } && - - # Now rename the file to the real destination. - $doit $mvcmd "$dsttmp" "$dstdir/$dstfile" - } - } - fi || { (exit 1); exit 1; } -done - -# The final little trick to "correctly" pass the exit status to the exit trap. -{ - (exit 0); exit 0 -} - -# Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "scriptversion=" -# time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-end: "$" -# End: diff --git a/libs/dbus-c++/libdbus-c++.spec.in b/libs/dbus-c++/libdbus-c++.spec.in deleted file mode 100644 index 264e02f23bebf974e676610721d4d16601e529fc..0000000000000000000000000000000000000000 --- a/libs/dbus-c++/libdbus-c++.spec.in +++ /dev/null @@ -1,62 +0,0 @@ - - - - -Summary: C++ Interface for DBus -Name: libdbus-c++ -Version: @PACKAGE_VERSION@ -Release: 70001 -URL: http://dev.openwengo.org/trac/openwengo/trac.fcgi/browser/wengophone-ng/branches/wengophone-dbus-api/libs/dbus/src -Source0: %{name}-%{version}.tar.gz -License: LGPL -Group: Libraries -BuildRoot: %{_tmppath}/%{name}-root -Prefix: /usr - -%description - -Ability to reflect dbus methods and signals into a more natural C++ object system. - -%package devel -Requires: libdbus-c++ = %{version} -Group: Development/Libraries -Summary: Header files for libdbus-c++ - -%description devel -Header files for libdbus-c++ - - -%prep -%setup -q - -%build -./configure --prefix=/usr -make -j 4 - -%install -make prefix=$RPM_BUILD_ROOT%{prefix} install - -%clean -rm -rf $RPM_BUILD_ROOT - -%post -p /sbin/ldconfig - -%postun -p /sbin/ldconfig - -%files -%defattr(755,root,root) -%{prefix}/lib/libdbus-c++*.so* - - - -%files devel -%defattr(-,root,root) -%{prefix}/bin/dbusxx-xml2cpp -%{prefix}/bin/dbusxx-introspect -%{prefix}/lib/libdbus-c*.a -%{prefix}/include/dbus-c++-1 -%{prefix}/lib/pkgconfig/*.pc - -%changelog -* Thu Feb 8 2007 Ben Martin -- initial spec file diff --git a/libs/dbus-c++/ltmain.sh b/libs/dbus-c++/ltmain.sh deleted file mode 100644 index e420facf55f8bf28e0d73c486fbecb4a7deadf5e..0000000000000000000000000000000000000000 --- a/libs/dbus-c++/ltmain.sh +++ /dev/null @@ -1,6964 +0,0 @@ -# ltmain.sh - Provide generalized library-building support services. -# NOTE: Changing this file will not affect anything until you rerun configure. -# -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, -# 2007, 2008 Free Software Foundation, Inc. -# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996 -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 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. -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -basename="s,^.*/,,g" - -# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh -# is ksh but when the shell is invoked as "sh" and the current value of -# the _XPG environment variable is not equal to 1 (one), the special -# positional parameter $0, within a function call, is the name of the -# function. -progpath="$0" - -# The name of this program: -progname=`echo "$progpath" | $SED $basename` -modename="$progname" - -# Global variables: -EXIT_SUCCESS=0 -EXIT_FAILURE=1 - -PROGRAM=ltmain.sh -PACKAGE=libtool -VERSION="1.5.26 Debian 1.5.26-1ubuntu1" -TIMESTAMP=" (1.1220.2.493 2008/02/01 16:58:18)" - -# Be Bourne compatible (taken from Autoconf:_AS_BOURNE_COMPATIBLE). -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac -fi -BIN_SH=xpg4; export BIN_SH # for Tru64 -DUALCASE=1; export DUALCASE # for MKS sh - -# Check that we have a working $echo. -if test "X$1" = X--no-reexec; then - # Discard the --no-reexec flag, and continue. - shift -elif test "X$1" = X--fallback-echo; then - # Avoid inline document here, it may be left over - : -elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then - # Yippee, $echo works! - : -else - # Restart under the correct shell, and then maybe $echo will work. - exec $SHELL "$progpath" --no-reexec ${1+"$@"} -fi - -if test "X$1" = X--fallback-echo; then - # used as fallback echo - shift - cat <<EOF -$* -EOF - exit $EXIT_SUCCESS -fi - -default_mode= -help="Try \`$progname --help' for more information." -magic="%%%MAGIC variable%%%" -mkdir="mkdir" -mv="mv -f" -rm="rm -f" - -# Sed substitution that helps us do robust quoting. It backslashifies -# metacharacters that are still active within double-quoted strings. -Xsed="${SED}"' -e 1s/^X//' -sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g' -# test EBCDIC or ASCII -case `echo X|tr X '\101'` in - A) # ASCII based system - # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr - SP2NL='tr \040 \012' - NL2SP='tr \015\012 \040\040' - ;; - *) # EBCDIC based system - SP2NL='tr \100 \n' - NL2SP='tr \r\n \100\100' - ;; -esac - -# NLS nuisances. -# Only set LANG and LC_ALL to C if already set. -# These must not be set unconditionally because not all systems understand -# e.g. LANG=C (notably SCO). -# We save the old values to restore during execute mode. -lt_env= -for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES -do - eval "if test \"\${$lt_var+set}\" = set; then - save_$lt_var=\$$lt_var - lt_env=\"$lt_var=\$$lt_var \$lt_env\" - $lt_var=C - export $lt_var - fi" -done - -if test -n "$lt_env"; then - lt_env="env $lt_env" -fi - -# Make sure IFS has a sensible default -lt_nl=' -' -IFS=" $lt_nl" - -if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then - $echo "$modename: not configured to build any kind of library" 1>&2 - $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 - exit $EXIT_FAILURE -fi - -# Global variables. -mode=$default_mode -nonopt= -prev= -prevopt= -run= -show="$echo" -show_help= -execute_dlfiles= -duplicate_deps=no -preserve_args= -lo2o="s/\\.lo\$/.${objext}/" -o2lo="s/\\.${objext}\$/.lo/" -extracted_archives= -extracted_serial=0 - -##################################### -# Shell function definitions: -# This seems to be the best place for them - -# func_mktempdir [string] -# Make a temporary directory that won't clash with other running -# libtool processes, and avoids race conditions if possible. If -# given, STRING is the basename for that directory. -func_mktempdir () -{ - my_template="${TMPDIR-/tmp}/${1-$progname}" - - if test "$run" = ":"; then - # Return a directory name, but don't create it in dry-run mode - my_tmpdir="${my_template}-$$" - else - - # If mktemp works, use that first and foremost - my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` - - if test ! -d "$my_tmpdir"; then - # Failing that, at least try and use $RANDOM to avoid a race - my_tmpdir="${my_template}-${RANDOM-0}$$" - - save_mktempdir_umask=`umask` - umask 0077 - $mkdir "$my_tmpdir" - umask $save_mktempdir_umask - fi - - # If we're not in dry-run mode, bomb out on failure - test -d "$my_tmpdir" || { - $echo "cannot create temporary directory \`$my_tmpdir'" 1>&2 - exit $EXIT_FAILURE - } - fi - - $echo "X$my_tmpdir" | $Xsed -} - - -# func_win32_libid arg -# return the library type of file 'arg' -# -# Need a lot of goo to handle *both* DLLs and import libs -# Has to be a shell function in order to 'eat' the argument -# that is supplied when $file_magic_command is called. -func_win32_libid () -{ - win32_libid_type="unknown" - win32_fileres=`file -L $1 2>/dev/null` - case $win32_fileres in - *ar\ archive\ import\ library*) # definitely import - win32_libid_type="x86 archive import" - ;; - *ar\ archive*) # could be an import, or static - if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \ - $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then - win32_nmres=`eval $NM -f posix -A $1 | \ - $SED -n -e '1,100{ - / I /{ - s,.*,import, - p - q - } - }'` - case $win32_nmres in - import*) win32_libid_type="x86 archive import";; - *) win32_libid_type="x86 archive static";; - esac - fi - ;; - *DLL*) - win32_libid_type="x86 DLL" - ;; - *executable*) # but shell scripts are "executable" too... - case $win32_fileres in - *MS\ Windows\ PE\ Intel*) - win32_libid_type="x86 DLL" - ;; - esac - ;; - esac - $echo $win32_libid_type -} - - -# func_infer_tag arg -# Infer tagged configuration to use if any are available and -# if one wasn't chosen via the "--tag" command line option. -# Only attempt this if the compiler in the base compile -# command doesn't match the default compiler. -# arg is usually of the form 'gcc ...' -func_infer_tag () -{ - if test -n "$available_tags" && test -z "$tagname"; then - CC_quoted= - for arg in $CC; do - case $arg in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - arg="\"$arg\"" - ;; - esac - CC_quoted="$CC_quoted $arg" - done - case $@ in - # Blanks in the command may have been stripped by the calling shell, - # but not from the CC environment variable when configure was run. - " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;; - # Blanks at the start of $base_compile will cause this to fail - # if we don't check for them as well. - *) - for z in $available_tags; do - if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then - # Evaluate the configuration. - eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" - CC_quoted= - for arg in $CC; do - # Double-quote args containing other shell metacharacters. - case $arg in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - arg="\"$arg\"" - ;; - esac - CC_quoted="$CC_quoted $arg" - done - case "$@ " in - " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) - # The compiler in the base compile command matches - # the one in the tagged configuration. - # Assume this is the tagged configuration we want. - tagname=$z - break - ;; - esac - fi - done - # If $tagname still isn't set, then no tagged configuration - # was found and let the user know that the "--tag" command - # line option must be used. - if test -z "$tagname"; then - $echo "$modename: unable to infer tagged configuration" - $echo "$modename: specify a tag with \`--tag'" 1>&2 - exit $EXIT_FAILURE -# else -# $echo "$modename: using $tagname tagged configuration" - fi - ;; - esac - fi -} - - -# func_extract_an_archive dir oldlib -func_extract_an_archive () -{ - f_ex_an_ar_dir="$1"; shift - f_ex_an_ar_oldlib="$1" - - $show "(cd $f_ex_an_ar_dir && $AR x $f_ex_an_ar_oldlib)" - $run eval "(cd \$f_ex_an_ar_dir && $AR x \$f_ex_an_ar_oldlib)" || exit $? - if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then - : - else - $echo "$modename: ERROR: object name conflicts: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" 1>&2 - exit $EXIT_FAILURE - fi -} - -# func_extract_archives gentop oldlib ... -func_extract_archives () -{ - my_gentop="$1"; shift - my_oldlibs=${1+"$@"} - my_oldobjs="" - my_xlib="" - my_xabs="" - my_xdir="" - my_status="" - - $show "${rm}r $my_gentop" - $run ${rm}r "$my_gentop" - $show "$mkdir $my_gentop" - $run $mkdir "$my_gentop" - my_status=$? - if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then - exit $my_status - fi - - for my_xlib in $my_oldlibs; do - # Extract the objects. - case $my_xlib in - [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;; - *) my_xabs=`pwd`"/$my_xlib" ;; - esac - my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'` - my_xlib_u=$my_xlib - while :; do - case " $extracted_archives " in - *" $my_xlib_u "*) - extracted_serial=`expr $extracted_serial + 1` - my_xlib_u=lt$extracted_serial-$my_xlib ;; - *) break ;; - esac - done - extracted_archives="$extracted_archives $my_xlib_u" - my_xdir="$my_gentop/$my_xlib_u" - - $show "${rm}r $my_xdir" - $run ${rm}r "$my_xdir" - $show "$mkdir $my_xdir" - $run $mkdir "$my_xdir" - exit_status=$? - if test "$exit_status" -ne 0 && test ! -d "$my_xdir"; then - exit $exit_status - fi - case $host in - *-darwin*) - $show "Extracting $my_xabs" - # Do not bother doing anything if just a dry run - if test -z "$run"; then - darwin_orig_dir=`pwd` - cd $my_xdir || exit $? - darwin_archive=$my_xabs - darwin_curdir=`pwd` - darwin_base_archive=`$echo "X$darwin_archive" | $Xsed -e 's%^.*/%%'` - darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null` - if test -n "$darwin_arches"; then - darwin_arches=`echo "$darwin_arches" | $SED -e 's/.*are://'` - darwin_arch= - $show "$darwin_base_archive has multiple architectures $darwin_arches" - for darwin_arch in $darwin_arches ; do - mkdir -p "unfat-$$/${darwin_base_archive}-${darwin_arch}" - lipo -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" - cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" - func_extract_an_archive "`pwd`" "${darwin_base_archive}" - cd "$darwin_curdir" - $rm "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" - done # $darwin_arches - ## Okay now we have a bunch of thin objects, gotta fatten them up :) - darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print| xargs basename | sort -u | $NL2SP` - darwin_file= - darwin_files= - for darwin_file in $darwin_filelist; do - darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP` - lipo -create -output "$darwin_file" $darwin_files - done # $darwin_filelist - ${rm}r unfat-$$ - cd "$darwin_orig_dir" - else - cd "$darwin_orig_dir" - func_extract_an_archive "$my_xdir" "$my_xabs" - fi # $darwin_arches - fi # $run - ;; - *) - func_extract_an_archive "$my_xdir" "$my_xabs" - ;; - esac - my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP` - done - func_extract_archives_result="$my_oldobjs" -} -# End of Shell function definitions -##################################### - -# Darwin sucks -eval std_shrext=\"$shrext_cmds\" - -disable_libs=no - -# Parse our command line options once, thoroughly. -while test "$#" -gt 0 -do - arg="$1" - shift - - case $arg in - -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;; - *) optarg= ;; - esac - - # If the previous option needs an argument, assign it. - if test -n "$prev"; then - case $prev in - execute_dlfiles) - execute_dlfiles="$execute_dlfiles $arg" - ;; - tag) - tagname="$arg" - preserve_args="${preserve_args}=$arg" - - # Check whether tagname contains only valid characters - case $tagname in - *[!-_A-Za-z0-9,/]*) - $echo "$progname: invalid tag name: $tagname" 1>&2 - exit $EXIT_FAILURE - ;; - esac - - case $tagname in - CC) - # Don't test for the "default" C tag, as we know, it's there, but - # not specially marked. - ;; - *) - if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev/null; then - taglist="$taglist $tagname" - # Evaluate the configuration. - eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`" - else - $echo "$progname: ignoring unknown tag $tagname" 1>&2 - fi - ;; - esac - ;; - *) - eval "$prev=\$arg" - ;; - esac - - prev= - prevopt= - continue - fi - - # Have we seen a non-optional argument yet? - case $arg in - --help) - show_help=yes - ;; - - --version) - echo "\ -$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP - -Copyright (C) 2008 Free Software Foundation, Inc. -This is free software; see the source for copying conditions. There is NO -warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." - exit $? - ;; - - --config) - ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath - # Now print the configurations for the tags. - for tagname in $taglist; do - ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath" - done - exit $? - ;; - - --debug) - $echo "$progname: enabling shell trace mode" - set -x - preserve_args="$preserve_args $arg" - ;; - - --dry-run | -n) - run=: - ;; - - --features) - $echo "host: $host" - if test "$build_libtool_libs" = yes; then - $echo "enable shared libraries" - else - $echo "disable shared libraries" - fi - if test "$build_old_libs" = yes; then - $echo "enable static libraries" - else - $echo "disable static libraries" - fi - exit $? - ;; - - --finish) mode="finish" ;; - - --mode) prevopt="--mode" prev=mode ;; - --mode=*) mode="$optarg" ;; - - --preserve-dup-deps) duplicate_deps="yes" ;; - - --quiet | --silent) - show=: - preserve_args="$preserve_args $arg" - ;; - - --tag) - prevopt="--tag" - prev=tag - preserve_args="$preserve_args --tag" - ;; - --tag=*) - set tag "$optarg" ${1+"$@"} - shift - prev=tag - preserve_args="$preserve_args --tag" - ;; - - -dlopen) - prevopt="-dlopen" - prev=execute_dlfiles - ;; - - -*) - $echo "$modename: unrecognized option \`$arg'" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - ;; - - *) - nonopt="$arg" - break - ;; - esac -done - -if test -n "$prevopt"; then - $echo "$modename: option \`$prevopt' requires an argument" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE -fi - -case $disable_libs in -no) - ;; -shared) - build_libtool_libs=no - build_old_libs=yes - ;; -static) - build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` - ;; -esac - -# If this variable is set in any of the actions, the command in it -# will be execed at the end. This prevents here-documents from being -# left over by shells. -exec_cmd= - -if test -z "$show_help"; then - - # Infer the operation mode. - if test -z "$mode"; then - $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2 - $echo "*** Future versions of Libtool will require --mode=MODE be specified." 1>&2 - case $nonopt in - *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*) - mode=link - for arg - do - case $arg in - -c) - mode=compile - break - ;; - esac - done - ;; - *db | *dbx | *strace | *truss) - mode=execute - ;; - *install*|cp|mv) - mode=install - ;; - *rm) - mode=uninstall - ;; - *) - # If we have no mode, but dlfiles were specified, then do execute mode. - test -n "$execute_dlfiles" && mode=execute - - # Just use the default operation mode. - if test -z "$mode"; then - if test -n "$nonopt"; then - $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2 - else - $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2 - fi - fi - ;; - esac - fi - - # Only execute mode is allowed to have -dlopen flags. - if test -n "$execute_dlfiles" && test "$mode" != execute; then - $echo "$modename: unrecognized option \`-dlopen'" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - fi - - # Change the help message to a mode-specific one. - generic_help="$help" - help="Try \`$modename --help --mode=$mode' for more information." - - # These modes are in order of execution frequency so that they run quickly. - case $mode in - # libtool compile mode - compile) - modename="$modename: compile" - # Get the compilation command and the source file. - base_compile= - srcfile="$nonopt" # always keep a non-empty value in "srcfile" - suppress_opt=yes - suppress_output= - arg_mode=normal - libobj= - later= - - for arg - do - case $arg_mode in - arg ) - # do not "continue". Instead, add this to base_compile - lastarg="$arg" - arg_mode=normal - ;; - - target ) - libobj="$arg" - arg_mode=normal - continue - ;; - - normal ) - # Accept any command-line options. - case $arg in - -o) - if test -n "$libobj" ; then - $echo "$modename: you cannot specify \`-o' more than once" 1>&2 - exit $EXIT_FAILURE - fi - arg_mode=target - continue - ;; - - -static | -prefer-pic | -prefer-non-pic) - later="$later $arg" - continue - ;; - - -no-suppress) - suppress_opt=no - continue - ;; - - -Xcompiler) - arg_mode=arg # the next one goes into the "base_compile" arg list - continue # The current "srcfile" will either be retained or - ;; # replaced later. I would guess that would be a bug. - - -Wc,*) - args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"` - lastarg= - save_ifs="$IFS"; IFS=',' - for arg in $args; do - IFS="$save_ifs" - - # Double-quote args containing other shell metacharacters. - # Many Bourne shells cannot handle close brackets correctly - # in scan sets, so we specify it separately. - case $arg in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - arg="\"$arg\"" - ;; - esac - lastarg="$lastarg $arg" - done - IFS="$save_ifs" - lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"` - - # Add the arguments to base_compile. - base_compile="$base_compile $lastarg" - continue - ;; - - * ) - # Accept the current argument as the source file. - # The previous "srcfile" becomes the current argument. - # - lastarg="$srcfile" - srcfile="$arg" - ;; - esac # case $arg - ;; - esac # case $arg_mode - - # Aesthetically quote the previous argument. - lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"` - - case $lastarg in - # Double-quote args containing other shell metacharacters. - # Many Bourne shells cannot handle close brackets correctly - # in scan sets, and some SunOS ksh mistreat backslash-escaping - # in scan sets (worked around with variable expansion), - # and furthermore cannot handle '|' '&' '(' ')' in scan sets - # at all, so we specify them separately. - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - lastarg="\"$lastarg\"" - ;; - esac - - base_compile="$base_compile $lastarg" - done # for arg - - case $arg_mode in - arg) - $echo "$modename: you must specify an argument for -Xcompile" - exit $EXIT_FAILURE - ;; - target) - $echo "$modename: you must specify a target with \`-o'" 1>&2 - exit $EXIT_FAILURE - ;; - *) - # Get the name of the library object. - [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'` - ;; - esac - - # Recognize several different file suffixes. - # If the user specifies -o file.o, it is replaced with file.lo - xform='[cCFSifmso]' - case $libobj in - *.ada) xform=ada ;; - *.adb) xform=adb ;; - *.ads) xform=ads ;; - *.asm) xform=asm ;; - *.c++) xform=c++ ;; - *.cc) xform=cc ;; - *.ii) xform=ii ;; - *.class) xform=class ;; - *.cpp) xform=cpp ;; - *.cxx) xform=cxx ;; - *.[fF][09]?) xform=[fF][09]. ;; - *.for) xform=for ;; - *.java) xform=java ;; - *.obj) xform=obj ;; - *.sx) xform=sx ;; - esac - - libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"` - - case $libobj in - *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;; - *) - $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2 - exit $EXIT_FAILURE - ;; - esac - - func_infer_tag $base_compile - - for arg in $later; do - case $arg in - -static) - build_old_libs=yes - continue - ;; - - -prefer-pic) - pic_mode=yes - continue - ;; - - -prefer-non-pic) - pic_mode=no - continue - ;; - esac - done - - qlibobj=`$echo "X$libobj" | $Xsed -e "$sed_quote_subst"` - case $qlibobj in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - qlibobj="\"$qlibobj\"" ;; - esac - test "X$libobj" != "X$qlibobj" \ - && $echo "X$libobj" | grep '[]~#^*{};<>?"'"'"' &()|`$[]' \ - && $echo "$modename: libobj name \`$libobj' may not contain shell special characters." - objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` - xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'` - if test "X$xdir" = "X$obj"; then - xdir= - else - xdir=$xdir/ - fi - lobj=${xdir}$objdir/$objname - - if test -z "$base_compile"; then - $echo "$modename: you must specify a compilation command" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - fi - - # Delete any leftover library objects. - if test "$build_old_libs" = yes; then - removelist="$obj $lobj $libobj ${libobj}T" - else - removelist="$lobj $libobj ${libobj}T" - fi - - $run $rm $removelist - trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15 - - # On Cygwin there's no "real" PIC flag so we must build both object types - case $host_os in - cygwin* | mingw* | pw32* | os2*) - pic_mode=default - ;; - esac - if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then - # non-PIC code in shared libraries is not supported - pic_mode=default - fi - - # Calculate the filename of the output object if compiler does - # not support -o with -c - if test "$compiler_c_o" = no; then - output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext} - lockfile="$output_obj.lock" - removelist="$removelist $output_obj $lockfile" - trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15 - else - output_obj= - need_locks=no - lockfile= - fi - - # Lock this critical section if it is needed - # We use this script file to make the link, it avoids creating a new file - if test "$need_locks" = yes; then - until $run ln "$progpath" "$lockfile" 2>/dev/null; do - $show "Waiting for $lockfile to be removed" - sleep 2 - done - elif test "$need_locks" = warn; then - if test -f "$lockfile"; then - $echo "\ -*** ERROR, $lockfile exists and contains: -`cat $lockfile 2>/dev/null` - -This indicates that another process is trying to use the same -temporary object file, and libtool could not work around it because -your compiler does not support \`-c' and \`-o' together. If you -repeat this compilation, it may succeed, by chance, but you had better -avoid parallel builds (make -j) in this platform, or get a better -compiler." - - $run $rm $removelist - exit $EXIT_FAILURE - fi - $echo "$srcfile" > "$lockfile" - fi - - if test -n "$fix_srcfile_path"; then - eval srcfile=\"$fix_srcfile_path\" - fi - qsrcfile=`$echo "X$srcfile" | $Xsed -e "$sed_quote_subst"` - case $qsrcfile in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - qsrcfile="\"$qsrcfile\"" ;; - esac - - $run $rm "$libobj" "${libobj}T" - - # Create a libtool object file (analogous to a ".la" file), - # but don't create it if we're doing a dry run. - test -z "$run" && cat > ${libobj}T <<EOF -# $libobj - a libtool object file -# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP -# -# Please DO NOT delete this file! -# It is necessary for linking the library. - -# Name of the PIC object. -EOF - - # Only build a PIC object if we are building libtool libraries. - if test "$build_libtool_libs" = yes; then - # Without this assignment, base_compile gets emptied. - fbsd_hideous_sh_bug=$base_compile - - if test "$pic_mode" != no; then - command="$base_compile $qsrcfile $pic_flag" - else - # Don't build PIC code - command="$base_compile $qsrcfile" - fi - - if test ! -d "${xdir}$objdir"; then - $show "$mkdir ${xdir}$objdir" - $run $mkdir ${xdir}$objdir - exit_status=$? - if test "$exit_status" -ne 0 && test ! -d "${xdir}$objdir"; then - exit $exit_status - fi - fi - - if test -z "$output_obj"; then - # Place PIC objects in $objdir - command="$command -o $lobj" - fi - - $run $rm "$lobj" "$output_obj" - - $show "$command" - if $run eval $lt_env "$command"; then : - else - test -n "$output_obj" && $run $rm $removelist - exit $EXIT_FAILURE - fi - - if test "$need_locks" = warn && - test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then - $echo "\ -*** ERROR, $lockfile contains: -`cat $lockfile 2>/dev/null` - -but it should contain: -$srcfile - -This indicates that another process is trying to use the same -temporary object file, and libtool could not work around it because -your compiler does not support \`-c' and \`-o' together. If you -repeat this compilation, it may succeed, by chance, but you had better -avoid parallel builds (make -j) in this platform, or get a better -compiler." - - $run $rm $removelist - exit $EXIT_FAILURE - fi - - # Just move the object if needed, then go on to compile the next one - if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then - $show "$mv $output_obj $lobj" - if $run $mv $output_obj $lobj; then : - else - error=$? - $run $rm $removelist - exit $error - fi - fi - - # Append the name of the PIC object to the libtool object file. - test -z "$run" && cat >> ${libobj}T <<EOF -pic_object='$objdir/$objname' - -EOF - - # Allow error messages only from the first compilation. - if test "$suppress_opt" = yes; then - suppress_output=' >/dev/null 2>&1' - fi - else - # No PIC object so indicate it doesn't exist in the libtool - # object file. - test -z "$run" && cat >> ${libobj}T <<EOF -pic_object=none - -EOF - fi - - # Only build a position-dependent object if we build old libraries. - if test "$build_old_libs" = yes; then - if test "$pic_mode" != yes; then - # Don't build PIC code - command="$base_compile $qsrcfile" - else - command="$base_compile $qsrcfile $pic_flag" - fi - if test "$compiler_c_o" = yes; then - command="$command -o $obj" - fi - - # Suppress compiler output if we already did a PIC compilation. - command="$command$suppress_output" - $run $rm "$obj" "$output_obj" - $show "$command" - if $run eval $lt_env "$command"; then : - else - $run $rm $removelist - exit $EXIT_FAILURE - fi - - if test "$need_locks" = warn && - test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then - $echo "\ -*** ERROR, $lockfile contains: -`cat $lockfile 2>/dev/null` - -but it should contain: -$srcfile - -This indicates that another process is trying to use the same -temporary object file, and libtool could not work around it because -your compiler does not support \`-c' and \`-o' together. If you -repeat this compilation, it may succeed, by chance, but you had better -avoid parallel builds (make -j) in this platform, or get a better -compiler." - - $run $rm $removelist - exit $EXIT_FAILURE - fi - - # Just move the object if needed - if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then - $show "$mv $output_obj $obj" - if $run $mv $output_obj $obj; then : - else - error=$? - $run $rm $removelist - exit $error - fi - fi - - # Append the name of the non-PIC object the libtool object file. - # Only append if the libtool object file exists. - test -z "$run" && cat >> ${libobj}T <<EOF -# Name of the non-PIC object. -non_pic_object='$objname' - -EOF - else - # Append the name of the non-PIC object the libtool object file. - # Only append if the libtool object file exists. - test -z "$run" && cat >> ${libobj}T <<EOF -# Name of the non-PIC object. -non_pic_object=none - -EOF - fi - - $run $mv "${libobj}T" "${libobj}" - - # Unlock the critical section if it was locked - if test "$need_locks" != no; then - $run $rm "$lockfile" - fi - - exit $EXIT_SUCCESS - ;; - - # libtool link mode - link | relink) - modename="$modename: link" - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) - # It is impossible to link a dll without this setting, and - # we shouldn't force the makefile maintainer to figure out - # which system we are compiling for in order to pass an extra - # flag for every libtool invocation. - # allow_undefined=no - - # FIXME: Unfortunately, there are problems with the above when trying - # to make a dll which has undefined symbols, in which case not - # even a static library is built. For now, we need to specify - # -no-undefined on the libtool link line when we can be certain - # that all symbols are satisfied, otherwise we get a static library. - allow_undefined=yes - ;; - *) - allow_undefined=yes - ;; - esac - libtool_args="$nonopt" - base_compile="$nonopt $@" - compile_command="$nonopt" - finalize_command="$nonopt" - - compile_rpath= - finalize_rpath= - compile_shlibpath= - finalize_shlibpath= - convenience= - old_convenience= - deplibs= - old_deplibs= - compiler_flags= - linker_flags= - dllsearchpath= - lib_search_path=`pwd` - inst_prefix_dir= - - avoid_version=no - dlfiles= - dlprefiles= - dlself=no - export_dynamic=no - export_symbols= - export_symbols_regex= - generated= - libobjs= - ltlibs= - module=no - no_install=no - objs= - non_pic_objects= - notinst_path= # paths that contain not-installed libtool libraries - precious_files_regex= - prefer_static_libs=no - preload=no - prev= - prevarg= - release= - rpath= - xrpath= - perm_rpath= - temp_rpath= - thread_safe=no - vinfo= - vinfo_number=no - single_module="${wl}-single_module" - - func_infer_tag $base_compile - - # We need to know -static, to get the right output filenames. - for arg - do - case $arg in - -all-static | -static | -static-libtool-libs) - case $arg in - -all-static) - if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then - $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2 - fi - if test -n "$link_static_flag"; then - dlopen_self=$dlopen_self_static - fi - prefer_static_libs=yes - ;; - -static) - if test -z "$pic_flag" && test -n "$link_static_flag"; then - dlopen_self=$dlopen_self_static - fi - prefer_static_libs=built - ;; - -static-libtool-libs) - if test -z "$pic_flag" && test -n "$link_static_flag"; then - dlopen_self=$dlopen_self_static - fi - prefer_static_libs=yes - ;; - esac - build_libtool_libs=no - build_old_libs=yes - break - ;; - esac - done - - # See if our shared archives depend on static archives. - test -n "$old_archive_from_new_cmds" && build_old_libs=yes - - # Go through the arguments, transforming them on the way. - while test "$#" -gt 0; do - arg="$1" - shift - case $arg in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test - ;; - *) qarg=$arg ;; - esac - libtool_args="$libtool_args $qarg" - - # If the previous option needs an argument, assign it. - if test -n "$prev"; then - case $prev in - output) - compile_command="$compile_command @OUTPUT@" - finalize_command="$finalize_command @OUTPUT@" - ;; - esac - - case $prev in - dlfiles|dlprefiles) - if test "$preload" = no; then - # Add the symbol object into the linking commands. - compile_command="$compile_command @SYMFILE@" - finalize_command="$finalize_command @SYMFILE@" - preload=yes - fi - case $arg in - *.la | *.lo) ;; # We handle these cases below. - force) - if test "$dlself" = no; then - dlself=needless - export_dynamic=yes - fi - prev= - continue - ;; - self) - if test "$prev" = dlprefiles; then - dlself=yes - elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then - dlself=yes - else - dlself=needless - export_dynamic=yes - fi - prev= - continue - ;; - *) - if test "$prev" = dlfiles; then - dlfiles="$dlfiles $arg" - else - dlprefiles="$dlprefiles $arg" - fi - prev= - continue - ;; - esac - ;; - expsyms) - export_symbols="$arg" - if test ! -f "$arg"; then - $echo "$modename: symbol file \`$arg' does not exist" - exit $EXIT_FAILURE - fi - prev= - continue - ;; - expsyms_regex) - export_symbols_regex="$arg" - prev= - continue - ;; - inst_prefix) - inst_prefix_dir="$arg" - prev= - continue - ;; - precious_regex) - precious_files_regex="$arg" - prev= - continue - ;; - release) - release="-$arg" - prev= - continue - ;; - objectlist) - if test -f "$arg"; then - save_arg=$arg - moreargs= - for fil in `cat $save_arg` - do -# moreargs="$moreargs $fil" - arg=$fil - # A libtool-controlled object. - - # Check to see that this really is a libtool object. - if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then - pic_object= - non_pic_object= - - # Read the .lo file - # If there is no directory component, then add one. - case $arg in - */* | *\\*) . $arg ;; - *) . ./$arg ;; - esac - - if test -z "$pic_object" || \ - test -z "$non_pic_object" || - test "$pic_object" = none && \ - test "$non_pic_object" = none; then - $echo "$modename: cannot find name of object for \`$arg'" 1>&2 - exit $EXIT_FAILURE - fi - - # Extract subdirectory from the argument. - xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` - if test "X$xdir" = "X$arg"; then - xdir= - else - xdir="$xdir/" - fi - - if test "$pic_object" != none; then - # Prepend the subdirectory the object is found in. - pic_object="$xdir$pic_object" - - if test "$prev" = dlfiles; then - if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then - dlfiles="$dlfiles $pic_object" - prev= - continue - else - # If libtool objects are unsupported, then we need to preload. - prev=dlprefiles - fi - fi - - # CHECK ME: I think I busted this. -Ossama - if test "$prev" = dlprefiles; then - # Preload the old-style object. - dlprefiles="$dlprefiles $pic_object" - prev= - fi - - # A PIC object. - libobjs="$libobjs $pic_object" - arg="$pic_object" - fi - - # Non-PIC object. - if test "$non_pic_object" != none; then - # Prepend the subdirectory the object is found in. - non_pic_object="$xdir$non_pic_object" - - # A standard non-PIC object - non_pic_objects="$non_pic_objects $non_pic_object" - if test -z "$pic_object" || test "$pic_object" = none ; then - arg="$non_pic_object" - fi - else - # If the PIC object exists, use it instead. - # $xdir was prepended to $pic_object above. - non_pic_object="$pic_object" - non_pic_objects="$non_pic_objects $non_pic_object" - fi - else - # Only an error if not doing a dry-run. - if test -z "$run"; then - $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 - exit $EXIT_FAILURE - else - # Dry-run case. - - # Extract subdirectory from the argument. - xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` - if test "X$xdir" = "X$arg"; then - xdir= - else - xdir="$xdir/" - fi - - pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"` - non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"` - libobjs="$libobjs $pic_object" - non_pic_objects="$non_pic_objects $non_pic_object" - fi - fi - done - else - $echo "$modename: link input file \`$save_arg' does not exist" - exit $EXIT_FAILURE - fi - arg=$save_arg - prev= - continue - ;; - rpath | xrpath) - # We need an absolute path. - case $arg in - [\\/]* | [A-Za-z]:[\\/]*) ;; - *) - $echo "$modename: only absolute run-paths are allowed" 1>&2 - exit $EXIT_FAILURE - ;; - esac - if test "$prev" = rpath; then - case "$rpath " in - *" $arg "*) ;; - *) rpath="$rpath $arg" ;; - esac - else - case "$xrpath " in - *" $arg "*) ;; - *) xrpath="$xrpath $arg" ;; - esac - fi - prev= - continue - ;; - xcompiler) - compiler_flags="$compiler_flags $qarg" - prev= - compile_command="$compile_command $qarg" - finalize_command="$finalize_command $qarg" - continue - ;; - xlinker) - linker_flags="$linker_flags $qarg" - compiler_flags="$compiler_flags $wl$qarg" - prev= - compile_command="$compile_command $wl$qarg" - finalize_command="$finalize_command $wl$qarg" - continue - ;; - xcclinker) - linker_flags="$linker_flags $qarg" - compiler_flags="$compiler_flags $qarg" - prev= - compile_command="$compile_command $qarg" - finalize_command="$finalize_command $qarg" - continue - ;; - shrext) - shrext_cmds="$arg" - prev= - continue - ;; - darwin_framework|darwin_framework_skip) - test "$prev" = "darwin_framework" && compiler_flags="$compiler_flags $arg" - compile_command="$compile_command $arg" - finalize_command="$finalize_command $arg" - prev= - continue - ;; - *) - eval "$prev=\"\$arg\"" - prev= - continue - ;; - esac - fi # test -n "$prev" - - prevarg="$arg" - - case $arg in - -all-static) - if test -n "$link_static_flag"; then - compile_command="$compile_command $link_static_flag" - finalize_command="$finalize_command $link_static_flag" - fi - continue - ;; - - -allow-undefined) - # FIXME: remove this flag sometime in the future. - $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2 - continue - ;; - - -avoid-version) - avoid_version=yes - continue - ;; - - -dlopen) - prev=dlfiles - continue - ;; - - -dlpreopen) - prev=dlprefiles - continue - ;; - - -export-dynamic) - export_dynamic=yes - continue - ;; - - -export-symbols | -export-symbols-regex) - if test -n "$export_symbols" || test -n "$export_symbols_regex"; then - $echo "$modename: more than one -exported-symbols argument is not allowed" - exit $EXIT_FAILURE - fi - if test "X$arg" = "X-export-symbols"; then - prev=expsyms - else - prev=expsyms_regex - fi - continue - ;; - - -framework|-arch|-isysroot) - case " $CC " in - *" ${arg} ${1} "* | *" ${arg} ${1} "*) - prev=darwin_framework_skip ;; - *) compiler_flags="$compiler_flags $arg" - prev=darwin_framework ;; - esac - compile_command="$compile_command $arg" - finalize_command="$finalize_command $arg" - continue - ;; - - -inst-prefix-dir) - prev=inst_prefix - continue - ;; - - # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* - # so, if we see these flags be careful not to treat them like -L - -L[A-Z][A-Z]*:*) - case $with_gcc/$host in - no/*-*-irix* | /*-*-irix*) - compile_command="$compile_command $arg" - finalize_command="$finalize_command $arg" - ;; - esac - continue - ;; - - -L*) - dir=`$echo "X$arg" | $Xsed -e 's/^-L//'` - # We need an absolute path. - case $dir in - [\\/]* | [A-Za-z]:[\\/]*) ;; - *) - absdir=`cd "$dir" && pwd` - if test -z "$absdir"; then - $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2 - absdir="$dir" - notinst_path="$notinst_path $dir" - fi - dir="$absdir" - ;; - esac - case "$deplibs " in - *" -L$dir "*) ;; - *) - deplibs="$deplibs -L$dir" - lib_search_path="$lib_search_path $dir" - ;; - esac - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) - testbindir=`$echo "X$dir" | $Xsed -e 's*/lib$*/bin*'` - case :$dllsearchpath: in - *":$dir:"*) ;; - *) dllsearchpath="$dllsearchpath:$dir";; - esac - case :$dllsearchpath: in - *":$testbindir:"*) ;; - *) dllsearchpath="$dllsearchpath:$testbindir";; - esac - ;; - esac - continue - ;; - - -l*) - if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos*) - # These systems don't actually have a C or math library (as such) - continue - ;; - *-*-os2*) - # These systems don't actually have a C library (as such) - test "X$arg" = "X-lc" && continue - ;; - *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) - # Do not include libc due to us having libc/libc_r. - test "X$arg" = "X-lc" && continue - ;; - *-*-rhapsody* | *-*-darwin1.[012]) - # Rhapsody C and math libraries are in the System framework - deplibs="$deplibs -framework System" - continue - ;; - *-*-sco3.2v5* | *-*-sco5v6*) - # Causes problems with __ctype - test "X$arg" = "X-lc" && continue - ;; - *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) - # Compiler inserts libc in the correct place for threads to work - test "X$arg" = "X-lc" && continue - ;; - esac - elif test "X$arg" = "X-lc_r"; then - case $host in - *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) - # Do not include libc_r directly, use -pthread flag. - continue - ;; - esac - fi - deplibs="$deplibs $arg" - continue - ;; - - # Tru64 UNIX uses -model [arg] to determine the layout of C++ - # classes, name mangling, and exception handling. - -model) - compile_command="$compile_command $arg" - compiler_flags="$compiler_flags $arg" - finalize_command="$finalize_command $arg" - prev=xcompiler - continue - ;; - - -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads) - compiler_flags="$compiler_flags $arg" - compile_command="$compile_command $arg" - finalize_command="$finalize_command $arg" - continue - ;; - - -multi_module) - single_module="${wl}-multi_module" - continue - ;; - - -module) - module=yes - continue - ;; - - # -64, -mips[0-9] enable 64-bit mode on the SGI compiler - # -r[0-9][0-9]* specifies the processor on the SGI compiler - # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler - # +DA*, +DD* enable 64-bit mode on the HP compiler - # -q* pass through compiler args for the IBM compiler - # -m* pass through architecture-specific compiler args for GCC - # -m*, -t[45]*, -txscale* pass through architecture-specific - # compiler args for GCC - # -p, -pg, --coverage, -fprofile-* pass through profiling flag for GCC - # -F/path gives path to uninstalled frameworks, gcc on darwin - # @file GCC response files - -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ - -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*) - - # Unknown arguments in both finalize_command and compile_command need - # to be aesthetically quoted because they are evaled later. - arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` - case $arg in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - arg="\"$arg\"" - ;; - esac - compile_command="$compile_command $arg" - finalize_command="$finalize_command $arg" - compiler_flags="$compiler_flags $arg" - continue - ;; - - -shrext) - prev=shrext - continue - ;; - - -no-fast-install) - fast_install=no - continue - ;; - - -no-install) - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin*) - # The PATH hackery in wrapper scripts is required on Windows - # and Darwin in order for the loader to find any dlls it needs. - $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2 - $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2 - fast_install=no - ;; - *) no_install=yes ;; - esac - continue - ;; - - -no-undefined) - allow_undefined=no - continue - ;; - - -objectlist) - prev=objectlist - continue - ;; - - -o) prev=output ;; - - -precious-files-regex) - prev=precious_regex - continue - ;; - - -release) - prev=release - continue - ;; - - -rpath) - prev=rpath - continue - ;; - - -R) - prev=xrpath - continue - ;; - - -R*) - dir=`$echo "X$arg" | $Xsed -e 's/^-R//'` - # We need an absolute path. - case $dir in - [\\/]* | [A-Za-z]:[\\/]*) ;; - *) - $echo "$modename: only absolute run-paths are allowed" 1>&2 - exit $EXIT_FAILURE - ;; - esac - case "$xrpath " in - *" $dir "*) ;; - *) xrpath="$xrpath $dir" ;; - esac - continue - ;; - - -static | -static-libtool-libs) - # The effects of -static are defined in a previous loop. - # We used to do the same as -all-static on platforms that - # didn't have a PIC flag, but the assumption that the effects - # would be equivalent was wrong. It would break on at least - # Digital Unix and AIX. - continue - ;; - - -thread-safe) - thread_safe=yes - continue - ;; - - -version-info) - prev=vinfo - continue - ;; - -version-number) - prev=vinfo - vinfo_number=yes - continue - ;; - - -Wc,*) - args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'` - arg= - save_ifs="$IFS"; IFS=',' - for flag in $args; do - IFS="$save_ifs" - case $flag in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - flag="\"$flag\"" - ;; - esac - arg="$arg $wl$flag" - compiler_flags="$compiler_flags $flag" - done - IFS="$save_ifs" - arg=`$echo "X$arg" | $Xsed -e "s/^ //"` - ;; - - -Wl,*) - args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'` - arg= - save_ifs="$IFS"; IFS=',' - for flag in $args; do - IFS="$save_ifs" - case $flag in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - flag="\"$flag\"" - ;; - esac - arg="$arg $wl$flag" - compiler_flags="$compiler_flags $wl$flag" - linker_flags="$linker_flags $flag" - done - IFS="$save_ifs" - arg=`$echo "X$arg" | $Xsed -e "s/^ //"` - ;; - - -Xcompiler) - prev=xcompiler - continue - ;; - - -Xlinker) - prev=xlinker - continue - ;; - - -XCClinker) - prev=xcclinker - continue - ;; - - # Some other compiler flag. - -* | +*) - # Unknown arguments in both finalize_command and compile_command need - # to be aesthetically quoted because they are evaled later. - arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` - case $arg in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - arg="\"$arg\"" - ;; - esac - ;; - - *.$objext) - # A standard object. - objs="$objs $arg" - ;; - - *.lo) - # A libtool-controlled object. - - # Check to see that this really is a libtool object. - if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then - pic_object= - non_pic_object= - - # Read the .lo file - # If there is no directory component, then add one. - case $arg in - */* | *\\*) . $arg ;; - *) . ./$arg ;; - esac - - if test -z "$pic_object" || \ - test -z "$non_pic_object" || - test "$pic_object" = none && \ - test "$non_pic_object" = none; then - $echo "$modename: cannot find name of object for \`$arg'" 1>&2 - exit $EXIT_FAILURE - fi - - # Extract subdirectory from the argument. - xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` - if test "X$xdir" = "X$arg"; then - xdir= - else - xdir="$xdir/" - fi - - if test "$pic_object" != none; then - # Prepend the subdirectory the object is found in. - pic_object="$xdir$pic_object" - - if test "$prev" = dlfiles; then - if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then - dlfiles="$dlfiles $pic_object" - prev= - continue - else - # If libtool objects are unsupported, then we need to preload. - prev=dlprefiles - fi - fi - - # CHECK ME: I think I busted this. -Ossama - if test "$prev" = dlprefiles; then - # Preload the old-style object. - dlprefiles="$dlprefiles $pic_object" - prev= - fi - - # A PIC object. - libobjs="$libobjs $pic_object" - arg="$pic_object" - fi - - # Non-PIC object. - if test "$non_pic_object" != none; then - # Prepend the subdirectory the object is found in. - non_pic_object="$xdir$non_pic_object" - - # A standard non-PIC object - non_pic_objects="$non_pic_objects $non_pic_object" - if test -z "$pic_object" || test "$pic_object" = none ; then - arg="$non_pic_object" - fi - else - # If the PIC object exists, use it instead. - # $xdir was prepended to $pic_object above. - non_pic_object="$pic_object" - non_pic_objects="$non_pic_objects $non_pic_object" - fi - else - # Only an error if not doing a dry-run. - if test -z "$run"; then - $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 - exit $EXIT_FAILURE - else - # Dry-run case. - - # Extract subdirectory from the argument. - xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` - if test "X$xdir" = "X$arg"; then - xdir= - else - xdir="$xdir/" - fi - - pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"` - non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"` - libobjs="$libobjs $pic_object" - non_pic_objects="$non_pic_objects $non_pic_object" - fi - fi - ;; - - *.$libext) - # An archive. - deplibs="$deplibs $arg" - old_deplibs="$old_deplibs $arg" - continue - ;; - - *.la) - # A libtool-controlled library. - - if test "$prev" = dlfiles; then - # This library was specified with -dlopen. - dlfiles="$dlfiles $arg" - prev= - elif test "$prev" = dlprefiles; then - # The library was specified with -dlpreopen. - dlprefiles="$dlprefiles $arg" - prev= - else - deplibs="$deplibs $arg" - fi - continue - ;; - - # Some other compiler argument. - *) - # Unknown arguments in both finalize_command and compile_command need - # to be aesthetically quoted because they are evaled later. - arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` - case $arg in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - arg="\"$arg\"" - ;; - esac - ;; - esac # arg - - # Now actually substitute the argument into the commands. - if test -n "$arg"; then - compile_command="$compile_command $arg" - finalize_command="$finalize_command $arg" - fi - done # argument parsing loop - - if test -n "$prev"; then - $echo "$modename: the \`$prevarg' option requires an argument" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - fi - - if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then - eval arg=\"$export_dynamic_flag_spec\" - compile_command="$compile_command $arg" - finalize_command="$finalize_command $arg" - fi - - oldlibs= - # calculate the name of the file, without its directory - outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'` - libobjs_save="$libobjs" - - if test -n "$shlibpath_var"; then - # get the directories listed in $shlibpath_var - eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\` - else - shlib_search_path= - fi - eval sys_lib_search_path=\"$sys_lib_search_path_spec\" - eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" - - output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'` - if test "X$output_objdir" = "X$output"; then - output_objdir="$objdir" - else - output_objdir="$output_objdir/$objdir" - fi - # Create the object directory. - if test ! -d "$output_objdir"; then - $show "$mkdir $output_objdir" - $run $mkdir $output_objdir - exit_status=$? - if test "$exit_status" -ne 0 && test ! -d "$output_objdir"; then - exit $exit_status - fi - fi - - # Determine the type of output - case $output in - "") - $echo "$modename: you must specify an output file" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - ;; - *.$libext) linkmode=oldlib ;; - *.lo | *.$objext) linkmode=obj ;; - *.la) linkmode=lib ;; - *) linkmode=prog ;; # Anything else should be a program. - esac - - case $host in - *cygwin* | *mingw* | *pw32*) - # don't eliminate duplications in $postdeps and $predeps - duplicate_compiler_generated_deps=yes - ;; - *) - duplicate_compiler_generated_deps=$duplicate_deps - ;; - esac - specialdeplibs= - - libs= - # Find all interdependent deplibs by searching for libraries - # that are linked more than once (e.g. -la -lb -la) - for deplib in $deplibs; do - if test "X$duplicate_deps" = "Xyes" ; then - case "$libs " in - *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; - esac - fi - libs="$libs $deplib" - done - - if test "$linkmode" = lib; then - libs="$predeps $libs $compiler_lib_search_path $postdeps" - - # Compute libraries that are listed more than once in $predeps - # $postdeps and mark them as special (i.e., whose duplicates are - # not to be eliminated). - pre_post_deps= - if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then - for pre_post_dep in $predeps $postdeps; do - case "$pre_post_deps " in - *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;; - esac - pre_post_deps="$pre_post_deps $pre_post_dep" - done - fi - pre_post_deps= - fi - - deplibs= - newdependency_libs= - newlib_search_path= - need_relink=no # whether we're linking any uninstalled libtool libraries - notinst_deplibs= # not-installed libtool libraries - case $linkmode in - lib) - passes="conv link" - for file in $dlfiles $dlprefiles; do - case $file in - *.la) ;; - *) - $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2 - exit $EXIT_FAILURE - ;; - esac - done - ;; - prog) - compile_deplibs= - finalize_deplibs= - alldeplibs=no - newdlfiles= - newdlprefiles= - passes="conv scan dlopen dlpreopen link" - ;; - *) passes="conv" - ;; - esac - for pass in $passes; do - if test "$linkmode,$pass" = "lib,link" || - test "$linkmode,$pass" = "prog,scan"; then - libs="$deplibs" - deplibs= - fi - if test "$linkmode" = prog; then - case $pass in - dlopen) libs="$dlfiles" ;; - dlpreopen) libs="$dlprefiles" ;; - link) - libs="$deplibs %DEPLIBS%" - test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs" - ;; - esac - fi - if test "$pass" = dlopen; then - # Collect dlpreopened libraries - save_deplibs="$deplibs" - deplibs= - fi - for deplib in $libs; do - lib= - found=no - case $deplib in - -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads) - if test "$linkmode,$pass" = "prog,link"; then - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - else - compiler_flags="$compiler_flags $deplib" - fi - continue - ;; - -l*) - if test "$linkmode" != lib && test "$linkmode" != prog; then - $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2 - continue - fi - name=`$echo "X$deplib" | $Xsed -e 's/^-l//'` - if test "$linkmode" = lib; then - searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path" - else - searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path" - fi - for searchdir in $searchdirs; do - for search_ext in .la $std_shrext .so .a; do - # Search the libtool library - lib="$searchdir/lib${name}${search_ext}" - if test -f "$lib"; then - if test "$search_ext" = ".la"; then - found=yes - else - found=no - fi - break 2 - fi - done - done - if test "$found" != yes; then - # deplib doesn't seem to be a libtool library - if test "$linkmode,$pass" = "prog,link"; then - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - else - deplibs="$deplib $deplibs" - test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" - fi - continue - else # deplib is a libtool library - # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, - # We need to do some special things here, and not later. - if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then - case " $predeps $postdeps " in - *" $deplib "*) - if (${SED} -e '2q' $lib | - grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then - library_names= - old_library= - case $lib in - */* | *\\*) . $lib ;; - *) . ./$lib ;; - esac - for l in $old_library $library_names; do - ll="$l" - done - if test "X$ll" = "X$old_library" ; then # only static version available - found=no - ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` - test "X$ladir" = "X$lib" && ladir="." - lib=$ladir/$old_library - if test "$linkmode,$pass" = "prog,link"; then - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - else - deplibs="$deplib $deplibs" - test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" - fi - continue - fi - fi - ;; - *) ;; - esac - fi - fi - ;; # -l - -L*) - case $linkmode in - lib) - deplibs="$deplib $deplibs" - test "$pass" = conv && continue - newdependency_libs="$deplib $newdependency_libs" - newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` - ;; - prog) - if test "$pass" = conv; then - deplibs="$deplib $deplibs" - continue - fi - if test "$pass" = scan; then - deplibs="$deplib $deplibs" - else - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - fi - newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` - ;; - *) - $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2 - ;; - esac # linkmode - continue - ;; # -L - -R*) - if test "$pass" = link; then - dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'` - # Make sure the xrpath contains only unique directories. - case "$xrpath " in - *" $dir "*) ;; - *) xrpath="$xrpath $dir" ;; - esac - fi - deplibs="$deplib $deplibs" - continue - ;; - *.la) lib="$deplib" ;; - *.$libext) - if test "$pass" = conv; then - deplibs="$deplib $deplibs" - continue - fi - case $linkmode in - lib) - valid_a_lib=no - case $deplibs_check_method in - match_pattern*) - set dummy $deplibs_check_method - match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` - if eval $echo \"$deplib\" 2>/dev/null \ - | $SED 10q \ - | $EGREP "$match_pattern_regex" > /dev/null; then - valid_a_lib=yes - fi - ;; - pass_all) - valid_a_lib=yes - ;; - esac - if test "$valid_a_lib" != yes; then - $echo - $echo "*** Warning: Trying to link with static lib archive $deplib." - $echo "*** I have the capability to make that library automatically link in when" - $echo "*** you link to this library. But I can only do this if you have a" - $echo "*** shared version of the library, which you do not appear to have" - $echo "*** because the file extensions .$libext of this argument makes me believe" - $echo "*** that it is just a static archive that I should not used here." - else - $echo - $echo "*** Warning: Linking the shared library $output against the" - $echo "*** static library $deplib is not portable!" - deplibs="$deplib $deplibs" - fi - continue - ;; - prog) - if test "$pass" != link; then - deplibs="$deplib $deplibs" - else - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - fi - continue - ;; - esac # linkmode - ;; # *.$libext - *.lo | *.$objext) - if test "$pass" = conv; then - deplibs="$deplib $deplibs" - elif test "$linkmode" = prog; then - if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then - # If there is no dlopen support or we're linking statically, - # we need to preload. - newdlprefiles="$newdlprefiles $deplib" - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - else - newdlfiles="$newdlfiles $deplib" - fi - fi - continue - ;; - %DEPLIBS%) - alldeplibs=yes - continue - ;; - esac # case $deplib - if test "$found" = yes || test -f "$lib"; then : - else - $echo "$modename: cannot find the library \`$lib' or unhandled argument \`$deplib'" 1>&2 - exit $EXIT_FAILURE - fi - - # Check to see that this really is a libtool archive. - if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : - else - $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 - exit $EXIT_FAILURE - fi - - ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` - test "X$ladir" = "X$lib" && ladir="." - - dlname= - dlopen= - dlpreopen= - libdir= - library_names= - old_library= - # If the library was installed with an old release of libtool, - # it will not redefine variables installed, or shouldnotlink - installed=yes - shouldnotlink=no - avoidtemprpath= - - - # Read the .la file - case $lib in - */* | *\\*) . $lib ;; - *) . ./$lib ;; - esac - - if test "$linkmode,$pass" = "lib,link" || - test "$linkmode,$pass" = "prog,scan" || - { test "$linkmode" != prog && test "$linkmode" != lib; }; then - test -n "$dlopen" && dlfiles="$dlfiles $dlopen" - test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen" - fi - - if test "$pass" = conv; then - # Only check for convenience libraries - deplibs="$lib $deplibs" - if test -z "$libdir"; then - if test -z "$old_library"; then - $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 - exit $EXIT_FAILURE - fi - # It is a libtool convenience library, so add in its objects. - convenience="$convenience $ladir/$objdir/$old_library" - old_convenience="$old_convenience $ladir/$objdir/$old_library" - tmp_libs= - for deplib in $dependency_libs; do - deplibs="$deplib $deplibs" - if test "X$duplicate_deps" = "Xyes" ; then - case "$tmp_libs " in - *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; - esac - fi - tmp_libs="$tmp_libs $deplib" - done - elif test "$linkmode" != prog && test "$linkmode" != lib; then - $echo "$modename: \`$lib' is not a convenience library" 1>&2 - exit $EXIT_FAILURE - fi - continue - fi # $pass = conv - - - # Get the name of the library we link against. - linklib= - for l in $old_library $library_names; do - linklib="$l" - done - if test -z "$linklib"; then - $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 - exit $EXIT_FAILURE - fi - - # This library was specified with -dlopen. - if test "$pass" = dlopen; then - if test -z "$libdir"; then - $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2 - exit $EXIT_FAILURE - fi - if test -z "$dlname" || - test "$dlopen_support" != yes || - test "$build_libtool_libs" = no; then - # If there is no dlname, no dlopen support or we're linking - # statically, we need to preload. We also need to preload any - # dependent libraries so libltdl's deplib preloader doesn't - # bomb out in the load deplibs phase. - dlprefiles="$dlprefiles $lib $dependency_libs" - else - newdlfiles="$newdlfiles $lib" - fi - continue - fi # $pass = dlopen - - # We need an absolute path. - case $ladir in - [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; - *) - abs_ladir=`cd "$ladir" && pwd` - if test -z "$abs_ladir"; then - $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2 - $echo "$modename: passing it literally to the linker, although it might fail" 1>&2 - abs_ladir="$ladir" - fi - ;; - esac - laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` - - # Find the relevant object directory and library name. - if test "X$installed" = Xyes; then - if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then - $echo "$modename: warning: library \`$lib' was moved." 1>&2 - dir="$ladir" - absdir="$abs_ladir" - libdir="$abs_ladir" - else - dir="$libdir" - absdir="$libdir" - fi - test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes - else - if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then - dir="$ladir" - absdir="$abs_ladir" - # Remove this search path later - notinst_path="$notinst_path $abs_ladir" - else - dir="$ladir/$objdir" - absdir="$abs_ladir/$objdir" - # Remove this search path later - notinst_path="$notinst_path $abs_ladir" - fi - fi # $installed = yes - name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` - - # This library was specified with -dlpreopen. - if test "$pass" = dlpreopen; then - if test -z "$libdir"; then - $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2 - exit $EXIT_FAILURE - fi - # Prefer using a static library (so that no silly _DYNAMIC symbols - # are required to link). - if test -n "$old_library"; then - newdlprefiles="$newdlprefiles $dir/$old_library" - # Otherwise, use the dlname, so that lt_dlopen finds it. - elif test -n "$dlname"; then - newdlprefiles="$newdlprefiles $dir/$dlname" - else - newdlprefiles="$newdlprefiles $dir/$linklib" - fi - fi # $pass = dlpreopen - - if test -z "$libdir"; then - # Link the convenience library - if test "$linkmode" = lib; then - deplibs="$dir/$old_library $deplibs" - elif test "$linkmode,$pass" = "prog,link"; then - compile_deplibs="$dir/$old_library $compile_deplibs" - finalize_deplibs="$dir/$old_library $finalize_deplibs" - else - deplibs="$lib $deplibs" # used for prog,scan pass - fi - continue - fi - - - if test "$linkmode" = prog && test "$pass" != link; then - newlib_search_path="$newlib_search_path $ladir" - deplibs="$lib $deplibs" - - linkalldeplibs=no - if test "$link_all_deplibs" != no || test -z "$library_names" || - test "$build_libtool_libs" = no; then - linkalldeplibs=yes - fi - - tmp_libs= - for deplib in $dependency_libs; do - case $deplib in - -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test - esac - # Need to link against all dependency_libs? - if test "$linkalldeplibs" = yes; then - deplibs="$deplib $deplibs" - else - # Need to hardcode shared library paths - # or/and link against static libraries - newdependency_libs="$deplib $newdependency_libs" - fi - if test "X$duplicate_deps" = "Xyes" ; then - case "$tmp_libs " in - *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; - esac - fi - tmp_libs="$tmp_libs $deplib" - done # for deplib - continue - fi # $linkmode = prog... - - if test "$linkmode,$pass" = "prog,link"; then - if test -n "$library_names" && - { { test "$prefer_static_libs" = no || - test "$prefer_static_libs,$installed" = "built,yes"; } || - test -z "$old_library"; }; then - # We need to hardcode the library path - if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then - # Make sure the rpath contains only unique directories. - case "$temp_rpath " in - *" $dir "*) ;; - *" $absdir "*) ;; - *) temp_rpath="$temp_rpath $absdir" ;; - esac - fi - - # Hardcode the library path. - # Skip directories that are in the system default run-time - # search path. - case " $sys_lib_dlsearch_path " in - *" $absdir "*) ;; - *) - case "$compile_rpath " in - *" $absdir "*) ;; - *) compile_rpath="$compile_rpath $absdir" - esac - ;; - esac - case " $sys_lib_dlsearch_path " in - *" $libdir "*) ;; - *) - case "$finalize_rpath " in - *" $libdir "*) ;; - *) finalize_rpath="$finalize_rpath $libdir" - esac - ;; - esac - fi # $linkmode,$pass = prog,link... - - if test "$alldeplibs" = yes && - { test "$deplibs_check_method" = pass_all || - { test "$build_libtool_libs" = yes && - test -n "$library_names"; }; }; then - # We only need to search for static libraries - continue - fi - fi - - link_static=no # Whether the deplib will be linked statically - use_static_libs=$prefer_static_libs - if test "$use_static_libs" = built && test "$installed" = yes ; then - use_static_libs=no - fi - if test -n "$library_names" && - { test "$use_static_libs" = no || test -z "$old_library"; }; then - if test "$installed" = no; then - notinst_deplibs="$notinst_deplibs $lib" - need_relink=yes - fi - # This is a shared library - - # Warn about portability, can't link against -module's on - # some systems (darwin) - if test "$shouldnotlink" = yes && test "$pass" = link ; then - $echo - if test "$linkmode" = prog; then - $echo "*** Warning: Linking the executable $output against the loadable module" - else - $echo "*** Warning: Linking the shared library $output against the loadable module" - fi - $echo "*** $linklib is not portable!" - fi - if test "$linkmode" = lib && - test "$hardcode_into_libs" = yes; then - # Hardcode the library path. - # Skip directories that are in the system default run-time - # search path. - case " $sys_lib_dlsearch_path " in - *" $absdir "*) ;; - *) - case "$compile_rpath " in - *" $absdir "*) ;; - *) compile_rpath="$compile_rpath $absdir" - esac - ;; - esac - case " $sys_lib_dlsearch_path " in - *" $libdir "*) ;; - *) - case "$finalize_rpath " in - *" $libdir "*) ;; - *) finalize_rpath="$finalize_rpath $libdir" - esac - ;; - esac - fi - - if test -n "$old_archive_from_expsyms_cmds"; then - # figure out the soname - set dummy $library_names - realname="$2" - shift; shift - libname=`eval \\$echo \"$libname_spec\"` - # use dlname if we got it. it's perfectly good, no? - if test -n "$dlname"; then - soname="$dlname" - elif test -n "$soname_spec"; then - # bleh windows - case $host in - *cygwin* | mingw*) - major=`expr $current - $age` - versuffix="-$major" - ;; - esac - eval soname=\"$soname_spec\" - else - soname="$realname" - fi - - # Make a new name for the extract_expsyms_cmds to use - soroot="$soname" - soname=`$echo $soroot | ${SED} -e 's/^.*\///'` - newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a" - - # If the library has no export list, then create one now - if test -f "$output_objdir/$soname-def"; then : - else - $show "extracting exported symbol list from \`$soname'" - save_ifs="$IFS"; IFS='~' - cmds=$extract_expsyms_cmds - for cmd in $cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - fi - - # Create $newlib - if test -f "$output_objdir/$newlib"; then :; else - $show "generating import library for \`$soname'" - save_ifs="$IFS"; IFS='~' - cmds=$old_archive_from_expsyms_cmds - for cmd in $cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - fi - # make sure the library variables are pointing to the new library - dir=$output_objdir - linklib=$newlib - fi # test -n "$old_archive_from_expsyms_cmds" - - if test "$linkmode" = prog || test "$mode" != relink; then - add_shlibpath= - add_dir= - add= - lib_linked=yes - case $hardcode_action in - immediate | unsupported) - if test "$hardcode_direct" = no; then - add="$dir/$linklib" - case $host in - *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;; - *-*-sysv4*uw2*) add_dir="-L$dir" ;; - *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ - *-*-unixware7*) add_dir="-L$dir" ;; - *-*-darwin* ) - # if the lib is a module then we can not link against - # it, someone is ignoring the new warnings I added - if /usr/bin/file -L $add 2> /dev/null | - $EGREP ": [^:]* bundle" >/dev/null ; then - $echo "** Warning, lib $linklib is a module, not a shared library" - if test -z "$old_library" ; then - $echo - $echo "** And there doesn't seem to be a static archive available" - $echo "** The link will probably fail, sorry" - else - add="$dir/$old_library" - fi - fi - esac - elif test "$hardcode_minus_L" = no; then - case $host in - *-*-sunos*) add_shlibpath="$dir" ;; - esac - add_dir="-L$dir" - add="-l$name" - elif test "$hardcode_shlibpath_var" = no; then - add_shlibpath="$dir" - add="-l$name" - else - lib_linked=no - fi - ;; - relink) - if test "$hardcode_direct" = yes; then - add="$dir/$linklib" - elif test "$hardcode_minus_L" = yes; then - add_dir="-L$dir" - # Try looking first in the location we're being installed to. - if test -n "$inst_prefix_dir"; then - case $libdir in - [\\/]*) - add_dir="$add_dir -L$inst_prefix_dir$libdir" - ;; - esac - fi - add="-l$name" - elif test "$hardcode_shlibpath_var" = yes; then - add_shlibpath="$dir" - add="-l$name" - else - lib_linked=no - fi - ;; - *) lib_linked=no ;; - esac - - if test "$lib_linked" != yes; then - $echo "$modename: configuration error: unsupported hardcode properties" - exit $EXIT_FAILURE - fi - - if test -n "$add_shlibpath"; then - case :$compile_shlibpath: in - *":$add_shlibpath:"*) ;; - *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;; - esac - fi - if test "$linkmode" = prog; then - test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" - test -n "$add" && compile_deplibs="$add $compile_deplibs" - else - test -n "$add_dir" && deplibs="$add_dir $deplibs" - test -n "$add" && deplibs="$add $deplibs" - if test "$hardcode_direct" != yes && \ - test "$hardcode_minus_L" != yes && \ - test "$hardcode_shlibpath_var" = yes; then - case :$finalize_shlibpath: in - *":$libdir:"*) ;; - *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; - esac - fi - fi - fi - - if test "$linkmode" = prog || test "$mode" = relink; then - add_shlibpath= - add_dir= - add= - # Finalize command for both is simple: just hardcode it. - if test "$hardcode_direct" = yes; then - add="$libdir/$linklib" - elif test "$hardcode_minus_L" = yes; then - add_dir="-L$libdir" - add="-l$name" - elif test "$hardcode_shlibpath_var" = yes; then - case :$finalize_shlibpath: in - *":$libdir:"*) ;; - *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; - esac - add="-l$name" - elif test "$hardcode_automatic" = yes; then - if test -n "$inst_prefix_dir" && - test -f "$inst_prefix_dir$libdir/$linklib" ; then - add="$inst_prefix_dir$libdir/$linklib" - else - add="$libdir/$linklib" - fi - else - # We cannot seem to hardcode it, guess we'll fake it. - add_dir="-L$libdir" - # Try looking first in the location we're being installed to. - if test -n "$inst_prefix_dir"; then - case $libdir in - [\\/]*) - add_dir="$add_dir -L$inst_prefix_dir$libdir" - ;; - esac - fi - add="-l$name" - fi - - if test "$linkmode" = prog; then - test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" - test -n "$add" && finalize_deplibs="$add $finalize_deplibs" - else - test -n "$add_dir" && deplibs="$add_dir $deplibs" - test -n "$add" && deplibs="$add $deplibs" - fi - fi - elif test "$linkmode" = prog; then - # Here we assume that one of hardcode_direct or hardcode_minus_L - # is not unsupported. This is valid on all known static and - # shared platforms. - if test "$hardcode_direct" != unsupported; then - test -n "$old_library" && linklib="$old_library" - compile_deplibs="$dir/$linklib $compile_deplibs" - finalize_deplibs="$dir/$linklib $finalize_deplibs" - else - compile_deplibs="-l$name -L$dir $compile_deplibs" - finalize_deplibs="-l$name -L$dir $finalize_deplibs" - fi - elif test "$build_libtool_libs" = yes; then - # Not a shared library - if test "$deplibs_check_method" != pass_all; then - # We're trying link a shared library against a static one - # but the system doesn't support it. - - # Just print a warning and add the library to dependency_libs so - # that the program can be linked against the static library. - $echo - $echo "*** Warning: This system can not link to static lib archive $lib." - $echo "*** I have the capability to make that library automatically link in when" - $echo "*** you link to this library. But I can only do this if you have a" - $echo "*** shared version of the library, which you do not appear to have." - if test "$module" = yes; then - $echo "*** But as you try to build a module library, libtool will still create " - $echo "*** a static module, that should work as long as the dlopening application" - $echo "*** is linked with the -dlopen flag to resolve symbols at runtime." - if test -z "$global_symbol_pipe"; then - $echo - $echo "*** However, this would only work if libtool was able to extract symbol" - $echo "*** lists from a program, using \`nm' or equivalent, but libtool could" - $echo "*** not find such a program. So, this module is probably useless." - $echo "*** \`nm' from GNU binutils and a full rebuild may help." - fi - if test "$build_old_libs" = no; then - build_libtool_libs=module - build_old_libs=yes - else - build_libtool_libs=no - fi - fi - else - deplibs="$dir/$old_library $deplibs" - link_static=yes - fi - fi # link shared/static library? - - if test "$linkmode" = lib; then - if test -n "$dependency_libs" && - { test "$hardcode_into_libs" != yes || - test "$build_old_libs" = yes || - test "$link_static" = yes; }; then - # Extract -R from dependency_libs - temp_deplibs= - for libdir in $dependency_libs; do - case $libdir in - -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'` - case " $xrpath " in - *" $temp_xrpath "*) ;; - *) xrpath="$xrpath $temp_xrpath";; - esac;; - *) temp_deplibs="$temp_deplibs $libdir";; - esac - done - dependency_libs="$temp_deplibs" - fi - - newlib_search_path="$newlib_search_path $absdir" - # Link against this library - test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" - # ... and its dependency_libs - tmp_libs= - for deplib in $dependency_libs; do - newdependency_libs="$deplib $newdependency_libs" - if test "X$duplicate_deps" = "Xyes" ; then - case "$tmp_libs " in - *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; - esac - fi - tmp_libs="$tmp_libs $deplib" - done - - if test "$link_all_deplibs" != no; then - # Add the search paths of all dependency libraries - for deplib in $dependency_libs; do - case $deplib in - -L*) path="$deplib" ;; - *.la) - dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'` - test "X$dir" = "X$deplib" && dir="." - # We need an absolute path. - case $dir in - [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; - *) - absdir=`cd "$dir" && pwd` - if test -z "$absdir"; then - $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2 - absdir="$dir" - fi - ;; - esac - if grep "^installed=no" $deplib > /dev/null; then - path="$absdir/$objdir" - else - eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` - if test -z "$libdir"; then - $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 - exit $EXIT_FAILURE - fi - if test "$absdir" != "$libdir"; then - $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2 - fi - path="$absdir" - fi - depdepl= - case $host in - *-*-darwin*) - # we do not want to link against static libs, - # but need to link against shared - eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` - eval deplibdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` - if test -n "$deplibrary_names" ; then - for tmp in $deplibrary_names ; do - depdepl=$tmp - done - if test -f "$deplibdir/$depdepl" ; then - depdepl="$deplibdir/$depdepl" - elif test -f "$path/$depdepl" ; then - depdepl="$path/$depdepl" - else - # Can't find it, oh well... - depdepl= - fi - # do not add paths which are already there - case " $newlib_search_path " in - *" $path "*) ;; - *) newlib_search_path="$newlib_search_path $path";; - esac - fi - path="" - ;; - *) - path="-L$path" - ;; - esac - ;; - -l*) - case $host in - *-*-darwin*) - # Again, we only want to link against shared libraries - eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"` - for tmp in $newlib_search_path ; do - if test -f "$tmp/lib$tmp_libs.dylib" ; then - eval depdepl="$tmp/lib$tmp_libs.dylib" - break - fi - done - path="" - ;; - *) continue ;; - esac - ;; - *) continue ;; - esac - case " $deplibs " in - *" $path "*) ;; - *) deplibs="$path $deplibs" ;; - esac - case " $deplibs " in - *" $depdepl "*) ;; - *) deplibs="$depdepl $deplibs" ;; - esac - done - fi # link_all_deplibs != no - fi # linkmode = lib - done # for deplib in $libs - dependency_libs="$newdependency_libs" - if test "$pass" = dlpreopen; then - # Link the dlpreopened libraries before other libraries - for deplib in $save_deplibs; do - deplibs="$deplib $deplibs" - done - fi - if test "$pass" != dlopen; then - if test "$pass" != conv; then - # Make sure lib_search_path contains only unique directories. - lib_search_path= - for dir in $newlib_search_path; do - case "$lib_search_path " in - *" $dir "*) ;; - *) lib_search_path="$lib_search_path $dir" ;; - esac - done - newlib_search_path= - fi - - if test "$linkmode,$pass" != "prog,link"; then - vars="deplibs" - else - vars="compile_deplibs finalize_deplibs" - fi - for var in $vars dependency_libs; do - # Add libraries to $var in reverse order - eval tmp_libs=\"\$$var\" - new_libs= - for deplib in $tmp_libs; do - # FIXME: Pedantically, this is the right thing to do, so - # that some nasty dependency loop isn't accidentally - # broken: - #new_libs="$deplib $new_libs" - # Pragmatically, this seems to cause very few problems in - # practice: - case $deplib in - -L*) new_libs="$deplib $new_libs" ;; - -R*) ;; - *) - # And here is the reason: when a library appears more - # than once as an explicit dependence of a library, or - # is implicitly linked in more than once by the - # compiler, it is considered special, and multiple - # occurrences thereof are not removed. Compare this - # with having the same library being listed as a - # dependency of multiple other libraries: in this case, - # we know (pedantically, we assume) the library does not - # need to be listed more than once, so we keep only the - # last copy. This is not always right, but it is rare - # enough that we require users that really mean to play - # such unportable linking tricks to link the library - # using -Wl,-lname, so that libtool does not consider it - # for duplicate removal. - case " $specialdeplibs " in - *" $deplib "*) new_libs="$deplib $new_libs" ;; - *) - case " $new_libs " in - *" $deplib "*) ;; - *) new_libs="$deplib $new_libs" ;; - esac - ;; - esac - ;; - esac - done - tmp_libs= - for deplib in $new_libs; do - case $deplib in - -L*) - case " $tmp_libs " in - *" $deplib "*) ;; - *) tmp_libs="$tmp_libs $deplib" ;; - esac - ;; - *) tmp_libs="$tmp_libs $deplib" ;; - esac - done - eval $var=\"$tmp_libs\" - done # for var - fi - # Last step: remove runtime libs from dependency_libs - # (they stay in deplibs) - tmp_libs= - for i in $dependency_libs ; do - case " $predeps $postdeps $compiler_lib_search_path " in - *" $i "*) - i="" - ;; - esac - if test -n "$i" ; then - tmp_libs="$tmp_libs $i" - fi - done - dependency_libs=$tmp_libs - done # for pass - if test "$linkmode" = prog; then - dlfiles="$newdlfiles" - dlprefiles="$newdlprefiles" - fi - - case $linkmode in - oldlib) - case " $deplibs" in - *\ -l* | *\ -L*) - $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2 ;; - esac - - if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then - $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2 - fi - - if test -n "$rpath"; then - $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2 - fi - - if test -n "$xrpath"; then - $echo "$modename: warning: \`-R' is ignored for archives" 1>&2 - fi - - if test -n "$vinfo"; then - $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2 - fi - - if test -n "$release"; then - $echo "$modename: warning: \`-release' is ignored for archives" 1>&2 - fi - - if test -n "$export_symbols" || test -n "$export_symbols_regex"; then - $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2 - fi - - # Now set the variables for building old libraries. - build_libtool_libs=no - oldlibs="$output" - objs="$objs$old_deplibs" - ;; - - lib) - # Make sure we only generate libraries of the form `libNAME.la'. - case $outputname in - lib*) - name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` - eval shared_ext=\"$shrext_cmds\" - eval libname=\"$libname_spec\" - ;; - *) - if test "$module" = no; then - $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - fi - if test "$need_lib_prefix" != no; then - # Add the "lib" prefix for modules if required - name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` - eval shared_ext=\"$shrext_cmds\" - eval libname=\"$libname_spec\" - else - libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` - fi - ;; - esac - - if test -n "$objs"; then - if test "$deplibs_check_method" != pass_all; then - $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1 - exit $EXIT_FAILURE - else - $echo - $echo "*** Warning: Linking the shared library $output against the non-libtool" - $echo "*** objects $objs is not portable!" - libobjs="$libobjs $objs" - fi - fi - - if test "$dlself" != no; then - $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2 - fi - - set dummy $rpath - if test "$#" -gt 2; then - $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2 - fi - install_libdir="$2" - - oldlibs= - if test -z "$rpath"; then - if test "$build_libtool_libs" = yes; then - # Building a libtool convenience library. - # Some compilers have problems with a `.al' extension so - # convenience libraries should have the same extension an - # archive normally would. - oldlibs="$output_objdir/$libname.$libext $oldlibs" - build_libtool_libs=convenience - build_old_libs=yes - fi - - if test -n "$vinfo"; then - $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2 - fi - - if test -n "$release"; then - $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2 - fi - else - - # Parse the version information argument. - save_ifs="$IFS"; IFS=':' - set dummy $vinfo 0 0 0 - IFS="$save_ifs" - - if test -n "$8"; then - $echo "$modename: too many parameters to \`-version-info'" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - fi - - # convert absolute version numbers to libtool ages - # this retains compatibility with .la files and attempts - # to make the code below a bit more comprehensible - - case $vinfo_number in - yes) - number_major="$2" - number_minor="$3" - number_revision="$4" - # - # There are really only two kinds -- those that - # use the current revision as the major version - # and those that subtract age and use age as - # a minor version. But, then there is irix - # which has an extra 1 added just for fun - # - case $version_type in - darwin|linux|osf|windows|none) - current=`expr $number_major + $number_minor` - age="$number_minor" - revision="$number_revision" - ;; - freebsd-aout|freebsd-elf|sunos) - current="$number_major" - revision="$number_minor" - age="0" - ;; - irix|nonstopux) - current=`expr $number_major + $number_minor` - age="$number_minor" - revision="$number_minor" - lt_irix_increment=no - ;; - *) - $echo "$modename: unknown library version type \`$version_type'" 1>&2 - $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 - exit $EXIT_FAILURE - ;; - esac - ;; - no) - current="$2" - revision="$3" - age="$4" - ;; - esac - - # Check that each of the things are valid numbers. - case $current in - 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; - *) - $echo "$modename: CURRENT \`$current' must be a nonnegative integer" 1>&2 - $echo "$modename: \`$vinfo' is not valid version information" 1>&2 - exit $EXIT_FAILURE - ;; - esac - - case $revision in - 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; - *) - $echo "$modename: REVISION \`$revision' must be a nonnegative integer" 1>&2 - $echo "$modename: \`$vinfo' is not valid version information" 1>&2 - exit $EXIT_FAILURE - ;; - esac - - case $age in - 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; - *) - $echo "$modename: AGE \`$age' must be a nonnegative integer" 1>&2 - $echo "$modename: \`$vinfo' is not valid version information" 1>&2 - exit $EXIT_FAILURE - ;; - esac - - if test "$age" -gt "$current"; then - $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2 - $echo "$modename: \`$vinfo' is not valid version information" 1>&2 - exit $EXIT_FAILURE - fi - - # Calculate the version variables. - major= - versuffix= - verstring= - case $version_type in - none) ;; - - darwin) - # Like Linux, but with the current version available in - # verstring for coding it into the library header - major=.`expr $current - $age` - versuffix="$major.$age.$revision" - # Darwin ld doesn't like 0 for these options... - minor_current=`expr $current + 1` - xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" - verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" - ;; - - freebsd-aout) - major=".$current" - versuffix=".$current.$revision"; - ;; - - freebsd-elf) - major=".$current" - versuffix=".$current"; - ;; - - irix | nonstopux) - if test "X$lt_irix_increment" = "Xno"; then - major=`expr $current - $age` - else - major=`expr $current - $age + 1` - fi - case $version_type in - nonstopux) verstring_prefix=nonstopux ;; - *) verstring_prefix=sgi ;; - esac - verstring="$verstring_prefix$major.$revision" - - # Add in all the interfaces that we are compatible with. - loop=$revision - while test "$loop" -ne 0; do - iface=`expr $revision - $loop` - loop=`expr $loop - 1` - verstring="$verstring_prefix$major.$iface:$verstring" - done - - # Before this point, $major must not contain `.'. - major=.$major - versuffix="$major.$revision" - ;; - - linux) - major=.`expr $current - $age` - versuffix="$major.$age.$revision" - ;; - - osf) - major=.`expr $current - $age` - versuffix=".$current.$age.$revision" - verstring="$current.$age.$revision" - - # Add in all the interfaces that we are compatible with. - loop=$age - while test "$loop" -ne 0; do - iface=`expr $current - $loop` - loop=`expr $loop - 1` - verstring="$verstring:${iface}.0" - done - - # Make executables depend on our current version. - verstring="$verstring:${current}.0" - ;; - - sunos) - major=".$current" - versuffix=".$current.$revision" - ;; - - windows) - # Use '-' rather than '.', since we only want one - # extension on DOS 8.3 filesystems. - major=`expr $current - $age` - versuffix="-$major" - ;; - - *) - $echo "$modename: unknown library version type \`$version_type'" 1>&2 - $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 - exit $EXIT_FAILURE - ;; - esac - - # Clear the version info if we defaulted, and they specified a release. - if test -z "$vinfo" && test -n "$release"; then - major= - case $version_type in - darwin) - # we can't check for "0.0" in archive_cmds due to quoting - # problems, so we reset it completely - verstring= - ;; - *) - verstring="0.0" - ;; - esac - if test "$need_version" = no; then - versuffix= - else - versuffix=".0.0" - fi - fi - - # Remove version info from name if versioning should be avoided - if test "$avoid_version" = yes && test "$need_version" = no; then - major= - versuffix= - verstring="" - fi - - # Check to see if the archive will have undefined symbols. - if test "$allow_undefined" = yes; then - if test "$allow_undefined_flag" = unsupported; then - $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2 - build_libtool_libs=no - build_old_libs=yes - fi - else - # Don't allow undefined symbols. - allow_undefined_flag="$no_undefined_flag" - fi - fi - - if test "$mode" != relink; then - # Remove our outputs, but don't remove object files since they - # may have been created when compiling PIC objects. - removelist= - tempremovelist=`$echo "$output_objdir/*"` - for p in $tempremovelist; do - case $p in - *.$objext) - ;; - $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) - if test "X$precious_files_regex" != "X"; then - if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 - then - continue - fi - fi - removelist="$removelist $p" - ;; - *) ;; - esac - done - if test -n "$removelist"; then - $show "${rm}r $removelist" - $run ${rm}r $removelist - fi - fi - - # Now set the variables for building old libraries. - if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then - oldlibs="$oldlibs $output_objdir/$libname.$libext" - - # Transform .lo files to .o files. - oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP` - fi - - # Eliminate all temporary directories. - #for path in $notinst_path; do - # lib_search_path=`$echo "$lib_search_path " | ${SED} -e "s% $path % %g"` - # deplibs=`$echo "$deplibs " | ${SED} -e "s% -L$path % %g"` - # dependency_libs=`$echo "$dependency_libs " | ${SED} -e "s% -L$path % %g"` - #done - - if test -n "$xrpath"; then - # If the user specified any rpath flags, then add them. - temp_xrpath= - for libdir in $xrpath; do - temp_xrpath="$temp_xrpath -R$libdir" - case "$finalize_rpath " in - *" $libdir "*) ;; - *) finalize_rpath="$finalize_rpath $libdir" ;; - esac - done - if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then - dependency_libs="$temp_xrpath $dependency_libs" - fi - fi - - # Make sure dlfiles contains only unique files that won't be dlpreopened - old_dlfiles="$dlfiles" - dlfiles= - for lib in $old_dlfiles; do - case " $dlprefiles $dlfiles " in - *" $lib "*) ;; - *) dlfiles="$dlfiles $lib" ;; - esac - done - - # Make sure dlprefiles contains only unique files - old_dlprefiles="$dlprefiles" - dlprefiles= - for lib in $old_dlprefiles; do - case "$dlprefiles " in - *" $lib "*) ;; - *) dlprefiles="$dlprefiles $lib" ;; - esac - done - - if test "$build_libtool_libs" = yes; then - if test -n "$rpath"; then - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*) - # these systems don't actually have a c library (as such)! - ;; - *-*-rhapsody* | *-*-darwin1.[012]) - # Rhapsody C library is in the System framework - deplibs="$deplibs -framework System" - ;; - *-*-netbsd*) - # Don't link with libc until the a.out ld.so is fixed. - ;; - *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) - # Do not include libc due to us having libc/libc_r. - ;; - *-*-sco3.2v5* | *-*-sco5v6*) - # Causes problems with __ctype - ;; - *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) - # Compiler inserts libc in the correct place for threads to work - ;; - *) - # Add libc to deplibs on all other systems if necessary. - if test "$build_libtool_need_lc" = "yes"; then - deplibs="$deplibs -lc" - fi - ;; - esac - fi - - # Transform deplibs into only deplibs that can be linked in shared. - name_save=$name - libname_save=$libname - release_save=$release - versuffix_save=$versuffix - major_save=$major - # I'm not sure if I'm treating the release correctly. I think - # release should show up in the -l (ie -lgmp5) so we don't want to - # add it in twice. Is that correct? - release="" - versuffix="" - major="" - newdeplibs= - droppeddeps=no - case $deplibs_check_method in - pass_all) - # Don't check for shared/static. Everything works. - # This might be a little naive. We might want to check - # whether the library exists or not. But this is on - # osf3 & osf4 and I'm not really sure... Just - # implementing what was already the behavior. - newdeplibs=$deplibs - ;; - test_compile) - # This code stresses the "libraries are programs" paradigm to its - # limits. Maybe even breaks it. We compile a program, linking it - # against the deplibs as a proxy for the library. Then we can check - # whether they linked in statically or dynamically with ldd. - $rm conftest.c - cat > conftest.c <<EOF - int main() { return 0; } -EOF - $rm conftest - if $LTCC $LTCFLAGS -o conftest conftest.c $deplibs; then - ldd_output=`ldd conftest` - for i in $deplibs; do - name=`expr $i : '-l\(.*\)'` - # If $name is empty we are operating on a -L argument. - if test "$name" != "" && test "$name" != "0"; then - if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then - case " $predeps $postdeps " in - *" $i "*) - newdeplibs="$newdeplibs $i" - i="" - ;; - esac - fi - if test -n "$i" ; then - libname=`eval \\$echo \"$libname_spec\"` - deplib_matches=`eval \\$echo \"$library_names_spec\"` - set dummy $deplib_matches - deplib_match=$2 - if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then - newdeplibs="$newdeplibs $i" - else - droppeddeps=yes - $echo - $echo "*** Warning: dynamic linker does not accept needed library $i." - $echo "*** I have the capability to make that library automatically link in when" - $echo "*** you link to this library. But I can only do this if you have a" - $echo "*** shared version of the library, which I believe you do not have" - $echo "*** because a test_compile did reveal that the linker did not use it for" - $echo "*** its dynamic dependency list that programs get resolved with at runtime." - fi - fi - else - newdeplibs="$newdeplibs $i" - fi - done - else - # Error occurred in the first compile. Let's try to salvage - # the situation: Compile a separate program for each library. - for i in $deplibs; do - name=`expr $i : '-l\(.*\)'` - # If $name is empty we are operating on a -L argument. - if test "$name" != "" && test "$name" != "0"; then - $rm conftest - if $LTCC $LTCFLAGS -o conftest conftest.c $i; then - ldd_output=`ldd conftest` - if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then - case " $predeps $postdeps " in - *" $i "*) - newdeplibs="$newdeplibs $i" - i="" - ;; - esac - fi - if test -n "$i" ; then - libname=`eval \\$echo \"$libname_spec\"` - deplib_matches=`eval \\$echo \"$library_names_spec\"` - set dummy $deplib_matches - deplib_match=$2 - if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then - newdeplibs="$newdeplibs $i" - else - droppeddeps=yes - $echo - $echo "*** Warning: dynamic linker does not accept needed library $i." - $echo "*** I have the capability to make that library automatically link in when" - $echo "*** you link to this library. But I can only do this if you have a" - $echo "*** shared version of the library, which you do not appear to have" - $echo "*** because a test_compile did reveal that the linker did not use this one" - $echo "*** as a dynamic dependency that programs can get resolved with at runtime." - fi - fi - else - droppeddeps=yes - $echo - $echo "*** Warning! Library $i is needed by this library but I was not able to" - $echo "*** make it link in! You will probably need to install it or some" - $echo "*** library that it depends on before this library will be fully" - $echo "*** functional. Installing it before continuing would be even better." - fi - else - newdeplibs="$newdeplibs $i" - fi - done - fi - ;; - file_magic*) - set dummy $deplibs_check_method - file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` - for a_deplib in $deplibs; do - name=`expr $a_deplib : '-l\(.*\)'` - # If $name is empty we are operating on a -L argument. - if test "$name" != "" && test "$name" != "0"; then - if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then - case " $predeps $postdeps " in - *" $a_deplib "*) - newdeplibs="$newdeplibs $a_deplib" - a_deplib="" - ;; - esac - fi - if test -n "$a_deplib" ; then - libname=`eval \\$echo \"$libname_spec\"` - for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do - potential_libs=`ls $i/$libname[.-]* 2>/dev/null` - for potent_lib in $potential_libs; do - # Follow soft links. - if ls -lLd "$potent_lib" 2>/dev/null \ - | grep " -> " >/dev/null; then - continue - fi - # The statement above tries to avoid entering an - # endless loop below, in case of cyclic links. - # We might still enter an endless loop, since a link - # loop can be closed while we follow links, - # but so what? - potlib="$potent_lib" - while test -h "$potlib" 2>/dev/null; do - potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` - case $potliblink in - [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; - *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";; - esac - done - if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \ - | ${SED} 10q \ - | $EGREP "$file_magic_regex" > /dev/null; then - newdeplibs="$newdeplibs $a_deplib" - a_deplib="" - break 2 - fi - done - done - fi - if test -n "$a_deplib" ; then - droppeddeps=yes - $echo - $echo "*** Warning: linker path does not have real file for library $a_deplib." - $echo "*** I have the capability to make that library automatically link in when" - $echo "*** you link to this library. But I can only do this if you have a" - $echo "*** shared version of the library, which you do not appear to have" - $echo "*** because I did check the linker path looking for a file starting" - if test -z "$potlib" ; then - $echo "*** with $libname but no candidates were found. (...for file magic test)" - else - $echo "*** with $libname and none of the candidates passed a file format test" - $echo "*** using a file magic. Last file checked: $potlib" - fi - fi - else - # Add a -L argument. - newdeplibs="$newdeplibs $a_deplib" - fi - done # Gone through all deplibs. - ;; - match_pattern*) - set dummy $deplibs_check_method - match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` - for a_deplib in $deplibs; do - name=`expr $a_deplib : '-l\(.*\)'` - # If $name is empty we are operating on a -L argument. - if test -n "$name" && test "$name" != "0"; then - if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then - case " $predeps $postdeps " in - *" $a_deplib "*) - newdeplibs="$newdeplibs $a_deplib" - a_deplib="" - ;; - esac - fi - if test -n "$a_deplib" ; then - libname=`eval \\$echo \"$libname_spec\"` - for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do - potential_libs=`ls $i/$libname[.-]* 2>/dev/null` - for potent_lib in $potential_libs; do - potlib="$potent_lib" # see symlink-check above in file_magic test - if eval $echo \"$potent_lib\" 2>/dev/null \ - | ${SED} 10q \ - | $EGREP "$match_pattern_regex" > /dev/null; then - newdeplibs="$newdeplibs $a_deplib" - a_deplib="" - break 2 - fi - done - done - fi - if test -n "$a_deplib" ; then - droppeddeps=yes - $echo - $echo "*** Warning: linker path does not have real file for library $a_deplib." - $echo "*** I have the capability to make that library automatically link in when" - $echo "*** you link to this library. But I can only do this if you have a" - $echo "*** shared version of the library, which you do not appear to have" - $echo "*** because I did check the linker path looking for a file starting" - if test -z "$potlib" ; then - $echo "*** with $libname but no candidates were found. (...for regex pattern test)" - else - $echo "*** with $libname and none of the candidates passed a file format test" - $echo "*** using a regex pattern. Last file checked: $potlib" - fi - fi - else - # Add a -L argument. - newdeplibs="$newdeplibs $a_deplib" - fi - done # Gone through all deplibs. - ;; - none | unknown | *) - newdeplibs="" - tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \ - -e 's/ -[LR][^ ]*//g'` - if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then - for i in $predeps $postdeps ; do - # can't use Xsed below, because $i might contain '/' - tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"` - done - fi - if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \ - | grep . >/dev/null; then - $echo - if test "X$deplibs_check_method" = "Xnone"; then - $echo "*** Warning: inter-library dependencies are not supported in this platform." - else - $echo "*** Warning: inter-library dependencies are not known to be supported." - fi - $echo "*** All declared inter-library dependencies are being dropped." - droppeddeps=yes - fi - ;; - esac - versuffix=$versuffix_save - major=$major_save - release=$release_save - libname=$libname_save - name=$name_save - - case $host in - *-*-rhapsody* | *-*-darwin1.[012]) - # On Rhapsody replace the C library is the System framework - newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'` - ;; - esac - - if test "$droppeddeps" = yes; then - if test "$module" = yes; then - $echo - $echo "*** Warning: libtool could not satisfy all declared inter-library" - $echo "*** dependencies of module $libname. Therefore, libtool will create" - $echo "*** a static module, that should work as long as the dlopening" - $echo "*** application is linked with the -dlopen flag." - if test -z "$global_symbol_pipe"; then - $echo - $echo "*** However, this would only work if libtool was able to extract symbol" - $echo "*** lists from a program, using \`nm' or equivalent, but libtool could" - $echo "*** not find such a program. So, this module is probably useless." - $echo "*** \`nm' from GNU binutils and a full rebuild may help." - fi - if test "$build_old_libs" = no; then - oldlibs="$output_objdir/$libname.$libext" - build_libtool_libs=module - build_old_libs=yes - else - build_libtool_libs=no - fi - else - $echo "*** The inter-library dependencies that have been dropped here will be" - $echo "*** automatically added whenever a program is linked with this library" - $echo "*** or is declared to -dlopen it." - - if test "$allow_undefined" = no; then - $echo - $echo "*** Since this library must not contain undefined symbols," - $echo "*** because either the platform does not support them or" - $echo "*** it was explicitly requested with -no-undefined," - $echo "*** libtool will only create a static version of it." - if test "$build_old_libs" = no; then - oldlibs="$output_objdir/$libname.$libext" - build_libtool_libs=module - build_old_libs=yes - else - build_libtool_libs=no - fi - fi - fi - fi - # Done checking deplibs! - deplibs=$newdeplibs - fi - - - # move library search paths that coincide with paths to not yet - # installed libraries to the beginning of the library search list - new_libs= - for path in $notinst_path; do - case " $new_libs " in - *" -L$path/$objdir "*) ;; - *) - case " $deplibs " in - *" -L$path/$objdir "*) - new_libs="$new_libs -L$path/$objdir" ;; - esac - ;; - esac - done - for deplib in $deplibs; do - case $deplib in - -L*) - case " $new_libs " in - *" $deplib "*) ;; - *) new_libs="$new_libs $deplib" ;; - esac - ;; - *) new_libs="$new_libs $deplib" ;; - esac - done - deplibs="$new_libs" - - - # All the library-specific variables (install_libdir is set above). - library_names= - old_library= - dlname= - - # Test again, we may have decided not to build it any more - if test "$build_libtool_libs" = yes; then - if test "$hardcode_into_libs" = yes; then - # Hardcode the library paths - hardcode_libdirs= - dep_rpath= - rpath="$finalize_rpath" - test "$mode" != relink && rpath="$compile_rpath$rpath" - for libdir in $rpath; do - if test -n "$hardcode_libdir_flag_spec"; then - if test -n "$hardcode_libdir_separator"; then - if test -z "$hardcode_libdirs"; then - hardcode_libdirs="$libdir" - else - # Just accumulate the unique libdirs. - case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in - *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) - ;; - *) - hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" - ;; - esac - fi - else - eval flag=\"$hardcode_libdir_flag_spec\" - dep_rpath="$dep_rpath $flag" - fi - elif test -n "$runpath_var"; then - case "$perm_rpath " in - *" $libdir "*) ;; - *) perm_rpath="$perm_rpath $libdir" ;; - esac - fi - done - # Substitute the hardcoded libdirs into the rpath. - if test -n "$hardcode_libdir_separator" && - test -n "$hardcode_libdirs"; then - libdir="$hardcode_libdirs" - if test -n "$hardcode_libdir_flag_spec_ld"; then - case $archive_cmds in - *\$LD*) eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" ;; - *) eval dep_rpath=\"$hardcode_libdir_flag_spec\" ;; - esac - else - eval dep_rpath=\"$hardcode_libdir_flag_spec\" - fi - fi - if test -n "$runpath_var" && test -n "$perm_rpath"; then - # We should set the runpath_var. - rpath= - for dir in $perm_rpath; do - rpath="$rpath$dir:" - done - eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" - fi - test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" - fi - - shlibpath="$finalize_shlibpath" - test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath" - if test -n "$shlibpath"; then - eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" - fi - - # Get the real and link names of the library. - eval shared_ext=\"$shrext_cmds\" - eval library_names=\"$library_names_spec\" - set dummy $library_names - realname="$2" - shift; shift - - if test -n "$soname_spec"; then - eval soname=\"$soname_spec\" - else - soname="$realname" - fi - if test -z "$dlname"; then - dlname=$soname - fi - - lib="$output_objdir/$realname" - linknames= - for link - do - linknames="$linknames $link" - done - - # Use standard objects if they are pic - test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` - - # Prepare the list of exported symbols - if test -z "$export_symbols"; then - if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then - $show "generating symbol list for \`$libname.la'" - export_symbols="$output_objdir/$libname.exp" - $run $rm $export_symbols - cmds=$export_symbols_cmds - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - if len=`expr "X$cmd" : ".*"` && - test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then - $show "$cmd" - $run eval "$cmd" || exit $? - skipped_export=false - else - # The command line is too long to execute in one step. - $show "using reloadable object file for export list..." - skipped_export=: - # Break out early, otherwise skipped_export may be - # set to false by a later but shorter cmd. - break - fi - done - IFS="$save_ifs" - if test -n "$export_symbols_regex"; then - $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\"" - $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' - $show "$mv \"${export_symbols}T\" \"$export_symbols\"" - $run eval '$mv "${export_symbols}T" "$export_symbols"' - fi - fi - fi - - if test -n "$export_symbols" && test -n "$include_expsyms"; then - $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"' - fi - - tmp_deplibs= - for test_deplib in $deplibs; do - case " $convenience " in - *" $test_deplib "*) ;; - *) - tmp_deplibs="$tmp_deplibs $test_deplib" - ;; - esac - done - deplibs="$tmp_deplibs" - - if test -n "$convenience"; then - if test -n "$whole_archive_flag_spec"; then - save_libobjs=$libobjs - eval libobjs=\"\$libobjs $whole_archive_flag_spec\" - else - gentop="$output_objdir/${outputname}x" - generated="$generated $gentop" - - func_extract_archives $gentop $convenience - libobjs="$libobjs $func_extract_archives_result" - fi - fi - - if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then - eval flag=\"$thread_safe_flag_spec\" - linker_flags="$linker_flags $flag" - fi - - # Make a backup of the uninstalled library when relinking - if test "$mode" = relink; then - $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $? - fi - - # Do each of the archive commands. - if test "$module" = yes && test -n "$module_cmds" ; then - if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then - eval test_cmds=\"$module_expsym_cmds\" - cmds=$module_expsym_cmds - else - eval test_cmds=\"$module_cmds\" - cmds=$module_cmds - fi - else - if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then - eval test_cmds=\"$archive_expsym_cmds\" - cmds=$archive_expsym_cmds - else - eval test_cmds=\"$archive_cmds\" - cmds=$archive_cmds - fi - fi - - if test "X$skipped_export" != "X:" && - len=`expr "X$test_cmds" : ".*" 2>/dev/null` && - test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then - : - else - # The command line is too long to link in one step, link piecewise. - $echo "creating reloadable object files..." - - # Save the value of $output and $libobjs because we want to - # use them later. If we have whole_archive_flag_spec, we - # want to use save_libobjs as it was before - # whole_archive_flag_spec was expanded, because we can't - # assume the linker understands whole_archive_flag_spec. - # This may have to be revisited, in case too many - # convenience libraries get linked in and end up exceeding - # the spec. - if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then - save_libobjs=$libobjs - fi - save_output=$output - output_la=`$echo "X$output" | $Xsed -e "$basename"` - - # Clear the reloadable object creation command queue and - # initialize k to one. - test_cmds= - concat_cmds= - objlist= - delfiles= - last_robj= - k=1 - output=$output_objdir/$output_la-${k}.$objext - # Loop over the list of objects to be linked. - for obj in $save_libobjs - do - eval test_cmds=\"$reload_cmds $objlist $last_robj\" - if test "X$objlist" = X || - { len=`expr "X$test_cmds" : ".*" 2>/dev/null` && - test "$len" -le "$max_cmd_len"; }; then - objlist="$objlist $obj" - else - # The command $test_cmds is almost too long, add a - # command to the queue. - if test "$k" -eq 1 ; then - # The first file doesn't have a previous command to add. - eval concat_cmds=\"$reload_cmds $objlist $last_robj\" - else - # All subsequent reloadable object files will link in - # the last one created. - eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\" - fi - last_robj=$output_objdir/$output_la-${k}.$objext - k=`expr $k + 1` - output=$output_objdir/$output_la-${k}.$objext - objlist=$obj - len=1 - fi - done - # Handle the remaining objects by creating one last - # reloadable object file. All subsequent reloadable object - # files will link in the last one created. - test -z "$concat_cmds" || concat_cmds=$concat_cmds~ - eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\" - - if ${skipped_export-false}; then - $show "generating symbol list for \`$libname.la'" - export_symbols="$output_objdir/$libname.exp" - $run $rm $export_symbols - libobjs=$output - # Append the command to create the export file. - eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\" - fi - - # Set up a command to remove the reloadable object files - # after they are used. - i=0 - while test "$i" -lt "$k" - do - i=`expr $i + 1` - delfiles="$delfiles $output_objdir/$output_la-${i}.$objext" - done - - $echo "creating a temporary reloadable object file: $output" - - # Loop through the commands generated above and execute them. - save_ifs="$IFS"; IFS='~' - for cmd in $concat_cmds; do - IFS="$save_ifs" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - - libobjs=$output - # Restore the value of output. - output=$save_output - - if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then - eval libobjs=\"\$libobjs $whole_archive_flag_spec\" - fi - # Expand the library linking commands again to reset the - # value of $libobjs for piecewise linking. - - # Do each of the archive commands. - if test "$module" = yes && test -n "$module_cmds" ; then - if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then - cmds=$module_expsym_cmds - else - cmds=$module_cmds - fi - else - if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then - cmds=$archive_expsym_cmds - else - cmds=$archive_cmds - fi - fi - - # Append the command to remove the reloadable object files - # to the just-reset $cmds. - eval cmds=\"\$cmds~\$rm $delfiles\" - fi - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - $show "$cmd" - $run eval "$cmd" || { - lt_exit=$? - - # Restore the uninstalled library and exit - if test "$mode" = relink; then - $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)' - fi - - exit $lt_exit - } - done - IFS="$save_ifs" - - # Restore the uninstalled library and exit - if test "$mode" = relink; then - $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $? - - if test -n "$convenience"; then - if test -z "$whole_archive_flag_spec"; then - $show "${rm}r $gentop" - $run ${rm}r "$gentop" - fi - fi - - exit $EXIT_SUCCESS - fi - - # Create links to the real library. - for linkname in $linknames; do - if test "$realname" != "$linkname"; then - $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)" - $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $? - fi - done - - # If -module or -export-dynamic was specified, set the dlname. - if test "$module" = yes || test "$export_dynamic" = yes; then - # On all known operating systems, these are identical. - dlname="$soname" - fi - fi - ;; - - obj) - case " $deplibs" in - *\ -l* | *\ -L*) - $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2 ;; - esac - - if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then - $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2 - fi - - if test -n "$rpath"; then - $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2 - fi - - if test -n "$xrpath"; then - $echo "$modename: warning: \`-R' is ignored for objects" 1>&2 - fi - - if test -n "$vinfo"; then - $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2 - fi - - if test -n "$release"; then - $echo "$modename: warning: \`-release' is ignored for objects" 1>&2 - fi - - case $output in - *.lo) - if test -n "$objs$old_deplibs"; then - $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2 - exit $EXIT_FAILURE - fi - libobj="$output" - obj=`$echo "X$output" | $Xsed -e "$lo2o"` - ;; - *) - libobj= - obj="$output" - ;; - esac - - # Delete the old objects. - $run $rm $obj $libobj - - # Objects from convenience libraries. This assumes - # single-version convenience libraries. Whenever we create - # different ones for PIC/non-PIC, this we'll have to duplicate - # the extraction. - reload_conv_objs= - gentop= - # reload_cmds runs $LD directly, so let us get rid of - # -Wl from whole_archive_flag_spec and hope we can get by with - # turning comma into space.. - wl= - - if test -n "$convenience"; then - if test -n "$whole_archive_flag_spec"; then - eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" - reload_conv_objs=$reload_objs\ `$echo "X$tmp_whole_archive_flags" | $Xsed -e 's|,| |g'` - else - gentop="$output_objdir/${obj}x" - generated="$generated $gentop" - - func_extract_archives $gentop $convenience - reload_conv_objs="$reload_objs $func_extract_archives_result" - fi - fi - - # Create the old-style object. - reload_objs="$objs$old_deplibs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test - - output="$obj" - cmds=$reload_cmds - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - - # Exit if we aren't doing a library object file. - if test -z "$libobj"; then - if test -n "$gentop"; then - $show "${rm}r $gentop" - $run ${rm}r $gentop - fi - - exit $EXIT_SUCCESS - fi - - if test "$build_libtool_libs" != yes; then - if test -n "$gentop"; then - $show "${rm}r $gentop" - $run ${rm}r $gentop - fi - - # Create an invalid libtool object if no PIC, so that we don't - # accidentally link it into a program. - # $show "echo timestamp > $libobj" - # $run eval "echo timestamp > $libobj" || exit $? - exit $EXIT_SUCCESS - fi - - if test -n "$pic_flag" || test "$pic_mode" != default; then - # Only do commands if we really have different PIC objects. - reload_objs="$libobjs $reload_conv_objs" - output="$libobj" - cmds=$reload_cmds - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - fi - - if test -n "$gentop"; then - $show "${rm}r $gentop" - $run ${rm}r $gentop - fi - - exit $EXIT_SUCCESS - ;; - - prog) - case $host in - *cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;; - esac - if test -n "$vinfo"; then - $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2 - fi - - if test -n "$release"; then - $echo "$modename: warning: \`-release' is ignored for programs" 1>&2 - fi - - if test "$preload" = yes; then - if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown && - test "$dlopen_self_static" = unknown; then - $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support." - fi - fi - - case $host in - *-*-rhapsody* | *-*-darwin1.[012]) - # On Rhapsody replace the C library is the System framework - compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'` - finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'` - ;; - esac - - case $host in - *darwin*) - # Don't allow lazy linking, it breaks C++ global constructors - if test "$tagname" = CXX ; then - compile_command="$compile_command ${wl}-bind_at_load" - finalize_command="$finalize_command ${wl}-bind_at_load" - fi - ;; - esac - - - # move library search paths that coincide with paths to not yet - # installed libraries to the beginning of the library search list - new_libs= - for path in $notinst_path; do - case " $new_libs " in - *" -L$path/$objdir "*) ;; - *) - case " $compile_deplibs " in - *" -L$path/$objdir "*) - new_libs="$new_libs -L$path/$objdir" ;; - esac - ;; - esac - done - for deplib in $compile_deplibs; do - case $deplib in - -L*) - case " $new_libs " in - *" $deplib "*) ;; - *) new_libs="$new_libs $deplib" ;; - esac - ;; - *) new_libs="$new_libs $deplib" ;; - esac - done - compile_deplibs="$new_libs" - - - compile_command="$compile_command $compile_deplibs" - finalize_command="$finalize_command $finalize_deplibs" - - if test -n "$rpath$xrpath"; then - # If the user specified any rpath flags, then add them. - for libdir in $rpath $xrpath; do - # This is the magic to use -rpath. - case "$finalize_rpath " in - *" $libdir "*) ;; - *) finalize_rpath="$finalize_rpath $libdir" ;; - esac - done - fi - - # Now hardcode the library paths - rpath= - hardcode_libdirs= - for libdir in $compile_rpath $finalize_rpath; do - if test -n "$hardcode_libdir_flag_spec"; then - if test -n "$hardcode_libdir_separator"; then - if test -z "$hardcode_libdirs"; then - hardcode_libdirs="$libdir" - else - # Just accumulate the unique libdirs. - case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in - *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) - ;; - *) - hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" - ;; - esac - fi - else - eval flag=\"$hardcode_libdir_flag_spec\" - rpath="$rpath $flag" - fi - elif test -n "$runpath_var"; then - case "$perm_rpath " in - *" $libdir "*) ;; - *) perm_rpath="$perm_rpath $libdir" ;; - esac - fi - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) - testbindir=`$echo "X$libdir" | $Xsed -e 's*/lib$*/bin*'` - case :$dllsearchpath: in - *":$libdir:"*) ;; - *) dllsearchpath="$dllsearchpath:$libdir";; - esac - case :$dllsearchpath: in - *":$testbindir:"*) ;; - *) dllsearchpath="$dllsearchpath:$testbindir";; - esac - ;; - esac - done - # Substitute the hardcoded libdirs into the rpath. - if test -n "$hardcode_libdir_separator" && - test -n "$hardcode_libdirs"; then - libdir="$hardcode_libdirs" - eval rpath=\" $hardcode_libdir_flag_spec\" - fi - compile_rpath="$rpath" - - rpath= - hardcode_libdirs= - for libdir in $finalize_rpath; do - if test -n "$hardcode_libdir_flag_spec"; then - if test -n "$hardcode_libdir_separator"; then - if test -z "$hardcode_libdirs"; then - hardcode_libdirs="$libdir" - else - # Just accumulate the unique libdirs. - case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in - *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) - ;; - *) - hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" - ;; - esac - fi - else - eval flag=\"$hardcode_libdir_flag_spec\" - rpath="$rpath $flag" - fi - elif test -n "$runpath_var"; then - case "$finalize_perm_rpath " in - *" $libdir "*) ;; - *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;; - esac - fi - done - # Substitute the hardcoded libdirs into the rpath. - if test -n "$hardcode_libdir_separator" && - test -n "$hardcode_libdirs"; then - libdir="$hardcode_libdirs" - eval rpath=\" $hardcode_libdir_flag_spec\" - fi - finalize_rpath="$rpath" - - if test -n "$libobjs" && test "$build_old_libs" = yes; then - # Transform all the library objects into standard objects. - compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` - finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` - fi - - dlsyms= - if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then - if test -n "$NM" && test -n "$global_symbol_pipe"; then - dlsyms="${outputname}S.c" - else - $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2 - fi - fi - - if test -n "$dlsyms"; then - case $dlsyms in - "") ;; - *.c) - # Discover the nlist of each of the dlfiles. - nlist="$output_objdir/${outputname}.nm" - - $show "$rm $nlist ${nlist}S ${nlist}T" - $run $rm "$nlist" "${nlist}S" "${nlist}T" - - # Parse the name list into a source file. - $show "creating $output_objdir/$dlsyms" - - test -z "$run" && $echo > "$output_objdir/$dlsyms" "\ -/* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */ -/* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */ - -#ifdef __cplusplus -extern \"C\" { -#endif - -/* Prevent the only kind of declaration conflicts we can make. */ -#define lt_preloaded_symbols some_other_symbol - -/* External symbol declarations for the compiler. */\ -" - - if test "$dlself" = yes; then - $show "generating symbol list for \`$output'" - - test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist" - - # Add our own program objects to the symbol list. - progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` - for arg in $progfiles; do - $show "extracting global C symbols from \`$arg'" - $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" - done - - if test -n "$exclude_expsyms"; then - $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' - $run eval '$mv "$nlist"T "$nlist"' - fi - - if test -n "$export_symbols_regex"; then - $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' - $run eval '$mv "$nlist"T "$nlist"' - fi - - # Prepare the list of exported symbols - if test -z "$export_symbols"; then - export_symbols="$output_objdir/$outputname.exp" - $run $rm $export_symbols - $run eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' - case $host in - *cygwin* | *mingw* ) - $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' - $run eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' - ;; - esac - else - $run eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' - $run eval 'grep -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' - $run eval 'mv "$nlist"T "$nlist"' - case $host in - *cygwin* | *mingw* ) - $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' - $run eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' - ;; - esac - fi - fi - - for arg in $dlprefiles; do - $show "extracting global C symbols from \`$arg'" - name=`$echo "$arg" | ${SED} -e 's%^.*/%%'` - $run eval '$echo ": $name " >> "$nlist"' - $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" - done - - if test -z "$run"; then - # Make sure we have at least an empty file. - test -f "$nlist" || : > "$nlist" - - if test -n "$exclude_expsyms"; then - $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T - $mv "$nlist"T "$nlist" - fi - - # Try sorting and uniquifying the output. - if grep -v "^: " < "$nlist" | - if sort -k 3 </dev/null >/dev/null 2>&1; then - sort -k 3 - else - sort +2 - fi | - uniq > "$nlist"S; then - : - else - grep -v "^: " < "$nlist" > "$nlist"S - fi - - if test -f "$nlist"S; then - eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"' - else - $echo '/* NONE */' >> "$output_objdir/$dlsyms" - fi - - $echo >> "$output_objdir/$dlsyms" "\ - -#undef lt_preloaded_symbols - -#if defined (__STDC__) && __STDC__ -# define lt_ptr void * -#else -# define lt_ptr char * -# define const -#endif - -/* The mapping between symbol names and symbols. */ -" - - case $host in - *cygwin* | *mingw* ) - $echo >> "$output_objdir/$dlsyms" "\ -/* DATA imports from DLLs on WIN32 can't be const, because - runtime relocations are performed -- see ld's documentation - on pseudo-relocs */ -struct { -" - ;; - * ) - $echo >> "$output_objdir/$dlsyms" "\ -const struct { -" - ;; - esac - - - $echo >> "$output_objdir/$dlsyms" "\ - const char *name; - lt_ptr address; -} -lt_preloaded_symbols[] = -{\ -" - - eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms" - - $echo >> "$output_objdir/$dlsyms" "\ - {0, (lt_ptr) 0} -}; - -/* This works around a problem in FreeBSD linker */ -#ifdef FREEBSD_WORKAROUND -static const void *lt_preloaded_setup() { - return lt_preloaded_symbols; -} -#endif - -#ifdef __cplusplus -} -#endif\ -" - fi - - pic_flag_for_symtable= - case $host in - # compiling the symbol table file with pic_flag works around - # a FreeBSD bug that causes programs to crash when -lm is - # linked before any other PIC object. But we must not use - # pic_flag when linking with -static. The problem exists in - # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. - *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) - case "$compile_command " in - *" -static "*) ;; - *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";; - esac;; - *-*-hpux*) - case "$compile_command " in - *" -static "*) ;; - *) pic_flag_for_symtable=" $pic_flag";; - esac - esac - - # Now compile the dynamic symbol file. - $show "(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")" - $run eval '(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $? - - # Clean up the generated files. - $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T" - $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T" - - # Transform the symbol file into the correct name. - case $host in - *cygwin* | *mingw* ) - if test -f "$output_objdir/${outputname}.def" ; then - compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%" | $NL2SP` - finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%" | $NL2SP` - else - compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP` - finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP` - fi - ;; - * ) - compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP` - finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP` - ;; - esac - ;; - *) - $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2 - exit $EXIT_FAILURE - ;; - esac - else - # We keep going just in case the user didn't refer to - # lt_preloaded_symbols. The linker will fail if global_symbol_pipe - # really was required. - - # Nullify the symbol file. - compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s% @SYMFILE@%%" | $NL2SP` - finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s% @SYMFILE@%%" | $NL2SP` - fi - - if test "$need_relink" = no || test "$build_libtool_libs" != yes; then - # Replace the output file specification. - compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e 's%@OUTPUT@%'"$output"'%g' | $NL2SP` - link_command="$compile_command$compile_rpath" - - # We have no uninstalled library dependencies, so finalize right now. - $show "$link_command" - $run eval "$link_command" - exit_status=$? - - # Delete the generated files. - if test -n "$dlsyms"; then - $show "$rm $output_objdir/${outputname}S.${objext}" - $run $rm "$output_objdir/${outputname}S.${objext}" - fi - - exit $exit_status - fi - - if test -n "$shlibpath_var"; then - # We should set the shlibpath_var - rpath= - for dir in $temp_rpath; do - case $dir in - [\\/]* | [A-Za-z]:[\\/]*) - # Absolute path. - rpath="$rpath$dir:" - ;; - *) - # Relative path: add a thisdir entry. - rpath="$rpath\$thisdir/$dir:" - ;; - esac - done - temp_rpath="$rpath" - fi - - if test -n "$compile_shlibpath$finalize_shlibpath"; then - compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" - fi - if test -n "$finalize_shlibpath"; then - finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" - fi - - compile_var= - finalize_var= - if test -n "$runpath_var"; then - if test -n "$perm_rpath"; then - # We should set the runpath_var. - rpath= - for dir in $perm_rpath; do - rpath="$rpath$dir:" - done - compile_var="$runpath_var=\"$rpath\$$runpath_var\" " - fi - if test -n "$finalize_perm_rpath"; then - # We should set the runpath_var. - rpath= - for dir in $finalize_perm_rpath; do - rpath="$rpath$dir:" - done - finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " - fi - fi - - if test "$no_install" = yes; then - # We don't need to create a wrapper script. - link_command="$compile_var$compile_command$compile_rpath" - # Replace the output file specification. - link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` - # Delete the old output file. - $run $rm $output - # Link the executable and exit - $show "$link_command" - $run eval "$link_command" || exit $? - exit $EXIT_SUCCESS - fi - - if test "$hardcode_action" = relink; then - # Fast installation is not supported - link_command="$compile_var$compile_command$compile_rpath" - relink_command="$finalize_var$finalize_command$finalize_rpath" - - $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2 - $echo "$modename: \`$output' will be relinked during installation" 1>&2 - else - if test "$fast_install" != no; then - link_command="$finalize_var$compile_command$finalize_rpath" - if test "$fast_install" = yes; then - relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $SP2NL | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g' | $NL2SP` - else - # fast_install is set to needless - relink_command= - fi - else - link_command="$compile_var$compile_command$compile_rpath" - relink_command="$finalize_var$finalize_command$finalize_rpath" - fi - fi - - # Replace the output file specification. - link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` - - # Delete the old output files. - $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname - - $show "$link_command" - $run eval "$link_command" || exit $? - - # Now create the wrapper script. - $show "creating $output" - - # Quote the relink command for shipping. - if test -n "$relink_command"; then - # Preserve any variables that may affect compiler behavior - for var in $variables_saved_for_relink; do - if eval test -z \"\${$var+set}\"; then - relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" - elif eval var_value=\$$var; test -z "$var_value"; then - relink_command="$var=; export $var; $relink_command" - else - var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` - relink_command="$var=\"$var_value\"; export $var; $relink_command" - fi - done - relink_command="(cd `pwd`; $relink_command)" - relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e "$sed_quote_subst" | $NL2SP` - fi - - # Quote $echo for shipping. - if test "X$echo" = "X$SHELL $progpath --fallback-echo"; then - case $progpath in - [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";; - *) qecho="$SHELL `pwd`/$progpath --fallback-echo";; - esac - qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"` - else - qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"` - fi - - # Only actually do things if our run command is non-null. - if test -z "$run"; then - # win32 will think the script is a binary if it has - # a .exe suffix, so we strip it off here. - case $output in - *.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;; - esac - # test for cygwin because mv fails w/o .exe extensions - case $host in - *cygwin*) - exeext=.exe - outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;; - *) exeext= ;; - esac - case $host in - *cygwin* | *mingw* ) - output_name=`basename $output` - output_path=`dirname $output` - cwrappersource="$output_path/$objdir/lt-$output_name.c" - cwrapper="$output_path/$output_name.exe" - $rm $cwrappersource $cwrapper - trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 - - cat > $cwrappersource <<EOF - -/* $cwrappersource - temporary wrapper executable for $objdir/$outputname - Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP - - The $output program cannot be directly executed until all the libtool - libraries that it depends on are installed. - - This wrapper executable should never be moved out of the build directory. - If it is, it will not operate correctly. - - Currently, it simply execs the wrapper *script* "/bin/sh $output", - but could eventually absorb all of the scripts functionality and - exec $objdir/$outputname directly. -*/ -EOF - cat >> $cwrappersource<<"EOF" -#include <stdio.h> -#include <stdlib.h> -#include <unistd.h> -#include <malloc.h> -#include <stdarg.h> -#include <assert.h> -#include <string.h> -#include <ctype.h> -#include <sys/stat.h> - -#if defined(PATH_MAX) -# define LT_PATHMAX PATH_MAX -#elif defined(MAXPATHLEN) -# define LT_PATHMAX MAXPATHLEN -#else -# define LT_PATHMAX 1024 -#endif - -#ifndef DIR_SEPARATOR -# define DIR_SEPARATOR '/' -# define PATH_SEPARATOR ':' -#endif - -#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ - defined (__OS2__) -# define HAVE_DOS_BASED_FILE_SYSTEM -# ifndef DIR_SEPARATOR_2 -# define DIR_SEPARATOR_2 '\\' -# endif -# ifndef PATH_SEPARATOR_2 -# define PATH_SEPARATOR_2 ';' -# endif -#endif - -#ifndef DIR_SEPARATOR_2 -# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) -#else /* DIR_SEPARATOR_2 */ -# define IS_DIR_SEPARATOR(ch) \ - (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) -#endif /* DIR_SEPARATOR_2 */ - -#ifndef PATH_SEPARATOR_2 -# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) -#else /* PATH_SEPARATOR_2 */ -# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) -#endif /* PATH_SEPARATOR_2 */ - -#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) -#define XFREE(stale) do { \ - if (stale) { free ((void *) stale); stale = 0; } \ -} while (0) - -/* -DDEBUG is fairly common in CFLAGS. */ -#undef DEBUG -#if defined DEBUGWRAPPER -# define DEBUG(format, ...) fprintf(stderr, format, __VA_ARGS__) -#else -# define DEBUG(format, ...) -#endif - -const char *program_name = NULL; - -void * xmalloc (size_t num); -char * xstrdup (const char *string); -const char * base_name (const char *name); -char * find_executable(const char *wrapper); -int check_executable(const char *path); -char * strendzap(char *str, const char *pat); -void lt_fatal (const char *message, ...); - -int -main (int argc, char *argv[]) -{ - char **newargz; - int i; - - program_name = (char *) xstrdup (base_name (argv[0])); - DEBUG("(main) argv[0] : %s\n",argv[0]); - DEBUG("(main) program_name : %s\n",program_name); - newargz = XMALLOC(char *, argc+2); -EOF - - cat >> $cwrappersource <<EOF - newargz[0] = (char *) xstrdup("$SHELL"); -EOF - - cat >> $cwrappersource <<"EOF" - newargz[1] = find_executable(argv[0]); - if (newargz[1] == NULL) - lt_fatal("Couldn't find %s", argv[0]); - DEBUG("(main) found exe at : %s\n",newargz[1]); - /* we know the script has the same name, without the .exe */ - /* so make sure newargz[1] doesn't end in .exe */ - strendzap(newargz[1],".exe"); - for (i = 1; i < argc; i++) - newargz[i+1] = xstrdup(argv[i]); - newargz[argc+1] = NULL; - - for (i=0; i<argc+1; i++) - { - DEBUG("(main) newargz[%d] : %s\n",i,newargz[i]); - ; - } - -EOF - - case $host_os in - mingw*) - cat >> $cwrappersource <<EOF - execv("$SHELL",(char const **)newargz); -EOF - ;; - *) - cat >> $cwrappersource <<EOF - execv("$SHELL",newargz); -EOF - ;; - esac - - cat >> $cwrappersource <<"EOF" - return 127; -} - -void * -xmalloc (size_t num) -{ - void * p = (void *) malloc (num); - if (!p) - lt_fatal ("Memory exhausted"); - - return p; -} - -char * -xstrdup (const char *string) -{ - return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL -; -} - -const char * -base_name (const char *name) -{ - const char *base; - -#if defined (HAVE_DOS_BASED_FILE_SYSTEM) - /* Skip over the disk name in MSDOS pathnames. */ - if (isalpha ((unsigned char)name[0]) && name[1] == ':') - name += 2; -#endif - - for (base = name; *name; name++) - if (IS_DIR_SEPARATOR (*name)) - base = name + 1; - return base; -} - -int -check_executable(const char * path) -{ - struct stat st; - - DEBUG("(check_executable) : %s\n", path ? (*path ? path : "EMPTY!") : "NULL!"); - if ((!path) || (!*path)) - return 0; - - if ((stat (path, &st) >= 0) && - ( - /* MinGW & native WIN32 do not support S_IXOTH or S_IXGRP */ -#if defined (S_IXOTH) - ((st.st_mode & S_IXOTH) == S_IXOTH) || -#endif -#if defined (S_IXGRP) - ((st.st_mode & S_IXGRP) == S_IXGRP) || -#endif - ((st.st_mode & S_IXUSR) == S_IXUSR)) - ) - return 1; - else - return 0; -} - -/* Searches for the full path of the wrapper. Returns - newly allocated full path name if found, NULL otherwise */ -char * -find_executable (const char* wrapper) -{ - int has_slash = 0; - const char* p; - const char* p_next; - /* static buffer for getcwd */ - char tmp[LT_PATHMAX + 1]; - int tmp_len; - char* concat_name; - - DEBUG("(find_executable) : %s\n", wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!"); - - if ((wrapper == NULL) || (*wrapper == '\0')) - return NULL; - - /* Absolute path? */ -#if defined (HAVE_DOS_BASED_FILE_SYSTEM) - if (isalpha ((unsigned char)wrapper[0]) && wrapper[1] == ':') - { - concat_name = xstrdup (wrapper); - if (check_executable(concat_name)) - return concat_name; - XFREE(concat_name); - } - else - { -#endif - if (IS_DIR_SEPARATOR (wrapper[0])) - { - concat_name = xstrdup (wrapper); - if (check_executable(concat_name)) - return concat_name; - XFREE(concat_name); - } -#if defined (HAVE_DOS_BASED_FILE_SYSTEM) - } -#endif - - for (p = wrapper; *p; p++) - if (*p == '/') - { - has_slash = 1; - break; - } - if (!has_slash) - { - /* no slashes; search PATH */ - const char* path = getenv ("PATH"); - if (path != NULL) - { - for (p = path; *p; p = p_next) - { - const char* q; - size_t p_len; - for (q = p; *q; q++) - if (IS_PATH_SEPARATOR(*q)) - break; - p_len = q - p; - p_next = (*q == '\0' ? q : q + 1); - if (p_len == 0) - { - /* empty path: current directory */ - if (getcwd (tmp, LT_PATHMAX) == NULL) - lt_fatal ("getcwd failed"); - tmp_len = strlen(tmp); - concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1); - memcpy (concat_name, tmp, tmp_len); - concat_name[tmp_len] = '/'; - strcpy (concat_name + tmp_len + 1, wrapper); - } - else - { - concat_name = XMALLOC(char, p_len + 1 + strlen(wrapper) + 1); - memcpy (concat_name, p, p_len); - concat_name[p_len] = '/'; - strcpy (concat_name + p_len + 1, wrapper); - } - if (check_executable(concat_name)) - return concat_name; - XFREE(concat_name); - } - } - /* not found in PATH; assume curdir */ - } - /* Relative path | not found in path: prepend cwd */ - if (getcwd (tmp, LT_PATHMAX) == NULL) - lt_fatal ("getcwd failed"); - tmp_len = strlen(tmp); - concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1); - memcpy (concat_name, tmp, tmp_len); - concat_name[tmp_len] = '/'; - strcpy (concat_name + tmp_len + 1, wrapper); - - if (check_executable(concat_name)) - return concat_name; - XFREE(concat_name); - return NULL; -} - -char * -strendzap(char *str, const char *pat) -{ - size_t len, patlen; - - assert(str != NULL); - assert(pat != NULL); - - len = strlen(str); - patlen = strlen(pat); - - if (patlen <= len) - { - str += len - patlen; - if (strcmp(str, pat) == 0) - *str = '\0'; - } - return str; -} - -static void -lt_error_core (int exit_status, const char * mode, - const char * message, va_list ap) -{ - fprintf (stderr, "%s: %s: ", program_name, mode); - vfprintf (stderr, message, ap); - fprintf (stderr, ".\n"); - - if (exit_status >= 0) - exit (exit_status); -} - -void -lt_fatal (const char *message, ...) -{ - va_list ap; - va_start (ap, message); - lt_error_core (EXIT_FAILURE, "FATAL", message, ap); - va_end (ap); -} -EOF - # we should really use a build-platform specific compiler - # here, but OTOH, the wrappers (shell script and this C one) - # are only useful if you want to execute the "real" binary. - # Since the "real" binary is built for $host, then this - # wrapper might as well be built for $host, too. - $run $LTCC $LTCFLAGS -s -o $cwrapper $cwrappersource - ;; - esac - $rm $output - trap "$rm $output; exit $EXIT_FAILURE" 1 2 15 - - $echo > $output "\ -#! $SHELL - -# $output - temporary wrapper script for $objdir/$outputname -# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP -# -# The $output program cannot be directly executed until all the libtool -# libraries that it depends on are installed. -# -# This wrapper script should never be moved out of the build directory. -# If it is, it will not operate correctly. - -# Sed substitution that helps us do robust quoting. It backslashifies -# metacharacters that are still active within double-quoted strings. -Xsed='${SED} -e 1s/^X//' -sed_quote_subst='$sed_quote_subst' - -# Be Bourne compatible (taken from Autoconf:_AS_BOURNE_COMPATIBLE). -if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which - # is contrary to our usage. Disable this feature. - alias -g '\${1+\"\$@\"}'='\"\$@\"' - setopt NO_GLOB_SUBST -else - case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac -fi -BIN_SH=xpg4; export BIN_SH # for Tru64 -DUALCASE=1; export DUALCASE # for MKS sh - -# The HP-UX ksh and POSIX shell print the target directory to stdout -# if CDPATH is set. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - -relink_command=\"$relink_command\" - -# This environment variable determines our operation mode. -if test \"\$libtool_install_magic\" = \"$magic\"; then - # install mode needs the following variable: - notinst_deplibs='$notinst_deplibs' -else - # When we are sourced in execute mode, \$file and \$echo are already set. - if test \"\$libtool_execute_magic\" != \"$magic\"; then - echo=\"$qecho\" - file=\"\$0\" - # Make sure echo works. - if test \"X\$1\" = X--no-reexec; then - # Discard the --no-reexec flag, and continue. - shift - elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then - # Yippee, \$echo works! - : - else - # Restart under the correct shell, and then maybe \$echo will work. - exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"} - fi - fi\ -" - $echo >> $output "\ - - # Find the directory that this script lives in. - thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\` - test \"x\$thisdir\" = \"x\$file\" && thisdir=. - - # Follow symbolic links until we get to the real thisdir. - file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\` - while test -n \"\$file\"; do - destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\` - - # If there was a directory component, then change thisdir. - if test \"x\$destdir\" != \"x\$file\"; then - case \"\$destdir\" in - [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; - *) thisdir=\"\$thisdir/\$destdir\" ;; - esac - fi - - file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\` - file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\` - done - - # Try to get the absolute directory name. - absdir=\`cd \"\$thisdir\" && pwd\` - test -n \"\$absdir\" && thisdir=\"\$absdir\" -" - - if test "$fast_install" = yes; then - $echo >> $output "\ - program=lt-'$outputname'$exeext - progdir=\"\$thisdir/$objdir\" - - if test ! -f \"\$progdir/\$program\" || \\ - { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ - test \"X\$file\" != \"X\$progdir/\$program\"; }; then - - file=\"\$\$-\$program\" - - if test ! -d \"\$progdir\"; then - $mkdir \"\$progdir\" - else - $rm \"\$progdir/\$file\" - fi" - - $echo >> $output "\ - - # relink executable if necessary - if test -n \"\$relink_command\"; then - if relink_command_output=\`eval \$relink_command 2>&1\`; then : - else - $echo \"\$relink_command_output\" >&2 - $rm \"\$progdir/\$file\" - exit $EXIT_FAILURE - fi - fi - - $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || - { $rm \"\$progdir/\$program\"; - $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; } - $rm \"\$progdir/\$file\" - fi" - else - $echo >> $output "\ - program='$outputname' - progdir=\"\$thisdir/$objdir\" -" - fi - - $echo >> $output "\ - - if test -f \"\$progdir/\$program\"; then" - - # Export our shlibpath_var if we have one. - if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then - $echo >> $output "\ - # Add our own library path to $shlibpath_var - $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" - - # Some systems cannot cope with colon-terminated $shlibpath_var - # The second colon is a workaround for a bug in BeOS R4 sed - $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\` - - export $shlibpath_var -" - fi - - # fixup the dll searchpath if we need to. - if test -n "$dllsearchpath"; then - $echo >> $output "\ - # Add the dll search path components to the executable PATH - PATH=$dllsearchpath:\$PATH -" - fi - - $echo >> $output "\ - if test \"\$libtool_execute_magic\" != \"$magic\"; then - # Run the actual program with our arguments. -" - case $host in - # Backslashes separate directories on plain windows - *-*-mingw | *-*-os2*) - $echo >> $output "\ - exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} -" - ;; - - *) - $echo >> $output "\ - exec \"\$progdir/\$program\" \${1+\"\$@\"} -" - ;; - esac - $echo >> $output "\ - \$echo \"\$0: cannot exec \$program \$*\" - exit $EXIT_FAILURE - fi - else - # The program doesn't exist. - \$echo \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2 - \$echo \"This script is just a wrapper for \$program.\" 1>&2 - $echo \"See the $PACKAGE documentation for more information.\" 1>&2 - exit $EXIT_FAILURE - fi -fi\ -" - chmod +x $output - fi - exit $EXIT_SUCCESS - ;; - esac - - # See if we need to build an old-fashioned archive. - for oldlib in $oldlibs; do - - if test "$build_libtool_libs" = convenience; then - oldobjs="$libobjs_save" - addlibs="$convenience" - build_libtool_libs=no - else - if test "$build_libtool_libs" = module; then - oldobjs="$libobjs_save" - build_libtool_libs=no - else - oldobjs="$old_deplibs $non_pic_objects" - fi - addlibs="$old_convenience" - fi - - if test -n "$addlibs"; then - gentop="$output_objdir/${outputname}x" - generated="$generated $gentop" - - func_extract_archives $gentop $addlibs - oldobjs="$oldobjs $func_extract_archives_result" - fi - - # Do each command in the archive commands. - if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then - cmds=$old_archive_from_new_cmds - else - # POSIX demands no paths to be encoded in archives. We have - # to avoid creating archives with duplicate basenames if we - # might have to extract them afterwards, e.g., when creating a - # static archive out of a convenience library, or when linking - # the entirety of a libtool archive into another (currently - # not supported by libtool). - if (for obj in $oldobjs - do - $echo "X$obj" | $Xsed -e 's%^.*/%%' - done | sort | sort -uc >/dev/null 2>&1); then - : - else - $echo "copying selected object files to avoid basename conflicts..." - - if test -z "$gentop"; then - gentop="$output_objdir/${outputname}x" - generated="$generated $gentop" - - $show "${rm}r $gentop" - $run ${rm}r "$gentop" - $show "$mkdir $gentop" - $run $mkdir "$gentop" - exit_status=$? - if test "$exit_status" -ne 0 && test ! -d "$gentop"; then - exit $exit_status - fi - fi - - save_oldobjs=$oldobjs - oldobjs= - counter=1 - for obj in $save_oldobjs - do - objbase=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` - case " $oldobjs " in - " ") oldobjs=$obj ;; - *[\ /]"$objbase "*) - while :; do - # Make sure we don't pick an alternate name that also - # overlaps. - newobj=lt$counter-$objbase - counter=`expr $counter + 1` - case " $oldobjs " in - *[\ /]"$newobj "*) ;; - *) if test ! -f "$gentop/$newobj"; then break; fi ;; - esac - done - $show "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" - $run ln "$obj" "$gentop/$newobj" || - $run cp "$obj" "$gentop/$newobj" - oldobjs="$oldobjs $gentop/$newobj" - ;; - *) oldobjs="$oldobjs $obj" ;; - esac - done - fi - - eval cmds=\"$old_archive_cmds\" - - if len=`expr "X$cmds" : ".*"` && - test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then - cmds=$old_archive_cmds - else - # the command line is too long to link in one step, link in parts - $echo "using piecewise archive linking..." - save_RANLIB=$RANLIB - RANLIB=: - objlist= - concat_cmds= - save_oldobjs=$oldobjs - - # Is there a better way of finding the last object in the list? - for obj in $save_oldobjs - do - last_oldobj=$obj - done - for obj in $save_oldobjs - do - oldobjs="$objlist $obj" - objlist="$objlist $obj" - eval test_cmds=\"$old_archive_cmds\" - if len=`expr "X$test_cmds" : ".*" 2>/dev/null` && - test "$len" -le "$max_cmd_len"; then - : - else - # the above command should be used before it gets too long - oldobjs=$objlist - if test "$obj" = "$last_oldobj" ; then - RANLIB=$save_RANLIB - fi - test -z "$concat_cmds" || concat_cmds=$concat_cmds~ - eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" - objlist= - fi - done - RANLIB=$save_RANLIB - oldobjs=$objlist - if test "X$oldobjs" = "X" ; then - eval cmds=\"\$concat_cmds\" - else - eval cmds=\"\$concat_cmds~\$old_archive_cmds\" - fi - fi - fi - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - eval cmd=\"$cmd\" - IFS="$save_ifs" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - done - - if test -n "$generated"; then - $show "${rm}r$generated" - $run ${rm}r$generated - fi - - # Now create the libtool archive. - case $output in - *.la) - old_library= - test "$build_old_libs" = yes && old_library="$libname.$libext" - $show "creating $output" - - # Preserve any variables that may affect compiler behavior - for var in $variables_saved_for_relink; do - if eval test -z \"\${$var+set}\"; then - relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" - elif eval var_value=\$$var; test -z "$var_value"; then - relink_command="$var=; export $var; $relink_command" - else - var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` - relink_command="$var=\"$var_value\"; export $var; $relink_command" - fi - done - # Quote the link command for shipping. - relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" - relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e "$sed_quote_subst" | $NL2SP` - if test "$hardcode_automatic" = yes ; then - relink_command= - fi - - - # Only create the output if not a dry run. - if test -z "$run"; then - for installed in no yes; do - if test "$installed" = yes; then - if test -z "$install_libdir"; then - break - fi - output="$output_objdir/$outputname"i - # Replace all uninstalled libtool libraries with the installed ones - newdependency_libs= - for deplib in $dependency_libs; do - case $deplib in - *.la) - name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'` - eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` - if test -z "$libdir"; then - $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 - exit $EXIT_FAILURE - fi - newdependency_libs="$newdependency_libs $libdir/$name" - ;; - *) newdependency_libs="$newdependency_libs $deplib" ;; - esac - done - dependency_libs="$newdependency_libs" - newdlfiles= - for lib in $dlfiles; do - name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` - eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` - if test -z "$libdir"; then - $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 - exit $EXIT_FAILURE - fi - newdlfiles="$newdlfiles $libdir/$name" - done - dlfiles="$newdlfiles" - newdlprefiles= - for lib in $dlprefiles; do - name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` - eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` - if test -z "$libdir"; then - $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 - exit $EXIT_FAILURE - fi - newdlprefiles="$newdlprefiles $libdir/$name" - done - dlprefiles="$newdlprefiles" - else - newdlfiles= - for lib in $dlfiles; do - case $lib in - [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; - *) abs=`pwd`"/$lib" ;; - esac - newdlfiles="$newdlfiles $abs" - done - dlfiles="$newdlfiles" - newdlprefiles= - for lib in $dlprefiles; do - case $lib in - [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; - *) abs=`pwd`"/$lib" ;; - esac - newdlprefiles="$newdlprefiles $abs" - done - dlprefiles="$newdlprefiles" - fi - $rm $output - # place dlname in correct position for cygwin - tdlname=$dlname - case $host,$output,$installed,$module,$dlname in - *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;; - esac - $echo > $output "\ -# $outputname - a libtool library file -# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP -# -# Please DO NOT delete this file! -# It is necessary for linking the library. - -# The name that we can dlopen(3). -dlname='$tdlname' - -# Names of this library. -library_names='$library_names' - -# The name of the static archive. -old_library='$old_library' - -# Libraries that this one depends upon. -dependency_libs='$dependency_libs' - -# Version information for $libname. -current=$current -age=$age -revision=$revision - -# Is this an already installed library? -installed=$installed - -# Should we warn about portability when linking against -modules? -shouldnotlink=$module - -# Files to dlopen/dlpreopen -dlopen='$dlfiles' -dlpreopen='$dlprefiles' - -# Directory that this library needs to be installed in: -libdir='$install_libdir'" - if test "$installed" = no && test "$need_relink" = yes; then - $echo >> $output "\ -relink_command=\"$relink_command\"" - fi - done - fi - - # Do a symbolic link so that the libtool archive can be found in - # LD_LIBRARY_PATH before the program is installed. - $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)" - $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $? - ;; - esac - exit $EXIT_SUCCESS - ;; - - # libtool install mode - install) - modename="$modename: install" - - # There may be an optional sh(1) argument at the beginning of - # install_prog (especially on Windows NT). - if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || - # Allow the use of GNU shtool's install command. - $echo "X$nonopt" | grep shtool > /dev/null; then - # Aesthetically quote it. - arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"` - case $arg in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - arg="\"$arg\"" - ;; - esac - install_prog="$arg " - arg="$1" - shift - else - install_prog= - arg=$nonopt - fi - - # The real first argument should be the name of the installation program. - # Aesthetically quote it. - arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` - case $arg in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - arg="\"$arg\"" - ;; - esac - install_prog="$install_prog$arg" - - # We need to accept at least all the BSD install flags. - dest= - files= - opts= - prev= - install_type= - isdir=no - stripme= - for arg - do - if test -n "$dest"; then - files="$files $dest" - dest=$arg - continue - fi - - case $arg in - -d) isdir=yes ;; - -f) - case " $install_prog " in - *[\\\ /]cp\ *) ;; - *) prev=$arg ;; - esac - ;; - -g | -m | -o) prev=$arg ;; - -s) - stripme=" -s" - continue - ;; - -*) - ;; - *) - # If the previous option needed an argument, then skip it. - if test -n "$prev"; then - prev= - else - dest=$arg - continue - fi - ;; - esac - - # Aesthetically quote the argument. - arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` - case $arg in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - arg="\"$arg\"" - ;; - esac - install_prog="$install_prog $arg" - done - - if test -z "$install_prog"; then - $echo "$modename: you must specify an install program" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - fi - - if test -n "$prev"; then - $echo "$modename: the \`$prev' option requires an argument" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - fi - - if test -z "$files"; then - if test -z "$dest"; then - $echo "$modename: no file or destination specified" 1>&2 - else - $echo "$modename: you must specify a destination" 1>&2 - fi - $echo "$help" 1>&2 - exit $EXIT_FAILURE - fi - - # Strip any trailing slash from the destination. - dest=`$echo "X$dest" | $Xsed -e 's%/$%%'` - - # Check to see that the destination is a directory. - test -d "$dest" && isdir=yes - if test "$isdir" = yes; then - destdir="$dest" - destname= - else - destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'` - test "X$destdir" = "X$dest" && destdir=. - destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'` - - # Not a directory, so check to see that there is only one file specified. - set dummy $files - if test "$#" -gt 2; then - $echo "$modename: \`$dest' is not a directory" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - fi - fi - case $destdir in - [\\/]* | [A-Za-z]:[\\/]*) ;; - *) - for file in $files; do - case $file in - *.lo) ;; - *) - $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - ;; - esac - done - ;; - esac - - # This variable tells wrapper scripts just to set variables rather - # than running their programs. - libtool_install_magic="$magic" - - staticlibs= - future_libdirs= - current_libdirs= - for file in $files; do - - # Do each installation. - case $file in - *.$libext) - # Do the static libraries later. - staticlibs="$staticlibs $file" - ;; - - *.la) - # Check to see that this really is a libtool archive. - if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : - else - $echo "$modename: \`$file' is not a valid libtool archive" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - fi - - library_names= - old_library= - relink_command= - # If there is no directory component, then add one. - case $file in - */* | *\\*) . $file ;; - *) . ./$file ;; - esac - - # Add the libdir to current_libdirs if it is the destination. - if test "X$destdir" = "X$libdir"; then - case "$current_libdirs " in - *" $libdir "*) ;; - *) current_libdirs="$current_libdirs $libdir" ;; - esac - else - # Note the libdir as a future libdir. - case "$future_libdirs " in - *" $libdir "*) ;; - *) future_libdirs="$future_libdirs $libdir" ;; - esac - fi - - dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/ - test "X$dir" = "X$file/" && dir= - dir="$dir$objdir" - - if test -n "$relink_command"; then - # Determine the prefix the user has applied to our future dir. - inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"` - - # Don't allow the user to place us outside of our expected - # location b/c this prevents finding dependent libraries that - # are installed to the same prefix. - # At present, this check doesn't affect windows .dll's that - # are installed into $libdir/../bin (currently, that works fine) - # but it's something to keep an eye on. - if test "$inst_prefix_dir" = "$destdir"; then - $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2 - exit $EXIT_FAILURE - fi - - if test -n "$inst_prefix_dir"; then - # Stick the inst_prefix_dir data into the link command. - relink_command=`$echo "$relink_command" | $SP2NL | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%" | $NL2SP` - else - relink_command=`$echo "$relink_command" | $SP2NL | $SED "s%@inst_prefix_dir@%%" | $NL2SP` - fi - - $echo "$modename: warning: relinking \`$file'" 1>&2 - $show "$relink_command" - if $run eval "$relink_command"; then : - else - $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 - exit $EXIT_FAILURE - fi - fi - - # See the names of the shared library. - set dummy $library_names - if test -n "$2"; then - realname="$2" - shift - shift - - srcname="$realname" - test -n "$relink_command" && srcname="$realname"T - - # Install the shared library and build the symlinks. - $show "$install_prog $dir/$srcname $destdir/$realname" - $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $? - if test -n "$stripme" && test -n "$striplib"; then - $show "$striplib $destdir/$realname" - $run eval "$striplib $destdir/$realname" || exit $? - fi - - if test "$#" -gt 0; then - # Delete the old symlinks, and create new ones. - # Try `ln -sf' first, because the `ln' binary might depend on - # the symlink we replace! Solaris /bin/ln does not understand -f, - # so we also need to try rm && ln -s. - for linkname - do - if test "$linkname" != "$realname"; then - $show "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })" - $run eval "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })" - fi - done - fi - - # Do each command in the postinstall commands. - lib="$destdir/$realname" - cmds=$postinstall_cmds - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - $show "$cmd" - $run eval "$cmd" || { - lt_exit=$? - - # Restore the uninstalled library and exit - if test "$mode" = relink; then - $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)' - fi - - exit $lt_exit - } - done - IFS="$save_ifs" - fi - - # Install the pseudo-library for information purposes. - name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` - instname="$dir/$name"i - $show "$install_prog $instname $destdir/$name" - $run eval "$install_prog $instname $destdir/$name" || exit $? - - # Maybe install the static library, too. - test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library" - ;; - - *.lo) - # Install (i.e. copy) a libtool object. - - # Figure out destination file name, if it wasn't already specified. - if test -n "$destname"; then - destfile="$destdir/$destname" - else - destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` - destfile="$destdir/$destfile" - fi - - # Deduce the name of the destination old-style object file. - case $destfile in - *.lo) - staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"` - ;; - *.$objext) - staticdest="$destfile" - destfile= - ;; - *) - $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - ;; - esac - - # Install the libtool object if requested. - if test -n "$destfile"; then - $show "$install_prog $file $destfile" - $run eval "$install_prog $file $destfile" || exit $? - fi - - # Install the old object if enabled. - if test "$build_old_libs" = yes; then - # Deduce the name of the old-style object file. - staticobj=`$echo "X$file" | $Xsed -e "$lo2o"` - - $show "$install_prog $staticobj $staticdest" - $run eval "$install_prog \$staticobj \$staticdest" || exit $? - fi - exit $EXIT_SUCCESS - ;; - - *) - # Figure out destination file name, if it wasn't already specified. - if test -n "$destname"; then - destfile="$destdir/$destname" - else - destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` - destfile="$destdir/$destfile" - fi - - # If the file is missing, and there is a .exe on the end, strip it - # because it is most likely a libtool script we actually want to - # install - stripped_ext="" - case $file in - *.exe) - if test ! -f "$file"; then - file=`$echo $file|${SED} 's,.exe$,,'` - stripped_ext=".exe" - fi - ;; - esac - - # Do a test to see if this is really a libtool program. - case $host in - *cygwin*|*mingw*) - wrapper=`$echo $file | ${SED} -e 's,.exe$,,'` - ;; - *) - wrapper=$file - ;; - esac - if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then - notinst_deplibs= - relink_command= - - # Note that it is not necessary on cygwin/mingw to append a dot to - # foo even if both foo and FILE.exe exist: automatic-append-.exe - # behavior happens only for exec(3), not for open(2)! Also, sourcing - # `FILE.' does not work on cygwin managed mounts. - # - # If there is no directory component, then add one. - case $wrapper in - */* | *\\*) . ${wrapper} ;; - *) . ./${wrapper} ;; - esac - - # Check the variables that should have been set. - if test -z "$notinst_deplibs"; then - $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2 - exit $EXIT_FAILURE - fi - - finalize=yes - for lib in $notinst_deplibs; do - # Check to see that each library is installed. - libdir= - if test -f "$lib"; then - # If there is no directory component, then add one. - case $lib in - */* | *\\*) . $lib ;; - *) . ./$lib ;; - esac - fi - libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test - if test -n "$libdir" && test ! -f "$libfile"; then - $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2 - finalize=no - fi - done - - relink_command= - # Note that it is not necessary on cygwin/mingw to append a dot to - # foo even if both foo and FILE.exe exist: automatic-append-.exe - # behavior happens only for exec(3), not for open(2)! Also, sourcing - # `FILE.' does not work on cygwin managed mounts. - # - # If there is no directory component, then add one. - case $wrapper in - */* | *\\*) . ${wrapper} ;; - *) . ./${wrapper} ;; - esac - - outputname= - if test "$fast_install" = no && test -n "$relink_command"; then - if test "$finalize" = yes && test -z "$run"; then - tmpdir=`func_mktempdir` - file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'` - outputname="$tmpdir/$file" - # Replace the output file specification. - relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g' | $NL2SP` - - $show "$relink_command" - if $run eval "$relink_command"; then : - else - $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 - ${rm}r "$tmpdir" - continue - fi - file="$outputname" - else - $echo "$modename: warning: cannot relink \`$file'" 1>&2 - fi - else - # Install the binary that we compiled earlier. - file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"` - fi - fi - - # remove .exe since cygwin /usr/bin/install will append another - # one anyway - case $install_prog,$host in - */usr/bin/install*,*cygwin*) - case $file:$destfile in - *.exe:*.exe) - # this is ok - ;; - *.exe:*) - destfile=$destfile.exe - ;; - *:*.exe) - destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'` - ;; - esac - ;; - esac - $show "$install_prog$stripme $file $destfile" - $run eval "$install_prog\$stripme \$file \$destfile" || exit $? - test -n "$outputname" && ${rm}r "$tmpdir" - ;; - esac - done - - for file in $staticlibs; do - name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` - - # Set up the ranlib parameters. - oldlib="$destdir/$name" - - $show "$install_prog $file $oldlib" - $run eval "$install_prog \$file \$oldlib" || exit $? - - if test -n "$stripme" && test -n "$old_striplib"; then - $show "$old_striplib $oldlib" - $run eval "$old_striplib $oldlib" || exit $? - fi - - # Do each command in the postinstall commands. - cmds=$old_postinstall_cmds - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - done - - if test -n "$future_libdirs"; then - $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2 - fi - - if test -n "$current_libdirs"; then - # Maybe just do a dry run. - test -n "$run" && current_libdirs=" -n$current_libdirs" - exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' - else - exit $EXIT_SUCCESS - fi - ;; - - # libtool finish mode - finish) - modename="$modename: finish" - libdirs="$nonopt" - admincmds= - - if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then - for dir - do - libdirs="$libdirs $dir" - done - - for libdir in $libdirs; do - if test -n "$finish_cmds"; then - # Do each command in the finish commands. - cmds=$finish_cmds - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - $show "$cmd" - $run eval "$cmd" || admincmds="$admincmds - $cmd" - done - IFS="$save_ifs" - fi - if test -n "$finish_eval"; then - # Do the single finish_eval. - eval cmds=\"$finish_eval\" - $run eval "$cmds" || admincmds="$admincmds - $cmds" - fi - done - fi - - # Exit here if they wanted silent mode. - test "$show" = : && exit $EXIT_SUCCESS - - $echo "X----------------------------------------------------------------------" | $Xsed - $echo "Libraries have been installed in:" - for libdir in $libdirs; do - $echo " $libdir" - done - $echo - $echo "If you ever happen to want to link against installed libraries" - $echo "in a given directory, LIBDIR, you must either use libtool, and" - $echo "specify the full pathname of the library, or use the \`-LLIBDIR'" - $echo "flag during linking and do at least one of the following:" - if test -n "$shlibpath_var"; then - $echo " - add LIBDIR to the \`$shlibpath_var' environment variable" - $echo " during execution" - fi - if test -n "$runpath_var"; then - $echo " - add LIBDIR to the \`$runpath_var' environment variable" - $echo " during linking" - fi - if test -n "$hardcode_libdir_flag_spec"; then - libdir=LIBDIR - eval flag=\"$hardcode_libdir_flag_spec\" - - $echo " - use the \`$flag' linker flag" - fi - if test -n "$admincmds"; then - $echo " - have your system administrator run these commands:$admincmds" - fi - if test -f /etc/ld.so.conf; then - $echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" - fi - $echo - $echo "See any operating system documentation about shared libraries for" - $echo "more information, such as the ld(1) and ld.so(8) manual pages." - $echo "X----------------------------------------------------------------------" | $Xsed - exit $EXIT_SUCCESS - ;; - - # libtool execute mode - execute) - modename="$modename: execute" - - # The first argument is the command name. - cmd="$nonopt" - if test -z "$cmd"; then - $echo "$modename: you must specify a COMMAND" 1>&2 - $echo "$help" - exit $EXIT_FAILURE - fi - - # Handle -dlopen flags immediately. - for file in $execute_dlfiles; do - if test ! -f "$file"; then - $echo "$modename: \`$file' is not a file" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - fi - - dir= - case $file in - *.la) - # Check to see that this really is a libtool archive. - if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : - else - $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - fi - - # Read the libtool library. - dlname= - library_names= - - # If there is no directory component, then add one. - case $file in - */* | *\\*) . $file ;; - *) . ./$file ;; - esac - - # Skip this library if it cannot be dlopened. - if test -z "$dlname"; then - # Warn if it was a shared library. - test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'" - continue - fi - - dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` - test "X$dir" = "X$file" && dir=. - - if test -f "$dir/$objdir/$dlname"; then - dir="$dir/$objdir" - else - if test ! -f "$dir/$dlname"; then - $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2 - exit $EXIT_FAILURE - fi - fi - ;; - - *.lo) - # Just add the directory containing the .lo file. - dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` - test "X$dir" = "X$file" && dir=. - ;; - - *) - $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2 - continue - ;; - esac - - # Get the absolute pathname. - absdir=`cd "$dir" && pwd` - test -n "$absdir" && dir="$absdir" - - # Now add the directory to shlibpath_var. - if eval "test -z \"\$$shlibpath_var\""; then - eval "$shlibpath_var=\"\$dir\"" - else - eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" - fi - done - - # This variable tells wrapper scripts just to set shlibpath_var - # rather than running their programs. - libtool_execute_magic="$magic" - - # Check if any of the arguments is a wrapper script. - args= - for file - do - case $file in - -*) ;; - *) - # Do a test to see if this is really a libtool program. - if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then - # If there is no directory component, then add one. - case $file in - */* | *\\*) . $file ;; - *) . ./$file ;; - esac - - # Transform arg to wrapped name. - file="$progdir/$program" - fi - ;; - esac - # Quote arguments (to preserve shell metacharacters). - file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"` - args="$args \"$file\"" - done - - if test -z "$run"; then - if test -n "$shlibpath_var"; then - # Export the shlibpath_var. - eval "export $shlibpath_var" - fi - - # Restore saved environment variables - for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES - do - eval "if test \"\${save_$lt_var+set}\" = set; then - $lt_var=\$save_$lt_var; export $lt_var - fi" - done - - # Now prepare to actually exec the command. - exec_cmd="\$cmd$args" - else - # Display what would be done. - if test -n "$shlibpath_var"; then - eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\"" - $echo "export $shlibpath_var" - fi - $echo "$cmd$args" - exit $EXIT_SUCCESS - fi - ;; - - # libtool clean and uninstall mode - clean | uninstall) - modename="$modename: $mode" - rm="$nonopt" - files= - rmforce= - exit_status=0 - - # This variable tells wrapper scripts just to set variables rather - # than running their programs. - libtool_install_magic="$magic" - - for arg - do - case $arg in - -f) rm="$rm $arg"; rmforce=yes ;; - -*) rm="$rm $arg" ;; - *) files="$files $arg" ;; - esac - done - - if test -z "$rm"; then - $echo "$modename: you must specify an RM program" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - fi - - rmdirs= - - origobjdir="$objdir" - for file in $files; do - dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` - if test "X$dir" = "X$file"; then - dir=. - objdir="$origobjdir" - else - objdir="$dir/$origobjdir" - fi - name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` - test "$mode" = uninstall && objdir="$dir" - - # Remember objdir for removal later, being careful to avoid duplicates - if test "$mode" = clean; then - case " $rmdirs " in - *" $objdir "*) ;; - *) rmdirs="$rmdirs $objdir" ;; - esac - fi - - # Don't error if the file doesn't exist and rm -f was used. - if (test -L "$file") >/dev/null 2>&1 \ - || (test -h "$file") >/dev/null 2>&1 \ - || test -f "$file"; then - : - elif test -d "$file"; then - exit_status=1 - continue - elif test "$rmforce" = yes; then - continue - fi - - rmfiles="$file" - - case $name in - *.la) - # Possibly a libtool archive, so verify it. - if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then - . $dir/$name - - # Delete the libtool libraries and symlinks. - for n in $library_names; do - rmfiles="$rmfiles $objdir/$n" - done - test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library" - - case "$mode" in - clean) - case " $library_names " in - # " " in the beginning catches empty $dlname - *" $dlname "*) ;; - *) rmfiles="$rmfiles $objdir/$dlname" ;; - esac - test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i" - ;; - uninstall) - if test -n "$library_names"; then - # Do each command in the postuninstall commands. - cmds=$postuninstall_cmds - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - $show "$cmd" - $run eval "$cmd" - if test "$?" -ne 0 && test "$rmforce" != yes; then - exit_status=1 - fi - done - IFS="$save_ifs" - fi - - if test -n "$old_library"; then - # Do each command in the old_postuninstall commands. - cmds=$old_postuninstall_cmds - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - $show "$cmd" - $run eval "$cmd" - if test "$?" -ne 0 && test "$rmforce" != yes; then - exit_status=1 - fi - done - IFS="$save_ifs" - fi - # FIXME: should reinstall the best remaining shared library. - ;; - esac - fi - ;; - - *.lo) - # Possibly a libtool object, so verify it. - if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then - - # Read the .lo file - . $dir/$name - - # Add PIC object to the list of files to remove. - if test -n "$pic_object" \ - && test "$pic_object" != none; then - rmfiles="$rmfiles $dir/$pic_object" - fi - - # Add non-PIC object to the list of files to remove. - if test -n "$non_pic_object" \ - && test "$non_pic_object" != none; then - rmfiles="$rmfiles $dir/$non_pic_object" - fi - fi - ;; - - *) - if test "$mode" = clean ; then - noexename=$name - case $file in - *.exe) - file=`$echo $file|${SED} 's,.exe$,,'` - noexename=`$echo $name|${SED} 's,.exe$,,'` - # $file with .exe has already been added to rmfiles, - # add $file without .exe - rmfiles="$rmfiles $file" - ;; - esac - # Do a test to see if this is a libtool program. - if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then - relink_command= - . $dir/$noexename - - # note $name still contains .exe if it was in $file originally - # as does the version of $file that was added into $rmfiles - rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}" - if test "$fast_install" = yes && test -n "$relink_command"; then - rmfiles="$rmfiles $objdir/lt-$name" - fi - if test "X$noexename" != "X$name" ; then - rmfiles="$rmfiles $objdir/lt-${noexename}.c" - fi - fi - fi - ;; - esac - $show "$rm $rmfiles" - $run $rm $rmfiles || exit_status=1 - done - objdir="$origobjdir" - - # Try to remove the ${objdir}s in the directories where we deleted files - for dir in $rmdirs; do - if test -d "$dir"; then - $show "rmdir $dir" - $run rmdir $dir >/dev/null 2>&1 - fi - done - - exit $exit_status - ;; - - "") - $echo "$modename: you must specify a MODE" 1>&2 - $echo "$generic_help" 1>&2 - exit $EXIT_FAILURE - ;; - esac - - if test -z "$exec_cmd"; then - $echo "$modename: invalid operation mode \`$mode'" 1>&2 - $echo "$generic_help" 1>&2 - exit $EXIT_FAILURE - fi -fi # test -z "$show_help" - -if test -n "$exec_cmd"; then - eval exec $exec_cmd - exit $EXIT_FAILURE -fi - -# We need to display help for each of the modes. -case $mode in -"") $echo \ -"Usage: $modename [OPTION]... [MODE-ARG]... - -Provide generalized library-building support services. - - --config show all configuration variables - --debug enable verbose shell tracing --n, --dry-run display commands without modifying any files - --features display basic configuration information and exit - --finish same as \`--mode=finish' - --help display this help message and exit - --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS] - --quiet same as \`--silent' - --silent don't print informational messages - --tag=TAG use configuration variables from tag TAG - --version print version information - -MODE must be one of the following: - - clean remove files from the build directory - compile compile a source file into a libtool object - execute automatically set library path, then run a program - finish complete the installation of libtool libraries - install install libraries or executables - link create a library or an executable - uninstall remove libraries from an installed directory - -MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for -a more detailed description of MODE. - -Report bugs to <bug-libtool@gnu.org>." - exit $EXIT_SUCCESS - ;; - -clean) - $echo \ -"Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE... - -Remove files from the build directory. - -RM is the name of the program to use to delete files associated with each FILE -(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed -to RM. - -If FILE is a libtool library, object or program, all the files associated -with it are deleted. Otherwise, only FILE itself is deleted using RM." - ;; - -compile) - $echo \ -"Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE - -Compile a source file into a libtool library object. - -This mode accepts the following additional options: - - -o OUTPUT-FILE set the output file name to OUTPUT-FILE - -prefer-pic try to building PIC objects only - -prefer-non-pic try to building non-PIC objects only - -static always build a \`.o' file suitable for static linking - -COMPILE-COMMAND is a command to be used in creating a \`standard' object file -from the given SOURCEFILE. - -The output file name is determined by removing the directory component from -SOURCEFILE, then substituting the C source code suffix \`.c' with the -library object suffix, \`.lo'." - ;; - -execute) - $echo \ -"Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]... - -Automatically set library path, then run a program. - -This mode accepts the following additional options: - - -dlopen FILE add the directory containing FILE to the library path - -This mode sets the library path environment variable according to \`-dlopen' -flags. - -If any of the ARGS are libtool executable wrappers, then they are translated -into their corresponding uninstalled binary, and any of their required library -directories are added to the library path. - -Then, COMMAND is executed, with ARGS as arguments." - ;; - -finish) - $echo \ -"Usage: $modename [OPTION]... --mode=finish [LIBDIR]... - -Complete the installation of libtool libraries. - -Each LIBDIR is a directory that contains libtool libraries. - -The commands that this mode executes may require superuser privileges. Use -the \`--dry-run' option if you just want to see what would be executed." - ;; - -install) - $echo \ -"Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND... - -Install executables or libraries. - -INSTALL-COMMAND is the installation command. The first component should be -either the \`install' or \`cp' program. - -The rest of the components are interpreted as arguments to that command (only -BSD-compatible install options are recognized)." - ;; - -link) - $echo \ -"Usage: $modename [OPTION]... --mode=link LINK-COMMAND... - -Link object files or libraries together to form another library, or to -create an executable program. - -LINK-COMMAND is a command using the C compiler that you would use to create -a program from several object files. - -The following components of LINK-COMMAND are treated specially: - - -all-static do not do any dynamic linking at all - -avoid-version do not add a version suffix if possible - -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime - -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols - -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) - -export-symbols SYMFILE - try to export only the symbols listed in SYMFILE - -export-symbols-regex REGEX - try to export only the symbols matching REGEX - -LLIBDIR search LIBDIR for required installed libraries - -lNAME OUTPUT-FILE requires the installed library libNAME - -module build a library that can dlopened - -no-fast-install disable the fast-install mode - -no-install link a not-installable executable - -no-undefined declare that a library does not refer to external symbols - -o OUTPUT-FILE create OUTPUT-FILE from the specified objects - -objectlist FILE Use a list of object files found in FILE to specify objects - -precious-files-regex REGEX - don't remove output files matching REGEX - -release RELEASE specify package release information - -rpath LIBDIR the created library will eventually be installed in LIBDIR - -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries - -static do not do any dynamic linking of uninstalled libtool libraries - -static-libtool-libs - do not do any dynamic linking of libtool libraries - -version-info CURRENT[:REVISION[:AGE]] - specify library version info [each variable defaults to 0] - -All other options (arguments beginning with \`-') are ignored. - -Every other argument is treated as a filename. Files ending in \`.la' are -treated as uninstalled libtool libraries, other files are standard or library -object files. - -If the OUTPUT-FILE ends in \`.la', then a libtool library is created, -only library objects (\`.lo' files) may be specified, and \`-rpath' is -required, except when creating a convenience library. - -If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created -using \`ar' and \`ranlib', or on Windows using \`lib'. - -If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file -is created, otherwise an executable program is created." - ;; - -uninstall) - $echo \ -"Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... - -Remove libraries from an installation directory. - -RM is the name of the program to use to delete files associated with each FILE -(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed -to RM. - -If FILE is a libtool library, all the files associated with it are deleted. -Otherwise, only FILE itself is deleted using RM." - ;; - -*) - $echo "$modename: invalid operation mode \`$mode'" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - ;; -esac - -$echo -$echo "Try \`$modename --help' for more information about other modes." - -exit $? - -# The TAGs below are defined such that we never get into a situation -# in which we disable both kinds of libraries. Given conflicting -# choices, we go for a static library, that is the most portable, -# since we can't tell whether shared libraries were disabled because -# the user asked for that or because the platform doesn't support -# them. This is particularly important on AIX, because we don't -# support having both static and shared libraries enabled at the same -# time on that platform, so we default to a shared-only configuration. -# If a disable-shared tag is given, we'll fallback to a static-only -# configuration. But we'll never go from static-only to shared-only. - -# ### BEGIN LIBTOOL TAG CONFIG: disable-shared -disable_libs=shared -# ### END LIBTOOL TAG CONFIG: disable-shared - -# ### BEGIN LIBTOOL TAG CONFIG: disable-static -disable_libs=static -# ### END LIBTOOL TAG CONFIG: disable-static - -# Local Variables: -# mode:shell-script -# sh-indentation:2 -# End: diff --git a/libs/dbus-c++/src/Makefile.am b/libs/dbus-c++/src/Makefile.am deleted file mode 100644 index f449e9db9eb9e68ee8f2ec809b8e8c14e75f2643..0000000000000000000000000000000000000000 --- a/libs/dbus-c++/src/Makefile.am +++ /dev/null @@ -1,46 +0,0 @@ -AM_CPPFLAGS = \ - $(dbus_CFLAGS) \ - $(glib_CFLAGS) \ - -I$(top_srcdir)/include \ - -I$(top_builddir)/include - -if ENABLE_GLIB -GLIB_H = $(HEADER_DIR)/glib-integration.h -GLIB_CPP = glib-integration.cpp -endif - -CONFIG_H = $(top_builddir)/include/dbus-c++/config.h - -HEADER_DIR = $(top_srcdir)/include/dbus-c++ -HEADER_FILES = \ - $(CONFIG_H) \ - $(HEADER_DIR)/dbus.h \ - $(HEADER_DIR)/types.h \ - $(HEADER_DIR)/connection.h \ - $(HEADER_DIR)/property.h \ - $(HEADER_DIR)/debug.h \ - $(HEADER_DIR)/error.h \ - $(HEADER_DIR)/interface.h \ - $(HEADER_DIR)/message.h \ - $(HEADER_DIR)/dispatcher.h \ - $(HEADER_DIR)/object.h \ - $(HEADER_DIR)/pendingcall.h \ - $(HEADER_DIR)/server.h \ - $(HEADER_DIR)/debug.h \ - $(HEADER_DIR)/util.h \ - $(HEADER_DIR)/refptr_impl.h \ - $(HEADER_DIR)/introspection.h \ - $(HEADER_DIR)/api.h \ - $(HEADER_DIR)/eventloop.h \ - $(HEADER_DIR)/eventloop-integration.h \ - $(GLIB_H) - -lib_includedir=$(includedir)/dbus-c++-1/dbus-c++/ -lib_include_HEADERS = $(HEADER_FILES) - -lib_LTLIBRARIES = libdbus-c++-1.la -libdbus_c___1_la_SOURCES = $(HEADER_FILES) interface.cpp object.cpp introspection.cpp debug.cpp types.cpp connection.cpp connection_p.h property.cpp dispatcher.cpp dispatcher_p.h pendingcall.cpp pendingcall_p.h error.cpp internalerror.h message.cpp message_p.h server.cpp server_p.h eventloop.cpp eventloop-integration.cpp $(GLIB_CPP) -libdbus_c___1_la_LIBADD = $(dbus_LIBS) $(glib_LIBS) $(pthread_LIBS) - -MAINTAINERCLEANFILES = \ - Makefile.in diff --git a/libs/dbus-c++/src/connection.cpp b/libs/dbus-c++/src/connection.cpp deleted file mode 100644 index 08f573a070c8876fb823ca9d8f967dc035ca2672..0000000000000000000000000000000000000000 --- a/libs/dbus-c++/src/connection.cpp +++ /dev/null @@ -1,413 +0,0 @@ -/* - * - * D-Bus++ - C++ bindings for D-Bus - * - * Copyright (C) 2005-2007 Paolo Durante <shackan@gmail.com> - * - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - - -#include <dbus-c++/debug.h> -#include <dbus-c++/connection.h> - -#include <dbus/dbus.h> -#include <string> - -#include "internalerror.h" - -#include "connection_p.h" -#include "dispatcher_p.h" -#include "server_p.h" -#include "message_p.h" -#include "pendingcall_p.h" - -using namespace DBus; - -Connection::Private::Private(DBusConnection *c, Server::Private *s) -: conn(c) , dispatcher(0), server(s) -{ - init(); -} - -Connection::Private::Private(DBusBusType type) -{ - InternalError e; - - conn = dbus_bus_get_private(type, e); - - if (e) throw Error(e); - - init(); -} - -Connection::Private::~Private() -{ - debug_log("terminating connection 0x%08x", conn); - - detach_server(); - - if (dbus_connection_get_is_connected(conn)) - { - std::vector<std::string>::iterator i = names.begin(); - - while (i != names.end()) - { - debug_log("%s: releasing bus name %s", dbus_bus_get_unique_name(conn), i->c_str()); - dbus_bus_release_name(conn, i->c_str(), NULL); - ++i; - } - dbus_connection_close(conn); - } - dbus_connection_unref(conn); -} - -void Connection::Private::init() -{ - dbus_connection_ref(conn); - dbus_connection_ref(conn); //todo: the library has to own another reference - - disconn_filter = new Callback<Connection::Private, bool, const Message &>( - this, &Connection::Private::disconn_filter_function - ); - - dbus_connection_add_filter(conn, message_filter_stub, &disconn_filter, NULL); - - dbus_connection_set_dispatch_status_function(conn, dispatch_status_stub, this, 0); - dbus_connection_set_exit_on_disconnect(conn, false); //why was this set to true?? -} - -void Connection::Private::detach_server() -{ -/* Server::Private *tmp = server; - - server = NULL; - - if (tmp) - { - ConnectionList::iterator i; - - for (i = tmp->connections.begin(); i != tmp->connections.end(); ++i) - { - if (i->_pvt.get() == this) - { - tmp->connections.erase(i); - break; - } - } - }*/ -} - -bool Connection::Private::do_dispatch() -{ - debug_log("dispatching on %p", conn); - - if (!dbus_connection_get_is_connected(conn)) - { - debug_log("connection terminated"); - - detach_server(); - - return true; - } - - return dbus_connection_dispatch(conn) != DBUS_DISPATCH_DATA_REMAINS; -} - -void Connection::Private::dispatch_status_stub(DBusConnection *dc, DBusDispatchStatus status, void *data) -{ - Private *p = static_cast<Private *>(data); - - switch (status) - { - case DBUS_DISPATCH_DATA_REMAINS: - debug_log("some dispatching to do on %p", dc); - p->dispatcher->queue_connection(p); - break; - - case DBUS_DISPATCH_COMPLETE: - debug_log("all dispatching done on %p", dc); - break; - - case DBUS_DISPATCH_NEED_MEMORY: //uh oh... - debug_log("connection %p needs memory", dc); - break; - } -} - -DBusHandlerResult Connection::Private::message_filter_stub(DBusConnection *conn, DBusMessage *dmsg, void *data) -{ - MessageSlot *slot = static_cast<MessageSlot *>(data); - - Message msg = Message(new Message::Private(dmsg)); - - return slot && !slot->empty() && slot->call(msg) - ? DBUS_HANDLER_RESULT_HANDLED - : DBUS_HANDLER_RESULT_NOT_YET_HANDLED; -} - -bool Connection::Private::disconn_filter_function(const Message &msg) -{ - if (msg.is_signal(DBUS_INTERFACE_LOCAL,"Disconnected")) - { - debug_log("%p disconnected by local bus", conn); - dbus_connection_close(conn); - - return true; - } - return false; -} - -Connection Connection::SystemBus() -{ - return Connection(new Private(DBUS_BUS_SYSTEM)); -} - -Connection Connection::SessionBus() -{ - return Connection(new Private(DBUS_BUS_SESSION)); -} - -Connection Connection::ActivationBus() -{ - return Connection(new Private(DBUS_BUS_STARTER)); -} - -Connection::Connection(const char *address, bool priv) -{ - InternalError e; - DBusConnection *conn = priv - ? dbus_connection_open_private(address, e) - : dbus_connection_open(address, e); - - if (e) throw Error(e); - - _pvt = new Private(conn); - - setup(default_dispatcher); - - debug_log("connected to %s", address); -} - -Connection::Connection(Connection::Private *p) -: _pvt(p) -{ - setup(default_dispatcher); -} - -Connection::Connection(const Connection &c) -: _pvt(c._pvt) -{ - dbus_connection_ref(_pvt->conn); -} - -Connection::~Connection() -{ - dbus_connection_unref(_pvt->conn); -} - -Dispatcher *Connection::setup(Dispatcher *dispatcher) -{ - debug_log("registering stubs for connection %p", _pvt->conn); - - if (!dispatcher) dispatcher = default_dispatcher; - - if (!dispatcher) throw ErrorFailed("no default dispatcher set for new connection"); - - Dispatcher *prev = _pvt->dispatcher; - - _pvt->dispatcher = dispatcher; - - dispatcher->queue_connection(_pvt.get()); - - dbus_connection_set_watch_functions( - _pvt->conn, - Dispatcher::Private::on_add_watch, - Dispatcher::Private::on_rem_watch, - Dispatcher::Private::on_toggle_watch, - dispatcher, - 0 - ); - - dbus_connection_set_timeout_functions( - _pvt->conn, - Dispatcher::Private::on_add_timeout, - Dispatcher::Private::on_rem_timeout, - Dispatcher::Private::on_toggle_timeout, - dispatcher, - 0 - ); - - return prev; -} - -bool Connection::operator == (const Connection &c) const -{ - return _pvt->conn == c._pvt->conn; -} - -bool Connection::register_bus() -{ - InternalError e; - - bool r = dbus_bus_register(_pvt->conn, e); - - if (e) throw (e); - - return r; -} - -bool Connection::connected() const -{ - return dbus_connection_get_is_connected(_pvt->conn); -} - -void Connection::disconnect() -{ -// dbus_connection_disconnect(_pvt->conn); // disappeared in 0.9x - dbus_connection_close(_pvt->conn); -} - -void Connection::exit_on_disconnect(bool exit) -{ - dbus_connection_set_exit_on_disconnect(_pvt->conn, exit); -} - -bool Connection::unique_name(const char *n) -{ - return dbus_bus_set_unique_name(_pvt->conn, n); -} - -const char *Connection::unique_name() const -{ - return dbus_bus_get_unique_name(_pvt->conn); -} - -void Connection::flush() -{ - dbus_connection_flush(_pvt->conn); -} - -void Connection::add_match(const char *rule) -{ - InternalError e; - - dbus_bus_add_match(_pvt->conn, rule, e); - - debug_log("%s: added match rule %s", unique_name(), rule); - - if (e) throw Error(e); -} - -void Connection::remove_match(const char *rule) -{ - InternalError e; - - dbus_bus_remove_match(_pvt->conn, rule, e); - - debug_log("%s: removed match rule %s", unique_name(), rule); - - if (e) throw Error(e); -} - -bool Connection::add_filter(MessageSlot &s) -{ - debug_log("%s: adding filter", unique_name()); - return dbus_connection_add_filter(_pvt->conn, Private::message_filter_stub, &s, NULL); -} - -void Connection::remove_filter(MessageSlot &s) -{ - debug_log("%s: removing filter", unique_name()); - dbus_connection_remove_filter(_pvt->conn, Private::message_filter_stub, &s); -} - -bool Connection::send(const Message &msg, unsigned int *serial) -{ - return dbus_connection_send(_pvt->conn, msg._pvt->msg, serial); -} - -Message Connection::send_blocking(Message &msg, int timeout) -{ - DBusMessage *reply; - InternalError e; - - reply = dbus_connection_send_with_reply_and_block(_pvt->conn, msg._pvt->msg, timeout, e); - - if (e) throw Error(e); - - return Message(new Message::Private(reply), false); -} - -PendingCall Connection::send_async(Message &msg, int timeout) -{ - DBusPendingCall *pending; - - if (!dbus_connection_send_with_reply(_pvt->conn, msg._pvt->msg, &pending, timeout)) - { - throw ErrorNoMemory("Unable to start asynchronous call"); - } - return PendingCall(new PendingCall::Private(pending)); -} - -void Connection::request_name(const char *name, int flags) -{ - InternalError e; - - debug_log("%s: registering bus name %s", unique_name(), name); - - dbus_bus_request_name(_pvt->conn, name, flags, e); //we deliberately don't check return value - - if (e) throw Error(e); - -// this->remove_match("destination"); - - if (name) - { - _pvt->names.push_back(name); - std::string match = "destination='" + _pvt->names.back() + "'"; - add_match(match.c_str()); - } -} - -bool Connection::has_name(const char *name) -{ - InternalError e; - - bool b = dbus_bus_name_has_owner(_pvt->conn, name, e); - - if (e) throw Error(e); - - return b; -} - -const std::vector<std::string>& Connection::names() -{ - return _pvt->names; -} - -bool Connection::start_service(const char *name, unsigned long flags) -{ - InternalError e; - - bool b = dbus_bus_start_service_by_name(_pvt->conn, name, flags, NULL, e); - - if (e) throw Error(e); - - return b; -} - diff --git a/libs/dbus-c++/src/connection_p.h b/libs/dbus-c++/src/connection_p.h deleted file mode 100644 index 21643829b808faf4b891733eeb08e921b74b4e48..0000000000000000000000000000000000000000 --- a/libs/dbus-c++/src/connection_p.h +++ /dev/null @@ -1,73 +0,0 @@ -/* - * - * D-Bus++ - C++ bindings for D-Bus - * - * Copyright (C) 2005-2007 Paolo Durante <shackan@gmail.com> - * - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - - -#ifndef __DBUSXX_CONNECTION_P_H -#define __DBUSXX_CONNECTION_P_H - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include <dbus-c++/connection.h> -#include <dbus-c++/server.h> -#include <dbus-c++/dispatcher.h> -#include <dbus-c++/refptr_impl.h> - -#include <dbus/dbus.h> - -#include <string> - -namespace DBus { - -struct DXXAPILOCAL Connection::Private -{ - DBusConnection * conn; - - std::vector<std::string> names; - - Dispatcher *dispatcher; - bool do_dispatch(); - - MessageSlot disconn_filter; - bool disconn_filter_function(const Message &); - - Server::Private *server; - void detach_server(); - - Private(DBusConnection *, Server::Private * = NULL); - - Private(DBusBusType); - - ~Private(); - - void init(); - - static void dispatch_status_stub(DBusConnection *, DBusDispatchStatus, void *); - - static DBusHandlerResult message_filter_stub(DBusConnection *, DBusMessage *, void *); -}; - -} /* namespace DBus */ - -#endif//__DBUSXX_CONNECTION_P_H diff --git a/libs/dbus-c++/src/debug.cpp b/libs/dbus-c++/src/debug.cpp deleted file mode 100644 index 4ca2c782ce57e4b6cebd888c58938c3c17c577b0..0000000000000000000000000000000000000000 --- a/libs/dbus-c++/src/debug.cpp +++ /dev/null @@ -1,53 +0,0 @@ -/* - * - * D-Bus++ - C++ bindings for D-Bus - * - * Copyright (C) 2005-2007 Paolo Durante <shackan@gmail.com> - * - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - - -#include <dbus-c++/debug.h> - -#include <stdarg.h> -#include <cstdio> -#include <stdlib.h> - -static void _debug_log_default(const char *format, ...) -{ -#ifdef DEBUG - - static int debug_env = getenv("DBUSXX_VERBOSE") ? 1 : 0; - - if (debug_env) - { - va_list args; - va_start(args, format); - - fprintf(stderr, "dbus-c++: "); - vfprintf(stderr, format, args); - fprintf(stderr, "\n"); - - va_end(args); - } - -#endif//DEBUG -} - -DBus::LogFunction DBus::debug_log = _debug_log_default; - diff --git a/libs/dbus-c++/src/dispatcher.cpp b/libs/dbus-c++/src/dispatcher.cpp deleted file mode 100644 index 68c4412c3d5171e1452f43edbcd1aa0fff4cb364..0000000000000000000000000000000000000000 --- a/libs/dbus-c++/src/dispatcher.cpp +++ /dev/null @@ -1,245 +0,0 @@ -/* - * - * D-Bus++ - C++ bindings for D-Bus - * - * Copyright (C) 2005-2007 Paolo Durante <shackan@gmail.com> - * - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - - -#include <dbus-c++/dispatcher.h> - -#include <dbus/dbus.h> - -#include "dispatcher_p.h" -#include "server_p.h" -#include "connection_p.h" - -DBus::Dispatcher *DBus::default_dispatcher = NULL; - -using namespace DBus; - -Timeout::Timeout(Timeout::Internal *i) -: _int(i) -{ - dbus_timeout_set_data((DBusTimeout *)i, this, NULL); -} - -int Timeout::interval() const -{ - return dbus_timeout_get_interval((DBusTimeout *)_int); -} - -bool Timeout::enabled() const -{ - return dbus_timeout_get_enabled((DBusTimeout *)_int); -} - -bool Timeout::handle() -{ - return dbus_timeout_handle((DBusTimeout *)_int); -} - -/* -*/ - -Watch::Watch(Watch::Internal *i) -: _int(i) -{ - dbus_watch_set_data((DBusWatch *)i, this, NULL); -} - -int Watch::descriptor() const -{ - return dbus_watch_get_fd((DBusWatch *)_int); -} - -int Watch::flags() const -{ - return dbus_watch_get_flags((DBusWatch *)_int); -} - -bool Watch::enabled() const -{ - return dbus_watch_get_enabled((DBusWatch *)_int); -} - -bool Watch::handle(int flags) -{ - return dbus_watch_handle((DBusWatch *)_int, flags); -} - -/* -*/ - -dbus_bool_t Dispatcher::Private::on_add_watch(DBusWatch *watch, void *data) -{ - Dispatcher *d = static_cast<Dispatcher *>(data); - - Watch::Internal *w = reinterpret_cast<Watch::Internal *>(watch); - - d->add_watch(w); - - return true; -} - -void Dispatcher::Private::on_rem_watch(DBusWatch *watch, void *data) -{ - Dispatcher *d = static_cast<Dispatcher *>(data); - - Watch *w = static_cast<Watch *>(dbus_watch_get_data(watch)); - - d->rem_watch(w); -} - -void Dispatcher::Private::on_toggle_watch(DBusWatch *watch, void *data) -{ - Watch *w = static_cast<Watch *>(dbus_watch_get_data(watch)); - - w->toggle(); -} - -dbus_bool_t Dispatcher::Private::on_add_timeout(DBusTimeout *timeout, void *data) -{ - Dispatcher *d = static_cast<Dispatcher *>(data); - - Timeout::Internal *t = reinterpret_cast<Timeout::Internal *>(timeout); - - d->add_timeout(t); - - return true; -} - -void Dispatcher::Private::on_rem_timeout(DBusTimeout *timeout, void *data) -{ - Dispatcher *d = static_cast<Dispatcher *>(data); - - Timeout *t = static_cast<Timeout *>(dbus_timeout_get_data(timeout)); - - d->rem_timeout(t); -} - -void Dispatcher::Private::on_toggle_timeout(DBusTimeout *timeout, void *data) -{ - Timeout *t = static_cast<Timeout *>(dbus_timeout_get_data(timeout)); - - t->toggle(); -} - -void Dispatcher::queue_connection(Connection::Private *cp) -{ - _mutex_p.lock(); - _pending_queue.push_back(cp); - _mutex_p.unlock(); -} - -void Dispatcher::dispatch_pending() -{ - _mutex_p.lock(); - - while (_pending_queue.size() > 0) - { - Connection::PrivatePList::iterator i, j; - - i = _pending_queue.begin(); - - while (i != _pending_queue.end()) - { - j = i; - - ++j; - - if ((*i)->do_dispatch()) - _pending_queue.erase(i); - - i = j; - } - } - _mutex_p.unlock(); -} - -#ifdef DBUS_HAS_THREADS_INIT_DEFAULT -void DBus::_init_threading() -{ - dbus_threads_init_default(); -} -#endif//DBUS_HAS_THREADS_INIT_DEFAULT - -void DBus::_init_threading( - MutexNewFn m1, - MutexFreeFn m2, - MutexLockFn m3, - MutexUnlockFn m4, - CondVarNewFn c1, - CondVarFreeFn c2, - CondVarWaitFn c3, - CondVarWaitTimeoutFn c4, - CondVarWakeOneFn c5, - CondVarWakeAllFn c6 -) -{ -#ifndef DBUS_HAS_RECURSIVE_MUTEX - DBusThreadFunctions functions = { - DBUS_THREAD_FUNCTIONS_MUTEX_NEW_MASK | - DBUS_THREAD_FUNCTIONS_MUTEX_FREE_MASK | - DBUS_THREAD_FUNCTIONS_MUTEX_LOCK_MASK | - DBUS_THREAD_FUNCTIONS_MUTEX_UNLOCK_MASK | - DBUS_THREAD_FUNCTIONS_CONDVAR_NEW_MASK | - DBUS_THREAD_FUNCTIONS_CONDVAR_FREE_MASK | - DBUS_THREAD_FUNCTIONS_CONDVAR_WAIT_MASK | - DBUS_THREAD_FUNCTIONS_CONDVAR_WAIT_TIMEOUT_MASK | - DBUS_THREAD_FUNCTIONS_CONDVAR_WAKE_ONE_MASK| - DBUS_THREAD_FUNCTIONS_CONDVAR_WAKE_ALL_MASK, - (DBusMutexNewFunction) m1, - (DBusMutexFreeFunction) m2, - (DBusMutexLockFunction) m3, - (DBusMutexUnlockFunction) m4, - (DBusCondVarNewFunction) c1, - (DBusCondVarFreeFunction) c2, - (DBusCondVarWaitFunction) c3, - (DBusCondVarWaitTimeoutFunction) c4, - (DBusCondVarWakeOneFunction) c5, - (DBusCondVarWakeAllFunction) c6 - }; -#else - DBusThreadFunctions functions = { - DBUS_THREAD_FUNCTIONS_RECURSIVE_MUTEX_NEW_MASK | - DBUS_THREAD_FUNCTIONS_RECURSIVE_MUTEX_FREE_MASK | - DBUS_THREAD_FUNCTIONS_RECURSIVE_MUTEX_LOCK_MASK | - DBUS_THREAD_FUNCTIONS_RECURSIVE_MUTEX_UNLOCK_MASK | - DBUS_THREAD_FUNCTIONS_CONDVAR_NEW_MASK | - DBUS_THREAD_FUNCTIONS_CONDVAR_FREE_MASK | - DBUS_THREAD_FUNCTIONS_CONDVAR_WAIT_MASK | - DBUS_THREAD_FUNCTIONS_CONDVAR_WAIT_TIMEOUT_MASK | - DBUS_THREAD_FUNCTIONS_CONDVAR_WAKE_ONE_MASK| - DBUS_THREAD_FUNCTIONS_CONDVAR_WAKE_ALL_MASK, - 0, 0, 0, 0, - (DBusCondVarNewFunction) c1, - (DBusCondVarFreeFunction) c2, - (DBusCondVarWaitFunction) c3, - (DBusCondVarWaitTimeoutFunction) c4, - (DBusCondVarWakeOneFunction) c5, - (DBusCondVarWakeAllFunction) c6, - (DBusRecursiveMutexNewFunction) m1, - (DBusRecursiveMutexFreeFunction) m2, - (DBusRecursiveMutexLockFunction) m3, - (DBusRecursiveMutexUnlockFunction) m4 - }; -#endif//DBUS_HAS_RECURSIVE_MUTEX - dbus_threads_init(&functions); -} diff --git a/libs/dbus-c++/src/dispatcher_p.h b/libs/dbus-c++/src/dispatcher_p.h deleted file mode 100644 index ece33b7be80d8ef2cda3cf9a500674fc44d2b0a8..0000000000000000000000000000000000000000 --- a/libs/dbus-c++/src/dispatcher_p.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - * - * D-Bus++ - C++ bindings for D-Bus - * - * Copyright (C) 2005-2007 Paolo Durante <shackan@gmail.com> - * - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - - -#ifndef __DBUSXX_DISPATCHER_P_H -#define __DBUSXX_DISPATCHER_P_H - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include <dbus-c++/dispatcher.h> - -#include <dbus/dbus.h> - -#include "internalerror.h" - -namespace DBus { - -struct DXXAPILOCAL Dispatcher::Private -{ - static dbus_bool_t on_add_watch(DBusWatch *watch, void *data); - - static void on_rem_watch(DBusWatch *watch, void *data); - - static void on_toggle_watch(DBusWatch *watch, void *data); - - static dbus_bool_t on_add_timeout(DBusTimeout *timeout, void *data); - - static void on_rem_timeout(DBusTimeout *timeout, void *data); - - static void on_toggle_timeout(DBusTimeout *timeout, void *data); -}; - -} /* namespace DBus */ - -#endif//__DBUSXX_DISPATCHER_P_H diff --git a/libs/dbus-c++/src/error.cpp b/libs/dbus-c++/src/error.cpp deleted file mode 100644 index 23f7bec71b1e7d2b67176876a740b1215f910299..0000000000000000000000000000000000000000 --- a/libs/dbus-c++/src/error.cpp +++ /dev/null @@ -1,86 +0,0 @@ -/* - * - * D-Bus++ - C++ bindings for D-Bus - * - * Copyright (C) 2005-2007 Paolo Durante <shackan@gmail.com> - * - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - - -#include <dbus-c++/message.h> -#include <dbus-c++/error.h> - -#include <dbus/dbus.h> - -#include "message_p.h" -#include "internalerror.h" - -using namespace DBus; - -/* -*/ - -Error::Error() -: _int(new InternalError) -{} - -Error::Error(InternalError &i) -: _int(new InternalError(i)) -{} - -Error::Error(const char *name, const char *message) -: _int(new InternalError) -{ - set(name, message); -} - -Error::Error(Message &m) -: _int(new InternalError) -{ - dbus_set_error_from_message(&(_int->error), m._pvt->msg); -} - -Error::~Error() throw() -{ -} - -const char *Error::name() const -{ - return _int->error.name; -} - -const char *Error::message() const -{ - return _int->error.message; -} - -bool Error::is_set() const -{ - return *(_int); -} - -void Error::set(const char *name, const char *message) -{ - dbus_set_error_const(&(_int->error), name, message); -} - -const char *Error::what() const throw() -{ - return _int->error.message; -} - diff --git a/libs/dbus-c++/src/eventloop-integration.cpp b/libs/dbus-c++/src/eventloop-integration.cpp deleted file mode 100644 index b1075672e0cf8482ea6c2c230dd63880a1751e45..0000000000000000000000000000000000000000 --- a/libs/dbus-c++/src/eventloop-integration.cpp +++ /dev/null @@ -1,163 +0,0 @@ -/* - * - * D-Bus++ - C++ bindings for D-Bus - * - * Copyright (C) 2005-2007 Paolo Durante <shackan@gmail.com> - * - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - - -#include <dbus-c++/eventloop-integration.h> -#include <dbus-c++/debug.h> - -#include <sys/poll.h> - -#include <dbus/dbus.h> - -using namespace DBus; - -BusTimeout::BusTimeout(Timeout::Internal *ti, BusDispatcher *bd) -: Timeout(ti), DefaultTimeout(Timeout::interval(), true, bd) -{ - DefaultTimeout::enabled(Timeout::enabled()); -} - -void BusTimeout::toggle() -{ - debug_log("timeout %p toggled (%s)", this, Timeout::enabled() ? "on":"off"); - - DefaultTimeout::enabled(Timeout::enabled()); -} - -BusWatch::BusWatch(Watch::Internal *wi, BusDispatcher *bd) -: Watch(wi), DefaultWatch(Watch::descriptor(), 0, bd) -{ - int flags = POLLHUP | POLLERR; - - if (Watch::flags() & DBUS_WATCH_READABLE) - flags |= POLLIN; - if (Watch::flags() & DBUS_WATCH_WRITABLE) - flags |= POLLOUT; - - DefaultWatch::flags(flags); - DefaultWatch::enabled(Watch::enabled()); -} - -void BusWatch::toggle() -{ - debug_log("watch %p toggled (%s)", this, Watch::enabled() ? "on":"off"); - - DefaultWatch::enabled(Watch::enabled()); -} - -void BusDispatcher::enter() -{ - debug_log("entering dispatcher %p", this); - - _running = true; - - while (_running) - { - do_iteration(); - } - - debug_log("leaving dispatcher %p", this); -} - -void BusDispatcher::leave() -{ - _running = false; -} - -void BusDispatcher::do_iteration() -{ - dispatch_pending(); - dispatch(); -} - -Timeout *BusDispatcher::add_timeout(Timeout::Internal *ti) -{ - BusTimeout *bt = new BusTimeout(ti, this); - - bt->expired = new Callback<BusDispatcher, void, DefaultTimeout &>(this, &BusDispatcher::timeout_expired); - bt->data(bt); - - debug_log("added timeout %p (%s) interval=%d", - bt, ((Timeout *)bt)->enabled() ? "on":"off", ((Timeout *)bt)->interval()); - - return bt; -} - -void BusDispatcher::rem_timeout(Timeout *t) -{ - debug_log("removed timeout %p", t); - - delete t; -} - -Watch *BusDispatcher::add_watch(Watch::Internal *wi) -{ - BusWatch *bw = new BusWatch(wi, this); - - bw->ready = new Callback<BusDispatcher, void, DefaultWatch &>(this, &BusDispatcher::watch_ready); - bw->data(bw); - - debug_log("added watch %p (%s) fd=%d flags=%d", - bw, ((Watch *)bw)->enabled() ? "on":"off", ((Watch *)bw)->descriptor(), ((Watch *)bw)->flags()); - - return bw; -} - -void BusDispatcher::rem_watch(Watch *w) -{ - debug_log("removed watch %p", w); - - delete w; -} - -void BusDispatcher::timeout_expired(DefaultTimeout &et) -{ - debug_log("timeout %p expired", &et); - - BusTimeout *timeout = reinterpret_cast<BusTimeout *>(et.data()); - - timeout->handle(); -} - -void BusDispatcher::watch_ready(DefaultWatch &ew) -{ - BusWatch *watch = reinterpret_cast<BusWatch *>(ew.data()); - - debug_log("watch %p ready, flags=%d state=%d", - watch, ((Watch *)watch)->flags(), watch->state() - ); - - int flags = 0; - - if (watch->state() & POLLIN) - flags |= DBUS_WATCH_READABLE; - if (watch->state() & POLLOUT) - flags |= DBUS_WATCH_WRITABLE; - if (watch->state() & POLLHUP) - flags |= DBUS_WATCH_HANGUP; - if (watch->state() & POLLERR) - flags |= DBUS_WATCH_ERROR; - - watch->handle(flags); -} - diff --git a/libs/dbus-c++/src/eventloop.cpp b/libs/dbus-c++/src/eventloop.cpp deleted file mode 100644 index 1d4aa2a19c44409eeb7b7d3161f3195633521c8d..0000000000000000000000000000000000000000 --- a/libs/dbus-c++/src/eventloop.cpp +++ /dev/null @@ -1,227 +0,0 @@ -/* - * - * D-Bus++ - C++ bindings for D-Bus - * - * Copyright (C) 2005-2007 Paolo Durante <shackan@gmail.com> - * - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - - -#include <dbus-c++/eventloop.h> -#include <dbus-c++/debug.h> - -#include <sys/poll.h> -#include <sys/time.h> - -#include <dbus/dbus.h> - -using namespace DBus; - -static double millis(timeval tv) -{ - return (tv.tv_sec *1000.0 + tv.tv_usec/1000.0); -} - -DefaultTimeout::DefaultTimeout(int interval, bool repeat, DefaultMainLoop *ed) -: _enabled(true), _interval(interval), _repeat(repeat), _expiration(0), _data(0), _disp(ed) -{ - timeval now; - gettimeofday(&now, NULL); - - _expiration = millis(now) + interval; - - _disp->_mutex_t.lock(); - _disp->_timeouts.push_back(this); - _disp->_mutex_t.unlock(); -} - -DefaultTimeout::~DefaultTimeout() -{ - _disp->_mutex_t.lock(); - _disp->_timeouts.remove(this); - _disp->_mutex_t.unlock(); -} - -DefaultWatch::DefaultWatch(int fd, int flags, DefaultMainLoop *ed) -: _enabled(true), _fd(fd), _flags(flags), _state(0), _data(0), _disp(ed) -{ - _disp->_mutex_w.lock(); - _disp->_watches.push_back(this); - _disp->_mutex_w.unlock(); -} - -DefaultWatch::~DefaultWatch() -{ - _disp->_mutex_w.lock(); - _disp->_watches.remove(this); - _disp->_mutex_w.unlock(); -} - -DefaultMutex::DefaultMutex() -{ - pthread_mutex_init(&_mutex, NULL); -} - -DefaultMutex::~DefaultMutex() -{ - pthread_mutex_destroy(&_mutex); -} - -void DefaultMutex::lock() -{ - pthread_mutex_lock(&_mutex); -} - -void DefaultMutex::unlock() -{ - pthread_mutex_unlock(&_mutex); -} - -DefaultMainLoop::DefaultMainLoop() -{ -} - -DefaultMainLoop::~DefaultMainLoop() -{ - _mutex_w.lock(); - - DefaultWatches::iterator wi = _watches.begin(); - while (wi != _watches.end()) - { - DefaultWatches::iterator wmp = wi; - ++wmp; - _mutex_w.unlock(); - delete (*wi); - _mutex_w.lock(); - wi = wmp; - } - _mutex_w.unlock(); - - _mutex_t.lock(); - - DefaultTimeouts::iterator ti = _timeouts.begin(); - while (ti != _timeouts.end()) - { - DefaultTimeouts::iterator tmp = ti; - ++tmp; - _mutex_t.unlock(); - delete (*ti); - _mutex_t.lock(); - ti = tmp; - } - _mutex_t.unlock(); -} - -void DefaultMainLoop::dispatch() -{ - _mutex_w.lock(); - - int nfd = _watches.size(); - - pollfd fds[nfd]; - - DefaultWatches::iterator wi = _watches.begin(); - - for (nfd = 0; wi != _watches.end(); ++wi) - { - if ((*wi)->enabled()) - { - fds[nfd].fd = (*wi)->descriptor(); - fds[nfd].events = (*wi)->flags(); - fds[nfd].revents = 0; - - ++nfd; - } - } - _mutex_w.unlock(); - - int wait_min = 10000; - - DefaultTimeouts::iterator ti; - - _mutex_t.lock(); - - for (ti = _timeouts.begin(); ti != _timeouts.end(); ++ti) - { - if ((*ti)->enabled() && (*ti)->interval() < wait_min) - wait_min = (*ti)->interval(); - } - - _mutex_t.unlock(); - - poll(fds, nfd, wait_min); - - timeval now; - gettimeofday(&now, NULL); - - double now_millis = millis(now); - - _mutex_t.lock(); - - ti = _timeouts.begin(); - - while (ti != _timeouts.end()) - { - DefaultTimeouts::iterator tmp = ti; - ++tmp; - - if ((*ti)->enabled() && now_millis >= (*ti)->_expiration) - { - (*ti)->expired(*(*ti)); - - if ((*ti)->_repeat) - { - (*ti)->_expiration = now_millis + (*ti)->_interval; - } - - } - - ti = tmp; - } - - _mutex_t.unlock(); - - _mutex_w.lock(); - - for (int j = 0; j < nfd; ++j) - { - DefaultWatches::iterator wi; - - for (wi = _watches.begin(); wi != _watches.end();) - { - DefaultWatches::iterator tmp = wi; - ++tmp; - - if ((*wi)->enabled() && (*wi)->_fd == fds[j].fd) - { - if (fds[j].revents) - { - (*wi)->_state = fds[j].revents; - - (*wi)->ready(*(*wi)); - - fds[j].revents = 0; - } - } - - wi = tmp; - } - } - _mutex_w.unlock(); -} - diff --git a/libs/dbus-c++/src/glib-integration.cpp b/libs/dbus-c++/src/glib-integration.cpp deleted file mode 100644 index bde3c7afe0937c43fe9407024e274f6c4120be5a..0000000000000000000000000000000000000000 --- a/libs/dbus-c++/src/glib-integration.cpp +++ /dev/null @@ -1,225 +0,0 @@ -/* - * - * D-Bus++ - C++ bindings for D-Bus - * - * Copyright (C) 2005-2007 Paolo Durante <shackan@gmail.com> - * - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - - -#include <dbus-c++/glib-integration.h> - -#include <dbus/dbus.h> // for DBUS_WATCH_* - -using namespace DBus; - -Glib::BusTimeout::BusTimeout(Timeout::Internal *ti, GMainContext *ctx, int priority) -: Timeout(ti), _ctx(ctx), _priority(priority) -{ - _enable(); -} - -Glib::BusTimeout::~BusTimeout() -{ - _disable(); -} - -void Glib::BusTimeout::toggle() -{ - debug_log("glib: timeout %p toggled (%s)", this, Timeout::enabled() ? "on":"off"); - - if (Timeout::enabled()) _enable(); - else _disable(); -} - -gboolean Glib::BusTimeout::timeout_handler(gpointer data) -{ - Glib::BusTimeout *t = reinterpret_cast<Glib::BusTimeout *>(data); - - t->handle(); - - return TRUE; -} - -void Glib::BusTimeout::_enable() -{ - _source = g_timeout_source_new(Timeout::interval()); - g_source_set_priority(_source, _priority); - g_source_set_callback(_source, timeout_handler, this, NULL); - g_source_attach(_source, _ctx); -} - -void Glib::BusTimeout::_disable() -{ - g_source_destroy(_source); -} - -struct BusSource -{ - GSource source; - GPollFD poll; -}; - -static gboolean watch_prepare(GSource *source, gint *timeout) -{ -// debug_log("glib: watch_prepare"); - - *timeout = -1; - return FALSE; -} - -static gboolean watch_check(GSource *source) -{ -// debug_log("glib: watch_check"); - - BusSource *io = (BusSource *)source; - return io->poll.revents ? TRUE : FALSE; -} - -static gboolean watch_dispatch(GSource *source, GSourceFunc callback, gpointer data) -{ - debug_log("glib: watch_dispatch"); - - gboolean cb = callback(data); - DBus::default_dispatcher->dispatch_pending(); //TODO: won't work in case of multiple dispatchers - return cb; -} - -static GSourceFuncs watch_funcs = { - watch_prepare, - watch_check, - watch_dispatch, - NULL -}; - -Glib::BusWatch::BusWatch(Watch::Internal *wi, GMainContext *ctx, int priority) -: Watch(wi), _ctx(ctx), _priority(priority) -{ - _enable(); -} - -Glib::BusWatch::~BusWatch() -{ - _disable(); -} - -void Glib::BusWatch::toggle() -{ - debug_log("glib: watch %p toggled (%s)", this, Watch::enabled() ? "on":"off"); - - if (Watch::enabled()) _enable(); - else _disable(); -} - -gboolean Glib::BusWatch::watch_handler(gpointer data) -{ - Glib::BusWatch *w = reinterpret_cast<Glib::BusWatch *>(data); - - BusSource *io = (BusSource *)(w->_source); - - int flags = 0; - if (io->poll.revents &G_IO_IN) - flags |= DBUS_WATCH_READABLE; - if (io->poll.revents &G_IO_OUT) - flags |= DBUS_WATCH_WRITABLE; - if (io->poll.revents &G_IO_ERR) - flags |= DBUS_WATCH_ERROR; - if (io->poll.revents &G_IO_HUP) - flags |= DBUS_WATCH_HANGUP; - - w->handle(flags); - - return TRUE; -} - -void Glib::BusWatch::_enable() -{ - _source = g_source_new(&watch_funcs, sizeof(BusSource)); - g_source_set_priority(_source, _priority); - g_source_set_callback(_source, watch_handler, this, NULL); - - int flags = Watch::flags(); - int condition = 0; - - if (flags &DBUS_WATCH_READABLE) - condition |= G_IO_IN; -// if (flags &DBUS_WATCH_WRITABLE) -// condition |= G_IO_OUT; - if (flags &DBUS_WATCH_ERROR) - condition |= G_IO_ERR; - if (flags &DBUS_WATCH_HANGUP) - condition |= G_IO_HUP; - - GPollFD *poll = &(((BusSource *)_source)->poll); - poll->fd = Watch::descriptor(); - poll->events = condition; - poll->revents = 0; - - g_source_add_poll(_source, poll); - g_source_attach(_source, _ctx); -} - -void Glib::BusWatch::_disable() -{ - GPollFD *poll = &(((BusSource *)_source)->poll); - g_source_remove_poll(_source, poll); - g_source_destroy(_source); -} - -void Glib::BusDispatcher::attach(GMainContext *ctx) -{ - _ctx = ctx ? ctx : g_main_context_default(); -} - -Timeout *Glib::BusDispatcher::add_timeout(Timeout::Internal *wi) -{ - Timeout *t = new Glib::BusTimeout(wi, _ctx, _priority); - - debug_log("glib: added timeout %p (%s)", t, t->enabled() ? "on":"off"); - - return t; -} - -void Glib::BusDispatcher::rem_timeout(Timeout *t) -{ - debug_log("glib: removed timeout %p", t); - - delete t; -} - -Watch *Glib::BusDispatcher::add_watch(Watch::Internal *wi) -{ - Watch *w = new Glib::BusWatch(wi, _ctx, _priority); - - debug_log("glib: added watch %p (%s) fd=%d flags=%d", - w, w->enabled() ? "on":"off", w->descriptor(), w->flags() - ); - return w; -} - -void Glib::BusDispatcher::rem_watch(Watch *w) -{ - debug_log("glib: removed watch %p", w); - - delete w; -} - -void Glib::BusDispatcher::set_priority(int priority) -{ - _priority = priority; -} diff --git a/libs/dbus-c++/src/interface.cpp b/libs/dbus-c++/src/interface.cpp deleted file mode 100644 index 6a47cf631c022cb6d81a248ba5de8c88a47f5457..0000000000000000000000000000000000000000 --- a/libs/dbus-c++/src/interface.cpp +++ /dev/null @@ -1,156 +0,0 @@ -/* - * - * D-Bus++ - C++ bindings for D-Bus - * - * Copyright (C) 2005-2007 Paolo Durante <shackan@gmail.com> - * - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - - -#include <dbus-c++/debug.h> -#include <dbus-c++/interface.h> - -#include "internalerror.h" - -using namespace DBus; - -Interface::Interface(const std::string &name) -: _name(name) -{} - -Interface::~Interface() -{} - -InterfaceAdaptor *AdaptorBase::find_interface(const std::string &name) -{ - InterfaceAdaptorTable::const_iterator ii = _interfaces.find(name); - - return ii != _interfaces.end() ? ii->second : NULL; -} - -InterfaceAdaptor::InterfaceAdaptor(const std::string &name) -: Interface(name) -{ - debug_log("adding interface %s", name.c_str()); - - _interfaces[name] = this; -} - -Message InterfaceAdaptor::dispatch_method(const CallMessage &msg) -{ - const char *name = msg.member(); - - MethodTable::iterator mi = _methods.find(name); - if (mi != _methods.end()) - { - return mi->second.call(msg); - } - else - { - return ErrorMessage(msg, DBUS_ERROR_UNKNOWN_METHOD, name); - } -} - -void InterfaceAdaptor::emit_signal(const SignalMessage &sig) -{ - SignalMessage &sig2 = const_cast<SignalMessage &>(sig); - - if (sig2.interface() == NULL) - sig2.interface(name().c_str()); - - _emit_signal(sig2); -} - -Variant *InterfaceAdaptor::get_property(const std::string &name) -{ - PropertyTable::iterator pti = _properties.find(name); - - if (pti != _properties.end()) - { - if (!pti->second.read) - throw ErrorAccessDenied("property is not readable"); - - return &(pti->second.value); - } - return NULL; -} - -void InterfaceAdaptor::set_property(const std::string &name, Variant &value) -{ - PropertyTable::iterator pti = _properties.find(name); - - if (pti != _properties.end()) - { - if (!pti->second.write) - throw ErrorAccessDenied("property is not writeable"); - - Signature sig = value.signature(); - - if (pti->second.sig != sig) - throw ErrorInvalidSignature("property expects a different type"); - - pti->second.value = value; - return; - } - throw ErrorFailed("requested property not found"); -} - -InterfaceProxy *ProxyBase::find_interface(const std::string &name) -{ - InterfaceProxyTable::const_iterator ii = _interfaces.find(name); - - return ii != _interfaces.end() ? ii->second : NULL; -} - -InterfaceProxy::InterfaceProxy(const std::string &name) -: Interface(name) -{ - debug_log("adding interface %s", name.c_str()); - - _interfaces[name] = this; -} - -bool InterfaceProxy::dispatch_signal(const SignalMessage &msg) -{ - const char *name = msg.member(); - - SignalTable::iterator si = _signals.find(name); - if (si != _signals.end()) - { - si->second.call(msg); - // Here we always return false because there might be - // another InterfaceProxy listening for the same signal. - // This way we instruct libdbus-1 to go on dispatching - // the signal. - return false; - } - else - { - return false; - } -} - -Message InterfaceProxy::invoke_method(const CallMessage &call) -{ - CallMessage &call2 = const_cast<CallMessage &>(call); - - if (call.interface() == NULL) - call2.interface(name().c_str()); - - return _invoke_method(call2); -} diff --git a/libs/dbus-c++/src/internalerror.h b/libs/dbus-c++/src/internalerror.h deleted file mode 100644 index 1cc1fcaec14712a63e4ea06efb5ed1dd4406c386..0000000000000000000000000000000000000000 --- a/libs/dbus-c++/src/internalerror.h +++ /dev/null @@ -1,77 +0,0 @@ -/* - * - * D-Bus++ - C++ bindings for D-Bus - * - * Copyright (C) 2005-2007 Paolo Durante <shackan@gmail.com> - * - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - - -#ifndef __DBUSXX_INTERNALERROR_H -#define __DBUSXX_INTERNALERROR_H - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include <dbus-c++/error.h> - -#include <dbus/dbus.h> - -namespace DBus { - -struct DXXAPI InternalError -{ - DBusError error; - - InternalError() - { - dbus_error_init(&error); - } - - explicit InternalError(DBusError *e) - { - dbus_error_init(&error); - dbus_move_error(e, &error); - } - - InternalError(const InternalError &ie) - { - dbus_error_init(&error); - dbus_move_error(const_cast<DBusError *>(&(ie.error)), &error); - } - - ~InternalError() - { - dbus_error_free(&error); - } - - operator DBusError *() - { - return &error; - } - - operator bool() - { - return dbus_error_is_set(&error); - } -}; - -} /* namespace DBus */ - -#endif//__DBUSXX_INTERNALERROR_H diff --git a/libs/dbus-c++/src/introspection.cpp b/libs/dbus-c++/src/introspection.cpp deleted file mode 100644 index 88b61a14b245f284685a6a626a74755cea673247..0000000000000000000000000000000000000000 --- a/libs/dbus-c++/src/introspection.cpp +++ /dev/null @@ -1,190 +0,0 @@ -/* - * - * D-Bus++ - C++ bindings for D-Bus - * - * Copyright (C) 2005-2007 Paolo Durante <shackan@gmail.com> - * - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - - -#include <dbus-c++/introspection.h> -#include <dbus-c++/object.h> -#include <dbus-c++/message.h> - -#include <dbus/dbus.h> - -#include <sstream> - -using namespace DBus; - -static const char *introspectable_name = "org.freedesktop.DBus.Introspectable"; - -IntrospectableAdaptor::IntrospectableAdaptor() -: InterfaceAdaptor(introspectable_name) -{ - register_method(IntrospectableAdaptor, Introspect, Introspect); -} - -Message IntrospectableAdaptor::Introspect(const CallMessage &call) -{ - debug_log("requested introspection data"); - - std::ostringstream xml; - - xml << DBUS_INTROSPECT_1_0_XML_DOCTYPE_DECL_NODE; - - const std::string path = object()->path(); - - xml << "<node name=\"" << path << "\">"; - - InterfaceAdaptorTable::const_iterator iti; - - for (iti = _interfaces.begin(); iti != _interfaces.end(); ++iti) - { - debug_log("introspecting interface %s", iti->first.c_str()); - - IntrospectedInterface *const intro = iti->second->introspect(); - if (intro) - { - xml << "\n\t<interface name=\"" << intro->name << "\">"; - - for (const IntrospectedProperty *p = intro->properties; p->name; ++p) - { - std::string access; - - if (p->read) access += "read"; - if (p->write) access += "write"; - - xml << "\n\t\t<property name=\"" << p->name << "\"" - << " type=\"" << p->type << "\"" - << " access=\"" << access << "\"/>"; - } - - for (const IntrospectedMethod *m = intro->methods; m->args; ++m) - { - xml << "\n\t\t<method name=\"" << m->name << "\">"; - - for (const IntrospectedArgument *a = m->args; a->type; ++a) - { - xml << "\n\t\t\t<arg direction=\"" << (a->in ? "in" : "out") << "\"" - << " type=\"" << a->type << "\""; - - if (a->name) xml << " name=\"" << a->name << "\""; - - xml << "/>"; - } - - xml << "\n\t\t</method>"; - } - - for (const IntrospectedMethod *m = intro->signals; m->args; ++m) - { - xml << "\n\t\t<signal name=\"" << m->name << "\">"; - - for (const IntrospectedArgument *a = m->args; a->type; ++a) - { - xml << "<arg type=\"" << a->type << "\""; - - if (a->name) xml << " name=\"" << a->name << "\""; - - xml << "/>"; - } - xml << "\n\t\t</signal>"; - } - - xml << "\n\t</interface>"; - } - } - - const ObjectPathList nodes = ObjectAdaptor::child_nodes_from_prefix(path + '/'); - ObjectPathList::const_iterator oni; - - for (oni = nodes.begin(); oni != nodes.end(); ++oni) - { - xml << "\n\t<node name=\"" << (*oni) << "\"/>"; - } - - /* broken - const ObjectAdaptorPList children = ObjectAdaptor::from_path_prefix(path + '/'); - - ObjectAdaptorPList::const_iterator oci; - - for (oci = children.begin(); oci != children.end(); ++oci) - { - std::string name = (*oci)->path().substr(path.length()+1); - name.substr(name.find('/')); - - xml << "<node name=\"" << name << "\"/>"; - } - */ - - xml << "\n</node>"; - - ReturnMessage reply(call); - MessageIter wi = reply.writer(); - wi.append_string(xml.str().c_str()); - return reply; -} - -IntrospectedInterface *const IntrospectableAdaptor::introspect() const -{ - static IntrospectedArgument Introspect_args[] = - { - { "data", "s", false }, - { 0, 0, 0 } - }; - static IntrospectedMethod Introspectable_methods[] = - { - { "Introspect", Introspect_args }, - { 0, 0 } - }; - static IntrospectedMethod Introspectable_signals[] = - { - { 0, 0 } - }; - static IntrospectedProperty Introspectable_properties[] = - { - { 0, 0, 0, 0 } - }; - static IntrospectedInterface Introspectable_interface = - { - introspectable_name, - Introspectable_methods, - Introspectable_signals, - Introspectable_properties - }; - return &Introspectable_interface; -} - -IntrospectableProxy::IntrospectableProxy() -: InterfaceProxy(introspectable_name) -{} - -std::string IntrospectableProxy::Introspect() -{ - DBus::CallMessage call; - - call.member("Introspect"); - - DBus::Message ret = invoke_method(call); - - DBus::MessageIter ri = ret.reader(); - const char *str = ri.get_string(); - - return str; -} diff --git a/libs/dbus-c++/src/message.cpp b/libs/dbus-c++/src/message.cpp deleted file mode 100644 index 119bff8e312b8325864ff8dfa98c1d1e0543cb43..0000000000000000000000000000000000000000 --- a/libs/dbus-c++/src/message.cpp +++ /dev/null @@ -1,639 +0,0 @@ -/* - * - * D-Bus++ - C++ bindings for D-Bus - * - * Copyright (C) 2005-2007 Paolo Durante <shackan@gmail.com> - * - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - - -#include <dbus-c++/message.h> - -#include <dbus/dbus.h> -#include <cstdlib> - -#include "internalerror.h" -#include "message_p.h" - -using namespace DBus; - -/* -*/ - -int MessageIter::type() -{ - return dbus_message_iter_get_arg_type((DBusMessageIter *)&_iter); -} - -bool MessageIter::at_end() -{ - return type() == DBUS_TYPE_INVALID; -} - -bool MessageIter::has_next() -{ - return dbus_message_iter_has_next((DBusMessageIter *)&_iter); -} - -MessageIter &MessageIter::operator ++() -{ - dbus_message_iter_next((DBusMessageIter *)&_iter); - return (*this); -} - -MessageIter MessageIter::operator ++(int) -{ - MessageIter copy(*this); - ++(*this); - return copy; -} - -bool MessageIter::append_basic(int type_id, void *value) -{ - return dbus_message_iter_append_basic((DBusMessageIter *)&_iter, type_id, value); -} - -void MessageIter::get_basic(int type_id, void *ptr) -{ - if (type() != type_id) - throw ErrorInvalidArgs("type mismatch"); - - dbus_message_iter_get_basic((DBusMessageIter *)_iter, ptr); -} - -bool MessageIter::append_byte(unsigned char b) -{ - return append_basic(DBUS_TYPE_BYTE, &b); -} - -unsigned char MessageIter::get_byte() -{ - unsigned char b; - get_basic(DBUS_TYPE_BYTE, &b); - return b; -} - -bool MessageIter::append_bool(bool b) -{ - dbus_bool_t db = b; - return append_basic(DBUS_TYPE_BOOLEAN, &db); -} - -bool MessageIter::get_bool() -{ - dbus_bool_t db; - get_basic(DBUS_TYPE_BOOLEAN, &db); - return (bool)db; -} - -bool MessageIter::append_int16(signed short i) -{ - return append_basic(DBUS_TYPE_INT16, &i); -} - -signed short MessageIter::get_int16() -{ - signed short i; - get_basic(DBUS_TYPE_INT16, &i); - return i; -} - -bool MessageIter::append_uint16(unsigned short u) -{ - return append_basic(DBUS_TYPE_UINT16, &u); -} - -unsigned short MessageIter::get_uint16() -{ - unsigned short u; - get_basic(DBUS_TYPE_UINT16, &u); - return u; -} - -bool MessageIter::append_int32(signed int i) -{ - return append_basic(DBUS_TYPE_INT32, &i); -} - -signed int MessageIter::get_int32() -{ - signed int i; - get_basic(DBUS_TYPE_INT32, &i); - return i; -} - -bool MessageIter::append_uint32(unsigned int u) -{ - return append_basic(DBUS_TYPE_UINT32, &u); -} - -unsigned int MessageIter::get_uint32() -{ - unsigned int u; - get_basic(DBUS_TYPE_UINT32, &u); - return u; -} - -signed long long MessageIter::get_int64() -{ - signed long long i; - get_basic(DBUS_TYPE_INT64, &i); - return i; -} - -bool MessageIter::append_int64(signed long long i) -{ - return append_basic(DBUS_TYPE_INT64, &i); -} - -unsigned long long MessageIter::get_uint64() -{ - unsigned long long u; - get_basic(DBUS_TYPE_UINT64, &u); - return u; -} - -bool MessageIter::append_uint64(unsigned long long u) -{ - return append_basic(DBUS_TYPE_UINT64, &u); -} - -double MessageIter::get_double() -{ - double d; - get_basic(DBUS_TYPE_DOUBLE, &d); - return d; -} - -bool MessageIter::append_double(double d) -{ - return append_basic(DBUS_TYPE_DOUBLE, &d); -} - -bool MessageIter::append_string(const char *chars) -{ - return append_basic(DBUS_TYPE_STRING, &chars); -} - -const char *MessageIter::get_string() -{ - char *chars; - get_basic(DBUS_TYPE_STRING, &chars); - return chars; -} - -bool MessageIter::append_path(const char *chars) -{ - return append_basic(DBUS_TYPE_OBJECT_PATH, &chars); -} - -const char *MessageIter::get_path() -{ - char *chars; - get_basic(DBUS_TYPE_OBJECT_PATH, &chars); - return chars; -} - -bool MessageIter::append_signature(const char *chars) -{ - return append_basic(DBUS_TYPE_SIGNATURE, &chars); -} - -const char *MessageIter::get_signature() -{ - char *chars; - get_basic(DBUS_TYPE_SIGNATURE, &chars); - return chars; -} - -MessageIter MessageIter::recurse() -{ - MessageIter iter(msg()); - dbus_message_iter_recurse((DBusMessageIter *)&_iter, (DBusMessageIter *)&(iter._iter)); - return iter; -} - -char *MessageIter::signature() const -{ - return dbus_message_iter_get_signature((DBusMessageIter *)&_iter); -} - -bool MessageIter::append_array(char type, const void *ptr, size_t length) -{ - return dbus_message_iter_append_fixed_array((DBusMessageIter *)&_iter, type, &ptr, length); -} - -int MessageIter::array_type() -{ - return dbus_message_iter_get_element_type((DBusMessageIter *)&_iter); -} - -int MessageIter::get_array(void *ptr) -{ - int length; - dbus_message_iter_get_fixed_array((DBusMessageIter *)&_iter, ptr, &length); - return length; -} - -bool MessageIter::is_array() -{ - return dbus_message_iter_get_arg_type((DBusMessageIter *)&_iter) == DBUS_TYPE_ARRAY; -} - -bool MessageIter::is_dict() -{ - return is_array() && dbus_message_iter_get_element_type((DBusMessageIter *)_iter) == DBUS_TYPE_DICT_ENTRY; -} - -MessageIter MessageIter::new_array(const char *sig) -{ - MessageIter arr(msg()); - dbus_message_iter_open_container( - (DBusMessageIter *)&_iter, DBUS_TYPE_ARRAY, sig, (DBusMessageIter *)&(arr._iter) - ); - return arr; -} - -MessageIter MessageIter::new_variant(const char *sig) -{ - MessageIter var(msg()); - dbus_message_iter_open_container( - (DBusMessageIter *)_iter, DBUS_TYPE_VARIANT, sig, (DBusMessageIter *)&(var._iter) - ); - return var; -} - -MessageIter MessageIter::new_struct() -{ - MessageIter stu(msg()); - dbus_message_iter_open_container( - (DBusMessageIter *)_iter, DBUS_TYPE_STRUCT, NULL, (DBusMessageIter *)&(stu._iter) - ); - return stu; -} - -MessageIter MessageIter::new_dict_entry() -{ - MessageIter ent(msg()); - dbus_message_iter_open_container( - (DBusMessageIter *)_iter, DBUS_TYPE_DICT_ENTRY, NULL, (DBusMessageIter *)&(ent._iter) - ); - return ent; -} - -void MessageIter::close_container(MessageIter &container) -{ - dbus_message_iter_close_container((DBusMessageIter *)&_iter, (DBusMessageIter *)&(container._iter)); -} - -static bool is_basic_type(int typecode) -{ - switch (typecode) - { - case 'y': - case 'b': - case 'n': - case 'q': - case 'i': - case 'u': - case 'x': - case 't': - case 'd': - case 's': - case 'o': - case 'g': - return true; - default: - return false; - } -} - -void MessageIter::copy_data(MessageIter &to) -{ - for (MessageIter &from = *this; !from.at_end(); ++from) - { - if (is_basic_type(from.type())) - { - debug_log("copying basic type: %c", from.type()); - - unsigned char value[8]; - from.get_basic(from.type(), &value); - to.append_basic(from.type(), &value); - } - else - { - MessageIter from_container = from.recurse(); - char *sig = from_container.signature(); - - debug_log("copying compound type: %c[%s]", from.type(), sig); - - MessageIter to_container (to.msg()); - dbus_message_iter_open_container - ( - (DBusMessageIter *)&(to._iter), - from.type(), - from.type() == DBUS_TYPE_VARIANT ? NULL : sig, - (DBusMessageIter *)&(to_container._iter) - ); - - from_container.copy_data(to_container); - to.close_container(to_container); - free(sig); - } - } -} - -/* -*/ - -Message::Message() -: _pvt(new Private) -{ -} - -Message::Message(Message::Private *p, bool incref) -: _pvt(p) -{ - if (_pvt->msg && incref) dbus_message_ref(_pvt->msg); -} - -Message::Message(const Message &m) -: _pvt(m._pvt) -{ - dbus_message_ref(_pvt->msg); -} - -Message::~Message() -{ - dbus_message_unref(_pvt->msg); -} - -Message &Message::operator = (const Message &m) -{ - if (&m != this) - { - dbus_message_unref(_pvt->msg); - _pvt = m._pvt; - dbus_message_ref(_pvt->msg); - } - return *this; -} - -Message Message::copy() -{ - Private *pvt = new Private(dbus_message_copy(_pvt->msg)); - return Message(pvt); -} - -bool Message::append(int first_type, ...) -{ - va_list vl; - va_start(vl, first_type); - - bool b = dbus_message_append_args_valist(_pvt->msg, first_type, vl); - - va_end(vl); - return b; -} - -void Message::terminate() -{ - dbus_message_append_args(_pvt->msg, DBUS_TYPE_INVALID); -} - -int Message::type() const -{ - return dbus_message_get_type(_pvt->msg); -} - -int Message::serial() const -{ - return dbus_message_get_serial(_pvt->msg); -} - -int Message::reply_serial() const -{ - return dbus_message_get_reply_serial(_pvt->msg); -} - -bool Message::reply_serial(int s) -{ - return dbus_message_set_reply_serial(_pvt->msg, s); -} - -const char *Message::sender() const -{ - return dbus_message_get_sender(_pvt->msg); -} - -bool Message::sender(const char *s) -{ - return dbus_message_set_sender(_pvt->msg, s); -} - -const char *Message::destination() const -{ - return dbus_message_get_destination(_pvt->msg); -} - -bool Message::destination(const char *s) -{ - return dbus_message_set_destination(_pvt->msg, s); -} - -bool Message::is_error() const -{ - return type() == DBUS_MESSAGE_TYPE_ERROR; -} - -bool Message::is_signal(const char *interface, const char *member) const -{ - return dbus_message_is_signal(_pvt->msg, interface, member); -} - -MessageIter Message::writer() -{ - MessageIter iter(*this); - dbus_message_iter_init_append(_pvt->msg, (DBusMessageIter *)&(iter._iter)); - return iter; -} - -MessageIter Message::reader() const -{ - MessageIter iter(const_cast<Message &>(*this)); - dbus_message_iter_init(_pvt->msg, (DBusMessageIter *)&(iter._iter)); - return iter; -} - -/* -*/ - -ErrorMessage::ErrorMessage() -{ - _pvt->msg = dbus_message_new(DBUS_MESSAGE_TYPE_ERROR); -} - -ErrorMessage::ErrorMessage(const Message &to_reply, const char *name, const char *message) -{ - _pvt->msg = dbus_message_new_error(to_reply._pvt->msg, name, message); -} - -bool ErrorMessage::operator == (const ErrorMessage &m) const -{ - return dbus_message_is_error(_pvt->msg, m.name()); -} - -const char *ErrorMessage::name() const -{ - return dbus_message_get_error_name(_pvt->msg); -} - -bool ErrorMessage::name(const char *n) -{ - return dbus_message_set_error_name(_pvt->msg, n); -} - -/* -*/ - -SignalMessage::SignalMessage(const char *name) -{ - _pvt->msg = dbus_message_new(DBUS_MESSAGE_TYPE_SIGNAL); - member(name); -} - -SignalMessage::SignalMessage(const char *path, const char *interface, const char *name) -{ - _pvt->msg = dbus_message_new_signal(path, interface, name); -} - -bool SignalMessage::operator == (const SignalMessage &m) const -{ - return dbus_message_is_signal(_pvt->msg, m.interface(), m.member()); -} - -const char *SignalMessage::interface() const -{ - return dbus_message_get_interface(_pvt->msg); -} - -bool SignalMessage::interface(const char *i) -{ - return dbus_message_set_interface(_pvt->msg, i); -} - -const char *SignalMessage::member() const -{ - return dbus_message_get_member(_pvt->msg); -} - -bool SignalMessage::member(const char *m) -{ - return dbus_message_set_member(_pvt->msg, m); -} - -const char *SignalMessage::path() const -{ - return dbus_message_get_path(_pvt->msg); -} - -char ** SignalMessage::path_split() const -{ - char ** p; - dbus_message_get_path_decomposed(_pvt->msg, &p); //todo: return as a std::vector ? - return p; -} - -bool SignalMessage::path(const char *p) -{ - return dbus_message_set_path(_pvt->msg, p); -} - -/* -*/ - -CallMessage::CallMessage() -{ - _pvt->msg = dbus_message_new(DBUS_MESSAGE_TYPE_METHOD_CALL); -} - -CallMessage::CallMessage(const char *dest, const char *path, const char *iface, const char *method) -{ - _pvt->msg = dbus_message_new_method_call(dest, path, iface, method); -} - -bool CallMessage::operator == (const CallMessage &m) const -{ - return dbus_message_is_method_call(_pvt->msg, m.interface(), m.member()); -} - -const char *CallMessage::interface() const -{ - return dbus_message_get_interface(_pvt->msg); -} - -bool CallMessage::interface(const char *i) -{ - return dbus_message_set_interface(_pvt->msg, i); -} - -const char *CallMessage::member() const -{ - return dbus_message_get_member(_pvt->msg); -} - -bool CallMessage::member(const char *m) -{ - return dbus_message_set_member(_pvt->msg, m); -} - -const char *CallMessage::path() const -{ - return dbus_message_get_path(_pvt->msg); -} - -char ** CallMessage::path_split() const -{ - char ** p; - dbus_message_get_path_decomposed(_pvt->msg, &p); - return p; -} - -bool CallMessage::path(const char *p) -{ - return dbus_message_set_path(_pvt->msg, p); -} - -const char *CallMessage::signature() const -{ - return dbus_message_get_signature(_pvt->msg); -} - -/* -*/ - -ReturnMessage::ReturnMessage(const CallMessage &callee) -{ - _pvt = new Private(dbus_message_new_method_return(callee._pvt->msg)); -} - -const char *ReturnMessage::signature() const -{ - return dbus_message_get_signature(_pvt->msg); -} - diff --git a/libs/dbus-c++/src/message_p.h b/libs/dbus-c++/src/message_p.h deleted file mode 100644 index af421bc10ed81493f4b814d0a996737891ec602c..0000000000000000000000000000000000000000 --- a/libs/dbus-c++/src/message_p.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - * - * D-Bus++ - C++ bindings for D-Bus - * - * Copyright (C) 2005-2007 Paolo Durante <shackan@gmail.com> - * - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - - -#ifndef __DBUSXX_MESSAGE_P_H -#define __DBUSXX_MESSAGE_P_H - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include <dbus-c++/message.h> -#include <dbus-c++/refptr_impl.h> - -#include <dbus/dbus.h> - -namespace DBus { - -struct DXXAPILOCAL Message::Private -{ - DBusMessage *msg; - - Private() : msg(0) - {} - - Private(DBusMessage *m) : msg(m) - {} -}; - -} /* namespace DBus */ - -#endif//__DBUSXX_MESSAGE_P_H diff --git a/libs/dbus-c++/src/object.cpp b/libs/dbus-c++/src/object.cpp deleted file mode 100644 index 970fcf7b28269fccb6498463bb0ee1865eb6566a..0000000000000000000000000000000000000000 --- a/libs/dbus-c++/src/object.cpp +++ /dev/null @@ -1,363 +0,0 @@ -/* - * - * D-Bus++ - C++ bindings for D-Bus - * - * Copyright (C) 2005-2007 Paolo Durante <shackan@gmail.com> - * - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - - -#include <dbus-c++/debug.h> -#include <dbus-c++/object.h> -#include "internalerror.h" - -#include <cstring> -#include <map> -#include <dbus/dbus.h> - -#include "message_p.h" -#include "server_p.h" -#include "connection_p.h" - -using namespace DBus; - -Object::Object(Connection &conn, const Path &path, const char *service) -: _conn(conn), _path(path), _service(service ? service : "") -{ -} - -Object::~Object() -{ -} - -struct ObjectAdaptor::Private -{ - static void unregister_function_stub(DBusConnection *, void *); - static DBusHandlerResult message_function_stub(DBusConnection *, DBusMessage *, void *); -}; - -static DBusObjectPathVTable _vtable = -{ - ObjectAdaptor::Private::unregister_function_stub, - ObjectAdaptor::Private::message_function_stub, - NULL, NULL, NULL, NULL -}; - -void ObjectAdaptor::Private::unregister_function_stub(DBusConnection *conn, void *data) -{ - //TODO: what do we have to do here ? -} - -DBusHandlerResult ObjectAdaptor::Private::message_function_stub(DBusConnection *, DBusMessage *dmsg, void *data) -{ - ObjectAdaptor *o = static_cast<ObjectAdaptor *>(data); - - if (o) - { - Message msg(new Message::Private(dmsg)); - - debug_log("in object %s", o->path().c_str()); - debug_log(" got message #%d from %s to %s", - msg.serial(), - msg.sender(), - msg.destination() - ); - - return o->handle_message(msg) - ? DBUS_HANDLER_RESULT_HANDLED - : DBUS_HANDLER_RESULT_NOT_YET_HANDLED; - } - else - { - return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; - } -} - -typedef std::map<Path, ObjectAdaptor *> ObjectAdaptorTable; -static ObjectAdaptorTable _adaptor_table; - -ObjectAdaptor *ObjectAdaptor::from_path(const Path &path) -{ - ObjectAdaptorTable::iterator ati = _adaptor_table.find(path); - - if (ati != _adaptor_table.end()) - return ati->second; - - return NULL; -} - -ObjectAdaptorPList ObjectAdaptor::from_path_prefix(const std::string &prefix) -{ - ObjectAdaptorPList ali; - - ObjectAdaptorTable::iterator ati = _adaptor_table.begin(); - - size_t plen = prefix.length(); - - while (ati != _adaptor_table.end()) - { - if (!strncmp(ati->second->path().c_str(), prefix.c_str(), plen)) - ali.push_back(ati->second); - - ++ati; - } - - return ali; -} - -ObjectPathList ObjectAdaptor::child_nodes_from_prefix(const std::string &prefix) -{ - ObjectPathList ali; - - ObjectAdaptorTable::iterator ati = _adaptor_table.begin(); - - size_t plen = prefix.length(); - - while (ati != _adaptor_table.end()) - { - if (!strncmp(ati->second->path().c_str(), prefix.c_str(), plen)) - { - std::string p = ati->second->path().substr(plen); - p = p.substr(0,p.find('/')); - ali.push_back(p); - } - ++ati; - } - - ali.sort(); - ali.unique(); - - return ali; -} - -ObjectAdaptor::ObjectAdaptor(Connection &conn, const Path &path) -: Object(conn, path, conn.unique_name()) -{ - register_obj(); -} - -ObjectAdaptor::~ObjectAdaptor() -{ - unregister_obj(); -} - -void ObjectAdaptor::register_obj() -{ - debug_log("registering local object %s", path().c_str()); - - if (!dbus_connection_register_object_path(conn()._pvt->conn, path().c_str(), &_vtable, this)) - { - throw ErrorNoMemory("unable to register object path"); - } - - _adaptor_table[path()] = this; -} - -void ObjectAdaptor::unregister_obj() -{ - _adaptor_table.erase(path()); - - debug_log("unregistering local object %s", path().c_str()); - - dbus_connection_unregister_object_path(conn()._pvt->conn, path().c_str()); -} - -void ObjectAdaptor::_emit_signal(SignalMessage &sig) -{ - sig.path(path().c_str()); - - conn().send(sig); -} - -struct ReturnLaterError -{ - const Tag *tag; -}; - -bool ObjectAdaptor::handle_message(const Message &msg) -{ - switch (msg.type()) - { - case DBUS_MESSAGE_TYPE_METHOD_CALL: - { - const CallMessage &cmsg = reinterpret_cast<const CallMessage &>(msg); - const char *member = cmsg.member(); - const char *interface = cmsg.interface(); - - debug_log(" invoking method %s.%s", interface, member); - - InterfaceAdaptor *ii = find_interface(interface); - if (ii) - { - try - { - Message ret = ii->dispatch_method(cmsg); - conn().send(ret); - } - catch(Error &e) - { - ErrorMessage em(cmsg, e.name(), e.message()); - conn().send(em); - } - catch(ReturnLaterError &rle) - { - _continuations[rle.tag] = new Continuation(conn(), cmsg, rle.tag); - } - return true; - } - else - { - return false; - } - } - default: - { - return false; - } - } -} - -void ObjectAdaptor::return_later(const Tag *tag) -{ - ReturnLaterError rle = { tag }; - throw rle; -} - -void ObjectAdaptor::return_now(Continuation *ret) -{ - ret->_conn.send(ret->_return); - - ContinuationMap::iterator di = _continuations.find(ret->_tag); - - delete di->second; - - _continuations.erase(di); -} - -void ObjectAdaptor::return_error(Continuation *ret, const Error error) -{ - ret->_conn.send(ErrorMessage(ret->_call, error.name(), error.message())); - - ContinuationMap::iterator di = _continuations.find(ret->_tag); - - delete di->second; - - _continuations.erase(di); -} - -ObjectAdaptor::Continuation *ObjectAdaptor::find_continuation(const Tag *tag) -{ - ContinuationMap::iterator di = _continuations.find(tag); - - return di != _continuations.end() ? di->second : NULL; -} - -ObjectAdaptor::Continuation::Continuation(Connection &conn, const CallMessage &call, const Tag *tag) -: _conn(conn), _call(call), _return(_call), _tag(tag) -{ - _writer = _return.writer(); //todo: verify -} - -/* -*/ - -ObjectProxy::ObjectProxy(Connection &conn, const Path &path, const char *service) -: Object(conn, path, service) -{ - register_obj(); -} - -ObjectProxy::~ObjectProxy() -{ - unregister_obj(); -} - -void ObjectProxy::register_obj() -{ - debug_log("registering remote object %s", path().c_str()); - - _filtered = new Callback<ObjectProxy, bool, const Message &>(this, &ObjectProxy::handle_message); - - conn().add_filter(_filtered); - - InterfaceProxyTable::const_iterator ii = _interfaces.begin(); - while (ii != _interfaces.end()) - { - std::string im = "type='signal',interface='"+ii->first+"',path='"+path()+"'"; - conn().add_match(im.c_str()); - ++ii; - } -} - -void ObjectProxy::unregister_obj() -{ - debug_log("unregistering remote object %s", path().c_str()); - - InterfaceProxyTable::const_iterator ii = _interfaces.begin(); - while (ii != _interfaces.end()) - { - std::string im = "type='signal',interface='"+ii->first+"',path='"+path()+"'"; - conn().remove_match(im.c_str()); - ++ii; - } - conn().remove_filter(_filtered); -} - -Message ObjectProxy::_invoke_method(CallMessage &call) -{ - if (call.path() == NULL) - call.path(path().c_str()); - - if (call.destination() == NULL) - call.destination(service().c_str()); - - return conn().send_blocking(call); -} - -bool ObjectProxy::handle_message(const Message &msg) -{ - switch (msg.type()) - { - case DBUS_MESSAGE_TYPE_SIGNAL: - { - const SignalMessage &smsg = reinterpret_cast<const SignalMessage &>(msg); - const char *interface = smsg.interface(); - const char *member = smsg.member(); - const char *objpath = smsg.path(); - - if (objpath != path()) return false; - - debug_log("filtered signal %s(in %s) from %s to object %s", - member, interface, msg.sender(), objpath); - - InterfaceProxy *ii = find_interface(interface); - if (ii) - { - return ii->dispatch_signal(smsg); - } - else - { - return false; - } - } - default: - { - return false; - } - } -} diff --git a/libs/dbus-c++/src/pendingcall.cpp b/libs/dbus-c++/src/pendingcall.cpp deleted file mode 100644 index e55c174be575db3d632135e1209471b3c1d95a73..0000000000000000000000000000000000000000 --- a/libs/dbus-c++/src/pendingcall.cpp +++ /dev/null @@ -1,139 +0,0 @@ -/* - * - * D-Bus++ - C++ bindings for D-Bus - * - * Copyright (C) 2005-2007 Paolo Durante <shackan@gmail.com> - * - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - - -#include <dbus-c++/pendingcall.h> - -#include <dbus/dbus.h> - -#include "internalerror.h" -#include "pendingcall_p.h" -#include "message_p.h" - -using namespace DBus; - -PendingCall::Private::Private(DBusPendingCall *dpc) -: call(dpc), dataslot(-1) -{ - if (!dbus_pending_call_allocate_data_slot(&dataslot)) - { - throw ErrorNoMemory("Unable to allocate data slot"); - } -} - -PendingCall::Private::~Private() -{ - if (dataslot != -1) - { - dbus_pending_call_allocate_data_slot(&dataslot); - } -} - -void PendingCall::Private::notify_stub(DBusPendingCall *dpc, void *data) -{ - PendingCall::Private *pvt = static_cast<PendingCall::Private *>(data); - - PendingCall pc(pvt); - pvt->slot(pc); -} - -PendingCall::PendingCall(PendingCall::Private *p) -: _pvt(p) -{ - if (!dbus_pending_call_set_notify(_pvt->call, Private::notify_stub, p, NULL)) - { - throw ErrorNoMemory("Unable to initialize pending call"); - } -} - -PendingCall::PendingCall(const PendingCall &c) -: _pvt(c._pvt) -{ - dbus_pending_call_ref(_pvt->call); -} - -PendingCall::~PendingCall() -{ - dbus_pending_call_unref(_pvt->call); -} - -PendingCall &PendingCall::operator = (const PendingCall &c) -{ - if (&c != this) - { - dbus_pending_call_unref(_pvt->call); - _pvt = c._pvt; - dbus_pending_call_ref(_pvt->call); - } - return *this; -} - -bool PendingCall::completed() -{ - return dbus_pending_call_get_completed(_pvt->call); -} - -void PendingCall::cancel() -{ - dbus_pending_call_cancel(_pvt->call); -} - -void PendingCall::block() -{ - dbus_pending_call_block(_pvt->call); -} - -void PendingCall::data(void *p) -{ - if (!dbus_pending_call_set_data(_pvt->call, _pvt->dataslot, p, NULL)) - { - throw ErrorNoMemory("Unable to initialize data slot"); - } -} - -void *PendingCall::data() -{ - return dbus_pending_call_get_data(_pvt->call, _pvt->dataslot); -} - -Slot<void, PendingCall &>& PendingCall::slot() -{ - return _pvt->slot; -} - -Message PendingCall::steal_reply() -{ - DBusMessage *dmsg = dbus_pending_call_steal_reply(_pvt->call); - if (!dmsg) - { - dbus_bool_t callComplete = dbus_pending_call_get_completed(_pvt->call); - - if (callComplete) - throw ErrorNoReply("No reply available"); - else - throw ErrorNoReply("Call not complete"); - } - - return Message(new Message::Private(dmsg)); -} - diff --git a/libs/dbus-c++/src/pendingcall_p.h b/libs/dbus-c++/src/pendingcall_p.h deleted file mode 100644 index 1768b52da544ecd101c848af7b3f5becbc4872bf..0000000000000000000000000000000000000000 --- a/libs/dbus-c++/src/pendingcall_p.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - * - * D-Bus++ - C++ bindings for D-Bus - * - * Copyright (C) 2005-2007 Paolo Durante <shackan@gmail.com> - * - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - - -#ifndef __DBUSXX_PENDING_CALL_P_H -#define __DBUSXX_PENDING_CALL_P_H - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include <dbus-c++/pendingcall.h> -#include <dbus-c++/refptr_impl.h> - -#include <dbus/dbus.h> - -namespace DBus { - -struct DXXAPILOCAL PendingCall::Private -{ - DBusPendingCall *call; - int dataslot; - Slot<void, PendingCall &> slot; - - Private(DBusPendingCall *); - - ~Private(); - - static void notify_stub(DBusPendingCall *dpc, void *data); -}; - -} /* namespace DBus */ - -#endif//__DBUSXX_PENDING_CALL_P_H diff --git a/libs/dbus-c++/src/property.cpp b/libs/dbus-c++/src/property.cpp deleted file mode 100644 index 1bf6c6b1f0132e2985b89bccfb3629e35cd5a669..0000000000000000000000000000000000000000 --- a/libs/dbus-c++/src/property.cpp +++ /dev/null @@ -1,151 +0,0 @@ -/* - * - * D-Bus++ - C++ bindings for D-Bus - * - * Copyright (C) 2005-2007 Paolo Durante <shackan@gmail.com> - * - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - -#include <dbus-c++/debug.h> -#include <dbus-c++/property.h> - -#include <dbus-c++/introspection.h> - -using namespace DBus; - -static const char *properties_name = "org.freedesktop.DBus.Properties"; - -PropertiesAdaptor::PropertiesAdaptor() -: InterfaceAdaptor(properties_name) -{ - register_method(PropertiesAdaptor, Get, Get); - register_method(PropertiesAdaptor, Set, Set); -} - -Message PropertiesAdaptor::Get(const CallMessage &call) -{ - MessageIter ri = call.reader(); - - std::string iface_name; - std::string property_name; - - ri >> iface_name >> property_name; - - debug_log("requesting property %s on interface %s", property_name.c_str(), iface_name.c_str()); - - InterfaceAdaptor *interface = (InterfaceAdaptor *) find_interface(iface_name); - - if (!interface) - throw ErrorFailed("requested interface not found"); - - Variant *value = interface->get_property(property_name); - - if (!value) - throw ErrorFailed("requested property not found"); - - on_get_property(*interface, property_name, *value); - - ReturnMessage reply(call); - - MessageIter wi = reply.writer(); - - wi << *value; - return reply; -} - -Message PropertiesAdaptor::Set(const CallMessage &call) -{ - MessageIter ri = call.reader(); - - std::string iface_name; - std::string property_name; - Variant value; - - ri >> iface_name >> property_name >> value; - - InterfaceAdaptor *interface = (InterfaceAdaptor *) find_interface(iface_name); - - if (!interface) - throw ErrorFailed("requested interface not found"); - - on_set_property(*interface, property_name, value); - - interface->set_property(property_name, value); - - ReturnMessage reply(call); - - return reply; -} - -IntrospectedInterface *const PropertiesAdaptor::introspect() const -{ - static IntrospectedArgument Get_args[] = - { - { "interface_name", "s", true }, - { "property_name", "s", true }, - { "value", "v", false }, - { 0, 0, 0 } - }; - static IntrospectedArgument Set_args[] = - { - { "interface_name", "s", true }, - { "property_name", "s", true }, - { "value", "v", true }, - { 0, 0, 0 } - }; - static IntrospectedMethod Properties_methods[] = - { - { "Get", Get_args }, - { "Set", Set_args }, - { 0, 0 } - }; - static IntrospectedMethod Properties_signals[] = - { - { 0, 0 } - }; - static IntrospectedProperty Properties_properties[] = - { - { 0, 0, 0, 0 } - }; - static IntrospectedInterface Properties_interface = - { - properties_name, - Properties_methods, - Properties_signals, - Properties_properties - }; - return &Properties_interface; -} - -PropertiesProxy::PropertiesProxy() -: InterfaceProxy(properties_name) -{ -} - -Variant PropertiesProxy::Get(const std::string &iface, const std::string &property) -{ -//todo - Variant v; - return v; -} - -void PropertiesProxy::Set(const std::string &iface, const std::string &property, const Variant &value) -{ -//todo -} - diff --git a/libs/dbus-c++/src/server.cpp b/libs/dbus-c++/src/server.cpp deleted file mode 100644 index eae46d664c7f3be0d6416f15fa5d04a48b4de2bd..0000000000000000000000000000000000000000 --- a/libs/dbus-c++/src/server.cpp +++ /dev/null @@ -1,126 +0,0 @@ -/* - * - * D-Bus++ - C++ bindings for D-Bus - * - * Copyright (C) 2005-2007 Paolo Durante <shackan@gmail.com> - * - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - - -#include <dbus-c++/debug.h> -#include <dbus-c++/server.h> - -#include "internalerror.h" -#include "server_p.h" -#include "connection_p.h" -#include "dispatcher_p.h" - -using namespace DBus; - -Server::Private::Private(DBusServer *s) -: server(s) -{ -} - -Server::Private::~Private() -{ -} - -void Server::Private::on_new_conn_cb(DBusServer *server, DBusConnection *conn, void *data) -{ - Server *s = static_cast<Server *>(data); - - Connection nc (new Connection::Private(conn, s->_pvt.get())); - - s->_pvt->connections.push_back(nc); - - s->on_new_connection(nc); - - debug_log("incoming connection 0x%08x", conn); -} - -Server::Server(const char *address) -{ - InternalError e; - DBusServer *server = dbus_server_listen(address, e); - - if (e) throw Error(e); - - debug_log("server 0x%08x listening on %s", server, address); - - _pvt = new Private(server); - - dbus_server_set_new_connection_function(_pvt->server, Private::on_new_conn_cb, this, NULL); - - setup(default_dispatcher); -} -/* -Server::Server(const Server &s) -: _pvt(s._pvt) -{ - dbus_server_ref(_pvt->server); -} -*/ -Server::~Server() -{ - dbus_server_unref(_pvt->server); -} - -Dispatcher *Server::setup(Dispatcher *dispatcher) -{ - debug_log("registering stubs for server %p", _pvt->server); - - Dispatcher *prev = _pvt->dispatcher; - - dbus_server_set_watch_functions( - _pvt->server, - Dispatcher::Private::on_add_watch, - Dispatcher::Private::on_rem_watch, - Dispatcher::Private::on_toggle_watch, - dispatcher, - 0 - ); - - dbus_server_set_timeout_functions( - _pvt->server, - Dispatcher::Private::on_add_timeout, - Dispatcher::Private::on_rem_timeout, - Dispatcher::Private::on_toggle_timeout, - dispatcher, - 0 - ); - - _pvt->dispatcher = dispatcher; - - return prev; -} - -bool Server::operator == (const Server &s) const -{ - return _pvt->server == s._pvt->server; -} - -bool Server::listening() const -{ - return dbus_server_get_is_connected(_pvt->server); -} -void Server::disconnect() -{ - dbus_server_disconnect(_pvt->server); -} - diff --git a/libs/dbus-c++/src/server_p.h b/libs/dbus-c++/src/server_p.h deleted file mode 100644 index 6264ebf4d5db282e6d43ad4877b1557e78ed1c4b..0000000000000000000000000000000000000000 --- a/libs/dbus-c++/src/server_p.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - * - * D-Bus++ - C++ bindings for D-Bus - * - * Copyright (C) 2005-2007 Paolo Durante <shackan@gmail.com> - * - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - - -#ifndef __DBUSXX_SERVER_P_H -#define __DBUSXX_SERVER_P_H - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include <dbus-c++/server.h> -#include <dbus-c++/dispatcher.h> -#include <dbus-c++/refptr_impl.h> - -#include <dbus/dbus.h> - -namespace DBus { - -struct DXXAPILOCAL Server::Private -{ - DBusServer *server; - - Dispatcher *dispatcher; - - ConnectionList connections; - - Private(DBusServer *); - - ~Private(); - - static void on_new_conn_cb(DBusServer *server, DBusConnection *conn, void *data); -}; - -} /* namespace DBus */ - -#endif//__DBUSXX_SERVER_P_H diff --git a/libs/dbus-c++/src/types.cpp b/libs/dbus-c++/src/types.cpp deleted file mode 100644 index a144f789dbb7d29b323ad03299725a45eb45f5f9..0000000000000000000000000000000000000000 --- a/libs/dbus-c++/src/types.cpp +++ /dev/null @@ -1,103 +0,0 @@ -/* - * - * D-Bus++ - C++ bindings for D-Bus - * - * Copyright (C) 2005-2007 Paolo Durante <shackan@gmail.com> - * - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - - -#include <dbus-c++/types.h> -#include <dbus-c++/object.h> -#include <dbus/dbus.h> -#include <cstdlib> -#include <stdarg.h> - -#include "message_p.h" -#include "internalerror.h" - -using namespace DBus; - -Variant::Variant() -: _msg(CallMessage()) // dummy message used as temporary storage for variant data -{ -} - -Variant::Variant(MessageIter &it) -: _msg(CallMessage()) -{ - MessageIter vi = it.recurse(); - MessageIter mi = _msg.writer(); - vi.copy_data(mi); -} - -Variant &Variant::operator = (const Variant &v) -{ - if (&v != this) - { - _msg = v._msg; - } - return *this; -} - -void Variant::clear() -{ - CallMessage empty; - _msg = empty; -} - -const Signature Variant::signature() const -{ - char *sigbuf = reader().signature(); - - Signature signature = sigbuf; - - free(sigbuf); - - return signature; -} - -MessageIter &operator << (MessageIter &iter, const Variant &val) -{ - const Signature sig = val.signature(); - - MessageIter rit = val.reader(); - MessageIter wit = iter.new_variant(sig.c_str()); - - rit.copy_data(wit); - - iter.close_container(wit); - - return iter; -} - -MessageIter &operator >> (MessageIter &iter, Variant &val) -{ - if (iter.type() != DBUS_TYPE_VARIANT) - throw ErrorInvalidArgs("variant type expected"); - - val.clear(); - - MessageIter vit = iter.recurse(); - MessageIter mit = val.writer(); - - vit.copy_data(mit); - - return ++iter; -} - diff --git a/libs/dbus-c++/tools/Makefile.am b/libs/dbus-c++/tools/Makefile.am deleted file mode 100644 index 8ee021cf20fab1fe9432016d0a05df97be527f9e..0000000000000000000000000000000000000000 --- a/libs/dbus-c++/tools/Makefile.am +++ /dev/null @@ -1,26 +0,0 @@ -# hacky, but ... - -CXX = $(CXX_FOR_BUILD) - -AM_CPPFLAGS = \ - $(dbus_CFLAGS) \ - $(xml_CFLAGS) \ - -I$(top_srcdir)/include \ - -I$(top_builddir)/include - -if CROSS_COMPILING -libdbus_cxx_la = $(BUILD_LIBDBUS_CXX_DIR)/src/libdbus-c++-1.la -else -libdbus_cxx_la = $(top_builddir)/src/libdbus-c++-1.la -endif - -bin_PROGRAMS = dbusxx-xml2cpp dbusxx-introspect - -dbusxx_xml2cpp_SOURCES = xml.h xml.cpp xml2cpp.h xml2cpp.cpp -dbusxx_xml2cpp_LDADD = $(libdbus_cxx_la) $(xml_LIBS) - -dbusxx_introspect_SOURCES = introspect.h introspect.cpp -dbusxx_introspect_LDADD = $(libdbus_cxx_la) - -MAINTAINERCLEANFILES = \ - Makefile.in diff --git a/libs/dbus-c++/tools/introspect.cpp b/libs/dbus-c++/tools/introspect.cpp deleted file mode 100644 index 8ce9f3a74c6c6faa4183164df49983789df8e0c1..0000000000000000000000000000000000000000 --- a/libs/dbus-c++/tools/introspect.cpp +++ /dev/null @@ -1,79 +0,0 @@ -/* - * - * D-Bus++ - C++ bindings for D-Bus - * - * Copyright (C) 2005-2007 Paolo Durante <shackan@gmail.com> - * - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - -#include <cstring> -#include <signal.h> -#include <unistd.h> -#include <iostream> -#include "introspect.h" - -DBus::BusDispatcher dispatcher; -static bool systembus; -static char *path; -static char *service; - -void niam(int sig) -{ - DBus::Connection conn = systembus ? DBus::Connection::SystemBus() : DBus::Connection::SessionBus(); - - IntrospectedObject io(conn, path, service); - - std::cout << io.Introspect(); - - dispatcher.leave(); -} - -int main(int argc, char ** argv) -{ - signal(SIGTERM, niam); - signal(SIGINT, niam); - signal(SIGALRM, niam); - - if (argc == 1) - { - std::cerr << std::endl << "Usage: " << argv[0] << " [--system] <object_path> [<destination>]" << std::endl << std::endl; - } - else - { - if (strcmp(argv[1], "--system")) - { - systembus = false; - path = argv[1]; - service = argc > 2 ? argv[2] : 0; - } - else - { - systembus = true; - path = argv[2]; - service = argc > 3 ? argv[3] : 0; - } - - DBus::default_dispatcher = &dispatcher; - - alarm(1); - - dispatcher.enter(); - } - - return 0; -} diff --git a/libs/dbus-c++/tools/introspect.h b/libs/dbus-c++/tools/introspect.h deleted file mode 100644 index 1c6e3264140ec507f9b5ec0d985e50cc48dd361c..0000000000000000000000000000000000000000 --- a/libs/dbus-c++/tools/introspect.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - * - * D-Bus++ - C++ bindings for D-Bus - * - * Copyright (C) 2005-2007 Paolo Durante <shackan@gmail.com> - * - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - - -#ifndef __DBUSXX_TOOLS_INTROSPECT_H -#define __DBUSXX_TOOLS_INTROSPECT_H - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include <dbus-c++/dbus.h> -#include <string> - -class IntrospectedObject : public DBus::IntrospectableProxy, public DBus::ObjectProxy -{ -public: - - IntrospectedObject(DBus::Connection &conn, const char *path, const char *service) - : DBus::ObjectProxy(conn, path, service) - {} -}; - -#endif//__DBUSXX_TOOLS_INTROSPECT_H diff --git a/libs/dbus-c++/tools/xml.cpp b/libs/dbus-c++/tools/xml.cpp deleted file mode 100644 index 68ae5a64da68080330b5985673243a02a5dcf400..0000000000000000000000000000000000000000 --- a/libs/dbus-c++/tools/xml.cpp +++ /dev/null @@ -1,315 +0,0 @@ -/* - * - * D-Bus++ - C++ bindings for D-Bus - * - * Copyright (C) 2005-2007 Paolo Durante <shackan@gmail.com> - * - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - - -#include "xml.h" - -#include <dbus-c++/debug.h> - -#include <expat.h> - -std::istream &operator >> (std::istream &in, DBus::Xml::Document &doc) -{ - std::stringbuf xmlbuf; - in.get(xmlbuf, '\0'); - doc.from_xml(xmlbuf.str()); - - return in; -} - -std::ostream &operator << (std::ostream &out, const DBus::Xml::Document &doc) -{ - return out << doc.to_xml(); -} - -using namespace DBus; -using namespace DBus::Xml; - -Error::Error(const char *error, int line, int column) -{ - std::ostringstream estream; - - estream << "line " << line << ", column " << column << ": " << error; - - _error = estream.str(); -} - -Node::Node(const char *n, const char ** a) -: name(n) -{ - if (a) - for (int i = 0; a[i]; i += 2) - { - _attrs[a[i]] = a[i+1]; - - //debug_log("xml:\t%s = %s", a[i], a[i+1]); - } -} - -Nodes Nodes::operator[](const std::string &key) -{ - Nodes result; - - for (iterator i = begin(); i != end(); ++i) - { - Nodes part = (**i)[key]; - - result.insert(result.end(), part.begin(), part.end()); - } - return result; -} - -Nodes Nodes::select(const std::string &attr, const std::string &value) -{ - Nodes result; - - for (iterator i = begin(); i != end(); ++i) - { - if ((*i)->get(attr) == value) - result.insert(result.end(), *i); - } - return result; -} - -Nodes Node::operator[](const std::string &key) -{ - Nodes result; - - if (key.length() == 0) return result; - - for (Children::iterator i = children.begin(); i != children.end(); ++i) - { - if (i->name == key) - result.push_back(&(*i)); - } - return result; -} - -std::string Node::get(const std::string &attribute) -{ - if (_attrs.find(attribute) != _attrs.end()) - return _attrs[attribute]; - else - return ""; -} - -void Node::set(const std::string &attribute, std::string value) -{ - if (value.length()) - _attrs[attribute] = value; - else - _attrs.erase(value); -} - -std::string Node::to_xml() const -{ - std::string xml; - int depth = 0; - - _raw_xml(xml, depth); - - return xml; -} - -void Node::_raw_xml(std::string &xml, int &depth) const -{ - xml.append(depth *2, ' '); - xml.append("<"+name); - - for (Attributes::const_iterator i = _attrs.begin(); i != _attrs.end(); ++i) - { - xml.append(" "+i->first+"=\""+i->second+"\""); - } - - if (cdata.length() == 0 && children.size() == 0) - { - xml.append("/>\n"); - } - else - { - xml.append(">"); - - if (cdata.length()) - { - xml.append(cdata); - } - - if (children.size()) - { - xml.append("\n"); - depth++; - - for (Children::const_iterator i = children.begin(); i != children.end(); ++i) - { - i->_raw_xml(xml, depth); - } - - depth--; - xml.append(depth *2, ' '); - } - xml.append("</"+name+">\n"); - } -} - -Document::Document() -: root(0), _depth(0) -{ -} - -Document::Document(const std::string &xml) -: root(0), _depth(0) -{ - from_xml(xml); -} - -Document::~Document() -{ - delete root; -} - -struct Document::Expat -{ - static void start_doctype_decl_handler( - void *data, const XML_Char *name, const XML_Char *sysid, const XML_Char *pubid, int has_internal_subset - ); - static void end_doctype_decl_handler(void *data); - static void start_element_handler(void *data, const XML_Char *name, const XML_Char **atts); - static void character_data_handler(void *data, const XML_Char *chars, int len); - static void end_element_handler(void *data, const XML_Char *name); -}; - -void Document::from_xml(const std::string &xml) -{ - _depth = 0; - delete root; - root = 0; - - XML_Parser parser = XML_ParserCreate("UTF-8"); - - XML_SetUserData(parser, this); - - XML_SetDoctypeDeclHandler( - parser, - Document::Expat::start_doctype_decl_handler, - Document::Expat::end_doctype_decl_handler - ); - - XML_SetElementHandler( - parser, - Document::Expat::start_element_handler, - Document::Expat::end_element_handler - ); - - XML_SetCharacterDataHandler( - parser, - Document::Expat::character_data_handler - ); - - XML_Status status = XML_Parse(parser, xml.c_str(), xml.length(), true); - - if (status == XML_STATUS_ERROR) - { - const char *error = XML_ErrorString(XML_GetErrorCode(parser)); - int line = XML_GetCurrentLineNumber(parser); - int column = XML_GetCurrentColumnNumber(parser); - - XML_ParserFree(parser); - - throw Error(error, line, column); - } - else - { - XML_ParserFree(parser); - } -} - -std::string Document::to_xml() const -{ - return root->to_xml(); -} - -void Document::Expat::start_doctype_decl_handler( - void *data, const XML_Char *name, const XML_Char *sysid, const XML_Char *pubid, int has_internal_subset -) -{ -} - -void Document::Expat::end_doctype_decl_handler(void *data) -{ -} - -void Document::Expat::start_element_handler(void *data, const XML_Char *name, const XML_Char **atts) -{ - Document *doc = (Document *)data; - - //debug_log("xml:%d -> %s", doc->_depth, name); - - if (!doc->root) - { - doc->root = new Node(name, atts); - } - else - { - Node::Children *cld = &(doc->root->children); - - for (int i = 1; i < doc->_depth; ++i) - { - cld = &(cld->back().children); - } - cld->push_back(Node(name, atts)); - - //std::cerr << doc->to_xml() << std::endl; - } - doc->_depth++; -} - -void Document::Expat::character_data_handler(void *data, const XML_Char *chars, int len) -{ - Document *doc = (Document *)data; - - Node *nod = doc->root; - - for (int i = 1; i < doc->_depth; ++i) - { - nod = &(nod->children.back()); - } - int x, y; - - x = 0; - y = len-1; - - while (isspace(chars[y]) && y > 0) --y; - while (isspace(chars[x]) && x < y) ++x; - - nod->cdata = std::string(chars, x, y+1); -} - -void Document::Expat::end_element_handler(void *data, const XML_Char *name) -{ - Document *doc = (Document *)data; - - //debug_log("xml:%d <- %s", doc->_depth, name); - - doc->_depth--; -} - diff --git a/libs/dbus-c++/tools/xml.h b/libs/dbus-c++/tools/xml.h deleted file mode 100644 index 6a8e69c19f2121002d0b418c68143f5084aee655..0000000000000000000000000000000000000000 --- a/libs/dbus-c++/tools/xml.h +++ /dev/null @@ -1,142 +0,0 @@ -/* - * - * D-Bus++ - C++ bindings for D-Bus - * - * Copyright (C) 2005-2007 Paolo Durante <shackan@gmail.com> - * - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - - -#ifndef __DBUSXX_XML_H -#define __DBUSXX_XML_H - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include <exception> -#include <string> -#include <vector> -#include <map> -#include <iostream> -#include <sstream> - -namespace DBus { - -namespace Xml { - -class Error : public std::exception -{ -public: - - Error(const char *error, int line, int column); - - ~Error() throw() - {} - - const char *what() const throw() - { - return _error.c_str(); - } - -private: - - std::string _error; -}; - -class Node; - -class Nodes : public std::vector<Node *> -{ -public: - - Nodes operator[](const std::string &key); - - Nodes select(const std::string &attr, const std::string &value); -}; - -class Node -{ -public: - - typedef std::map<std::string, std::string> Attributes; - - typedef std::vector<Node> Children; - - std::string name; - std::string cdata; - Children children; - - Node(std::string &n, Attributes &a) - : name(n), _attrs(a) - {} - - Node(const char *n, const char ** a = NULL); - - Nodes operator[](const std::string &key); - - std::string get(const std::string &attribute); - - void set(const std::string &attribute, std::string value); - - std::string to_xml() const; - - Node &add(Node child) - { - children.push_back(child); - return children.back(); - } - -private: - - void _raw_xml(std::string &xml, int &depth) const; - - Attributes _attrs; -}; - -class Document -{ -public: - - struct Expat; - - Node *root; - - Document(); - - Document(const std::string &xml); - - ~Document(); - - void from_xml(const std::string &xml); - - std::string to_xml() const; - -private: - - int _depth; -}; - -} /* namespace Xml */ - -} /* namespace DBus */ - -std::istream &operator >> (std::istream &, DBus::Xml::Document &); -std::ostream &operator << (std::ostream &, DBus::Xml::Document &); - -#endif//__DBUSXX_XML_H diff --git a/libs/dbus-c++/tools/xml2cpp.cpp b/libs/dbus-c++/tools/xml2cpp.cpp deleted file mode 100644 index 45c8dde1c3fcc9a0fee2b9df3bb89e7e63639cb3..0000000000000000000000000000000000000000 --- a/libs/dbus-c++/tools/xml2cpp.cpp +++ /dev/null @@ -1,1039 +0,0 @@ -/* - * - * D-Bus++ - C++ bindings for D-Bus - * - * Copyright (C) 2005-2007 Paolo Durante <shackan@gmail.com> - * - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - - -#include "xml2cpp.h" - -#include <dbus/dbus.h> - -#include <cstdlib> -#include <cstring> -#include <string> -#include <map> -#include <iostream> -#include <fstream> -#include <sstream> - -using namespace std; -using namespace DBus; - -static const char *tab = " "; - -static const char *header = "\n\ -/*\n\ - * This file was automatically generated by dbusxx-xml2cpp; DO NOT EDIT!\n\ - */\n\ -\n\ -"; - -static const char *dbus_includes = "\n\ -#include <dbus-c++/dbus.h>\n\ -\n\ -"; - -typedef map<string,string> TypeCache; - -void usage(const char *argv0) -{ - cerr << endl << "Usage: " << argv0 << " <xmlfile> [ --proxy=<outfile.h> ] [ --adaptor=<outfile.h> ]" - << endl << endl; - exit(-1); -} - -void underscorize(string &str) -{ - for (unsigned int i = 0; i < str.length(); ++i) - { - if (!isalpha(str[i]) && !isdigit(str[i])) str[i] = '_'; - } -} - -string stub_name(string name) -{ - underscorize(name); - - return "_" + name + "_stub"; -} - -int char_to_atomic_type(char t) -{ - if (strchr("ybnqiuxtdsgavre", t)) - return t; - - return DBUS_TYPE_INVALID; -} - -const char *atomic_type_to_string(char t) -{ - static struct { char type; const char *name; } atos[] = - { - { 'y', "uint8_t" }, - { 'b', "bool" }, - { 'n', "int16_t" }, - { 'q', "uint16_t" }, - { 'i', "int32_t" }, - { 'u', "uint32_t" }, - { 'x', "int64_t" }, - { 't', "uint64_t" }, - { 'd', "double" }, - { 's', "std::string" }, - { 'o', "::DBus::Path" }, - { 'g', "::DBus::Signature" }, - { 'v', "::DBus::Variant" }, - { '\0', "" } - }; - int i; - - for (i = 0; atos[i].type; ++i) - { - if (atos[i].type == t) break; - } - return atos[i].name; -} - -bool is_atomic_type(const string &type) -{ - return type.length() == 1 && char_to_atomic_type(type[0]) != DBUS_TYPE_INVALID; -} - -void _parse_signature(const string &signature, string &type, unsigned int &i) -{ - for (; i < signature.length(); ++i) - { - switch (signature[i]) - { - case 'a': - { - switch (signature[++i]) - { - case '{': - { - type += "std::map< "; - - const char *atom = atomic_type_to_string(signature[++i]); - if (!atom) - { - cerr << "invalid signature" << endl; - exit(-1); - } - type += atom; - type += ", "; - ++i; - break; - } - default: - { - type += "std::vector< "; - break; - } - } - _parse_signature(signature, type, i); - type += " >"; - continue; - } - case '(': - { - type += "::DBus::Struct< "; - ++i; - _parse_signature(signature, type, i); - type += " >"; - if (signature[i+1]) - { - type += ", "; - } - continue; - } - case ')': - case '}': - { - return; - } - default: - { - const char *atom = atomic_type_to_string(signature[i]); - if (!atom) - { - cerr << "invalid signature" << endl; - exit(-1); - } - type += atom; - - if (signature[i+1] != ')' && signature[i+1] != '}' && i+1 < signature.length()) - { - type += ", "; - } - break; - } - } - } -} - -string signature_to_type(const string &signature) -{ - string type; - unsigned int i = 0; - _parse_signature(signature, type, i); - return type; -} - -void generate_proxy(Xml::Document &doc, const char *filename) -{ - cerr << "writing " << filename << endl; - - ofstream file(filename); - if (file.bad()) - { - cerr << "unable to write file " << filename << endl; - exit(-1); - } - - file << header; - string filestring = filename; - underscorize(filestring); - - string cond_comp = "__dbusxx__" + filestring + "__PROXY_MARSHAL_H"; - - file << "#ifndef " << cond_comp << endl; - file << "#define " << cond_comp << endl; - - file << dbus_includes; - - Xml::Node &root = *(doc.root); - Xml::Nodes interfaces = root["interface"]; - - for (Xml::Nodes::iterator i = interfaces.begin(); i != interfaces.end(); ++i) - { - Xml::Node &iface = **i; - Xml::Nodes methods = iface["method"]; - Xml::Nodes signals = iface["signal"]; - Xml::Nodes properties = iface["property"]; - Xml::Nodes ms; - ms.insert(ms.end(), methods.begin(), methods.end()); - ms.insert(ms.end(), signals.begin(), signals.end()); - - string ifacename = iface.get("name"); - if (ifacename == "org.freedesktop.DBus.Introspectable" - ||ifacename == "org.freedesktop.DBus.Properties") - { - cerr << "skipping interface " << ifacename << endl; - continue; - } - - istringstream ss(ifacename); - string nspace; - unsigned int nspaces = 0; - - while (ss.str().find('.', ss.tellg()) != string::npos) - { - getline(ss, nspace, '.'); - - file << "namespace " << nspace << " {" << endl; - - ++nspaces; - } - file << endl; - - string ifaceclass; - - getline(ss, ifaceclass); - - ifaceclass += "_proxy"; - - cerr << "generating code for interface " << ifacename << "..." << endl; - - file << "class " << ifaceclass << endl - << " : public ::DBus::InterfaceProxy" << endl - << "{" << endl - << "public:" << endl - << endl - << tab << ifaceclass << "()" << endl - << tab << ": ::DBus::InterfaceProxy(\"" << ifacename << "\")" << endl - << tab << "{" << endl; - - for (Xml::Nodes::iterator si = signals.begin(); si != signals.end(); ++si) - { - Xml::Node &signal = **si; - - string marshname = "_" + signal.get("name") + "_stub"; - - file << tab << tab << "connect_signal(" - << ifaceclass << ", " << signal.get("name") << ", " << stub_name(signal.get("name")) - << ");" << endl; - } - - file << tab << "}" << endl - << endl; -/// write properties - file << "public:" << endl << endl - << tab << "/* properties exported by this interface */" << endl; - - for (Xml::Nodes::iterator pi = properties.begin (); - pi != properties.end (); ++pi) - { - Xml::Node & property = **pi; - string prop_name = property.get ("name"); - string property_access = property.get ("access"); - if (property_access == "read" || property_access == "readwrite") - { - file << tab << tab << "const " << signature_to_type (property.get("type")) - << " " << prop_name << "() {" << endl; - file << tab << tab << tab << "::DBus::CallMessage call ;\n "; - file << tab << tab << tab - << "call.member(\"Get\"); call.interface(\"org.freedesktop.DBus.Properties\");" - << endl; - file << tab << tab << tab - << "::DBus::MessageIter wi = call.writer(); " << endl; - file << tab << tab << tab - << "const std::string interface_name = \"" << ifacename << "\";" - << endl; - file << tab << tab << tab - << "const std::string property_name = \"" << prop_name << "\";" - << endl; - file << tab << tab << tab << "wi << interface_name;" << endl; - file << tab << tab << tab << "wi << property_name;" << endl; - file << tab << tab << tab - << "::DBus::Message ret = this->invoke_method (call);" << endl; - file << tab << tab << tab - << "::DBus::MessageIter ri = ret.reader ();" << endl; - file << tab << tab << tab << "::DBus::Variant argout; " << endl; - file << tab << tab << tab << "ri >> argout;" << endl; - file << tab << tab << tab << "return argout;" << endl; - file << tab << tab << "};" << endl; - } - - if (property_access == "write" || property_access == "readwrite") - { - file << tab << tab << "void " << prop_name << "( const "<< signature_to_type (property.get("type")) << " & input" << ") {" << endl; - file << tab << tab << tab << "::DBus::CallMessage call ;\n "; - file << tab << tab << tab <<"call.member(\"Set\"); call.interface( \"org.freedesktop.DBus.Properties\");"<< endl; - file << tab << tab << tab <<"::DBus::MessageIter wi = call.writer(); " << endl; - file << tab << tab << tab <<"::DBus::Variant value;" << endl; - file << tab << tab << tab <<"::DBus::MessageIter vi = value.writer ();" << endl; - file << tab << tab << tab <<"vi << input;" << endl; - file << tab << tab << tab <<"const std::string interface_name = \"" << ifacename << "\";" << endl; - file << tab << tab << tab <<"const std::string property_name = \"" << prop_name << "\";"<< endl; - file << tab << tab << tab <<"wi << interface_name;" << endl; - file << tab << tab << tab <<"wi << property_name;" << endl; - file << tab << tab << tab <<"wi << value;" << endl; - file << tab << tab << tab <<"::DBus::Message ret = this->invoke_method (call);" << endl; - file << tab << tab << "};" << endl; - } - } - - file << "public:" << endl - << endl - << tab << "/* methods exported by this interface," << endl - << tab << " * this functions will invoke the corresponding methods on the remote objects" << endl - << tab << " */" << endl; - - for (Xml::Nodes::iterator mi = methods.begin(); mi != methods.end(); ++mi) - { - Xml::Node &method = **mi; - Xml::Nodes args = method["arg"]; - Xml::Nodes args_in = args.select("direction","in"); - Xml::Nodes args_out = args.select("direction","out"); - - if (args_out.size() == 0 || args_out.size() > 1) - { - file << tab << "void "; - } - else if (args_out.size() == 1) - { - file << tab << signature_to_type(args_out.front()->get("type")) << " "; - } - - file << method.get("name") << "("; - - unsigned int i = 0; - for (Xml::Nodes::iterator ai = args_in.begin(); ai != args_in.end(); ++ai, ++i) - { - Xml::Node &arg = **ai; - file << "const " << signature_to_type(arg.get("type")) << "& "; - - string arg_name = arg.get("name"); - if (arg_name.length()) - file << arg_name; - else - file << "argin" << i; - - if ((i+1 != args_in.size() || args_out.size() > 1)) - file << ", "; - } - - if (args_out.size() > 1) - { - unsigned int i = 0; - for (Xml::Nodes::iterator ao = args_out.begin(); ao != args_out.end(); ++ao, ++i) - { - Xml::Node &arg = **ao; - file << signature_to_type(arg.get("type")) << "&"; - - string arg_name = arg.get("name"); - if (arg_name.length()) - file << " " << arg_name; - else - file << " argout" << i; - - if (i+1 != args_out.size()) - file << ", "; - } - } - file << ")" << endl; - - file << tab << "{" << endl - << tab << tab << "::DBus::CallMessage call;" << endl; - - if (args_in.size() > 0) - { - file << tab << tab << "::DBus::MessageIter wi = call.writer();" << endl - << endl; - } - - unsigned int j = 0; - for (Xml::Nodes::iterator ai = args_in.begin(); ai != args_in.end(); ++ai, ++j) - { - Xml::Node &arg = **ai; - string arg_name = arg.get("name"); - if (arg_name.length()) - file << tab << tab << "wi << " << arg_name << ";" << endl; - else - file << tab << tab << "wi << argin" << j << ";" << endl; - } - - file << tab << tab << "call.member(\"" << method.get("name") << "\");" << endl - << tab << tab << "::DBus::Message ret = invoke_method(call);" << endl; - - - if (args_out.size() > 0) - { - file << tab << tab << "::DBus::MessageIter ri = ret.reader();" << endl - << endl; - } - - if (args_out.size() == 1) - { - file << tab << tab << signature_to_type(args_out.front()->get("type")) << " argout;" << endl; - file << tab << tab << "ri >> argout;" << endl; - file << tab << tab << "return argout;" << endl; - } - else if (args_out.size() > 1) - { - unsigned int i = 0; - for (Xml::Nodes::iterator ao = args_out.begin(); ao != args_out.end(); ++ao, ++i) - { - Xml::Node &arg = **ao; - - string arg_name = arg.get("name"); - if (arg_name.length()) - file << tab << tab << "ri >> " << arg.get("name") << ";" << endl; - else - file << tab << tab << "ri >> argout" << i << ";" << endl; - } - } - - file << tab << "}" << endl - << endl; - } - - file << endl - << "public:" << endl - << endl - << tab << "/* signal handlers for this interface" << endl - << tab << " */" << endl; - - for (Xml::Nodes::iterator si = signals.begin(); si != signals.end(); ++si) - { - Xml::Node &signal = **si; - Xml::Nodes args = signal["arg"]; - - file << tab << "virtual void " << signal.get("name") << "("; - - unsigned int i = 0; - for (Xml::Nodes::iterator ai = args.begin(); ai != args.end(); ++ai, ++i) - { - Xml::Node &arg = **ai; - file << "const " << signature_to_type(arg.get("type")) << "& "; - - string arg_name = arg.get("name"); - if (arg_name.length()) - file << arg_name; - else - file << "argin" << i; - - if ((ai+1 != args.end())) - file << ", "; - } - file << ") = 0;" << endl; - } - - file << endl - << "private:" << endl - << endl - << tab << "/* unmarshalers (to unpack the DBus message before calling the actual signal handler)" << endl - << tab << " */" << endl; - - for (Xml::Nodes::iterator si = signals.begin(); si != signals.end(); ++si) - { - Xml::Node &signal = **si; - Xml::Nodes args = signal["arg"]; - - file << tab << "void " << stub_name(signal.get("name")) << "(const ::DBus::SignalMessage &sig)" << endl - << tab << "{" << endl; - - if (args.size() > 0) - { - file << tab << tab << "::DBus::MessageIter ri = sig.reader();" << endl - << endl; - } - - unsigned int i = 0; - for (Xml::Nodes::iterator ai = args.begin(); ai != args.end(); ++ai, ++i) - { - Xml::Node &arg = **ai; - file << tab << tab << signature_to_type(arg.get("type")) << " " ; - - string arg_name = arg.get("name"); - if (arg_name.length()) - file << arg_name << ";" << " ri >> " << arg_name << ";" << endl; - else - file << "arg" << i << ";" << " ri >> " << "arg" << i << ";" << endl; - } - - file << tab << tab << signal.get("name") << "("; - - unsigned int j = 0; - for (Xml::Nodes::iterator ai = args.begin(); ai != args.end(); ++ai, ++j) - { - Xml::Node &arg = **ai; - - string arg_name = arg.get("name"); - if (arg_name.length()) - file << arg_name; - else - file << "arg" << j; - - if (ai+1 != args.end()) - file << ", "; - } - - file << ");" << endl; - - file << tab << "}" << endl; - } - - - file << "};" << endl - << endl; - - for (unsigned int i = 0; i < nspaces; ++i) - { - file << "} "; - } - file << endl; - } - - file << "#endif//" << cond_comp << endl; - - file.close(); -} - -void generate_adaptor(Xml::Document &doc, const char *filename) -{ - cerr << "writing " << filename << endl; - - ofstream file(filename); - if (file.bad()) - { - cerr << "unable to write file " << filename << endl; - exit(-1); - } - - file << header; - string filestring = filename; - underscorize(filestring); - - string cond_comp = "__dbusxx__" + filestring + "__ADAPTOR_MARSHAL_H"; - - file << "#ifndef " << cond_comp << endl - << "#define " << cond_comp << endl; - - file << dbus_includes; - - Xml::Node &root = *(doc.root); - Xml::Nodes interfaces = root["interface"]; - - for (Xml::Nodes::iterator i = interfaces.begin(); i != interfaces.end(); ++i) - { - Xml::Node &iface = **i; - Xml::Nodes methods = iface["method"]; - Xml::Nodes signals = iface["signal"]; - Xml::Nodes properties = iface["property"]; - Xml::Nodes ms; - ms.insert(ms.end(), methods.begin(), methods.end()); - ms.insert(ms.end(), signals.begin(), signals.end()); - - string ifacename = iface.get("name"); - if (ifacename == "org.freedesktop.DBus.Introspectable" - ||ifacename == "org.freedesktop.DBus.Properties") - { - cerr << "skipping interface " << ifacename << endl; - continue; - } - - istringstream ss(ifacename); - string nspace; - unsigned int nspaces = 0; - - while (ss.str().find('.', ss.tellg()) != string::npos) - { - getline(ss, nspace, '.'); - - file << "namespace " << nspace << " {" << endl; - - ++nspaces; - } - file << endl; - - string ifaceclass; - - getline(ss, ifaceclass); - - ifaceclass += "_adaptor"; - - cerr << "generating code for interface " << ifacename << "..." << endl; - - file << "class " << ifaceclass << endl - << ": public ::DBus::InterfaceAdaptor" << endl - << "{" << endl - << "public:" << endl - << endl - << tab << ifaceclass << "()" << endl - << tab << ": ::DBus::InterfaceAdaptor(\"" << ifacename << "\")" << endl - << tab << "{" << endl; - - for (Xml::Nodes::iterator pi = properties.begin(); pi != properties.end(); ++pi) - { - Xml::Node &property = **pi; - - file << tab << tab << "bind_property(" - << property.get("name") << ", " - << "\"" << property.get("type") << "\", " - << (property.get("access").find("read") != string::npos - ? "true" - : "false") - << ", " - << (property.get("access").find("write") != string::npos - ? "true" - : "false") - << ");" << endl; - } - - for (Xml::Nodes::iterator mi = methods.begin(); mi != methods.end(); ++mi) - { - Xml::Node &method = **mi; - - file << tab << tab << "register_method(" - << ifaceclass << ", " << method.get("name") << ", "<< stub_name(method.get("name")) - << ");" << endl; - } - - file << tab << "}" << endl - << endl; - - file << tab << "::DBus::IntrospectedInterface *const introspect() const " << endl - << tab << "{" << endl; - - for (Xml::Nodes::iterator mi = ms.begin(); mi != ms.end(); ++mi) - { - Xml::Node &method = **mi; - Xml::Nodes args = method["arg"]; - - file << tab << tab << "static ::DBus::IntrospectedArgument " << method.get("name") << "_args[] = " << endl - << tab << tab << "{" << endl; - - for (Xml::Nodes::iterator ai = args.begin(); ai != args.end(); ++ai) - { - Xml::Node &arg = **ai; - - file << tab << tab << tab << "{ "; - - if (arg.get("name").length()) - { - file << "\"" << arg.get("name") << "\", "; - } - else - { - file << "0, "; - } - file << "\"" << arg.get("type") << "\", " - << (arg.get("direction") == "in" ? "true" : "false") - << " }," << endl; - } - file << tab << tab << tab << "{ 0, 0, 0 }" << endl - << tab << tab << "};" << endl; - } - - file << tab << tab << "static ::DBus::IntrospectedMethod " << ifaceclass << "_methods[] = " << endl - << tab << tab << "{" << endl; - - for (Xml::Nodes::iterator mi = methods.begin(); mi != methods.end(); ++mi) - { - Xml::Node &method = **mi; - - file << tab << tab << tab << "{ \"" << method.get("name") << "\", " << method.get("name") << "_args }," << endl; - } - - file << tab << tab << tab << "{ 0, 0 }" << endl - << tab << tab << "};" << endl; - - file << tab << tab << "static ::DBus::IntrospectedMethod " << ifaceclass << "_signals[] = " << endl - << tab << tab << "{" << endl; - - for (Xml::Nodes::iterator si = signals.begin(); si != signals.end(); ++si) - { - Xml::Node &method = **si; - - file << tab << tab << tab << "{ \"" << method.get("name") << "\", " << method.get("name") << "_args }," << endl; - } - - file << tab << tab << tab << "{ 0, 0 }" << endl - << tab << tab << "};" << endl; - - file << tab << tab << "static ::DBus::IntrospectedProperty " << ifaceclass << "_properties[] = " << endl - << tab << tab << "{" << endl; - - for (Xml::Nodes::iterator pi = properties.begin(); pi != properties.end(); ++pi) - { - Xml::Node &property = **pi; - - file << tab << tab << tab << "{ " - << "\"" << property.get("name") << "\", " - << "\"" << property.get("type") << "\", " - << (property.get("access").find("read") != string::npos - ? "true" - : "false") - << ", " - << (property.get("access").find("write") != string::npos - ? "true" - : "false") - << " }," << endl; - } - - - file << tab << tab << tab << "{ 0, 0, 0, 0 }" << endl - << tab << tab << "};" << endl; - - file << tab << tab << "static ::DBus::IntrospectedInterface " << ifaceclass << "_interface = " << endl - << tab << tab << "{" << endl - << tab << tab << tab << "\"" << ifacename << "\"," << endl - << tab << tab << tab << ifaceclass << "_methods," << endl - << tab << tab << tab << ifaceclass << "_signals," << endl - << tab << tab << tab << ifaceclass << "_properties" << endl - << tab << tab << "};" << endl - << tab << tab << "return &" << ifaceclass << "_interface;" << endl - << tab << "}" << endl - << endl; - - file << "public:" << endl - << endl - << tab << "/* properties exposed by this interface, use" << endl - << tab << " * property() and property(value) to get and set a particular property" << endl - << tab << " */" << endl; - - for (Xml::Nodes::iterator pi = properties.begin(); pi != properties.end(); ++pi) - { - Xml::Node &property = **pi; - string name = property.get("name"); - string type = property.get("type"); - string type_name = signature_to_type(type); - - file << tab << "::DBus::PropertyAdaptor< " << type_name << " > " << name << ";" << endl; - } - - file << endl; - - file << "public:" << endl - << endl - << tab << "/* methods exported by this interface," << endl - << tab << " * you will have to implement them in your ObjectAdaptor" << endl - << tab << " */" << endl; - - for (Xml::Nodes::iterator mi = methods.begin(); mi != methods.end(); ++mi) - { - Xml::Node &method = **mi; - Xml::Nodes args = method["arg"]; - Xml::Nodes args_in = args.select("direction","in"); - Xml::Nodes args_out = args.select("direction","out"); - - file << tab << "virtual "; - - if (args_out.size() == 0 || args_out.size() > 1) - { - file << "void "; - } - else if (args_out.size() == 1) - { - file << signature_to_type(args_out.front()->get("type")) << " "; - } - - file << method.get("name") << "("; - - unsigned int i = 0; - for (Xml::Nodes::iterator ai = args_in.begin(); ai != args_in.end(); ++ai, ++i) - { - Xml::Node &arg = **ai; - file << "const " << signature_to_type(arg.get("type")) << "& "; - - string arg_name = arg.get("name"); - if (arg_name.length()) - file << arg_name; - - if ((i+1 != args_in.size() || args_out.size() > 1)) - file << ", "; - } - - if (args_out.size() > 1) - { - unsigned int i = 0; - for (Xml::Nodes::iterator ao = args_out.begin(); ao != args_out.end(); ++ao, ++i) - { - Xml::Node &arg = **ao; - file << signature_to_type(arg.get("type")) << "&"; - - string arg_name = arg.get("name"); - if (arg_name.length()) - file << " " << arg_name; - - if (i+1 != args_out.size()) - file << ", "; - } - } - file << ") = 0;" << endl; - } - - file << endl - << "public:" << endl - << endl - << tab << "/* signal emitters for this interface" << endl - << tab << " */" << endl; - - for (Xml::Nodes::iterator si = signals.begin(); si != signals.end(); ++si) - { - Xml::Node &signal = **si; - Xml::Nodes args = signal["arg"]; - - file << tab << "void " << signal.get("name") << "("; - - unsigned int i = 0; - for (Xml::Nodes::iterator a = args.begin(); a != args.end(); ++a, ++i) - { - Xml::Node &arg = **a; - - file << "const " << signature_to_type(arg.get("type")) << "& arg" << i+1; - - if (i+1 != args.size()) - file << ", "; - } - - file << ")" << endl - << tab << "{" << endl - << tab << tab << "::DBus::SignalMessage sig(\"" << signal.get("name") <<"\");" << endl;; - - - if (args.size() > 0) - { - file << tab << tab << "::DBus::MessageIter wi = sig.writer();" << endl; - - for (unsigned int i = 0; i < args.size(); ++i) - { - file << tab << tab << "wi << arg" << i+1 << ";" << endl; - } - } - - file << tab << tab << "emit_signal(sig);" << endl - << tab << "}" << endl; - } - - file << endl - << "private:" << endl - << endl - << tab << "/* unmarshalers (to unpack the DBus message before calling the actual interface method)" << endl - << tab << " */" << endl; - - for (Xml::Nodes::iterator mi = methods.begin(); mi != methods.end(); ++mi) - { - Xml::Node &method = **mi; - Xml::Nodes args = method["arg"]; - Xml::Nodes args_in = args.select("direction","in"); - Xml::Nodes args_out = args.select("direction","out"); - - file << tab << "::DBus::Message " << stub_name(method.get("name")) << "(const ::DBus::CallMessage &call)" << endl - << tab << "{" << endl - << tab << tab << "::DBus::MessageIter ri = call.reader();" << endl - << endl; - - unsigned int i = 1; - for (Xml::Nodes::iterator ai = args_in.begin(); ai != args_in.end(); ++ai, ++i) - { - Xml::Node &arg = **ai; - file << tab << tab << signature_to_type(arg.get("type")) << " argin" << i << ";" - << " ri >> argin" << i << ";" << endl; - } - - if (args_out.size() == 0) - { - file << tab << tab; - } - else if (args_out.size() == 1) - { - file << tab << tab << signature_to_type(args_out.front()->get("type")) << " argout1 = "; - } - else - { - unsigned int i = 1; - for (Xml::Nodes::iterator ao = args_out.begin(); ao != args_out.end(); ++ao, ++i) - { - Xml::Node &arg = **ao; - file << tab << tab << signature_to_type(arg.get("type")) << " argout" << i << ";" << endl; - } - file << tab << tab; - } - - file << method.get("name") << "("; - - for (unsigned int i = 0; i < args_in.size(); ++i) - { - file << "argin" << i+1; - - if ((i+1 != args_in.size() || args_out.size() > 1)) - file << ", "; - } - - if (args_out.size() > 1) - for (unsigned int i = 0; i < args_out.size(); ++i) - { - file << "argout" << i+1; - - if (i+1 != args_out.size()) - file << ", "; - } - - file << ");" << endl; - - file << tab << tab << "::DBus::ReturnMessage reply(call);" << endl; - - if (args_out.size() > 0) - { - file << tab << tab << "::DBus::MessageIter wi = reply.writer();" << endl; - - for (unsigned int i = 0; i < args_out.size(); ++i) - { - file << tab << tab << "wi << argout" << i+1 << ";" << endl; - } - } - - file << tab << tab << "return reply;" << endl; - - file << tab << "}" << endl; - } - - file << "};" << endl - << endl; - - for (unsigned int i = 0; i < nspaces; ++i) - { - file << "} "; - } - file << endl; - } - - file << "#endif//" << cond_comp << endl; - - file.close(); -} - -int main(int argc, char ** argv) -{ - if (argc < 2) - { - usage(argv[0]); - } - - bool proxy_mode, adaptor_mode; - char *proxy, *adaptor; - - proxy_mode = false; - proxy = 0; - - adaptor_mode = false; - adaptor = 0; - - for (int a = 1; a < argc; ++a) - { - if (!strncmp(argv[a], "--proxy=", 8)) - { - proxy_mode = true; - proxy = argv[a] +8; - } - else - if (!strncmp(argv[a], "--adaptor=", 10)) - { - adaptor_mode = true; - adaptor = argv[a] +10; - } - } - - if (!proxy_mode && !adaptor_mode) usage(argv[0]); - - ifstream xmlfile(argv[1]); - - if (xmlfile.bad()) - { - cerr << "unable to open file " << argv[1] << endl; - return -1; - } - - Xml::Document doc; - - try - { - xmlfile >> doc; - //cout << doc.to_xml(); - } - catch(Xml::Error &e) - { - cerr << "error parsing " << argv[1] << ": " << e.what() << endl; - return -1; - } - - if (!doc.root) - { - cerr << "empty document" << endl; - return -1; - } - - if (proxy_mode) generate_proxy(doc, proxy); - if (adaptor_mode) generate_adaptor(doc, adaptor); - - return 0; -} diff --git a/libs/dbus-c++/tools/xml2cpp.h b/libs/dbus-c++/tools/xml2cpp.h deleted file mode 100644 index 84f53feacf4fc7f263f3802097e8ff45e9dea6bc..0000000000000000000000000000000000000000 --- a/libs/dbus-c++/tools/xml2cpp.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - * - * D-Bus++ - C++ bindings for D-Bus - * - * Copyright (C) 2005-2007 Paolo Durante <shackan@gmail.com> - * - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - - -#ifndef __DBUSXX_TOOLS_XML2CPP_H -#define __DBUSXX_TOOLS_XML2CPP_H - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include <dbus-c++/dbus.h> -#include <dbus/dbus.h> - -#include "xml.h" - -#endif//__DBUSXX_TOOLS_XML2CPP_H