--- /dev/null
+ GNU GENERAL PUBLIC LICENSE
+ Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The GNU General Public License is a free, copyleft license for
+software and other kinds of works.
+
+ The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works. By contrast,
+the GNU General Public License is intended to guarantee your freedom to
+share and change all versions of a program--to make sure it remains free
+software for all its users. We, the Free Software Foundation, use the
+GNU General Public License for most of our software; it applies also to
+any other work released this way by its authors. You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+them if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs, and that you know you can do these things.
+
+ To protect your rights, we need to prevent others from denying you
+these rights or asking you to surrender the rights. Therefore, you have
+certain responsibilities if you distribute copies of the software, or if
+you modify it: responsibilities to respect the freedom of others.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must pass on to the recipients the same
+freedoms that you received. You must make sure that they, too, receive
+or can get the source code. And you must show them these terms so they
+know their rights.
+
+ Developers that use the GNU GPL protect your rights with two steps:
+(1) assert copyright on the software, and (2) offer you this License
+giving you legal permission to copy, distribute and/or modify it.
+
+ For the developers' and authors' protection, the GPL clearly explains
+that there is no warranty for this free software. For both users' and
+authors' sake, the GPL requires that modified versions be marked as
+changed, so that their problems will not be attributed erroneously to
+authors of previous versions.
+
+ Some devices are designed to deny users access to install or run
+modified versions of the software inside them, although the manufacturer
+can do so. This is fundamentally incompatible with the aim of
+protecting users' freedom to change the software. The systematic
+pattern of such abuse occurs in the area of products for individuals to
+use, which is precisely where it is most unacceptable. Therefore, we
+have designed this version of the GPL to prohibit the practice for those
+products. If such problems arise substantially in other domains, we
+stand ready to extend this provision to those domains in future versions
+of the GPL, as needed to protect the freedom of users.
+
+ Finally, every program is threatened constantly by software patents.
+States should not allow patents to restrict development and use of
+software on general-purpose computers, but in those that do, we wish to
+avoid the special danger that patents applied to a free program could
+make it effectively proprietary. To prevent this, the GPL assures that
+patents cannot be used to render the program non-free.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ TERMS AND CONDITIONS
+
+ 0. Definitions.
+
+ "This License" refers to version 3 of the GNU General Public License.
+
+ "Copyright" also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
+
+ "The Program" refers to any copyrightable work licensed under this
+License. Each licensee is addressed as "you". "Licensees" and
+"recipients" may be individuals or organizations.
+
+ To "modify" a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of an
+exact copy. The resulting work is called a "modified version" of the
+earlier work or a work "based on" the earlier work.
+
+ A "covered work" means either the unmodified Program or a work based
+on the Program.
+
+ To "propagate" a work means to do anything with it that, without
+permission, would make you directly or secondarily liable for
+infringement under applicable copyright law, except executing it on a
+computer or modifying a private copy. Propagation includes copying,
+distribution (with or without modification), making available to the
+public, and in some countries other activities as well.
+
+ To "convey" a work means any kind of propagation that enables other
+parties to make or receive copies. Mere interaction with a user through
+a computer network, with no transfer of a copy, is not conveying.
+
+ An interactive user interface displays "Appropriate Legal Notices"
+to the extent that it includes a convenient and prominently visible
+feature that (1) displays an appropriate copyright notice, and (2)
+tells the user that there is no warranty for the work (except to the
+extent that warranties are provided), that licensees may convey the
+work under this License, and how to view a copy of this License. If
+the interface presents a list of user commands or options, such as a
+menu, a prominent item in the list meets this criterion.
+
+ 1. Source Code.
+
+ The "source code" for a work means the preferred form of the work
+for making modifications to it. "Object code" means any non-source
+form of a work.
+
+ A "Standard Interface" means an interface that either is an official
+standard defined by a recognized standards body, or, in the case of
+interfaces specified for a particular programming language, one that
+is widely used among developers working in that language.
+
+ The "System Libraries" of an executable work include anything, other
+than the work as a whole, that (a) is included in the normal form of
+packaging a Major Component, but which is not part of that Major
+Component, and (b) serves only to enable use of the work with that
+Major Component, or to implement a Standard Interface for which an
+implementation is available to the public in source code form. A
+"Major Component", in this context, means a major essential component
+(kernel, window system, and so on) of the specific operating system
+(if any) on which the executable work runs, or a compiler used to
+produce the work, or an object code interpreter used to run it.
+
+ The "Corresponding Source" for a work in object code form means all
+the source code needed to generate, install, and (for an executable
+work) run the object code and to modify the work, including scripts to
+control those activities. However, it does not include the work's
+System Libraries, or general-purpose tools or generally available free
+programs which are used unmodified in performing those activities but
+which are not part of the work. For example, Corresponding Source
+includes interface definition files associated with source files for
+the work, and the source code for shared libraries and dynamically
+linked subprograms that the work is specifically designed to require,
+such as by intimate data communication or control flow between those
+subprograms and other parts of the work.
+
+ The Corresponding Source need not include anything that users
+can regenerate automatically from other parts of the Corresponding
+Source.
+
+ The Corresponding Source for a work in source code form is that
+same work.
+
+ 2. Basic Permissions.
+
+ All rights granted under this License are granted for the term of
+copyright on the Program, and are irrevocable provided the stated
+conditions are met. This License explicitly affirms your unlimited
+permission to run the unmodified Program. The output from running a
+covered work is covered by this License only if the output, given its
+content, constitutes a covered work. This License acknowledges your
+rights of fair use or other equivalent, as provided by copyright law.
+
+ You may make, run and propagate covered works that you do not
+convey, without conditions so long as your license otherwise remains
+in force. You may convey covered works to others for the sole purpose
+of having them make modifications exclusively for you, or provide you
+with facilities for running those works, provided that you comply with
+the terms of this License in conveying all material for which you do
+not control copyright. Those thus making or running the covered works
+for you must do so exclusively on your behalf, under your direction
+and control, on terms that prohibit them from making any copies of
+your copyrighted material outside their relationship with you.
+
+ Conveying under any other circumstances is permitted solely under
+the conditions stated below. Sublicensing is not allowed; section 10
+makes it unnecessary.
+
+ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+
+ No covered work shall be deemed part of an effective technological
+measure under any applicable law fulfilling obligations under article
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
+similar laws prohibiting or restricting circumvention of such
+measures.
+
+ When you convey a covered work, you waive any legal power to forbid
+circumvention of technological measures to the extent such circumvention
+is effected by exercising rights under this License with respect to
+the covered work, and you disclaim any intention to limit operation or
+modification of the work as a means of enforcing, against the work's
+users, your or third parties' legal rights to forbid circumvention of
+technological measures.
+
+ 4. Conveying Verbatim Copies.
+
+ You may convey verbatim copies of the Program's source code as you
+receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice;
+keep intact all notices stating that this License and any
+non-permissive terms added in accord with section 7 apply to the code;
+keep intact all notices of the absence of any warranty; and give all
+recipients a copy of this License along with the Program.
+
+ You may charge any price or no price for each copy that you convey,
+and you may offer support or warranty protection for a fee.
+
+ 5. Conveying Modified Source Versions.
+
+ You may convey a work based on the Program, or the modifications to
+produce it from the Program, in the form of source code under the
+terms of section 4, provided that you also meet all of these conditions:
+
+ a) The work must carry prominent notices stating that you modified
+ it, and giving a relevant date.
+
+ b) The work must carry prominent notices stating that it is
+ released under this License and any conditions added under section
+ 7. This requirement modifies the requirement in section 4 to
+ "keep intact all notices".
+
+ c) You must license the entire work, as a whole, under this
+ License to anyone who comes into possession of a copy. This
+ License will therefore apply, along with any applicable section 7
+ additional terms, to the whole of the work, and all its parts,
+ regardless of how they are packaged. This License gives no
+ permission to license the work in any other way, but it does not
+ invalidate such permission if you have separately received it.
+
+ d) If the work has interactive user interfaces, each must display
+ Appropriate Legal Notices; however, if the Program has interactive
+ interfaces that do not display Appropriate Legal Notices, your
+ work need not make them do so.
+
+ A compilation of a covered work with other separate and independent
+works, which are not by their nature extensions of the covered work,
+and which are not combined with it such as to form a larger program,
+in or on a volume of a storage or distribution medium, is called an
+"aggregate" if the compilation and its resulting copyright are not
+used to limit the access or legal rights of the compilation's users
+beyond what the individual works permit. Inclusion of a covered work
+in an aggregate does not cause this License to apply to the other
+parts of the aggregate.
+
+ 6. Conveying Non-Source Forms.
+
+ You may convey a covered work in object code form under the terms
+of sections 4 and 5, provided that you also convey the
+machine-readable Corresponding Source under the terms of this License,
+in one of these ways:
+
+ a) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by the
+ Corresponding Source fixed on a durable physical medium
+ customarily used for software interchange.
+
+ b) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by a
+ written offer, valid for at least three years and valid for as
+ long as you offer spare parts or customer support for that product
+ model, to give anyone who possesses the object code either (1) a
+ copy of the Corresponding Source for all the software in the
+ product that is covered by this License, on a durable physical
+ medium customarily used for software interchange, for a price no
+ more than your reasonable cost of physically performing this
+ conveying of source, or (2) access to copy the
+ Corresponding Source from a network server at no charge.
+
+ c) Convey individual copies of the object code with a copy of the
+ written offer to provide the Corresponding Source. This
+ alternative is allowed only occasionally and noncommercially, and
+ only if you received the object code with such an offer, in accord
+ with subsection 6b.
+
+ d) Convey the object code by offering access from a designated
+ place (gratis or for a charge), and offer equivalent access to the
+ Corresponding Source in the same way through the same place at no
+ further charge. You need not require recipients to copy the
+ Corresponding Source along with the object code. If the place to
+ copy the object code is a network server, the Corresponding Source
+ may be on a different server (operated by you or a third party)
+ that supports equivalent copying facilities, provided you maintain
+ clear directions next to the object code saying where to find the
+ Corresponding Source. Regardless of what server hosts the
+ Corresponding Source, you remain obligated to ensure that it is
+ available for as long as needed to satisfy these requirements.
+
+ e) Convey the object code using peer-to-peer transmission, provided
+ you inform other peers where the object code and Corresponding
+ Source of the work are being offered to the general public at no
+ charge under subsection 6d.
+
+ A separable portion of the object code, whose source code is excluded
+from the Corresponding Source as a System Library, need not be
+included in conveying the object code work.
+
+ A "User Product" is either (1) a "consumer product", which means any
+tangible personal property which is normally used for personal, family,
+or household purposes, or (2) anything designed or sold for incorporation
+into a dwelling. In determining whether a product is a consumer product,
+doubtful cases shall be resolved in favor of coverage. For a particular
+product received by a particular user, "normally used" refers to a
+typical or common use of that class of product, regardless of the status
+of the particular user or of the way in which the particular user
+actually uses, or expects or is expected to use, the product. A product
+is a consumer product regardless of whether the product has substantial
+commercial, industrial or non-consumer uses, unless such uses represent
+the only significant mode of use of the product.
+
+ "Installation Information" for a User Product means any methods,
+procedures, authorization keys, or other information required to install
+and execute modified versions of a covered work in that User Product from
+a modified version of its Corresponding Source. The information must
+suffice to ensure that the continued functioning of the modified object
+code is in no case prevented or interfered with solely because
+modification has been made.
+
+ If you convey an object code work under this section in, or with, or
+specifically for use in, a User Product, and the conveying occurs as
+part of a transaction in which the right of possession and use of the
+User Product is transferred to the recipient in perpetuity or for a
+fixed term (regardless of how the transaction is characterized), the
+Corresponding Source conveyed under this section must be accompanied
+by the Installation Information. But this requirement does not apply
+if neither you nor any third party retains the ability to install
+modified object code on the User Product (for example, the work has
+been installed in ROM).
+
+ The requirement to provide Installation Information does not include a
+requirement to continue to provide support service, warranty, or updates
+for a work that has been modified or installed by the recipient, or for
+the User Product in which it has been modified or installed. Access to a
+network may be denied when the modification itself materially and
+adversely affects the operation of the network or violates the rules and
+protocols for communication across the network.
+
+ Corresponding Source conveyed, and Installation Information provided,
+in accord with this section must be in a format that is publicly
+documented (and with an implementation available to the public in
+source code form), and must require no special password or key for
+unpacking, reading or copying.
+
+ 7. Additional Terms.
+
+ "Additional permissions" are terms that supplement the terms of this
+License by making exceptions from one or more of its conditions.
+Additional permissions that are applicable to the entire Program shall
+be treated as though they were included in this License, to the extent
+that they are valid under applicable law. If additional permissions
+apply only to part of the Program, that part may be used separately
+under those permissions, but the entire Program remains governed by
+this License without regard to the additional permissions.
+
+ When you convey a copy of a covered work, you may at your option
+remove any additional permissions from that copy, or from any part of
+it. (Additional permissions may be written to require their own
+removal in certain cases when you modify the work.) You may place
+additional permissions on material, added by you to a covered work,
+for which you have or can give appropriate copyright permission.
+
+ Notwithstanding any other provision of this License, for material you
+add to a covered work, you may (if authorized by the copyright holders of
+that material) supplement the terms of this License with terms:
+
+ a) Disclaiming warranty or limiting liability differently from the
+ terms of sections 15 and 16 of this License; or
+
+ b) Requiring preservation of specified reasonable legal notices or
+ author attributions in that material or in the Appropriate Legal
+ Notices displayed by works containing it; or
+
+ c) Prohibiting misrepresentation of the origin of that material, or
+ requiring that modified versions of such material be marked in
+ reasonable ways as different from the original version; or
+
+ d) Limiting the use for publicity purposes of names of licensors or
+ authors of the material; or
+
+ e) Declining to grant rights under trademark law for use of some
+ trade names, trademarks, or service marks; or
+
+ f) Requiring indemnification of licensors and authors of that
+ material by anyone who conveys the material (or modified versions of
+ it) with contractual assumptions of liability to the recipient, for
+ any liability that these contractual assumptions directly impose on
+ those licensors and authors.
+
+ All other non-permissive additional terms are considered "further
+restrictions" within the meaning of section 10. If the Program as you
+received it, or any part of it, contains a notice stating that it is
+governed by this License along with a term that is a further
+restriction, you may remove that term. If a license document contains
+a further restriction but permits relicensing or conveying under this
+License, you may add to a covered work material governed by the terms
+of that license document, provided that the further restriction does
+not survive such relicensing or conveying.
+
+ If you add terms to a covered work in accord with this section, you
+must place, in the relevant source files, a statement of the
+additional terms that apply to those files, or a notice indicating
+where to find the applicable terms.
+
+ Additional terms, permissive or non-permissive, may be stated in the
+form of a separately written license, or stated as exceptions;
+the above requirements apply either way.
+
+ 8. Termination.
+
+ You may not propagate or modify a covered work except as expressly
+provided under this License. Any attempt otherwise to propagate or
+modify it is void, and will automatically terminate your rights under
+this License (including any patent licenses granted under the third
+paragraph of section 11).
+
+ However, if you cease all violation of this License, then your
+license from a particular copyright holder is reinstated (a)
+provisionally, unless and until the copyright holder explicitly and
+finally terminates your license, and (b) permanently, if the copyright
+holder fails to notify you of the violation by some reasonable means
+prior to 60 days after the cessation.
+
+ Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+ Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License. If your rights have been terminated and not permanently
+reinstated, you do not qualify to receive new licenses for the same
+material under section 10.
+
+ 9. Acceptance Not Required for Having Copies.
+
+ You are not required to accept this License in order to receive or
+run a copy of the Program. Ancillary propagation of a covered work
+occurring solely as a consequence of using peer-to-peer transmission
+to receive a copy likewise does not require acceptance. However,
+nothing other than this License grants you permission to propagate or
+modify any covered work. These actions infringe copyright if you do
+not accept this License. Therefore, by modifying or propagating a
+covered work, you indicate your acceptance of this License to do so.
+
+ 10. Automatic Licensing of Downstream Recipients.
+
+ Each time you convey a covered work, the recipient automatically
+receives a license from the original licensors, to run, modify and
+propagate that work, subject to this License. You are not responsible
+for enforcing compliance by third parties with this License.
+
+ An "entity transaction" is a transaction transferring control of an
+organization, or substantially all assets of one, or subdividing an
+organization, or merging organizations. If propagation of a covered
+work results from an entity transaction, each party to that
+transaction who receives a copy of the work also receives whatever
+licenses to the work the party's predecessor in interest had or could
+give under the previous paragraph, plus a right to possession of the
+Corresponding Source of the work from the predecessor in interest, if
+the predecessor has it or can get it with reasonable efforts.
+
+ You may not impose any further restrictions on the exercise of the
+rights granted or affirmed under this License. For example, you may
+not impose a license fee, royalty, or other charge for exercise of
+rights granted under this License, and you may not initiate litigation
+(including a cross-claim or counterclaim in a lawsuit) alleging that
+any patent claim is infringed by making, using, selling, offering for
+sale, or importing the Program or any portion of it.
+
+ 11. Patents.
+
+ A "contributor" is a copyright holder who authorizes use under this
+License of the Program or a work on which the Program is based. The
+work thus licensed is called the contributor's "contributor version".
+
+ A contributor's "essential patent claims" are all patent claims
+owned or controlled by the contributor, whether already acquired or
+hereafter acquired, that would be infringed by some manner, permitted
+by this License, of making, using, or selling its contributor version,
+but do not include claims that would be infringed only as a
+consequence of further modification of the contributor version. For
+purposes of this definition, "control" includes the right to grant
+patent sublicenses in a manner consistent with the requirements of
+this License.
+
+ Each contributor grants you a non-exclusive, worldwide, royalty-free
+patent license under the contributor's essential patent claims, to
+make, use, sell, offer for sale, import and otherwise run, modify and
+propagate the contents of its contributor version.
+
+ In the following three paragraphs, a "patent license" is any express
+agreement or commitment, however denominated, not to enforce a patent
+(such as an express permission to practice a patent or covenant not to
+sue for patent infringement). To "grant" such a patent license to a
+party means to make such an agreement or commitment not to enforce a
+patent against the party.
+
+ If you convey a covered work, knowingly relying on a patent license,
+and the Corresponding Source of the work is not available for anyone
+to copy, free of charge and under the terms of this License, through a
+publicly available network server or other readily accessible means,
+then you must either (1) cause the Corresponding Source to be so
+available, or (2) arrange to deprive yourself of the benefit of the
+patent license for this particular work, or (3) arrange, in a manner
+consistent with the requirements of this License, to extend the patent
+license to downstream recipients. "Knowingly relying" means you have
+actual knowledge that, but for the patent license, your conveying the
+covered work in a country, or your recipient's use of the covered work
+in a country, would infringe one or more identifiable patents in that
+country that you have reason to believe are valid.
+
+ If, pursuant to or in connection with a single transaction or
+arrangement, you convey, or propagate by procuring conveyance of, a
+covered work, and grant a patent license to some of the parties
+receiving the covered work authorizing them to use, propagate, modify
+or convey a specific copy of the covered work, then the patent license
+you grant is automatically extended to all recipients of the covered
+work and works based on it.
+
+ A patent license is "discriminatory" if it does not include within
+the scope of its coverage, prohibits the exercise of, or is
+conditioned on the non-exercise of one or more of the rights that are
+specifically granted under this License. You may not convey a covered
+work if you are a party to an arrangement with a third party that is
+in the business of distributing software, under which you make payment
+to the third party based on the extent of your activity of conveying
+the work, and under which the third party grants, to any of the
+parties who would receive the covered work from you, a discriminatory
+patent license (a) in connection with copies of the covered work
+conveyed by you (or copies made from those copies), or (b) primarily
+for and in connection with specific products or compilations that
+contain the covered work, unless you entered into that arrangement,
+or that patent license was granted, prior to 28 March 2007.
+
+ Nothing in this License shall be construed as excluding or limiting
+any implied license or other defenses to infringement that may
+otherwise be available to you under applicable patent law.
+
+ 12. No Surrender of Others' Freedom.
+
+ If 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 convey a
+covered work so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you may
+not convey it at all. For example, if you agree to terms that obligate you
+to collect a royalty for further conveying from those to whom you convey
+the Program, the only way you could satisfy both those terms and this
+License would be to refrain entirely from conveying the Program.
+
+ 13. Use with the GNU Affero General Public License.
+
+ Notwithstanding any other provision of this License, you have
+permission to link or combine any covered work with a work licensed
+under version 3 of the GNU Affero General Public License into a single
+combined work, and to convey the resulting work. The terms of this
+License will continue to apply to the part which is the covered work,
+but the special requirements of the GNU Affero General Public License,
+section 13, concerning interaction through a network will apply to the
+combination as such.
+
+ 14. Revised Versions of this License.
+
+ The Free Software Foundation may publish revised and/or new versions of
+the GNU General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+ Each version is given a distinguishing version number. If the
+Program specifies that a certain numbered version of the GNU General
+Public License "or any later version" applies to it, you have the
+option of following the terms and conditions either of that numbered
+version or of any later version published by the Free Software
+Foundation. If the Program does not specify a version number of the
+GNU General Public License, you may choose any version ever published
+by the Free Software Foundation.
+
+ If the Program specifies that a proxy can decide which future
+versions of the GNU General Public License can be used, that proxy's
+public statement of acceptance of a version permanently authorizes you
+to choose that version for the Program.
+
+ Later license versions may give you additional or different
+permissions. However, no additional obligations are imposed on any
+author or copyright holder as a result of your choosing to follow a
+later version.
+
+ 15. Disclaimer of Warranty.
+
+ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
+APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
+IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. Limitation of Liability.
+
+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGES.
+
+ 17. Interpretation of Sections 15 and 16.
+
+ If the disclaimer of warranty and limitation of liability provided
+above cannot be given local legal effect according to their terms,
+reviewing courts shall apply local law that most closely approximates
+an absolute waiver of all civil liability in connection with the
+Program, unless a warranty or assumption of liability accompanies a
+copy of the Program in return for a fee.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+state the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+Also add information on how to contact you by electronic and paper mail.
+
+ If the program does terminal interaction, make it output a short
+notice like this when it starts in an interactive mode:
+
+ <program> Copyright (C) <year> <name of author>
+ This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, your program's commands
+might be different; for a GUI interface, you would use an "about box".
+
+ You should also get your employer (if you work as a programmer) or school,
+if any, to sign a "copyright disclaimer" for the program, if necessary.
+For more information on this, and how to apply and follow the GNU GPL, see
+<http://www.gnu.org/licenses/>.
+
+ The GNU General Public License does not permit incorporating your program
+into proprietary programs. If your program is a subroutine library, you
+may consider it more useful to permit linking proprietary applications with
+the library. If this is what you want to do, use the GNU Lesser General
+Public License instead of this License. But first, please read
+<http://www.gnu.org/philosophy/why-not-lgpl.html>.
--- /dev/null
+# -*- Makefile -*-
+
+GITVERSION = $(shell "$(top_srcdir)/version.sh" "$(top_srcdir)")
+relnotes = doc/RELEASE_NOTES_3_2_1
+
+bumblebeedconfdir=$(sysconfdir)/bumblebee
+
+AM_CPPFLAGS = ${regular_CPPFLAGS} \
+ -DCONFIG_FILE='"$(bumblebeedconfdir)/bumblebee.conf"' \
+ -DCONF_XORG='"$(bumblebeedconfdir)/xorg.conf.DRIVER"' \
+ -DCONF_XORG_DIR='"$(bumblebeedconfdir)/xorg.conf.d"'
+AM_CFLAGS = ${regular_CFLAGS} \
+ ${x11_CFLAGS} ${libbsd_CFLAGS} ${glib_CFLAGS} \
+ -Wextra -funsigned-char -DGITVERSION='"${GITVERSION}"'
+
+noinst_SCRIPTS = scripts/systemd/bumblebeed.service \
+ scripts/upstart/bumblebeed.conf
+
+if WITH_PIDFILE
+noinst_SCRIPTS += scripts/sysvinit/bumblebeed
+endif
+
+bin_SCRIPTS = scripts/bumblebee-bugreport
+
+xconfddir = $(bumblebeedconfdir)/xorg.conf.d
+xconfd_DATA = conf/xorg.conf.d/10-dummy.conf
+
+CLEANFILES = $(noinst_SCRIPTS) conf/bumblebee.conf $(bin_SCRIPTS)
+EXTRA_DIST = scripts/systemd/bumblebeed.service.in \
+ scripts/upstart/bumblebeed.conf.in \
+ conf/99-bumblebee-nvidia-dev.rules \
+ conf/bumblebee.conf.in \
+ conf/xorg.conf.nvidia \
+ conf/xorg.conf.nouveau \
+ $(xconfd_DATA) \
+ README.markdown \
+ scripts/bash_completion/bumblebee \
+ scripts/bumblebee-bugreport.in \
+ $(relnotes) \
+ version.sh
+# for laziness include all headers found
+EXTRA_DIST += src/*.h src/*/switching.h
+
+if WITH_PIDFILE
+EXTRA_DIST += scripts/sysvinit/bumblebeed.in
+endif
+
+sbin_PROGRAMS = bin/bumblebeed
+bin_PROGRAMS = bin/optirun
+
+bin_optirun_SOURCES = src/module.c src/bbconfig.c src/bblogger.c src/bbrun.c \
+ src/bbsocket.c src/driver.c src/optirun.c src/bbsocketclient.c
+bin_optirun_LDADD = ${glib_LIBS} -lrt
+bin_bumblebeed_SOURCES = src/pci.c src/bbconfig.c src/bblogger.c src/bbrun.c \
+ src/bbsocket.c src/module.c src/bbsecondary.c src/switch/switching.c \
+ src/switch/sw_bbswitch.c src/switch/sw_switcheroo.c \
+ src/driver.c src/bumblebeed.c
+bin_bumblebeed_LDADD = ${x11_LIBS} ${libbsd_LIBS} ${glib_LIBS} -lrt
+
+dist_doc_DATA = $(relnotes) README.markdown
+bumblebeedconf_DATA = conf/bumblebee.conf conf/xorg.conf.nouveau conf/xorg.conf.nvidia
+
+completiondir = $(sysconfdir)/bash_completion.d
+completion_DATA = scripts/bash_completion/bumblebee
+
+if WITH_UDEV_RULES
+udevrulesdir = $(UDEV_RULES_DIR)
+udevrules_DATA = conf/99-bumblebee-nvidia-dev.rules
+endif
+
+do_subst = sed -e 's|[@]GITVERSION[@]|$(GITVERSION)|g' \
+ -e 's|[@]CONF_XDISP[@]|$(CONF_XDISP)|g' \
+ -e 's|[@]CONF_SOCKPATH[@]|$(CONF_SOCKPATH)|g' \
+ -e 's|[@]CONF_GID[@]|$(CONF_GID)|g' \
+ -e 's|[@]CONF_PM_METHOD[@]|$(CONF_PM_METHOD)|g' \
+ -e 's|[@]CONF_KEEPONEXIT[@]|$(CONF_KEEPONEXIT)|g' \
+ -e 's|[@]CONF_FALLBACKSTART[@]|$(CONF_FALLBACKSTART)|g' \
+ -e 's|[@]CONF_BRIDGE[@]|$(CONF_BRIDGE)|g' \
+ -e 's|[@]CONF_VGLCOMPRESS[@]|$(CONF_VGLCOMPRESS)|g' \
+ -e 's|[@]CONF_PRIMUS_LD_PATH[@]|$(CONF_PRIMUS_LD_PATH)|g' \
+ -e 's|[@]CONF_DRIVER[@]|$(CONF_DRIVER)|g' \
+ -e 's|[@]CONF_TURNOFFATEXIT[@]|$(CONF_TURNOFFATEXIT)|g' \
+ -e 's|[@]BINDIR[@]|$(bindir)|g' \
+ -e 's|[@]SBINDIR[@]|$(sbindir)|g' \
+ -e 's|[@]BBCONFDIR[@]|$(bumblebeedconfdir)|g' \
+ -e 's|[@]XCONFDDIR[@]|$(xconfddir)|g' \
+ -e 's|[@]CONF_DRIVER_MODULE_NVIDIA[@]|$(CONF_DRIVER_MODULE_NVIDIA)|g' \
+ -e 's|[@]CONF_LDPATH_NVIDIA[@]|$(CONF_LDPATH_NVIDIA)|g' \
+ -e 's|[@]CONF_MODPATH_NVIDIA[@]|$(CONF_MODPATH_NVIDIA)|g' \
+ -e 's|[@]CONF_PIDFILE[@]|$(CONF_PIDFILE)|g'
+
+conf/bumblebee.conf: $(srcdir)/conf/bumblebee.conf.in
+ mkdir -p conf
+ $(do_subst) < $< > $@
+
+scripts/systemd/bumblebeed.service: $(srcdir)/scripts/systemd/bumblebeed.service.in
+ mkdir -p scripts/systemd
+ $(do_subst) < $< > $@
+
+scripts/bumblebee-bugreport: $(srcdir)/scripts/bumblebee-bugreport.in
+ mkdir -p scripts
+ $(do_subst) < $< > $@
+
+if WITH_PIDFILE
+scripts/sysvinit/bumblebeed: $(srcdir)/scripts/sysvinit/bumblebeed.in
+ mkdir -p scripts/sysvinit
+ $(do_subst) < $< > $@
+endif
+
+scripts/upstart/bumblebeed.conf: $(srcdir)/scripts/upstart/bumblebeed.conf.in
+ mkdir -p scripts/upstart
+ $(do_subst) < $< > $@
+
+if HAVE_HELP2MAN
+man_MANS = bumblebeed.1 optirun.1
+CLEANFILES += $(man_MANS)
+
+optirun.1: bin/optirun $(bin_optirun_SOURCES)
+ $(HELP2MAN) --output=$@ --no-info \
+ --name='run programs on the discrete video card' \
+ bin/optirun
+
+bumblebeed.1: bin/bumblebeed $(bin_bumblebeed_SOURCES)
+ $(HELP2MAN) --output=$@ --no-info \
+ --name='bumblebee daemon' \
+ bin/bumblebeed
+else
+ @echo "Warning: help2man not available, no man page is created."
+endif
+
+dist-hook:
+ echo $(PACKAGE_VERSION) > $(distdir)/VERSION
--- /dev/null
+# Makefile.in generated by automake 1.11.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
+# Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+# -*- Makefile -*-
+
+
+
+VPATH = @srcdir@
+am__make_dryrun = \
+ { \
+ am__dry=no; \
+ case $$MAKEFLAGS in \
+ *\\[\ \ ]*) \
+ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \
+ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+ *) \
+ for am__flg in $$MAKEFLAGS; do \
+ case $$am__flg in \
+ *=*|--*) ;; \
+ *n*) am__dry=yes; break;; \
+ esac; \
+ done;; \
+ esac; \
+ test $$am__dry = yes; \
+ }
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+@WITH_PIDFILE_TRUE@am__append_1 = scripts/sysvinit/bumblebeed
+@WITH_PIDFILE_TRUE@am__append_2 = scripts/sysvinit/bumblebeed.in
+sbin_PROGRAMS = bin/bumblebeed$(EXEEXT)
+bin_PROGRAMS = bin/optirun$(EXEEXT)
+@HAVE_HELP2MAN_TRUE@am__append_3 = $(man_MANS)
+subdir = .
+DIST_COMMON = $(am__configure_deps) $(dist_doc_DATA) \
+ $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+ $(top_srcdir)/configure COPYING build-aux/compile \
+ build-aux/depcomp build-aux/install-sh build-aux/missing
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
+ configure.lineno config.status.lineno
+mkinstalldirs = $(install_sh) -d
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(sbindir)" \
+ "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" \
+ "$(DESTDIR)$(bumblebeedconfdir)" "$(DESTDIR)$(completiondir)" \
+ "$(DESTDIR)$(docdir)" "$(DESTDIR)$(udevrulesdir)" \
+ "$(DESTDIR)$(xconfddir)"
+PROGRAMS = $(bin_PROGRAMS) $(sbin_PROGRAMS)
+am__dirstamp = $(am__leading_dot)dirstamp
+am_bin_bumblebeed_OBJECTS = src/pci.$(OBJEXT) src/bbconfig.$(OBJEXT) \
+ src/bblogger.$(OBJEXT) src/bbrun.$(OBJEXT) \
+ src/bbsocket.$(OBJEXT) src/module.$(OBJEXT) \
+ src/bbsecondary.$(OBJEXT) src/switch/switching.$(OBJEXT) \
+ src/switch/sw_bbswitch.$(OBJEXT) \
+ src/switch/sw_switcheroo.$(OBJEXT) src/driver.$(OBJEXT) \
+ src/bumblebeed.$(OBJEXT)
+bin_bumblebeed_OBJECTS = $(am_bin_bumblebeed_OBJECTS)
+am__DEPENDENCIES_1 =
+bin_bumblebeed_DEPENDENCIES = $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
+am_bin_optirun_OBJECTS = src/module.$(OBJEXT) src/bbconfig.$(OBJEXT) \
+ src/bblogger.$(OBJEXT) src/bbrun.$(OBJEXT) \
+ src/bbsocket.$(OBJEXT) src/driver.$(OBJEXT) \
+ src/optirun.$(OBJEXT) src/bbsocketclient.$(OBJEXT)
+bin_optirun_OBJECTS = $(am_bin_optirun_OBJECTS)
+bin_optirun_DEPENDENCIES = $(am__DEPENDENCIES_1)
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+ if (++n[$$2] == $(am__install_max)) \
+ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+ END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+ test -z "$$files" \
+ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+ $(am__cd) "$$dir" && rm -f $$files; }; \
+ }
+SCRIPTS = $(bin_SCRIPTS) $(noinst_SCRIPTS)
+DEFAULT_INCLUDES = -I.@am__isrc@
+depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(bin_bumblebeed_SOURCES) $(bin_optirun_SOURCES)
+DIST_SOURCES = $(bin_bumblebeed_SOURCES) $(bin_optirun_SOURCES)
+am__can_run_installinfo = \
+ case $$AM_UPDATE_INFO_DIR in \
+ n|no|NO) false;; \
+ *) (install-info --version) >/dev/null 2>&1;; \
+ esac
+man1dir = $(mandir)/man1
+NROFF = nroff
+MANS = $(man_MANS)
+DATA = $(bumblebeedconf_DATA) $(completion_DATA) $(dist_doc_DATA) \
+ $(udevrules_DATA) $(xconfd_DATA)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+distdir = $(PACKAGE)-$(VERSION)
+top_distdir = $(distdir)
+am__remove_distdir = \
+ if test -d "$(distdir)"; then \
+ find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \
+ && rm -rf "$(distdir)" \
+ || { sleep 5 && rm -rf "$(distdir)"; }; \
+ else :; fi
+DIST_ARCHIVES = $(distdir).tar.gz
+GZIP_ENV = --best
+distuninstallcheck_listfiles = find . -type f -print
+am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \
+ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$'
+distcleancheck_listfiles = find . -type f -print
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CONF_BRIDGE = @CONF_BRIDGE@
+CONF_DRIVER = @CONF_DRIVER@
+CONF_DRIVER_MODULE_NVIDIA = @CONF_DRIVER_MODULE_NVIDIA@
+CONF_FALLBACKSTART = @CONF_FALLBACKSTART@
+CONF_GID = @CONF_GID@
+CONF_KEEPONEXIT = @CONF_KEEPONEXIT@
+CONF_LDPATH_NVIDIA = @CONF_LDPATH_NVIDIA@
+CONF_MODPATH_NVIDIA = @CONF_MODPATH_NVIDIA@
+CONF_PIDFILE = @CONF_PIDFILE@
+CONF_PM_METHOD = @CONF_PM_METHOD@
+CONF_PRIMUS_LD_PATH = @CONF_PRIMUS_LD_PATH@
+CONF_SOCKPATH = @CONF_SOCKPATH@
+CONF_TURNOFFATEXIT = @CONF_TURNOFFATEXIT@
+CONF_VGLCOMPRESS = @CONF_VGLCOMPRESS@
+CONF_XDISP = @CONF_XDISP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EXEEXT = @EXEEXT@
+HELP2MAN = @HELP2MAN@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
+PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+UDEV_RULES_DIR = @UDEV_RULES_DIR@
+VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build_alias = @build_alias@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+glib_CFLAGS = @glib_CFLAGS@
+glib_LIBS = @glib_LIBS@
+host_alias = @host_alias@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libbsd_CFLAGS = @libbsd_CFLAGS@
+libbsd_LIBS = @libbsd_LIBS@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+regular_CFLAGS = @regular_CFLAGS@
+regular_CPPFLAGS = @regular_CPPFLAGS@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+x11_CFLAGS = @x11_CFLAGS@
+x11_LIBS = @x11_LIBS@
+GITVERSION = $(shell "$(top_srcdir)/version.sh" "$(top_srcdir)")
+relnotes = doc/RELEASE_NOTES_3_2_1
+bumblebeedconfdir = $(sysconfdir)/bumblebee
+AM_CPPFLAGS = ${regular_CPPFLAGS} \
+ -DCONFIG_FILE='"$(bumblebeedconfdir)/bumblebee.conf"' \
+ -DCONF_XORG='"$(bumblebeedconfdir)/xorg.conf.DRIVER"' \
+ -DCONF_XORG_DIR='"$(bumblebeedconfdir)/xorg.conf.d"'
+
+AM_CFLAGS = ${regular_CFLAGS} \
+ ${x11_CFLAGS} ${libbsd_CFLAGS} ${glib_CFLAGS} \
+ -Wextra -funsigned-char -DGITVERSION='"${GITVERSION}"'
+
+noinst_SCRIPTS = scripts/systemd/bumblebeed.service \
+ scripts/upstart/bumblebeed.conf $(am__append_1)
+bin_SCRIPTS = scripts/bumblebee-bugreport
+xconfddir = $(bumblebeedconfdir)/xorg.conf.d
+xconfd_DATA = conf/xorg.conf.d/10-dummy.conf
+CLEANFILES = $(noinst_SCRIPTS) conf/bumblebee.conf $(bin_SCRIPTS) \
+ $(am__append_3)
+# for laziness include all headers found
+EXTRA_DIST = scripts/systemd/bumblebeed.service.in \
+ scripts/upstart/bumblebeed.conf.in \
+ conf/99-bumblebee-nvidia-dev.rules conf/bumblebee.conf.in \
+ conf/xorg.conf.nvidia conf/xorg.conf.nouveau $(xconfd_DATA) \
+ README.markdown scripts/bash_completion/bumblebee \
+ scripts/bumblebee-bugreport.in $(relnotes) version.sh src/*.h \
+ src/*/switching.h $(am__append_2)
+bin_optirun_SOURCES = src/module.c src/bbconfig.c src/bblogger.c src/bbrun.c \
+ src/bbsocket.c src/driver.c src/optirun.c src/bbsocketclient.c
+
+bin_optirun_LDADD = ${glib_LIBS} -lrt
+bin_bumblebeed_SOURCES = src/pci.c src/bbconfig.c src/bblogger.c src/bbrun.c \
+ src/bbsocket.c src/module.c src/bbsecondary.c src/switch/switching.c \
+ src/switch/sw_bbswitch.c src/switch/sw_switcheroo.c \
+ src/driver.c src/bumblebeed.c
+
+bin_bumblebeed_LDADD = ${x11_LIBS} ${libbsd_LIBS} ${glib_LIBS} -lrt
+dist_doc_DATA = $(relnotes) README.markdown
+bumblebeedconf_DATA = conf/bumblebee.conf conf/xorg.conf.nouveau conf/xorg.conf.nvidia
+completiondir = $(sysconfdir)/bash_completion.d
+completion_DATA = scripts/bash_completion/bumblebee
+@WITH_UDEV_RULES_TRUE@udevrulesdir = $(UDEV_RULES_DIR)
+@WITH_UDEV_RULES_TRUE@udevrules_DATA = conf/99-bumblebee-nvidia-dev.rules
+do_subst = sed -e 's|[@]GITVERSION[@]|$(GITVERSION)|g' \
+ -e 's|[@]CONF_XDISP[@]|$(CONF_XDISP)|g' \
+ -e 's|[@]CONF_SOCKPATH[@]|$(CONF_SOCKPATH)|g' \
+ -e 's|[@]CONF_GID[@]|$(CONF_GID)|g' \
+ -e 's|[@]CONF_PM_METHOD[@]|$(CONF_PM_METHOD)|g' \
+ -e 's|[@]CONF_KEEPONEXIT[@]|$(CONF_KEEPONEXIT)|g' \
+ -e 's|[@]CONF_FALLBACKSTART[@]|$(CONF_FALLBACKSTART)|g' \
+ -e 's|[@]CONF_BRIDGE[@]|$(CONF_BRIDGE)|g' \
+ -e 's|[@]CONF_VGLCOMPRESS[@]|$(CONF_VGLCOMPRESS)|g' \
+ -e 's|[@]CONF_PRIMUS_LD_PATH[@]|$(CONF_PRIMUS_LD_PATH)|g' \
+ -e 's|[@]CONF_DRIVER[@]|$(CONF_DRIVER)|g' \
+ -e 's|[@]CONF_TURNOFFATEXIT[@]|$(CONF_TURNOFFATEXIT)|g' \
+ -e 's|[@]BINDIR[@]|$(bindir)|g' \
+ -e 's|[@]SBINDIR[@]|$(sbindir)|g' \
+ -e 's|[@]BBCONFDIR[@]|$(bumblebeedconfdir)|g' \
+ -e 's|[@]XCONFDDIR[@]|$(xconfddir)|g' \
+ -e 's|[@]CONF_DRIVER_MODULE_NVIDIA[@]|$(CONF_DRIVER_MODULE_NVIDIA)|g' \
+ -e 's|[@]CONF_LDPATH_NVIDIA[@]|$(CONF_LDPATH_NVIDIA)|g' \
+ -e 's|[@]CONF_MODPATH_NVIDIA[@]|$(CONF_MODPATH_NVIDIA)|g' \
+ -e 's|[@]CONF_PIDFILE[@]|$(CONF_PIDFILE)|g'
+
+@HAVE_HELP2MAN_TRUE@man_MANS = bumblebeed.1 optirun.1
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .o .obj
+am--refresh: Makefile
+ @:
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \
+ $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ echo ' $(SHELL) ./config.status'; \
+ $(SHELL) ./config.status;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ $(SHELL) ./config.status --recheck
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ $(am__cd) $(srcdir) && $(AUTOCONF)
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
+$(am__aclocal_m4_deps):
+install-binPROGRAMS: $(bin_PROGRAMS)
+ @$(NORMAL_INSTALL)
+ @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+ if test -n "$$list"; then \
+ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
+ fi; \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed 's/$(EXEEXT)$$//' | \
+ while read p p1; do if test -f $$p; \
+ then echo "$$p"; echo "$$p"; else :; fi; \
+ done | \
+ sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
+ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
+ sed 'N;N;N;s,\n, ,g' | \
+ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
+ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+ if ($$2 == $$4) files[d] = files[d] " " $$1; \
+ else { print "f", $$3 "/" $$4, $$1; } } \
+ END { for (d in files) print "f", d, files[d] }' | \
+ while read type dir files; do \
+ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+ test -z "$$files" || { \
+ echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
+ $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
+ } \
+ ; done
+
+uninstall-binPROGRAMS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+ files=`for p in $$list; do echo "$$p"; done | \
+ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
+ -e 's/$$/$(EXEEXT)/' `; \
+ test -n "$$list" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(bindir)" && rm -f $$files
+
+clean-binPROGRAMS:
+ -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
+install-sbinPROGRAMS: $(sbin_PROGRAMS)
+ @$(NORMAL_INSTALL)
+ @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \
+ if test -n "$$list"; then \
+ echo " $(MKDIR_P) '$(DESTDIR)$(sbindir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(sbindir)" || exit 1; \
+ fi; \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed 's/$(EXEEXT)$$//' | \
+ while read p p1; do if test -f $$p; \
+ then echo "$$p"; echo "$$p"; else :; fi; \
+ done | \
+ sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
+ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
+ sed 'N;N;N;s,\n, ,g' | \
+ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
+ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+ if ($$2 == $$4) files[d] = files[d] " " $$1; \
+ else { print "f", $$3 "/" $$4, $$1; } } \
+ END { for (d in files) print "f", d, files[d] }' | \
+ while read type dir files; do \
+ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+ test -z "$$files" || { \
+ echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(sbindir)$$dir'"; \
+ $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(sbindir)$$dir" || exit $$?; \
+ } \
+ ; done
+
+uninstall-sbinPROGRAMS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \
+ files=`for p in $$list; do echo "$$p"; done | \
+ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
+ -e 's/$$/$(EXEEXT)/' `; \
+ test -n "$$list" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(sbindir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(sbindir)" && rm -f $$files
+
+clean-sbinPROGRAMS:
+ -test -z "$(sbin_PROGRAMS)" || rm -f $(sbin_PROGRAMS)
+src/$(am__dirstamp):
+ @$(MKDIR_P) src
+ @: > src/$(am__dirstamp)
+src/$(DEPDIR)/$(am__dirstamp):
+ @$(MKDIR_P) src/$(DEPDIR)
+ @: > src/$(DEPDIR)/$(am__dirstamp)
+src/pci.$(OBJEXT): src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp)
+src/bbconfig.$(OBJEXT): src/$(am__dirstamp) \
+ src/$(DEPDIR)/$(am__dirstamp)
+src/bblogger.$(OBJEXT): src/$(am__dirstamp) \
+ src/$(DEPDIR)/$(am__dirstamp)
+src/bbrun.$(OBJEXT): src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp)
+src/bbsocket.$(OBJEXT): src/$(am__dirstamp) \
+ src/$(DEPDIR)/$(am__dirstamp)
+src/module.$(OBJEXT): src/$(am__dirstamp) \
+ src/$(DEPDIR)/$(am__dirstamp)
+src/bbsecondary.$(OBJEXT): src/$(am__dirstamp) \
+ src/$(DEPDIR)/$(am__dirstamp)
+src/switch/$(am__dirstamp):
+ @$(MKDIR_P) src/switch
+ @: > src/switch/$(am__dirstamp)
+src/switch/$(DEPDIR)/$(am__dirstamp):
+ @$(MKDIR_P) src/switch/$(DEPDIR)
+ @: > src/switch/$(DEPDIR)/$(am__dirstamp)
+src/switch/switching.$(OBJEXT): src/switch/$(am__dirstamp) \
+ src/switch/$(DEPDIR)/$(am__dirstamp)
+src/switch/sw_bbswitch.$(OBJEXT): src/switch/$(am__dirstamp) \
+ src/switch/$(DEPDIR)/$(am__dirstamp)
+src/switch/sw_switcheroo.$(OBJEXT): src/switch/$(am__dirstamp) \
+ src/switch/$(DEPDIR)/$(am__dirstamp)
+src/driver.$(OBJEXT): src/$(am__dirstamp) \
+ src/$(DEPDIR)/$(am__dirstamp)
+src/bumblebeed.$(OBJEXT): src/$(am__dirstamp) \
+ src/$(DEPDIR)/$(am__dirstamp)
+bin/$(am__dirstamp):
+ @$(MKDIR_P) bin
+ @: > bin/$(am__dirstamp)
+bin/bumblebeed$(EXEEXT): $(bin_bumblebeed_OBJECTS) $(bin_bumblebeed_DEPENDENCIES) $(EXTRA_bin_bumblebeed_DEPENDENCIES) bin/$(am__dirstamp)
+ @rm -f bin/bumblebeed$(EXEEXT)
+ $(LINK) $(bin_bumblebeed_OBJECTS) $(bin_bumblebeed_LDADD) $(LIBS)
+src/optirun.$(OBJEXT): src/$(am__dirstamp) \
+ src/$(DEPDIR)/$(am__dirstamp)
+src/bbsocketclient.$(OBJEXT): src/$(am__dirstamp) \
+ src/$(DEPDIR)/$(am__dirstamp)
+bin/optirun$(EXEEXT): $(bin_optirun_OBJECTS) $(bin_optirun_DEPENDENCIES) $(EXTRA_bin_optirun_DEPENDENCIES) bin/$(am__dirstamp)
+ @rm -f bin/optirun$(EXEEXT)
+ $(LINK) $(bin_optirun_OBJECTS) $(bin_optirun_LDADD) $(LIBS)
+install-binSCRIPTS: $(bin_SCRIPTS)
+ @$(NORMAL_INSTALL)
+ @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || list=; \
+ if test -n "$$list"; then \
+ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
+ fi; \
+ for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \
+ done | \
+ sed -e 'p;s,.*/,,;n' \
+ -e 'h;s|.*|.|' \
+ -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \
+ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \
+ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+ if ($$2 == $$4) { files[d] = files[d] " " $$1; \
+ if (++n[d] == $(am__install_max)) { \
+ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \
+ else { print "f", d "/" $$4, $$1 } } \
+ END { for (d in files) print "f", d, files[d] }' | \
+ while read type dir files; do \
+ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+ test -z "$$files" || { \
+ echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(bindir)$$dir'"; \
+ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
+ } \
+ ; done
+
+uninstall-binSCRIPTS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || exit 0; \
+ files=`for p in $$list; do echo "$$p"; done | \
+ sed -e 's,.*/,,;$(transform)'`; \
+ dir='$(DESTDIR)$(bindir)'; $(am__uninstall_files_from_dir)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+ -rm -f src/bbconfig.$(OBJEXT)
+ -rm -f src/bblogger.$(OBJEXT)
+ -rm -f src/bbrun.$(OBJEXT)
+ -rm -f src/bbsecondary.$(OBJEXT)
+ -rm -f src/bbsocket.$(OBJEXT)
+ -rm -f src/bbsocketclient.$(OBJEXT)
+ -rm -f src/bumblebeed.$(OBJEXT)
+ -rm -f src/driver.$(OBJEXT)
+ -rm -f src/module.$(OBJEXT)
+ -rm -f src/optirun.$(OBJEXT)
+ -rm -f src/pci.$(OBJEXT)
+ -rm -f src/switch/sw_bbswitch.$(OBJEXT)
+ -rm -f src/switch/sw_switcheroo.$(OBJEXT)
+ -rm -f src/switch/switching.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bbconfig.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bblogger.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bbrun.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bbsecondary.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bbsocket.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bbsocketclient.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bumblebeed.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/driver.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/module.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/optirun.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/pci.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/switch/$(DEPDIR)/sw_bbswitch.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/switch/$(DEPDIR)/sw_switcheroo.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/switch/$(DEPDIR)/switching.Po@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
+@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(COMPILE) -c -o $@ $<
+
+.c.obj:
+@am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
+@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+install-man1: $(man_MANS)
+ @$(NORMAL_INSTALL)
+ @list1=''; \
+ list2='$(man_MANS)'; \
+ test -n "$(man1dir)" \
+ && test -n "`echo $$list1$$list2`" \
+ || exit 0; \
+ echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \
+ { for i in $$list1; do echo "$$i"; done; \
+ if test -n "$$list2"; then \
+ for i in $$list2; do echo "$$i"; done \
+ | sed -n '/\.1[a-z]*$$/p'; \
+ fi; \
+ } | while read p; do \
+ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
+ echo "$$d$$p"; echo "$$p"; \
+ done | \
+ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
+ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \
+ sed 'N;N;s,\n, ,g' | { \
+ list=; while read file base inst; do \
+ if test "$$base" = "$$inst"; then list="$$list $$file"; else \
+ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \
+ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \
+ fi; \
+ done; \
+ for i in $$list; do echo "$$i"; done | $(am__base_list) | \
+ while read files; do \
+ test -z "$$files" || { \
+ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \
+ $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \
+ done; }
+
+uninstall-man1:
+ @$(NORMAL_UNINSTALL)
+ @list=''; test -n "$(man1dir)" || exit 0; \
+ files=`{ for i in $$list; do echo "$$i"; done; \
+ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \
+ sed -n '/\.1[a-z]*$$/p'; \
+ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
+ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
+ dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir)
+install-bumblebeedconfDATA: $(bumblebeedconf_DATA)
+ @$(NORMAL_INSTALL)
+ @list='$(bumblebeedconf_DATA)'; test -n "$(bumblebeedconfdir)" || list=; \
+ if test -n "$$list"; then \
+ echo " $(MKDIR_P) '$(DESTDIR)$(bumblebeedconfdir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(bumblebeedconfdir)" || exit 1; \
+ fi; \
+ for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ echo "$$d$$p"; \
+ done | $(am__base_list) | \
+ while read files; do \
+ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(bumblebeedconfdir)'"; \
+ $(INSTALL_DATA) $$files "$(DESTDIR)$(bumblebeedconfdir)" || exit $$?; \
+ done
+
+uninstall-bumblebeedconfDATA:
+ @$(NORMAL_UNINSTALL)
+ @list='$(bumblebeedconf_DATA)'; test -n "$(bumblebeedconfdir)" || list=; \
+ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+ dir='$(DESTDIR)$(bumblebeedconfdir)'; $(am__uninstall_files_from_dir)
+install-completionDATA: $(completion_DATA)
+ @$(NORMAL_INSTALL)
+ @list='$(completion_DATA)'; test -n "$(completiondir)" || list=; \
+ if test -n "$$list"; then \
+ echo " $(MKDIR_P) '$(DESTDIR)$(completiondir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(completiondir)" || exit 1; \
+ fi; \
+ for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ echo "$$d$$p"; \
+ done | $(am__base_list) | \
+ while read files; do \
+ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(completiondir)'"; \
+ $(INSTALL_DATA) $$files "$(DESTDIR)$(completiondir)" || exit $$?; \
+ done
+
+uninstall-completionDATA:
+ @$(NORMAL_UNINSTALL)
+ @list='$(completion_DATA)'; test -n "$(completiondir)" || list=; \
+ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+ dir='$(DESTDIR)$(completiondir)'; $(am__uninstall_files_from_dir)
+install-dist_docDATA: $(dist_doc_DATA)
+ @$(NORMAL_INSTALL)
+ @list='$(dist_doc_DATA)'; test -n "$(docdir)" || list=; \
+ if test -n "$$list"; then \
+ echo " $(MKDIR_P) '$(DESTDIR)$(docdir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(docdir)" || exit 1; \
+ fi; \
+ for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ echo "$$d$$p"; \
+ done | $(am__base_list) | \
+ while read files; do \
+ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(docdir)'"; \
+ $(INSTALL_DATA) $$files "$(DESTDIR)$(docdir)" || exit $$?; \
+ done
+
+uninstall-dist_docDATA:
+ @$(NORMAL_UNINSTALL)
+ @list='$(dist_doc_DATA)'; test -n "$(docdir)" || list=; \
+ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+ dir='$(DESTDIR)$(docdir)'; $(am__uninstall_files_from_dir)
+install-udevrulesDATA: $(udevrules_DATA)
+ @$(NORMAL_INSTALL)
+ @list='$(udevrules_DATA)'; test -n "$(udevrulesdir)" || list=; \
+ if test -n "$$list"; then \
+ echo " $(MKDIR_P) '$(DESTDIR)$(udevrulesdir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(udevrulesdir)" || exit 1; \
+ fi; \
+ for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ echo "$$d$$p"; \
+ done | $(am__base_list) | \
+ while read files; do \
+ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(udevrulesdir)'"; \
+ $(INSTALL_DATA) $$files "$(DESTDIR)$(udevrulesdir)" || exit $$?; \
+ done
+
+uninstall-udevrulesDATA:
+ @$(NORMAL_UNINSTALL)
+ @list='$(udevrules_DATA)'; test -n "$(udevrulesdir)" || list=; \
+ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+ dir='$(DESTDIR)$(udevrulesdir)'; $(am__uninstall_files_from_dir)
+install-xconfdDATA: $(xconfd_DATA)
+ @$(NORMAL_INSTALL)
+ @list='$(xconfd_DATA)'; test -n "$(xconfddir)" || list=; \
+ if test -n "$$list"; then \
+ echo " $(MKDIR_P) '$(DESTDIR)$(xconfddir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(xconfddir)" || exit 1; \
+ fi; \
+ for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ echo "$$d$$p"; \
+ done | $(am__base_list) | \
+ while read files; do \
+ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(xconfddir)'"; \
+ $(INSTALL_DATA) $$files "$(DESTDIR)$(xconfddir)" || exit $$?; \
+ done
+
+uninstall-xconfdDATA:
+ @$(NORMAL_UNINSTALL)
+ @list='$(xconfd_DATA)'; test -n "$(xconfddir)" || list=; \
+ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+ dir='$(DESTDIR)$(xconfddir)'; $(am__uninstall_files_from_dir)
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ set x; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ shift; \
+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ if test $$# -gt 0; then \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ "$$@" $$unique; \
+ else \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$unique; \
+ fi; \
+ fi
+ctags: CTAGS
+CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ test -z "$(CTAGS_ARGS)$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ @list='$(MANS)'; if test -n "$$list"; then \
+ list=`for p in $$list; do \
+ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
+ if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \
+ if test -n "$$list" && \
+ grep 'ab help2man is required to generate this page' $$list >/dev/null; then \
+ echo "error: found man pages containing the \`missing help2man' replacement text:" >&2; \
+ grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/ /' >&2; \
+ echo " to fix them, install help2man, remove and regenerate the man pages;" >&2; \
+ echo " typically \`make maintainer-clean' will remove them" >&2; \
+ exit 1; \
+ else :; fi; \
+ else :; fi
+ $(am__remove_distdir)
+ test -d "$(distdir)" || mkdir "$(distdir)"
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d "$(distdir)/$$file"; then \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+ else \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
+ || exit 1; \
+ fi; \
+ done
+ $(MAKE) $(AM_MAKEFLAGS) \
+ top_distdir="$(top_distdir)" distdir="$(distdir)" \
+ dist-hook
+ -test -n "$(am__skip_mode_fix)" \
+ || find "$(distdir)" -type d ! -perm -755 \
+ -exec chmod u+rwx,go+rx {} \; -o \
+ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
+ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
+ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
+ || chmod -R a+r "$(distdir)"
+dist-gzip: distdir
+ tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
+ $(am__remove_distdir)
+
+dist-bzip2: distdir
+ tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2
+ $(am__remove_distdir)
+
+dist-lzip: distdir
+ tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz
+ $(am__remove_distdir)
+
+dist-lzma: distdir
+ tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma
+ $(am__remove_distdir)
+
+dist-xz: distdir
+ tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz
+ $(am__remove_distdir)
+
+dist-tarZ: distdir
+ tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
+ $(am__remove_distdir)
+
+dist-shar: distdir
+ shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
+ $(am__remove_distdir)
+
+dist-zip: distdir
+ -rm -f $(distdir).zip
+ zip -rq $(distdir).zip $(distdir)
+ $(am__remove_distdir)
+
+dist dist-all: distdir
+ tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
+ $(am__remove_distdir)
+
+# This target untars the dist file and tries a VPATH configuration. Then
+# it guarantees that the distribution is self-contained by making another
+# tarfile.
+distcheck: dist
+ case '$(DIST_ARCHIVES)' in \
+ *.tar.gz*) \
+ GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
+ *.tar.bz2*) \
+ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
+ *.tar.lzma*) \
+ lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\
+ *.tar.lz*) \
+ lzip -dc $(distdir).tar.lz | $(am__untar) ;;\
+ *.tar.xz*) \
+ xz -dc $(distdir).tar.xz | $(am__untar) ;;\
+ *.tar.Z*) \
+ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
+ *.shar.gz*) \
+ GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\
+ *.zip*) \
+ unzip $(distdir).zip ;;\
+ esac
+ chmod -R a-w $(distdir); chmod u+w $(distdir)
+ mkdir $(distdir)/_build
+ mkdir $(distdir)/_inst
+ chmod a-w $(distdir)
+ test -d $(distdir)/_build || exit 0; \
+ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
+ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
+ && am__cwd=`pwd` \
+ && $(am__cd) $(distdir)/_build \
+ && ../configure --srcdir=.. --prefix="$$dc_install_base" \
+ $(AM_DISTCHECK_CONFIGURE_FLAGS) \
+ $(DISTCHECK_CONFIGURE_FLAGS) \
+ && $(MAKE) $(AM_MAKEFLAGS) \
+ && $(MAKE) $(AM_MAKEFLAGS) dvi \
+ && $(MAKE) $(AM_MAKEFLAGS) check \
+ && $(MAKE) $(AM_MAKEFLAGS) install \
+ && $(MAKE) $(AM_MAKEFLAGS) installcheck \
+ && $(MAKE) $(AM_MAKEFLAGS) uninstall \
+ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
+ distuninstallcheck \
+ && chmod -R a-w "$$dc_install_base" \
+ && ({ \
+ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \
+ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
+ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
+ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
+ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
+ } || { rm -rf "$$dc_destdir"; exit 1; }) \
+ && rm -rf "$$dc_destdir" \
+ && $(MAKE) $(AM_MAKEFLAGS) dist \
+ && rm -rf $(DIST_ARCHIVES) \
+ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \
+ && cd "$$am__cwd" \
+ || exit 1
+ $(am__remove_distdir)
+ @(echo "$(distdir) archives ready for distribution: "; \
+ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
+ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
+distuninstallcheck:
+ @test -n '$(distuninstallcheck_dir)' || { \
+ echo 'ERROR: trying to run $@ with an empty' \
+ '$$(distuninstallcheck_dir)' >&2; \
+ exit 1; \
+ }; \
+ $(am__cd) '$(distuninstallcheck_dir)' || { \
+ echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \
+ exit 1; \
+ }; \
+ test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \
+ || { echo "ERROR: files left after uninstall:" ; \
+ if test -n "$(DESTDIR)"; then \
+ echo " (check DESTDIR support)"; \
+ fi ; \
+ $(distuninstallcheck_listfiles) ; \
+ exit 1; } >&2
+distcleancheck: distclean
+ @if test '$(srcdir)' = . ; then \
+ echo "ERROR: distcleancheck can only run from a VPATH build" ; \
+ exit 1 ; \
+ fi
+ @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
+ || { echo "ERROR: files left in build directory after distclean:" ; \
+ $(distcleancheck_listfiles) ; \
+ exit 1; } >&2
+check-am: all-am
+check: check-am
+all-am: Makefile $(PROGRAMS) $(SCRIPTS) $(MANS) $(DATA)
+installdirs:
+ for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(bumblebeedconfdir)" "$(DESTDIR)$(completiondir)" "$(DESTDIR)$(docdir)" "$(DESTDIR)$(udevrulesdir)" "$(DESTDIR)$(xconfddir)"; do \
+ test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+ done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ if test -z '$(STRIP)'; then \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ install; \
+ else \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+ fi
+mostlyclean-generic:
+
+clean-generic:
+ -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+ -rm -f bin/$(am__dirstamp)
+ -rm -f src/$(DEPDIR)/$(am__dirstamp)
+ -rm -f src/$(am__dirstamp)
+ -rm -f src/switch/$(DEPDIR)/$(am__dirstamp)
+ -rm -f src/switch/$(am__dirstamp)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-binPROGRAMS clean-generic clean-sbinPROGRAMS \
+ mostlyclean-am
+
+distclean: distclean-am
+ -rm -f $(am__CONFIG_DISTCLEAN_FILES)
+ -rm -rf src/$(DEPDIR) src/switch/$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am: install-bumblebeedconfDATA install-completionDATA \
+ install-dist_docDATA install-man install-udevrulesDATA \
+ install-xconfdDATA
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-binPROGRAMS install-binSCRIPTS \
+ install-sbinPROGRAMS
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man: install-man1
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -f $(am__CONFIG_DISTCLEAN_FILES)
+ -rm -rf $(top_srcdir)/autom4te.cache
+ -rm -rf src/$(DEPDIR) src/switch/$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-binPROGRAMS uninstall-binSCRIPTS \
+ uninstall-bumblebeedconfDATA uninstall-completionDATA \
+ uninstall-dist_docDATA uninstall-man uninstall-sbinPROGRAMS \
+ uninstall-udevrulesDATA uninstall-xconfdDATA
+
+uninstall-man: uninstall-man1
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am am--refresh check check-am clean \
+ clean-binPROGRAMS clean-generic clean-sbinPROGRAMS ctags dist \
+ dist-all dist-bzip2 dist-gzip dist-hook dist-lzip dist-lzma \
+ dist-shar dist-tarZ dist-xz dist-zip distcheck distclean \
+ distclean-compile distclean-generic distclean-tags \
+ distcleancheck distdir distuninstallcheck dvi dvi-am html \
+ html-am info info-am install install-am install-binPROGRAMS \
+ install-binSCRIPTS install-bumblebeedconfDATA \
+ install-completionDATA install-data install-data-am \
+ install-dist_docDATA install-dvi install-dvi-am install-exec \
+ install-exec-am install-html install-html-am install-info \
+ install-info-am install-man install-man1 install-pdf \
+ install-pdf-am install-ps install-ps-am install-sbinPROGRAMS \
+ install-strip install-udevrulesDATA install-xconfdDATA \
+ installcheck installcheck-am installdirs maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-compile \
+ mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \
+ uninstall-am uninstall-binPROGRAMS uninstall-binSCRIPTS \
+ uninstall-bumblebeedconfDATA uninstall-completionDATA \
+ uninstall-dist_docDATA uninstall-man uninstall-man1 \
+ uninstall-sbinPROGRAMS uninstall-udevrulesDATA \
+ uninstall-xconfdDATA
+
+
+conf/bumblebee.conf: $(srcdir)/conf/bumblebee.conf.in
+ mkdir -p conf
+ $(do_subst) < $< > $@
+
+scripts/systemd/bumblebeed.service: $(srcdir)/scripts/systemd/bumblebeed.service.in
+ mkdir -p scripts/systemd
+ $(do_subst) < $< > $@
+
+scripts/bumblebee-bugreport: $(srcdir)/scripts/bumblebee-bugreport.in
+ mkdir -p scripts
+ $(do_subst) < $< > $@
+
+@WITH_PIDFILE_TRUE@scripts/sysvinit/bumblebeed: $(srcdir)/scripts/sysvinit/bumblebeed.in
+@WITH_PIDFILE_TRUE@ mkdir -p scripts/sysvinit
+@WITH_PIDFILE_TRUE@ $(do_subst) < $< > $@
+
+scripts/upstart/bumblebeed.conf: $(srcdir)/scripts/upstart/bumblebeed.conf.in
+ mkdir -p scripts/upstart
+ $(do_subst) < $< > $@
+
+@HAVE_HELP2MAN_TRUE@optirun.1: bin/optirun $(bin_optirun_SOURCES)
+@HAVE_HELP2MAN_TRUE@ $(HELP2MAN) --output=$@ --no-info \
+@HAVE_HELP2MAN_TRUE@ --name='run programs on the discrete video card' \
+@HAVE_HELP2MAN_TRUE@ bin/optirun
+
+@HAVE_HELP2MAN_TRUE@bumblebeed.1: bin/bumblebeed $(bin_bumblebeed_SOURCES)
+@HAVE_HELP2MAN_TRUE@ $(HELP2MAN) --output=$@ --no-info \
+@HAVE_HELP2MAN_TRUE@ --name='bumblebee daemon' \
+@HAVE_HELP2MAN_TRUE@ bin/bumblebeed
+@HAVE_HELP2MAN_FALSE@ @echo "Warning: help2man not available, no man page is created."
+
+dist-hook:
+ echo $(PACKAGE_VERSION) > $(distdir)/VERSION
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
--- /dev/null
+Bumblebee Daemon
+=================
+
+Bumblebee daemon is a rewrite of the original
+[Bumblebee](https://github.com/Bumblebee-Project/Bumblebee-old)
+service, providing an elegant and stable means of managing Optimus
+hybrid graphics chipsets. A primary goal of this project is to not only
+enable use of the discrete GPU for rendering, but also to enable
+smart power management of the dGPU when it's not in use.
+
+Build Requirements
+-------------------
+
+Source tarballs can be downloaded from
+https://github.com/Bumblebee-Project/Bumblebee/downloads
+
+The following packages are dependencies for the build process:
+
+- pkg-config
+- glib-2.0 and development headers
+- libx11 and development headers
+- libbsd and development headers (if pidfile support is enabled, default yes)
+- help2man (optional, it is needed for building manual pages)
+
+If you are building from git, you will also need:
+
+- autotools (2.68+ recommended)
+
+Runtime dependencies
+--------------------
+
+If you want to use `optirun` for running applications with the discrete nVidia
+card, you will also need:
+
+- At least one back-end for `optirun`:
+ - [virtualgl](http://virtualgl.org/)
+ - [primus](https://github.com/amonakov/primus) (beta)
+- Driver for nvidia graphics card: [nouveau](http://nouveau.freedesktop.org/)
+ or the proprietary nvidia driver. Don't install it directly from nvidia.com
+ as it will break 3D capabilities on the Intel graphics card and therefore
+ affect the display of frames from the nvidia card.
+
+If you want to make use of Power Management, you will need:
+
+- [bbswitch](https://github.com/Bumblebee-Project/bbswitch)
+- If you're brave and want to try the `switcheroo` method, install at least the
+ [optimus patch](http://lekensteyn.nl/files/nouveau-switcheroo-optimus.patch)
+ (merged in Linux 3.3). Note that suspend is not yet supported by this
+ method.
+
+Building
+---------
+
+If you are building from git, you first need to run `autoreconf -fi` to generate
+the `configure` script.
+
+Next, run the configure script to check for dependencies and populate the
+`Makefile`:
+
+ ./configure
+
+To set the default driver to `nvidia` and adjust the library and module paths
+for it, use `./configure` like:
+
+ ./configure CONF_DRIVER=nvidia CONF_DRIVER_MODULE_NVIDIA=nvidia-current \
+ CONF_LDPATH_NVIDIA=/usr/lib/nvidia-current:/usr/lib32/nvidia-current \
+ CONF_MODPATH_NVIDIA=/usr/lib/nvidia-current/xorg,/usr/lib/xorg/modules
+
+For all available options, run:
+
+ ./configure --help
+
+After configuring, you can build the binaries with:
+
+ make
+
+Installing System-wide and Packaging
+-------------------------------------
+
+You can build the binaries and set the system wide paths at configure time
+
+ ./configure --prefix=/usr --sysconfdir=/etc
+ make
+
+After building the binaries and bash completion script, it can be installed
+together with an udev rule (unless `--without-udev-rules` was passed) using
+`make`:
+
+ sudo make install
+
+For packagers you need to add DESTDIR=$pkgdir
+
+ make install DESTDIR=$pkgdir
+
+Example initscripts are available in the `scripts/` directory. Currently,
+Upstart, systemd and Sys V initscripts are available.
+
+Usage
+------
+
+The first time you install Bumblebee, the `bumblebee` group has to be created.
+Users who are allowed to use Bumblebee need to be added to the group:
+
+ sudo groupadd bumblebee
+ sudo gpasswd -a $USER bumblebee
+
+To run Bumblebee after installing it system-wide, run:
+
+ sudo bumblebeed --daemon
+ optirun -- <application>
+
+For more information, try `--help` on either of the two binaries.
+
+Interesting Links
+------
+- Facebook: http://www.bumblebee-project.org/facebook
+- Twitter: http://www.bumblebee-project.org/twitter
+- Google Plus: http://www.bumblebee-project.org/g+
+- Ubuntu wiki: https://wiki.ubuntu.com/Bumblebee
+- Arch wiki: https://wiki.archlinux.org/index.php/Bumblebee
+- Mandriva wiki: http://wiki.mandriva.com/en/Bumblebee
+- Debian wiki: http://wiki.debian.org/Bumblebee
--- /dev/null
+# generated automatically by aclocal 1.11.6 -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+# 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation,
+# Inc.
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+m4_ifndef([AC_AUTOCONF_VERSION],
+ [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
+m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],,
+[m4_warning([this file was generated for autoconf 2.69.
+You have another version of autoconf. It may work, but is not guaranteed to.
+If you have problems, you may need to regenerate the build system entirely.
+To do so, use the procedure documented by the package, typically `autoreconf'.])])
+
+# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
+# serial 1 (pkg-config-0.24)
+#
+# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# PKG_PROG_PKG_CONFIG([MIN-VERSION])
+# ----------------------------------
+AC_DEFUN([PKG_PROG_PKG_CONFIG],
+[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
+m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
+m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
+AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
+AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
+AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
+
+if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
+ AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
+fi
+if test -n "$PKG_CONFIG"; then
+ _pkg_min_version=m4_default([$1], [0.9.0])
+ AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
+ if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_RESULT([no])
+ PKG_CONFIG=""
+ fi
+fi[]dnl
+])# PKG_PROG_PKG_CONFIG
+
+# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+#
+# Check to see whether a particular set of modules exists. Similar
+# to PKG_CHECK_MODULES(), but does not set variables or print errors.
+#
+# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
+# only at the first occurence in configure.ac, so if the first place
+# it's called might be skipped (such as if it is within an "if", you
+# have to call PKG_CHECK_EXISTS manually
+# --------------------------------------------------------------
+AC_DEFUN([PKG_CHECK_EXISTS],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
+if test -n "$PKG_CONFIG" && \
+ AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
+ m4_default([$2], [:])
+m4_ifvaln([$3], [else
+ $3])dnl
+fi])
+
+# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
+# ---------------------------------------------
+m4_define([_PKG_CONFIG],
+[if test -n "$$1"; then
+ pkg_cv_[]$1="$$1"
+ elif test -n "$PKG_CONFIG"; then
+ PKG_CHECK_EXISTS([$3],
+ [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
+ test "x$?" != "x0" && pkg_failed=yes ],
+ [pkg_failed=yes])
+ else
+ pkg_failed=untried
+fi[]dnl
+])# _PKG_CONFIG
+
+# _PKG_SHORT_ERRORS_SUPPORTED
+# -----------------------------
+AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+ _pkg_short_errors_supported=yes
+else
+ _pkg_short_errors_supported=no
+fi[]dnl
+])# _PKG_SHORT_ERRORS_SUPPORTED
+
+
+# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
+# [ACTION-IF-NOT-FOUND])
+#
+#
+# Note that if there is a possibility the first call to
+# PKG_CHECK_MODULES might not happen, you should be sure to include an
+# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
+#
+#
+# --------------------------------------------------------------
+AC_DEFUN([PKG_CHECK_MODULES],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
+AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
+AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
+
+pkg_failed=no
+AC_MSG_CHECKING([for $1])
+
+_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
+_PKG_CONFIG([$1][_LIBS], [libs], [$2])
+
+m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
+and $1[]_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.])
+
+if test $pkg_failed = yes; then
+ AC_MSG_RESULT([no])
+ _PKG_SHORT_ERRORS_SUPPORTED
+ if test $_pkg_short_errors_supported = yes; then
+ $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
+ else
+ $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
+ fi
+ # Put the nasty error message in config.log where it belongs
+ echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
+
+ m4_default([$4], [AC_MSG_ERROR(
+[Package requirements ($2) were not met:
+
+$$1_PKG_ERRORS
+
+Consider adjusting the PKG_CONFIG_PATH environment variable if you
+installed software in a non-standard prefix.
+
+_PKG_TEXT])[]dnl
+ ])
+elif test $pkg_failed = untried; then
+ AC_MSG_RESULT([no])
+ m4_default([$4], [AC_MSG_FAILURE(
+[The pkg-config script could not be found or is too old. Make sure it
+is in your PATH or set the PKG_CONFIG environment variable to the full
+path to pkg-config.
+
+_PKG_TEXT
+
+To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
+ ])
+else
+ $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
+ $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
+ AC_MSG_RESULT([yes])
+ $3
+fi[]dnl
+])# PKG_CHECK_MODULES
+
+# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008, 2011 Free Software
+# Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 1
+
+# AM_AUTOMAKE_VERSION(VERSION)
+# ----------------------------
+# Automake X.Y traces this macro to ensure aclocal.m4 has been
+# generated from the m4 files accompanying Automake X.Y.
+# (This private macro should not be called outside this file.)
+AC_DEFUN([AM_AUTOMAKE_VERSION],
+[am__api_version='1.11'
+dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
+dnl require some minimum version. Point them to the right macro.
+m4_if([$1], [1.11.6], [],
+ [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
+])
+
+# _AM_AUTOCONF_VERSION(VERSION)
+# -----------------------------
+# aclocal traces this macro to find the Autoconf version.
+# This is a private macro too. Using m4_define simplifies
+# the logic in aclocal, which can simply ignore this definition.
+m4_define([_AM_AUTOCONF_VERSION], [])
+
+# AM_SET_CURRENT_AUTOMAKE_VERSION
+# -------------------------------
+# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
+# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
+AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
+[AM_AUTOMAKE_VERSION([1.11.6])dnl
+m4_ifndef([AC_AUTOCONF_VERSION],
+ [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
+_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
+
+# AM_AUX_DIR_EXPAND -*- Autoconf -*-
+
+# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 1
+
+# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
+# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to
+# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
+#
+# Of course, Automake must honor this variable whenever it calls a
+# tool from the auxiliary directory. The problem is that $srcdir (and
+# therefore $ac_aux_dir as well) can be either absolute or relative,
+# depending on how configure is run. This is pretty annoying, since
+# it makes $ac_aux_dir quite unusable in subdirectories: in the top
+# source directory, any form will work fine, but in subdirectories a
+# relative path needs to be adjusted first.
+#
+# $ac_aux_dir/missing
+# fails when called from a subdirectory if $ac_aux_dir is relative
+# $top_srcdir/$ac_aux_dir/missing
+# fails if $ac_aux_dir is absolute,
+# fails when called from a subdirectory in a VPATH build with
+# a relative $ac_aux_dir
+#
+# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
+# are both prefixed by $srcdir. In an in-source build this is usually
+# harmless because $srcdir is `.', but things will broke when you
+# start a VPATH build or use an absolute $srcdir.
+#
+# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
+# iff we strip the leading $srcdir from $ac_aux_dir. That would be:
+# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
+# and then we would define $MISSING as
+# MISSING="\${SHELL} $am_aux_dir/missing"
+# This will work as long as MISSING is not called from configure, because
+# unfortunately $(top_srcdir) has no meaning in configure.
+# However there are other variables, like CC, which are often used in
+# configure, and could therefore not use this "fixed" $ac_aux_dir.
+#
+# Another solution, used here, is to always expand $ac_aux_dir to an
+# absolute PATH. The drawback is that using absolute paths prevent a
+# configured tree to be moved without reconfiguration.
+
+AC_DEFUN([AM_AUX_DIR_EXPAND],
+[dnl Rely on autoconf to set up CDPATH properly.
+AC_PREREQ([2.50])dnl
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
+])
+
+# AM_CONDITIONAL -*- Autoconf -*-
+
+# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 9
+
+# AM_CONDITIONAL(NAME, SHELL-CONDITION)
+# -------------------------------------
+# Define a conditional.
+AC_DEFUN([AM_CONDITIONAL],
+[AC_PREREQ(2.52)dnl
+ ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
+ [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
+AC_SUBST([$1_TRUE])dnl
+AC_SUBST([$1_FALSE])dnl
+_AM_SUBST_NOTMAKE([$1_TRUE])dnl
+_AM_SUBST_NOTMAKE([$1_FALSE])dnl
+m4_define([_AM_COND_VALUE_$1], [$2])dnl
+if $2; then
+ $1_TRUE=
+ $1_FALSE='#'
+else
+ $1_TRUE='#'
+ $1_FALSE=
+fi
+AC_CONFIG_COMMANDS_PRE(
+[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
+ AC_MSG_ERROR([[conditional "$1" was never defined.
+Usually this means the macro was only invoked conditionally.]])
+fi])])
+
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009,
+# 2010, 2011 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 12
+
+# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
+# written in clear, in which case automake, when reading aclocal.m4,
+# will think it sees a *use*, and therefore will trigger all it's
+# C support machinery. Also note that it means that autoscan, seeing
+# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
+
+
+# _AM_DEPENDENCIES(NAME)
+# ----------------------
+# See how the compiler implements dependency checking.
+# NAME is "CC", "CXX", "GCJ", or "OBJC".
+# We try a few techniques and use that to set a single cache variable.
+#
+# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
+# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
+# dependency, and given that the user is not expected to run this macro,
+# just rely on AC_PROG_CC.
+AC_DEFUN([_AM_DEPENDENCIES],
+[AC_REQUIRE([AM_SET_DEPDIR])dnl
+AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
+AC_REQUIRE([AM_MAKE_INCLUDE])dnl
+AC_REQUIRE([AM_DEP_TRACK])dnl
+
+ifelse([$1], CC, [depcc="$CC" am_compiler_list=],
+ [$1], CXX, [depcc="$CXX" am_compiler_list=],
+ [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
+ [$1], UPC, [depcc="$UPC" am_compiler_list=],
+ [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
+ [depcc="$$1" am_compiler_list=])
+
+AC_CACHE_CHECK([dependency style of $depcc],
+ [am_cv_$1_dependencies_compiler_type],
+[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+ # We make a subdir and do the tests there. Otherwise we can end up
+ # making bogus files that we don't know about and never remove. For
+ # instance it was reported that on HP-UX the gcc test will end up
+ # making a dummy file named `D' -- because `-MD' means `put the output
+ # in D'.
+ rm -rf conftest.dir
+ mkdir conftest.dir
+ # Copy depcomp to subdir because otherwise we won't find it if we're
+ # using a relative directory.
+ cp "$am_depcomp" conftest.dir
+ cd conftest.dir
+ # We will build objects and dependencies in a subdirectory because
+ # it helps to detect inapplicable dependency modes. For instance
+ # both Tru64's cc and ICC support -MD to output dependencies as a
+ # side effect of compilation, but ICC will put the dependencies in
+ # the current directory while Tru64 will put them in the object
+ # directory.
+ mkdir sub
+
+ am_cv_$1_dependencies_compiler_type=none
+ if test "$am_compiler_list" = ""; then
+ am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
+ fi
+ am__universal=false
+ m4_case([$1], [CC],
+ [case " $depcc " in #(
+ *\ -arch\ *\ -arch\ *) am__universal=true ;;
+ esac],
+ [CXX],
+ [case " $depcc " in #(
+ *\ -arch\ *\ -arch\ *) am__universal=true ;;
+ esac])
+
+ for depmode in $am_compiler_list; do
+ # Setup a source with many dependencies, because some compilers
+ # like to wrap large dependency lists on column 80 (with \), and
+ # we should not choose a depcomp mode which is confused by this.
+ #
+ # We need to recreate these files for each test, as the compiler may
+ # overwrite some of them when testing with obscure command lines.
+ # This happens at least with the AIX C compiler.
+ : > sub/conftest.c
+ for i in 1 2 3 4 5 6; do
+ echo '#include "conftst'$i'.h"' >> sub/conftest.c
+ # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
+ # Solaris 8's {/usr,}/bin/sh.
+ touch sub/conftst$i.h
+ done
+ echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+ # We check with `-c' and `-o' for the sake of the "dashmstdout"
+ # mode. It turns out that the SunPro C++ compiler does not properly
+ # handle `-M -o', and we need to detect this. Also, some Intel
+ # versions had trouble with output in subdirs
+ am__obj=sub/conftest.${OBJEXT-o}
+ am__minus_obj="-o $am__obj"
+ case $depmode in
+ gcc)
+ # This depmode causes a compiler race in universal mode.
+ test "$am__universal" = false || continue
+ ;;
+ nosideeffect)
+ # after this tag, mechanisms are not by side-effect, so they'll
+ # only be used when explicitly requested
+ if test "x$enable_dependency_tracking" = xyes; then
+ continue
+ else
+ break
+ fi
+ ;;
+ msvc7 | msvc7msys | msvisualcpp | msvcmsys)
+ # This compiler won't grok `-c -o', but also, the minuso test has
+ # not run yet. These depmodes are late enough in the game, and
+ # so weak that their functioning should not be impacted.
+ am__obj=conftest.${OBJEXT-o}
+ am__minus_obj=
+ ;;
+ none) break ;;
+ esac
+ if depmode=$depmode \
+ source=sub/conftest.c object=$am__obj \
+ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
+ >/dev/null 2>conftest.err &&
+ grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
+ ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+ # icc doesn't choke on unknown options, it will just issue warnings
+ # or remarks (even with -Werror). So we grep stderr for any message
+ # that says an option was ignored or not supported.
+ # When given -MP, icc 7.0 and 7.1 complain thusly:
+ # icc: Command line warning: ignoring option '-M'; no argument required
+ # The diagnosis changed in icc 8.0:
+ # icc: Command line remark: option '-MP' not supported
+ if (grep 'ignoring option' conftest.err ||
+ grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+ am_cv_$1_dependencies_compiler_type=$depmode
+ break
+ fi
+ fi
+ done
+
+ cd ..
+ rm -rf conftest.dir
+else
+ am_cv_$1_dependencies_compiler_type=none
+fi
+])
+AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
+AM_CONDITIONAL([am__fastdep$1], [
+ test "x$enable_dependency_tracking" != xno \
+ && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
+])
+
+
+# AM_SET_DEPDIR
+# -------------
+# Choose a directory name for dependency files.
+# This macro is AC_REQUIREd in _AM_DEPENDENCIES
+AC_DEFUN([AM_SET_DEPDIR],
+[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
+AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
+])
+
+
+# AM_DEP_TRACK
+# ------------
+AC_DEFUN([AM_DEP_TRACK],
+[AC_ARG_ENABLE(dependency-tracking,
+[ --disable-dependency-tracking speeds up one-time build
+ --enable-dependency-tracking do not reject slow dependency extractors])
+if test "x$enable_dependency_tracking" != xno; then
+ am_depcomp="$ac_aux_dir/depcomp"
+ AMDEPBACKSLASH='\'
+ am__nodep='_no'
+fi
+AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
+AC_SUBST([AMDEPBACKSLASH])dnl
+_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
+AC_SUBST([am__nodep])dnl
+_AM_SUBST_NOTMAKE([am__nodep])dnl
+])
+
+# Generate code to set up dependency tracking. -*- Autoconf -*-
+
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+#serial 5
+
+# _AM_OUTPUT_DEPENDENCY_COMMANDS
+# ------------------------------
+AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
+[{
+ # Autoconf 2.62 quotes --file arguments for eval, but not when files
+ # are listed without --file. Let's play safe and only enable the eval
+ # if we detect the quoting.
+ case $CONFIG_FILES in
+ *\'*) eval set x "$CONFIG_FILES" ;;
+ *) set x $CONFIG_FILES ;;
+ esac
+ shift
+ for mf
+ do
+ # Strip MF so we end up with the name of the file.
+ mf=`echo "$mf" | sed -e 's/:.*$//'`
+ # Check whether this is an Automake generated Makefile or not.
+ # We used to match only the files named `Makefile.in', but
+ # some people rename them; so instead we look at the file content.
+ # Grep'ing the first line is not enough: some people post-process
+ # each Makefile.in and add a new line on top of each file to say so.
+ # Grep'ing the whole file is not good either: AIX grep has a line
+ # limit of 2048, but all sed's we know have understand at least 4000.
+ if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
+ dirpart=`AS_DIRNAME("$mf")`
+ else
+ continue
+ fi
+ # Extract the definition of DEPDIR, am__include, and am__quote
+ # from the Makefile without running `make'.
+ DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
+ test -z "$DEPDIR" && continue
+ am__include=`sed -n 's/^am__include = //p' < "$mf"`
+ test -z "am__include" && continue
+ am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
+ # When using ansi2knr, U may be empty or an underscore; expand it
+ U=`sed -n 's/^U = //p' < "$mf"`
+ # Find all dependency output files, they are included files with
+ # $(DEPDIR) in their names. We invoke sed twice because it is the
+ # simplest approach to changing $(DEPDIR) to its actual value in the
+ # expansion.
+ for file in `sed -n "
+ s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
+ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+ # Make sure the directory exists.
+ test -f "$dirpart/$file" && continue
+ fdir=`AS_DIRNAME(["$file"])`
+ AS_MKDIR_P([$dirpart/$fdir])
+ # echo "creating $dirpart/$file"
+ echo '# dummy' > "$dirpart/$file"
+ done
+ done
+}
+])# _AM_OUTPUT_DEPENDENCY_COMMANDS
+
+
+# AM_OUTPUT_DEPENDENCY_COMMANDS
+# -----------------------------
+# This macro should only be invoked once -- use via AC_REQUIRE.
+#
+# This code is only required when automatic dependency tracking
+# is enabled. FIXME. This creates each `.P' file that we will
+# need in order to bootstrap the dependency handling code.
+AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
+[AC_CONFIG_COMMANDS([depfiles],
+ [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
+ [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
+])
+
+# Do all the work for Automake. -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+# 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 16
+
+# This macro actually does too much. Some checks are only needed if
+# your package does certain things. But this isn't really a big deal.
+
+# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
+# AM_INIT_AUTOMAKE([OPTIONS])
+# -----------------------------------------------
+# The call with PACKAGE and VERSION arguments is the old style
+# call (pre autoconf-2.50), which is being phased out. PACKAGE
+# and VERSION should now be passed to AC_INIT and removed from
+# the call to AM_INIT_AUTOMAKE.
+# We support both call styles for the transition. After
+# the next Automake release, Autoconf can make the AC_INIT
+# arguments mandatory, and then we can depend on a new Autoconf
+# release and drop the old call support.
+AC_DEFUN([AM_INIT_AUTOMAKE],
+[AC_PREREQ([2.62])dnl
+dnl Autoconf wants to disallow AM_ names. We explicitly allow
+dnl the ones we care about.
+m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
+AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
+AC_REQUIRE([AC_PROG_INSTALL])dnl
+if test "`cd $srcdir && pwd`" != "`pwd`"; then
+ # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
+ # is not polluted with repeated "-I."
+ AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
+ # test to see if srcdir already configured
+ if test -f $srcdir/config.status; then
+ AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
+ fi
+fi
+
+# test whether we have cygpath
+if test -z "$CYGPATH_W"; then
+ if (cygpath --version) >/dev/null 2>/dev/null; then
+ CYGPATH_W='cygpath -w'
+ else
+ CYGPATH_W=echo
+ fi
+fi
+AC_SUBST([CYGPATH_W])
+
+# Define the identity of the package.
+dnl Distinguish between old-style and new-style calls.
+m4_ifval([$2],
+[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
+ AC_SUBST([PACKAGE], [$1])dnl
+ AC_SUBST([VERSION], [$2])],
+[_AM_SET_OPTIONS([$1])dnl
+dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
+m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
+ [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
+ AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
+ AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
+
+_AM_IF_OPTION([no-define],,
+[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
+ AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
+
+# Some tools Automake needs.
+AC_REQUIRE([AM_SANITY_CHECK])dnl
+AC_REQUIRE([AC_ARG_PROGRAM])dnl
+AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
+AM_MISSING_PROG(AUTOCONF, autoconf)
+AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
+AM_MISSING_PROG(AUTOHEADER, autoheader)
+AM_MISSING_PROG(MAKEINFO, makeinfo)
+AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
+AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
+AC_REQUIRE([AM_PROG_MKDIR_P])dnl
+# We need awk for the "check" target. The system "awk" is bad on
+# some platforms.
+AC_REQUIRE([AC_PROG_AWK])dnl
+AC_REQUIRE([AC_PROG_MAKE_SET])dnl
+AC_REQUIRE([AM_SET_LEADING_DOT])dnl
+_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
+ [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
+ [_AM_PROG_TAR([v7])])])
+_AM_IF_OPTION([no-dependencies],,
+[AC_PROVIDE_IFELSE([AC_PROG_CC],
+ [_AM_DEPENDENCIES(CC)],
+ [define([AC_PROG_CC],
+ defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_CXX],
+ [_AM_DEPENDENCIES(CXX)],
+ [define([AC_PROG_CXX],
+ defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_OBJC],
+ [_AM_DEPENDENCIES(OBJC)],
+ [define([AC_PROG_OBJC],
+ defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
+])
+_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
+dnl The `parallel-tests' driver may need to know about EXEEXT, so add the
+dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro
+dnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
+AC_CONFIG_COMMANDS_PRE(dnl
+[m4_provide_if([_AM_COMPILER_EXEEXT],
+ [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
+])
+
+dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not
+dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
+dnl mangled by Autoconf and run in a shell conditional statement.
+m4_define([_AC_COMPILER_EXEEXT],
+m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
+
+
+# When config.status generates a header, we must update the stamp-h file.
+# This file resides in the same directory as the config header
+# that is generated. The stamp files are numbered to have different names.
+
+# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
+# loop where config.status creates the headers, so we can generate
+# our stamp files there.
+AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
+[# Compute $1's index in $config_headers.
+_am_arg=$1
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+ case $_am_header in
+ $_am_arg | $_am_arg:* )
+ break ;;
+ * )
+ _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+ esac
+done
+echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
+
+# Copyright (C) 2001, 2003, 2005, 2008, 2011 Free Software Foundation,
+# Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 1
+
+# AM_PROG_INSTALL_SH
+# ------------------
+# Define $install_sh.
+AC_DEFUN([AM_PROG_INSTALL_SH],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+if test x"${install_sh}" != xset; then
+ case $am_aux_dir in
+ *\ * | *\ *)
+ install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
+ *)
+ install_sh="\${SHELL} $am_aux_dir/install-sh"
+ esac
+fi
+AC_SUBST(install_sh)])
+
+# Copyright (C) 2003, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 2
+
+# Check whether the underlying file-system supports filenames
+# with a leading dot. For instance MS-DOS doesn't.
+AC_DEFUN([AM_SET_LEADING_DOT],
+[rm -rf .tst 2>/dev/null
+mkdir .tst 2>/dev/null
+if test -d .tst; then
+ am__leading_dot=.
+else
+ am__leading_dot=_
+fi
+rmdir .tst 2>/dev/null
+AC_SUBST([am__leading_dot])])
+
+# Check to see how 'make' treats includes. -*- Autoconf -*-
+
+# Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 4
+
+# AM_MAKE_INCLUDE()
+# -----------------
+# Check to see how make treats includes.
+AC_DEFUN([AM_MAKE_INCLUDE],
+[am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+ @echo this is the am__doit target
+.PHONY: am__doit
+END
+# If we don't find an include directive, just comment out the code.
+AC_MSG_CHECKING([for style of include used by $am_make])
+am__include="#"
+am__quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# Ignore all kinds of additional output from `make'.
+case `$am_make -s -f confmf 2> /dev/null` in #(
+*the\ am__doit\ target*)
+ am__include=include
+ am__quote=
+ _am_result=GNU
+ ;;
+esac
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+ echo '.include "confinc"' > confmf
+ case `$am_make -s -f confmf 2> /dev/null` in #(
+ *the\ am__doit\ target*)
+ am__include=.include
+ am__quote="\""
+ _am_result=BSD
+ ;;
+ esac
+fi
+AC_SUBST([am__include])
+AC_SUBST([am__quote])
+AC_MSG_RESULT([$_am_result])
+rm -f confinc confmf
+])
+
+# Copyright (C) 1999, 2000, 2001, 2003, 2004, 2005, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 6
+
+# AM_PROG_CC_C_O
+# --------------
+# Like AC_PROG_CC_C_O, but changed for automake.
+AC_DEFUN([AM_PROG_CC_C_O],
+[AC_REQUIRE([AC_PROG_CC_C_O])dnl
+AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+AC_REQUIRE_AUX_FILE([compile])dnl
+# FIXME: we rely on the cache variable name because
+# there is no other way.
+set dummy $CC
+am_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']`
+eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o
+if test "$am_t" != yes; then
+ # Losing compiler, so override with the script.
+ # FIXME: It is wrong to rewrite CC.
+ # But if we don't then we get into trouble of one sort or another.
+ # A longer-term fix would be to have automake use am__CC in this case,
+ # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
+ CC="$am_aux_dir/compile $CC"
+fi
+dnl Make sure AC_PROG_CC is never called again, or it will override our
+dnl setting of CC.
+m4_define([AC_PROG_CC],
+ [m4_fatal([AC_PROG_CC cannot be called after AM_PROG_CC_C_O])])
+])
+
+# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
+
+# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 6
+
+# AM_MISSING_PROG(NAME, PROGRAM)
+# ------------------------------
+AC_DEFUN([AM_MISSING_PROG],
+[AC_REQUIRE([AM_MISSING_HAS_RUN])
+$1=${$1-"${am_missing_run}$2"}
+AC_SUBST($1)])
+
+
+# AM_MISSING_HAS_RUN
+# ------------------
+# Define MISSING if not defined so far and test if it supports --run.
+# If it does, set am_missing_run to use it, otherwise, to nothing.
+AC_DEFUN([AM_MISSING_HAS_RUN],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+AC_REQUIRE_AUX_FILE([missing])dnl
+if test x"${MISSING+set}" != xset; then
+ case $am_aux_dir in
+ *\ * | *\ *)
+ MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
+ *)
+ MISSING="\${SHELL} $am_aux_dir/missing" ;;
+ esac
+fi
+# Use eval to expand $SHELL
+if eval "$MISSING --run true"; then
+ am_missing_run="$MISSING --run "
+else
+ am_missing_run=
+ AC_MSG_WARN([`missing' script is too old or missing])
+fi
+])
+
+# Copyright (C) 2003, 2004, 2005, 2006, 2011 Free Software Foundation,
+# Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 1
+
+# AM_PROG_MKDIR_P
+# ---------------
+# Check for `mkdir -p'.
+AC_DEFUN([AM_PROG_MKDIR_P],
+[AC_PREREQ([2.60])dnl
+AC_REQUIRE([AC_PROG_MKDIR_P])dnl
+dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P,
+dnl while keeping a definition of mkdir_p for backward compatibility.
+dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
+dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
+dnl Makefile.ins that do not define MKDIR_P, so we do our own
+dnl adjustment using top_builddir (which is defined more often than
+dnl MKDIR_P).
+AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
+case $mkdir_p in
+ [[\\/$]]* | ?:[[\\/]]*) ;;
+ */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
+esac
+])
+
+# Helper functions for option handling. -*- Autoconf -*-
+
+# Copyright (C) 2001, 2002, 2003, 2005, 2008, 2010 Free Software
+# Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 5
+
+# _AM_MANGLE_OPTION(NAME)
+# -----------------------
+AC_DEFUN([_AM_MANGLE_OPTION],
+[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
+
+# _AM_SET_OPTION(NAME)
+# --------------------
+# Set option NAME. Presently that only means defining a flag for this option.
+AC_DEFUN([_AM_SET_OPTION],
+[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
+
+# _AM_SET_OPTIONS(OPTIONS)
+# ------------------------
+# OPTIONS is a space-separated list of Automake options.
+AC_DEFUN([_AM_SET_OPTIONS],
+[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
+
+# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
+# -------------------------------------------
+# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
+AC_DEFUN([_AM_IF_OPTION],
+[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
+
+# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 1
+
+# AM_RUN_LOG(COMMAND)
+# -------------------
+# Run COMMAND, save the exit status in ac_status, and log it.
+# (This has been adapted from Autoconf's _AC_RUN_LOG macro.)
+AC_DEFUN([AM_RUN_LOG],
+[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD
+ ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
+ (exit $ac_status); }])
+
+# Check to make sure that the build environment is sane. -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 5
+
+# AM_SANITY_CHECK
+# ---------------
+AC_DEFUN([AM_SANITY_CHECK],
+[AC_MSG_CHECKING([whether build environment is sane])
+# Just in case
+sleep 1
+echo timestamp > conftest.file
+# Reject unsafe characters in $srcdir or the absolute working directory
+# name. Accept space and tab only in the latter.
+am_lf='
+'
+case `pwd` in
+ *[[\\\"\#\$\&\'\`$am_lf]]*)
+ AC_MSG_ERROR([unsafe absolute working directory name]);;
+esac
+case $srcdir in
+ *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*)
+ AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
+esac
+
+# Do `set' in a subshell so we don't clobber the current shell's
+# arguments. Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+ set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
+ if test "$[*]" = "X"; then
+ # -L didn't work.
+ set X `ls -t "$srcdir/configure" conftest.file`
+ fi
+ rm -f conftest.file
+ if test "$[*]" != "X $srcdir/configure conftest.file" \
+ && test "$[*]" != "X conftest.file $srcdir/configure"; then
+
+ # If neither matched, then we have a broken ls. This can happen
+ # if, for instance, CONFIG_SHELL is bash and it inherits a
+ # broken ls alias from the environment. This has actually
+ # happened. Such a system could not be considered "sane".
+ AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
+alias in your environment])
+ fi
+
+ test "$[2]" = conftest.file
+ )
+then
+ # Ok.
+ :
+else
+ AC_MSG_ERROR([newly created file is older than distributed files!
+Check your system clock])
+fi
+AC_MSG_RESULT(yes)])
+
+# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 1
+
+# AM_PROG_INSTALL_STRIP
+# ---------------------
+# One issue with vendor `install' (even GNU) is that you can't
+# specify the program used to strip binaries. This is especially
+# annoying in cross-compiling environments, where the build's strip
+# is unlikely to handle the host's binaries.
+# Fortunately install-sh will honor a STRIPPROG variable, so we
+# always use install-sh in `make install-strip', and initialize
+# STRIPPROG with the value of the STRIP variable (set by the user).
+AC_DEFUN([AM_PROG_INSTALL_STRIP],
+[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
+# Installed binaries are usually stripped using `strip' when the user
+# run `make install-strip'. However `strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the `STRIP' environment variable to overrule this program.
+dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
+if test "$cross_compiling" != no; then
+ AC_CHECK_TOOL([STRIP], [strip], :)
+fi
+INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
+AC_SUBST([INSTALL_STRIP_PROGRAM])])
+
+# Copyright (C) 2006, 2008, 2010 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 3
+
+# _AM_SUBST_NOTMAKE(VARIABLE)
+# ---------------------------
+# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
+# This macro is traced by Automake.
+AC_DEFUN([_AM_SUBST_NOTMAKE])
+
+# AM_SUBST_NOTMAKE(VARIABLE)
+# --------------------------
+# Public sister of _AM_SUBST_NOTMAKE.
+AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
+
+# Check how to create a tarball. -*- Autoconf -*-
+
+# Copyright (C) 2004, 2005, 2012 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 2
+
+# _AM_PROG_TAR(FORMAT)
+# --------------------
+# Check how to create a tarball in format FORMAT.
+# FORMAT should be one of `v7', `ustar', or `pax'.
+#
+# Substitute a variable $(am__tar) that is a command
+# writing to stdout a FORMAT-tarball containing the directory
+# $tardir.
+# tardir=directory && $(am__tar) > result.tar
+#
+# Substitute a variable $(am__untar) that extract such
+# a tarball read from stdin.
+# $(am__untar) < result.tar
+AC_DEFUN([_AM_PROG_TAR],
+[# Always define AMTAR for backward compatibility. Yes, it's still used
+# in the wild :-( We should find a proper way to deprecate it ...
+AC_SUBST([AMTAR], ['$${TAR-tar}'])
+m4_if([$1], [v7],
+ [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
+ [m4_case([$1], [ustar],, [pax],,
+ [m4_fatal([Unknown tar format])])
+AC_MSG_CHECKING([how to create a $1 tar archive])
+# Loop over all known methods to create a tar archive until one works.
+_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
+_am_tools=${am_cv_prog_tar_$1-$_am_tools}
+# Do not fold the above two line into one, because Tru64 sh and
+# Solaris sh will not grok spaces in the rhs of `-'.
+for _am_tool in $_am_tools
+do
+ case $_am_tool in
+ gnutar)
+ for _am_tar in tar gnutar gtar;
+ do
+ AM_RUN_LOG([$_am_tar --version]) && break
+ done
+ am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
+ am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
+ am__untar="$_am_tar -xf -"
+ ;;
+ plaintar)
+ # Must skip GNU tar: if it does not support --format= it doesn't create
+ # ustar tarball either.
+ (tar --version) >/dev/null 2>&1 && continue
+ am__tar='tar chf - "$$tardir"'
+ am__tar_='tar chf - "$tardir"'
+ am__untar='tar xf -'
+ ;;
+ pax)
+ am__tar='pax -L -x $1 -w "$$tardir"'
+ am__tar_='pax -L -x $1 -w "$tardir"'
+ am__untar='pax -r'
+ ;;
+ cpio)
+ am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
+ am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
+ am__untar='cpio -i -H $1 -d'
+ ;;
+ none)
+ am__tar=false
+ am__tar_=false
+ am__untar=false
+ ;;
+ esac
+
+ # If the value was cached, stop now. We just wanted to have am__tar
+ # and am__untar set.
+ test -n "${am_cv_prog_tar_$1}" && break
+
+ # tar/untar a dummy directory, and stop if the command works
+ rm -rf conftest.dir
+ mkdir conftest.dir
+ echo GrepMe > conftest.dir/file
+ AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
+ rm -rf conftest.dir
+ if test -s conftest.tar; then
+ AM_RUN_LOG([$am__untar <conftest.tar])
+ grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
+ fi
+done
+rm -rf conftest.dir
+
+AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
+AC_MSG_RESULT([$am_cv_prog_tar_$1])])
+AC_SUBST([am__tar])
+AC_SUBST([am__untar])
+]) # _AM_PROG_TAR
+
--- /dev/null
+#! /bin/sh
+# Wrapper for compilers which do not understand '-c -o'.
+
+scriptversion=2012-03-05.13; # UTC
+
+# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2009, 2010, 2012 Free
+# Software Foundation, Inc.
+# Written by Tom Tromey <tromey@cygnus.com>.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# This file is maintained in Automake, please report
+# bugs to <bug-automake@gnu.org> or send patches to
+# <automake-patches@gnu.org>.
+
+nl='
+'
+
+# We need space, tab and new line, in precisely that order. Quoting is
+# there to prevent tools from complaining about whitespace usage.
+IFS=" "" $nl"
+
+file_conv=
+
+# func_file_conv build_file lazy
+# Convert a $build file to $host form and store it in $file
+# Currently only supports Windows hosts. If the determined conversion
+# type is listed in (the comma separated) LAZY, no conversion will
+# take place.
+func_file_conv ()
+{
+ file=$1
+ case $file in
+ / | /[!/]*) # absolute file, and not a UNC file
+ if test -z "$file_conv"; then
+ # lazily determine how to convert abs files
+ case `uname -s` in
+ MINGW*)
+ file_conv=mingw
+ ;;
+ CYGWIN*)
+ file_conv=cygwin
+ ;;
+ *)
+ file_conv=wine
+ ;;
+ esac
+ fi
+ case $file_conv/,$2, in
+ *,$file_conv,*)
+ ;;
+ mingw/*)
+ file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
+ ;;
+ cygwin/*)
+ file=`cygpath -m "$file" || echo "$file"`
+ ;;
+ wine/*)
+ file=`winepath -w "$file" || echo "$file"`
+ ;;
+ esac
+ ;;
+ esac
+}
+
+# func_cl_dashL linkdir
+# Make cl look for libraries in LINKDIR
+func_cl_dashL ()
+{
+ func_file_conv "$1"
+ if test -z "$lib_path"; then
+ lib_path=$file
+ else
+ lib_path="$lib_path;$file"
+ fi
+ linker_opts="$linker_opts -LIBPATH:$file"
+}
+
+# func_cl_dashl library
+# Do a library search-path lookup for cl
+func_cl_dashl ()
+{
+ lib=$1
+ found=no
+ save_IFS=$IFS
+ IFS=';'
+ for dir in $lib_path $LIB
+ do
+ IFS=$save_IFS
+ if $shared && test -f "$dir/$lib.dll.lib"; then
+ found=yes
+ lib=$dir/$lib.dll.lib
+ break
+ fi
+ if test -f "$dir/$lib.lib"; then
+ found=yes
+ lib=$dir/$lib.lib
+ break
+ fi
+ done
+ IFS=$save_IFS
+
+ if test "$found" != yes; then
+ lib=$lib.lib
+ fi
+}
+
+# func_cl_wrapper cl arg...
+# Adjust compile command to suit cl
+func_cl_wrapper ()
+{
+ # Assume a capable shell
+ lib_path=
+ shared=:
+ linker_opts=
+ for arg
+ do
+ if test -n "$eat"; then
+ eat=
+ else
+ case $1 in
+ -o)
+ # configure might choose to run compile as 'compile cc -o foo foo.c'.
+ eat=1
+ case $2 in
+ *.o | *.[oO][bB][jJ])
+ func_file_conv "$2"
+ set x "$@" -Fo"$file"
+ shift
+ ;;
+ *)
+ func_file_conv "$2"
+ set x "$@" -Fe"$file"
+ shift
+ ;;
+ esac
+ ;;
+ -I)
+ eat=1
+ func_file_conv "$2" mingw
+ set x "$@" -I"$file"
+ shift
+ ;;
+ -I*)
+ func_file_conv "${1#-I}" mingw
+ set x "$@" -I"$file"
+ shift
+ ;;
+ -l)
+ eat=1
+ func_cl_dashl "$2"
+ set x "$@" "$lib"
+ shift
+ ;;
+ -l*)
+ func_cl_dashl "${1#-l}"
+ set x "$@" "$lib"
+ shift
+ ;;
+ -L)
+ eat=1
+ func_cl_dashL "$2"
+ ;;
+ -L*)
+ func_cl_dashL "${1#-L}"
+ ;;
+ -static)
+ shared=false
+ ;;
+ -Wl,*)
+ arg=${1#-Wl,}
+ save_ifs="$IFS"; IFS=','
+ for flag in $arg; do
+ IFS="$save_ifs"
+ linker_opts="$linker_opts $flag"
+ done
+ IFS="$save_ifs"
+ ;;
+ -Xlinker)
+ eat=1
+ linker_opts="$linker_opts $2"
+ ;;
+ -*)
+ set x "$@" "$1"
+ shift
+ ;;
+ *.cc | *.CC | *.cxx | *.CXX | *.[cC]++)
+ func_file_conv "$1"
+ set x "$@" -Tp"$file"
+ shift
+ ;;
+ *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO])
+ func_file_conv "$1" mingw
+ set x "$@" "$file"
+ shift
+ ;;
+ *)
+ set x "$@" "$1"
+ shift
+ ;;
+ esac
+ fi
+ shift
+ done
+ if test -n "$linker_opts"; then
+ linker_opts="-link$linker_opts"
+ fi
+ exec "$@" $linker_opts
+ exit 1
+}
+
+eat=
+
+case $1 in
+ '')
+ echo "$0: No command. Try '$0 --help' for more information." 1>&2
+ exit 1;
+ ;;
+ -h | --h*)
+ cat <<\EOF
+Usage: compile [--help] [--version] PROGRAM [ARGS]
+
+Wrapper for compilers which do not understand '-c -o'.
+Remove '-o dest.o' from ARGS, run PROGRAM with the remaining
+arguments, and rename the output as expected.
+
+If you are trying to build a whole package this is not the
+right script to run: please start by reading the file 'INSTALL'.
+
+Report bugs to <bug-automake@gnu.org>.
+EOF
+ exit $?
+ ;;
+ -v | --v*)
+ echo "compile $scriptversion"
+ exit $?
+ ;;
+ cl | *[/\\]cl | cl.exe | *[/\\]cl.exe )
+ func_cl_wrapper "$@" # Doesn't return...
+ ;;
+esac
+
+ofile=
+cfile=
+
+for arg
+do
+ if test -n "$eat"; then
+ eat=
+ else
+ case $1 in
+ -o)
+ # configure might choose to run compile as 'compile cc -o foo foo.c'.
+ # So we strip '-o arg' only if arg is an object.
+ eat=1
+ case $2 in
+ *.o | *.obj)
+ ofile=$2
+ ;;
+ *)
+ set x "$@" -o "$2"
+ shift
+ ;;
+ esac
+ ;;
+ *.c)
+ cfile=$1
+ set x "$@" "$1"
+ shift
+ ;;
+ *)
+ set x "$@" "$1"
+ shift
+ ;;
+ esac
+ fi
+ shift
+done
+
+if test -z "$ofile" || test -z "$cfile"; then
+ # If no '-o' option was seen then we might have been invoked from a
+ # pattern rule where we don't need one. That is ok -- this is a
+ # normal compilation that the losing compiler can handle. If no
+ # '.c' file was seen then we are probably linking. That is also
+ # ok.
+ exec "$@"
+fi
+
+# Name of file we expect compiler to create.
+cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'`
+
+# Create the lock directory.
+# Note: use '[/\\:.-]' here to ensure that we don't use the same name
+# that we are using for the .o file. Also, base the name on the expected
+# object file name, since that is what matters with a parallel build.
+lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d
+while true; do
+ if mkdir "$lockdir" >/dev/null 2>&1; then
+ break
+ fi
+ sleep 1
+done
+# FIXME: race condition here if user kills between mkdir and trap.
+trap "rmdir '$lockdir'; exit 1" 1 2 15
+
+# Run the compile.
+"$@"
+ret=$?
+
+if test -f "$cofile"; then
+ test "$cofile" = "$ofile" || mv "$cofile" "$ofile"
+elif test -f "${cofile}bj"; then
+ test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile"
+fi
+
+rmdir "$lockdir"
+exit $ret
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
--- /dev/null
+#! /bin/sh
+# depcomp - compile a program generating dependencies as side-effects
+
+scriptversion=2012-03-27.16; # UTC
+
+# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009, 2010,
+# 2011, 2012 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# 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 outputting dependencies.
+ libtool Whether libtool is used (yes/no).
+
+Report bugs to <bug-automake@gnu.org>.
+EOF
+ exit $?
+ ;;
+ -v | --v*)
+ echo "depcomp $scriptversion"
+ exit $?
+ ;;
+esac
+
+# A tabulation character.
+tab=' '
+# A newline character.
+nl='
+'
+
+if test -z "$depmode" || test -z "$source" || test -z "$object"; then
+ echo "depcomp: Variables source, object and depmode must be set" 1>&2
+ exit 1
+fi
+
+# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
+depfile=${depfile-`echo "$object" |
+ sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
+tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
+
+rm -f "$tmpdepfile"
+
+# Some modes work just like other modes, but use different flags. We
+# parameterize here, but still list the modes in the big case below,
+# to make depend.m4 easier to write. Note that we *cannot* use a case
+# here, because this file can only contain one case statement.
+if test "$depmode" = hp; then
+ # HP compiler uses -M and no extra arg.
+ gccflag=-M
+ depmode=gcc
+fi
+
+if test "$depmode" = dashXmstdout; then
+ # This is just like dashmstdout with a different argument.
+ dashmflag=-xM
+ depmode=dashmstdout
+fi
+
+cygpath_u="cygpath -u -f -"
+if test "$depmode" = msvcmsys; then
+ # This is just like msvisualcpp but w/o cygpath translation.
+ # Just convert the backslash-escaped backslashes to single forward
+ # slashes to satisfy depend.m4
+ cygpath_u='sed s,\\\\,/,g'
+ depmode=msvisualcpp
+fi
+
+if test "$depmode" = msvc7msys; then
+ # This is just like msvc7 but w/o cygpath translation.
+ # Just convert the backslash-escaped backslashes to single forward
+ # slashes to satisfy depend.m4
+ cygpath_u='sed s,\\\\,/,g'
+ depmode=msvc7
+fi
+
+if test "$depmode" = xlc; then
+ # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency informations.
+ gccflag=-qmakedep=gcc,-MF
+ depmode=gcc
+fi
+
+case "$depmode" in
+gcc3)
+## gcc 3 implements dependency tracking that does exactly what
+## we want. Yay! Note: for some reason libtool 1.4 doesn't like
+## it if -MD -MP comes after the -MF stuff. Hmm.
+## Unfortunately, FreeBSD c89 acceptance of flags depends upon
+## the command line argument order; so add the flags where they
+## appear in depend2.am. Note that the slowdown incurred here
+## affects only configure: in makefiles, %FASTDEP% shortcuts this.
+ for arg
+ do
+ case $arg in
+ -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
+ *) set fnord "$@" "$arg" ;;
+ esac
+ shift # fnord
+ shift # $arg
+ done
+ "$@"
+ stat=$?
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+ mv "$tmpdepfile" "$depfile"
+ ;;
+
+gcc)
+## There are various ways to get dependency output from gcc. Here's
+## why we pick this rather obscure method:
+## - Don't want to use -MD because we'd like the dependencies to end
+## up in a subdir. Having to rename by hand is ugly.
+## (We might end up doing this anyway to support other compilers.)
+## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
+## -MM, not -M (despite what the docs say).
+## - Using -M directly means running the compiler twice (even worse
+## than renaming).
+ if test -z "$gccflag"; then
+ gccflag=-MD,
+ fi
+ "$@" -Wp,"$gccflag$tmpdepfile"
+ stat=$?
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+ rm -f "$depfile"
+ echo "$object : \\" > "$depfile"
+ alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
+## The second -e expression handles DOS-style file names with drive letters.
+ sed -e 's/^[^:]*: / /' \
+ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
+## This next piece of magic avoids the "deleted header file" problem.
+## The problem is that when a header file which appears in a .P file
+## is deleted, the dependency causes make to die (because there is
+## typically no way to rebuild the header). We avoid this by adding
+## dummy dependencies for each header file. Too bad gcc doesn't do
+## this for us directly.
+ tr ' ' "$nl" < "$tmpdepfile" |
+## Some versions of gcc put a space before the ':'. On the theory
+## that the space means something, we add a space to the output as
+## well. hp depmode also adds that space, but also prefixes the VPATH
+## to the object. Take care to not repeat it in the output.
+## Some versions of the HPUX 10.20 sed can't process this invocation
+## correctly. Breaking it into two sed invocations is a workaround.
+ sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \
+ | sed -e 's/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+hp)
+ # This case exists only to let depend.m4 do its work. It works by
+ # looking at the text of this script. This case will never be run,
+ # since it is checked for above.
+ exit 1
+ ;;
+
+sgi)
+ if test "$libtool" = yes; then
+ "$@" "-Wp,-MDupdate,$tmpdepfile"
+ else
+ "$@" -MDupdate "$tmpdepfile"
+ fi
+ stat=$?
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+ rm -f "$depfile"
+
+ if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
+ echo "$object : \\" > "$depfile"
+
+ # Clip off the initial element (the dependent). Don't try to be
+ # clever and replace this with sed code, as IRIX sed won't handle
+ # lines with more than a fixed number of characters (4096 in
+ # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
+ # the IRIX cc adds comments like '#:fec' to the end of the
+ # dependency line.
+ tr ' ' "$nl" < "$tmpdepfile" \
+ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
+ tr "$nl" ' ' >> "$depfile"
+ echo >> "$depfile"
+
+ # The second pass generates a dummy entry for each header file.
+ tr ' ' "$nl" < "$tmpdepfile" \
+ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
+ >> "$depfile"
+ else
+ # The sourcefile does not contain any dependencies, so just
+ # store a dummy comment line, to avoid errors with the Makefile
+ # "include basename.Plo" scheme.
+ echo "#dummy" > "$depfile"
+ fi
+ rm -f "$tmpdepfile"
+ ;;
+
+xlc)
+ # This case exists only to let depend.m4 do its work. It works by
+ # looking at the text of this script. This case will never be run,
+ # since it is checked for above.
+ exit 1
+ ;;
+
+aix)
+ # The C for AIX Compiler uses -M and outputs the dependencies
+ # in a .u file. In older versions, this file always lives in the
+ # current directory. Also, the AIX compiler puts '$object:' at the
+ # start of each line; $object doesn't have directory information.
+ # Version 6 uses the directory in both cases.
+ dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
+ test "x$dir" = "x$object" && dir=
+ base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
+ if test "$libtool" = yes; then
+ tmpdepfile1=$dir$base.u
+ tmpdepfile2=$base.u
+ tmpdepfile3=$dir.libs/$base.u
+ "$@" -Wc,-M
+ else
+ tmpdepfile1=$dir$base.u
+ tmpdepfile2=$dir$base.u
+ tmpdepfile3=$dir$base.u
+ "$@" -M
+ fi
+ stat=$?
+
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
+ exit $stat
+ fi
+
+ for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
+ do
+ test -f "$tmpdepfile" && break
+ done
+ if test -f "$tmpdepfile"; then
+ # Each line is of the form 'foo.o: dependent.h'.
+ # Do two passes, one to just change these to
+ # '$object: dependent.h' and one to simply 'dependent.h:'.
+ sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
+ sed -e 's,^.*\.[a-z]*:['"$tab"' ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
+ else
+ # The sourcefile does not contain any dependencies, so just
+ # store a dummy comment line, to avoid errors with the Makefile
+ # "include basename.Plo" scheme.
+ echo "#dummy" > "$depfile"
+ fi
+ rm -f "$tmpdepfile"
+ ;;
+
+icc)
+ # Intel's C compiler anf tcc (Tiny C Compiler) understand '-MD -MF file'.
+ # However on
+ # $CC -MD -MF foo.d -c -o sub/foo.o sub/foo.c
+ # ICC 7.0 will fill foo.d with something like
+ # foo.o: sub/foo.c
+ # foo.o: sub/foo.h
+ # which is wrong. We want
+ # sub/foo.o: sub/foo.c
+ # sub/foo.o: sub/foo.h
+ # sub/foo.c:
+ # sub/foo.h:
+ # ICC 7.1 will output
+ # foo.o: sub/foo.c sub/foo.h
+ # and will wrap long lines using '\':
+ # foo.o: sub/foo.c ... \
+ # sub/foo.h ... \
+ # ...
+ # tcc 0.9.26 (FIXME still under development at the moment of writing)
+ # will emit a similar output, but also prepend the continuation lines
+ # with horizontal tabulation characters.
+ "$@" -MD -MF "$tmpdepfile"
+ stat=$?
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+ rm -f "$depfile"
+ # Each line is of the form 'foo.o: dependent.h',
+ # or 'foo.o: dep1.h dep2.h \', or ' dep3.h dep4.h \'.
+ # Do two passes, one to just change these to
+ # '$object: dependent.h' and one to simply 'dependent.h:'.
+ sed -e "s/^[ $tab][ $tab]*/ /" -e "s,^[^:]*:,$object :," \
+ < "$tmpdepfile" > "$depfile"
+ sed '
+ s/[ '"$tab"'][ '"$tab"']*/ /g
+ s/^ *//
+ s/ *\\*$//
+ s/^[^:]*: *//
+ /^$/d
+ /:$/d
+ s/$/ :/
+ ' < "$tmpdepfile" >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+hp2)
+ # The "hp" stanza above does not work with aCC (C++) and HP's ia64
+ # compilers, which have integrated preprocessors. The correct option
+ # to use with these is +Maked; it writes dependencies to a file named
+ # 'foo.d', which lands next to the object file, wherever that
+ # happens to be.
+ # Much of this is similar to the tru64 case; see comments there.
+ dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
+ test "x$dir" = "x$object" && dir=
+ base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
+ if test "$libtool" = yes; then
+ tmpdepfile1=$dir$base.d
+ tmpdepfile2=$dir.libs/$base.d
+ "$@" -Wc,+Maked
+ else
+ tmpdepfile1=$dir$base.d
+ tmpdepfile2=$dir$base.d
+ "$@" +Maked
+ fi
+ stat=$?
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile1" "$tmpdepfile2"
+ exit $stat
+ fi
+
+ for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
+ do
+ test -f "$tmpdepfile" && break
+ done
+ if test -f "$tmpdepfile"; then
+ sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile"
+ # Add 'dependent.h:' lines.
+ sed -ne '2,${
+ s/^ *//
+ s/ \\*$//
+ s/$/:/
+ p
+ }' "$tmpdepfile" >> "$depfile"
+ else
+ echo "#dummy" > "$depfile"
+ fi
+ rm -f "$tmpdepfile" "$tmpdepfile2"
+ ;;
+
+tru64)
+ # The Tru64 compiler uses -MD to generate dependencies as a side
+ # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'.
+ # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
+ # dependencies in 'foo.d' instead, so we check for that too.
+ # Subdirectories are respected.
+ dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
+ test "x$dir" = "x$object" && dir=
+ base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
+
+ if test "$libtool" = yes; then
+ # With Tru64 cc, shared objects can also be used to make a
+ # static library. This mechanism is used in libtool 1.4 series to
+ # handle both shared and static libraries in a single compilation.
+ # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
+ #
+ # With libtool 1.5 this exception was removed, and libtool now
+ # generates 2 separate objects for the 2 libraries. These two
+ # compilations output dependencies in $dir.libs/$base.o.d and
+ # in $dir$base.o.d. We have to check for both files, because
+ # one of the two compilations can be disabled. We should prefer
+ # $dir$base.o.d over $dir.libs/$base.o.d because the latter is
+ # automatically cleaned when .libs/ is deleted, while ignoring
+ # the former would cause a distcleancheck panic.
+ tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4
+ tmpdepfile2=$dir$base.o.d # libtool 1.5
+ tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5
+ tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504
+ "$@" -Wc,-MD
+ else
+ tmpdepfile1=$dir$base.o.d
+ tmpdepfile2=$dir$base.d
+ tmpdepfile3=$dir$base.d
+ tmpdepfile4=$dir$base.d
+ "$@" -MD
+ fi
+
+ stat=$?
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
+ exit $stat
+ fi
+
+ for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
+ do
+ test -f "$tmpdepfile" && break
+ done
+ if test -f "$tmpdepfile"; then
+ sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
+ sed -e 's,^.*\.[a-z]*:['"$tab"' ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
+ else
+ echo "#dummy" > "$depfile"
+ fi
+ rm -f "$tmpdepfile"
+ ;;
+
+msvc7)
+ if test "$libtool" = yes; then
+ showIncludes=-Wc,-showIncludes
+ else
+ showIncludes=-showIncludes
+ fi
+ "$@" $showIncludes > "$tmpdepfile"
+ stat=$?
+ grep -v '^Note: including file: ' "$tmpdepfile"
+ if test "$stat" = 0; then :
+ else
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+ rm -f "$depfile"
+ echo "$object : \\" > "$depfile"
+ # The first sed program below extracts the file names and escapes
+ # backslashes for cygpath. The second sed program outputs the file
+ # name when reading, but also accumulates all include files in the
+ # hold buffer in order to output them again at the end. This only
+ # works with sed implementations that can handle large buffers.
+ sed < "$tmpdepfile" -n '
+/^Note: including file: *\(.*\)/ {
+ s//\1/
+ s/\\/\\\\/g
+ p
+}' | $cygpath_u | sort -u | sed -n '
+s/ /\\ /g
+s/\(.*\)/'"$tab"'\1 \\/p
+s/.\(.*\) \\/\1:/
+H
+$ {
+ s/.*/'"$tab"'/
+ G
+ p
+}' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+msvc7msys)
+ # This case exists only to let depend.m4 do its work. It works by
+ # looking at the text of this script. This case will never be run,
+ # since it is checked for above.
+ exit 1
+ ;;
+
+#nosideeffect)
+ # This comment above is used by automake to tell side-effect
+ # dependency tracking mechanisms from slower ones.
+
+dashmstdout)
+ # Important note: in order to support this mode, a compiler *must*
+ # always write the preprocessed file to stdout, regardless of -o.
+ "$@" || exit $?
+
+ # Remove the call to Libtool.
+ if test "$libtool" = yes; then
+ while test "X$1" != 'X--mode=compile'; do
+ shift
+ done
+ shift
+ fi
+
+ # Remove '-o $object'.
+ IFS=" "
+ for arg
+ do
+ case $arg in
+ -o)
+ shift
+ ;;
+ $object)
+ shift
+ ;;
+ *)
+ set fnord "$@" "$arg"
+ shift # fnord
+ shift # $arg
+ ;;
+ esac
+ done
+
+ test -z "$dashmflag" && dashmflag=-M
+ # Require at least two characters before searching for ':'
+ # in the target name. This is to cope with DOS-style filenames:
+ # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise.
+ "$@" $dashmflag |
+ sed 's:^['"$tab"' ]*[^:'"$tab"' ][^:][^:]*\:['"$tab"' ]*:'"$object"'\: :' > "$tmpdepfile"
+ rm -f "$depfile"
+ cat < "$tmpdepfile" > "$depfile"
+ tr ' ' "$nl" < "$tmpdepfile" | \
+## Some versions of the HPUX 10.20 sed can't process this invocation
+## correctly. Breaking it into two sed invocations is a workaround.
+ sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+dashXmstdout)
+ # This case only exists to satisfy depend.m4. It is never actually
+ # run, as this mode is specially recognized in the preamble.
+ exit 1
+ ;;
+
+makedepend)
+ "$@" || exit $?
+ # Remove any Libtool call
+ if test "$libtool" = yes; then
+ while test "X$1" != 'X--mode=compile'; do
+ shift
+ done
+ shift
+ fi
+ # X makedepend
+ shift
+ cleared=no eat=no
+ for arg
+ do
+ case $cleared in
+ no)
+ set ""; shift
+ cleared=yes ;;
+ esac
+ if test $eat = yes; then
+ eat=no
+ continue
+ fi
+ case "$arg" in
+ -D*|-I*)
+ set fnord "$@" "$arg"; shift ;;
+ # Strip any option that makedepend may not understand. Remove
+ # the object too, otherwise makedepend will parse it as a source file.
+ -arch)
+ eat=yes ;;
+ -*|$object)
+ ;;
+ *)
+ set fnord "$@" "$arg"; shift ;;
+ esac
+ done
+ obj_suffix=`echo "$object" | sed 's/^.*\././'`
+ touch "$tmpdepfile"
+ ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
+ rm -f "$depfile"
+ # makedepend may prepend the VPATH from the source file name to the object.
+ # No need to regex-escape $object, excess matching of '.' is harmless.
+ sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile"
+ sed '1,2d' "$tmpdepfile" | tr ' ' "$nl" | \
+## Some versions of the HPUX 10.20 sed can't process this invocation
+## correctly. Breaking it into two sed invocations is a workaround.
+ sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile" "$tmpdepfile".bak
+ ;;
+
+cpp)
+ # Important note: in order to support this mode, a compiler *must*
+ # always write the preprocessed file to stdout.
+ "$@" || exit $?
+
+ # Remove the call to Libtool.
+ if test "$libtool" = yes; then
+ while test "X$1" != 'X--mode=compile'; do
+ shift
+ done
+ shift
+ fi
+
+ # Remove '-o $object'.
+ IFS=" "
+ for arg
+ do
+ case $arg in
+ -o)
+ shift
+ ;;
+ $object)
+ shift
+ ;;
+ *)
+ set fnord "$@" "$arg"
+ shift # fnord
+ shift # $arg
+ ;;
+ esac
+ done
+
+ "$@" -E |
+ sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
+ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
+ sed '$ s: \\$::' > "$tmpdepfile"
+ rm -f "$depfile"
+ echo "$object : \\" > "$depfile"
+ cat < "$tmpdepfile" >> "$depfile"
+ sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+msvisualcpp)
+ # Important note: in order to support this mode, a compiler *must*
+ # always write the preprocessed file to stdout.
+ "$@" || exit $?
+
+ # Remove the call to Libtool.
+ if test "$libtool" = yes; then
+ while test "X$1" != 'X--mode=compile'; do
+ shift
+ done
+ shift
+ fi
+
+ IFS=" "
+ for arg
+ do
+ case "$arg" in
+ -o)
+ shift
+ ;;
+ $object)
+ shift
+ ;;
+ "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
+ set fnord "$@"
+ shift
+ shift
+ ;;
+ *)
+ set fnord "$@" "$arg"
+ shift
+ shift
+ ;;
+ esac
+ done
+ "$@" -E 2>/dev/null |
+ sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile"
+ rm -f "$depfile"
+ echo "$object : \\" > "$depfile"
+ sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile"
+ echo "$tab" >> "$depfile"
+ sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+msvcmsys)
+ # This case exists only to let depend.m4 do its work. It works by
+ # looking at the text of this script. This case will never be run,
+ # since it is checked for above.
+ exit 1
+ ;;
+
+none)
+ exec "$@"
+ ;;
+
+*)
+ echo "Unknown depmode $depmode" 1>&2
+ exit 1
+ ;;
+esac
+
+exit 0
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
--- /dev/null
+#!/bin/sh
+# install - install a program, script, or datafile
+
+scriptversion=2011-01-19.21; # UTC
+
+# This originates from X11R5 (mit/util/scripts/install.sh), which was
+# later released in X11R6 (xc/config/util/install.sh) with the
+# following copyright and license.
+#
+# Copyright (C) 1994 X Consortium
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to
+# deal in the Software without restriction, including without limitation the
+# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+# sell copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
+# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+#
+# Except as contained in this notice, the name of the X Consortium shall not
+# be used in advertising or otherwise to promote the sale, use or other deal-
+# ings in this Software without prior written authorization from the X Consor-
+# tium.
+#
+#
+# FSF changes to this file are in the public domain.
+#
+# Calling this script install-sh is preferred over install.sh, to prevent
+# `make' implicit rules from creating a file called install from it
+# when there is no Makefile.
+#
+# This script is compatible with the BSD install script, but was written
+# from scratch.
+
+nl='
+'
+IFS=" "" $nl"
+
+# set DOITPROG to echo to test this script
+
+# Don't use :- since 4.3BSD and earlier shells don't like it.
+doit=${DOITPROG-}
+if test -z "$doit"; then
+ doit_exec=exec
+else
+ doit_exec=$doit
+fi
+
+# Put in absolute file names if you don't have them in your path;
+# or use environment vars.
+
+chgrpprog=${CHGRPPROG-chgrp}
+chmodprog=${CHMODPROG-chmod}
+chownprog=${CHOWNPROG-chown}
+cmpprog=${CMPPROG-cmp}
+cpprog=${CPPROG-cp}
+mkdirprog=${MKDIRPROG-mkdir}
+mvprog=${MVPROG-mv}
+rmprog=${RMPROG-rm}
+stripprog=${STRIPPROG-strip}
+
+posix_glob='?'
+initialize_posix_glob='
+ test "$posix_glob" != "?" || {
+ if (set -f) 2>/dev/null; then
+ posix_glob=
+ else
+ posix_glob=:
+ fi
+ }
+'
+
+posix_mkdir=
+
+# Desired mode of installed file.
+mode=0755
+
+chgrpcmd=
+chmodcmd=$chmodprog
+chowncmd=
+mvcmd=$mvprog
+rmcmd="$rmprog -f"
+stripcmd=
+
+src=
+dst=
+dir_arg=
+dst_arg=
+
+copy_on_change=false
+no_target_directory=
+
+usage="\
+Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
+ or: $0 [OPTION]... SRCFILES... DIRECTORY
+ or: $0 [OPTION]... -t DIRECTORY SRCFILES...
+ or: $0 [OPTION]... -d DIRECTORIES...
+
+In the 1st form, copy SRCFILE to DSTFILE.
+In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
+In the 4th, create DIRECTORIES.
+
+Options:
+ --help display this help and exit.
+ --version display version info and exit.
+
+ -c (ignored)
+ -C install only if different (preserve the last data modification time)
+ -d create directories instead of installing files.
+ -g GROUP $chgrpprog installed files to GROUP.
+ -m MODE $chmodprog installed files to MODE.
+ -o USER $chownprog installed files to USER.
+ -s $stripprog installed files.
+ -t DIRECTORY install into DIRECTORY.
+ -T report an error if DSTFILE is a directory.
+
+Environment variables override the default commands:
+ CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
+ RMPROG STRIPPROG
+"
+
+while test $# -ne 0; do
+ case $1 in
+ -c) ;;
+
+ -C) copy_on_change=true;;
+
+ -d) dir_arg=true;;
+
+ -g) chgrpcmd="$chgrpprog $2"
+ shift;;
+
+ --help) echo "$usage"; exit $?;;
+
+ -m) mode=$2
+ case $mode in
+ *' '* | *' '* | *'
+'* | *'*'* | *'?'* | *'['*)
+ echo "$0: invalid mode: $mode" >&2
+ exit 1;;
+ esac
+ shift;;
+
+ -o) chowncmd="$chownprog $2"
+ shift;;
+
+ -s) stripcmd=$stripprog;;
+
+ -t) dst_arg=$2
+ # Protect names problematic for `test' and other utilities.
+ case $dst_arg in
+ -* | [=\(\)!]) dst_arg=./$dst_arg;;
+ esac
+ shift;;
+
+ -T) no_target_directory=true;;
+
+ --version) echo "$0 $scriptversion"; exit $?;;
+
+ --) shift
+ break;;
+
+ -*) echo "$0: invalid option: $1" >&2
+ exit 1;;
+
+ *) break;;
+ esac
+ shift
+done
+
+if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
+ # When -d is used, all remaining arguments are directories to create.
+ # When -t is used, the destination is already specified.
+ # Otherwise, the last argument is the destination. Remove it from $@.
+ for arg
+ do
+ if test -n "$dst_arg"; then
+ # $@ is not empty: it contains at least $arg.
+ set fnord "$@" "$dst_arg"
+ shift # fnord
+ fi
+ shift # arg
+ dst_arg=$arg
+ # Protect names problematic for `test' and other utilities.
+ case $dst_arg in
+ -* | [=\(\)!]) dst_arg=./$dst_arg;;
+ esac
+ done
+fi
+
+if test $# -eq 0; then
+ if test -z "$dir_arg"; then
+ echo "$0: no input file specified." >&2
+ exit 1
+ fi
+ # It's OK to call `install-sh -d' without argument.
+ # This can happen when creating conditional directories.
+ exit 0
+fi
+
+if test -z "$dir_arg"; then
+ do_exit='(exit $ret); exit $ret'
+ trap "ret=129; $do_exit" 1
+ trap "ret=130; $do_exit" 2
+ trap "ret=141; $do_exit" 13
+ trap "ret=143; $do_exit" 15
+
+ # Set umask so as not to create temps with too-generous modes.
+ # However, 'strip' requires both read and write access to temps.
+ case $mode in
+ # Optimize common cases.
+ *644) cp_umask=133;;
+ *755) cp_umask=22;;
+
+ *[0-7])
+ if test -z "$stripcmd"; then
+ u_plus_rw=
+ else
+ u_plus_rw='% 200'
+ fi
+ cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
+ *)
+ if test -z "$stripcmd"; then
+ u_plus_rw=
+ else
+ u_plus_rw=,u+rw
+ fi
+ cp_umask=$mode$u_plus_rw;;
+ esac
+fi
+
+for src
+do
+ # Protect names problematic for `test' and other utilities.
+ case $src in
+ -* | [=\(\)!]) src=./$src;;
+ esac
+
+ if test -n "$dir_arg"; then
+ dst=$src
+ dstdir=$dst
+ test -d "$dstdir"
+ dstdir_status=$?
+ else
+
+ # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
+ # might cause directories to be created, which would be especially bad
+ # if $src (and thus $dsttmp) contains '*'.
+ if test ! -f "$src" && test ! -d "$src"; then
+ echo "$0: $src does not exist." >&2
+ exit 1
+ fi
+
+ if test -z "$dst_arg"; then
+ echo "$0: no destination specified." >&2
+ exit 1
+ fi
+ dst=$dst_arg
+
+ # If destination is a directory, append the input filename; won't work
+ # if double slashes aren't ignored.
+ if test -d "$dst"; then
+ if test -n "$no_target_directory"; then
+ echo "$0: $dst_arg: Is a directory" >&2
+ exit 1
+ fi
+ dstdir=$dst
+ dst=$dstdir/`basename "$src"`
+ dstdir_status=0
+ else
+ # Prefer dirname, but fall back on a substitute if dirname fails.
+ dstdir=`
+ (dirname "$dst") 2>/dev/null ||
+ expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$dst" : 'X\(//\)[^/]' \| \
+ X"$dst" : 'X\(//\)$' \| \
+ X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
+ echo X"$dst" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'
+ `
+
+ test -d "$dstdir"
+ dstdir_status=$?
+ fi
+ fi
+
+ obsolete_mkdir_used=false
+
+ if test $dstdir_status != 0; then
+ case $posix_mkdir in
+ '')
+ # Create intermediate dirs using mode 755 as modified by the umask.
+ # This is like FreeBSD 'install' as of 1997-10-28.
+ umask=`umask`
+ case $stripcmd.$umask in
+ # Optimize common cases.
+ *[2367][2367]) mkdir_umask=$umask;;
+ .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
+
+ *[0-7])
+ mkdir_umask=`expr $umask + 22 \
+ - $umask % 100 % 40 + $umask % 20 \
+ - $umask % 10 % 4 + $umask % 2
+ `;;
+ *) mkdir_umask=$umask,go-w;;
+ esac
+
+ # With -d, create the new directory with the user-specified mode.
+ # Otherwise, rely on $mkdir_umask.
+ if test -n "$dir_arg"; then
+ mkdir_mode=-m$mode
+ else
+ mkdir_mode=
+ fi
+
+ posix_mkdir=false
+ case $umask in
+ *[123567][0-7][0-7])
+ # POSIX mkdir -p sets u+wx bits regardless of umask, which
+ # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
+ ;;
+ *)
+ tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
+ trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
+
+ if (umask $mkdir_umask &&
+ exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
+ then
+ if test -z "$dir_arg" || {
+ # Check for POSIX incompatibilities with -m.
+ # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
+ # other-writeable bit of parent directory when it shouldn't.
+ # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
+ ls_ld_tmpdir=`ls -ld "$tmpdir"`
+ case $ls_ld_tmpdir in
+ d????-?r-*) different_mode=700;;
+ d????-?--*) different_mode=755;;
+ *) false;;
+ esac &&
+ $mkdirprog -m$different_mode -p -- "$tmpdir" && {
+ ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
+ test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
+ }
+ }
+ then posix_mkdir=:
+ fi
+ rmdir "$tmpdir/d" "$tmpdir"
+ else
+ # Remove any dirs left behind by ancient mkdir implementations.
+ rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
+ fi
+ trap '' 0;;
+ esac;;
+ esac
+
+ if
+ $posix_mkdir && (
+ umask $mkdir_umask &&
+ $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
+ )
+ then :
+ else
+
+ # The umask is ridiculous, or mkdir does not conform to POSIX,
+ # or it failed possibly due to a race condition. Create the
+ # directory the slow way, step by step, checking for races as we go.
+
+ case $dstdir in
+ /*) prefix='/';;
+ [-=\(\)!]*) prefix='./';;
+ *) prefix='';;
+ esac
+
+ eval "$initialize_posix_glob"
+
+ oIFS=$IFS
+ IFS=/
+ $posix_glob set -f
+ set fnord $dstdir
+ shift
+ $posix_glob set +f
+ IFS=$oIFS
+
+ prefixes=
+
+ for d
+ do
+ test X"$d" = X && continue
+
+ prefix=$prefix$d
+ if test -d "$prefix"; then
+ prefixes=
+ else
+ if $posix_mkdir; then
+ (umask=$mkdir_umask &&
+ $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
+ # Don't fail if two instances are running concurrently.
+ test -d "$prefix" || exit 1
+ else
+ case $prefix in
+ *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
+ *) qprefix=$prefix;;
+ esac
+ prefixes="$prefixes '$qprefix'"
+ fi
+ fi
+ prefix=$prefix/
+ done
+
+ if test -n "$prefixes"; then
+ # Don't fail if two instances are running concurrently.
+ (umask $mkdir_umask &&
+ eval "\$doit_exec \$mkdirprog $prefixes") ||
+ test -d "$dstdir" || exit 1
+ obsolete_mkdir_used=true
+ fi
+ fi
+ fi
+
+ if test -n "$dir_arg"; then
+ { test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
+ { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
+ { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
+ test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
+ else
+
+ # Make a couple of temp file names in the proper directory.
+ dsttmp=$dstdir/_inst.$$_
+ rmtmp=$dstdir/_rm.$$_
+
+ # Trap to clean up those temp files at exit.
+ trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
+
+ # Copy the file name to the temp name.
+ (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
+
+ # and set any options; do chmod last to preserve setuid bits.
+ #
+ # If any of these fail, we abort the whole thing. If we want to
+ # ignore errors from any of these, just make sure not to ignore
+ # errors from the above "$doit $cpprog $src $dsttmp" command.
+ #
+ { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
+ { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
+ { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
+ { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
+
+ # If -C, don't bother to copy if it wouldn't change the file.
+ if $copy_on_change &&
+ old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
+ new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
+
+ eval "$initialize_posix_glob" &&
+ $posix_glob set -f &&
+ set X $old && old=:$2:$4:$5:$6 &&
+ set X $new && new=:$2:$4:$5:$6 &&
+ $posix_glob set +f &&
+
+ test "$old" = "$new" &&
+ $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
+ then
+ rm -f "$dsttmp"
+ else
+ # Rename the file to the real destination.
+ $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
+
+ # The rename failed, perhaps because mv can't rename something else
+ # to itself, or perhaps because mv is so ancient that it does not
+ # support -f.
+ {
+ # Now remove or move aside any old file at destination location.
+ # We try this two ways since rm can't unlink itself on some
+ # systems and the destination file might be busy for other
+ # reasons. In this case, the final cleanup might fail but the new
+ # file should still install successfully.
+ {
+ test ! -f "$dst" ||
+ $doit $rmcmd -f "$dst" 2>/dev/null ||
+ { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
+ { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
+ } ||
+ { echo "$0: cannot unlink or rename $dst" >&2
+ (exit 1); exit 1
+ }
+ } &&
+
+ # Now rename the file to the real destination.
+ $doit $mvcmd "$dsttmp" "$dst"
+ }
+ fi || exit 1
+
+ trap '' 0
+ fi
+done
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
--- /dev/null
+#! /bin/sh
+# Common stub for a few missing GNU programs while installing.
+
+scriptversion=2012-01-06.13; # UTC
+
+# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006,
+# 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
+# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+if test $# -eq 0; then
+ echo 1>&2 "Try \`$0 --help' for more information"
+ exit 1
+fi
+
+run=:
+sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p'
+sed_minuso='s/.* -o \([^ ]*\).*/\1/p'
+
+# In the cases where this matters, `missing' is being run in the
+# srcdir already.
+if test -f configure.ac; then
+ configure_ac=configure.ac
+else
+ configure_ac=configure.in
+fi
+
+msg="missing on your system"
+
+case $1 in
+--run)
+ # Try to run requested program, and just exit if it succeeds.
+ run=
+ shift
+ "$@" && exit 0
+ # Exit code 63 means version mismatch. This often happens
+ # when the user try to use an ancient version of a tool on
+ # a file that requires a minimum version. In this case we
+ # we should proceed has if the program had been absent, or
+ # if --run hadn't been passed.
+ if test $? = 63; then
+ run=:
+ msg="probably too old"
+ fi
+ ;;
+
+ -h|--h|--he|--hel|--help)
+ echo "\
+$0 [OPTION]... PROGRAM [ARGUMENT]...
+
+Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
+error status if there is no known handling for PROGRAM.
+
+Options:
+ -h, --help display this help and exit
+ -v, --version output version information and exit
+ --run try to run the given command, and emulate it if it fails
+
+Supported PROGRAM values:
+ aclocal touch file \`aclocal.m4'
+ autoconf touch file \`configure'
+ autoheader touch file \`config.h.in'
+ autom4te touch the output file, or create a stub one
+ automake touch all \`Makefile.in' files
+ bison create \`y.tab.[ch]', if possible, from existing .[ch]
+ flex create \`lex.yy.c', if possible, from existing .c
+ help2man touch the output file
+ lex create \`lex.yy.c', if possible, from existing .c
+ makeinfo touch the output file
+ yacc create \`y.tab.[ch]', if possible, from existing .[ch]
+
+Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and
+\`g' are ignored when checking the name.
+
+Send bug reports to <bug-automake@gnu.org>."
+ exit $?
+ ;;
+
+ -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
+ echo "missing $scriptversion (GNU Automake)"
+ exit $?
+ ;;
+
+ -*)
+ echo 1>&2 "$0: Unknown \`$1' option"
+ echo 1>&2 "Try \`$0 --help' for more information"
+ exit 1
+ ;;
+
+esac
+
+# normalize program name to check for.
+program=`echo "$1" | sed '
+ s/^gnu-//; t
+ s/^gnu//; t
+ s/^g//; t'`
+
+# Now exit if we have it, but it failed. Also exit now if we
+# don't have it and --version was passed (most likely to detect
+# the program). This is about non-GNU programs, so use $1 not
+# $program.
+case $1 in
+ lex*|yacc*)
+ # Not GNU programs, they don't have --version.
+ ;;
+
+ *)
+ if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
+ # We have it, but it failed.
+ exit 1
+ elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
+ # Could not run --version or --help. This is probably someone
+ # running `$TOOL --version' or `$TOOL --help' to check whether
+ # $TOOL exists and not knowing $TOOL uses missing.
+ exit 1
+ fi
+ ;;
+esac
+
+# If it does not exist, or fails to run (possibly an outdated version),
+# try to emulate it.
+case $program in
+ aclocal*)
+ echo 1>&2 "\
+WARNING: \`$1' is $msg. You should only need it if
+ you modified \`acinclude.m4' or \`${configure_ac}'. You might want
+ to install the \`Automake' and \`Perl' packages. Grab them from
+ any GNU archive site."
+ touch aclocal.m4
+ ;;
+
+ autoconf*)
+ echo 1>&2 "\
+WARNING: \`$1' is $msg. You should only need it if
+ you modified \`${configure_ac}'. You might want to install the
+ \`Autoconf' and \`GNU m4' packages. Grab them from any GNU
+ archive site."
+ touch configure
+ ;;
+
+ autoheader*)
+ echo 1>&2 "\
+WARNING: \`$1' is $msg. You should only need it if
+ you modified \`acconfig.h' or \`${configure_ac}'. You might want
+ to install the \`Autoconf' and \`GNU m4' packages. Grab them
+ from any GNU archive site."
+ files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
+ test -z "$files" && files="config.h"
+ touch_files=
+ for f in $files; do
+ case $f in
+ *:*) touch_files="$touch_files "`echo "$f" |
+ sed -e 's/^[^:]*://' -e 's/:.*//'`;;
+ *) touch_files="$touch_files $f.in";;
+ esac
+ done
+ touch $touch_files
+ ;;
+
+ automake*)
+ echo 1>&2 "\
+WARNING: \`$1' is $msg. You should only need it if
+ you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
+ You might want to install the \`Automake' and \`Perl' packages.
+ Grab them from any GNU archive site."
+ find . -type f -name Makefile.am -print |
+ sed 's/\.am$/.in/' |
+ while read f; do touch "$f"; done
+ ;;
+
+ autom4te*)
+ echo 1>&2 "\
+WARNING: \`$1' is needed, but is $msg.
+ You might have modified some files without having the
+ proper tools for further handling them.
+ You can get \`$1' as part of \`Autoconf' from any GNU
+ archive site."
+
+ file=`echo "$*" | sed -n "$sed_output"`
+ test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
+ if test -f "$file"; then
+ touch $file
+ else
+ test -z "$file" || exec >$file
+ echo "#! /bin/sh"
+ echo "# Created by GNU Automake missing as a replacement of"
+ echo "# $ $@"
+ echo "exit 0"
+ chmod +x $file
+ exit 1
+ fi
+ ;;
+
+ bison*|yacc*)
+ echo 1>&2 "\
+WARNING: \`$1' $msg. You should only need it if
+ you modified a \`.y' file. You may need the \`Bison' package
+ in order for those modifications to take effect. You can get
+ \`Bison' from any GNU archive site."
+ rm -f y.tab.c y.tab.h
+ if test $# -ne 1; then
+ eval LASTARG=\${$#}
+ case $LASTARG in
+ *.y)
+ SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
+ if test -f "$SRCFILE"; then
+ cp "$SRCFILE" y.tab.c
+ fi
+ SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
+ if test -f "$SRCFILE"; then
+ cp "$SRCFILE" y.tab.h
+ fi
+ ;;
+ esac
+ fi
+ if test ! -f y.tab.h; then
+ echo >y.tab.h
+ fi
+ if test ! -f y.tab.c; then
+ echo 'main() { return 0; }' >y.tab.c
+ fi
+ ;;
+
+ lex*|flex*)
+ echo 1>&2 "\
+WARNING: \`$1' is $msg. You should only need it if
+ you modified a \`.l' file. You may need the \`Flex' package
+ in order for those modifications to take effect. You can get
+ \`Flex' from any GNU archive site."
+ rm -f lex.yy.c
+ if test $# -ne 1; then
+ eval LASTARG=\${$#}
+ case $LASTARG in
+ *.l)
+ SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
+ if test -f "$SRCFILE"; then
+ cp "$SRCFILE" lex.yy.c
+ fi
+ ;;
+ esac
+ fi
+ if test ! -f lex.yy.c; then
+ echo 'main() { return 0; }' >lex.yy.c
+ fi
+ ;;
+
+ help2man*)
+ echo 1>&2 "\
+WARNING: \`$1' is $msg. You should only need it if
+ you modified a dependency of a manual page. You may need the
+ \`Help2man' package in order for those modifications to take
+ effect. You can get \`Help2man' from any GNU archive site."
+
+ file=`echo "$*" | sed -n "$sed_output"`
+ test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
+ if test -f "$file"; then
+ touch $file
+ else
+ test -z "$file" || exec >$file
+ echo ".ab help2man is required to generate this page"
+ exit $?
+ fi
+ ;;
+
+ makeinfo*)
+ echo 1>&2 "\
+WARNING: \`$1' is $msg. You should only need it if
+ you modified a \`.texi' or \`.texinfo' file, or any other file
+ indirectly affecting the aspect of the manual. The spurious
+ call might also be the consequence of using a buggy \`make' (AIX,
+ DU, IRIX). You might want to install the \`Texinfo' package or
+ the \`GNU make' package. Grab either from any GNU archive site."
+ # The file to touch is that specified with -o ...
+ file=`echo "$*" | sed -n "$sed_output"`
+ test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
+ if test -z "$file"; then
+ # ... or it is the one specified with @setfilename ...
+ infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
+ file=`sed -n '
+ /^@setfilename/{
+ s/.* \([^ ]*\) *$/\1/
+ p
+ q
+ }' $infile`
+ # ... or it is derived from the source name (dir/f.texi becomes f.info)
+ test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info
+ fi
+ # If the file does not exist, the user really needs makeinfo;
+ # let's fail without touching anything.
+ test -f $file || exit 1
+ touch $file
+ ;;
+
+ *)
+ echo 1>&2 "\
+WARNING: \`$1' is needed, and is $msg.
+ You might have modified some files without having the
+ proper tools for further handling them. Check the \`README' file,
+ it often tells you about the needed prerequisites for installing
+ this package. You may also peek at any GNU archive site, in case
+ some other package would contain this missing \`$1' program."
+ exit 1
+ ;;
+esac
+
+exit 0
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
--- /dev/null
+# Put this file in /lib/udev/rules.d or /etc/udev/rules.d
+# Prevent the nvidia card from "randomly" turning on
+DEVPATH=="/module/nvidia", ACTION=="remove", RUN+="/bin/rm -f /dev/nvidiactl /dev/nvidia0 /dev/nvidia1"
+
+# Create devices files upon loading the module
+DEVPATH=="/module/nvidia", ACTION=="add", RUN+="/bin/mknod -m 666 /dev/nvidiactl c 195 255"
+DEVPATH=="/module/nvidia", ACTION=="add", RUN+="/bin/mknod -m 666 /dev/nvidia0 c 195 0"
--- /dev/null
+# Configuration file for Bumblebee. Values should **not** be put between quotes
+
+## Server options. Any change made in this section will need a server restart
+# to take effect.
+[bumblebeed]
+# The secondary Xorg server DISPLAY number
+VirtualDisplay=@CONF_XDISP@
+# Should the unused Xorg server be kept running? Set this to true if waiting
+# for X to be ready is too long and don't need power management at all.
+KeepUnusedXServer=@CONF_KEEPONEXIT@
+# The name of the Bumbleblee server group name (GID name)
+ServerGroup=@CONF_GID@
+# Card power state at exit. Set to false if the card shoud be ON when Bumblebee
+# server exits.
+TurnCardOffAtExit=@CONF_TURNOFFATEXIT@
+# The default behavior of '-f' option on optirun. If set to "true", '-f' will
+# be ignored.
+NoEcoModeOverride=false
+# The Driver used by Bumblebee server. If this value is not set (or empty),
+# auto-detection is performed. The available drivers are nvidia and nouveau
+# (See also the driver-specific sections below)
+Driver=@CONF_DRIVER@
+# Directory with a dummy config file to pass as a -configdir to secondary X
+XorgConfDir=@XCONFDDIR@
+
+## Client options. Will take effect on the next optirun executed.
+[optirun]
+# Acceleration/ rendering bridge, possible values are auto, virtualgl and
+# primus.
+Bridge=@CONF_BRIDGE@
+# The method used for VirtualGL to transport frames between X servers.
+# Possible values are proxy, jpeg, rgb, xv and yuv.
+VGLTransport=@CONF_VGLCOMPRESS@
+# List of paths which are searched for the primus libGL.so.1 when using
+# the primus bridge
+PrimusLibraryPath=@CONF_PRIMUS_LD_PATH@
+# Should the program run under optirun even if Bumblebee server or nvidia card
+# is not available?
+AllowFallbackToIGC=@CONF_FALLBACKSTART@
+
+
+# Driver-specific settings are grouped under [driver-NAME]. The sections are
+# parsed if the Driver setting in [bumblebeed] is set to NAME (or if auto-
+# detection resolves to NAME).
+# PMMethod: method to use for saving power by disabling the nvidia card, valid
+# values are: auto - automatically detect which PM method to use
+# bbswitch - new in BB 3, recommended if available
+# switcheroo - vga_switcheroo method, use at your own risk
+# none - disable PM completely
+# https://github.com/Bumblebee-Project/Bumblebee/wiki/Comparison-of-PM-methods
+
+## Section with nvidia driver specific options, only parsed if Driver=nvidia
+[driver-nvidia]
+# Module name to load, defaults to Driver if empty or unset
+KernelDriver=@CONF_DRIVER_MODULE_NVIDIA@
+PMMethod=@CONF_PM_METHOD@
+# colon-separated path to the nvidia libraries
+LibraryPath=@CONF_LDPATH_NVIDIA@
+# comma-separated path of the directory containing nvidia_drv.so and the
+# default Xorg modules path
+XorgModulePath=@CONF_MODPATH_NVIDIA@
+XorgConfFile=@BBCONFDIR@/xorg.conf.nvidia
+
+## Section with nouveau driver specific options, only parsed if Driver=nouveau
+[driver-nouveau]
+KernelDriver=nouveau
+PMMethod=@CONF_PM_METHOD@
+XorgConfFile=@BBCONFDIR@/xorg.conf.nouveau
+
--- /dev/null
+Section "ServerLayout"
+ Identifier "Layout0"
+ Option "AutoAddDevices" "false"
+ Option "AutoAddGPU" "false"
+EndSection
+
+Section "Device"
+ Identifier "DiscreteNvidia"
+ Driver "nouveau"
+
+# If the X server does not automatically detect your VGA device,
+# you can manually set it here.
+# To get the BusID prop, run `lspci | egrep 'VGA|3D'` and input the data
+# as you see in the commented example.
+# This Setting is needed on Ubuntu 13.04.
+# BusID "PCI:01:00:0"
+
+EndSection
--- /dev/null
+Section "ServerLayout"
+ Identifier "Layout0"
+ Option "AutoAddDevices" "false"
+ Option "AutoAddGPU" "false"
+EndSection
+
+Section "Device"
+ Identifier "DiscreteNvidia"
+ Driver "nvidia"
+ VendorName "NVIDIA Corporation"
+
+# If the X server does not automatically detect your VGA device,
+# you can manually set it here.
+# To get the BusID prop, run `lspci | egrep 'VGA|3D'` and input the data
+# as you see in the commented example.
+# This Setting may be needed in some platforms with more than one
+# nvidia card, which may confuse the proprietary driver (e.g.,
+# trying to take ownership of the wrong device). Also needed on Ubuntu 13.04.
+# BusID "PCI:01:00:0"
+
+# Setting ProbeAllGpus to false prevents the new proprietary driver
+# instance spawned to try to control the integrated graphics card,
+# which is already being managed outside bumblebee.
+# This option doesn't hurt and it is required on platforms running
+# more than one nvidia graphics card with the proprietary driver.
+# (E.g. Macbook Pro pre-2010 with nVidia 9400M + 9600M GT).
+# If this option is not set, the new Xorg may blacken the screen and
+# render it unusable (unless you have some way to run killall Xorg).
+ Option "ProbeAllGpus" "false"
+
+ Option "NoLogo" "true"
+ Option "UseEDID" "false"
+ Option "UseDisplayDevice" "none"
+EndSection
--- /dev/null
+#! /bin/sh
+# Guess values for system-dependent variables and create Makefiles.
+# Generated by GNU Autoconf 2.69 for bumblebee 3.2.1.
+#
+#
+# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
+#
+#
+# This configure script is free software; the Free Software Foundation
+# gives unlimited permission to copy, distribute and modify it.
+## -------------------- ##
+## M4sh Initialization. ##
+## -------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
+ emulate sh
+ NULLCMD=:
+ # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+ setopt NO_GLOB_SUBST
+else
+ case `(set -o) 2>/dev/null` in #(
+ *posix*) :
+ set -o posix ;; #(
+ *) :
+ ;;
+esac
+fi
+
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+# Prefer a ksh shell builtin over an external printf program on Solaris,
+# but without wasting forks for bash or zsh.
+if test -z "$BASH_VERSION$ZSH_VERSION" \
+ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='print -r --'
+ as_echo_n='print -rn --'
+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='printf %s\n'
+ as_echo_n='printf %s'
+else
+ if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+ as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+ as_echo_n='/usr/ucb/echo -n'
+ else
+ as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+ as_echo_n_body='eval
+ arg=$1;
+ case $arg in #(
+ *"$as_nl"*)
+ expr "X$arg" : "X\\(.*\\)$as_nl";
+ arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+ esac;
+ expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+ '
+ export as_echo_n_body
+ as_echo_n='sh -c $as_echo_n_body as_echo'
+ fi
+ export as_echo_body
+ as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ PATH_SEPARATOR=:
+ (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+ (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+ PATH_SEPARATOR=';'
+ }
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order. Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" "" $as_nl"
+
+# Find who we are. Look in the path if we contain no directory separator.
+as_myself=
+case $0 in #((
+ *[\\/]* ) as_myself=$0 ;;
+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+ as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+ $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+ exit 1
+fi
+
+# Unset variables that we do not need and which cause bugs (e.g. in
+# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
+# suppresses any "Segmentation fault" message there. '((' could
+# trigger a bug in pdksh 5.2.14.
+for as_var in BASH_ENV ENV MAIL MAILPATH
+do eval test x\${$as_var+set} = xset \
+ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+# Use a proper internal environment variable to ensure we don't fall
+ # into an infinite loop, continuously re-executing ourselves.
+ if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then
+ _as_can_reexec=no; export _as_can_reexec;
+ # We cannot yet assume a decent shell, so we have to provide a
+# neutralization value for shells without unset; and this also
+# works around shells that cannot unset nonexistent variables.
+# Preserve -v and -x to the replacement shell.
+BASH_ENV=/dev/null
+ENV=/dev/null
+(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+case $- in # ((((
+ *v*x* | *x*v* ) as_opts=-vx ;;
+ *v* ) as_opts=-v ;;
+ *x* ) as_opts=-x ;;
+ * ) as_opts= ;;
+esac
+exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
+# Admittedly, this is quite paranoid, since all the known shells bail
+# out after a failed `exec'.
+$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
+as_fn_exit 255
+ fi
+ # We don't want this to propagate to other subprocesses.
+ { _as_can_reexec=; unset _as_can_reexec;}
+if test "x$CONFIG_SHELL" = x; then
+ as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
+ emulate sh
+ NULLCMD=:
+ # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '\${1+\"\$@\"}'='\"\$@\"'
+ setopt NO_GLOB_SUBST
+else
+ case \`(set -o) 2>/dev/null\` in #(
+ *posix*) :
+ set -o posix ;; #(
+ *) :
+ ;;
+esac
+fi
+"
+ as_required="as_fn_return () { (exit \$1); }
+as_fn_success () { as_fn_return 0; }
+as_fn_failure () { as_fn_return 1; }
+as_fn_ret_success () { return 0; }
+as_fn_ret_failure () { return 1; }
+
+exitcode=0
+as_fn_success || { exitcode=1; echo as_fn_success failed.; }
+as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }
+as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }
+as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }
+if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
+
+else
+ exitcode=1; echo positional parameters were not saved.
+fi
+test x\$exitcode = x0 || exit 1
+test -x / || exit 1"
+ as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
+ as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
+ eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
+ test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1"
+ if (eval "$as_required") 2>/dev/null; then :
+ as_have_required=yes
+else
+ as_have_required=no
+fi
+ if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then :
+
+else
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+as_found=false
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ as_found=:
+ case $as_dir in #(
+ /*)
+ for as_base in sh bash ksh sh5; do
+ # Try only shells that exist, to save several forks.
+ as_shell=$as_dir/$as_base
+ if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
+ { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then :
+ CONFIG_SHELL=$as_shell as_have_required=yes
+ if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then :
+ break 2
+fi
+fi
+ done;;
+ esac
+ as_found=false
+done
+$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
+ { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then :
+ CONFIG_SHELL=$SHELL as_have_required=yes
+fi; }
+IFS=$as_save_IFS
+
+
+ if test "x$CONFIG_SHELL" != x; then :
+ export CONFIG_SHELL
+ # We cannot yet assume a decent shell, so we have to provide a
+# neutralization value for shells without unset; and this also
+# works around shells that cannot unset nonexistent variables.
+# Preserve -v and -x to the replacement shell.
+BASH_ENV=/dev/null
+ENV=/dev/null
+(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+case $- in # ((((
+ *v*x* | *x*v* ) as_opts=-vx ;;
+ *v* ) as_opts=-v ;;
+ *x* ) as_opts=-x ;;
+ * ) as_opts= ;;
+esac
+exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
+# Admittedly, this is quite paranoid, since all the known shells bail
+# out after a failed `exec'.
+$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
+exit 255
+fi
+
+ if test x$as_have_required = xno; then :
+ $as_echo "$0: This script requires a shell more modern than all"
+ $as_echo "$0: the shells that I found on your system."
+ if test x${ZSH_VERSION+set} = xset ; then
+ $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should"
+ $as_echo "$0: be upgraded to zsh 4.3.4 or later."
+ else
+ $as_echo "$0: Please tell bug-autoconf@gnu.org about your system,
+$0: including any error possibly output before this
+$0: message. Then install a modern shell, or manually run
+$0: the script under such a shell if you do have one."
+ fi
+ exit 1
+fi
+fi
+fi
+SHELL=${CONFIG_SHELL-/bin/sh}
+export SHELL
+# Unset more variables known to interfere with behavior of common tools.
+CLICOLOR_FORCE= GREP_OPTIONS=
+unset CLICOLOR_FORCE GREP_OPTIONS
+
+## --------------------- ##
+## M4sh Shell Functions. ##
+## --------------------- ##
+# as_fn_unset VAR
+# ---------------
+# Portably unset VAR.
+as_fn_unset ()
+{
+ { eval $1=; unset $1;}
+}
+as_unset=as_fn_unset
+
+# as_fn_set_status STATUS
+# -----------------------
+# Set $? to STATUS, without forking.
+as_fn_set_status ()
+{
+ return $1
+} # as_fn_set_status
+
+# as_fn_exit STATUS
+# -----------------
+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
+as_fn_exit ()
+{
+ set +e
+ as_fn_set_status $1
+ exit $1
+} # as_fn_exit
+
+# as_fn_mkdir_p
+# -------------
+# Create "$as_dir" as a directory, including parents if necessary.
+as_fn_mkdir_p ()
+{
+
+ case $as_dir in #(
+ -*) as_dir=./$as_dir;;
+ esac
+ test -d "$as_dir" || eval $as_mkdir_p || {
+ as_dirs=
+ while :; do
+ case $as_dir in #(
+ *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+ *) as_qdir=$as_dir;;
+ esac
+ as_dirs="'$as_qdir' $as_dirs"
+ as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ test -d "$as_dir" && break
+ done
+ test -z "$as_dirs" || eval "mkdir $as_dirs"
+ } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
+
+
+} # as_fn_mkdir_p
+
+# as_fn_executable_p FILE
+# -----------------------
+# Test if FILE is an executable regular file.
+as_fn_executable_p ()
+{
+ test -f "$1" && test -x "$1"
+} # as_fn_executable_p
+# as_fn_append VAR VALUE
+# ----------------------
+# Append the text in VALUE to the end of the definition contained in VAR. Take
+# advantage of any shell optimizations that allow amortized linear growth over
+# repeated appends, instead of the typical quadratic growth present in naive
+# implementations.
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+ eval 'as_fn_append ()
+ {
+ eval $1+=\$2
+ }'
+else
+ as_fn_append ()
+ {
+ eval $1=\$$1\$2
+ }
+fi # as_fn_append
+
+# as_fn_arith ARG...
+# ------------------
+# Perform arithmetic evaluation on the ARGs, and store the result in the
+# global $as_val. Take advantage of shells that can avoid forks. The arguments
+# must be portable across $(()) and expr.
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+ eval 'as_fn_arith ()
+ {
+ as_val=$(( $* ))
+ }'
+else
+ as_fn_arith ()
+ {
+ as_val=`expr "$@" || test $? -eq 1`
+ }
+fi # as_fn_arith
+
+
+# as_fn_error STATUS ERROR [LINENO LOG_FD]
+# ----------------------------------------
+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
+# script with STATUS, using 1 if that was 0.
+as_fn_error ()
+{
+ as_status=$1; test $as_status -eq 0 && as_status=1
+ if test "$4"; then
+ as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
+ fi
+ $as_echo "$as_me: error: $2" >&2
+ as_fn_exit $as_status
+} # as_fn_error
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+ test "X`expr 00001 : '.*\(...\)'`" = X001; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+ as_basename=basename
+else
+ as_basename=false
+fi
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+ as_dirname=dirname
+else
+ as_dirname=false
+fi
+
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+ sed '/^.*\/\([^/][^/]*\)\/*$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+
+ as_lineno_1=$LINENO as_lineno_1a=$LINENO
+ as_lineno_2=$LINENO as_lineno_2a=$LINENO
+ eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
+ test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
+ # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-)
+ sed -n '
+ p
+ /[$]LINENO/=
+ ' <$as_myself |
+ sed '
+ s/[$]LINENO.*/&-/
+ t lineno
+ b
+ :lineno
+ N
+ :loop
+ s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+ t loop
+ s/-\n.*//
+ ' >$as_me.lineno &&
+ chmod +x "$as_me.lineno" ||
+ { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
+
+ # If we had to re-execute with $CONFIG_SHELL, we're ensured to have
+ # already done that, so ensure we don't try to do so again and fall
+ # in an infinite loop. This has already happened in practice.
+ _as_can_reexec=no; export _as_can_reexec
+ # Don't try to exec as it changes $[0], causing all sort of problems
+ # (the dirname of $[0] is not the place where we might find the
+ # original and so on. Autoconf is especially sensitive to this).
+ . "./$as_me.lineno"
+ # Exit status is that of the last command.
+ exit
+}
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in #(((((
+-n*)
+ case `echo 'xy\c'` in
+ *c*) ECHO_T=' ';; # ECHO_T is single tab character.
+ xy) ECHO_C='\c';;
+ *) echo `echo ksh88 bug on AIX 6.1` > /dev/null
+ ECHO_T=' ';;
+ esac;;
+*)
+ ECHO_N='-n';;
+esac
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+ rm -f conf$$.dir/conf$$.file
+else
+ rm -f conf$$.dir
+ mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+ if ln -s conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s='ln -s'
+ # ... but there are two gotchas:
+ # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+ # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+ # In both cases, we have to default to `cp -pR'.
+ ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+ as_ln_s='cp -pR'
+ elif ln conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s=ln
+ else
+ as_ln_s='cp -pR'
+ fi
+else
+ as_ln_s='cp -pR'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+if mkdir -p . 2>/dev/null; then
+ as_mkdir_p='mkdir -p "$as_dir"'
+else
+ test -d ./-p && rmdir ./-p
+ as_mkdir_p=false
+fi
+
+as_test_x='test -x'
+as_executable_p=as_fn_executable_p
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+test -n "$DJDIR" || exec 7<&0 </dev/null
+exec 6>&1
+
+# Name of the host.
+# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status,
+# so uname gets run too.
+ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
+
+#
+# Initializations.
+#
+ac_default_prefix=/usr/local
+ac_clean_files=
+ac_config_libobj_dir=.
+LIBOBJS=
+cross_compiling=no
+subdirs=
+MFLAGS=
+MAKEFLAGS=
+
+# Identity of this package.
+PACKAGE_NAME='bumblebee'
+PACKAGE_TARNAME='bumblebee'
+PACKAGE_VERSION='3.2.1'
+PACKAGE_STRING='bumblebee 3.2.1'
+PACKAGE_BUGREPORT=''
+PACKAGE_URL=''
+
+ac_unique_file="src/bbsocket.c"
+ac_subst_vars='am__EXEEXT_FALSE
+am__EXEEXT_TRUE
+LTLIBOBJS
+LIBOBJS
+libbsd_LIBS
+libbsd_CFLAGS
+glib_LIBS
+glib_CFLAGS
+x11_LIBS
+x11_CFLAGS
+PKG_CONFIG_LIBDIR
+PKG_CONFIG_PATH
+PKG_CONFIG
+regular_CFLAGS
+regular_CPPFLAGS
+HAVE_HELP2MAN_FALSE
+HAVE_HELP2MAN_TRUE
+HELP2MAN
+am__fastdepCC_FALSE
+am__fastdepCC_TRUE
+CCDEPMODE
+am__nodep
+AMDEPBACKSLASH
+AMDEP_FALSE
+AMDEP_TRUE
+am__quote
+am__include
+DEPDIR
+OBJEXT
+EXEEXT
+ac_ct_CC
+CPPFLAGS
+LDFLAGS
+CFLAGS
+CC
+WITH_UDEV_RULES_FALSE
+WITH_UDEV_RULES_TRUE
+UDEV_RULES_DIR
+WITH_PIDFILE_FALSE
+WITH_PIDFILE_TRUE
+am__untar
+am__tar
+AMTAR
+am__leading_dot
+SET_MAKE
+AWK
+mkdir_p
+MKDIR_P
+INSTALL_STRIP_PROGRAM
+STRIP
+install_sh
+MAKEINFO
+AUTOHEADER
+AUTOMAKE
+AUTOCONF
+ACLOCAL
+VERSION
+PACKAGE
+CYGPATH_W
+am__isrc
+INSTALL_DATA
+INSTALL_SCRIPT
+INSTALL_PROGRAM
+CONF_MODPATH_NVIDIA
+CONF_LDPATH_NVIDIA
+CONF_DRIVER_MODULE_NVIDIA
+CONF_DRIVER
+CONF_PM_METHOD
+CONF_PIDFILE
+CONF_PRIMUS_LD_PATH
+CONF_BRIDGE
+CONF_TURNOFFATEXIT
+CONF_VGLCOMPRESS
+CONF_FALLBACKSTART
+CONF_KEEPONEXIT
+CONF_GID
+CONF_SOCKPATH
+CONF_XDISP
+target_alias
+host_alias
+build_alias
+LIBS
+ECHO_T
+ECHO_N
+ECHO_C
+DEFS
+mandir
+localedir
+libdir
+psdir
+pdfdir
+dvidir
+htmldir
+infodir
+docdir
+oldincludedir
+includedir
+localstatedir
+sharedstatedir
+sysconfdir
+datadir
+datarootdir
+libexecdir
+sbindir
+bindir
+program_transform_name
+prefix
+exec_prefix
+PACKAGE_URL
+PACKAGE_BUGREPORT
+PACKAGE_STRING
+PACKAGE_VERSION
+PACKAGE_TARNAME
+PACKAGE_NAME
+PATH_SEPARATOR
+SHELL'
+ac_subst_files=''
+ac_user_opts='
+enable_option_checking
+with_pidfile
+with_udev_rules
+enable_dependency_tracking
+'
+ ac_precious_vars='build_alias
+host_alias
+target_alias
+CONF_BRIDGE
+CONF_PRIMUS_LD_PATH
+CONF_PIDFILE
+CONF_PM_METHOD
+CONF_DRIVER
+CONF_DRIVER_MODULE_NVIDIA
+CONF_LDPATH_NVIDIA
+CONF_MODPATH_NVIDIA
+CC
+CFLAGS
+LDFLAGS
+LIBS
+CPPFLAGS
+PKG_CONFIG
+PKG_CONFIG_PATH
+PKG_CONFIG_LIBDIR
+x11_CFLAGS
+x11_LIBS
+glib_CFLAGS
+glib_LIBS
+libbsd_CFLAGS
+libbsd_LIBS'
+
+
+# Initialize some variables set by options.
+ac_init_help=
+ac_init_version=false
+ac_unrecognized_opts=
+ac_unrecognized_sep=
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+cache_file=/dev/null
+exec_prefix=NONE
+no_create=
+no_recursion=
+prefix=NONE
+program_prefix=NONE
+program_suffix=NONE
+program_transform_name=s,x,x,
+silent=
+site=
+srcdir=
+verbose=
+x_includes=NONE
+x_libraries=NONE
+
+# Installation directory options.
+# These are left unexpanded so users can "make install exec_prefix=/foo"
+# and all the variables that are supposed to be based on exec_prefix
+# by default will actually change.
+# Use braces instead of parens because sh, perl, etc. also accept them.
+# (The list follows the same order as the GNU Coding Standards.)
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datarootdir='${prefix}/share'
+datadir='${datarootdir}'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
+infodir='${datarootdir}/info'
+htmldir='${docdir}'
+dvidir='${docdir}'
+pdfdir='${docdir}'
+psdir='${docdir}'
+libdir='${exec_prefix}/lib'
+localedir='${datarootdir}/locale'
+mandir='${datarootdir}/man'
+
+ac_prev=
+ac_dashdash=
+for ac_option
+do
+ # If the previous option needs an argument, assign it.
+ if test -n "$ac_prev"; then
+ eval $ac_prev=\$ac_option
+ ac_prev=
+ continue
+ fi
+
+ case $ac_option in
+ *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
+ *=) ac_optarg= ;;
+ *) ac_optarg=yes ;;
+ esac
+
+ # Accept the important Cygnus configure options, so we can diagnose typos.
+
+ case $ac_dashdash$ac_option in
+ --)
+ ac_dashdash=yes ;;
+
+ -bindir | --bindir | --bindi | --bind | --bin | --bi)
+ ac_prev=bindir ;;
+ -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+ bindir=$ac_optarg ;;
+
+ -build | --build | --buil | --bui | --bu)
+ ac_prev=build_alias ;;
+ -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+ build_alias=$ac_optarg ;;
+
+ -cache-file | --cache-file | --cache-fil | --cache-fi \
+ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+ ac_prev=cache_file ;;
+ -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+ cache_file=$ac_optarg ;;
+
+ --config-cache | -C)
+ cache_file=config.cache ;;
+
+ -datadir | --datadir | --datadi | --datad)
+ ac_prev=datadir ;;
+ -datadir=* | --datadir=* | --datadi=* | --datad=*)
+ datadir=$ac_optarg ;;
+
+ -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
+ | --dataroo | --dataro | --datar)
+ ac_prev=datarootdir ;;
+ -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
+ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
+ datarootdir=$ac_optarg ;;
+
+ -disable-* | --disable-*)
+ ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ as_fn_error $? "invalid feature name: $ac_useropt"
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"enable_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval enable_$ac_useropt=no ;;
+
+ -docdir | --docdir | --docdi | --doc | --do)
+ ac_prev=docdir ;;
+ -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
+ docdir=$ac_optarg ;;
+
+ -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
+ ac_prev=dvidir ;;
+ -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
+ dvidir=$ac_optarg ;;
+
+ -enable-* | --enable-*)
+ ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ as_fn_error $? "invalid feature name: $ac_useropt"
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"enable_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval enable_$ac_useropt=\$ac_optarg ;;
+
+ -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
+ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
+ | --exec | --exe | --ex)
+ ac_prev=exec_prefix ;;
+ -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
+ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
+ | --exec=* | --exe=* | --ex=*)
+ exec_prefix=$ac_optarg ;;
+
+ -gas | --gas | --ga | --g)
+ # Obsolete; use --with-gas.
+ with_gas=yes ;;
+
+ -help | --help | --hel | --he | -h)
+ ac_init_help=long ;;
+ -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
+ ac_init_help=recursive ;;
+ -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
+ ac_init_help=short ;;
+
+ -host | --host | --hos | --ho)
+ ac_prev=host_alias ;;
+ -host=* | --host=* | --hos=* | --ho=*)
+ host_alias=$ac_optarg ;;
+
+ -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
+ ac_prev=htmldir ;;
+ -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
+ | --ht=*)
+ htmldir=$ac_optarg ;;
+
+ -includedir | --includedir | --includedi | --included | --include \
+ | --includ | --inclu | --incl | --inc)
+ ac_prev=includedir ;;
+ -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
+ | --includ=* | --inclu=* | --incl=* | --inc=*)
+ includedir=$ac_optarg ;;
+
+ -infodir | --infodir | --infodi | --infod | --info | --inf)
+ ac_prev=infodir ;;
+ -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
+ infodir=$ac_optarg ;;
+
+ -libdir | --libdir | --libdi | --libd)
+ ac_prev=libdir ;;
+ -libdir=* | --libdir=* | --libdi=* | --libd=*)
+ libdir=$ac_optarg ;;
+
+ -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
+ | --libexe | --libex | --libe)
+ ac_prev=libexecdir ;;
+ -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
+ | --libexe=* | --libex=* | --libe=*)
+ libexecdir=$ac_optarg ;;
+
+ -localedir | --localedir | --localedi | --localed | --locale)
+ ac_prev=localedir ;;
+ -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
+ localedir=$ac_optarg ;;
+
+ -localstatedir | --localstatedir | --localstatedi | --localstated \
+ | --localstate | --localstat | --localsta | --localst | --locals)
+ ac_prev=localstatedir ;;
+ -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
+ localstatedir=$ac_optarg ;;
+
+ -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+ ac_prev=mandir ;;
+ -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+ mandir=$ac_optarg ;;
+
+ -nfp | --nfp | --nf)
+ # Obsolete; use --without-fp.
+ with_fp=no ;;
+
+ -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+ | --no-cr | --no-c | -n)
+ no_create=yes ;;
+
+ -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
+ no_recursion=yes ;;
+
+ -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
+ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
+ | --oldin | --oldi | --old | --ol | --o)
+ ac_prev=oldincludedir ;;
+ -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
+ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
+ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
+ oldincludedir=$ac_optarg ;;
+
+ -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+ ac_prev=prefix ;;
+ -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+ prefix=$ac_optarg ;;
+
+ -program-prefix | --program-prefix | --program-prefi | --program-pref \
+ | --program-pre | --program-pr | --program-p)
+ ac_prev=program_prefix ;;
+ -program-prefix=* | --program-prefix=* | --program-prefi=* \
+ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
+ program_prefix=$ac_optarg ;;
+
+ -program-suffix | --program-suffix | --program-suffi | --program-suff \
+ | --program-suf | --program-su | --program-s)
+ ac_prev=program_suffix ;;
+ -program-suffix=* | --program-suffix=* | --program-suffi=* \
+ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
+ program_suffix=$ac_optarg ;;
+
+ -program-transform-name | --program-transform-name \
+ | --program-transform-nam | --program-transform-na \
+ | --program-transform-n | --program-transform- \
+ | --program-transform | --program-transfor \
+ | --program-transfo | --program-transf \
+ | --program-trans | --program-tran \
+ | --progr-tra | --program-tr | --program-t)
+ ac_prev=program_transform_name ;;
+ -program-transform-name=* | --program-transform-name=* \
+ | --program-transform-nam=* | --program-transform-na=* \
+ | --program-transform-n=* | --program-transform-=* \
+ | --program-transform=* | --program-transfor=* \
+ | --program-transfo=* | --program-transf=* \
+ | --program-trans=* | --program-tran=* \
+ | --progr-tra=* | --program-tr=* | --program-t=*)
+ program_transform_name=$ac_optarg ;;
+
+ -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
+ ac_prev=pdfdir ;;
+ -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
+ pdfdir=$ac_optarg ;;
+
+ -psdir | --psdir | --psdi | --psd | --ps)
+ ac_prev=psdir ;;
+ -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
+ psdir=$ac_optarg ;;
+
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil)
+ silent=yes ;;
+
+ -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+ ac_prev=sbindir ;;
+ -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+ | --sbi=* | --sb=*)
+ sbindir=$ac_optarg ;;
+
+ -sharedstatedir | --sharedstatedir | --sharedstatedi \
+ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+ | --sharedst | --shareds | --shared | --share | --shar \
+ | --sha | --sh)
+ ac_prev=sharedstatedir ;;
+ -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
+ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+ | --sha=* | --sh=*)
+ sharedstatedir=$ac_optarg ;;
+
+ -site | --site | --sit)
+ ac_prev=site ;;
+ -site=* | --site=* | --sit=*)
+ site=$ac_optarg ;;
+
+ -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+ ac_prev=srcdir ;;
+ -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+ srcdir=$ac_optarg ;;
+
+ -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
+ | --syscon | --sysco | --sysc | --sys | --sy)
+ ac_prev=sysconfdir ;;
+ -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
+ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
+ sysconfdir=$ac_optarg ;;
+
+ -target | --target | --targe | --targ | --tar | --ta | --t)
+ ac_prev=target_alias ;;
+ -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+ target_alias=$ac_optarg ;;
+
+ -v | -verbose | --verbose | --verbos | --verbo | --verb)
+ verbose=yes ;;
+
+ -version | --version | --versio | --versi | --vers | -V)
+ ac_init_version=: ;;
+
+ -with-* | --with-*)
+ ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ as_fn_error $? "invalid package name: $ac_useropt"
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"with_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval with_$ac_useropt=\$ac_optarg ;;
+
+ -without-* | --without-*)
+ ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ as_fn_error $? "invalid package name: $ac_useropt"
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"with_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval with_$ac_useropt=no ;;
+
+ --x)
+ # Obsolete; use --with-x.
+ with_x=yes ;;
+
+ -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
+ | --x-incl | --x-inc | --x-in | --x-i)
+ ac_prev=x_includes ;;
+ -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
+ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
+ x_includes=$ac_optarg ;;
+
+ -x-libraries | --x-libraries | --x-librarie | --x-librari \
+ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
+ ac_prev=x_libraries ;;
+ -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
+ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
+ x_libraries=$ac_optarg ;;
+
+ -*) as_fn_error $? "unrecognized option: \`$ac_option'
+Try \`$0 --help' for more information"
+ ;;
+
+ *=*)
+ ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
+ # Reject names that are not valid shell variable names.
+ case $ac_envvar in #(
+ '' | [0-9]* | *[!_$as_cr_alnum]* )
+ as_fn_error $? "invalid variable name: \`$ac_envvar'" ;;
+ esac
+ eval $ac_envvar=\$ac_optarg
+ export $ac_envvar ;;
+
+ *)
+ # FIXME: should be removed in autoconf 3.0.
+ $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+ expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+ $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
+ : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}"
+ ;;
+
+ esac
+done
+
+if test -n "$ac_prev"; then
+ ac_option=--`echo $ac_prev | sed 's/_/-/g'`
+ as_fn_error $? "missing argument to $ac_option"
+fi
+
+if test -n "$ac_unrecognized_opts"; then
+ case $enable_option_checking in
+ no) ;;
+ fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;;
+ *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
+ esac
+fi
+
+# Check all directory arguments for consistency.
+for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
+ datadir sysconfdir sharedstatedir localstatedir includedir \
+ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
+ libdir localedir mandir
+do
+ eval ac_val=\$$ac_var
+ # Remove trailing slashes.
+ case $ac_val in
+ */ )
+ ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
+ eval $ac_var=\$ac_val;;
+ esac
+ # Be sure to have absolute directory names.
+ case $ac_val in
+ [\\/$]* | ?:[\\/]* ) continue;;
+ NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
+ esac
+ as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val"
+done
+
+# There might be people who depend on the old broken behavior: `$host'
+# used to hold the argument of --host etc.
+# FIXME: To remove some day.
+build=$build_alias
+host=$host_alias
+target=$target_alias
+
+# FIXME: To remove some day.
+if test "x$host_alias" != x; then
+ if test "x$build_alias" = x; then
+ cross_compiling=maybe
+ elif test "x$build_alias" != "x$host_alias"; then
+ cross_compiling=yes
+ fi
+fi
+
+ac_tool_prefix=
+test -n "$host_alias" && ac_tool_prefix=$host_alias-
+
+test "$silent" = yes && exec 6>/dev/null
+
+
+ac_pwd=`pwd` && test -n "$ac_pwd" &&
+ac_ls_di=`ls -di .` &&
+ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
+ as_fn_error $? "working directory cannot be determined"
+test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
+ as_fn_error $? "pwd does not report name of working directory"
+
+
+# Find the source files, if location was not specified.
+if test -z "$srcdir"; then
+ ac_srcdir_defaulted=yes
+ # Try the directory containing this script, then the parent directory.
+ ac_confdir=`$as_dirname -- "$as_myself" ||
+$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_myself" : 'X\(//\)[^/]' \| \
+ X"$as_myself" : 'X\(//\)$' \| \
+ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_myself" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ srcdir=$ac_confdir
+ if test ! -r "$srcdir/$ac_unique_file"; then
+ srcdir=..
+ fi
+else
+ ac_srcdir_defaulted=no
+fi
+if test ! -r "$srcdir/$ac_unique_file"; then
+ test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
+ as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir"
+fi
+ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
+ac_abs_confdir=`(
+ cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg"
+ pwd)`
+# When building in place, set srcdir=.
+if test "$ac_abs_confdir" = "$ac_pwd"; then
+ srcdir=.
+fi
+# Remove unnecessary trailing slashes from srcdir.
+# Double slashes in file names in object file debugging info
+# mess up M-x gdb in Emacs.
+case $srcdir in
+*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
+esac
+for ac_var in $ac_precious_vars; do
+ eval ac_env_${ac_var}_set=\${${ac_var}+set}
+ eval ac_env_${ac_var}_value=\$${ac_var}
+ eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
+ eval ac_cv_env_${ac_var}_value=\$${ac_var}
+done
+
+#
+# Report the --help message.
+#
+if test "$ac_init_help" = "long"; then
+ # Omit some internal or obsolete options to make the list less imposing.
+ # This message is too long to be a string in the A/UX 3.1 sh.
+ cat <<_ACEOF
+\`configure' configures bumblebee 3.2.1 to adapt to many kinds of systems.
+
+Usage: $0 [OPTION]... [VAR=VALUE]...
+
+To assign environment variables (e.g., CC, CFLAGS...), specify them as
+VAR=VALUE. See below for descriptions of some of the useful variables.
+
+Defaults for the options are specified in brackets.
+
+Configuration:
+ -h, --help display this help and exit
+ --help=short display options specific to this package
+ --help=recursive display the short help of all the included packages
+ -V, --version display version information and exit
+ -q, --quiet, --silent do not print \`checking ...' messages
+ --cache-file=FILE cache test results in FILE [disabled]
+ -C, --config-cache alias for \`--cache-file=config.cache'
+ -n, --no-create do not create output files
+ --srcdir=DIR find the sources in DIR [configure dir or \`..']
+
+Installation directories:
+ --prefix=PREFIX install architecture-independent files in PREFIX
+ [$ac_default_prefix]
+ --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
+ [PREFIX]
+
+By default, \`make install' will install all the files in
+\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify
+an installation prefix other than \`$ac_default_prefix' using \`--prefix',
+for instance \`--prefix=\$HOME'.
+
+For better control, use the options below.
+
+Fine tuning of the installation directories:
+ --bindir=DIR user executables [EPREFIX/bin]
+ --sbindir=DIR system admin executables [EPREFIX/sbin]
+ --libexecdir=DIR program executables [EPREFIX/libexec]
+ --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
+ --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
+ --localstatedir=DIR modifiable single-machine data [PREFIX/var]
+ --libdir=DIR object code libraries [EPREFIX/lib]
+ --includedir=DIR C header files [PREFIX/include]
+ --oldincludedir=DIR C header files for non-gcc [/usr/include]
+ --datarootdir=DIR read-only arch.-independent data root [PREFIX/share]
+ --datadir=DIR read-only architecture-independent data [DATAROOTDIR]
+ --infodir=DIR info documentation [DATAROOTDIR/info]
+ --localedir=DIR locale-dependent data [DATAROOTDIR/locale]
+ --mandir=DIR man documentation [DATAROOTDIR/man]
+ --docdir=DIR documentation root [DATAROOTDIR/doc/bumblebee]
+ --htmldir=DIR html documentation [DOCDIR]
+ --dvidir=DIR dvi documentation [DOCDIR]
+ --pdfdir=DIR pdf documentation [DOCDIR]
+ --psdir=DIR ps documentation [DOCDIR]
+_ACEOF
+
+ cat <<\_ACEOF
+
+Program names:
+ --program-prefix=PREFIX prepend PREFIX to installed program names
+ --program-suffix=SUFFIX append SUFFIX to installed program names
+ --program-transform-name=PROGRAM run sed PROGRAM on installed program names
+_ACEOF
+fi
+
+if test -n "$ac_init_help"; then
+ case $ac_init_help in
+ short | recursive ) echo "Configuration of bumblebee 3.2.1:";;
+ esac
+ cat <<\_ACEOF
+
+Optional Features:
+ --disable-option-checking ignore unrecognized --enable/--with options
+ --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
+ --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
+ --disable-dependency-tracking speeds up one-time build
+ --enable-dependency-tracking do not reject slow dependency extractors
+
+Optional Packages:
+ --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
+ --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
+ --without-pidfile support for pidfiles in the daemon [default=yes]
+ --with-udev-rules[=DIR] install nvidia udev rule [default=/lib/udev/rules.d]
+
+Some influential environment variables:
+ CONF_BRIDGE optirun display/render bridge, valid values are auto (default),
+ primus and virtualgl
+ CONF_PRIMUS_LD_PATH
+ List of paths which are searched for the primus libGL.so.1 when
+ using the primus bridge
+ CONF_PIDFILE
+ Path to the pidfile or /var/run/bumblebeed.pid if empty
+ CONF_PM_METHOD
+ Power management method, valid values are auto (default),
+ bbswitch, switcheroo and none
+ CONF_DRIVER default driver to use, valid values are nvidia, nouveau and an
+ empty value (for autodetection, default)
+ CONF_DRIVER_MODULE_NVIDIA
+ name of module for nvidia driver, i.e. the filename without .ko.
+ If empty, "nvidia" is assumed
+ CONF_LDPATH_NVIDIA
+ Path to nvidia libraries for nvidia driver
+ CONF_MODPATH_NVIDIA
+ ModulePath for xorg modules when using nvidia driver
+ CC C compiler command
+ CFLAGS C compiler flags
+ LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
+ nonstandard directory <lib dir>
+ LIBS libraries to pass to the linker, e.g. -l<library>
+ CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
+ you have headers in a nonstandard directory <include dir>
+ PKG_CONFIG path to pkg-config utility
+ PKG_CONFIG_PATH
+ directories to add to pkg-config's search path
+ PKG_CONFIG_LIBDIR
+ path overriding pkg-config's built-in search path
+ x11_CFLAGS C compiler flags for x11, overriding pkg-config
+ x11_LIBS linker flags for x11, overriding pkg-config
+ glib_CFLAGS C compiler flags for glib, overriding pkg-config
+ glib_LIBS linker flags for glib, overriding pkg-config
+ libbsd_CFLAGS
+ C compiler flags for libbsd, overriding pkg-config
+ libbsd_LIBS linker flags for libbsd, overriding pkg-config
+
+Use these variables to override the choices made by `configure' or to help
+it to find libraries and programs with nonstandard names/locations.
+
+Report bugs to the package provider.
+_ACEOF
+ac_status=$?
+fi
+
+if test "$ac_init_help" = "recursive"; then
+ # If there are subdirs, report their specific --help.
+ for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
+ test -d "$ac_dir" ||
+ { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
+ continue
+ ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+ ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+ # A ".." for each directory in $ac_dir_suffix.
+ ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+ case $ac_top_builddir_sub in
+ "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+ *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+ esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+ .) # We are building in place.
+ ac_srcdir=.
+ ac_top_srcdir=$ac_top_builddir_sub
+ ac_abs_top_srcdir=$ac_pwd ;;
+ [\\/]* | ?:[\\/]* ) # Absolute name.
+ ac_srcdir=$srcdir$ac_dir_suffix;
+ ac_top_srcdir=$srcdir
+ ac_abs_top_srcdir=$srcdir ;;
+ *) # Relative name.
+ ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_build_prefix$srcdir
+ ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+ cd "$ac_dir" || { ac_status=$?; continue; }
+ # Check for guested configure.
+ if test -f "$ac_srcdir/configure.gnu"; then
+ echo &&
+ $SHELL "$ac_srcdir/configure.gnu" --help=recursive
+ elif test -f "$ac_srcdir/configure"; then
+ echo &&
+ $SHELL "$ac_srcdir/configure" --help=recursive
+ else
+ $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+ fi || ac_status=$?
+ cd "$ac_pwd" || { ac_status=$?; break; }
+ done
+fi
+
+test -n "$ac_init_help" && exit $ac_status
+if $ac_init_version; then
+ cat <<\_ACEOF
+bumblebee configure 3.2.1
+generated by GNU Autoconf 2.69
+
+Copyright (C) 2012 Free Software Foundation, Inc.
+This configure script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it.
+_ACEOF
+ exit
+fi
+
+## ------------------------ ##
+## Autoconf initialization. ##
+## ------------------------ ##
+
+# ac_fn_c_try_compile LINENO
+# --------------------------
+# Try to compile conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_compile ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ rm -f conftest.$ac_objext
+ if { { ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_compile") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ grep -v '^ *+' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ mv -f conftest.er1 conftest.err
+ fi
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=1
+fi
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_compile
+cat >config.log <<_ACEOF
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+
+It was created by bumblebee $as_me 3.2.1, which was
+generated by GNU Autoconf 2.69. Invocation command line was
+
+ $ $0 $@
+
+_ACEOF
+exec 5>>config.log
+{
+cat <<_ASUNAME
+## --------- ##
+## Platform. ##
+## --------- ##
+
+hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
+/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown`
+
+/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown`
+/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
+/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown`
+/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown`
+/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown`
+/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown`
+
+_ASUNAME
+
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ $as_echo "PATH: $as_dir"
+ done
+IFS=$as_save_IFS
+
+} >&5
+
+cat >&5 <<_ACEOF
+
+
+## ----------- ##
+## Core tests. ##
+## ----------- ##
+
+_ACEOF
+
+
+# Keep a trace of the command line.
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Strip out --silent because we don't want to record it for future runs.
+# Also quote any args containing shell meta-characters.
+# Make two passes to allow for proper duplicate-argument suppression.
+ac_configure_args=
+ac_configure_args0=
+ac_configure_args1=
+ac_must_keep_next=false
+for ac_pass in 1 2
+do
+ for ac_arg
+ do
+ case $ac_arg in
+ -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil)
+ continue ;;
+ *\'*)
+ ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ esac
+ case $ac_pass in
+ 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;;
+ 2)
+ as_fn_append ac_configure_args1 " '$ac_arg'"
+ if test $ac_must_keep_next = true; then
+ ac_must_keep_next=false # Got value, back to normal.
+ else
+ case $ac_arg in
+ *=* | --config-cache | -C | -disable-* | --disable-* \
+ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
+ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
+ | -with-* | --with-* | -without-* | --without-* | --x)
+ case "$ac_configure_args0 " in
+ "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
+ esac
+ ;;
+ -* ) ac_must_keep_next=true ;;
+ esac
+ fi
+ as_fn_append ac_configure_args " '$ac_arg'"
+ ;;
+ esac
+ done
+done
+{ ac_configure_args0=; unset ac_configure_args0;}
+{ ac_configure_args1=; unset ac_configure_args1;}
+
+# When interrupted or exit'd, cleanup temporary files, and complete
+# config.log. We remove comments because anyway the quotes in there
+# would cause problems or look ugly.
+# WARNING: Use '\'' to represent an apostrophe within the trap.
+# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
+trap 'exit_status=$?
+ # Save into config.log some information that might help in debugging.
+ {
+ echo
+
+ $as_echo "## ---------------- ##
+## Cache variables. ##
+## ---------------- ##"
+ echo
+ # The following way of writing the cache mishandles newlines in values,
+(
+ for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
+ eval ac_val=\$$ac_var
+ case $ac_val in #(
+ *${as_nl}*)
+ case $ac_var in #(
+ *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+ esac
+ case $ac_var in #(
+ _ | IFS | as_nl) ;; #(
+ BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+ *) { eval $ac_var=; unset $ac_var;} ;;
+ esac ;;
+ esac
+ done
+ (set) 2>&1 |
+ case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
+ *${as_nl}ac_space=\ *)
+ sed -n \
+ "s/'\''/'\''\\\\'\'''\''/g;
+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
+ ;; #(
+ *)
+ sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+ ;;
+ esac |
+ sort
+)
+ echo
+
+ $as_echo "## ----------------- ##
+## Output variables. ##
+## ----------------- ##"
+ echo
+ for ac_var in $ac_subst_vars
+ do
+ eval ac_val=\$$ac_var
+ case $ac_val in
+ *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+ esac
+ $as_echo "$ac_var='\''$ac_val'\''"
+ done | sort
+ echo
+
+ if test -n "$ac_subst_files"; then
+ $as_echo "## ------------------- ##
+## File substitutions. ##
+## ------------------- ##"
+ echo
+ for ac_var in $ac_subst_files
+ do
+ eval ac_val=\$$ac_var
+ case $ac_val in
+ *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+ esac
+ $as_echo "$ac_var='\''$ac_val'\''"
+ done | sort
+ echo
+ fi
+
+ if test -s confdefs.h; then
+ $as_echo "## ----------- ##
+## confdefs.h. ##
+## ----------- ##"
+ echo
+ cat confdefs.h
+ echo
+ fi
+ test "$ac_signal" != 0 &&
+ $as_echo "$as_me: caught signal $ac_signal"
+ $as_echo "$as_me: exit $exit_status"
+ } >&5
+ rm -f core *.core core.conftest.* &&
+ rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
+ exit $exit_status
+' 0
+for ac_signal in 1 2 13 15; do
+ trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal
+done
+ac_signal=0
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -f -r conftest* confdefs.h
+
+$as_echo "/* confdefs.h */" > confdefs.h
+
+# Predefined preprocessor variables.
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_NAME "$PACKAGE_NAME"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION "$PACKAGE_VERSION"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_STRING "$PACKAGE_STRING"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_URL "$PACKAGE_URL"
+_ACEOF
+
+
+# Let the site file select an alternate cache file if it wants to.
+# Prefer an explicitly selected file to automatically selected ones.
+ac_site_file1=NONE
+ac_site_file2=NONE
+if test -n "$CONFIG_SITE"; then
+ # We do not want a PATH search for config.site.
+ case $CONFIG_SITE in #((
+ -*) ac_site_file1=./$CONFIG_SITE;;
+ */*) ac_site_file1=$CONFIG_SITE;;
+ *) ac_site_file1=./$CONFIG_SITE;;
+ esac
+elif test "x$prefix" != xNONE; then
+ ac_site_file1=$prefix/share/config.site
+ ac_site_file2=$prefix/etc/config.site
+else
+ ac_site_file1=$ac_default_prefix/share/config.site
+ ac_site_file2=$ac_default_prefix/etc/config.site
+fi
+for ac_site_file in "$ac_site_file1" "$ac_site_file2"
+do
+ test "x$ac_site_file" = xNONE && continue
+ if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
+$as_echo "$as_me: loading site script $ac_site_file" >&6;}
+ sed 's/^/| /' "$ac_site_file" >&5
+ . "$ac_site_file" \
+ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "failed to load site script $ac_site_file
+See \`config.log' for more details" "$LINENO" 5; }
+ fi
+done
+
+if test -r "$cache_file"; then
+ # Some versions of bash will fail to source /dev/null (special files
+ # actually), so we avoid doing that. DJGPP emulates it as a regular file.
+ if test /dev/null != "$cache_file" && test -f "$cache_file"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5
+$as_echo "$as_me: loading cache $cache_file" >&6;}
+ case $cache_file in
+ [\\/]* | ?:[\\/]* ) . "$cache_file";;
+ *) . "./$cache_file";;
+ esac
+ fi
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5
+$as_echo "$as_me: creating cache $cache_file" >&6;}
+ >$cache_file
+fi
+
+# Check that the precious variables saved in the cache have kept the same
+# value.
+ac_cache_corrupted=false
+for ac_var in $ac_precious_vars; do
+ eval ac_old_set=\$ac_cv_env_${ac_var}_set
+ eval ac_new_set=\$ac_env_${ac_var}_set
+ eval ac_old_val=\$ac_cv_env_${ac_var}_value
+ eval ac_new_val=\$ac_env_${ac_var}_value
+ case $ac_old_set,$ac_new_set in
+ set,)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+ ac_cache_corrupted=: ;;
+ ,set)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
+ ac_cache_corrupted=: ;;
+ ,);;
+ *)
+ if test "x$ac_old_val" != "x$ac_new_val"; then
+ # differences in whitespace do not lead to failure.
+ ac_old_val_w=`echo x $ac_old_val`
+ ac_new_val_w=`echo x $ac_new_val`
+ if test "$ac_old_val_w" != "$ac_new_val_w"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5
+$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+ ac_cache_corrupted=:
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
+$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
+ eval $ac_var=\$ac_old_val
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5
+$as_echo "$as_me: former value: \`$ac_old_val'" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5
+$as_echo "$as_me: current value: \`$ac_new_val'" >&2;}
+ fi;;
+ esac
+ # Pass precious variables to config.status.
+ if test "$ac_new_set" = set; then
+ case $ac_new_val in
+ *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
+ *) ac_arg=$ac_var=$ac_new_val ;;
+ esac
+ case " $ac_configure_args " in
+ *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy.
+ *) as_fn_append ac_configure_args " '$ac_arg'" ;;
+ esac
+ fi
+done
+if $ac_cache_corrupted; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
+$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
+ as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
+fi
+## -------------------- ##
+## Main body of script. ##
+## -------------------- ##
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+ac_aux_dir=
+for ac_dir in build-aux "$srcdir"/build-aux; do
+ if test -f "$ac_dir/install-sh"; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install-sh -c"
+ break
+ elif test -f "$ac_dir/install.sh"; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install.sh -c"
+ break
+ elif test -f "$ac_dir/shtool"; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/shtool install -c"
+ break
+ fi
+done
+if test -z "$ac_aux_dir"; then
+ as_fn_error $? "cannot find install-sh, install.sh, or shtool in build-aux \"$srcdir\"/build-aux" "$LINENO" 5
+fi
+
+# These three variables are undocumented and unsupported,
+# and are intended to be withdrawn in a future Autoconf release.
+# They can cause serious problems if a builder's source tree is in a directory
+# whose full name contains unusual characters.
+ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var.
+ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var.
+ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
+
+
+
+#AC_CONFIG_HEADERS([config.h])
+
+# AC_DEFINE_SUBST(NAME, VALUE, DESCRIPTION)
+# -----------------------------------------
+
+
+# AC_DEFINE_CONF(NAME, HELP_TEXT, VAR_SET_CODE)
+# --------------------------------------
+
+
+# default configuration
+# Don't be stupid by using values like "path/$(nuke_machine)", it gets expanded!
+
+CONF_XDISP=":8"
+
+
+cat >>confdefs.h <<_ACEOF
+#define CONF_XDISP "$CONF_XDISP"
+_ACEOF
+
+
+
+CONF_SOCKPATH="/var/run/bumblebee.socket"
+
+
+cat >>confdefs.h <<_ACEOF
+#define CONF_SOCKPATH "$CONF_SOCKPATH"
+_ACEOF
+
+
+
+CONF_GID="bumblebee"
+
+
+cat >>confdefs.h <<_ACEOF
+#define CONF_GID "$CONF_GID"
+_ACEOF
+
+
+
+CONF_KEEPONEXIT="false"
+
+
+cat >>confdefs.h <<_ACEOF
+#define CONF_KEEPONEXIT "$CONF_KEEPONEXIT"
+_ACEOF
+
+
+
+CONF_FALLBACKSTART="false"
+
+
+cat >>confdefs.h <<_ACEOF
+#define CONF_FALLBACKSTART "$CONF_FALLBACKSTART"
+_ACEOF
+
+
+
+CONF_VGLCOMPRESS="proxy"
+
+
+cat >>confdefs.h <<_ACEOF
+#define CONF_VGLCOMPRESS "$CONF_VGLCOMPRESS"
+_ACEOF
+
+
+
+CONF_TURNOFFATEXIT="false"
+
+
+cat >>confdefs.h <<_ACEOF
+#define CONF_TURNOFFATEXIT "$CONF_TURNOFFATEXIT"
+_ACEOF
+
+
+
+
+
+
+case $CONF_BRIDGE in
+auto|primus|virtualgl) ;;
+"") CONF_BRIDGE=auto ;;
+*) as_fn_error $? "Invalid value for CONF_BRIDGE" "$LINENO" 5 ;;
+esac
+
+
+cat >>confdefs.h <<_ACEOF
+#define CONF_BRIDGE "$CONF_BRIDGE"
+_ACEOF
+
+
+
+
+
+
+if test "x" = "x$CONF_PRIMUS_LD_PATH"; then
+ CONF_PRIMUS_LD_PATH="/usr/lib/primus:/usr/lib32/primus"
+fi
+
+
+cat >>confdefs.h <<_ACEOF
+#define CONF_PRIMUS_LD_PATH "$CONF_PRIMUS_LD_PATH"
+_ACEOF
+
+
+
+
+
+
+if test "x" = "x$CONF_PIDFILE"; then
+ CONF_PIDFILE=/var/run/bumblebeed.pid
+fi
+
+
+cat >>confdefs.h <<_ACEOF
+#define CONF_PIDFILE "$CONF_PIDFILE"
+_ACEOF
+
+
+
+
+
+
+case $CONF_PM_METHOD in
+auto|bbswitch|switcheroo|none) ;;
+"") CONF_PM_METHOD=auto ;;
+*) as_fn_error $? "Invalid value for CONF_PM_METHOD" "$LINENO" 5 ;;
+esac
+
+
+cat >>confdefs.h <<_ACEOF
+#define CONF_PM_METHOD "$CONF_PM_METHOD"
+_ACEOF
+
+
+
+
+
+case $CONF_DRIVER in
+nvidia|nouveau|"") ;;
+*) as_fn_error $? "Invalid value for CONF_DRIVER" "$LINENO" 5 ;;
+esac
+
+
+cat >>confdefs.h <<_ACEOF
+#define CONF_DRIVER "$CONF_DRIVER"
+_ACEOF
+
+
+
+
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define CONF_DRIVER_MODULE_NVIDIA "$CONF_DRIVER_MODULE_NVIDIA"
+_ACEOF
+
+
+
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define CONF_LDPATH_NVIDIA "$CONF_LDPATH_NVIDIA"
+_ACEOF
+
+
+
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define CONF_MODPATH_NVIDIA "$CONF_MODPATH_NVIDIA"
+_ACEOF
+
+
+
+# non-config related compile-time defines
+
+$as_echo "#define DAEMON_NAME \"bumblebeed\"" >>confdefs.h
+
+
+am__api_version='1.11'
+
+# Find a good install program. We prefer a C program (faster),
+# so one script is as good as another. But avoid the broken or
+# incompatible versions:
+# SysV /etc/install, /usr/sbin/install
+# SunOS /usr/etc/install
+# IRIX /sbin/install
+# AIX /bin/install
+# AmigaOS /C/install, which installs bootblocks on floppy discs
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
+# AFS /usr/afsws/bin/install, which mishandles nonexistent args
+# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# OS/2's system install, which has a completely different semantic
+# ./install, which can be erroneously created by make from ./install.sh.
+# Reject install programs that cannot install multiple files.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
+$as_echo_n "checking for a BSD-compatible install... " >&6; }
+if test -z "$INSTALL"; then
+if ${ac_cv_path_install+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ # Account for people who put trailing slashes in PATH elements.
+case $as_dir/ in #((
+ ./ | .// | /[cC]/* | \
+ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
+ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \
+ /usr/ucb/* ) ;;
+ *)
+ # OSF1 and SCO ODT 3.0 have their own names for install.
+ # Don't use installbsd from OSF since it installs stuff as root
+ # by default.
+ for ac_prog in ginstall scoinst install; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
+ if test $ac_prog = install &&
+ grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+ # AIX install. It has an incompatible calling convention.
+ :
+ elif test $ac_prog = install &&
+ grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+ # program-specific install script used by HP pwplus--don't use.
+ :
+ else
+ rm -rf conftest.one conftest.two conftest.dir
+ echo one > conftest.one
+ echo two > conftest.two
+ mkdir conftest.dir
+ if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
+ test -s conftest.one && test -s conftest.two &&
+ test -s conftest.dir/conftest.one &&
+ test -s conftest.dir/conftest.two
+ then
+ ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+ break 3
+ fi
+ fi
+ fi
+ done
+ done
+ ;;
+esac
+
+ done
+IFS=$as_save_IFS
+
+rm -rf conftest.one conftest.two conftest.dir
+
+fi
+ if test "${ac_cv_path_install+set}" = set; then
+ INSTALL=$ac_cv_path_install
+ else
+ # As a last resort, use the slow shell script. Don't cache a
+ # value for INSTALL within a source directory, because that will
+ # break other packages using the cache if that directory is
+ # removed, or if the value is a relative name.
+ INSTALL=$ac_install_sh
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5
+$as_echo "$INSTALL" >&6; }
+
+# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
+# It thinks the first close brace ends the variable substitution.
+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5
+$as_echo_n "checking whether build environment is sane... " >&6; }
+# Just in case
+sleep 1
+echo timestamp > conftest.file
+# Reject unsafe characters in $srcdir or the absolute working directory
+# name. Accept space and tab only in the latter.
+am_lf='
+'
+case `pwd` in
+ *[\\\"\#\$\&\'\`$am_lf]*)
+ as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;;
+esac
+case $srcdir in
+ *[\\\"\#\$\&\'\`$am_lf\ \ ]*)
+ as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;;
+esac
+
+# Do `set' in a subshell so we don't clobber the current shell's
+# arguments. Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+ set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
+ if test "$*" = "X"; then
+ # -L didn't work.
+ set X `ls -t "$srcdir/configure" conftest.file`
+ fi
+ rm -f conftest.file
+ if test "$*" != "X $srcdir/configure conftest.file" \
+ && test "$*" != "X conftest.file $srcdir/configure"; then
+
+ # If neither matched, then we have a broken ls. This can happen
+ # if, for instance, CONFIG_SHELL is bash and it inherits a
+ # broken ls alias from the environment. This has actually
+ # happened. Such a system could not be considered "sane".
+ as_fn_error $? "ls -t appears to fail. Make sure there is not a broken
+alias in your environment" "$LINENO" 5
+ fi
+
+ test "$2" = conftest.file
+ )
+then
+ # Ok.
+ :
+else
+ as_fn_error $? "newly created file is older than distributed files!
+Check your system clock" "$LINENO" 5
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+test "$program_prefix" != NONE &&
+ program_transform_name="s&^&$program_prefix&;$program_transform_name"
+# Use a double $ so make ignores it.
+test "$program_suffix" != NONE &&
+ program_transform_name="s&\$&$program_suffix&;$program_transform_name"
+# Double any \ or $.
+# By default was `s,x,x', remove it if useless.
+ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
+program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
+
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
+
+if test x"${MISSING+set}" != xset; then
+ case $am_aux_dir in
+ *\ * | *\ *)
+ MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
+ *)
+ MISSING="\${SHELL} $am_aux_dir/missing" ;;
+ esac
+fi
+# Use eval to expand $SHELL
+if eval "$MISSING --run true"; then
+ am_missing_run="$MISSING --run "
+else
+ am_missing_run=
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5
+$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
+fi
+
+if test x"${install_sh}" != xset; then
+ case $am_aux_dir in
+ *\ * | *\ *)
+ install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
+ *)
+ install_sh="\${SHELL} $am_aux_dir/install-sh"
+ esac
+fi
+
+# Installed binaries are usually stripped using `strip' when the user
+# run `make install-strip'. However `strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the `STRIP' environment variable to overrule this program.
+if test "$cross_compiling" != no; then
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+set dummy ${ac_tool_prefix}strip; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_STRIP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$STRIP"; then
+ ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
+$as_echo "$STRIP" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_STRIP"; then
+ ac_ct_STRIP=$STRIP
+ # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_STRIP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_STRIP"; then
+ ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_STRIP="strip"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
+$as_echo "$ac_ct_STRIP" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_STRIP" = x; then
+ STRIP=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ STRIP=$ac_ct_STRIP
+ fi
+else
+ STRIP="$ac_cv_prog_STRIP"
+fi
+
+fi
+INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5
+$as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
+if test -z "$MKDIR_P"; then
+ if ${ac_cv_path_mkdir+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in mkdir gmkdir; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue
+ case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
+ 'mkdir (GNU coreutils) '* | \
+ 'mkdir (coreutils) '* | \
+ 'mkdir (fileutils) '4.1*)
+ ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext
+ break 3;;
+ esac
+ done
+ done
+ done
+IFS=$as_save_IFS
+
+fi
+
+ test -d ./--version && rmdir ./--version
+ if test "${ac_cv_path_mkdir+set}" = set; then
+ MKDIR_P="$ac_cv_path_mkdir -p"
+ else
+ # As a last resort, use the slow shell script. Don't cache a
+ # value for MKDIR_P within a source directory, because that will
+ # break other packages using the cache if that directory is
+ # removed, or if the value is a relative name.
+ MKDIR_P="$ac_install_sh -d"
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5
+$as_echo "$MKDIR_P" >&6; }
+
+mkdir_p="$MKDIR_P"
+case $mkdir_p in
+ [\\/$]* | ?:[\\/]*) ;;
+ */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
+esac
+
+for ac_prog in gawk mawk nawk awk
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_AWK+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$AWK"; then
+ ac_cv_prog_AWK="$AWK" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_AWK="$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+AWK=$ac_cv_prog_AWK
+if test -n "$AWK"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5
+$as_echo "$AWK" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$AWK" && break
+done
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
+set x ${MAKE-make}
+ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
+if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat >conftest.make <<\_ACEOF
+SHELL = /bin/sh
+all:
+ @echo '@@@%%%=$(MAKE)=@@@%%%'
+_ACEOF
+# GNU make sometimes prints "make[1]: Entering ...", which would confuse us.
+case `${MAKE-make} -f conftest.make 2>/dev/null` in
+ *@@@%%%=?*=@@@%%%*)
+ eval ac_cv_prog_make_${ac_make}_set=yes;;
+ *)
+ eval ac_cv_prog_make_${ac_make}_set=no;;
+esac
+rm -f conftest.make
+fi
+if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+ SET_MAKE=
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ SET_MAKE="MAKE=${MAKE-make}"
+fi
+
+rm -rf .tst 2>/dev/null
+mkdir .tst 2>/dev/null
+if test -d .tst; then
+ am__leading_dot=.
+else
+ am__leading_dot=_
+fi
+rmdir .tst 2>/dev/null
+
+if test "`cd $srcdir && pwd`" != "`pwd`"; then
+ # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
+ # is not polluted with repeated "-I."
+ am__isrc=' -I$(srcdir)'
+ # test to see if srcdir already configured
+ if test -f $srcdir/config.status; then
+ as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5
+ fi
+fi
+
+# test whether we have cygpath
+if test -z "$CYGPATH_W"; then
+ if (cygpath --version) >/dev/null 2>/dev/null; then
+ CYGPATH_W='cygpath -w'
+ else
+ CYGPATH_W=echo
+ fi
+fi
+
+
+# Define the identity of the package.
+ PACKAGE='bumblebee'
+ VERSION='3.2.1'
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE "$PACKAGE"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define VERSION "$VERSION"
+_ACEOF
+
+# Some tools Automake needs.
+
+ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"}
+
+
+AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"}
+
+
+AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"}
+
+
+AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
+
+
+MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
+
+# We need awk for the "check" target. The system "awk" is bad on
+# some platforms.
+# Always define AMTAR for backward compatibility. Yes, it's still used
+# in the wild :-( We should find a proper way to deprecate it ...
+AMTAR='$${TAR-tar}'
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to create a pax tar archive" >&5
+$as_echo_n "checking how to create a pax tar archive... " >&6; }
+# Loop over all known methods to create a tar archive until one works.
+_am_tools='gnutar pax cpio none'
+_am_tools=${am_cv_prog_tar_pax-$_am_tools}
+# Do not fold the above two line into one, because Tru64 sh and
+# Solaris sh will not grok spaces in the rhs of `-'.
+for _am_tool in $_am_tools
+do
+ case $_am_tool in
+ gnutar)
+ for _am_tar in tar gnutar gtar;
+ do
+ { echo "$as_me:$LINENO: $_am_tar --version" >&5
+ ($_am_tar --version) >&5 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && break
+ done
+ am__tar="$_am_tar --format=posix -chf - "'"$$tardir"'
+ am__tar_="$_am_tar --format=posix -chf - "'"$tardir"'
+ am__untar="$_am_tar -xf -"
+ ;;
+ plaintar)
+ # Must skip GNU tar: if it does not support --format= it doesn't create
+ # ustar tarball either.
+ (tar --version) >/dev/null 2>&1 && continue
+ am__tar='tar chf - "$$tardir"'
+ am__tar_='tar chf - "$tardir"'
+ am__untar='tar xf -'
+ ;;
+ pax)
+ am__tar='pax -L -x pax -w "$$tardir"'
+ am__tar_='pax -L -x pax -w "$tardir"'
+ am__untar='pax -r'
+ ;;
+ cpio)
+ am__tar='find "$$tardir" -print | cpio -o -H pax -L'
+ am__tar_='find "$tardir" -print | cpio -o -H pax -L'
+ am__untar='cpio -i -H pax -d'
+ ;;
+ none)
+ am__tar=false
+ am__tar_=false
+ am__untar=false
+ ;;
+ esac
+
+ # If the value was cached, stop now. We just wanted to have am__tar
+ # and am__untar set.
+ test -n "${am_cv_prog_tar_pax}" && break
+
+ # tar/untar a dummy directory, and stop if the command works
+ rm -rf conftest.dir
+ mkdir conftest.dir
+ echo GrepMe > conftest.dir/file
+ { echo "$as_me:$LINENO: tardir=conftest.dir && eval $am__tar_ >conftest.tar" >&5
+ (tardir=conftest.dir && eval $am__tar_ >conftest.tar) >&5 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+ rm -rf conftest.dir
+ if test -s conftest.tar; then
+ { echo "$as_me:$LINENO: $am__untar <conftest.tar" >&5
+ ($am__untar <conftest.tar) >&5 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+ grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
+ fi
+done
+rm -rf conftest.dir
+
+if ${am_cv_prog_tar_pax+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ am_cv_prog_tar_pax=$_am_tool
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_tar_pax" >&5
+$as_echo "$am_cv_prog_tar_pax" >&6; }
+
+
+
+
+
+
+
+# Check whether --with-pidfile was given.
+if test "${with_pidfile+set}" = set; then :
+ withval=$with_pidfile;
+else
+ with_pidfile=yes
+fi
+
+if test "x$with_pidfile" != xno; then :
+
+$as_echo "#define WITH_PIDFILE 1" >>confdefs.h
+
+
+fi
+ if test "x$with_pidfile" != xno; then
+ WITH_PIDFILE_TRUE=
+ WITH_PIDFILE_FALSE='#'
+else
+ WITH_PIDFILE_TRUE='#'
+ WITH_PIDFILE_FALSE=
+fi
+
+
+UDEV_RULES_DIR=/lib/udev/rules.d
+
+# Check whether --with-udev-rules was given.
+if test "${with_udev_rules+set}" = set; then :
+ withval=$with_udev_rules;
+else
+ with_udev_rules=yes
+fi
+
+case $with_udev_rules in #(
+ no) :
+ UDEV_RULES_DIR= ;; #(
+ yes) :
+ ;; #(
+ *) :
+ # --with-udev-rules: keep the default
+ UDEV_RULES_DIR=$with_udev_rules ;;
+esac
+
+ if test -n "$UDEV_RULES_DIR"; then
+ WITH_UDEV_RULES_TRUE=
+ WITH_UDEV_RULES_FALSE='#'
+else
+ WITH_UDEV_RULES_TRUE='#'
+ WITH_UDEV_RULES_FALSE=
+fi
+
+
+# Checks for programs.
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}gcc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="${ac_tool_prefix}gcc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+ ac_ct_CC=$CC
+ # Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CC="gcc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_CC" = x; then
+ CC=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ CC=$ac_ct_CC
+ fi
+else
+ CC="$ac_cv_prog_CC"
+fi
+
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}cc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="${ac_tool_prefix}cc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ fi
+fi
+if test -z "$CC"; then
+ # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+ ac_prog_rejected=no
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
+ ac_prog_rejected=yes
+ continue
+ fi
+ ac_cv_prog_CC="cc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+if test $ac_prog_rejected = yes; then
+ # We found a bogon in the path, so make sure we never use it.
+ set dummy $ac_cv_prog_CC
+ shift
+ if test $# != 0; then
+ # We chose a different compiler from the bogus one.
+ # However, it has the same basename, so the bogon will be chosen
+ # first if we set CC to just the basename; use the full file name.
+ shift
+ ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
+ fi
+fi
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ for ac_prog in cl.exe
+ do
+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$CC" && break
+ done
+fi
+if test -z "$CC"; then
+ ac_ct_CC=$CC
+ for ac_prog in cl.exe
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CC="$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$ac_ct_CC" && break
+done
+
+ if test "x$ac_ct_CC" = x; then
+ CC=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ CC=$ac_ct_CC
+ fi
+fi
+
+fi
+
+
+test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "no acceptable C compiler found in \$PATH
+See \`config.log' for more details" "$LINENO" 5; }
+
+# Provide some information about the compiler.
+$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+for ac_option in --version -v -V -qversion; do
+ { { ac_try="$ac_compiler $ac_option >&5"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_compiler $ac_option >&5") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ sed '10a\
+... rest of stderr output deleted ...
+ 10q' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ fi
+ rm -f conftest.er1 conftest.err
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+done
+
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"
+# Try to create an executable without -o first, disregard a.out.
+# It will help us diagnose broken compilers, and finding out an intuition
+# of exeext.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5
+$as_echo_n "checking whether the C compiler works... " >&6; }
+ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+
+# The possible output files:
+ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
+
+ac_rmfiles=
+for ac_file in $ac_files
+do
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+ * ) ac_rmfiles="$ac_rmfiles $ac_file";;
+ esac
+done
+rm -f $ac_rmfiles
+
+if { { ac_try="$ac_link_default"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link_default") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then :
+ # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
+# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
+# in a Makefile. We should not override ac_cv_exeext if it was cached,
+# so that the user can short-circuit this test for compilers unknown to
+# Autoconf.
+for ac_file in $ac_files ''
+do
+ test -f "$ac_file" || continue
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )
+ ;;
+ [ab].out )
+ # We found the default executable, but exeext='' is most
+ # certainly right.
+ break;;
+ *.* )
+ if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
+ then :; else
+ ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+ fi
+ # We set ac_cv_exeext here because the later test for it is not
+ # safe: cross compilers may not add the suffix if given an `-o'
+ # argument, so we may need to know it at that point already.
+ # Even if this section looks crufty: it has the advantage of
+ # actually working.
+ break;;
+ * )
+ break;;
+ esac
+done
+test "$ac_cv_exeext" = no && ac_cv_exeext=
+
+else
+ ac_file=''
+fi
+if test -z "$ac_file"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+$as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "C compiler cannot create executables
+See \`config.log' for more details" "$LINENO" 5; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5
+$as_echo_n "checking for C compiler default output file name... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
+$as_echo "$ac_file" >&6; }
+ac_exeext=$ac_cv_exeext
+
+rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
+ac_clean_files=$ac_clean_files_save
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5
+$as_echo_n "checking for suffix of executables... " >&6; }
+if { { ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then :
+ # If both `conftest.exe' and `conftest' are `present' (well, observable)
+# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will
+# work properly (i.e., refer to `conftest.exe'), while it won't with
+# `rm'.
+for ac_file in conftest.exe conftest conftest.*; do
+ test -f "$ac_file" || continue
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+ *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+ break;;
+ * ) break;;
+ esac
+done
+else
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+rm -f conftest conftest$ac_cv_exeext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
+$as_echo "$ac_cv_exeext" >&6; }
+
+rm -f conftest.$ac_ext
+EXEEXT=$ac_cv_exeext
+ac_exeext=$EXEEXT
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdio.h>
+int
+main ()
+{
+FILE *f = fopen ("conftest.out", "w");
+ return ferror (f) || fclose (f) != 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+ac_clean_files="$ac_clean_files conftest.out"
+# Check that the compiler produces executables we can run. If not, either
+# the compiler is broken, or we cross compile.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
+$as_echo_n "checking whether we are cross compiling... " >&6; }
+if test "$cross_compiling" != yes; then
+ { { ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+ if { ac_try='./conftest$ac_cv_exeext'
+ { { case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; }; then
+ cross_compiling=no
+ else
+ if test "$cross_compiling" = maybe; then
+ cross_compiling=yes
+ else
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details" "$LINENO" 5; }
+ fi
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
+$as_echo "$cross_compiling" >&6; }
+
+rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out
+ac_clean_files=$ac_clean_files_save
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
+$as_echo_n "checking for suffix of object files... " >&6; }
+if ${ac_cv_objext+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.o conftest.obj
+if { { ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_compile") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then :
+ for ac_file in conftest.o conftest.obj conftest.*; do
+ test -f "$ac_file" || continue;
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;
+ *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
+ break;;
+ esac
+done
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot compute suffix of object files: cannot compile
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+rm -f conftest.$ac_cv_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5
+$as_echo "$ac_cv_objext" >&6; }
+OBJEXT=$ac_cv_objext
+ac_objext=$OBJEXT
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
+$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
+if ${ac_cv_c_compiler_gnu+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+#ifndef __GNUC__
+ choke me
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_compiler_gnu=yes
+else
+ ac_compiler_gnu=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
+$as_echo "$ac_cv_c_compiler_gnu" >&6; }
+if test $ac_compiler_gnu = yes; then
+ GCC=yes
+else
+ GCC=
+fi
+ac_test_CFLAGS=${CFLAGS+set}
+ac_save_CFLAGS=$CFLAGS
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
+$as_echo_n "checking whether $CC accepts -g... " >&6; }
+if ${ac_cv_prog_cc_g+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_save_c_werror_flag=$ac_c_werror_flag
+ ac_c_werror_flag=yes
+ ac_cv_prog_cc_g=no
+ CFLAGS="-g"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_prog_cc_g=yes
+else
+ CFLAGS=""
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+else
+ ac_c_werror_flag=$ac_save_c_werror_flag
+ CFLAGS="-g"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_prog_cc_g=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ ac_c_werror_flag=$ac_save_c_werror_flag
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
+$as_echo "$ac_cv_prog_cc_g" >&6; }
+if test "$ac_test_CFLAGS" = set; then
+ CFLAGS=$ac_save_CFLAGS
+elif test $ac_cv_prog_cc_g = yes; then
+ if test "$GCC" = yes; then
+ CFLAGS="-g -O2"
+ else
+ CFLAGS="-g"
+ fi
+else
+ if test "$GCC" = yes; then
+ CFLAGS="-O2"
+ else
+ CFLAGS=
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
+$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
+if ${ac_cv_prog_cc_c89+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_cv_prog_cc_c89=no
+ac_save_CC=$CC
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdarg.h>
+#include <stdio.h>
+struct stat;
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+ char **p;
+ int i;
+{
+ return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+ char *s;
+ va_list v;
+ va_start (v,p);
+ s = g (p, va_arg (v,int));
+ va_end (v);
+ return s;
+}
+
+/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
+ function prototypes and stuff, but not '\xHH' hex character constants.
+ These don't provoke an error unfortunately, instead are silently treated
+ as 'x'. The following induces an error, until -std is added to get
+ proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
+ array size at least. It's necessary to write '\x00'==0 to get something
+ that's true only with -std. */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
+/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
+ inside strings and character constants. */
+#define FOO(x) 'x'
+int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
+
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
+int
+main ()
+{
+return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
+ ;
+ return 0;
+}
+_ACEOF
+for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
+ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+ CC="$ac_save_CC $ac_arg"
+ if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_prog_cc_c89=$ac_arg
+fi
+rm -f core conftest.err conftest.$ac_objext
+ test "x$ac_cv_prog_cc_c89" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+
+fi
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c89" in
+ x)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+$as_echo "none needed" >&6; } ;;
+ xno)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+$as_echo "unsupported" >&6; } ;;
+ *)
+ CC="$CC $ac_cv_prog_cc_c89"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
+$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
+esac
+if test "x$ac_cv_prog_cc_c89" != xno; then :
+
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+DEPDIR="${am__leading_dot}deps"
+
+ac_config_commands="$ac_config_commands depfiles"
+
+
+am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+ @echo this is the am__doit target
+.PHONY: am__doit
+END
+# If we don't find an include directive, just comment out the code.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5
+$as_echo_n "checking for style of include used by $am_make... " >&6; }
+am__include="#"
+am__quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# Ignore all kinds of additional output from `make'.
+case `$am_make -s -f confmf 2> /dev/null` in #(
+*the\ am__doit\ target*)
+ am__include=include
+ am__quote=
+ _am_result=GNU
+ ;;
+esac
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+ echo '.include "confinc"' > confmf
+ case `$am_make -s -f confmf 2> /dev/null` in #(
+ *the\ am__doit\ target*)
+ am__include=.include
+ am__quote="\""
+ _am_result=BSD
+ ;;
+ esac
+fi
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5
+$as_echo "$_am_result" >&6; }
+rm -f confinc confmf
+
+# Check whether --enable-dependency-tracking was given.
+if test "${enable_dependency_tracking+set}" = set; then :
+ enableval=$enable_dependency_tracking;
+fi
+
+if test "x$enable_dependency_tracking" != xno; then
+ am_depcomp="$ac_aux_dir/depcomp"
+ AMDEPBACKSLASH='\'
+ am__nodep='_no'
+fi
+ if test "x$enable_dependency_tracking" != xno; then
+ AMDEP_TRUE=
+ AMDEP_FALSE='#'
+else
+ AMDEP_TRUE='#'
+ AMDEP_FALSE=
+fi
+
+
+
+depcc="$CC" am_compiler_list=
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
+$as_echo_n "checking dependency style of $depcc... " >&6; }
+if ${am_cv_CC_dependencies_compiler_type+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+ # We make a subdir and do the tests there. Otherwise we can end up
+ # making bogus files that we don't know about and never remove. For
+ # instance it was reported that on HP-UX the gcc test will end up
+ # making a dummy file named `D' -- because `-MD' means `put the output
+ # in D'.
+ rm -rf conftest.dir
+ mkdir conftest.dir
+ # Copy depcomp to subdir because otherwise we won't find it if we're
+ # using a relative directory.
+ cp "$am_depcomp" conftest.dir
+ cd conftest.dir
+ # We will build objects and dependencies in a subdirectory because
+ # it helps to detect inapplicable dependency modes. For instance
+ # both Tru64's cc and ICC support -MD to output dependencies as a
+ # side effect of compilation, but ICC will put the dependencies in
+ # the current directory while Tru64 will put them in the object
+ # directory.
+ mkdir sub
+
+ am_cv_CC_dependencies_compiler_type=none
+ if test "$am_compiler_list" = ""; then
+ am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
+ fi
+ am__universal=false
+ case " $depcc " in #(
+ *\ -arch\ *\ -arch\ *) am__universal=true ;;
+ esac
+
+ for depmode in $am_compiler_list; do
+ # Setup a source with many dependencies, because some compilers
+ # like to wrap large dependency lists on column 80 (with \), and
+ # we should not choose a depcomp mode which is confused by this.
+ #
+ # We need to recreate these files for each test, as the compiler may
+ # overwrite some of them when testing with obscure command lines.
+ # This happens at least with the AIX C compiler.
+ : > sub/conftest.c
+ for i in 1 2 3 4 5 6; do
+ echo '#include "conftst'$i'.h"' >> sub/conftest.c
+ # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
+ # Solaris 8's {/usr,}/bin/sh.
+ touch sub/conftst$i.h
+ done
+ echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+ # We check with `-c' and `-o' for the sake of the "dashmstdout"
+ # mode. It turns out that the SunPro C++ compiler does not properly
+ # handle `-M -o', and we need to detect this. Also, some Intel
+ # versions had trouble with output in subdirs
+ am__obj=sub/conftest.${OBJEXT-o}
+ am__minus_obj="-o $am__obj"
+ case $depmode in
+ gcc)
+ # This depmode causes a compiler race in universal mode.
+ test "$am__universal" = false || continue
+ ;;
+ nosideeffect)
+ # after this tag, mechanisms are not by side-effect, so they'll
+ # only be used when explicitly requested
+ if test "x$enable_dependency_tracking" = xyes; then
+ continue
+ else
+ break
+ fi
+ ;;
+ msvc7 | msvc7msys | msvisualcpp | msvcmsys)
+ # This compiler won't grok `-c -o', but also, the minuso test has
+ # not run yet. These depmodes are late enough in the game, and
+ # so weak that their functioning should not be impacted.
+ am__obj=conftest.${OBJEXT-o}
+ am__minus_obj=
+ ;;
+ none) break ;;
+ esac
+ if depmode=$depmode \
+ source=sub/conftest.c object=$am__obj \
+ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
+ >/dev/null 2>conftest.err &&
+ grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
+ ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+ # icc doesn't choke on unknown options, it will just issue warnings
+ # or remarks (even with -Werror). So we grep stderr for any message
+ # that says an option was ignored or not supported.
+ # When given -MP, icc 7.0 and 7.1 complain thusly:
+ # icc: Command line warning: ignoring option '-M'; no argument required
+ # The diagnosis changed in icc 8.0:
+ # icc: Command line remark: option '-MP' not supported
+ if (grep 'ignoring option' conftest.err ||
+ grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+ am_cv_CC_dependencies_compiler_type=$depmode
+ break
+ fi
+ fi
+ done
+
+ cd ..
+ rm -rf conftest.dir
+else
+ am_cv_CC_dependencies_compiler_type=none
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5
+$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; }
+CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
+
+ if
+ test "x$enable_dependency_tracking" != xno \
+ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
+ am__fastdepCC_TRUE=
+ am__fastdepCC_FALSE='#'
+else
+ am__fastdepCC_TRUE='#'
+ am__fastdepCC_FALSE=
+fi
+
+
+if test "x$CC" != xcc; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC and cc understand -c and -o together" >&5
+$as_echo_n "checking whether $CC and cc understand -c and -o together... " >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether cc understands -c and -o together" >&5
+$as_echo_n "checking whether cc understands -c and -o together... " >&6; }
+fi
+set dummy $CC; ac_cc=`$as_echo "$2" |
+ sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'`
+if eval \${ac_cv_prog_cc_${ac_cc}_c_o+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+# Make sure it works both with $CC and with simple cc.
+# We do the test twice because some compilers refuse to overwrite an
+# existing .o file with -o, though they will create one.
+ac_try='$CC -c conftest.$ac_ext -o conftest2.$ac_objext >&5'
+rm -f conftest2.*
+if { { case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } &&
+ test -f conftest2.$ac_objext && { { case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; };
+then
+ eval ac_cv_prog_cc_${ac_cc}_c_o=yes
+ if test "x$CC" != xcc; then
+ # Test first that cc exists at all.
+ if { ac_try='cc -c conftest.$ac_ext >&5'
+ { { case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; }; then
+ ac_try='cc -c conftest.$ac_ext -o conftest2.$ac_objext >&5'
+ rm -f conftest2.*
+ if { { case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } &&
+ test -f conftest2.$ac_objext && { { case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; };
+ then
+ # cc works too.
+ :
+ else
+ # cc exists but doesn't like -o.
+ eval ac_cv_prog_cc_${ac_cc}_c_o=no
+ fi
+ fi
+ fi
+else
+ eval ac_cv_prog_cc_${ac_cc}_c_o=no
+fi
+rm -f core conftest*
+
+fi
+if eval test \$ac_cv_prog_cc_${ac_cc}_c_o = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+$as_echo "#define NO_MINUS_C_MINUS_O 1" >>confdefs.h
+
+fi
+
+# FIXME: we rely on the cache variable name because
+# there is no other way.
+set dummy $CC
+am_cc=`echo $2 | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'`
+eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o
+if test "$am_t" != yes; then
+ # Losing compiler, so override with the script.
+ # FIXME: It is wrong to rewrite CC.
+ # But if we don't then we get into trouble of one sort or another.
+ # A longer-term fix would be to have automake use am__CC in this case,
+ # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
+ CC="$am_aux_dir/compile $CC"
+fi
+
+
+# Extract the first word of "help2man", so it can be a program name with args.
+set dummy help2man; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_HELP2MAN+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $HELP2MAN in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_HELP2MAN="$HELP2MAN" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_path_HELP2MAN="$as_dir/$ac_word$ac_exec_ext"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+fi
+HELP2MAN=$ac_cv_path_HELP2MAN
+if test -n "$HELP2MAN"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $HELP2MAN" >&5
+$as_echo "$HELP2MAN" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ if test -n "$HELP2MAN"; then
+ HAVE_HELP2MAN_TRUE=
+ HAVE_HELP2MAN_FALSE='#'
+else
+ HAVE_HELP2MAN_TRUE='#'
+ HAVE_HELP2MAN_FALSE=
+fi
+
+if test x"$HELP2MAN" = x; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cannot find help2man, you will not be able to generate
+ manpages" >&5
+$as_echo "$as_me: WARNING: cannot find help2man, you will not be able to generate
+ manpages" >&2;}
+fi
+
+regular_CPPFLAGS="-D_FILE_OFFSET_BITS=64 -D_REENTRANT"
+regular_CFLAGS="-Wall -Waggregate-return \
+ -Wmissing-declarations -Wmissing-prototypes -Wredundant-decls \
+ -Wshadow -Wstrict-prototypes -Winline -Wformat=2 -pipe"
+
+
+
+# Checks for libraries.
+#AC_CHECK_LIB([bsd], [pidfile_open])
+
+# Checks for header files.
+
+
+
+
+
+
+
+if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
+set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_PKG_CONFIG+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $PKG_CONFIG in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+fi
+PKG_CONFIG=$ac_cv_path_PKG_CONFIG
+if test -n "$PKG_CONFIG"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
+$as_echo "$PKG_CONFIG" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_path_PKG_CONFIG"; then
+ ac_pt_PKG_CONFIG=$PKG_CONFIG
+ # Extract the first word of "pkg-config", so it can be a program name with args.
+set dummy pkg-config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $ac_pt_PKG_CONFIG in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+fi
+ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
+if test -n "$ac_pt_PKG_CONFIG"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5
+$as_echo "$ac_pt_PKG_CONFIG" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_pt_PKG_CONFIG" = x; then
+ PKG_CONFIG=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ PKG_CONFIG=$ac_pt_PKG_CONFIG
+ fi
+else
+ PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
+fi
+
+fi
+if test -n "$PKG_CONFIG"; then
+ _pkg_min_version=0.9.0
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5
+$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; }
+ if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ PKG_CONFIG=""
+ fi
+fi
+
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for x11" >&5
+$as_echo_n "checking for x11... " >&6; }
+
+if test -n "$x11_CFLAGS"; then
+ pkg_cv_x11_CFLAGS="$x11_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+ if test -n "$PKG_CONFIG" && \
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"x11\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "x11") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ pkg_cv_x11_CFLAGS=`$PKG_CONFIG --cflags "x11" 2>/dev/null`
+ test "x$?" != "x0" && pkg_failed=yes
+else
+ pkg_failed=yes
+fi
+ else
+ pkg_failed=untried
+fi
+if test -n "$x11_LIBS"; then
+ pkg_cv_x11_LIBS="$x11_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+ if test -n "$PKG_CONFIG" && \
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"x11\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "x11") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ pkg_cv_x11_LIBS=`$PKG_CONFIG --libs "x11" 2>/dev/null`
+ test "x$?" != "x0" && pkg_failed=yes
+else
+ pkg_failed=yes
+fi
+ else
+ pkg_failed=untried
+fi
+
+
+
+if test $pkg_failed = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+ _pkg_short_errors_supported=yes
+else
+ _pkg_short_errors_supported=no
+fi
+ if test $_pkg_short_errors_supported = yes; then
+ x11_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "x11" 2>&1`
+ else
+ x11_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "x11" 2>&1`
+ fi
+ # Put the nasty error message in config.log where it belongs
+ echo "$x11_PKG_ERRORS" >&5
+
+ as_fn_error $? "Package requirements (x11) were not met:
+
+$x11_PKG_ERRORS
+
+Consider adjusting the PKG_CONFIG_PATH environment variable if you
+installed software in a non-standard prefix.
+
+Alternatively, you may set the environment variables x11_CFLAGS
+and x11_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details." "$LINENO" 5
+elif test $pkg_failed = untried; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it
+is in your PATH or set the PKG_CONFIG environment variable to the full
+path to pkg-config.
+
+Alternatively, you may set the environment variables x11_CFLAGS
+and x11_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
+
+To get pkg-config, see <http://pkg-config.freedesktop.org/>.
+See \`config.log' for more details" "$LINENO" 5; }
+else
+ x11_CFLAGS=$pkg_cv_x11_CFLAGS
+ x11_LIBS=$pkg_cv_x11_LIBS
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+fi
+
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for glib" >&5
+$as_echo_n "checking for glib... " >&6; }
+
+if test -n "$glib_CFLAGS"; then
+ pkg_cv_glib_CFLAGS="$glib_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+ if test -n "$PKG_CONFIG" && \
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glib-2.0\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "glib-2.0") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ pkg_cv_glib_CFLAGS=`$PKG_CONFIG --cflags "glib-2.0" 2>/dev/null`
+ test "x$?" != "x0" && pkg_failed=yes
+else
+ pkg_failed=yes
+fi
+ else
+ pkg_failed=untried
+fi
+if test -n "$glib_LIBS"; then
+ pkg_cv_glib_LIBS="$glib_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+ if test -n "$PKG_CONFIG" && \
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glib-2.0\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "glib-2.0") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ pkg_cv_glib_LIBS=`$PKG_CONFIG --libs "glib-2.0" 2>/dev/null`
+ test "x$?" != "x0" && pkg_failed=yes
+else
+ pkg_failed=yes
+fi
+ else
+ pkg_failed=untried
+fi
+
+
+
+if test $pkg_failed = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+ _pkg_short_errors_supported=yes
+else
+ _pkg_short_errors_supported=no
+fi
+ if test $_pkg_short_errors_supported = yes; then
+ glib_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "glib-2.0" 2>&1`
+ else
+ glib_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "glib-2.0" 2>&1`
+ fi
+ # Put the nasty error message in config.log where it belongs
+ echo "$glib_PKG_ERRORS" >&5
+
+ as_fn_error $? "Package requirements (glib-2.0) were not met:
+
+$glib_PKG_ERRORS
+
+Consider adjusting the PKG_CONFIG_PATH environment variable if you
+installed software in a non-standard prefix.
+
+Alternatively, you may set the environment variables glib_CFLAGS
+and glib_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details." "$LINENO" 5
+elif test $pkg_failed = untried; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it
+is in your PATH or set the PKG_CONFIG environment variable to the full
+path to pkg-config.
+
+Alternatively, you may set the environment variables glib_CFLAGS
+and glib_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
+
+To get pkg-config, see <http://pkg-config.freedesktop.org/>.
+See \`config.log' for more details" "$LINENO" 5; }
+else
+ glib_CFLAGS=$pkg_cv_glib_CFLAGS
+ glib_LIBS=$pkg_cv_glib_LIBS
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+fi
+if test "x$with_pidfile" != xno; then :
+
+
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for libbsd" >&5
+$as_echo_n "checking for libbsd... " >&6; }
+
+if test -n "$libbsd_CFLAGS"; then
+ pkg_cv_libbsd_CFLAGS="$libbsd_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+ if test -n "$PKG_CONFIG" && \
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libbsd >= 0.2.0\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "libbsd >= 0.2.0") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ pkg_cv_libbsd_CFLAGS=`$PKG_CONFIG --cflags "libbsd >= 0.2.0" 2>/dev/null`
+ test "x$?" != "x0" && pkg_failed=yes
+else
+ pkg_failed=yes
+fi
+ else
+ pkg_failed=untried
+fi
+if test -n "$libbsd_LIBS"; then
+ pkg_cv_libbsd_LIBS="$libbsd_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+ if test -n "$PKG_CONFIG" && \
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libbsd >= 0.2.0\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "libbsd >= 0.2.0") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ pkg_cv_libbsd_LIBS=`$PKG_CONFIG --libs "libbsd >= 0.2.0" 2>/dev/null`
+ test "x$?" != "x0" && pkg_failed=yes
+else
+ pkg_failed=yes
+fi
+ else
+ pkg_failed=untried
+fi
+
+
+
+if test $pkg_failed = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+ _pkg_short_errors_supported=yes
+else
+ _pkg_short_errors_supported=no
+fi
+ if test $_pkg_short_errors_supported = yes; then
+ libbsd_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libbsd >= 0.2.0" 2>&1`
+ else
+ libbsd_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libbsd >= 0.2.0" 2>&1`
+ fi
+ # Put the nasty error message in config.log where it belongs
+ echo "$libbsd_PKG_ERRORS" >&5
+
+ as_fn_error $? "Package requirements (libbsd >= 0.2.0) were not met:
+
+$libbsd_PKG_ERRORS
+
+Consider adjusting the PKG_CONFIG_PATH environment variable if you
+installed software in a non-standard prefix.
+
+Alternatively, you may set the environment variables libbsd_CFLAGS
+and libbsd_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details." "$LINENO" 5
+elif test $pkg_failed = untried; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it
+is in your PATH or set the PKG_CONFIG environment variable to the full
+path to pkg-config.
+
+Alternatively, you may set the environment variables libbsd_CFLAGS
+and libbsd_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
+
+To get pkg-config, see <http://pkg-config.freedesktop.org/>.
+See \`config.log' for more details" "$LINENO" 5; }
+else
+ libbsd_CFLAGS=$pkg_cv_libbsd_CFLAGS
+ libbsd_LIBS=$pkg_cv_libbsd_LIBS
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+fi
+ if test -n "$PKG_CONFIG" && \
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libbsd = 0.2.0\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "libbsd = 0.2.0") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ $as_echo "#define HAVE_LIBBSD_020 1" >>confdefs.h
+
+fi
+
+fi
+
+ac_config_files="$ac_config_files Makefile"
+
+cat >confcache <<\_ACEOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs, see configure's option --config-cache.
+# It is not useful on other systems. If it contains results you don't
+# want to keep, you may remove or edit it.
+#
+# config.status only pays attention to the cache file if you give it
+# the --recheck option to rerun configure.
+#
+# `ac_cv_env_foo' variables (set or unset) will be overridden when
+# loading this file, other *unset* `ac_cv_foo' will be assigned the
+# following values.
+
+_ACEOF
+
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, we kill variables containing newlines.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+(
+ for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
+ eval ac_val=\$$ac_var
+ case $ac_val in #(
+ *${as_nl}*)
+ case $ac_var in #(
+ *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+ esac
+ case $ac_var in #(
+ _ | IFS | as_nl) ;; #(
+ BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+ *) { eval $ac_var=; unset $ac_var;} ;;
+ esac ;;
+ esac
+ done
+
+ (set) 2>&1 |
+ case $as_nl`(ac_space=' '; set) 2>&1` in #(
+ *${as_nl}ac_space=\ *)
+ # `set' does not quote correctly, so add quotes: double-quote
+ # substitution turns \\\\ into \\, and sed turns \\ into \.
+ sed -n \
+ "s/'/'\\\\''/g;
+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
+ ;; #(
+ *)
+ # `set' quotes correctly as required by POSIX, so do not add quotes.
+ sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+ ;;
+ esac |
+ sort
+) |
+ sed '
+ /^ac_cv_env_/b end
+ t clear
+ :clear
+ s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+ t end
+ s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
+ :end' >>confcache
+if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
+ if test -w "$cache_file"; then
+ if test "x$cache_file" != "x/dev/null"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
+$as_echo "$as_me: updating cache $cache_file" >&6;}
+ if test ! -f "$cache_file" || test -h "$cache_file"; then
+ cat confcache >"$cache_file"
+ else
+ case $cache_file in #(
+ */* | ?:*)
+ mv -f confcache "$cache_file"$$ &&
+ mv -f "$cache_file"$$ "$cache_file" ;; #(
+ *)
+ mv -f confcache "$cache_file" ;;
+ esac
+ fi
+ fi
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
+$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
+ fi
+fi
+rm -f confcache
+
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+# Let make expand exec_prefix.
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
+# Transform confdefs.h into DEFS.
+# Protect against shell expansion while executing Makefile rules.
+# Protect against Makefile macro expansion.
+#
+# If the first sed substitution is executed (which looks for macros that
+# take arguments), then branch to the quote section. Otherwise,
+# look for a macro that doesn't take arguments.
+ac_script='
+:mline
+/\\$/{
+ N
+ s,\\\n,,
+ b mline
+}
+t clear
+:clear
+s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g
+t quote
+s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g
+t quote
+b any
+:quote
+s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g
+s/\[/\\&/g
+s/\]/\\&/g
+s/\$/$$/g
+H
+:any
+${
+ g
+ s/^\n//
+ s/\n/ /g
+ p
+}
+'
+DEFS=`sed -n "$ac_script" confdefs.h`
+
+
+ac_libobjs=
+ac_ltlibobjs=
+U=
+for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
+ # 1. Remove the extension, and $U if already installed.
+ ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
+ ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
+ # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR
+ # will be set to the directory where LIBOBJS objects are built.
+ as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext"
+ as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo'
+done
+LIBOBJS=$ac_libobjs
+
+LTLIBOBJS=$ac_ltlibobjs
+
+
+ if test -n "$EXEEXT"; then
+ am__EXEEXT_TRUE=
+ am__EXEEXT_FALSE='#'
+else
+ am__EXEEXT_TRUE='#'
+ am__EXEEXT_FALSE=
+fi
+
+if test -z "${WITH_PIDFILE_TRUE}" && test -z "${WITH_PIDFILE_FALSE}"; then
+ as_fn_error $? "conditional \"WITH_PIDFILE\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${WITH_UDEV_RULES_TRUE}" && test -z "${WITH_UDEV_RULES_FALSE}"; then
+ as_fn_error $? "conditional \"WITH_UDEV_RULES\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
+ as_fn_error $? "conditional \"AMDEP\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
+ as_fn_error $? "conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${HAVE_HELP2MAN_TRUE}" && test -z "${HAVE_HELP2MAN_FALSE}"; then
+ as_fn_error $? "conditional \"HAVE_HELP2MAN\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+
+: "${CONFIG_STATUS=./config.status}"
+ac_write_fail=0
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files $CONFIG_STATUS"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5
+$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
+as_write_fail=0
+cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1
+#! $SHELL
+# Generated by $as_me.
+# Run this file to recreate the current configuration.
+# Compiler output produced by configure, useful for debugging
+# configure, is in config.log if it exists.
+
+debug=false
+ac_cs_recheck=false
+ac_cs_silent=false
+
+SHELL=\${CONFIG_SHELL-$SHELL}
+export SHELL
+_ASEOF
+cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1
+## -------------------- ##
+## M4sh Initialization. ##
+## -------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
+ emulate sh
+ NULLCMD=:
+ # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+ setopt NO_GLOB_SUBST
+else
+ case `(set -o) 2>/dev/null` in #(
+ *posix*) :
+ set -o posix ;; #(
+ *) :
+ ;;
+esac
+fi
+
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+# Prefer a ksh shell builtin over an external printf program on Solaris,
+# but without wasting forks for bash or zsh.
+if test -z "$BASH_VERSION$ZSH_VERSION" \
+ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='print -r --'
+ as_echo_n='print -rn --'
+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='printf %s\n'
+ as_echo_n='printf %s'
+else
+ if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+ as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+ as_echo_n='/usr/ucb/echo -n'
+ else
+ as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+ as_echo_n_body='eval
+ arg=$1;
+ case $arg in #(
+ *"$as_nl"*)
+ expr "X$arg" : "X\\(.*\\)$as_nl";
+ arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+ esac;
+ expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+ '
+ export as_echo_n_body
+ as_echo_n='sh -c $as_echo_n_body as_echo'
+ fi
+ export as_echo_body
+ as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ PATH_SEPARATOR=:
+ (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+ (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+ PATH_SEPARATOR=';'
+ }
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order. Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" "" $as_nl"
+
+# Find who we are. Look in the path if we contain no directory separator.
+as_myself=
+case $0 in #((
+ *[\\/]* ) as_myself=$0 ;;
+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+ as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+ $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+ exit 1
+fi
+
+# Unset variables that we do not need and which cause bugs (e.g. in
+# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
+# suppresses any "Segmentation fault" message there. '((' could
+# trigger a bug in pdksh 5.2.14.
+for as_var in BASH_ENV ENV MAIL MAILPATH
+do eval test x\${$as_var+set} = xset \
+ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+
+# as_fn_error STATUS ERROR [LINENO LOG_FD]
+# ----------------------------------------
+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
+# script with STATUS, using 1 if that was 0.
+as_fn_error ()
+{
+ as_status=$1; test $as_status -eq 0 && as_status=1
+ if test "$4"; then
+ as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
+ fi
+ $as_echo "$as_me: error: $2" >&2
+ as_fn_exit $as_status
+} # as_fn_error
+
+
+# as_fn_set_status STATUS
+# -----------------------
+# Set $? to STATUS, without forking.
+as_fn_set_status ()
+{
+ return $1
+} # as_fn_set_status
+
+# as_fn_exit STATUS
+# -----------------
+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
+as_fn_exit ()
+{
+ set +e
+ as_fn_set_status $1
+ exit $1
+} # as_fn_exit
+
+# as_fn_unset VAR
+# ---------------
+# Portably unset VAR.
+as_fn_unset ()
+{
+ { eval $1=; unset $1;}
+}
+as_unset=as_fn_unset
+# as_fn_append VAR VALUE
+# ----------------------
+# Append the text in VALUE to the end of the definition contained in VAR. Take
+# advantage of any shell optimizations that allow amortized linear growth over
+# repeated appends, instead of the typical quadratic growth present in naive
+# implementations.
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+ eval 'as_fn_append ()
+ {
+ eval $1+=\$2
+ }'
+else
+ as_fn_append ()
+ {
+ eval $1=\$$1\$2
+ }
+fi # as_fn_append
+
+# as_fn_arith ARG...
+# ------------------
+# Perform arithmetic evaluation on the ARGs, and store the result in the
+# global $as_val. Take advantage of shells that can avoid forks. The arguments
+# must be portable across $(()) and expr.
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+ eval 'as_fn_arith ()
+ {
+ as_val=$(( $* ))
+ }'
+else
+ as_fn_arith ()
+ {
+ as_val=`expr "$@" || test $? -eq 1`
+ }
+fi # as_fn_arith
+
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+ test "X`expr 00001 : '.*\(...\)'`" = X001; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+ as_basename=basename
+else
+ as_basename=false
+fi
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+ as_dirname=dirname
+else
+ as_dirname=false
+fi
+
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+ sed '/^.*\/\([^/][^/]*\)\/*$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in #(((((
+-n*)
+ case `echo 'xy\c'` in
+ *c*) ECHO_T=' ';; # ECHO_T is single tab character.
+ xy) ECHO_C='\c';;
+ *) echo `echo ksh88 bug on AIX 6.1` > /dev/null
+ ECHO_T=' ';;
+ esac;;
+*)
+ ECHO_N='-n';;
+esac
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+ rm -f conf$$.dir/conf$$.file
+else
+ rm -f conf$$.dir
+ mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+ if ln -s conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s='ln -s'
+ # ... but there are two gotchas:
+ # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+ # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+ # In both cases, we have to default to `cp -pR'.
+ ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+ as_ln_s='cp -pR'
+ elif ln conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s=ln
+ else
+ as_ln_s='cp -pR'
+ fi
+else
+ as_ln_s='cp -pR'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+
+# as_fn_mkdir_p
+# -------------
+# Create "$as_dir" as a directory, including parents if necessary.
+as_fn_mkdir_p ()
+{
+
+ case $as_dir in #(
+ -*) as_dir=./$as_dir;;
+ esac
+ test -d "$as_dir" || eval $as_mkdir_p || {
+ as_dirs=
+ while :; do
+ case $as_dir in #(
+ *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+ *) as_qdir=$as_dir;;
+ esac
+ as_dirs="'$as_qdir' $as_dirs"
+ as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ test -d "$as_dir" && break
+ done
+ test -z "$as_dirs" || eval "mkdir $as_dirs"
+ } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
+
+
+} # as_fn_mkdir_p
+if mkdir -p . 2>/dev/null; then
+ as_mkdir_p='mkdir -p "$as_dir"'
+else
+ test -d ./-p && rmdir ./-p
+ as_mkdir_p=false
+fi
+
+
+# as_fn_executable_p FILE
+# -----------------------
+# Test if FILE is an executable regular file.
+as_fn_executable_p ()
+{
+ test -f "$1" && test -x "$1"
+} # as_fn_executable_p
+as_test_x='test -x'
+as_executable_p=as_fn_executable_p
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+exec 6>&1
+## ----------------------------------- ##
+## Main body of $CONFIG_STATUS script. ##
+## ----------------------------------- ##
+_ASEOF
+test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# Save the log message, to keep $0 and so on meaningful, and to
+# report actual input values of CONFIG_FILES etc. instead of their
+# values after options handling.
+ac_log="
+This file was extended by bumblebee $as_me 3.2.1, which was
+generated by GNU Autoconf 2.69. Invocation command line was
+
+ CONFIG_FILES = $CONFIG_FILES
+ CONFIG_HEADERS = $CONFIG_HEADERS
+ CONFIG_LINKS = $CONFIG_LINKS
+ CONFIG_COMMANDS = $CONFIG_COMMANDS
+ $ $0 $@
+
+on `(hostname || uname -n) 2>/dev/null | sed 1q`
+"
+
+_ACEOF
+
+case $ac_config_files in *"
+"*) set x $ac_config_files; shift; ac_config_files=$*;;
+esac
+
+
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+# Files that config.status was made for.
+config_files="$ac_config_files"
+config_commands="$ac_config_commands"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+ac_cs_usage="\
+\`$as_me' instantiates files and other configuration actions
+from templates according to the current configuration. Unless the files
+and actions are specified as TAGs, all are instantiated by default.
+
+Usage: $0 [OPTION]... [TAG]...
+
+ -h, --help print this help, then exit
+ -V, --version print version number and configuration settings, then exit
+ --config print configuration, then exit
+ -q, --quiet, --silent
+ do not print progress messages
+ -d, --debug don't remove temporary files
+ --recheck update $as_me by reconfiguring in the same conditions
+ --file=FILE[:TEMPLATE]
+ instantiate the configuration file FILE
+
+Configuration files:
+$config_files
+
+Configuration commands:
+$config_commands
+
+Report bugs to the package provider."
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
+ac_cs_version="\\
+bumblebee config.status 3.2.1
+configured by $0, generated by GNU Autoconf 2.69,
+ with options \\"\$ac_cs_config\\"
+
+Copyright (C) 2012 Free Software Foundation, Inc.
+This config.status script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it."
+
+ac_pwd='$ac_pwd'
+srcdir='$srcdir'
+INSTALL='$INSTALL'
+MKDIR_P='$MKDIR_P'
+AWK='$AWK'
+test -n "\$AWK" || AWK=awk
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# The default lists apply if the user does not specify any file.
+ac_need_defaults=:
+while test $# != 0
+do
+ case $1 in
+ --*=?*)
+ ac_option=`expr "X$1" : 'X\([^=]*\)='`
+ ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
+ ac_shift=:
+ ;;
+ --*=)
+ ac_option=`expr "X$1" : 'X\([^=]*\)='`
+ ac_optarg=
+ ac_shift=:
+ ;;
+ *)
+ ac_option=$1
+ ac_optarg=$2
+ ac_shift=shift
+ ;;
+ esac
+
+ case $ac_option in
+ # Handling of the options.
+ -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+ ac_cs_recheck=: ;;
+ --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
+ $as_echo "$ac_cs_version"; exit ;;
+ --config | --confi | --conf | --con | --co | --c )
+ $as_echo "$ac_cs_config"; exit ;;
+ --debug | --debu | --deb | --de | --d | -d )
+ debug=: ;;
+ --file | --fil | --fi | --f )
+ $ac_shift
+ case $ac_optarg in
+ *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ '') as_fn_error $? "missing file argument" ;;
+ esac
+ as_fn_append CONFIG_FILES " '$ac_optarg'"
+ ac_need_defaults=false;;
+ --he | --h | --help | --hel | -h )
+ $as_echo "$ac_cs_usage"; exit ;;
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil | --si | --s)
+ ac_cs_silent=: ;;
+
+ # This is an error.
+ -*) as_fn_error $? "unrecognized option: \`$1'
+Try \`$0 --help' for more information." ;;
+
+ *) as_fn_append ac_config_targets " $1"
+ ac_need_defaults=false ;;
+
+ esac
+ shift
+done
+
+ac_configure_extra_args=
+
+if $ac_cs_silent; then
+ exec 6>/dev/null
+ ac_configure_extra_args="$ac_configure_extra_args --silent"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+if \$ac_cs_recheck; then
+ set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+ shift
+ \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
+ CONFIG_SHELL='$SHELL'
+ export CONFIG_SHELL
+ exec "\$@"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+exec 5>>config.log
+{
+ echo
+ sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
+## Running $as_me. ##
+_ASBOX
+ $as_echo "$ac_log"
+} >&5
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+#
+# INIT-COMMANDS
+#
+AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+
+# Handling of arguments.
+for ac_config_target in $ac_config_targets
+do
+ case $ac_config_target in
+ "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
+ "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+
+ *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
+ esac
+done
+
+
+# If the user did not use the arguments to specify the items to instantiate,
+# then the envvar interface is used. Set only those that are not.
+# We use the long form for the default assignment because of an extremely
+# bizarre bug on SunOS 4.1.3.
+if $ac_need_defaults; then
+ test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
+ test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
+fi
+
+# Have a temporary directory for convenience. Make it in the build tree
+# simply because there is no reason against having it here, and in addition,
+# creating and moving files from /tmp can sometimes cause problems.
+# Hook for its removal unless debugging.
+# Note that there is a small window in which the directory will not be cleaned:
+# after its creation but before its name has been assigned to `$tmp'.
+$debug ||
+{
+ tmp= ac_tmp=
+ trap 'exit_status=$?
+ : "${ac_tmp:=$tmp}"
+ { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status
+' 0
+ trap 'as_fn_exit 1' 1 2 13 15
+}
+# Create a (secure) tmp directory for tmp files.
+
+{
+ tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
+ test -d "$tmp"
+} ||
+{
+ tmp=./conf$$-$RANDOM
+ (umask 077 && mkdir "$tmp")
+} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
+ac_tmp=$tmp
+
+# Set up the scripts for CONFIG_FILES section.
+# No need to generate them if there are no CONFIG_FILES.
+# This happens for instance with `./config.status config.h'.
+if test -n "$CONFIG_FILES"; then
+
+
+ac_cr=`echo X | tr X '\015'`
+# On cygwin, bash can eat \r inside `` if the user requested igncr.
+# But we know of no other shell where ac_cr would be empty at this
+# point, so we can use a bashism as a fallback.
+if test "x$ac_cr" = x; then
+ eval ac_cr=\$\'\\r\'
+fi
+ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
+if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
+ ac_cs_awk_cr='\\r'
+else
+ ac_cs_awk_cr=$ac_cr
+fi
+
+echo 'BEGIN {' >"$ac_tmp/subs1.awk" &&
+_ACEOF
+
+
+{
+ echo "cat >conf$$subs.awk <<_ACEOF" &&
+ echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
+ echo "_ACEOF"
+} >conf$$subs.sh ||
+ as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'`
+ac_delim='%!_!# '
+for ac_last_try in false false false false false :; do
+ . ./conf$$subs.sh ||
+ as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+
+ ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
+ if test $ac_delim_n = $ac_delim_num; then
+ break
+ elif $ac_last_try; then
+ as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+ else
+ ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+ fi
+done
+rm -f conf$$subs.sh
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&
+_ACEOF
+sed -n '
+h
+s/^/S["/; s/!.*/"]=/
+p
+g
+s/^[^!]*!//
+:repl
+t repl
+s/'"$ac_delim"'$//
+t delim
+:nl
+h
+s/\(.\{148\}\)..*/\1/
+t more1
+s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
+p
+n
+b repl
+:more1
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t nl
+:delim
+h
+s/\(.\{148\}\)..*/\1/
+t more2
+s/["\\]/\\&/g; s/^/"/; s/$/"/
+p
+b
+:more2
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t delim
+' <conf$$subs.awk | sed '
+/^[^""]/{
+ N
+ s/\n//
+}
+' >>$CONFIG_STATUS || ac_write_fail=1
+rm -f conf$$subs.awk
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+_ACAWK
+cat >>"\$ac_tmp/subs1.awk" <<_ACAWK &&
+ for (key in S) S_is_set[key] = 1
+ FS = "\a"
+
+}
+{
+ line = $ 0
+ nfields = split(line, field, "@")
+ substed = 0
+ len = length(field[1])
+ for (i = 2; i < nfields; i++) {
+ key = field[i]
+ keylen = length(key)
+ if (S_is_set[key]) {
+ value = S[key]
+ line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
+ len += length(value) + length(field[++i])
+ substed = 1
+ } else
+ len += 1 + keylen
+ }
+
+ print line
+}
+
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
+ sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
+else
+ cat
+fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \
+ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5
+_ACEOF
+
+# VPATH may cause trouble with some makes, so we remove sole $(srcdir),
+# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and
+# trailing colons and then remove the whole line if VPATH becomes empty
+# (actually we leave an empty line to preserve line numbers).
+if test "x$srcdir" = x.; then
+ ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{
+h
+s///
+s/^/:/
+s/[ ]*$/:/
+s/:\$(srcdir):/:/g
+s/:\${srcdir}:/:/g
+s/:@srcdir@:/:/g
+s/^:*//
+s/:*$//
+x
+s/\(=[ ]*\).*/\1/
+G
+s/\n//
+s/^[^=]*=[ ]*$//
+}'
+fi
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+fi # test -n "$CONFIG_FILES"
+
+
+eval set X " :F $CONFIG_FILES :C $CONFIG_COMMANDS"
+shift
+for ac_tag
+do
+ case $ac_tag in
+ :[FHLC]) ac_mode=$ac_tag; continue;;
+ esac
+ case $ac_mode$ac_tag in
+ :[FHL]*:*);;
+ :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;;
+ :[FH]-) ac_tag=-:-;;
+ :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
+ esac
+ ac_save_IFS=$IFS
+ IFS=:
+ set x $ac_tag
+ IFS=$ac_save_IFS
+ shift
+ ac_file=$1
+ shift
+
+ case $ac_mode in
+ :L) ac_source=$1;;
+ :[FH])
+ ac_file_inputs=
+ for ac_f
+ do
+ case $ac_f in
+ -) ac_f="$ac_tmp/stdin";;
+ *) # Look for the file first in the build tree, then in the source tree
+ # (if the path is not absolute). The absolute path cannot be DOS-style,
+ # because $ac_f cannot contain `:'.
+ test -f "$ac_f" ||
+ case $ac_f in
+ [\\/$]*) false;;
+ *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
+ esac ||
+ as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;
+ esac
+ case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
+ as_fn_append ac_file_inputs " '$ac_f'"
+ done
+
+ # Let's still pretend it is `configure' which instantiates (i.e., don't
+ # use $as_me), people would be surprised to read:
+ # /* config.h. Generated by config.status. */
+ configure_input='Generated from '`
+ $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
+ `' by configure.'
+ if test x"$ac_file" != x-; then
+ configure_input="$ac_file. $configure_input"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5
+$as_echo "$as_me: creating $ac_file" >&6;}
+ fi
+ # Neutralize special characters interpreted by sed in replacement strings.
+ case $configure_input in #(
+ *\&* | *\|* | *\\* )
+ ac_sed_conf_input=`$as_echo "$configure_input" |
+ sed 's/[\\\\&|]/\\\\&/g'`;; #(
+ *) ac_sed_conf_input=$configure_input;;
+ esac
+
+ case $ac_tag in
+ *:-:* | *:-) cat >"$ac_tmp/stdin" \
+ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
+ esac
+ ;;
+ esac
+
+ ac_dir=`$as_dirname -- "$ac_file" ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$ac_file" : 'X\(//\)[^/]' \| \
+ X"$ac_file" : 'X\(//\)$' \| \
+ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$ac_file" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ as_dir="$ac_dir"; as_fn_mkdir_p
+ ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+ ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+ # A ".." for each directory in $ac_dir_suffix.
+ ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+ case $ac_top_builddir_sub in
+ "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+ *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+ esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+ .) # We are building in place.
+ ac_srcdir=.
+ ac_top_srcdir=$ac_top_builddir_sub
+ ac_abs_top_srcdir=$ac_pwd ;;
+ [\\/]* | ?:[\\/]* ) # Absolute name.
+ ac_srcdir=$srcdir$ac_dir_suffix;
+ ac_top_srcdir=$srcdir
+ ac_abs_top_srcdir=$srcdir ;;
+ *) # Relative name.
+ ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_build_prefix$srcdir
+ ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+
+ case $ac_mode in
+ :F)
+ #
+ # CONFIG_FILE
+ #
+
+ case $INSTALL in
+ [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
+ *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
+ esac
+ ac_MKDIR_P=$MKDIR_P
+ case $MKDIR_P in
+ [\\/$]* | ?:[\\/]* ) ;;
+ */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;;
+ esac
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# If the template does not know about datarootdir, expand it.
+# FIXME: This hack should be removed a few years after 2.60.
+ac_datarootdir_hack=; ac_datarootdir_seen=
+ac_sed_dataroot='
+/datarootdir/ {
+ p
+ q
+}
+/@datadir@/p
+/@docdir@/p
+/@infodir@/p
+/@localedir@/p
+/@mandir@/p'
+case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
+*datarootdir*) ac_datarootdir_seen=yes;;
+*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
+$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ ac_datarootdir_hack='
+ s&@datadir@&$datadir&g
+ s&@docdir@&$docdir&g
+ s&@infodir@&$infodir&g
+ s&@localedir@&$localedir&g
+ s&@mandir@&$mandir&g
+ s&\\\${datarootdir}&$datarootdir&g' ;;
+esac
+_ACEOF
+
+# Neutralize VPATH when `$srcdir' = `.'.
+# Shell code in configure.ac might set extrasub.
+# FIXME: do we really want to maintain this feature?
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_sed_extra="$ac_vpsub
+$extrasub
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+:t
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+s|@configure_input@|$ac_sed_conf_input|;t t
+s&@top_builddir@&$ac_top_builddir_sub&;t t
+s&@top_build_prefix@&$ac_top_build_prefix&;t t
+s&@srcdir@&$ac_srcdir&;t t
+s&@abs_srcdir@&$ac_abs_srcdir&;t t
+s&@top_srcdir@&$ac_top_srcdir&;t t
+s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
+s&@builddir@&$ac_builddir&;t t
+s&@abs_builddir@&$ac_abs_builddir&;t t
+s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
+s&@INSTALL@&$ac_INSTALL&;t t
+s&@MKDIR_P@&$ac_MKDIR_P&;t t
+$ac_datarootdir_hack
+"
+eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \
+ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+
+test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
+ { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } &&
+ { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \
+ "$ac_tmp/out"`; test -z "$ac_out"; } &&
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined. Please make sure it is defined" >&5
+$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined. Please make sure it is defined" >&2;}
+
+ rm -f "$ac_tmp/stdin"
+ case $ac_file in
+ -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";;
+ *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";;
+ esac \
+ || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+ ;;
+
+
+ :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5
+$as_echo "$as_me: executing $ac_file commands" >&6;}
+ ;;
+ esac
+
+
+ case $ac_file$ac_mode in
+ "depfiles":C) test x"$AMDEP_TRUE" != x"" || {
+ # Autoconf 2.62 quotes --file arguments for eval, but not when files
+ # are listed without --file. Let's play safe and only enable the eval
+ # if we detect the quoting.
+ case $CONFIG_FILES in
+ *\'*) eval set x "$CONFIG_FILES" ;;
+ *) set x $CONFIG_FILES ;;
+ esac
+ shift
+ for mf
+ do
+ # Strip MF so we end up with the name of the file.
+ mf=`echo "$mf" | sed -e 's/:.*$//'`
+ # Check whether this is an Automake generated Makefile or not.
+ # We used to match only the files named `Makefile.in', but
+ # some people rename them; so instead we look at the file content.
+ # Grep'ing the first line is not enough: some people post-process
+ # each Makefile.in and add a new line on top of each file to say so.
+ # Grep'ing the whole file is not good either: AIX grep has a line
+ # limit of 2048, but all sed's we know have understand at least 4000.
+ if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
+ dirpart=`$as_dirname -- "$mf" ||
+$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$mf" : 'X\(//\)[^/]' \| \
+ X"$mf" : 'X\(//\)$' \| \
+ X"$mf" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$mf" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ else
+ continue
+ fi
+ # Extract the definition of DEPDIR, am__include, and am__quote
+ # from the Makefile without running `make'.
+ DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
+ test -z "$DEPDIR" && continue
+ am__include=`sed -n 's/^am__include = //p' < "$mf"`
+ test -z "am__include" && continue
+ am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
+ # When using ansi2knr, U may be empty or an underscore; expand it
+ U=`sed -n 's/^U = //p' < "$mf"`
+ # Find all dependency output files, they are included files with
+ # $(DEPDIR) in their names. We invoke sed twice because it is the
+ # simplest approach to changing $(DEPDIR) to its actual value in the
+ # expansion.
+ for file in `sed -n "
+ s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
+ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+ # Make sure the directory exists.
+ test -f "$dirpart/$file" && continue
+ fdir=`$as_dirname -- "$file" ||
+$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$file" : 'X\(//\)[^/]' \| \
+ X"$file" : 'X\(//\)$' \| \
+ X"$file" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$file" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ as_dir=$dirpart/$fdir; as_fn_mkdir_p
+ # echo "creating $dirpart/$file"
+ echo '# dummy' > "$dirpart/$file"
+ done
+ done
+}
+ ;;
+
+ esac
+done # for ac_tag
+
+
+as_fn_exit 0
+_ACEOF
+ac_clean_files=$ac_clean_files_save
+
+test $ac_write_fail = 0 ||
+ as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5
+
+
+# configure is writing to config.log, and then calls config.status.
+# config.status does its own redirection, appending to config.log.
+# Unfortunately, on DOS this fails, as config.log is still kept open
+# by configure, so config.status won't be able to write to it; its
+# output is simply discarded. So we exec the FD to /dev/null,
+# effectively closing config.log, so it can be properly (re)opened and
+# appended to by config.status. When coming back to configure, we
+# need to make the FD available again.
+if test "$no_create" != yes; then
+ ac_cs_success=:
+ ac_config_status_args=
+ test "$silent" = yes &&
+ ac_config_status_args="$ac_config_status_args --quiet"
+ exec 5>/dev/null
+ $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
+ exec 5>>config.log
+ # Use ||, not &&, to avoid exiting from the if with $? = 1, which
+ # would make configure fail if this is the last instruction.
+ $ac_cs_success || as_fn_exit 1
+fi
+if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
+$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
+fi
+
--- /dev/null
+# -*- Autoconf -*-
+# Process this file with autoconf to produce a configure script.
+
+AC_PREREQ([2.68])
+AC_INIT([bumblebee], [3.2.1])
+AC_CONFIG_AUX_DIR([build-aux])
+AC_CONFIG_SRCDIR([src/bbsocket.c])
+#AC_CONFIG_HEADERS([config.h])
+
+# AC_DEFINE_SUBST(NAME, VALUE, DESCRIPTION)
+# -----------------------------------------
+AC_DEFUN([AC_DEFINE_SUBST], [
+AC_SUBST([$1], [$2])
+AC_DEFINE_UNQUOTED([$1], "$[$1]", [$3])
+])
+
+# AC_DEFINE_CONF(NAME, HELP_TEXT, VAR_SET_CODE)
+# --------------------------------------
+AC_DEFUN([AC_DEFINE_CONF], [
+AC_ARG_VAR([$1], [$2])
+$3
+AC_DEFINE_UNQUOTED([$1], "$[$1]", [$2])
+])
+
+# default configuration
+# Don't be stupid by using values like "path/$(nuke_machine)", it gets expanded!
+AC_DEFINE_SUBST(CONF_XDISP, ":8", [X screen number])
+AC_DEFINE_SUBST(CONF_SOCKPATH, "/var/run/bumblebee.socket", [socket path])
+AC_DEFINE_SUBST(CONF_GID, "bumblebee", [group to use when setting GID])
+AC_DEFINE_SUBST(CONF_KEEPONEXIT, "false", [stop secondary X on exit of last optirun executable])
+AC_DEFINE_SUBST(CONF_FALLBACKSTART, "false", [make optirun start applications normally if secondary is unavailable])
+AC_DEFINE_SUBST(CONF_VGLCOMPRESS, "proxy", [vglclient transport method])
+AC_DEFINE_SUBST(CONF_TURNOFFATEXIT, "false", [state of card when shutting off daemon])
+
+AC_DEFINE_CONF(CONF_BRIDGE, [optirun display/render bridge, valid values are auto (default), primus and virtualgl], [
+case $CONF_BRIDGE in
+auto|primus|virtualgl) ;;
+"") CONF_BRIDGE=auto ;;
+*) AC_MSG_ERROR([Invalid value for CONF_BRIDGE]) ;;
+esac
+])
+
+AC_DEFINE_CONF(CONF_PRIMUS_LD_PATH, [List of paths which are searched for the primus libGL.so.1 when using the primus bridge], [
+if test "x" = "x$CONF_PRIMUS_LD_PATH"; then
+ CONF_PRIMUS_LD_PATH="/usr/lib/primus:/usr/lib32/primus"
+fi
+])
+
+AC_DEFINE_CONF(CONF_PIDFILE, [Path to the pidfile or /var/run/bumblebeed.pid if empty], [
+if test "x" = "x$CONF_PIDFILE"; then
+ CONF_PIDFILE=/var/run/bumblebeed.pid
+fi
+])
+
+AC_DEFINE_CONF(CONF_PM_METHOD, [Power management method, valid values are auto (default), bbswitch, switcheroo and none], [
+case $CONF_PM_METHOD in
+auto|bbswitch|switcheroo|none) ;;
+"") CONF_PM_METHOD=auto ;;
+*) AC_MSG_ERROR([Invalid value for CONF_PM_METHOD]) ;;
+esac
+])
+AC_DEFINE_CONF(CONF_DRIVER, [default driver to use, valid values are nvidia, nouveau and an empty value (for autodetection, default)], [
+case $CONF_DRIVER in
+nvidia|nouveau|"") ;;
+*) AC_MSG_ERROR([Invalid value for CONF_DRIVER]) ;;
+esac
+])
+
+AC_DEFINE_CONF(CONF_DRIVER_MODULE_NVIDIA, [name of module for nvidia driver, i.e. the filename without .ko. If empty, "nvidia" is assumed])
+AC_DEFINE_CONF(CONF_LDPATH_NVIDIA, [Path to nvidia libraries for nvidia driver])
+AC_DEFINE_CONF(CONF_MODPATH_NVIDIA, [ModulePath for xorg modules when using nvidia driver])
+
+# non-config related compile-time defines
+AC_DEFINE(DAEMON_NAME, "bumblebeed", "daemon name")
+
+AM_INIT_AUTOMAKE([1.10.2 -Wall foreign subdir-objects
+ tar-pax])
+
+AC_ARG_WITH([pidfile],
+ [AS_HELP_STRING([--without-pidfile],
+ [support for pidfiles in the daemon @<:@default=yes@:>@])],
+ [],
+ [with_pidfile=yes])
+AS_IF([test "x$with_pidfile" != xno],
+ [AC_DEFINE(WITH_PIDFILE, [1], [Define if pidfiles should be available])
+ ])
+AM_CONDITIONAL([WITH_PIDFILE], [test "x$with_pidfile" != xno])
+
+UDEV_RULES_DIR=/lib/udev/rules.d
+AC_ARG_WITH([udev-rules],
+ [AS_HELP_STRING([--with-udev-rules@<:@=DIR@:>@],
+ [install nvidia udev rule @<:@default=/lib/udev/rules.d@:>@])],
+ [],
+ [with_udev_rules=yes])
+AS_CASE([$with_udev_rules],
+ [no], [UDEV_RULES_DIR=],
+ [yes], [], # --with-udev-rules: keep the default
+ [UDEV_RULES_DIR=$with_udev_rules])
+AC_SUBST([UDEV_RULES_DIR])
+AM_CONDITIONAL([WITH_UDEV_RULES], [test -n "$UDEV_RULES_DIR"])
+
+# Checks for programs.
+AC_PROG_CC
+AM_PROG_CC_C_O
+AC_PATH_PROG([HELP2MAN], help2man)
+AM_CONDITIONAL([HAVE_HELP2MAN], [test -n "$HELP2MAN"])
+if test x"$HELP2MAN" = x; then
+ AC_MSG_WARN([cannot find help2man, you will not be able to generate
+ manpages])
+fi
+
+regular_CPPFLAGS="-D_FILE_OFFSET_BITS=64 -D_REENTRANT"
+regular_CFLAGS="-Wall -Waggregate-return \
+ -Wmissing-declarations -Wmissing-prototypes -Wredundant-decls \
+ -Wshadow -Wstrict-prototypes -Winline -Wformat=2 -pipe"
+AC_SUBST([regular_CPPFLAGS])
+AC_SUBST([regular_CFLAGS])
+
+# Checks for libraries.
+#AC_CHECK_LIB([bsd], [pidfile_open])
+
+# Checks for header files.
+PKG_CHECK_MODULES([x11], [x11])
+PKG_CHECK_MODULES([glib], [glib-2.0])
+AS_IF([test "x$with_pidfile" != xno], [
+ PKG_CHECK_MODULES([libbsd], [libbsd >= 0.2.0])
+ PKG_CHECK_EXISTS([libbsd = 0.2.0], [AC_DEFINE(HAVE_LIBBSD_020)])
+ ])
+
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT
--- /dev/null
+bumblebee for Debian/Ubuntu
+---------------------------
+
+Bumblebee in Debian defaults to using the primus backend, not because we wish
+to diverge from upstream, but simply because virtualgl and libjpeg-turbo are
+not yet packaged. libjpeg-turbo is currently blocked by a number of technical
+and/or legal issues in Debian; see http://bugs.debian.org/612341.
+
+Bumblebee in Ubuntu also defaults to using the primus backend, because
+virtualgl has not yet been packaged for Ubuntu proper. It is however easy to
+switch to using virtualgl by using upstream's PPAs. Follow the instructions at:
+https://launchpad.net/~bumblebee/+archive/stable
+
+ -- Vincent Cheng <Vincentc1208@gmail.com> Wed, 27 Feb 2013 01:07:57 -0800
--- /dev/null
+bumblebee-nvidia: postinst-has-useless-call-to-ldconfig
+bumblebee-nvidia: postrm-has-useless-call-to-ldconfig
--- /dev/null
+#!/bin/sh
+# postinst script for bumblebee-nvidia
+#
+# see: dh_installdeb(1)
+
+set -e
+
+case "$1" in
+ configure)
+ # Ubuntu and Debian's packaging of nvidia's proprietary driver differ greatly
+ # Also, do not rely solely on dpkg-vendor (see LP: #1061769)
+ if (which dpkg-vendor >/dev/null && dpkg-vendor --derives-from Ubuntu) || \
+ [ -e /etc/dpkg/origins/ubuntu ]; then
+
+ # == Ubuntu specific section ==
+ # Repair GL on the intel display
+ for arch in x86_64-linux-gnu i386-linux-gnu; do
+ update-alternatives --force --set \
+ ${arch}_gl_conf /usr/lib/$arch/mesa/ld.so.conf 2>/dev/null || true
+ done
+
+ # versions before Oneiric without multiarch
+ update-alternatives --force --set \
+ gl_conf /usr/lib/mesa/ld.so.conf 2>/dev/null || true
+
+ else
+
+ # == Debian specific section ==
+ # Repair GL on the intel display
+ update-alternatives --force --set \
+ glx /usr/lib/mesa-diverted 2>/dev/null || true
+
+ fi
+
+ ldconfig
+ # this has a chance of crashing the machine with mainline kernels...
+ grep -q '^nouveau ' /proc/modules && rmmod nouveau || true
+ if [ -e "/etc/init/bumblebeed.conf" ]; then
+ invoke-rc.d bumblebeed restart || true
+ fi
+ ;;
+
+ abort-upgrade|abort-remove|abort-deconfigure)
+ ;;
+
+ *)
+ echo "postinst called with unknown argument \`$1'" >&2
+ exit 1
+ ;;
+esac
+
+#DEBHELPER#
+
+exit 0
--- /dev/null
+#!/bin/sh
+# postrm script for bumblebee-nvidia
+#
+# see: dh_installdeb(1)
+
+set -e
+
+case "$1" in
+ purge|remove|abort-install)
+ # Ubuntu and Debian's packaging of nvidia's proprietary driver differ greatly
+ # Also, do not rely solely on dpkg-vendor (see LP: #1061769)
+ if (which dpkg-vendor >/dev/null && dpkg-vendor --derives-from Ubuntu) || \
+ [ -e /etc/dpkg/origins/ubuntu ]; then
+
+ # == Ubuntu specific section ==
+ # Restore the alternatives in case bumblebee is installed on a
+ # non-Optimus system that requires the nvidia driver
+ for arch in x86_64-linux-gnu i386-linux-gnu; do
+ update-alternatives --force --auto ${arch}_gl_conf 2>/dev/null || true
+ done
+
+ # versions before Oneiric without multiarch
+ update-alternatives --force --auto gl_conf 2>/dev/null || true
+
+ else
+
+ # == Debian specific section ==
+ # Restore the alternatives in case bumblebee is installed on a
+ # non-Optimus system that requires the nvidia driver
+ update-alternatives --force --auto glx 2>/dev/null || true
+
+ fi
+
+ ldconfig
+ ;;
+ upgrade|failed-upgrade|abort-upgrade|disappear)
+ ;;
+ *)
+ echo "postrm called with unknown argument \`$1'" >&2
+ exit 1
+ ;;
+esac
+
+#DEBHELPER#
+
+exit 0
--- /dev/null
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides: bumblebeed
+# Required-Start: $local_fs $remote_fs $syslog
+# Required-Stop: $local_fs $remote_fs $syslog
+# Should-Start: kdm gdm lightdm nvidia-kernel
+# Should-Stop: kdm gdm lightdm nvidia-kernel
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+# Short-Description: Bumblebee supporting NVIDIA Optimus cards
+# Description: Daemon responsible for handling power management for
+# NVIDIA Optimus cards and handling optirun requests which
+# allows the discrete card to be used
+### END INIT INFO
+
+# Author: Aron Xu <aron@debian.org>
+
+# PATH should only include /usr/* if it runs after the mountnfs.sh script
+PATH=/sbin:/usr/sbin:/bin:/usr/bin
+DESC=bumblebeed # Introduce a short description here
+NAME=bumblebeed # Introduce the short server's name here
+DAEMON=/usr/sbin/bumblebeed # Introduce the server's location here
+DAEMON_ARGS="--daemon" # Arguments to run the daemon with
+PIDFILE=/var/run/$NAME.pid
+SCRIPTNAME=/etc/init.d/$NAME
+
+# Exit if the package is not installed
+[ -x $DAEMON ] || exit 0
+
+# Read configuration variable file if it is present
+[ -r /etc/default/$NAME ] && . /etc/default/$NAME
+
+# Load the VERBOSE setting and other rcS variables
+. /lib/init/vars.sh
+
+# Define LSB log_* functions.
+# Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
+. /lib/lsb/init-functions
+
+#
+# Function that starts the daemon/service
+#
+do_start()
+{
+ # Return
+ # 0 if daemon has been started
+ # 1 if daemon was already running
+ # 2 if daemon could not be started
+ start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON --test > /dev/null \
+ || return 1
+ start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- \
+ $DAEMON_ARGS \
+ || return 2
+ # Add code here, if necessary, that waits for the process to be ready
+ # to handle requests from services started subsequently which depend
+ # on this one. As a last resort, sleep for some time.
+}
+
+#
+# Function that stops the daemon/service
+#
+do_stop()
+{
+ # Return
+ # 0 if daemon has been stopped
+ # 1 if daemon was already stopped
+ # 2 if daemon could not be stopped
+ # other if a failure occurred
+ start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE --name $NAME
+ RETVAL="$?"
+ [ "$RETVAL" = 2 ] && return 2
+ # Wait for children to finish too if this is a daemon that forks
+ # and if the daemon is only ever run from this initscript.
+ # If the above conditions are not satisfied then add some other code
+ # that waits for the process to drop all resources that could be
+ # needed by services started subsequently. A last resort is to
+ # sleep for some time.
+ start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON
+ [ "$?" = 2 ] && return 2
+ # Many daemons don't delete their pidfiles when they exit.
+ rm -f $PIDFILE
+ return "$RETVAL"
+}
+
+#
+# Function that sends a SIGHUP to the daemon/service
+#
+do_reload() {
+ #
+ # If the daemon can reload its configuration without
+ # restarting (for example, when it is sent a SIGHUP),
+ # then implement that here.
+ #
+ start-stop-daemon --stop --signal 1 --quiet --pidfile $PIDFILE --name $NAME
+ return 0
+}
+
+case "$1" in
+ start)
+ [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC " "$NAME"
+ do_start
+ case "$?" in
+ 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
+ 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
+ esac
+ ;;
+ stop)
+ [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
+ do_stop
+ case "$?" in
+ 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
+ 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
+ esac
+ ;;
+ status)
+ status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $?
+ ;;
+ #reload|force-reload)
+ #
+ # If do_reload() is not implemented then leave this commented out
+ # and leave 'force-reload' as an alias for 'restart'.
+ #
+ #log_daemon_msg "Reloading $DESC" "$NAME"
+ #do_reload
+ #log_end_msg $?
+ #;;
+ restart|force-reload)
+ #
+ # If the "reload" option is implemented then remove the
+ # 'force-reload' alias
+ #
+ log_daemon_msg "Restarting $DESC" "$NAME"
+ do_stop
+ case "$?" in
+ 0|1)
+ do_start
+ case "$?" in
+ 0) log_end_msg 0 ;;
+ 1) log_end_msg 1 ;; # Old process is still running
+ *) log_end_msg 1 ;; # Failed to start
+ esac
+ ;;
+ *)
+ # Failed to stop
+ log_end_msg 1
+ ;;
+ esac
+ ;;
+ *)
+ #echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2
+ echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2
+ exit 3
+ ;;
+esac
+
+:
--- /dev/null
+# Upstart job for Bumblebee daemon
+
+description "Bumblebee supporting nVidia Optimus cards"
+author "Lekensteyn <lekensteyn@gmail.com>"
+
+# XXX: do we need to stop before / after a graphical DE like kdm?
+start on (login-session-start or desktop-session-start)
+stop on (desktop-shutdown)
+
+# restart in case it crashed for some reason
+respawn
+
+script
+ libopts=
+
+ # When the user installs a nvidia package that is unknown,
+ # ignore the paths in bumblebee.conf and use detected ones
+ if ! driver=$(grep -Po '^Driver=\K.*' /etc/bumblebee/bumblebee.conf) \
+ || [ -z "$driver" ] || [ "$driver" = "nvidia" ]; then
+ # find LibraryPath setting of nvidia section
+ libpath=$(awk -F[=:] '/^\[driver-nvidia\]/{d=1}/^LibraryPath=/{if(d){print $2;exit}}' \
+ /etc/bumblebee/bumblebee.conf) || true
+
+ # pick the first available nvidia installation (not necessary
+ # the latest, e.g. nvidia-current over nvidia-experimental-310)
+ pkgname=$(ls -1d /usr/lib/nvidia*/libGL.so | cut -d/ -f4 | head -1) || true
+
+ # When the default library path does not contain nvidia drivers,
+ # it is possibly not installed. If no driver is installed (no
+ # /usr/lib/nvidia-*), assume that the auto-detection will use
+ # nouveau instead and do not override paths.
+ if [ ! -e "$libpath/libGL.so" -a -n "$pkgname" ] && \
+ modprobe -nq "$pkgname"; then
+ # assume nvidia driver even if nouveau is already loaded
+ libopts="$libopts --driver nvidia"
+ libopts="$libopts --driver-module $pkgname"
+ libopts="$libopts --ldpath /usr/lib/$pkgname:/usr/lib32/$pkgname"
+ libopts="$libopts --module-path /usr/lib/$pkgname/xorg,/usr/lib/xorg/modules"
+ fi
+ fi
+
+ # don't use --daemon as Upstart gets confused by that.
+ exec '/usr/sbin/bumblebeed' --use-syslog $libopts
+end script
--- /dev/null
+debian/bumblebee/etc/bumblebee/* usr/share/bumblebee/default-conf/
+scripts/systemd/bumblebeed.service lib/systemd/system/
--- /dev/null
+# installed by bumblebee-nvidia
+
+# do not automatically load nouveau as it may prevent nvidia from loading
+blacklist nouveau
+# do not automatically load nvidia as it's unloaded anyway when bumblebeed
+# starts and may fail bumblebeed to disable the card in a race condition.
+blacklist nvidia
+blacklist nvidia-current
+blacklist nvidia-current-updates
+# 304
+blacklist nvidia-304
+blacklist nvidia-304-updates
+blacklist nvidia-experimental-304
+# 310
+blacklist nvidia-310
+blacklist nvidia-310-updates
+blacklist nvidia-experimental-310
+# 313
+blacklist nvidia-313
+blacklist nvidia-313-updates
+blacklist nvidia-experimental-313
--- /dev/null
+#!/bin/sh
+# postinst script for bumblebee
+#
+# see: dh_installdeb(1)
+
+set -e
+
+# group that allows users to use Bumblebee
+BB_GROUP=bumblebee
+
+# add members of these groups automatically to group "bumblebee" for new
+# installations
+USE_GROUPS='adm sudo admin'
+
+case "$1" in
+ configure)
+ # only add a group and members if the configured group does match the
+ # default group and if the group is missing
+ if grep -qx ServerGroup=$BB_GROUP /etc/bumblebee/bumblebee.conf &&
+ ! getent group $BB_GROUP > /dev/null; then
+ groupadd $BB_GROUP
+ users=$(getent group $USE_GROUPS | cut -d: -f4 | tr , '\n' | sort -u)
+ echo "Adding members from group(s) '$USE_GROUPS' to '$BB_GROUP':"
+ echo $users
+ for user in $users; do
+ gpasswd -a $user $BB_GROUP
+ done
+ fi
+ # rebuild initial ramdisk to include blacklist
+ update-initramfs -u
+ ;;
+
+ abort-upgrade|abort-remove|abort-deconfigure)
+ ;;
+
+ *)
+ echo "postinst called with unknown argument \`$1'" >&2
+ exit 1
+ ;;
+esac
+
+#DEBHELPER#
+
+exit 0
--- /dev/null
+#!/bin/sh
+# postrm script for bumblebee
+#
+# see: dh_installdeb(1)
+
+set -e
+
+
+case "$1" in
+ purge)
+ groupdel bumblebee || true
+ # keep this as old versions did not mark these files as conffiles
+ for file in bumblebee.conf xorg.conf.nvidia xorg.conf.nouveau; do
+ rm -f /etc/bumblebee/$file
+ done
+ ;;
+ remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
+ ;;
+
+ *)
+ echo "postrm called with unknown argument \`$1'" >&2
+ exit 1
+ ;;
+esac
+
+case "$1" in
+ purge|remove|abort-install)
+ # update initial ramdisk to skip blacklist
+ update-initramfs -u
+ ;;
+esac
+
+#DEBHELPER#
+
+exit 0
--- /dev/null
+bumblebee (3.1-1) experimental; urgency=low
+
+ * New upstream release.
+ * Upload to experimental.
+
+ -- Vincent Cheng <Vincentc1208@gmail.com> Tue, 09 Apr 2013 19:59:13 -0700
+
+bumblebee (3.0.1-1) unstable; urgency=low
+
+ [ Aron Xu ]
+ * Initial release (Closes: #659440).
+ * Thanks to Peter Lekensteyn and Bruno Pagani, most stuff taken from the
+ packaging for Ubuntu PPA.
+
+ [ Vincent Cheng ]
+ * Thanks to Igor Urazov for lots of the Debian-specific portions of the
+ packaging.
+
+ -- Aron Xu <aron@debian.org> Mon, 14 Jan 2013 22:16:25 +0800
--- /dev/null
+Source: bumblebee
+Section: utils
+Priority: optional
+Maintainer: Debian NVIDIA Maintainers <pkg-nvidia-devel@lists.alioth.debian.org>
+Uploaders:
+ Aron Xu <aron@debian.org>,
+ Vincent Cheng <Vincentc1208@gmail.com>,
+ Yunqiang Su <wzssyqa@gmail.com>
+Build-Depends: debhelper (>= 9), libbsd-dev (>= 0.2.0), pkg-config,
+ libx11-dev, libglib2.0-dev, help2man
+Standards-Version: 3.9.4
+Homepage: https://launchpad.net/~bumblebee
+Vcs-Git: git://anonscm.debian.org/pkg-nvidia/bumblebee.git
+Vcs-Browser: http://anonscm.debian.org/gitweb/?p=pkg-nvidia/bumblebee.git
+
+Package: bumblebee
+Architecture: linux-any
+Depends: ${shlibs:Depends}, ${misc:Depends}, bbswitch-dkms
+Recommends: virtualgl | primus
+Suggests: bumblebee-nvidia (= ${binary:Version})
+Description: NVIDIA Optimus support for Linux
+ Bumblebee is an effort to make NVIDIA Optimus enabled laptops work in
+ GNU/Linux systems. These laptops are built in such a way that the NVIDIA
+ graphics card can be used on demand so that battery life is improved and
+ temperature is kept low.
+ .
+ It disables the discrete graphics card if no client is detected, and start
+ an X server making use of NVIDIA card if requested then let software GL
+ implementations (such as VirtualGL) copy frames to the visible display that
+ runs on the intergrated graphics. The ability to use discrete graphics
+ depends on the driver: open source nouveau and proprietary nvidia.
+
+Package: bumblebee-nvidia
+Architecture: amd64 i386
+Section: contrib/utils
+Depends: ${shlibs:Depends}, ${misc:Depends}, bumblebee (= ${binary:Version}),
+ nvidia-glx | nvidia-304 | nvidia-304-updates | nvidia-experimental-304 |
+ nvidia-310 | nvidia-310-updates | nvidia-experimental-310 |
+ nvidia-313 | nvidia-313-updates | nvidia-experimental-313
+Recommends: virtualgl | primus-nvidia
+Description: NVIDIA Optimus support using the proprietary NVIDIA driver
+ This metapackage ensures that the proprietary NVIDIA driver is installed in a
+ way such that 3D acceleration does not break. It does so by configuring the
+ OpenGL library path to use the Mesa graphics library.
+
+Package: bumblebee-dbg
+Priority: extra
+Architecture: linux-any
+Section: debug
+Depends: ${misc:Depends}, bumblebee (= ${binary:Version})
+Description: NVIDIA Optimus support - debugging symbols
+ This package contains the debugging symbols for bumblebee.
--- /dev/null
+Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Upstream-Name: bumblebee
+Source: https://github.com/Bumblebee-Project/Bumblebee
+
+Files: *
+Copyright: 2011-2013 Bumblebee Project <bumblebee@lists.launchpad.net>
+License: GPL-3.0+
+
+Files: debian/*
+Copyright: 2011-2013 Peter Lekensteyn <lekensteyn@gmail.com>
+ 2011-2013 Bruno Pagani <bruno.n.pagani@gmail.com>
+ 2012 Igor Urazov <z0rc3r@gmail.com>
+ 2013 Aron Xu <aron@debian.org>
+ 2013 Vincent Cheng <Vincentc1208@gmail.com>
+License: GPL-3.0+
+
+License: GPL-3.0+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+ .
+ This package is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+ .
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+ .
+ On Debian systems, the complete text of the GNU General
+ Public License version 3 can be found in "/usr/share/common-licenses/GPL-3".
--- /dev/null
+Description: Fix primus $LIB expanding
+ In Ubuntu Raring, $LIB expand to lib/arch/, not just arch/.
+Origin: upstream, https://github.com/Bumblebee-Project/Bumblebee/commit/36683895d9fce9fa8acad5b83b2a6f020b3f1360
+Author: Bruno Pagani <bruno.n.pagani@gmail.com>
+Last-Update: 2013-02-25
+
+--- a/src/optirun.c
++++ b/src/optirun.c
+@@ -186,7 +186,7 @@ static int run_primus(int argc, char **argv) {
+ }
+ }
+
+- char *libgl_mesa = "/usr/$LIB/libGL.so.1:/usr/lib/$LIB/libGL.so.1:/usr/lib/$LIB/mesa/libGL.so.1";
++ char *libgl_mesa = "/usr/$LIB/libGL.so.1:/usr/lib/$LIB/libGL.so.1:/usr/$LIB/mesa/libGL.so.1:/usr/lib/$LIB/mesa/libGL.so.1";
+ if (bb_config.ld_path[0]) { /* build new library path for PRIMUS_libGLa */
+ int libgl_size = strlen(bb_config.ld_path) + 1;
+ { /* calculate additional memories for adding "/libGL.so.1" */
--- /dev/null
+008-primus-libs-fix.patch
--- /dev/null
+#!/usr/bin/make -f
+# -*- makefile -*-
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+%:
+ dh $@
+
+override_dh_auto_configure:
+# Ubuntu and Debian's packaging of nvidia's proprietary driver differ greatly
+ifeq ($(shell dpkg-vendor --derives-from Ubuntu && echo yes),yes)
+ dh_auto_configure -- \
+ CONF_DRIVER_MODULE_NVIDIA=nvidia-current \
+ CONF_LDPATH_NVIDIA=/usr/lib/nvidia-current:/usr/lib32/nvidia-current \
+ CONF_MODPATH_NVIDIA=/usr/lib/nvidia-current/xorg,/usr/lib/xorg/modules
+else
+ dh_auto_configure -- \
+ CONF_DRIVER_MODULE_NVIDIA=nvidia \
+ CONF_LDPATH_NVIDIA=/usr/lib/x86_64-linux-gnu/nvidia:/usr/lib/i386-linux-gnu/nvidia:/usr/lib/nvidia \
+ CONF_MODPATH_NVIDIA=/usr/lib/nvidia,/usr/lib/xorg/modules
+endif
+
+override_dh_auto_install:
+ dh_auto_install --destdir=debian/bumblebee/
+
+override_dh_installinit:
+ dh_installinit --name=bumblebeed
+
+override_dh_strip:
+ dh_strip --dbg-package=bumblebee-dbg
--- /dev/null
+3.0 (quilt)
--- /dev/null
+version=3
+https://github.com/Bumblebee-Project/Bumblebee/tags .*/v?(\d.*)\.(?:tgz|tbz2|tar\.(?:gz|bz2|xz))
--- /dev/null
+Version 3.2.1 - 26 April 2013
+
+Highlights:
+ - [hotfix] Fixed Bumblebee 3.2 not working on a lot of setups.
+ This happened because of "Device" section splitting in xorg conf files.
+ - [fix] Fixed an issue where an empty XorgModulePath lead to -isolateDecide
+ being removed from Xorg start command line instead of -modulepath.
+
+Important notes for packagers:
+ - In 3.2.1 release, we removed the bumblebee/xorg.conf.d/busid.conf file,
+ because it was avoiding X to start in cases widely common. If your packaging
+ system does not automatically remove it on upgrade to 3.2.1, then you will
+ still have a broken optirun. You either need to remove this file on package
+ upgrade or tell your distro users to do so, depending on your distro policy.
+ - In 3.2 release, we have extended our nvidia-specific udev rule file to add
+ device files (/dev/nvidia*) when the module is loaded (previously it would
+ only remove those files when the module is unloaded). Consequently, we also
+ changed its name. Some distributions, for example Gentoo, do not need to
+ install this rule file because they already have a similar mechanism in
+ place. Please also note that the rule file sets file permissions to 0666; you
+ may want to adjust it to set permissions/owner/group more strictly according
+ to your distribution's practice before installing. If you already use the
+ kernel module options to declare permissions, simply running nvidia-smi on
+ module load will do the job.
+
+Notes:
+- bbswitch is independent of the driver; vga_switcheroo works for nouveau only.
+ See also the Known Issues section above and
+ https://github.com/Bumblebee-Project/Bumblebee/wiki/Comparison-of-PM-methods
+- the video drivers must be unloadable. This means that it should not be
+ compiled into the kernel. When using dynamically built modules like nvidia,
+ be sure that the toolchain used for building the kernel matches the one that
+ is used for building the module. This means that Ubuntu mainline kernels do
+ not work and will cause crashes.
+- VirtualGL performance is very dependent on the Transport method set. The
+ default "proxy" setting appears to perform bad in some situations. Try other
+ available settings like "rgb" or "yuv".
+- in many cases, primus offers better performance; please try it and report
+ compatibility issues in primus tracker, if you find any; for now VirtualGL is
+ still preferred as the default autodetected render bridge, while primus is
+ being tested at larger scales before being released as default. Try it and
+ ensure everything you use works to help us build the best backend.
+
+Known issues:
+- vga-switcheroo won't survive suspension/hibernation (patch for newer Optimus
+ machines for OFF to work has been published in Kernel 3.3; a good patch for
+ suspend is still being prepared).
+- bbswitch cannot disable the discrete nvidia card for the Dell Vostro 360
+ desktop with Synergy. If you have a machine using that technology, please
+ submit your machine information on: https://bugs.launchpad.net/bugs/752542
+- Some laptops (mainly Lenovo) are neither supported by bbswitch nor the video
+ drivers. See https://github.com/Bumblebee-Project/bbswitch/issues/2. This is
+ fixed in Linux Kernel 3.9.
--- /dev/null
+# bash completion for bumblebee
+
+_optirun() {
+ local i prev cur last_optirun_offset compress_types in_option
+
+ in_option=false
+ # the position of the last optirun arguments part
+ last_optirun_offset=0
+ compress_types='proxy jpeg rgb xv yuv'
+
+ for (( i=1; i<=COMP_CWORD; i++ )); do
+ prev="${COMP_WORDS[i-1]}"
+ cur="${COMP_WORDS[i]}"
+
+ if $in_option; then
+ in_option=false
+ else
+ case "$prev" in
+ -c|--vgl-compress|--failsafe|--display|-d|--config|-C|--ldpath|-l|--primus-ldpath|--socket|-s|-b|--bridge)
+ in_option=true
+ ;;
+ --)
+ break
+ ;;
+ esac
+ fi
+
+ if ! $in_option; then
+ [[ "$cur" != -* ]] && break
+ fi
+
+ last_optirun_offset=$i
+ done
+
+ if [ $last_optirun_offset -eq $COMP_CWORD ]; then
+ case "$prev" in
+ -b|--bridge)
+ COMPREPLY=( $(compgen -W "auto primus virtualgl" -- "$cur") )
+ ;;
+ -c|--vgl-compress)
+ COMPREPLY=( $(compgen -W "$compress_types" -- "$cur") )
+ ;;
+ --failsafe)
+ COMPREPLY=( $(compgen -W "true false" -- "$cur") )
+ ;;
+ -d|--display)
+ # XXX: find active bumblebee X servers and suggest these
+ ;;
+ -C|--config|-s|--socket)
+ _filedir
+ ;;
+ -l|--ldpath|--primus-ldpath)
+ ;;
+ *)
+ COMPREPLY=( $(compgen -W "--vgl-compress -c --failsafe --quiet \
+ --silent -q --verbose -v --display -d --config -C --ldpath -l \
+ --primus-ldpath --socket -s --help -h --" -- "$cur") )
+ ;;
+ esac
+ return 0
+ fi
+
+ # after the options, auto-complete command
+ _command_offset $i
+}
+have optirun && complete -F _optirun optirun
+
--- /dev/null
+#!/bin/bash
+# Copyright (C) 2011-2013 Bumblebee Project
+#
+# This file is part of Bumblebee.
+#
+# Bumblebee is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# Bumblebee is distributed in the hope that 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 Bumblebee. If not, see <http://www.gnu.org/licenses/>.
+
+BUMBLEBEE_VERSION='@GITVERSION@'
+CONFDIR='@BBCONFDIR@'
+BINDIR='@BINDIR@'
+SBINDIR='@SBINDIR@'
+
+if (( EUID != 0 )); then
+ echo "Certain system information can only be gathered as root. This"
+ echo "includes the machine manufacturer and model."
+ echo
+ if which sudo &>/dev/null; then
+ echo "Please run: sudo ${0##*/}"
+ else
+ echo "Please run this script as root"
+ fi
+ echo
+ exit 1
+fi
+
+# These tools need to be able to accept multiple packages as arguments
+PKG_QUERY_TOOLS=(
+ 'apt-cache policy'
+ 'dpkg-query --show'
+ 'pacman -Q'
+ 'mpkg-show'
+)
+PKG_QUERY_TOOL=
+PACKAGES=
+# this directory will recursively be listed, symlinks are not followed
+LIST_DIRS_RECURSIVE=
+
+# Auto-detect packager tool
+for tool in "${PKG_QUERY_TOOLS[@]}"; do
+ if which "${tool%% *}" &>/dev/null; then
+ PKG_QUERY_TOOL="$tool"
+ break
+ fi
+done
+
+# XXX: perhaps LIST_DIRS_RECURSIVE can be separated from the tools
+case "$PKG_QUERY_TOOL" in
+ apt-cache*|dpkg-query*)
+ PACKAGES=(bumblebee virtualgl nvidia-current nvidia-kernel-dkms nvidia-glx libgl1-mesa-glx)
+ LIST_DIRS_RECURSIVE=(
+ /usr/lib/nvidia-current /usr/lib32/nvidia-current /usr/lib/nvidia /usr/lib/*/nvidia
+ /etc/ld.so.conf.d /usr/lib/xorg
+ )
+ ;;
+ pacman*)
+ PACKAGES=(bumblebee bumblebee-git xf86-video-nouveau nouveau-dri mesa libgl lib32-nvidia-utils-bumblebee nvidia-utils-bumblebee virtualgl-bin virtualgl32-bin)
+ LIST_DIRS_RECURSIVE=(/usr/lib/nvidia-bumblebee /usr/lib32/nvidia-bumblebee)
+ ;;
+ mpkg-show*)
+ PACKAGES=(bumblebeed xf86-video-nouveau mesa libgl nvidia-driver-optimus nvidia-driver-optimus32 virtualgl virtualgl32)
+ LIST_DIRS_RECURSIVE=(/usr/lib64/nvidia-optimus /usr/lib/nvidia-optimus)
+ ;;
+ *)
+ # unknown package management tool :/
+ ;;
+esac
+
+echo
+echo "Bug report is being generated"
+echo
+
+# Can you read Japanese? I don't.
+export LANG=C
+export LC_MESSAGES=C
+
+BUGREPORT_TMP="$(mktemp -d)"
+BUGREPORT_NAME="bumblebee-bugreport-$(date +%Y%m%d_%H%M%S)"
+BUGREPORT_DIR="$BUGREPORT_TMP/$BUGREPORT_NAME"
+BUGREPORT_FILE="$BUGREPORT_DIR"/bumblebee-report
+
+mkdir "$BUGREPORT_DIR"
+
+# Copy a logfile if exists, but merge duplicate lines if at least 10% of the
+# messages are duplicates
+copy_log() {
+ local log line skipchars months day hhmmss date hostname msg
+ local stripped_time lines_orig lines_new
+ log="$1"
+ if [ -f "$log" ]; then
+ # use the last line for determining the log format
+ line="$(tail -1 "$log")"
+ skipchars=0
+
+ months='(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)'
+ day='[ 123][0-9]'
+ hhmmss='[012][0-9]:[0-5][0-9]:[0-5][0-9]'
+ date="$months $day $hhmmss"
+ # Assume a part looking like 'Jan 1 00:00:00 '
+ if [[ "$line" =~ ^$date ]]; then
+ # skip over the leading date part and space
+ ((skipchars += 16))
+ fi
+
+ hostname="$(hostname)"
+ # Assume a static machine name part
+ if [[ "${line:$skipchars}" == "$hostname "* ]]; then
+ # skip over the hostname and space
+ ((skipchars += ${#hostname} + 1))
+ fi
+
+ # Assume a literal "kernel: " syslog tag part
+ if [[ "${line:$skipchars}" == "kernel: "* ]]; then
+ ((skipchars += 8))
+ fi
+
+ # for the printk timestamp
+ msg="${line:$skipchars}"
+ # strip leading '[ <any whitespace> <digits> . <digits> ] '
+ stripped_time="$(sed -r 's,^\[ *\d+\.\d+\] ,,' <<<"$msg")"
+ if [ ${#stripped_time} -lt ${#msg} ]; then
+ ((skipchars += ${#msg} - ${#stripped_time}))
+ fi
+
+ # Merge duplicate messages
+ uniq -s $skipchars -c "$log" > "$BUGREPORT_DIR/${log##*/}"
+
+ lines_orig=$(wc -l "$log" | cut -d' ' -f1)
+ lines_new=$(wc -l "$BUGREPORT_DIR/${log##*/}" | cut -d' ' -f1)
+
+ # if the new file is just 10% smaller in lines, use the original log
+ if [ $((lines_orig * 9 / 10)) -le $lines_new ]; then
+ cp "$log" "$BUGREPORT_DIR/"
+ fi
+ return 0
+ fi
+ return 1
+}
+
+# Remove non-matching wildcards
+shopt -s nullglob
+
+# Copy configuration, preserving times and permissions
+cp -pr "$CONFDIR" "$BUGREPORT_DIR"
+
+for log in /var/log/Xorg.* /var/log/bumblebee.*; do
+ copy_log "$log"
+done
+
+dmesg > "$BUGREPORT_TMP/dmesg"
+copy_log "$BUGREPORT_TMP/dmesg"
+
+for kernlog in /var/log/syslog /var/log/kern.log /var/log/kernel.log /var/log/messages; do
+ copy_log "$kernlog" && break
+done
+
+header() {
+ printf '\n=== %s ===\n' "$1"
+}
+
+{ # Start bug report
+header "Bumblebee Bug Report"
+echo "$BUGREPORT_NAME"
+date -R -u
+echo "Bumblebee version: $BUMBLEBEE_VERSION"
+
+header "dmidecode"
+
+for key in baseboard-manufacturer baseboard-product-name baseboard-version \
+ system-manufacturer system-product-name system-version \
+ bios-vendor bios-version bios-release-date; do
+ printf "%22s : %s\n" "$key" "$(dmidecode --string "$key")"
+done
+
+header "System Information"
+uname -a
+echo "/etc/issue:"
+cat /etc/issue
+if which lsb_release &>/dev/null; then
+ echo "lsb_release -a:"
+ lsb_release -a
+fi
+
+header "lspci overview"
+lspci -nn
+
+header "lspci on nvidia devices"
+lspci -d 10de: -vvnn
+
+header "Process information info"
+PIDS=$(pidof $(which X Xorg bumblebeed bumblebee optirun optirun32 optirun64 2>/dev/null))
+[ -n "$PIDS" ] && ps uww --pid "$PIDS"
+
+header "Directory contents"
+
+for dir in "${LIST_DIRS_RECURSIVE[@]}"; do
+ if [ -d "$dir" ]; then
+ ls --group-directories-first -laR "$dir"
+ fi
+done
+
+header "Modules info"
+lsmod
+
+if [ -d /etc/alternatives ]; then
+ header "Alternatives links"
+ alt_links=(/etc/alternatives/*gl_conf* /etc/alternatives/*xorg* /etc/alternatives/*glx* /etc/alternatives/*GL*)
+ # only show links if there are any
+ [ "${#alt_links[@]}" -eq 0 ] || ls -ld "${alt_links[@]}"
+
+ header "Alternatives info"
+ for alt in /var/lib/dpkg/alternatives/*gl_conf* \
+ /var/lib/dpkg/alternatives/*xorg*; do
+ update-alternatives --display "${alt##*/}"
+ done
+
+ header "Alternative links (all)"
+ ls -lAtr /etc/alternatives
+fi
+
+header "Library info for a GL program"
+# Try some programs, we just need the information for a single program
+for bin in $(which glxgears glxspheres xdriinfo 2>/dev/null); do
+ if ldd "$bin" | grep -qF "libGL.so"; then
+ ldd "$bin"
+ break
+ fi
+done
+
+header "Locations of files"
+for file in "$SBINDIR/bumblebeed" "$BINDIR/optirun" \
+ $(which optirun bumblebeed bumblebee vglrun vglconnect 2>/dev/null); do
+ if [ -e "$file" ]; then
+ ls -la "$file"
+ else
+ echo "$file: not found"
+ fi
+done
+
+header "Modules information"
+modinfo bbswitch
+modinfo nvidia
+modinfo nvidia-current
+modinfo nouveau
+
+header "Driver information"
+ls -ld /usr/lib/libnvidia*
+ls -ld /usr/lib/libGL.so*
+ls -ld /usr/lib/libvdpau.so*
+ls -ld /usr/lib/*/libnvidia*
+ls -ld /usr/lib/*/libGL.so*
+ls -ld /usr/lib/*/libvdpau.so*
+# non-empty containing 'log' and 1[0-9][0-9] files if the driver was installed
+# from nvidia.com
+ls -la /var/lib/nvidia
+
+header "Packages info"
+if [ -n "$PKG_QUERY_TOOL" ]; then
+ echo "Using tool: $PKG_QUERY_TOOL"
+ $PKG_QUERY_TOOL "${PACKAGES[@]}"
+else
+ echo "No package query tool is detected, no package report is generated"
+fi
+
+# End bug report
+} &>> "$BUGREPORT_FILE"
+
+tar zcf "${BUGREPORT_NAME}.tar.gz" -C "$BUGREPORT_TMP" "$BUGREPORT_NAME"
+rm -rf "$BUGREPORT_TMP"
+
+cat <<EOF
+Bug report generated
+
+The bug report has been saved as:
+${PWD%%/}/${BUGREPORT_NAME}.tar.gz
+
+Please continue following the instructions on
+https://github.com/Bumblebee-Project/Bumblebee/wiki/Reporting-Issues
+
+Thanks for your help!
+The Bumblebee Project Team
+EOF
--- /dev/null
+[Unit]
+Description=Bumblebee C Daemon
+
+[Service]
+Type=simple
+CPUSchedulingPolicy=idle
+ExecStart=@SBINDIR@/bumblebeed
+Restart=always
+RestartSec=60
+StandardOutput=kmsg
+
+[Install]
+WantedBy=graphical.target
+
--- /dev/null
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides: bumblebeed
+# Required-Start: $localfs $syslog nvidia-kernel
+# Required-Stop: $localfs $syslog nvidia-kernel
+# Should-Start: kdm gdm
+# Should-Stop: kdm gdm
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+# Short-Description: Bumblebee supporting nVidia Optimus cards
+# Description: Daemon responsible for handling power management for
+# nVidia Optimus cards and handling optirun requests which
+# allows the discrete card to be used
+### END INIT INFO
+
+# Bumblebee daemon handler script. Distro-independent script to start/stop
+# daemon. Should be runnable in any distro but won't give any feedback.
+
+# Avoid bashism since this script runs using /bin/sh, not /bin/bash!
+
+NAME=bumblebeed
+BIN='@SBINDIR@/bumblebeed'
+PIDFILE=/var/run/$NAME.pid
+
+# returns 0 if running, non-zero otherwise
+status() {
+ local pid
+ # program is not running
+ [ -s "$PIDFILE" ] || return 3
+
+ pid="$(cat "$PIDFILE" 2>/dev/null)"
+
+ # process is not running, pid file not properly cleared
+ kill -0 "$pid" || return 1
+
+ # process is running
+ return 0
+}
+
+start() {
+ # program is not installed
+ [ -x "$BIN" ] || return 5
+
+ # return if already started
+ status && return 0 || true
+ "$BIN" --daemon
+ status && return 0 || return 1
+}
+
+stop() {
+ local retries=10
+ local pid="$(cat "$PIDFILE" 2>/dev/null)"
+
+ # not running, we're done
+ status || return 0
+
+ # first ask the daemon nicely to quit
+ kill "$pid" || true
+ # and check whether it listened
+ while [ $retries -gt 0 ]; do
+ retries=$((retries - 1))
+
+ # process has gone, return success
+ status || return 0
+ # wait for half a minut before polling again
+ sleep .5
+ done
+ # failed to stop or timeout
+ return 1
+}
+
+restart() {
+ stop && start
+}
+
+case "$1" in
+ start)
+ start
+ ;;
+ stop)
+ stop
+ ;;
+ restart)
+ restart
+ ;;
+ status)
+ status
+ ;;
+ *)
+ echo "Usage: $0 {start|stop|restart|status}"
+ exit 1
+ ;;
+esac
--- /dev/null
+# Upstart job for Bumblebee daemon
+
+description "Bumblebee supporting nVidia Optimus cards"
+author "Lekensteyn <lekensteyn@gmail.com>"
+
+# XXX: do we need to stop before / after a graphical DE like kdm?
+start on (login-session-start or desktop-session-start)
+stop on (desktop-shutdown)
+
+# restart in case it crashed for some reason
+respawn
+
+# don't use --daemon as Upstart gets confused by that.
+exec '@SBINDIR@/bumblebeed' --use-syslog
--- /dev/null
+/*
+ * Copyright (c) 2011-2013, The Bumblebee Project
+ * Author: Joaquín Ignacio Aramendía samsagax@gmail.com
+ * Author: Jaron Viëtor AKA "Thulinma" <jaron@vietors.com>
+ *
+ * This file is part of Bumblebee.
+ *
+ * Bumblebee is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Bumblebee is distributed in the hope that 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 Bumblebee. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/*
+ * bbconfig.c: Bumblebee configuration file handler
+ */
+
+#include <errno.h>
+#include <ctype.h>
+#include <assert.h>
+#include <unistd.h>
+#include <getopt.h>
+#include <string.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include "bbconfig.h"
+#include "bblogger.h"
+#include "module.h"
+
+/* config values for PM methods, edit bb_pm_method in bbconfig.h as well! */
+const char *bb_pm_method_string[PM_METHODS_COUNT] = {
+ "none",
+ "auto",
+ /* the below names are used in switch/switching.c */
+ "bbswitch",
+ "switcheroo",
+};
+
+struct bb_status_struct bb_status;
+struct bb_config_struct bb_config;
+
+/**
+ * Returns a gboolean from true/false strings
+ * @return TRUE if str="true", FALSE otherwise
+ */
+gboolean bb_bool_from_string(char* str) {
+ if (strcmp(str, "true") == 0) {
+ return TRUE;
+ } else {
+ return FALSE;
+ }
+}
+
+/**
+ * Sets a value for configstring and free() existing values
+ * @param configstring A pointer to the destination
+ * @param newvalue A string to be set
+ */
+void free_and_set_value(char **configstring, char *newvalue) {
+ if (*configstring != NULL) {
+ free(*configstring);
+ }
+ *configstring = newvalue;
+}
+
+/**
+ * Takes a pointer to a char pointer, resizing and copying the string value to it.
+ */
+void set_string_value(char ** configstring, char * newvalue) {
+ //free the string if it already existed.
+ if (*configstring != 0) {
+ free(*configstring);
+ *configstring = 0;
+ }
+ //malloc a new buffer of strlen, plus one for the terminating null byte
+ *configstring = malloc(strlen(newvalue) + 1);
+ if (*configstring != 0) {
+ //copy the string if successful
+ strcpy(*configstring, newvalue);
+ } else {
+ //something, somewhere, went terribly wrong
+ bb_log(LOG_ERR, "Could not allocate %i bytes for new config value, setting to empty string!\n", strlen(newvalue) + 1);
+ *configstring = malloc(1);
+ if (*configstring == 0) {
+ bb_log(LOG_ERR, "FATAL: Could not allocate even 1 byte for config value!\n");
+ bb_log(LOG_ERR, "Aborting - cannot continue without stable config!\n");
+ exit(1);
+ }
+ (*configstring)[0] = 0;
+ }
+}//set_string_value
+
+/**
+ * Converts a string to the internal representation of a PM method
+ * @param value The string to be converted
+ * @return An index in the PM methods array
+ */
+enum bb_pm_method bb_pm_method_from_string(char *value) {
+ /* loop backwards through all possible values. If no valid value is found,
+ * assume the first element ("none") */
+ enum bb_pm_method method_index = PM_METHODS_COUNT;
+ while (method_index > 0) {
+ if (strcmp(value, bb_pm_method_string[--method_index]) == 0) {
+ break;
+ }
+ }
+ return method_index;
+}
+
+/**
+ * Prints a usage message and exits with given exit code
+ * @param exit_val The exit code to be passed to exit(). If non-zero, an hint is
+ * printed to use --help. Otherwise a help message is printed
+ */
+void print_usage(int exit_val) {
+ FILE *out = stdout;
+ int is_optirun = bb_status.runmode == BB_RUN_APP ||
+ bb_status.runmode == BB_RUN_STATUS;
+
+ if (exit_val != EXIT_SUCCESS) {
+ fprintf(stderr, "Try `%s --help' for more information.\n",
+ bb_status.program_name);
+ exit(exit_val);
+ }
+
+ if (is_optirun) {
+ printf("Usage: %s [OPTION]... command [command options...]\n",
+ bb_status.program_name);
+ fputs("Run an application using the discrete video card.\n", out);
+ } else {
+ printf("Usage: %s [OPTION]...\n", bb_status.program_name);
+ fputs("Daemon for controlling the discrete nVidia video card on Optimus"
+ " systems.\n", out);
+ }
+ printf("\n");
+ if (is_optirun) {
+ //client-only options
+ fputs("\
+ --failsafe run a program even if the nvidia card is unavailable\n\
+ --no-failsafe do not run a program if the nvidia card is unavailable\n\
+ --no-xorg do not start secondary X server (implies -b none)\n\
+ -b, --bridge METHOD acceleration/displaying bridge to use. Valid values\n\
+ are auto, virtualgl and primus. The --vgl-* options\n\
+ only make sense when using the virtualgl bridge,\n\
+ while the --primus-* options apply only when using\n\
+ the primus bridge.\n\
+ Additionally, value none is recognized, and its effect\n\
+ is to add paths to driver libraries to LD_LIBRARY_PATH\n\
+ (useful for nvidia-settings and CUDA applications)\n\
+ -c, --vgl-compress METHOD image compression or transport to use with \n\
+ VirtualGL. Valid values for METHOD are proxy,\n\
+ jpeg, rgb, xv and yuv. Changing this setting\n\
+ may affect performance, CPU usage and image\n\
+ quality\n\
+ --vgl-options OPTS a space-separated list of command options to be\n\
+ passed to vglrun. Useful for debugging virtualgl\n\
+ by passing options to it like +tr. These OPTS\n\
+ override the settings from optirun so be careful\n\
+ with setting it\n\
+ --primus-ldpath PATH a colon-separated list of paths which are searched\n\
+ for the primus libGL.so.1\n",
+ out);
+ } else {
+ //server-only options
+ fputs("\
+ -D, --daemon run daemonized (backgrounded). Implies --use-syslog\n\
+ -x, --xconf FILE xorg.conf file to use\n\
+ --xconfdir DIR xorg.conf.d directory to use\n\
+ -g, --group GROUP allow GROUP to communicate with the daemon\n\
+ --driver DRIVER the driver to use for the nvidia card. Valid values\n\
+ are nouveau and nvidia. This option also effects\n\
+ the driver section that will be used from the\n\
+ configuration file\n\
+ -m, --module-path PATH ModulePath to use for Xorg (only useful for nvidia)\n\
+ -k, --driver-module NAME Name of kernel module to be loaded if different\n\
+ from the driver\n\
+ --pm-method METHOD method to use for disabling the discrete video card,\n\
+ valid values are auto, bbswitch, switcheroo and\n\
+ none. auto selects a sensible method,\n\
+ bbswitch (kernel module) is available for nvidia\n\
+ and nouveau drivers,\n\
+ switcheroo (vga_switcheroo) is usually for\n\
+ nouveau and radeon drivers and none disables PM\n\
+ completely\n",
+ out);
+#ifdef WITH_PIDFILE
+ fputs("\
+ --pidfile FILE file in which the process ID is written. An empty\n\
+ value disables cretion of a pidfile. Note that\n\
+ the file must not already exist\n\
+ --use-syslog redirect all messages to syslog\n", out);
+#endif
+ }
+ /* common options */
+ fputs("\
+ -q, --quiet, --silent supresses all logging messages\n\
+ -v, --verbose increase the verbosity level of log messages. It\n\
+ can be specified up to two times (or five if\n\
+ --quiet is used)\n\
+ --debug show all logging messsages by setting the verbosity\n\
+ level to the maximum\n\
+ -C, --config FILE retrieve settings for Bumblebee from FILE\n", out);
+ if (is_optirun) {
+ fputs("\
+ -d, --display VDISPLAY find the Bumblebee X server on VDISPLAY. Do not\n\
+ confuse this option with the DISPLAY environment\n\
+ variable. By default, PATH is queried from the\n\
+ daemon\n\
+ -l, --ldpath PATH libraries like libGL.so are searched in PATH\n\
+ (useful for the nvidia driver). By default, PATH\n\
+ is queried from the\n", out);
+ } else {
+ fputs("\
+ -d, --display VDISPLAY start the Bumblebee X server on VDISPLAY. Do not\n\
+ confuse this option with the DISPLAY environment\n\
+ variable\n\
+ -l, --ldpath PATH libraries like nvidia_drv.so are searched in PATH\n\
+ (useful for the nvidia driver)\n", out);
+ }
+ fputs("\
+ -s, --socket FILENAME use FILENAME for communication with the daemon\n\
+ -h, --help display this help and exit\n\
+ --version output version information and exit\n", out);
+ if (is_optirun) {
+ fputs("\n\
+Examples:\n\
+ optirun glxspheres Runs the graphics demo supplied with Virtual GL.\n\
+ optirun -c yuv glxspheres Runs a program with the yuv transport method for\n\
+ better performance.\n\
+ optirun firefox http://example.com Run a program with arguments.\n", out);
+ }
+ fputs("\n\
+Report bugs on <http://Bumblebee-Project.org/issues>\n\
+Bumblebee homepage: <http://Bumblebee-Project.org/>\n", out);
+ exit(exit_val);
+}
+
+/**
+ * Parses common (shared) command line options
+ * @param opt The short option
+ * @param value Value for the option if any
+ * @return 1 if the option has been processed, 0 otherwise
+ */
+static int bbconfig_parse_common(int opt, char *value) {
+ switch (opt) {
+ case 'q'://quiet mode
+ bb_status.verbosity = VERB_NONE;
+ break;
+ case OPT_DEBUG://debug mode
+ bb_status.verbosity = VERB_ALL;
+ break;
+ case 'd'://X display number
+ set_string_value(&bb_config.x_display, value);
+ break;
+ case 'l'://LD driver path
+ set_string_value(&bb_config.ld_path, value);
+ break;
+ default:
+ /* no options parsed */
+ return 0;
+ }
+ return 1;
+}
+
+/**
+ * Parses commandline options
+ * @param argc The arguments count
+ * @param argv The arguments values
+ * @param config_only 1 if the config file is the only option to be parsed
+ */
+void bbconfig_parse_opts(int argc, char *argv[], int conf_round) {
+ /* Parse the options, set flags as necessary */
+ int opt;
+ optind = 0;
+ const char *optString = bbconfig_get_optstr();
+ const struct option *longOpts = bbconfig_get_lopts();
+ while ((opt = getopt_long(argc, argv, optString, longOpts, 0)) != -1) {
+ if (opt == '?') {
+ /* if an option was not recognized */
+ print_usage(EXIT_FAILURE);
+ }
+ if (conf_round == PARSE_STAGE_LOG && bb_status.runmode == BB_RUN_SERVER) {
+ /* hack to get logging ready before parsing other options */
+ switch (opt) {
+ case 'D':
+ case OPT_USE_SYSLOG:
+ bb_status.use_syslog = TRUE;
+ break;
+ }
+ } else if (conf_round == PARSE_STAGE_PRECONF) {
+ int is_optirun = bb_status.runmode == BB_RUN_APP ||
+ bb_status.runmode == BB_RUN_STATUS;
+ switch (opt) {
+ case 'C':
+ set_string_value(&bb_config.bb_conf_file, optarg);
+ break;
+ case 'v':
+ if (bb_status.verbosity < VERB_ALL) {
+ bb_status.verbosity++;
+ }
+ break;
+ case 's': /* Unix socket to use for communication */
+ set_string_value(&bb_config.socket_path, optarg);
+ break;
+ case 'V'://print version
+ printf("%s (Bumblebee) %s\n",
+ is_optirun ? "optirun" : "bumblebeed", GITVERSION);
+ printf("Copyright (C) 2011 The Bumblebee Project\n");
+ printf("License GPLv3+: GNU GPL version 3 or later"
+ " <http://gnu.org/licenses/gpl.html>.\n");
+ printf("This is free software: you are free to change and redistribute"
+ " it.\n");
+ printf("There is NO WARRANTY, to the extent permitted by law.\n");
+ exit(EXIT_SUCCESS);
+ break;
+ case 'h':
+ print_usage(EXIT_SUCCESS);
+ break;
+ }
+ } else if (conf_round == PARSE_STAGE_DRIVER) {
+ switch (opt) {
+ case OPT_DRIVER:
+ set_string_value(&bb_config.driver, optarg);
+ break;
+ }
+ } else if (conf_round == PARSE_STAGE_OTHER) {
+ /* try to find local options first, then try common options */
+ if (bbconfig_parse_options(opt, optarg) ||
+ bbconfig_parse_common(opt, optarg)) {
+ /* option has been parsed, continue with the next options */
+ continue;
+ }
+ }
+ }
+}
+
+/**
+ * Parse configuration file given by bb_config.bb_conf_file
+ *
+ * @return A pointer to an GKeyFile object or NULL on failure
+ */
+GKeyFile *bbconfig_parse_conf(void) {
+ //Old behavior
+ //return read_configuration();
+
+ bb_log(LOG_DEBUG, "Reading file: %s\n", bb_config.bb_conf_file);
+ GKeyFile *bbcfg;
+ GKeyFileFlags flags = G_KEY_FILE_NONE;
+ GError *err = NULL;
+
+ bbcfg = g_key_file_new();
+ if (!g_key_file_load_from_file(bbcfg, bb_config.bb_conf_file, flags, &err)) {
+ bb_log(LOG_WARNING, "Could not open configuration file: %s\n", bb_config.bb_conf_file);
+ bb_log(LOG_WARNING, "Using default configuration\n");
+ g_error_free(err);
+ g_key_file_free(bbcfg);
+ return NULL;
+ }
+
+ // First check for a key existence then parse it with appropriate format
+ // Use false as default for boolean arguments.
+ // TODO:optirun/bumblebeed must be parsed according to RUN_MODE
+
+ char* section;
+ char* key;
+ // Client settings
+ // [optirun]
+ section = "optirun";
+ key = "Bridge";
+ if (g_key_file_has_key(bbcfg, section, key, NULL)) {
+ free_and_set_value(&bb_config.optirun_bridge, g_key_file_get_string(bbcfg, section, key, NULL));
+ }
+ key = "PrimusLibraryPath";
+ if (g_key_file_has_key(bbcfg, section, key, NULL)) {
+ free_and_set_value(&bb_config.primus_ld_path, g_key_file_get_string(bbcfg, section, key, NULL));
+ }
+ key = "VGLTransport";
+ if (g_key_file_has_key(bbcfg, section, key, NULL)) {
+ free_and_set_value(&bb_config.vgl_compress, g_key_file_get_string(bbcfg, section, key, NULL));
+ }
+ key = "AllowFallbackToIGC";
+ if (g_key_file_has_key(bbcfg, section, key, NULL)) {
+ bb_config.fallback_start = g_key_file_get_boolean(bbcfg, section, key, NULL);
+ }
+
+ // Server settings
+ // [bumblebeed]
+ section = "bumblebeed";
+ key = "VirtualDisplay";
+ if (g_key_file_has_key(bbcfg, section, key, NULL)) {
+ free_and_set_value(&bb_config.x_display, g_key_file_get_string(bbcfg, section, key, NULL));
+ }
+ key = "KeepUnusedXServer";
+ if (g_key_file_has_key(bbcfg, section, key, NULL)) {
+ bb_config.stop_on_exit = !g_key_file_get_boolean(bbcfg, section, key, NULL);
+ }
+ key = "Driver";
+ if (g_key_file_has_key(bbcfg, section, key, NULL)) {
+ char *driver = g_key_file_get_string(bbcfg, section, key, NULL);
+ /* empty driv */
+ if (*driver != 0) {
+ free_and_set_value(&bb_config.driver, driver);
+ bb_log(LOG_INFO, "Configured driver: %s\n", bb_config.driver);
+ } else {
+ g_free(driver);
+ }
+ }
+ key = "ServerGroup";
+ if (g_key_file_has_key(bbcfg, section, key, NULL)) {
+ free_and_set_value(&bb_config.gid_name, g_key_file_get_string(bbcfg, section, key, NULL));
+ }
+ key = "TurnCardOffAtExit";
+ if (g_key_file_has_key(bbcfg, section, key, NULL)) {
+ bb_config.card_shutdown_state = !g_key_file_get_boolean(bbcfg, section, key, NULL);
+ }
+ key = "XorgConfDir";
+ if (g_key_file_has_key(bbcfg, section, key, NULL)) {
+ free_and_set_value(&bb_config.x_conf_dir, g_key_file_get_string(bbcfg, section, key, NULL));
+ }
+ return bbcfg;
+}
+
+/**
+ * Loads driver settings from an open GKeyFile
+ * @param bbcfg A pointer to a GKeyFile
+ * @param driver The string containing the driver to be loaded
+ */
+void bbconfig_parse_conf_driver(GKeyFile *bbcfg, char *driver) {
+ GError *err = NULL;
+ char *key, *section;
+
+ section = malloc(strlen("driver-") + strlen(driver) + 1);
+ if (section == NULL) {
+ /* why can't we just assume that there is always enough memory available?
+ * If there is no memory, the program cannot do anything useful anyway. */
+ bb_log(LOG_WARNING, "Driver settings could not be loaded: out of memory\n");
+ return;
+ }
+ strcpy(section, "driver-");
+ strcat(section, driver);
+
+ key = "KernelDriver";
+ if (g_key_file_has_key(bbcfg, section, key, NULL)) {
+ char *module_name = g_key_file_get_string(bbcfg, section, key, NULL);
+ /* if KernelDriver is empty, the default behavior is to copy Driver which
+ * is done in driver_detect() */
+ if (*module_name) {
+ free_and_set_value(&bb_config.module_name, module_name);
+ } else {
+ g_free(module_name);
+ }
+ }
+ key = "LibraryPath";
+ if (g_key_file_has_key(bbcfg, section, key, NULL)) {
+ free_and_set_value(&bb_config.ld_path, g_key_file_get_string(bbcfg, section, key, NULL));
+ }
+ key = "XorgModulePath";
+ if (g_key_file_has_key(bbcfg, section, key, NULL)) {
+ free_and_set_value(&bb_config.mod_path, g_key_file_get_string(bbcfg, section, key, NULL));
+ }
+ key = "PMMethod";
+ if (g_key_file_has_key(bbcfg, section, key, NULL)) {
+ char *val = g_key_file_get_string(bbcfg, section, key, NULL);
+ enum bb_pm_method pm_method_index = bb_pm_method_from_string(val);
+ bb_config.pm_method = pm_method_index;
+ g_free(val);
+ }
+ key = "XorgConfFile";
+ if (g_key_file_has_key(bbcfg, section, key, NULL)) {
+ free_and_set_value(&bb_config.x_conf_file, g_key_file_get_string(bbcfg, section, key, NULL));
+ }
+ if (err != NULL) {
+ g_error_free(err);
+ }
+ free(section);
+}
+
+/**
+ * Set options that must be set before opening logs or loading configuration
+ * @param argv Argument values
+ * @param runmode The running mode of the program
+ */
+void init_early_config(char **argv, int runmode) {
+ /* clear existing configuration and reset pointers */
+ memset(&bb_status, 0, sizeof bb_status);
+ set_string_value(&bb_status.errors, ""); //we start without errors, yay!
+ bb_status.verbosity = VERB_NOTICE;
+ bb_status.bb_socket = -1;
+ bb_status.appcount = 0;
+ bb_status.x_pid = 0;
+ bb_status.x_pipe[0] = -1;
+ bb_status.x_pipe[1] = -1;
+ bb_status.runmode = runmode;
+ bb_status.program_name = argv[0];
+}
+
+/**
+ * Parse configuration file and command line arguments
+ */
+void init_config(void) {
+ /* clear pointers and settings */
+ memset(&bb_config, 0, sizeof bb_config);
+ /* set defaults if not set already */
+ set_string_value(&bb_config.x_display, CONF_XDISP);
+ set_string_value(&bb_config.bb_conf_file, CONFIG_FILE);
+ set_string_value(&bb_config.ld_path, "");
+ set_string_value(&bb_config.mod_path, "");
+ set_string_value(&bb_config.socket_path, CONF_SOCKPATH);
+ set_string_value(&bb_config.gid_name, CONF_GID);
+ set_string_value(&bb_config.x_conf_file, CONF_XORG);
+ set_string_value(&bb_config.x_conf_dir, CONF_XORG_DIR);
+ set_string_value(&bb_config.optirun_bridge, CONF_BRIDGE);
+ set_string_value(&bb_config.primus_ld_path, CONF_PRIMUS_LD_PATH);
+ set_string_value(&bb_config.vgl_compress, CONF_VGLCOMPRESS);
+ // default to auto-detect
+ set_string_value(&bb_config.driver, "");
+ set_string_value(&bb_config.module_name, "");
+ bb_config.pm_method = bb_pm_method_from_string(CONF_PM_METHOD);
+ bb_config.stop_on_exit = bb_bool_from_string(CONF_KEEPONEXIT);
+ bb_config.fallback_start = bb_bool_from_string(CONF_FALLBACKSTART);
+ bb_config.card_shutdown_state = bb_bool_from_string(CONF_TURNOFFATEXIT);
+#ifdef WITH_PIDFILE
+ set_string_value(&bb_config.pid_file, CONF_PIDFILE);
+#endif
+}
+
+/**
+ * Prints the current configuration with verbosity level LOG_DEBUG
+ */
+void config_dump(void) {
+ //print configuration as debug messages
+ bb_log(LOG_DEBUG, "Active configuration:\n");
+ /* common options */
+ bb_log(LOG_DEBUG, " bumblebeed config file: %s\n", bb_config.bb_conf_file);
+ bb_log(LOG_DEBUG, " X display: %s\n", bb_config.x_display);
+ bb_log(LOG_DEBUG, " LD_LIBRARY_PATH: %s\n", bb_config.ld_path);
+ bb_log(LOG_DEBUG, " Socket path: %s\n", bb_config.socket_path);
+ if (bb_status.runmode == BB_RUN_SERVER || bb_status.runmode == BB_RUN_DAEMON) {
+ /* daemon options */
+#ifdef WITH_PIDFILE
+ bb_log(LOG_DEBUG, " pidfile: %s\n", bb_config.pid_file);
+#endif
+ bb_log(LOG_DEBUG, " xorg.conf file: %s\n", bb_config.x_conf_file);
+ bb_log(LOG_DEBUG, " xorg.conf.d dir: %s\n", bb_config.x_conf_dir);
+ bb_log(LOG_DEBUG, " ModulePath: %s\n", bb_config.mod_path);
+ bb_log(LOG_DEBUG, " GID name: %s\n", bb_config.gid_name);
+ bb_log(LOG_DEBUG, " Power method: %s\n",
+ bb_pm_method_string[bb_config.pm_method]);
+ bb_log(LOG_DEBUG, " Stop X on exit: %i\n", bb_config.stop_on_exit);
+ bb_log(LOG_DEBUG, " Driver: %s\n", bb_config.driver);
+ bb_log(LOG_DEBUG, " Driver module: %s\n", bb_config.module_name);
+ bb_log(LOG_DEBUG, " Card shutdown state: %i\n",
+ bb_config.card_shutdown_state);
+ } else {
+ /* client options */
+ bb_log(LOG_DEBUG, " Accel/display bridge: %s\n", bb_config.optirun_bridge);
+ bb_log(LOG_DEBUG, " VGL Compression: %s\n", bb_config.vgl_compress);
+ bb_log(LOG_DEBUG, " VGLrun extra options: %s\n", bb_config.vglrun_options ? bb_config.vglrun_options : "");
+ bb_log(LOG_DEBUG, " Primus LD Path: %s\n", bb_config.primus_ld_path);
+ }
+}
+
+/**
+ * Checks the configuration for errors and report them
+ *
+ * @return 0 if no errors are detected, non-zero otherwise
+ */
+int config_validate(void) {
+ int error = 0;
+ if (*bb_config.module_name) {
+ char *mod = bb_config.module_name;
+ if (!module_is_available(mod)) {
+ error = 1;
+ bb_log(LOG_ERR, "Module '%s' is not found.\n", mod);
+ }
+ } else {
+ bb_log(LOG_ERR, "Invalid configuration: no driver configured.\n");
+ error = 1;
+ }
+ if (!error) {
+ bb_log(LOG_DEBUG, "Configuration test passed.\n");
+ }
+ return error;
+}
+
+/**
+ * Sets error messages if any problems occur.
+ * Resets stored error when called with argument 0.
+ */
+void set_bb_error(char * msg) {
+ if (msg && msg[0] != 0) {
+ //only store error if no error stored yet
+ //earliest error is the most important!
+ if (bb_status.errors[0] == 0){
+ set_string_value(&bb_status.errors, msg);
+ }
+ bb_log(LOG_ERR, "%s\n", msg);
+ } else {
+ //clear set error message, if any.
+ if (bb_status.errors[0] != 0) {
+ set_string_value(&bb_status.errors, "");
+ }
+ }
+}//set_bb_error
--- /dev/null
+/*
+ * Copyright (c) 2011-2013, The Bumblebee Project
+ * Author: Joaquín Ignacio Aramendía samsagax@gmail.com
+ * Author: Jaron Viëtor AKA "Thulinma" <jaron@vietors.com>
+ *
+ * This file is part of Bumblebee.
+ *
+ * Bumblebee is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Bumblebee is distributed in the hope that 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 Bumblebee. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/*
+ * bbconfig.h: Bumblebee configuration file handler
+ */
+
+#include <unistd.h> //for pid_t
+#include <limits.h> //for CHAR_MAX
+#include <glib.h>
+
+/* Daemon states */
+#define BB_DAEMON 1
+#define BB_NODEAMON 0
+
+/* Parsing rounds */
+enum {
+ PARSE_STAGE_LOG,
+ PARSE_STAGE_PRECONF,
+ PARSE_STAGE_DRIVER,
+ PARSE_STAGE_OTHER,
+};
+
+/* common command line params */
+#define BBCONFIG_COMMON_OPTSTR "+qvd:s:l:C:hV"
+#define BBCONFIG_COMMON_LOPTS \
+ {"quiet", 0, 0, 'q'},\
+ {"silent", 0, 0, 'q'},\
+ {"verbose", 0, 0, 'v'},\
+ {"display", 1, 0, 'd'},\
+ {"socket", 1, 0, 's'},\
+ {"ldpath", 1, 0, 'l'},\
+ {"config", 1, 0, 'C'},\
+ {"help", 0, 0, 'h'},\
+ {"version", 0, 0, 'V'},\
+ {"debug", 0, 0, OPT_DEBUG},\
+ {0, 0, 0, 0}
+
+const char *bbconfig_get_optstr(void);
+const struct option *bbconfig_get_lopts(void);
+int bbconfig_parse_options(int opt, char *value);
+
+/* use a value that cannot be a valid char for getopt */
+enum {
+ OPT_DRIVER = CHAR_MAX + 1,
+ OPT_FAILSAFE,
+ OPT_NO_FAILSAFE,
+ OPT_NO_XORG,
+ OPT_VGL_OPTIONS,
+ OPT_STATUS,
+ OPT_PIDFILE,
+ OPT_USE_SYSLOG,
+ OPT_DEBUG,
+ OPT_PM_METHOD,
+ OPT_PRIMUS_LD_PATH,
+ OPT_X_CONF_DIR_PATH,
+};
+
+/* Verbosity levels */
+enum verbosity_level {
+ VERB_NONE,
+ VERB_ERR,
+ VERB_WARN,
+ VERB_NOTICE,
+ VERB_INFO,
+ VERB_DEBUG,
+ VERB_ALL
+};
+
+/* Running modes */
+enum bb_run_mode {
+ BB_RUN_SERVER = 0,
+ BB_RUN_DAEMON = 1,
+ BB_RUN_APP = 2,
+ BB_RUN_STATUS = 4,
+ BB_RUN_EXIT = 99
+};
+
+/* Power management methods, edit bb_pm_method_string in bbconfig.c as well! */
+enum bb_pm_method {
+ PM_DISABLED,
+ PM_AUTO, /* at detection time, this value will be changed */
+ PM_BBSWITCH,
+ PM_VGASWITCHEROO,
+ PM_METHODS_COUNT /* not a method but a marker for the end */
+};
+const char *bb_pm_method_string[PM_METHODS_COUNT];
+
+/* String buffer size */
+#define BUFFER_SIZE 1024
+
+/* Structure containing the status of the application */
+struct bb_status_struct {
+ enum verbosity_level verbosity; ///Verbosity level of messages.
+ int bb_socket; /// The socket file descriptor of the application.
+ unsigned int appcount; /// Count applications using the X server.
+ char * errors; /// Error message if any. First byte is 0 otherwise.
+ enum bb_run_mode runmode; /// Running mode.
+ pid_t x_pid;
+ int x_pipe[2];//pipes for reading/writing output from X's stdout/stderr
+ gboolean use_syslog;
+ char *program_name;
+};
+
+/* Structure containing the configuration. */
+struct bb_config_struct {
+ char * x_display; /// X display number to use.
+ char * x_conf_file; /// Path to the X configuration file.
+ char * x_conf_dir; /// Path to the dummy X configuration directory.
+ char * bb_conf_file; /// Path to the bumblebeed configuration file.
+ char * ld_path; /// LD_LIBRARY_PATH to launch applications.
+ char * mod_path; /// ModulePath for xorg.
+ char * socket_path; /// Path to the server socket.
+ char * gid_name; /// Group name for setgid.
+ enum bb_pm_method pm_method; /// Which method to use for power management.
+ int stop_on_exit; /// Whether to stop the X server on last optirun instance exit.
+ int fallback_start; /// Wheter the application should be launched on the integrated card when X is not available.
+ int no_xorg; /// Do not start secondary X server
+ char * optirun_bridge; /// Accel/display bridge for optirun.
+ char * primus_ld_path; /// LD_LIBRARY_PATH containing primus libGL.so.1
+ char * vgl_compress; /// VGL transport method.
+ char * vglrun_options; /* extra options passed to vglrun */
+ char * driver; /// Driver to use (nvidia or nouveau).
+ char * module_name; /* Kernel module to be loaded for the driver.
+ * If empty, driver will be used. This is
+ * for Ubuntu which uses nvidia-current */
+ int card_shutdown_state;
+#ifdef WITH_PIDFILE
+ char *pid_file; /* pid file for storing the daemons PID */
+#endif
+};
+
+extern struct bb_status_struct bb_status;
+extern struct bb_config_struct bb_config;
+
+/* Early initialization of bb_status */
+void init_early_config(char **argv, int runmode);
+/* Parse configuration from command line and configuration files */
+void init_config(void);
+void config_dump(void);
+int config_validate(void);
+
+/**
+ * Sets error messages if any problems occur.
+ * Resets stored error when called with argument 0.
+ */
+void set_bb_error(char * msg);
+
+void free_and_set_value(char **configstring, char *newvalue);
+
+/**
+ * Takes a pointer to a char pointer, resizing and copying the string value to it.
+ */
+void set_string_value(char ** configstring, char * newvalue);
+
+struct option *config_get_longopts(struct option *longopts, size_t items);
+
+void print_usage(int exit_val);
+
+void bbconfig_parse_opts(int argc, char *argv[], int conf_round);
+
+GKeyFile *bbconfig_parse_conf(void);
+void bbconfig_parse_conf_driver(GKeyFile *bbcfg, char *driver);
+
+gboolean bb_bool_from_string(char* str);
+
+enum bb_pm_method bb_pm_method_from_string(char *value);
+
+size_t ensureZeroTerminated(char *buff, size_t size, size_t max);
--- /dev/null
+/*
+ * Copyright (c) 2011-2013, The Bumblebee Project
+ * Author: Joaquín Ignacio Aramendía samsagax@gmail.com
+ *
+ * This file is part of Bumblebee.
+ *
+ * Bumblebee is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Bumblebee is distributed in the hope that 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 Bumblebee. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/*
+ * bblogger.c: loggin functions for bumblebee daemon and client
+ */
+
+#include <stdlib.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <ctype.h>
+#include <time.h>
+#include "bblogger.h"
+#include "bbconfig.h"
+
+char x_output_buffer[512]; /* Xorg output buffer */
+int x_buffer_pos = 0;/* Xorg output buffer position */
+
+
+/**
+ * Initialize log capabilities. Return 0 on success
+ */
+int bb_init_log(void) {
+ /* Open Logggin mechanism based on configuration */
+ if (bb_status.use_syslog) {
+ openlog(DAEMON_NAME, LOG_PID, LOG_DAEMON);
+ } else {
+ }
+ /* Should end with no error by now */
+ return 0;
+}
+
+/**
+ * Log a message to the current log mechanism.
+ * Try to keep log messages less than 80 characters.
+ */
+void bb_log(int priority, char* msg_format, ...) {
+ switch (priority) {
+ case LOG_ERR:
+ if (bb_status.verbosity < VERB_ERR) {
+ return;
+ }
+ break;
+ case LOG_WARNING:
+ if (bb_status.verbosity < VERB_WARN) {
+ return;
+ }
+ break;
+ case LOG_NOTICE:
+ if (bb_status.verbosity < VERB_NOTICE) {
+ return;
+ }
+ break;
+ case LOG_INFO:
+ if (bb_status.verbosity < VERB_INFO) {
+ return;
+ }
+ break;
+ case LOG_DEBUG:
+ if (bb_status.verbosity < VERB_DEBUG) {
+ return;
+ }
+ break;
+ default:
+ /* unspecified log level, always log it unless verbosity is NONE */
+ if (bb_status.verbosity == VERB_NONE) {
+ return;
+ }
+ break;
+ }
+
+ va_list args;
+ va_start(args, msg_format);
+ if (bb_status.use_syslog) {
+ vsyslog(priority, msg_format, args);
+ } else {
+ char* fullmsg_fmt = malloc(BUFFER_SIZE + 8);
+ struct timespec tp;
+ clock_gettime(CLOCK_MONOTONIC, &tp);
+ switch (priority) {
+ case LOG_ERR:
+ fullmsg_fmt = strcpy(fullmsg_fmt, "[ERROR]");
+ break;
+ case LOG_DEBUG:
+ fullmsg_fmt = strcpy(fullmsg_fmt, "[DEBUG]");
+ break;
+ case LOG_WARNING:
+ fullmsg_fmt = strcpy(fullmsg_fmt, "[WARN]");
+ break;
+ default:
+ fullmsg_fmt = strcpy(fullmsg_fmt, "[INFO]");
+ }
+ fullmsg_fmt = strncat(fullmsg_fmt, msg_format, BUFFER_SIZE);
+ fprintf(stderr, "[%5llu.%06lu] ", (long long)tp.tv_sec, tp.tv_nsec / 1000);
+ vfprintf(stderr, fullmsg_fmt, args);
+ free(fullmsg_fmt);
+ }
+ va_end(args);
+}
+
+/**
+ * Close logging mechanism
+ */
+void bb_closelog(void) {
+ if (bb_status.use_syslog) {
+ closelog();
+ }
+}
+
+/** Parses a single null-terminated string of Xorg output.
+ * Will call bb_log appropiately.
+ */
+static void parse_xorg_output(char * string){
+ int prio = LOG_DEBUG;/* most lines are debug messages */
+ char * valid = 0; /* Helper for finding correct ConnectedMonitor setting */
+ char * valid_end = 0; /* Helper for finding correct ConnectedMonitor setting */
+ /* message to be logged with set_bb_error */
+ char error_buffer[strlen("[XORG] ") + sizeof (x_output_buffer)];
+
+ /* don't log an empty line or a line with a single whitespace */
+ if (string[0] == 0 || (string[1] == 0 && isspace(string[0]))) {
+ return;
+ }
+
+ /* Error lines are errors. */
+ if (strncmp(string, "(EE)", 4) == 0){
+ if (strstr(string, "Failed to load module \"kbd\"") ||
+ strstr(string, "No input driver matching")) {
+ /* non-fatal errors */
+ prio = LOG_DEBUG;
+ } else {
+ /* prefix with [XORG] */
+ snprintf(error_buffer, sizeof error_buffer, "[XORG] %s", string);
+ set_bb_error(error_buffer);//set as error
+ /* errors are handled seperately from the rest - return */
+ return;
+ }
+ }
+
+ /* Warning lines are warnings. */
+ if (strncmp(string, "(WW)", 4) == 0){
+ prio = LOG_WARNING;
+ /* recognize some of the less useful warnings, degrade them to LOG_DEBUG level. */
+ if (
+ /* nouveau: warning about no outputs being found connected */
+ strstr(string, "trying again") ||
+ /* nouveau: warning for set resolution with no screen attached */
+ strstr(string, "initial framebuffer") ||
+ /* X: no keyboard/mouse warning */
+ strstr(string, "looking for one") ||
+ /* nvidia: cannot read EDID warning */
+ strstr(string, "EDID") ||
+ /* fonts directory that cannot be found */
+ strstr(string, "The directory \"") ||
+ /* kbd module that is trying to get loaded */
+ strstr(string, "couldn't open module kbd") ||
+ /* we're not interested in input drivers */
+ strstr(string, "No input driver matching")) {
+ prio = LOG_DEBUG;
+ } else if (strstr(string, "valid display devices are")) {
+ /* Recognize nvidia complaining about ConnectedMonitor setting */
+ valid = strchr(string, '\'');//find the '-character
+ if (valid){
+ char last_chr = 0;
+ valid_end = ++valid;/* advance valid one character, start searching for end */
+ while (valid_end[0] != 0){
+ last_chr = valid_end[0];
+ if (last_chr == '\'' || last_chr == ',' || last_chr == ' ') {
+ valid_end[0] = 0;
+ break;
+ }
+ valid_end++;
+ }
+ set_bb_error(0); /* Clear error message, we want to override it even though it is not first */
+ snprintf(error_buffer, sizeof error_buffer, "You need to change the"
+ " ConnectedMonitor setting in %s to %s",
+ bb_config.x_conf_file, valid);
+ set_bb_error(error_buffer);//set as error
+ /* Restore the string for logging purposes */
+ valid_end[0] = last_chr;
+ }
+ }
+ }
+
+ /* do the actual logging */
+ bb_log(prio, "[XORG] %s\n", string);
+}
+
+/** Will check the xorg output pipe and parse any waiting messages.
+ * Doesn't take any parameters and doesn't return anything.
+ */
+void check_xorg_pipe(void){
+ if (bb_status.x_pipe[0] == -1){return;}
+ int repeat;
+
+ do{
+ repeat = 0;
+ /* attempt to read at most the entire buffer full. */
+ int r = read(bb_status.x_pipe[0], x_output_buffer + x_buffer_pos,
+ sizeof (x_output_buffer) - x_buffer_pos - 1);
+ if (r > 0){
+ x_buffer_pos += r;
+ /* append a null byte to close the string */
+ x_output_buffer[x_buffer_pos] = 0;
+ if (x_buffer_pos == sizeof (x_output_buffer) - 1) {
+ /* line / buffer is full, process the remaining buffer the next round */
+ repeat = 1;
+ }
+ }else{
+ if (r == 0 || (errno != EAGAIN && r == -1)){
+ /* the pipe is closed/invalid. Clean up. */
+ if (bb_status.x_pipe[0] != -1){close(bb_status.x_pipe[0]); bb_status.x_pipe[0] = -1;}
+ if (bb_status.x_pipe[1] != -1){close(bb_status.x_pipe[1]); bb_status.x_pipe[1] = -1;}
+ }
+ }
+ /* while x_buffer_pos>0 and a \n is in the buffer, parse.
+ * if buffer is full, parse also. */
+ while (x_buffer_pos > 0){
+ char * foundnewline = strchr(x_output_buffer, '\n');
+ if (!foundnewline || foundnewline-x_output_buffer > x_buffer_pos){
+ /* cancel search if no newline, try again later
+ * except if buffer is full, then parse */
+ if (x_buffer_pos == sizeof (x_output_buffer) - 1) {
+ parse_xorg_output(x_output_buffer);
+ x_buffer_pos = 0;
+ }
+ break;
+ }
+ foundnewline[0] = 0;/* convert newline to null byte */
+ parse_xorg_output(x_output_buffer);/* parse the line */
+ char *next_part = foundnewline + 1; /* begin of next line */
+ int size = next_part - x_output_buffer;
+ x_buffer_pos -= size;/* cut the parsed part from the buffer size */
+ if (x_buffer_pos > 0){/* move the unparsed part left, if any */
+ memmove(x_output_buffer, next_part, x_buffer_pos);
+ }
+ }
+ }while(repeat);
+}/* check_xorg_pipe */
--- /dev/null
+/*
+ * Copyright (c) 2011-2013, The Bumblebee Project
+ * Author: Joaquín Ignacio Aramendía samsagax@gmail.com
+ *
+ * This file is part of Bumblebee.
+ *
+ * Bumblebee is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Bumblebee is distributed in the hope that 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 Bumblebee. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/*
+ * bblogger.c: loggin functions for bumblebee daemon and client
+ */
+/* necessary for all LOG_ constants */
+#include <syslog.h>
+
+#ifndef _BBLOGGER
+#define _BBLOGGER
+
+/**
+ * Initialize log capabilities. Return 0 on success
+ */
+int bb_init_log(void);
+
+/**
+ * Log a message to the current log mechanism.
+ * Try to keep log messages less than 80 characters.
+ */
+void bb_log(int priority, char* msg_format, ...);
+
+/**
+ * Close logging mechanism
+ */
+void bb_closelog(void);
+
+/** Will check the xorg output pipe and parse any waiting messages.
+ * Doesn't take any parameters and doesn't return anything.
+ */
+void check_xorg_pipe(void);
+
+#endif
--- /dev/null
+/*
+ * Copyright (c) 2011-2013, The Bumblebee Project
+ * Author: Jaron Viëtor AKA "Thulinma" <jaron@vietors.com>
+ * Author: Lekensteyn <lekensteyn@gmail.com>
+ *
+ * This file is part of Bumblebee.
+ *
+ * Bumblebee is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Bumblebee is distributed in the hope that 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 Bumblebee. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/*
+ * Run command functions for Bumblebee
+ */
+
+/* for strchrnul */
+#define _GNU_SOURCE
+
+#include <linux/limits.h> /* for PATH_MAX */
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <signal.h>
+#include <sys/wait.h>
+#include <errno.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <stdio.h>
+#include "bbrun.h"
+#include "bblogger.h"
+
+int handler_set = 0;
+int dowait = 1;
+
+/// Socket list structure for use in main_loop.
+
+struct pidlist {
+ pid_t PID;
+ struct pidlist *prev;
+ struct pidlist *next;
+};
+
+struct pidlist * pidlist_start = 0; ///Begin of the linked-list of PIDs, if any.
+
+/// Adds a pid_t to the linked list of PIDs.
+/// Creates the list if it is still null.
+
+static void pidlist_add(pid_t newpid) {
+ struct pidlist *curr = malloc(sizeof (struct pidlist));
+ curr->PID = newpid;
+ curr->prev = 0;
+ // the PID is inserted BEFORE the first PID, this should not matter
+ curr->next = pidlist_start ? pidlist_start : 0;
+ pidlist_start = curr;
+}
+
+/// Removes a pid_t from the linked list of PIDs.
+/// Makes list null if empty.
+static void pidlist_remove(pid_t rempid) {
+ struct pidlist *curr;
+ struct pidlist *next_iter;
+ for (curr = pidlist_start; curr; curr = next_iter) {
+ next_iter = curr->next;
+ if (curr->PID == rempid) {
+ if (curr->next) {
+ curr->next->prev = curr->prev;
+ }
+ if (curr->prev) {
+ curr->prev->next = curr->next;
+ } else {
+ pidlist_start = curr->next;
+ }
+ free(curr);
+ }
+ }
+}//pidlist_remove
+
+/// Finds a pid_t in the linked list of PIDs.
+/// Returns 0 if not found, 1 otherwise.
+
+static int pidlist_find(pid_t findpid) {
+ struct pidlist *curr;
+ for (curr = pidlist_start; curr; curr = curr->next) {
+ if (curr->PID == findpid) {
+ return 1;
+ }
+ }
+ return 0;
+}//pidlist_find
+
+static void childsig_handler(int signum) {
+ if (signum != SIGCHLD) {
+ return;
+ }
+ int chld_stat = 0;
+ /* Wait for the child to exit */
+ pid_t ret = wait(&chld_stat);
+ /* Log the child termination and return value */
+ if (ret == -1) {
+ bb_log(LOG_DEBUG, "SIGCHILD received, but wait failed with %s\n",
+ strerror(errno));
+ } else if (WIFEXITED(chld_stat)) {
+ bb_log(LOG_DEBUG, "Process with PID %i returned code %i\n", ret,
+ WEXITSTATUS (chld_stat));
+ } else if (WIFSIGNALED(chld_stat)) {
+ bb_log(LOG_DEBUG, "Process with PID %i terminated with %i\n", ret,
+ WTERMSIG(chld_stat));
+ }
+ pidlist_remove(ret);
+}//childsig_handler
+
+static void check_handler(void) {
+ // Set handler for this child process if not already
+ if (handler_set == 0) {
+ struct sigaction new_action;
+ new_action.sa_handler = childsig_handler;
+ sigemptyset(&new_action.sa_mask);
+ new_action.sa_flags = 0;
+ sigaction(SIGCHLD, &new_action, NULL);
+ handler_set = 1;
+ }
+}//check_handler
+
+static void bb_run_exec_detached(char **argv);
+
+/**
+ * Forks and runs the given application and waits for the process to finish
+ *
+ * @param argv The arguments values, the first one is the program
+ * @param detached non-zero if the std in/output must be redirected to /dev/null, zero otherwise
+ * @return Exit code of the program (between 0 and 255) or -1 on failure
+ */
+int bb_run_fork(char **argv, int detached) {
+ int exitcode = -1;
+
+ check_handler();
+ /* Fork and attempt to run given application */
+ pid_t pid = fork();
+ if (pid == 0) {
+ /* child process after fork */
+ if (detached) {
+ bb_run_exec_detached(argv);
+ } else {
+ bb_run_exec(argv);
+ }
+ } else if (pid > 0) {
+ /* parent process after fork */
+ int status = 0;
+
+ bb_log(LOG_DEBUG, "Process %s started, PID %i.\n", argv[0], pid);
+ pidlist_add(pid);
+
+ if (waitpid(pid, &status, 0) != -1) {
+ if (WIFEXITED(status)) {
+ /* program exited normally, return status */
+ exitcode = WEXITSTATUS(status);
+ } else if (WIFSIGNALED(status)) {
+ /* program was terminated by a signal */
+ exitcode = 128 + WTERMSIG(status);
+ }
+ } else {
+ bb_log(LOG_ERR, "waitpid(%i) faild with %s\n", pid, strerror(errno));
+ }
+ pidlist_remove(pid);
+ } else {
+ /* Fork failed */
+ bb_log(LOG_ERR, "Process %s could not be started. fork() failed.\n", argv[0]);
+ }
+
+ /* could not determine return value */
+ return exitcode;
+}
+
+/**
+ * Forks and runs the given application, using an optional LD_LIBRARY_PATH. The
+ * function then returns immediately.
+ * stderr and stdout of the ran application is redirected to the parameter redirect.
+ * stdin is redirected to /dev/null always.
+ *
+ * @param argv The arguments values, the first one is the program
+ * @param ldpath The library path to be used if any (may be NULL)
+ * @param redirect The file descriptor to redirect stdout/stderr to. Must be valid and open.
+ * @return The childs process ID
+ */
+pid_t bb_run_fork_ld_redirect(char **argv, char *ldpath, int redirect) {
+ check_handler();
+ // Fork and attempt to run given application
+ pid_t ret = fork();
+ if (ret == 0) {
+ if (ldpath && *ldpath) {
+ char *current_path = getenv("LD_LIBRARY_PATH");
+ /* Fork went ok, set environment if necessary */
+ if (current_path) {
+ char *ldpath_new = malloc(strlen(ldpath) + 1 + strlen(current_path) + 1);
+ if (ldpath_new) {
+ strcpy(ldpath_new, ldpath);
+ strcat(ldpath_new, ":");
+ strcat(ldpath_new, current_path);
+ setenv("LD_LIBRARY_PATH", ldpath_new, 1);
+ free(ldpath_new);
+ } else {
+ bb_log(LOG_WARNING, "Could not allocate memory for LD_LIBRARY_PATH\n");
+ }
+ } else {
+ setenv("LD_LIBRARY_PATH", ldpath, 1);
+ }
+ }
+ //open /dev/null for stdin redirect
+ int devnull = open("/dev/null", O_RDWR);
+ //fail silently on error, nothing we can do about it anyway...
+ if (devnull >= 0){dup2(devnull, STDIN_FILENO);}
+ //redirect stdout and stderr to the given filenum.
+ dup2(redirect, STDOUT_FILENO);
+ dup2(redirect, STDERR_FILENO);
+ close(devnull);
+ //ok, all ready, now actually execute
+ bb_run_exec(argv);
+ } else {
+ if (ret > 0) {
+ // Fork went ok, parent process continues
+ bb_log(LOG_DEBUG, "Process %s started, PID %i.\n", argv[0], ret);
+ pidlist_add(ret);
+ } else {
+ // Fork failed
+ bb_log(LOG_ERR, "Process %s could not be started. fork() failed.\n", argv[0]);
+ return 0;
+ }
+ }
+ return ret;
+}
+
+/**
+ * Forks and runs the given application, waits for a maximum of timeout seconds for process to finish.
+ *
+ * @param argv The arguments values, the first one is the application path or name
+ */
+void bb_run_fork_wait(char** argv, int timeout) {
+ check_handler();
+ // Fork and attempt to run given application
+ pid_t ret = fork();
+ if (ret == 0) {
+ // Fork went ok, child process replace
+ bb_run_exec(argv);
+ } else {
+ if (ret > 0) {
+ // Fork went ok, parent process continues
+ bb_log(LOG_DEBUG, "Process %s started, PID %i.\n", argv[0], ret);
+ pidlist_add(ret);
+ //sleep until process finishes or timeout reached
+ int i = 0;
+ while (bb_is_running(ret) && ((i < timeout) || (timeout == 0)) && dowait) {
+ usleep(1000000);
+ i++;
+ }
+ //make a single attempt to kill the process if timed out, without waiting
+ if (bb_is_running(ret)) {
+ bb_stop(ret);
+ }
+ } else {
+ // Fork failed
+ bb_log(LOG_ERR, "Process %s could not be started. fork() failed.\n", argv[0]);
+ return;
+ }
+ }
+ return;
+}
+
+/// Returns 1 if a process is currently running, 0 otherwise.
+
+int bb_is_running(pid_t proc) {
+ return pidlist_find(proc);
+}
+
+/// Stops the running process, if any.
+void bb_stop(pid_t proc) {
+ if (bb_is_running(proc)) {
+ kill(proc, SIGTERM);
+ }
+}
+
+/// Stops the running process, if any.
+/// Does not return until successful.
+/// Is always successful, eventually.
+void bb_stop_wait(pid_t proc) {
+ int i = 0;
+ while (bb_is_running(proc)) {
+ ++i;
+ //the first 10 attempts, use SIGTERM
+ if (i < 10) {
+ kill(proc, SIGTERM);
+ } else {
+ //after that, use SIGKILL
+ kill(proc, SIGKILL);
+ }
+ if (dowait) {
+ usleep(1000000); //sleep up to a second, waiting for process
+ } else {
+ usleep(10000); //sleep only 10ms, because we are in a hurry
+ }
+ }
+}
+
+/**
+ * Stops all the running processes, if any
+ */
+void bb_stop_all(void) {
+ bb_log(LOG_DEBUG, "Killing all remaining processes.\n");
+ /* keep killing the first program in the list until it's empty */
+ while (pidlist_start) {
+ bb_stop_wait(pidlist_start->PID);
+ }
+}
+
+/**
+ * Attempts to run the given application, replacing the current process
+ * @param argv The program to be run
+ */
+void bb_run_exec(char **argv) {
+ execvp(argv[0], argv);
+ bb_log(LOG_ERR, "Error running \"%s\": %s\n", argv[0], strerror(errno));
+ exit(errno);
+}
+
+/**
+ * Attempts to run the given application, replacing the current process but
+ * redirect all standard in/outputs to /dev/null.
+ * @param argv The program to be run
+ */
+static void bb_run_exec_detached(char **argv) {
+ int old_stderr, exec_err;
+ bb_log(LOG_DEBUG, "Hiding stderr for execution of %s\n", argv[0]);
+ /* Redirect all three standard file descriptors to /dev/null.
+ * If daemonized, this already happened - but doing it
+ * again doesn't hurt since this fork won't run forever anyway.
+ */
+ int devnull = open("/dev/null", O_RDWR);
+ if (devnull < 0){
+ bb_log(LOG_ERR, "Could not open /dev/null: %s\n", strerror(errno));
+ }
+ old_stderr = dup(STDERR_FILENO);
+ dup2(devnull, STDIN_FILENO);
+ dup2(devnull, STDOUT_FILENO);
+ dup2(devnull, STDERR_FILENO);
+ close(devnull);
+ //done redirecting, do the exec
+ execvp(argv[0], argv);
+ /* note: the below lines are only executed if execvp fails */
+ exec_err = errno;
+ dup2(old_stderr, STDERR_FILENO);
+ bb_log(LOG_ERR, "Error running \"%s\": %s\n", argv[0], strerror(exec_err));
+ exit(exec_err);
+}
+
+/**
+ * Cancels waiting for processes to finish - use when doing a fast shutdown.
+ */
+void bb_run_stopwaiting(void){
+ dowait = 0;
+}
+
+
+/**
+ * Finds a program in PATH, similar to which(1).
+ * @param program_name A program to find in $PATH. Must not be empty or NULL.
+ * @returns path to the program if found (need to be free'd) or NULL otherwise.
+ */
+char * which_program(const char * program_name) {
+ size_t prog_len = strlen(program_name);
+ char * env_path = getenv("PATH");
+ char * search_path = env_path;
+ char * program_path = NULL;
+ if (!search_path) {
+ int n = confstr(_CS_PATH, NULL, 0);
+ search_path = malloc(n);
+ confstr(_CS_PATH, search_path, n);
+ }
+
+ char * path = search_path;
+ do {
+ char cmd[PATH_MAX];
+ char * p = strchrnul(path, ':');
+ size_t path_len = p - path;
+ path += path_len;
+
+ if (path_len + prog_len + 1 > sizeof(cmd))
+ continue; /* silently skip impossible long paths */
+
+ if (path_len) {
+ strncpy(cmd, path - path_len, path_len);
+ cmd[path_len] = '/';
+ cmd[path_len + 1] = 0;
+ } else { /* treat empty as currect dir */
+ strcpy(cmd, "./");
+ }
+ strcat(cmd, program_name);
+ /* not fool-proof, e.g. a directory named "program" */
+ if (!access(cmd, X_OK))
+ program_path = strdup(cmd);
+ } while (!program_path && *path++ == ':');
+
+ if (!env_path) free(search_path);
+
+ return program_path;
+}
--- /dev/null
+/*
+ * Copyright (c) 2011-2013, The Bumblebee Project
+ * Author: Jaron Viëtor AKA "Thulinma" <jaron@vietors.com>
+ *
+ * This file is part of Bumblebee.
+ *
+ * Bumblebee is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Bumblebee is distributed in the hope that 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 Bumblebee. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/*
+ * Run command functions for Bumblebee
+ */
+#pragma once
+#include <sys/types.h>
+
+/* Forks and runs the given application. */
+int bb_run_fork(char** argv, int detached);
+
+/// Forks and runs the given application, using an LD_LIBRARY_PATH.
+pid_t bb_run_fork_ld_redirect(char** argv, char * ldpath, int redirect);
+
+/// Forks and runs the given application, waits for a maximum of timeout seconds for process to finish.
+void bb_run_fork_wait(char** argv, int timeout);
+
+/// Returns 1 if a process is currently running, 0 otherwise.
+int bb_is_running(pid_t proc);
+
+/// Stops the running process, if any.
+void bb_stop(pid_t proc);
+
+/// Stops the running process, if any.
+void bb_stop_wait(pid_t proc);
+
+/// Stops all the running processes, if any.
+void bb_stop_all(void);
+
+/// Attempts to run the given application, replacing the current process
+void bb_run_exec(char ** argv);
+
+/// Cancels waiting for processes to finish - use when doing a fast shutdown.
+void bb_run_stopwaiting(void);
+
+/* Finds a program in PATH, similar to which(1). */
+char * which_program(const char * program_name);
--- /dev/null
+/*
+ * Copyright (c) 2011-2013, The Bumblebee Project
+ * Author: Joaquín Ignacio Aramendía <samsagax@gmail.com>
+ * Author: Jaron Viëtor AKA "Thulinma" <jaron@vietors.com>
+ *
+ * This file is part of Bumblebee.
+ *
+ * Bumblebee is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Bumblebee is distributed in the hope that 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 Bumblebee. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#define _GNU_SOURCE
+#include <unistd.h>
+#include <X11/Xlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <time.h>
+#include <fcntl.h>
+#include <stdlib.h>
+#include <stdbool.h>
+#include <errno.h>
+#include "bbsecondary.h"
+#include "switch/switching.h"
+#include "bbrun.h"
+#include "bblogger.h"
+#include "bbconfig.h"
+#include "pci.h"
+#include "module.h"
+
+/**
+ * Substitutes DRIVER in the passed path
+ * @param x_conf_file A path to be processed
+ * @param driver The replacement for each occurence of DRIVER
+ * @return A path to xorg.conf with DRIVER substituted for the driver
+ */
+static char *xorg_path_w_driver(char *x_conf_file, char *driver) {
+ static char *path;
+ const char *driver_keyword = "DRIVER";
+ unsigned int driver_occurences = 0;
+ int path_length;
+ char *pos, *next;
+
+ /* calculate the path buffer size */
+ pos = x_conf_file;
+ while ((next = strstr(pos, driver_keyword)) != 0) {
+ driver_occurences++;
+ pos = next + strlen(driver_keyword);
+ }
+ path_length = strlen(x_conf_file) +
+ driver_occurences * (strlen(driver_keyword) - 1);
+
+ /* allocate some memory including null byte and make it an empty string */
+ path = malloc(path_length + 1);
+ if (!path) {
+ bb_log(LOG_WARNING, "Could not allocate memory for xorg conf path\n");
+ return NULL;
+ }
+ path[0] = 0;
+
+ /* now replace for real */
+ pos = x_conf_file;
+ while ((next = strstr(pos, driver_keyword)) != 0) {
+ int len = next - pos;
+ strncat(path, pos, len);
+ strncat(path, driver, path_length);
+
+ /* the next search starts at the position after %s */
+ pos = next + strlen(driver_keyword);
+ }
+ /* append the remainder after the last %s if any and overwrite the setting */
+ strncat(path, pos, path_length);
+ return path;
+}
+
+/**
+ * Load the kernel module, powering on the card beforehand
+ */
+static bool switch_and_load(void)
+{
+ char driver[BUFFER_SIZE] = {0};
+ /* enable card if the switcher is available */
+ if (switcher) {
+ if (switch_on() != SWITCH_ON) {
+ set_bb_error("Could not enable discrete graphics card");
+ return false;
+ }
+ }
+
+ //if runmode is BB_RUN_EXIT, do not start X, we are shutting down.
+ if (bb_status.runmode == BB_RUN_EXIT) {
+ return false;
+ }
+
+ if (pci_get_driver(driver, pci_bus_id_discrete, sizeof driver)) {
+ /* if the loaded driver does not equal the driver from config, unload it */
+ if (strcasecmp(bb_config.driver, driver)) {
+ if (!module_unload(driver)) {
+ /* driver failed to unload, aborting */
+ return false;
+ }
+ }
+ }
+
+ /* load the driver if none was loaded or if the loaded driver did not match
+ * the configured one */
+ if (strcasecmp(bb_config.driver, driver)) {
+ char *module_name = bb_config.module_name;
+ char *driver_name = bb_config.driver;
+ if (!module_load(module_name, driver_name)) {
+ set_bb_error("Could not load GPU driver");
+ return false;
+ }
+ }
+ return true;
+}
+
+/**
+ * Start the X server by fork-exec, turn card on and load driver if needed.
+ * If after this method finishes X is running, it was successfull.
+ * If it somehow fails, X should not be running after this method finishes.
+ */
+bool start_secondary(bool need_secondary) {
+ if (!switch_and_load())
+ return false;
+ if (!need_secondary)
+ return true;
+ //no problems, start X if not started yet
+ if (!bb_is_running(bb_status.x_pid)) {
+ char pci_id[12];
+ static char *x_conf_file;
+ snprintf(pci_id, 12, "PCI:%02x:%02x:%o", pci_bus_id_discrete->bus,
+ pci_bus_id_discrete->slot, pci_bus_id_discrete->func);
+ if (!x_conf_file) {
+ x_conf_file = xorg_path_w_driver(bb_config.x_conf_file, bb_config.driver);
+ }
+
+ bb_log(LOG_INFO, "Starting X server on display %s.\n", bb_config.x_display);
+ char *x_argv[] = {
+ XORG_BINARY,
+ bb_config.x_display,
+ "-config", x_conf_file,
+ "-configdir", bb_config.x_conf_dir,
+ "-sharevts",
+ "-nolisten", "tcp",
+ "-noreset",
+ "-verbose", "3",
+ "-isolateDevice", pci_id,
+ "-modulepath", bb_config.mod_path, // keep last
+ NULL
+ };
+ enum {n_x_args = sizeof(x_argv) / sizeof(x_argv[0])};
+ if (!*bb_config.mod_path) {
+ x_argv[n_x_args - 3] = 0; //remove -modulepath if not set
+ }
+ //close any previous pipe, if it (still) exists
+ if (bb_status.x_pipe[0] != -1){close(bb_status.x_pipe[0]); bb_status.x_pipe[0] = -1;}
+ if (bb_status.x_pipe[1] != -1){close(bb_status.x_pipe[1]); bb_status.x_pipe[1] = -1;}
+ //create a new pipe
+ if (pipe2(bb_status.x_pipe, O_NONBLOCK | O_CLOEXEC)){
+ set_bb_error("Could not create output pipe for X");
+ return false;
+ }
+ bb_status.x_pid = bb_run_fork_ld_redirect(x_argv, bb_config.ld_path, bb_status.x_pipe[1]);
+ //close the end of the pipe that is not ours
+ if (bb_status.x_pipe[1] != -1){close(bb_status.x_pipe[1]); bb_status.x_pipe[1] = -1;}
+ }
+
+ //check if X is available, for maximum 10 seconds.
+ time_t xtimer = time(0);
+ Display * xdisp = 0;
+ while ((time(0) - xtimer <= 10) && bb_is_running(bb_status.x_pid)) {
+ xdisp = XOpenDisplay(bb_config.x_display);
+ if (xdisp != 0) {
+ break;
+ }
+ check_xorg_pipe();//make sure Xorg errors come in smoothly
+ usleep(100000); //don't retry too fast
+ }
+ check_xorg_pipe();//make sure Xorg errors come in smoothly
+
+ //check if X is available
+ if (xdisp == 0) {
+ //X not available
+ /// \todo Maybe check X exit status and/or messages?
+ if (bb_is_running(bb_status.x_pid)) {
+ //X active, but not accepting connections
+ set_bb_error("X unresponsive after 10 seconds - aborting");
+ bb_stop(bb_status.x_pid);
+ } else {
+ //X terminated itself
+ set_bb_error("X did not start properly");
+ }
+ } else {
+ //X accepted the connetion - we assume it works
+ XCloseDisplay(xdisp); //close connection to X again
+ bb_log(LOG_INFO, "X successfully started in %i seconds\n", time(0) - xtimer);
+ //reset errors, if any
+ set_bb_error(0);
+ return true;
+ }
+ return false;
+}//start_secondary
+
+/**
+ * Unload the kernel module and power down the card
+ */
+static void switch_and_unload(void)
+{
+ char driver[BUFFER_SIZE];
+
+ if (bb_config.pm_method == PM_DISABLED && bb_status.runmode != BB_RUN_EXIT) {
+ /* do not disable the card if PM is disabled unless exiting */
+ return;
+ }
+
+ //if card is on and can be switched, switch it off
+ if (switcher) {
+ if (switcher->need_driver_unloaded) {
+ /* do not unload the drivers nor disable the card if the card is not on */
+ if (switcher->status() != SWITCH_ON) {
+ return;
+ }
+ /* unload the driver loaded by the graphica card */
+ if (pci_get_driver(driver, pci_bus_id_discrete, sizeof driver)) {
+ module_unload(driver);
+ }
+
+ //only turn card off if no drivers are loaded
+ if (pci_get_driver(NULL, pci_bus_id_discrete, 0)) {
+ bb_log(LOG_DEBUG, "Drivers are still loaded, unable to disable card\n");
+ return;
+ }
+ }
+ if (switch_off() != SWITCH_OFF) {
+ bb_log(LOG_WARNING, "Unable to disable discrete card.");
+ }
+ }
+}
+
+/**
+ * Kill the second X server if any, turn card off if requested.
+ */
+void stop_secondary() {
+ // kill X if it is running
+ if (bb_is_running(bb_status.x_pid)) {
+ bb_log(LOG_INFO, "Stopping X server\n");
+ bb_stop_wait(bb_status.x_pid);
+ }
+ switch_and_unload();
+}//stop_secondary
+
+/**
+ * Check for the availability of a PM method, warn if no method is available
+ */
+void check_pm_method(void) {
+ if (bb_config.pm_method == PM_DISABLED) {
+ bb_log(LOG_INFO, "PM is disabled, not performing detection.\n");
+ } else {
+ struct switch_info info;
+ memset(&info, 0, sizeof info);
+ info.driver = bb_config.driver;
+ info.configured_pm = bb_pm_method_string[bb_config.pm_method];
+
+ const char *pm_method = NULL;
+ if (bb_config.pm_method != PM_AUTO) {
+ /* auto-detection override */
+ pm_method = bb_pm_method_string[bb_config.pm_method];
+ }
+
+ switcher = switcher_detect(pm_method, info);
+ if (switcher) {
+ bb_log(LOG_INFO, "Switching method '%s' is available and will be used.\n",
+ switcher->name);
+ } else {
+ bb_log(LOG_WARNING, "No switching method available. The dedicated card"
+ " will always be on.\n");
+ }
+ }
+}
--- /dev/null
+/*
+ * Copyright (c) 2011-2013, The Bumblebee Project
+ * Author: Joaquín Ignacio Aramendía <samsagax@gmail.com>
+ * Author: Jaron Viëtor AKA "Thulinma" <jaron@vietors.com>
+ *
+ * This file is part of Bumblebee.
+ *
+ * Bumblebee is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Bumblebee is distributed in the hope that 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 Bumblebee. If not, see <http://www.gnu.org/licenses/>.
+ */
+#pragma once
+
+/**
+ * OpenSUSE: /usr/bin/X -> /var/lib/X11/X -> /usr/bin/Xorg
+ * Fedora, Arch Linux: /usr/bin/X -> /usr/bin/Xorg
+ * Ubuntu: /usr/bin/X is a custom binary doing authorization and then executes
+ * /etc/X11/X -> /usr/bin/Xorg
+ */
+#define XORG_BINARY "Xorg"
+
+/* PCI Bus ID of the discrete video card */
+struct pci_bus_id *pci_bus_id_discrete;
+
+/// Start the X server by fork-exec, turn card on if needed.
+bool start_secondary(bool);
+
+/// Kill the second X server if any, turn card off if requested.
+void stop_secondary(void);
+
+/* check for the availability of PM methods */
+void check_pm_method(void);
--- /dev/null
+/*
+ * Copyright (c) 2011-2013, The Bumblebee Project
+ * Author: Jaron Viëtor AKA "Thulinma" <jaron@vietors.com>
+ *
+ * This file is part of Bumblebee.
+ *
+ * Bumblebee is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Bumblebee is distributed in the hope that 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 Bumblebee. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/*
+ * Common networking functions for Bumblebee
+ */
+
+#include <sys/stat.h>
+#include <poll.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <sys/un.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <errno.h>
+#include <string.h>
+#include <fcntl.h>
+#include "bbsocket.h"
+#include "bblogger.h"
+#include "bbconfig.h"
+
+#ifdef __FreeBSD__
+#include <netinet/in.h>
+#endif
+
+
+/// Create a new Unix Socket. This socket will (try to) connect to the given address right away.
+/// \param address String containing the location of the Unix socket to connect to.
+/// \param nonblock Whether the socket should be nonblocking. 1 means nonblocking, 0 means blocking.
+/// \return An integer representing the socket, or -1 if connection failed.
+
+int socketConnect(char * address, int nonblock) {
+ //create the socket itself
+ int sock = socket(PF_UNIX, SOCK_STREAM | SOCK_CLOEXEC, 0);
+ if (sock < 0) {
+ bb_log(LOG_ERR, "Could not create socket. Error: %s\n", strerror(errno));
+ return -1;
+ }
+ //full our the address information for the connection
+ struct sockaddr_un addr;
+ addr.sun_family = AF_UNIX;
+ strcpy(addr.sun_path, address);
+ //attempt to connect
+ int r = connect(sock, (struct sockaddr*) & addr, sizeof (addr));
+ if (r == 0) {
+ //connection success, set nonblocking if requested.
+ if (nonblock == 1) {
+ int flags = fcntl(sock, F_GETFL, 0);
+ flags |= O_NONBLOCK;
+ fcntl(sock, F_SETFL, flags);
+ }
+ } else {
+ if (errno == EACCES) {
+ bb_log(LOG_ERR, "You've no permission to communicate with the Bumblebee"
+ " daemon. Try adding yourself to the '%s' group\n",
+ bb_config.gid_name);
+ } else if (errno == ENOENT) {
+ bb_log(LOG_ERR, "The Bumblebee daemon has not been started yet or the"
+ " socket path %s was incorrect.\n", address);
+ } else {
+ bb_log(LOG_ERR, "Could not connect to %s! Error: %s\n", address,
+ strerror(errno));
+ }
+ //close the socket and set it to -1
+ socketClose(&sock);
+ }
+ return sock;
+}//socketConnect
+
+/// Nicely closes the given socket, setting it to -1.
+/// Never fails.
+
+void socketClose(int * sock) {
+ bb_log(LOG_DEBUG, "Socket closed.\n");
+ // do not attempt to close closed or uninitialized sockets
+ if (!sock || *sock == -1) {
+ return;
+ }
+ //half-close the socket first
+ shutdown(*sock, SHUT_RDWR);
+ //fully close the socket
+ close(*sock);
+ //set to -1 to prevent usage
+ *sock = -1;
+}//socketClose
+
+/// Incremental write call. This function tries to write len bytes to the socket from the buffer,
+/// returning the amount of bytes it actually wrote.
+/// \param sock The socket to write to. Set to -1 if any error occurs.
+/// \param buffer Location of the buffer to write from.
+/// \param len Amount of bytes to write.
+/// \returns The amount of bytes actually written.
+
+int socketWrite(int * sock, void * buffer, int len) {
+ if (*sock < 0) {
+ return 0;
+ }
+ /* Try to send a message, but don't SIGPIPE if the client has gone */
+ int r = send(*sock, buffer, len, MSG_NOSIGNAL);
+ if (r < 0) {
+ switch (errno) {
+ case EWOULDBLOCK: return 0;
+ break;
+ default:
+ bb_log(LOG_WARNING, "Could not write data! Error: %s\n", strerror(errno));
+ socketClose(sock);
+ return 0;
+ break;
+ }
+ }
+ if (r == 0) {
+ socketClose(sock);
+ }
+ return r;
+}//socketWrite
+
+/// Incremental read call. This function tries to read len bytes to the buffer from the socket,
+/// returning the amount of bytes it actually read.
+/// \param sock The socket to read from. Set to -1 if any error occurs.
+/// \param buffer Location of the buffer to read to.
+/// \param len Amount of bytes to read.
+/// \returns The amount of bytes actually read.
+
+int socketRead(int * sock, void * buffer, int len) {
+ if (*sock < 0) {
+ return 0;
+ }
+ int r = recv(*sock, buffer, len, 0);
+ if (r < 0) {
+ switch (errno) {
+ case EWOULDBLOCK: return 0;
+ break;
+ default:
+ bb_log(LOG_WARNING, "Could not read data! Error: %s\n", strerror(errno));
+ socketClose(sock);
+ return 0;
+ break;
+ }
+ }
+ if (r == 0) {
+ socketClose(sock);
+ }
+ return r;
+}//socketRead
+
+/// Create a new Unix Server. The socket is immediately bound and set to listen.
+/// A maximum of 100 connections will be accepted between accept() calls.
+/// Any further connections coming in will be dropped.
+/// The address used will first be unlinked - so it succeeds if the Unix socket already existed. Watch out for this behaviour - it will delete any file located at address!
+/// \param address The location of the Unix socket to bind to.
+/// \param nonblock Whether accept() calls will be nonblocking. 0 = Blocking, 1 = Nonblocking.
+/// \param return The socket itself, or -1 upon failure.
+
+int socketServer(char * address, int nonblock) {
+ //delete the file currently there, if any
+ unlink(address);
+ //create the socket
+ int sock = socket(AF_UNIX, SOCK_STREAM | SOCK_CLOEXEC, 0);
+ if (sock < 0) {
+ bb_log(LOG_ERR, "Could not create socket! Error: %s\n", strerror(errno));
+ return -1;
+ }
+ //set to nonblocking if requested
+ if (nonblock == 1) {
+ int flags = fcntl(sock, F_GETFL, 0);
+ flags |= O_NONBLOCK;
+ fcntl(sock, F_SETFL, flags);
+ }
+ //fill address information
+ struct sockaddr_un addr;
+ addr.sun_family = AF_UNIX;
+ // XXX this path is 107 bytes (excl. null) on Linux, a larger path is
+ // truncated. bb_config.socket_path can therefore be shrinked as well
+ strncpy(addr.sun_path, address, sizeof(addr.sun_path) - 1);
+ addr.sun_path[sizeof(addr.sun_path) - 1] = 0;
+ //bind the socket
+ int ret = bind(sock, (struct sockaddr*) & addr, sizeof (addr));
+ if (ret == 0) {
+ ret = listen(sock, 100); //start listening, backlog of 100 allowed
+ //allow reading and writing for group and self
+ chmod(address, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP);
+ if (ret != 0) {
+ bb_log(LOG_ERR, "Listen failed! Error: %s\n", strerror(errno));
+ socketClose(&sock);
+ }
+ } else {
+ bb_log(LOG_ERR, "Binding failed! Error: %s\n", strerror(errno));
+ socketClose(&sock);
+ }
+ return sock;
+}//socketServer
+
+
+/// Accept any waiting connections. If the Socket::Server is blocking, this function will block until there is an incoming connection.
+/// If the Socket::Server is nonblocking, it might return a Socket::Connection that is not connected, so check for this.
+/// \param nonblock Whether the newly connected socket should be nonblocking. Default is false (blocking).
+/// \returns A valid socket or -1.
+
+int socketAccept(int * sock, int nonblock) {
+ if (*sock < 0) {
+ return -1;
+ }
+ int r = accept(*sock, 0, 0);
+ //set the socket to be nonblocking, if requested.
+ //we could do this through accept4 with a flag, but that call is non-standard...
+ if ((r >= 0) && (nonblock == 1)) {
+ int flags = fcntl(r, F_GETFL, 0);
+ flags |= O_NONBLOCK;
+ fcntl(r, F_SETFL, flags);
+ }
+
+ if (r < 0) {
+ if ((errno != EWOULDBLOCK) && (errno != EAGAIN) && (errno != EINTR)) {
+ bb_log(LOG_ERR, "Error during accept - closing server socket: %s\n", strerror(errno));
+ socketClose(sock);
+ }
+ }
+ return r;
+}
+
+// Ensures that the given buffer is properly NUL terminated.
+// \param buff Writable uffer containing data to be NUL terminated.
+// \param size The expected size of data in the buffer, including NUL (if any).
+// Must be greater than zero and smaller or equal to the maximum size of the
+// buffer.
+// \param max Number of bytes that buff can hold.
+// \returns the length of data buffer including NUL byte
+size_t ensureZeroTerminated(char *buff, size_t size, size_t max) {
+ char *nil_pos = memchr(buff, '\0', size);
+ if (nil_pos == NULL) {
+ if (size >= max) {
+ buff[size - 1] = '\0'; // buffer is full, eat last byte
+ } else {
+ buff[size] = '\0'; // buffer can haz NUL, place it after data
+ }
+ } else {
+ size = nil_pos - buff + 1; // NUL byte present, include it in the actual length
+ }
+ return size;
+}
--- /dev/null
+/*
+ * Copyright (c) 2011-2013, The Bumblebee Project
+ * Author: Jaron Viëtor AKA "Thulinma" <jaron@vietors.com>
+ *
+ * This file is part of Bumblebee.
+ *
+ * Bumblebee is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Bumblebee is distributed in the hope that 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 Bumblebee. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/*
+ * Common networking functions for Bumblebee
+ */
+#pragma once
+
+#define SOCK_BLOCK 0
+#define SOCK_NOBLOCK 1
+
+int socketConnect(char * address, int nonblock);
+void socketClose(int * sock);
+int socketWrite(int * sock, void * buffer, int len);
+int socketRead(int * sock, void * buffer, int len);
+int socketServer(char * address, int nonblock);
+int socketAccept(int * sock, int nonblock);
--- /dev/null
+/*
+ * Copyright (c) 2012-2013, The Bumblebee Project
+ * Author: Peter Lekensteyn <lekensteyn@gmail.com>
+ *
+ * This file is part of Bumblebee.
+ *
+ * Bumblebee is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Bumblebee is distributed in the hope that 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 Bumblebee. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/*
+ * Functions for communicating with the daemon through a socket
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <sys/syslog.h>
+#include "bbsocket.h"
+#include "bbsocketclient.h"
+#include "bbconfig.h"
+#include "bblogger.h"
+
+/**
+ * Requests a key over the socket
+ * @param key The key to be retrieved
+ * @param target A pointer to a char to store the value in
+ * @param max_len The maximum number of bytes to be written in target, must be
+ * greater than 0
+ * @return 0 on success, non-zero on failure
+ */
+int bbsocket_query(const char *key, char *target, size_t max_len) {
+ char buff[BUFFER_SIZE];
+ snprintf(buff, sizeof buff, "Query %s", key);
+ if (!socketWrite(&bb_status.bb_socket, buff, strlen(buff) + 1)) {
+ bb_log(LOG_DEBUG, "Write failed for query of %s\n", key);
+ return 1;
+ }
+ while (bb_status.bb_socket != -1) {
+ int r = socketRead(&bb_status.bb_socket, buff, sizeof (buff));
+ if (r > 0) {
+ ensureZeroTerminated(buff, r, sizeof (buff));
+ if (strncmp("Value: ", buff, strlen("Value: "))) {
+ bb_log(LOG_DEBUG, "Failed to query for %s: %s\n", key, buff);
+ return 1;
+ }
+ strncpy(target, buff + strlen("Value: "), max_len);
+ target[max_len - 1] = 0;
+ /* remove trailing newline */
+ if (strlen(target)) {
+ target[strlen(target) - 1] = 0;
+ }
+ return 0;
+ }
+ }
+ bb_log(LOG_DEBUG, "Read failed for query of %s\n", key);
+ return 1;
+}
--- /dev/null
+/*
+ * Copyright (c) 2011-2013, The Bumblebee Project
+ * Author: Peter Lekensteyn <lekensteyn@gmail.com>
+ *
+ * This file is part of Bumblebee.
+ *
+ * Bumblebee is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Bumblebee is distributed in the hope that 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 Bumblebee. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+
+#pragma once
+
+int bbsocket_query(const char *key, char *target, size_t max_len);
--- /dev/null
+/*
+ * Copyright (c) 2011-2013, The Bumblebee Project
+ * Author: Joaquín Ignacio Aramendía <samsagax@gmail.com>
+ * Author: Jaron Viëtor AKA "Thulinma" <jaron@vietors.com>
+ *
+ * This file is part of Bumblebee.
+ *
+ * Bumblebee is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Bumblebee is distributed in the hope that 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 Bumblebee. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/*
+ * C-coded version of the Bumblebee daemon and optirun.
+ */
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <stdlib.h>
+#include <stdbool.h>
+#include <grp.h>
+#include <signal.h>
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+#include <getopt.h>
+#ifdef WITH_PIDFILE
+#ifdef HAVE_LIBBSD_020
+#include <libutil.h>
+#else
+#include <bsd/libutil.h>
+#endif
+#endif
+#include "bbconfig.h"
+#include "bbsocket.h"
+#include "bblogger.h"
+#include "bbsecondary.h"
+#include "bbrun.h"
+#include "pci.h"
+#include "driver.h"
+#include "switch/switching.h"
+
+/**
+ * Change GID and umask of the daemon
+ * @return EXIT_SUCCESS if the gid could be changed, EXIT_FAILURE otherwise
+ */
+static int bb_chgid(void) {
+ /* Change the Group ID of bumblebee */
+ struct group *gp;
+ errno = 0;
+ gp = getgrnam(bb_config.gid_name);
+ if (gp == NULL) {
+ int error_num = errno;
+ bb_log(LOG_ERR, "%s\n", strerror(error_num));
+ bb_log(LOG_ERR, "There is no \"%s\" group\n", bb_config.gid_name);
+ return EXIT_FAILURE;
+ }
+ if (setgid(gp->gr_gid) != 0) {
+ bb_log(LOG_ERR, "Could not set the GID of bumblebee: %s\n", strerror(errno));
+ return EXIT_FAILURE;
+ }
+ /* Change the file mode mask */
+ umask(027);
+ return EXIT_SUCCESS;
+}
+
+/**
+ * Fork to the background, and exit parent.
+ * @return EXIT_SUCCESS if the daemon could fork, EXIT_FAILURE otherwise. Note
+ * that the parent exits and the child continues to run
+ */
+static int daemonize(void) {
+ /* Fork off the parent process */
+ pid_t bb_pid = fork();
+ if (bb_pid < 0) {
+ bb_log(LOG_ERR, "Could not fork to background\n");
+ return EXIT_FAILURE;
+ }
+
+ /* If we got a good PID, then we can exit the parent process. */
+ if (bb_pid > 0) {
+ exit(EXIT_SUCCESS);
+ }
+
+ /* Create a new SID for the child process */
+ pid_t bb_sid = setsid();
+ if (bb_sid < 0) {
+ bb_log(LOG_ERR, "Could not set SID: %s\n", strerror(errno));
+ return EXIT_FAILURE;
+ }
+
+ /* Change the current working directory */
+ if ((chdir("/")) < 0) {
+ bb_log(LOG_ERR, "Could not change to root directory: %s\n", strerror(errno));
+ return EXIT_FAILURE;
+ }
+
+ /* Reroute standard file descriptors to /dev/null */
+ int devnull = open("/dev/null", O_RDWR);
+ if (devnull < 0){
+ bb_log(LOG_ERR, "Could not open /dev/null: %s\n", strerror(errno));
+ return EXIT_FAILURE;
+ }
+ dup2(devnull, STDIN_FILENO);
+ dup2(devnull, STDOUT_FILENO);
+ dup2(devnull, STDERR_FILENO);
+ close(devnull);
+ return EXIT_SUCCESS;
+}
+
+/**
+ * Handle recieved signals - except SIGCHLD, which is handled in bbrun.c
+ */
+static void handle_signal(int sig) {
+ static int sigpipes = 0;
+
+ switch (sig) {
+ case SIGHUP:
+ bb_log(LOG_WARNING, "Received %s signal (ignoring...)\n", strsignal(sig));
+ break;
+ case SIGPIPE:
+ /* if bb_log generates a SIGPIPE, i.e. when bumblebeed runs like
+ * bumblebeed 2>&1 | cat and the pipe is killed, don't die infinitely */
+ if (sigpipes <= 10) {
+ bb_log(LOG_WARNING, "Received %s signal %i (signals 10> are ignored)\n",
+ strsignal(sig), ++sigpipes);
+ }
+ break;
+ case SIGINT:
+ case SIGQUIT:
+ bb_log(LOG_WARNING, "Received %s signal.\n", strsignal(sig));
+ socketClose(&bb_status.bb_socket); //closing the socket terminates the server
+ break;
+ case SIGTERM:
+ bb_log(LOG_WARNING, "Received %s signal.\n", strsignal(sig));
+ socketClose(&bb_status.bb_socket); //closing the socket terminates the server
+ bb_run_stopwaiting(); //speed up shutdown by not waiting for processes anymore
+ break;
+ default:
+ bb_log(LOG_WARNING, "Unhandled signal %s\n", strsignal(sig));
+ break;
+ }
+}
+
+/// Socket list structure for use in main_loop.
+
+struct clientsocket {
+ int sock;
+ int inuse;
+ struct clientsocket * prev;
+ struct clientsocket * next;
+};
+
+/// Receive and/or sent data to/from this socket.
+/// \param sock Pointer to socket. Assumed to be valid.
+
+static void handle_socket(struct clientsocket * C) {
+ static char buffer[BUFFER_SIZE], *conf_key;
+ bool need_secondary;
+ //since these are local sockets, we can safely assume we get whole messages at a time
+ int r = socketRead(&C->sock, buffer, BUFFER_SIZE);
+ if (r > 0) {
+ ensureZeroTerminated(buffer, r, BUFFER_SIZE);
+ conf_key = strchr(buffer, ' ');
+ switch (buffer[0]) {
+ case 'S'://status
+ if (bb_status.errors[0] != 0) {
+ r = snprintf(buffer, BUFFER_SIZE, "Error (%s): %s\n", GITVERSION, bb_status.errors);
+ } else {
+ if (bb_is_running(bb_status.x_pid)) {
+ r = snprintf(buffer, BUFFER_SIZE, "Ready (%s). X is PID %i, %i applications using bumblebeed.\n", GITVERSION, bb_status.x_pid, bb_status.appcount);
+ } else {
+ char *card_status;
+ switch (switch_status()) {
+ case SWITCH_OFF:
+ card_status = "off";
+ break;
+ case SWITCH_ON:
+ card_status = "on";
+ break;
+ default:
+ /* no PM available, assume it's on */
+ card_status = "likely on";
+ break;
+ }
+ r = snprintf(buffer, BUFFER_SIZE, "Ready (%s). X inactive. Discrete"
+ " video card is %s.\n", GITVERSION, card_status);
+ }
+ }
+ /* don't rely on result of snprintf, instead calculate length including
+ * null byte. We assume a succesful write */
+ socketWrite(&C->sock, buffer, strlen(buffer) + 1);
+ break;
+ case 'F'://force VirtualGL if possible
+ case 'C'://check if VirtualGL is allowed
+ need_secondary = conf_key ? strcmp(conf_key + 1, "NoX") : true;
+ if (start_secondary(need_secondary)) {
+ r = snprintf(buffer, BUFFER_SIZE, "Yes. X is active.\n");
+ if (C->inuse == 0) {
+ C->inuse = 1;
+ bb_status.appcount++;
+ }
+ } else {
+ if (bb_status.errors[0] != 0) {
+ r = snprintf(buffer, BUFFER_SIZE, "No - error: %s\n", bb_status.errors);
+ } else {
+ r = snprintf(buffer, BUFFER_SIZE, "No, secondary X is not active.\n");
+ }
+ }
+ /* don't rely on result of snprintf, instead calculate length including
+ * null byte. We assume a succesful write */
+ socketWrite(&C->sock, buffer, strlen(buffer) + 1);
+ break;
+ case 'D'://done, close the socket.
+ socketClose(&C->sock);
+ break;
+ case 'Q': /* query for configuration details */
+ /* required since labels can only be attached on statements */;
+ if (conf_key) {
+ conf_key++;
+ if (strcmp(conf_key, "VirtualDisplay") == 0) {
+ snprintf(buffer, BUFFER_SIZE, "Value: %s\n", bb_config.x_display);
+ } else if (strcmp(conf_key, "LibraryPath") == 0) {
+ snprintf(buffer, BUFFER_SIZE, "Value: %s\n", bb_config.ld_path);
+ } else if (strcmp(conf_key, "Driver") == 0) {
+ /* note: this is not the auto-detected value, but the actual one */
+ snprintf(buffer, BUFFER_SIZE, "Value: %s\n", bb_config.driver);
+ } else {
+ snprintf(buffer, BUFFER_SIZE, "Unknown key requested.\n");
+ }
+ } else {
+ snprintf(buffer, BUFFER_SIZE, "Error: invalid protocol message.\n");
+ }
+ socketWrite(&C->sock, buffer, strlen(buffer) + 1);
+ break;
+ default:
+ bb_log(LOG_WARNING, "Unhandled message received: %s\n", buffer);
+ break;
+ }
+ }
+}
+
+/* The main loop handles all connections and cleanup.
+ * It returns if there are any problems with the listening socket.
+ */
+static void main_loop(void) {
+ int optirun_socket_fd;
+ struct clientsocket *client;
+ struct clientsocket *last = 0; // the last client
+
+ bb_log(LOG_INFO, "Initialization completed - now handling client requests\n");
+ /* Listen for Optirun conections and act accordingly */
+ while (bb_status.bb_socket != -1) {
+ fd_set readfds;
+ int max_fd = 0;
+
+ FD_ZERO(&readfds);
+#define FD_SET_AND_MAX(fd) \
+ do if ((fd) >= 0 && (fd) < FD_SETSIZE) { \
+ FD_SET((fd), &readfds); \
+ if (max_fd < (fd)) \
+ max_fd = (fd); \
+ } while (0)
+ FD_SET_AND_MAX(bb_status.bb_socket);
+ FD_SET_AND_MAX(bb_status.x_pipe[0]);
+ for (client = last; client; client = client->prev)
+ FD_SET_AND_MAX(client->sock);
+#undef FD_SET_AND_MAX
+
+ if (select(max_fd + 1, &readfds, NULL, NULL, NULL) < 0) {
+ if (errno == EINTR)
+ continue;
+ bb_log(LOG_ERR, "select() failed: %s\n", strerror(errno));
+ break;
+ }
+
+#define FD_EVENT(fd) ((fd) >= 0 && FD_ISSET((fd), &readfds))
+ if (FD_EVENT(bb_status.bb_socket)) {
+ /* Accept a connection. */
+ optirun_socket_fd = socketAccept(&bb_status.bb_socket, SOCK_NOBLOCK);
+ if (optirun_socket_fd >= 0) {
+ bb_log(LOG_DEBUG, "Accepted new connection\n", optirun_socket_fd, bb_status.appcount);
+
+ /* add to list of sockets */
+ client = malloc(sizeof (struct clientsocket));
+ client->sock = optirun_socket_fd;
+ client->inuse = 0;
+ client->prev = last;
+ client->next = 0;
+ if (last) {
+ last->next = client;
+ }
+ last = client;
+ }
+ }
+
+ //check the X output pipe, if open
+ if (FD_EVENT(bb_status.x_pipe[0]))
+ check_xorg_pipe();
+
+ /* loop through all connections, removing dead ones, receiving/sending data to the rest */
+ struct clientsocket *next_iter;
+ for (client = last; client; client = next_iter) {
+ /* set the next client here because client may be free()'d */
+ next_iter = client->prev;
+ if (FD_EVENT(client->sock))
+ handle_socket(client);
+ if (client->sock < 0) {
+ //remove from list
+ if (client->inuse > 0) {
+ bb_status.appcount--;
+ //stop X / card if there is no need to keep it running
+ if ((bb_status.appcount == 0) && (bb_config.stop_on_exit)) {
+ stop_secondary();
+ }
+ }
+ if (client->next) {
+ client->next->prev = client->prev;
+ } else {
+ last = client->prev;
+ }
+ if (client->prev) {
+ client->prev->next = client->next;
+ }
+ free(client);
+ }
+ }
+#undef FD_EVENT
+ }//socket server loop
+
+ /* loop through all connections, closing all of them */
+ client = last;
+ while (client) {
+ //close socket if not already closed
+ if (client->sock >= 0) {
+ socketClose(&client->sock);
+ }
+ //remove from list
+ if (client->inuse > 0) {
+ bb_status.appcount--;
+ }
+ // change the client here because after free() there is no way to know prev
+ last = client;
+ client = client->prev;
+ free(last);
+ }
+ if (bb_status.appcount != 0) {
+ bb_log(LOG_WARNING, "appcount = %i (should be 0)\n", bb_status.appcount);
+ }
+}
+
+/**
+ * Returns the option string for this program
+ * @return An option string which can be used for getopt
+ */
+const char *bbconfig_get_optstr(void) {
+ return BBCONFIG_COMMON_OPTSTR "Dx:g:m:k:";
+}
+
+/**
+ * Returns the long options for this program
+ * @return A option struct which can be used for getopt_long
+ */
+const struct option *bbconfig_get_lopts(void) {
+ static struct option longOpts[] = {
+ {"daemon", 0, 0, 'D'},
+ {"xconf", 1, 0, 'x'},
+ {"xconfdir", 1, 0, OPT_X_CONF_DIR_PATH},
+ {"group", 1, 0, 'g'},
+ {"module-path", 1, 0, 'm'},
+ {"driver-module", 1, 0, 'k'},
+ {"driver", 1, 0, OPT_DRIVER},
+#ifdef WITH_PIDFILE
+ {"pidfile", 1, 0, OPT_PIDFILE},
+#endif
+ {"use-syslog", 0, 0, OPT_USE_SYSLOG},
+ {"pm-method", 1, 0, OPT_PM_METHOD},
+ BBCONFIG_COMMON_LOPTS
+ };
+ return longOpts;
+}
+
+/**
+ * Parses local command line options
+ * @param opt The short option
+ * @param value Value for the option if any
+ * @return 1 if the option has been processed, 0 otherwise
+ */
+int bbconfig_parse_options(int opt, char *value) {
+ switch (opt) {
+ case OPT_USE_SYSLOG:
+ /* already processed in bbconfig.c */
+ break;
+ case 'D'://daemonize
+ bb_status.runmode = BB_RUN_DAEMON;
+ break;
+ case 'x'://xorg.conf path
+ set_string_value(&bb_config.x_conf_file, value);
+ break;
+ case OPT_X_CONF_DIR_PATH://xorg.conf.d path
+ set_string_value(&bb_config.x_conf_dir, value);
+ break;
+ case 'g'://group name to use
+ set_string_value(&bb_config.gid_name, value);
+ break;
+ case 'm'://modulepath
+ set_string_value(&bb_config.mod_path, value);
+ break;
+ case OPT_DRIVER://driver
+ set_string_value(&bb_config.driver, value);
+ break;
+ case 'k'://kernel module
+ set_string_value(&bb_config.module_name, value);
+ break;
+ case OPT_PM_METHOD:
+ bb_config.pm_method = bb_pm_method_from_string(value);
+ break;
+#ifdef WITH_PIDFILE
+ case OPT_PIDFILE:
+ set_string_value(&bb_config.pid_file, value);
+ break;
+#endif
+ default:
+ /* no options parsed */
+ return 0;
+ }
+ return 1;
+}
+
+int main(int argc, char* argv[]) {
+#ifdef WITH_PIDFILE
+ struct pidfh *pfh = NULL;
+ pid_t otherpid;
+#endif
+
+ /* the logs needs to be ready before the signal handlers */
+ init_early_config(argv, BB_RUN_SERVER);
+ bbconfig_parse_opts(argc, argv, PARSE_STAGE_LOG);
+ bb_init_log();
+
+ /* Setup signal handling before anything else. Note that messages are not
+ * shown until init_config has set bb_status.verbosity
+ */
+ signal(SIGHUP, handle_signal);
+ signal(SIGTERM, handle_signal);
+ signal(SIGINT, handle_signal);
+ signal(SIGQUIT, handle_signal);
+ signal(SIGPIPE, handle_signal);
+
+ /* first load the config to make the logging verbosity level available */
+ init_config();
+ bbconfig_parse_opts(argc, argv, PARSE_STAGE_PRECONF);
+
+ /* First look for an intel card */
+ struct pci_bus_id *pci_id_igd = pci_find_gfx_by_vendor(PCI_VENDOR_ID_INTEL, 0);
+ if (!pci_id_igd) {
+ /* This is no Optimus configuration. But maybe it's a
+ dual-nvidia configuration. Let us test that.
+ */
+ pci_id_igd = pci_find_gfx_by_vendor(PCI_VENDOR_ID_NVIDIA, 1);
+ bb_log(LOG_INFO, "No Intel video card found, testing for dual-nvidia system.\n");
+
+ if (!pci_id_igd) {
+ /* Ok, this is not a double gpu setup supported (there is at most
+ one nvidia and no intel cards */
+ bb_log(LOG_ERR, "No integrated video card found, quitting.\n");
+ return (EXIT_FAILURE);
+ }
+ }
+ pci_bus_id_discrete = pci_find_gfx_by_vendor(PCI_VENDOR_ID_NVIDIA, 0);
+ if (!pci_bus_id_discrete) {
+ bb_log(LOG_ERR, "No discrete video card found, quitting\n");
+ return (EXIT_FAILURE);
+ }
+
+ bb_log(LOG_DEBUG, "Found card: %02x:%02x.%x (discrete)\n", pci_bus_id_discrete->bus, pci_bus_id_discrete->slot, pci_bus_id_discrete->func);
+ bb_log(LOG_DEBUG, "Found card: %02x:%02x.%x (integrated)\n", pci_id_igd->bus, pci_id_igd->slot, pci_id_igd->func);
+
+ free(pci_id_igd);
+
+ GKeyFile *bbcfg = bbconfig_parse_conf();
+ bbconfig_parse_opts(argc, argv, PARSE_STAGE_DRIVER);
+ driver_detect();
+ if (bbcfg) {
+ bbconfig_parse_conf_driver(bbcfg, bb_config.driver);
+ g_key_file_free(bbcfg);
+ }
+ bbconfig_parse_opts(argc, argv, PARSE_STAGE_OTHER);
+ check_pm_method();
+
+ /* dump the config after detecting the driver */
+ config_dump();
+ if (config_validate() != 0) {
+ return (EXIT_FAILURE);
+ }
+
+#ifdef WITH_PIDFILE
+ /* only write PID if a pid file has been set */
+ if (bb_config.pid_file[0]) {
+ pfh = pidfile_open(bb_config.pid_file, 0644, &otherpid);
+ if (pfh == NULL) {
+ if (errno == EEXIST) {
+ bb_log(LOG_ERR, "Daemon already running, pid %d\n", otherpid);
+ } else {
+ bb_log(LOG_ERR, "Cannot open or write pidfile %s.\n", bb_config.pid_file);
+ }
+ bb_closelog();
+ exit(EXIT_FAILURE);
+ }
+ }
+#endif
+
+ /* Change GID and mask according to configuration */
+ if ((bb_config.gid_name != 0) && (bb_config.gid_name[0] != 0)) {
+ int retval = bb_chgid();
+ if (retval != EXIT_SUCCESS) {
+ bb_closelog();
+#ifdef WITH_PIDFILE
+ pidfile_remove(pfh);
+#endif
+ exit(retval);
+ }
+ }
+
+ bb_log(LOG_NOTICE, "%s %s started\n", bb_status.program_name, GITVERSION);
+
+ /* Daemonized if daemon flag is activated */
+ if (bb_status.runmode == BB_RUN_DAEMON) {
+ int retval = daemonize();
+ if (retval != EXIT_SUCCESS) {
+ bb_closelog();
+#ifdef WITH_PIDFILE
+ pidfile_remove(pfh);
+#endif
+ exit(retval);
+ }
+ }
+
+#ifdef WITH_PIDFILE
+ /* write PID after daemonizing */
+ pidfile_write(pfh);
+#endif
+
+ /* Initialize communication socket, enter main loop */
+ bb_status.bb_socket = socketServer(bb_config.socket_path, SOCK_NOBLOCK);
+ stop_secondary(); //turn off card, nobody is connected right now.
+ main_loop();
+ unlink(bb_config.socket_path);
+ bb_status.runmode = BB_RUN_EXIT; //make sure all methods understand we are shutting down
+ if (bb_config.card_shutdown_state) {
+ //if shutdown state = 1, turn on card
+ start_secondary(false);
+ } else {
+ //if shutdown state = 0, turn off card
+ stop_secondary();
+ }
+ bb_closelog();
+#ifdef WITH_PIDFILE
+ pidfile_remove(pfh);
+#endif
+ bb_stop_all(); //stop any started processes that are left
+ //close X pipe, if any parts of it are open still
+ if (bb_status.x_pipe[0] != -1){close(bb_status.x_pipe[0]); bb_status.x_pipe[0] = -1;}
+ if (bb_status.x_pipe[1] != -1){close(bb_status.x_pipe[1]); bb_status.x_pipe[1] = -1;}
+ return (EXIT_SUCCESS);
+}
--- /dev/null
+/*
+ * Copyright (c) 2011-2013, The Bumblebee Project
+ * Author: Peter Lekensteyn <lekensteyn@gmail.com>
+ *
+ * This file is part of Bumblebee.
+ *
+ * Bumblebee is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Bumblebee is distributed in the hope that 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 Bumblebee. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <string.h>
+#include "bbconfig.h"
+#include "module.h"
+#include "bblogger.h"
+#include "driver.h"
+
+/**
+ * Check what drivers are available and autodetect if possible. Driver, module
+ * library path and module path are set
+ */
+void driver_detect(void) {
+ /* determine driver to be used */
+ if (*bb_config.driver) {
+ bb_log(LOG_DEBUG, "Skipping auto-detection, using configured driver"
+ " '%s'\n", bb_config.driver);
+ } else if (strlen(CONF_DRIVER)) {
+ /* if the default driver is set, use that */
+ set_string_value(&bb_config.driver, CONF_DRIVER);
+ bb_log(LOG_DEBUG, "Using compile default driver '%s'", CONF_DRIVER);
+ } else if (module_is_loaded("nouveau")) {
+ /* loaded drivers take precedence over ones available for modprobing */
+ set_string_value(&bb_config.driver, "nouveau");
+ set_string_value(&bb_config.module_name, "nouveau");
+ bb_log(LOG_DEBUG, "Detected nouveau driver\n");
+ } else if (module_is_available(CONF_DRIVER_MODULE_NVIDIA)) {
+ /* Ubuntu and Mandriva use nvidia-current.ko. nvidia cannot be compiled into
+ * the kernel, so module_is_available makes module_is_loaded redundant */
+ set_string_value(&bb_config.driver, "nvidia");
+ set_string_value(&bb_config.module_name, CONF_DRIVER_MODULE_NVIDIA);
+ bb_log(LOG_DEBUG, "Detected nvidia driver (module %s)\n",
+ CONF_DRIVER_MODULE_NVIDIA);
+ } else if (module_is_available("nouveau")) {
+ set_string_value(&bb_config.driver, "nouveau");
+ set_string_value(&bb_config.module_name, "nouveau");
+ bb_log(LOG_DEBUG, "Detected nouveau driver\n");
+ }
+
+ if (!*bb_config.module_name) {
+ /* no module has been configured, set a sensible one based on driver */
+ if (strcmp(bb_config.driver, "nvidia") == 0 &&
+ module_is_available(CONF_DRIVER_MODULE_NVIDIA)) {
+ set_string_value(&bb_config.module_name, CONF_DRIVER_MODULE_NVIDIA);
+ } else {
+ set_string_value(&bb_config.module_name, bb_config.driver);
+ }
+ }
+
+ if (strcmp(bb_config.driver, "nvidia") == 0) {
+ set_string_value(&bb_config.ld_path, CONF_LDPATH_NVIDIA);
+ set_string_value(&bb_config.mod_path, CONF_MODPATH_NVIDIA);
+ }
+}
--- /dev/null
+/*
+ * Copyright (c) 2011-2013, The Bumblebee Project
+ * Author: Peter Lekensteyn <lekensteyn@gmail.com>
+ *
+ * This file is part of Bumblebee.
+ *
+ * Bumblebee is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Bumblebee is distributed in the hope that 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 Bumblebee. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#pragma once
+
+/* Check what drivers are available and autodetect if possible */
+void driver_detect(void);
--- /dev/null
+/*
+ * Copyright (c) 2011-2013, The Bumblebee Project
+ * Author: Joaquín Ignacio Aramendía <samsagax@gmail.com>
+ * Author: Jaron Viëtor AKA "Thulinma" <jaron@vietors.com>
+ *
+ * This file is part of Bumblebee.
+ *
+ * Bumblebee is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Bumblebee is distributed in the hope that 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 Bumblebee. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <ctype.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include "module.h"
+#include "bblogger.h"
+#include "bbrun.h"
+
+/**
+ * Checks in /proc/modules whether a kernel module is loaded
+ *
+ * @param driver The name of the driver (not a filename)
+ * @return 1 if the module is loaded, 0 otherwise
+ */
+int module_is_loaded(char *driver) {
+ // use the same buffer length as lsmod
+ char buffer[4096];
+ FILE * bbs = fopen("/proc/modules", "r");
+ int ret = 0;
+ /* assume mod_len <= sizeof(buffer) */
+ int mod_len = strlen(driver);
+
+ if (bbs == 0) {//error opening, return -1
+ bb_log(LOG_DEBUG, "Couldn't open /proc/modules");
+ return -1;
+ }
+ while (fgets(buffer, sizeof(buffer), bbs)) {
+ /* match "module" with "module " and not "module-blah" */
+ if (!strncmp(buffer, driver, mod_len) && isspace(buffer[mod_len])) {
+ /* module is found */
+ ret = 1;
+ break;
+ }
+ }
+ fclose(bbs);
+ return ret;
+}
+
+/**
+ * Attempts to load a module. If the module has not been loaded after ten
+ * seconds, give up
+ *
+ * @param module_name The filename of the module to be loaded
+ * @param driver The name of the driver to be loaded
+ * @return 1 if the driver is succesfully loaded, 0 otherwise
+ */
+int module_load(char *module_name, char *driver) {
+ if (module_is_loaded(driver) == 0) {
+ /* the module has not loaded yet, try to load it */
+ bb_log(LOG_INFO, "Loading driver %s (module %s)\n", driver, module_name);
+ char *mod_argv[] = {
+ "modprobe",
+ module_name,
+ NULL
+ };
+ bb_run_fork_wait(mod_argv, 10);
+ if (module_is_loaded(driver) == 0) {
+ bb_log(LOG_ERR, "Module %s could not be loaded (timeout?)\n", module_name);
+ return 0;
+ }
+ }
+ return 1;
+}
+
+/**
+ * Attempts to unload a module if loaded, for ten seconds before
+ * giving up
+ *
+ * @param driver The name of the driver (not a filename)
+ * @return 1 if the driver is succesfully unloaded, 0 otherwise
+ */
+int module_unload(char *driver) {
+ if (module_is_loaded(driver) == 1) {
+ int retries = 30;
+ bb_log(LOG_INFO, "Unloading %s driver\n", driver);
+ char *mod_argv[] = {
+ "rmmod",
+ driver,
+ NULL
+ };
+ bb_run_fork_wait(mod_argv, 10);
+ while (retries-- > 0 && module_is_loaded(driver) == 1) {
+ usleep(100000);
+ }
+ if (module_is_loaded(driver) == 1) {
+ bb_log(LOG_ERR, "Unloading %s driver timed out.\n", driver);
+ return 0;
+ }
+ }
+ return 1;
+}
+
+/**
+ * Checks whether a kernel module is available for loading
+ *
+ * @param module_name The module name to be checked (filename or alias)
+ * @return 1 if the module is available for loading, 0 otherwise
+ */
+int module_is_available(char *module_name) {
+ /* HACK to support call from optirun */
+ char *modprobe_bin = "/sbin/modprobe";
+ if (access(modprobe_bin, X_OK)) {
+ /* if /sbin/modprobe is not found, pray that PATH contains it */
+ modprobe_bin = "modprobe";
+ }
+ char *mod_argv[] = {
+ modprobe_bin,
+ "--dry-run",
+ "--quiet",
+ module_name,
+ NULL
+ };
+ return bb_run_fork(mod_argv, 1) == EXIT_SUCCESS;
+}
--- /dev/null
+/*
+ * Copyright (c) 2011-2013, The Bumblebee Project
+ * Author: Peter Lekensteyn <lekensteyn@gmail.com>
+ *
+ * This file is part of Bumblebee.
+ *
+ * Bumblebee is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Bumblebee is distributed in the hope that 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 Bumblebee. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#pragma once
+
+int module_is_loaded(char *driver);
+int module_load(char *module_name, char *driver);
+int module_unload(char *driver);
+int module_is_available(char *module_name);
--- /dev/null
+/*
+ * Copyright (c) 2011-2013, The Bumblebee Project
+ * Author: Joaquín Ignacio Aramendía <samsagax@gmail.com>
+ * Author: Jaron Viëtor AKA "Thulinma" <jaron@vietors.com>
+ * Author: Lekensteyn <lekensteyn@gmail.com>
+ *
+ * This file is part of Bumblebee.
+ *
+ * Bumblebee is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Bumblebee is distributed in the hope that 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 Bumblebee. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/*
+ * C-coded version of the Bumblebee daemon and optirun.
+ */
+
+/* for strchrnul */
+#define _GNU_SOURCE
+
+#include <stdlib.h>
+#include <signal.h>
+#include <stdio.h>
+#include <string.h>
+#include <getopt.h>
+#include "bbconfig.h"
+#include "bbsocket.h"
+#include "bbsocketclient.h"
+#include "bblogger.h"
+#include "bbrun.h"
+#include "driver.h"
+
+
+/**
+ * Handle recieved signals - except SIGCHLD, which is handled in bbrun.c
+ */
+static void handle_signal(int sig) {
+ switch (sig) {
+ case SIGHUP:
+ bb_log(LOG_WARNING, "Received %s signal (ignoring...)\n", strsignal(sig));
+ break;
+ case SIGINT:
+ case SIGQUIT:
+ case SIGTERM:
+ bb_log(LOG_WARNING, "Received %s signal.\n", strsignal(sig));
+ socketClose(&bb_status.bb_socket); //closing the socket terminates the server
+ break;
+ default:
+ bb_log(LOG_WARNING, "Unhandled signal %s\n", strsignal(sig));
+ break;
+ }
+}
+
+/**
+ * Prints the status of the Bumblebee server if available
+ * @return EXIT_SUCCESS if the status is succesfully retrieved,
+ * EXIT_FAILURE otherwise
+ */
+static int report_daemon_status(void) {
+ char buffer[BUFFER_SIZE];
+ int r = snprintf(buffer, BUFFER_SIZE, "Status?");
+ socketWrite(&bb_status.bb_socket, buffer, r + 1);
+ while (bb_status.bb_socket != -1) {
+ r = socketRead(&bb_status.bb_socket, buffer, BUFFER_SIZE);
+ if (r > 0) {
+ ensureZeroTerminated(buffer, r, BUFFER_SIZE);
+ printf("Bumblebee status: %s\n", buffer);
+ socketClose(&bb_status.bb_socket);
+ return EXIT_SUCCESS;
+ }
+ }
+ return EXIT_FAILURE;
+}
+
+/**
+ * Runs a requested program if fallback mode was enabled
+ * @param argv The program and param list to be executed
+ * @return EXIT_FAILURE on failure and if fallback was disabled, -1 on failure
+ * and if fallback was enabled and never on success
+ */
+static int run_fallback(char *argv[]) {
+ if (bb_status.runmode == BB_RUN_APP && bb_config.fallback_start) {
+ bb_log(LOG_WARNING, "The Bumblebee server was not available.\n");
+ bb_run_exec(argv);
+ bb_log(LOG_ERR, "Unable to start program in fallback mode.\n");
+ }
+ return EXIT_FAILURE;
+}
+
+static int check_virtualgl(void) {
+ /* check if vglrun and vglclient exist */
+ char *p = which_program("vglrun");
+ int has_virtualgl = (p != NULL);
+ free(p);
+ p = which_program("vglclient");
+ has_virtualgl = has_virtualgl && (p != NULL);
+ free(p);
+ return has_virtualgl;
+}
+
+static int run_virtualgl(int argc, char **argv) {
+ //run vglclient if any method other than proxy is used
+ if (strncmp(bb_config.vgl_compress, "proxy", BUFFER_SIZE) != 0) {
+ char * vglclient_args[] = {
+ "vglclient",
+ "-detach",
+ 0
+ };
+ bb_run_fork(vglclient_args, 1);
+ }
+ /* number of options passed to --vgl-options */
+ unsigned int vglrun_opts_count = 0;
+ char *next_arg = bb_config.vglrun_options;
+ /* read vglrun options only if there is an arguments list */
+ if (next_arg && next_arg[0]) {
+ do {
+ ++vglrun_opts_count;
+ } while ((next_arg = strchr(next_arg + 1, ' ')));
+ }
+ /* position of next option */
+ unsigned int optno = 0;
+
+ /* 7 for the first options, 1 for the -- and 1 for the trailing 0 */
+ char ** vglrun_args = malloc(sizeof (char *) *
+ (9 + vglrun_opts_count + argc - optind));
+ vglrun_args[0] = "vglrun";
+ vglrun_args[1] = "-c";
+ vglrun_args[2] = bb_config.vgl_compress;
+ vglrun_args[3] = "-d";
+ vglrun_args[4] = bb_config.x_display;
+ vglrun_args[5] = "-ld";
+ vglrun_args[6] = bb_config.ld_path;
+ optno = 7;
+
+ next_arg = bb_config.vglrun_options;
+ if (next_arg && next_arg[0]) {
+ char *current_arg;
+ do {
+ current_arg = next_arg;
+ next_arg = strchr(current_arg, ' ');
+ /* cut the string if a space is found */
+ if (next_arg) {
+ *next_arg = 0;
+ /* the next argument starts at the position after the space */
+ next_arg++;
+ }
+ vglrun_args[optno++] = current_arg;
+ } while (next_arg);
+ }
+
+ vglrun_args[optno++] = "--";
+ int r;
+ for (r = 0; r < argc - optind; r++) {
+ vglrun_args[r + optno] = argv[optind + r];
+ }
+ vglrun_args[optno+=r] = 0;
+ /* set envvar for better performance on some systems, but allow the
+ * user for manually override */
+ setenv("VGL_READBACK", "pbo", 0);
+ int exitcode = bb_run_fork(vglrun_args, 0);
+ free(vglrun_args);
+ return exitcode;
+}
+
+static int check_primus(void) {
+ /* check if a libGL.so.1 can be found in one of the primus paths */
+ char *path = bb_config.primus_ld_path;
+ char *libgl = malloc(strlen(path) + sizeof("/libGL.so.1") + 1);
+ int libgl_found = 0;
+ do { /* iterate over paths separated by : */
+ char *p = strchrnul(path, ':');
+ int part_len = p - path;
+ if (part_len > 0) {
+ memcpy(libgl, path, part_len);
+ strcpy(libgl + part_len, "/libGL.so.1");
+ if (access(libgl, R_OK) == 0) {
+ libgl_found = 1;
+ break;
+ }
+ }
+ path = p;
+ } while (*path++ == ':'); /* after check, move to part after ':' */
+ free(libgl);
+ return libgl_found;
+}
+
+static int run_primus(int argc, char **argv) {
+ char **run_args = malloc(sizeof (char *) * (1 + argc - optind));
+ int r;
+ for (r = 0; r < argc - optind; r++) {
+ run_args[r] = argv[optind + r];
+ }
+ run_args[r] = 0;
+
+ /* primus starts the X server when needed, fixes long-standing fork issue */
+ setenv("BUMBLEBEE_SOCKET", bb_config.socket_path, 1);
+
+ /* set LD_LIBRARY_PATH to primus_ld_path plus ld_path plus current LD_LIBRARY_PATH */
+ setenv("PRIMUS_DISPLAY", bb_config.x_display, 0);
+ char *ldpath_cur = getenv("LD_LIBRARY_PATH");
+ char *ldpath_new = malloc(strlen(bb_config.primus_ld_path) + 1 + strlen(bb_config.ld_path) + 1 +
+ (ldpath_cur ? strlen(ldpath_cur) : 0) + 1);
+ strcpy(ldpath_new, bb_config.primus_ld_path);
+ if (bb_config.ld_path[0]) {
+ strcat(ldpath_new, ":");
+ strcat(ldpath_new, bb_config.ld_path);
+ }
+ if (ldpath_cur) {
+ strcat(ldpath_new, ":");
+ strcat(ldpath_new, ldpath_cur);
+ }
+ setenv("LD_LIBRARY_PATH", ldpath_new, 1);
+ free(ldpath_new);
+
+ /* set PRIMUS_libGLa */
+ char *libgl_mesa = "/usr/$LIB/libGL.so.1:/usr/lib/$LIB/libGL.so.1:/usr/$LIB/mesa/libGL.so.1:/usr/lib/$LIB/mesa/libGL.so.1";
+ if (bb_config.ld_path[0]) { /* build new library path for PRIMUS_libGLa */
+ int libgl_size = strlen(bb_config.ld_path) + 1;
+ { /* calculate additional memories for adding "/libGL.so.1" */
+ char *p = bb_config.ld_path;
+ do {
+ p = strchr(p, ':');
+ libgl_size += sizeof("/libGL.so.1") - 1;
+ } while (p++);
+ }
+ char *libgl = malloc(libgl_size);
+ { /* from library path A:B build A/libGL.so.1:B/libGL.so.1 */
+ int pos = 0;
+ char *path = bb_config.ld_path;
+ do {
+ char *p = strchrnul(path, ':');
+ int part_len = p - path;
+ if (part_len > 0) {
+ memcpy(libgl + pos, path, part_len);
+ pos += part_len;
+ snprintf(libgl + pos, libgl_size - pos, "/libGL.so.1%c", *p);
+ pos += sizeof("/libGL.so.1:") - 1;
+ }
+ path = p;
+ } while (*path++ == ':'); /* after check, move to part after ':' */
+ }
+ /* override PRIMUS_libGLa because PRIMUS does not know our driver */
+ setenv("PRIMUS_libGLa", libgl, 0);
+ free(libgl);
+ } else { /* no LibraryPath is set, assume OSS drivers */
+ setenv("PRIMUS_libGLa", libgl_mesa, 0);
+ }
+ /* assume OSS drivers for primary display (Mesa for Intel) */
+ setenv("PRIMUS_libGLd", libgl_mesa, 0);
+
+ int exitcode = bb_run_fork(run_args, 0);
+ free(run_args);
+ return exitcode;
+}
+
+static int check_none(void) {
+ return 1;
+}
+
+static int run_none(int argc, char **argv) {
+ char **run_args = malloc(sizeof (char *) * (1 + argc - optind));
+ int r;
+ for (r = 0; r < argc - optind; r++) {
+ run_args[r] = argv[optind + r];
+ }
+ run_args[r] = 0;
+
+ if (bb_config.ld_path[0]) {
+ char *ldpath_cur = getenv("LD_LIBRARY_PATH");
+ char *ldpath_new = malloc(strlen(bb_config.ld_path) + 1 + (ldpath_cur ? strlen(ldpath_cur) : 0) + 1);
+ strcpy(ldpath_new, bb_config.ld_path);
+ if (ldpath_cur) {
+ strcat(ldpath_new, ":");
+ strcat(ldpath_new, ldpath_cur);
+ }
+ setenv("LD_LIBRARY_PATH", ldpath_new, 1);
+ free(ldpath_new);
+ }
+
+ int exitcode = bb_run_fork(run_args, 0);
+ free(run_args);
+ return exitcode;
+}
+
+struct optirun_bridge {
+ const char *name;
+ int (*check_availability)(void);
+ int (*run)(int argc, char **argv);
+};
+
+static struct optirun_bridge backends[] = {
+ {"virtualgl", check_virtualgl, run_virtualgl},
+ {"primus", check_primus, run_primus},
+ {"none", check_none, run_none}, // keep last
+ {NULL, NULL, NULL}
+};
+
+/**
+ * Starts a program with Bumblebee if possible
+ *
+ * @param argc The number of arguments
+ * @param argv The values of arguments
+ * @return The exitcode of the program on success, EXIT_FAILURE if the program
+ * could not be started
+ */
+static int run_app(int argc, char *argv[]) {
+ int exitcode = EXIT_FAILURE;
+ char buffer[BUFFER_SIZE];
+ int r;
+ int ranapp = 0;
+
+ struct optirun_bridge *back = backends;
+ if (!strcmp(bb_config.optirun_bridge, "auto")) {
+ while (back->name && !back->check_availability()) ++back;
+ if (!back->name || !strcmp(back->name, "none")) {
+ bb_log(LOG_ERR, "No bridge found. Try installing primus or virtualgl.\n");
+ goto out;
+ }
+ bb_log(LOG_DEBUG, "Using auto-detected bridge %s\n", back->name);
+ } else {
+ while (back->name && strcmp(bb_config.optirun_bridge, back->name)) ++back;
+ if (!back->name) {
+ bb_log(LOG_ERR, "Unknown accel/display bridge: %s\n", bb_config.optirun_bridge);
+ goto out;
+ }
+ if (!back->check_availability()) {
+ bb_log(LOG_ERR, "Accel/display bridge %s is not installed.\n", back->name);
+ goto out;
+ }
+ }
+
+ r = snprintf(buffer, BUFFER_SIZE, "Connect %s", bb_config.no_xorg ? "NoX" : "");
+ socketWrite(&bb_status.bb_socket, buffer, r + 1);
+ while (bb_status.bb_socket != -1) {
+ r = socketRead(&bb_status.bb_socket, buffer, BUFFER_SIZE);
+ if (r > 0) {
+ r = ensureZeroTerminated(buffer, r, BUFFER_SIZE);
+ bb_log(LOG_INFO, "Response: %s\n", buffer);
+ switch (buffer[0]) {
+ case 'N': //No, run normally.
+ // buffer should contain "No, ..." or "No - ..."
+ bb_log(LOG_ERR, "Cannot access secondary GPU%s\n", r > 2 ? buffer+2 : "");
+ socketClose(&bb_status.bb_socket);
+ if (!bb_config.fallback_start) {
+ bb_log(LOG_ERR, "Aborting because fallback start is disabled.\n");
+ }
+ break;
+ case 'Y': //Yes, run through vglrun
+ bb_log(LOG_INFO, "Running application using %s.\n", back->name);
+ ranapp = 1;
+ exitcode = back->run(argc, argv);
+ socketClose(&bb_status.bb_socket);
+ break;
+ default: //Something went wrong - output and exit.
+ bb_log(LOG_ERR, "Problem: %s\n", buffer);
+ socketClose(&bb_status.bb_socket);
+ break;
+ }
+ }
+ }
+out:
+ if (!ranapp) {
+ exitcode = run_fallback(argv + optind);
+ }
+ return exitcode;
+}
+
+/**
+ * Returns the option string for this program
+ * @return An option string which can be used for getopt
+ */
+const char *bbconfig_get_optstr(void) {
+ return BBCONFIG_COMMON_OPTSTR "c:b:";
+}
+
+/**
+ * Returns the long options for this program
+ * @return A option struct which can be used for getopt_long
+ */
+const struct option *bbconfig_get_lopts(void) {
+ static struct option longOpts[] = {
+ {"failsafe", 0, 0, OPT_FAILSAFE},
+ {"no-failsafe", 0, 0, OPT_NO_FAILSAFE},
+ {"no-xorg", 0, 0, OPT_NO_XORG},
+ {"bridge", 1, 0, 'b'},
+ {"vgl-compress", 1, 0, 'c'},
+ {"vgl-options", 1, 0, OPT_VGL_OPTIONS},
+ {"primus-ldpath", 1, 0, OPT_PRIMUS_LD_PATH},
+ {"status", 0, 0, OPT_STATUS},
+ BBCONFIG_COMMON_LOPTS
+ };
+ return longOpts;
+}
+
+/**
+ * Parses local command line options
+ * @param opt The short option
+ * @param value Value for the option if any
+ * @return 1 if the option has been processed, 0 otherwise
+ */
+int bbconfig_parse_options(int opt, char *value) {
+ switch (opt) {
+ case 'b':/* accel/display bridge, e.g. virtualgl or primus */
+ set_string_value(&bb_config.optirun_bridge, value);
+ break;
+ case 'c'://vglclient method
+ set_string_value(&bb_config.vgl_compress, value);
+ break;
+ case OPT_FAILSAFE:
+ bb_config.fallback_start = 1;
+ break;
+ case OPT_NO_FAILSAFE:
+ bb_config.fallback_start = 0;
+ break;
+ case OPT_NO_XORG:
+ bb_config.no_xorg = 1;
+ set_string_value(&bb_config.optirun_bridge, "none");
+ break;
+ case OPT_VGL_OPTIONS:
+ set_string_value(&bb_config.vglrun_options, value);
+ break;
+ case OPT_PRIMUS_LD_PATH:
+ set_string_value(&bb_config.primus_ld_path, value);
+ break;
+ case OPT_STATUS:
+ bb_status.runmode = BB_RUN_STATUS;
+ break;
+ default:
+ /* no options parsed */
+ return 0;
+ }
+ return 1;
+}
+
+int main(int argc, char *argv[]) {
+ int exitcode = EXIT_FAILURE;
+
+ init_early_config(argv, BB_RUN_APP);
+
+ /* Setup signal handling before anything else */
+ signal(SIGHUP, handle_signal);
+ signal(SIGTERM, handle_signal);
+ signal(SIGINT, handle_signal);
+ signal(SIGQUIT, handle_signal);
+
+ bb_init_log();
+
+ /* Initializing configuration */
+ init_config();
+ bbconfig_parse_opts(argc, argv, PARSE_STAGE_PRECONF);
+ GKeyFile *bbcfg = bbconfig_parse_conf();
+ if (bbcfg) g_key_file_free(bbcfg);
+
+ /* Connect to listening daemon */
+ bb_status.bb_socket = socketConnect(bb_config.socket_path, SOCK_BLOCK);
+ if (bb_status.bb_socket < 0) {
+ bb_log(LOG_ERR, "Could not connect to bumblebee daemon - is it running?\n");
+ run_fallback(argv + optind);
+ bb_closelog();
+ return exitcode;
+ }
+
+ free_and_set_value(&bb_config.ld_path, malloc(BUFFER_SIZE));
+ if (bbsocket_query("LibraryPath", bb_config.ld_path, BUFFER_SIZE)) {
+ bb_log(LOG_ERR, "Failed to retrieve LibraryPath setting.\n");
+ return EXIT_FAILURE;
+ }
+ free_and_set_value(&bb_config.x_display, malloc(BUFFER_SIZE));
+ if (bbsocket_query("VirtualDisplay", bb_config.x_display, BUFFER_SIZE)) {
+ bb_log(LOG_ERR, "Failed to retrieve VirtualDisplay setting.\n");
+ return EXIT_FAILURE;
+ }
+
+ /* parse remaining common and optirun-specific options */
+ bbconfig_parse_opts(argc, argv, PARSE_STAGE_OTHER);
+ bb_log(LOG_DEBUG, "%s version %s starting...\n", "optirun", GITVERSION);
+ config_dump();
+
+ /* Request status */
+ if (bb_status.runmode == BB_RUN_STATUS) {
+ exitcode = report_daemon_status();
+ }
+
+ /* Run given application */
+ if (bb_status.runmode == BB_RUN_APP) {
+ if (optind >= argc) {
+ bb_log(LOG_ERR, "Missing argument: application to run\n");
+ print_usage(EXIT_FAILURE);
+ } else {
+ exitcode = run_app(argc, argv);
+ }
+ }
+
+ bb_closelog();
+ bb_stop_all(); //stop any started processes that are left
+ return exitcode;
+}
--- /dev/null
+/*
+ * Copyright (c) 2011-2013, The Bumblebee Project
+ * Author: Peter Lekensteyn <lekensteyn@gmail.com>
+ *
+ * This file is part of Bumblebee.
+ *
+ * Bumblebee is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Bumblebee is distributed in the hope that 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 Bumblebee. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <libgen.h>
+#include <errno.h>
+#include "pci.h"
+#include <stdlib.h>
+#include <string.h>
+#include "bblogger.h"
+
+/**
+ * Builds a Bus ID like 02:f0.1 from a binary representation
+ * @param dest The struct to store the Bus ID in
+ * @param bus_id The binary Bus ID
+ * @return 1 if bus_id is valid, 0 otherwise
+ */
+int pci_parse_bus_id(struct pci_bus_id *dest, int bus_id_numeric) {
+ if (bus_id_numeric >= 0 && bus_id_numeric < 0x10000) {
+ dest->bus = bus_id_numeric >> 8;
+ dest->slot = (bus_id_numeric >> 3) & 0x1f;
+ dest->func = bus_id_numeric & 0x7;
+ return 1;
+ }
+ return 0;
+}
+
+/**
+ * Gets the class of a device given by the Bus ID
+ * @param bus_id A string containing a Bus ID like 01:00.0
+ * @return The class number of a device as shown by lspci or 0 if the class
+ * could not be determined
+ */
+int pci_get_class(struct pci_bus_id *bus_id) {
+ /* the Bus ID is always of fixed length */
+ char class_path[40];
+ FILE *fp;
+
+ snprintf(class_path, sizeof class_path,
+ "/sys/bus/pci/devices/0000:%02x:%02x.%o/class", bus_id->bus,
+ bus_id->slot, bus_id->func);
+ fp = fopen(class_path, "r");
+ if (fp) {
+ char class_buff[16];
+ int read_bytes;
+
+ read_bytes = fread(class_buff, 1, sizeof class_buff, fp);
+ class_buff[read_bytes] = 0;
+ fclose(fp);
+ return strtol(class_buff, NULL, 0) >> 8;
+ }
+ return 0;
+}
+
+/**
+ * Finds the Bus ID a graphics card by vendor ID
+ * @param vendor_id A numeric vendor ID
+ * @param index A numeric index (the card we want when we have many of a vendor)
+ * @return A bus ID struct if a device was found, NULL if no device is found or
+ * no memory could be allocated
+ */
+struct pci_bus_id *pci_find_gfx_by_vendor(unsigned int vendor_id, unsigned int idx) {
+ FILE *fp;
+ char buf[512];
+ unsigned int bus_id_numeric, vendor_device;
+ struct pci_bus_id *result;
+
+ fp = fopen("/proc/bus/pci/devices", "r");
+ if (!fp) {
+ return NULL;
+ }
+
+ result = malloc(sizeof (struct pci_bus_id));
+ if (!result) {
+ return NULL;
+ }
+
+ while (fgets(buf, sizeof(buf) - 1, fp)) {
+ if (sscanf(buf, "%x %x", &bus_id_numeric, &vendor_device) != 2) {
+ continue;
+ }
+ /* VVVVDDDD becomes VVVV */
+ if (vendor_device >> 0x10 == vendor_id) {
+ if (pci_parse_bus_id(result, bus_id_numeric)) {
+ int pci_class = pci_get_class(result);
+ if (pci_class == PCI_CLASS_DISPLAY_VGA ||
+ pci_class == PCI_CLASS_DISPLAY_3D) {
+ /* yay, found device. Now get next, or clean up and return */
+ if (idx--) {
+ /* It's not yet our device */
+ continue;
+ }
+ fclose(fp);
+ return result;
+ }
+ }
+ }
+ }
+ /* no device found, clean up and return */
+ fclose(fp);
+ free(result);
+ return NULL;
+}
+
+/**
+ * Gets the driver name for a given Bus ID. If dest is not null and len is
+ * larger than 0, the driver name will be stored in dest
+ * @param dest An optional buffer to store the found driver name in
+ * @param bus_id A pci_bus_id struct containing a Bus ID
+ * @param len The maximum number of bytes to store in dest
+ * @return The length of the driver name (which may be larger than len if the
+ * buffer was too small) or 0 on error
+ */
+size_t pci_get_driver(char *dest, struct pci_bus_id *bus_id, size_t len) {
+ char path[1024];
+ ssize_t read_bytes;
+ char *name;
+
+ /* if the bus_id was invalid */
+ if (!bus_id) {
+ return 0;
+ }
+
+ /* the path to the driver if one is loaded */
+ snprintf(path, sizeof path, "/sys/bus/pci/devices/0000:%02x:%02x.%o/driver",
+ bus_id->bus, bus_id->slot, bus_id->func);
+ read_bytes = readlink(path, path, sizeof(path) - 1);
+ if (read_bytes < 0) {
+ /* error, assume that the driver is not loaded */
+ return 0;
+ }
+
+ /* readlink does not append a NULL according to the manpage */
+ path[read_bytes] = 0;
+
+ name = basename(path);
+ /* save the name if a valid destination and buffer size was given */
+ if (dest && len > 0) {
+ strncpy(dest, name, len - 1);
+ dest[len - 1] = 0;
+ }
+
+ return strlen(name);
+}
+
+/**
+ * Opens a stream to the PCI configuration space
+ * @param bus_id A pci_bus_id struct containing a Bus ID
+ * @param mode The mode for opening the file: O_WRONLY for writing, O_RDONLY for
+ * reading
+ * @return a file handle on success, or NULL on failure
+ */
+static int pci_config_open(struct pci_bus_id *bus_id, mode_t mode) {
+ char config_path[41];
+
+ snprintf(config_path, sizeof config_path,
+ "/sys/bus/pci/devices/0000:%02x:%02x.%o/config", bus_id->bus,
+ bus_id->slot, bus_id->func);
+ return open(config_path, mode);
+}
+
+/**
+ * Reads data from the PCI configuration space of a device. Based on
+ * pci_save_state in drivers/pci/pci.c
+ * @param bus_id A pci_bus_id struct containing a Bus ID
+ * @param pcs A struct containing the PCI configuration state
+ * @return zero on success, non-zero on failure
+ */
+int pci_config_save(struct pci_bus_id *bus_id, struct pci_config_state *pcs) {
+ int i, is_saved = 1;
+ int fd = pci_config_open(bus_id, O_RDONLY);
+ if (fd == -1) {
+ return errno;
+ }
+ bb_log(LOG_DEBUG, "Saving PCI configuration space...\n");
+ for (i = 0; i < 16; i++) {
+ /* read 32 bits (8 bytes) from the PCI configuration space */
+ if (read(fd, &pcs->saved_config_space[i], 4) != 4) {
+ bb_log(LOG_WARNING, "failed to retrieve config space value at offset"
+ " %#x - aborting\n", i);
+ is_saved = 0;
+ break;
+ }
+ /* Vendor ID and Device ID with all bits enabled is invalid and returned if
+ * a device is disabled */
+ if (i == 0 && pcs->saved_config_space[i] == (int32_t)-1) {
+ bb_log(LOG_WARNING, "invalid device state, is the discrete video card"
+ " disabled?\n");
+ is_saved = 0;
+ break;
+ }
+ }
+ close(fd);
+ pcs->state_saved = is_saved;
+ return 0;
+}
+
+/**
+ * Writes data to the PCI configuration space of a device. Based on
+ * pci_restore_state in drivers/pci/pci.c
+ * @param bus_id A pci_bus_id struct containing a Bus ID
+ * @param pcs A struct containing the PCI configuration state
+ * @return zero on success, non-zero on failure
+ */
+int pci_config_restore(struct pci_bus_id *bus_id, struct pci_config_state *pcs) {
+ int i;
+ int fd_write, fd_read;
+ if (!pcs->state_saved) {
+ /* nothing to restore, so success? */
+ bb_log(LOG_DEBUG, "there is no PCI configuration space to restore\n");
+ return 0;
+ }
+ fd_write = pci_config_open(bus_id, O_WRONLY);
+ if (fd_write == -1) {
+ return errno;
+ }
+ fd_read = pci_config_open(bus_id, O_RDONLY);
+ if (fd_read == -1) {
+ int err = errno;
+ close(fd_write);
+ return err;
+ }
+
+ bb_log(LOG_DEBUG, "Restoring PCI configuration space...\n");
+
+ for (i = 15; i >= 0; i--) {
+ int32_t val;
+
+ lseek(fd_read, 4 * i, SEEK_SET);
+ if (read(fd_read, &val, 4) == 0) {
+ bb_log(LOG_WARNING, "failed to retrieve config space value at offset"
+ " %#x - not writing\n", i);
+ } else if (val != pcs->saved_config_space[i]) {
+ bb_log(LOG_DEBUG, "restoring config space at offset %#x (was %#x, writing"
+ " %#x)\n", i, val, pcs->saved_config_space[i]);
+ lseek(fd_write, 4 * i, SEEK_SET);
+
+ int written_bytes = write(fd_write, &pcs->saved_config_space[i], 4) != 4;
+ if (written_bytes != 4) {
+ /* this is unlikely to happen, but not sure if it will never happen */
+ bb_log(LOG_WARNING, "The PCI config space could not be written fully at"
+ " offset %#x; %i bytes have been written; error: %s",
+ i, written_bytes, strerror(errno));
+ }
+ }
+ }
+ close(fd_read);
+ close(fd_write);
+ pcs->state_saved = 0;
+ return 0;
+}
--- /dev/null
+/*
+ * Copyright (c) 2011-2013, The Bumblebee Project
+ * Author: Peter Lekensteyn <lekensteyn@gmail.com>
+ *
+ * This file is part of Bumblebee.
+ *
+ * Bumblebee is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Bumblebee is distributed in the hope that 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 Bumblebee. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#pragma once
+#include <sys/types.h> /* necessary for int32_t */
+
+#define PCI_VENDOR_ID_NVIDIA 0x10de
+#define PCI_VENDOR_ID_INTEL 0x8086
+#define PCI_CLASS_DISPLAY_VGA 0x0300
+#define PCI_CLASS_DISPLAY_3D 0x0302
+
+struct pci_bus_id {
+ unsigned char bus; /* 0x00 - 0xFF */
+ unsigned char slot; /* 0x00 - 0x1F */
+ unsigned char func; /* 0 - 7 */
+};
+
+int pci_parse_bus_id(struct pci_bus_id *dest, int bus_id_numeric);
+int pci_get_class(struct pci_bus_id *bus_id);
+struct pci_bus_id *pci_find_gfx_by_vendor(unsigned int vendor_id, unsigned int idx);
+size_t pci_get_driver(char *dest, struct pci_bus_id *bus_id, size_t len);
+
+struct pci_config_state {
+ int state_saved;
+ int32_t saved_config_space[16];
+};
+
+int pci_config_save(struct pci_bus_id *bus_id, struct pci_config_state *pcs);
+int pci_config_restore(struct pci_bus_id *bus_id, struct pci_config_state *pcs);
--- /dev/null
+/*
+ * Copyright (c) 2011-2013, The Bumblebee Project
+ * Author: Jaron Viëtor AKA "Thulinma" <jaron@vietors.com>
+ * Author: Peter Lekensteyn <lekensteyn@gmail.com>
+ *
+ * This file is part of Bumblebee.
+ *
+ * Bumblebee is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Bumblebee is distributed in the hope that 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 Bumblebee. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <errno.h>
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include "../bblogger.h"
+#include "switching.h"
+#include "../module.h"
+
+#define BBSWITCH_PATH "/proc/acpi/bbswitch"
+
+/**
+ * Reports the status of bbswitch
+ *
+ * @return SWITCH_OFF if card is off, SWITCH_ON if card is on and SWITCH_UNAVAIL
+ * if bbswitch not available
+ */
+enum switch_state bbswitch_status(void) {
+ char buffer[BBS_BUFFER];
+ int ret = SWITCH_UNAVAIL;
+ FILE * bbs = fopen(BBSWITCH_PATH, "r");
+ if (bbs == 0) {
+ return SWITCH_UNAVAIL;
+ }
+ memset(buffer, 0, BBS_BUFFER);
+ // skip the PCI Bus ID, a space and 'O'
+ if (fseek(bbs, strlen("0000:00:00.0 O"), SEEK_SET) != -1) {
+ switch (fgetc(bbs)) {
+ case 'F': // value was 0000:00:00.0 OFF
+ ret = SWITCH_OFF;
+ break;
+ case 'N': // value was 0000:00:00.0 ON
+ ret = SWITCH_ON;
+ break;
+ default:
+ // this should never happen unless the behavior of the bbswitch kernel
+ // module has changed. If no device was registered, the procfs entry
+ // should not exist either
+ break;
+ }
+ }
+ fclose(bbs);
+ return ret;
+}//bbswitch_status
+
+static void bbswitch_write(char *msg) {
+ FILE *bbs = fopen(BBSWITCH_PATH, "w");
+ if (bbs == 0) {
+ bb_log(LOG_ERR, "Could not open %s: %s\n", BBSWITCH_PATH, strerror(errno));
+ return;
+ }
+ fwrite(msg, sizeof msg, strlen(msg) + 1, bbs);
+ if (ferror(bbs)) {
+ bb_log(LOG_WARNING, "Could not write to %s: %s\n", BBSWITCH_PATH,
+ strerror(errno));
+ }
+ fclose(bbs);
+}
+
+/**
+ * Whether bbswitch is available for use
+ *
+ * @param info A struct containing information which would help with the
+ * decision whether bbswitch is usable or not
+ * @return 1 if available for use for PM, 0 otherwise
+ */
+int bbswitch_is_available(struct switch_info info) {
+ (void) info; /* unused parameter */
+
+ /* easy one: if the path is available, bbswitch is usable */
+ if (access(BBSWITCH_PATH, F_OK | R_OK | W_OK) == 0) {
+ /* file exists and read/write is allowed */
+ bb_log(LOG_DEBUG, "bbswitch has been detected.\n");
+ return 1;
+ }
+ /* module is not loaded yet. Try to load it, checking whether the device is
+ * recognized by bbswitch. Assuming that vga_switcheroo was not told to OFF
+ * the device */
+ if (module_load("bbswitch", "bbswitch")) {
+ bb_log(LOG_DEBUG, "succesfully loaded bbswitch\n");
+ /* hurrah, bbswitch could be loaded which means that the module is
+ * available and that the card is supported */
+ return 1;
+ }
+ /* nope, we can't use bbswitch */
+ bb_log(LOG_DEBUG, "bbswitch is not available, perhaps you need to insmod"
+ " it?\n");
+ return 0;
+}
+
+/**
+ * Turns card on if not already on
+ */
+void bbswitch_on(void) {
+ bbswitch_write("ON\n");
+}//bbswitch_on
+
+/**
+ * Turns card off if not already off
+ */
+void bbswitch_off(void) {
+ bbswitch_write("OFF\n");
+}//bbswitch_off
--- /dev/null
+/*
+ * Copyright (c) 2011-2013, The Bumblebee Project
+ * Author: Jaron Viëtor AKA "Thulinma" <jaron@vietors.com>
+ * Author: Peter Lekensteyn <lekensteyn@gmail.com>
+ *
+ * This file is part of Bumblebee.
+ *
+ * Bumblebee is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Bumblebee is distributed in the hope that 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 Bumblebee. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <errno.h>
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+#include "../bblogger.h"
+#include "switching.h"
+
+#define SWITCHEROO_PATH "/sys/kernel/debug/vgaswitcheroo/switch"
+
+/**
+ * Reports the status of vga switcheroo
+ *
+ * @return SWITCH_OFF if card is off, SWITCH_ON if card is on and SWITCH_UNAVAIL
+ * if switcheroo not available
+ */
+int switcheroo_status(void) {
+ char buffer[BBS_BUFFER];
+ int ret = SWITCH_UNAVAIL;
+ FILE * bbs = fopen(SWITCHEROO_PATH, "r");
+ if (bbs == 0) {
+ return SWITCH_UNAVAIL;
+ }
+ while (fgets(buffer, BBS_BUFFER, bbs)) {
+ if (strlen(buffer) > strlen("0:DIS: :Pwr") &&
+ !strncmp(buffer + 2, "DIS", 3)) {//found the DIS line
+ // compare the first char after "0:DIS: :"
+ switch (buffer[strlen("0:DIS: :")]) {
+ case 'P': // Pwr
+ ret = SWITCH_ON;
+ break;
+ case 'O':
+ ret = SWITCH_OFF;
+ break;
+ }
+ }
+ }
+ fclose(bbs);
+ return ret;
+}//switcheroo_status
+
+static void switcheroo_write(char *msg) {
+ FILE * bbs = fopen(SWITCHEROO_PATH, "w");
+ if (bbs == 0) {
+ bb_log(LOG_ERR, "Could not open %s: %s\n", SWITCHEROO_PATH,
+ strerror(errno));
+ return;
+ }
+ fwrite(msg, sizeof msg, strlen(msg) + 1, bbs);
+ if (ferror(bbs)) {
+ bb_log(LOG_WARNING, "Could not write to %s: %s\n", SWITCHEROO_PATH,
+ strerror(errno));
+ }
+ fclose(bbs);
+}
+
+/**
+ * Whether vga_switcheroo is available for use
+ *
+ * @param info A struct containing information which would help with the
+ * decision whether vga_switcheroo is usable or not
+ * @return 1 if available for use for PM, 0 otherwise
+ */
+int switcheroo_is_available(struct switch_info info) {
+ if (strcmp(info.configured_pm, "switcheroo") != 0) {
+ bb_log(LOG_INFO, "Skipping switcheroo PM method because it is not"
+ " explicitly selected in the configuration.\n");
+ return 0;
+ }
+ return 1;
+}
+
+/**
+ * Turns card on if not already on
+ */
+void switcheroo_on(void) {
+ switcheroo_write("ON\n");
+}//switcheroo_on
+
+/**
+ * Turns card off if not already off.
+ */
+void switcheroo_off(void) {
+ switcheroo_write("OFF\n");
+}//switcheroo_off
--- /dev/null
+/*
+ * Copyright (c) 2011-2013, The Bumblebee Project
+ * Author: Peter Lekensteyn <lekensteyn@gmail.com>
+ *
+ * This file is part of Bumblebee.
+ *
+ * Bumblebee is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Bumblebee is distributed in the hope that 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 Bumblebee. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <stddef.h>
+#include <string.h>
+#include "../bblogger.h"
+#include "switching.h"
+
+/* increase SWITCHERS_COUNT in switching.h when more methods are added */
+struct switching_method switching_methods[SWITCHERS_COUNT] = {
+ {"bbswitch", 1, bbswitch_status, bbswitch_is_available,
+ bbswitch_on, bbswitch_off},
+ {"switcheroo", 0, switcheroo_status, switcheroo_is_available,
+ switcheroo_on, switcheroo_off}
+};
+
+/**
+ * Enumerates through available switching methods and try a method
+ *
+ * @param name An optional name to find out the status for that name. If NULL,
+ * all methods will be probed
+ * @param info A struct containing information which would help with the
+ * decision whether bbswitch is usable or not
+ * @return A switching method if available, NULL otherwise
+ */
+struct switching_method *switcher_detect(const char *name,
+ struct switch_info info) {
+ int i;
+ switcher = NULL;
+ for (i = 0; i<SWITCHERS_COUNT; ++i) {
+ /* If the status is 0 or 1, the method is usable */
+ if ((!name || strcmp(name, switching_methods[i].name) == 0) &&
+ switching_methods[i].is_available(info)) {
+ switcher = &switching_methods[i];
+ break;
+ }
+ }
+ return switcher;
+}
+
+enum switch_state switch_status(void) {
+ if (switcher) {
+ return switcher->status();
+ }
+ return SWITCH_UNAVAIL;
+}
+
+enum switch_state switch_on(void) {
+ if (switcher) {
+ if (switcher->status() == SWITCH_ON) {
+ return SWITCH_ON;
+ }
+ bb_log(LOG_INFO, "Switching dedicated card ON [%s]\n", switcher->name);
+ switcher->on();
+ return switcher->status();
+ }
+ return SWITCH_UNAVAIL;
+}
+
+enum switch_state switch_off(void) {
+ if (switcher) {
+ if (switcher->status() == SWITCH_OFF) {
+ return SWITCH_OFF;
+ }
+ bb_log(LOG_INFO, "Switching dedicated card OFF [%s]\n", switcher->name);
+ switcher->off();
+ return switcher->status();
+ }
+ return SWITCH_UNAVAIL;
+}
--- /dev/null
+/*
+ * Copyright (c) 2011-2013, The Bumblebee Project
+ * Author: Peter Lekensteyn <lekensteyn@gmail.com>
+ *
+ * This file is part of Bumblebee.
+ *
+ * Bumblebee is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Bumblebee is distributed in the hope that 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 Bumblebee. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+
+#pragma once
+
+/* Buffer size for result from reading files for switching methods */
+#define BBS_BUFFER 100
+
+enum switch_state {
+ SWITCH_ON = 1,
+ SWITCH_OFF = 0,
+ SWITCH_UNAVAIL = -1
+};
+
+/* information that could be useful for use in is_available */
+struct switch_info {
+ char *driver; /* possible values are nouveau and nvidia */
+ const char *configured_pm; /* configured PM method, NOT the detected one */
+};
+
+struct switching_method {
+ char *name; /* a short name for informational / logging purposes */
+ int need_driver_unloaded; /* 1 if the method needs drivers to be unloaded
+ * when disabling the card, 0 otherwise*/
+ enum switch_state (*status)(void); /* reports status: off (0), on (1),
+ * unavailable (-1) */
+ int (*is_available)(struct switch_info); /* returns 1 if available for use,
+ * 0 otherwise */
+ void (*on)(void); /* attempts to enable a card */
+ void (*off)(void); /* attempts to disable a card */
+};
+
+enum switch_state bbswitch_status(void);
+int bbswitch_is_available(struct switch_info);
+void bbswitch_on(void);
+void bbswitch_off(void);
+
+enum switch_state switcheroo_status(void);
+int switcheroo_is_available(struct switch_info);
+void switcheroo_on(void);
+void switcheroo_off(void);
+
+/* number of switchers as defined in switching.c */
+#define SWITCHERS_COUNT 2
+struct switching_method switching_methods[SWITCHERS_COUNT];
+
+/* A switching method that can be used or NULL if none */
+struct switching_method *switcher;
+
+struct switching_method *switcher_detect(const char *name, struct switch_info);
+enum switch_state switch_status(void);
+enum switch_state switch_on(void);
+enum switch_state switch_off(void);
--- /dev/null
+#!/bin/sh
+
+rootdir="$1"
+[ -n "$rootdir" ] || rootdir=.
+if [ -z "$PACKAGE_VERSION" ]; then
+ eval "$(cd "$rootdir" && grep -m1 PACKAGE_VERSION configure \
+ 2>/dev/null)"
+fi
+
+[ ! -f "$1/VERSION" ] || VN="$(cat VERSION)"
+
+if [ -z "$VN" ] && [ -d "$rootdir/.git" ]; then
+ VN=$(cd "$rootdir" &&
+ git describe --tags --match 'v[0-9]*' 2>/dev/null)
+
+ if [ -z "$VN" ]; then
+ VN=$(cd "$rootdir" &&
+ git log -1 --pretty=format:"git-%cd-%h" --date=short \
+ 2>/dev/null)
+ [ -z "$VN" ] || VN="$PACKAGE_VERSION-$VN"
+ fi
+fi
+
+# try substituted hash if any
+if [ -z "$VN" ]; then
+ git_date="$Format:%ci"
+ git_hash="$Format:%h$"
+ if ! [ "${git_hash:0:1}" = "\$" ]; then
+ git_date="${git_date%% *}"
+ VN="$PACKAGE_VERSION-$git_date-$git_hash"
+ fi
+fi
+
+# try name of directory (from github tarballs)
+if [ -z "$VN" ]; then
+ srcdir="$(cd "$1" && pwd)"
+ case "$srcdir" in
+ */*-*-[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f])
+ git_hash="${srcdir##*-}"
+ [ -z "$PACKAGE_VERSION" ] || VN="$PACKAGE_VERSION-$git_hash"
+ ;;
+ esac
+fi
+
+VN=$(expr "$VN" : v*'\(.*\)')
+[ -n "$VN" ] || VN="$PACKAGE_VERSION"
+
+if [ -n "$VN" ]; then
+ echo "$VN"
+else
+ echo "0-UNKNOWN"
+fi