From: Charles McGarvey Date: Tue, 14 Dec 2010 21:44:20 +0000 (-0700) Subject: build system enhancements X-Git-Url: https://git.dogcows.com/gitweb?a=commitdiff_plain;h=6c9943707d4f33035830eba0587a61a34eaecbc2;p=chaz%2Fyoink build system enhancements --- diff --git a/COPYING b/COPYING index afe3fe7..0b63b1d 100644 --- a/COPYING +++ b/COPYING @@ -1,102 +1,1690 @@ +YOINK_LICENSE(7) Miscellaneous Information Manual YOINK_LICENSE(7) -Excluding certain portions of this software as mentioned later in this -document, the software distributed alongside this file are licensed -according to the following terms and conditions: - -The Simplified BSD License - -Copyright (c) 2009-2010, Charles McGarvey -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. - ---------------------------------------------------------------------------- - -Portions of this software are owned by third parties and licensed under -separate terms and conditions. These portions, although packaged together -according to the distribution rights granted by their own individual -licenses, are used and provided under their separate terms and conditions -and therefore the above license can not necessarily be applied to such -portions. Neither do the terms and conditions associated with the -following portions necessarily apply to the files released under the above -license. The texts of applicable licences can be found in doc/licenses/. - - Portion: cml - Source: http://www.cmldev.net/ -Copyright: (c) 2009 Jesse Anders - License: Boost-1.0 - - Portion: ConvertUTF.{c,h} - Source: http://www.unicode.org/Public/PROGRAMS/CVTUTF/ -Copyright: (c) 2000-2004 Unicode, Inc. - License: see file comments - - Portion: fastevents.{c,h} - Source: http://www.gameprogrammer.com/fastevents/fastevents1.html -Copyright: (c) 2002 Bob Pendleton - License: LGPL-2.1 - - Portion: libpng14.dll - Source: http://www.libpng.org/pub/png/libpng.html -Copyright: (c) 2004, 2006-2009 Glenn Randers-Pehrson - License: libpng - - Portion: libogg-0.dll, libvorbis-0.dll, libvorbisfile-3.dll - Source: http://www.xiph.org/downloads/ -Copyright: (c) 2009 Xiph.Org Foundation - License: BSD - - Portion: lua51.dll - Source: http://www.lua.org/ -Copyright: (c) 1995-2008 Lua.org, PUC-Rio - License: MIT - - Portion: nightfusion.xm - Source: http://8bitcollective.com/members/FearofDark/ -Copyright: (c) 2009 Stephen H. Johnston - License: CCPL-Attribution-ShareAlike-NonCommercial-2.5 - - Portion: OpenAL32.dll - Source: http://kcat.strangesoft.net/openal.html -Copyright: (c) 2009 Chris Robinson - License: LGPL-2 - - Portion: original image and sound resources - Source: http://www.nether.org.uk/bad_mac_code.html -Copyright: (c) 2003 Neil Carter - License: zlib-libpng - - Portion: SDL.dll - Source: http://www.libsdl.org/ -Copyright: (c) 2009 Sam Lantinga et al. - License: LGPL-2.1 - - Portion: stlplus - Source: http://stlplus.sourceforge.net/ -Copyright: (c) 1999-2004 Southampton University, 2004-2009 Andy Rushton - License: BSD - - Portion: zlib1.dll - Source: http://www.zlib.net/ -Copyright: (c) 1995-2005 Jean-loup Gailly and Mark Adler - License: zlib-libpng +NAME + yoink_license -- copyright and license terms and conditions +DESCRIPTION + Unless otherwise stated, either in this document or in the file's header + or metadata section (the latter taking precedence in the case of + conflict), the files that make up Yoink are licensed accordingly: + + The Simplified BSD License + + Copyright (C) 2009-2011, Charles McGarvey et al. + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + + Boost-1.0 License + These components fall under the Boost-1.0 license: + + (C) 2009 Jesse Anders + CML: http://www.cmldev.net/ + + Boost Software License - Version 1.0 - August 17th, 2003 + + Permission is hereby granted, free of charge, to any person or + organization obtaining a copy of the software and accompanying + documentation covered by this license (the "Software") to use, + reproduce, display, distribute, execute, and transmit the Software, + and to prepare derivative works of the Software, and to permit + third-parties to whom the Software is furnished to do so, all + subject to the following: + + The copyright notices in the Software and this entire statement, + including the above license grant, this restriction and the + following disclaimer, must be included in all copies of the + Software, in whole or in part, and all derivative works of the + Software, unless such copies or derivative works are solely in the + form of machine-executable object code generated by a source + language processor. + + 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, TITLE AND NON- + INFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR ANYONE + DISTRIBUTING THE SOFTWARE BE LIABLE FOR ANY DAMAGES OR OTHER + LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT + OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + IN THE SOFTWARE. + + BSD License + These components fall under the BSD license: + + (C) 1999-2004 Southampton University, 2004-2009 Andy Rushton + stlplus: http://stlplus.sourceforge.net/ + + (C) 2009 Xiph.Org Foundation + libogg, libvorbis: http://www.xiph.org/downloads/ + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + + 3. Neither the name of the nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + + CCPL-BY-NC-SA-3.0 + These components fall under the CCPL-BY-NC-SA-3.0: + + (C) 2009 Stephen H. Johnston + Night Fusion: http://www.fodxm.co.uk/ + + Creative Commons + + Creative Commons Legal Code + + Attribution-NonCommercial-ShareAlike 3.0 Unported + + CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE + LEGAL SERVICES. DISTRIBUTION OF THIS LICENSE DOES NOT CREATE AN + ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS + INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO + WARRANTIES REGARDING THE INFORMATION PROVIDED, AND DISCLAIMS + LIABILITY FOR DAMAGES RESULTING FROM ITS USE. + + License + + THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS + CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS + PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE + WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS + PROHIBITED. + + BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND + AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. TO THE EXTENT THIS + LICENSE MAY BE CONSIDERED TO BE A CONTRACT, THE LICENSOR GRANTS YOU + THE RIGHTS CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF + SUCH TERMS AND CONDITIONS. + + 1. Definitions + + a. "Adaptation" means a work based upon the Work, or upon + the Work and other pre-existing works, such as a + translation, adaptation, derivative work, arrangement of + music or other alterations of a literary or artistic work, + or phonogram or performance and includes cinematographic + adaptations or any other form in which the Work may be + recast, transformed, or adapted including in any form + recognizably derived from the original, except that a work + that constitutes a Collection will not be considered an + Adaptation for the purpose of this License. For the + avoidance of doubt, where the Work is a musical work, + performance or phonogram, the synchronization of the Work + in timed-relation with a moving image ("synching") will be + considered an Adaptation for the purpose of this License. + + b. "Collection" means a collection of literary or artistic + works, such as encyclopedias and anthologies, or + performances, phonograms or broadcasts, or other works or + subject matter other than works listed in Section 1(g) + below, which, by reason of the selection and arrangement + of their contents, constitute intellectual creations, in + which the Work is included in its entirety in unmodified + form along with one or more other contributions, each + constituting separate and independent works in themselves, + which together are assembled into a collective whole. A + work that constitutes a Collection will not be considered + an Adaptation (as defined above) for the purposes of this + License. + + c. "Distribute" means to make available to the public the + original and copies of the Work or Adaptation, as + appropriate, through sale or other transfer of ownership. + + d. "License Elements" means the following high-level + license attributes as selected by Licensor and indicated + in the title of this License: Attribution, Noncommercial, + ShareAlike. + + e. "Licensor" means the individual, individuals, entity or + entities that offer(s) the Work under the terms of this + License. + + f. "Original Author" means, in the case of a literary or + artistic work, the individual, individuals, entity or + entities who created the Work or if no individual or + entity can be identified, the publisher; and in addition + (i) in the case of a performance the actors, singers, + musicians, dancers, and other persons who act, sing, + deliver, declaim, play in, interpret or otherwise perform + literary or artistic works or expressions of folklore; + (ii) in the case of a phonogram the producer being the + person or legal entity who first fixes the sounds of a + performance or other sounds; and, (iii) in the case of + broadcasts, the organization that transmits the broadcast. + + g. "Work" means the literary and/or artistic work offered + under the terms of this License including without + limitation any production in the literary, scientific and + artistic domain, whatever may be the mode or form of its + expression including digital form, such as a book, + pamphlet and other writing; a lecture, address, sermon or + other work of the same nature; a dramatic or dramatico- + musical work; a choreographic work or entertainment in + dumb show; a musical composition with or without words; a + cinematographic work to which are assimilated works + expressed by a process analogous to cinematography; a work + of drawing, painting, architecture, sculpture, engraving + or lithography; a photographic work to which are + assimilated works expressed by a process analogous to + photography; a work of applied art; an illustration, map, + plan, sketch or three-dimensional work relative to + geography, topography, architecture or science; a + performance; a broadcast; a phonogram; a compilation of + data to the extent it is protected as a copyrightable + work; or a work performed by a variety or circus performer + to the extent it is not otherwise considered a literary or + artistic work. + + h. "You" means an individual or entity exercising rights + under this License who has not previously violated the + terms of this License with respect to the Work, or who has + received express permission from the Licensor to exercise + rights under this License despite a previous violation. + + i. "Publicly Perform" means to perform public recitations + of the Work and to communicate to the public those public + recitations, by any means or process, including by wire or + wireless means or public digital performances; to make + available to the public Works in such a way that members + of the public may access these Works from a place and at a + place individually chosen by them; to perform the Work to + the public by any means or process and the communication + to the public of the performances of the Work, including + by public digital performance; to broadcast and + rebroadcast the Work by any means including signs, sounds + or images. + + j. "Reproduce" means to make copies of the Work by any + means including without limitation by sound or visual + recordings and the right of fixation and reproducing + fixations of the Work, including storage of a protected + performance or phonogram in digital form or other + electronic medium. + + 2. Fair Dealing Rights. Nothing in this License is intended to + reduce, limit, or restrict any uses free from copyright or + rights arising from limitations or exceptions that are provided + for in connection with the copyright protection under copyright + law or other applicable laws. + + 3. License Grant. Subject to the terms and conditions of this + License, Licensor hereby grants You a worldwide, royalty-free, + non-exclusive, perpetual (for the duration of the applicable + copyright) license to exercise the rights in the Work as stated + below: + + a. to Reproduce the Work, to incorporate the Work into one + or more Collections, and to Reproduce the Work as + incorporated in the Collections; + + b. to create and Reproduce Adaptations provided that any + such Adaptation, including any translation in any medium, + takes reasonable steps to clearly label, demarcate or + otherwise identify that changes were made to the original + Work. For example, a translation could be marked "The + original work was translated from English to Spanish," or + a modification could indicate "The original work has been + modified."; + + c. to Distribute and Publicly Perform the Work including + as incorporated in Collections; and, + + d. to Distribute and Publicly Perform Adaptations. + + The above rights may be exercised in all media and formats + whether now known or hereafter devised. The above rights + include the right to make such modifications as are technically + necessary to exercise the rights in other media and formats. + Subject to Section 8(f), all rights not expressly granted by + Licensor are hereby reserved, including but not limited to the + rights described in Section 4(e). + + 4. Restrictions. The license granted in Section 3 above is + expressly made subject to and limited by the following + restrictions: + + a. You may Distribute or Publicly Perform the Work only + under the terms of this License. You must include a copy + of, or the Uniform Resource Identifier (URI) for, this + License with every copy of the Work You Distribute or + Publicly Perform. You may not offer or impose any terms on + the Work that restrict the terms of this License or the + ability of the recipient of the Work to exercise the + rights granted to that recipient under the terms of the + License. You may not sublicense the Work. You must keep + intact all notices that refer to this License and to the + disclaimer of warranties with every copy of the Work You + Distribute or Publicly Perform. When You Distribute or + Publicly Perform the Work, You may not impose any + effective technological measures on the Work that restrict + the ability of a recipient of the Work from You to + exercise the rights granted to that recipient under the + terms of the License. This Section 4(a) applies to the + Work as incorporated in a Collection, but this does not + require the Collection apart from the Work itself to be + made subject to the terms of this License. If You create a + Collection, upon notice from any Licensor You must, to the + extent practicable, remove from the Collection any credit + as required by Section 4(d), as requested. If You create + an Adaptation, upon notice from any Licensor You must, to + the extent practicable, remove from the Adaptation any + credit as required by Section 4(d), as requested. + + b. You may Distribute or Publicly Perform an Adaptation + only under: (i) the terms of this License; (ii) a later + version of this License with the same License Elements as + this License; (iii) a Creative Commons jurisdiction + license (either this or a later license version) that + contains the same License Elements as this License (e.g., + Attribution-NonCommercial-ShareAlike 3.0 US) ("Applicable + License"). You must include a copy of, or the URI, for + Applicable License with every copy of each Adaptation You + Distribute or Publicly Perform. You may not offer or + impose any terms on the Adaptation that restrict the terms + of the Applicable License or the ability of the recipient + of the Adaptation to exercise the rights granted to that + recipient under the terms of the Applicable License. You + must keep intact all notices that refer to the Applicable + License and to the disclaimer of warranties with every + copy of the Work as included in the Adaptation You + Distribute or Publicly Perform. When You Distribute or + Publicly Perform the Adaptation, You may not impose any + effective technological measures on the Adaptation that + restrict the ability of a recipient of the Adaptation from + You to exercise the rights granted to that recipient under + the terms of the Applicable License. This Section 4(b) + applies to the Adaptation as incorporated in a Collection, + but this does not require the Collection apart from the + Adaptation itself to be made subject to the terms of the + Applicable License. + + c. You may not exercise any of the rights granted to You + in Section 3 above in any manner that is primarily + intended for or directed toward commercial advantage or + private monetary compensation. The exchange of the Work + for other copyrighted works by means of digital file- + sharing or otherwise shall not be considered to be + intended for or directed toward commercial advantage or + private monetary compensation, provided there is no + payment of any monetary compensation in con-nection with + the exchange of copyrighted works. + + d. If You Distribute, or Publicly Perform the Work or any + Adaptations or Collections, You must, unless a request has + been made pursuant to Section 4(a), keep intact all + copyright notices for the Work and provide, reasonable to + the medium or means You are utilizing: (i) the name of the + Original Author (or pseudonym, if applicable) if supplied, + and/or if the Original Author and/or Licensor designate + another party or parties (e.g., a sponsor institute, + publishing entity, journal) for attribution ("Attribution + Parties") in Licensor's copyright notice, terms of service + or by other reasonable means, the name of such party or + parties; (ii) the title of the Work if supplied; (iii) to + the extent reasonably practicable, the URI, if any, that + Licensor specifies to be associated with the Work, unless + such URI does not refer to the copyright notice or + licensing information for the Work; and, (iv) consistent + with Section 3(b), in the case of an Adaptation, a credit + identifying the use of the Work in the Adaptation (e.g., + "French translation of the Work by Original Author," or + "Screenplay based on original Work by Original Author"). + The credit required by this Section 4(d) may be + implemented in any reasonable manner; provided, however, + that in the case of a Adaptation or Collection, at a + minimum such credit will appear, if a credit for all + contributing authors of the Adaptation or Collection + appears, then as part of these credits and in a manner at + least as prominent as the credits for the other + contributing authors. For the avoidance of doubt, You may + only use the credit required by this Section for the + purpose of attribution in the manner set out above and, by + exercising Your rights under this License, You may not + implicitly or explicitly assert or imply any connection + with, sponsorship or endorsement by the Original Author, + Licensor and/or Attribution Parties, as appropriate, of + You or Your use of the Work, without the separate, express + prior written permission of the Original Author, Licensor + and/or Attribution Parties. + + e. For the avoidance of doubt: + + i. Non-waivable Compulsory License Schemes. In those + jurisdictions in which the right to collect royalties + through any statutory or compulsory licensing scheme + cannot be waived, the Licensor reserves the exclusive + right to collect such royalties for any exercise by + You of the rights granted under this License; + + ii. Waivable Compulsory License Schemes. In those + jurisdictions in which the right to collect royalties + through any statutory or compulsory licensing scheme + can be waived, the Licensor reserves the exclusive + right to collect such royalties for any exercise by + You of the rights granted under this License if Your + exercise of such rights is for a purpose or use which + is otherwise than noncommercial as permitted under + Section 4(c) and otherwise waives the right to + collect royalties through any statutory or compulsory + licensing scheme; and, + + iii. Voluntary License Schemes. The Licensor reserves + the right to collect royalties, whether individually + or, in the event that the Licensor is a member of a + collecting society that administers voluntary + licensing schemes, via that society, from any + exercise by You of the rights granted under this + License that is for a purpose or use which is + otherwise than noncommercial as permitted under + Section 4(c). + + f. Except as otherwise agreed in writing by the Licensor + or as may be otherwise permitted by applicable law, if You + Reproduce, Distribute or Publicly Perform the Work either + by itself or as part of any Adaptations or Collections, + You must not distort, mutilate, modify or take other + derogatory action in relation to the Work which would be + prejudicial to the Original Author's honor or reputation. + Licensor agrees that in those jurisdictions (e.g. Japan), + in which any exercise of the right granted in Section 3(b) + of this License (the right to make Adaptations) would be + deemed to be a distortion, mutilation, modification or + other derogatory action prejudicial to the Original + Author's honor and reputation, the Licensor will waive or + not assert, as appropriate, this Section, to the fullest + extent permitted by the applicable national law, to enable + You to reasonably exercise Your right under Section 3(b) + of this License (right to make Adaptations) but not + otherwise. + + 5. Representations, Warranties and Disclaimer + + UNLESS OTHERWISE MUTUALLY AGREED TO BY THE PARTIES IN WRITING + AND TO THE FULLEST EXTENT PERMITTED BY APPLICABLE LAW, LICENSOR + OFFERS THE WORK AS-IS AND MAKES NO REPRESENTATIONS OR + WARRANTIES OF ANY KIND CONCERNING THE WORK, EXPRESS, IMPLIED, + STATUTORY OR OTHERWISE, INCLUDING, WITHOUT LIMITATION, + WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR + PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER + DEFECTS, ACCURACY, OR THE PRESENCE OF ABSENCE OF ERRORS, + WHETHER OR NOT DISCOVERABLE. SOME JURISDICTIONS DO NOT ALLOW + THE EXCLUSION OF IMPLIED WARRANTIES, SO THIS EXCLUSION MAY NOT + APPLY TO YOU. + + 6. Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY + APPLICABLE LAW, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON + ANY LEGAL THEORY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, + PUNITIVE OR EXEMPLARY DAMAGES ARISING OUT OF THIS LICENSE OR + THE USE OF THE WORK, EVEN IF LICENSOR HAS BEEN ADVISED OF THE + POSSIBILITY OF SUCH DAMAGES. + + 7. Termination + + a. This License and the rights granted hereunder will + terminate automatically upon any breach by You of the + terms of this License. Individuals or entities who have + received Adaptations or Collections from You under this + License, however, will not have their licenses terminated + provided such individuals or entities remain in full + compliance with those licenses. Sections 1, 2, 5, 6, 7, + and 8 will survive any termination of this License. + + b. Subject to the above terms and conditions, the license + granted here is perpetual (for the duration of the + applicable copyright in the Work). Notwithstanding the + above, Licensor reserves the right to release the Work + under different license terms or to stop distributing the + Work at any time; provided, however that any such election + will not serve to withdraw this License (or any other + license that has been, or is required to be, granted under + the terms of this License), and this License will continue + in full force and effect unless terminated as stated + above. + + 8. Miscellaneous + + a. Each time You Distribute or Publicly Perform the Work + or a Collection, the Licensor offers to the recipient a + license to the Work on the same terms and conditions as + the license granted to You under this License. + + b. Each time You Distribute or Publicly Perform an + Adaptation, Licensor offers to the recipient a license to + the original Work on the same terms and conditions as the + license granted to You under this License. + + c. If any provision of this License is invalid or + unenforceable under applicable law, it shall not affect + the validity or enforceability of the remainder of the + terms of this License, and without further action by the + parties to this agreement, such provision shall be + reformed to the minimum extent necessary to make such + provision valid and enforceable. + + d. No term or provision of this License shall be deemed + waived and no breach consented to unless such waiver or + consent shall be in writing and signed by the party to be + charged with such waiver or consent. + + e. This License constitutes the entire agreement between + the parties with respect to the Work licensed here. There + are no understandings, agreements or representations with + respect to the Work not specified here. Licensor shall not + be bound by any additional provisions that may appear in + any communication from You. This License may not be + modified without the mutual written agreement of the + Licensor and You. + + f. The rights granted under, and the subject matter + referenced, in this License were drafted utilizing the + terminology of the Berne Convention for the Protection of + Literary and Artistic Works (as amended on September 28, + 1979), the Rome Convention of 1961, the WIPO Copyright + Treaty of 1996, the WIPO Performances and Phonograms + Treaty of 1996 and the Universal Copyright Convention (as + revised on July 24, 1971). These rights and subject matter + take effect in the relevant jurisdiction in which the + License terms are sought to be enforced according to the + corresponding provisions of the implementation of those + treaty provisions in the applicable national law. If the + standard suite of rights granted under applicable + copyright law includes additional rights not granted under + this License, such additional rights are deemed to be + included in the License; this License is not intended to + restrict the license of any rights under applicable law. + + Creative Commons Notice + + Creative Commons is not a party to this License, and makes no + warranty whatsoever in connection with the Work. Creative Commons + will not be liable to You or any party on any legal theory for any + damages whatsoever, including without limitation any general, + special, incidental or consequential damages arising in connection + to this license. Notwithstanding the foregoing two (2) sentences, + if Creative Commons has expressly identified itself as the Licensor + hereunder, it shall have all rights and obligations of Licensor. + + Except for the limited purpose of indicating to the public that the + Work is licensed under the CCPL, Creative Commons does not authorize + the use by either party of the trademark "Creative Commons" or any + related trademark or logo of Creative Commons without the prior + written consent of Creative Commons. Any permitted use will be in + compliance with Creative Commons' then-current trademark usage + guidelines, as may be published on its website or otherwise made + available upon request from time to time. For the avoidance of + doubt, this trademark restriction does not form part of this + License. + + Creative Commons may be contacted at http://creativecommons.org/. + + LGPL-2 + These components fall under the LGPL-2: + + (C) 2009 Chris Robinson + openal-soft: http://kcat.strangesoft.net/openal.html + + GNU LIBRARY GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1991 Free Software Foundation, Inc. 59 Temple Place - + Suite 330, Boston, MA 02111-1307, USA + Everyone is permitted to copy and distribute verbatim copies of this + license document, but changing it is not allowed. + + [This is the first released version of the library GPL. It is + numbered 2 because it goes with version 2 of the ordinary GPL.] + + Preamble + + The licenses for most software are designed to take away your + freedom to share and change it. By contrast, the GNU General Public + Licenses are intended to guarantee your freedom to share and change + free software--to make sure the software is free for all its users. + + This license, the Library General Public License, applies to some + specially designated Free Software Foundation software, and to any + other libraries whose authors decide to use it. You can use it for + your libraries, too. + + When we speak of free software, we are referring to freedom, not + price. Our General Public Licenses are designed to make sure that + you have the freedom to distribute copies of free software (and + charge for this service if you wish), that you receive source code + or can get it if you want it, that you can change the software or + use pieces of it in new free programs; and that you know you can do + these things. + + To protect your rights, we need to make restrictions that forbid + anyone to deny you these rights or to ask you to surrender the + rights. These restrictions translate to certain responsibilities + for you if you distribute copies of the library, or if you modify + it. + + For example, if you distribute copies of the library, whether gratis + or for a fee, you must give the recipients all the rights that we + gave you. You must make sure that they, too, receive or can get the + source code. If you link a program with the library, you must + provide complete object files to the recipients so that they can + relink them with the library, after making changes to the library + and recompiling it. And you must show them these terms so they know + their rights. + + Our method of protecting your rights has two steps: (1) copyright + the library, and (2) offer you this license which gives you legal + permission to copy, distribute and/or modify the library. + + Also, for each distributor's protection, we want to make certain + that everyone understands that there is no warranty for this free + library. If the library is modified by someone else and passed on, + we want its recipients to know that what they have is not the + original version, so that any problems introduced by others will not + reflect on the original authors' reputations. + + Finally, any free program is threatened constantly by software + patents. We wish to avoid the danger that companies distributing + free software will individually obtain patent licenses, thus in + effect transforming the program into proprietary software. To + prevent this, we have made it clear that any patent must be licensed + for everyone's free use or not licensed at all. + + Most GNU software, including some libraries, is covered by the + ordinary GNU General Public License, which was designed for utility + programs. This license, the GNU Library General Public License, + applies to certain designated libraries. This license is quite + different from the ordinary one; be sure to read it in full, and + don't assume that anything in it is the same as in the ordinary + license. + + The reason we have a separate public license for some libraries is + that they blur the distinction we usually make between modifying or + adding to a program and simply using it. Linking a program with a + library, without changing the library, is in some sense simply using + the library, and is analogous to running a utility program or + application program. However, in a textual and legal sense, the + linked executable is a combined work, a derivative of the original + library, and the ordinary General Public License treats it as such. + + Because of this blurred distinction, using the ordinary General + Public License for libraries did not effectively promote software + sharing, because most developers did not use the libraries. We + concluded that weaker conditions might promote sharing better. + + However, unrestricted linking of non-free programs would deprive the + users of those programs of all benefit from the free status of the + libraries themselves. This Library General Public License is + intended to permit developers of non-free programs to use free + libraries, while preserving your freedom as a user of such programs + to change the free libraries that are incorporated in them. (We + have not seen how to achieve this as regards changes in header + files, but we have achieved it as regards changes in the actual + functions of the Library.) The hope is that this will lead to + faster development of free libraries. + + The precise terms and conditions for copying, distribution and + modification follow. Pay close attention to the difference between + a "work based on the library" and a "work that uses the library". + The former contains code derived from the library, while the latter + only works together with the library. + + Note that it is possible for a library to be covered by the ordinary + General Public License rather than by this special one. + + GNU LIBRARY GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library which + contains a notice placed by the copyright holder or other authorized + party saying it may be distributed under the terms of this Library + General Public License (also called "this License"). Each licensee + is addressed as "you". + + A "library" means a collection of software functions and/or data + prepared so as to be conveniently linked with application programs + (which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work + which has been distributed under these terms. A "work based on the + Library" means either the Library or any derivative work under + copyright law: that is to say, a work containing the Library or a + portion of it, either verbatim or with modifications and/or + translated straightforwardly into another language. (Hereinafter, + translation is included without limitation in the term + "modification".) + + "Source code" for a work means the preferred form of the work for + making modifications to it. For a library, complete source code + means all the source code for all modules it contains, plus any + associated interface definition files, plus the scripts used to + control compilation and installation of the library. + + Activities other than copying, distribution and modification are not + covered by this License; they are outside its scope. The act of + running a program using the Library is not restricted, and output + from such a program is covered only if its contents constitute a + work based on the Library (independent of the use of the Library in + a tool for writing it). Whether that is true depends on what the + Library does and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's + complete source code as you receive it, in any medium, provided that + you conspicuously and appropriately publish on each copy an + appropriate copyright notice and disclaimer of warranty; keep intact + all the notices that refer to this License and to the absence of any + warranty; and distribute a copy of this License along with the + Library. + + You may charge a fee for the physical act of transferring a copy, + and you may at your option offer warranty protection in exchange for + a fee. + + 2. You may modify your copy or copies of the Library or any portion + of it, thus forming a work based on the Library, and copy and + distribute such modifications or work under the terms of Section 1 + above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function + or a table of data to be supplied by an application program + that uses the facility, other than as an argument passed when + the facility is invoked, then you must make a good faith effort + to ensure that, in the event an application does not supply + such function or table, the facility still operates, and + performs whatever part of its purpose remains meaningful. + + (For example, a function in a library to compute square roots + has a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function + must be optional: if the application does not supply it, the + square root function must still compute square roots.) + + These requirements apply to the modified work as a whole. If + identifiable sections of that work are not derived from the Library, + and can be reasonably considered independent and separate works in + themselves, then this License, and its terms, do not apply to those + sections when you distribute them as separate works. But when you + distribute the same sections as part of a whole which is a work + based on the Library, the distribution of the whole must be on the + terms of this License, whose permissions for other licensees extend + to the entire whole, and thus to each and every part regardless of + who wrote it. + + Thus, it is not the intent of this section to claim rights or + contest your rights to work written entirely by you; rather, the + intent is to exercise the right to control the distribution of + derivative or collective works based on the Library. + + In addition, mere aggregation of another work not based on the + Library with the Library (or with a work based on the Library) on a + volume of a storage or distribution medium does not bring the other + work under the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public + License instead of this License to a given copy of the Library. To + do this, you must alter all the notices that refer to this License, + so that they refer to the ordinary GNU General Public License, + version 2, instead of to this License. (If a newer version than + version 2 of the ordinary GNU General Public License has appeared, + then you can specify that version instead if you wish.) Do not make + any other change in these notices. + + Once this change is made in a given copy, it is irreversible for + that copy, so the ordinary GNU General Public License applies to all + subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of the + Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or + derivative of it, under Section 2) in object code or executable form + under the terms of Sections 1 and 2 above provided that you + accompany it with the complete corresponding machine-readable source + code, which must be distributed under the terms of Sections 1 and 2 + above on a medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy + from a designated place, then offering equivalent access to copy the + source code from the same place satisfies the requirement to + distribute the source code, even though third parties are not + compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the + Library, but is designed to work with the Library by being compiled + or linked with it, is called a "work that uses the Library". Such a + work, in isolation, is not a derivative work of the Library, and + therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library + creates an executable that is a derivative of the Library (because + it contains portions of the Library), rather than a "work that uses + the library". The executable is therefore covered by this License. + Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file + that is part of the Library, the object code for the work may be a + derivative work of the Library even though the source code is not. + Whether this is true is especially significant if the work can be + linked without the Library, or if the work is itself a library. The + threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data + structure layouts and accessors, and small macros and small inline + functions (ten lines or less in length), then the use of the object + file is unrestricted, regardless of whether it is legally a + derivative work. (Executables containing this object code plus + portions of the Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may + distribute the object code for the work under the terms of Section + 6. Any executables containing that work also fall under Section 6, + whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also compile or + link a "work that uses the Library" with the Library to produce a + work containing portions of the Library, and distribute that work + under terms of your choice, provided that the terms permit + modification of the work for the customer's own use and reverse + engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the + Library is used in it and that the Library and its use are covered + by this License. You must supply a copy of this License. If the + work during execution displays copyright notices, you must include + the copyright notice for the Library among them, as well as a + reference directing the user to the copy of this License. Also, you + must do one of these things: + + a) Accompany the work with the complete corresponding machine- + readable source code for the Library including whatever changes + were used in the work (which must be distributed under Sections + 1 and 2 above); and, if the work is an executable linked with + the Library, with the complete machine-readable "work that uses + the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a + modified executable containing the modified Library. (It is + understood that the user who changes the contents of + definitions files in the Library will not necessarily be able + to recompile the application to use the modified definitions.) + + b) Accompany the work with a written offer, valid for at least + three years, to give the same user the materials specified in + Subsection 6a, above, for a charge no more than the cost of + performing this distribution. + + c) If distribution of the work is made by offering access to + copy from a designated place, offer equivalent access to copy + the above specified materials from the same place. + + d) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the + Library" must include any data and utility programs needed for + reproducing the executable from it. However, as a special + exception, the source code distributed need not include anything + that is normally distributed (in either source or binary form) with + the major components (compiler, kernel, and so on) of the operating + system on which the executable runs, unless that component itself + accompanies the executable. + + It may happen that this requirement contradicts the license + restrictions of other proprietary libraries that do not normally + accompany the operating system. Such a contradiction means you + cannot use both them and the Library together in an executable that + you distribute. + + 7. You may place library facilities that are a work based on the + Library side-by-side in a single library together with other library + facilities not covered by this License, and distribute such a + combined library, provided that the separate distribution of the + work based on the Library and of the other library facilities is + otherwise permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same + work. + + 8. You may not copy, modify, sublicense, link with, or distribute + the Library except as expressly provided under this License. Any + attempt otherwise to copy, modify, sublicense, link with, or + distribute the Library is void, and will automatically terminate + your rights under this License. However, parties who have received + copies, or rights, from you under this License will not have their + licenses terminated so long as such parties remain in full + compliance. + + 9. You are not required to accept this License, since you have not + signed it. However, nothing else grants you permission to modify or + distribute the Library or its derivative works. These actions are + prohibited by law if you do not accept this License. Therefore, by + modifying or distributing the Library (or any work based on the + Library), you indicate your acceptance of this License to do so, and + all its terms and conditions for copying, distributing or modifying + the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the + Library), the recipient automatically receives a license from the + original licensor to copy, distribute, link with or modify the + Library subject to these terms and conditions. You may not impose + any further restrictions on the recipients' exercise of the rights + granted herein. You are not responsible for enforcing compliance by + third parties to this License. + + 11. If, as a consequence of a court judgment or allegation of patent + infringement or for any other reason (not limited to patent issues), + conditions are imposed on you (whether by court order, agreement or + otherwise) that contradict the conditions of this License, they do + not excuse you from the conditions of this License. If you cannot + distribute so as to satisfy simultaneously your obligations under + this License and any other pertinent obligations, then as a + consequence you may not distribute the Library at all. For example, + if a patent license would not permit royalty-free redistribution of + the Library by all those who receive copies directly or indirectly + through you, then the only way you could satisfy both it and this + License would be to refrain entirely from distribution of the + Library. + + If any portion of this section is held invalid or unenforceable + under any particular circumstance, the balance of the section is + intended to apply, and the section as a whole is intended to apply + in other circumstances. + + It is not the purpose of this section to induce you to infringe any + patents or other property right claims or to contest validity of any + such claims; this section has the sole purpose of protecting the + integrity of the free software distribution system which is + implemented by public license practices. Many people have made + generous contributions to the wide range of software distributed + through that system in reliance on consistent application of that + system; it is up to the author/donor to decide if he or she is + willing to distribute software through any other system and a + licensee cannot impose that choice. + + This section is intended to make thoroughly clear what is believed + to be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in + certain countries either by patents or by copyrighted interfaces, + the original copyright holder who places the Library under this + License may add an explicit geographical distribution limitation + excluding those countries, so that distribution is permitted only in + or among countries not thus excluded. In such case, this License + incorporates the limitation as if written in the body of this + License. + + 13. The Free Software Foundation may publish revised and/or new + versions of the Library General Public License from time to time. + Such new versions will be similar in spirit to the present version, + but may differ in detail to address new problems or concerns. + + Each version is given a distinguishing version number. If the + Library specifies a version number of this License which applies to + it and "any later version", you have the option of following the + terms and conditions either of that version or of any later version + published by the Free Software Foundation. If the Library does not + specify a license version number, you may choose any version ever + published by the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free + programs whose distribution conditions are incompatible with these, + write to the author to ask for permission. For software which is + copyrighted by the Free Software Foundation, write to the Free + Software Foundation; we sometimes make exceptions for this. Our + decision will be guided by the two goals of preserving the free + status of all derivatives of our free software and of promoting the + sharing and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO + WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. + EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR + OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY + KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, + THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND + PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE + DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR + CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN + WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY + AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU + FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR + CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE + LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING + RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A + FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF + SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF + SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + Appendix: How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest + possible use to the public, we recommend making it free software + that everyone can redistribute and change. You can do so by + permitting redistribution under these terms (or, alternatively, + under the terms of the ordinary General Public License). + + To apply these terms, attach the following notices to the library. + It is safest to attach them to the start of each source file to most + effectively convey the exclusion of warranty; and each file should + have at least the "copyright" line and a pointer to where the full + notice is found. + + + Copyright (C) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later + version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Library General Public License for more details. + + You should have received a copy of the GNU Library General + Public License along with this library; if not, write to the + Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA + + Also add information on how to contact you by electronic and paper + mail. + + You should also get your employer (if you work as a programmer) or + your school, if any, to sign a "copyright disclaimer" for the + library, if necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James + Random Hacker. + + , 1 April 1990 + Ty Coon, President of Vice + + That's all there is to it! + + LGPL-2.1 + These components fall under the LGPL-2.1: + + (C) 2009 Sam Lantinga et al. + SDL: http://www.libsdl.org/ + + (C) 2002 Bob Pendleton + fastevents: http://www.gameprogrammer.com/fastevents/ + + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. 51 Franklin + St, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies of this + license document, but changing it is not allowed. + + [This is the first released version of the Lesser GPL. It also + counts as the successor of the GNU Library Public License, version + 2, hence the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your + freedom to share and change it. By contrast, the GNU General Public + Licenses are intended to guarantee your freedom to share and change + free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some + specially designated software packages--typically libraries--of the + Free Software Foundation and other authors who decide to use it. + You can use it too, but we suggest you first think carefully about + whether this license or the ordinary General Public License is the + better strategy to use in any particular case, based on the + explanations below. + + When we speak of free software, we are referring to freedom of use, + not price. Our General Public Licenses are designed to make sure + that you have the freedom to distribute copies of free software (and + charge for this service if you wish); that you receive source code + or can get it if you want it; that you can change the software and + use pieces of it in new free programs; and that you are informed + that you can do these things. + + To protect your rights, we need to make restrictions that forbid + distributors to deny you these rights or to ask you to surrender + these rights. These restrictions translate to certain + responsibilities for you if you distribute copies of the library or + if you modify it. + + For example, if you distribute copies of the library, whether gratis + or for a fee, you must give the recipients all the rights that we + gave you. You must make sure that they, too, receive or can get the + source code. If you link other code with the library, you must + provide complete object files to the recipients, so that they can + relink them with the library after making changes to the library and + recompiling it. And you must show them these terms so they know + their rights. + + We protect your rights with a two-step method: (1) we copyright the + library, and (2) we offer you this license, which gives you legal + permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that + there is no warranty for the free library. Also, if the library is + modified by someone else and passed on, the recipients should know + that what they have is not the original version, so that the + original author's reputation will not be affected by problems that + might be introduced by others. + + Finally, software patents pose a constant threat to the existence of + any free program. We wish to make sure that a company cannot + effectively restrict the users of a free program by obtaining a + restrictive license from a patent holder. Therefore, we insist that + any patent license obtained for a version of the library must be + consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the + ordinary GNU General Public License. This license, the GNU Lesser + General Public License, applies to certain designated libraries, and + is quite different from the ordinary General Public License. We use + this license for certain libraries in order to permit linking those + libraries into non-free programs. + + When a program is linked with a library, whether statically or using + a shared library, the combination of the two is legally speaking a + combined work, a derivative of the original library. The ordinary + General Public License therefore permits such linking only if the + entire combination fits its criteria of freedom. The Lesser General + Public License permits more lax criteria for linking other code with + the library. + + We call this license the "Lesser" General Public License because it + does Less to protect the user's freedom than the ordinary General + Public License. It also provides other free software developers + Less of an advantage over competing non-free programs. These + disadvantages are the reason we use the ordinary General Public + License for many libraries. However, the Lesser license provides + advantages in certain special circumstances. + + For example, on rare occasions, there may be a special need to + encourage the widest possible use of a certain library, so that it + becomes a de-facto standard. To achieve this, non-free programs + must be allowed to use the library. A more frequent case is that a + free library does the same job as widely used non-free libraries. + In this case, there is little to gain by limiting the free library + to free software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free + programs enables a greater number of people to use a large body of + free software. For example, permission to use the GNU C Library in + non-free programs enables many more people to use the whole GNU + operating system, as well as its variant, the GNU/Linux operating + system. + + Although the Lesser General Public License is Less protective of the + users' freedom, it does ensure that the user of a program that is + linked with the Library has the freedom and the wherewithal to run + that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and + modification follow. Pay close attention to the difference between + a "work based on the library" and a "work that uses the library". + The former contains code derived from the library, whereas the + latter must be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other + program which contains a notice placed by the copyright holder or + other authorized party saying it may be distributed under the terms + of this Lesser General Public License (also called "this License"). + Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data + prepared so as to be conveniently linked with application programs + (which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work + which has been distributed under these terms. A "work based on the + Library" means either the Library or any derivative work under + copyright law: that is to say, a work containing the Library or a + portion of it, either verbatim or with modifications and/or + translated straightforwardly into another language. (Hereinafter, + translation is included without limitation in the term + "modification".) + + "Source code" for a work means the preferred form of the work for + making modifications to it. For a library, complete source code + means all the source code for all modules it contains, plus any + associated interface definition files, plus the scripts used to + control compilation and installation of the library. + + Activities other than copying, distribution and modification are not + covered by this License; they are outside its scope. The act of + running a program using the Library is not restricted, and output + from such a program is covered only if its contents constitute a + work based on the Library (independent of the use of the Library in + a tool for writing it). Whether that is true depends on what the + Library does and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's + complete source code as you receive it, in any medium, provided that + you conspicuously and appropriately publish on each copy an + appropriate copyright notice and disclaimer of warranty; keep intact + all the notices that refer to this License and to the absence of any + warranty; and distribute a copy of this License along with the + Library. + + You may charge a fee for the physical act of transferring a copy, + and you may at your option offer warranty protection in exchange for + a fee. + + 2. You may modify your copy or copies of the Library or any portion + of it, thus forming a work based on the Library, and copy and + distribute such modifications or work under the terms of Section 1 + above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function + or a table of data to be supplied by an application program + that uses the facility, other than as an argument passed when + the facility is invoked, then you must make a good faith effort + to ensure that, in the event an application does not supply + such function or table, the facility still operates, and + performs whatever part of its purpose remains meaningful. + + (For example, a function in a library to compute square roots + has a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function + must be optional: if the application does not supply it, the + square root function must still compute square roots.) + + These requirements apply to the modified work as a whole. If + identifiable sections of that work are not derived from the Library, + and can be reasonably considered independent and separate works in + themselves, then this License, and its terms, do not apply to those + sections when you distribute them as separate works. But when you + distribute the same sections as part of a whole which is a work + based on the Library, the distribution of the whole must be on the + terms of this License, whose permissions for other licensees extend + to the entire whole, and thus to each and every part regardless of + who wrote it. + + Thus, it is not the intent of this section to claim rights or + contest your rights to work written entirely by you; rather, the + intent is to exercise the right to control the distribution of + derivative or collective works based on the Library. + + In addition, mere aggregation of another work not based on the + Library with the Library (or with a work based on the Library) on a + volume of a storage or distribution medium does not bring the other + work under the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public + License instead of this License to a given copy of the Library. To + do this, you must alter all the notices that refer to this License, + so that they refer to the ordinary GNU General Public License, + version 2, instead of to this License. (If a newer version than + version 2 of the ordinary GNU General Public License has appeared, + then you can specify that version instead if you wish.) Do not make + any other change in these notices. + + Once this change is made in a given copy, it is irreversible for + that copy, so the ordinary GNU General Public License applies to all + subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of the + Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or + derivative of it, under Section 2) in object code or executable form + under the terms of Sections 1 and 2 above provided that you + accompany it with the complete corresponding machine-readable source + code, which must be distributed under the terms of Sections 1 and 2 + above on a medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy + from a designated place, then offering equivalent access to copy the + source code from the same place satisfies the requirement to + distribute the source code, even though third parties are not + compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the + Library, but is designed to work with the Library by being compiled + or linked with it, is called a "work that uses the Library". Such a + work, in isolation, is not a derivative work of the Library, and + therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library + creates an executable that is a derivative of the Library (because + it contains portions of the Library), rather than a "work that uses + the library". The executable is therefore covered by this License. + Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file + that is part of the Library, the object code for the work may be a + derivative work of the Library even though the source code is not. + Whether this is true is especially significant if the work can be + linked without the Library, or if the work is itself a library. The + threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data + structure layouts and accessors, and small macros and small inline + functions (ten lines or less in length), then the use of the object + file is unrestricted, regardless of whether it is legally a + derivative work. (Executables containing this object code plus + portions of the Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may + distribute the object code for the work under the terms of Section + 6. Any executables containing that work also fall under Section 6, + whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or + link a "work that uses the Library" with the Library to produce a + work containing portions of the Library, and distribute that work + under terms of your choice, provided that the terms permit + modification of the work for the customer's own use and reverse + engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the + Library is used in it and that the Library and its use are covered + by this License. You must supply a copy of this License. If the + work during execution displays copyright notices, you must include + the copyright notice for the Library among them, as well as a + reference directing the user to the copy of this License. Also, you + must do one of these things: + + a) Accompany the work with the complete corresponding machine- + readable source code for the Library including whatever changes + were used in the work (which must be distributed under Sections + 1 and 2 above); and, if the work is an executable linked with + the Library, with the complete machine-readable "work that uses + the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a + modified executable containing the modified Library. (It is + understood that the user who changes the contents of + definitions files in the Library will not necessarily be able + to recompile the application to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time + a copy of the library already present on the user's computer + system, rather than copying library functions into the + executable, and (2) will operate properly with a modified + version of the library, if the user installs one, as long as + the modified version is interface-compatible with the version + that the work was made with. + + c) Accompany the work with a written offer, valid for at least + three years, to give the same user the materials specified in + Subsection 6a, above, for a charge no more than the cost of + performing this distribution. + + d) If distribution of the work is made by offering access to + copy from a designated place, offer equivalent access to copy + the above specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the + Library" must include any data and utility programs needed for + reproducing the executable from it. However, as a special + exception, the materials to be distributed need not include anything + that is normally distributed (in either source or binary form) with + the major components (compiler, kernel, and so on) of the operating + system on which the executable runs, unless that component itself + accompanies the executable. + + It may happen that this requirement contradicts the license + restrictions of other proprietary libraries that do not normally + accompany the operating system. Such a contradiction means you + cannot use both them and the Library together in an executable that + you distribute. + + 7. You may place library facilities that are a work based on the + Library side-by-side in a single library together with other library + facilities not covered by this License, and distribute such a + combined library, provided that the separate distribution of the + work based on the Library and of the other library facilities is + otherwise permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same + work. + + 8. You may not copy, modify, sublicense, link with, or distribute + the Library except as expressly provided under this License. Any + attempt otherwise to copy, modify, sublicense, link with, or + distribute the Library is void, and will automatically terminate + your rights under this License. However, parties who have received + copies, or rights, from you under this License will not have their + licenses terminated so long as such parties remain in full + compliance. + + 9. You are not required to accept this License, since you have not + signed it. However, nothing else grants you permission to modify or + distribute the Library or its derivative works. These actions are + prohibited by law if you do not accept this License. Therefore, by + modifying or distributing the Library (or any work based on the + Library), you indicate your acceptance of this License to do so, and + all its terms and conditions for copying, distributing or modifying + the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the + Library), the recipient automatically receives a license from the + original licensor to copy, distribute, link with or modify the + Library subject to these terms and conditions. You may not impose + any further restrictions on the recipients' exercise of the rights + granted herein. You are not responsible for enforcing compliance by + third parties with this License. + + 11. If, as a consequence of a court judgment or allegation of patent + infringement or for any other reason (not limited to patent issues), + conditions are imposed on you (whether by court order, agreement or + otherwise) that contradict the conditions of this License, they do + not excuse you from the conditions of this License. If you cannot + distribute so as to satisfy simultaneously your obligations under + this License and any other pertinent obligations, then as a + consequence you may not distribute the Library at all. For example, + if a patent license would not permit royalty-free redistribution of + the Library by all those who receive copies directly or indirectly + through you, then the only way you could satisfy both it and this + License would be to refrain entirely from distribution of the + Library. + + If any portion of this section is held invalid or unenforceable + under any particular circumstance, the balance of the section is + intended to apply, and the section as a whole is intended to apply + in other circumstances. + + It is not the purpose of this section to induce you to infringe any + patents or other property right claims or to contest validity of any + such claims; this section has the sole purpose of protecting the + integrity of the free software distribution system which is + implemented by public license practices. Many people have made + generous contributions to the wide range of software distributed + through that system in reliance on consistent application of that + system; it is up to the author/donor to decide if he or she is + willing to distribute software through any other system and a + licensee cannot impose that choice. + + This section is intended to make thoroughly clear what is believed + to be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in + certain countries either by patents or by copyrighted interfaces, + the original copyright holder who places the Library under this + License may add an explicit geographical distribution limitation + excluding those countries, so that distribution is permitted only in + or among countries not thus excluded. In such case, this License + incorporates the limitation as if written in the body of this + License. + + 13. The Free Software Foundation may publish revised and/or new + versions of the Lesser General Public License from time to time. + Such new versions will be similar in spirit to the present version, + but may differ in detail to address new problems or concerns. + + Each version is given a distinguishing version number. If the + Library specifies a version number of this License which applies to + it and "any later version", you have the option of following the + terms and conditions either of that version or of any later version + published by the Free Software Foundation. If the Library does not + specify a license version number, you may choose any version ever + published by the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free + programs whose distribution conditions are incompatible with these, + write to the author to ask for permission. For software which is + copyrighted by the Free Software Foundation, write to the Free + Software Foundation; we sometimes make exceptions for this. Our + decision will be guided by the two goals of preserving the free + status of all derivatives of our free software and of promoting the + sharing and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO + WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. + EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR + OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY + KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, + THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND + PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE + DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR + CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN + WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY + AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU + FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR + CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE + LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING + RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A + FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF + SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF + SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest + possible use to the public, we recommend making it free software + that everyone can redistribute and change. You can do so by + permitting redistribution under these terms (or, alternatively, + under the terms of the ordinary General Public License). + + To apply these terms, attach the following notices to the library. + It is safest to attach them to the start of each source file to most + effectively convey the exclusion of warranty; and each file should + have at least the "copyright" line and a pointer to where the full + notice is found. + + + Copyright (C) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later + version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General + Public License along with this library; if not, write to the + Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + Boston, MA 02110-1301 USA + + Also add information on how to contact you by electronic and paper + mail. + + You should also get your employer (if you work as a programmer) or + your school, if any, to sign a "copyright disclaimer" for the + library, if necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James + Random Hacker. + + , 1 April 1990 + Ty Coon, President of Vice + + That's all there is to it! + + MIT License + These components fall under the MIT license: + + (C) 1995-2008 Lua.org, PUC-Rio + Lua: http://www.lua.org/ + + Permission is hereby granted, free of charge, to any person + obtaining a copy of this software and associated documentation files + (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, + publish, distribute, sublicense, and/or sell copies of the Software, + and to permit persons to whom the Software is furnished to do so, + subject to the following conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE. + + zlib-libpng + These components fall under the zlib-libpng license: + + (C) 1995-2010 Jean-loup Gailly and Mark Adler + zlib: http://www.zlib.net/ + + (C) 1998-2011 Glenn Randers-Pehrson + libpng: http://www.libpng.org/pub/png/libpng.html + + (C) 2003 Neil Carter + original image and sound resources: + http://www.nether.org.uk/bad_mac_code.html + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any + damages arising from the use of this software. + + Permission is granted to anyone to use this software for any + purpose, including commercial applications, and to alter it and + redistribute it freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you + must not claim that you wrote the original software. If you use + this software in a product, an acknowledgment in the product + documentation would be appreciated but is not required. + + 2. Altered source versions must be plainly marked as such, and + must not be misrepresented as being the original software. + + 3. This notice may not be removed or altered from any source + distribution. + + Uncategorized + Some components fall under some other license: + + (C) 2001-2004 Unicode, Inc. + ConvertUTF: http://www.unicode.org/Public/PROGRAMS/CVTUTF/ + + Disclaimer + + This source code is provided as is by Unicode, Inc. No claims are + made as to fitness for any particular purpose. No warranties of any + kind are expressed or implied. The recipient agrees to determine + applicability of information provided. If this file has been + purchased on magnetic or optical media from Unicode, Inc., the sole + remedy for any claim will be exchange of defective media within 90 + days of receipt. + + Limitations on Rights to Redistribute This Code + + Unicode, Inc. hereby grants the right to freely use the information + supplied in this file in the creation of products supporting the + Unicode Standard, and to make copies of this file in any form for + internal or external distribution as long as this notice remains + attached. + +SEE ALSO + yoink(6) + +AUTHORS + Charles McGarvey chaz@dogcows.com + +NetBSD 5.1.0_PATCH June 14, 2011 NetBSD 5.1.0_PATCH diff --git a/INSTALL b/INSTALL index a9438a1..b34de47 100644 --- a/INSTALL +++ b/INSTALL @@ -1,53 +1,157 @@ +YOINK_INSTALL(7) Miscellaneous Information Manual YOINK_INSTALL(7) -The quick and dirty instructions: +NAME + yoink_install -- building and installation instructions for yoink - ./configure - make && make install +DESCRIPTION + Yoink can usually be built and installed in the same way as most other + open source packages, using the following commands: + cd /path/to/yoink + ./configure + make && make install -The longer, more detailed instructions: + Yet, although the build system scripts and makefiles follow standard + conventions, they are themselves a little unconventional. Therefore, if + things go wrong, this reference may aid in diagnosing the problem. The + rest of this page is for those for whom the basic steps do not work or + for those who have specialized needs, like packagers. -1. Run ./configure --help to see how you can customize the installation. + CONFIGURATION + A configure script is provided in the package to help prepare the build + system to compile and install Yoink on your particular system. This + script supports many of the same options as your typical Autoconf- + generated script. Just use the script's --help flag to see which options + are available. - If this step fails, you probably don't have Lua installed. Lua is - required to configure the build system. It is also required by the - built product. + In particular, you may use the --prefix flag to set where Yoink will be + installed. The default directory prefix is /usr/local, which is a good + idea in most cases, as long as you have write permissions for that + directory. Otherwise, you might want to set the prefix to be some + directory within your home directory. -2. Run ./configure with whatever options you like. Use --prefix to set the - directory where Yoink will be installed. Use --datadir to set the - directory where the resource files will be installed. Use --host if you - want to cross-compile for another type of system--you will need a - working cross-compiler toolchain installed. Use CC and CXX to set the C - and C++ compiler commands, respectively. Use CFLAGS and LDFLAGS to - set the compiler and linker flags, respectively. + The script also supports the --host flag to allow for cross-compiling. + Use this flag to set the triplet of the machine architecture and system + software combination for the platform you want Yoink to run on. Of + course, you will need the appropriate toolchain installed. - If this step fails, make sure you have a working toolchain (including - compilers and archivers). Also make sure you have the required - libraries. You also need pkg-config and all the relevant ``pc'' files - for each library dependency. + If you have dialog installed, an alternative approach to configuration is + to use menuconfig, the interactive menu system built into the configure + script. To use this method, there exists a familiar make target to bring + up the menu dialogs: -3. Run make. If you have a multi-core or multi-processor system, you may - also want to use the -j option to perform compilations in parallel. See - make(1) for more information. + make menuconfig - If this step fails, you may need to change your configuration from step - 2 and try again. In particular, you may need to change the CFLAGS and - LDFLAGS, depending on whether it is the compiler that has a problem or - the linker. + This is the same as running the configure script with the --interactive + flag. This allows you to browse the various options and make changes to + the configuration before it is saved in preparation for building. -4. Run make run to run the program without installing. + Regardless of which way configure is run, it will perform various checks + and make sure the required dependencies are found. If all of the checks + pass, the configuration file is saved to config.mk, and the script will + terminate with an exit code of 0. If any checks fail, a non-zero exit + code will result. The configuration file, config.mk, can be edited + manually if desired. However, the configure script should be run again + afterward to make sure the changes didn't cause any errors, and the + script may choose to alter any part of the configuration. - If this step fails, either step 3 didn't actually complete successfully, - or there is a bug in the code that is revealed on your platform. You - may also need to modify LDFLAGS in step 2 and try again, making sure to - set the correct rpath so that the shared libraries will be found at - runtime. Note that the linker will be invoked through the compiler. + If any part of the configuration fails, make sure you have these basic + requirements fulfilled: -5. Run make install to copy the files into the installation directories you - have specified in step 2. You're done! + 1. You must have Lua installed. Much of the configure script is + written in Lua, and Yoink requires Lua as a dependency anyway. - If this step fails, you probably do not have correct filesystem - permissions to install to your chosen directory. Either do the install - with elevated privileges, or start at step 2 again and specify --prefix - with some directory that you have write access to, such as $HOME/usr. + 2. You must have a working toolchain installed. This usually means you + have gcc installed along with its C++ compiler components, libc and + binutils. + 3. You must have pkg-config installed, along with the required library + dependencies and ``pc'' files. Look for these packages with your + favorite package manager: + o boost headers + o libpng + o libvorbis + o Lua + o OpenAL + o OpenGL (including GLU) + o SDL + o zlib + + BUILDING + Once the build system has been properly configured, it is ready to do + some compiling. This is done simply with an invocation of GNU make, + perhaps like this: + + make -j2 + + Sometimes the command for GNU make is gmake, although it may also be + simply make. No other variety of make will work, and you need a fairly + recent version of GNU make since some older versions have fatal bugs. + The -j flag may be used to perform multiple build steps in parallel, + decreasing the amount of time the compile takes on multi-core machines. + See make(1) for more information. + + Advanced users may choose to override parts of the configuration with + additional arguments to make, although it is rarely useful to do so. + However, in the event that some error occurs during the process, it often + is useful to retry the make command with the V=1 argument (for verbosity) + in order to cause make to echo each actual command before it is executed. + Users who are familiar with compiler and linker warnings and errors will + then be able diagnose the problem, whether it be a problem with the + configuration or something else. + + TESTING + After the build process has successfully completed, Yoink should now be + able to run from within the build directory, as long as you're not cross- + compiling to an incompatible platform. To test this, there is a make + target to execute Yoink: + + make run + + If an error occurs and the rest of the build really did complete + successfully, the likely problem is that the dynamic libraries could not + be found. This may happen if the libraries are installed to a non- + standard location, and the linker wasn't given the appropriate -rpath + flag. This means that pkg-config failed to provide all of the flags we + need. The easiest thing to do in this situation is to reconfigure the + build system with the LDFLAGS=-Wl,-rpath=/path/to/lib option set and + retry the test (the executable will be rebuilt). + + INSTALLATION + Once testing is completed, it is time to copy the Yoink files to their + final destinations. As usual, there is a make target to handle the + installation: + + make install + + This will cause the files to be copied with the BSD-compatible install + program. Of course, you may need to elevate your privileges (i.e. with + sudo) if you are installing to a directory your user account does not + have write access to. + + The installation destination depends on prefix and other configuration + variables. You can override the configuration by passing the arguments + directly to make with the install target. The Makefile also supports + staging by using the DESTDIR variable passed to make. + + Any failure during installation is probably a result of simply not having + sufficient privileges. It will also be a problem if you do not have a + BSD-compatible version of install. In the case of the latter, it should + be a minor modification to the Makefile to get it working. The build + system is still not compatible in many regards. + +FILES + configure + config.h + config.mk + config.sed + Makefile + options.lua + +SEE ALSO + yoinkrc(5), yoink(6) + +AUTHORS + Charles McGarvey chaz@dogcows.com + +NetBSD 5.1.0_PATCH June 13, 2011 NetBSD 5.1.0_PATCH diff --git a/Makefile b/Makefile index 5809c57..e104a4e 100644 --- a/Makefile +++ b/Makefile @@ -1,125 +1,157 @@ # # Yoink -# Use this file with make to compile and install Yoink. +# Use this file with GNU make to compile and install Yoink. # -# This makefile supports these targets: -# all, install, clean, distclean, run, debug, dist, dist-gzip, dist-bzip2 -# -# This build system incorporates the ideas written by Emile van Bergen: -# http://www.xs4all.nl/~evbergen/nonrecursive-make.html -# - -# Set this to `true' to echo each build command in full. -verbose := false -# Set this to `false' to avoid installing manual pages. -install_man := true +# Set V to `1' to echo each build command in full. The default behavior +# will keep output minimal. +V = 0 +SHELL = /bin/sh -# -# Include the configuration file, config.mk. -# -SHELL := /bin/sh - -have_config := $(wildcard config.mk) -ifneq ($(strip $(have_config)),) -include config.mk +ifeq (menuconfig,$(MAKECMDGOALS)) +menuconfig: + ./configure --interactive +.PHONY: menuconfig else -$(error You must run the configure script before you can make anything) -endif +config.h: config.mk + $(Q)$(configure) --export-header=$@ -# -# Declare the default targets and implicit rules. -# +config.sed: config.mk + $(Q)$(configure) --export-terms=$@ -.PHONY: all -all: all_ +config.mk: + $(Q)$(configure) --interactive --print-instructions=no -.SUFFIXES: -.SUFFIXES: .a .c .cc .cpp .in .o .rc +include config.mk # # Define some useful functions. # -add_exe_suffix = $(addsuffix $(EXEEXT),$1) -remove_silencer = $(1:@%=%) +DATA_TARGETS := +EXEC_TARGETS := +SUBDIRS := + +define include_func = +ifeq (,$$d) +dir := $1 +else +dir := $$d/$1 +endif +sp := $$(sp).x +dirstack_$$(sp) := $$d +datstack_$$(sp) := $$(data) +exestack_$$(sp) := $$(exec) +d := $$(dir) +data := +exec := +include $$(dir)/rules.mk +SUBDIRS += $$d $$b +data := $$(sort $$(data) $$(appdir_$$b) $$(mandir_$$b) $$(pkgdatadir_$$b) $$(desktop_$$b)) +exec := $$(sort $$(exec) $$(bindir_$$b) $$(libdir_$$b)) +deps := $$(filter %.d,$$(exec:%.o=%.d)) +clean := $$(clean) $$(deps) $$(exec) $$(data) +DEPFILE := $$(DEPFILE) $$(deps) +DATA_TARGETS += $$(data) +EXEC_TARGETS += $$(exec) +d := $$(dirstack_$$(sp)) +data := $$(datstack_$$(sp)) +exec := $$(exestack_$$(sp)) +sp := $$(basename $$(sp)) +endef +include = $(foreach i,$1,$(eval $(call include_func,$i))) + +targets = $(EXEC_TARGETS) $(DATA_TARGETS) +builddir = build/obj +b = $(builddir)/$(d) +this = $(d)/rules.mk + +ifeq (gzip,$(manCompression)) +MANEXT=.gz +else +ifeq (bzip2,$(manCompression)) +MANEXT=.bz2 +endif +endif # # Include the subdirectories--order is not important. # -dir := src -include $(dir)/rules.mk - -dir := data -include $(dir)/rules.mk - -dir := doc -include $(dir)/rules.mk +$(call include,src data doc) +-include build/$(platform)/rules.mk # # Define some common rules. # -ifeq ($(DEP_TRACKING),true) -COMPILE = ./tools/compile.lua -endif - -ifeq ($(DEP_MINIMIZING),true) -LINK = ./tools/link.lua +ifeq (true,$(tracking)) +PKG_CFLAGS += -MD -MP -MF $(@:%.o=%.d) -MT $@ +-include $(DEPFILE) endif -INSTALL = ./tools/install.lua - -# Include current directory to allow sources to #include "config.h". -CFLAGS += -I. -CXXFLAGS += -I. - -COMMAND_CC = $(COMPILE) $(CC) $(CFLAGS) $(CF_TGT) -o $@ -c $< -COMMAND_CXX = $(COMPILE) $(CXX) $(CXXFLAGS) $(CF_TGT) -o $@ -c $< -COMMAND_LD = $(LINK) $(CC) $(LDFLAGS) $(LF_TGT) -o $@ $^ $(LL_TGT) $(LIBS) -COMMAND_LDX = $(LINK) $(CXX) $(LDFLAGS) $(LF_TGT) -o $@ $^ $(LL_TGT) $(LIBS) -COMMAND_CCLD = $(COMPILE) $(CC) $(CFLAGS) $(CF_TGT) $(LDFLAGS) $(LF_TGT) -o $@ $< $(LL_TGT) $(LIBS) -COMMAND_CXXLD = $(COMPILE) $(CXX) $(CXXFLAGS) $(CF_TGT) $(LDFLAGS) $(LF_TGT) -o $@ $< $(LL_TGT) $(LIBS) -COMMAND_AR = $(AR) rcs $@ $^; $(RANLIB) $@ -COMMAND_RC = $(WINDRES) -I. $(DF_TGT) -o $@ -i $< -COMMAND_INSTALL = $(INSTALL) -m $1 $2 $3/ -COMMAND_RM = rm -f $1 -COMMAND_IN = sed -f config.sed <"$1" >"$2" - -ifeq ($(verbose),true) -DO_CC = $(COMMAND_CC) -DO_CXX = $(COMMAND_CXX) -DO_LD = $(COMMAND_LD) -DO_LDX = $(COMMAND_LDX) -DO_CCLD = $(COMMAND_CCLD) -DO_CXXLD = $(COMMAND_CXXLD) -DO_AR = $(COMMAND_AR) -DO_RC = $(COMMAND_RC) -DO_INSTALL = $(COMMAND_INSTALL) -DO_RM = $(COMMAND_RM) -DO_IN = $(COMMAND_IN) -SHELL_LINE_PREFIX = +# Include current directory to allow sources to include config.h. +override CPPFLAGS += -I. +TGT_CXXFLAGS = $(TGT_CFLAGS) +ARFLAGS = rc +INSTALL = install + +tarname = $(TARNAME)-$(VERSION) + +cmd_compile_c = $(CC) $(PKG_CFLAGS) $(TGT_CFLAGS) $(CFLAGS) $(CPPFLAGS) \ + $(TARGET_ARCH) -c $(OUTPUT_OPTION) $< +cmd_compile_cc = $(CXX) $(PKG_CXXFLAGS) $(TGT_CXXFLAGS) $(CXXFLAGS) $(CPPFLAGS) \ + $(TARGET_ARCH) -c $(OUTPUT_OPTION) $< +cmd_link_c = $(CC) $(PKG_CFLAGS) $(TGT_CFLAGS) $(CFLAGS) $(CPPFLAGS) \ + $(PKG_LDFLAGS) $(TGT_LDFLAGS) $(LDFLAGS) \ + $(TARGET_ARCH) $^ $(LOADLIBES) $(PKG_LDLIBS) $(TGT_LDLIBS) $(LDLIBS) -o $@ +cmd_link_cc = $(CXX) $(PKG_CXXFLAGS) $(TGT_CXXFLAGS) $(CXXFLAGS) $(CPPFLAGS) \ + $(PKG_LDFLAGS) $(TGT_LDFLAGS) $(LDFLAGS) \ + $(TARGET_ARCH) $^ $(LOADLIBES) $(PKG_LDLIBS) $(TGT_LDLIBS) $(LDLIBS) -o $@ +cmd_ar = $(AR) $(ARFLAGS) $@ $^; $(RANLIB) $@ +cmd_compile_rc = $(WINDRES) $(CPPFLAGS) $(TARGET_ARCH) $(OUTPUT_OPTION) -i $< +cmd_sed = sed -f config.sed <$< >$@ +cmd_gzip = gzip -c $< >$@ +cmd_bzip2 = bzip2 -c $< >$@ +cmd_xxd = id=$(subst .,_,$(notdir $<)); \ + printf "\#include \nsize_t\tdata_%s_size = %d;\nchar\tdata_%s[] = {\n" \ + $$id $$(wc -c <$<) $$id >$@; \ + xxd -i <$< >>$@; \ + printf ", 0x00\n};\n" >>$@ +cmd_configure = ./configure +func_install = mkdir -p $(DESTDIR)$3 && $(INSTALL) -m $1 $2 $(DESTDIR)$3 +func_remove = rm -f $1 +func_dist = git archive HEAD --prefix='$(tarname)/' | $1 >"$(tarname).tar.$2" && \ + (md5 "$(tarname).tar.$2" 2>/dev/null || md5sum "$(tarname).tar.$2") + +compile_c = $(call func_print,CC,$@) $(cmd_compile_c) +compile_cc = $(call func_print,CXX,$@) $(cmd_compile_cc) +compile_rc = $(call func_print,RC,$@) $(cmd_compile_rc) +link_c = $(call func_print,LINK,$@) $(cmd_link_c) +link_cc = $(call func_print,LINK,$@) $(cmd_link_cc) +ar = $(call func_print,AR,$@) $(cmd_ar) +sed = $(call func_print,SED,$@) $(cmd_sed) +gzip = $(call func_print,GZIP,$@) $(cmd_gzip) +bzip2 = $(call func_print,BZIP2,$@) $(cmd_bzip2) +xxd = $(call func_print,XXD,$@) $(cmd_xxd) +configure = $(call func_print,MAKE,$@) $(cmd_configure) +dist = $(call func_print,DIST,$1) $(func_dist) +install = $(call func_print,CP,$(DESTDIR)$(3:%/=%)/$(notdir $2)) $(func_install) +remove = $(call func_print,RM,$1) $(func_remove) + +ifeq (1,$V) +Q = +func_print = else -DO_CC = @echo " CC $@"; $(COMMAND_CC) -DO_CXX = @echo " CXX $@"; $(COMMAND_CXX) -DO_LD = @echo " LINK $@"; $(COMMAND_LD) -DO_LDX = @echo " LINK $@"; $(COMMAND_LDX) -DO_CCLD = @echo " LINK $@"; $(COMMAND_CCLD) -DO_CXXLD = @echo " LINK $@"; $(COMMAND_CXXLD) -DO_AR = @echo " AR $@"; $(COMMAND_AR) -DO_RC = @echo " RC $@"; $(COMMAND_RC) -DO_INSTALL = @echo " CP $2"; $(COMMAND_INSTALL) -DO_RM = @echo " RM $1"; $(COMMAND_RM) -DO_IN = @echo " GEN $2"; $(COMMAND_IN) -SHELL_LINE_PREFIX = @ +Q = @ +func_print = printf "\x20\x20$1\t%s\n" $2; endif @@ -127,96 +159,98 @@ endif # Define the implicit rules. # -%.o: %.c - $(DO_CC) %.o: %.cc - $(DO_CXX) + $(Q)$(compile_cc) %.o: %.cpp - $(DO_CXX) + $(Q)$(compile_cc) +%.o: %.c + $(Q)$(compile_c) %.o: %.rc - $(DO_RC) -%$(EXEEXT): %.o - $(DO_LD) -%$(EXEEXT): %.c - $(DO_CCLD) -%$(EXEEXT): %.cc - $(DO_CXXLD) -%$(EXEEXT): %.cpp - $(DO_CXXLD) -%.a: %.o - $(DO_AR) -%: %.in config.sed - $(call DO_IN,$<,$@) + $(Q)$(compile_rc) +%: %.in + $(Q)$(sed) +%.gz: % + $(Q)$(gzip) +%.bz2: % + $(Q)$(bzip2) + +$(builddir)/%.o: %.cc + $(Q)$(compile_cc) +$(builddir)/%.o: %.cpp + $(Q)$(compile_cc) +$(builddir)/%.o: %.c + $(Q)$(compile_c) +$(builddir)/%.o: %.rc + $(Q)$(compile_rc) +$(builddir)/%: %.in + $(Q)$(sed) +$(builddir)/%.gz: % + $(Q)$(gzip) +$(builddir)/%.bz2: % + $(Q)$(bzip2) +$(builddir)/%: % + $(Q)if [ -d $< ]; then mkdir -p $@; elif [ -f $< ]; then cp -f $< $@; fi # # Define the phony targets. # -.PHONY: clean +.DEFAULT_GOAL := +all: $(targets) + clean: - $(SHELL_LINE_PREFIX)files='$(CLEAN)'; for file in $$files; \ - do \ - $(call remove_silencer,$(call DO_RM,$$file)); \ - done + $(Q)$(foreach f,$(clean),$(call remove,$f);) + $(Q)if [ -d $(builddir) ]; then find $(builddir) -type d -empty -delete; fi -.PHONY: distclean distclean: clean - $(call DO_RM,config.h) - $(call DO_RM,config.mk) - $(call DO_RM,config.sed) - -.PHONY: all_ -all_: $(BINARIES) $(MANPAGES) - -.PHONY: install -install: all - $(SHELL_LINE_PREFIX)files='$(DATAFILES)'; for file in $$files; \ - do \ - full=`echo "$$file" | cut -d\; -f1`; \ - base=`echo "$$file" | cut -d\; -f2`; \ - $(call remove_silencer,$(call DO_INSTALL,644,$$full,$(DESTDIR)$(datadir)$$base)); \ - done - $(SHELL_LINE_PREFIX)files='$(BINARIES)'; for file in $$files; \ - do \ - $(call remove_silencer,$(call DO_INSTALL,755,$$file,$(DESTDIR)$(bindir))); \ - done -ifeq ($(install_man),true) - $(SHELL_LINE_PREFIX)files='$(MANPAGES)'; for file in $$files; \ - do \ - $(call remove_silencer,$(call DO_INSTALL,644,$$file,$(DESTDIR)$(mandir))); \ - done -endif + $(Q)cd build && $(MAKE) clean + $(Q)$(call remove,config.h);$(call remove,config.mk);$(call remove,config.sed) + + +install: install-data install-exec + +install-data: $(DATA_TARGETS) + $(Q)$(foreach d,$(SUBDIRS),$(foreach f,$(pkgdatadir_$d),\ + $(call install,644,$f,$(dir $(f:$d%=$(pkgdatadir)%)));)) + $(Q)$(foreach d,$(SUBDIRS),$(foreach f,$(mandir_$d),\ + $(call install,644,$f,$(dir $(f:$d%=$(mandir)/man$(shell echo "$f" | sed 's/[^.]*\.\([^.]*\).*/\1/')%)));)) + +install-exec: $(EXEC_TARGETS) + $(Q)$(foreach d,$(SUBDIRS),$(foreach f,$(bindir_$d),\ + $(call install,755,$f,$(dir $(f:$d%=$(bindir)%)));)) + +install-desktop-entry: $(DATA_TARGETS) + $(Q)$(foreach d,$(SUBDIRS),$(foreach f,$(desktop_$d),\ + $(call install,644,$f,/usr/share/applications);)) + + +dist-all: dist-bzip2 dist-gzip dist-lzma dist-xz -.PHONY: uninstall -uninstall: - $(SHELL_LINE_PREFIX)files='$(BINARIES)'; for file in $$files; \ - do \ - base="/`basename $$file`"; \ - $(call remove_silencer,$(call DO_RM,$(DESTDIR)$(bindir)$$base)); \ - done - $(SHELL_LINE_PREFIX)files='$(DATAFILES)'; for file in $$files; \ - do \ - full="`echo "$$file" | cut -d\; -f1`"; \ - base="`echo "$$file" | cut -d\; -f2`/`basename $$full`"; \ - $(call remove_silencer,$(call DO_RM,$(DESTDIR)$(datadir)$$base)); \ - done - -.PHONY: dist-bzip2 dist-bzip2: - $(SHELL_LINE_PREFIX)git archive HEAD --prefix='$(TARNAME)/' | bzip2 > "$(TARNAME).tar.bz2" + $(Q)$(call dist,bzip2,bz2) -.PHONY: dist-gzip dist-gzip: - $(SHELL_LINE_PREFIX)git archive HEAD --prefix='$(TARNAME)/' | gzip > "$(TARNAME).tar.gz" + $(Q)$(call dist,gzip,gz) -.PHONY: dist -dist: dist-bzip2 +dist-lzma: + $(Q)$(call dist,lzma,lzma) + +dist-xz: + $(Q)$(call dist,xz,xz) + +dist: dist-$(archiveFormat) # # Prevent make from removing any build targets. # -.SECONDARY: $(CLEAN) +.SECONDARY: $(clean) + +.PHONY: all clean distclean install install-data install-exec +.PHONY: install-desktop-entry +.PHONY: dist dist-all dist-gzip dist-bzip2 dist-xz dist-lzma + +endif # menuconfig diff --git a/README b/README index c834a3d..0cab8cc 100644 --- a/README +++ b/README @@ -1,139 +1,100 @@ +YOINK_README(7) Miscellaneous Information Manual YOINK_README(7) -Yoink - The alien-smashing action game -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +NAME + yoink_readme -- general information about yoink -Contents: +DESCRIPTION + Yoink is a game created by Neil Carter for Mac OS. You play the part of + a flying alien heroine who must defend her home on Earth from other + airborne alien invaders. -I. Users - a) General information - b) Requirements - c) Installing - d) License -II. Developers and Packagers - a) Notes regarding the code - b) Packaging - c) Sending patches + This version of the game uses all new code and modern frameworks to bring + this simple, fast-moving action game to a wider audience. + INSTALLATION + Installing Yoink is simple. You can typically use commands such as + these: -I. Users -======== + cd /path/to/yoink + ./configure + make && make install -a) General information ----------------------- + This will install Yoink into the /usr/local directory. To run Yoink, + issue the command: -Yoink is a game created by Neil Carter for Mac OS. You play the part of a -flying alien heroine who must defend her home on Earth from other airborne -alien invaders. + /usr/local/bin/yoink -This version of the game uses all new code and modern frameworks to bring -this simple, fast-moving action game to a wider audience. + or just yoink if /usr/local/bin is already in your PATH. See + yoink_install(7) for a more detailed discussion about the build system + and a list of required packages. -b) Requirements ---------------- + LICENSE + The new code is released under the 2-clause BSD license. The old code + and original resources are provided under the zlib/libpng License. See + the COPYING file for complete details. The full texts of applicable + licenses can be found in doc/licenses within the Yoink package. -boost headers -libpng -libvorbis -Lua -OpenAL -OpenGL (including GLU) -pkg-config -SDL + ABOUT THE CODE + The code is a complete rewrite, containing none of the original code. + I've made some effort to put the more generic or reusable code into a + separate library called libmoof. I've also made an effort to incorporate + 3rd-party code that happened to fit well into what I needed. So, + generally, the source code is separated into these three categories: -c) Installing -------------- + 1. Yoink-specific code. This is the code in the src directory. These + classes reside in no explicit namespace. -To build and install Yoink yourself, you should first make sure you have -all the required libraries. Then, issue these commands at a command-line -prompt: + 2. Reusable code. The code is in src/moof, and it is compiled as a + convenience library. These classes and helper functions reside in + the moof namespace. Since I wrote this code alongside the Yoink- + specific stuff, there is somewhat of a blurry line between the two + categories, unfortunately. - cd /path/to/project - ./configure - make && make install + 3. Third-party code. This is made up of free code from other projects + or libraries, the licenses of which are also noted in the COPYING + file. This code resides in various namespaces and in various + subdirectories of src. -where /path/to/project is the path to the directory where this file is. + PACKAGING + Here are some tips to help packagers: -That will compile and install Yoink into the /usr/local directory. To run -Yoink, issue this command: + o The build scripts are written in Lua, so make sure the Lua + interpreter is installed. That shouldn't be a problem since Yoink + depends on the Lua library anyway. - /usr/local/bin/yoink + o The Makefile will only work well with GNU make. On some systems, + this is installed as gmake. -or just ``yoink'' if /usr/loca/bin is already in your PATH. You can also -install Yoink to a different directory or change a lot of build options -using the configure script. See ./configure --help and the file INSTALL -for details. + o The configure script supports most of the useful options that an + Autoconf-generated script would have, and the Makefile supports + DESTDIR. -d) License ----------- + See yoink_install(7) for a more detailed discussion about the build + system. -The new code is released under the 2-clause BSD license. The old code and -original resources are provided under the zlib/libpng License. See file -COPYING for complete details. The full texts of applicable licenses can be -found in doc/licenses. + SENDING PATCHES + I'll gladly entertain patches if you want to help out. Just email me + your stuff or tell me where to pull if you use git. If you're interested + in that, please observe the following: + o Stick to the coding style of the source code files you edit. Follow + the general style of method and variable naming, as well as white + space formatting. In particular, use literal tabs with an assumed + tabstop of 4 characters. Also, try to limit line lengths to 75 + characters. -II. Developers and Packagers -============================ + o For legal reasons, don't include other peoples' code with your patch. + You must also agree to license your changes according to the same + terms and conditions as the files you edit, usually the 2-clause BSD + license. -a) Notes regarding the code ---------------------------- + o If you want your name and contact information in the AUTHORS file, + please make it so in the patch you provide. -The code is a complete rewrite, containing none of the original code. I've -made some effort to put the more generic or reusable code into a separate -library called libmoof. I've also made an effort to incorporate 3rd-party -code that happened to fit well into what I needed. So, generally, the -source code is separated into these three categories: +SEE ALSO + yoinkrc(5), yoink(6) -1. Yoink-specific code. - -This is the code in the directory src. These classes reside in no explicit -namespace. - -2. Reusable code. - -The code is in src/moof, and it is compiled as a convenience library. -These classes and helper functions reside in the moof namespace. Since I -wrote this code alongside the Yoink-specific stuff, there is somewhat of a -blurry line between the two categories, unfortunately. - -3. Third-party code. - -This is made up of free code from other projects or libraries (aside from -the explicit dependencies above), the licenses of which are also noted in -the file COPYING. This code resides in various namespaces and in various -subdirectories of src. - -b) Packaging ------------- - -Here are some tips to help packagers: - -* The build scripts are written in Lua, so make sure the Lua interpreter - is installed. That shouldn't be a problem since Yoink depends on the - Lua library anyway. - -* The makefile will probably only work well with GNU make. On some - systems, this is installed as gmake. - -* The configure script supports most of the useful options that an - autoconf-generated script would have, and the makefile supports DESTDIR. - -c) Sending patches ------------------- - -I'll gladly entertain patches if you want to help out. Just email me your -stuff or tell me where to pull if you use git. If you're interested in -that, please observe the following: - -* Stick to the coding style of the source code files you edit. Follow the - general style of method and variable naming, as well as white space - formatting. In particular, use literal tabs with an assumed tabstop of - 4 characters. Also, try to limit line lengths to 75 characters. - -* For legal reasons, don't include other peoples' code with your patch. - You must also agree to license your changes according to the same terms - and conditions as the files you edit, usually the 2-clause BSD license. - -* If you want your name and contact information in the file AUTHORS, - please make it so in the patch you provide. +AUTHORS + Charles McGarvey chaz@dogcows.com +NetBSD 5.1.0_PATCH June 14, 2011 NetBSD 5.1.0_PATCH diff --git a/arch/macosx/bundle.tar.bz2 b/arch/macosx/bundle.tar.bz2 deleted file mode 100644 index 46446ab..0000000 Binary files a/arch/macosx/bundle.tar.bz2 and /dev/null differ diff --git a/arch/macosx/mkbundle.sh.in b/arch/macosx/mkbundle.sh.in deleted file mode 100644 index c71ac8c..0000000 --- a/arch/macosx/mkbundle.sh.in +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/sh - -# -# Yoink -# Run this script to create a macosx app bundle. -# - -# Anchor paths -ROOT_DIR="$PWD/.." - -# Extract the bundle skeleton -tar xjf bundle.tar.bz2 - -sed -i -e 's/\@VERSION\@/@VERSION@/g' Yoink.app/Contents/Info.plist - -# Prepare the binary -${STRIP:-strip} "$ROOT_DIR/src/yoink" -cp "$ROOT_DIR/src/yoink" Yoink.app/Contents/MacOS - -cp -r "$ROOT_DIR/data" Yoink.app/Contents/Resources/data - diff --git a/arch/win32/makedeps.sh b/arch/win32/makedeps.sh deleted file mode 100755 index cc8a8bf..0000000 --- a/arch/win32/makedeps.sh +++ /dev/null @@ -1,366 +0,0 @@ -#!/bin/sh - -# -# Yoink -# Run this script to download and cross-compile dependencies for win32. -# -# A directory named deps will be created and/or populated in the current -# directory. Upon successful completion (be patient), the compiled -# dependencies will be packaged into an archive named deps.tar.bz2 in the -# current directory. To install the dependencies, execute this command: -# -# tar xjf deps.tar.bz2 -C $PREFIX -# -# where $PREFIX is the path to your mingw32 toolchain. If problems occur, -# check stdout and stderr for clues. You may be able to easily determine -# the problem and make the necessary corrections. These packages will be -# downloaded and built: -# -# SDL 1.2.14 -# boost 1.43.0 (headers only) -# libogg 1.2.0 -# libpng 1.4.2 -# libvorbis 1.3.1 -# lua 5.1.4 -# openal-soft 1.12.854 -# zlib 1.2.5 -# -# This script requires a working mingw32 toolchain and other basic tools. -# -# Example usage: -# ./makedeps.sh -H i486-mingw32 -p /usr/i486-mingw32 -m "-j8" -# -# Bugs: Each time the script is run, all of the dependencies will be -# rebuilt, even the ones which were already built successfully. -# - -showhelp() -{ - echo "Usage: $0 [-h] [-m makeopts] -H host -p prefix" - echo " Downloads and cross-compiles dependencies for win32." - echo "" - echo " -H Specify the name of your toolchain, like i486-mingw32." - echo " -h Show this help an exit." - echo " -m Specify options to be passed to make." - echo " -p Specify the path to your toolchain installation." -} - -while getopts ":H:hm:p:" opt -do - case $opt in - H) - HOST="$OPTARG" - ;; - h) - showhelp - exit 0 - ;; - m) - MAKEOPTS="$OPTARG" - ;; - p) - PREFIX="$OPTARG" - ;; - \?) - echo "Invalid option: -$OPTARG" >&2 - showhelp - exit 1 - ;; - esac -done - -if test x$HOST = x || test x$PREFIX = x -then - showhelp - exit 1 -fi - - -die() -{ - echo "die:" $@ - exit 1 -} - -DESTDIR="`pwd`/deps" -mkdir -p "$DESTDIR" -rm -f "$DESTDIR/README" -rm -rf "$DESTDIR/$PREFIX" - - -PACKAGE="boost_1_43_0" -VERSION="1.43.0" -cd $DESTDIR -test ! -f $PACKAGE.tar.bz2 && (wget "http://sourceforge.net/projects/boost/files/boost/$VERSION/$PACKAGE.tar.bz2/download" || die "downloading $PACKAGE") -(md5sum -c <<"EOL" -dd49767bfb726b0c774f7db0cef91ed1 boost_1_43_0.tar.bz2 -EOL -) || die "verifying $PACKAGE" -rm -rf $PACKAGE -tar xjf $PACKAGE.tar.bz2 || die "unpackaging $PACKAGE" -(mkdir -p $DESTDIR/$PREFIX/include && \ -rm -rf $DESTDIR/$PREFIX/include/boost && \ -cp -r $PACKAGE/boost $DESTDIR/$PREFIX/include/boost) || die "installing $PACKAGE" - - -PACKAGE="SDL-1.2.14" -cd $DESTDIR -test ! -f $PACKAGE.tar.gz && (wget "http://www.libsdl.org/release/$PACKAGE.tar.gz" || die "downloading $PACKAGE") -(md5sum -c <<"EOL" -e52086d1b508fa0b76c52ee30b55bec4 SDL-1.2.14.tar.gz -EOL -) || die "verifying $PACKAGE" -rm -rf $PACKAGE -tar xzf $PACKAGE.tar.gz || die "unpackaging $PACKAGE" -cd $PACKAGE -./configure --host=$HOST --prefix=$PREFIX --disable-stdio-redirect || die "configuring $PACKAGE" -make $MAKEOPTS || die "making $PACKAGE" -make DESTDIR=$DESTDIR install || die "installing $PACKAGE" - - -PACKAGE="libogg-1.2.0" -cd $DESTDIR -test ! -f $PACKAGE.tar.gz && (wget "http://downloads.xiph.org/releases/ogg/$PACKAGE.tar.gz" || die "downloading $PACKAGE") -(md5sum -c <<"EOL" -c95b73759acfc30712beef6ce4e88efa libogg-1.2.0.tar.gz -EOL -) || die "verifying $PACKAGE" -rm -rf $PACKAGE -tar xzf $PACKAGE.tar.gz || die "unpackaging $PACKAGE" -cd $PACKAGE -./configure --host=$HOST --prefix=$PREFIX || die "configuring $PACKAGE" -make $MAKEOPTS || die "making $PACKAGE" -make DESTDIR=$DESTDIR install || die "installing $PACKAGE" - - -PACKAGE="libvorbis-1.3.1" -cd $DESTDIR -test ! -f $PACKAGE.tar.gz && (wget "http://downloads.xiph.org/releases/vorbis/$PACKAGE.tar.gz" || die "downloading $PACKAGE") -(md5sum -c <<"EOL" -016e523fac70bdd786258a9d15fd36e9 libvorbis-1.3.1.tar.gz -EOL -) || die "verifying $PACKAGE" -rm -rf $PACKAGE -tar xzf $PACKAGE.tar.gz || die "unpackaging $PACKAGE" -cd $PACKAGE -./configure --host=$HOST --prefix=$PREFIX \ -CPPFLAGS="-I$DESTDIR/$PREFIX/include" \ -LDFLAGS="-L$DESTDIR/$PREFIX/lib" || die "configuring $PACKAGE" -make $MAKEOPTS || die "making $PACKAGE" -make DESTDIR=$DESTDIR install || die "installing $PACKAGE" - - -PACKAGE="openal-soft-1.12.854-bin" -cd $DESTDIR -test ! -f $PACKAGE.zip && (wget "http://kcat.strangesoft.net/$PACKAGE.zip" || die "downloading $PACKAGE") -(md5sum -c <<"EOL" -a0d92a959895fa9d0981b39089897a01 openal-soft-1.12.854-bin.zip -EOL -) || die "verifying $PACKAGE" -rm -rf $PACKAGE -unzip $PACKAGE.zip || die "unpackaging $PACKAGE" -cd $PACKAGE -(mkdir -p $DESTDIR/$PREFIX/{lib/pkgconfig,include/AL} && \ -install -p -m 0644 include/AL/* $DESTDIR/$PREFIX/include/AL/ && \ -install -p -m 0755 Win32/soft_oal.dll $DESTDIR/$PREFIX/bin/OpenAL32.dll && \ -install -p -m 0755 openal-info.exe $DESTDIR/$PREFIX/bin/ && \ -install -p -m 0755 lib/Win32/libOpenAL32.dll.a $DESTDIR/$PREFIX/lib/ && \ -cat >$DESTDIR/$PREFIX/lib/pkgconfig/openal.pc <$DESTDIR/$PREFIX/lib/pkgconfig/gl.pc <$DESTDIR/$PREFIX/lib/pkgconfig/glu.pc <README <&2 - showhelp - exit 1 - ;; - esac -done - -if test "x$ASSETS" = x || test "x$VERSION" = x || test "x$PREFIX" = x -then - showhelp - exit 1 -fi - -die() -{ - rm -rf "$BUILD" - echo "die:" $@ - exit 1 -} - -ROOT="$PWD" -BUILD=`mktemp -d "$ROOT/tmp-XXXXXXXX"` -DIRECTORY="yoink-$VERSION" -ARCHIVE="$BUILD/$DIRECTORY" - -MAN2HTML="lua $ROOT/doc/man2html.lua" -UNIX2DOS="$ROOT/arch/win32/unix2dos.sh" - -DLLS="libogg-0 libpng14 libvorbis-0 libvorbisfile-3 lua51 OpenAL32 SDL zlib1" - - -if test ! -f "src/version.c" -then - echo "Run the script from the repository root directory." - exit 1 -fi - -if test ! -d "$BUILD" -then - "The temp directory $BUILD could not be created." - exit 1 -fi -mkdir -p "$ARCHIVE" - - -cp -f "$ROOT/src/yoink.exe" "$ARCHIVE" || die "copying yoink.exe" -test "x$STRIP" != x && "$STRIP" "$ARCHIVE/yoink.exe" - -for dll in $DLLS -do - cp -f "$PREFIX/bin/$dll.dll" "$ARCHIVE" || die "copying $dll" - test "x$STRIP" != x && "$STRIP" "$ARCHIVE/$dll.dll" -done - -for asset in $ASSETS -do - cp -f --parents "data/$asset" "$ARCHIVE" -done - -for doc in AUTHORS ChangeLog COPYING README TODO -do - "$UNIX2DOS" "$doc" "$ARCHIVE/$doc.txt" || die "unix2dos $doc" -done - -$MAN2HTML -o "$ARCHIVE/Manual.html" -$UNIX2DOS "$ARCHIVE/Manual.html" - -cp -rf "$ROOT/doc/licenses" "$ARCHIVE" || die "copying doc/licenses" -cd "$ARCHIVE/licenses" -for license in $(ls) -do - (mv "$license" "$license.txt" && "$UNIX2DOS" "$license.txt") \ - || die "moving and unix2dos $license" -done -cd "$ROOT" - - -if test "x$MAKENSIS" = x -then -# build portable archive - echo "No valid makensis executable passed;" - echo "making portable package instead..." - NAME="$DIRECTORY.zip" - cd "$BUILD" - zip -r "$NAME" "$DIRECTORY" || die "zipping portable archive" - cd "$ROOT" - mv "$BUILD/$NAME" . - echo "Done! Package saved to $NAME." -else -# build an installer - NAME="yoinksetup-$VERSION.exe" - cd "$BUILD" - cp "$ROOT/arch/win32/yoink.nsi" . - "$MAKENSIS" -DROOTPATH="$ROOT" -DINSTALLFILES="$ARCHIVE" \ - -DVERSION="$VERSION" -DOUTFILE="$NAME" yoink.nsi \ - || die "running '$MAKENSIS'" - cd "$ROOT" - mv "$BUILD/$NAME" . - echo "Done! Installer saved to $NAME." -fi - - -rm -rf "$BUILD" - diff --git a/arch/archlinux/PKGBUILD b/build/arch/archlinux/PKGBUILD similarity index 81% rename from arch/archlinux/PKGBUILD rename to build/arch/archlinux/PKGBUILD index 9d174c2..721eb00 100644 --- a/arch/archlinux/PKGBUILD +++ b/build/arch/archlinux/PKGBUILD @@ -16,14 +16,14 @@ replaces=() backup=() options=() install= -source=(http://www.dogcows.com/yoink/chrome/site/$pkgname-$pkgver.tar.bz2) +source=(ftp://www.dogcows.com/pub/$pkgname/$pkgname-$pkgver.tar.xz) noextract=() md5sums=('@CHECKSUM@') build() { cd "$srcdir/$pkgname-$pkgver" - ./configure --prefix=/usr + ./configure --prefix=/usr --with-man-compression=gzip make || return 1 make DESTDIR="$pkgdir/" install } diff --git a/arch/gentoo/yoink.ebuild b/build/arch/gentoo/yoink.ebuild similarity index 62% rename from arch/gentoo/yoink.ebuild rename to build/arch/gentoo/yoink.ebuild index 6e167d0..b27524e 100644 --- a/arch/gentoo/yoink.ebuild +++ b/build/arch/gentoo/yoink.ebuild @@ -2,18 +2,16 @@ # Distributed under the terms of the GNU General Public License v2 # $Header: $ -EAPI=2 - +EAPI=3 inherit eutils games DESCRIPTION="Alien-smashing action game" -HOMEPAGE="http://www.dogcows.com/yoink/" -SRC_URI="http://www.dogcows.com/yoink/chrome/site/${P}.tar.bz2 - http://eng.utah.edu/~mcgarvey/yoink/${P}.tar.bz2" +HOMEPAGE="http://www.dogcows.com/yoink" +SRC_URI="ftp://ftp.dogcows.com/yoink/${P}.tar.bz2" LICENSE="BSD-2 BSD LGPL-2.1 ZLIB" SLOT="0" -KEYWORDS="amd64 x86" +KEYWORDS="amd64 ~ppc x86" IUSE="debug double-precision gtk hotload qt4 threads" RDEPEND="dev-lang/lua @@ -30,8 +28,9 @@ DEPEND="${RDEPEND} dev-util/pkgconfig" src_configure() { - egamesconf \ - --disable-dependency-tracking \ + egamesconf --disable-dependency-tracking \ + --install-icon=no \ + --print-instructions=no \ $(use_enable debug) \ $(use_enable double-precision) \ $(use_enable hotload) \ @@ -41,10 +40,9 @@ src_configure() { } src_install() { - emake DESTDIR="${D}" install_man=no install || die "emake failed" - dodoc AUTHORS COPYING README TODO - doman doc/yoink.6 - doicon data/yoink.png - make_desktop_entry ${PN} Yoink + emake DESTDIR="${D}" install || die "Install failed" + dodoc AUTHORS COPYING README TODO || die "Install docs failed" + doicon data/yoink.png || die "Install icon failed" + make_desktop_entry yoink Yoink || die "Install destop entry failed" prepgamesdirs } diff --git a/build/arch/win32/makedeps.mk b/build/arch/win32/makedeps.mk new file mode 100644 index 0000000..fbdbecd --- /dev/null +++ b/build/arch/win32/makedeps.mk @@ -0,0 +1,334 @@ +# +# Yoink +# Use this with make to download and cross-compile dependencies for win32. +# +# boost_1_46_1 +# libogg-1.2.2 +# libpng-1.5.2 +# libvorbis-1.3.2 +# lua-5.1.4 +# openal-soft-1.12.854-bin +# SDL-1.2.14 +# zlib-1.2.5 +# +# This requires GNU make, curl, openssl, tar, unzip, patch, and a working +# mingw32 toolchain. Just set host and prefix and away you go! +# +# Example usage: +# make -f deps.mk -j2 host=i486-mingw32 prefix=/usr/i486-mingw32 +# sudo make install +# +# A lot of temporary files and directories are downloaded or extracted to +# the current directory, so you may want to make from a clean directory. +# + + +host = i686-mingw32 +prefix = /usr/i686-mingw32/usr + + +########################################################################### +ECONF = ./configure --host=$(host) --prefix=$(prefix) +MAKEINST = $(MAKE) -j1 install + +getdist = curl -L -o $1 "$2" +checkdist = test "MD5($1)= $2" = "$$(openssl md5 $1)" +patch = echo "$$$1" | patch -p1 +mkdirinst = mkdir -p $(addprefix $(DESTDIR)$(prefix)/,$1) +installdir = cp -pR $1 $(DESTDIR)$(prefix)/$2 +install = install -p -m $1 $2 $(DESTDIR)$(prefix)/$3 +installvar = echo "$$$1" >$(DESTDIR)$(prefix)/$2 + + +.PHONY: all +all: __package__ + +ifneq ($(strip $(wildcard .saved)),) +host = $(shell sed -n 1p .saved) +prefix = $(shell sed -n 2p .saved) +endif + + +########################################################################### +BOOST = boost_1_46_1 +BOOST_CKSUM = 7375679575f4c8db605d426fc721d506 +BOOST_EXT = .tar.bz2 +BOOST_VERSION = 1.46.1 + +$(BOOST)$(BOOST_EXT): + $(call getdist,$@,http://sourceforge.net/projects/boost/files/boost/$(BOOST_VERSION)/$@/download) + $(call checkdist,$@,$(BOOST_CKSUM)) || rm -f $@ + +.PHONY: $(BOOST) install-$(BOOST) +$(BOOST): $(BOOST)$(BOOST_EXT) + +install-$(BOOST): $(BOOST)$(BOOST_EXT) + tar -xjf $< + $(call mkdirinst,include) + $(call installdir,$(BOOST)/boost,include/boost) + + +########################################################################### +SDL = SDL-1.2.14 +SDL_CKSUM = e52086d1b508fa0b76c52ee30b55bec4 +SDL_EXT = .tar.gz + +$(SDL)$(SDL_EXT): + $(call getdist,$@,http://www.libsdl.org/release/$@) + $(call checkdist,$@,$(SDL_CKSUM)) || rm -f $@ + +$(SDL)/build/.libs/SDL.dll: $(SDL)$(SDL_EXT) + tar -xzf $< + cd $(SDL) && $(ECONF) --disable-stdio-redirect && $(MAKE) + +.PHONY: $(SDL) install-$(SDL) +$(SDL): $(SDL)/build/.libs/SDL.dll + +install-$(SDL): $(SDL) + cd $(SDL) && $(MAKEINST) + + +########################################################################### +LIBOGG = libogg-1.2.2 +LIBOGG_CKSUM = 5a9fcabc9a1b7c6f1cd75ddc78f36c56 +LIBOGG_EXT = .tar.gz + +$(LIBOGG)$(LIBOGG_EXT): + $(call getdist,$@,http://downloads.xiph.org/releases/ogg/$@) + $(call checkdist,$@,$(LIBOGG_CKSUM)) || rm -f $@ + +$(LIBOGG)/src/.libs/libogg-0.dll: $(LIBOGG)$(LIBOGG_EXT) + tar -xzf $< + cd $(LIBOGG) && $(ECONF) && $(MAKE) && $(MAKEINST) DESTDIR=$$PWD + +.PHONY: $(LIBOGG) install-$(LIBOGG) +$(LIBOGG): $(LIBOGG)/src/.libs/libogg-0.dll + +install-$(LIBOGG): $(LIBOGG) + cd $(LIBOGG) && $(MAKEINST) + + +########################################################################### +LIBVORBIS = libvorbis-1.3.2 +LIBVORBIS_CKSUM = c870b9bd5858a0ecb5275c14486d9554 +LIBVORBIS_EXT = .tar.gz + +$(LIBVORBIS)$(LIBVORBIS_EXT): + $(call getdist,$@,http://downloads.xiph.org/releases/vorbis/$@) + $(call checkdist,$@,$(LIBVORBIS_CKSUM)) || rm -f $@ + +$(LIBVORBIS)/lib/.libs/libvorbis-0.dll: $(LIBVORBIS)$(LIBVORBIS_EXT) + tar -xzf $< + cd $(LIBVORBIS) && $(ECONF) --with-ogg=$(PWD)/$(LIBOGG)$(prefix) && $(MAKE) + +.PHONY: $(LIBVORBIS) install-$(LIBVORBIS) +$(LIBVORBIS): $(LIBOGG) $(LIBVORBIS)/lib/.libs/libvorbis-0.dll + +install-$(LIBVORBIS): $(LIBVORBIS) install-$(LIBOGG) + cd $(LIBVORBIS) && $(MAKEINST) + + +########################################################################### +OPENAL = openal-soft-1.13-bin +OPENAL_CKSUM = b545d3ebb8138cc581cd67f988638f43 +OPENAL_EXT = .zip +OPENAL_VERSION = 1.13 + +define OPENAL_PCFILE +prefix=$(prefix) +exec_prefix=$${prefix} +libdir=$${exec_prefix}/lib +includedir=$${prefix}/include + +Name: OpenAL +Description: OpenAL is a cross-platform 3D audio API +Requires: +Version: $(OPENAL_VERSION) +Libs: -L$${libdir} -lOpenAL32 +Cflags: -I$${includedir} +endef +export OPENAL_PCFILE + +$(OPENAL)$(OPENAL_EXT): + $(call getdist,$@,http://kcat.strangesoft.net/$@) + $(call checkdist,$@,$(OPENAL_CKSUM)) || rm -f $@ + +.PHONY: $(OPENAL) install-$(OPENAL) +$(OPENAL): $(OPENAL)$(OPENAL_EXT) + +install-$(OPENAL): $(OPENAL)$(OPENAL_EXT) + $(call mkdirinst,bin include/AL lib/pkgconfig) + unzip -o $< + $(call install,0644,$(OPENAL)/include/AL/*,include/AL) + $(call install,0755,$(OPENAL)/Win32/soft_oal.dll,bin/OpenAL32.dll) + $(call install,0755,$(OPENAL)/openal-info.exe,bin) + $(call install,0755,$(OPENAL)/lib/Win32/libOpenAL32.dll.a,lib) + $(call installvar,OPENAL_PCFILE,lib/pkgconfig/openal.pc) + + +########################################################################### +ZLIB = zlib-1.2.5 +ZLIB_CKSUM = c735eab2d659a96e5a594c9e8541ad63 +ZLIB_EXT = .tar.gz +ZLIB_VERSION = 1.2.5 + +define ZLIB_PCFILE +prefix=$(prefix) +exec_prefix=$${prefix} +libdir=$${exec_prefix}/lib +includedir=$${prefix}/include + +Name: zlib +Description: zlib compression library +Version: $(ZLIB_VERSION) +Requires: +Libs: -L$${libdir} -lz +Cflags: -I$${includedir} +endef +export ZLIB_PCFILE + +$(ZLIB)$(ZLIB_EXT): + $(call getdist,$@,http://www.zlib.net/$@) + $(call checkdist,$@,$(ZLIB_CKSUM)) || rm -f $@ + +$(ZLIB)/zlib1.dll: $(ZLIB)$(ZLIB_EXT) + tar -xzf $< + cd $(ZLIB) && $(MAKE) -f win32/Makefile.gcc PREFIX="$(host)-" + +.PHONY: $(ZLIB) install-$(ZLIB) +$(ZLIB): $(ZLIB)/zlib1.dll + +install-$(ZLIB): $(ZLIB) + $(call mkdirinst,bin include lib/pkgconfig) + $(call install,0644,$(ZLIB)/zconf.h $(ZLIB)/zlib.h,include) + $(call install,0755,$(ZLIB)/zlib1.dll,bin) + $(call install,0755,$(ZLIB)/libzdll.a,lib) + $(call installvar,ZLIB_PCFILE,lib/pkgconfig/zlib.pc) + cd $(DESTDIR)$(prefix)/lib && ln -fs libzdll.a libz.dll.a + + +########################################################################### +LIBPNG = libpng-1.5.2 +LIBPNG_CKSUM = 31d448eb93a1646359a23f1b23434ab3 +LIBPNG_EXT = .tar.gz + +define LIBPNG_PATCH +diff -ur libpng-1.5.2.orig/configure.pc libpng-1.5.2/configure.pc +--- libpng-1.5.2.orig/configure.ac 2011-06-03 14:01:39.174626747 -0600 ++++ libpng-1.5.2/configure.ac 2011-06-03 14:02:05.427642561 -0600 +@@ -85,9 +85,9 @@ + [prefix that may have been used in installed zlib]), + [ZPREFIX=$${withval}], + [ZPREFIX='z_']) +-AC_CHECK_LIB(z, zlibVersion, , +- AC_CHECK_LIB(z, $${ZPREFIX}zlibVersion, , +- AC_ERROR([zlib not installed]))) ++LIBS="$$LIBS -lz" ++CPPFLAGS="$$CPPFLAGS -I../$(ZLIB)" ++LDFLAGS="$$LDFLAGS -L../$(ZLIB) -avoid-version" + + + LIBPNG_DEFINES=-DPNG_CONFIGURE_LIBPNG +endef +export LIBPNG_PATCH + +$(LIBPNG)$(LIBPNG_EXT): + $(call getdist,$@,http://prdownloads.sourceforge.net/libpng/$@?download) + $(call checkdist,$@,$(LIBPNG_CKSUM)) || rm -f $@ + +$(LIBPNG)/.libs/libpng15.dll: $(LIBPNG)$(LIBPNG_EXT) + tar -xzf $< + cd $(LIBPNG) && $(call patch,LIBPNG_PATCH) && ./autogen.sh && $(ECONF) && $(MAKE) + +.PHONY: $(LIBPNG) install-$(LIBPNG) +$(LIBPNG): $(ZLIB) $(LIBPNG)/.libs/libpng15.dll + +install-$(LIBPNG): $(LIBPNG) install-$(ZLIB) + cd $(LIBPNG) && $(MAKEINST) + + +########################################################################### +LUA = lua-5.1.4 +LUA_CKSUM = d0870f2de55d59c1c8419f36e8fac150 +LUA_EXT = .tar.gz + +$(LUA)$(LUA_EXT): + $(call getdist,$@,http://www.lua.org/ftp/$@) + $(call checkdist,$@,$(LUA_CKSUM)) || rm -f $@ + +$(LUA)/src/lua51.dll: $(LUA)$(LUA_EXT) + tar -xzf $< + cd $(LUA) && $(MAKE) CC=$(host)-gcc RANLIB=$(host)-ranlib mingw + +.PHONY: $(LUA) install-$(LUA) +$(LUA): $(LUA)/src/lua51.dll + +install-$(LUA): $(LUA) + $(call mkdirinst,bin include lib/pkgconfig) + $(call install,0644,$(addprefix $(LUA)/src/,lua.h lualib.h luaconf.h lauxlib.h) $(LUA)/etc/lua.hpp,include) + $(call install,0755,$(LUA)/src/liblua.a,lib/liblua.dll.a) + $(call install,0755,$(LUA)/src/*.exe $(LUA)/src/lua51.dll,bin) + sed 's!/usr/local!$(prefix)!' $(LUA)/etc/lua.pc >$(DESTDIR)$(prefix)/lib/pkgconfig/lua.pc + + +############################################################################ +# libopengl32 and libglu32 pkgconfig files +define GL_PCFILE +prefix=$(prefix) +exec_prefix=$${prefix} +libdir=$${exec_prefix}/lib +includedir=$${prefix}/include + +Name: gl +Description: OpenGL library +Version: +Requires: +Libs: -L$${libdir} -lopengl32 +Cflags: -I$${includedir} +endef +export GL_PCFILE + +.PHONY: install-gl.pc +install-gl.pc: + $(call mkdirinst,lib/pkgconfig) + $(call installvar,GL_PCFILE,lib/pkgconfig/gl.pc) + +define GLU_PCFILE +prefix=$(prefix) +exec_prefix=$${prefix} +libdir=$${exec_prefix}/lib +includedir=$${prefix}/include + +Name: glu +Description: OpenGL Utility library +Version: +Requires: gl +Libs: -L$${libdir} -lglu32 +Cflags: -I$${includedir} +endef +export GLU_PCFILE + +.PHONY: install-glu.pc +install-glu.pc: + $(call mkdirinst,lib/pkgconfig) + $(call installvar,GLU_PCFILE,lib/pkgconfig/glu.pc) + + +########################################################################### +# wspiapi.h header file +install-wspiapi.h: + $(call install,0644,wspiapi.h,include) + + +########################################################################### +ALL = $(BOOST) $(SDL) $(LIBOGG) $(LIBVORBIS) $(OPENAL) $(ZLIB) $(LIBPNG) $(LUA) +__package__: $(ALL) + printf "$(host)\n$(prefix)\n" >.saved + @echo "All done!" + +install: $(addprefix install-,$(ALL)) install-gl.pc install-glu.pc + @echo "All done!" + +.NOTPARALLEL: +# For readability, the recipes in this file should not run in parallel. + diff --git a/build/arch/win32/rules.mk b/build/arch/win32/rules.mk new file mode 100644 index 0000000..0f5eae5 --- /dev/null +++ b/build/arch/win32/rules.mk @@ -0,0 +1,43 @@ +# +# Yoink +# Run this script to create a win32 package. +# +# You should typically only run this through the "portable" and "installer" +# makes targets in the package root directory. The build system will take +# care to pass the correct arguments. +# + +docs = AUTHORS COPYING README TODO +libraries = libogg-0 libpng15 libvorbis-0 libvorbisfile-3 lua51 OpenAL32 SDL zlib1 + +MAN2HTML = lua doc/man2html.lua +UNIX2DOS = arch/win32/unix2dos.sh +MAKENSIS = makensis + +stagedir = $(builddir)/$(tarname) +zipfile = $(tarname).zip +installer = $(TARNAME)setup-$(VERSION)$(EXEEXT) + +__prepackage__: all + rm -rf $(stagedir) && mkdir -p $(stagedir) + cp -f $(builddir)/src/yoink$(EXEEXT) $(stagedir) + $(foreach l,$(libraries),cp -f $(bindir)/$l.dll $(stagedir);) + $(foreach d,$(SUBDIRS),$(foreach f,$(datadir_$(d)),\ + mkdir -p $(dir $(f:$(d)%=$(stagedir)/data%)) && cp -f $(f) $(dir $(f:$(d)%=$(stagedir)/data%));)) + $(MAN2HTML) -o $(stagedir)/Manual.html && $(UNIX2DOS) $(stagedir)/Manual.html + $(foreach f,$(docs),$(UNIX2DOS) $f $(stagedir)/$f.txt;) + +package: __prepackage__ + cd $(builddir) && zip -r $(zipfile) $(tarname) + rm -rf $(stagedir) + mv -f $(builddir)/$(zipfile) $(zipfile) + +installer: __prepackage__ + cp -f arch/win32/yoink.nsi $(builddir)/yoink.nsi + cd $(builddir) && $(MAKENSIS) -DROOTPATH=$(PWD) -DINSTALLFILES=$(PWD)/$(stagedir) \ + -DVERSION=$(VERSION) -DOUTFILE=$(installer) yoink.nsi + rm -rf $(builddir)/yoink.nsi $(stagedir) + mv -f $(builddir)/$(installer) $(installer) && chmod +x $(installer) + +.PHONY: __prepackage__ package installer + diff --git a/arch/win32/setup.ico b/build/arch/win32/setup.ico similarity index 100% rename from arch/win32/setup.ico rename to build/arch/win32/setup.ico diff --git a/arch/win32/uninstall.ico b/build/arch/win32/uninstall.ico similarity index 100% rename from arch/win32/uninstall.ico rename to build/arch/win32/uninstall.ico diff --git a/arch/win32/unix2dos.sh b/build/arch/win32/unix2dos.sh similarity index 100% rename from arch/win32/unix2dos.sh rename to build/arch/win32/unix2dos.sh diff --git a/arch/win32/wspiapi.h b/build/arch/win32/wspiapi.h similarity index 100% rename from arch/win32/wspiapi.h rename to build/arch/win32/wspiapi.h diff --git a/arch/win32/yoink.ico b/build/arch/win32/yoink.ico similarity index 100% rename from arch/win32/yoink.ico rename to build/arch/win32/yoink.ico diff --git a/arch/win32/yoink.nsi b/build/arch/win32/yoink.nsi similarity index 100% rename from arch/win32/yoink.nsi rename to build/arch/win32/yoink.nsi diff --git a/build/check.lua b/build/check.lua new file mode 100644 index 0000000..609cbfa --- /dev/null +++ b/build/check.lua @@ -0,0 +1,170 @@ +-- +-- Yoink Build System +-- A collection of Lua functions for performing checks. +-- +-- Copyright (c) 2011, Charles McGarvey +-- Distributable under the terms and conditions of the 2-clause BSD +-- license; see the file COPYING for a complete text of the license. +-- + +local M = {} + + +local util = require "utility" +local print_check = util.printer("checking for %s... ") + +-- TODO: Should have check for toolset triplet, compiling arbitrary code, +-- headers, libraries. + + +local CC = "" +local CXX = "" + + +local compile +do + local cache = {} + compile = function(compiler, ext, flags, code) + if type(compiler) ~= "table" then compiler = {compiler} end + local key = util.concat(compiler, "&") .. ext .. code + if cache[key] then return cache[key], "cached value" end + local tmpdir = util.make_tempdir("config.XXXXXX") + if tmpdir + then + local fd, err = io.open(tmpdir .. "/test." .. ext, "w") + if not fd then die("failed to create temporary file", fd) end + fd:write(code) + fd:close() + --util.print_log("code to be compiled:\n" .. code) + compiler = util.find_command(compiler, "test." .. ext, tmpdir) + os.execute("rm -rf " .. tmpdir) + else + die("failed to create temporary directory", tmpdir) + end + cache[key] = compiler + if compiler == nil then return nil, "test program could not be compiled" end + return compiler + end +end + + +do + local cache = {} + local function cc(...) + local arg = util.copy(arg, "v", tostring) + local key = util.concat(arg) + if cache[key] then return cache[key], "cached value" end + --print_check("C compiler") + local cc, err = compile(arg, "c", "", "int main() { return 0; }") + --if cc then util.print(cc) else util.print("no") end + cache[key] = cc + --util.print_info("cccheck:", key, cc) + if cc == nil then return nil, err end + return cc + end + M.cc = cc + + local function native_cc(triplet) + local ccenv = os.getenv("CC") + if ccenv + then + local result = cc(ccenv) + if result then return result end + end + if type(triplet) ~= "string" then triplet = util.exec("config.guess") end + return cc(triplet .. "-gcc", "cc", "gcc") + end + M.native_cc = native_cc + + local function cross_cc(triplet) + return cc(triplet .. "-gcc") + end + M.cross_cc = cross_cc +end + +do + local cache = {} + local function cxx(...) + local arg = util.copy(arg, "v", tostring) + local key = util.concat(arg) + if cache[key] then return cache[key], "cached value" end + --print_check("C++ compiler") + local cxx, err = compile(arg, "c++", "", "int main() { return 0; }") + --if cxx then util.print(cxx) else util.print("no") end + cache[key] = cxx + CXX = cxx + --util.print_info("cxxcheck:", key, cxx) + if cxx == nil then return nil, err end + return cxx + end + M.cxx = cxx + + local function native_cxx(triplet) + if type(triplet) ~= "string" then triplet = util.exec("config.guess") end + return cxx(os.getenv("CXX"), "g++", "c++") + end + M.native_cxx = native_cxx + + local function cross_cxx(triplet) + return cxx(triplet .. "-g++") + end + M.cross_cxx = cross_cxx +end + +do + local cache = {} + local function lib(...) + --local key = util.concat(arg, ", ") + --if cache[key] then return cache[key] end + --print_check(key) + --local code = "" + --local result = false + --for _,header in ipairs(arg) + --do + --code = string.format("%s#include <%s>\n", code, header) + --end + --code = code .. "int main() { return 0; }\n" + --if compile({CC}, "c", "", code) or compile({CC}, "c++", "", code) + --then + --result = true + --util.print("yes") + --else + --util.print("no") + --end + --cache[key] = result + --return key + return true + end + M.lib = lib +end + +do + local cache = {} + local function header(...) + local CC = M.native_cc() + local key = util.concat(arg, ", ") + if cache[key] then return cache[key] end + --print_check(key) + local code = "" + local result = false + for _,header in util.npairs(arg) + do + code = string.format("%s#include <%s>\n", code, header) + end + code = code .. "int main() { return 0; }\n" + if compile({CC}, "c", "", code) or compile({CC}, "c++", "", code) + then + result = true + --util.print("yes") + else + --util.print("no") + end + cache[key] = result + return key + end + M.header = header +end + + +return M + diff --git a/build/config.lua b/build/config.lua new file mode 100644 index 0000000..fa522cf --- /dev/null +++ b/build/config.lua @@ -0,0 +1,998 @@ +-- +-- Yoink Build System +-- Execute this script with Lua to prepare the project for compiling. +-- +-- Copyright (c) 2011, Charles McGarvey +-- Distributable under the terms and conditions of the 2-clause BSD +-- license; see the file COPYING for a complete text of the license. +-- + + +--local function trace(event, line) + --local s = debug.getinfo(2).short_src + --print(s .. ":" .. line) +--end +--debug.sethook(trace, "l") + + +-- Convert the arguments into standard form. Each argument should be a +-- string. A table is returned with the arguments' standard form as keys. +-- If an argument has a value, it will correspond to the appropriate key in +-- the table. This function supports autoconf-style arguments, including: +-- 1. -h, --help produce a --help key with a value of true. +-- 2. --enable-feature=[yes|no|whatever], --disable-feature produce a +-- --enable-feature key with a value of true, false, or a string. +-- 3. --with-package=[yes|no|whatever], --without-feature produce a +-- --with-package key with a value of true, false, or a string. +-- 4. SYMBOL=VALUE produce a SYMBOL key with VALUE as the string value. +-- 5. Anything else will appear as a key in the table as-is with a value of +-- true. +-- If multiple arguments mapping to the same key are present in the +-- argument list, the last one is used. +local function parseArguments(...) + local result = {} + local filters = {} + + local function setPair(key, value) result[key] = value end + local function setTrue(key) result[key] = true end + local function addLibrarySearchPath(path) + package.path = path .. "/?.lua;" .. package.path + package.cpath = path .. "/?.so;" .. package.cpath + end + + table.insert(filters, {"^-h$", function() result["--help"] = true end}) + table.insert(filters, {"^-L(.*)$", addLibrarySearchPath}) + + table.insert(filters, {"^(--enable%-[%w_-]+)=?(.*)$", setPair}) + table.insert(filters, {"^--disable%-([%w_-]+)$", function(feature) + setPair("--enable-" .. feature, "no") + end}) + + table.insert(filters, {"^(--with%-[%w_-]+)=?(.*)$", setPair}) + table.insert(filters, {"^--without%-([%w_-]+)$", function(package) + setPair("--with-" .. package, "no") + end}) + + table.insert(filters, {"^([%w_-]+)=(.*)$", setPair}) + table.insert(filters, {"^([%w_-]+)$", setTrue}) + + for _,a in ipairs(arg) + do + for _,filter in pairs(filters) + do + local matches = {a:match(filter[1])} + if matches[1] then filter[2](unpack(matches)) break end + end + end + + return result +end + + +local arguments = parseArguments(unpack(arg)) +local interactive = arguments["--interactive"] +local rules = arguments["--rules"] or "options.lua" +local configfile = arguments["--configfile"] or "config.mk" +local printendmsg = arguments["--print-instructions"] +local exportHeader = arguments["--export-header"] +local exportTerms = arguments["--export-terms"] + + +local util = require "utility" +util.logfile = "config.log" + + +local printInfo = util.printer("%s - %s\n") +local printWarning = util.printer("\a%s - %s\n", "33") +local printError = util.printer("\a%s - %s\n", "31") +local function beginProcess(title, caption) + print(string.format("%s:\n", title)) + local updater = util.printer(" [%3d%%] %s\n") + updater(0, caption) + return function(progress, caption) + if progress ~= nil + then + if 0.0 <= progress and progress <= 1.0 then progress = progress * 100 end + return updater(progress, caption) + end + print() + return 0 + end +end + +local function loadDialog(name, configfile) + local dialog + local result, err = pcall(function() dialog = require "dialog" end) + if not result + then + printWarning(err) + return nil + end + dialog.title = string.format("%s - %s Configuration", configfile, name) + printInfo = dialog.msgbox + printWarning = dialog.msgbox + printError = dialog.msgbox + beginProcess = dialog.gauge + return dialog +end + + +local function topologicalSort(lookup) + local dependants = util.copy(lookup, "v", {v = function() return 0 end}) + for _,option in pairs(lookup) + do + for _,dep in ipairs(option:getDirectDependants()) + do + dependants[dep] = dependants[dep] + 1 + end + end + + local sorted = {} + local queued = {} + for symbol,count in pairs(dependants) + do + if count == 0 then table.insert(queued, symbol) end + end + while 0 < #queued + do + local symbol = table.remove(queued) + table.insert(sorted, symbol) + for _,dep in ipairs(lookup[symbol]:getDirectDependants()) + do + dependants[dep] = dependants[dep] - 1 + if dependants[dep] == 0 then table.insert(queued, dep) end + end + end + + local remaining = {} + for symbol,count in pairs(dependants) + do + if 0 < count then table.insert(remaining, symbol) end + end + if 0 < #remaining + then + printWarning("Q.A. Notice", "One or more circular dependencies were detected involving these symbols: " + .. table.concat(remaining, ", ")) + for _,symbol in ipairs(remaining) do table.insert(sorted, symbol) end + end + + return sorted +end + +local function checkSymbols(symbols) + local check = topologicalSort(symbols) + local isErr = false + local updateTask = function() end + if 1 < #check + then + updateTask = beginProcess("Checking Symbols", "Resolving dependencies...", 6, 65) + end + for i = 1, #check + do + local option = symbols[check[i]] + if option:validate() == nil then isErr = true end + updateTask(i / #check, + (option:getSymbol() .. ": " .. option:toExpandedString()):truncate(60)) + end + updateTask() + if isErr then return nil end + return true +end + + +--------------------------------------------------------------------------- +local Option = util.class() +--------------------------------------------------------------------------- + +function Option:__init(rule, lookup, objects) + self.name = rule.name + self.caption = rule.caption + self.help = rule.help + self.value = rule.value + self.symbol = rule.symbol + self.cmdline = rule.cmdline + self.config = rule.config + self.export = rule.export + self.visible = rule.visible + self.check = rule.check + self.temp = rule.temp + self.before = rule.before + self.after = rule.after + self.lookup = lookup or {} + self.objects = objects or {} + + if type(self.check) == "function" then setfenv(self.check, self.lookup) end + if type(self.visible) == "function" then setfenv(self.visible, self.lookup) end + + if self.symbol ~= nil + then + if self.lookup[self.symbol] ~= nil + then + printWarning("duplicate symbol defined:", self.symbol) + end + self.lookup[self.symbol] = self.value + self.objects[self.symbol] = self + end +end + +-- Get the symbol of the option. The symbol is used as a reference in the +-- string values of other options. It must be unique. +function Option:getSymbol() + return self.symbol +end + +-- Get the argument of the option. +function Option:getArg() + return self.cmdline +end + +-- Get the value of the option as a string. +function Option:toString() + return tostring(self.lookup[self.symbol]) +end + +-- Get the value of the option as an expanded string. For most types of +-- options, this is the same as Option:toString(). +function Option:toExpandedString() + return self:toString() +end + +function Option:getDirectDependants() + return self.before or {} +end + +function Option:getUnsortedDependants(dependants) + dependants = dependants or {} + if dependants[self.symbol] then return dependants end + dependants[self.symbol] = self + if self.before + then + for _,dep in ipairs(self.before) + do + local option = self.objects[dep] + if option + then + dependants = option:getUnsortedDependants(dependants) + else + printWarning("invalid dependency: " .. dep) + end + end + end + return dependants +end + +function Option:addDependant(dependency) + self.before = self.before or {} + table.insert(self.before, dependency) +end + +function Option:convertDependenciesToDependants() + if self.after + then + local dep = table.remove(self.after) + while dep ~= nil + do + local option = self.objects[dep] + if option + then + option:addDependant(self.symbol) + else + printWarning("invalid dependency: " .. dep) + end + dep = table.remove(self.after) + end + end +end + +function Option:getObjects() + return self.objects +end + +-- Check the value of the option for validity. +-- Returns a valid value based on the given value, or nil (with an error +-- message) if the value is invalid and could not be converted to a valid +-- value. +function Option:validate(value) + local err + if value == nil then value = self.lookup[self.symbol] end + self.problem = nil + if type(self.check) == "function" + then + value, err = self.check(value) + if value == nil then self.problem = err return nil, err end + end + self.lookup[self.symbol] = value + return value, err +end + +-- Set the value of the option to the value in a new lookup table. +function Option:applyTable(lookup) +end + +-- Set the value of the option based on a table of argument flags. +function Option:applyArguments() +end + +-- Set the value of the option. +function Option:set(value) + self.lookup[self.symbol] = value + if checkSymbols(self:getUnsortedDependants()) + then + return self.lookup[self.symbol] + end +end + +-- Write the symbol and current value to the config file. +function Option:writeSymbol(fd) + if self.symbol ~= nil and not self.temp + then + fd:write(util.align(self.symbol, "= " .. tostring(self.lookup[self.symbol]), 16) .. "\n") + --fd:write(string.format("%s\t= %s\n", self.symbol, tostring(self.lookup[self.symbol]))) + end +end + +-- Write the option value to the config header file. +function Option:writeCppLine(fd) +end + +-- Write the option value as a string replacement to the sed file. +function Option:writeSedLine(fd) + if self.export + then + local value = self:toExpandedString():gsub("/", "\\/") + local function writeLine(key) + key = tostring(key):gsub("/", "\\/") + fd:write(string.format("s/@%s@/%s/g\n", key, value)) + end + if type(self.export) == "table" + then + for _,key in ipairs(self.export) do writeLine(key) end + else + writeLine(self.export) + end + end +end + +-- Run an interactive menu with the given dialog context. The type of menu +-- run will depend on the type of option. +function Option:showMenu(dialog) +end + +-- Get whether or not there is a problem with the current value of the +-- option. +function Option:isValid() + return type(self.problem) ~= "string" +end + +-- Get a human-readable description of the problem(s) this option faces +-- before it can be considered valid. +function Option:getProblem() + return self.problem +end + +-- Get the name to be used for this option in the interactive menu. +function Option:getMenuItem() + if not self:isValid() then return self.name .. " " end + return self.name +end + +-- Get the label used to represent this option in a menu. +function Option:getLabel() + return "" +end + +-- Get whether or not this option should be visible in a menu of options. +-- Returns true if option is visible, false otherwise. +function Option:isVisible() + if type(self.visible) == "function" then return self.visible() end + return true +end + +-- If the option has an argument flag, print out a line with information +-- about the purpose of this option. +function Option:printHelpLine() + if self.cmdline ~= nil + then + print(util.align(" " .. self:getArg(), self.caption, 32)) + end +end + +function Option:getHelpText() + local value = self:toString() + local help = self.help or "No help available.\n" + local name = self.name or "Unnamed" + local symbol = self:getSymbol() or "None" + local arg = self:getArg() or "None" + + local problem = self:getProblem() + if problem then problem = "\nProblem(s):\n" .. problem + else problem = "" end + + return [[ + +]] .. help .. [[ + + Option Name: ]] .. name .. [[ + + Symbol: ]] .. symbol .. [[ + + Current Value: ]] .. value .. [[ + + Argument: ]] .. arg .. [[ + +]] .. problem +end + + +--------------------------------------------------------------------------- +local StringOption = util.class(Option) +--------------------------------------------------------------------------- + +-- Get the expanded option value. Symbols which begin with dollar signs +-- will be substituted for their values. +function StringOption:toExpandedString() + local function expand(value) + _, value, count = pcall(string.gsub, value, "%$%(([%w_]+)%)", self.lookup) + if not count then count = 0 end + return value, count + end + local value = self.lookup[self.symbol] + local iterations = 0 + while iterations < 8 + do + local count = 0 + value, count = expand(value) + if count == 0 then return value end + iterations = iterations + 1 + end + return value +end + +function StringOption:applyTable(lookup) + local value = lookup[self.symbol] + if type(value) == "string" then self.lookup[self.symbol] = tostring(value) end +end + +function StringOption:applyArguments(args) + local value = args[self.cmdline] + if value ~= nil then self:validate(tostring(value)) end +end + +function StringOption:writeCppLine(fd) + if self.config + then + local value = self:toExpandedString() + local function writeLine(key) + if type(self.value) == "string" + then + fd:write(string.format("#define %s %q\n", key, value)) + else + fd:write(string.format("#define %s %s\n", key, value)) + end + end + if type(self.config) == "table" + then + for _,key in ipairs(self.config) do writeLine(key) end + else + writeLine(self.config) + end + end +end + +function StringOption:showMenu(dialog) + local code, item = dialog.inputbox(self.name, self.caption, self.lookup[self.symbol]) + if code == 0 and item ~= self.lookup[self.symbol] + then + return self:set(item) + end +end + +function StringOption:getLabel() + return self:toExpandedString() +end + + +--------------------------------------------------------------------------- +local EnumOption = util.class(StringOption) +--------------------------------------------------------------------------- + +-- An enumeration option is like a string, but it can only hold certain +-- pre-determined values. In a rule, it is distinguished by its value key +-- which refers to an array of the possible (string) values. +function EnumOption:__init(rule, lookup, objects) + Option.__init(self, rule, lookup, objects) + self.lookup[self.symbol] = self.value[1] +end + +function EnumOption:getArg() + if self.cmdline == nil then return nil end + return self.cmdline .. "=[" .. table.concat(self.value, "|") .. "]" +end + +function EnumOption:validate(str) + str = str or self.lookup[self.symbol] + for _,value in ipairs(self.value) + do + if value == str then return Option.validate(self, str) end + end + self.problem = "The assigned value (" .. str .. ") is not a valid option." + return nil, self.problem +end + +function EnumOption:applyArguments(args) + -- Just like applying arguments for strings, but if the argument is + -- false, assume the first value should be assigned. + local value = args[self.cmdline] + if value == false then self:validate(self.value[1]) return end + StringOption.applyArguments(self, args) +end + +function EnumOption:writeCppLine(fd) + if self.config + then + local value = self:toString():upper() + local function writeLine(key) + key = tostring(key) .. "_" .. value + fd:write(string.format("#define %s 1\n", key)) + end + if type(self.config) == "table" + then + for _,key in ipairs(self.config) do writeLine(key) end + else + writeLine(self.config) + end + end +end + +function EnumOption:showMenu(dialog) + local menuitems = {} + for _,value in ipairs(self.value) + do + table.insert(menuitems, {value, ""}) + end + local code, item = dialog.menu( + self.name, + self.caption, + menuitems, + self.lookup[self.symbol], + {["--ok-label"] = "Select"} + ) + if code == 0 and item ~= self.lookup[self.symbol] + then + return self:set(item) + end +end + +function EnumOption:getLabel() + return "[" .. StringOption.getLabel(self) .. "]" +end + + +--------------------------------------------------------------------------- +local BooleanOption = util.class(Option) +--------------------------------------------------------------------------- + +function BooleanOption:toString() + if self.lookup[self.symbol] then return "Yes" else return "No" end +end + +function BooleanOption:applyTable(lookup) + local value = lookup[self.symbol] + if type(value) == "boolean" then self.lookup[self.symbol] = value end +end + +function BooleanOption:applyArguments(args) + local value = args[self.cmdline] + if value == "yes" or value == "" then value = true end + if value == "no" then value = false end + if type(value) == "boolean" then self:validate(value) end +end + +function BooleanOption:writeCppLine(fd) + if self.config + then + local value = self.lookup[self.symbol] + local function writeLine(key) + -- Reverse the value if key starts with a bang. + local value = value + if key:byte(1) == 33 then key = key:sub(2) value = not value end + if value + then + fd:write("#define " .. key .. " 1\n") + else + fd:write("/* #undef " .. key .. " */\n") + end + end + if type(self.config) == "table" + then + for _,key in ipairs(self.config) do writeLine(key) end + else + writeLine(self.config) + end + end +end + +function BooleanOption:showMenu(dialog) + local item = not self.lookup[self.symbol] + return self:set(item) +end + +function BooleanOption:getLabel() + if self.lookup[self.symbol] then return "[X]" else return "[ ]" end +end + + +--------------------------------------------------------------------------- +local NullOption = util.class(Option) +--------------------------------------------------------------------------- + +-- Null options don't really hold any useful information; they just +-- translate to a blank line in the menuconfig. Any non-table object in a +-- rule will become this type of option. +function NullOption:__init() + self.name = "" + self.lookup = {} +end + +function NullOption:validate() + return true +end +function NullOption:isVisible() + return true +end + + +--------------------------------------------------------------------------- +local GroupOption = util.class(Option) +--------------------------------------------------------------------------- + +local function optionFactory(rule, lookup, objects) + local jump = setmetatable({ + string = StringOption, + number = StringOption, + table = EnumOption, + boolean = BooleanOption + }, { + __index = function() return GroupOption end + }) + if type(rule) == "table" + then + return jump[type(rule.value)](rule, lookup, objects) + else + -- If the rule is not a table, just insert a placeholder option for + -- a blank line. + return NullOption() + end +end + +-- A GroupOption is not really an option itself, but a group of options. +function GroupOption:__init(rule, lookup, objects) + Option.__init(self, rule, lookup, objects) + self.children = {} + + for _,child in ipairs(rule) + do + table.insert(self.children, optionFactory(child, self.lookup, self.objects)) + end +end + +function GroupOption:toString() + return "n/a" +end + +-- Call the method with an arbitrary number of arguments to each +-- sub-option. +function GroupOption:recurse(method, ...) + for _,child in ipairs(self.children) + do + child[method](child, unpack(arg)) + end +end + +function GroupOption:convertDependenciesToDependants() + self:recurse("convertDependenciesToDependants") +end + +-- Validate each sub-option in order. The validation will short-circuit +-- and return nil (with an error message) upon the first failed validation. +function GroupOption:validate() + for _,child in ipairs(self.children) + do + local result, err = child:validate() + if result == nil then return result, err end + end + return true +end + +function GroupOption:isValid() + for _,child in ipairs(self.children) + do + if not child:isValid() then return false end + end + return true +end + +function GroupOption:getProblem() + local problems = "" + for _,child in ipairs(self.children) + do + local problem = child:getProblem() + if problem + then + local symbol = child:getSymbol() + if symbol + then + problems = problems .. util.align(symbol .. ":", problem, 16) .. "\n" + else + problems = problems .. problem .. "\n" + end + util.align(symbol, problem, 16) + end + end + if problems == "" then return nil end + return util.trim(problems) +end + +function GroupOption:applyTable(lookup) + self:recurse("applyTable", lookup) +end + +function GroupOption:applyArguments(args) + self:recurse("applyArguments", args) +end + +function GroupOption:writeSymbol(fd) + if self.name ~= nil then + fd:write(string.format("\n# %s\n", self.name)) + self:recurse("writeSymbol", fd) + end +end + +function GroupOption:writeCppLine(fd) + self:recurse("writeCppLine", fd) +end + +function GroupOption:writeSedLine(fd) + self:recurse("writeSedLine", fd) +end + + +function GroupOption:showMenu(dialog) + local running, dirty, selected = true + while running + do + local menuitems = {} + for _,value in ipairs(self.children) + do + if type(value) ~= "table" + then + table.insert(menuitems, value) + elseif type(value.name) == "string" and value:isVisible() + then + local name = value:getMenuItem() + local label = value:getLabel() + local caption = "" + if type(value.caption) == "string" + then + caption = value.caption + menuitems["HELP " .. value.caption] = value + end + menuitems[name] = value + table.insert(menuitems, {name, label, caption}) + end + end + + local code, item = dialog.menu( + self.name, + self.caption, + menuitems, + selected, + { + ["--ok-label"] = "Select", + ["--cancel-label"] = "Exit", + ["--item-help"] = true, + ["--help-button"] = true + } + ) + + if code == 0 + then + local value = menuitems[item] + if type(value) == "table" + then + if value:showMenu(dialog) ~= nil then dirty = "changed" end + selected = value:getMenuItem() + else + selected = value + end + elseif code == 2 + then + local value = menuitems[item] + if value + then + dialog.msgbox(value.name, value:getHelpText(), {["--no-collapse"] = true}) + selected = value:getMenuItem() + else + dialog.msgbox("No Help", + "Sorry, no help is available for this option.") + end + else + running = false + end + end + return dirty +end + +function GroupOption:getLabel() + return "-->" +end + +function GroupOption:printHelpLine() + if self:isVisible() and self.name ~= nil then + print(string.format("\n%s:", self.name)) + self:recurse("printHelpLine") + end +end + + +-- Print arguments and usage information for all of the sub-options. +function GroupOption:printHelp(name) + print([[ + +This script prepares ]] .. name .. [[ for building on your system. +Usage: ./configure [OPTION]... [VAR=VALUE]...]]) + + self:printHelpLine() + print() +end + +-- Set values of the sub-options based on a table that is loaded from a +-- file. The table is formatted as one or more lines with keys and values +-- separated by an equal sign. The pound sign (#) serves to start a +-- comment on the line. The first equal sign on a line is used as the +-- separator, so keys cannot have an equal sign. +function GroupOption:loadFromFile(filepath) + local lookup = {} + local fd = io.open(filepath) + if fd + then + for line in fd:lines() + do + if not line:find("^%s*#") + then + key, value = line:match("^%s*(%S.-)%s*=%s*(.*)%s*") + if value + then + if value:upper() == "TRUE" then value = true + elseif value:upper() == "FALSE" then value = false end + end + if key then lookup[key] = value end + end + end + fd:close() + end + self:applyTable(lookup) +end + +-- Save a table with the current values of the sub-options to a file. The +-- file can be reloaded with GroupOption:loadFromFile. +function GroupOption:saveToFile(filepath) + local fd = io.open(filepath, "w") + if fd + then + fd:write(string.format("\n# Auto-generated: %s", os.date())) + self:writeSymbol(fd) + fd:write("\n") + else + printError("couldn't save config file to:", filepath) + end +end + +-- Exports the config header file. The key-value pairs of sub-options with +-- "config" defined will be written to the file. +function GroupOption:exportHeader(filepath) + local fd = io.open(filepath, "w") + self:writeCppLine(fd) + fd:close() +end + +-- Exports the search 'n replace file. The key-value pairs of sub-options +-- with "export" defined will be written to the file. +function GroupOption:exportTerms(filepath) + local fd = io.open(filepath, "w") + self:writeSedLine(fd) + fd:close() +end + +-- Run menuconfig. This is different from showMenu in that this method +-- tracks changes and returns an action: save, cancel, nochange or error. +function GroupOption:runMenu() + local result, dirty = nil, false + while result == nil + do + if self:showMenu(dialog) ~= nil then dirty = true end + if not self:isValid() + then + local code = dialog.yesno("Oh drat!", + "There is at least one problem with the configuration, marked with , and the configuration will not be saved. Do you really want to exit without saving?", + { + ["--extra-button"] = false, + ["--ok-label"] = "Exit", + ["--cancel-label"] = "Back" + }) + if code == 0 or code == 255 then result = "error" end + elseif dirty + then + local code = dialog.yesno("Save Changes?", + "Your configuration has been altered. Do you want to save the changes?", + { + ["--ok-label"] = "Save", + ["--cancel-label"] = "Back", + ["--extra-button"] = true, + ["--extra-label"] = "Exit" + }) + if code == 0 then result = "save" + elseif code == 3 or code == 255 then result = "cancel" end + else + result = "nochange" + end + end + return result +end + + +local loadFn = assert(loadfile(rules)) +local name, rules = loadFn() + +local options = optionFactory(rules) +if arguments["--help"] then options:printHelp(name) os.exit() end + +options:loadFromFile(configfile) +if exportHeader or exportTerms +then + if exportHeader then options:exportHeader(exportHeader) end + if exportTerms then options:exportTerms(exportTerms) end + os.exit() +end + +print() +printInfo(name, "Preparing for building and installation on your system.\n") +options:applyArguments(arguments) + +if interactive then loadDialog(name, configfile) end + +options:convertDependenciesToDependants() +checkSymbols(options:getObjects()) + +if dialog +then + local action = options:runMenu() + if action == "exit" or action == "error" + then + print("configuration aborted by user request") + os.exit(1) + else + options:saveToFile(configfile) + print("configuration saved to " .. configfile) + end +elseif options:isValid() +then + options:saveToFile(configfile) +else + printError("Uh oh!", [[ +There is at least one unresolved problem with the configuration. +]] .. options:getProblem() .. "\n") + os.exit(2) +end + +if printendmsg ~= "no" +then + printInfo("Configuration complete!", [[ +To finish the installation, type: + make + make install +]]) +end + +-- vi:ts=4 sw=4 tw=75 + diff --git a/build/dialog.c b/build/dialog.c new file mode 100644 index 0000000..ee8a2a8 --- /dev/null +++ b/build/dialog.c @@ -0,0 +1,578 @@ + +/*] Copyright (c) 2011, Charles McGarvey [******************************* +**] All rights reserved. +* +* vi:ts=4 sw=4 tw=75 +* +* Distributable under the terms and conditions of the 2-clause BSD license; +* see the file COPYING for a complete text of the license. +* +**************************************************************************/ + +#define LUA_DIALOG_NAME "dialog" +#define LUA_DIALOG_VERSION "1.0" + + +#include +#include +#include +#include + +#include +#include + +#define LUA_LIB +#include "lua.h" +#include "lauxlib.h" + + +#ifdef NDEBUG +#define printarray(A) +#else +#include +static void printarray(const char* argv[]) +{ + printf("%s", argv[0]); + int i; for (i = 1; argv[i]; ++i) printf(" %s", argv[i]); +} +#endif + + +/** + * Fork and execute a command with arguments and optionally get a file + * descriptor connected to one of the child's own file descriptors. The + * process id of the child is returned, or -1 on error. If fd is not NULL, + * a pipe will be created and connected to *fd. If *fd is 0, then *fd will + * be set to a write file descriptor connected to the child's standard + * input. If *fd is not 0, then *fd will be set to a read file descriptor + * set connected to the specified file descriptor of the child. In either + * case, the caller has the responsibility to close fd when it is no longer + * needed. + */ +static pid_t myexec(const char* command, char* const argv[], int* fd) +{ + int parentFd = -1; + int p[2]; + pid_t child; + + if (fd) + { + if (pipe(p) != 0) return -1; + parentFd = (*fd == 0); + } + if (!(child = fork())) + { + if (fd) + { + close(p[parentFd]); + if (dup2(p[!parentFd], *fd) == -1) _exit(127); + } + execv(command, argv); + _exit(127); + } + if (child == -1) + { + if (parentFd != -1) + { + close(p[0]); close(p[1]); + } + return -1; + } + if (parentFd != -1) + { + close(p[!parentFd]); + *fd = p[parentFd]; + } + return child; +} + +/** + * Wait on a child process. Returns the exit status of the process if the + * child terminates normally, or -1 on error or abnormal child termination. + */ +static int mywait(pid_t pid) +{ + int status; + if (waitpid(pid, &status, 0) == -1 || !WIFEXITED(status)) return -1; + return WEXITSTATUS(status); +} + + +/** + * Read from a file descriptor until EOF and push contents to the top of + * the Lua stack. Closes the file descriptor afterward. + */ +static void pushstream(lua_State* L, int fd) +{ + luaL_Buffer B; + luaL_buffinit(L, &B); + + char buffer[BUFSIZ]; + ssize_t bytes; + while ((bytes = read(fd, buffer, sizeof(buffer)))) + { + if (bytes == -1) break; + luaL_addlstring(&B, buffer, bytes); + } + + close(fd); + luaL_pushresult(&B); +} + +/** + * Write some arbitrary bytes to a file descriptor, appending a newline. + */ +static void writelstring(int fd, const char* str, size_t len) +{ + ssize_t bytes; + while ((bytes = write(fd, str, len))) + { + if (bytes == -1) break; + str += bytes; + len -= bytes; + } + bytes = write(fd, "\n", 1); +} + +/** + * Write a NULL-terminate string to a file descriptor. Uses writelstring. + */ +static void writestring(int fd, const char* str) +{ + writelstring(fd, str, strlen(str)); +} + +/** + * Write a Lua value, that is able to be converted to a string, to a file + * descriptor. + */ +static void tostream(lua_State* L, int index, int fd) +{ + size_t len = 0; + const char* buffer = lua_tolstring(L, index, &len); + writelstring(fd, buffer, len); +} + + +/** + * Add one or more strings to the end of a NULL-terminated array of + * strings. The parameter list itself should also be terminated with a + * NULL. The terminating NULL of the array of strings will be moved back + * as needed. It is the responsibility of the caller to assert there is + * enough room in the array so that an overflow doesn't occur. Strings are + * not duplicated as they are added to the array. + */ +static void addstrings(const char* argv[], ...) +{ + va_list ap; + int i; for (i = 0; argv[i]; ++i); + va_start(ap, argv); + const char* arg = va_arg(ap, const char*); + while (arg) + { + argv[i++] = arg; + arg = va_arg(ap, const char*); + } + va_end(ap); + argv[i] = NULL; +} + +/** + * Search an array of strings for a particular string, returning the index + * where the first equivalent string is found or -1 if it wasn't found. + */ +static int searchstrings(const char* argv[], const char* str) +{ + int i; for (i = 0; argv[i]; ++i) if (strcmp(argv[i], str) == 0) return i; + return -1; +} + + +/** + * Add the command and backtitle to the argument list from the Lua state. + */ +static void addcommand(lua_State* L, const char* argv[]) +{ + lua_getglobal(L, LUA_DIALOG_NAME); + lua_getfield(L, -1, "command"); + lua_getfield(L, -2, "title"); + addstrings(argv, lua_tostring(L, -2), NULL); + if (lua_isstring(L, -1)) + { + addstrings(argv, "--backtitle", lua_tostring(L, -1), NULL); + } + lua_pop(L, 3); +} + +/** + * Add the height and width to the argument list from the Lua state. + */ +static int addsize(lua_State* L, const char* argv[], int extra, int n) +{ + int m = n; + lua_getglobal(L, LUA_DIALOG_NAME); + if (lua_isnumber(L, m)) lua_pushvalue(L, m++); + else lua_getfield(L, -1, "height"); + if (lua_isnumber(L, m)) lua_pushvalue(L, m++); + else lua_getfield(L, -2, "width"); + addstrings(argv, lua_tostring(L, -2), lua_tostring(L, -1), NULL); + if (extra) addstrings(argv, lua_tostring(L, -2), NULL); + lua_pop(L, 3); + return m - n; +} + +/** + * Add the dialog title to the argument list from the Lua state. The title + * should be at index 1 on the stack, and an error is thrown if it is not + * found. + */ +static void addtitle(lua_State* L, const char* argv[]) +{ + addstrings(argv, "--title", luaL_checkstring(L, 1), NULL); +} + +/** + * Add the caption to the argument list from the Lua state. The caption + * should be at index 2 on the stack, and an error is thrown if it is not + * found. + */ +static void addcaption(lua_State* L, const char* argv[]) +{ + addstrings(argv, luaL_optstring(L, 2, ""), NULL); +} + +/** + * Get the string found at a certain index on the Lua stack, returned in + * the text argument. Returns whether the text was set. + */ +static int getstring(lua_State* L, const char* argv[], int n, const char** text) +{ + if (lua_type(L, n) != LUA_TSTRING) return 0; + *text = lua_tostring(L, n); + return 1; +} + +/** + * Add extra arguments to the argument list from the Lua state. The extra + * arguments exist in a table where the key is a flag and its value (if it + * is a string) is added as a flag option. + */ +static int addextra(lua_State* L, const char* argv[], int n) +{ + if (!lua_istable(L, n)) return 0; + lua_pushnil(L); + while (lua_next(L, n)) + { + addstrings(argv, lua_tostring(L, -2), NULL); + if (lua_isstring(L, -1)) addstrings(argv, lua_tostring(L, -1), NULL); + lua_pop(L, 1); + } + return 1; +} + +/** + * Add the default item to the argument list from the Lua stack for a menu + * command. Returns whether or not the arguments were found and added. If + * the value on the stack is nil, no arguments are added to the list, but + * the return value is still 1. + */ +static int addselected(lua_State* L, const char* argv[], int n) +{ + if (lua_isnil(L, n)) return 1; + if (!lua_isstring(L, n)) return 0; + addstrings(argv, "--default-item", lua_tostring(L, n), NULL); + return 1; +} + +/** + * Add menu items to the argument list from the Lua stack. They should + * exist in a table at index 3 of a menu command. Each item should be a + * table itself with two or three strings, depending on whether --item-help + * exists in the argument list. + */ +static void addmenuitems(lua_State* L, const char* argv[]) +{ + int fields = 2; + if (searchstrings(argv, "--item-help") != -1) fields = 3; + + if (!lua_istable(L, 3)) luaL_argerror(L, 3, "menu items"); + int i; for (i = 1;; ++i) + { + lua_pushinteger(L, i); + lua_gettable(L, 3); + if (lua_isnil(L, -1)) + { + lua_pop(L, 1); + break; + } + else if (lua_istable(L, -1)) + { + int subtable = lua_gettop(L); + lua_pushnil(L); + int j; for (j = 0; j < fields; ++j) + { + if (!lua_next(L, subtable)) luaL_argerror(L, 3, "not enough fields"); + addstrings(argv, lua_tostring(L, -1), NULL); + lua_pop(L, 1); + } + lua_pop(L, 1); + } + else + { + if (fields == 2) addstrings(argv, "", "", NULL); + else addstrings(argv, "", "", "", NULL); + } + lua_pop(L, 1); + } +} + +/** + * Fill out the argument list from the Lua state according to the standard + * 3 or 4 argument dialog command format. + */ +static void addargs(lua_State* L, const char* command, int nargs, const char* argv[]) +{ + assert((nargs == 3 || nargs == 4) && "nargs should be 3 or 4"); + + addcommand(L, argv); + addtitle(L, argv); + const char* text = NULL; + int n = 3; + if (nargs == 4) n += getstring(L, argv, n, &text); + n += addextra(L, argv, n); + addstrings(argv, command, NULL); + addcaption(L, argv); + addsize(L, argv, 0, n); + if (text) addstrings(argv, text, NULL); +} + + +/** + * Close a gauge dialog if one is running. If a gauge is in progress, the + * status code will be pushed onto the stack and 1 is returned; otherwise, + * 0 is returned. + */ +static void closegauge(lua_State* L) +{ + lua_getfield(L, LUA_REGISTRYINDEX, "dialog_gauge_pid"); + lua_getfield(L, LUA_REGISTRYINDEX, "dialog_gauge_fd"); + if (!lua_isnumber(L, -2) || !lua_isnumber(L, -1)) + { + lua_pop(L, 2); + return; + } + pid_t pid = lua_tointeger(L, -2); + int fd = lua_tointeger(L, -1); + lua_pop(L, 2); + + lua_pushnil(L); + lua_setfield(L, LUA_REGISTRYINDEX, "dialog_gauge_pid"); + lua_pushnil(L); + lua_setfield(L, LUA_REGISTRYINDEX, "dialog_gauge_fd"); + + close(fd); + int code = mywait(pid); + if (code == -1) luaL_error(L, "dialog killed abnormally"); +} + +/** + * Updates the progress of a gauge dialog. Takes a number argument in the + * range of 0-100 or 0.0-1.0 as the progress. Optionally takes a string as + * the second argument which causes the caption to change. The last call + * to this function should be with no arguments to end the gauge dialog. + * Returns nothing except the last call which returns the status code of + * the dialog which should always be OK. + */ +static int updategauge(lua_State* L) +{ + if (!lua_isnumber(L, 1)) + { + closegauge(L); + return 0; + } + + lua_getfield(L, LUA_REGISTRYINDEX, "dialog_gauge_fd"); + if (!lua_isnumber(L, -1)) return 0; + int fd = lua_tointeger(L, -1); + + lua_Number percent = lua_tonumber(L, 1); + if (0.0 <= percent && percent <= 1.0) percent *= 100.0; + lua_pushinteger(L, (lua_Integer)percent); + lua_replace(L, 1); + if (lua_isstring(L, 2)) + { + writestring(fd, "XXX"); + tostream(L, 1, fd); + tostream(L, 2, fd); + writestring(fd, "XXX"); + } + else + { + tostream(L, 1, fd); + } + return 0; +} + +/** + * Display a gauge dialog. Required arguments are dialog title and + * caption. Optional arguments include a table of extra flags. Returns a + * new function which can be used to update the progress. + */ +static int dialog_gauge(lua_State* L) +{ + const char* argv[40] = {NULL}; + closegauge(L); + addargs(L, "--gauge", 3, argv); + + int fd = 0; + pid_t pid = myexec(argv[0], (char* const*)argv, &fd); + if (pid == -1) luaL_error(L, "dialog failed to execute"); + lua_pushinteger(L, pid); + lua_setfield(L, LUA_REGISTRYINDEX, "dialog_gauge_pid"); + lua_pushinteger(L, fd); + lua_setfield(L, LUA_REGISTRYINDEX, "dialog_gauge_fd"); + lua_pushcfunction(L, updategauge); + return 1; +} +/** + * Display a menu dialog. Required arguments are dialog title, caption, + * and table of menu items. Optional arguments are selected item and table + * of extra flags. + */ +static int dialog_menu(lua_State* L) +{ + const char* argv[1024] = {NULL}; + closegauge(L); + + addcommand(L, argv); + addtitle(L, argv); + int n = 4; + n += addselected(L, argv, n); + n += addextra(L, argv, n); + addstrings(argv, "--menu", NULL); + addcaption(L, argv); + addsize(L, argv, 1, n); + addmenuitems(L, argv); + + printarray(argv); + + int fd = 2; + pid_t pid = myexec(argv[0], (char* const*)argv, &fd); + if (pid == -1) luaL_error(L, "dialog failed to execute"); + int code = mywait(pid); + if (code == -1) luaL_error(L, "dialog killed abnormally"); + lua_pushinteger(L, code); + pushstream(L, fd); + return 2; +} + +/** + * Display a message dialog. Required arguments are dialog title and + * caption. Optional arguments include a table of extra flags. + */ +static int dialog_msgbox(lua_State* L) +{ + const char* argv[40] = {NULL}; + closegauge(L); + addargs(L, "--msgbox", 3, argv); + + pid_t pid = myexec(argv[0], (char* const*)argv, NULL); + if (pid == -1) luaL_error(L, "dialog failed to execute"); + int code = mywait(pid); + if (code == -1) luaL_error(L, "dialog killed abnormally"); + lua_pushinteger(L, code); + return 1; +} + +/** + * Display an input dialog. Required arguments are dialog title and + * caption. Optional arguments are the default text and a table of extra + * flags. + */ +static int dialog_inputbox(lua_State* L) +{ + const char* argv[40] = {NULL}; + closegauge(L); + addargs(L, "--inputbox", 4, argv); + + int fd = 2; + pid_t pid = myexec(argv[0], (char* const*)argv, &fd); + if (pid == -1) luaL_error(L, "dialog failed to execute"); + int code = mywait(pid); + if (code == -1) luaL_error(L, "dialog killed abnormally"); + lua_pushinteger(L, code); + pushstream(L, fd); + return 2; +} + +/** + * Display a yes/no dialog. Required arguments are dialog title and + * caption. Optional arguments include a table of extra flags. + */ +static int dialog_yesno(lua_State* L) +{ + const char* argv[40] = {NULL}; + closegauge(L); + addargs(L, "--yesno", 3, argv); + + pid_t pid = myexec(argv[0], (char* const*)argv, NULL); + if (pid == -1) luaL_error(L, "dialog failed to execute"); + int code = mywait(pid); + if (code == -1) luaL_error(L, "dialog killed abnormally"); + lua_pushinteger(L, code); + return 1; +} + + +/** + * Register the module functions and find a dialog command in the path. + */ +LUALIB_API int luaopen_dialog(lua_State* L) +{ + const struct luaL_Reg dialog_funcs[] = { + {"gauge", dialog_gauge}, + {"inputbox", dialog_inputbox}, + {"menu", dialog_menu}, + {"msgbox", dialog_msgbox}, + {"yesno", dialog_yesno}, + {NULL, NULL} + }; + luaL_register(L, LUA_DIALOG_NAME, dialog_funcs); + + const char* names[] = {getenv("DIALOG"), "dialog", "cdialog"}; + int i; for (i = 0; i < 3; ++i) + { + if (names[i]) + { + char* path = strdup(getenv("PATH")); + char* token; char** paths = &path; + while ((token = strsep(paths, ":"))) + { + luaL_Buffer B; + luaL_buffinit(L, &B); + luaL_addstring(&B, token); + luaL_addstring(&B, "/"); + luaL_addstring(&B, names[i]); + luaL_pushresult(&B); + if (access(lua_tostring(L, -1), X_OK) == 0) + { + lua_setfield(L, -2, "command"); + goto break2; + } + lua_pop(L, 1); + } + free(path); + } + } + luaL_error(L, "cannot find dialog executable in the path; set DIALOG"); + +break2: + + lua_pushinteger(L, 0); + lua_setfield(L, -2, "height"); + lua_pushinteger(L, 0); + lua_setfield(L, -2, "width"); + + return 1; +} + diff --git a/build/utility.lua b/build/utility.lua new file mode 100644 index 0000000..b94a7ec --- /dev/null +++ b/build/utility.lua @@ -0,0 +1,424 @@ +-- +-- Yoink Build System +-- A pseudo-random collection of useful Lua functions. +-- +-- Copyright (c) 2011, Charles McGarvey +-- Distributable under the terms and conditions of the 2-clause BSD +-- license; see the file COPYING for a complete text of the license. +-- + +local M = { + logfile = "config.log" +} + + +-- Sometimes it is useful to iterate over an array with gaps or sections of +-- nil values, skipping over such empty sections. This function, like the +-- standard ipairs, creates an iterator, except the iterator will look n +-- indices past any nil key it finds. The argument n should be given as +-- the largest possible number of consecutive nils; it defaults to 4. This +-- function can typically serve as a drop-in replacement for ipairs. +local function npairs(t, n) + n = tonumber(n) or 4 + return function(t, k) + for i = k + 1, k + n + do + local v = t[i] + if v ~= nil then return i, v end + end + end, t, 0 +end +M.npairs = npairs + + +-- Makes a copy of an object. For most objects, this just returns the +-- object that was passed. For tables, a new table will be created and the +-- contents of the original object will either be assigned or copied over, +-- depending on the mode. The mode enables deep copies; it is a string +-- which may be empty or contain any combination of subsets of "k", "v", +-- and "m" for copying keys, values and metatables, respectively. The +-- default behavior is to deep copy only the values. The subcopy argument +-- is the function to be called when making subcopies during a deep copy. +-- It may also be a table with keys equal to one or more of the copy modes +-- and values set as the subcopy function to use for the type of object +-- represented by the copy mode character identifier. +local function copy(object, mode, subcopy) + if type(object) ~= "table" then return object end + mode = mode or "v" + local copykey = function(object) return object end + local copyvalue, copymetatable = copykey, copykey + if type(subcopy) == "table" + then + if mode:find("k") and type(subcopy.k) == "function" + then + copykey = subcopy.k + end + if mode:find("v") and type(subcopy.v) == "function" + then + copyvalue = subcopy.v + end + if mode:find("m") and type(subcopy.m) == "function" + then + copymetatable = subcopy.m + end + else + if type(subcopy) ~= "function" then subcopy = copy end + if mode:find("k") then copykey = subcopy end + if mode:find("v") then copyvalue = subcopy end + if mode:find("m") then copymetatable = subcopy end + end + local new = {} + for key,value in pairs(object) do + new[copykey(key, mode)] = copyvalue(value, mode) + end + return setmetatable(new, copymetatable(getmetatable(object), mode)) +end +M.copy = copy + + +-- Like the standard table.concat function in all respects except values +-- are transformed by an optional function given; the function defaults to +-- tostring, so tables with objects for which the concatenate operator +-- cannot apply do not cause an error to be thrown. +local function concat(t, s, i, j, f) + f = f or tostring + return table.concat(copy(t, "v", f), s, i, j) +end +M.concat = concat + +-- Escape the argument, preparing it for passage through a shell parse. +local function escape(str) + return string.format("%q", tostring(str)) +end +M.escape = escape + +-- Run the test command with the given arguments. If the test passes, +-- returns true; false if the test fails. +local function test(...) + return os.execute(string.format("test %s", concat(arg, " ", 1, #arg, escape))) == 0 +end +M.test = test + + +-- Format a string with two pieces of text; the first bit of text is +-- printed as-is, and the next bit of text is printed left-justified with +-- an indent. The second bit of text is pushed to the right if the first +-- bit of text is too big. +local function align(text1, text2, indent) + text1 = text1 or "" + text2 = text2 or "" + indent = indent or 8 + local numSpaces = math.max(indent - #text1 - 1, 0) + for i = 0, numSpaces do text2 = " " .. text2 end + return text1 .. text2 +end +M.align = align + + +-- Remove the whitespace surrounding a string. +local function trim(str) + return (str:gsub("^%s*(.-)%s*$", "%1")) +end +M.trim = trim + +-- Trim the string and convert all sequences of whitespace to a single +-- space. +local function compact(str) + return trim(str:gsub("%s+", " ")) +end +M.compact = compact + + +-- Execute a command and return its output or nil if the command failed to +-- run. Use capture to specify which file descriptor to return. The exit +-- code of the command is also returned. +local function exec(command, capture) + capture = capture or "" + local tmpname = os.tmpname() + local full = string.format("%s %s>%q", command, tostring(capture), tmpname) + local code = os.execute(full) + local fd = io.open(tmpname) + local output = "" + if fd then output = fd:read("*a") fd:close() end + os.remove(tmpname) + if M.logfile + then + local fd = io.open(M.logfile, "a") + fd:write("\n# ", command, "\n", output, "# exit: ", code, "\n") + fd:close() + end + return trim(output), code +end +M.exec = exec + +-- Try to execute a command and return true if the command finished +-- successfully (with an exit code of zero). +local function try_run(command, dir) + if type(dir) == "string" then dir = string.format("cd %q && ", dir) else dir = "" end + local output, code= exec(string.format("%s%s", dir, command)) + return code == 0 +end +M.try_run = try_run + +-- Look for a command from a list that can complete successfully (with exit +-- code zero) given some arguments. Returns nil and an error string if +-- none were successful. +local function find_command(commands, args, dir) + if type(commands) ~= "table" then commands = {commands} end + if type(args) ~= "string" then args = "" end + local paths = os.getenv("PATH") + local found = false + for _,command in npairs(commands) + do + if command:byte() == 0x2F + then + if test("-x", command) + then + if try_run(command .. " " .. args, dir) then return command end + found = true + end + else + for path in paths:gmatch("([^:]*)") + do + local command = path .. "/" .. command + if test("-x", command) + then + if try_run(command .. " " .. args, dir) then return command end + found = true + end + end + end + if found then return nil, "command failed" end + return nil, "command not found" + end +end +M.find_command = find_command + + +local function make_tempdir(template) + local dir, code = exec(string.format("mktemp -d ${TMPDIR:-/tmp}/%q", template)) + if code == 0 then return dir end +end +M.make_tempdir = make_tempdir + + +local function pkgfind(libs, libdir) + local cmd = "pkg-config" + if type(libdir) == "string" and libdir ~= "" + then + cmd = string.format("PKG_CONFIG_PATH=%s/pkgconfig:$PKG_CONFIG_PATH %s", libdir, cmd) + end + local function invoke(package) return exec(cmd .. " " .. package) end + local packages, missing = {}, {} + for _,list in ipairs(libs:split("%S+")) + do + list = list:split("[^|]+") + local found = false + for _,package in ipairs(list) + do + local flags,code = invoke(package) + if code == 0 + then + table.insert(packages, package) + found = true + break + end + end + if not found then table.insert(missing, list[1]) end + end + if #missing == 0 then return concat(packages, " ") end + return nil, "One or more required packages are missing: " .. concat(missing, ", ") .. ". Please install them." +end +M.pkgfind = pkgfind + +-- A wrapper function for a call out to pkg-config. The first argument is +-- a string signifying what kind of flags to get, either CFLAGS, LIBS, or +-- LDFLAGS. The second argument is the list of libraries. Finally, the +-- last argument can be given as a path to libdir; it is used to add a new +-- path to PKG_CONFIG_PATH when searching for "pc" files. +local function pkgconfig(what, libs, libdir) + local cmd = "pkg-config" + if type(libdir) == "string" and libdir ~= "" + then + cmd = string.format("PKG_CONFIG_PATH=%s/pkgconfig:$PKG_CONFIG_PATH %s", libdir, cmd) + end + if what == "CFLAGS" or what == "CXXFLAGS" + then + return exec(cmd .. " --cflags " .. libs) + elseif what == "LIBS" + then + return exec(cmd .. " --libs-only-l " .. libs) + elseif what == "LDFLAGS" + then + local output, code = exec(cmd .. " --libs " .. libs) + output = output:gsub("%s%-l%S*", ""):gsub("^%-l%S*%s*", "") + return output, code + end + return exec(cmd .. " " .. libs) +end +M.pkgconfig = pkgconfig + + +-- Escape special characters of a pattern string. +local function escapePattern(str) + str = str:gsub("%%", "%%%%") + str = str:gsub("%^", "%%^") + str = str:gsub("%$", "%%$") + str = str:gsub("%(", "%%(") + str = str:gsub("%)", "%%)") + str = str:gsub("%.", "%%.") + str = str:gsub("%[", "%%[") + str = str:gsub("%]", "%%[") + str = str:gsub("%*", "%%*") + str = str:gsub("%+", "%%+") + str = str:gsub("%-", "%%-") + str = str:gsub("%?", "%%?") + return str +end + +-- A basic split function for strings. Give a pattern of a sequence which +-- should be matched and returns a table of matches. +function string:split(pattern) + local t = {} + self:gsub(pattern, function(seq) table.insert(t, seq) end) + return t +end + +-- Truncates a string to a certain length, appending an ellipsis if any +-- part of the string had to be chopped. +function string:truncate(length) + if length < #self then return self:sub(1, length - 3) .. "..." end + return self +end + + +-- Append a word (i.e. flag) to the end of the string. +function string:appendFlag(...) + for _,flag in ipairs(arg) + do + if self == "" then self = flag + else self = string.format("%s %s", self, flag) end + end + return self +end + +-- Set the flag by appending it to the end of the string unless it already +-- exists somewhere else in the string. Note: The command line isn't +-- parsed; a simple search is used to determined if a flag is set. +function string:setFlag(...) + for _,flag in ipairs(arg) + do + local escaped = escapePattern(flag) + if not self:match(escaped) then self = self:appendFlag(flag) end + end + return self +end + +-- Remove all matching flags from a string. Note: The command line isn't +-- parsed; a simple search and replace is used to determine where a flag is +-- set. +function string:unsetFlag(...) + for _,flag in ipairs(arg) + do + flag = escapePattern(flag) + self = self:gsub("^"..flag.."$", "") + self = self:gsub("^"..flag.."%s", "") + self = self:gsub("%s"..flag.."$", "") + self = self:gsub("%s"..flag, "") + end + return self +end + +-- Replace all matching flags from a string with a new flag. The old flag +-- is parsed as a pattern, just like a substitution. Each flag matching +-- the pattern is replaced by the new flag, but if no replacements are +-- made, the new flag is appended to the string. +function string:replaceFlag(old, new) + local count + self, count = self:gsub(old, new) + if count < 1 then self = self:appendFlag(new) end + return self +end + + +do + local colorCount = exec("tput colors") + local isTTY = test("-t", 1) + + -- The logging facility is exported by way of this printer generator. + -- Pass a format and attribute string and get a function to print to + -- stdout. Attributes will only be used if stdout is a terminal with + -- at least eight colors. All arguments are optional; the default + -- format mimics the return print function regarding only the first + -- argument. + local function printer(format, attrib) + format = tostring(format or "%s\n") + if type(attrib) == "string" and isTTY and 8 <= tonumber(colorCount) + then + return function(...) + io.write(string.format("[%sm%s", attrib, string.format(format, ...))) + end + else + return function(...) + io.write(string.format(format, ...)) + end + end + end + M.printer = printer +end + + +-- Symbolize a name; that is, convert a string such that it would make a +-- good filename. The string is converted to lower case and series of +-- non-alphanumeric characters are converted to hyphens. +local function symbolize(name) + return name:lower():gsub("%W+", "-") +end +M.symbolize = symbolize + +-- Take a standard version number with three parts and separate the parts +-- into major, minor, and revision components. +local function splitVersion(version) + local vmajor, vminor, vrevis = version:match("^(%d*)%.?(%d*)%.?(%d*)") + vmajor = tonumber(vmajor) or 0 + vminor = tonumber(vminor) or 0 + vrevis = tonumber(vrevis) or 0 + return vmajor, vminor, vrevis +end +M.splitVersion = splitVersion + + +-- Create a new class type. Pass one or more parent classes for +-- inheritence. +local function class(...) + local c = {__init = function() end} + local s = {} + for _,super in ipairs(arg) + do + for key,value in pairs(super) do c[key] = value end + table.insert(s, super) + end + c.__index = c + c.__super = s + local m = {} + function m:__call(...) + local o = setmetatable({}, c) o:__init(...) return o + end + function c:isa(c) + local function recurse(a, b) + if a == b then return true end + for _,super in ipairs(a.__super) + do + if recurse(super, b) then return true end + end + return false + end + return recurse(getmetatable(self), c) + end + return setmetatable(c, m) +end +M.class = class + + +return M + diff --git a/configure b/configure index 8cc0b0d..09df45f 100755 --- a/configure +++ b/configure @@ -1,607 +1,34 @@ -#!/usr/bin/env lua +#!/bin/sh --- --- Yoink --- Execute this file to configure the build system. --- +# +# Yoink +# Execute this file to configure the build system. +# --- Define project, version, tarname, website, and contact. -project = "Yoink" -version = "0.1" -tarname = project:lower():gsub("%s+", "-") -website = "http://www.dogcows.com/yoink" -contact = "onefriedrice@brokenzipper.com" - - --- This script will create three different config files from three tables --- with values determined by the host and configuration options: --- --- The table `config' contains key-value pairs to be written to the file --- `config.h' which is included by sources files. Boolean values will --- either #define or #undef the key with no associated values. String --- values will be defined as quoted strings while any other value, --- particularly numbers, will be defined unquoted. --- --- The table `define' contains key-value pairs to be written to the file --- `config.mk' which is included by the Makefile. Values are assigned to --- their keys as they are, unquoted. --- --- The table `export' contains key-value pairs to be written to the file --- `config.sed' which is used by sed to perform search-and-replace on files --- containing @REPLACE_ME@-style keywords. When used with sed, such --- keyworded keys will be replaced by their values as they are, unquoted. - - -function show_help() - print([[ - -This script prepares ]]..project..[[ for building on your system. -Usage: ./configure [OPTION]... [VAR=VALUE]... - -This is NOT an autoconf-generated configure script, though it was written -to be familiar by supporting many of the same options. - -Basic configuration: - -h, --help display this help and exit - --host=HOST cross-compile the program to run on HOST - - --prefix=DIR base directory to install programs to - --bindir=DIR directory to install executables - --datadir=DIR directory to install shared data files - --mandir=DIR directory to install manual pages - - --disable-dependency-tracking speed up one-time builds (maybe) - --disable-special-linking do not use direct dependency minimizer - --enable-profile compile in gprof profiling instructions - -Program options: - --enable-clock_gettime use a very accurate timing function - --enable-debug compile in assertion checks and other debug helps - --enable-double-precision use larger floating-point numbers - --enable-hotload automatically reload modified game assets - --enable-threads use threads for concurrency where appropriate - - --with-gtk use the gtk2 toolkit (overrides --with-qt4) - --with-qt4 use the qt4 gui toolkit -]]) -end - - --- --- Setup a temporary file to collect error messages. --- - -config_log = "config.log" -os.remove(config_log) - - --- --- Define some useful functions. --- - --- Return true if a file exists, false otherwise. -function file_exists(path) - return os.execute(string.format("test -f %q", path)) == 0 -end - --- Print an error message and exit with an error. -function die(...) - for i,value in ipairs(arg) do - print("fatal: "..tostring(value)) - end - if file_exists(config_log) then - print() - print("Look through the file `config.log' for more information:\n") - os.execute("tail "..config_log) - end - os.exit(1) -end - --- Execute a command and return its output or nil if the command failed to --- run. -function backtick_run(command) - os.execute("echo '# "..command.."' >>"..config_log) - local fd = io.popen(command.." 2>>"..config_log) - if fd then - local stdout = fd:read("*l") - fd:close() - return stdout - end - return nil -end - --- Try to execute a command and return true if the command finished --- successfully (with an exit code of zero). -function try_run(command) - os.execute("echo '# "..command.."' >>"..config_log) - return os.execute(command.." >/dev/null 2>>"..config_log) == 0 -end - --- Remove the whitespace surrounding a string. -function trim(str) - str = str:gsub("^%s+", "") - return str:gsub("%s+$", "") -end - --- Trim the string and convert all sequences of whitespace to a single --- space. -function reduce_whitespace(str) - str = str:gsub("%s+", " ") - return trim(str) -end - --- Get the CFLAGS from pkg-config for the passed libraries. -function pkg_config_cflags(libs) - local env = "PKG_CONFIG_PATH="..libdir.."/pkgconfig:$PKG_CONFIG_PATH" - local cmd = env.." pkg-config" - return backtick_run(cmd.." --cflags "..libs) -end - --- Get the LDFLAGS from pkg-config for the passed libraries. -function pkg_config_ldflags(libs) - local env = "PKG_CONFIG_PATH="..libdir.."/pkgconfig:$PKG_CONFIG_PATH" - local cmd = env.." pkg-config" - return (" "..backtick_run(cmd.." --libs "..libs)):gsub("%s%-l%S*", "") -end - --- Get the LIBS flags from pkg-config for the passed libraries. -function pkg_config_libs(libs) - local env = "PKG_CONFIG_PATH="..libdir.."/pkgconfig:$PKG_CONFIG_PATH" - local cmd = env.." pkg-config" - return backtick_run(cmd.." --libs-only-l "..libs) -end - --- Add a flag to the CFLAGS and CXXFLAGS variables. -function add_cflag(flag) - if CFLAGS == "" then - CFLAGS = flag - else - CFLAGS = string.format("%s %s", CFLAGS, flag) - end - if CXXFLAGS == "" then - CXXFLAGS = flag - else - CXXFLAGS = string.format("%s %s", CXXFLAGS, flag) - end -end - --- Replace a flag in the CFLAGS and CXXFLAGS variables. -function set_cflag(flag) - local cflag_set, cxxflag_set = false, false - CFLAGS = CFLAGS:gsub("%"..flag:sub(1, 2).."%S+", function() - cflag_set = true - return flag - end) - CXXFLAGS = CXXFLAGS:gsub("%"..flag:sub(1, 2).."%S+", function() - cxxflag_set = true - return flag - end) - if not cflag_set or not cxxflag_set then add_cflag(flag) end -end - --- Look for a command from a list that can complete successfully (with exit --- code zero) given some arguments. Returns nil if none were successful. -function find_command(commands, args) - if not args then args = "" end - for i,command in ipairs(commands) do - if try_run(command.." "..args) then return command end - end - return nil -end - - --- --- Perform a quick sanity check. --- - -if not file_exists("configure") or not file_exists("Makefile") then - -- This script doesn't support out-of-tree builds. - die("You must `cd' to the project root where the Makefile is.") -end - - --- --- Parse the command-line options. --- - --- This script supports many of the options provided by autoconf-generated --- scripts. In particular, all the directory-related options are --- supported, including --prefix, --exec-prefix, and all the --dirDIR --- options for configuring installation paths. If passed, the option --- parsing routine below will place these options in the global namespace --- (i.e. prefix, eprefix, bindir, datadir, etc). --- --- Feature and package options are also supported. The value of any option --- of the form --enable-OPT= and --with-OPT= can be obtained with the --- functions get_feature and get_package, respectively. Like --- autoconf-generated scripts, passing --disable-OPT or --without-OPT is --- equivalent to passing --enable-OPT=no and --without-OPT=no, --- respectively. Values that are either yes or no are interpreted as --- booleans. Any other values are interpreted as strings. --- --- Definitions of the form KEY=VALUE are also supported. If passed, the --- option parsing routine below will place these options in the global --- namespace. --- --- Finally, the options -h, --help, and --host are also supported, the --- former two calling the show_help function and the latter setting the --- host global variable. - -do - local features = {} - local packages = {} - local handlers = {} - - - -- Define the option-parsing rules and handlers. - - handlers["--help"] = function() - show_help() - os.exit(0) - end - handlers["-h"] = handlers["--help"] - - handlers["--host=(.+)"] = function(triplet) - host = triplet - cross_compile = true - end - - local add_feature = function(feature, value) - if value == "yes" or value == "" then value = true end - if value == "no" then value = false end - features[feature] = value - end - handlers["--enable%-([%w_-]+)=?(.*)"] = add_feature - handlers["--disable%-([%w_-]+)"] = function(feature) - add_feature(feature, "no") - end - - local add_package = function(package, value) - if value == "yes" or value == "" then value = true end - if value == "no" then value = false end - packages[package] = value - end - handlers["--with%-([%w_-]+)=?(.*)"] = add_package - handlers["--without%-([%w_-]+)"] = function(package) - add_package(package, "no") - end - - handlers["--(%l+)dir=(.+)"] = function(dir, path) - _G[dir.."dir"] = path - end - handlers["--prefix=(.+)"] = function(path) - prefix = path - end - handlers["--exec-prefix=(.+)"] = function(path) - eprefix = path - end - - handlers["([%w_]+)=(.*)"] = function(key, value) - _G[key] = value - end - - - -- Define the feature and package accessors. - - function get_feature(feature) return features[feature] end - function get_package(package) return packages[package] end - - - -- Now read and parse the command-line options. - - local function parse_arg(arg) - for key,value in pairs(handlers) do - local matches = {arg:match(key)} - if matches[1] then value(unpack(matches)) return end - end - print("warning: unknown or incomplete argument "..arg) - end - - for i,arg in ipairs(arg) do - parse_arg(arg) - end - - - -- Define default values for significant variables. - - local function define(symbol, value) - if not _G[symbol] then _G[symbol] = value end - end - - define("CC", "") - define("CXX", "") - define("AR", "") - define("RANLIB", "") - define("WINDRES", "") - - define("CFLAGS", "-g -O2") - define("CXXFLAGS", CFLAGS) - define("LDFLAGS", "") - define("LIBS", "") - - define("host", backtick_run("tools/config.guess")) - define("alt_host", backtick_run("tools/config.sub "..host)) - - define("prefix", "/usr/local") - define("eprefix", prefix) - define("bindir", eprefix.."/bin") - define("sbindir", eprefix.."/sbin") - define("libexecdir", eprefix.."/libexec") - define("sysconfdir", prefix.."/etc") - define("localstatedir", prefix.."/var") - define("libdir", eprefix.."/lib") - define("includedir", prefix.."/include") - define("datarootdir", prefix.."/share") - define("datadir", datarootdir.."/"..tarname) - define("infodir", datarootdir.."/info") - define("localedir", datarootdir.."/locale") - define("mandir", datarootdir.."/man") - define("docdir", datarootdir.."/doc/"..tarname) - - if features["dependency-tracking"] == nil then - features["dependency-tracking"] = true - end - - if features["special-linking"] == nil then - features["special-linking"] = true - end - - define("config", {}) - define("define", {}) - define("export", {}) -end - - --- --- Determine special target platforms. --- - --- Win32 has some special cases related to its resource file, src/yoinkrc. -if host:match("mingw32") then platform = "win32" end - - --- --- Look for a working toolchain. --- - -print("Please wait...") - --- Check for CC. -tmpname = os.tmpname()..".c" -tmpfile, err = io.open(tmpname, "w") -if tmpfile then - tmpfile:write([[ -#include -int main() -{ - printf("Hello world!\n"); - return 0; +die () { + while read line; do echo $line; done && exit ${1:-127} } -]]) - tmpfile:close() - - function extra() if not cross_compile then return "gcc", "cc" end end - CC = find_command({ - CC, - host.."-gcc", host.."-cc", - alt_host.."-gcc", alt_host.."-cc", - extra()}, tmpname.." -o "..tmpname..".tmp") - os.remove(tmpname) - os.remove(tmpname..".tmp") - if not CC then die("Can't find a working C compiler.") end -else - die("failed to create temporary file: "..err) -end - --- Check for CXX. -tmpname = os.tmpname()..".cpp" -tmpfile, err = io.open(tmpname, "w") -if tmpfile then - tmpfile:write([[ -#include -int main() -{ - std::cout << "Hello world!" << std::endl; - return 0; -} -]]) - tmpfile:close() - - function extra() if not cross_compile then return "g++", "c++" end end - CXX = find_command({ - CXX, - host.."-g++", host.."-c++", - alt_host.."-g++", alt_host.."-c++", - extra()}, tmpname.." -o "..tmpname..".tmp") - os.remove(tmpname) - os.remove(tmpname..".tmp") - if not CXX then die("Can't find a working C++ compiler.") end -else - die("failed to create temporary file: "..err) -end - --- Check for AR. -do - function extra() if not cross_compile then return "ar" end end - AR = find_command({ - AR, - host.."-ar", - alt_host.."-ar", - extra()}, "--version") - if not AR then die("Can't find a working archiver.") end -end - --- Check for RANLIB. -do - function extra() if not cross_compile then return "ranlib" end end - RANLIB = find_command({ - RANLIB, - host.."-ranlib", - alt_host.."-ranlib", - extra()}, "--version") - if not RANLIB then die("Can't find a working library indexer.") end -end - --- Check for WINDRES. -if platform == "win32" then - function extra() if not cross_compile then return "windres" end end - WINDRES = find_command({ - WINDRES, - host.."-windres", - alt_host.."-windres", - extra()}, "--version") - if not WINDRES then die("Can't find a working resource compiler.") end -end - - --- --- Configure the features and packages. --- - -if get_feature("debug") then - set_cflag("-O0") - add_cflag("-Wall -Wno-uninitialized") - config.DEBUG = true -else - config.NDEBUG = true -end - -config.ENABLE_CLOCK_GETTIME = get_feature("clock_gettime") -config.ENABLE_DOUBLE_PRECISION = get_feature("double-precision") -config.ENABLE_HOTLOADING = get_feature("hotload") -config.ENABLE_THREADS = get_feature("threads") -if get_feature("profile") then - config.ENABLE_PROFILING = true - add_cflag("-pg") - LDFLAGS = LDFLAGS .. "-pg" -end - -if get_package("gtk") then config.WITH_GTK = true end -if get_package("qt4") then config.WITH_QT4 = true end - - --- --- Check for the libraries we need. --- - -do - local dependencies = "sdl gl glu libpng openal vorbisfile lua" - - if get_package("gtk") then - dependencies = dependencies.." gtk+-2.0" - elseif get_package("qt4") then - dependencies = dependencies.." QtGui" - end - - add_cflag(pkg_config_cflags(dependencies)) - LDFLAGS = LDFLAGS .." "..pkg_config_ldflags(dependencies) - LIBS = LIBS .." "..pkg_config_libs(dependencies) - - if platform == "win32" then - LIBS = LIBS.." -lws2_32" - exe_extension = ".exe" - else - exe_extension = "" - end -end - - --- --- Define the exports and definitions. --- - -if platform == "win32" then - -- These are used in src/yoink.rc. - local vmajor, vminor, vrevis = version:match("^(%d*)%.?(%d*)%.?(%d*)") - config.VERSION_MAJOR = tonumber(vmajor) or 0 - config.VERSION_MINOR = tonumber(vminor) or 0 - config.VERSION_REVISION = tonumber(vrevis) or 0 -end - -config.PACKAGE = tarname -config.PACKAGE_NAME = project -config.PACKAGE_VERSION = version -config.PACKAGE_STRING = project.." "..version -config.PACKAGE_TARNAME = tarname -config.PACKAGE_URL = website -config.PACKAGE_BUGREPORT = contact -config.YOINK_GITHEAD = backtick_run("git describe master") -config.YOINK_DATADIR = datadir - -define.PACKAGE = project -define.TARNAME = tarname.."-"..version -define.TARGET = host -define.PLATFORM = platform -define.CC = CC -define.CXX = CXX -define.AR = AR -define.RANLIB = RANLIB -define.WINDRES = WINDRES -define.CFLAGS = reduce_whitespace(CFLAGS) -define.CXXFLAGS = reduce_whitespace(CXXFLAGS) -define.LDFLAGS = reduce_whitespace(LDFLAGS) -define.LIBS = reduce_whitespace(LIBS) -define.prefix = prefix -define.bindir = bindir -define.datadir = datadir -define.mandir = mandir -define.EXEEXT = exe_extension -define.DEP_TRACKING = get_feature("dependency-tracking") -define.DEP_MINIMIZING = get_feature("special-linking") - -export.datadir = datadir -- Used in doc/yoink.6.in. -export.PACKAGE_BUGREPORT = contact -- Used in doc/yoink.6.in. - - --- --- All done; output the configuration files. --- - --- Output the program options. -output = io.open("config.h", "w") -for key,value in pairs(config) do - key = tostring(key) - if type(value) == "boolean" then - if value then - output:write("#define "..key.." 1") - else - output:write("#undef "..key) - end - elseif type(value) == "string" then - output:write(string.format("#define %s %q", key, tostring(value))) - else - output:write(string.format("#define %s %s", key, tostring(value))) - end - output:write("\n") -end -output:close() - --- Output the make definitions. -output = io.open("config.mk", "w") -for key,value in pairs(define) do - key = tostring(key) - value = tostring(value) - output:write(string.format("%s = %s\n", key, value)) -end -output:close() - --- Output the exported variables. -output = io.open("config.sed", "w") -for key,value in pairs(export) do - key = key:gsub("/", "\\/") - value = value:gsub("/", "\\/") - output:write(string.format("s/@%s@/%s/g\n", key, value)) -end -output:close() +[ -f build/config.lua ] || die 1 <<"END" +You must first `cd' to the project directory root where the Makefile is. +There is no support for out-of-tree builds. +END +LUA=${LUA:-lua} +"$LUA" -v >/dev/null 2>&1 || die 2 </dev/null && \ + ! (cd build && ${MAKE:-make} dialog) && die 3 <, -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. Neither the name of the nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. diff --git a/doc/licenses/BSD-2 b/doc/licenses/BSD-2 deleted file mode 100644 index a995d54..0000000 --- a/doc/licenses/BSD-2 +++ /dev/null @@ -1,23 +0,0 @@ -Copyright (c) , -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. diff --git a/doc/licenses/Boost-1.0 b/doc/licenses/Boost-1.0 deleted file mode 100644 index 1dad8e9..0000000 --- a/doc/licenses/Boost-1.0 +++ /dev/null @@ -1,23 +0,0 @@ -Boost Software License - Version 1.0 - August 17th, 2003 - -Permission is hereby granted, free of charge, to any person or organization -obtaining a copy of the software and accompanying documentation covered by -this license (the "Software") to use, reproduce, display, distribute, -execute, and transmit the Software, and to prepare derivative works of the -Software, and to permit third-parties to whom the Software is furnished to -do so, all subject to the following: - -The copyright notices in the Software and this entire statement, including -the above license grant, this restriction and the following disclaimer, -must be included in all copies of the Software, in whole or in part, and -all derivative works of the Software, unless such copies or derivative -works are solely in the form of machine-executable object code generated by -a source language processor. - -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, TITLE AND NON-INFRINGEMENT. IN NO EVENT -SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE -FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -DEALINGS IN THE SOFTWARE. diff --git a/doc/licenses/CCPL-Attribution-ShareAlike-NonCommercial-2.5 b/doc/licenses/CCPL-Attribution-ShareAlike-NonCommercial-2.5 deleted file mode 100644 index 2610a73..0000000 --- a/doc/licenses/CCPL-Attribution-ShareAlike-NonCommercial-2.5 +++ /dev/null @@ -1,281 +0,0 @@ -Creative Commons Legal Code - -*Attribution-NonCommercial-ShareAlike 2.5* - -CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE -LEGAL SERVICES. DISTRIBUTION OF THIS LICENSE DOES NOT CREATE AN -ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS INFORMATION -ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES REGARDING THE -INFORMATION PROVIDED, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM -ITS USE. - -/License/ - -THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE -COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY -COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS -AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED. - -BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE -TO BE BOUND BY THE TERMS OF THIS LICENSE. THE LICENSOR GRANTS YOU THE -RIGHTS CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS -AND CONDITIONS. - -*1. Definitions* - - 1. *"Collective Work"* means a work, such as a periodical issue, - anthology or encyclopedia, in which the Work in its entirety in - unmodified form, along with a number of other contributions, - constituting separate and independent works in themselves, are - assembled into a collective whole. A work that constitutes a - Collective Work will not be considered a Derivative Work (as - defined below) for the purposes of this License. - 2. *"Derivative Work"* means a work based upon the Work or upon the - Work and other pre-existing works, such as a translation, musical - arrangement, dramatization, fictionalization, motion picture - version, sound recording, art reproduction, abridgment, - condensation, or any other form in which the Work may be recast, - transformed, or adapted, except that a work that constitutes a - Collective Work will not be considered a Derivative Work for the - purpose of this License. For the avoidance of doubt, where the - Work is a musical composition or sound recording, the - synchronization of the Work in timed-relation with a moving image - ("synching") will be considered a Derivative Work for the purpose - of this License. - 3. *"Licensor"* means the individual or entity that offers the Work - under the terms of this License. - 4. *"Original Author"* means the individual or entity who created the - Work. - 5. *"Work"* means the copyrightable work of authorship offered under - the terms of this License. - 6. *"You"* means an individual or entity exercising rights under this - License who has not previously violated the terms of this License - with respect to the Work, or who has received express permission - from the Licensor to exercise rights under this License despite a - previous violation. - 7. *"License Elements"* means the following high-level license - attributes as selected by Licensor and indicated in the title of - this License: Attribution, Noncommercial, ShareAlike. - -*2. Fair Use Rights.* Nothing in this license is intended to reduce, -limit, or restrict any rights arising from fair use, first sale or other -limitations on the exclusive rights of the copyright owner under -copyright law or other applicable laws. - -*3. License Grant.* Subject to the terms and conditions of this License, -Licensor hereby grants You a worldwide, royalty-free, non-exclusive, -perpetual (for the duration of the applicable copyright) license to -exercise the rights in the Work as stated below: - - 1. to reproduce the Work, to incorporate the Work into one or more - Collective Works, and to reproduce the Work as incorporated in the - Collective Works; - 2. to create and reproduce Derivative Works; - 3. to distribute copies or phonorecords of, display publicly, perform - publicly, and perform publicly by means of a digital audio - transmission the Work including as incorporated in Collective Works; - 4. to distribute copies or phonorecords of, display publicly, perform - publicly, and perform publicly by means of a digital audio - transmission Derivative Works; - -The above rights may be exercised in all media and formats whether now -known or hereafter devised. The above rights include the right to make -such modifications as are technically necessary to exercise the rights -in other media and formats. All rights not expressly granted by Licensor -are hereby reserved, including but not limited to the rights set forth -in Sections 4(e) and 4(f). - -*4. Restrictions.*The license granted in Section 3 above is expressly -made subject to and limited by the following restrictions: - - 1. You may distribute, publicly display, publicly perform, or - publicly digitally perform the Work only under the terms of this - License, and You must include a copy of, or the Uniform Resource - Identifier for, this License with every copy or phonorecord of the - Work You distribute, publicly display, publicly perform, or - publicly digitally perform. You may not offer or impose any terms - on the Work that alter or restrict the terms of this License or - the recipients' exercise of the rights granted hereunder. You may - not sublicense the Work. You must keep intact all notices that - refer to this License and to the disclaimer of warranties. You may - not distribute, publicly display, publicly perform, or publicly - digitally perform the Work with any technological measures that - control access or use of the Work in a manner inconsistent with - the terms of this License Agreement. The above applies to the Work - as incorporated in a Collective Work, but this does not require - the Collective Work apart from the Work itself to be made subject - to the terms of this License. If You create a Collective Work, - upon notice from any Licensor You must, to the extent practicable, - remove from the Collective Work any credit as required by clause - 4(d), as requested. If You create a Derivative Work, upon notice - from any Licensor You must, to the extent practicable, remove from - the Derivative Work any credit as required by clause 4(d), as - requested. - 2. You may distribute, publicly display, publicly perform, or - publicly digitally perform a Derivative Work only under the terms - of this License, a later version of this License with the same - License Elements as this License, or a Creative Commons iCommons - license that contains the same License Elements as this License - (e.g. Attribution-NonCommercial-ShareAlike 2.5 Japan). You must - include a copy of, or the Uniform Resource Identifier for, this - License or other license specified in the previous sentence with - every copy or phonorecord of each Derivative Work You distribute, - publicly display, publicly perform, or publicly digitally perform. - You may not offer or impose any terms on the Derivative Works that - alter or restrict the terms of this License or the recipients' - exercise of the rights granted hereunder, and You must keep intact - all notices that refer to this License and to the disclaimer of - warranties. You may not distribute, publicly display, publicly - perform, or publicly digitally perform the Derivative Work with - any technological measures that control access or use of the Work - in a manner inconsistent with the terms of this License Agreement. - The above applies to the Derivative Work as incorporated in a - Collective Work, but this does not require the Collective Work - apart from the Derivative Work itself to be made subject to the - terms of this License. - 3. You may not exercise any of the rights granted to You in Section 3 - above in any manner that is primarily intended for or directed - toward commercial advantage or private monetary compensation. The - exchange of the Work for other copyrighted works by means of - digital file-sharing or otherwise shall not be considered to be - intended for or directed toward commercial advantage or private - monetary compensation, provided there is no payment of any - monetary compensation in connection with the exchange of - copyrighted works. - 4. If you distribute, publicly display, publicly perform, or publicly - digitally perform the Work or any Derivative Works or Collective - Works, You must keep intact all copyright notices for the Work and - provide, reasonable to the medium or means You are utilizing: (i) - the name of the Original Author (or pseudonym, if applicable) if - supplied, and/or (ii) if the Original Author and/or Licensor - designate another party or parties (e.g. a sponsor institute, - publishing entity, journal) for attribution in Licensor's - copyright notice, terms of service or by other reasonable means, - the name of such party or parties; the title of the Work if - supplied; to the extent reasonably practicable, the Uniform - Resource Identifier, if any, that Licensor specifies to be - associated with the Work, unless such URI does not refer to the - copyright notice or licensing information for the Work; and in the - case of a Derivative Work, a credit identifying the use of the - Work in the Derivative Work (e.g., "French translation of the Work - by Original Author," or "Screenplay based on original Work by - Original Author"). Such credit may be implemented in any - reasonable manner; provided, however, that in the case of a - Derivative Work or Collective Work, at a minimum such credit will - appear where any other comparable authorship credit appears and in - a manner at least as prominent as such other comparable authorship - credit. - 5. - - For the avoidance of doubt, where the Work is a musical composition: - - 1. *Performance Royalties Under Blanket Licenses*. Licensor - reserves the exclusive right to collect, whether - individually or via a performance rights society (e.g. - ASCAP, BMI, SESAC), royalties for the public performance or - public digital performance (e.g. webcast) of the Work if - that performance is primarily intended for or directed - toward commercial advantage or private monetary compensation. - 2. *Mechanical Rights and Statutory Royalties*. Licensor - reserves the exclusive right to collect, whether - individually or via a music rights agency or designated - agent (e.g. Harry Fox Agency), royalties for any phonorecord - You create from the Work ("cover version") and distribute, - subject to the compulsory license created by 17 USC Section - 115 of the US Copyright Act (or the equivalent in other - jurisdictions), if Your distribution of such cover version - is primarily intended for or directed toward commercial - advantage or private monetary compensation. - 6. *Webcasting Rights and Statutory Royalties*. For the avoidance of - doubt, where the Work is a sound recording, Licensor reserves the - exclusive right to collect, whether individually or via a - performance-rights society (e.g. SoundExchange), royalties for the - public digital performance (e.g. webcast) of the Work, subject to - the compulsory license created by 17 USC Section 114 of the US - Copyright Act (or the equivalent in other jurisdictions), if Your - public digital performance is primarily intended for or directed - toward commercial advantage or private monetary compensation. - -*5. Representations, Warranties and Disclaimer* - -UNLESS OTHERWISE MUTUALLY AGREED TO BY THE PARTIES IN WRITING, LICENSOR -OFFERS THE WORK AS-IS AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY -KIND CONCERNING THE WORK, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE, -INCLUDING, WITHOUT LIMITATION, WARRANTIES OF TITLE, MERCHANTIBILITY, -FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF -LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OF ABSENCE OF ERRORS, -WHETHER OR NOT DISCOVERABLE. SOME JURISDICTIONS DO NOT ALLOW THE -EXCLUSION OF IMPLIED WARRANTIES, SO SUCH EXCLUSION MAY NOT APPLY TO YOU. - -*6. Limitation on Liability.* EXCEPT TO THE EXTENT REQUIRED BY -APPLICABLE LAW, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL -THEORY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY -DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF -LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - -*7. Termination* - - 1. This License and the rights granted hereunder will terminate - automatically upon any breach by You of the terms of this License. - Individuals or entities who have received Derivative Works or - Collective Works from You under this License, however, will not - have their licenses terminated provided such individuals or - entities remain in full compliance with those licenses. Sections - 1, 2, 5, 6, 7, and 8 will survive any termination of this License. - 2. Subject to the above terms and conditions, the license granted - here is perpetual (for the duration of the applicable copyright in - the Work). Notwithstanding the above, Licensor reserves the right - to release the Work under different license terms or to stop - distributing the Work at any time; provided, however that any such - election will not serve to withdraw this License (or any other - license that has been, or is required to be, granted under the - terms of this License), and this License will continue in full - force and effect unless terminated as stated above. - -*8. Miscellaneous* - - 1. Each time You distribute or publicly digitally perform the Work or - a Collective Work, the Licensor offers to the recipient a license - to the Work on the same terms and conditions as the license - granted to You under this License. - 2. Each time You distribute or publicly digitally perform a - Derivative Work, Licensor offers to the recipient a license to the - original Work on the same terms and conditions as the license - granted to You under this License. - 3. If any provision of this License is invalid or unenforceable under - applicable law, it shall not affect the validity or enforceability - of the remainder of the terms of this License, and without further - action by the parties to this agreement, such provision shall be - reformed to the minimum extent necessary to make such provision - valid and enforceable. - 4. No term or provision of this License shall be deemed waived and no - breach consented to unless such waiver or consent shall be in - writing and signed by the party to be charged with such waiver or - consent. - 5. This License constitutes the entire agreement between the parties - with respect to the Work licensed here. There are no - understandings, agreements or representations with respect to the - Work not specified here. Licensor shall not be bound by any - additional provisions that may appear in any communication from - You. This License may not be modified without the mutual written - agreement of the Licensor and You. - -Creative Commons is not a party to this License, and makes no warranty -whatsoever in connection with the Work. Creative Commons will not be -liable to You or any party on any legal theory for any damages -whatsoever, including without limitation any general, special, -incidental or consequential damages arising in connection to this -license. Notwithstanding the foregoing two (2) sentences, if Creative -Commons has expressly identified itself as the Licensor hereunder, it -shall have all rights and obligations of Licensor. - -Except for the limited purpose of indicating to the public that the Work -is licensed under the CCPL, neither party will use the trademark -"Creative Commons" or any related trademark or logo of Creative Commons -without the prior written consent of Creative Commons. Any permitted use -will be in compliance with Creative Commons' then-current trademark -usage guidelines, as may be published on its website or otherwise made -available upon request from time to time. - -Creative Commons may be contacted at http://creativecommons.org/ -. diff --git a/doc/licenses/LGPL-2 b/doc/licenses/LGPL-2 deleted file mode 100644 index 161a3d1..0000000 --- a/doc/licenses/LGPL-2 +++ /dev/null @@ -1,482 +0,0 @@ - GNU LIBRARY GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1991 Free Software Foundation, Inc. - 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - -[This is the first released version of the library GPL. It is - numbered 2 because it goes with version 2 of the ordinary GPL.] - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -Licenses are intended to guarantee your freedom to share and change -free software--to make sure the software is free for all its users. - - This license, the Library General Public License, applies to some -specially designated Free Software Foundation software, and to any -other libraries whose authors decide to use it. You can use it for -your libraries, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if -you distribute copies of the library, or if you modify it. - - For example, if you distribute copies of the library, whether gratis -or for a fee, you must give the recipients all the rights that we gave -you. You must make sure that they, too, receive or can get the source -code. If you link a program with the library, you must provide -complete object files to the recipients so that they can relink them -with the library, after making changes to the library and recompiling -it. And you must show them these terms so they know their rights. - - Our method of protecting your rights has two steps: (1) copyright -the library, and (2) offer you this license which gives you legal -permission to copy, distribute and/or modify the library. - - Also, for each distributor's protection, we want to make certain -that everyone understands that there is no warranty for this free -library. If the library is modified by someone else and passed on, we -want its recipients to know that what they have is not the original -version, so that any problems introduced by others will not reflect on -the original authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that companies distributing free -software will individually obtain patent licenses, thus in effect -transforming the program into proprietary software. To prevent this, -we have made it clear that any patent must be licensed for everyone's -free use or not licensed at all. - - Most GNU software, including some libraries, is covered by the ordinary -GNU General Public License, which was designed for utility programs. This -license, the GNU Library General Public License, applies to certain -designated libraries. This license is quite different from the ordinary -one; be sure to read it in full, and don't assume that anything in it is -the same as in the ordinary license. - - The reason we have a separate public license for some libraries is that -they blur the distinction we usually make between modifying or adding to a -program and simply using it. Linking a program with a library, without -changing the library, is in some sense simply using the library, and is -analogous to running a utility program or application program. However, in -a textual and legal sense, the linked executable is a combined work, a -derivative of the original library, and the ordinary General Public License -treats it as such. - - Because of this blurred distinction, using the ordinary General -Public License for libraries did not effectively promote software -sharing, because most developers did not use the libraries. We -concluded that weaker conditions might promote sharing better. - - However, unrestricted linking of non-free programs would deprive the -users of those programs of all benefit from the free status of the -libraries themselves. This Library General Public License is intended to -permit developers of non-free programs to use free libraries, while -preserving your freedom as a user of such programs to change the free -libraries that are incorporated in them. (We have not seen how to achieve -this as regards changes in header files, but we have achieved it as regards -changes in the actual functions of the Library.) The hope is that this -will lead to faster development of free libraries. - - The precise terms and conditions for copying, distribution and -modification follow. Pay close attention to the difference between a -"work based on the library" and a "work that uses the library". The -former contains code derived from the library, while the latter only -works together with the library. - - Note that it is possible for a library to be covered by the ordinary -General Public License rather than by this special one. - - GNU LIBRARY GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License Agreement applies to any software library which -contains a notice placed by the copyright holder or other authorized -party saying it may be distributed under the terms of this Library -General Public License (also called "this License"). Each licensee is -addressed as "you". - - A "library" means a collection of software functions and/or data -prepared so as to be conveniently linked with application programs -(which use some of those functions and data) to form executables. - - The "Library", below, refers to any such software library or work -which has been distributed under these terms. A "work based on the -Library" means either the Library or any derivative work under -copyright law: that is to say, a work containing the Library or a -portion of it, either verbatim or with modifications and/or translated -straightforwardly into another language. (Hereinafter, translation is -included without limitation in the term "modification".) - - "Source code" for a work means the preferred form of the work for -making modifications to it. For a library, complete source code means -all the source code for all modules it contains, plus any associated -interface definition files, plus the scripts used to control compilation -and installation of the library. - - Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running a program using the Library is not restricted, and output from -such a program is covered only if its contents constitute a work based -on the Library (independent of the use of the Library in a tool for -writing it). Whether that is true depends on what the Library does -and what the program that uses the Library does. - - 1. You may copy and distribute verbatim copies of the Library's -complete source code as you receive it, in any medium, provided that -you conspicuously and appropriately publish on each copy an -appropriate copyright notice and disclaimer of warranty; keep intact -all the notices that refer to this License and to the absence of any -warranty; and distribute a copy of this License along with the -Library. - - You may charge a fee for the physical act of transferring a copy, -and you may at your option offer warranty protection in exchange for a -fee. - - 2. You may modify your copy or copies of the Library or any portion -of it, thus forming a work based on the Library, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) The modified work must itself be a software library. - - b) You must cause the files modified to carry prominent notices - stating that you changed the files and the date of any change. - - c) You must cause the whole of the work to be licensed at no - charge to all third parties under the terms of this License. - - d) If a facility in the modified Library refers to a function or a - table of data to be supplied by an application program that uses - the facility, other than as an argument passed when the facility - is invoked, then you must make a good faith effort to ensure that, - in the event an application does not supply such function or - table, the facility still operates, and performs whatever part of - its purpose remains meaningful. - - (For example, a function in a library to compute square roots has - a purpose that is entirely well-defined independent of the - application. Therefore, Subsection 2d requires that any - application-supplied function or table used by this function must - be optional: if the application does not supply it, the square - root function must still compute square roots.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Library, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Library, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote -it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Library. - -In addition, mere aggregation of another work not based on the Library -with the Library (or with a work based on the Library) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may opt to apply the terms of the ordinary GNU General Public -License instead of this License to a given copy of the Library. To do -this, you must alter all the notices that refer to this License, so -that they refer to the ordinary GNU General Public License, version 2, -instead of to this License. (If a newer version than version 2 of the -ordinary GNU General Public License has appeared, then you can specify -that version instead if you wish.) Do not make any other change in -these notices. - - Once this change is made in a given copy, it is irreversible for -that copy, so the ordinary GNU General Public License applies to all -subsequent copies and derivative works made from that copy. - - This option is useful when you wish to copy part of the code of -the Library into a program that is not a library. - - 4. You may copy and distribute the Library (or a portion or -derivative of it, under Section 2) in object code or executable form -under the terms of Sections 1 and 2 above provided that you accompany -it with the complete corresponding machine-readable source code, which -must be distributed under the terms of Sections 1 and 2 above on a -medium customarily used for software interchange. - - If distribution of object code is made by offering access to copy -from a designated place, then offering equivalent access to copy the -source code from the same place satisfies the requirement to -distribute the source code, even though third parties are not -compelled to copy the source along with the object code. - - 5. A program that contains no derivative of any portion of the -Library, but is designed to work with the Library by being compiled or -linked with it, is called a "work that uses the Library". Such a -work, in isolation, is not a derivative work of the Library, and -therefore falls outside the scope of this License. - - However, linking a "work that uses the Library" with the Library -creates an executable that is a derivative of the Library (because it -contains portions of the Library), rather than a "work that uses the -library". The executable is therefore covered by this License. -Section 6 states terms for distribution of such executables. - - When a "work that uses the Library" uses material from a header file -that is part of the Library, the object code for the work may be a -derivative work of the Library even though the source code is not. -Whether this is true is especially significant if the work can be -linked without the Library, or if the work is itself a library. The -threshold for this to be true is not precisely defined by law. - - If such an object file uses only numerical parameters, data -structure layouts and accessors, and small macros and small inline -functions (ten lines or less in length), then the use of the object -file is unrestricted, regardless of whether it is legally a derivative -work. (Executables containing this object code plus portions of the -Library will still fall under Section 6.) - - Otherwise, if the work is a derivative of the Library, you may -distribute the object code for the work under the terms of Section 6. -Any executables containing that work also fall under Section 6, -whether or not they are linked directly with the Library itself. - - 6. As an exception to the Sections above, you may also compile or -link a "work that uses the Library" with the Library to produce a -work containing portions of the Library, and distribute that work -under terms of your choice, provided that the terms permit -modification of the work for the customer's own use and reverse -engineering for debugging such modifications. - - You must give prominent notice with each copy of the work that the -Library is used in it and that the Library and its use are covered by -this License. You must supply a copy of this License. If the work -during execution displays copyright notices, you must include the -copyright notice for the Library among them, as well as a reference -directing the user to the copy of this License. Also, you must do one -of these things: - - a) Accompany the work with the complete corresponding - machine-readable source code for the Library including whatever - changes were used in the work (which must be distributed under - Sections 1 and 2 above); and, if the work is an executable linked - with the Library, with the complete machine-readable "work that - uses the Library", as object code and/or source code, so that the - user can modify the Library and then relink to produce a modified - executable containing the modified Library. (It is understood - that the user who changes the contents of definitions files in the - Library will not necessarily be able to recompile the application - to use the modified definitions.) - - b) Accompany the work with a written offer, valid for at - least three years, to give the same user the materials - specified in Subsection 6a, above, for a charge no more - than the cost of performing this distribution. - - c) If distribution of the work is made by offering access to copy - from a designated place, offer equivalent access to copy the above - specified materials from the same place. - - d) Verify that the user has already received a copy of these - materials or that you have already sent this user a copy. - - For an executable, the required form of the "work that uses the -Library" must include any data and utility programs needed for -reproducing the executable from it. However, as a special exception, -the source code distributed need not include anything that is normally -distributed (in either source or binary form) with the major -components (compiler, kernel, and so on) of the operating system on -which the executable runs, unless that component itself accompanies -the executable. - - It may happen that this requirement contradicts the license -restrictions of other proprietary libraries that do not normally -accompany the operating system. Such a contradiction means you cannot -use both them and the Library together in an executable that you -distribute. - - 7. You may place library facilities that are a work based on the -Library side-by-side in a single library together with other library -facilities not covered by this License, and distribute such a combined -library, provided that the separate distribution of the work based on -the Library and of the other library facilities is otherwise -permitted, and provided that you do these two things: - - a) Accompany the combined library with a copy of the same work - based on the Library, uncombined with any other library - facilities. This must be distributed under the terms of the - Sections above. - - b) Give prominent notice with the combined library of the fact - that part of it is a work based on the Library, and explaining - where to find the accompanying uncombined form of the same work. - - 8. You may not copy, modify, sublicense, link with, or distribute -the Library except as expressly provided under this License. Any -attempt otherwise to copy, modify, sublicense, link with, or -distribute the Library is void, and will automatically terminate your -rights under this License. However, parties who have received copies, -or rights, from you under this License will not have their licenses -terminated so long as such parties remain in full compliance. - - 9. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Library or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Library (or any work based on the -Library), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Library or works based on it. - - 10. Each time you redistribute the Library (or any work based on the -Library), the recipient automatically receives a license from the -original licensor to copy, distribute, link with or modify the Library -subject to these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 11. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Library at all. For example, if a patent -license would not permit royalty-free redistribution of the Library by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Library. - -If any portion of this section is held invalid or unenforceable under any -particular circumstance, the balance of the section is intended to apply, -and the section as a whole is intended to apply in other circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 12. If the distribution and/or use of the Library is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Library under this License may add -an explicit geographical distribution limitation excluding those countries, -so that distribution is permitted only in or among countries not thus -excluded. In such case, this License incorporates the limitation as if -written in the body of this License. - - 13. The Free Software Foundation may publish revised and/or new -versions of the Library General Public License from time to time. -Such new versions will be similar in spirit to the present version, -but may differ in detail to address new problems or concerns. - -Each version is given a distinguishing version number. If the Library -specifies a version number of this License which applies to it and -"any later version", you have the option of following the terms and -conditions either of that version or of any later version published by -the Free Software Foundation. If the Library does not specify a -license version number, you may choose any version ever published by -the Free Software Foundation. - - 14. If you wish to incorporate parts of the Library into other free -programs whose distribution conditions are incompatible with these, -write to the author to ask for permission. For software which is -copyrighted by the Free Software Foundation, write to the Free -Software Foundation; we sometimes make exceptions for this. Our -decision will be guided by the two goals of preserving the free status -of all derivatives of our free software and of promoting the sharing -and reuse of software generally. - - NO WARRANTY - - 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO -WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. -EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR -OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY -KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE -LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME -THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN -WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY -AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU -FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR -CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE -LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING -RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A -FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF -SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGES. - - END OF TERMS AND CONDITIONS - - Appendix: How to Apply These Terms to Your New Libraries - - If you develop a new library, and you want it to be of the greatest -possible use to the public, we recommend making it free software that -everyone can redistribute and change. You can do so by permitting -redistribution under these terms (or, alternatively, under the terms of the -ordinary General Public License). - - To apply these terms, attach the following notices to the library. It is -safest to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least the -"copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, - MA 02111-1307, USA - -Also add information on how to contact you by electronic and paper mail. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the library, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the - library `Frob' (a library for tweaking knobs) written by James Random Hacker. - - , 1 April 1990 - Ty Coon, President of Vice - -That's all there is to it! diff --git a/doc/licenses/LGPL-2.1 b/doc/licenses/LGPL-2.1 deleted file mode 100644 index 8add30a..0000000 --- a/doc/licenses/LGPL-2.1 +++ /dev/null @@ -1,504 +0,0 @@ - GNU LESSER GENERAL PUBLIC LICENSE - Version 2.1, February 1999 - - Copyright (C) 1991, 1999 Free Software Foundation, Inc. - 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - -[This is the first released version of the Lesser GPL. It also counts - as the successor of the GNU Library Public License, version 2, hence - the version number 2.1.] - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -Licenses are intended to guarantee your freedom to share and change -free software--to make sure the software is free for all its users. - - This license, the Lesser General Public License, applies to some -specially designated software packages--typically libraries--of the -Free Software Foundation and other authors who decide to use it. You -can use it too, but we suggest you first think carefully about whether -this license or the ordinary General Public License is the better -strategy to use in any particular case, based on the explanations below. - - When we speak of free software, we are referring to freedom of use, -not price. Our General Public Licenses are designed to make sure that -you have the freedom to distribute copies of free software (and charge -for this service if you wish); that you receive source code or can get -it if you want it; that you can change the software and use pieces of -it in new free programs; and that you are informed that you can do -these things. - - To protect your rights, we need to make restrictions that forbid -distributors to deny you these rights or to ask you to surrender these -rights. These restrictions translate to certain responsibilities for -you if you distribute copies of the library or if you modify it. - - For example, if you distribute copies of the library, whether gratis -or for a fee, you must give the recipients all the rights that we gave -you. You must make sure that they, too, receive or can get the source -code. If you link other code with the library, you must provide -complete object files to the recipients, so that they can relink them -with the library after making changes to the library and recompiling -it. And you must show them these terms so they know their rights. - - We protect your rights with a two-step method: (1) we copyright the -library, and (2) we offer you this license, which gives you legal -permission to copy, distribute and/or modify the library. - - To protect each distributor, we want to make it very clear that -there is no warranty for the free library. Also, if the library is -modified by someone else and passed on, the recipients should know -that what they have is not the original version, so that the original -author's reputation will not be affected by problems that might be -introduced by others. - - Finally, software patents pose a constant threat to the existence of -any free program. We wish to make sure that a company cannot -effectively restrict the users of a free program by obtaining a -restrictive license from a patent holder. Therefore, we insist that -any patent license obtained for a version of the library must be -consistent with the full freedom of use specified in this license. - - Most GNU software, including some libraries, is covered by the -ordinary GNU General Public License. This license, the GNU Lesser -General Public License, applies to certain designated libraries, and -is quite different from the ordinary General Public License. We use -this license for certain libraries in order to permit linking those -libraries into non-free programs. - - When a program is linked with a library, whether statically or using -a shared library, the combination of the two is legally speaking a -combined work, a derivative of the original library. The ordinary -General Public License therefore permits such linking only if the -entire combination fits its criteria of freedom. The Lesser General -Public License permits more lax criteria for linking other code with -the library. - - We call this license the "Lesser" General Public License because it -does Less to protect the user's freedom than the ordinary General -Public License. It also provides other free software developers Less -of an advantage over competing non-free programs. These disadvantages -are the reason we use the ordinary General Public License for many -libraries. However, the Lesser license provides advantages in certain -special circumstances. - - For example, on rare occasions, there may be a special need to -encourage the widest possible use of a certain library, so that it becomes -a de-facto standard. To achieve this, non-free programs must be -allowed to use the library. A more frequent case is that a free -library does the same job as widely used non-free libraries. In this -case, there is little to gain by limiting the free library to free -software only, so we use the Lesser General Public License. - - In other cases, permission to use a particular library in non-free -programs enables a greater number of people to use a large body of -free software. For example, permission to use the GNU C Library in -non-free programs enables many more people to use the whole GNU -operating system, as well as its variant, the GNU/Linux operating -system. - - Although the Lesser General Public License is Less protective of the -users' freedom, it does ensure that the user of a program that is -linked with the Library has the freedom and the wherewithal to run -that program using a modified version of the Library. - - The precise terms and conditions for copying, distribution and -modification follow. Pay close attention to the difference between a -"work based on the library" and a "work that uses the library". The -former contains code derived from the library, whereas the latter must -be combined with the library in order to run. - - GNU LESSER GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License Agreement applies to any software library or other -program which contains a notice placed by the copyright holder or -other authorized party saying it may be distributed under the terms of -this Lesser General Public License (also called "this License"). -Each licensee is addressed as "you". - - A "library" means a collection of software functions and/or data -prepared so as to be conveniently linked with application programs -(which use some of those functions and data) to form executables. - - The "Library", below, refers to any such software library or work -which has been distributed under these terms. A "work based on the -Library" means either the Library or any derivative work under -copyright law: that is to say, a work containing the Library or a -portion of it, either verbatim or with modifications and/or translated -straightforwardly into another language. (Hereinafter, translation is -included without limitation in the term "modification".) - - "Source code" for a work means the preferred form of the work for -making modifications to it. For a library, complete source code means -all the source code for all modules it contains, plus any associated -interface definition files, plus the scripts used to control compilation -and installation of the library. - - Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running a program using the Library is not restricted, and output from -such a program is covered only if its contents constitute a work based -on the Library (independent of the use of the Library in a tool for -writing it). Whether that is true depends on what the Library does -and what the program that uses the Library does. - - 1. You may copy and distribute verbatim copies of the Library's -complete source code as you receive it, in any medium, provided that -you conspicuously and appropriately publish on each copy an -appropriate copyright notice and disclaimer of warranty; keep intact -all the notices that refer to this License and to the absence of any -warranty; and distribute a copy of this License along with the -Library. - - You may charge a fee for the physical act of transferring a copy, -and you may at your option offer warranty protection in exchange for a -fee. - - 2. You may modify your copy or copies of the Library or any portion -of it, thus forming a work based on the Library, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) The modified work must itself be a software library. - - b) You must cause the files modified to carry prominent notices - stating that you changed the files and the date of any change. - - c) You must cause the whole of the work to be licensed at no - charge to all third parties under the terms of this License. - - d) If a facility in the modified Library refers to a function or a - table of data to be supplied by an application program that uses - the facility, other than as an argument passed when the facility - is invoked, then you must make a good faith effort to ensure that, - in the event an application does not supply such function or - table, the facility still operates, and performs whatever part of - its purpose remains meaningful. - - (For example, a function in a library to compute square roots has - a purpose that is entirely well-defined independent of the - application. Therefore, Subsection 2d requires that any - application-supplied function or table used by this function must - be optional: if the application does not supply it, the square - root function must still compute square roots.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Library, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Library, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote -it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Library. - -In addition, mere aggregation of another work not based on the Library -with the Library (or with a work based on the Library) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may opt to apply the terms of the ordinary GNU General Public -License instead of this License to a given copy of the Library. To do -this, you must alter all the notices that refer to this License, so -that they refer to the ordinary GNU General Public License, version 2, -instead of to this License. (If a newer version than version 2 of the -ordinary GNU General Public License has appeared, then you can specify -that version instead if you wish.) Do not make any other change in -these notices. - - Once this change is made in a given copy, it is irreversible for -that copy, so the ordinary GNU General Public License applies to all -subsequent copies and derivative works made from that copy. - - This option is useful when you wish to copy part of the code of -the Library into a program that is not a library. - - 4. You may copy and distribute the Library (or a portion or -derivative of it, under Section 2) in object code or executable form -under the terms of Sections 1 and 2 above provided that you accompany -it with the complete corresponding machine-readable source code, which -must be distributed under the terms of Sections 1 and 2 above on a -medium customarily used for software interchange. - - If distribution of object code is made by offering access to copy -from a designated place, then offering equivalent access to copy the -source code from the same place satisfies the requirement to -distribute the source code, even though third parties are not -compelled to copy the source along with the object code. - - 5. A program that contains no derivative of any portion of the -Library, but is designed to work with the Library by being compiled or -linked with it, is called a "work that uses the Library". Such a -work, in isolation, is not a derivative work of the Library, and -therefore falls outside the scope of this License. - - However, linking a "work that uses the Library" with the Library -creates an executable that is a derivative of the Library (because it -contains portions of the Library), rather than a "work that uses the -library". The executable is therefore covered by this License. -Section 6 states terms for distribution of such executables. - - When a "work that uses the Library" uses material from a header file -that is part of the Library, the object code for the work may be a -derivative work of the Library even though the source code is not. -Whether this is true is especially significant if the work can be -linked without the Library, or if the work is itself a library. The -threshold for this to be true is not precisely defined by law. - - If such an object file uses only numerical parameters, data -structure layouts and accessors, and small macros and small inline -functions (ten lines or less in length), then the use of the object -file is unrestricted, regardless of whether it is legally a derivative -work. (Executables containing this object code plus portions of the -Library will still fall under Section 6.) - - Otherwise, if the work is a derivative of the Library, you may -distribute the object code for the work under the terms of Section 6. -Any executables containing that work also fall under Section 6, -whether or not they are linked directly with the Library itself. - - 6. As an exception to the Sections above, you may also combine or -link a "work that uses the Library" with the Library to produce a -work containing portions of the Library, and distribute that work -under terms of your choice, provided that the terms permit -modification of the work for the customer's own use and reverse -engineering for debugging such modifications. - - You must give prominent notice with each copy of the work that the -Library is used in it and that the Library and its use are covered by -this License. You must supply a copy of this License. If the work -during execution displays copyright notices, you must include the -copyright notice for the Library among them, as well as a reference -directing the user to the copy of this License. Also, you must do one -of these things: - - a) Accompany the work with the complete corresponding - machine-readable source code for the Library including whatever - changes were used in the work (which must be distributed under - Sections 1 and 2 above); and, if the work is an executable linked - with the Library, with the complete machine-readable "work that - uses the Library", as object code and/or source code, so that the - user can modify the Library and then relink to produce a modified - executable containing the modified Library. (It is understood - that the user who changes the contents of definitions files in the - Library will not necessarily be able to recompile the application - to use the modified definitions.) - - b) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (1) uses at run time a - copy of the library already present on the user's computer system, - rather than copying library functions into the executable, and (2) - will operate properly with a modified version of the library, if - the user installs one, as long as the modified version is - interface-compatible with the version that the work was made with. - - c) Accompany the work with a written offer, valid for at - least three years, to give the same user the materials - specified in Subsection 6a, above, for a charge no more - than the cost of performing this distribution. - - d) If distribution of the work is made by offering access to copy - from a designated place, offer equivalent access to copy the above - specified materials from the same place. - - e) Verify that the user has already received a copy of these - materials or that you have already sent this user a copy. - - For an executable, the required form of the "work that uses the -Library" must include any data and utility programs needed for -reproducing the executable from it. However, as a special exception, -the materials to be distributed need not include anything that is -normally distributed (in either source or binary form) with the major -components (compiler, kernel, and so on) of the operating system on -which the executable runs, unless that component itself accompanies -the executable. - - It may happen that this requirement contradicts the license -restrictions of other proprietary libraries that do not normally -accompany the operating system. Such a contradiction means you cannot -use both them and the Library together in an executable that you -distribute. - - 7. You may place library facilities that are a work based on the -Library side-by-side in a single library together with other library -facilities not covered by this License, and distribute such a combined -library, provided that the separate distribution of the work based on -the Library and of the other library facilities is otherwise -permitted, and provided that you do these two things: - - a) Accompany the combined library with a copy of the same work - based on the Library, uncombined with any other library - facilities. This must be distributed under the terms of the - Sections above. - - b) Give prominent notice with the combined library of the fact - that part of it is a work based on the Library, and explaining - where to find the accompanying uncombined form of the same work. - - 8. You may not copy, modify, sublicense, link with, or distribute -the Library except as expressly provided under this License. Any -attempt otherwise to copy, modify, sublicense, link with, or -distribute the Library is void, and will automatically terminate your -rights under this License. However, parties who have received copies, -or rights, from you under this License will not have their licenses -terminated so long as such parties remain in full compliance. - - 9. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Library or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Library (or any work based on the -Library), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Library or works based on it. - - 10. Each time you redistribute the Library (or any work based on the -Library), the recipient automatically receives a license from the -original licensor to copy, distribute, link with or modify the Library -subject to these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties with -this License. - - 11. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Library at all. For example, if a patent -license would not permit royalty-free redistribution of the Library by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Library. - -If any portion of this section is held invalid or unenforceable under any -particular circumstance, the balance of the section is intended to apply, -and the section as a whole is intended to apply in other circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 12. If the distribution and/or use of the Library is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Library under this License may add -an explicit geographical distribution limitation excluding those countries, -so that distribution is permitted only in or among countries not thus -excluded. In such case, this License incorporates the limitation as if -written in the body of this License. - - 13. The Free Software Foundation may publish revised and/or new -versions of the Lesser General Public License from time to time. -Such new versions will be similar in spirit to the present version, -but may differ in detail to address new problems or concerns. - -Each version is given a distinguishing version number. If the Library -specifies a version number of this License which applies to it and -"any later version", you have the option of following the terms and -conditions either of that version or of any later version published by -the Free Software Foundation. If the Library does not specify a -license version number, you may choose any version ever published by -the Free Software Foundation. - - 14. If you wish to incorporate parts of the Library into other free -programs whose distribution conditions are incompatible with these, -write to the author to ask for permission. For software which is -copyrighted by the Free Software Foundation, write to the Free -Software Foundation; we sometimes make exceptions for this. Our -decision will be guided by the two goals of preserving the free status -of all derivatives of our free software and of promoting the sharing -and reuse of software generally. - - NO WARRANTY - - 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO -WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. -EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR -OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY -KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE -LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME -THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN -WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY -AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU -FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR -CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE -LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING -RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A -FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF -SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Libraries - - If you develop a new library, and you want it to be of the greatest -possible use to the public, we recommend making it free software that -everyone can redistribute and change. You can do so by permitting -redistribution under these terms (or, alternatively, under the terms of the -ordinary General Public License). - - To apply these terms, attach the following notices to the library. It is -safest to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least the -"copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -Also add information on how to contact you by electronic and paper mail. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the library, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the - library `Frob' (a library for tweaking knobs) written by James Random Hacker. - - , 1 April 1990 - Ty Coon, President of Vice - -That's all there is to it! - - diff --git a/doc/licenses/MIT b/doc/licenses/MIT deleted file mode 100644 index 4110670..0000000 --- a/doc/licenses/MIT +++ /dev/null @@ -1,20 +0,0 @@ -Copyright (c) - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/doc/licenses/libpng b/doc/licenses/libpng deleted file mode 100644 index ac910fb..0000000 --- a/doc/licenses/libpng +++ /dev/null @@ -1,110 +0,0 @@ -This copy of the libpng notices is provided for your convenience. In case of -any discrepancy between this copy and the notices in the file png.h that is -included in the libpng distribution, the latter shall prevail. - -COPYRIGHT NOTICE, DISCLAIMER, and LICENSE: - -If you modify libpng you may insert additional notices immediately following -this sentence. - -This code is released under the libpng license. - -libpng versions 1.2.6, August 15, 2004, through 1.2.41, December 3, 2009, are -Copyright (c) 2004, 2006-2009 Glenn Randers-Pehrson, and are -distributed according to the same disclaimer and license as libpng-1.2.5 -with the following individual added to the list of Contributing Authors - - Cosmin Truta - -libpng versions 1.0.7, July 1, 2000, through 1.2.5 - October 3, 2002, are -Copyright (c) 2000-2002 Glenn Randers-Pehrson, and are -distributed according to the same disclaimer and license as libpng-1.0.6 -with the following individuals added to the list of Contributing Authors - - Simon-Pierre Cadieux - Eric S. Raymond - Gilles Vollant - -and with the following additions to the disclaimer: - - There is no warranty against interference with your enjoyment of the - library or against infringement. There is no warranty that our - efforts or the library will fulfill any of your particular purposes - or needs. This library is provided with all faults, and the entire - risk of satisfactory quality, performance, accuracy, and effort is with - the user. - -libpng versions 0.97, January 1998, through 1.0.6, March 20, 2000, are -Copyright (c) 1998, 1999 Glenn Randers-Pehrson, and are -distributed according to the same disclaimer and license as libpng-0.96, -with the following individuals added to the list of Contributing Authors: - - Tom Lane - Glenn Randers-Pehrson - Willem van Schaik - -libpng versions 0.89, June 1996, through 0.96, May 1997, are -Copyright (c) 1996, 1997 Andreas Dilger -Distributed according to the same disclaimer and license as libpng-0.88, -with the following individuals added to the list of Contributing Authors: - - John Bowler - Kevin Bracey - Sam Bushell - Magnus Holmgren - Greg Roelofs - Tom Tanner - -libpng versions 0.5, May 1995, through 0.88, January 1996, are -Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc. - -For the purposes of this copyright and license, "Contributing Authors" -is defined as the following set of individuals: - - Andreas Dilger - Dave Martindale - Guy Eric Schalnat - Paul Schmidt - Tim Wegner - -The PNG Reference Library is supplied "AS IS". The Contributing Authors -and Group 42, Inc. disclaim all warranties, expressed or implied, -including, without limitation, the warranties of merchantability and of -fitness for any purpose. The Contributing Authors and Group 42, Inc. -assume no liability for direct, indirect, incidental, special, exemplary, -or consequential damages, which may result from the use of the PNG -Reference Library, even if advised of the possibility of such damage. - -Permission is hereby granted to use, copy, modify, and distribute this -source code, or portions hereof, for any purpose, without fee, subject -to the following restrictions: - -1. The origin of this source code must not be misrepresented. - -2. Altered versions must be plainly marked as such and must not - be misrepresented as being the original source. - -3. This Copyright notice may not be removed or altered from any - source or altered source distribution. - -The Contributing Authors and Group 42, Inc. specifically permit, without -fee, and encourage the use of this source code as a component to -supporting the PNG file format in commercial products. If you use this -source code in a product, acknowledgment is not required but would be -appreciated. - - -A "png_get_copyright" function is available, for convenient use in "about" -boxes and the like: - - printf("%s",png_get_copyright(NULL)); - -Also, the PNG logo (in PNG format, of course) is supplied in the -files "pngbar.png" and "pngbar.jpg (88x31) and "pngnow.png" (98x31). - -Libpng is OSI Certified Open Source Software. OSI Certified Open Source is a -certification mark of the Open Source Initiative. - -Glenn Randers-Pehrson -glennrp at users.sourceforge.net -December 3, 2009 diff --git a/doc/licenses/zlib-libpng b/doc/licenses/zlib-libpng deleted file mode 100644 index eef85c5..0000000 --- a/doc/licenses/zlib-libpng +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) - -This software is provided 'as-is', without any express or implied warranty. -In no event will the authors be held liable for any damages arising from -the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not -claim that you wrote the original software. If you use this software in a -product, an acknowledgment in the product documentation would be -appreciated but is not required. - -2. Altered source versions must be plainly marked as such, and must not be -misrepresented as being the original software. - -3. This notice may not be removed or altered from any source distribution. diff --git a/doc/rules.mk b/doc/rules.mk index 04f135b..5e3d9fb 100644 --- a/doc/rules.mk +++ b/doc/rules.mk @@ -1,23 +1,10 @@ -######################### -sp := $(sp).x -dirstack_$(sp) := $(d) -d := $(dir) -######################### - # # Define rules and targets for man pages. # -MANPAGE_$(d) := $(d)/yoink.6 - -MANPAGES := $(MANPAGES) $(MANPAGE_$(d)) -CLEAN := $(CLEAN) $(MANPAGE_$(d)) - +data += $b/yoink.6 $b/yoinkrc.5 # Make build targets of these man pages. +$(data): config.sed | $b -####################### --include $(DEPS_$(d)) -d := $(dirstack_$(sp)) -sp := $(basename $(sp)) -####################### +mandir_$b := $(data:%=%$(MANEXT)) # Install compressed pages to mandir. diff --git a/doc/screenshot.jpg b/doc/screenshot.jpg deleted file mode 100644 index 66e8e26..0000000 Binary files a/doc/screenshot.jpg and /dev/null differ diff --git a/doc/yoink.6.in b/doc/yoink.6.in index 08acade..4409421 100644 --- a/doc/yoink.6.in +++ b/doc/yoink.6.in @@ -1,204 +1,124 @@ .\" -.\" Copyright (c) 2009-2010, Charles McGarvey +.\" Copyright (c) 2009-2011, Charles McGarvey .\" All rights reserved. .\" .\" Distributable under the terms and conditions of the 2-clause BSD .\" license; see the file COPYING for a complete text of the license. .\" -.TH YOINK 6 "July 24, 2009" -.SH NAME -Yoink \- An alien-smashing action game. -.SH SYNOPSIS -.B yoink [-hi] [OPTION=VALUE]... -.SH DESCRIPTION +.Dd July 24, 2009 +.Dt YOINK 6 +.Os +.Sh NAME +.Nm yoink +.Nd an alien-smashing action game +.Sh SYNOPSIS +.Nm yoink +.Op Fl hi +.Op Ar OPTION=VALUE ... +.Sh DESCRIPTION Leap tall buildings! Crush stupid robots beneath your feet! Wield your extra-terrestrial powers in the defense of humanity, and send those alien invaders back from whence they came! - +.Pp You play the part of a flying alien heroine who must defend her home on Earth from other airborne alien invaders. The game draws inspiration from classic arcade games like Joust, Bombjack, Rampage, and Defender--simple, -fast-moving action. Basic arguments include: -.TP -.B -h, --help +fast-moving action. Basic options include: +.Bl -tag -width flag +.It Fl h, -help Display basic usage information, and exit immediately. -.TP -.B -i, --info +.It Fl i, -info Display build and environment details, and exit immediately. -.SH TIPS +.El +.Pp +For a list of the other options available, see +.Xr yoinkrc 5 Ns . +.Pp To attack, you must dive on the enemy at high speed. If you're going too slowly, you'll just drift harmlessly by. Diving from above gives different results from swooping in and hitting them from the side. If you're too close to attack, try to build up speed by running away and bouncing off a nearby building! - +.Pp By charging your special alien powers, you can throw fireballs. The orange bar at the top of the screen represents your power level--at maximum, you can destroy almost anything. Aiming can be tricky, but with a little practice it's quite easy to launch them in the right direction. Try doing a little swoop or circle in the air to line yourself up before releasing your fireball. - +.Pp The heroine has limited energy, measured by the blue bar at the top of the screen. When it runs out, it's game over! She can regain lost energy by picking up bonuses dropped by enemies. - +.Pp To complete the current attack wave, you must destroy all the enemies. Hunt around, especially in the sky, if you can't find the last few. -.SH OPTIONS -You have a certain level of control over the operation of \fByoink\fP -through options passed as program arguments or given in config files. -\fByoink\fP looks for config files in several locations and in this order: -.TP -1. \fI@datadir@/yoinkrc\fP -This is the base config file which should be considered read-only. Look to -this file as an example of the format used for config files. -.TP -2. \fI/etc/yoinkrc\fP -This is the system-wide config file. -.TP -3. \fI$HOME/.yoinkrc\fP -This is your own personal config file. -.TP -4. \fI$YOINKRC\fP -This is an optional environment variable you can set to the path of a -config file at a non-standard location. See the \fBENVIRONMENT\fP section -below for more information. -.PP -As usual, options that are passed as arguments take precedence over options -loaded from any config file. Here is a list of some of the options -available at your disposal: -.TP -.B detail -The level of detail. Possible values are 1, 2, or 3 where 1 means the -least amount of detail and 3 means the most. This effects the number of -objects drawn to the screen. A high level of detail will draw everything -but could cause poor frame rates if the graphics driver can't keep up with -the load. Lower levels will omit certain details which aren't crucial for -playing the game with the possible benefit of higher frame rates. See the -Notes for more ways to increase the game's performance. The default value -is 3. -.TP -.B doublebuffer -If true, double-buffering will be used to help minimize distortion and -artifacts caused by the animation of the game. Otherwise, a single buffer -will be used. The default value is true. -.TP -.B framerate -The target number of frames to be drawn per second. If your computer is -really old, you can get away with decreasing this value and still have -reasonably smooth animation. You can set this to a very high number to -effectively render as many frames as is possible, but the actual rate could -be limited by vertical display synchronization, depending on the X11 driver -and settings used. The default value is 50. -.TP -.B fullscreen -If true, the window will capture the display and render the game in full -screen splendor. A value of false means the game will run in a window. -The default value is false. -.TP -.B resizable -If true, the window will be resizable by the window manager. This option -is meaningless if the game is drawing to the full screen. The default -option is true. -.TP -.B showfps -If true, the current number of frames being drawn per second will be -printed to the console every second. The default value is false. -.TP -.B timestep -The number of times per second the simulation state will be updated. A -value of 100 or higher is ideal for a better physical simulation. Values -that are much lower cause the CPU to do less work, but accuracy will -suffer. Errors could be introduced in the game with extremely low values. -The default value is 80. -.TP -.B videomode -The resolution or size of the window. The value is an array with three -number elements representing the width, height, and bits per pixel that -make up the video mode. The third number is optional. The default value -is {800,600}. If passing on the command-line, you may need to escape the -curly braces so the shell doesn't parse them. -.PP -This is only a list of the more useful options. You'll have to use the -source to find out about the more esoteric options, but you probably won't -need to. -.SH EXAMPLES -Here are some examples of typical usage: -.TP -$ yoink detail=2 -Set the level of detail to 2 so that less stuff is drawn to the screen. -.TP -$ yoink fullscreen=true videomode=\\{1024,768\\} -Run \fByoink\fP at full screen with a resolution of 1024x768. Notice the -escapes for the curly braces so the shell doesn't parse them. -.SH ENVIRONMENT -\fByoink\fP responds to some variables in the environment: -.TP -.I HOME -If set to a path of a valid directory (presumably your home directory), -\fByoink\fP will look for a file at \fI$HOME/.yoinkrc\fP and load it as a -config file. -.TP -.I USER -\fByoink\fP uses this variable as the user's name, for a high score entry -or whatever. -.TP -.I YOINK_DATADIR -If set to a path of a valid directory, \fByoink\fP will look in this -directory first when it is loading game assets. Set this variable if you -move the game's assets to another directory or perhaps want to load your -own custom assets rather than the defaults. -.TP -.I YOINKRC -If set to a path of a valid config file, \fByoink\fP will load the options -from that file, and those options will take precedence over options loaded -from other config files. -.SH NOTES -\fByoink\fP may or may not be playable with acceptable frame rates without -a hardware accelerated GL driver installed and working, depending on how -fast your CPU is. \fByoink\fP is really not all that heavy on graphics, -but it doesn't take much to overload a software implementation. You should -first check the documentation provided by your OS provider to see how to -enable direct rendering. If you're really stuck without hardware -acceleration, there are some things you can do to get marginally better -frame rates: -.TP -1. Decrease the resolution. -Use the \fBvideomode\fP option or just resize the window if the -\fBfullscreen\fP option is false and the \fBresizable\fP option is true. -This can speed up a software renderer considerably. -.TP -2. Decrease the level of rendering detail. -Use the \fBdetail\fP option. The game world may look sparse or incomplete, -but that's probably better than choppy animation if you can avoid it. -.TP -3. Decrease the framerate and/or timestep. -If your machine can't meet the target framerate, your actual framerate will -probably vary. You will have a better visual experience if you can reduce -the \fBframerate\fP to a point such that the actual framerate is basically -constant. A constant 20fps or 30fps will look better than a sporadic -40-60fps. You can also decrease the \fBtimestep\fP at the expense of -decreased simulation accuracy. You'll have to experiment with this value -to determine acceptable levels. -.PP +.Sh FILES +.Bl -tag -width Fl +.It Pa @pkgdatadir@/yoinkrc +The configuration file with the default options. This file is to be +considered read-only and should be looked to as an example of the file +format (see +.Xr yoinkrc 5 Ns ). +.It Pa /etc/yoinkrc +The system-wide configuration file. +.It Pa ~/.yoinkrc +The user's specialized configuration file. +.El +.Sh ENVIRONMENT +.Bl -tag -width Fl +.It Ev HOME +If set to the path of a valid directory (presumably your home directory), +.Nm +will look for a file at +.Pa $HOME/.yoinkrc +and load it as a config file. +.It Ev USER +.Nm +uses this variable as the user's name, for a high score entry or whatever. +.It Ev YOINK_DATADIR +If set to a path of a valid directory, +.Nm +will look in this directory first when it is loading game assets. Set this +variable if you move the game's assets to another directory or perhaps want +to load your own custom assets rather than the defaults. +.It Ev YOINKRC +If set to a path of a valid config file, +.Nm +will load the options from that file, and those options will take +precedence over options loaded from other config files. +.El +.Sh SEE ALSO +.Xr yoinkrc 5 +.Sh HISTORY +.Nm Yoink +was originally created for Mac OS X by Neil Carter. It was a winning entry +in the uDevGames 2003 Mac game development contest. +.Sh AUTHOR +.Bl -tag -width 2i -compact +.It An Charles McGarvey +.Mt @email@ +.El +.Sh CAVEATS +.Nm +requires direct rendering. A software implementation of GL will probably +run to slowly to provide a decent framerate. If you're stuck without +hardware acceleration, some options may be able to boost framerates +somewhat. See +.Ar videomode Ns , +.Ar detail Ns , +.Ar framerate +and +.Ar timestep +in +.Xr yoinkrc 5 +for more information. +.Pp If you are having audio problems, you may need to upgrade OpenAL. Some systems still provide an old, busted version of OpenAL which may result in stuttering, lag, and other oddities. See about installing a recent version of openal-soft, a high-quality software implementation that is still being maintained. -.SH BUGS -.IP \(bu 3 -The robots aren't very bright. -.IP \(bu -Although the pixelated graphics are intentional, there are some unintended -artifacts which are more obvious with certain video drivers. -.PP -Send bug reports, patches and love notes to: -.IP -Charles McGarvey <@PACKAGE_BUGREPORT@> -.SH AUTHOR -.PP -Neil Carter was the original creator of Yoink, his winning entry in the -uDevGames 2003 Mac game development contest. Charles McGarvey restored the -game and is the current maintainer. +.Sh BUGS +Submit bug reports and/or patches to: +.Lk http://www.dogcows.com/yoink/newticket "Yoink Bug Tracker" diff --git a/doc/yoink_install.7 b/doc/yoink_install.7 new file mode 100644 index 0000000..c4d9c49 --- /dev/null +++ b/doc/yoink_install.7 @@ -0,0 +1,228 @@ +.\" +.\" Copyright (c) 2009-2011, Charles McGarvey +.\" All rights reserved. +.\" +.\" Distributable under the terms and conditions of the 2-clause BSD +.\" license; see the file COPYING for a complete text of the license. +.\" +.Dd June 13, 2011 +.Dt YOINK_INSTALL 7 +.Os +.Sh NAME +.Nm yoink_install +.Nd building and installation instructions for yoink +.Sh DESCRIPTION +Yoink can usually be built and installed in the same way as most other open +source packages, using the following commands: +.Pp +.D1 cd /path/to/yoink +.D1 ./configure +.D1 make && make install +.Pp +Yet, although the build system scripts and makefiles follow standard +conventions, they are themselves a little unconventional. Therefore, if +things go wrong, this reference may aid in diagnosing the problem. The +rest of this page is for those for whom the basic steps do not work or for +those who have specialized needs, like packagers. +.Ss CONFIGURATION +A +.Nm configure +script is provided in the package to help prepare the build system to +compile and install Yoink on your particular system. This script supports +many of the same options as your typical Autoconf-generated script. Just +use the script's +.Fl -help +flag to see which options are available. +.Pp +In particular, you may use the +.Fl -prefix +flag to set where Yoink will be installed. The default directory prefix is +.Pa /usr/local Ns , +which is a good idea in most cases, as long as you have write permissions +for that directory. Otherwise, you might want to set the prefix to be some +directory within your home directory. +.Pp +The script also supports the +.Fl -host +flag to allow for cross-compiling. Use this flag to set the triplet of the +machine architecture and system software combination for the platform you +want Yoink to run on. Of course, you will need the appropriate toolchain +installed. +.Pp +If you have +.Nm dialog +installed, an alternative approach to configuration is to use +.Cm menuconfig Ns , +the interactive menu system built into the +.Nm configure +script. To use this method, there exists a familiar +.Nm make +target to bring up the menu dialogs: +.Pp +.D1 make menuconfig +.Pp +This is the same as running the +.Nm configure +script with the +.Fl -interactive +flag. This allows you to browse the various options and make changes to +the configuration before it is saved in preparation for building. +.Pp +Regardless of which way +.Nm configure +is run, it will perform various checks and make sure the required +dependencies are found. If all of the checks pass, the configuration file +is saved to +.Pa config.mk Ns , +and the script will terminate with an exit code of 0. If any checks fail, +a non-zero exit code will result. The configuration file, +.Pa config.mk Ns , +can be edited manually if desired. However, the +.Nm configure +script should be run again afterward to make sure the changes didn't cause +any errors, and the script may choose to alter any part of the +configuration. +.Pp +If any part of the configuration fails, make sure you have these basic +requirements fulfilled: +.Bl -enum +.It +You must have Lua installed. Much of the +.Nm configure +script is written in Lua, and Yoink requires Lua as a dependency anyway. +.It +You must have a working toolchain installed. This usually means you have +.Nm gcc +installed along with its C++ compiler components, libc and binutils. +.It +You must have +.Nm pkg-config +installed, along with the required library dependencies and \(lqpc\(rq +files. Look for these packages with your favorite package manager: +.Bl -bullet -compact +.It +boost headers +.It +libpng +.It +libvorbis +.It +Lua +.It +OpenAL +.It +OpenGL (including GLU) +.It +SDL +.It +zlib +.El +.El +.Ss BUILDING +Once the build system has been properly configured, it is ready to do some +compiling. This is done simply with an invocation of GNU make, perhaps +like this: +.Pp +.D1 make -j2 +.Pp +Sometimes the command for GNU make is +.Nm gmake Ns , +although it may also be simply +.Nm make Ns . +No other variety of +.Nm make +will work, and you need a fairly recent version of GNU make since some +older versions have fatal bugs. The +.Fl j +flag may be used to perform multiple build steps in parallel, decreasing +the amount of time the compile takes on multi-core machines. See +.Xr make 1 +for more information. +.Pp +Advanced users may choose to override parts of the configuration with +additional arguments to +.Nm make Ns , +although it is rarely useful to do so. However, in the event that some +error occurs during the process, it often is useful to retry the +.Nm make +command with the +.Ar V=1 +argument (for verbosity) in order to cause +.Nm make +to echo each actual command before it is executed. Users who are familiar +with compiler and linker warnings and errors will then be able diagnose the +problem, whether it be a problem with the configuration or something else. +.Ss TESTING +After the build process has successfully completed, Yoink should now be +able to run from within the +.Pa build +directory, as long as you're not cross-compiling to an incompatible +platform. To test this, there is a +.Nm make +target to execute Yoink: +.Pp +.D1 make run +.Pp +If an error occurs and the rest of the build really did complete +successfully, the likely problem is that the dynamic libraries could not be +found. This may happen if the libraries are installed to a non-standard +location, and the linker wasn't given the appropriate +.Fl rpath +flag. This means that +.Nm pkg-config +failed to provide all of the flags we need. The easiest thing to do in +this situation is to reconfigure the build system with the +.Ar LDFLAGS=-Wl,-rpath=/path/to/lib +option set and retry the test (the executable will be rebuilt). +.Ss INSTALLATION +Once testing is completed, it is time to copy the Yoink files to their +final destinations. As usual, there is a +.Nm make +target to handle the installation: +.Pp +.D1 make install +.Pp +This will cause the files to be copied with the BSD-compatible +.Nm install +program. Of course, you may need to elevate your privileges (i.e. with +.Nm sudo Ns ) +if you are installing to a directory your user account does not have write +access to. +.Pp +The installation destination depends on +.Ar prefix +and other configuration variables. You can override the configuration by +passing the arguments directly to +.Nm make +with the install target. The +.Pa Makefile +also supports staging by using the +.Ar DESTDIR +variable passed to +.Nm make Ns . +.Pp +Any failure during installation is probably a result of simply not having +sufficient privileges. It will also be a problem if you do not have a +BSD-compatible version of +.Nm install Ns . +In the case of the latter, it should be a minor modification to the +.Pa Makefile +to get it working. The build system is still not compatible in many +regards. +.Sh FILES +.Bl -tag -compact +.It Pa configure +.It Pa config.h +.It Pa config.mk +.It Pa config.sed +.It Pa Makefile +.It Pa options.lua +.El +.Sh SEE ALSO +.Xr yoinkrc 5 Ns , +.Xr yoink 6 +.Sh AUTHORS +.Bl -tag -width 2i -compact +.It An Charles McGarvey +.Mt chaz@dogcows.com +.El diff --git a/doc/yoink_license.7 b/doc/yoink_license.7 new file mode 100644 index 0000000..575e724 --- /dev/null +++ b/doc/yoink_license.7 @@ -0,0 +1,1593 @@ +.\" +.\" Copyright (c) 2009-2011, Charles McGarvey +.\" All rights reserved. +.\" +.\" Distributable under the terms and conditions of the 2-clause BSD +.\" license; see the file COPYING for a complete text of the license. +.\" +.Dd June 14, 2011 +.Dt YOINK_LICENSE 7 +.Os +.Sh NAME +.Nm yoink_license +.Nd copyright and license terms and conditions +.Sh DESCRIPTION +Unless otherwise stated, either in this document or in the file's header or +metadata section (the latter taking precedence in the case of conflict), +the files that make up Yoink are licensed accordingly: +.Pp +.Bd -filled -offset 0.5i +The Simplified BSD License +.Bd -ragged +Copyright \(co 2009-2011, Charles McGarvey et al. +.br +All rights reserved. +.Ed +.Pp +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: +.Bl -enum +.It +Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +.It +Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. +.El +.Pp +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +.Ed +.Ss Boost-1.0 License +These components fall under the Boost-1.0 license: +.Bl -tag -width 1i +.It \(co 2009 Jesse Anders +.Lk http://www.cmldev.net/ CML +.El +.Bd -filled -offset 0.5i +Boost Software License - Version 1.0 - August 17th, 2003 +.Pp +Permission is hereby granted, free of charge, to any person or organization +obtaining a copy of the software and accompanying documentation covered by +this license (the "Software") to use, reproduce, display, distribute, +execute, and transmit the Software, and to prepare derivative works of the +Software, and to permit third-parties to whom the Software is furnished to +do so, all subject to the following: +.Pp +The copyright notices in the Software and this entire statement, including +the above license grant, this restriction and the following disclaimer, +must be included in all copies of the Software, in whole or in part, and +all derivative works of the Software, unless such copies or derivative +works are solely in the form of machine-executable object code generated by +a source language processor. +.Pp +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, TITLE AND NON-INFRINGEMENT. IN NO EVENT +SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE +FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. +.Ed +.Ss BSD License +These components fall under the BSD license: +.Bl -tag -width 1i +.It \(co 1999-2004 Southampton University, 2004-2009 Andy Rushton +.Lk http://stlplus.sourceforge.net/ stlplus +.It \(co 2009 Xiph.Org Foundation +.Lk http://www.xiph.org/downloads/ "libogg, libvorbis" +.El +.Bd -filled -offset 0.5i +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: +.Bl -enum +.It +Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +.It +Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. +.It +Neither the name of the nor the names of its contributors +may be used to endorse or promote products derived from this software +without specific prior written permission. +.El +.Pp +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +.Ed +.Ss CCPL-BY-NC-SA-3.0 +These components fall under the CCPL-BY-NC-SA-3.0: +.Bl -tag -width 1i +.It \(co 2009-2011 Stephen H. Johnston +.Lk http://www.fodxm.co.uk/ "Night Fusion" +.El +.Bd -filled -offset 0.5i +.Bd -centered -compact +Creative Commons +.Pp +Creative Commons Legal Code +.Pp +Attribution-NonCommercial-ShareAlike 3.0 Unported +.Ed +.Pp +CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE LEGAL +SERVICES. DISTRIBUTION OF THIS LICENSE DOES NOT CREATE AN ATTORNEY-CLIENT +RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS INFORMATION ON AN "AS-IS" +BASIS. CREATIVE COMMONS MAKES NO WARRANTIES REGARDING THE INFORMATION +PROVIDED, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM ITS USE. +.Bd -centered +License +.Ed +.Pp +THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE +COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY +COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS +AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED. +.Pp +BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE TO +BE BOUND BY THE TERMS OF THIS LICENSE. TO THE EXTENT THIS LICENSE MAY BE +CONSIDERED TO BE A CONTRACT, THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED +HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS. +.Pp +.Bd -filled -offset 0.5i +1. Definitions +.Bd -filled -offset 0.5i +a. "Adaptation" means a work based upon the Work, or upon the Work and +other pre-existing works, such as a translation, adaptation, derivative +work, arrangement of music or other alterations of a literary or artistic +work, or phonogram or performance and includes cinematographic adaptations +or any other form in which the Work may be recast, transformed, or adapted +including in any form recognizably derived from the original, except that a +work that constitutes a Collection will not be considered an Adaptation for +the purpose of this License. For the avoidance of doubt, where the Work is +a musical work, performance or phonogram, the synchronization of the Work +in timed-relation with a moving image ("synching") will be considered an +Adaptation for the purpose of this License. +.Pp +b. "Collection" means a collection of literary or artistic works, such as +encyclopedias and anthologies, or performances, phonograms or broadcasts, +or other works or subject matter other than works listed in Section 1(g) +below, which, by reason of the selection and arrangement of their contents, +constitute intellectual creations, in which the Work is included in its +entirety in unmodified form along with one or more other contributions, +each constituting separate and independent works in themselves, which +together are assembled into a collective whole. A work that constitutes a +Collection will not be considered an Adaptation (as defined above) for the +purposes of this License. +.Pp +c. "Distribute" means to make available to the public the original and +copies of the Work or Adaptation, as appropriate, through sale or other +transfer of ownership. +.Pp +d. "License Elements" means the following high-level license attributes as +selected by Licensor and indicated in the title of this License: +Attribution, Noncommercial, ShareAlike. +.Pp +e. "Licensor" means the individual, individuals, entity or entities that +offer(s) the Work under the terms of this License. +.Pp +f. "Original Author" means, in the case of a literary or artistic work, the +individual, individuals, entity or entities who created the Work or if no +individual or entity can be identified, the publisher; and in addition (i) +in the case of a performance the actors, singers, musicians, dancers, and +other persons who act, sing, deliver, declaim, play in, interpret or +otherwise perform literary or artistic works or expressions of folklore; +(ii) in the case of a phonogram the producer being the person or legal +entity who first fixes the sounds of a performance or other sounds; and, +(iii) in the case of broadcasts, the organization that transmits the +broadcast. +.Pp +g. "Work" means the literary and/or artistic work offered under the terms +of this License including without limitation any production in the +literary, scientific and artistic domain, whatever may be the mode or form +of its expression including digital form, such as a book, pamphlet and +other writing; a lecture, address, sermon or other work of the same nature; +a dramatic or dramatico-musical work; a choreographic work or entertainment +in dumb show; a musical composition with or without words; a +cinematographic work to which are assimilated works expressed by a process +analogous to cinematography; a work of drawing, painting, architecture, +sculpture, engraving or lithography; a photographic work to which are +assimilated works expressed by a process analogous to photography; a work +of applied art; an illustration, map, plan, sketch or three-dimensional +work relative to geography, topography, architecture or science; a +performance; a broadcast; a phonogram; a compilation of data to the extent +it is protected as a copyrightable work; or a work performed by a variety +or circus performer to the extent it is not otherwise considered a literary +or artistic work. +.Pp +h. "You" means an individual or entity exercising rights under this License +who has not previously violated the terms of this License with respect to +the Work, or who has received express permission from the Licensor to +exercise rights under this License despite a previous violation. +.Pp +i. "Publicly Perform" means to perform public recitations of the Work and +to communicate to the public those public recitations, by any means or +process, including by wire or wireless means or public digital +performances; to make available to the public Works in such a way that +members of the public may access these Works from a place and at a place +individually chosen by them; to perform the Work to the public by any means +or process and the communication to the public of the performances of the +Work, including by public digital performance; to broadcast and rebroadcast +the Work by any means including signs, sounds or images. +.Pp +j. "Reproduce" means to make copies of the Work by any means including +without limitation by sound or visual recordings and the right of fixation +and reproducing fixations of the Work, including storage of a protected +performance or phonogram in digital form or other electronic medium. +.Ed +.Pp +2. Fair Dealing Rights. Nothing in this License is intended to reduce, +limit, or restrict any uses free from copyright or rights arising from +limitations or exceptions that are provided for in connection with the +copyright protection under copyright law or other applicable laws. +.Pp +3. License Grant. Subject to the terms and conditions of this License, +Licensor hereby grants You a worldwide, royalty-free, non-exclusive, +perpetual (for the duration of the applicable copyright) license to +exercise the rights in the Work as stated below: +.Bd -filled -offset 0.5i +a. to Reproduce the Work, to incorporate the Work into one or more +Collections, and to Reproduce the Work as incorporated in the Collections; +.Pp +b. to create and Reproduce Adaptations provided that any such Adaptation, +including any translation in any medium, takes reasonable steps to clearly +label, demarcate or otherwise identify that changes were made to the +original Work. For example, a translation could be marked "The original +work was translated from English to Spanish," or a modification could +indicate "The original work has been modified."; +.Pp +c. to Distribute and Publicly Perform the Work including as incorporated in +Collections; and, +.Pp +d. to Distribute and Publicly Perform Adaptations. +.Ed +.Pp +The above rights may be exercised in all media and formats whether now +known or hereafter devised. The above rights include the right to make such +modifications as are technically necessary to exercise the rights in other +media and formats. Subject to Section 8(f), all rights not expressly +granted by Licensor are hereby reserved, including but not limited to the +rights described in Section 4(e). +.Pp +4. Restrictions. The license granted in Section 3 above is expressly made +subject to and limited by the following restrictions: +.Bd -filled -offset 0.5i +a. You may Distribute or Publicly Perform the Work only under the terms of +this License. You must include a copy of, or the Uniform Resource +Identifier (URI) for, this License with every copy of the Work You +Distribute or Publicly Perform. You may not offer or impose any terms on +the Work that restrict the terms of this License or the ability of the +recipient of the Work to exercise the rights granted to that recipient +under the terms of the License. You may not sublicense the Work. You must +keep intact all notices that refer to this License and to the disclaimer of +warranties with every copy of the Work You Distribute or Publicly Perform. +When You Distribute or Publicly Perform the Work, You may not impose any +effective technological measures on the Work that restrict the ability of a +recipient of the Work from You to exercise the rights granted to that +recipient under the terms of the License. This Section 4(a) applies to the +Work as incorporated in a Collection, but this does not require the +Collection apart from the Work itself to be made subject to the terms of +this License. If You create a Collection, upon notice from any Licensor You +must, to the extent practicable, remove from the Collection any credit as +required by Section 4(d), as requested. If You create an Adaptation, upon +notice from any Licensor You must, to the extent practicable, remove from +the Adaptation any credit as required by Section 4(d), as requested. +.Pp +b. You may Distribute or Publicly Perform an Adaptation only under: (i) the +terms of this License; (ii) a later version of this License with the same +License Elements as this License; (iii) a Creative Commons jurisdiction +license (either this or a later license version) that contains the same +License Elements as this License (e.g., +Attribution-NonCommercial-ShareAlike 3.0 US) ("Applicable License"). You +must include a copy of, or the URI, for Applicable License with every copy +of each Adaptation You Distribute or Publicly Perform. You may not offer or +impose any terms on the Adaptation that restrict the terms of the +Applicable License or the ability of the recipient of the Adaptation to +exercise the rights granted to that recipient under the terms of the +Applicable License. You must keep intact all notices that refer to the +Applicable License and to the disclaimer of warranties with every copy of +the Work as included in the Adaptation You Distribute or Publicly Perform. +When You Distribute or Publicly Perform the Adaptation, You may not impose +any effective technological measures on the Adaptation that restrict the +ability of a recipient of the Adaptation from You to exercise the rights +granted to that recipient under the terms of the Applicable License. This +Section 4(b) applies to the Adaptation as incorporated in a Collection, but +this does not require the Collection apart from the Adaptation itself to be +made subject to the terms of the Applicable License. +.Pp +c. You may not exercise any of the rights granted to You in Section 3 above +in any manner that is primarily intended for or directed toward commercial +advantage or private monetary compensation. The exchange of the Work for +other copyrighted works by means of digital file-sharing or otherwise shall +not be considered to be intended for or directed toward commercial +advantage or private monetary compensation, provided there is no payment of +any monetary compensation in con-nection with the exchange of copyrighted +works. +.Pp +d. If You Distribute, or Publicly Perform the Work or any Adaptations or +Collections, You must, unless a request has been made pursuant to Section +4(a), keep intact all copyright notices for the Work and provide, +reasonable to the medium or means You are utilizing: (i) the name of the +Original Author (or pseudonym, if applicable) if supplied, and/or if the +Original Author and/or Licensor designate another party or parties (e.g., a +sponsor institute, publishing entity, journal) for attribution +("Attribution Parties") in Licensor's copyright notice, terms of service or +by other reasonable means, the name of such party or parties; (ii) the +title of the Work if supplied; (iii) to the extent reasonably practicable, +the URI, if any, that Licensor specifies to be associated with the Work, +unless such URI does not refer to the copyright notice or licensing +information for the Work; and, (iv) consistent with Section 3(b), in the +case of an Adaptation, a credit identifying the use of the Work in the +Adaptation (e.g., "French translation of the Work by Original Author," or +"Screenplay based on original Work by Original Author"). The credit +required by this Section 4(d) may be implemented in any reasonable manner; +provided, however, that in the case of a Adaptation or Collection, at a +minimum such credit will appear, if a credit for all contributing authors +of the Adaptation or Collection appears, then as part of these credits and +in a manner at least as prominent as the credits for the other contributing +authors. For the avoidance of doubt, You may only use the credit required +by this Section for the purpose of attribution in the manner set out above +and, by exercising Your rights under this License, You may not implicitly +or explicitly assert or imply any connection with, sponsorship or +endorsement by the Original Author, Licensor and/or Attribution Parties, as +appropriate, of You or Your use of the Work, without the separate, express +prior written permission of the Original Author, Licensor and/or +Attribution Parties. +.Pp +e. For the avoidance of doubt: +.Bd -filled -offset 0.5i +i. Non-waivable Compulsory License Schemes. In those jurisdictions in which +the right to collect royalties through any statutory or compulsory +licensing scheme cannot be waived, the Licensor reserves the exclusive +right to collect such royalties for any exercise by You of the rights +granted under this License; +.Pp +ii. Waivable Compulsory License Schemes. In those jurisdictions in which +the right to collect royalties through any statutory or compulsory +licensing scheme can be waived, the Licensor reserves the exclusive right +to collect such royalties for any exercise by You of the rights granted +under this License if Your exercise of such rights is for a purpose or use +which is otherwise than noncommercial as permitted under Section 4(c) and +otherwise waives the right to collect royalties through any statutory or +compulsory licensing scheme; and, +.Pp +iii. Voluntary License Schemes. The Licensor reserves the right to collect +royalties, whether individually or, in the event that the Licensor is a +member of a collecting society that administers voluntary licensing +schemes, via that society, from any exercise by You of the rights granted +under this License that is for a purpose or use which is otherwise than +noncommercial as permitted under Section 4(c). +.Ed +.Pp +f. Except as otherwise agreed in writing by the Licensor or as may be +otherwise permitted by applicable law, if You Reproduce, Distribute or +Publicly Perform the Work either by itself or as part of any Adaptations or +Collections, You must not distort, mutilate, modify or take other +derogatory action in relation to the Work which would be prejudicial to the +Original Author's honor or reputation. Licensor agrees that in those +jurisdictions (e.g. Japan), in which any exercise of the right granted in +Section 3(b) of this License (the right to make Adaptations) would be +deemed to be a distortion, mutilation, modification or other derogatory +action prejudicial to the Original Author's honor and reputation, the +Licensor will waive or not assert, as appropriate, this Section, to the +fullest extent permitted by the applicable national law, to enable You to +reasonably exercise Your right under Section 3(b) of this License (right to +make Adaptations) but not otherwise. +.Ed +.Pp +5. Representations, Warranties and Disclaimer +.Pp +UNLESS OTHERWISE MUTUALLY AGREED TO BY THE PARTIES IN WRITING AND TO THE +FULLEST EXTENT PERMITTED BY APPLICABLE LAW, LICENSOR OFFERS THE WORK AS-IS +AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND CONCERNING THE WORK, +EXPRESS, IMPLIED, STATUTORY OR OTHERWISE, INCLUDING, WITHOUT LIMITATION, +WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, +NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, ACCURACY, OR +THE PRESENCE OF ABSENCE OF ERRORS, WHETHER OR NOT DISCOVERABLE. SOME +JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED WARRANTIES, SO THIS +EXCLUSION MAY NOT APPLY TO YOU. +.Pp +6. Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE +LAW, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR ANY +SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES ARISING +OUT OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS BEEN +ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. +.Pp +7. Termination +.Bd -filled -offset 0.5i +a. This License and the rights granted hereunder will terminate +automatically upon any breach by You of the terms of this License. +Individuals or entities who have received Adaptations or Collections from +You under this License, however, will not have their licenses terminated +provided such individuals or entities remain in full compliance with those +licenses. Sections 1, 2, 5, 6, 7, and 8 will survive any termination of +this License. +.Pp +b. Subject to the above terms and conditions, the license granted here is +perpetual (for the duration of the applicable copyright in the Work). +Notwithstanding the above, Licensor reserves the right to release the Work +under different license terms or to stop distributing the Work at any time; +provided, however that any such election will not serve to withdraw this +License (or any other license that has been, or is required to be, granted +under the terms of this License), and this License will continue in full +force and effect unless terminated as stated above. +.Ed +.Pp +8. Miscellaneous +.Bd -filled -offset 0.5i +a. Each time You Distribute or Publicly Perform the Work or a Collection, +the Licensor offers to the recipient a license to the Work on the same +terms and conditions as the license granted to You under this License. +.Pp +b. Each time You Distribute or Publicly Perform an Adaptation, Licensor +offers to the recipient a license to the original Work on the same terms +and conditions as the license granted to You under this License. +.Pp +c. If any provision of this License is invalid or unenforceable under +applicable law, it shall not affect the validity or enforceability of the +remainder of the terms of this License, and without further action by the +parties to this agreement, such provision shall be reformed to the minimum +extent necessary to make such provision valid and enforceable. +.Pp +d. No term or provision of this License shall be deemed waived and no +breach consented to unless such waiver or consent shall be in writing and +signed by the party to be charged with such waiver or consent. +.Pp +e. This License constitutes the entire agreement between the parties with +respect to the Work licensed here. There are no understandings, agreements +or representations with respect to the Work not specified here. Licensor +shall not be bound by any additional provisions that may appear in any +communication from You. This License may not be modified without the mutual +written agreement of the Licensor and You. +.Pp +f. The rights granted under, and the subject matter referenced, in this +License were drafted utilizing the terminology of the Berne Convention for +the Protection of Literary and Artistic Works (as amended on September 28, +1979), the Rome Convention of 1961, the WIPO Copyright Treaty of 1996, the +WIPO Performances and Phonograms Treaty of 1996 and the Universal Copyright +Convention (as revised on July 24, 1971). These rights and subject matter +take effect in the relevant jurisdiction in which the License terms are +sought to be enforced according to the corresponding provisions of the +implementation of those treaty provisions in the applicable national law. +If the standard suite of rights granted under applicable copyright law +includes additional rights not granted under this License, such additional +rights are deemed to be included in the License; this License is not +intended to restrict the license of any rights under applicable law. +.Ed +.Ed +.Bd -centered +Creative Commons Notice +.Ed +.Pp +Creative Commons is not a party to this License, and makes no warranty +whatsoever in connection with the Work. Creative Commons will not be liable +to You or any party on any legal theory for any damages whatsoever, +including without limitation any general, special, incidental or +consequential damages arising in connection to this license. +Notwithstanding the foregoing two (2) sentences, if Creative Commons has +expressly identified itself as the Licensor hereunder, it shall have all +rights and obligations of Licensor. +.Pp +Except for the limited purpose of indicating to the public that the Work is +licensed under the CCPL, Creative Commons does not authorize the use by +either party of the trademark "Creative Commons" or any related trademark +or logo of Creative Commons without the prior written consent of Creative +Commons. Any permitted use will be in compliance with Creative Commons' +then-current trademark usage guidelines, as may be published on its website +or otherwise made available upon request from time to time. For the +avoidance of doubt, this trademark restriction does not form part of this +License. +.Pp +Creative Commons may be contacted at http://creativecommons.org/. +.Ed +.Ss LGPL-2 +These components fall under the LGPL-2: +.Bl -tag -width 1i +.It \(co 2009 Chris Robinson +.Lk http://kcat.strangesoft.net/openal.html openal-soft +.El +.Bd -filled -offset 0.5i +.Bd -centered -compact +GNU LIBRARY GENERAL PUBLIC LICENSE +.br +Version 2, June 1991 +.Ed +.Pp +Copyright \(co 1991 Free Software Foundation, Inc. 59 Temple Place - Suite +330, Boston, MA 02111-1307, USA +.br +Everyone is permitted to copy and distribute verbatim copies of this +license document, but changing it is not allowed. +.Pp +.Bo +This is the first released version of the library GPL. It is numbered 2 +because it goes with version 2 of the ordinary GPL. +.Bc +.Bd -centered +Preamble +.Ed +.Pp +The licenses for most software are designed to take away your freedom to +share and change it. By contrast, the GNU General Public Licenses are +intended to guarantee your freedom to share and change free software--to +make sure the software is free for all its users. +.Pp +This license, the Library General Public License, applies to some specially +designated Free Software Foundation software, and to any other libraries +whose authors decide to use it. You can use it for your libraries, too. +.Pp +When we speak of free software, we are referring to freedom, not price. +Our General Public Licenses are designed to make sure that you have the +freedom to distribute copies of free software (and charge for this service +if you wish), that you receive source code or can get it if you want it, +that you can change the software or use pieces of it in new free programs; +and that you know you can do these things. +.Pp +To protect your rights, we need to make restrictions that forbid anyone to +deny you these rights or to ask you to surrender the rights. These +restrictions translate to certain responsibilities for you if you +distribute copies of the library, or if you modify it. +.Pp +For example, if you distribute copies of the library, whether gratis or for +a fee, you must give the recipients all the rights that we gave you. You +must make sure that they, too, receive or can get the source code. If you +link a program with the library, you must provide complete object files to +the recipients so that they can relink them with the library, after making +changes to the library and recompiling it. And you must show them these +terms so they know their rights. +.Pp +Our method of protecting your rights has two steps: (1) copyright the +library, and (2) offer you this license which gives you legal permission to +copy, distribute and/or modify the library. +.Pp +Also, for each distributor's protection, we want to make certain that +everyone understands that there is no warranty for this free library. If +the library is modified by someone else and passed on, we want its +recipients to know that what they have is not the original version, so that +any problems introduced by others will not reflect on the original authors' +reputations. +.Pp +Finally, any free program is threatened constantly by software patents. We +wish to avoid the danger that companies distributing free software will +individually obtain patent licenses, thus in effect transforming the +program into proprietary software. To prevent this, we have made it clear +that any patent must be licensed for everyone's free use or not licensed at +all. +.Pp +Most GNU software, including some libraries, is covered by the ordinary GNU +General Public License, which was designed for utility programs. This +license, the GNU Library General Public License, applies to certain +designated libraries. This license is quite different from the ordinary +one; be sure to read it in full, and don't assume that anything in it is +the same as in the ordinary license. +.Pp +The reason we have a separate public license for some libraries is that +they blur the distinction we usually make between modifying or adding to a +program and simply using it. Linking a program with a library, without +changing the library, is in some sense simply using the library, and is +analogous to running a utility program or application program. However, in +a textual and legal sense, the linked executable is a combined work, a +derivative of the original library, and the ordinary General Public License +treats it as such. +.Pp +Because of this blurred distinction, using the ordinary General Public +License for libraries did not effectively promote software sharing, because +most developers did not use the libraries. We concluded that weaker +conditions might promote sharing better. +.Pp +However, unrestricted linking of non-free programs would deprive the users +of those programs of all benefit from the free status of the libraries +themselves. This Library General Public License is intended to permit +developers of non-free programs to use free libraries, while preserving +your freedom as a user of such programs to change the free libraries that +are incorporated in them. (We have not seen how to achieve this as regards +changes in header files, but we have achieved it as regards changes in the +actual functions of the Library.) The hope is that this will lead to +faster development of free libraries. +.Pp +The precise terms and conditions for copying, distribution and modification +follow. Pay close attention to the difference between a "work based on the +library" and a "work that uses the library". The former contains code +derived from the library, while the latter only works together with the +library. +.Pp +Note that it is possible for a library to be covered by the ordinary +General Public License rather than by this special one. +.Bd -centered +GNU LIBRARY GENERAL PUBLIC LICENSE +.br +TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION +.Ed +.Pp +0. This License Agreement applies to any software library which contains a +notice placed by the copyright holder or other authorized party saying it +may be distributed under the terms of this Library General Public License +(also called "this License"). Each licensee is addressed as "you". +.Pp +A "library" means a collection of software functions and/or data prepared +so as to be conveniently linked with application programs (which use some +of those functions and data) to form executables. +.Pp +The "Library", below, refers to any such software library or work which has +been distributed under these terms. A "work based on the Library" means +either the Library or any derivative work under copyright law: that is to +say, a work containing the Library or a portion of it, either verbatim or +with modifications and/or translated straightforwardly into another +language. (Hereinafter, translation is included without limitation in the +term "modification".) +.Pp +"Source code" for a work means the preferred form of the work for making +modifications to it. For a library, complete source code means all the +source code for all modules it contains, plus any associated interface +definition files, plus the scripts used to control compilation and +installation of the library. +.Pp +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of running a +program using the Library is not restricted, and output from such a program +is covered only if its contents constitute a work based on the Library +(independent of the use of the Library in a tool for writing it). Whether +that is true depends on what the Library does and what the program that +uses the Library does. +.Pp +1. You may copy and distribute verbatim copies of the Library's complete +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the notices +that refer to this License and to the absence of any warranty; and +distribute a copy of this License along with the Library. +.Pp +You may charge a fee for the physical act of transferring a copy, and you +may at your option offer warranty protection in exchange for a fee. +.Pp +2. You may modify your copy or copies of the Library or any portion of it, +thus forming a work based on the Library, and copy and distribute such +modifications or work under the terms of Section 1 above, provided that you +also meet all of these conditions: +.Bd -filled -offset 0.5i +a) The modified work must itself be a software library. +.Pp +b) You must cause the files modified to carry prominent notices stating +that you changed the files and the date of any change. +.Pp +c) You must cause the whole of the work to be licensed at no charge to all +third parties under the terms of this License. +.Pp +d) If a facility in the modified Library refers to a function or a table of +data to be supplied by an application program that uses the facility, other +than as an argument passed when the facility is invoked, then you must make +a good faith effort to ensure that, in the event an application does not +supply such function or table, the facility still operates, and performs +whatever part of its purpose remains meaningful. +.Pp +.Po +For example, a function in a library to compute square roots has a purpose +that is entirely well-defined independent of the application. Therefore, +Subsection 2d requires that any application-supplied function or table used +by this function must be optional: if the application does not supply it, +the square root function must still compute square roots. +.Pc +.Ed +.Pp +These requirements apply to the modified work as a whole. If identifiable +sections of that work are not derived from the Library, and can be +reasonably considered independent and separate works in themselves, then +this License, and its terms, do not apply to those sections when you +distribute them as separate works. But when you distribute the same +sections as part of a whole which is a work based on the Library, the +distribution of the whole must be on the terms of this License, whose +permissions for other licensees extend to the entire whole, and thus to +each and every part regardless of who wrote it. +.Pp +Thus, it is not the intent of this section to claim rights or contest your +rights to work written entirely by you; rather, the intent is to exercise +the right to control the distribution of derivative or collective works +based on the Library. +.Pp +In addition, mere aggregation of another work not based on the Library with +the Library (or with a work based on the Library) on a volume of a storage +or distribution medium does not bring the other work under the scope of +this License. +.Pp +3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so that +they refer to the ordinary GNU General Public License, version 2, instead +of to this License. (If a newer version than version 2 of the ordinary GNU +General Public License has appeared, then you can specify that version +instead if you wish.) Do not make any other change in these notices. +.Pp +Once this change is made in a given copy, it is irreversible for that copy, +so the ordinary GNU General Public License applies to all subsequent copies +and derivative works made from that copy. +.Pp +This option is useful when you wish to copy part of the code of the Library +into a program that is not a library. +.Pp +4. You may copy and distribute the Library (or a portion or derivative of +it, under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you accompany it with the complete +corresponding machine-readable source code, which must be distributed under +the terms of Sections 1 and 2 above on a medium customarily used for +software interchange. +.Pp +If distribution of object code is made by offering access to copy from a +designated place, then offering equivalent access to copy the source code +from the same place satisfies the requirement to distribute the source +code, even though third parties are not compelled to copy the source along +with the object code. +.Pp +5. A program that contains no derivative of any portion of the Library, but +is designed to work with the Library by being compiled or linked with it, +is called a "work that uses the Library". Such a work, in isolation, is +not a derivative work of the Library, and therefore falls outside the scope +of this License. +.Pp +However, linking a "work that uses the Library" with the Library creates an +executable that is a derivative of the Library (because it contains +portions of the Library), rather than a "work that uses the library". The +executable is therefore covered by this License. Section 6 states terms +for distribution of such executables. +.Pp +When a "work that uses the Library" uses material from a header file that +is part of the Library, the object code for the work may be a derivative +work of the Library even though the source code is not. Whether this is +true is especially significant if the work can be linked without the +Library, or if the work is itself a library. The threshold for this to be +true is not precisely defined by law. +.Pp +If such an object file uses only numerical parameters, data structure +layouts and accessors, and small macros and small inline functions (ten +lines or less in length), then the use of the object file is unrestricted, +regardless of whether it is legally a derivative work. (Executables +containing this object code plus portions of the Library will still fall +under Section 6.) +.Pp +Otherwise, if the work is a derivative of the Library, you may distribute +the object code for the work under the terms of Section 6. Any executables +containing that work also fall under Section 6, whether or not they are +linked directly with the Library itself. +.Pp +6. As an exception to the Sections above, you may also compile or link a +"work that uses the Library" with the Library to produce a work containing +portions of the Library, and distribute that work under terms of your +choice, provided that the terms permit modification of the work for the +customer's own use and reverse engineering for debugging such +modifications. +.Pp +You must give prominent notice with each copy of the work that the Library +is used in it and that the Library and its use are covered by this License. +You must supply a copy of this License. If the work during execution +displays copyright notices, you must include the copyright notice for the +Library among them, as well as a reference directing the user to the copy +of this License. Also, you must do one of these things: +.Bd -filled -offset 0.5i +a) Accompany the work with the complete corresponding machine-readable +source code for the Library including whatever changes were used in the +work (which must be distributed under Sections 1 and 2 above); and, if the +work is an executable linked with the Library, with the complete +machine-readable "work that uses the Library", as object code and/or source +code, so that the user can modify the Library and then relink to produce a +modified executable containing the modified Library. (It is understood +that the user who changes the contents of definitions files in the Library +will not necessarily be able to recompile the application to use the +modified definitions.) +.Pp +b) Accompany the work with a written offer, valid for at least three years, +to give the same user the materials specified in Subsection 6a, above, for +a charge no more than the cost of performing this distribution. +.Pp +c) If distribution of the work is made by offering access to copy from a +designated place, offer equivalent access to copy the above specified +materials from the same place. +.Pp +d) Verify that the user has already received a copy of these materials or +that you have already sent this user a copy. +.Ed +.Pp +For an executable, the required form of the "work that uses the Library" +must include any data and utility programs needed for reproducing the +executable from it. However, as a special exception, the source code +distributed need not include anything that is normally distributed (in +either source or binary form) with the major components (compiler, kernel, +and so on) of the operating system on which the executable runs, unless +that component itself accompanies the executable. +.Pp +It may happen that this requirement contradicts the license restrictions of +other proprietary libraries that do not normally accompany the operating +system. Such a contradiction means you cannot use both them and the +Library together in an executable that you distribute. +.Pp +7. You may place library facilities that are a work based on the Library +side-by-side in a single library together with other library facilities not +covered by this License, and distribute such a combined library, provided +that the separate distribution of the work based on the Library and of the +other library facilities is otherwise permitted, and provided that you do +these two things: +.Bd -filled -offset 0.5i +a) Accompany the combined library with a copy of the same work based on the +Library, uncombined with any other library facilities. This must be +distributed under the terms of the Sections above. +.Pp +b) Give prominent notice with the combined library of the fact that part of +it is a work based on the Library, and explaining where to find the +accompanying uncombined form of the same work. +.Ed +.Pp +8. You may not copy, modify, sublicense, link with, or distribute the +Library except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense, link with, or distribute the Library +is void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under this +License will not have their licenses terminated so long as such parties +remain in full compliance. +.Pp +9. You are not required to accept this License, since you have not signed +it. However, nothing else grants you permission to modify or distribute +the Library or its derivative works. These actions are prohibited by law +if you do not accept this License. Therefore, by modifying or distributing +the Library (or any work based on the Library), you indicate your +acceptance of this License to do so, and all its terms and conditions for +copying, distributing or modifying the Library or works based on it. +.Pp +10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the original +licensor to copy, distribute, link with or modify the Library subject to +these terms and conditions. You may not impose any further restrictions on +the recipients' exercise of the rights granted herein. You are not +responsible for enforcing compliance by third parties to this License. +.Pp +11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot distribute +so as to satisfy simultaneously your obligations under this License and any +other pertinent obligations, then as a consequence you may not distribute +the Library at all. For example, if a patent license would not permit +royalty-free redistribution of the Library by all those who receive copies +directly or indirectly through you, then the only way you could satisfy +both it and this License would be to refrain entirely from distribution of +the Library. +.Pp +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. +.Pp +It is not the purpose of this section to induce you to infringe any patents +or other property right claims or to contest validity of any such claims; +this section has the sole purpose of protecting the integrity of the free +software distribution system which is implemented by public license +practices. Many people have made generous contributions to the wide range +of software distributed through that system in reliance on consistent +application of that system; it is up to the author/donor to decide if he or +she is willing to distribute software through any other system and a +licensee cannot impose that choice. +.Pp +This section is intended to make thoroughly clear what is believed to be a +consequence of the rest of this License. +.Pp +12. If the distribution and/or use of the Library is restricted in certain +countries either by patents or by copyrighted interfaces, the original +copyright holder who places the Library under this License may add an +explicit geographical distribution limitation excluding those countries, so +that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. +.Pp +13. The Free Software Foundation may publish revised and/or new versions of +the Library 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. +.Pp +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Library does not specify a license version +number, you may choose any version ever published by the Free Software +Foundation. +.Pp +14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, write +to the author to ask for permission. For software which is copyrighted by +the Free Software Foundation, write to the Free Software Foundation; we +sometimes make exceptions for this. Our decision will be guided by the two +goals of preserving the free status of all derivatives of our free software +and of promoting the sharing and reuse of software generally. +.Bd -centered +NO WARRANTY +.Ed +.Pp +15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE +LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. +.Pp +16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER +SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. +.Bd -centered +END OF TERMS AND CONDITIONS +.Pp +Appendix: How to Apply These Terms to Your New Libraries +.Ed +.Pp +If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). +.Pp +To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. +.Bd -filled -offset 0.5i + +.br +Copyright \(co +.Pp +This library is free software; you can redistribute it and/or modify it +under the terms of the GNU Library General Public License as published by +the Free Software Foundation; either version 2 of the License, or (at your +option) any later version. +.Pp +This library is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public +License for more details. +.Pp +You should have received a copy of the GNU Library General Public License +along with this library; if not, write to the Free Software Foundation, +Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA +.Ed +.Pp +Also add information on how to contact you by electronic and paper mail. +.Pp +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: +.Bd -filled -offset 0.5i +Yoyodyne, Inc., hereby disclaims all copyright interest in the library +`Frob' (a library for tweaking knobs) written by James Random Hacker. +.Bd -ragged +, 1 April 1990 +.br +Ty Coon, President of Vice +.Ed +.Ed +.Pp +That's all there is to it! +.Ed +.Ss LGPL-2.1 +These components fall under the LGPL-2.1: +.Bl -tag -width 1i +.It \(co 2009 Sam Lantinga et al. +.Lk http://www.libsdl.org/ SDL +.It \(co 2002 Bob Pendleton +.Lk http://www.gameprogrammer.com/fastevents/ fastevents +.El +.Bd -filled -offset 0.5i +.Bd -centered -compact +GNU LESSER GENERAL PUBLIC LICENSE +.br +Version 2.1, February 1999 +.Ed +.Pp +Copyright \(co 1991, 1999 Free Software Foundation, Inc. 51 Franklin St, +Fifth Floor, Boston, MA 02110-1301 USA +.br +Everyone is permitted to copy and distribute verbatim copies of this +license document, but changing it is not allowed. +.Pp +.Bo +This is the first released version of the Lesser GPL. It also counts as +the successor of the GNU Library Public License, version 2, hence the +version number 2.1. +.Bc +.Bd -centered +Preamble +.Ed +.Pp +The licenses for most software are designed to take away your freedom to +share and change it. By contrast, the GNU General Public Licenses are +intended to guarantee your freedom to share and change free software--to +make sure the software is free for all its users. +.Pp +This license, the Lesser General Public License, applies to some specially +designated software packages--typically libraries--of the Free Software +Foundation and other authors who decide to use it. You can use it too, but +we suggest you first think carefully about whether this license or the +ordinary General Public License is the better strategy to use in any +particular case, based on the explanations below. +.Pp +When we speak of free software, we are referring to freedom of use, not +price. Our General Public Licenses are designed to make sure that you have +the freedom to distribute copies of free software (and charge for this +service if you wish); that you receive source code or can get it if you +want it; that you can change the software and use pieces of it in new free +programs; and that you are informed that you can do these things. +.Pp +To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for you +if you distribute copies of the library or if you modify it. +.Pp +For example, if you distribute copies of the library, whether gratis or for +a fee, you must give the recipients all the rights that we gave you. You +must make sure that they, too, receive or can get the source code. If you +link other code with the library, you must provide complete object files to +the recipients, so that they can relink them with the library after making +changes to the library and recompiling it. And you must show them these +terms so they know their rights. +.Pp +We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. +.Pp +To protect each distributor, we want to make it very clear that there is no +warranty for the free library. Also, if the library is modified by someone +else and passed on, the recipients should know that what they have is not +the original version, so that the original author's reputation will not be +affected by problems that might be introduced by others. +.Pp +Finally, software patents pose a constant threat to the existence of any +free program. We wish to make sure that a company cannot effectively +restrict the users of a free program by obtaining a restrictive license +from a patent holder. Therefore, we insist that any patent license +obtained for a version of the library must be consistent with the full +freedom of use specified in this license. +.Pp +Most GNU software, including some libraries, is covered by the ordinary GNU +General Public License. This license, the GNU Lesser General Public +License, applies to certain designated libraries, and is quite different +from the ordinary General Public License. We use this license for certain +libraries in order to permit linking those libraries into non-free +programs. +.Pp +When a program is linked with a library, whether statically or using a +shared library, the combination of the two is legally speaking a combined +work, a derivative of the original library. The ordinary General Public +License therefore permits such linking only if the entire combination fits +its criteria of freedom. The Lesser General Public License permits more +lax criteria for linking other code with the library. +.Pp +We call this license the "Lesser" General Public License because it does +Less to protect the user's freedom than the ordinary General Public +License. It also provides other free software developers Less of an +advantage over competing non-free programs. These disadvantages are the +reason we use the ordinary General Public License for many libraries. +However, the Lesser license provides advantages in certain special +circumstances. +.Pp +For example, on rare occasions, there may be a special need to encourage +the widest possible use of a certain library, so that it becomes a de-facto +standard. To achieve this, non-free programs must be allowed to use the +library. A more frequent case is that a free library does the same job as +widely used non-free libraries. In this case, there is little to gain by +limiting the free library to free software only, so we use the Lesser +General Public License. +.Pp +In other cases, permission to use a particular library in non-free programs +enables a greater number of people to use a large body of free software. +For example, permission to use the GNU C Library in non-free programs +enables many more people to use the whole GNU operating system, as well as +its variant, the GNU/Linux operating system. +.Pp +Although the Lesser General Public License is Less protective of the users' +freedom, it does ensure that the user of a program that is linked with the +Library has the freedom and the wherewithal to run that program using a +modified version of the Library. +.Pp +The precise terms and conditions for copying, distribution and modification +follow. Pay close attention to the difference between a "work based on the +library" and a "work that uses the library". The former contains code +derived from the library, whereas the latter must be combined with the +library in order to run. +.Bd -centered +GNU LESSER GENERAL PUBLIC LICENSE +.br +TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION +.Ed +.Pp +0. This License Agreement applies to any software library or other program +which contains a notice placed by the copyright holder or other authorized +party saying it may be distributed under the terms of this Lesser General +Public License (also called "this License"). Each licensee is addressed as +"you". +.Pp +A "library" means a collection of software functions and/or data prepared +so as to be conveniently linked with application programs (which use some +of those functions and data) to form executables. +.Pp +The "Library", below, refers to any such software library or work which has +been distributed under these terms. A "work based on the Library" means +either the Library or any derivative work under copyright law: that is to +say, a work containing the Library or a portion of it, either verbatim or +with modifications and/or translated straightforwardly into another +language. (Hereinafter, translation is included without limitation in the +term "modification".) +.Pp +"Source code" for a work means the preferred form of the work for making +modifications to it. For a library, complete source code means all the +source code for all modules it contains, plus any associated interface +definition files, plus the scripts used to control compilation and +installation of the library. +.Pp +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of running a +program using the Library is not restricted, and output from such a program +is covered only if its contents constitute a work based on the Library +(independent of the use of the Library in a tool for writing it). Whether +that is true depends on what the Library does and what the program that +uses the Library does. +.Pp +1. You may copy and distribute verbatim copies of the Library's complete +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the notices +that refer to this License and to the absence of any warranty; and +distribute a copy of this License along with the Library. +.Pp +You may charge a fee for the physical act of transferring a copy, and you +may at your option offer warranty protection in exchange for a fee. +.Pp +2. You may modify your copy or copies of the Library or any portion of it, +thus forming a work based on the Library, and copy and distribute such +modifications or work under the terms of Section 1 above, provided that you +also meet all of these conditions: +.Bd -filled -offset 0.5i +a) The modified work must itself be a software library. +.Pp +b) You must cause the files modified to carry prominent notices stating +that you changed the files and the date of any change. +.Pp +c) You must cause the whole of the work to be licensed at no charge to all +third parties under the terms of this License. +.Pp +d) If a facility in the modified Library refers to a function or a table of +data to be supplied by an application program that uses the facility, other +than as an argument passed when the facility is invoked, then you must make +a good faith effort to ensure that, in the event an application does not +supply such function or table, the facility still operates, and performs +whatever part of its purpose remains meaningful. +.Pp +.Po +For example, a function in a library to compute square roots has a purpose +that is entirely well-defined independent of the application. Therefore, +Subsection 2d requires that any application-supplied function or table used +by this function must be optional: if the application does not supply it, +the square root function must still compute square roots. +.Pc +.Ed +.Pp +These requirements apply to the modified work as a whole. If identifiable +sections of that work are not derived from the Library, and can be +reasonably considered independent and separate works in themselves, then +this License, and its terms, do not apply to those sections when you +distribute them as separate works. But when you distribute the same +sections as part of a whole which is a work based on the Library, the +distribution of the whole must be on the terms of this License, whose +permissions for other licensees extend to the entire whole, and thus to +each and every part regardless of who wrote it. +.Pp +Thus, it is not the intent of this section to claim rights or contest your +rights to work written entirely by you; rather, the intent is to exercise +the right to control the distribution of derivative or collective works +based on the Library. +.Pp +In addition, mere aggregation of another work not based on the Library with +the Library (or with a work based on the Library) on a volume of a storage +or distribution medium does not bring the other work under the scope of +this License. +.Pp +3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so that +they refer to the ordinary GNU General Public License, version 2, instead +of to this License. (If a newer version than version 2 of the ordinary GNU +General Public License has appeared, then you can specify that version +instead if you wish.) Do not make any other change in these notices. +.Pp +Once this change is made in a given copy, it is irreversible for that copy, +so the ordinary GNU General Public License applies to all subsequent copies +and derivative works made from that copy. +.Pp +This option is useful when you wish to copy part of the code of the Library +into a program that is not a library. +.Pp +4. You may copy and distribute the Library (or a portion or derivative of +it, under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you accompany it with the complete +corresponding machine-readable source code, which must be distributed under +the terms of Sections 1 and 2 above on a medium customarily used for +software interchange. +.Pp +If distribution of object code is made by offering access to copy from a +designated place, then offering equivalent access to copy the source code +from the same place satisfies the requirement to distribute the source +code, even though third parties are not compelled to copy the source along +with the object code. +.Pp +5. A program that contains no derivative of any portion of the Library, but +is designed to work with the Library by being compiled or linked with it, +is called a "work that uses the Library". Such a work, in isolation, is +not a derivative work of the Library, and therefore falls outside the scope +of this License. +.Pp +However, linking a "work that uses the Library" with the Library creates an +executable that is a derivative of the Library (because it contains +portions of the Library), rather than a "work that uses the library". The +executable is therefore covered by this License. Section 6 states terms +for distribution of such executables. +.Pp +When a "work that uses the Library" uses material from a header file that +is part of the Library, the object code for the work may be a derivative +work of the Library even though the source code is not. Whether this is +true is especially significant if the work can be linked without the +Library, or if the work is itself a library. The threshold for this to be +true is not precisely defined by law. +.Pp +If such an object file uses only numerical parameters, data structure +layouts and accessors, and small macros and small inline functions (ten +lines or less in length), then the use of the object file is unrestricted, +regardless of whether it is legally a derivative work. (Executables +containing this object code plus portions of the Library will still fall +under Section 6.) +.Pp +Otherwise, if the work is a derivative of the Library, you may distribute +the object code for the work under the terms of Section 6. Any executables +containing that work also fall under Section 6, whether or not they are +linked directly with the Library itself. +.Pp +6. As an exception to the Sections above, you may also combine or link a +"work that uses the Library" with the Library to produce a work containing +portions of the Library, and distribute that work under terms of your +choice, provided that the terms permit modification of the work for the +customer's own use and reverse engineering for debugging such +modifications. +.Pp +You must give prominent notice with each copy of the work that the Library +is used in it and that the Library and its use are covered by this License. +You must supply a copy of this License. If the work during execution +displays copyright notices, you must include the copyright notice for the +Library among them, as well as a reference directing the user to the copy +of this License. Also, you must do one of these things: +.Bd -filled -offset 0.5i +a) Accompany the work with the complete corresponding machine-readable +source code for the Library including whatever changes were used in the +work (which must be distributed under Sections 1 and 2 above); and, if the +work is an executable linked with the Library, with the complete +machine-readable "work that uses the Library", as object code and/or source +code, so that the user can modify the Library and then relink to produce a +modified executable containing the modified Library. (It is understood +that the user who changes the contents of definitions files in the Library +will not necessarily be able to recompile the application to use the +modified definitions.) +.Pp +b) Use a suitable shared library mechanism for linking with the Library. A +suitable mechanism is one that (1) uses at run time a copy of the library +already present on the user's computer system, rather than copying library +functions into the executable, and (2) will operate properly with a +modified version of the library, if the user installs one, as long as the +modified version is interface-compatible with the version that the work was +made with. +.Pp +c) Accompany the work with a written offer, valid for at least three years, +to give the same user the materials specified in Subsection 6a, above, for +a charge no more than the cost of performing this distribution. +.Pp +d) If distribution of the work is made by offering access to copy from a +designated place, offer equivalent access to copy the above specified +materials from the same place. +.Pp +e) Verify that the user has already received a copy of these materials or +that you have already sent this user a copy. +.Ed +.Pp +For an executable, the required form of the "work that uses the Library" +must include any data and utility programs needed for reproducing the +executable from it. However, as a special exception, the materials to be +distributed need not include anything that is normally distributed (in +either source or binary form) with the major components (compiler, kernel, +and so on) of the operating system on which the executable runs, unless +that component itself accompanies the executable. +.Pp +It may happen that this requirement contradicts the license restrictions of +other proprietary libraries that do not normally accompany the operating +system. Such a contradiction means you cannot use both them and the +Library together in an executable that you distribute. +.Pp +7. You may place library facilities that are a work based on the Library +side-by-side in a single library together with other library facilities not +covered by this License, and distribute such a combined library, provided +that the separate distribution of the work based on the Library and of the +other library facilities is otherwise permitted, and provided that you do +these two things: +.Bd -filled -offset 0.5i +a) Accompany the combined library with a copy of the same work based on the +Library, uncombined with any other library facilities. This must be +distributed under the terms of the Sections above. +.Pp +b) Give prominent notice with the combined library of the fact that part of +it is a work based on the Library, and explaining where to find the +accompanying uncombined form of the same work. +.Ed +.Pp +8. You may not copy, modify, sublicense, link with, or distribute the +Library except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense, link with, or distribute the Library +is void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under this +License will not have their licenses terminated so long as such parties +remain in full compliance. +.Pp +9. You are not required to accept this License, since you have not signed +it. However, nothing else grants you permission to modify or distribute +the Library or its derivative works. These actions are prohibited by law +if you do not accept this License. Therefore, by modifying or distributing +the Library (or any work based on the Library), you indicate your +acceptance of this License to do so, and all its terms and conditions for +copying, distributing or modifying the Library or works based on it. +.Pp +10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the original +licensor to copy, distribute, link with or modify the Library subject to +these terms and conditions. You may not impose any further restrictions on +the recipients' exercise of the rights granted herein. You are not +responsible for enforcing compliance by third parties with this License. +.Pp +11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot distribute +so as to satisfy simultaneously your obligations under this License and any +other pertinent obligations, then as a consequence you may not distribute +the Library at all. For example, if a patent license would not permit +royalty-free redistribution of the Library by all those who receive copies +directly or indirectly through you, then the only way you could satisfy +both it and this License would be to refrain entirely from distribution of +the Library. +.Pp +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. +.Pp +It is not the purpose of this section to induce you to infringe any patents +or other property right claims or to contest validity of any such claims; +this section has the sole purpose of protecting the integrity of the free +software distribution system which is implemented by public license +practices. Many people have made generous contributions to the wide range +of software distributed through that system in reliance on consistent +application of that system; it is up to the author/donor to decide if he or +she is willing to distribute software through any other system and a +licensee cannot impose that choice. +.Pp +This section is intended to make thoroughly clear what is believed to be a +consequence of the rest of this License. +.Pp +12. If the distribution and/or use of the Library is restricted in certain +countries either by patents or by copyrighted interfaces, the original +copyright holder who places the Library under this License may add an +explicit geographical distribution limitation excluding those countries, so +that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. +.Pp +13. The Free Software Foundation may publish revised and/or new versions of +the Lesser General Public License from time to time. Such new versions +will be similar in spirit to the present version, but may differ in detail +to address new problems or concerns. +.Pp +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Library does not specify a license version +number, you may choose any version ever published by the Free Software +Foundation. +.Pp +14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, write +to the author to ask for permission. For software which is copyrighted by +the Free Software Foundation, write to the Free Software Foundation; we +sometimes make exceptions for this. Our decision will be guided by the two +goals of preserving the free status of all derivatives of our free software +and of promoting the sharing and reuse of software generally. +.Bd -centered +NO WARRANTY +.Ed +.Pp +15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE +LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. +.Pp +16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER +SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. +.Bd -centered +END OF TERMS AND CONDITIONS +.Pp +How to Apply These Terms to Your New Libraries +.Ed +.Pp +If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). +.Pp +To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. +.Bd -filled -offset 0.5i + +.br +Copyright \(co +.Pp +This library is free software; you can redistribute it and/or modify it +under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation; either version 2.1 of the License, or (at +your option) any later version. +.Pp +This library is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public +License for more details. +.Pp +You should have received a copy of the GNU Lesser General Public License +along with this library; if not, write to the Free Software Foundation, +Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +.Ed +.Pp +Also add information on how to contact you by electronic and paper mail. +.Pp +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: +.Pp +.Bd -filled -offset 0.5i +Yoyodyne, Inc., hereby disclaims all copyright interest in the library +`Frob' (a library for tweaking knobs) written by James Random Hacker. +.Bd +, 1 April 1990 +.br +Ty Coon, President of Vice +.Ed +.Ed +.Pp +That's all there is to it! +.Ed +.Ss MIT License +These components fall under the MIT license: +.Bl -tag -width 1i +.It \(co 1995-2008 Lua.org, PUC-Rio +.Lk http://www.lua.org/ Lua +.El +.Bd -filled -offset 0.5i +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: +.Pp +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. +.Pp +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. +.Ed +.Ss zlib-libpng +These components fall under the zlib-libpng license: +.Bl -tag -width 1i +.It \(co 1995-2010 Jean-loup Gailly and Mark Adler +.Lk http://www.zlib.net/ zlib +.It \(co 1998-2011 Glenn Randers-Pehrson +.Lk http://www.libpng.org/pub/png/libpng.html libpng +.It \(co 2003 Neil Carter +.Lk http://www.nether.org.uk/bad_mac_code.html "original image and sound resources" +.El +.Bd -filled -offset 0.5i +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from +the use of this software. +.Pp +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: +.Bl -enum +.It +The origin of this software must not be misrepresented; you must not claim +that you wrote the original software. If you use this software in a +product, an acknowledgment in the product documentation would be +appreciated but is not required. +.It +Altered source versions must be plainly marked as such, and must not be +misrepresented as being the original software. +.It +This notice may not be removed or altered from any source distribution. +.El +.Ed +.Ss Uncategorized +Some components fall under some other license: +.Bl -tag -width 1i +.It \(co 2001-2004 Unicode, Inc. +.Lk http://www.unicode.org/Public/PROGRAMS/CVTUTF/ ConvertUTF +.El +.Bd -filled -offset 0.5i +Disclaimer +.Pp +This source code is provided as is by Unicode, Inc. No claims are made as +to fitness for any particular purpose. No warranties of any kind are +expressed or implied. The recipient agrees to determine applicability of +information provided. If this file has been purchased on magnetic or +optical media from Unicode, Inc., the sole remedy for any claim will be +exchange of defective media within 90 days of receipt. +.Pp +Limitations on Rights to Redistribute This Code +.Pp +Unicode, Inc. hereby grants the right to freely use the information +supplied in this file in the creation of products supporting the Unicode +Standard, and to make copies of this file in any form for internal or +external distribution as long as this notice remains attached. +.Ed +.Sh SEE ALSO +.Xr yoink 6 +.Sh AUTHORS +.Bl -tag -width 2i -compact +.It An Charles McGarvey +.Mt chaz@dogcows.com +.El diff --git a/doc/yoink_readme.7 b/doc/yoink_readme.7 new file mode 100644 index 0000000..e61ddf6 --- /dev/null +++ b/doc/yoink_readme.7 @@ -0,0 +1,129 @@ +.\" +.\" Copyright (c) 2009-2011, Charles McGarvey +.\" All rights reserved. +.\" +.\" Distributable under the terms and conditions of the 2-clause BSD +.\" license; see the file COPYING for a complete text of the license. +.\" +.Dd June 14, 2011 +.Dt YOINK_README 7 +.Os +.Sh NAME +.Nm yoink_readme +.Nd general information about yoink +.Sh DESCRIPTION +Yoink is a game created by Neil Carter for Mac OS. You play the part of a +flying alien heroine who must defend her home on Earth from other airborne +alien invaders. +.Pp +This version of the game uses all new code and modern frameworks to bring +this simple, fast-moving action game to a wider audience. +.Ss INSTALLATION +Installing Yoink is simple. You can typically use commands such as these: +.Pp +.D1 cd /path/to/yoink +.D1 ./configure +.D1 make && make install +.Pp +This will install Yoink into the +.Pa /usr/local +directory. To run Yoink, issue the command: +.Pp +.D1 /usr/local/bin/yoink +.Pp +or just +.Nm yoink +if +.Pa /usr/local/bin +is already in your +.Ev PATH Ns . +See +.Xr yoink_install 7 +for a more detailed discussion about the build system and a list of +required packages. +.Ss LICENSE +The new code is released under the 2-clause BSD license. The old code and +original resources are provided under the zlib/libpng License. See the +.Pa COPYING +file for complete details. The full texts of applicable licenses can be +found in +.Pa doc/licenses +within the Yoink package. +.Ss ABOUT THE CODE +The code is a complete rewrite, containing none of the original code. I've +made some effort to put the more generic or reusable code into a separate +library called libmoof. I've also made an effort to incorporate 3rd-party +code that happened to fit well into what I needed. So, generally, the +source code is separated into these three categories: +.Bl -enum +.It +Yoink-specific code. This is the code in the +.Pa src +directory. These classes reside in no explicit namespace. +.It +Reusable code. The code is in +.Pa src/moof Ns , +and it is compiled as a convenience library. These classes and helper +functions reside in the moof namespace. Since I wrote this code alongside +the Yoink-specific stuff, there is somewhat of a blurry line between the +two categories, unfortunately. +.It +Third-party code. This is made up of free code from other projects or +libraries, the licenses of which are also noted in the +.Pa COPYING +file. This code resides in various namespaces and in various +subdirectories of +.Pa src Ns . +.El +.Ss PACKAGING +Here are some tips to help packagers: +.Bl -bullet +.It +The build scripts are written in Lua, so make sure the Lua interpreter is +installed. That shouldn't be a problem since Yoink depends on the Lua +library anyway. +.It +The +.Pa Makefile +will only work well with GNU make. On some systems, this is installed as +.Nm gmake Ns . +.It +The +.Pa configure +script supports most of the useful options that an Autoconf-generated +script would have, and the +.Pa Makefile +supports +.Ar DESTDIR Ns . +.El +.Pp +See +.Xr yoink_install 7 +for a more detailed discussion about the build system. +.Ss SENDING PATCHES +I'll gladly entertain patches if you want to help out. Just email me your +stuff or tell me where to pull if you use git. If you're interested in +that, please observe the following: +.Bl -bullet +.It +Stick to the coding style of the source code files you edit. Follow the +general style of method and variable naming, as well as white space +formatting. In particular, use literal tabs with an assumed tabstop of 4 +characters. Also, try to limit line lengths to 75 characters. +.It +For legal reasons, don't include other peoples' code with your patch. You +must also agree to license your changes according to the same terms and +conditions as the files you edit, usually the 2-clause BSD license. +.It +If you want your name and contact information in the +.Pa AUTHORS +file, please make it so in the patch you provide. +.El +.Sh SEE ALSO +.Xr yoinkrc 5 Ns , +.Xr yoink 6 +.Sh AUTHORS +.Bl -tag -width 2i -compact +.It An Charles McGarvey +.Mt chaz@dogcows.com +.El diff --git a/doc/yoinkrc.5.in b/doc/yoinkrc.5.in new file mode 100644 index 0000000..2d964a1 --- /dev/null +++ b/doc/yoinkrc.5.in @@ -0,0 +1,79 @@ +.\" +.\" Copyright (c) 2009-2011, Charles McGarvey +.\" All rights reserved. +.\" +.\" Distributable under the terms and conditions of the 2-clause BSD +.\" license; see the file COPYING for a complete text of the license. +.\" +.Dd July 24, 2009 +.Dt YOINKRC 5 +.Os +.Sh NAME +.Nm yoinkrc +.Nd user configuration for yoink +.Sh DESCRIPTION +Yoink configuration files are little more than Lua scripts with meaningful +variables. The syntax for variable assignment is similar to that in other +languages, where the variable name appears on the left side of an equals +\(lq=\(rq character, and the value to be assigned appears on the right +side. Please refer to the distributed configuration file at +.Pa @pkgdatadir@/yoinkrc +for an example of the syntax. Here is a list of some of the available +options: +.Bl -tag -width Fl +.It Va detail +The level of detail. Possible values are 1, 2, or 3 where 1 means the +least amount of detail and 3 means the most. This effects the number of +objects drawn to the screen. A high level of detail will draw everything +but could cause poor frame rates if the graphics driver can't keep up with +the load. Lower levels will omit certain details which aren't crucial for +playing the game with the possible benefit of higher frame rates. See the +Notes for more ways to increase the game's performance. The default value +is 3. +.It Va doublebuffer +If true, double-buffering will be used to help minimize distortion and +artifacts caused by the animation of the game. Otherwise, a single buffer +will be used. The default value is true. +.It Va framerate +The target number of frames to be drawn per second. If your computer is +really old, you can get away with decreasing this value and still have +reasonably smooth animation. You can set this to a very high number to +effectively render as many frames as is possible, but the actual rate could +be limited by vertical display synchronization, depending on the X11 driver +and settings used. The default value is 50. +.It Va fullscreen +If true, the window will capture the display and render the game in full +screen splendor. A value of false means the game will run in a window. +The default value is false. +.It Va resizable +If true, the window will be resizable by the window manager. This option +is meaningless if the game is drawing to the full screen. The default +option is true. +.It Va showfps +If true, the current number of frames being drawn per second will be +printed to the console every second. The default value is false. +.It Va timestep +The number of times per second the simulation state will be updated. A +value of 100 or higher is ideal for a better physical simulation. Values +that are much lower cause the CPU to do less work, but accuracy will +suffer. Errors could be introduced in the game with extremely low values. +The default value is 80. +.It Va videomode +The resolution or size of the window. The value is an array with three +number elements representing the width, height, and bits per pixel that +make up the video mode. The third number is optional. The default value +is {800,600}. +.El +.Sh FILES +.Bl -tag -compact +.It Pa @pkgdatadir@/yoinkrc +.It Pa /etc/yoinkrc +.It Pa ~/.yoinkrc +.El +.Sh SEE ALSO +.Xr yoink 6 +.Sh AUTHORS +.Bl -tag -width 2i -compact +.It An Charles McGarvey +.Mt chaz@dogcows.com +.El diff --git a/options.lua b/options.lua new file mode 100644 index 0000000..30d1c75 --- /dev/null +++ b/options.lua @@ -0,0 +1,597 @@ + +-- +-- Yoink Configuration Rules +-- Use this file with config.lua to generate config files. +-- + +local project = "Yoink" +local version = "0.1" +local website = "http://www.dogcows.com/yoink" +local contact = "chaz@dogcows.com" + + +local check = require "check" +local util = require "utility" + +return string.format("%s %s", project, version), +{ + name = "Yoink Configuration", + caption = "Choose the category of settings to view/change.", + { + name = "Installation Paths", + caption = "Set the directory paths where program files will be installed.", + { + symbol = "prefix", + value = "/usr/local", + cmdline = "--prefix", + name = "Prefix", + caption = "Set the base installation directory.", + check = function(value) + libdir = value .. "/lib" + return value + end + }, + { + symbol = "exec_prefix", + value = "$(prefix)", + cmdline = "--exec-prefix", + name = "Executable Prefix", + caption = "Set the base installation directory for executables.", + visible = function() return showAdvanced end + }, + { + symbol = "bindir", + value = "$(exec_prefix)/bin", + cmdline = "--bindir", + name = "Binaries", + caption = "Set the executable storage directory." + }, + { + symbol = "libdir", + value = "/usr/local/lib" + }, + { + symbol = "datarootdir", + value = "$(prefix)/share", + cmdline = "--datarootdir", + name = "Data Root", + caption = "Set the base installation directory for resource files.", + visible = function() return showAdvanced end + }, + { + symbol = "datadir", + value = "$(datarootdir)", + cmdline = "--datadir", + name = "Data", + caption = "Set the program resource storage directory." + }, + { + symbol = "pkgdatadir", + value = "$(datadir)/$(projectName)", + config = "YOINK_DATADIR", + export = "pkgdatadir", + name = "Package Data", + caption = "Set the program resource storage directory.", + visible = function() return showAdvanced end + }, + { + symbol = "mandir", + value = "$(datarootdir)/man", + cmdline = "--mandir", + name = "Manuals", + caption = "Set the manual page storage directory." + } + }, + { + name = "Build Options", + caption = "Set toolset commands and flags.", + { + symbol = "build", + value = util.exec("config.guess"), + cmdline = "--build", + name = "Build Triplet", + caption = "Set the build triplet.", + check = function(value) return value end + }, + { + symbol = "host", + value = "", + cmdline = "--host", + name = "Host Triplet", + caption = "Set the host triplet.", + check = function(value) + if value == "" + then + CC = "gcc" + CXX = "g++" + AR = "ar" + RANLIB = "ranlib" + WINDRES = "windres" + else + CC = value .. "-gcc" + CXX = value .. "-g++" + AR = value .. "-ar" + RANLIB = value .. "-ranlib" + WINDRES = value .. "-windres" + end + if value:find("mingw32") + then + platform = "win32" + EXEEXT = ".exe" + else + platform = "posix" + EXEEXT = "" + end + return value + end, + before = {"dependencies", "CC", "CXX", "AR", "RANLIB", "WINDRES"} + }, + { + symbol = "EXEEXT", + value = "", + name = "Executable Suffix", + export = "EXEEXT", + caption = "Set the extension of binary executables.", + help = [[ +Some platforms follow certain conventions with regard +to the file extension of executables. By default, the +build system will create executables with no suffix, +but specifying this option will cause the text to be +appended to the names of these files. + +This option may be changed without your intervention if +automatic checks determine there is a common executable +suffix for the host platform. +]], + visible = function() return showAdvanced end + }, + { + symbol = "platform", + value = {"posix", "win32"}, + config = "PLATFORM", + name = "Platform", + caption = "Set the architectural platform to target.", + visible = function() return showAdvanced end, + check = function(value) + if value == "win32" + then + PKG_LDLIBS = PKG_LDLIBS:setFlag("-lws2_32") + else + PKG_LDLIBS = PKG_LDLIBS:unsetFlag("-lws2_32") + end + return value + end, + before = {"LDLIBS"} + }, + { + name = "Toolset Options", + caption = "Customize the toolset.", + help = [[ +You can set which compilers and other tools to use. +You may also specify which extra flags should be used +during the compile and linking phase. +]], + { + symbol = "CC", + value = "cc", + cmdline = "CC", + name = "CC", + caption = "Set the C compiler command." + }, + { + symbol = "CXX", + value = "g++", + cmdline = "CXX", + name = "CXX", + caption = "Set the C++ compiler command." + }, + { + symbol = "AR", + value = "ar", + cmdline = "AR", + name = "AR", + caption = "Set the archiver for static libraries command." + }, + { + symbol = "RANLIB", + value = "ranlib", + cmdline = "RANLIB", + name = "RANLIB", + caption = "Set the archive indexer command." + }, + { + symbol = "WINDRES", + value = "windres", + cmdline = "WINDRES", + name = "WINDRES", + caption = "Set the Windows resource compiler command.", + visible = function() return platform == "win32" end + }, + "------------INSERT-BLANK-LINE------------", + { + symbol = "CFLAGS", + value = "-Wall -Wno-uninitialized -O2", + cmdline = "CFLAGS", + name = "CFLAGS", + caption = "Set the C compiler flags." + }, + { + symbol = "CXXFLAGS", + value = "$(CFLAGS)", + cmdline = "CXXFLAGS", + name = "CXXFLAGS", + caption = "Set the C++ compiler flags." + }, + { + symbol = "CPPFLAGS", + value = "", + cmdline = "CPPFLAGS", + name = "CPPFLAGS", + caption = "Set the C preprocessor flags." + }, + { + symbol = "LDLIBS", + value = "", + cmdline = "LIBS", + name = "LIBS", + caption = "Set the libraries the executable should link with." + }, + { + symbol = "LDFLAGS", + value = "", + cmdline = "LDFLAGS", + name = "LDFLAGS", + caption = "Set the linker flags." + }, + { + symbol = "dependencies", + value = "sdl gl glu libpng openal vorbisfile lua|lua5.1", + check = function(value) + local value, err = util.pkgfind(value, libdir) + if value + then + PKG_CFLAGS = util.pkgconfig("CFLAGS", value, libdir) + PKG_LDLIBS = util.pkgconfig("LIBS", value, libdir) .. " -lz" + PKG_LDFLAGS = util.pkgconfig("LDFLAGS", value, libdir) + end + return value, err + end, + after = {"prefix"}, + temp = true + }, + { + symbol = "PKG_CFLAGS", + value = "", + after = {"dependencies"} + }, + { + symbol = "PKG_CXXFLAGS", + value = "$(PKG_CFLAGS)", + after = {"PKG_CFLAGS"} + }, + { + symbol = "PKG_LDLIBS", + value = "", + after = {"dependencies"} + }, + { + symbol = "PKG_LDFLAGS", + value = "", + after = {"dependencies"} + } + }, + "------------INSERT-BLANK-LINE------------", + { + symbol = "tracking", + value = true, + cmdline = "--enable-dependency-tracking", + name = "Dependency Tracking", + caption = "Enable tracking of code dependencies.", + help = [[ +If you are working on the code, you want this enabled +so that the files you edit will automatically be +rebuilt when you run make. This may add some overhead +to the build process. + +If in doubt, say Yes. +]] + }, + { + symbol = "profile", + value = false, + cmdline = "--enable-profile", + config = "ENABLE_PROFILING", + name = "Profiling", + caption = "Compile in gprof instructions for profiling.", + help = [[ +Yoink can be compiled with extra instructions to +generate statistical data regarding the performance of +the code. This data is saved to a file which can be +used by the gprof program to generate a nice report. + +If in doubt, say No. +]], + check = function(value) + if value + then + PKG_CFLAGS = PKG_CFLAGS:setFlag("-pg") + PKG_LDFLAGS = PKG_LDFLAGS:setFlag("-pg") + else + PKG_CFLAGS = PKG_CFLAGS:unsetFlag("-pg") + PKG_LDFLAGS = PKG_LDFLAGS:unsetFlag("-pg") + end + return value + end + } + }, + { + name = "Program Features", + caption = "Choose which features to compile into the program.", + { + symbol = "debug", + value = false, + cmdline = "--enable-debug", + config = {"DEBUG", "!NDEBUG"}, + name = "Debug Mode", + caption = "Compile in debug codepaths.", + help = [[ +The debug target mode enables runtime assertions and +other codepaths appropriate for finding bugs and +diagnosing problems. The release target mode will +avoid compiling in this extra overhead and also set +some compiler flags for optimizing the performance of +the code. + +Note that logging and exception-handling facilities are +still available in release mode, and debug symbols are +always available provided you do not explicitly strip +them out. Therefore, many problems can be diagnosed +without these extra codepaths. + +If in doubt, say No. +]], + check = function(value) + if value + then + CFLAGS = CFLAGS:setFlag("-Wall", "-g") + CFLAGS = CFLAGS:replaceFlag("%-O%d?", "-O0") + end + return value + end + }, + { + symbol = "clock_gettime", + value = false, + cmdline = "--enable-clock_gettime", + config = "ENABLE_CLOCK_GETTIME", + name = "clock_gettime", + caption = "Use a high-res clock on platforms that support it.", + help = [[ +By default, Yoink will use whatever timing facility is +provided by SDL. This only provides a low-resolution +guarantee. On some targets, a much higher-resolution +timer is available through the use of clock_gettime(2). +On such platforms, SDL might have been built to use +this time source. This option will cause Yoink to use +it directly so that the high resolution is guaranteed. + +If in doubt, say No. +]], + visible = function() return platform == "posix" end + }, + { + symbol = "doublePrecision", + value = false, + cmdline = "--enable-double-precision", + config = "ENABLE_DOUBLE_PRECISION", + name = "Double Precision", + caption = "Use doubles for floating point numbers.", + help = [[ +The most common data type for storing non-integral +numbers is called a float. These are quickly processed +on modern hardware, but they suffer problems in +accuracy. A much more accurate data type is a double, +but they may take a bit longer to process. + +In most cases, floats are adequate. Yet, using doubles +will help prevent small inaccuracies from accumulating +over time and becoming a bigger deal. + +If in doubt, say No. +]] + }, + { + symbol = "hotloading", + value = false, + cmdline = "--enable-hotloading", + config = "ENABLE_HOTLOADING", + name = "Hotloading", + caption = "Allow assets to reload themselves automatically.", + help = [[ +Hotloading allows game resources to be reloaded into +the game automatically whenever they are changed on +disk. For example, if you are running Yoink at the +same time as you are editing one of its image files, +any changes you save to the file will immediately be +seen in the game. Other types of assets are also +hotloadable. This is very useful to content creators +interested in rapid development. + +Currently only recent Linux kernels are supported. +There is a small amount of overhead associated with +hotloading; as such, it is not recommended unless you +plan to take advantage of its benefits. + +If in doubt, say No. +]], + visible = function() return platform == "posix" end + }, + { + symbol = "threads", + value = true, + cmdline = "--enable-threads", + config = "ENABLE_THREADS", + name = "Threads", + caption = "Use threads for concurrency where appropriate.", + help = [[ +If you have multiple processors or cores, enabling +threads will allow the workload to be shared. This +may have limited usefulness even if you have only a +single core. + +If in doubt, say Yes. +]] + }, + { + symbol = "gui", + value = {"none", "gtk", "qt4"}, + cmdline = "--with-gui", + config = "WITH_GUI", + name = "GUI Toolkit", + caption = "Set which (if any) widget toolkit to use for dialogs.", + help = [[ +Sometimes Yoink will show a dialog window for the +purpose of providing diagnostics information. If you +have KDE, you probably want to choose QT4 for this +purpose. If you have Gnome or any other environment, +you may prefer GTK2. This option will make certain QT4 +or GTK2 libraries dependencies. If you choose "none," +no dialog windows will be shown, and any such +information can be seen from the terminal output. + +Under certain targets, the native API will be used and +this option will have no effect. For example, a +mingw32 target will automatically use native win32 +dialogs. + +If in doubt, say None. +]], + visible = function() return platform == "posix" end, + check = function(value) + dependencies = dependencies:unsetFlag("gtk+-2.0", "QtGui") + if value == "gtk" then dependencies = dependencies:setFlag("gtk+-2.0") + elseif value == "qt4" then dependencies = dependencies:setFlag("QtGui") end + return value + end, + before = {"dependencies"} + } + }, + { + name = "Package Strings", + caption = "Set the package strings.", + visible = function() return showAdvanced end, + { + symbol = "PACKAGE", + value = project, + config = {"PACKAGE_NAME", "PACKAGE"}, + name = "Package Name", + export = "PACKAGE", + caption = "Set the name of the program.", + check = function(value) + projectName = util.symbolize(value) return value + end + }, + { + symbol = "projectName", + value = util.symbolize(project), + export = "projectName", + }, + { + symbol = "VERSION", + value = version, + config = "PACKAGE_VERSION", + export = "VERSION", + name = "Version", + caption = "Set the three-part version number of the program.", + check = function(value) + versionMajor, versionMinor, versionRevision = util.splitVersion(value) + return value + end, + before = {"versionMajor", "versionMinor", "versionRevision"} + }, + { + symbol = "packageString", + value = "$(PACKAGE) $(VERSION)", + config = "PACKAGE_STRING", + name = "Full String", + caption = "Set the complete package string." + }, + { + symbol = "TARNAME", + value = "$(projectName)", + config = "PACKAGE_TARNAME", + name = "Archive Name", + caption = "Set the name used in creating tarballs." + }, + { + symbol = "archiveFormat", + value = {"bzip2", "gzip", "lzma", "xz", "all"}, + name = "Default Archive Format", + caption = "Set the default compression format for tarballs." + }, + { + symbol = "email", + value = contact, + config = "PACKAGE_BUGREPORT", + export = "email", + name = "Email Address", + caption = "Set the email address for collecting bug reports." + }, + { + symbol = "website", + value = website, + config = "PACKAGE_URL", + name = "Website URL", + caption = "Set the project website URL." + }, + { + symbol = "versionMajor", + value = 0, + config = "VERSION_MAJOR" + }, + { + symbol = "versionMinor", + value = 0, + config = "VERSION_MINOR" + }, + { + symbol = "versionRevision", + value = 0, + config = "VERSION_REVISION" + }, + { + symbol = "gitHead", + value = "", + check = function(value) + local hash, code = util.exec("git show-ref --head HEAD | sed -n 's/\\(.*\\) HEAD/\\1/p'") + if code == 0 then value = hash end + return value + end + }, + { + symbol = "manCompression", + value = {"none", "bzip2", "gzip"}, + cmdline = "--with-man-compression", + name = "Manual Compression", + caption = "Set which compression to use for installed man pages" + }, + { + symbol = "includeConfig", + value = true, + config = "INCLUDE_CONFIG_FILE", + name = "Compile config.mk into executable", + caption = "What the name says." + } + }, + "------------INSERT-BLANK-LINE------------", + { + symbol = "showAdvanced", + value = false, + name = "Show Advanced Options", + caption = "Show advanced (and often less useful) options." + } +} + + +-- vi:ft=lua + diff --git a/scripts/cscopedb.sh b/scripts/cscopedb.sh new file mode 100755 index 0000000..1b94bdf --- /dev/null +++ b/scripts/cscopedb.sh @@ -0,0 +1,16 @@ +#!/bin/sh + +# Create or update the cscope database. + +current="$PWD" +cd / +find "$current" \ +-iname "*.c" -o \ +-iname "*.h" -o \ +-iname "*.cc" -o \ +-iname "*.hh" | sed '/ / s/^\(.*\)/"\1"/' >"$current/cscope.files" + +cd "$current" + +cscope -b -q + diff --git a/doc/man2html.lua b/scripts/man2html.lua similarity index 93% rename from doc/man2html.lua rename to scripts/man2html.lua index 9a305b0..e33a126 100755 --- a/doc/man2html.lua +++ b/scripts/man2html.lua @@ -24,7 +24,7 @@ arg.hideEmail = false arg.output = "yoink.html" arg.input = "yoink.6" -if not isReadable(arg.input) then arg.input = "doc/yoink.6" end +if not isReadable(arg.input) then arg.input = "build/doc/yoink.6" end do local t = { @@ -59,7 +59,7 @@ filters = {

This manual page was generated on ]]..os.date("%d %b %Y")..[[. For more information, go to the - Yoink website. + Yoink website.

]]) end, diff --git a/scripts/textureattr.pl b/scripts/textureattr.pl new file mode 100755 index 0000000..a12c2fd --- /dev/null +++ b/scripts/textureattr.pl @@ -0,0 +1,66 @@ +#!/usr/bin/env perl + +# +# A wrapper around pngcrush to read and write the texture attributes of a +# Yoink texture in PNG format. +# + +my $infile = shift or die "Missing argument"; +my $outfile = shift; + +if ($infile eq "-h" or $infile eq "--help") { + print <; +close(FILE); + +# See if we can't determine what the text currently is. +my $text = ""; +if ($bytes =~ m/(.{4})tEXt$key(\0)/g) +{ + my $offset = pos($bytes); + my $size = unpack("N", $1) - (length($key) + 1); + $text = substr($bytes, $offset, $size); +} + +# Write that text to a temporary file. +$tmpfile = new File::Temp(UNLINK => 1); +print $tmpfile $text; + +# Allow the user a chance to edit the text. +system("\${EDITOR:-vi} $tmpfile"); +(0 == $? >> 8) or die "Editor exited with an error"; + +# Reread the text from the temporary file. +seek $tmpfile, 0, 0; +$text = <$tmpfile>; + +# Use pngcrush to rewrite the image file with the new text. +system("pngcrush", "-fix", "-rem", "text", "-text", "b", + $key, $text, $infile, $tmpfile); +if (0 == $? >> 8) { + not $outfile and $outfile = $infile; + seek $tmpfile, 0, 0; + copy($tmpfile, $outfile) or die $!; +} else { + die "pngcrush exited with an error"; +} + diff --git a/src/Main.cc b/src/Main.cc index 070912e..a674bbc 100644 --- a/src/Main.cc +++ b/src/Main.cc @@ -17,10 +17,10 @@ #include #include -#if !defined(__WIN32) -#include -#else +#if PLATFORM_WIN32 inline int isatty(int dummy) { return 0; } +#else +#include #endif #include @@ -36,7 +36,6 @@ inline int isatty(int dummy) { return 0; } #include #include "Main.hh" -#include "version.h" Main::Main(moof::settings& settings) : @@ -122,6 +121,8 @@ std::string Main::search_paths() path += ":"; } path += YOINK_DATADIR; + path += ":"; + path += "data"; return path; } @@ -136,7 +137,7 @@ std::string Main::config_paths() std::string path = moof::resource::find_file("yoinkrc"); -#if !defined(_WIN32) +#if PLATFORM_POSIX path += ":/etc/yoinkrc"; #endif path += ":$HOME/.yoinkrc"; @@ -209,94 +210,14 @@ void Main::print_usage() << "See documentation for more options." << std::endl; } - void Main::print_info(int argc, char* argv[]) { - bool color = (isatty(1) == 1); - - stlplus::env_vector environment; - - std::string assets; - assets.assign(YOINK_DATADIR); - if (!stlplus::file_readable(assets)) - { - assets += " "; - if (color) assets += "\033[1;91m"; - assets += "(no access)"; - if (color) assets += "\033[0m"; - } - - std::string datadir = environment["YOINK_DATADIR"]; - if (!datadir.empty()) - { - if (!stlplus::folder_readable(datadir)) - { - datadir += " "; - if (color) datadir += "\033[1;91m"; - datadir += "(no access)"; - if (color) datadir += "\033[0m"; - } - } - - std::string rc_file = environment["YOINKRC"]; - if (!rc_file.empty()) - { - if (!stlplus::file_readable(rc_file)) rc_file += " (no access)"; - } - - std::cout << " Executable: " << argv[0] << std::endl -#ifdef YOINK_GITHEAD - << " Commit: "YOINK_GITHEAD << std::endl -#endif - << " Version: " << PACKAGE_VERSION << std::endl - << " Built: " << COMPILE_TIME << std::endl - << " Compiler: " << COMPILER_STRING << std::endl - << " Assets: " << assets << std::endl - << "Build options: "; - -#if ENABLE_CLOCK_GETTIME - print_option("clock_gettime", true); -#else - print_option("clock_gettime", false); -#endif -#if DEBUG - print_option("debug", true); -#else - print_option("debug", false); -#endif -#if ENABLE_DOUBLE_PRECISION - print_option("double", true); -#else - print_option("double", false); -#endif -#if WITH_GTK - print_option("gtk", true); -#else - print_option("gtk", false); -#endif -#if ENABLE_HOTLOADING - print_option("hotload", true); +#if INCLUDE_CONFIG_FILE + extern char data_config_mk[]; + std::cout << data_config_mk; #else - print_option("hotload", false); + std::cout << std::endl << "Configuration not included." << std::endl; #endif -#if ENABLE_PROFILING - print_option("profile", true); -#else - print_option("profile", false); -#endif -#if WITH_QT4 - print_option("qt4", true); -#else - print_option("qt4", false); -#endif -#if ENABLE_THREADS - print_option("threads", true); -#else - print_option("threads", false); -#endif - std::cout << std::endl; - std::cout << " YOINKRC: " << rc_file << std::endl - << "YOINK_DATADIR: " << datadir << std::endl; } void Main::print_option(const std::string& option, bool enabled) @@ -331,8 +252,6 @@ void goodbye() int main(int argc, char* argv[]) { - moof::backend backend; - if (argc > 1) { std::string arg(argv[1]); @@ -351,6 +270,8 @@ int main(int argc, char* argv[]) hello(); atexit(goodbye); + moof::backend backend; + moof::resource::set_search_paths(Main::search_paths()); moof::settings settings(argc, argv, Main::config_paths()); @@ -361,7 +282,7 @@ int main(int argc, char* argv[]) try { - moof::image_handle icon(PACKAGE, "png"); + moof::image_handle icon("yoink", "png"); if (icon) icon->set_as_icon(); else moof::log_error("no icon loaded"); icon.unload(); diff --git a/src/moof/application.cc b/src/moof/application.cc index b462a0e..0da5bae 100644 --- a/src/moof/application.cc +++ b/src/moof/application.cc @@ -27,7 +27,6 @@ namespace moof { application::application(settings& settings) : last_update_(timer::ticks()), - total_time_(SCALAR(0.0)), accum_(SCALAR(0.0)) { unsigned random_seed; @@ -43,14 +42,17 @@ application::application(settings& settings) : settings.get("framerate", framerate); framerate = SCALAR(1.0) / framerate; - //timer::default_source().scale(SCALAR(1.2)); + //timer::default_source().scale(SCALAR(0.76)); - //update_timer_.init(boost::bind(&application::dispatch_update, this, _1, _2), - //timestep_, timer::repeat, this); - next_update_ = update_timer_.expiration(); + //update_timer_.init(boost::bind(&application::dispatch_update, + //this, _1, _2), + //timestep_, timer::repeat); + //add_timer(update_timer_); + + game_time_.reset(timestep_); - draw_timer_.init(boost::bind(&application::dispatch_draw, this, _1, _2), - framerate, timer::repeat); + draw_timer_.init(boost::bind(&application::dispatch_draw, + this, _1, _2), framerate, timer::repeat); add_timer(draw_timer_); } @@ -84,28 +86,19 @@ void application::dispatch_update(timer& timer, scalar t) } - //const int MAX_FRAMESKIP = 15; + const int MAX_CONSECUTIVE_UPDATES = 15; log_debug("updating", timer.expiration(), "/", t); - //int i = 0; - //while (next_update_ < t && ++i < MAX_FRAMESKIP) - //{ - //total_time_ += timestep_; - //update(total_time_, timestep_); - - //next_update_ += timestep_; - //log_debug("updated", next_update_, "time:", timer::ticks()); - //} - scalar deltaTime = t - last_update_; accum_ += deltaTime; - while (timestep_ <= accum_) + int i = 0; + while (timestep_ <= accum_ && i < MAX_CONSECUTIVE_UPDATES) { log_debug("UPDATING"); - update(total_time_, timestep_); - total_time_ += timestep_; + update(game_time_.ticks(), timestep_); + game_time_.step(); accum_ -= timestep_; } @@ -114,17 +107,14 @@ void application::dispatch_update(timer& timer, scalar t) void application::dispatch_draw(timer& timer, scalar t) { - log_debug("next update", update_timer_.expiration()); log_debug("draw", timer.expiration(), "/", t); + // XXX temporary + thread::main_runloop().run_once(); + dispatch_update(timer, t); - //if (t < next_update_ - timestep_) return; - //scalar alpha = (t + timestep_ - next_update_) * inverse_timestep_; - //scalar alpha = (t + timestep_ - update_timer_.expiration()) * inverse_timestep_; - //scalar alpha = (next_update_ - t) * inverse_timestep_; scalar alpha = accum_ * inverse_timestep_; - //if (alpha < SCALAR(0.0) || SCALAR(1.0) < alpha) return; alpha = cml::clamp(alpha, SCALAR(-1.0), SCALAR(2.0)); if (alpha < SCALAR(0.0)) log_warning("alpha:", alpha); diff --git a/src/moof/application.hh b/src/moof/application.hh index 494e98d..8449058 100644 --- a/src/moof/application.hh +++ b/src/moof/application.hh @@ -47,15 +47,13 @@ private: void dispatch_update(timer& timer, scalar t); void dispatch_draw(timer& timer, scalar t); - scalar next_update_; scalar last_update_; - scalar total_time_; scalar accum_; + game_time game_time_; timer update_timer_; timer draw_timer_; - scalar timestep_; scalar inverse_timestep_; }; diff --git a/src/moof/image.cc b/src/moof/image.cc index 94d4687..b9076f0 100644 --- a/src/moof/image.cc +++ b/src/moof/image.cc @@ -9,8 +9,8 @@ * **************************************************************************/ -#include // FILE #include // strncmp +#include #include #include @@ -43,26 +43,29 @@ MOOF_REGISTER_RESOURCE(image, png, textures); unsigned image::global_object_ = 0; +static void read_from_stream(png_structp context, png_bytep data, png_size_t length) +{ + std::istream& stream(*(std::istream*)png_get_io_ptr(context)); + stream.read((char*)data, length); +} + + image::image(const std::string& path) : pixels_(0), object_(0), min_filter_(GL_NEAREST), mag_filter_(GL_NEAREST), + tile_s_(1), + tile_t_(1), wrap_s_(GL_CLAMP), - wrap_t_(GL_CLAMP), - tile_width_(1), - tile_height_(1) + wrap_t_(GL_CLAMP) { - FILE* fp = fopen(path.c_str(), "rb"); - if (!fp) throw std::runtime_error("image not found at " + path); + std::ifstream file(path.c_str()); + if (!file.good()) throw std::runtime_error("no valid image found at " + path); png_byte signature[8]; size_t bytesRead; - png_infop pngInfo = 0; - png_infop pngInfoEnd = 0; - png_structp pngObj = 0; - int bpp; png_byte colors; @@ -71,83 +74,100 @@ image::image(const std::string& path) : png_textp texts = 0; int nutext_s; - bytesRead = fread(signature, 1, sizeof(signature), fp); + bytesRead = file.read((char*)signature, sizeof(signature)).gcount(); if (bytesRead < sizeof(signature) || - png_sig_cmp(signature, 0, sizeof(signature)) != 0) goto cleanup; + png_sig_cmp(signature, 0, sizeof(signature)) != 0) throw 0; - pngObj = png_create_read_struct(PNG_LIBPNG_VER_STRING, 0, 0, 0); - if (!pngObj) goto cleanup; - - pngInfo = png_create_info_struct(pngObj); - if (!pngInfo) goto cleanup; - - pngInfoEnd = png_create_info_struct(pngObj); - if (!pngInfoEnd) goto cleanup; + struct png + { + png_structp context; + png_infop info; + png() : + context(png_create_read_struct(PNG_LIBPNG_VER_STRING, 0, 0, 0)), + info(png_create_info_struct(context)) + { + if (!context || !info) throw 0; + } + ~png() + { + png_destroy_read_struct(context ? &context : 0, + info ? &info : 0, 0); + } + } png; - if (setjmp(png_jmpbuf(pngObj))) goto cleanup; + if (setjmp(png_jmpbuf(png.context))) throw 0; - png_init_io(pngObj, fp); - png_set_sig_bytes(pngObj, sizeof(signature)); - png_read_info(pngObj, pngInfo); + png_set_read_fn(png.context, (void*)&file, read_from_stream); + png_set_sig_bytes(png.context, sizeof(signature)); + png_read_info(png.context, png.info); - bpp = png_get_bit_depth(pngObj, pngInfo); - colors = png_get_color_type(pngObj, pngInfo); + bpp = png_get_bit_depth(png.context, png.info); + colors = png_get_color_type(png.context, png.info); switch (colors) { case PNG_COLOR_TYPE_PALETTE: - png_set_palette_to_rgb(pngObj); + png_set_palette_to_rgb(png.context); break; case PNG_COLOR_TYPE_GRAY: - if (bpp < 8) png_set_expand(pngObj); + if (bpp < 8) png_set_expand(png.context); break; case PNG_COLOR_TYPE_GRAY_ALPHA: - png_set_gray_to_rgb(pngObj); + png_set_gray_to_rgb(png.context); break; } - if (bpp == 16) png_set_strip_16(pngObj); + if (bpp == 16) png_set_strip_16(png.context); - png_read_update_info(pngObj, pngInfo); + png_read_update_info(png.context, png.info); - bpp = png_get_bit_depth(pngObj, pngInfo); - channels_ = png_get_channels(pngObj, pngInfo); + bpp = png_get_bit_depth(png.context, png.info); + channels_ = png_get_channels(png.context, png.info); depth_ = bpp * channels_; // read comments - png_get_text(pngObj, pngInfo, &texts, &nutext_s); + bool isTexture = false; + png_get_text(png.context, png.info, &texts, &nutext_s); for (int i = 0; i < nutext_s; ++i) { - if (strncmp(texts[i].key, "TextureInfo", 11) == 0) + if (strncmp(texts[i].key, "X-Yoink-Texture", 11) == 0) { set_texture_info(texts[i].text); + isTexture = true; break; } } - width_ = png_get_image_width(pngObj, pngInfo); - height_ = png_get_image_height(pngObj, pngInfo); + width_ = png_get_image_width(png.context, png.info); + height_ = png_get_image_height(png.context, png.info); - pitch_ = png_get_rowbytes(pngObj, pngInfo); + pitch_ = png_get_rowbytes(png.context, png.info); pixels_ = new char[width_ * pitch_]; rows = new png_bytep[height_]; - for (int i = 0; i < height_; ++i) + if (isTexture) { - rows[height_-1-i] = (png_bytep)(pixels_ + i * channels_ * width_); + log_debug("texture detected; loading flipped"); + for (int i = 0; i < height_; ++i) + { + rows[height_-1-i] = (png_bytep)(pixels_ + i * channels_ * width_); + } + } + else + { + log_debug("no texture attributes found"); + for (int i = 0; i < height_; ++i) + { + rows[i] = (png_bytep)(pixels_ + i * channels_ * width_); + } } - png_read_image(pngObj, rows); - png_read_end(pngObj, 0); - -cleanup: + png_read_image(png.context, rows); + png_read_end(png.context, 0); + // TODO leak delete[] rows; - png_destroy_read_struct(pngObj ? &pngObj : 0, - pngInfo ? &pngInfo : 0, - pngInfoEnd ? &pngInfoEnd : 0); - fclose(fp); } image::~image() @@ -190,13 +210,13 @@ void image::set_as_icon() const bool image::tile_coordinates(int index, scalar coords[8]) const { // make sure the index represents a real tile - if (index < 0 && index >= tile_width_ * tile_height_) return false; + if (index < 0 && index >= tile_s_ * tile_t_) return false; - scalar w = 1.0 / scalar(tile_width_); - scalar h = 1.0 / scalar(tile_height_); + scalar w = 1.0 / scalar(tile_s_); + scalar h = 1.0 / scalar(tile_t_); - coords[0] = scalar(index % tile_width_) * w; - coords[1] = (scalar(tile_height_ - 1) - scalar(index / tile_width_)) * h; + coords[0] = scalar(index % tile_s_) * w; + coords[1] = (scalar(tile_t_ - 1) - scalar(index / tile_s_)) * h; coords[2] = coords[0] + w; coords[3] = coords[1]; coords[4] = coords[2]; @@ -334,16 +354,12 @@ void image::set_texture_info(const std::string& info) log_info("loading texture information..."); script::slot globals = script.globals(); - globals.get(tile_width_, "tiles_s"); - globals.get(tile_height_, "tiles_t"); globals.get(min_filter_, "min_filter"); globals.get(mag_filter_, "mag_filter"); + globals.get(tile_s_, "tile_s"); + globals.get(tile_t_, "tile_t"); globals.get(wrap_s_, "wrap_s"); globals.get(wrap_t_, "wrap_t"); - //min_filter_ = GL_LINEAR; - //mag_filter_ = GL_LINEAR; - //wrap_s_ = GL_CLAMP; - //wrap_t_ = GL_CLAMP; } } diff --git a/src/moof/image.hh b/src/moof/image.hh index 82c8f55..6aa251b 100644 --- a/src/moof/image.hh +++ b/src/moof/image.hh @@ -122,10 +122,10 @@ private: unsigned min_filter_; unsigned mag_filter_; + int tile_s_; + int tile_t_; unsigned wrap_s_; unsigned wrap_t_; - int tile_width_; - int tile_height_; //mutable dispatcher::handle new_context_; }; diff --git a/src/moof/log.cc b/src/moof/log.cc index e59740d..d0acf2e 100644 --- a/src/moof/log.cc +++ b/src/moof/log.cc @@ -81,15 +81,24 @@ std::ostream& log(std::cout); static std::ofstream null_log_; std::ostream& null_log(null_log_); -class log log_error(log::error); -class log log_warning(log::warning); -class log log_info(log::info); -class log log_debug(log::debug); + +// These objects are intentionally not deconstructed so that logging will +// still be available after this module has been cleaned up. +class log& log_error(*new class log(log::error)); +class log& log_warning(*new class log(log::warning)); +class log& log_info(*new class log(log::info)); +class log& log_debug(*new class log(log::debug)); static int log_script(script& script, enum log::level level) { - static class log* logs[] = {0, &log_error, &log_warning, &log_info, &log_debug}; + static class log* logs[] = { + 0, + &log_error, + &log_warning, + &log_info, + &log_debug + }; script::slot param = script[1]; diff --git a/src/moof/log.hh b/src/moof/log.hh index 1e2a216..cad63e9 100644 --- a/src/moof/log.hh +++ b/src/moof/log.hh @@ -147,10 +147,10 @@ private: extern std::ostream& log; extern std::ostream& null_log; -extern class log log_error; -extern class log log_warning; -extern class log log_info; -extern class log log_debug; +extern class log& log_error; +extern class log& log_warning; +extern class log& log_info; +extern class log& log_debug; template diff --git a/src/moof/modal_dialog.hh b/src/moof/modal_dialog.hh index c537662..4498692 100644 --- a/src/moof/modal_dialog.hh +++ b/src/moof/modal_dialog.hh @@ -22,11 +22,11 @@ #include -#if defined(_WIN32) +#if PLATFORM_WIN32 #include -#elif WITH_GTK +#elif WITH_GUI_GTK #include -#elif WITH_QT4 +#elif WITH_GUI_QT4 #include #include #include @@ -94,7 +94,7 @@ struct modal_dialog break; } -#if defined(_WIN32) +#if PLATFORM_WIN32 int icon_type; switch (type) @@ -113,7 +113,7 @@ struct modal_dialog MessageBox(0, (text1 + "\n" + text2).c_str(), title.c_str(), MB_OK | icon_type); -#elif WITH_GTK +#elif WITH_GUI_GTK int argc = 0; char** argv; @@ -153,7 +153,7 @@ struct modal_dialog // FIXME - this doesn't seem to actually remove the window from the // screen when it closes -#elif WITH_QT4 +#elif WITH_GUI_QT4 int argc = 0; char** argv; diff --git a/src/moof/rules.mk b/src/moof/rules.mk index 63fed37..5bae72c 100644 --- a/src/moof/rules.mk +++ b/src/moof/rules.mk @@ -1,32 +1,15 @@ -######################### -sp := $(sp).x -dirstack_$(sp) := $(d) -d := $(dir) -######################### - # # Define rules and targets for libmoof. # -OBJECTS_$(d) := $(patsubst %.c,%.o,$(wildcard $(d)/*.c)) \ - $(patsubst %.cc,%.o,$(wildcard $(d)/*.cc)) -D_FILES_$(d) := $(OBJECTS_$(d):%=%.d) - -LIBRARY_$(d) := $(d)/libmoof.a - -CLEAN := $(CLEAN) $(OBJECTS_$(d)) $(D_FILES_$(d)) $(LIBRARY_$(d)) - -$(OBJECTS_$(d)): CF_TGT := -I$(d) -I$(d)/.. -$(OBJECTS_$(d)): $(d)/rules.mk - -$(LIBRARY_$(d)): $(OBJECTS_$(d)) - $(DO_AR) +objects = $(patsubst %.c,$(builddir)/%.o,$(patsubst %.cc,$(builddir)/%.o,$(wildcard $d/*.c $d/*.cc))) +$(objects): TGT_CFLAGS := -I$d -I$d/.. +$(objects): config.h $(this) | $b +library = $b/libmoof.a +$(library): $(objects) + $(Q)$(ar) -######################## --include $(D_FILES_$(d)) -d := $(dirstack_$(sp)) -sp := $(basename $(sp)) -######################## +exec += $(objects) $(library) diff --git a/src/moof/runloop.cc b/src/moof/runloop.cc index f6f47dd..98bc3a2 100644 --- a/src/moof/runloop.cc +++ b/src/moof/runloop.cc @@ -22,104 +22,48 @@ namespace moof { -enum registry_action +bool comp(timer* a, timer* b) { - lookup, - set -}; + return a->expiration() < b->expiration(); +} -static uint32_t call_registry(runloop*& runloop, registry_action action) +void runloop::run_once() { #if ENABLE_THREADS - typedef stlplus::hash table_t; - static table_t table; - - uint32_t thread_id = thread::current_identifier(); - - MOOF_DECLARE_STATIC_MUTEX(table_mutex); - MOOF_MUTEX_LOCK(table_mutex); + thread_id_ = thread::current_identifier(); +#endif - switch (action) + //log_debug("------------------------------------"); + //scalar next_event = SCALAR(0.0); { - case set: - { - log_info("registering runloop", runloop, "for thread", thread_id); - if (runloop) table[thread_id] = runloop; - else table.erase(thread_id); - break; - } + MOOF_MUTEX_LOCK(timers_mutex_); - case lookup: + for (timers_it_ = timers_.begin(); + timers_it_ != timers_.end(); + ++timers_it_) { - table_t::iterator it = table.find(thread_id); - if (it != table.end()) runloop = (*it).second; - else log_warning("runloop is not in registry for thread", thread_id); - break; + (*timers_it_)->fire_if_expired(); } - } - return thread_id; -#else - return thread::current_identifier(); -#endif -} - -bool comp(timer* a, timer* b) -{ - return a->expiration() < b->expiration(); + std::sort(timers_.begin(), timers_.end(), comp); + //next_event = timers_[0]->expiration(); + } } int runloop::run() { -#if ENABLE_THREADS - runloop* runloop = this; - thread_id_ = call_registry(runloop, set); -#endif - stop_ = false; while (!stop_) { - log_debug("------------------------------------"); - scalar next_event = SCALAR(0.0); - { - MOOF_MUTEX_LOCK(timers_mutex_); - - for (timers_it_ = timers_.begin(); - timers_it_ != timers_.end(); - ++timers_it_) - { - (*timers_it_)->fire_if_expired(); - } - - std::sort(timers_.begin(), timers_.end(), comp); - next_event = timers_[0]->expiration(); - - //for (timers_it_ = timers_.begin(); - //timers_it_ != timers_.end(); - //++timers_it_) - //{ - //scalar absolute = (*timers_it_)->fire_if_expired(); - //if (next_event == SCALAR(0.0) || - //(absolute != SCALAR(0.0) && absolute < next_event)) - //{ - //next_event = absolute; - //} - //} - } - timer::sleep(next_event, timer::absolute); + run_once(); + //timer::sleep(next_event, timer::absolute); + timer::sleep(SCALAR(0.0)); } return code_; } -runloop::~runloop() -{ - runloop* runloop = 0; - call_registry(runloop, set); -} - - void runloop::stop(int code) { code_ = code; @@ -127,14 +71,6 @@ void runloop::stop(int code) } -runloop* runloop::current() -{ - runloop* runloop; - call_registry(runloop, lookup); - return runloop; -} - - void runloop::add_timer(timer& timer) { #if ENABLE_THREADS diff --git a/src/moof/runloop.hh b/src/moof/runloop.hh index f70abde..2952952 100644 --- a/src/moof/runloop.hh +++ b/src/moof/runloop.hh @@ -21,7 +21,6 @@ #include -#include #include @@ -51,9 +50,9 @@ public: } /** - * Deconstruct the runloop. + * Do one iteration of the runloop. */ - ~runloop(); + void run_once(); /** @@ -69,13 +68,6 @@ public: void stop(int code = 0); - /** Get the runloop of the current thread. - * \return The current runloop or 0 if none is running in the current - * thread. - */ - static runloop* current(); - - void add_timer(timer& timer); void remove_timer(timer& timer); @@ -93,9 +85,6 @@ private: MOOF_DECLARE_MUTEX(timers_mutex_); uint32_t thread_id_; #endif - - - backend backend_; }; diff --git a/src/moof/sound.cc b/src/moof/sound.cc index 34c30ce..864c68a 100644 --- a/src/moof/sound.cc +++ b/src/moof/sound.cc @@ -23,6 +23,8 @@ #include "log.hh" #include "sound.hh" #include "resource.hh" +#include "runloop.hh" +#include "thread.hh" #include "timer.hh" @@ -36,6 +38,9 @@ namespace moof { +thread stream_thread_; + + /*] Sound backend *************************************************************************/ @@ -356,10 +361,18 @@ public: alSourcePlay(source_); } + void start_update_timer() { stream_timer_.init(boost::bind(&impl::stream_update, this, _1, _2), - SCALAR(0.1), timer::repeat); + SCALAR(0.1), timer::repeat); + + //thread thread; + //thread.runloop().add_timer(stream_timer_); + if (!stream_thread_.is_valid()) + { + stream_thread_ = thread::detach(stream_timer_); + } } void fill_stream() @@ -531,10 +544,8 @@ public: void stream_update(timer& timer, scalar t) { - //log_error("blaaaaaaaaaaaaaaaaaaaaaaaaaaahhhhhhhhhhhhhhhhrrrrrg"); + log_debug("blaaaaaaaaaaaaaaaaaaaaaaaaaaahhhhhhhhhhhhhhhhrrrrrg"); fill_stream(); - // TODO: might be nice to also allow using threads for streaming - // rather than a timer, probably as a compile-time option } diff --git a/src/moof/thread.cc b/src/moof/thread.cc new file mode 100644 index 0000000..c1e501c --- /dev/null +++ b/src/moof/thread.cc @@ -0,0 +1,79 @@ + +/*] Copyright (c) 2009-2010, Charles McGarvey [************************** +**] All rights reserved. +* +* vi:ts=4 sw=4 tw=75 +* +* Distributable under the terms and conditions of the 2-clause BSD license; +* see the file COPYING for a complete text of the license. +* +**************************************************************************/ + +#include "runloop.hh" +#include "thread.hh" + + +namespace moof { + + +thread::thread() : + thread_(0), + runloop_(new moof::runloop) {} + + +thread thread::detach(const function& function) +{ + thread* thread = new moof::thread; + thread->function_ = function; + spawn(thread); + return *thread; +} + +thread thread::detach(timer& timer) +{ + thread* thread = new moof::thread; + thread->runloop().add_timer(timer); + thread->function_ = boost::bind(&moof::runloop::run, thread->runloop_); + spawn(thread); + return *thread; +} + + +void thread::spawn(thread* thread) +{ + thread->thread_ = SDL_CreateThread(&thread::run, (void*)thread); + if (!thread->thread_) delete thread; +} + +int thread::run(void* arg) +{ + int code = ((thread*)arg)->function_(*(thread*)arg); + delete (thread*)arg; + return code; +} + + +void thread::kill() +{ + if (thread_) + { + SDL_KillThread(thread_); + thread_ = 0; + } +} + + +moof::runloop& thread::runloop() const +{ + return *runloop_; +} + +moof::runloop& thread::main_runloop() +{ + static moof::runloop runloop; + return runloop; +} + + +} // namepsace moof + diff --git a/src/moof/thread.hh b/src/moof/thread.hh index 1e710d8..8151c32 100644 --- a/src/moof/thread.hh +++ b/src/moof/thread.hh @@ -17,18 +17,22 @@ * Light C++ wrapper around the SDL threads API. */ -#include "config.h" - #include #include +#include #include #include +#include namespace moof { +class runloop; +typedef boost::shared_ptr runloop_ptr; + + /** * Represents a thread which may be running. You cannot instantiate a * thread object directly; new threads are created by detaching functions @@ -40,28 +44,29 @@ class thread { public: - typedef boost::function function; + typedef boost::function function; /** * Construct an invalid thread object which has no association with any * real thread. */ - thread() : - thread_(0) {} + thread(); + /** * Execute a function in a new thread. * \param function The function to execute. * \return The new thread, or an invalid thread if an error occurred. */ - static thread detach(const function& function) - { - thread::function* fcopy = new thread::function(function); - SDL_Thread* thread = SDL_CreateThread(&thread::run, (void*)fcopy); - if (thread == 0) delete fcopy; - return moof::thread(thread); - } + static thread detach(const function& function); + + /** + * Detach a new thread and run its runloop with an initial timer. + * \param timer The timer to schedule on the thread. + * \return The new thread, or an invalid thread if an error occurred. + */ + static thread detach(timer& timer); /** @@ -71,21 +76,21 @@ public: */ int wait() { - int i; - SDL_WaitThread(thread_, &i); - thread_ = 0; - return i; + if (thread_) + { + int i; + SDL_WaitThread(thread_, &i); + thread_ = 0; + return i; + } + return 1; } /** * Forcefully kill the thread without giving it a chance to clean up * after itself. The thread will be invalidated. Don't use this. */ - void kill() - { - SDL_KillThread(thread_); - thread_ = 0; - } + void kill(); /** * Get whether or not the thread object is associated with a real @@ -117,20 +122,28 @@ public: } -private: + /** + * Get the thread's runloop. + * \return The thread's runloop. + */ + moof::runloop& runloop() const; + + /** + * Get the runloop for the main thread. + * \return The runloop. + */ + static moof::runloop& main_runloop(); - thread(SDL_Thread* thread) : - thread_(thread) {} - static int run(void* arg) - { - int code = (*(function*)arg)(); - delete (function*)arg; - return code; - } +private: + + static void spawn(thread* thread); + static int run(void* arg); - SDL_Thread* thread_; + function function_; + SDL_Thread* thread_; + runloop_ptr runloop_; }; diff --git a/src/moof/timer.cc b/src/moof/timer.cc index c45e1b8..cd898dd 100644 --- a/src/moof/timer.cc +++ b/src/moof/timer.cc @@ -199,7 +199,7 @@ private: }; -void timer::sleep(scalar seconds, mode mode) +void timer::sleep(scalar seconds, enum mode mode) { if (mode == absolute) seconds -= ticks(); if (seconds < SCALAR(0.0)) return; diff --git a/src/moof/timer.hh b/src/moof/timer.hh index 9f3e984..f9545eb 100644 --- a/src/moof/timer.hh +++ b/src/moof/timer.hh @@ -296,11 +296,10 @@ class game_time : public timer_source { public: - game_time(scalar timestep) : - timestep_(timestep), + game_time(scalar timestep = SCALAR(1.0)) : scale_(timestep) { - reset(); + reset(timestep); } scalar ticks() const @@ -313,6 +312,11 @@ public: reference_ = SCALAR(0.0); ticks_ = 0; } + void reset(scalar timestep) + { + reset(); + timestep_ = timestep; + } void scale(scalar factor) { diff --git a/src/moof/video.hh b/src/moof/video.hh index 8b42cfd..0b5cb99 100644 --- a/src/moof/video.hh +++ b/src/moof/video.hh @@ -77,7 +77,7 @@ public: explicit video(const std::string& caption = "Moof!!"); explicit video(const class attributes& attribs); - explicit video(const std::string& caption, + video(const std::string& caption, const class attributes& attribs); ~video(); diff --git a/src/rules.mk b/src/rules.mk index 8bffe04..f6bd89b 100644 --- a/src/rules.mk +++ b/src/rules.mk @@ -1,63 +1,45 @@ -######################### -sp := $(sp).x -dirstack_$(sp) := $(d) -d := $(dir) -######################### - -# -# Include the subdirectories--order is not important. -# - -dir := $(d)/moof -include $(dir)/rules.mk - -dir := $(d)/stlplus -include $(dir)/rules.mk - - # # Define rules and targets for Yoink. # -OBJECTS_$(d) := $(patsubst %.c,%.o,$(wildcard $(d)/*.c)) \ - $(patsubst %.cc,%.o,$(wildcard $(d)/*.cc)) -D_FILES_$(d) := $(OBJECTS_$(d):%=%.d) +$(call include,moof stlplus) # Recurse into subdirectories. -ifeq ($(PLATFORM),win32) -OBJECTS_$(d) += $(d)/yoink.o -endif +objects = $(patsubst %.c,$(builddir)/%.o,$(patsubst %.cc,$(builddir)/%.o,$(wildcard $d/*.c $d/*.cc))) -PROGRAM_$(d) := $(call add_exe_suffix,$(d)/yoink) +ifeq (win32,$(platform)) +objects += $b/win32.o # Also compile win32 resource file. +endif -BINARIES := $(BINARIES) $(PROGRAM_$(d)) -CLEAN := $(CLEAN) $(OBJECTS_$(d)) $(D_FILES_$(d)) $(PROGRAM_$(d)) +ifeq (true,$(includeConfig)) +objects += $b/config.o # Also compile in the configuration. +exec += $b/config.c # Make config.c a build target. +$b/config.c: config.mk + $(Q)$(xxd) +endif -$(OBJECTS_$(d)): CF_TGT := -I$(d) -$(OBJECTS_$(d)): $(d)/rules.mk +$(objects): TGT_CFLAGS := -I$d +$(objects): config.h $(this) | $b +# Make all objects depend on config.h; it's excessive, but config.h won't +# be remade otherwise if dependencies are not being generated. The +# alternative is to maintain an accurate list of objects with a dependency +# on config.h. -$(PROGRAM_$(d)): $(OBJECTS_$(d)) $(d)/moof/libmoof.a $(d)/stlplus/libstlplus.a - $(DO_LDX) +exec += $(objects) # Make the objects build targets. +bindir_$b := $b/$(projectName)$(EXEEXT) # Install executable to bindir. +$(bindir_$b): $(objects) $b/moof/libmoof.a $b/stlplus/libstlplus.a + $(Q)$(link_cc) # # Define the run and debug targets. # -YOINK_ENVIRONMENT = YOINK_DATADIR="./data" - -.PHONY: run -run: $(PROGRAM_$(d)) - @$(YOINK_ENVIRONMENT) $< $(YOINK_OPTS) - -.PHONY: debug -debug: $(PROGRAM_$(d)) - @$(YOINK_ENVIRONMENT) gdb $< +run: $(bindir_$b) + $(Q)$< $(YOINKFLAGS) +debug: $(bindir_$b) + $(Q)gdb $< -######################## --include $(D_FILES_$(d)) -d := $(dirstack_$(sp)) -sp := $(basename $(sp)) -######################## +.PHONY: run debug diff --git a/src/stlplus/rules.mk b/src/stlplus/rules.mk index 380609d..e6d807b 100644 --- a/src/stlplus/rules.mk +++ b/src/stlplus/rules.mk @@ -1,31 +1,15 @@ -######################### -sp := $(sp).x -dirstack_$(sp) := $(d) -d := $(dir) -######################### - # # Define rules and targets for libstlplus. # -OBJECTS_$(d) := $(patsubst %.cpp,%.o,$(shell find $(d) -name "*.cpp")) -D_FILES_$(d) := $(OBJECTS_$(d):%=%.d) - -LIBRARY_$(d) := $(d)/libstlplus.a - -CLEAN := $(CLEAN) $(OBJECTS_$(d)) $(D_FILES_$(d)) $(LIBRARY_$(d)) - -$(OBJECTS_$(d)): CF_TGT := -I$(d) -I$(d)/containers -I$(d)/portability -$(OBJECTS_$(d)): $(d)/rules.mk - -$(LIBRARY_$(d)): $(OBJECTS_$(d)) - $(DO_AR) +objects = $(patsubst %.cpp,$(builddir)/%.o,$(shell find $d -name "*.cpp")) +$(objects): TGT_CFLAGS := -I$d -I$d/containers -I$d/portability +$(objects): config.mk $(this) | $b/containers $b/portability $b/strings +library = $b/libstlplus.a +$(library): $(objects) + $(Q)$(ar) -######################## --include $(D_FILES_$(d)) -d := $(dirstack_$(sp)) -sp := $(basename $(sp)) -######################## +exec += $(objects) $(library) diff --git a/src/yoink.rc b/src/win32.rc similarity index 100% rename from src/yoink.rc rename to src/win32.rc diff --git a/tools/compile.lua b/tools/compile.lua deleted file mode 100755 index 3dfff3c..0000000 --- a/tools/compile.lua +++ /dev/null @@ -1,78 +0,0 @@ -#!/usr/bin/env lua - --- --- Yoink --- This script wraps around the compiler command to handle the creation of --- dependency files. It works with GCC. The script is based off of Emile --- van Bergen's `ccdeps-gcc' script. --- - - --- Get the next argument passed to the script. -function shift() - var = arg[1] - table.remove(arg, 1) - arguments = string.format("%s %q", tostring(arguments), tostring(var)) - return var -end - - --- The compiler command is the first argument. -compiler = shift() -arguments = "" -paths = {} - - --- Consume each compiler argument, appending it to the arguments variable. -while 0 < #arg do - local v = shift() - if v == "-o" then - product = shift() - elseif v:match("%-[xubV]$") then - shift() -- Shift an extra one for the option's payload. - else - path = v:match("([^-].*)/") - if path then paths[path] = true end - end -end -if not product then print("No output file specified.") os.exit(1) end - - --- Now try the actual compile WITH dependency generation. -if os.execute(compiler.." -MD"..arguments) ~= 0 then - -- Try it without dependency generation. - if os.execute(compiler..arguments) ~= 0 then - print("The compile failed. :-(") - os.exit(1) - end - print("The compile succeeded without dependency generation.") - os.exit(0) -end - - --- Remove the old dependency file. -dep = product..".d" -os.remove(dep) - - --- GCC outputs file.d for a product named file.o, either in the current --- directory or in the directory where the source is. -depname = product:gsub("^.*/(.*)%.o$", "%1.d") -depfiles = {} -table.insert(depfiles, depname) -for path in pairs(paths) do table.insert(depfiles, path.."/"..depname) end - -for i,gccdep in ipairs(depfiles) do - tmpname = gccdep..".tmp" - -- Fix up the dependency file with correct paths. - if os.execute("test -f "..gccdep) == 0 and os.rename(gccdep, tmpname) then - os.execute(string.format("sed -e 's|.*:|%s %s:|' <%s >>%s", product, dep, tmpname, dep)) - os.execute(string.format("sed -e 's/^.*://' -e 's/^ *//' -e 's/ *\\\\$//' -e 's/$/:/' <%s >>%s", tmpname, dep)) - os.remove(tmpname) - os.exit() - end -end - -print("Couldn't find the dependency file.") -os.exit(1) - diff --git a/tools/config.guess b/tools/config.guess deleted file mode 100755 index 115f944..0000000 --- a/tools/config.guess +++ /dev/null @@ -1,1502 +0,0 @@ -#! /bin/sh -# Attempt to guess a canonical system name. -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 -# Free Software Foundation, Inc. - -timestamp='2010-04-03' - -# This file is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA -# 02110-1301, USA. -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - - -# Originally written by Per Bothner. Please send patches (context -# diff format) to and include a ChangeLog -# entry. -# -# This script attempts to guess a canonical system name similar to -# config.sub. If it succeeds, it prints the system name on stdout, and -# exits with 0. Otherwise, it exits with 1. -# -# You can get the latest version of this script from: -# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD - -me=`echo "$0" | sed -e 's,.*/,,'` - -usage="\ -Usage: $0 [OPTION] - -Output the configuration name of the system \`$me' is run on. - -Operation modes: - -h, --help print this help, then exit - -t, --time-stamp print date of last modification, then exit - -v, --version print version number, then exit - -Report bugs and patches to ." - -version="\ -GNU config.guess ($timestamp) - -Originally written by Per Bothner. -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, -2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free -Software Foundation, Inc. - -This is free software; see the source for copying conditions. There is NO -warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." - -help=" -Try \`$me --help' for more information." - -# Parse command line -while test $# -gt 0 ; do - case $1 in - --time-stamp | --time* | -t ) - echo "$timestamp" ; exit ;; - --version | -v ) - echo "$version" ; exit ;; - --help | --h* | -h ) - echo "$usage"; exit ;; - -- ) # Stop option processing - shift; break ;; - - ) # Use stdin as input. - break ;; - -* ) - echo "$me: invalid option $1$help" >&2 - exit 1 ;; - * ) - break ;; - esac -done - -if test $# != 0; then - echo "$me: too many arguments$help" >&2 - exit 1 -fi - -trap 'exit 1' HUP INT TERM - -# CC_FOR_BUILD -- compiler used by this script. Note that the use of a -# compiler to aid in system detection is discouraged as it requires -# temporary files to be created and, as you can see below, it is a -# headache to deal with in a portable fashion. - -# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still -# use `HOST_CC' if defined, but it is deprecated. - -# Portable tmp directory creation inspired by the Autoconf team. - -set_cc_for_build=' -trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; -trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" HUP INT PIPE TERM ; -: ${TMPDIR=/tmp} ; - { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || - { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || - { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || - { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; -dummy=$tmp/dummy ; -tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; -case $CC_FOR_BUILD,$HOST_CC,$CC in - ,,) echo "int x;" > $dummy.c ; - for c in cc gcc c89 c99 ; do - if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then - CC_FOR_BUILD="$c"; break ; - fi ; - done ; - if test x"$CC_FOR_BUILD" = x ; then - CC_FOR_BUILD=no_compiler_found ; - fi - ;; - ,,*) CC_FOR_BUILD=$CC ;; - ,*,*) CC_FOR_BUILD=$HOST_CC ;; -esac ; set_cc_for_build= ;' - -# This is needed to find uname on a Pyramid OSx when run in the BSD universe. -# (ghazi@noc.rutgers.edu 1994-08-24) -if (test -f /.attbin/uname) >/dev/null 2>&1 ; then - PATH=$PATH:/.attbin ; export PATH -fi - -UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown -UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown -UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown -UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown - -# Note: order is significant - the case branches are not exclusive. - -case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in - *:NetBSD:*:*) - # NetBSD (nbsd) targets should (where applicable) match one or - # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, - # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently - # switched to ELF, *-*-netbsd* would select the old - # object file format. This provides both forward - # compatibility and a consistent mechanism for selecting the - # object file format. - # - # Note: NetBSD doesn't particularly care about the vendor - # portion of the name. We always set it to "unknown". - sysctl="sysctl -n hw.machine_arch" - UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ - /usr/sbin/$sysctl 2>/dev/null || echo unknown)` - case "${UNAME_MACHINE_ARCH}" in - armeb) machine=armeb-unknown ;; - arm*) machine=arm-unknown ;; - sh3el) machine=shl-unknown ;; - sh3eb) machine=sh-unknown ;; - sh5el) machine=sh5le-unknown ;; - *) machine=${UNAME_MACHINE_ARCH}-unknown ;; - esac - # The Operating System including object format, if it has switched - # to ELF recently, or will in the future. - case "${UNAME_MACHINE_ARCH}" in - arm*|i386|m68k|ns32k|sh3*|sparc|vax) - eval $set_cc_for_build - if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ - | grep -q __ELF__ - then - # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). - # Return netbsd for either. FIX? - os=netbsd - else - os=netbsdelf - fi - ;; - *) - os=netbsd - ;; - esac - # The OS release - # Debian GNU/NetBSD machines have a different userland, and - # thus, need a distinct triplet. However, they do not need - # kernel version information, so it can be replaced with a - # suitable tag, in the style of linux-gnu. - case "${UNAME_VERSION}" in - Debian*) - release='-gnu' - ;; - *) - release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` - ;; - esac - # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: - # contains redundant information, the shorter form: - # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. - echo "${machine}-${os}${release}" - exit ;; - *:OpenBSD:*:*) - UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` - echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} - exit ;; - *:ekkoBSD:*:*) - echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} - exit ;; - *:SolidBSD:*:*) - echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} - exit ;; - macppc:MirBSD:*:*) - echo powerpc-unknown-mirbsd${UNAME_RELEASE} - exit ;; - *:MirBSD:*:*) - echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} - exit ;; - alpha:OSF1:*:*) - case $UNAME_RELEASE in - *4.0) - UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` - ;; - *5.*) - UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` - ;; - esac - # According to Compaq, /usr/sbin/psrinfo has been available on - # OSF/1 and Tru64 systems produced since 1995. I hope that - # covers most systems running today. This code pipes the CPU - # types through head -n 1, so we only detect the type of CPU 0. - ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` - case "$ALPHA_CPU_TYPE" in - "EV4 (21064)") - UNAME_MACHINE="alpha" ;; - "EV4.5 (21064)") - UNAME_MACHINE="alpha" ;; - "LCA4 (21066/21068)") - UNAME_MACHINE="alpha" ;; - "EV5 (21164)") - UNAME_MACHINE="alphaev5" ;; - "EV5.6 (21164A)") - UNAME_MACHINE="alphaev56" ;; - "EV5.6 (21164PC)") - UNAME_MACHINE="alphapca56" ;; - "EV5.7 (21164PC)") - UNAME_MACHINE="alphapca57" ;; - "EV6 (21264)") - UNAME_MACHINE="alphaev6" ;; - "EV6.7 (21264A)") - UNAME_MACHINE="alphaev67" ;; - "EV6.8CB (21264C)") - UNAME_MACHINE="alphaev68" ;; - "EV6.8AL (21264B)") - UNAME_MACHINE="alphaev68" ;; - "EV6.8CX (21264D)") - UNAME_MACHINE="alphaev68" ;; - "EV6.9A (21264/EV69A)") - UNAME_MACHINE="alphaev69" ;; - "EV7 (21364)") - UNAME_MACHINE="alphaev7" ;; - "EV7.9 (21364A)") - UNAME_MACHINE="alphaev79" ;; - esac - # A Pn.n version is a patched version. - # A Vn.n version is a released version. - # A Tn.n version is a released field test version. - # A Xn.n version is an unreleased experimental baselevel. - # 1.2 uses "1.2" for uname -r. - echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - exit ;; - Alpha\ *:Windows_NT*:*) - # How do we know it's Interix rather than the generic POSIX subsystem? - # Should we change UNAME_MACHINE based on the output of uname instead - # of the specific Alpha model? - echo alpha-pc-interix - exit ;; - 21064:Windows_NT:50:3) - echo alpha-dec-winnt3.5 - exit ;; - Amiga*:UNIX_System_V:4.0:*) - echo m68k-unknown-sysv4 - exit ;; - *:[Aa]miga[Oo][Ss]:*:*) - echo ${UNAME_MACHINE}-unknown-amigaos - exit ;; - *:[Mm]orph[Oo][Ss]:*:*) - echo ${UNAME_MACHINE}-unknown-morphos - exit ;; - *:OS/390:*:*) - echo i370-ibm-openedition - exit ;; - *:z/VM:*:*) - echo s390-ibm-zvmoe - exit ;; - *:OS400:*:*) - echo powerpc-ibm-os400 - exit ;; - arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) - echo arm-acorn-riscix${UNAME_RELEASE} - exit ;; - arm:riscos:*:*|arm:RISCOS:*:*) - echo arm-unknown-riscos - exit ;; - SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) - echo hppa1.1-hitachi-hiuxmpp - exit ;; - Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) - # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. - if test "`(/bin/universe) 2>/dev/null`" = att ; then - echo pyramid-pyramid-sysv3 - else - echo pyramid-pyramid-bsd - fi - exit ;; - NILE*:*:*:dcosx) - echo pyramid-pyramid-svr4 - exit ;; - DRS?6000:unix:4.0:6*) - echo sparc-icl-nx6 - exit ;; - DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) - case `/usr/bin/uname -p` in - sparc) echo sparc-icl-nx7; exit ;; - esac ;; - s390x:SunOS:*:*) - echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; - sun4H:SunOS:5.*:*) - echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; - sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) - echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; - i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) - echo i386-pc-auroraux${UNAME_RELEASE} - exit ;; - i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) - eval $set_cc_for_build - SUN_ARCH="i386" - # If there is a compiler, see if it is configured for 64-bit objects. - # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. - # This test works for both compilers. - if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then - if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ - (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ - grep IS_64BIT_ARCH >/dev/null - then - SUN_ARCH="x86_64" - fi - fi - echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; - sun4*:SunOS:6*:*) - # According to config.sub, this is the proper way to canonicalize - # SunOS6. Hard to guess exactly what SunOS6 will be like, but - # it's likely to be more like Solaris than SunOS4. - echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; - sun4*:SunOS:*:*) - case "`/usr/bin/arch -k`" in - Series*|S4*) - UNAME_RELEASE=`uname -v` - ;; - esac - # Japanese Language versions have a version number like `4.1.3-JL'. - echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` - exit ;; - sun3*:SunOS:*:*) - echo m68k-sun-sunos${UNAME_RELEASE} - exit ;; - sun*:*:4.2BSD:*) - UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` - test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 - case "`/bin/arch`" in - sun3) - echo m68k-sun-sunos${UNAME_RELEASE} - ;; - sun4) - echo sparc-sun-sunos${UNAME_RELEASE} - ;; - esac - exit ;; - aushp:SunOS:*:*) - echo sparc-auspex-sunos${UNAME_RELEASE} - exit ;; - # The situation for MiNT is a little confusing. The machine name - # can be virtually everything (everything which is not - # "atarist" or "atariste" at least should have a processor - # > m68000). The system name ranges from "MiNT" over "FreeMiNT" - # to the lowercase version "mint" (or "freemint"). Finally - # the system name "TOS" denotes a system which is actually not - # MiNT. But MiNT is downward compatible to TOS, so this should - # be no problem. - atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} - exit ;; - atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} - exit ;; - *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} - exit ;; - milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) - echo m68k-milan-mint${UNAME_RELEASE} - exit ;; - hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) - echo m68k-hades-mint${UNAME_RELEASE} - exit ;; - *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) - echo m68k-unknown-mint${UNAME_RELEASE} - exit ;; - m68k:machten:*:*) - echo m68k-apple-machten${UNAME_RELEASE} - exit ;; - powerpc:machten:*:*) - echo powerpc-apple-machten${UNAME_RELEASE} - exit ;; - RISC*:Mach:*:*) - echo mips-dec-mach_bsd4.3 - exit ;; - RISC*:ULTRIX:*:*) - echo mips-dec-ultrix${UNAME_RELEASE} - exit ;; - VAX*:ULTRIX*:*:*) - echo vax-dec-ultrix${UNAME_RELEASE} - exit ;; - 2020:CLIX:*:* | 2430:CLIX:*:*) - echo clipper-intergraph-clix${UNAME_RELEASE} - exit ;; - mips:*:*:UMIPS | mips:*:*:RISCos) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c -#ifdef __cplusplus -#include /* for printf() prototype */ - int main (int argc, char *argv[]) { -#else - int main (argc, argv) int argc; char *argv[]; { -#endif - #if defined (host_mips) && defined (MIPSEB) - #if defined (SYSTYPE_SYSV) - printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); - #endif - #if defined (SYSTYPE_SVR4) - printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); - #endif - #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) - printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); - #endif - #endif - exit (-1); - } -EOF - $CC_FOR_BUILD -o $dummy $dummy.c && - dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && - SYSTEM_NAME=`$dummy $dummyarg` && - { echo "$SYSTEM_NAME"; exit; } - echo mips-mips-riscos${UNAME_RELEASE} - exit ;; - Motorola:PowerMAX_OS:*:*) - echo powerpc-motorola-powermax - exit ;; - Motorola:*:4.3:PL8-*) - echo powerpc-harris-powermax - exit ;; - Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) - echo powerpc-harris-powermax - exit ;; - Night_Hawk:Power_UNIX:*:*) - echo powerpc-harris-powerunix - exit ;; - m88k:CX/UX:7*:*) - echo m88k-harris-cxux7 - exit ;; - m88k:*:4*:R4*) - echo m88k-motorola-sysv4 - exit ;; - m88k:*:3*:R3*) - echo m88k-motorola-sysv3 - exit ;; - AViiON:dgux:*:*) - # DG/UX returns AViiON for all architectures - UNAME_PROCESSOR=`/usr/bin/uname -p` - if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] - then - if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ - [ ${TARGET_BINARY_INTERFACE}x = x ] - then - echo m88k-dg-dgux${UNAME_RELEASE} - else - echo m88k-dg-dguxbcs${UNAME_RELEASE} - fi - else - echo i586-dg-dgux${UNAME_RELEASE} - fi - exit ;; - M88*:DolphinOS:*:*) # DolphinOS (SVR3) - echo m88k-dolphin-sysv3 - exit ;; - M88*:*:R3*:*) - # Delta 88k system running SVR3 - echo m88k-motorola-sysv3 - exit ;; - XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) - echo m88k-tektronix-sysv3 - exit ;; - Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) - echo m68k-tektronix-bsd - exit ;; - *:IRIX*:*:*) - echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` - exit ;; - ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. - echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id - exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' - i*86:AIX:*:*) - echo i386-ibm-aix - exit ;; - ia64:AIX:*:*) - if [ -x /usr/bin/oslevel ] ; then - IBM_REV=`/usr/bin/oslevel` - else - IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} - fi - echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} - exit ;; - *:AIX:2:3) - if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #include - - main() - { - if (!__power_pc()) - exit(1); - puts("powerpc-ibm-aix3.2.5"); - exit(0); - } -EOF - if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` - then - echo "$SYSTEM_NAME" - else - echo rs6000-ibm-aix3.2.5 - fi - elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then - echo rs6000-ibm-aix3.2.4 - else - echo rs6000-ibm-aix3.2 - fi - exit ;; - *:AIX:*:[456]) - IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` - if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then - IBM_ARCH=rs6000 - else - IBM_ARCH=powerpc - fi - if [ -x /usr/bin/oslevel ] ; then - IBM_REV=`/usr/bin/oslevel` - else - IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} - fi - echo ${IBM_ARCH}-ibm-aix${IBM_REV} - exit ;; - *:AIX:*:*) - echo rs6000-ibm-aix - exit ;; - ibmrt:4.4BSD:*|romp-ibm:BSD:*) - echo romp-ibm-bsd4.4 - exit ;; - ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and - echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to - exit ;; # report: romp-ibm BSD 4.3 - *:BOSX:*:*) - echo rs6000-bull-bosx - exit ;; - DPX/2?00:B.O.S.:*:*) - echo m68k-bull-sysv3 - exit ;; - 9000/[34]??:4.3bsd:1.*:*) - echo m68k-hp-bsd - exit ;; - hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) - echo m68k-hp-bsd4.4 - exit ;; - 9000/[34678]??:HP-UX:*:*) - HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` - case "${UNAME_MACHINE}" in - 9000/31? ) HP_ARCH=m68000 ;; - 9000/[34]?? ) HP_ARCH=m68k ;; - 9000/[678][0-9][0-9]) - if [ -x /usr/bin/getconf ]; then - sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` - sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` - case "${sc_cpu_version}" in - 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 - 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 - 532) # CPU_PA_RISC2_0 - case "${sc_kernel_bits}" in - 32) HP_ARCH="hppa2.0n" ;; - 64) HP_ARCH="hppa2.0w" ;; - '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 - esac ;; - esac - fi - if [ "${HP_ARCH}" = "" ]; then - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - - #define _HPUX_SOURCE - #include - #include - - int main () - { - #if defined(_SC_KERNEL_BITS) - long bits = sysconf(_SC_KERNEL_BITS); - #endif - long cpu = sysconf (_SC_CPU_VERSION); - - switch (cpu) - { - case CPU_PA_RISC1_0: puts ("hppa1.0"); break; - case CPU_PA_RISC1_1: puts ("hppa1.1"); break; - case CPU_PA_RISC2_0: - #if defined(_SC_KERNEL_BITS) - switch (bits) - { - case 64: puts ("hppa2.0w"); break; - case 32: puts ("hppa2.0n"); break; - default: puts ("hppa2.0"); break; - } break; - #else /* !defined(_SC_KERNEL_BITS) */ - puts ("hppa2.0"); break; - #endif - default: puts ("hppa1.0"); break; - } - exit (0); - } -EOF - (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` - test -z "$HP_ARCH" && HP_ARCH=hppa - fi ;; - esac - if [ ${HP_ARCH} = "hppa2.0w" ] - then - eval $set_cc_for_build - - # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating - # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler - # generating 64-bit code. GNU and HP use different nomenclature: - # - # $ CC_FOR_BUILD=cc ./config.guess - # => hppa2.0w-hp-hpux11.23 - # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess - # => hppa64-hp-hpux11.23 - - if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | - grep -q __LP64__ - then - HP_ARCH="hppa2.0w" - else - HP_ARCH="hppa64" - fi - fi - echo ${HP_ARCH}-hp-hpux${HPUX_REV} - exit ;; - ia64:HP-UX:*:*) - HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` - echo ia64-hp-hpux${HPUX_REV} - exit ;; - 3050*:HI-UX:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #include - int - main () - { - long cpu = sysconf (_SC_CPU_VERSION); - /* The order matters, because CPU_IS_HP_MC68K erroneously returns - true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct - results, however. */ - if (CPU_IS_PA_RISC (cpu)) - { - switch (cpu) - { - case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; - case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; - case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; - default: puts ("hppa-hitachi-hiuxwe2"); break; - } - } - else if (CPU_IS_HP_MC68K (cpu)) - puts ("m68k-hitachi-hiuxwe2"); - else puts ("unknown-hitachi-hiuxwe2"); - exit (0); - } -EOF - $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && - { echo "$SYSTEM_NAME"; exit; } - echo unknown-hitachi-hiuxwe2 - exit ;; - 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) - echo hppa1.1-hp-bsd - exit ;; - 9000/8??:4.3bsd:*:*) - echo hppa1.0-hp-bsd - exit ;; - *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) - echo hppa1.0-hp-mpeix - exit ;; - hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) - echo hppa1.1-hp-osf - exit ;; - hp8??:OSF1:*:*) - echo hppa1.0-hp-osf - exit ;; - i*86:OSF1:*:*) - if [ -x /usr/sbin/sysversion ] ; then - echo ${UNAME_MACHINE}-unknown-osf1mk - else - echo ${UNAME_MACHINE}-unknown-osf1 - fi - exit ;; - parisc*:Lites*:*:*) - echo hppa1.1-hp-lites - exit ;; - C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) - echo c1-convex-bsd - exit ;; - C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) - if getsysinfo -f scalar_acc - then echo c32-convex-bsd - else echo c2-convex-bsd - fi - exit ;; - C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) - echo c34-convex-bsd - exit ;; - C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) - echo c38-convex-bsd - exit ;; - C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) - echo c4-convex-bsd - exit ;; - CRAY*Y-MP:*:*:*) - echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; - CRAY*[A-Z]90:*:*:*) - echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ - | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ - -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ - -e 's/\.[^.]*$/.X/' - exit ;; - CRAY*TS:*:*:*) - echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; - CRAY*T3E:*:*:*) - echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; - CRAY*SV1:*:*:*) - echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; - *:UNICOS/mp:*:*) - echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; - F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) - FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` - echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" - exit ;; - 5000:UNIX_System_V:4.*:*) - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` - echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" - exit ;; - i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) - echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} - exit ;; - sparc*:BSD/OS:*:*) - echo sparc-unknown-bsdi${UNAME_RELEASE} - exit ;; - *:BSD/OS:*:*) - echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} - exit ;; - *:FreeBSD:*:*) - case ${UNAME_MACHINE} in - pc98) - echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; - amd64) - echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; - *) - echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; - esac - exit ;; - i*:CYGWIN*:*) - echo ${UNAME_MACHINE}-pc-cygwin - exit ;; - *:MINGW*:*) - echo ${UNAME_MACHINE}-pc-mingw32 - exit ;; - i*:windows32*:*) - # uname -m includes "-pc" on this system. - echo ${UNAME_MACHINE}-mingw32 - exit ;; - i*:PW*:*) - echo ${UNAME_MACHINE}-pc-pw32 - exit ;; - *:Interix*:*) - case ${UNAME_MACHINE} in - x86) - echo i586-pc-interix${UNAME_RELEASE} - exit ;; - authenticamd | genuineintel | EM64T) - echo x86_64-unknown-interix${UNAME_RELEASE} - exit ;; - IA64) - echo ia64-unknown-interix${UNAME_RELEASE} - exit ;; - esac ;; - [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) - echo i${UNAME_MACHINE}-pc-mks - exit ;; - 8664:Windows_NT:*) - echo x86_64-pc-mks - exit ;; - i*:Windows_NT*:* | Pentium*:Windows_NT*:*) - # How do we know it's Interix rather than the generic POSIX subsystem? - # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we - # UNAME_MACHINE based on the output of uname instead of i386? - echo i586-pc-interix - exit ;; - i*:UWIN*:*) - echo ${UNAME_MACHINE}-pc-uwin - exit ;; - amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) - echo x86_64-unknown-cygwin - exit ;; - p*:CYGWIN*:*) - echo powerpcle-unknown-cygwin - exit ;; - prep*:SunOS:5.*:*) - echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; - *:GNU:*:*) - # the GNU system - echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` - exit ;; - *:GNU/*:*:*) - # other systems with GNU libc and userland - echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu - exit ;; - i*86:Minix:*:*) - echo ${UNAME_MACHINE}-pc-minix - exit ;; - alpha:Linux:*:*) - case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in - EV5) UNAME_MACHINE=alphaev5 ;; - EV56) UNAME_MACHINE=alphaev56 ;; - PCA56) UNAME_MACHINE=alphapca56 ;; - PCA57) UNAME_MACHINE=alphapca56 ;; - EV6) UNAME_MACHINE=alphaev6 ;; - EV67) UNAME_MACHINE=alphaev67 ;; - EV68*) UNAME_MACHINE=alphaev68 ;; - esac - objdump --private-headers /bin/sh | grep -q ld.so.1 - if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi - echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} - exit ;; - arm*:Linux:*:*) - eval $set_cc_for_build - if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ - | grep -q __ARM_EABI__ - then - echo ${UNAME_MACHINE}-unknown-linux-gnu - else - echo ${UNAME_MACHINE}-unknown-linux-gnueabi - fi - exit ;; - avr32*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - cris:Linux:*:*) - echo cris-axis-linux-gnu - exit ;; - crisv32:Linux:*:*) - echo crisv32-axis-linux-gnu - exit ;; - frv:Linux:*:*) - echo frv-unknown-linux-gnu - exit ;; - i*86:Linux:*:*) - LIBC=gnu - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #ifdef __dietlibc__ - LIBC=dietlibc - #endif -EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` - echo "${UNAME_MACHINE}-pc-linux-${LIBC}" - exit ;; - ia64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - m32r*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - m68*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - mips:Linux:*:* | mips64:Linux:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #undef CPU - #undef ${UNAME_MACHINE} - #undef ${UNAME_MACHINE}el - #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) - CPU=${UNAME_MACHINE}el - #else - #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) - CPU=${UNAME_MACHINE} - #else - CPU= - #endif - #endif -EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` - test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } - ;; - or32:Linux:*:*) - echo or32-unknown-linux-gnu - exit ;; - padre:Linux:*:*) - echo sparc-unknown-linux-gnu - exit ;; - parisc64:Linux:*:* | hppa64:Linux:*:*) - echo hppa64-unknown-linux-gnu - exit ;; - parisc:Linux:*:* | hppa:Linux:*:*) - # Look for CPU level - case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in - PA7*) echo hppa1.1-unknown-linux-gnu ;; - PA8*) echo hppa2.0-unknown-linux-gnu ;; - *) echo hppa-unknown-linux-gnu ;; - esac - exit ;; - ppc64:Linux:*:*) - echo powerpc64-unknown-linux-gnu - exit ;; - ppc:Linux:*:*) - echo powerpc-unknown-linux-gnu - exit ;; - s390:Linux:*:* | s390x:Linux:*:*) - echo ${UNAME_MACHINE}-ibm-linux - exit ;; - sh64*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - sh*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - sparc:Linux:*:* | sparc64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - vax:Linux:*:*) - echo ${UNAME_MACHINE}-dec-linux-gnu - exit ;; - x86_64:Linux:*:*) - echo x86_64-unknown-linux-gnu - exit ;; - xtensa*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - i*86:DYNIX/ptx:4*:*) - # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. - # earlier versions are messed up and put the nodename in both - # sysname and nodename. - echo i386-sequent-sysv4 - exit ;; - i*86:UNIX_SV:4.2MP:2.*) - # Unixware is an offshoot of SVR4, but it has its own version - # number series starting with 2... - # I am not positive that other SVR4 systems won't match this, - # I just have to hope. -- rms. - # Use sysv4.2uw... so that sysv4* matches it. - echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} - exit ;; - i*86:OS/2:*:*) - # If we were able to find `uname', then EMX Unix compatibility - # is probably installed. - echo ${UNAME_MACHINE}-pc-os2-emx - exit ;; - i*86:XTS-300:*:STOP) - echo ${UNAME_MACHINE}-unknown-stop - exit ;; - i*86:atheos:*:*) - echo ${UNAME_MACHINE}-unknown-atheos - exit ;; - i*86:syllable:*:*) - echo ${UNAME_MACHINE}-pc-syllable - exit ;; - i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) - echo i386-unknown-lynxos${UNAME_RELEASE} - exit ;; - i*86:*DOS:*:*) - echo ${UNAME_MACHINE}-pc-msdosdjgpp - exit ;; - i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) - UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` - if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then - echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} - else - echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} - fi - exit ;; - i*86:*:5:[678]*) - # UnixWare 7.x, OpenUNIX and OpenServer 6. - case `/bin/uname -X | grep "^Machine"` in - *486*) UNAME_MACHINE=i486 ;; - *Pentium) UNAME_MACHINE=i586 ;; - *Pent*|*Celeron) UNAME_MACHINE=i686 ;; - esac - echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} - exit ;; - i*86:*:3.2:*) - if test -f /usr/options/cb.name; then - UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then - UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` - (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 - (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ - && UNAME_MACHINE=i586 - (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ - && UNAME_MACHINE=i686 - (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ - && UNAME_MACHINE=i686 - echo ${UNAME_MACHINE}-pc-sco$UNAME_REL - else - echo ${UNAME_MACHINE}-pc-sysv32 - fi - exit ;; - pc:*:*:*) - # Left here for compatibility: - # uname -m prints for DJGPP always 'pc', but it prints nothing about - # the processor, so we play safe by assuming i586. - # Note: whatever this is, it MUST be the same as what config.sub - # prints for the "djgpp" host, or else GDB configury will decide that - # this is a cross-build. - echo i586-pc-msdosdjgpp - exit ;; - Intel:Mach:3*:*) - echo i386-pc-mach3 - exit ;; - paragon:*:*:*) - echo i860-intel-osf1 - exit ;; - i860:*:4.*:*) # i860-SVR4 - if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then - echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 - else # Add other i860-SVR4 vendors below as they are discovered. - echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 - fi - exit ;; - mini*:CTIX:SYS*5:*) - # "miniframe" - echo m68010-convergent-sysv - exit ;; - mc68k:UNIX:SYSTEM5:3.51m) - echo m68k-convergent-sysv - exit ;; - M680?0:D-NIX:5.3:*) - echo m68k-diab-dnix - exit ;; - M68*:*:R3V[5678]*:*) - test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; - 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) - OS_REL='' - test -r /etc/.relid \ - && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` - /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4.3${OS_REL}; exit; } - /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ - && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; - 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) - /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4; exit; } ;; - NCR*:*:4.2:* | MPRAS*:*:4.2:*) - OS_REL='.3' - test -r /etc/.relid \ - && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` - /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4.3${OS_REL}; exit; } - /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ - && { echo i586-ncr-sysv4.3${OS_REL}; exit; } - /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ - && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; - m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) - echo m68k-unknown-lynxos${UNAME_RELEASE} - exit ;; - mc68030:UNIX_System_V:4.*:*) - echo m68k-atari-sysv4 - exit ;; - TSUNAMI:LynxOS:2.*:*) - echo sparc-unknown-lynxos${UNAME_RELEASE} - exit ;; - rs6000:LynxOS:2.*:*) - echo rs6000-unknown-lynxos${UNAME_RELEASE} - exit ;; - PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) - echo powerpc-unknown-lynxos${UNAME_RELEASE} - exit ;; - SM[BE]S:UNIX_SV:*:*) - echo mips-dde-sysv${UNAME_RELEASE} - exit ;; - RM*:ReliantUNIX-*:*:*) - echo mips-sni-sysv4 - exit ;; - RM*:SINIX-*:*:*) - echo mips-sni-sysv4 - exit ;; - *:SINIX-*:*:*) - if uname -p 2>/dev/null >/dev/null ; then - UNAME_MACHINE=`(uname -p) 2>/dev/null` - echo ${UNAME_MACHINE}-sni-sysv4 - else - echo ns32k-sni-sysv - fi - exit ;; - PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort - # says - echo i586-unisys-sysv4 - exit ;; - *:UNIX_System_V:4*:FTX*) - # From Gerald Hewes . - # How about differentiating between stratus architectures? -djm - echo hppa1.1-stratus-sysv4 - exit ;; - *:*:*:FTX*) - # From seanf@swdc.stratus.com. - echo i860-stratus-sysv4 - exit ;; - i*86:VOS:*:*) - # From Paul.Green@stratus.com. - echo ${UNAME_MACHINE}-stratus-vos - exit ;; - *:VOS:*:*) - # From Paul.Green@stratus.com. - echo hppa1.1-stratus-vos - exit ;; - mc68*:A/UX:*:*) - echo m68k-apple-aux${UNAME_RELEASE} - exit ;; - news*:NEWS-OS:6*:*) - echo mips-sony-newsos6 - exit ;; - R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) - if [ -d /usr/nec ]; then - echo mips-nec-sysv${UNAME_RELEASE} - else - echo mips-unknown-sysv${UNAME_RELEASE} - fi - exit ;; - BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. - echo powerpc-be-beos - exit ;; - BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. - echo powerpc-apple-beos - exit ;; - BePC:BeOS:*:*) # BeOS running on Intel PC compatible. - echo i586-pc-beos - exit ;; - BePC:Haiku:*:*) # Haiku running on Intel PC compatible. - echo i586-pc-haiku - exit ;; - SX-4:SUPER-UX:*:*) - echo sx4-nec-superux${UNAME_RELEASE} - exit ;; - SX-5:SUPER-UX:*:*) - echo sx5-nec-superux${UNAME_RELEASE} - exit ;; - SX-6:SUPER-UX:*:*) - echo sx6-nec-superux${UNAME_RELEASE} - exit ;; - SX-7:SUPER-UX:*:*) - echo sx7-nec-superux${UNAME_RELEASE} - exit ;; - SX-8:SUPER-UX:*:*) - echo sx8-nec-superux${UNAME_RELEASE} - exit ;; - SX-8R:SUPER-UX:*:*) - echo sx8r-nec-superux${UNAME_RELEASE} - exit ;; - Power*:Rhapsody:*:*) - echo powerpc-apple-rhapsody${UNAME_RELEASE} - exit ;; - *:Rhapsody:*:*) - echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} - exit ;; - *:Darwin:*:*) - UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown - case $UNAME_PROCESSOR in - i386) - eval $set_cc_for_build - if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then - if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ - (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ - grep IS_64BIT_ARCH >/dev/null - then - UNAME_PROCESSOR="x86_64" - fi - fi ;; - unknown) UNAME_PROCESSOR=powerpc ;; - esac - echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} - exit ;; - *:procnto*:*:* | *:QNX:[0123456789]*:*) - UNAME_PROCESSOR=`uname -p` - if test "$UNAME_PROCESSOR" = "x86"; then - UNAME_PROCESSOR=i386 - UNAME_MACHINE=pc - fi - echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} - exit ;; - *:QNX:*:4*) - echo i386-pc-qnx - exit ;; - NSE-?:NONSTOP_KERNEL:*:*) - echo nse-tandem-nsk${UNAME_RELEASE} - exit ;; - NSR-?:NONSTOP_KERNEL:*:*) - echo nsr-tandem-nsk${UNAME_RELEASE} - exit ;; - *:NonStop-UX:*:*) - echo mips-compaq-nonstopux - exit ;; - BS2000:POSIX*:*:*) - echo bs2000-siemens-sysv - exit ;; - DS/*:UNIX_System_V:*:*) - echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} - exit ;; - *:Plan9:*:*) - # "uname -m" is not consistent, so use $cputype instead. 386 - # is converted to i386 for consistency with other x86 - # operating systems. - if test "$cputype" = "386"; then - UNAME_MACHINE=i386 - else - UNAME_MACHINE="$cputype" - fi - echo ${UNAME_MACHINE}-unknown-plan9 - exit ;; - *:TOPS-10:*:*) - echo pdp10-unknown-tops10 - exit ;; - *:TENEX:*:*) - echo pdp10-unknown-tenex - exit ;; - KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) - echo pdp10-dec-tops20 - exit ;; - XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) - echo pdp10-xkl-tops20 - exit ;; - *:TOPS-20:*:*) - echo pdp10-unknown-tops20 - exit ;; - *:ITS:*:*) - echo pdp10-unknown-its - exit ;; - SEI:*:*:SEIUX) - echo mips-sei-seiux${UNAME_RELEASE} - exit ;; - *:DragonFly:*:*) - echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` - exit ;; - *:*VMS:*:*) - UNAME_MACHINE=`(uname -p) 2>/dev/null` - case "${UNAME_MACHINE}" in - A*) echo alpha-dec-vms ; exit ;; - I*) echo ia64-dec-vms ; exit ;; - V*) echo vax-dec-vms ; exit ;; - esac ;; - *:XENIX:*:SysV) - echo i386-pc-xenix - exit ;; - i*86:skyos:*:*) - echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' - exit ;; - i*86:rdos:*:*) - echo ${UNAME_MACHINE}-pc-rdos - exit ;; - i*86:AROS:*:*) - echo ${UNAME_MACHINE}-pc-aros - exit ;; -esac - -#echo '(No uname command or uname output not recognized.)' 1>&2 -#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 - -eval $set_cc_for_build -cat >$dummy.c < -# include -#endif -main () -{ -#if defined (sony) -#if defined (MIPSEB) - /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, - I don't know.... */ - printf ("mips-sony-bsd\n"); exit (0); -#else -#include - printf ("m68k-sony-newsos%s\n", -#ifdef NEWSOS4 - "4" -#else - "" -#endif - ); exit (0); -#endif -#endif - -#if defined (__arm) && defined (__acorn) && defined (__unix) - printf ("arm-acorn-riscix\n"); exit (0); -#endif - -#if defined (hp300) && !defined (hpux) - printf ("m68k-hp-bsd\n"); exit (0); -#endif - -#if defined (NeXT) -#if !defined (__ARCHITECTURE__) -#define __ARCHITECTURE__ "m68k" -#endif - int version; - version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; - if (version < 4) - printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); - else - printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); - exit (0); -#endif - -#if defined (MULTIMAX) || defined (n16) -#if defined (UMAXV) - printf ("ns32k-encore-sysv\n"); exit (0); -#else -#if defined (CMU) - printf ("ns32k-encore-mach\n"); exit (0); -#else - printf ("ns32k-encore-bsd\n"); exit (0); -#endif -#endif -#endif - -#if defined (__386BSD__) - printf ("i386-pc-bsd\n"); exit (0); -#endif - -#if defined (sequent) -#if defined (i386) - printf ("i386-sequent-dynix\n"); exit (0); -#endif -#if defined (ns32000) - printf ("ns32k-sequent-dynix\n"); exit (0); -#endif -#endif - -#if defined (_SEQUENT_) - struct utsname un; - - uname(&un); - - if (strncmp(un.version, "V2", 2) == 0) { - printf ("i386-sequent-ptx2\n"); exit (0); - } - if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ - printf ("i386-sequent-ptx1\n"); exit (0); - } - printf ("i386-sequent-ptx\n"); exit (0); - -#endif - -#if defined (vax) -# if !defined (ultrix) -# include -# if defined (BSD) -# if BSD == 43 - printf ("vax-dec-bsd4.3\n"); exit (0); -# else -# if BSD == 199006 - printf ("vax-dec-bsd4.3reno\n"); exit (0); -# else - printf ("vax-dec-bsd\n"); exit (0); -# endif -# endif -# else - printf ("vax-dec-bsd\n"); exit (0); -# endif -# else - printf ("vax-dec-ultrix\n"); exit (0); -# endif -#endif - -#if defined (alliant) && defined (i860) - printf ("i860-alliant-bsd\n"); exit (0); -#endif - - exit (1); -} -EOF - -$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && - { echo "$SYSTEM_NAME"; exit; } - -# Apollos put the system type in the environment. - -test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } - -# Convex versions that predate uname can use getsysinfo(1) - -if [ -x /usr/convex/getsysinfo ] -then - case `getsysinfo -f cpu_type` in - c1*) - echo c1-convex-bsd - exit ;; - c2*) - if getsysinfo -f scalar_acc - then echo c32-convex-bsd - else echo c2-convex-bsd - fi - exit ;; - c34*) - echo c34-convex-bsd - exit ;; - c38*) - echo c38-convex-bsd - exit ;; - c4*) - echo c4-convex-bsd - exit ;; - esac -fi - -cat >&2 < in order to provide the needed -information to handle your system. - -config.guess timestamp = $timestamp - -uname -m = `(uname -m) 2>/dev/null || echo unknown` -uname -r = `(uname -r) 2>/dev/null || echo unknown` -uname -s = `(uname -s) 2>/dev/null || echo unknown` -uname -v = `(uname -v) 2>/dev/null || echo unknown` - -/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` -/bin/uname -X = `(/bin/uname -X) 2>/dev/null` - -hostinfo = `(hostinfo) 2>/dev/null` -/bin/universe = `(/bin/universe) 2>/dev/null` -/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` -/bin/arch = `(/bin/arch) 2>/dev/null` -/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` -/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` - -UNAME_MACHINE = ${UNAME_MACHINE} -UNAME_RELEASE = ${UNAME_RELEASE} -UNAME_SYSTEM = ${UNAME_SYSTEM} -UNAME_VERSION = ${UNAME_VERSION} -EOF - -exit 1 - -# Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "timestamp='" -# time-stamp-format: "%:y-%02m-%02d" -# time-stamp-end: "'" -# End: diff --git a/tools/config.sub b/tools/config.sub deleted file mode 100755 index 204218c..0000000 --- a/tools/config.sub +++ /dev/null @@ -1,1731 +0,0 @@ -#! /bin/sh -# Configuration validation subroutine script. -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 -# Free Software Foundation, Inc. - -timestamp='2010-05-21' - -# This file is (in principle) common to ALL GNU software. -# The presence of a machine in this file suggests that SOME GNU software -# can handle that machine. It does not imply ALL GNU software can. -# -# This file is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA -# 02110-1301, USA. -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - - -# Please send patches to . Submit a context -# diff and a properly formatted GNU ChangeLog entry. -# -# Configuration subroutine to validate and canonicalize a configuration type. -# Supply the specified configuration type as an argument. -# If it is invalid, we print an error message on stderr and exit with code 1. -# Otherwise, we print the canonical config type on stdout and succeed. - -# You can get the latest version of this script from: -# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD - -# This file is supposed to be the same for all GNU packages -# and recognize all the CPU types, system types and aliases -# that are meaningful with *any* GNU software. -# Each package is responsible for reporting which valid configurations -# it does not support. The user should be able to distinguish -# a failure to support a valid configuration from a meaningless -# configuration. - -# The goal of this file is to map all the various variations of a given -# machine specification into a single specification in the form: -# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM -# or in some cases, the newer four-part form: -# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM -# It is wrong to echo any other type of specification. - -me=`echo "$0" | sed -e 's,.*/,,'` - -usage="\ -Usage: $0 [OPTION] CPU-MFR-OPSYS - $0 [OPTION] ALIAS - -Canonicalize a configuration name. - -Operation modes: - -h, --help print this help, then exit - -t, --time-stamp print date of last modification, then exit - -v, --version print version number, then exit - -Report bugs and patches to ." - -version="\ -GNU config.sub ($timestamp) - -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, -2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free -Software Foundation, Inc. - -This is free software; see the source for copying conditions. There is NO -warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." - -help=" -Try \`$me --help' for more information." - -# Parse command line -while test $# -gt 0 ; do - case $1 in - --time-stamp | --time* | -t ) - echo "$timestamp" ; exit ;; - --version | -v ) - echo "$version" ; exit ;; - --help | --h* | -h ) - echo "$usage"; exit ;; - -- ) # Stop option processing - shift; break ;; - - ) # Use stdin as input. - break ;; - -* ) - echo "$me: invalid option $1$help" - exit 1 ;; - - *local*) - # First pass through any local machine types. - echo $1 - exit ;; - - * ) - break ;; - esac -done - -case $# in - 0) echo "$me: missing argument$help" >&2 - exit 1;; - 1) ;; - *) echo "$me: too many arguments$help" >&2 - exit 1;; -esac - -# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). -# Here we must recognize all the valid KERNEL-OS combinations. -maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` -case $maybe_os in - nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ - linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ - knetbsd*-gnu* | netbsd*-gnu* | \ - kopensolaris*-gnu* | \ - storm-chaos* | os2-emx* | rtmk-nova*) - os=-$maybe_os - basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` - ;; - *) - basic_machine=`echo $1 | sed 's/-[^-]*$//'` - if [ $basic_machine != $1 ] - then os=`echo $1 | sed 's/.*-/-/'` - else os=; fi - ;; -esac - -### Let's recognize common machines as not being operating systems so -### that things like config.sub decstation-3100 work. We also -### recognize some manufacturers as not being operating systems, so we -### can provide default operating systems below. -case $os in - -sun*os*) - # Prevent following clause from handling this invalid input. - ;; - -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ - -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ - -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ - -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ - -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ - -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ - -apple | -axis | -knuth | -cray | -microblaze) - os= - basic_machine=$1 - ;; - -bluegene*) - os=-cnk - ;; - -sim | -cisco | -oki | -wec | -winbond) - os= - basic_machine=$1 - ;; - -scout) - ;; - -wrs) - os=-vxworks - basic_machine=$1 - ;; - -chorusos*) - os=-chorusos - basic_machine=$1 - ;; - -chorusrdb) - os=-chorusrdb - basic_machine=$1 - ;; - -hiux*) - os=-hiuxwe2 - ;; - -sco6) - os=-sco5v6 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco5) - os=-sco3.2v5 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco4) - os=-sco3.2v4 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco3.2.[4-9]*) - os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco3.2v[4-9]*) - # Don't forget version if it is 3.2v4 or newer. - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco5v6*) - # Don't forget version if it is 3.2v4 or newer. - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco*) - os=-sco3.2v2 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -udk*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -isc) - os=-isc2.2 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -clix*) - basic_machine=clipper-intergraph - ;; - -isc*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -lynx*) - os=-lynxos - ;; - -ptx*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` - ;; - -windowsnt*) - os=`echo $os | sed -e 's/windowsnt/winnt/'` - ;; - -psos*) - os=-psos - ;; - -mint | -mint[0-9]*) - basic_machine=m68k-atari - os=-mint - ;; -esac - -# Decode aliases for certain CPU-COMPANY combinations. -case $basic_machine in - # Recognize the basic CPU types without company name. - # Some are omitted here because they have special meanings below. - 1750a | 580 \ - | a29k \ - | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ - | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ - | am33_2.0 \ - | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ - | bfin \ - | c4x | clipper \ - | d10v | d30v | dlx | dsp16xx \ - | fido | fr30 | frv \ - | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ - | i370 | i860 | i960 | ia64 \ - | ip2k | iq2000 \ - | lm32 \ - | m32c | m32r | m32rle | m68000 | m68k | m88k \ - | maxq | mb | microblaze | mcore | mep | metag \ - | mips | mipsbe | mipseb | mipsel | mipsle \ - | mips16 \ - | mips64 | mips64el \ - | mips64octeon | mips64octeonel \ - | mips64orion | mips64orionel \ - | mips64r5900 | mips64r5900el \ - | mips64vr | mips64vrel \ - | mips64vr4100 | mips64vr4100el \ - | mips64vr4300 | mips64vr4300el \ - | mips64vr5000 | mips64vr5000el \ - | mips64vr5900 | mips64vr5900el \ - | mipsisa32 | mipsisa32el \ - | mipsisa32r2 | mipsisa32r2el \ - | mipsisa64 | mipsisa64el \ - | mipsisa64r2 | mipsisa64r2el \ - | mipsisa64sb1 | mipsisa64sb1el \ - | mipsisa64sr71k | mipsisa64sr71kel \ - | mipstx39 | mipstx39el \ - | mn10200 | mn10300 \ - | moxie \ - | mt \ - | msp430 \ - | nios | nios2 \ - | ns16k | ns32k \ - | or32 \ - | pdp10 | pdp11 | pj | pjl \ - | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ - | pyramid \ - | rx \ - | score \ - | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ - | sh64 | sh64le \ - | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ - | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ - | spu | strongarm \ - | tahoe | thumb | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ - | ubicom32 \ - | v850 | v850e \ - | we32k \ - | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \ - | z8k | z80) - basic_machine=$basic_machine-unknown - ;; - c54x) - basic_machine=tic54x-unknown - ;; - c55x) - basic_machine=tic55x-unknown - ;; - c6x) - basic_machine=tic6x-unknown - ;; - m6811 | m68hc11 | m6812 | m68hc12 | picochip) - # Motorola 68HC11/12. - basic_machine=$basic_machine-unknown - os=-none - ;; - m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) - ;; - ms1) - basic_machine=mt-unknown - ;; - - # We use `pc' rather than `unknown' - # because (1) that's what they normally are, and - # (2) the word "unknown" tends to confuse beginning users. - i*86 | x86_64) - basic_machine=$basic_machine-pc - ;; - # Object if more than one company name word. - *-*-*) - echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 - exit 1 - ;; - # Recognize the basic CPU types with company name. - 580-* \ - | a29k-* \ - | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ - | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ - | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ - | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ - | avr-* | avr32-* \ - | bfin-* | bs2000-* \ - | c[123]* | c30-* | [cjt]90-* | c4x-* \ - | clipper-* | craynv-* | cydra-* \ - | d10v-* | d30v-* | dlx-* \ - | elxsi-* \ - | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ - | h8300-* | h8500-* \ - | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ - | i*86-* | i860-* | i960-* | ia64-* \ - | ip2k-* | iq2000-* \ - | lm32-* \ - | m32c-* | m32r-* | m32rle-* \ - | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ - | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \ - | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ - | mips16-* \ - | mips64-* | mips64el-* \ - | mips64octeon-* | mips64octeonel-* \ - | mips64orion-* | mips64orionel-* \ - | mips64r5900-* | mips64r5900el-* \ - | mips64vr-* | mips64vrel-* \ - | mips64vr4100-* | mips64vr4100el-* \ - | mips64vr4300-* | mips64vr4300el-* \ - | mips64vr5000-* | mips64vr5000el-* \ - | mips64vr5900-* | mips64vr5900el-* \ - | mipsisa32-* | mipsisa32el-* \ - | mipsisa32r2-* | mipsisa32r2el-* \ - | mipsisa64-* | mipsisa64el-* \ - | mipsisa64r2-* | mipsisa64r2el-* \ - | mipsisa64sb1-* | mipsisa64sb1el-* \ - | mipsisa64sr71k-* | mipsisa64sr71kel-* \ - | mipstx39-* | mipstx39el-* \ - | mmix-* \ - | mt-* \ - | msp430-* \ - | nios-* | nios2-* \ - | none-* | np1-* | ns16k-* | ns32k-* \ - | orion-* \ - | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ - | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ - | pyramid-* \ - | romp-* | rs6000-* | rx-* \ - | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ - | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ - | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ - | sparclite-* \ - | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \ - | tahoe-* | thumb-* \ - | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ - | tile-* | tilegx-* \ - | tron-* \ - | ubicom32-* \ - | v850-* | v850e-* | vax-* \ - | we32k-* \ - | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \ - | xstormy16-* | xtensa*-* \ - | ymp-* \ - | z8k-* | z80-*) - ;; - # Recognize the basic CPU types without company name, with glob match. - xtensa*) - basic_machine=$basic_machine-unknown - ;; - # Recognize the various machine names and aliases which stand - # for a CPU type and a company and sometimes even an OS. - 386bsd) - basic_machine=i386-unknown - os=-bsd - ;; - 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) - basic_machine=m68000-att - ;; - 3b*) - basic_machine=we32k-att - ;; - a29khif) - basic_machine=a29k-amd - os=-udi - ;; - abacus) - basic_machine=abacus-unknown - ;; - adobe68k) - basic_machine=m68010-adobe - os=-scout - ;; - alliant | fx80) - basic_machine=fx80-alliant - ;; - altos | altos3068) - basic_machine=m68k-altos - ;; - am29k) - basic_machine=a29k-none - os=-bsd - ;; - amd64) - basic_machine=x86_64-pc - ;; - amd64-*) - basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - amdahl) - basic_machine=580-amdahl - os=-sysv - ;; - amiga | amiga-*) - basic_machine=m68k-unknown - ;; - amigaos | amigados) - basic_machine=m68k-unknown - os=-amigaos - ;; - amigaunix | amix) - basic_machine=m68k-unknown - os=-sysv4 - ;; - apollo68) - basic_machine=m68k-apollo - os=-sysv - ;; - apollo68bsd) - basic_machine=m68k-apollo - os=-bsd - ;; - aros) - basic_machine=i386-pc - os=-aros - ;; - aux) - basic_machine=m68k-apple - os=-aux - ;; - balance) - basic_machine=ns32k-sequent - os=-dynix - ;; - blackfin) - basic_machine=bfin-unknown - os=-linux - ;; - blackfin-*) - basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` - os=-linux - ;; - bluegene*) - basic_machine=powerpc-ibm - os=-cnk - ;; - c54x-*) - basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - c55x-*) - basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - c6x-*) - basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - c90) - basic_machine=c90-cray - os=-unicos - ;; - cegcc) - basic_machine=arm-unknown - os=-cegcc - ;; - convex-c1) - basic_machine=c1-convex - os=-bsd - ;; - convex-c2) - basic_machine=c2-convex - os=-bsd - ;; - convex-c32) - basic_machine=c32-convex - os=-bsd - ;; - convex-c34) - basic_machine=c34-convex - os=-bsd - ;; - convex-c38) - basic_machine=c38-convex - os=-bsd - ;; - cray | j90) - basic_machine=j90-cray - os=-unicos - ;; - craynv) - basic_machine=craynv-cray - os=-unicosmp - ;; - cr16) - basic_machine=cr16-unknown - os=-elf - ;; - crds | unos) - basic_machine=m68k-crds - ;; - crisv32 | crisv32-* | etraxfs*) - basic_machine=crisv32-axis - ;; - cris | cris-* | etrax*) - basic_machine=cris-axis - ;; - crx) - basic_machine=crx-unknown - os=-elf - ;; - da30 | da30-*) - basic_machine=m68k-da30 - ;; - decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) - basic_machine=mips-dec - ;; - decsystem10* | dec10*) - basic_machine=pdp10-dec - os=-tops10 - ;; - decsystem20* | dec20*) - basic_machine=pdp10-dec - os=-tops20 - ;; - delta | 3300 | motorola-3300 | motorola-delta \ - | 3300-motorola | delta-motorola) - basic_machine=m68k-motorola - ;; - delta88) - basic_machine=m88k-motorola - os=-sysv3 - ;; - dicos) - basic_machine=i686-pc - os=-dicos - ;; - djgpp) - basic_machine=i586-pc - os=-msdosdjgpp - ;; - dpx20 | dpx20-*) - basic_machine=rs6000-bull - os=-bosx - ;; - dpx2* | dpx2*-bull) - basic_machine=m68k-bull - os=-sysv3 - ;; - ebmon29k) - basic_machine=a29k-amd - os=-ebmon - ;; - elxsi) - basic_machine=elxsi-elxsi - os=-bsd - ;; - encore | umax | mmax) - basic_machine=ns32k-encore - ;; - es1800 | OSE68k | ose68k | ose | OSE) - basic_machine=m68k-ericsson - os=-ose - ;; - fx2800) - basic_machine=i860-alliant - ;; - genix) - basic_machine=ns32k-ns - ;; - gmicro) - basic_machine=tron-gmicro - os=-sysv - ;; - go32) - basic_machine=i386-pc - os=-go32 - ;; - h3050r* | hiux*) - basic_machine=hppa1.1-hitachi - os=-hiuxwe2 - ;; - h8300hms) - basic_machine=h8300-hitachi - os=-hms - ;; - h8300xray) - basic_machine=h8300-hitachi - os=-xray - ;; - h8500hms) - basic_machine=h8500-hitachi - os=-hms - ;; - harris) - basic_machine=m88k-harris - os=-sysv3 - ;; - hp300-*) - basic_machine=m68k-hp - ;; - hp300bsd) - basic_machine=m68k-hp - os=-bsd - ;; - hp300hpux) - basic_machine=m68k-hp - os=-hpux - ;; - hp3k9[0-9][0-9] | hp9[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hp9k2[0-9][0-9] | hp9k31[0-9]) - basic_machine=m68000-hp - ;; - hp9k3[2-9][0-9]) - basic_machine=m68k-hp - ;; - hp9k6[0-9][0-9] | hp6[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hp9k7[0-79][0-9] | hp7[0-79][0-9]) - basic_machine=hppa1.1-hp - ;; - hp9k78[0-9] | hp78[0-9]) - # FIXME: really hppa2.0-hp - basic_machine=hppa1.1-hp - ;; - hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) - # FIXME: really hppa2.0-hp - basic_machine=hppa1.1-hp - ;; - hp9k8[0-9][13679] | hp8[0-9][13679]) - basic_machine=hppa1.1-hp - ;; - hp9k8[0-9][0-9] | hp8[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hppa-next) - os=-nextstep3 - ;; - hppaosf) - basic_machine=hppa1.1-hp - os=-osf - ;; - hppro) - basic_machine=hppa1.1-hp - os=-proelf - ;; - i370-ibm* | ibm*) - basic_machine=i370-ibm - ;; -# I'm not sure what "Sysv32" means. Should this be sysv3.2? - i*86v32) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv32 - ;; - i*86v4*) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv4 - ;; - i*86v) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv - ;; - i*86sol2) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-solaris2 - ;; - i386mach) - basic_machine=i386-mach - os=-mach - ;; - i386-vsta | vsta) - basic_machine=i386-unknown - os=-vsta - ;; - iris | iris4d) - basic_machine=mips-sgi - case $os in - -irix*) - ;; - *) - os=-irix4 - ;; - esac - ;; - isi68 | isi) - basic_machine=m68k-isi - os=-sysv - ;; - m68knommu) - basic_machine=m68k-unknown - os=-linux - ;; - m68knommu-*) - basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` - os=-linux - ;; - m88k-omron*) - basic_machine=m88k-omron - ;; - magnum | m3230) - basic_machine=mips-mips - os=-sysv - ;; - merlin) - basic_machine=ns32k-utek - os=-sysv - ;; - microblaze) - basic_machine=microblaze-xilinx - ;; - mingw32) - basic_machine=i386-pc - os=-mingw32 - ;; - mingw32ce) - basic_machine=arm-unknown - os=-mingw32ce - ;; - miniframe) - basic_machine=m68000-convergent - ;; - *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) - basic_machine=m68k-atari - os=-mint - ;; - mips3*-*) - basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` - ;; - mips3*) - basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown - ;; - monitor) - basic_machine=m68k-rom68k - os=-coff - ;; - morphos) - basic_machine=powerpc-unknown - os=-morphos - ;; - msdos) - basic_machine=i386-pc - os=-msdos - ;; - ms1-*) - basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` - ;; - mvs) - basic_machine=i370-ibm - os=-mvs - ;; - ncr3000) - basic_machine=i486-ncr - os=-sysv4 - ;; - netbsd386) - basic_machine=i386-unknown - os=-netbsd - ;; - netwinder) - basic_machine=armv4l-rebel - os=-linux - ;; - news | news700 | news800 | news900) - basic_machine=m68k-sony - os=-newsos - ;; - news1000) - basic_machine=m68030-sony - os=-newsos - ;; - news-3600 | risc-news) - basic_machine=mips-sony - os=-newsos - ;; - necv70) - basic_machine=v70-nec - os=-sysv - ;; - next | m*-next ) - basic_machine=m68k-next - case $os in - -nextstep* ) - ;; - -ns2*) - os=-nextstep2 - ;; - *) - os=-nextstep3 - ;; - esac - ;; - nh3000) - basic_machine=m68k-harris - os=-cxux - ;; - nh[45]000) - basic_machine=m88k-harris - os=-cxux - ;; - nindy960) - basic_machine=i960-intel - os=-nindy - ;; - mon960) - basic_machine=i960-intel - os=-mon960 - ;; - nonstopux) - basic_machine=mips-compaq - os=-nonstopux - ;; - np1) - basic_machine=np1-gould - ;; - nsr-tandem) - basic_machine=nsr-tandem - ;; - op50n-* | op60c-*) - basic_machine=hppa1.1-oki - os=-proelf - ;; - openrisc | openrisc-*) - basic_machine=or32-unknown - ;; - os400) - basic_machine=powerpc-ibm - os=-os400 - ;; - OSE68000 | ose68000) - basic_machine=m68000-ericsson - os=-ose - ;; - os68k) - basic_machine=m68k-none - os=-os68k - ;; - pa-hitachi) - basic_machine=hppa1.1-hitachi - os=-hiuxwe2 - ;; - paragon) - basic_machine=i860-intel - os=-osf - ;; - parisc) - basic_machine=hppa-unknown - os=-linux - ;; - parisc-*) - basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` - os=-linux - ;; - pbd) - basic_machine=sparc-tti - ;; - pbb) - basic_machine=m68k-tti - ;; - pc532 | pc532-*) - basic_machine=ns32k-pc532 - ;; - pc98) - basic_machine=i386-pc - ;; - pc98-*) - basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentium | p5 | k5 | k6 | nexgen | viac3) - basic_machine=i586-pc - ;; - pentiumpro | p6 | 6x86 | athlon | athlon_*) - basic_machine=i686-pc - ;; - pentiumii | pentium2 | pentiumiii | pentium3) - basic_machine=i686-pc - ;; - pentium4) - basic_machine=i786-pc - ;; - pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) - basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentiumpro-* | p6-* | 6x86-* | athlon-*) - basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) - basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentium4-*) - basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pn) - basic_machine=pn-gould - ;; - power) basic_machine=power-ibm - ;; - ppc) basic_machine=powerpc-unknown - ;; - ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ppcle | powerpclittle | ppc-le | powerpc-little) - basic_machine=powerpcle-unknown - ;; - ppcle-* | powerpclittle-*) - basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ppc64) basic_machine=powerpc64-unknown - ;; - ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ppc64le | powerpc64little | ppc64-le | powerpc64-little) - basic_machine=powerpc64le-unknown - ;; - ppc64le-* | powerpc64little-*) - basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ps2) - basic_machine=i386-ibm - ;; - pw32) - basic_machine=i586-unknown - os=-pw32 - ;; - rdos) - basic_machine=i386-pc - os=-rdos - ;; - rom68k) - basic_machine=m68k-rom68k - os=-coff - ;; - rm[46]00) - basic_machine=mips-siemens - ;; - rtpc | rtpc-*) - basic_machine=romp-ibm - ;; - s390 | s390-*) - basic_machine=s390-ibm - ;; - s390x | s390x-*) - basic_machine=s390x-ibm - ;; - sa29200) - basic_machine=a29k-amd - os=-udi - ;; - sb1) - basic_machine=mipsisa64sb1-unknown - ;; - sb1el) - basic_machine=mipsisa64sb1el-unknown - ;; - sde) - basic_machine=mipsisa32-sde - os=-elf - ;; - sei) - basic_machine=mips-sei - os=-seiux - ;; - sequent) - basic_machine=i386-sequent - ;; - sh) - basic_machine=sh-hitachi - os=-hms - ;; - sh5el) - basic_machine=sh5le-unknown - ;; - sh64) - basic_machine=sh64-unknown - ;; - sparclite-wrs | simso-wrs) - basic_machine=sparclite-wrs - os=-vxworks - ;; - sps7) - basic_machine=m68k-bull - os=-sysv2 - ;; - spur) - basic_machine=spur-unknown - ;; - st2000) - basic_machine=m68k-tandem - ;; - stratus) - basic_machine=i860-stratus - os=-sysv4 - ;; - sun2) - basic_machine=m68000-sun - ;; - sun2os3) - basic_machine=m68000-sun - os=-sunos3 - ;; - sun2os4) - basic_machine=m68000-sun - os=-sunos4 - ;; - sun3os3) - basic_machine=m68k-sun - os=-sunos3 - ;; - sun3os4) - basic_machine=m68k-sun - os=-sunos4 - ;; - sun4os3) - basic_machine=sparc-sun - os=-sunos3 - ;; - sun4os4) - basic_machine=sparc-sun - os=-sunos4 - ;; - sun4sol2) - basic_machine=sparc-sun - os=-solaris2 - ;; - sun3 | sun3-*) - basic_machine=m68k-sun - ;; - sun4) - basic_machine=sparc-sun - ;; - sun386 | sun386i | roadrunner) - basic_machine=i386-sun - ;; - sv1) - basic_machine=sv1-cray - os=-unicos - ;; - symmetry) - basic_machine=i386-sequent - os=-dynix - ;; - t3e) - basic_machine=alphaev5-cray - os=-unicos - ;; - t90) - basic_machine=t90-cray - os=-unicos - ;; - # This must be matched before tile*. - tilegx*) - basic_machine=tilegx-unknown - os=-linux-gnu - ;; - tile*) - basic_machine=tile-unknown - os=-linux-gnu - ;; - tx39) - basic_machine=mipstx39-unknown - ;; - tx39el) - basic_machine=mipstx39el-unknown - ;; - toad1) - basic_machine=pdp10-xkl - os=-tops20 - ;; - tower | tower-32) - basic_machine=m68k-ncr - ;; - tpf) - basic_machine=s390x-ibm - os=-tpf - ;; - udi29k) - basic_machine=a29k-amd - os=-udi - ;; - ultra3) - basic_machine=a29k-nyu - os=-sym1 - ;; - v810 | necv810) - basic_machine=v810-nec - os=-none - ;; - vaxv) - basic_machine=vax-dec - os=-sysv - ;; - vms) - basic_machine=vax-dec - os=-vms - ;; - vpp*|vx|vx-*) - basic_machine=f301-fujitsu - ;; - vxworks960) - basic_machine=i960-wrs - os=-vxworks - ;; - vxworks68) - basic_machine=m68k-wrs - os=-vxworks - ;; - vxworks29k) - basic_machine=a29k-wrs - os=-vxworks - ;; - w65*) - basic_machine=w65-wdc - os=-none - ;; - w89k-*) - basic_machine=hppa1.1-winbond - os=-proelf - ;; - xbox) - basic_machine=i686-pc - os=-mingw32 - ;; - xps | xps100) - basic_machine=xps100-honeywell - ;; - ymp) - basic_machine=ymp-cray - os=-unicos - ;; - z8k-*-coff) - basic_machine=z8k-unknown - os=-sim - ;; - z80-*-coff) - basic_machine=z80-unknown - os=-sim - ;; - none) - basic_machine=none-none - os=-none - ;; - -# Here we handle the default manufacturer of certain CPU types. It is in -# some cases the only manufacturer, in others, it is the most popular. - w89k) - basic_machine=hppa1.1-winbond - ;; - op50n) - basic_machine=hppa1.1-oki - ;; - op60c) - basic_machine=hppa1.1-oki - ;; - romp) - basic_machine=romp-ibm - ;; - mmix) - basic_machine=mmix-knuth - ;; - rs6000) - basic_machine=rs6000-ibm - ;; - vax) - basic_machine=vax-dec - ;; - pdp10) - # there are many clones, so DEC is not a safe bet - basic_machine=pdp10-unknown - ;; - pdp11) - basic_machine=pdp11-dec - ;; - we32k) - basic_machine=we32k-att - ;; - sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) - basic_machine=sh-unknown - ;; - sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) - basic_machine=sparc-sun - ;; - cydra) - basic_machine=cydra-cydrome - ;; - orion) - basic_machine=orion-highlevel - ;; - orion105) - basic_machine=clipper-highlevel - ;; - mac | mpw | mac-mpw) - basic_machine=m68k-apple - ;; - pmac | pmac-mpw) - basic_machine=powerpc-apple - ;; - *-unknown) - # Make sure to match an already-canonicalized machine name. - ;; - *) - echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 - exit 1 - ;; -esac - -# Here we canonicalize certain aliases for manufacturers. -case $basic_machine in - *-digital*) - basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` - ;; - *-commodore*) - basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` - ;; - *) - ;; -esac - -# Decode manufacturer-specific aliases for certain operating systems. - -if [ x"$os" != x"" ] -then -case $os in - # First match some system type aliases - # that might get confused with valid system types. - # -solaris* is a basic system type, with this one exception. - -auroraux) - os=-auroraux - ;; - -solaris1 | -solaris1.*) - os=`echo $os | sed -e 's|solaris1|sunos4|'` - ;; - -solaris) - os=-solaris2 - ;; - -svr4*) - os=-sysv4 - ;; - -unixware*) - os=-sysv4.2uw - ;; - -gnu/linux*) - os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` - ;; - # First accept the basic system types. - # The portable systems comes first. - # Each alternative MUST END IN A *, to match a version number. - # -sysv* is not here because it comes later, after sysvr4. - -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ - | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ - | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ - | -sym* | -kopensolaris* \ - | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ - | -aos* | -aros* \ - | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ - | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ - | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ - | -openbsd* | -solidbsd* \ - | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ - | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ - | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ - | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ - | -chorusos* | -chorusrdb* | -cegcc* \ - | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ - | -mingw32* | -linux-gnu* | -linux-android* \ - | -linux-newlib* | -linux-uclibc* \ - | -uxpv* | -beos* | -mpeix* | -udk* \ - | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ - | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ - | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ - | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ - | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ - | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ - | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*) - # Remember, each alternative MUST END IN *, to match a version number. - ;; - -qnx*) - case $basic_machine in - x86-* | i*86-*) - ;; - *) - os=-nto$os - ;; - esac - ;; - -nto-qnx*) - ;; - -nto*) - os=`echo $os | sed -e 's|nto|nto-qnx|'` - ;; - -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ - | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ - | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) - ;; - -mac*) - os=`echo $os | sed -e 's|mac|macos|'` - ;; - -linux-dietlibc) - os=-linux-dietlibc - ;; - -linux*) - os=`echo $os | sed -e 's|linux|linux-gnu|'` - ;; - -sunos5*) - os=`echo $os | sed -e 's|sunos5|solaris2|'` - ;; - -sunos6*) - os=`echo $os | sed -e 's|sunos6|solaris3|'` - ;; - -opened*) - os=-openedition - ;; - -os400*) - os=-os400 - ;; - -wince*) - os=-wince - ;; - -osfrose*) - os=-osfrose - ;; - -osf*) - os=-osf - ;; - -utek*) - os=-bsd - ;; - -dynix*) - os=-bsd - ;; - -acis*) - os=-aos - ;; - -atheos*) - os=-atheos - ;; - -syllable*) - os=-syllable - ;; - -386bsd) - os=-bsd - ;; - -ctix* | -uts*) - os=-sysv - ;; - -nova*) - os=-rtmk-nova - ;; - -ns2 ) - os=-nextstep2 - ;; - -nsk*) - os=-nsk - ;; - # Preserve the version number of sinix5. - -sinix5.*) - os=`echo $os | sed -e 's|sinix|sysv|'` - ;; - -sinix*) - os=-sysv4 - ;; - -tpf*) - os=-tpf - ;; - -triton*) - os=-sysv3 - ;; - -oss*) - os=-sysv3 - ;; - -svr4) - os=-sysv4 - ;; - -svr3) - os=-sysv3 - ;; - -sysvr4) - os=-sysv4 - ;; - # This must come after -sysvr4. - -sysv*) - ;; - -ose*) - os=-ose - ;; - -es1800*) - os=-ose - ;; - -xenix) - os=-xenix - ;; - -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) - os=-mint - ;; - -aros*) - os=-aros - ;; - -kaos*) - os=-kaos - ;; - -zvmoe) - os=-zvmoe - ;; - -dicos*) - os=-dicos - ;; - -nacl*) - ;; - -none) - ;; - *) - # Get rid of the `-' at the beginning of $os. - os=`echo $os | sed 's/[^-]*-//'` - echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 - exit 1 - ;; -esac -else - -# Here we handle the default operating systems that come with various machines. -# The value should be what the vendor currently ships out the door with their -# machine or put another way, the most popular os provided with the machine. - -# Note that if you're going to try to match "-MANUFACTURER" here (say, -# "-sun"), then you have to tell the case statement up towards the top -# that MANUFACTURER isn't an operating system. Otherwise, code above -# will signal an error saying that MANUFACTURER isn't an operating -# system, and we'll never get to this point. - -case $basic_machine in - score-*) - os=-elf - ;; - spu-*) - os=-elf - ;; - *-acorn) - os=-riscix1.2 - ;; - arm*-rebel) - os=-linux - ;; - arm*-semi) - os=-aout - ;; - c4x-* | tic4x-*) - os=-coff - ;; - tic54x-*) - os=-coff - ;; - tic55x-*) - os=-coff - ;; - tic6x-*) - os=-coff - ;; - # This must come before the *-dec entry. - pdp10-*) - os=-tops20 - ;; - pdp11-*) - os=-none - ;; - *-dec | vax-*) - os=-ultrix4.2 - ;; - m68*-apollo) - os=-domain - ;; - i386-sun) - os=-sunos4.0.2 - ;; - m68000-sun) - os=-sunos3 - # This also exists in the configure program, but was not the - # default. - # os=-sunos4 - ;; - m68*-cisco) - os=-aout - ;; - mep-*) - os=-elf - ;; - mips*-cisco) - os=-elf - ;; - mips*-*) - os=-elf - ;; - or32-*) - os=-coff - ;; - *-tti) # must be before sparc entry or we get the wrong os. - os=-sysv3 - ;; - sparc-* | *-sun) - os=-sunos4.1.1 - ;; - *-be) - os=-beos - ;; - *-haiku) - os=-haiku - ;; - *-ibm) - os=-aix - ;; - *-knuth) - os=-mmixware - ;; - *-wec) - os=-proelf - ;; - *-winbond) - os=-proelf - ;; - *-oki) - os=-proelf - ;; - *-hp) - os=-hpux - ;; - *-hitachi) - os=-hiux - ;; - i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) - os=-sysv - ;; - *-cbm) - os=-amigaos - ;; - *-dg) - os=-dgux - ;; - *-dolphin) - os=-sysv3 - ;; - m68k-ccur) - os=-rtu - ;; - m88k-omron*) - os=-luna - ;; - *-next ) - os=-nextstep - ;; - *-sequent) - os=-ptx - ;; - *-crds) - os=-unos - ;; - *-ns) - os=-genix - ;; - i370-*) - os=-mvs - ;; - *-next) - os=-nextstep3 - ;; - *-gould) - os=-sysv - ;; - *-highlevel) - os=-bsd - ;; - *-encore) - os=-bsd - ;; - *-sgi) - os=-irix - ;; - *-siemens) - os=-sysv4 - ;; - *-masscomp) - os=-rtu - ;; - f30[01]-fujitsu | f700-fujitsu) - os=-uxpv - ;; - *-rom68k) - os=-coff - ;; - *-*bug) - os=-coff - ;; - *-apple) - os=-macos - ;; - *-atari*) - os=-mint - ;; - *) - os=-none - ;; -esac -fi - -# Here we handle the case where we know the os, and the CPU type, but not the -# manufacturer. We pick the logical manufacturer. -vendor=unknown -case $basic_machine in - *-unknown) - case $os in - -riscix*) - vendor=acorn - ;; - -sunos*) - vendor=sun - ;; - -cnk*|-aix*) - vendor=ibm - ;; - -beos*) - vendor=be - ;; - -hpux*) - vendor=hp - ;; - -mpeix*) - vendor=hp - ;; - -hiux*) - vendor=hitachi - ;; - -unos*) - vendor=crds - ;; - -dgux*) - vendor=dg - ;; - -luna*) - vendor=omron - ;; - -genix*) - vendor=ns - ;; - -mvs* | -opened*) - vendor=ibm - ;; - -os400*) - vendor=ibm - ;; - -ptx*) - vendor=sequent - ;; - -tpf*) - vendor=ibm - ;; - -vxsim* | -vxworks* | -windiss*) - vendor=wrs - ;; - -aux*) - vendor=apple - ;; - -hms*) - vendor=hitachi - ;; - -mpw* | -macos*) - vendor=apple - ;; - -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) - vendor=atari - ;; - -vos*) - vendor=stratus - ;; - esac - basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` - ;; -esac - -echo $basic_machine$os -exit - -# Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "timestamp='" -# time-stamp-format: "%:y-%02m-%02d" -# time-stamp-end: "'" -# End: diff --git a/tools/install.lua b/tools/install.lua deleted file mode 100755 index 89f60cd..0000000 --- a/tools/install.lua +++ /dev/null @@ -1,109 +0,0 @@ -#!/usr/bin/env lua - --- --- Yoink --- This script is a predictable alternative to the system install program. --- - -function show_help() - print([[ - -Install files, optionally changing the mode of the installed files. -Usage: - install.lua [-m MODE] SOURCE... DEST - -If DEST is a directory, the source(s) will be copied into DEST with their -same names. -]]) -end - - --- Get the next argument passed to the script. -function shift() - var = arg[1] - table.remove(arg, 1) - return var -end - --- Execute a command and return its output or nil if the command failed to --- run. -function backtick_run(command) - local fd = io.popen(command.." 2>/dev/null") - if fd then local stdout = fd:read("*l") fd:close() return stdout end - return nil -end - --- Return true if a filespec is a directory, false otherwise. -function is_directory(path) - return os.execute(string.format("test -d %q", path)) == 0 -end - --- Get the basename of a path. -function basename(path, ext) - if not ext then ext = "" end - return backtick_run(string.format("basename %q %s", path, ext)) -end - --- Get the directory part of a path. -function dirname(path) - if path:sub(-1) == "/" then path = path .. "." end - return backtick_run(string.format("dirname %q", path)) -end - --- Like mkdir -p except portable. -function mkdir(path) - if path:sub(1,1) ~= "/" then path = os.getenv("PWD") .. "/" .. path end - path = path:gsub("/$", "") - path = path:gsub("/+", "/") - path = path:gsub("/[^/]+/%.%.", "") - path = path:gsub("%./", "") - path = path:gsub("/%.", "") - - local compound = "" - for component in path:gmatch("(/[^/]*)") do - compound = compound .. component - if not is_directory(compound) then - local result = os.execute(string.format("mkdir %q", compound)) - if result ~= 0 then os.exit(1) end - end - end -end - --- Change the mode of a file or directory. -function chmod(mode, filespec) - if not mode or mode == "" then return end - local result = os.execute(string.format("chmod %s %q", mode, filespec)) - if result ~= 0 then os.exit(1) end -end - --- Install a file. If destination is a directory, the source will be --- installed into the directory with the same name. -function install(mode, source, dest) - if is_directory(dest) then dest = dest .. "/" .. basename(source) end - local result = os.execute(string.format("cp %q %q", source, dest)) - if result == 0 then chmod(mode, dest) else os.exit(1) end -end - - -files = {} - --- Consume and parse each argument. -while 0 < #arg do - local v = shift() - if v == "-h" or v == "--help" then show_help() os.exit(0) end - if v == "-m" then mode = shift() else table.insert(files, v) end -end - --- Check the arguments and determine the target. -if #files < 2 then show_help() os.exit(1) -else target = table.remove(files) end - --- Perform the installation. -if 1 < #files then - mkdir(target) - for i,file in ipairs(files) do install(mode, file, target) end -else - mkdir(dirname(target)) - install(mode, files[1], target) -end - diff --git a/tools/link.lua b/tools/link.lua deleted file mode 100755 index d0eed0c..0000000 --- a/tools/link.lua +++ /dev/null @@ -1,83 +0,0 @@ -#!/usr/bin/env lua - --- --- Yoink --- Run this script to link the executable with fewer direct dependencies. --- --- You shouldn't call this directly; instead, use the configure script's --- --enable-asneeded option and run make normally. This isn't enabled by --- default because there is the potential for runtime linking problems on --- some platforms. If you have a newer version of GCC, you should prefer --- the --as-needed linker flag over this method, though they both should --- accomplish the same thing. --- - - --- List here any libraries that are known to not be needed on some --- platform. -libraries = { - "atk-1.0", - "cairo", - "fontconfig", - "freetype", - "gdk-x11-2.0", - "gio-2.0", - "glib-2.0", - "gmodule-2.0", - "ogg", - "pango-1.0", - "pangocairo-1.0", - "pangoft2-1.0", - "pthread", - "vorbis" -} - - --- We want to print only if verbose is set to true. -do - local verbose = os.getenv("verbose") == "true" - local oldprint = print - - print = function(...) if verbose then oldprint(unpack(arg)) end end -end - - -command = arg[1] -removed = {} - --- Get the link command as passed on the command-line. -for i,arg in ipairs(arg) do - if i ~= 1 then - command = string.format("%s %q", command, arg) - end -end - -original = command - - --- Check for libraries which aren't needed for successful linking. -for i,library in ipairs(libraries) do - local new_command = command:gsub("%s\"%-l"..library.."+\"%s", " ") - if new_command ~= command then - if os.execute(new_command.." >/dev/null 2>&1") == 0 then - print("We DON'T need "..library) - table.insert(removed, library) - command = new_command - else - print("We DO need "..library) - end - end -end - - --- Perform the final link. -if 0 < #removed and os.execute(command.." >/dev/null 2>&1") == 0 then - local removed = table.concat(removed, ", ") - print("Linked fine without some libraries: "..removed) -elseif os.execute(original.." >/dev/null 2>&1") == 0 then - print("Linked with the original link command.") -else - print("The link failed. :-(") - os.exit(1) -end -